Code:
<?php
function OpenTable() {
global $bgcolor1, $bgcolor2;
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">
<tr>
<td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">
<tr>
<td bgcolor=\"#CCCCCC\"><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" bgcolor=\"#303032\">
<tr>
<td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">
<tr>
<td background=\"themes/Charcoal2/forums/images/bk-z.jpg\" bgcolor=\"#C0C0C0\"><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\">
<tr>
<td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">
<tr>
<td background=\"themes/Charcoal2/forums/images/bk-z.jpg\" bgcolor=\"#8A8C91\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">
<tr>
<td>";
}
function CloseTable() {
echo "</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>";
}
function OpenTable2() {
global $bgcolor1, $bgcolor2;
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"$bgcolor2\" align=\"center\"><tr><td>\n";
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"8\" bgcolor=\"$bgcolor1\"><tr><td>\n";
}
function CloseTable2() {
echo "</td></tr></table></td></tr></table>\n";
}
/************************************************************/
/* 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 $admin, $user, $banners, $sitename, $slogan, $cookie, $prefix, $db, $nukeurl, $anonymous;
if ($banners == 1) {
$numrows = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_banner WHERE type='0' AND active='1'"));
/* Get a random banner if exist any. */
/* More efficient random stuff, thanks to Cristian Arroyo from http://www.planetalinux.com.ar */
if ($numrows>1) {
$numrows = $numrows-1;
mt_srand((double)microtime()*1000000);
$bannum = mt_rand(0, $numrows);
} else {
$bannum = 0;
}
$sql = "SELECT bid, imageurl, clickurl, alttext FROM ".$prefix."_banner WHERE type='0' AND active='1' LIMIT $bannum,1";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$bid = $row[bid];
$imageurl = $row[imageurl];
$clickurl = $row[clickurl];
$alttext = $row[alttext];
if (!is_admin($admin)) {
$db->sql_query("UPDATE ".$prefix."_banner SET impmade=impmade+1 WHERE bid='$bid'");
}
if($numrows>0) {
$sql2 = "SELECT cid, imptotal, impmade, clicks, date FROM ".$prefix."_banner WHERE bid='$bid'";
$result2 = $db->sql_query($sql2);
$row2 = $db->sql_fetchrow($result2);
$cid = $row2[cid];
$imptotal = $row2[imptotal];
$impmade = $row2[impmade];
$clicks = $row2[clicks];
$date = $row2[date];
/* Check if this impression is the last one and print the banner */
if (($imptotal <= $impmade) AND ($imptotal != 0)) {
$db->sql_query("UPDATE ".$prefix."_banner SET active='0' WHERE bid='$bid'");
$sql3 = "SELECT name, contact, email FROM ".$prefix."_bannerclient WHERE cid='$cid'";
$result3 = $db->sql_query($sql3);
$row3 = $db->sql_fetchrow($result3);
$c_name = $row3[name];
$c_contact = $row3[contact];
$c_email = $row3[email];
if ($c_email != "") {
$from = "$sitename <$adminmail>";
$to = "$c_contact <$c_email>";
$message = ""._HELLO." $c_contact:\n\n";
$message .= ""._THISISAUTOMATED."\n\n";
$message .= ""._THERESULTS."\n\n";
$message .= ""._TOTALIMPRESSIONS." $imptotal\n";
$message .= ""._CLICKSRECEIVED." $clicks\n";
$message .= ""._IMAGEURL." $imageurl\n";
$message .= ""._CLICKURL." $clickurl\n";
$message .= ""._ALTERNATETEXT." $alttext\n\n";
$message .= ""._HOPEYOULIKED."\n\n";
$message .= ""._THANKSUPPORT."\n\n";
$message .= "- $sitename "._TEAM."\n";
$message .= "$nukeurl";
$subject = "$sitename: "._BANNERSFINNISHED."";
mail($to, $subject, $message, "From: $from\nX-Mailer: PHP/" . phpversion());
}
}
$showbanners = "<a href=\"banners.php?op=click&bid=$bid\" target=\"_blank\"><img src=\"$imageurl\" border=\"0\" alt='$alttext' title='$alttext'></a><br><br>";
}
}
cookiedecode($user);
$username = $cookie[1];
if ($username == "") {
$username = "Anonymous";
}
echo "<scr ipt type=\"text/javascript\" language=\"Java Script1.2\" src=\"themes/Charcoal2/jscript/imageswap.js\"></sc ript><center>\n\n\n";
echo "<body bgcolor=\"#8A8C91\" text=\"#DCDCDC\" leftmargin=\"10\" topmargin=\"10\" marginwidth=\"10\" marginheight=\"10\">\n";
if ($username == "Anonymous") {
$theuser = " <a href=\"account.html\">"._LOGIN."</a> or <a href=\"account-new_user.html\">"._BREG."</a>\n";
} else {
$theuser = " "._BWEL." $username!";
}
$public_msg = public_message();
echo"$showbanners<table class=\"bodyline\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"> "
. " <tr> "
. " <td align=\"center\" valign=\"top\">\n"
. "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"
. "<tr>\n"
. "<td width=\"349\"><img src=\"themes/Charcoal2/forums/images/logo.jpg\" alt=\"\" height=\"58\" width=\"349\" border=\"0\"></td>\n"
. "<td align=\"right\" width=\"296\"></td>\n"
. "<td> </td>\n"
. "</tr>\n"
. "<tr>\n"
. "<td width=\"349\"><img src=\"themes/Charcoal2/forums/images/slogan.jpg\" alt=\"\" height=\"30\" width=\"349\" border=\"0\"></td>\n"
. "<td> </td>\n"
. "</tr>\n"
. "</table>\n"
. "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"
. "<tr>\n";
if ($username == "Anonymous") {
echo "<td width=\"201\"><a href=\"account.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('login','','themes/Charcoal2/forums/images/login_on.jpg')\"><img src=\"themes/Charcoal2/forums/images/login.jpg\" alt=\"\" name=\"login\" height=\"37\" width=\"201\" border=\"0\"></a></td>\n";
} else {
echo "<td width=\"201\"><a href=\"account-logout.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('login','','themes/Charcoal2/forums/images/login_on.jpg')\"><img src=\"themes/Charcoal2/forums/images/login.jpg\" alt=\"\" name=\"login\" height=\"37\" width=\"201\" border=\"0\"></a></td>\n";
}
echo "<td> </td>\n"
. "</tr>\n"
. "</table>\n"
. "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\">\n"
. " <tr valign=\"top\">\n"
. " <td>$public_msg<img src=\"themes/Charcoal2/images/pixel.gif\" width=\"1\" height=\"1\" border=\"0\" alt=\"\"></td>\n"
. "</tr></table>\n"
. "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\">\n"
. "<tr valign=\"top\">\n"
. " <td valign=\"top\" width=\"1\" background=\"themes/Charcoal2/images/7px.gif\">\n"
. "";
blocks(left);
echo "</td><td valign=\"top\" width=\"100%\">\n";
}
/************************************************************/
/* 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, $foot1, $foot2, $foot3, $foot4, $copyright, $totaltime, $footer_message;
if ($index == 1) {
echo "</td><td valign=\"top\" width=\"165\">\n";
blocks(right);
}
echo"</td>\n"
. "</table>\n"
. "<body>\n"
. "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">\n"
. " <tr>\n"
. " <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">\n"
. " <tr>\n"
. " <td><div align=\"center\"><font class=\"small\">$footer_message</font></div></td>\n"
. " </tr>\n"
. " <tr>\n"
. " <td><div align=\"center\"></div></td>\n"
. " </tr>\n"
. " </table></td>\n"
. " </tr>\n"
. "</table>\n"
."";
echo "<center>\n";
$footer_message = footmsg();
// DO NOT TOUCH THE NEXT LINE(s). DOING SO VIOLATES THE COPYRIGHTS OF THIS THEME
// YOU CAN ONLY ADD TO IT IF YOU MODIFY THIS THEME :-)
echo "</center>\n";
echo "<center><br><font class=\"small\">:: Charcoal2 phpbb2 style by <a href=\"http://www.zarron.com/\">zarron designs</a> © :: PHP-Nuke theme by <a href=\"http://www.nukemods.com\">www.nukemods.com</a> © ::</font></center>\n";
echo "<br>\n";
}
/************************************************************/
/* 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;
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";
}
$posted = ""._POSTEDBY." ";
$posted .= get_author($aid);
$posted .= " "._ON." $time $timezone ($counter "._READS.")";
echo"<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">\n"
. " <tr>\n"
. " <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n"
. " <tr>\n"
. " <td bgcolor=\"#CCCCCC\"><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" bgcolor=\"#303032\">\n"
. " <tr>\n"
. " <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">\n"
. " <tr>\n"
. " <td background=\"themes/Charcoal2/forums/images/bk-z.jpg\" bgcolor=\"#C0C0C0\"><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\">\n"
. " <tr>\n"
. " <td height=\"28\" background=\"themes/Charcoal2/forums/images/sidebox_background2.gif\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">\n"
. " <tr>\n"
. " <td><font class=\"block-title\"><strong>$title</strong></font></td>\n"
. " </tr>\n"
. " </table></td>\n"
. " </tr>\n"
. " <tr>\n"
. " <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n"
. " <tr>\n"
. " <td background=\"themes/Charcoal2/forums/images/bk-z.jpg\" bgcolor=\"#8A8C91\"><a href=\"modules.php?name=News&new_topic=$topic\"><img src=\"$tipath$topicimage\" border=\"0\" alt=\"$topictext\" title=\"$topictext\" align=\"right\" hspace=\"10\" vspace=\"10\"></a><font class=\"storycontent\">$content</font></td>\n"
. " </tr>\n"
. " </table></td>\n"
. " </tr>\n"
. " <tr>\n"
. " <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n"
. " <tr>\n"
. " <td background=\"themes/Charcoal2/forums/images/bk-w.jpg\" bgcolor=\"#8A8C91\"><div align=\"center\"><font class=\"content\">$posted</font><br><font class=\"content\">$morelink</font></div></td>\n"
. " </tr>\n"
. " </table></td>\n"
. " </tr>\n"
. " </table></td>\n"
. " </tr>\n"
. " </table></td>\n"
. " </tr>\n"
. " </table></td>\n"
. " </tr>\n"
. " </table></td>\n"
. " </tr>\n"
. "</table>\n"
."";
}
/************************************************************/
/* 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;
$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";
}
echo"<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">\n"
. " <tr>\n"
. " <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n"
. " <tr>\n"
. " <td bgcolor=\"#CCCCCC\"><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" bgcolor=\"#303032\">\n"
. " <tr>\n"
. " <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">\n"
. " <tr>\n"
. " <td background=\"themes/Charcoal2/forums/images/bk-z.jpg\" bgcolor=\"#C0C0C0\"><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\">\n"
. " <tr>\n"
. " <td height=\"28\" background=\"themes/Charcoal2/forums/images/sidebox_background2.gif\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">\n"
. " <tr>\n"
. " <td><font class=\"block-title\"><strong>$title</strong></font></td>\n"
. " </tr>\n"
. " </table></td>\n"
. " </tr>\n"
. " <tr>\n"
. " <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n"
. " <tr>\n"
. " <td background=\"themes/Charcoal2/forums/images/bk-z.jpg\" bgcolor=\"#8A8C91\"><a href=\"modules.php?name=News&new_topic=$topic\"><img src=\"$tipath$topicimage\" border=\"0\" alt=\"$topictext\" title=\"$topictext\" align=\"right\" hspace=\"10\" vspace=\"10\"></a><font class=\"storycontent\">$content</font></td>\n"
. " </tr>\n"
. " </table></td>\n"
. " </tr>\n"
. " <tr>\n"
. " <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n"
. " <tr>\n"
. " <td background=\"themes/Charcoal2/forums/images/bk-w.jpg\" bgcolor=\"#8A8C91\"><div align=\"center\"><font class=\"content\">$posted</font><br><font class=\"content\"></font></div></td>\n"
. " </tr>\n"
. " </table></td>\n"
. " </tr>\n"
. " </table></td>\n"
. " </tr>\n"
. " </table></td>\n"
. " </tr>\n"
. " </table></td>\n"
. " </tr>\n"
. " </table></td>\n"
. " </tr>\n"
. "</table>\n"
."";
}
/************************************************************/
/* Function themesidebox() */
/* */
/* Control look of your blocks. Just simple. */
/************************************************************/
function themesidebox($title, $content) {
echo"<table width=\"165\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">\n"
. " <tr>\n"
. " <td><table width=\"165\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">\n"
. " <tr>\n"
. " <td bgcolor=\"#696969\"><table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"0\">\n"
. " <tr>\n"
. " <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"
. " <tr>\n"
. " <td bgcolor=\"#C0C0C0\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"
. " <tr>\n"
. " <td height=\"28\" background=\"themes/Charcoal2/forums/images/sidebox_background.gif\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">\n"
. " <tr>\n"
. " <td><font class=\"block-title\"><strong>$title</strong></font></td>\n"
. " </tr>\n"
. " </table></td>\n"
. " </tr>\n"
. " <tr>\n"
. " <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n"
. " <tr>\n"
. " <td background=\"themes/Charcoal2/forums/images/dkback.gif\" bgcolor=\"#8A8C91\"><font class=\"content\">$content</font></td>\n"
. " </tr>\n"
. " </table></td>\n"
. " </tr>\n"
. " <tr>\n"
. " <td height=\"15\" background=\"themes/Charcoal2/forums/images/slogan_blank.jpg\"> </td>\n"
. " </tr>\n"
. " </table></td>\n"
. " </tr>\n"
. " </table></td>\n"
. " </tr>\n"
. " </table></td>\n"
. " </tr>\n"
. " </table></td>\n"
. " </tr>\n"
. "</table>\n"
."";
}
?>
|