Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools
Mist's Random Banner Hack Details »»
Mist's Random Banner Hack
Version: 1.00, by Dean C Dean C is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 01-11-2003 Last Update: Never Installs: 19
 
No support by the author.

Mist's Random Banner Hack

What does this hack do?

This allows you to have a random banner in your header.

Latest Version: 1.0

+++++++++++++++++++++++++++++++++++++++++++
If you install this hack then please click the INSTALL button.
+++++++++++++++++++++++++++++++++++++++++++

Regards

- miSt

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 01-13-2003, 03:22 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmmm well if someone installs this can they link me and i'll put it in their post (obviously with their permission )

- miSt
Reply With Quote
  #13  
Old 01-13-2003, 07:06 PM
DrkFusion's Avatar
DrkFusion DrkFusion is offline
 
Join Date: Nov 2001
Posts: 1,926
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would install this, but the fact that it is manually edited (to change banners and stuff) that is the con in my view of this hack, the rest looks good.
Reply With Quote
  #14  
Old 01-14-2003, 06:38 PM
Floris Floris is offline
 
Join Date: Jan 2002
Posts: 1,898
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PPN made an advert manager .. isn't this the same?
Reply With Quote
  #15  
Old 01-15-2003, 03:17 AM
setsykid setsykid is offline
 
Join Date: Jul 2002
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello, I'd like to ask where I can put the url for the banners?
I know I can put more banners creating my own variable, they are just images but the url for them?

thx
Reply With Quote
  #16  
Old 01-15-2003, 06:59 AM
NanoEntity NanoEntity is offline
 
Join Date: Oct 2001
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #17  
Old 01-15-2003, 07:14 AM
NanoEntity NanoEntity is offline
 
Join Date: Oct 2001
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your joking?

Just put this in <a href=\"http://url\"><img src=...........></a>

And theres your code...

Quote:
Originally posted by setsykid
Hello, I'd like to ask where I can put the url for the banners?
I know I can put more banners creating my own variable, they are just images but the url for them?

thx
Reply With Quote
  #18  
Old 01-15-2003, 03:38 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by xiphoid
PPN made an advert manager .. isn't this the same?
I must say i have lots of plans for this with admin cp intigration soon but again i chose to be a manual edit hack because i'm not confident enough with using mysql to store the banners - i haven't even got to the mysql part in my php book so bare with me for a while hehe

Also PPN's hack doesn't currently work

- miSt
Reply With Quote
  #19  
Old 01-15-2003, 03:39 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
$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 
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.
The reason i decided to have the variables as an array is to make it easier for newbies to add more banners - simple as that !

- miSt
Reply With Quote
  #20  
Old 01-18-2003, 08:07 AM
Mike Gaidin's Avatar
Mike Gaidin Mike Gaidin is offline
 
Join Date: Oct 2001
Location: Michigan
Posts: 247
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Will this only work in the header?
Reply With Quote
  #21  
Old 01-18-2003, 08:26 AM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No you can put the $banner variable in any template you wish

- miSt
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:13 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05434 seconds
  • Memory Usage 2,322KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete