Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Raven's RavenNuke(tm) v2.00.00 - v2.02.00 Distro
Author Message
tommyb
Hangin' Around



Joined: May 31, 2006
Posts: 49

PostPosted: Tue Jul 04, 2006 2:01 am Reply with quote

Hi,

Was there any major reason why the ads function was removed from mainfile.php? Or had I deleted myself somehow for some bizarre reason??It's just that I needed it for an advertising module and I wondered if it was removed for an obvious security reason?

Many Thanks

Tom
 
View user's profile Send private message
hitwalker
Sells PC To Pay For Divorce



Joined:
Posts: 5661

PostPosted: Tue Jul 04, 2006 6:35 am Reply with quote

Ads function ?
Huh...explain....
 
View user's profile Send private message
tommyb







PostPosted: Tue Jul 04, 2006 6:50 am Reply with quote

Well in a 7.8 nuke site in the mainfile.php there is the following function
Code:
function ads($position) {


   global $prefix, $db, $admin, $sitename, $adminmail, $nukeurl;

   $position = intval($position);

   if (paid()) {

      return;

   }

   $numrows = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_banner WHERE position='$position' AND active='1'"));

   /* Get a random banner if exist any. */

   if ($numrows > 1) {

      $numrows = $numrows-1;

      mt_srand((double)microtime()*1000000);

      $bannum = mt_rand(0, $numrows);

   } else {

      $bannum = 0;

   }

   $sql = "SELECT bid, impmade, imageurl, clickurl, alttext FROM ".$prefix."_banner WHERE position='$position' 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];

   $db->sql_query("UPDATE ".$prefix."_banner SET impmade=impmade+1 WHERE bid='$bid'");

   if($numrows > 0) {

      $sql2 = "SELECT cid, imptotal, impmade, clicks, date, ad_class, ad_code, ad_width, ad_height FROM ".$prefix."_banner WHERE bid='$bid'";

      $result2 = $db->sql_query($sql2);

      $row2 = $db->sql_fetchrow($result2);

      $cid = $row2[cid];

      $imptotal = $row2[imptotal];

      $imptotal = intval($imptotal);

      $impmade = $row2[impmade];

      $impmade = intval($impmade);

      $clicks = $row2[clicks];

      $clicks = intval($clicks);

      $date = $row2[date];

      $ad_class = $row2[ad_class];

      $ad_code = $row2[ad_code];

      $ad_width = $row['ad_width'];

      $ad_height = $row['ad_height'];

      /* 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."_banner_clients 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());

         }

      }

      if ($ad_class == "code") {

         $ad_code = stripslashes(FixQuotes($ad_code));

         $ads = "<center>$ad_code</center>";

      } elseif ($ad_class == "flash") {

         $ads = "<center>

            <OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"

            codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0\"

            WIDTH=\"$ad_width\" HEIGHT=\"$ad_height\" id=\"$bid\">

            <PARAM NAME=movie VALUE=\"$imageurl\">

            <PARAM NAME=quality VALUE=high>

            <EMBED src=\"$imageurl\" quality=high WIDTH=\"$ad_width\" HEIGHT=\"$ad_height\"

            NAME=\"$bid\" ALIGN=\"\" TYPE=\"application/x-shockwave-flash\"

            PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\">

            </EMBED>

            </OBJECT>

            </center>";

      } else {

         $ads = "<center><a href=\"index.php?op=ad_click&amp;bid=$bid\" target=\"_blank\"><img src=\"$imageurl\" border=\"0\" alt='$alttext' title='$alttext'></a></center>";

      }

   } else {

      $ads = "";   

   }

   return($ads);

}

Yet this was not present in the mainfile of a raven install. Maybe i'm just going crazy and forgot I added something.

Shocked
 
hitwalker







PostPosted: Tue Jul 04, 2006 7:52 am Reply with quote

and why do you need it?
Im not sure but my guess is that FB changed some code of the banner placement....
FB loves the use of new shitty function so he can manipulate people into newer versions.
im just guessing here cause i never looked at anything else above the 7.6
 
tommyb







PostPosted: Tue Jul 04, 2006 7:53 am Reply with quote

I just needed it for an advertising module. I was having problems with it and it was because this was removed but I wanted to check it hadn't been removed from Ravennuke due to some gaping security problem
 
hitwalker







PostPosted: Tue Jul 04, 2006 8:01 am Reply with quote

maybe but advertising module doesnt say much.. Sad
ravennuke uses the standard banner code as its allways been...
if you used a different system or whatever (is a bit unclear) then you have to alter it where needed.
 
tommyb







PostPosted: Tue Jul 04, 2006 8:11 am Reply with quote

It was from pcnuke as I wanted to allow flash banners and the ability to have them positioned in various positions. I've altered the code to get it all working but i just thought I'd post here to see if the function was removed for security reasons Smile no worries!
 
hitwalker







PostPosted: Tue Jul 04, 2006 8:18 am Reply with quote

well these lines/codes aren't standard but there are some fixes to show flasbanners,but then you have to search for that....
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Thu Jul 06, 2006 10:39 pm Reply with quote

Quote:

Well in a 7.8 nuke site in the mainfile.php there is the following function


RavenNuke is PHP-Nuke 76 at the core. The ad/banner system was changed in a higher level of nuke, but don't know which one. BUT, we know for certain that at least 7.8 had it differently... Wink

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Raven's RavenNuke(tm) v2.00.00 - v2.02.00 Distro

View next topic
View previous 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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©