vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Mist's Random Banner Hack (https://vborg.vbsupport.ru/showthread.php?t=47648)

Koss 02-12-2003 06:56 PM

im sorry im not sure if I understand what you mean?

do you mean like this:

Code:

$bannerh[2]=\"<OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,0,0" ID=popup_06 WIDTH=250 HEIGHT=250>
<PARAM NAME=movie VALUE="http://www.yourdomain.com/banner.swf?url=[AffiliateWizTargetURL]http://www.yourdomain.com"> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>
 <EMBED src="http://www.yourdomain.com/banner.swf?url=[AffiliateWizTargetURL]http://www.yourdomain.com" menu=false quality=high bgcolor=#FFFFFF swLiveConnect=FALSE WIDTH=250 HEIGHT=250 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</EMBED>
</OBJECT>";


Dean C 02-13-2003 03:26 PM

No only in the html code

Like this:

PHP Code:

$bannerh[2]= "<OBJECT classid=\"clsid27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,0,0\" ID=popup_06 WIDTH=250 HEIGHT=250>
<PARAM NAME=movie VALUE=\"http://www.yourdomain.com/banner.swf?url=[AffiliateWizTargetURL]http://www.yourdomain.com\"> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>
 <EMBED src=\"http://www.yourdomain.com/banner.swf?url=[AffiliateWizTargetURL]http://www.yourdomain.com" 
menu=false quality=high bgcolor=#FFFFFF swLiveConnect=FALSE WIDTH=250 HEIGHT=250 TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\">
</EMBED>
</
OBJECT>"; 

I think i managed to find all the double quotes hehe

- miSt

Koss 02-15-2003 05:06 PM

thanks but that didnt work....guess its back to PPN's one banner hack

oh well thanks for helping out

maoz440 03-12-2003 12:44 PM

nano - works perfectly! Thanks :D

klunderj 03-12-2003 03:33 PM

This is my first real hack of a hack

I really wanted to have the banner have a clickable url... so I modified the hack inphpinclude as follows...

//©hololith.com(NanoEntity)
$banners=array('image1', 'image2'); //images names
$bannerhref=array('url1.com','url2.com'); //url names
$randomnum=rand(0,count($banners)-1); //generate random num
$bannerimg=$banners[$randomnum]; //random image
$bannerurl=$bannerhref[$randomnum]; //corresponding random url

$adbannerurl="<a href=\"http://$bannerurl\">\n";
$adbanner="<img src=\"/images/banner/$bannerimg.jpg\" border=\"0\" alt=\"\">\n"; //images output

//END ©hololith.com(NanoEntity)

In my header I simpy call $addbanner, and $addbannerurl
Hope this is useful...

engquist 07-21-2003 12:30 AM

hey mist, wanted to let you know that the code doesn't work unless you change this part:

PHP Code:

//output banner
$banner "<img src=\"https://vborg.vbsupport.ru/images/banner$num\" border=\"0\" alt=\"\" />"

to:
PHP Code:

//output banner
$banner "<img src=\"https://vborg.vbsupport.ru/images/$banner[$num]\" border=\"0\" alt=\"\" />"

notice the difference?

but then it works fine, thanks MIST!

Zedd 02-08-2004 12:45 PM

Quote:

Originally Posted by NanoEntity
nice one Mist!

Mist! I would just forget about global.php, why not just insert this code to the phpinclude, it will be easy to mod if you need to add a new banner.

Also why list them as
$banner[1]="banner1.gif";
$banner[2]="newthread.gif";

Why not make an Array.
$banners=array('banner1', 'banner2');

Here is a simple way to do it, only takes 3 lines
PHP Code:

//?hololith.com(NanoEntity)
$banners=array('banner1''banner2'); //images names
$shuffle=$banners[rand(0,count($banners)-1)]; //shuffle images 
$adbanner="<img src=\"https://vborg.vbsupport.ru/greentek/adbanners/$shuffle.gif\" border=\"0\" alt=\"\">\n"//images output
//END ?hololith.com(NanoEntity) 

Was that easy :)

DEMO:
http://artwork.hololith.com/sigs.php - random
http://artwork.hololith.com/sigs.php?show=draco v1 - static
http://artwork.hololith.com/sigs.php?show=magal v1 - static
http://artwork.hololith.com/sigs.php?show=kinght v1 - static

This generates random signature, same way it would a banner ad, but its more advanced when it comes to code, about 13 lines.

--------------------------
EDIT - Addon

I am geting PMs from people that want diffrent urls to diffrent banners, here is the code

This was tested and it works.
PHP Code:

//?hololith.com(NanoEntity)
$banner1="<a href=\"http://url1\"><img src=\"{ imagesfolder }/adbanners/banner1.gif\" border=\"0\" alt=\"\"></a>";
$banner2="<a href=\"http://url2\"><img src=\"{ imagesfolder }/adbanners/banner2.gif\" border=\"0\" alt=\"\"></a>";

$banners=array($banner1,$banner2); //banner array
$shuffle=$banners[rand(0,count($banners)-1)]; //shuffle banners 
$adbanner="$shuffle\n"//banners output
//END ?hololith.com(NanoEntity) 

Enjoy.

Thanx Nanoentity, you code for the phpinclude template did the trick. IT was exactly what I wanted with no file hacks.

Dave Rosteck 02-03-2005 03:20 AM

Quote:

Originally Posted by engquist
hey mist, wanted to let you know that the code doesn't work unless you change this part:

PHP Code:

//output banner
$banner "<img src=\"https://vborg.vbsupport.ru/images/banner$num\" border=\"0\" alt=\"\" />"

to:
PHP Code:

//output banner
$banner "<img src=\"https://vborg.vbsupport.ru/images/$banner[$num]\" border=\"0\" alt=\"\" />"

notice the difference?

but then it works fine, thanks MIST!

I hate to bump but you're right, it won't work without this fix. I also wanted to point out that this hack works with vB3 as well.

Simply place the revised banner code under
PHP Code:

eval('$headinclude = "' fetch_template('headinclude') . '";'); 

in global.php.

ReZ 09-11-2005 04:05 PM

By any chance would this work with 3.0.7 also?

Marco van Herwaarden 09-11-2005 05:42 PM

vB2 hacks will not work with vB3.


All times are GMT. The time now is 05:58 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01236 seconds
  • Memory Usage 1,763KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (8)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete