Author |
Message |
vcorreia
New Member


Joined: Mar 05, 2006
Posts: 7
|
Posted:
Mon Jun 26, 2006 9:53 am |
|
hi,
I am really in need of a simple hack to nsn banner ads blocks.
I just want it to display all my active banners, instead of displaying only one random banner in the block.
PLS HELP, thanks in advance
Here is the code for the existing block (includes/babanners4.php):
Code:<?php
/********************************************************/
/* NSN Banner Ads */
/* By: NukeScripts Network (webmaster@nukescripts.net) */
/* http://www.nukescripts.net */
/* Copyright © 2000-2005 by NukeScripts Network */
/********************************************************/
if (stristr($_SERVER['SCRIPT_NAME'], "babanners4.php")) {
die("Illegal Desolate File Access");
}
$modname = "Banner_Ads";
get_lang($modname);
require_once("mainfile.php");
global $prefix, $db, $admin, $adminmail, $sitename, $nukeurl;
$testdate = date ("Y-m-d");
$bresult = $db->sql_query("SELECT bid FROM ".$prefix."_nsnba_banners WHERE pid='4' AND active='1'");
$numrows = $db->sql_numrows($bresult);
if ($numrows>0) {
if ($numrows==1) {
list ($bannum) = $db->sql_fetchrow($bresult);
} else if ($numrows>1) {
$i = 1;
while (list ($id) = $db->sql_fetchrow($bresult)) {
$abid[$i] = $id;
$i++;
}
$bannum = $abid[rand(1, $numrows)];
}
} else {
$bannum = 0;
}
if (!is_admin($admin)) { $db->sql_query("UPDATE ".$prefix."_nsnba_banners SET impmade=impmade+1 WHERE bid='$bannum'"); }
if ($numrows>0) {
$bidinfo = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_nsnba_banners WHERE pid='4' AND active='1' AND bid='$bannum'"));
$cidinfo = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_nsnba_clients WHERE cid='".$bidinfo['cid']."'"));
if (($bidinfo['imptotal'] <= $bidinfo['impmade']) AND ($bidinfo['imptotal'] != 0)) {
$db->sql_query("UPDATE ".$prefix."_nsnba_banners SET active='0' WHERE bid='$bannum'");
$fecha = date("F jS Y, h:iA.");
$subject = _BA_BANSTATAT." $sitename";
$message = _BA_COMPSTAT." $sitename:\n\n";
$message .= _BA_CONNME.": ".$cidinfo['name']."\n";
$message .= _BA_BANNUM.": $bannum\n";
$message .= _BA_IMGSRC.": $nukeurl/".$bidinfo['imageurl']."\n";
$message .= _BA_CLKU.": ".$bidinfo['clickurl']."\n\n";
$message .= _BA_IMPPUR.": ".$bidinfo['imptotal']."\n";
$message .= _BA_IMPMAD.": ".$bidinfo['impmade']."\n";
$message .= _BA_CLKS.": ".$bidinfo['clicks']."\n";
$message .= _BA_REPORTON.": $fecha";
$from = "$sitename <$adminmail>";
mail($cidinfo['email'], $subject, $message, "From: $from\nX-Mailer: PHP/" . phpversion());
}
if (($testdate > $bidinfo['dateend']) AND ($bidinfo['dateend'] != "0000-00-00")) {
$db->sql_query("UPDATE ".$prefix."_nsnba_banners SET active='0' WHERE bid='$bannum'");
$fecha = date("F jS Y, h:iA.");
$subject = _BA_BANSTATAT." $sitename";
$message = _BA_COMPSTAT." $sitename:\n\n";
$message .= _BA_CONNME.": ".$cidinfo['name']."\n";
$message .= _BA_BANNUM.": $bannum\n";
$message .= _BA_IMGSRC.": $nukeurl/".$bidinfo['imageurl']."\n";
$message .= _BA_CLKU.": ".$bidinfo['clickurl']."\n\n";
$message .= _BA_IMPMAD.": ".$bidinfo['impmade']."\n";
$message .= _BA_CLKS.": ".$bidinfo['clicks']."\n";
$message .= _BA_STRDTE.": ".$bidinfo['datestr']."\n";
$message .= _BA_ENDDTE.": ".$bidinfo['dateend']."\n";
$message .= _BA_REPORTON.": $fecha";
$from = "$sitename <$adminmail>";
mail($cidinfo['email'], $subject, $message, "From: $from\nX-Mailer: PHP/" . phpversion());
}
if ($bidinfo['flash']==1 AND $bidinfo['code']==0) {
$babanners4 = "\n\n<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width='".$bidinfo['width']."' height='".$bidinfo['height']."'>";
$babanners4 .= "\n<param name=movie value='images/banners/clicksba_h.swf'>";
$babanners4 .= "\n<param name=quality value=high>";
$babanners4 .= "\n<param name=FlashVars value='imageurl=".$bidinfo['imageurl']."&bid=$bannum'>";
$babanners4 .= "\n<embed src='images/banners/clicksba_h.swf?imageurl=".$bidinfo['imageurl']."&bid=$bannum' quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width='".$bidinfo['width']."' height='".$bidinfo['height']."'>";
$babanners4 .= "\n</embed> ";
$babanners4 .= "\n</object>\n\n";
} elseif ($bidinfo['flash']==0 AND $bidinfo['code']==1) {
$fp = fopen ($bidinfo['imageurl'], "rb");
$contents = fread ($fp, filesize($bidinfo['imageurl']));
fclose ($fp);
$babanners4 = "$contents";
} else {
$babanners4 = "<a href='clicksba.php?bid=$bannum' target='_blank'><img src='".$bidinfo['imageurl']."' border='0' alt='".$bidinfo['alttext']."' title='".$bidinfo['alttext']."' height='".$bidinfo['height']."' width='".$bidinfo['width']."'></a>";
}
} else {
$babanners4 = "<a href='modules.php?name=$modname'><img src='modules/$modname/images/ban-banner-4.png' border='0' alt='$sitename' title='$sitename'></a>";
}
$bresult3 = $db->sql_query("SELECT bid, datestr FROM ".$prefix."_nsnba_banners WHERE pid='4' AND active='-1'");
$numrows3 = $db->sql_numrows($bresult3);
if ($numrows3>0) {
while (list ($id, $datestr) = $db->sql_fetchrow($bresult3)) {
if (($testdate >= $datestr) AND ($datestr != "0000-00-00")) {
$db->sql_query("UPDATE ".$prefix."_nsnba_banners SET active='1' WHERE bid='$id'");
}
}
}
?>
| [/code] |
|
|
|
 |
kguske
Site Admin

Joined: Jun 04, 2004
Posts: 6437
|
Posted:
Mon Jun 26, 2006 10:21 am |
|
Uh...do you want them to all display at once? |
_________________ I search, therefore I exist...
Only registered users can see links on this board! Get registered or login! |
|
|
 |
vcorreia

|
Posted:
Mon Jun 26, 2006 5:38 pm |
|
yep. Instead of the random display,do display all the active banners.
something like: instead of "$bannum = $abid[rand(1, $numrows)]; " it should show all of the active banners, removing the random display of a single banner.
Thanks! |
|
|
|
 |
kguske

|
Posted:
Mon Jun 26, 2006 8:01 pm |
|
You will need a loop to display them all, and you'll probably want some kind of javascript to display them like a slide show, unless you want them to take up a lot of space. |
|
|
|
 |
vcorreia

|
Posted:
Tue Jun 27, 2006 8:51 am |
|
The banners are small, so there is no problem to show them all in a collumn.
Is there another module or block, where we can show small advertisements images, and be possible to change them trough the admin without messing around with the block code???? This would be great.
The porpuse is to made a collumn with small images (100x50) menu that each image links to somewhere. But it must be editable through the admin menu. |
|
|
|
 |
vcorreia

|
Posted:
Tue Jun 27, 2006 8:56 am |
|
Everything would be solved if this simple hack has to be made in the NSN banner Ads block. There is a small hack of this kind, that disables the random, by WESTERN STUDIOS http://www.westernstudios.net/web/, but I am not interested on subscribing them to get it!
Can u please help? Thanks in advance. |
|
|
|
 |
gregexp
The Mouse Is Extension Of Arm

Joined: Feb 21, 2006
Posts: 1497
Location: In front of a screen....HELP! lol
|
Posted:
Tue Jun 27, 2006 10:26 am |
|
Can you post the code of the block itself, not the include. |
_________________ For those who stand shall NEVER fall and those who fall shall RISE once more!! |
|
 |
 |
vcorreia

|
Posted:
Tue Jun 27, 2006 5:23 pm |
|
it is all on the include. Block code only states this :
Code:if ( !defined('BLOCK_FILE') ) {
die("Illegal Block File Access");
}
$content = "";
@include("includes/babanners4.php");
$content = "<center><br>$babanners4</center>";
?>
|
|
|
|
|
 |
|