Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Random Side Banners Outside Main Body in Fixed Position Details »»
Random Side Banners Outside Main Body in Fixed Position
Version: 1.00, by CAG CheechDogg CAG CheechDogg is offline
Developer Last Online: Jul 2023 Show Printable Version Email this Page

Category: Mini Mods - Version: 4.0.0 Rating:
Released: 11-08-2012 Last Update: Never Installs: 20
Supported Template Edits
Re-useable Code Additional Files Translations  

Random Side Banners

Quite a few people have asked how do you add side banners outside of your forum's main body and no one has offered a solution that I know of.

This mod allows you to have random banners outside of your forums main body in a fixed position. The banners will rotate with every unique visit to your forums similar to the dszuecs's "New way to force guests to register" Mod. The php code to make the banners rotate could possibly be written better, right now you don't always get a different random banner unless you completely close your browser and come back with a new session it seems.

The rotate.php code is not mine I found it not only in dszuecs's New way to force guests to register Mod but also online. I did however use his Mod as a base to get this Mod done.

If anyone can fix the rotate.php file so that you get a random with every page load that would be great.

The banners used in this mod have the dimensions of height:435px width:140px but you can change them to any size you want.

Included are the files to upload to your FORUMROOT using FTP:

Files included are:

1. left_banner_rotate.php
2. right_banner_rotate.php
3. images (includes 1 png file you can use as a template for your banners)
4. additional_css.txt (code to add to your additional_css)
5. header_template.txt (code to add to your header template)

You will need to make 2 manual template edits to your additional.css and your header template.

The code included in the additional_css file can be added at the very end of your additional.css file.

Code:
div.left-banner {
background:url(left_banner_rotate.php);
background-repeat: no-repeat; 
display:block;
height:435px;
width:140px;
position:fixed;
left:5px;
top:50px;
}
div.right-banner {
background:url(right_banner_rotate.php);
background-repeat: no-repeat; 
display:block;
height:435px;
width:140px;
position:fixed;
right:5px;
top:50px;
}
The code included in the header_template file must be added at the very top before all other code in your header template.

Code:
<div class="left-banner"></div>
<div class="right-banner"></div>
This is my first Mod contribution you guys so be gentle with me. I am just learning vBulletin's way of doing things and hopefully I can contribute other small Mods in the future.

Download Now

File Type: zip random_side_banners.zip (249.0 KB, 197 views)

Screenshots

File Type: jpg attachment_1.jpg (201.3 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
5 благодарности(ей) от:
aaronhaul, ChiNa, Max Taxable, RichieBoy67, Toorak Times

Comments
  #32  
Old 10-07-2015, 07:46 AM
Toorak Times's Avatar
Toorak Times Toorak Times is offline
 
Join Date: Jan 2011
Posts: 436
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CAG CheechDogg View Post
Do you have a link to your site so I can take a look?
www.tooraktimes.com.au
Reply With Quote
  #33  
Old 10-07-2015, 09:05 PM
CAG CheechDogg's Avatar
CAG CheechDogg CAG CheechDogg is offline
 
Join Date: Feb 2012
Location: Riverside, California USA
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do you have it installed on a particular style?
Reply With Quote
  #34  
Old 10-08-2015, 02:46 PM
Toorak Times's Avatar
Toorak Times Toorak Times is offline
 
Join Date: Jan 2011
Posts: 436
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CAG CheechDogg View Post
Do you have it installed on a particular style?
No mate, a LOT of mods though
Reply With Quote
  #35  
Old 01-20-2016, 02:05 AM
mangmel mangmel is offline
 
Join Date: Nov 2010
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks..............
Reply With Quote
  #36  
Old 01-20-2016, 04:55 AM
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Location: CT - Down in a hole..
Posts: 3,057
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Toorak Times View Post
No mate, a LOT of mods though
I haven't looked into the entire issue but from a quick peek at your site I see a pretty severe horizontal scroll. Probably not noticeable with high res screens but noticeable on my laptop using 1920 resolution.
Reply With Quote
  #37  
Old 04-19-2016, 07:54 PM
yjmalmsteen yjmalmsteen is offline
 
Join Date: Feb 2008
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great mod, thanks!
But can i use it without rotating option?and how?
I have to use still images there.
Thanks
Reply With Quote
  #38  
Old 04-20-2016, 07:01 PM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by yjmalmsteen View Post
Great mod, thanks!
But can i use it without rotating option?and how?
I have to use still images there.
Thanks
You *should* be able to with some small changes...

So take this:
Code:
div.left-banner {
background:url(left_banner_rotate.php);
background-repeat: no-repeat; 
display:block;
height:435px;
width:140px;
position:fixed;
left:5px;
top:50px;
}
div.right-banner {
background:url(right_banner_rotate.php);
background-repeat: no-repeat; 
display:block;
height:435px;
width:140px;
position:fixed;
right:5px;
top:50px;
}
Change to:
Code:
div.left-banner {
background:#ffffff;
display:block;
height:435px;
width:140px;
position:fixed;
left:5px;
top:50px;
}
div.right-banner {
background:#ffffff;
display:block;
height:435px;
width:140px;
position:fixed;
right:5px;
top:50px;
}
*Now the rotating .php file is no longer the background and it's just a white background .

Now take this:
Code:
<div class="left-banner"></div>
<div class="right-banner"></div>
And change it, you must add in your ad/banner codes or anything you want shown inside the div tags, here is an example:
Code:
<div class="left-banner">
NEW CODE HERE IF ADS OR BANNERS INCLUDING Google Ads/Ebay Partnership Ads/Openx or Revive Ad Server codes go HERE.
</div>
<div class="right-banner">
<a href="www.vbulletin.org" target="_blank"><img src="images/mybannerimage.png" alt="My Banner Title" /></a>
</div>
The top you could paste ad/banner codes in between the div tags, on the bottom "right-banner" I simply showed a basic ahref tag wrapped around an image i.e. a clickable banner which is very simple to do, this is also an example of what you said is a "still image" but it's linked to a site .

To adjust width/height simply change the following lines:
Code:
height:435px;
width:140px;
To the new values i.e. if it's a 300x250 ad simply change those to that, otherwise you could use 100% value instead of 435px (if it's too big then the div wrapping this does not have height defined or rather it's not inherited etc).

Let me know if this works for you or what didn't work .
Reply With Quote
2 благодарности(ей) от:
CAG CheechDogg, MarkFL
  #39  
Old 04-21-2016, 03:07 AM
CAG CheechDogg's Avatar
CAG CheechDogg CAG CheechDogg is offline
 
Join Date: Feb 2012
Location: Riverside, California USA
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks SP ..... just saw this .....
Reply With Quote
2 благодарности(ей) от:
MarkFL, TheLastSuperman
  #40  
Old 04-21-2016, 03:15 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CAG CheechDogg View Post
Thanks SP ..... just saw this .....
I would be willing to automate the CSS and header template edits, and add some product settings to allow the user to define the size of the banners if you want. If you are interested, shoot me a PM with your email addy, and I will send you the revised product.
Reply With Quote
3 благодарности(ей) от:
CAG CheechDogg, KevinL, TheLastSuperman
  #41  
Old 04-22-2016, 11:38 PM
CAG CheechDogg's Avatar
CAG CheechDogg CAG CheechDogg is offline
 
Join Date: Feb 2012
Location: Riverside, California USA
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post
I would be willing to automate the CSS and header template edits, and add some product settings to allow the user to define the size of the banners if you want. If you are interested, shoot me a PM with your email addy, and I will send you the revised product.

Go ahead and handle business Mark ... release it for all to enjoy my Man ...
Reply With Quote
Благодарность от:
TheLastSuperman
Reply


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 11:05 PM.


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.05317 seconds
  • Memory Usage 2,364KB
  • Queries Executed 26 (?)
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
  • (7)bbcode_code
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (13)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete