Enlightenment CVS committal

Author  : mekius
Project : web
Module  : www

Dir     : web/www/site


Modified Files:
        site.php 


Log Message:
1. Should use echo over print unless you need to the return status of print.
    - Small issue, but small things can add up.
2. include_once incurs extra overhead of checking existing includes.
    - It is not necessary for us since we only include the files once.
      Again small things can add up.
3. Anything between style or script tags should be HTML commented.
4. align is not a valid css property.
5. // is not a valid CSS commenting style, must use /* */.
6. Other misc cleanups/fixes, see diff.
7. Finally, lets do our part to be XHTML 1.1 :), not too hard.

===================================================================
RCS file: /cvs/e/web/www/site/site.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- site.php    9 Apr 2007 04:09:09 -0000       1.6
+++ site.php    12 Apr 2007 00:06:53 -0000      1.7
@@ -30,20 +30,20 @@
       global $page;
       global $lang;
       list($width, $height, $type, $attr) = getimagesize("p/$page/d/$src");
-      print("<img src='p/$page/d/$src' width=$width height=$height alt='$alt' 
border=0>");
+      echo("<img src=\"p/$page/d/$src\" style='width:".$width."px; 
height:".$height."px; border:0;' alt='$alt'/>");
   }
 
   function thm($src, $alt) {
       global $page;
       global $lang;
       list($width, $height, $type, $attr) = getimagesize("p/$page/d/.t.$src");
-      print("<a href='p/$page/d/$src'><img src='p/$page/d/.t.$src' 
width=$width height=$height alt='$alt' class='thumb'></a>");
+      echo("<a href='p/$page/d/$src'><img src='p/$page/d/.t.$src' 
style='width:".$width."px; height:".$height."px;' alt='$alt' 
class='thumb'/></a>");
   }
 
   function a($pg, $txt) {
       global $page;
       global $lang;
-      print("<a href='p.php?page=$pg?l=$lang'>$txt</a>");
+      echo("<a href='p.php?page=$pg?l=$lang'>$txt</a>");
   }
 
 /* utility functions */
@@ -70,7 +70,7 @@
                  $fl = fgets($handle, 4096);
                  $fl = str_replace("\n", "", $fl);
                  if ($fl != "") {
-                     print("<a href='p.php?p=$page&l=$fl'><img src='i/$fl.png' 
width=24 height=18></a>\n");
+                     echo("<a href='p.php?p=$page&amp;l=$fl'><img 
src='i/$fl.png' style='width:24px; height:18px; border:0;' alt='$fl'/></a>\n");
                  }
              }
          }
@@ -87,7 +87,7 @@
        $l = read_var("p/$b/en-label");
       if (file_exists("p/$b/page")) {
          $h = read_var("p/$b/page");
-         $h = "p.php?p=$h&l=$lang";
+         $h = "p.php?p=$h&amp;l=$lang";
       }
       else if (file_exists("p/$b/link")) {
          $h = read_var("p/$b/link");
@@ -102,7 +102,7 @@
       if (file_exists("p/$page/subs")) {
          $handle = fopen("p/$page/subs", "r");
          if ($handle) {
-             print("<ul class='navul'>\n");
+             echo("<ul class='navul'>\n");
              while (!feof($handle)) {
                  $fl = fgets($handle, 4096);
                  $fl = str_replace("\n", "", $fl);
@@ -115,24 +115,24 @@
                      if (file_exists("p/$page/$fl/$lang-label")) {
                          $l = read_var("p/$page/$fl/$lang-label");
                          if ($h == "") {
-                           $h = "p.php?p=$page/$fl&l=$lang";
+                           $h = "p.php?p=$page/$fl&amp;l=$lang";
                           }
-                         if ($item > 0) print("|\n");
-                         print("<li class='navul'><a class='navul' 
href='$h'>$l</a></li>\n");
+                         if ($item > 0) echo("|\n");
+                         echo("<li class='navul'><a class='navul' 
href='$h'>$l</a></li>\n");
                          $item++;
                      }
                      else if (file_exists("p/$page/$fl/en-label")) {
                          $l = read_var("p/$page/$fl/en-label");
                          if ($h == "") {
-                           $h = "p.php?p=$page/$fl&l=$lang";
+                           $h = "p.php?p=$page/$fl&amp;l=$lang";
                           }
-                         if ($item > 0) print("|\n");
-                         print("<li class='navul'><a class='navul' 
href='$h'>$l</a></li>\n");
+                         if ($item > 0) echo("|\n");
+                         echo("<li class='navul'><a class='navul' 
href='$h'>$l</a></li>\n");
                          $item++;
                      }
                  }
              }
-             print("</ul><hr>");
+             echo("</ul><hr>");
          }
       }
   }



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to