Author
Message
kd8hho Worker Joined: Mar 30, 2009 Posts: 105
Posted:
Mon Aug 10, 2009 12:25 am
testing a theme (nukecodes black-enuff-red) via my test account. theme comes up blank...
theme.php below.
Code:
<?php
/************************************************************/
/* Theme Name: Black_Enuff_Red */
/* Theme Design: http://nukecode.com */
/* */
/* */
/************************************************************/
/************************************************************/
/* Theme Colors Definition */
/* */
/* Define colors for your web site. $bgcolor2 is generaly */
/* used for the tables border as you can see on OpenTable() */
/* function, $bgcolor1 is for the table background and the */
/* other two bgcolor variables follows the same criteria. */
/* $texcolor1 and 2 are for tables internal texts */
/************************************************************/
$bgcolor1 = "000000";
$bgcolor2 = "333333";
$bgcolor3 = "000000";
$bgcolor4 = "000000";
$textcolor1 = "#ffffff";
$textcolor2 = "#ffffff";
include("themes/Black_Enuff_Red/tables.php");
/************************************************************/
/* Function themeheader() */
/* */
/* Control the header for your site. You need to define the */
/* BODY tag and in some part of the code call the blocks */
/* function for left side with: blocks(left); */
/************************************************************/
function themeheader() {
global $user, $banners, $sitename, $slogan, $cookie, $prefix, $dbi;
//Up-Quote for 7.7+
//$myban = ads(0);
//End Un-Quote
cookiedecode($user);
$username = $cookie[1];
if ($username == "") {
$username = "Anonymous";
}
echo "<body bgcolor=\"000000\" text=\"#ffffff\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">";
//Quote out for 7.7+
if ($banners == 1) {
include("banners.php");}
//End quote out for 7.7+
$topics_list = "<select name=\"new_topic\" onChange='submit()'>\n";
$topics_list .= "<option value=\"\">All Topics</option>\n";
$toplist = sql_query("select topicid, topictext from ".$prefix."_topics order by topictext", $dbi);
while(list($topicid, $topics) = sql_fetch_row($toplist, $dbi)) {
if ($topicid==$topic) { $sel = "selected "; }
$topics_list .= "<option $sel value=\"$topicid\">$topics</option>\n";
$sel = "";
}
if ($username == "Anonymous") {
$theuser = "<table><tr><td><form action=\"modules.php?name=Your_Account\" method=\"post\"> <input type=\"text\" name=\"username\" value=\"Username\" onFocus=\"if(this.value=='Username')this.value='';\" value style=\"width:70;height:18;FONT-SIZE: 10px; color:#cecece;\"></td><td><input type=\"password\" name=\"user_password\" value=\"password\" onFocus=\"if(this.value=='password')this.value='';\" value style=\"width:70;height:18;FONT-SIZE: 10px; color:#cecece;\"></td><td><input type=\"hidden\" name=\"random_num\" value=\"$random_num\"><input type=\"hidden\" name=\"gfx_check\" value=\"$code\"><input type=\"hidden\" name=\"op\" value=\"login\"><input type=\"submit\" value=\"login\"></td></form></table></font>\n";
} else { $theuser = " <b>Hello $username!</b></font> <b> <a href=\"modules.php?name=Your_Account&op=logout\"><font class=\"header\">logout</font></b></a>";
}
$tmpl_file = "themes/Black_Enuff_Red/header.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
blocks(left);
$tmpl_file = "themes/Black_Enuff_Red/left_center.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
/************************************************************/
/* Function themefooter() */
/* */
/* Control the footer for your site. You don't need to */
/* close BODY and HTML tags at the end. In some part call */
/* the function for right blocks with: blocks(right); */
/* Also, $index variable need to be global and is used to */
/* determine if the page your're viewing is the Homepage or */
/* and internal one. */
/************************************************************/
function themefooter() {
global $index, $user, $banners, $cookie, $prefix, $dbi, $db, $total_time, $start_time, $admin, $adminmail, $nukeurl, $foot1, $foot2, $foot3, $foot4;
if ($banners == 0) {
opentable2();
include("banners.php");
closetable2();
}
$maxshow = 10; // Number of downloads to display in the block.
$a = 1;
$result = sql_query("select lid, title, hits from ".$prefix."_downloads_downloads order by date DESC limit 0,$maxshow", $dbi);
while(list($lid, $title, $hits) = sql_fetch_row($result, $dbi)) {
$title2 = ereg_replace("_", " ", "<b>$title</b>");
$show .= " $a: <a href=\"modules.php?name=Downloads&d_op=viewdownloaddetails&lid=$lid&title=$title\">$title2</a><br> <b><font color=\"#FFFFFF\">$hits</b><font color=\"#FFFFEE\"> times<br>";
$showdownloads = " <A name= \"scrollingCodedownloads\"></A><MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"114\" scrollamount= \"2\" scrolldelay= \"90\" onmouseover='this.stop()' onmouseout='this.start()'><table width=\"100%\"><tr> <td></td></tr>$show</table></marquee>";
$a++;
}
$maxshow = 10; // Number of web links to display in the block.
$a = 1;
$result = sql_query("select lid, title, hits from ".$prefix."_links_links order by date DESC limit 0,$maxshow", $dbi);
while(list($lid, $title, $hits) = sql_fetch_row($result, $dbi)) {
$title2 = ereg_replace("_", " ", "<b>$title</b>");
$show2 .= " $a: <a href=\"links.html&l_op=viewlinkdetails&lid=$lid&ttitle=$title\">$title2</a><br> <b><font color=\"#FFFFFF\">$hits</b><font color=\"#FFFFEE\"> times<br>";
$showlinks = " <A name= \"scrollingCodeweblinks\"></A><MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"114\" scrollamount= \"2\" scrolldelay= \"90\" onmouseover='this.stop()' onmouseout='this.start()'><table width=\"100%\"><tr> <td></td></tr>$show2</table>";
$a++;
}
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$end_time = $mtime;
$total_time = ($end_time - $start_time);
$total_time = ""._PAGEGENERATION." ".substr($total_time,0,5)." "._SECONDS."";
//Without Patched 3.1
//if ($index == 1) {
//With Patched 3.1
if (defined('INDEX_FILE')) {
$tmpl_file = "themes/Black_Enuff_Red/left_center.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
blocks(right);
}
$footer_message = "$foot1<br>$foot2<br>$foot3<br>$foot4";
$tmpl_file = "themes/Black_Enuff_Red/footer.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
/************************************************************/
/* Function themeindex() */
/* */
/* This function format the stories on the Homepage */
/************************************************************/
function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
global $anonymous, $tipath;
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
$t_image = "themes/$ThemeSel/images/topics/$topicimage";
} else {
$t_image = "$tipath$topicimage";
}
if ($notes != "") {
$notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
} else {
$notes = "";
}
if ("$aid" == "$informant") {
$content = "$thetext$notes\n";
} else {
if($informant != "") {
$content = "<a href=\"modules.php?name=Your_Account&op=userinfo&uname=$informant\">$informant</a> ";
} else {
$content = "$anonymous ";
}
$content .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
}
$posted = ""._POSTEDBY." ";
$posted .= get_author($aid);
$posted .= " "._ON." $time $timezone ($counter "._READS.")";
$tmpl_file = "themes/Black_Enuff_Red/story_home.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
/************************************************************/
/* Function themearticle() */
/* */
/* This function format the stories on the story page, when */
/* you click on that "Read More..." link in the home */
/************************************************************/
function themearticle ($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext) {
global $admin, $sid, $tipath;
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
$t_image = "themes/$ThemeSel/images/topics/$topicimage";
} else {
$t_image = "$tipath$topicimage";
}
$posted = ""._POSTEDON." $datetime "._BY." ";
$posted .= get_author($aid);
if ($notes != "") {
$notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
} else {
$notes = "";
}
if ("$aid" == "$informant") {
$content = "$thetext$notes\n";
} else {
if($informant != "") {
$content = "<a href=\"modules.php?name=Your_Account&op=userinfo&username=$informant\">$informant</a> ";
} else {
$content = "$anonymous ";
}
$content .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
}
$tmpl_file = "themes/Black_Enuff_Red/story_page.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
/************************************************************/
/* Function themesidebox() */
/* */
/* Control look of your blocks. Just simple. */
/************************************************************/
function themesidebox($title, $content) {
$tmpl_file = "themes/Black_Enuff_Red/blocks.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
?>
any ideas?
Susann Moderator Joined: Dec 19, 2004 Posts: 3132 Location: Germany:Moderator German NukeSentinel Support
Posted:
Mon Aug 10, 2009 2:26 am
Search for $dbi also turn error reporting on in config.php
mantasledge New Member Joined: Oct 25, 2008 Posts: 12
Posted:
Mon Aug 10, 2009 2:39 am
Is $dbi the problem?
I have the same problem and have searched for $dbi (found multiply times)
Is there a fix for this?
jakec Site Admin Joined: Feb 06, 2006 Posts: 3028 Location: United Kingdom
Posted:
Mon Aug 10, 2009 6:23 am
Yes, the database layer has changed.
There is a fix in the forums here, which is what Susann is alluding too.
kd8hho Worker Joined: Mar 30, 2009 Posts: 105
Posted:
Mon Aug 10, 2009 2:12 pm
ok i was missing a sql_fetch_row query conversion.
also the
Code: include("banners.php");}
was messing it up. commenting it out fixed the errors (blank page)
so now the whole code
Code:
<?php
/************************************************************/
/* Theme Name: Black_Enuff_Red */
/* Theme Design: http://nukecode.com */
/* */
/* */
/************************************************************/
/************************************************************/
/* Theme Colors Definition */
/* */
/* Define colors for your web site. $bgcolor2 is generaly */
/* used for the tables border as you can see on OpenTable() */
/* function, $bgcolor1 is for the table background and the */
/* other two bgcolor variables follows the same criteria. */
/* $texcolor1 and 2 are for tables internal texts */
/************************************************************/
$bgcolor1 = "000000";
$bgcolor2 = "333333";
$bgcolor3 = "000000";
$bgcolor4 = "000000";
$textcolor1 = "#ffffff";
$textcolor2 = "#ffffff";
include("themes/Black_Enuff_Red/tables.php");
/************************************************************/
/* Function themeheader() */
/* */
/* Control the header for your site. You need to define the */
/* BODY tag and in some part of the code call the blocks */
/* function for left side with: blocks(left); */
/************************************************************/
function themeheader() {
global $user, $banners, $sitename, $slogan, $cookie, $prefix, $db;
//Up-Quote for 7.7+
//$myban = ads(0);
//End Un-Quote
cookiedecode($user);
$username = $cookie[1];
if ($username == "") {
$username = "Anonymous";
}
echo "<body bgcolor=\"000000\" text=\"#ffffff\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">";
//Quote out for 7.7+
// if ($banners == 1) {
// include("banners.php");}
//End quote out for 7.7+
$topics_list = "<select name=\"new_topic\" onChange='submit()'>\n";
$topics_list .= "<option value=\"\">All Topics</option>\n";
$toplist = $db->sql_query("select topicid, topictext from ".$prefix."_topics order by topictext");
while(list($topicid, $topics) = $db->sql_fetchrow($toplist)) {
if ($topicid==$topic) { $sel = "selected "; }
$topics_list .= "<option $sel value=\"$topicid\">$topics</option>\n";
$sel = "";
}
if ($username == "Anonymous") {
$theuser = "<table><tr><td><form action=\"modules.php?name=Your_Account\" method=\"post\"> <input type=\"text\" name=\"username\" value=\"Username\" onFocus=\"if(this.value=='Username')this.value='';\" value style=\"width:70;height:18;FONT-SIZE: 10px; color:#cecece;\"></td><td><input type=\"password\" name=\"user_password\" value=\"password\" onFocus=\"if(this.value=='password')this.value='';\" value style=\"width:70;height:18;FONT-SIZE: 10px; color:#cecece;\"></td><td><input type=\"hidden\" name=\"random_num\" value=\"$random_num\"><input type=\"hidden\" name=\"gfx_check\" value=\"$code\"><input type=\"hidden\" name=\"op\" value=\"login\"><input type=\"submit\" value=\"login\"></td></form></table></font>\n";
} else { $theuser = " <b>Hello $username!</b></font> <b> <a href=\"modules.php?name=Your_Account&op=logout\"><font class=\"header\">logout</font></b></a>";
}
$tmpl_file = "themes/Black_Enuff_Red/header.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
blocks(left);
$tmpl_file = "themes/Black_Enuff_Red/left_center.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
/************************************************************/
/* Function themefooter() */
/* */
/* Control the footer for your site. You don't need to */
/* close BODY and HTML tags at the end. In some part call */
/* the function for right blocks with: blocks(right); */
/* Also, $index variable need to be global and is used to */
/* determine if the page your're viewing is the Homepage or */
/* and internal one. */
/************************************************************/
function themefooter() {
global $index, $user, $banners, $cookie, $prefix, $db, $total_time, $start_time, $admin, $adminmail, $nukeurl, $foot1, $foot2, $foot3, $foot4;
if ($banners == 0) {
opentable2();
include("banners.php");
closetable2();
}
$maxshow = 10; // Number of downloads to display in the block.
$a = 1;
$result = $db->sql_query("select lid, title, hits from ".$prefix."_downloads_downloads order by date DESC limit 0,$maxshow");
while(list($lid, $title, $hits) = $db->sql_fetchrow($result)) {
$title2 = ereg_replace("_", " ", "<b>$title</b>");
$show .= " $a: <a href=\"modules.php?name=Downloads&d_op=viewdownloaddetails&lid=$lid&title=$title\">$title2</a><br> <b><font color=\"#FFFFFF\">$hits</b><font color=\"#FFFFEE\"> times<br>";
$showdownloads = " <A name= \"scrollingCodedownloads\"></A><MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"114\" scrollamount= \"2\" scrolldelay= \"90\" onmouseover='this.stop()' onmouseout='this.start()'><table width=\"100%\"><tr> <td></td></tr>$show</table></marquee>";
$a++;
}
$maxshow = 10; // Number of web links to display in the block.
$a = 1;
$result = $db->sql_query("select lid, title, hits from ".$prefix."_links_links order by date DESC limit 0,$maxshow");
while(list($lid, $title, $hits) = $db->sql_fetchrow($result)) {
$title2 = ereg_replace("_", " ", "<b>$title</b>");
$show2 .= " $a: <a href=\"links.html&l_op=viewlinkdetails&lid=$lid&ttitle=$title\">$title2</a><br> <b><font color=\"#FFFFFF\">$hits</b><font color=\"#FFFFEE\"> times<br>";
$showlinks = " <A name= \"scrollingCodeweblinks\"></A><MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"114\" scrollamount= \"2\" scrolldelay= \"90\" onmouseover='this.stop()' onmouseout='this.start()'><table width=\"100%\"><tr> <td></td></tr>$show2</table>";
$a++;
}
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$end_time = $mtime;
$total_time = ($end_time - $start_time);
$total_time = ""._PAGEGENERATION." ".substr($total_time,0,5)." "._SECONDS."";
//Without Patched 3.1
//if ($index == 1) {
//With Patched 3.1
if (defined('INDEX_FILE')) {
$tmpl_file = "themes/Black_Enuff_Red/left_center.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
blocks(right);
}
$footer_message = "$foot1<br>$foot2<br>$foot3<br>$foot4";
$tmpl_file = "themes/Black_Enuff_Red/footer.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
/************************************************************/
/* Function themeindex() */
/* */
/* This function format the stories on the Homepage */
/************************************************************/
function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
global $anonymous, $tipath;
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
$t_image = "themes/$ThemeSel/images/topics/$topicimage";
} else {
$t_image = "$tipath$topicimage";
}
if ($notes != "") {
$notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
} else {
$notes = "";
}
if ("$aid" == "$informant") {
$content = "$thetext$notes\n";
} else {
if($informant != "") {
$content = "<a href=\"modules.php?name=Your_Account&op=userinfo&uname=$informant\">$informant</a> ";
} else {
$content = "$anonymous ";
}
$content .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
}
$posted = ""._POSTEDBY." ";
$posted .= get_author($aid);
$posted .= " "._ON." $time $timezone ($counter "._READS.")";
$tmpl_file = "themes/Black_Enuff_Red/story_home.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
/************************************************************/
/* Function themearticle() */
/* */
/* This function format the stories on the story page, when */
/* you click on that "Read More..." link in the home */
/************************************************************/
function themearticle ($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext) {
global $admin, $sid, $tipath;
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
$t_image = "themes/$ThemeSel/images/topics/$topicimage";
} else {
$t_image = "$tipath$topicimage";
}
$posted = ""._POSTEDON." $datetime "._BY." ";
$posted .= get_author($aid);
if ($notes != "") {
$notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
} else {
$notes = "";
}
if ("$aid" == "$informant") {
$content = "$thetext$notes\n";
} else {
if($informant != "") {
$content = "<a href=\"modules.php?name=Your_Account&op=userinfo&username=$informant\">$informant</a> ";
} else {
$content = "$anonymous ";
}
$content .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
}
$tmpl_file = "themes/Black_Enuff_Red/story_page.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
/************************************************************/
/* Function themesidebox() */
/* */
/* Control look of your blocks. Just simple. */
/************************************************************/
function themesidebox($title, $content) {
$tmpl_file = "themes/Black_Enuff_Red/blocks.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
?>
so if anyone else having a issue like this could look and maybe fix there problem
Last edited by kd8hho on Mon Aug 10, 2009 3:29 pm; edited 1 time in total
wHiTeHaT Involved Joined: Jul 18, 2004 Posts: 431 Location: Netherlands
Posted:
Mon Aug 10, 2009 2:14 pm
can you send me the theme?
evaders99 Former Moderator in Good Standing Joined: Apr 30, 2004 Posts: 3221
Posted:
Mon Aug 10, 2009 7:11 pm
All you should need is
to get the theme to work with the new Advertising module
View next topic
View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum