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

  1. <?php
  2.  
  3. $lnkcolor = "#336699";
  4. $bgcolor1 = "#F6F6EB";
  5. $bgcolor2 = "#D8D8C4";
  6. $bgcolor3 = "#B7B78B";
  7. $textcolor1 = "#000000";
  8. $textcolor2 = "#000000";
  9. $theme_home = "Web_Links";
  10. $hr = 1; # 1 to have horizonal rule in comments instead of table bgcolor
  11.  
  12. function OpenTable() {
  13.     global $bgcolor1, $bgcolor2;
  14.     echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"$bgcolor2\"><tr><td>\n";
  15.     echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"8\" bgcolor=\"$bgcolor1\"><tr><td>\n";
  16. }
  17.  
  18. function OpenTable2() {
  19.     global $bgcolor1, $bgcolor2;
  20.     echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"$bgcolor2\" align=\"center\"><tr><td>\n";
  21.     echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"8\" bgcolor=\"$bgcolor1\"><tr><td>\n";
  22. }
  23.  
  24. function CloseTable() {
  25.     echo "</td></tr></table></td></tr></table>\n";
  26. }
  27.  
  28. function CloseTable2() {
  29.     echo "</td></tr></table></td></tr></table>\n";
  30. }
  31.  
  32. function FormatStory($thetext, $notes, $aid, $informant) {
  33.     global $anonymous;
  34.     if ($notes != "") {
  35.     $notes = "<b>"._NOTE."</b> <i>$notes</i>\n";
  36.     } else {
  37.     $notes = "";
  38.     }
  39.     if ("$aid" == "$informant") {
  40.     echo "<font size=\"2\">$thetext<br>$notes</font>\n";
  41.     } else {
  42.     if($informant != "") {
  43.         $boxstuff = "<a href=\"modules.php?name=Your_Account&op=userinfo&uname=$informant\">$informant</a> ";
  44.     } else {
  45.         $boxstuff = "$anonymous ";
  46.     }
  47.     $boxstuff .= ""._WRITES." <i>\"$thetext\"</i> $notes\n";
  48.     echo "<font size=\"2\">$boxstuff</font>\n";
  49.     }
  50. }
  51.  
  52. function themeheader() {
  53.     global $prefix, $dbi, $user, $cookie, $bgcolor1, $bgcolor2, $bgcolor3, $banners, $sitename, $anonymous, $user;
  54.     echo "<body bgcolor=\"$bgcolor1\">";
  55.     if ($banners
  56.  == 1) {
  57.     include("banners.php");
  58.     }
  59.     if (is_user($user)) {
  60.     cookiedecode($user);
  61.     $username = $cookie[1];
  62.     $bienvenida = "Hello $username! [ <a href=\"modules.php?name=Your_Account&op=logout\"><b>Logout</b></a> ]";
  63.     } else {
  64.     $bienvenida = "<a href=\"modules.php?name=Your_Account&op=new_user\">Create an Account</a>";
  65.     }
  66.     $topics_list = "<select name=\"topic\" onChange='submit()'>\n";
  67.     $topics_list .= "<option value=\"\">All Topics</option>\n";
  68.     $toplist = sql_query("select topicid, topictext from $prefix"._topics." order by topictext", $dbi);
  69.     while(list($topicid, $topics) = sql_fetch_row($toplist, $dbi)) {
  70.     if ($topicid==$topic) { $sel = "selected "; }
  71.     $topics_list .= "<option $sel value=\"$topicid\">$topics</option>\n";
  72.     $sel = "";
  73.     }
  74.     echo "<center><a href=\"index.php\"><img src=\"themes/Sand_Journey/images/LogoLeft.gif\" alt=\"Welcome to $sitename\" title=\"Welcome to $sitename\" border=\"0\"></a><br><br></center>"
  75.     ."<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\" align=\"center\" bgcolor=\"$bgcolor1\"><tr><td align=\"center\">"
  76.     ."<form action=\"modules.php?name=Search\" method=\"post\">"
  77.     ."<font class=\"content\"><b>Search</b> <input type=\"text\" size=\"15\" name=\"query\">  <b>in</b>  $topics_list</font>"
  78.     ."</select>"
  79.     ."</form>"
  80.     ."</td></tr></table>"
  81.     ."<br>"
  82.     ."<table border=\"0 cellpadding=\"4\" cellspacing=\"0\" width=\"100%\" align=\"center\">\n"
  83.     ."<tr><td bgcolor=\"$bgcolor2\" align=\"left\" width=\"20%\"> $bienvenida</td>"
  84.     ."<td bgcolor=\"$bgcolor2\" align=\"center\" width=\"60%\"><a href=\"index.php\">Home</a> | <a href=\"modules.php?name=Submit_News\">Submit News</a> | <a href=\"modules.php?name=Your_Account\">Your Account</a> | <a href=\"modules.php?name=Content\">Content</a> | <a href=\"modules.php?name=Topics\">Topics</a> | <a href=\"modules.php?name=Top\">Top 10</a></td>\n"
  85.     ."<td bgcolor=\"$bgcolor2\" align=\"right\" width=\"20%\">"
  86.         ."<b><script type=\"text/javascript\">\n\n"
  87.         ."<!--   // Array ofmonth Names\n"
  88.         ."var monthNames = new Array( \""._JANUARY."\",\""._FEBRUARY."\",\""._MARCH."\",\""._APRIL."\",\""._MAY."\",\""._JUNE."\",\""._JULY."\",\""._AUGUST."\",\""._SEPTEMBER."\",\""._OCTOBER."\",\""._NOVEMBER."\",\""._DECEMBER."\");\n"
  89.         ."var now = new Date();\n"
  90.         ."thisYear = now.getYear();\n"
  91.         ."if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem\n"
  92.         ."document.write(monthNames[now.getMonth()] + \" \" + now.getDate() + \", \" + thisYear);\n"
  93.         ."// -->\n\n"
  94.         ."</script></b> \n"
  95.     ."</td></tr>\n"
  96.         ."<tr><td valign=\"top\" width=\"100%\" colspan=3>\n"
  97. ;
  98.     $public_msg = public_message();
  99.         echo "$public_msg<br>";
  100.     echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"100%\"><tr><td valign=\"top\" width=\"150\" bgcolor=$bgcolor1>";
  101.     blocks(left);
  102.     echo "<img src=\"images/pix.gif\" border=\"0\" width=\"150\" height=\"1\"></td><td>  </td><td width=\"100%\" valign=\"top\">";
  103. }
  104.  
  105. function themefooter() {
  106.     global $index, $bgcolor1, $bgcolor2, $bgcolor3;
  107.     if ($index == 1) {
  108.     echo "</td><td>  </td><td valign=\"top\" bgcolor=$bgcolor1>";
  109.     blocks(right);
  110.     echo "</td>";
  111.     }
  112.     echo "</td></tr></table></td></tr></table>";
  113.     echo "<center>";
  114.     footmsg();
  115.     echo "</center>";
  116. }
  117.  
  118. function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
  119.     global $tipath, $anonymous, $bgcolor1, $bgcolor2, $bgcolor3;
  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.     echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" bgcolor=$bgcolor3 width=\"100%\"><tr><td>"
  127.         ."<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" width=\"100%\"><tr><td bgcolor=$bgcolor2>"
  128.         ."<font class=\"title\">$title</font><br>"
  129.         ."<font size=\"1\">"
  130.     ."$time "._BY." "
  131.         ."<b>";
  132.     formatAidHeader($aid);
  133.     echo "</b> ($counter "._READS.")</font></td></tr>"
  134.     ."<tr><td bgcolor=$bgcolor1><a href=\"modules.php?name=News&new_topic=$topic\"><img src=\"$t_image\" align=\"right\" border=\"0\" alt=\"$topictext\" title=\"$topictext\"></a>";
  135.     FormatStory($thetext, $notes, $aid, $informant);
  136.     echo "<br>"
  137.         ."</td></tr><tr><td bgcolor=$bgcolor1 align=\"right\">"
  138.         ."<font size=\"2\">$morelink</font>"
  139.         ."</td></tr></table></td></tr></table>"
  140.     ."<br>";
  141. }
  142.  
  143. function themearticle ($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext) {
  144.     global $admin, $sid, $tipath, $bgcolor1, $bgcolor2, $bgcolor3;
  145.     $ThemeSel = get_theme();
  146.     if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
  147.     $t_image = "themes/$ThemeSel/images/topics/$topicimage";
  148.     } else {
  149.     $t_image = "$tipath$topicimage";
  150.     }
  151.     if ("$aid" == "$informant") {
  152.     echo"
  153.     <table border=0 cellpadding=0 cellspacing=0 align=center bgcolor=$bgcolor3 width=100%><tr><td>
  154.     <table border=0 cellpadding=3 cellspacing=1 width=100%><tr><td bgcolor=$bgcolor2>
  155.     <font class=\"title\">$title</font><br>"._POSTEDON." $datetime
  156.     <br>"._TOPIC.": <a href=modules.php?name=News&new_topic=$topic>$topictext</a>
  157.     </td></tr><tr><td bgcolor=$bgcolor1>
  158.     <a href=\"modules.php?name=News&new_topic=$topic\"><img src=\"$t_image\" border=\"0\" alt=\"$topictext\" title=\"$topictext\" align=\"right\"></a>$thetext
  159.     </td></tr></table></td></tr></table><br>";
  160.     } else {
  161.     if($informant != "") $informant = "<a href=\"modules.php?name=Your_Account&op=userinfo&uname=$informant\">$informant</a> ";
  162.     else $boxstuff = "$anonymous ";
  163.     $boxstuff .= ""._WRITES." <i>\"$thetext\"</i> $notes";
  164.     echo "
  165.     <table border=0 cellpadding=0 cellspacing=0 align=center bgcolor=$bgcolor3 width=100%><tr><td>
  166.     <table border=0 cellpadding=3 cellspacing=1 width=100%><tr><td bgcolor=$bgcolor2>
  167.     <font class=\"title\">$title</b></font><p>"._CONTRIBUTEDBY." $informant "._ON." $datetime</font>
  168.     </td></tr><tr><td bgcolor=$bgcolor1>
  169.     <a href=\"modules.php?name=News&new_topic=$topic\"><img src=\"$t_image\" border=\"0\" alt=\"$topictext\" title=\"$topictext\" align=\"right\"></a>$thetext
  170.     </td></tr></table></td></tr></table><br>";
  171.     }
  172. }
  173.  
  174. function themesidebox($title, $content) {
  175.     global $bgcolor1, $bgcolor2, $bgcolor3;
  176.     echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"150\" bgcolor=\"$bgcolor3\">\n"
  177.     ."<tr><td>\n"
  178.         ."<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\">\n"
  179.     ."<tr><td bgcolor=$bgcolor2>"
  180.         ."<font class=\"boxtitle\">$title</font></td></tr><tr><td bgcolor=\"$bgcolor1\"><font size=\"2\">"
  181.         ."$content"
  182.     ."</font></td></tr></table></td></tr></table><br>";
  183. }
  184.  
  185. ?>
  186.