Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications

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
  #2  
Old 11-09-2012, 01:14 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

For easier banner management you guys can use the following Mod together with this one:

https://vborg.vbsupport.ru/showthrea...mages&page=137

This will allow you to set up to 10 different banners per side. To do this you do the following:

Open up your header template and do the following small edit if you already installed this Mod:

Find this:

Code:
<div class="left-banner"></div>
<div class="right-banner"></div>
Replace with this:

Code:
<div class="left-banner"><!--@vbbanners:0@--></div>
<div class="right-banner"><!--@vbbanners:2@--></div>
Note, there are 10 positions for the banners starting with 0 through 9, the 2 positions I used here are position 0 for the left side banners and position 2 for the right side banners. You can use any position you want for yours, just replace the red highlighted numbers with your positions.

This also gives you a better rotation of the your banners than using the left_banner_rotate.php and right_banner_rotate.php files, so you can remove those from your additional.css.


Change the code in additional.css to the following:

Code:
div.left-banner {
display:block;
height:435px;
width:140px;
position:fixed;
left:5px;
top:50px;
}
div.right-banner {
display:block;
height:435px;
width:140px;
position:fixed;
right:5px;
top:50px;
}
Reply With Quote
Благодарность от:
synseal
  #3  
Old 11-13-2012, 11:53 AM
synseal's Avatar
synseal synseal is offline
 
Join Date: Apr 2009
Posts: 334
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent!, was looking for something like this.

Don't know if your aware but when I click Forum in your Navbar on your site it takes me to google.co.uk?.
Reply With Quote
Благодарность от:
CAG CheechDogg
  #4  
Old 11-15-2012, 10:56 PM
Alan_SP's Avatar
Alan_SP Alan_SP is offline
 
Join Date: Nov 2009
Posts: 1,122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks good. :up:
Reply With Quote
Благодарность от:
CAG CheechDogg
  #5  
Old 11-16-2012, 08:36 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

Quote:
Originally Posted by synseal View Post
Excellent!, was looking for something like this.

Don't know if your aware but when I click Forum in your Navbar on your site it takes me to google.co.uk?.
Glad you like it synseal! And what Forum on what Navbar buddy? I have been going crazy trying to find this link and I don't see it! lol...help me out here!

Quote:
Originally Posted by Alan_SP View Post
Looks good. :up:
Thanks Alan, did everything work ok for you?
Reply With Quote
  #6  
Old 11-19-2012, 02:42 AM
synseal's Avatar
synseal synseal is offline
 
Join Date: Apr 2009
Posts: 334
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CAG CheechDogg View Post
Glad you like it synseal! And what Forum on what Navbar buddy? I have been going crazy trying to find this link and I don't see it! lol...help me out here!



Thanks Alan, did everything work ok for you?
Sorry been away for a few days,

This link on your forum redirects me to google, dont know why?.

Edit - to add so do every link in that drop down, strange.
Attached Images
File Type: jpg forum.jpg (38.1 KB, 0 views)
Reply With Quote
  #7  
Old 11-19-2012, 01:03 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

Ah ok, you might be on an old browser that I have banned using the Ban Spiders mod which redirects them to google.com ...

What country are you in? Send me your ip address and I will see if it's in one of the ip ranges I have banned.
Reply With Quote
  #8  
Old 11-21-2012, 04:22 PM
synseal's Avatar
synseal synseal is offline
 
Join Date: Apr 2009
Posts: 334
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CAG CheechDogg View Post
Ah ok, you might be on an old browser that I have banned using the Ban Spiders mod which redirects them to google.com ...

What country are you in? Send me your ip address and I will see if it's in one of the ip ranges I have banned.
It must have been my browser as you said cause I recently formatted my PC and you site is working fine for me now.

Sorry to take this off topic, regards :up:.
Reply With Quote
  #9  
Old 11-21-2012, 09:14 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 synseal View Post
It must have been my browser as you said cause I recently formatted my PC and you site is working fine for me now.

Sorry to take this off topic, regards :up:.
No problem buddy, thanks a lot for pointing that out regardless though.
Reply With Quote
  #10  
Old 11-22-2012, 12:28 AM
legiondadon legiondadon is offline
 
Join Date: Aug 2012
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the issue i was having with this is when members had a zoomed in browser...the images wouldnt zoom with the rest of the forum and caused them to overlap over forum content for sum members...had to disable although this is a great idea
Reply With Quote
Reply

Thread Tools

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 06: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.07732 seconds
  • Memory Usage 2,342KB
  • Queries Executed 24 (?)
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
  • (5)bbcode_code
  • (5)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
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (8)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (3)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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