Need Help Putting Banners Code Next to My Logo

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Need Help Putting Banners Code Next to My Logo
DivotMaker
CZ Newbie
DivotMaker has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Sep 02, 2004
0.00 posts per day
Posts: 21
Points: 976
   
Here's the code (I think) out of my theme.php file that displays my banner. I'd like to set up my site so that our banners appear right next to our logo.

."<tr><td width=\"100%\">\n"
."<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"800\">\n"
."<tr><td width=\"100%\">\n"
."<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"800\">\n"
."<tr><td width=\"50%\" height=\"60\" bgcolor=\"#FFFFFF\">\n"
."<table border=\"0\" width=\"50%\" cellpadding=\"0\" cellspacing=\"0\"><tr><td align=\"left\"><a href=\"index.php\"><img border=\"0\" src=\"themes/sierra/images/logo.jpg\" alt=\"Sierra OTHG\" hspace=\"0\"></td></tr></table></td></tr>\n"

I've tried to figure this out, but just can't get it. Right now, my banners appear in my footer, and here's the code for that:

if ($banners) {
include("banners.php");
}

Can someone tell me where to put this code into my theme.php file so that the banner appears right next to our logo? Many thanks.



Back to top Reply with quote
#2   re: Need Help Putting Banners Code Next to My Logo
Gareth
CZ Addict
 Codezwiz Site Donator
Gareth has been a member for over 20 year's 20 Year Member
uk.gif
Occupation: Student, Webmaster
Gender: Male
Fav. Sports Team: Liverpool FC
Status: Offline
Joined: May 29, 2004
0.08 posts per day
Posts: 587
Points: 38,220
   
if you have the code in your theme.php just put $showbanners in your html header

if you dont have the code in you theme.php and no $showbanners in your, place $showbanners in your header wherever you want the banner

and open theme.php

find something like:
if ($username == "Anonymous") {
        $theuser = "<a href=\"modules.php?name=Your_Account&op=new_user\">Login /Register</a>";
    } else {
        $theuser = "Hello $username!";
    }


and BEFORE Add:
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>";
    }
}


also find:
function themeheader() {
    global $user, $sitename, $slogan, $cookie, $prefix, $banners;


and replace that with:
function themeheader() {
    global $user, $banners, $cookie, $sitename, $slogan, $prefix, $db, $admin, $adminmail, $nukeurl;


hope that helps icon_mrgreen.gif



_________________
[ Register or login to view links on this board.]
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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
You cannot attach files in this forum
You cannot download files in this forum