vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Mini Mods - Random Side Banners Outside Main Body in Fixed Position (https://vborg.vbsupport.ru/showthread.php?t=290404)

CAG CheechDogg 11-08-2012 11:00 PM

Random Side Banners Outside Main Body in Fixed Position
 
1 Attachment(s)
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.

CAG CheechDogg 11-09-2012 01:14 PM

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;
}


synseal 11-13-2012 11:53 AM

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?.

Alan_SP 11-15-2012 10:56 PM

Looks good. :up:

CAG CheechDogg 11-16-2012 08:36 AM

Quote:

Originally Posted by synseal (Post 2380784)
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 (Post 2381396)
Looks good. :up:

Thanks Alan, did everything work ok for you?

synseal 11-19-2012 02:42 AM

1 Attachment(s)
Quote:

Originally Posted by CAG CheechDogg (Post 2381475)
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.

CAG CheechDogg 11-19-2012 01:03 PM

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.

synseal 11-21-2012 04:22 PM

Quote:

Originally Posted by CAG CheechDogg (Post 2382566)
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:.

CAG CheechDogg 11-21-2012 09:14 PM

Quote:

Originally Posted by synseal (Post 2383395)
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.

legiondadon 11-22-2012 12:28 AM

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


All times are GMT. The time now is 04:23 PM.

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.01088 seconds
  • Memory Usage 1,749KB
  • 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
  • (5)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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