| Author |
Message |
tommyb Hangin' Around

Joined: May 31, 2006 Posts: 49
|
Posted:
Tue Jul 04, 2006 2:01 am |
|
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 |
|
|
|
 |
hitwalker Sells PC To Pay For Divorce

Joined: Posts: 5661
|
Posted:
Tue Jul 04, 2006 6:35 am |
|
Ads function ?
Huh...explain.... |
|
|
|
 |
tommyb Hangin' Around

Joined: May 31, 2006 Posts: 49
|
Posted:
Tue Jul 04, 2006 6:50 am |
|
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&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.
 |
|
|
|
 |
hitwalker Sells PC To Pay For Divorce

Joined: Posts: 5661
|
Posted:
Tue Jul 04, 2006 7:52 am |
|
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 Hangin' Around

Joined: May 31, 2006 Posts: 49
|
Posted:
Tue Jul 04, 2006 7:53 am |
|
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 Sells PC To Pay For Divorce

Joined: Posts: 5661
|
Posted:
Tue Jul 04, 2006 8:01 am |
|
maybe but advertising module doesnt say much..
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 Hangin' Around

Joined: May 31, 2006 Posts: 49
|
Posted:
Tue Jul 04, 2006 8:11 am |
|
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 no worries! |
|
|
|
 |
hitwalker Sells PC To Pay For Divorce

Joined: Posts: 5661
|
Posted:
Tue Jul 04, 2006 8:18 am |
|
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: 9136 Location: Arizona
|
Posted:
Thu Jul 06, 2006 10:39 pm |
|
| 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...  |
|
|
|
 |
|
|
|
|