home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 June / INTERNET104.ISO / pc / software / windows / building / php_nuke / html / themes / nukenews / theme.php < prev   
Encoding:
PHP Script  |  2002-09-16  |  8.2 KB  |  207 lines

  1. <?php
  2.  
  3. /************************************************************/
  4. /* IMPORTANT NOTE FOR THEMES DEVELOPERS!                    */
  5. /*                                                          */
  6. /* When you start coding your theme, if you want to         */
  7. /* distribute it, please double check it to fit the HTML    */
  8. /* 4.01 Transitional Standard. You can use the W3 validator */
  9. /* located at http://validator.w3.org                       */
  10. /* If you don't know where to start with your theme, just   */
  11. /* start modifying this theme, it's validate and is cool ;) */
  12. /************************************************************/
  13.  
  14. /************************************************************/
  15. /* Theme Colors Definition                                  */
  16. /*                                                          */
  17. /* Define colors for your web site. $bgcolor2 is generaly   */
  18. /* used for the tables border as you can see on OpenTable() */
  19. /* function, $bgcolor1 is for the table background and the  */
  20. /* other two bgcolor variables follows the same criteria.   */
  21. /* $texcolor1 and 2 are for tables internal texts           */
  22. /************************************************************/
  23.  
  24. $bgcolor1 = "#efefef";
  25. $bgcolor2 = "#cfcfbb";
  26. $bgcolor3 = "#efefef";
  27. $bgcolor4 = "#cfcfbb";
  28. $textcolor1 = "#000000";
  29. $textcolor2 = "#000000";
  30.  
  31. include("themes/NukeNews/tables.php");
  32.  
  33. /************************************************************/
  34. /* Function themeheader()                                   */
  35. /*                                                          */
  36. /* Control the header for your site. You need to define the */
  37. /* BODY tag and in some part of the code call the blocks    */
  38. /* function for left side with: blocks(left);               */
  39. /************************************************************/
  40.  
  41. function themeheader() {
  42.     global $user, $banners, $sitename, $slogan, $cookie, $prefix, $dbi;
  43.     cookiedecode($user);
  44.     $username = $cookie[1];
  45.     if ($username == "") {
  46.         $username = "Anonymous";
  47.     }
  48.     echo "<body bgcolor=\"#505050\" text=\"#000000\" link=\"#363636\" vlink=\"#363636\" alink=\"#d5ae83\">";
  49.     if ($banners == 1) {
  50.     include("banners.php");
  51.     }
  52.     $topics_list = "<select name=\"new_topic\" onChange='submit()'>\n";
  53.     $topics_list .= "<option value=\"\">All Topics</option>\n";
  54.     $toplist = sql_query("select topicid, topictext from ".$prefix."_topics order by topictext", $dbi);
  55.     while(list($topicid, $topics) = sql_fetch_row($toplist, $dbi)) {
  56.     if ($topicid==$topic) { $sel = "selected "; }
  57.     $topics_list .= "<option $sel value=\"$topicid\">$topics</option>\n";
  58.     $sel = "";
  59.     }
  60.     if ($username == "Anonymous") {
  61.     $theuser = "  <a href=\"modules.php?name=Your_Account&op=new_user\">Create an account";
  62.     } else {
  63.     $theuser = "  Welcome $username!";
  64.     }
  65.     $public_msg = public_message();
  66.     $tmpl_file = "themes/NukeNews/header.html";
  67.     $thefile = implode("", file($tmpl_file));
  68.     $thefile = addslashes($thefile);
  69.     $thefile = "\$r_file=\"".$thefile."\";";
  70.     eval($thefile);
  71.     print $r_file;
  72.     blocks(left);
  73.     $tmpl_file = "themes/NukeNews/left_center.html";
  74.     $thefile = implode("", file($tmpl_file));
  75.     $thefile = addslashes($thefile);
  76.     $thefile = "\$r_file=\"".$thefile."\";";
  77.     eval($thefile);
  78.     print $r_file;
  79. }
  80.  
  81. /************************************************************/
  82. /* Function themefooter()                                   */
  83. /*                                                          */
  84. /* Control the footer for your site. You don't need to      */
  85. /* close BODY and HTML tags at the end. In some part call   */
  86. /* the function for right blocks with: blocks(right);       */
  87. /* Also, $index variable need to be global and is used to   */
  88. /* determine if the page your're viewing is the Homepage or */
  89. /* and internal one.                                        */
  90. /************************************************************/
  91.  
  92. function themefooter() {
  93.     global $index, $foot1, $foot2, $foot3, $copyright, $totaltime;
  94.     if ($index == 1) {
  95.     $tmpl_file = "themes/NukeNews/center_right.html";
  96.     $thefile = implode("", file($tmpl_file));
  97.     $thefile = addslashes($thefile);
  98.     $thefile = "\$r_file=\"".$thefile."\";";
  99.     eval($thefile);
  100.     print $r_file;
  101.     blocks(right);
  102.     }
  103.     $footer_message = "$foot1<br>$foot2<br>$foot3<br>$copyright<br>$totaltime";
  104.     $tmpl_file = "themes/NukeNews/footer.html";
  105.     $thefile = implode("", file($tmpl_file));
  106.     $thefile = addslashes($thefile);
  107.     $thefile = "\$r_file=\"".$thefile."\";";
  108.     eval($thefile);
  109.     print $r_file;
  110. }
  111.  
  112. /************************************************************/
  113. /* Function themeindex()                                    */
  114. /*                                                          */
  115. /* This function format the stories on the Homepage         */
  116. /************************************************************/
  117.  
  118. function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
  119.     global $anonymous, $tipath;
  120.     $ThemeSel = get_theme();
  121.     if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
  122.     $t_image = "themes/$ThemeSel/images/topics/$topicimage";
  123.     } else {
  124.     $t_image = "$tipath$topicimage";
  125.     }
  126.     if ($notes != "") {
  127.     $notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
  128.     } else {
  129.     $notes = "";
  130.     }
  131.     if ("$aid" == "$informant") {
  132.     $content = "$thetext$notes\n";
  133.     } else {
  134.     if($informant != "") {
  135.         $content = "<a href=\"modules.php?name=Your_Account&op=userinfo&uname=$informant\">$informant</a> ";
  136.     } else {
  137.         $content = "$anonymous ";
  138.     }
  139.     $content .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
  140.     }
  141.     $posted = ""._POSTEDBY." ";
  142.     $posted .= get_author($aid);
  143.     $posted .= " "._ON." $time $timezone ($counter "._READS.")";
  144.     $tmpl_file = "themes/NukeNews/story_home.html";
  145.     $thefile = implode("", file($tmpl_file));
  146.     $thefile = addslashes($thefile);
  147.     $thefile = "\$r_file=\"".$thefile."\";";
  148.     eval($thefile);
  149.     print $r_file;
  150. }
  151.  
  152. /************************************************************/
  153. /* Function themearticle()                                  */
  154. /*                                                          */
  155. /* This function format the stories on the story page, when */
  156. /* you click on that "Read More..." link in the home        */
  157. /************************************************************/
  158.  
  159. function themearticle ($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext) {
  160.     global $admin, $sid, $tipath;
  161.     $ThemeSel = get_theme();
  162.     if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
  163.     $t_image = "themes/$ThemeSel/images/topics/$topicimage";
  164.     } else {
  165.     $t_image = "$tipath$topicimage";
  166.     }
  167.     $posted = ""._POSTEDON." $datetime "._BY." ";
  168.     $posted .= get_author($aid);
  169.     if ($notes != "") {
  170.     $notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
  171.     } else {
  172.     $notes = "";
  173.     }
  174.     if ("$aid" == "$informant") {
  175.     $content = "$thetext$notes\n";
  176.     } else {
  177.     if($informant != "") {
  178.         $content = "<a href=\"modules.php?name=Your_Account&op=userinfo&uname=$informant\">$informant</a> ";
  179.     } else {
  180.         $content = "$anonymous ";
  181.     }
  182.     $content .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
  183.     }
  184.     $tmpl_file = "themes/NukeNews/story_page.html";
  185.     $thefile = implode("", file($tmpl_file));
  186.     $thefile = addslashes($thefile);
  187.     $thefile = "\$r_file=\"".$thefile."\";";
  188.     eval($thefile);
  189.     print $r_file;
  190. }
  191.  
  192. /************************************************************/
  193. /* Function themesidebox()                                  */
  194. /*                                                          */
  195. /* Control look of your blocks. Just simple.                */
  196. /************************************************************/
  197.  
  198. function themesidebox($title, $content) {
  199.     $tmpl_file = "themes/NukeNews/blocks.html";
  200.     $thefile = implode("", file($tmpl_file));
  201.     $thefile = addslashes($thefile);
  202.     $thefile = "\$r_file=\"".$thefile."\";";
  203.     eval($thefile);
  204.     print $r_file;
  205. }
  206.  
  207. ?>