You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 293 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 [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
ozwebfx
Nuke Cadet
Nuke Cadet


Joined: Oct 18, 2005
Posts: 3


PostPosted: Tue Oct 18, 2005 5:15 pm Reply with quoteBack to top

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
Find all posts by ozwebfxView user's profileSend private messageVisit poster's website
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12482


PostPosted: Tue Oct 18, 2005 7:30 pm Reply with quoteBack to top

No, that code must be on its seperate line.

_________________
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
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
ozwebfx
Nuke Cadet
Nuke Cadet


Joined: Oct 18, 2005
Posts: 3


PostPosted: Tue Oct 18, 2005 7:39 pm Reply with quoteBack to top

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
Find all posts by ozwebfxView user's profileSend private messageVisit poster's website
wildo69
Lieutenant
Lieutenant


Joined: Jul 29, 2003
Posts: 164

Location: Michigan

PostPosted: Sat Oct 29, 2005 4:33 pm Reply with quoteBack to top

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
Image
Find all posts by wildo69View user's profileSend private messageSend e-mailVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12482


PostPosted: Sat Oct 29, 2005 8:11 pm Reply with quoteBack to top

You'll need at the top of the themeheader function

Code:

echo ads(0);

_________________
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
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
wildo69
Lieutenant
Lieutenant


Joined: Jul 29, 2003
Posts: 164

Location: Michigan

PostPosted: Sun Oct 30, 2005 8:18 am Reply with quoteBack to top

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
Image
Find all posts by wildo69View user's profileSend private messageSend e-mailVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger
wildo69
Lieutenant
Lieutenant


Joined: Jul 29, 2003
Posts: 164

Location: Michigan

PostPosted: Sun Oct 30, 2005 8:23 am Reply with quoteBack to top

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 = "&nbsp;&nbsp;<a href=\"modules.php?name=Your_Account\">"._LOGIN."</a> or <a href=\"modules.php?name=Your_Account&op=new_user\">"._BREG."</a>";
    } else {
   $theuser = "&nbsp;&nbsp;"._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
Image
Find all posts by wildo69View user's profileSend private messageSend e-mailVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12482


PostPosted: Sun Oct 30, 2005 4:05 pm Reply with quoteBack to top

Use
Code:

$showbanners = ads(0);

and then put the $showbanners where you want it to appear in your 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
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
astalavistabd
Captain
Captain


Joined: Dec 19, 2004
Posts: 663

Location: Canada

PostPosted: Wed Nov 16, 2005 6:33 pm Reply with quoteBack to top

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>&nbsp;";
    }
}
    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 = "&nbsp;&nbsp;<a href=\"/account.html\"></a>  <a href=\"/account-new_user.html\"></a>";
    } else {
   $theuser = "&nbsp;&nbsp;"._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
Find all posts by astalavistabdView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN MessengerICQ Number
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12482


PostPosted: Wed Nov 16, 2005 9:27 pm Reply with quoteBack to top

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
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
astalavistabd
Captain
Captain


Joined: Dec 19, 2004
Posts: 663

Location: Canada

PostPosted: Thu Nov 17, 2005 7:59 am Reply with quoteBack to top

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>&nbsp;";
ob_flush();

_________________
Free PHPNuke Themes, PHPNuke Modules, PHPNuke Blocks (No Registration Required)
Find all posts by astalavistabdView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN MessengerICQ Number
dionsis
Sergeant
Sergeant


Joined: Jul 18, 2005
Posts: 133


PostPosted: Thu Nov 17, 2005 3:52 pm Reply with quoteBack to top

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
Find all posts by dionsisView user's profileSend private message
astalavistabd
Captain
Captain


Joined: Dec 19, 2004
Posts: 663

Location: Canada

PostPosted: Thu Nov 17, 2005 4:08 pm Reply with quoteBack to top

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?

Sad no, its not working for me

_________________
Free PHPNuke Themes, PHPNuke Modules, PHPNuke Blocks (No Registration Required)
Find all posts by astalavistabdView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN MessengerICQ Number
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12482


PostPosted: Thu Nov 17, 2005 4:53 pm Reply with quoteBack to top

ads(0) only works in phpNuke 7.8 and higher

_________________
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
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
astalavistabd
Captain
Captain


Joined: Dec 19, 2004
Posts: 663

Location: Canada

PostPosted: Fri Nov 18, 2005 4:14 am Reply with quoteBack to top

ya, i know. But i didn't understand that part. Sad

Quote:
along with some output buffering trick to put it into the $showbanners variable

_________________
Free PHPNuke Themes, PHPNuke Modules, PHPNuke Blocks (No Registration Required)
Find all posts by astalavistabdView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN MessengerICQ Number
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.344 Seconds - 431 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::