- Readme First! - Read and follow the rules, otherwise your posts will be closed
There are currently, 286 guest(s) and 0 member(s) that are online. You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Banners not showing [ ]
Author
Message
ozwebfx
Nuke Cadet
Joined: Oct 18, 2005
Posts: 3
Posted:
Tue Oct 18, 2005 5:15 pm
Thanks for your reply, I tried:
Code:
function themeheader() {
global $showbanners = ads(0), $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'"));
& I get a blank page.
_________________www.milliondollarhomepage.com.au
Evaders99
Site Admin
Joined: Aug 17, 2003
Posts: 12482
Posted:
Tue Oct 18, 2005 7:30 pm
ozwebfx
Nuke Cadet
Joined: Oct 18, 2005
Posts: 3
Posted:
Tue Oct 18, 2005 7:39 pm
ok, got it now!
Code:
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 */
$showbanners = ads(0);
if ($numrows>1) {
Thanks for your help!
_________________www.milliondollarhomepage.com.au
wildo69
Lieutenant
Joined: Jul 29, 2003
Posts: 164
Location: Michigan
Posted:
Sat Oct 29, 2005 4:33 pm
ok, im really trying to grasp this, but im missing something.
using nuke 7.9 patched. theme is Aeolus.
i just want the ad/banners system to work.
to be able to show banners at the top, or in the sidebar, as it used in in my previous version before i upgraded (which was version 7.6)
i dont need it in any special places, just top or side
_________________ Hosting for your Nuke powered sites and full service podcast hosting
http://www.webcyberhosting.com
Evaders99
Site Admin
Joined: Aug 17, 2003
Posts: 12482
Posted:
Sat Oct 29, 2005 8:11 pm
wildo69
Lieutenant
Joined: Jul 29, 2003
Posts: 164
Location: Michigan
Posted:
Sun Oct 30, 2005 8:18 am
so i dont need to do anything else, just add that line...
ok, will try and post results...
thanks
_________________ Hosting for your Nuke powered sites and full service podcast hosting
http://www.webcyberhosting.com
wildo69
Lieutenant
Joined: Jul 29, 2003
Posts: 164
Location: Michigan
Posted:
Sun Oct 30, 2005 8:23 am
ok, when i do that the banner is displayed, but it shows up at the top center of the page.
i want it to show up to the right of my site logo.. again, like the old versions did...
here is my themeheader()
Code:
function themeheader() {
global $admin, $user, $banners, $sitename, $slogan, $cookie, $prefix, $db, $nukeurl, $anonymous;
$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>";
} cookiedecode($user);
$username = $cookie[1];
if ($username == "") {
$username = "Anonymous";
}
echo "<body background=\"themes/Aeolus/images/bg_main.gif\" bgcolor=\"#000000\" text=\"#FFFFCC\" leftmargin=\"10\" topmargin=\"10\" marginwidth=\"10\" marginheight=\"10\">";
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 = " "._BWEL." $username!";
}
$datetime = "<script type=\"text/javascript\">\n\n"
."<!-- // Array ofmonth Names\n"
."var monthNames = new Array( \""._JANUARY."\",\""._FEBRUARY."\",\""._MARCH."\",\""._APRIL."\",\""._MAY."\",\""._JUNE."\",\""._JULY."\",\""._AUGUST."\",\""._SEPTEMBER."\",\""._OCTOBER."\",\""._NOVEMBER."\",\""._DECEMBER."\");\n"
."var now = new Date();\n"
."thisYear = now.getYear();\n"
."if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem\n"
."document.write(monthNames[now.getMonth()] + \" \" + now.getDate() + \", \" + thisYear);\n"
."// -->\n\n"
."</script>";
$public_msg = public_message();
$tmpl_file = "themes/Aeolus/header.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
blocks(left);
$tmpl_file = "themes/Aeolus/left_center.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
[/code]
_________________ Hosting for your Nuke powered sites and full service podcast hosting
http://www.webcyberhosting.com
Evaders99
Site Admin
Joined: Aug 17, 2003
Posts: 12482
Posted:
Sun Oct 30, 2005 4:05 pm
astalavistabd
Captain
Joined: Dec 19, 2004
Posts: 663
Location: Canada
Posted:
Wed Nov 16, 2005 6:33 pm
ok, my problem is kindaa wired !! My banner does not show up but it just shows the banner/image link. anyway i tried all these formula u guys mentioned here:
1) adding
Code:
include("banners.php");
inside the function themeheader () , i got a banner but its top of my site
2) adding
Code:
$showbanners = ads(0);
inside the function hemeheader (), i get page error
Here is my function themeheader ()
Code:
function themeheader() {
global $admin, $user, $banners, $sitename, $slogan, $cookie, $prefix, $db, $nukeurl, $anonymous, $name;
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> ";
}
}
cookiedecode($user);
$username = $cookie[1];
if ($username == "") {
$username = "Anonymous";
}
echo "<body bgcolor=\"#000000\" text=\"#FFFFFF\" leftmargin=\"1\" topmargin=\"1\" marginwidth=\"1\" marginheight=\"1\">";
if ($username == "Anonymous") {
$theuser = " <a href=\"/account.html\"></a> <a href=\"/account-new_user.html\"></a>";
} else {
$theuser = " "._BWEL." $username!";
}
$datetime = "<script type=\"text/javascript\">\n\n"
."<!-- // Array ofmonth Names\n"
."var monthNames = new Array( \""._JANUARY."\",\""._FEBRUARY."\",\""._MARCH."\",\""._APRIL."\",\""._MAY."\",\""._JUNE."\",\""._JULY."\",\""._AUGUST."\",\""._SEPTEMBER."\",\""._OCTOBER."\",\""._NOVEMBER."\",\""._DECEMBER."\");\n"
."var now = new Date();\n"
."thisYear = now.getYear();\n"
."if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem\n"
."document.write(monthNames[now.getMonth()] + \" \" + now.getDate() + \", \" + thisYear);\n"
."// -->\n\n"
."</script>";
$public_msg = public_message();
$tmpl_file = "themes/fiblack3d/header.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
blocks(left);
$tmpl_file = "themes/fiblack3d/left_center.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
My nuke version is 7.7(manually updated), php 2.4.0
Evaders99
Site Admin
Joined: Aug 17, 2003
Posts: 12482
Posted:
Wed Nov 16, 2005 9:27 pm
You will have to use
Code:
include("banners.php");
along with some output buffering trick to put it into the $showbanners variable
Then you can place the variable wherever you want in header.html
_________________ Helping those that help themselves
Read FIRST or DIE!
"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
astalavistabd
Captain
Joined: Dec 19, 2004
Posts: 663
Location: Canada
Posted:
Thu Nov 17, 2005 7:59 am
output buffering trick !! Do u mean like this?
Code:
ob_start();
include("banners.php");
$showbanners = "<a href=\"banners.php?op=click&bid=$bid\" target=\"_blank\"><img src=\"$imageurl\" border=\"0\" alt='$alttext' title='$alttext'></a> ";
ob_flush();
_________________Free PHPNuke Themes, PHPNuke Modules, PHPNuke Blocks (No Registration Required)
dionsis
Sergeant
Joined: Jul 18, 2005
Posts: 133
Posted:
Thu Nov 17, 2005 3:52 pm
i personally just put it in my html files for my theme
in theme.php i placed
$banner = ads(0);
then in the Header.html i decided to put it after the HTML for the logo, i.e. top right.
so place $banner = ads(0); in the theme.php
then for joker go into the footer.html
and whereever you want the ad in the footer put in
$banner
and your ad will display
as for putting it above the forum, if you only want it above the forum and nowhere else then go to
/modules/Forums/Template/**NAME OF TEMPLATE**
look for the forum head file, .tpl if i remember correctly and place
$banner = ads(0);
$banner
if im correct ( i didnt test)
this should display your ad ONLY above the forum when people are viewing the forum
astalavistabd
Captain
Joined: Dec 19, 2004
Posts: 663
Location: Canada
Posted:
Thu Nov 17, 2005 4:08 pm
dionsis wrote:
so place $banner = ads(0); in the theme.php
so, ur saying place $banner = ads(0); in the theme.php and $banner in header.html?
no, its not working for me
_________________Free PHPNuke Themes, PHPNuke Modules, PHPNuke Blocks (No Registration Required)
Evaders99
Site Admin
Joined: Aug 17, 2003
Posts: 12482
Posted:
Thu Nov 17, 2005 4:53 pm
astalavistabd
Captain
Joined: Dec 19, 2004
Posts: 663
Location: Canada
Posted:
Fri Nov 18, 2005 4:14 am
Goto page Previous 1 , 2 , 3 , 4 Next
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