From: Pierre Habouzit (MadCoder Date: Sun, 2 Jan 2005 13:50:39 +0000 (+0000) Subject: updates X-Git-Tag: xorg/old~544 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=cc04be9090aa677b54149e2b69634bfa66b365a9;p=platal.git updates git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-204 --- diff --git a/htdocs/banana/banana.css b/htdocs/banana/banana.css index 57e1294..2af59a5 100644 --- a/htdocs/banana/banana.css +++ b/htdocs/banana/banana.css @@ -23,6 +23,8 @@ table.bicol td.bouton { * FORUMS * *******************************************/ +.new { font-weight: bold; } + div.bananashortcuts { text-align: left; padding-bottom: 1em; diff --git a/htdocs/banana/include/format.inc.php b/htdocs/banana/include/format.inc.php index 88cf935..dbc7aa1 100644 --- a/htdocs/banana/include/format.inc.php +++ b/htdocs/banana/include/format.inc.php @@ -13,62 +13,13 @@ function url($string) return $string; $chemins = Array('', '../', '../../'); foreach ($chemins as $ch) { - if (file_exists($ch.'../htdocs/')) { - return $ch.$string; - } + if (file_exists($ch.'../htdocs/')) { + return $ch.$string; + } } return ''; } -/** produces HTML output for overview - * @param $_header STRING name of the header - * @param $_text STRING value of the header - * @param $_id INTEGER MSGNUM of message - * @param $_group TEXT name of newsgroup - * @param $_isref BOOLEAN emphasizes message in overview tree ? - * @param $_isread BOOLEAN displays message as read ? - * @return STRING HTML output - * @see disp_desc - */ - -function formatSpoolHeader($_header,$_text,$_id,$_group,$_isref,$_isread=true) { - global $locale; - switch ($_header) { - case "date": - return locale_header_date($_text); - case "from": -# From: mark@cbosgd.ATT.COM -# From: mark@cbosgd.ATT.COM (Mark Horton) -# From: Mark Horton - $result = htmlentities($_text); - if (preg_match("/^([^ ]+)@([^ ]+)$/",$_text,$regs)) - $result="".htmlentities($regs[1]. - "@".$regs[2]).""; - if (preg_match("/^([^ ]+)@([^ ]+) \((.*)\)$/",$_text,$regs)) - $result="".htmlentities($regs[3]).""; - if (preg_match("/^\"?([^<>\"]+)\"? +<(.+)@(.+)>$/",$_text,$regs)) - $result="".htmlentities($regs[1]).""; - return preg_replace("/\\\(\(|\))/","\\1",$result); - case "subject": - if ($_isref) { - return ''.htmlentities($_text).''; - } else { - if ($_isread) { - return "" - .htmlentities($_text).""; - }else { - return "" - .htmlentities($_text).""; - } - } - default: - return htmlentities($_text); - } -} - /** produces HTML ouput for header section in post.php * @param $_header STRING name of the header * @param $_text STRING value of the header @@ -77,84 +28,50 @@ function formatSpoolHeader($_header,$_text,$_id,$_group,$_isref,$_isread=true) { */ function formatDisplayHeader($_header,$_text,$_spool) { - global $locale; - switch ($_header) { - case "date": - return locale_date($_text); - case "followup": - case "newsgroups": - $res = ""; - $groups = preg_split("/(\t| )*,(\t| )*/",$_text); - foreach ($groups as $g) { - $res.=''.$g.', '; - } - return substr($res,0, -2); - case "from": -# From: mark@cbosgd.ATT.COM -# From: mark@cbosgd.ATT.COM (Mark Horton) -# From: Mark Horton -# From: Anonymous - $result = htmlentities($_text); - if (preg_match("/^([^ ]+)@([^ ]+)$/",$_text,$regs)) - $result="".htmlentities($regs[1]) - ."@{$regs[2]}"; - if (preg_match("/^([^ ]+)@([^ ]+) \((.*)\)$/",$_text,$regs)) - $result="".htmlentities($regs[3]) - .""; - if (preg_match("/^\"?([^<>\"]+)\"? +<(.+)@(.+)>$/",$_text,$regs)) - $result="".htmlentities($regs[1]) - .""; - return preg_replace("/\\\(\(|\))/","\\1",$result); - case "references": - $rsl = ""; - $ndx = 1; - $text=str_replace("><","> <",$_text); - $text=preg_split("/( |\t)/",strtr($text,$_spool->ids)); - $parents=preg_grep("/^\d+$/",$text); - $p=array_pop($parents); - $valid_parents = Array(); - while ($p) { - $valid_parents[]=$p; - $p = $_spool->overview[$p]->parent; - } - foreach (array_reverse($valid_parents) as $p) { - $rsl .= "group}" - ."&id=$p\">$ndx "; - $ndx++; - } - return $rsl; - case "xface": - return 'x-face'; - case "xorgid": - return "$_text".(preg_match("/[\w]+\.[\w\d]+/",$_text)? - " [fiche]":""); - default: - return htmlentities($_text); - } -} + global $locale; + switch ($_header) { + case "date": + return locale_date($_text); -/** produces HTML output for message body - * @param $_text STRING message body - * @return STRING HTML output - */ -function formatbody($_text) { - global $news; - $res = "\n\n" . htmlentities(wrap($_text,"",$news['wrap']))."\n\n"; - $res = preg_replace("/(<|>|")/"," \\1 ",$res); - $res = preg_replace('/(["\[])?((https?|ftp|news):\/\/[a-z@0-9.~%$£µ&i#\-+=_\/\?]*)(["\]])?/i', "\\1\\2\\4", $res); - $res = preg_replace("/ (<|>|") /","\\1",$res); - - $parts = preg_split("/\n-- ?\n/", $res); + case "followup": + case "newsgroups": + $res = ""; + $groups = preg_split("/(\t| )*,(\t| )*/",$_text); + foreach ($groups as $g) { + $res.=''.$g.', '; + } + return substr($res,0, -2); + + case "from": + return formatFrom($_text); + + case "references": + $rsl = ""; + $ndx = 1; + $text=str_replace("><","> <",$_text); + $text=preg_split("/( |\t)/",strtr($text,$_spool->ids)); + $parents=preg_grep("/^\d+$/",$text); + $p=array_pop($parents); + $valid_parents = Array(); + while ($p) { + $valid_parents[]=$p; + $p = $_spool->overview[$p]->parent; + } + foreach (array_reverse($valid_parents) as $p) { + $rsl .= "group}" + ."&id=$p\">$ndx "; + $ndx++; + } + return $rsl; - if (count($parts) > 1) { - $sign = "
" . array_pop($parts);
-        return join("\n-- \n", $parts).$sign;
-    } else {
-        return $res;
+        case "xface":
+            return 'x-face';
+
+        case "xorgid":
+            return "$_text".(preg_match("/[\w]+\.[\w\d]+/",$_text)?" [fiche]":"");
+
+        default:
+            return htmlentities($_text);
     }
 }
 
@@ -162,76 +79,70 @@ function formatbody($_text) {
  * @return STRING HTML output
  */
 function displayshortcuts() {
-  global $news,$locale,$first,$spool,$group,$post,$id,$profile,$css;
-  $sname = $_SERVER['SCRIPT_NAME'];
-  $array = explode('/',$sname);
-  $sname = array_pop($array);
+    global $news,$locale,$first,$spool,$group,$post,$id,$profile,$css;
+    $sname = basename($_SERVER['SCRIPT_NAME']);
 
-  echo "
"; + echo "
"; - switch ($sname) { - case 'subscribe.php' : - echo '[Liste des forums] '; - echo '[Profil] '; - break; - case 'index.php' : - if (!$profile['autoup']) { - echo '[Mettre à jour] '; - } - echo '[Profil] '; - echo '[Abonnements] '; - break; - case 'thread.php' : - if (!$profile['autoup']) { - echo '[Mettre à jour] '; - } - echo '[Profil] '; - echo '['.$locale['format']['grouplist'] - .'] '; - echo "[" - .$locale['format']['newpost']."] "; - if (sizeof($spool->overview)>$news['max']) { - for ($ndx=1; $ndx<=sizeof($spool->overview); $ndx += $news['max']) { - if ($first==$ndx) { - echo "[$ndx-".min($ndx+$news['max']-1,sizeof($spool->overview))."] "; - } else { - echo "[$ndx-".min($ndx+$news['max']-1,sizeof($spool->overview)) - ."] "; - } - } - } - break; - case 'article.php' : - if (!$profile['autoup']) { - echo '[Mettre à jour] '; - } - echo '[Profil] '; - echo '['.$locale['format']['grouplist'] - .'] '; - echo "[" - .$locale['format']['group_b'].$group - .$locale['format']['group_a']."] "; - echo "[" - .$locale['format']['followup']."] "; - if (checkcancel($post->headers)) { - echo "[" - .$locale['format']['cancel']."] "; - } - break; - case 'post.php' : - if (!$profile['autoup']) { - echo '[Mettre à jour] '; - } - echo '[Profil] '; - echo '['.$locale['format']['grouplist'] - .'] '; - echo "[" - .$locale['format']['group_b'].$group - .$locale['format']['group_a']."] "; - break; - } - echo '
'; + switch ($sname) { + case 'subscribe.php' : + echo '[Liste des forums] '; + echo '[Profil] '; + break; + case 'index.php' : + if (!$profile['autoup']) { + echo '[Mettre à jour] '; + } + echo '[Profil] '; + echo '[Abonnements] '; + break; + case 'thread.php' : + if (!$profile['autoup']) { + echo '[Mettre à jour] '; + } + echo '[Profil] '; + echo '['.$locale['format']['grouplist'].'] '; + echo "[".$locale['format']['newpost']."] "; + if (sizeof($spool->overview)>$news['max']) { + for ($ndx=1; $ndx<=sizeof($spool->overview); $ndx += $news['max']) { + if ($first==$ndx) { + echo "[$ndx-".min($ndx+$news['max']-1,sizeof($spool->overview))."] "; + } else { + echo "[$ndx-".min($ndx+$news['max']-1,sizeof($spool->overview))."] "; + } + } + } + break; + case 'article.php' : + if (!$profile['autoup']) { + echo '[Mettre à jour] '; + } + echo '[Profil] '; + echo '['.$locale['format']['grouplist'] + .'] '; + echo "[" + .$locale['format']['group_b'].$group + .$locale['format']['group_a']."] "; + echo "[" + .$locale['format']['followup']."] "; + if (checkcancel($post->headers)) { + echo "[" + .$locale['format']['cancel']."] "; + } + break; + case 'post.php' : + if (!$profile['autoup']) { + echo '[Mettre à jour] '; + } + echo '[Profil] '; + echo '['.$locale['format']['grouplist'] + .'] '; + echo "[" + .$locale['format']['group_b'].$group + .$locale['format']['group_a']."] "; + break; + } + echo '
'; } ?>