Come addatare il tema lightnuke
ti posto il codice theme_header del file theme.php
- Codice:
function themeheader() {
global $sitename, $admin, $index, $user, $cookie, $user_prefix, $userinfo, $prefix, $db, $banners, $Version_Num, $theme_name, $module_name, $forum_url, $okforum;
if ($banners == 1) {
$numrows = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_banner WHERE type='0' AND active='1'"));
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];
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\" alt='$alttext' title='$alttext'></a> ";
}
}
cookiedecode($user);
$username = $cookie[1];
if ($username == "") {
$username = "Anonymous";
}
if ($username == "Anonymous") {
$theuser = "<a href=\"modules.php?name=Your_Account\">"._LOGIN."</a> or <a href=\"modules.php?name=Your_Account&op=new_user\">"._BREG."</a>";
} else {
$theuser = "<font color=\"#455995\"><b>"._BWEL."</b></font> $username!";
}
$datetime = "<script type=\"text/javascript\">\n\n";
$datetime .= "<!-- // Array ofmonth Names\n";
$datetime .= "var monthNames = new Array( \""._JANUARY."\",\""._FEBRUARY."\",\""._MARCH."\",\""._APRIL."\",\""._MAY."\",\""._JUNE."\",\""._JULY."\",\""._AUGUST."\",\""._SEPTEMBER."\",\""._OCTOBER."\",\""._NOVEMBER."\",\""._DECEMBER."\");\n";
$datetime .= "var now = new Date();\n";
$datetime .= "thisYear = now.getYear();\n";
$datetime .= "if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem\n";
$datetime .= "document.write(monthNames[now.getMonth()] + \" \" + now.getDate() + \", \" + thisYear);\n";
$datetime .= "// -->\n\n";
$datetime .= "</script>";
// $public_msg = public_message();
echo "<table id=\"forum\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">";
echo "<tr>";
echo "<td class=\"forum-header\" align=\"center\" valign=\"top\">";
echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">";
echo "<tr>";
echo "<td width=\"60%\" height=\"80\" align='center'><center><a href=\"index.php\"><img src=\"themes/$theme_name/images/logo.jpg\" title=\"$sitename\"></a></center></td>";
echo "<td width=\"40%\" style=\"PADDING-right: 2px\" height=\"80\">$showbanners</td>";
echo "</tr></table>";
echo "<table height=\"20\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
echo "<tr>";
echo "<td align=\"center\" class=\"forum-buttons\">";
?>
<div>
<ul id="nav">
<li>
<h2><a href="index.php" <?php if (defined("INDEX")){ echo 'class="selected"'; } ?>><font size="3">Home</font></a></h2>
</li>
<li>
<?php if (is_user($user)){ ?>
<h2><a href="modules.php?name=Your_Account" <?php if ($module_name == "Your_Account"){ echo 'class="selected"'; } ?>><font size="3">Profilo</font></a></h2>
<?php } else { ?>
<h2><a href="modules.php?name=Your_Account" <?php if ($module_name == "Your_Account"){ echo 'class="selected"'; } ?>><font size="3">Registrati/Login</font></a></h2>
<?php }
?>
<?php if ($okforum == 1){ ?>
<li>
<h2><a href="modules.php?name=<?php echo $forum_url; ?>" <?php if ($module_name == "modules.php?name=$forum_url"){ echo 'class="selected"'; } ?>><font size="3">Forum</font></a></h2>
</li>
<?php }
if (is_active("Downloads")){
?>
<li>
<h2><a href="modules.php?name=Downloads" <?php if ($module_name == "Downloads"){ echo 'class="selected"'; } ?>><font size="3">Downloads</font></a></h2>
</li>
<?php } if (is_active("News")){ ?>
<li>
<h2><a href="modules.php?name=News" <?php if (($module_name == "News") and (!defined("INDEX"))){ echo 'class="selected"'; } ?>><font size="3">News</font></a></h2>
</li>
<?php } ?>
</ul>
</div>
<?php
echo "</td>";
echo "</tr></table>";
echo "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\">";
echo "<tr valign=\"top\">";
echo "<td>$public_msg</td>";
echo "</tr></table>";
echo "<table width=\"100%\" cellpadding=\"4\" cellspacing=\"0\" border=\"0\" align=\"center\">";
echo "<tr>";
echo "<td valign=\"top\">";
blocks('left');
echo"</td><td valign=\"top\" width=\"100%\">";
?>
<CENTER>
<SCRIPT LANGUAGE="JavaScript">
<!--
{
document.write("<SCRIPT LANGUAGE='JavaScript' SRC='http://www.itastore.it/banner/9661/banner.js'><\/SCRIPT>");
}
// -->
</SCRIPT>
</CENTER>
<?php
}
function themefooter() {
global $index, $foot1, $foot2, $foot3, $foot4, $total_time, $start_time, $footer_message;
if (!defined('ADMIN_FILE')) {
echo"</td><td valign=\"top\" width=\"170\">";
blocks(right);
}
$footer_message = "$foot1<br>$foot2<br>$foot3<br>$foot4<br>";
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$end_time = $mtime;
$total_time = ($end_time - $start_time);
$total_time = "".substr($total_time,0,5)."";
echo "</td></tr></table>\n";
//echo "$footer_message\n";
echo "<table cellSpacing=\"0\" cellPadding=\"2\" width=\"100%\" border=\"0\">";
echo "<tr><td id=\"copyright\" width=\"25%\" align=\"left\">Powered by: <a target=\"_blank\" href=\"http://phpnuke.org\">PHP-Nuke</a> © - 2006";
echo "</td>";
echo "<td width=\"50%\" id=\"copyright\" align=\"center\">Design by <a href=\"http://www.matteoiammarrone.com\" target=\"_blank\">matteoiamma</a> </td>";
echo "<td width=\"25%\" id=\"copyright\" align=\"right\">";
echo "Pagina generata in: $total_time secondi</td></tr></table>";
echo "<div style=\"font-size: xx-small;\" align=\"center\">\n";
echo footmsg();
echo "</div>";
}
function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
global $anonymous, $tipath, $sitename;
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
$t_image = "themes/$ThemeSel/images/topics/$topicimage";
} else {
$t_image = "$tipath$topicimage";
}
echo "<table class=\"forumline\" border=\"0\" cellspacing=\"0\" width=\"100%\" cellpadding=\"3\"><tr>";
echo "<td class=\"row-header\"><span>$title</span></td>";
echo "<tr>";
echo "<td><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"><tr>";
echo "<td bgcolor=\"#FFFFFF\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">";
echo "<tr><td>";
echo "<a href=\"modules.php?name=News&new_topic=$topic\"><img src=\"$t_image\" alt=\"$topictext\" hspace=\"10\" vspace=\"10\" align=\"left\"></a>";
FormatStory($thetext, $notes, $aid, $informant);
echo "</td></tr></table></td></tr></table>";
echo "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"><tr>";
echo "<td id=\"news-footer\">";
echo ""._POSTEDBY.": <a href=\"modules.php?name=Your_Account&op=userinfo&username=$informant\"><b>$informant</b></a> ";
echo ""._ON." $time $timezone";
echo "</td>";
echo "<td id=\"news-footer\" align=\"right\" >$morelink</td></tr></table></td></tr></table>\n";
}
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";
}
echo "<table class=\"forumline\" border=\"0\" cellspacing=\"0\" width=\"100%\" cellpadding=\"3\"><tr>";
echo "<td class=\"row-header\"><span>$title</span></td>";
echo "<tr>";
echo "<td><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"><tr>";
echo "<td bgcolor=\"#FFFFFF\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">";
echo "<tr><td>";
echo "<a href=\"modules.php?name=News&new_topic=$topic\"><img src=\"$t_image\" alt=\"$topictext\" hspace=\"10\" vspace=\"10\" align=\"left\"></a>";
FormatStory($thetext, $notes, $aid, $informant);
echo "</td></tr></table></td></tr></table>";
echo "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"><tr>";
echo "<td height=\"22\" id=\"news-footer\">"._POSTEDBY.": <b>";
formatAidHeader($aid);
echo "</b> "._ON." $datetime</td>";
echo "<td id=\"news-footer\" align=\"right\" >$morelink</td></tr></table></td></tr></table>\n";
}
function themesidebox($title, $content) {
echo "<table border=\"0\" class=\"forumline\" cellspacing=\"0\" width=\"170\" cellpadding=\"3\"><tr>";
echo "<td class=\"title_block\" width=\"100%\">";
echo "<span>$title</span>";
echo "</td></tr>";
echo "<tr><td class=\"row1\" width=\"170\">$content";
echo "</td></tr></table>";
}
?>
Grazie mille aspetto una tua risposta
