I would like to port that same idea over to .723, but with the changes in the way the database is accessed, it doesn't work as a straight copy/paste.
Here is an example of the code:
Code
function themecenterbox($title, $content) {
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"
."<tr><td>"
."<b><font class=\"pn-normal\">$title</font></b></td></tr>"
."<tr><td>"
."<font class=\"pn-sub\">";
if (file_exists($content)) {
$fp = fopen ($content, "r");
$content = fread($fp, filesize($content));
fclose ($fp);
$content = "?><font class=\"pn-normal\">$content</font><?";
echo eval($content);
} else {
echo $content;
}
echo "</font>"
."</td></tr></table><br>";
}
function recentheadlines() {
global $pntable;
$query="SELECT pn_sid, pn_title, left(time,10) FROM $pntable[stories] ORDER BY time DESC LIMIT 5";
$result=mysql_query($query);
$title .= "<FONT class=\"pn-title\"><A href=search.php?min=32&type=stories&category=><img src=\"themes/pcmodeler/images/latest_news.gif\" width=\"96\" height=\"14\" alt=\"Show me the News\" border=\"0\"></A></FONT>";
$title .= "<FONT class=\"pn-tiny\"><A href=modules.php?op=modload&name=Submit_News&file=index><img src=\"themes/pcmodeler/images/submit_news.gif\" width=\"116\" height=\"14\" alt=\"Submit a News Item\" border=\"0\"></A></FONT>";
while (list($sid, $headlinetitle, $time) = mysql_fetch_row($result)) {
if(strlen($headlinetitle) > 35) {
$headlinetitle = substr($headlinetitle,0,35);
$headlinetitle .= "..";
}
$content .= "<dt><FONT class=pn-tiny><img src=\"themes/pcmodeler/images/tag.gif\" width=\"10\" height=\"10\"border=\"0\">[$time] <A href=modules.php?op=modload&name=News&file=article&sid=$sid>$headlinetitle</A></FONT>";
}
themecenterbox($title, $content);
}
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"
."<tr><td>"
."<b><font class=\"pn-normal\">$title</font></b></td></tr>"
."<tr><td>"
."<font class=\"pn-sub\">";
if (file_exists($content)) {
$fp = fopen ($content, "r");
$content = fread($fp, filesize($content));
fclose ($fp);
$content = "?><font class=\"pn-normal\">$content</font><?";
echo eval($content);
} else {
echo $content;
}
echo "</font>"
."</td></tr></table><br>";
}
function recentheadlines() {
global $pntable;
$query="SELECT pn_sid, pn_title, left(time,10) FROM $pntable[stories] ORDER BY time DESC LIMIT 5";
$result=mysql_query($query);
$title .= "<FONT class=\"pn-title\"><A href=search.php?min=32&type=stories&category=><img src=\"themes/pcmodeler/images/latest_news.gif\" width=\"96\" height=\"14\" alt=\"Show me the News\" border=\"0\"></A></FONT>";
$title .= "<FONT class=\"pn-tiny\"><A href=modules.php?op=modload&name=Submit_News&file=index><img src=\"themes/pcmodeler/images/submit_news.gif\" width=\"116\" height=\"14\" alt=\"Submit a News Item\" border=\"0\"></A></FONT>";
while (list($sid, $headlinetitle, $time) = mysql_fetch_row($result)) {
if(strlen($headlinetitle) > 35) {
$headlinetitle = substr($headlinetitle,0,35);
$headlinetitle .= "..";
}
$content .= "<dt><FONT class=pn-tiny><img src=\"themes/pcmodeler/images/tag.gif\" width=\"10\" height=\"10\"border=\"0\">[$time] <A href=modules.php?op=modload&name=News&file=article&sid=$sid>$headlinetitle</A></FONT>";
}
themecenterbox($title, $content);
}
It is then called by placing recentheadlines() in the body.
I get the following error in .723.
Code
mysql_fetch_row(): supplied argument is not a valid mysql result resource in /home/www/pcmodeler/phoenix/themes/V-Sport/theme.php on line 218
Line 218 has this:
