PageRenderTime 25ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/nuke/themes/Odyssey/theme.php

https://github.com/lucasgoicoechea/prolab
PHP | 244 lines | 175 code | 17 blank | 52 comment | 41 complexity | 62b3de85477b3bc500f6994acd604212 MD5 | raw file
  1. <?php
  2. /************************************************************/
  3. /* IMPORTANT NOTE FOR THEMES DEVELOPERS! */
  4. /* */
  5. /* When you start cOdysseyng your theme, if you want to */
  6. /* distribute it, please double check it to fit the HTML */
  7. /* 4.01 Transitional Standard. You can use the W3 validator */
  8. /* located at http://validator.w3.org */
  9. /* If you don't know where to start with your theme, just */
  10. /* start mOdysseyfying this theme, it's validate and is cool*/
  11. /************************************************************/
  12. /************************************************************/
  13. /* Theme Colors Definition */
  14. /* */
  15. /* Define colors for your web site. $bgcolor2 is generaly */
  16. /* used for the tables border as you can see on OpenTable() */
  17. /* function, $bgcolor1 is for the table background and the */
  18. /* other two bgcolor variables follows the same criteria. */
  19. /* $texcolor1 and 2 are for tables internal texts */
  20. /************************************************************/
  21. global $loonr, $prefix, $db, $kokku;
  22. $kokku = $db->sql_numrows($db->sql_query("select * from ".$prefix."_stories LIMIT 0, 30 "));
  23. $bgcolor1 = "#FFFFFF";
  24. $bgcolor2 = "#00BBCC";
  25. $bgcolor3 = "#ffffff";
  26. $bgcolor4 = "#ffffff";
  27. $textcolor1 = "#000000";
  28. $textcolor2 = "#000000";
  29. if ($loonr == "") {
  30. $loonr = "0";
  31. }
  32. include("themes/Odyssey/tables.php");
  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. function themeheader() {
  41. global $user, $banners, $sitename, $slogan, $cookie, $prefix, $db;
  42. cookiedecode($user);
  43. $username = $cookie[1];
  44. if ($username == "") {
  45. $username = "Anonymous";
  46. }
  47. echo "<body bgcolor=\"#004080\" text=\"#000000\" link=\"#004080\" vlink=\"#004080\" alink=\"#004080\">";
  48. if ($banners) {
  49. include("banners.php");
  50. }
  51. $topics_list = "<select name=\"topic\" onChange='submit()'>\n";
  52. $topics_list .= "<option value=\"\">All Topics</option>\n";
  53. $toplist = $db->sql_query("select topicid, topictext from ".$prefix."_topics order by topictext");
  54. while(list($topicid, $topics) = $db->sql_fetchrow($toplist)) {
  55. $topicid = intval($topicid);
  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 = "&nbsp;&nbsp;<a href=\"modules.php?name=Your_Account\">Create an account";
  62. } else {
  63. $theuser = "&nbsp;&nbsp;Welcome $username!";
  64. }
  65. $public_msg = public_message();
  66. $tmpl_file = "themes/Odyssey/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/Odyssey/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. /* Function themefooter() */
  82. /* */
  83. /* Control the footer for your site. You don't need to */
  84. /* close BODY and HTML tags at the end. In some part call */
  85. /* the function for right blocks with: blocks(right); */
  86. /* Also, $index variable need to be global and is used to */
  87. /* determine if the page your're viewing is the Homepage or */
  88. /* and internal one. */
  89. /************************************************************/
  90. function themefooter() {
  91. global $index, $foot1, $foot2, $foot3, $foot4;
  92. if ($index == 1) {
  93. $tmpl_file = "themes/Odyssey/center_right.html";
  94. $thefile = implode("", file($tmpl_file));
  95. $thefile = addslashes($thefile);
  96. $thefile = "\$r_file=\"".$thefile."\";";
  97. eval($thefile);
  98. print $r_file;
  99. blocks(right);
  100. }
  101. $footer_message = "$foot1<br>$foot2<br>$foot3<br>$foot4";
  102. $tmpl_file = "themes/Odyssey/footer.html";
  103. $thefile = implode("", file($tmpl_file));
  104. $thefile = addslashes($thefile);
  105. $thefile = "\$r_file=\"".$thefile."\";";
  106. eval($thefile);
  107. print $r_file;
  108. }
  109. /************************************************************/
  110. /* Function themeindex() */
  111. /* */
  112. /* This function format the stories on the Homepage */
  113. /************************************************************/
  114. function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
  115. global $anonymous, $tipath, $cookie, $loonr, $vasak, $parem, $kokku, $storyhome, $storynum;
  116. $ThemeSel = get_theme();
  117. if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
  118. $t_image = "themes/$ThemeSel/images/topics/$topicimage";
  119. } else {
  120. $t_image = "$tipath$topicimage";
  121. }
  122. $loonr = ($loonr+1);
  123. if (isset($cookie[3])) {
  124. $storynum = $cookie[3];
  125. } else {
  126. $storynum = $storyhome;
  127. }
  128. $ridaaa1 = round($loonr/2);
  129. if ($notes != "") {
  130. $notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
  131. } else {
  132. $notes = "";
  133. }
  134. if ("$aid" == "$informant") {
  135. $content = "$thetext$notes\n";
  136. } else {
  137. if($informant != "") {
  138. $content = "<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$informant\">$informant</a> ";
  139. } else {
  140. $content = "$anonymous ";
  141. }
  142. $content .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
  143. }
  144. $posted = ""._POSTEDBY." ";
  145. $posted .= get_author($aid);
  146. $posted .= " "._ON." $time $timezone ($counter "._READS.")";
  147. if (($ridaaa1*2) != $loonr) {
  148. $tmpl_file = "themes/Odyssey/story_home.html";
  149. $thefile = implode("", file($tmpl_file));
  150. $thefile = addslashes($thefile);
  151. $thefile = "\$r_file=\"".$thefile."\";";
  152. eval($thefile);
  153. $vasak .= "$r_file";
  154. } else {
  155. $tmpl_file = "themes/Odyssey/story_home.html";
  156. $thefile = implode("", file($tmpl_file));
  157. $thefile = addslashes($thefile);
  158. $thefile = "\$r_file=\"".$thefile."\";";
  159. eval($thefile);
  160. $parem .= "$r_file";
  161. }
  162. if ($loonr == $storynum OR $loonr == $kokku) {
  163. echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
  164. echo "<tr>";
  165. echo "<td width=\"49%\" valign=\"top\">";
  166. print $vasak;
  167. echo "</td>";
  168. echo "<td width=\"5\" cellpadding=\"0\" cellspacing=\"0\" valign=\"top\"></td>";
  169. echo "<td width=\"49%\" valign=\"top\">";
  170. print $parem;
  171. echo "</td>";
  172. echo "</tr>";
  173. echo "</table>";
  174. }
  175. }
  176. /************************************************************/
  177. /* Function themeindex() */
  178. /* */
  179. /* This function format the stories on the story page, when */
  180. /* you click on that "Read More..." link in the home */
  181. /************************************************************/
  182. function themearticle ($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext) {
  183. global $admin, $sid, $tipath;
  184. $ThemeSel = get_theme();
  185. if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
  186. $t_image = "themes/$ThemeSel/images/topics/$topicimage";
  187. } else {
  188. $t_image = "$tipath$topicimage";
  189. }
  190. $posted = ""._POSTEDON." $datetime "._BY." ";
  191. $posted .= get_author($aid);
  192. if ($notes != "") {
  193. $notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
  194. } else {
  195. $notes = "";
  196. }
  197. if ("$aid" == "$informant") {
  198. $content = "$thetext$notes\n";
  199. } else {
  200. if($informant != "") {
  201. $content = "<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$informant\">$informant</a> ";
  202. } else {
  203. $content = "$anonymous ";
  204. }
  205. $content .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
  206. }
  207. $tmpl_file = "themes/Odyssey/story_page.html";
  208. $thefile = implode("", file($tmpl_file));
  209. $thefile = addslashes($thefile);
  210. $thefile = "\$r_file=\"".$thefile."\";";
  211. eval($thefile);
  212. print $r_file;
  213. }
  214. /************************************************************/
  215. /* Function themesidebox() */
  216. /* */
  217. /* Control look of your blocks. Just simple. */
  218. /************************************************************/
  219. function themesidebox($title, $content) {
  220. $tmpl_file = "themes/Odyssey/blocks.html";
  221. $thefile = implode("", file($tmpl_file));
  222. $thefile = addslashes($thefile);
  223. $thefile = "\$r_file=\"".$thefile."\";";
  224. eval($thefile);
  225. print $r_file;
  226. }
  227. ?>