Alexandre Julliard : Improve the formatting of the announcement message.

Alexandre Julliard julliard at winehq.org
Mon May 12 11:40:26 CDT 2008


Module: website
Branch: master
Commit: e32670611dde059223130f76ef6b95dbcfd5813f
URL:    http://source.winehq.org/git/website.git/?a=commit;h=e32670611dde059223130f76ef6b95dbcfd5813f

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon May 12 18:36:15 2008 +0200

Improve the formatting of the announcement message.

---

 site |   34 ++++++++++++++++++++++++++++------
 1 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/site b/site
index 32a6bb8..3b48e37 100644
--- a/site
+++ b/site
@@ -133,16 +133,38 @@ function view_announce ($ver)
 {
     global $file_root, $config, $html;
     
-    if ($ver == "latest")
-        $announce = "http://source.winehq.org/git/wine.git/master:ANNOUNCE";
-    else
-        $announce = "http://source.winehq.org/git/wine.git/tags/wine-".$ver.":ANNOUNCE";
+    $tag = ($ver == "latest") ? "master" : "tags/wine-" . $ver;
+    $announce = $config->git_tree . "/wine.git/" . $tag . ":ANNOUNCE";
         
-    if ($announce = @join("",file($announce)))
+    if ($arr = file($announce))
     {
+        $in_header = 1;
+        while (list($c,$val) = each($arr))
+        {
+            $arr[$c] = $html->urlify($arr[$c]);
+
+            if (ereg("^--------------------", $arr[$c])) $in_header = 0;
+            else if (ereg("^Bugs fixed", $arr[$c])) $in_bugs = 1;
+            else if (ereg("^Changes since", $arr[$c])) $in_bugs = 0;
+
+            if ($in_header)
+            {
+                $arr[$c] = ereg_replace("AUTHORS",
+                                        "<a href=\"".$config->git_tree."/wine.git/".$tag.":\\0\">\\0</a>",
+                                        $arr[$c]);
+            }           
+            else if ($in_bugs)
+            {
+                $arr[$c] = ereg_replace("^( +)([0-9]+)",
+                                        "\\1<a href=\"".$config->bug_system."\\2\">\\2</a>",
+                                        $arr[$c]);
+            }
+        }
+        $announce = join("",$arr);
+
         // display page
         $html->template_title = 'Announce';
-        return $html->theme_box($config->theme, "box_title", 'Announce', "100%", $html->format_msg($announce), '10', 'white', 'topMenu');
+        return $html->theme_box($config->theme, "box_title", 'Announce', "100%", $html->pre($announce), '10', 'white', 'topMenu');
     }
     
     $html->redirect($file_root);




More information about the wine-cvs mailing list