2 /********************************************************************************
3 * install.d/format.inc.php : HTML output subroutines
4 * --------------------------
6 * This file is part of the banana distribution
7 * Copyright: See COPYING files that comes with this distribution
8 ********************************************************************************/
10 /** produces HTML ouput for header section in post.php
11 * @param $_header STRING name of the header
12 * @param $_text STRING value of the header
13 * @param $_spool OBJECT spool object for building references
14 * @return STRING HTML output
17 function formatDisplayHeader($_header,$_text,$_spool) {
21 return locale_date($_text);
26 $groups = preg_split("/(\t| )*,(\t| )*/",$_text);
27 foreach ($groups as $g) {
28 $res.='<a href="thread.php?group='.$g.'">'.$g.'</a>, ';
30 return substr($res,0, -2);
33 return formatFrom($_text);
38 $text=str_replace("><","> <",$_text);
39 $text=preg_split("/( |\t)/",strtr($text,$_spool->ids
));
40 $parents=preg_grep("/^\d+$/",$text);
41 $p=array_pop($parents);
43 $rsl .= "<a href=\"article.php?group={$_spool->group}"
44 ."&id=$p\">$ndx</a> ";
45 $_spool->overview
[$p]->desc++
;
46 $p = $_spool->overview
[$p]->parent
;
52 return '<img src="xface.php?face='.base64_encode($_text)
56 return htmlentities($_text);
61 * @return STRING HTML output
63 function displayshortcuts() {
64 global $news,$locale,$first,$spool,$group,$post,$id;
65 $sname = basename($_SERVER['SCRIPT_NAME']);
67 echo '<div class="shortcuts">';
68 echo '[<a href="disconnect.php">'.$locale['format']['disconnection']
73 echo '[<a href="index.php">'.$locale['format']['grouplist'].'</a>] ';
74 echo "[<a href=\"post.php?group=$group\">".$locale['format']['newpost']."</a>] ";
75 if (sizeof($spool->overview
)>$news['max']) {
76 for ($ndx=1; $ndx<=sizeof($spool->overview
); $ndx +
= $news['max']) {
78 echo "[$ndx-".min($ndx+
$news['max']-1,sizeof($spool->overview
))."] ";
80 echo "[<a href=\"".$_SERVER['PHP_SELF']."?group=$group&first="
81 ."$ndx\">$ndx-".min($ndx+
$news['max']-1,sizeof($spool->overview
))
88 echo '[<a href="index.php">'.$locale['format']['grouplist'].'</a>] ';
89 echo "[<a href=\"thread.php?group=$group\">"
90 .$locale['format']['group_b'].$group
91 .$locale['format']['group_a']."</a>] ";
92 echo "[<a href=\"post.php?group=$group&id=$id&type=followup\">"
93 .$locale['format']['followup']."</a>] ";
94 if (checkcancel($post->headers
)) {
95 echo "[<a href=\"article.php?group=$group&id=$id&type=cancel\">"
96 .$locale['format']['cancel']."</a>] ";
100 echo '[<a href="index.php">'.$locale['format']['grouplist'].'</a>] ';
101 echo "[<a href=\"thread.php?group=$group\">"
102 .$locale['format']['group_b'].$group
103 .$locale['format']['group_a']."</a>] ";