vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Miscellaneous Hacks - 10 Random Banners (Or Other HTML Objects) (https://vborg.vbsupport.ru/showthread.php?t=232023)

EWGF 01-02-2010 10:00 PM

10 Random Banners (Or Other HTML Objects)
 
1 Attachment(s)
Note: This product is not limited to 10 random banners since it drives on HTML. You can tune it to showing 10 defined YouTube video's which will be displayed randomly. It's up to you.

Description
This lightweight product allows you to place $tenrandombanners on your template(s), which will randomly pick one of the 10 admin-defined banners. Every refresh of the page gives you another banner, unless the same banner is randomly chosen again.
Setting the banners (or any other object you want to display) is completely done with HTML (and not with millions of settings), so you can have full control over the height, width, alt, target, etc. per banner. You could use any other kind of HTML or conditional statements (if usergroup, if forum, if script, etc.) too.

Details
Works for 3.7.X and 3.8.X, not build for 4.X or higher
Adds one plugin and 22 phrases.
The CMPS module adds one template and one .php module.

Install product
- Upload product-10randombanners.xml in the Admin CP through the section Products And Plugins.
- Adjust settings at vBulletin Options > 10 Random Banners

Install CMPS-module (optional)
- Upload cmps-10randombanners.xml in the Admin CP through Upload Module at the section vBadvanced.
- Set on which page the module should appear.

Notes
- Fill in from 1 to 10, the script won't pick up gaps between fields. You're not obligated to use all 10 fields. Just fill in the fields chronologically: 1, 2, 3, 4, etc.
- Not likely to work on vBulletin 4.X or higher

History
1.0 - initial release (january 2010)
1.1 - added CMPS module and changed product for better rotation between banners (august 2011)

bing11 01-03-2010 01:04 PM

thanks

thernus 01-03-2010 09:21 PM

Hi

ist only to install as addon or must I set in addition $tenrandombanners to template source???

THx

EWGF 01-04-2010 07:15 AM

You must manually put $tenrandombanners somewhere in your template after installing the plugin, because this product does not support hooks (yet).

yamahapaul 01-04-2010 11:42 AM

1 Attachment(s)
I'm looking for a simple way of having random pictures in the top right corner opposite (as shown where the cross is on my attachment) and I'm wondering if I could use this to do it??

EWGF 01-04-2010 01:06 PM

Yes, that is possible. Add $tenrandombanners next to "$ad_location[ad_header_logo]" in your Header template.

Then setup the codes in vBulletin settings, like for example:
HTML Code:

<img src="/forum/banners/banner1.jpg" alt="Banner 1" />
HTML Code:

<img src="/forum/banners/banner2.jpg" alt="Banner 2" />
...

yamahapaul 01-05-2010 04:48 PM

Quote:

Originally Posted by EWGF (Post 1946877)
Yes, that is possible. Add $tenrandombanners next to "$ad_location[ad_header_logo]" in your Header template.

Then setup the codes in vBulletin settings, like for example:
HTML Code:

<img src="/forum/banners/banner1.jpg" alt="Banner 1" />
HTML Code:

<img src="/forum/banners/banner2.jpg" alt="Banner 2" />
...

Thanks, I'm gonna give it a go :D

barcena 02-03-2010 06:28 PM

Quote:

Originally Posted by EWGF (Post 1946688)
You must manually put $tenrandombanners somewhere in your template after installing the plugin, because this product does not support hooks (yet).

Excuseme, in what template?. Will you explain to me at no coder level?.

Thanks. :)

I wanted so it will only shows in one forum category.

barcena 02-03-2010 06:57 PM

Nevermind, admins please delete this if you want.

barcena 02-03-2010 07:16 PM

Lets say I will like to show the banner afther the third post on a giving forum, what should I input and where?

Need some help on a href, target, alt and border i guess.

HTML Code:

<a href="1" target="id:3"><img src="http://i50.tinypic.com/15gedxh.jpg" alt="4" height="795" width="95" border="7" /></a>

EWGF 03-29-2010 06:07 PM

I believe this code provides in showing the banner after the third post in forums 1, 2 and 3. In your case, this code should be placed in the "postbit" or "postbit_legacy" template
PHP Code:

<if condition="$post[postcount] % $vboptions[maxposts] == 3 AND in_array($GLOBALS[forumid], array(1,2,3))">$tenrandombanners</if> 


MagicThemeParks 04-11-2010 10:44 PM

Thanks for this! :up:

How do you increase this to more than ten banners or how do you run a 2nd instance of this same mod on the same page?

xoxstugotsxox 04-11-2010 11:47 PM

Is it possible to add this to CMPS?

EWGF 04-18-2010 10:56 PM

Quote:

Originally Posted by MagicThemeParks (Post 2019670)
Thanks for this! :up:

How do you increase this to more than ten banners or how do you run a 2nd instance of this same mod on the same page?

More than ten banners can be done by manually adjusting the plugin, although the settings in vBulletin Options only support ten fields.
You can place the variable more than once

Quote:

Originally Posted by xoxstugotsxox (Post 2019690)
Is it possible to add this to CMPS?

Yes

Scyther 07-21-2011 11:21 AM

nice mod..

marked installed....thanks..

BGObsession 07-30-2011 04:41 PM

I understand we can edit our CMPS template and add this, but what I want to be able to do on CMPS is to have this set as a center 'module' so I can rotate a series of images that change with every refresh. I've played with it, but can't figure out how to make that work.

Idea?

EWGF 08-02-2011 12:50 AM

You probably added $tenrandombanners as a BBcode in the module. That variable only works in templates :)

I made a CMPS module which does exactly what you're looking for. I also updated the code of the plugin for better rotation.

BGObsession 08-05-2011 03:22 PM

I knew the template code wouldn't work, just wasn't sure where to go from there. Awesome - I'm going to give it a try - thanks for the effort!

BGObsession 08-05-2011 08:40 PM

Working like a charm. Took me a bit to figure out I had to upload the first xml as a 'product', then upload the other xml in the CMPS section as a module, but I got it going. Thanks! Not often you ask for very specific help and get it. Truly appreciated.

BGObsession 06-03-2013 05:27 PM

Will this work on vbulletin version 4??? Anyone tried it?

EWGF 06-08-2013 10:42 AM

Quote:

Originally Posted by BGObsession (Post 2425589)
Will this work on vbulletin version 4??? Anyone tried it?

In theory it could work, judging on vb4 product codes. Can't verify it, I don't have vb4

BGObsession 06-10-2013 12:53 AM

Unable to get it working so far....looking for other options.


All times are GMT. The time now is 06:05 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.01279 seconds
  • Memory Usage 1,765KB
  • 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_html_printable
  • (1)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (22)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete