PHP code help
Posted: Tue Jul 22, 2008 1:21 pm
I am working with PHP nuke and I want to move the banner ads on a them up into a table, but I am a newb to PHP coding and could use a little help.
I need to put the code:
up into the table containing the logo.
Here is what I tried to do:
Didn't work. Any help would be greatly appreciated.
Code: Select all
echo "<table cellpadding=\"0\" cellspacing=\"0\" width=\"$thewidth\" border=\"0\" align=\"center\">\n"
."<tr>\n<td background=\"themes/$thename/images/logobg.gif\"><img src=\"themes/$thename/images/logo.gif\" alt=\""._WELCOMETO." $sitename\" border=\"0\" height=\"100\" width=\"350\"></td>\n</tr>\n"
."</table>\n";
}
echo "<table cellpadding=\"0\" cellspacing=\"0\" width=\"$thewidth\" border=\"0\" align=\"center\" bgcolor=\"#fefefe\">\n"
."<tr>\n<td bgcolor=\"$textcolor1\" colspan=\"3\"><IMG src=\"themes/$thename/images/pixel.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\" hspace=\"0\"></td>\n</tr>\n"
."<tr bgcolor=\"$bgcolor1\">\n<td align=\"left\" width=\"33%\"><font size=\"2\" color=\"#363636\">\n";
if ($username == $anonymous) {
echo " <a href=\"user.php?op=new_user\">"._NEWUSER."</a></b> / <b><a href=\"user.php\">"._USERLOGIN."</a>\n";
} else {
echo " "._TWELCOME." $username: <a href=\"user.php\">"._TACCOUNT."</a> | <a href=\"user.php?op=logout\">"._LOGOUT."</a>";
}
echo "</font></td>\n"
." <td align=\"center\" width=\"34%\"><font size=\"2\" color=\"#363636\">\n";
$result = sql_query("select type, var, count from $prefix"._counter." order by type desc", $dbi);
while(list($type, $var, $count) = sql_fetch_row($result, $dbi)) {
if(($type == "total") && ($var == "hits")) {
$total = $count;
echo ""._WERECEIVED." $total "._PAGESVIEWS." $startdate\n";
}
}
echo "</font></td>\n"
."<td align=\"right\" width=\"33%\"><font size=\"2\">\n";
$numrows = sql_num_rows(sql_query("select uid from $prefix"._users."", $dbi), $dbi);
echo " </font>\n</td>\n</tr>\n"
."<tr>\n<td bgcolor=\"$textcolor1\" colspan=\"3\"><IMG src=\"themes/$thename/images/pixel.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\" hspace=\"0\"></td>\n"
."</tr>\n</table>\n"
."<table width=\"$thewidth\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\"><tr valign=\"top\">\n"
."<td><img src=\"themes/$thename/images/pixel.gif\" width=\"1\" height=\"5\" border=\"0\" alt=\"\"></td></tr></table>\n"
."<table width=\"$thewidth\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\"><tr valign=\"top\">\n"
."<td width=\"160\" valign=\"top\">\n";
blocks(left);
echo "</td><td><img src=\"themes/$thename/images/pixel.gif\" width=\"5\" height=\"1\" border=\"0\" alt=\"\"></td><td width=\"100%\" bgcolor=\"$bgcolor1\">\n";
if ($banners) {
OpenTable2();
echo "<center>";
echo ads(0);
echo "</center>";
CloseTable2();
echo "<br>";
}
}Code: Select all
if (banners) { echo ads(0); }Code: Select all
else {
echo "<table cellpadding=\"0\" cellspacing=\"0\" width=\"$thewidth\" border=\"0\" align=\"center\">\n"
."<tr>\n<td background=\"themes/$thename/images/logobg.gif\"><img src=\"themes/$thename/images/logo.gif\" alt=\""._WELCOMETO." $sitename\" border=\"0\" height=\"100\" width=\"350\">[b][color=#BF0000]NEED BANNERS HERE[/color][/b]</td>\n</tr>\n"
."</table>\n";Here is what I tried to do:
Code: Select all
else {
echo "<table cellpadding=\"0\" cellspacing=\"0\" width=\"$thewidth\" border=\"0\" align=\"center\">\n"
."<tr>\n<td background=\"themes/$thename/images/logobg.gif\"><img src=\"themes/$thename/images/logo.gif\" alt=\""._WELCOMETO." $sitename\" border=\"0\" height=\"100\" width=\"350\"><php? if (banners) {echo ads(0); } ?></td>\n</tr>\n"
."</table>\n";