cvs: phpweb / docs.php

From: Date: Sun, 11 Mar 2001 18:09:57 +0000
Subject: cvs: phpweb / docs.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-4402@lists.php.net to get a copy of this message
goba Sun Mar 11 10:09:57 2001 EDT Modified files: /phpweb docs.php Log: Much cleaner code. Hope it will work. :) Index: phpweb/docs.php diff -u phpweb/docs.php:1.68 phpweb/docs.php:1.69 --- phpweb/docs.php:1.68 Sun Mar 11 04:05:34 2001 +++ phpweb/docs.php Sun Mar 11 10:09:57 2001 @@ -40,18 +40,18 @@ "es" => "Spanish" ); -# arrat structure: header, link text, show size in link +# array structure: (header, link text, show_size_in_link) $formats = array( - "" => array("View Online", "view", false), - "html/" => array("View Online (plain)", "view", false), + "" => array("View Online", "view", false), + "html/" => array("View Online (plain)", "view", false), "bigmanual.html.gz" => array("Single HTML", "html.gz", true), - "manual.txt.gz" => array("Plain text", "txt.gz", true), - "manual.tar.gz" => array("Many HTML files", "tar.gz", true), - "manual.zip" => array("Many HTML files", "zip", true), - "manual.pdf" => array("PDF", "pdf", true), - "manual_doc.pdb" => array("PalmPilot DOC", "doc.pdb", true), - "manual_isilo.pdb" => array("PalmPilot iSilo", "isilo.pdb", true), - "manual.chm" => array("Windows HTML Help", "chm", true) + "manual.txt.gz" => array("Plain text", "txt.gz", true), + "manual.tar.gz" => array("Many HTML files", "tar.gz", true), + "manual.zip" => array("Many HTML files", "zip", true), + "manual.pdf" => array("PDF", "pdf", false), + "manual_doc.pdb" => array("PalmPilot DOC", "doc.pdb", true), + "manual_isilo.pdb" => array("PalmPilot iSilo", "isilo.pdb", true), + "manual.chm" => array("Windows HTML Help", "chm", true) ); ?> @@ -77,28 +77,28 @@ reset($formats); while (list($fn,$details) = each($formats)) { echo "<td align=\"center\" bgcolor=\"#eeeeee\">"; - # temporary hack until pdf are auto-generated + + # temporary hacks until pdf and chm are auto-generated if ($fn == "manual.pdf") { - echo "<a href=\"http://snaps.php.net/~jah/pdf/manual-$langcode.pdf\">$details[1]</a></td>"; - continue; - } - # temporary hack until chm are auto-generated - if ($fn == "manual.chm") { - $size = @filesize("distributions/manual_$langcode.chm"); - if ($size) { - $print_size = ($details[2] ? ' title="' . (int) ($size/1024) . 'Kb"' : ''); - } - echo "<a href=\"distributions/manual_$langcode.chm\"$print_size>$details[1]</a></td>"; - continue; + $link_to = "http://snaps.php.net/~jah/pdf/manual-$langcode.pdf"; + } elseif ($fn == "manual.chm") { + $link_to = "distributions/manual_$langcode.chm"; + } else { + $link_to = "manual/$langcode/$fn"; } - $size = @filesize("manual/$langcode/$fn"); - if ($size) { - $print_size = ($details[2] ? ' title="' . (int) ($size/1024) . 'Kb"' : ''); - echo "<a href=\"manual/$langcode/$fn\"$print_size>$details[1]</a>"; - } + + # if no size required [pdf, online], then just print, else + # decide what to do according to the $size of the file + if (!$details[2]) { echo "<a href=\"$link_to\">$details[1]</a>"; } else { - echo "&nbsp;"; + $size = @filesize($link_to); + if ($size) { + echo "<a href=\"$link_to\" title=\"" . (int) ($size/1024) . "Kb\">$details[1]</a>"; + } else { + echo "&nbsp;"; + } } + echo "</td>\n"; } }?>

« previous php.mirrors (#4402) next »