home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 May / INTERNET103.ISO / pc / software / windows / building / php_nuke / html / themes / milo / theme.php
Encoding:
PHP Script  |  2002-09-16  |  14.9 KB  |  305 lines

  1. <?php
  2.  
  3. /************************************************************/
  4. /* Ported Theme Name: Milo (v1.0)                           */
  5. /* Original Theme Name: FungKu (v1.0)                       */
  6. /* Copyright (c) 2001 Somara Sem (http://www.somara.com)    */
  7. /* Last Updated: 09/21/2001 by dezina.com                   */
  8. /************************************************************/
  9.  
  10.  
  11. /************************************************************/
  12. /* Theme Colors Definition                                  */
  13. /*                                                          */
  14. /* Define colors for your web site. $bgcolor2 is generaly   */
  15. /* used for the tables border as you can see on OpenTable() */
  16. /* function, $bgcolor1 is for the table background and the  */
  17. /* other two bgcolor variables follows the same criteria.   */
  18. /* $texcolor1 and 2 are for tables internal texts           */
  19. /************************************************************/
  20.  
  21. $bgcolor1 = "#efefef";
  22. $bgcolor2 = "#808080";
  23. $bgcolor3 = "#efefef";
  24. $bgcolor4 = "#808080";
  25. $textcolor1 = "#000000";
  26. $textcolor2 = "#000000";
  27.  
  28. /************************************************************/
  29. /* OpenTable Functions                                      */
  30. /*                                                          */
  31. /* Define the tables look&feel for you whole site. For this */
  32. /* we have two options: OpenTable and OpenTable2 functions. */
  33. /* Then we have CloseTable and CloseTable2 function to      */
  34. /* properly close our tables. The difference is that        */
  35. /* OpenTable has a 100% width and OpenTable2 has a width    */
  36. /* according with the table content                         */
  37. /************************************************************/
  38.  
  39. function OpenTable() {
  40.     global $bgcolor1, $bgcolor2;
  41.     echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"$bgcolor2\"><tr><td>\n";
  42.     echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"8\" bgcolor=\"$bgcolor1\"><tr><td>\n";
  43. }
  44.  
  45. function CloseTable() {
  46.     echo "</td></tr></table></td></tr></table>\n";
  47. }
  48.  
  49. function OpenTable2() {
  50.     global $bgcolor1, $bgcolor2;
  51.     echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"$bgcolor2\" align=\"center\"><tr><td>\n";
  52.     echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"8\" bgcolor=\"$bgcolor1\"><tr><td>\n";
  53. }
  54.  
  55. function CloseTable2() {
  56.     echo "</td></tr></table></td></tr></table>\n";
  57. }
  58.  
  59. /************************************************************/
  60. /* FormatStory                                              */
  61. /*                                                          */
  62. /* Here we'll format the look of the stories in our site.   */
  63. /* If you dig a little on the function you will notice that */
  64. /* we set different stuff for anonymous, admin and users    */
  65. /* when displaying the story.                               */
  66. /************************************************************/
  67.  
  68. function FormatStory($thetext, $notes, $aid, $informant) {
  69.     global $anonymous;
  70.     if ($notes != "") {
  71.     $notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
  72.     } else {
  73.     $notes = "";
  74.     }
  75.     if ("$aid" == "$informant") {
  76.     echo "<font class=\"content\" color=\"#505050\">$thetext$notes</font>\n";
  77.     } else {
  78.     if($informant != "") {
  79.         $boxstuff = "<a href=\"modules.php?name=Your_Account&op=userinfo&uname=$informant\">$informant</a> ";
  80.     } else {
  81.         $boxstuff = "$anonymous ";
  82.     }
  83.     $boxstuff .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
  84.     echo "<font class=\"content\" color=\"#505050\">$boxstuff</font>\n";
  85.     }
  86. }
  87.  
  88. /************************************************************/
  89. /* Function themeheader()                                   */
  90. /*                                                          */
  91. /* Control the header for your site. You need to define the */
  92. /* BODY tag and in some part of the code call the blocks    */
  93. /* function for left side with: blocks(left);               */
  94. /************************************************************/
  95.  
  96. function themeheader() {
  97.     global $user, $banners, $sitename, $slogan, $cookie, $prefix;
  98.     cookiedecode($user);
  99.     $username = $cookie[1];
  100.     if ($username == "") {
  101.         $username = "Anonymous";
  102.     }
  103.     echo "<body bgcolor=\"#ffffff\" text=\"#000000\" link=\"#363636\" vlink=\"#363636\" alink=\"#d5ae83\">\n"
  104.     ."<br>\n";
  105.     if ($banners) {
  106.     include("banners.php");
  107.     }
  108.     echo "<br>\n"
  109.     ."<table cellpadding=\"0\" cellspacing=\"0\" width=\"750\" border=\"0\" align=\"center\" bgcolor=\"#ffffff\">\n"
  110.     ."<tr>\n"
  111.     ."<td bgcolor=\"#ffffff\" width=\"306\">\n"
  112.     ."<a href=\"index.php\"><img src=\"themes/Milo/images/logo.gif\" align=\"left\" alt=\""._WELCOMETO." $sitename\" border=\"0\"></a></td>\n"
  113.     ."</tr>\n"
  114.     ."</table><br>\n"
  115.     ."<table cellpadding=\"0\" cellspacing=\"0\" width=\"750\" border=\"0\" align=\"center\" bgcolor=\"#ffffff\">\n"
  116.     ."<tr>\n"
  117.     ."<td bgcolor=\"#808080\">\n"
  118.     ."<img src=\"themes/Milo/images/tophighlight.gif\"></td>\n"
  119.     ."</tr>\n"
  120.     ."</table>\n"
  121.     ."<table cellpadding=\"0\" cellspacing=\"0\" width=\"750\" border=\"0\" align=\"center\" bgcolor=\"#ffffff\">\n"
  122.     ."<tr valign=\"middle\">\n"
  123.     ."<td width=\"400\" bgcolor=\"#C0C0C0\" align=\"left\">\n"
  124.     ." </td>\n"
  125.     ."<td bgcolor=\"#C0C0C0\" align=\"center\">\n"
  126.     ."<form action=\"modules.php?name=Search\" method=\"post\"><font class=\"content\" color=\"#000000\"><b>"._SEARCH." </b>\n"
  127.     ."<input type=\"text\" name=\"query\" size=\"14\"></font></form></td>\n"
  128.     ."<td bgcolor=\"#C0C0C0\" align=\"center\">\n"
  129.     ."<form action=\"modules.php?name=Search\" method=\"get\"><font class=\"content\"><b>"._TOPICS." </b>\n";
  130.     $toplist = mysql_query("select topicid, topictext from $prefix"._topics." order by topictext");
  131.     echo "<select name=\"topic\"onChange='submit()'>\n"
  132.     ."<option value=\"\">"._ALLTOPICS."</option>\n";
  133.     while(list($topicid, $topics) = mysql_fetch_row($toplist)) {
  134.     if ($topicid==$topic) { $sel = "selected "; }
  135.     echo "<option $sel value=\"$topicid\">$topics</option>\n";
  136.     $sel = "";
  137.     }
  138.     echo "</select></font></form></td>\n"
  139.     ."</tr></table>\n"
  140.     ."<table cellpadding=\"0\" cellspacing=\"0\" width=\"750\" border=\"0\" align=\"center\" bgcolor=\"#fefefe\">\n"
  141.     ."<tr>\n"
  142.     ."<td bgcolor=\"#000000\" colspan=\"4\"><IMG src=\"themes/Milo/images/pixel.gif\" width=\"1\" height=1 alt=\"\" border=\"0\" hspace=\"0\"></td>\n"
  143.     ."</tr>\n"
  144.     ."<tr valign=\"middle\" bgcolor=\"#808080\">\n"
  145.     ."<td width=\"15%\" nowrap><font class=\"content\" color=\"#363636\">\n";
  146.     if ($username == "Anonymous") {
  147.     echo "  <font color=\"#363636\"><a href=\"modules.php?name=Your_Account\">Crear</a></font> una cuenta\n";
  148.     } else {
  149.     echo "  "._HELLO." $username!   [ <a href=\"modules.php?name=Your_Account&op=logout\">Logout</a> ]";
  150.     }
  151.     echo "</font></td>\n"
  152.     ."<td align=\"center\" height=\"20\" width=\"60%\"><font class=\"content\">\n"
  153.         ." \n"
  154.         ."</td>\n"
  155.         ."<td align=\"right\" width=\"25%\"><font class=\"content\">\n"
  156.         ."<script type=\"text/javascript\">\n\n"
  157.         ."<!--   // Array ofmonth Names\n"
  158.         ."var monthNames = new Array( \"Enero\",\"Febrero\",\"Marzo\",\"Abril\",\"Mayo\",\"Junio\",\"Julio\",\"Agosto\",\"Septiembre\",\"Octubre\",\"Noviembre\",\"Diciembre\");\n"
  159.         ."var now = new Date();\n"
  160.         ."thisYear = now.getYear();\n"
  161.         ."if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem\n"
  162.         ."document.write(monthNames[now.getMonth()] + \" \" + now.getDate() + \", \" + thisYear);\n"
  163.         ."// -->\n\n"
  164.         ."</script></font></td>\n"
  165.         ."<td> </td>\n"
  166.         ."</tr>\n"
  167.         ."<tr>\n"
  168.         ."<td bgcolor=\"#000000\" colspan=\"4\"><IMG src=\"themes/Milo/images/pixel.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\" hspace=\"0\"></td>\n"
  169.         ."</tr>\n"
  170.         ."</table>\n"
  171.     ."<!-- FIN DEL TITULO -->\n"
  172.     ."<table width=\"750\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"#ffffff\" align=\"center\">\n"
  173.     ."<tr valign=\"top\">\n"
  174.     ."<td bgcolor=\"#C0C0C0\"><img src=\"themes/Milo/images/pixel.gif\" width=\"1\" height=\"3\" border=\"0\" alt=\"\"></td>\n"
  175.     ."</tr>\n"
  176.     ."<tr valign=\"top\">\n"
  177.     ."<td bgcolor=\"#ffffff\"><img src=\"themes/Milo/images/pixel.gif\" width=\"1\" height=\"5\" border=\"0\" alt=\"\"></td>\n"
  178.     ."</tr>\n"
  179.     ."</table>\n"
  180. ;
  181.     $public_msg = public_message();
  182.         echo "$public_msg<br>";
  183.     echo "<table width=\"750\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"#ffffff\" align=\"center\"><tr valign=\"top\">\n"
  184.     ."<td bgcolor=\"#eeeeee\" width=\"150\" valign=\"top\">\n";
  185.     blocks(left);
  186.     echo "</td><td><img src=\"themes/Milo/images/pixel.gif\" width=\"15\" height=\"1\" border=\"0\" alt=\"\"></td><td width=\"100%\">\n";
  187. }
  188.  
  189. /************************************************************/
  190. /* Function themefooter()                                   */
  191. /*                                                          */
  192. /* Control the footer for your site. You don't need to      */
  193. /* close BODY and HTML tags at the end. In some part call   */
  194. /* the function for right blocks with: blocks(right);       */
  195. /* Also, $index variable need to be global and is used to   */
  196. /* determine if the page your're viewing is the Homepage or */
  197. /* and internal one.                                        */
  198. /************************************************************/
  199.  
  200. function themefooter() {
  201.     global $index;
  202.     if ($index == 1) {
  203.     echo "</td><td><img src=\"themes/Milo/images/pixel.gif\" width=\"15\" height=\"1\" border=\"0\" alt=\"\"></td><td valign=\"top\" width=\"150\" bgcolor=\"#eeeeee\">\n";
  204.     blocks(right);
  205.     }
  206.     echo "</td>\n"
  207.     ."</tr></table>\n"
  208.         ."<table bgcolor=\"#000000\" width=\"750\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\">\n"
  209.         ."<tr>\n"
  210.         ."<td width=\"750\" height=\"5\"><img src=\"themes/Milo/images/bottombar.gif\" width=\"750\" height=\"5\" border=\"0\" alt=\"\"></td>\n"
  211.         ."</tr>\n"
  212.         ."<tr>\n"
  213.         ."<td width=\"100%\"><img src=\"themes/Milo/images/pixel.gif\" width=\"1\" height=\"1\" border=\"0\" alt=\"\"></td>\n"
  214.         ."</tr>\n"
  215.         ."</table>\n"
  216.         ."<br>\n"
  217.         ."<br>\n"
  218.         ."<table width=\"750\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\">\n"
  219.         ."<tr align=\"center\">\n"
  220.         ."<td width=\"100%\" colspan=\"3\">\n";
  221.     footmsg();
  222.     echo "</td>\n"
  223.         ."</tr>\n"
  224.         ."</table>\n";
  225. }
  226.  
  227. /************************************************************/
  228. /* Function themeindex()                                    */
  229. /*                                                          */
  230. /* This function format the stories on the Homepage         */
  231. /************************************************************/
  232.  
  233. function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
  234.     global $anonymous, $tipath;
  235.     $ThemeSel = get_theme();
  236.     if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
  237.     $t_image = "themes/$ThemeSel/images/topics/$topicimage";
  238.     } else {
  239.     $t_image = "$tipath$topicimage";
  240.     }
  241.     echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#ffffff\" width=\"420\"><tr><td>\n"
  242.     ."<table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" bgcolor=\"#000000\" width=\"100%\"><tr><td>\n"
  243.     ."<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" bgcolor=\"#C0C0C0\" width=\"100%\"><tr><td align=\"left\">\n"
  244.     ."<font class=\"option\" color=\"#363636\"><b>$title</b></font>\n"
  245.     ."</td></tr></table></td></tr></table>\n"
  246.     ."<font color=\"#999999\"><b><a href=\"modules.php?name=News&new_topic=$topic\"><img src=\"$t_image\" border=\"0\" Alt=\"$topictext\" align=\"right\" hspace=\"10\" vspace=\"10\"></a></B></font>\n";
  247.     FormatStory($thetext, $notes, $aid, $informant);
  248.     echo "</td></tr></table><br>\n"
  249.     ."<table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" bgcolor=\"#eeeeee\" width=\"100%\"><tr><td>\n"
  250.     ."<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" bgcolor=\"#ffffff\" width=\"100%\"><tr><td align=\"center\">\n"
  251.     ."<font color=\"#999999\" size=\"1\">"._POSTEDBY." ";
  252.     formatAidHeader($aid);
  253.     echo " "._ON." $time $timezone ($counter "._READS.")<br></font>\n"
  254.     ."<font class=\"content\">$morelink</font>\n"
  255.     ."</td></tr></table></td></tr></table>\n"
  256.     ."<br>\n\n\n";
  257. }
  258.  
  259. /************************************************************/
  260. /* Function themeindex()                                    */
  261. /*                                                          */
  262. /* This function format the stories on the story page, when */
  263. /* you click on that "Read More..." link in the home        */
  264. /************************************************************/
  265.  
  266. function themearticle ($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext) {
  267.     global $admin, $sid, $tipath;
  268.     $ThemeSel = get_theme();
  269.     if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
  270.     $t_image = "themes/$ThemeSel/images/topics/$topicimage";
  271.     } else {
  272.     $t_image = "$tipath$topicimage";
  273.     }
  274.     echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#ffffff\" width=\"100%\"><tr><td>\n"
  275.         ."<table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" bgcolor=\"#000000\" width=\"100%\"><tr><td>\n"
  276.         ."<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" bgcolor=\"#808080\" width=\"100%\"><tr><td align=\"left\">\n"
  277.         ."<font class=\"option\" color=\"#363636\"><b>$title</b></font><br>\n"
  278.         ."<font class=\"content\">"._POSTEDON." $datetime "._BY." ";
  279.     formatAidHeader($aid);
  280.     echo "</td></tr></table></td></tr></table><br>";
  281.     echo "<a href=\"modules.php?name=News&new_topic=$topic\"><img src=\"$t_image\" border=\"0\" Alt=\"$topictext\" align=\"right\" hspace=\"10\" vspace=\"10\"></a>\n";
  282.     FormatStory($thetext, $notes="", $aid, $informant);
  283.     echo "</td></tr></table><br>\n\n\n";
  284. }
  285.  
  286. /************************************************************/
  287. /* Function themesidebox()                                  */
  288. /*                                                          */
  289. /* Control look of your blocks. Just simple.                */
  290. /************************************************************/
  291.  
  292. function themesidebox($title, $content) {
  293.     echo "<table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" bgcolor=\"#000000\" width=\"150\"><tr><td>\n"
  294.     ."<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" bgcolor=\"#C0C0C0\" width=\"100%\"><tr><td align=left>\n"
  295.     ."<font class=\"content\" color=\"#363636\"><b>$title</b></font>\n"
  296.     ."</td></tr></table></td></tr></table>\n"
  297.     ."<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"150\">\n"
  298.     ."<tr valign=\"top\"><td>\n"
  299.     ."$content\n"
  300.     ."</td></tr></table>\n"
  301.     ."<br>\n\n\n";
  302. }
  303.  
  304. ?>
  305.