vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Forum Display Enhancements - Add a banner image to each forum (vb3.6) (https://vborg.vbsupport.ru/showthread.php?t=132716)

Zachariah 11-27-2006 10:00 PM

Add a banner image to each forum (vb3.6)
 
/* -----------------11/28/2005 10:37AM-----------------
[HowTo] Add a banner option image to each forum w/ Link V.1.7
Tested on vBulletin: 3.6.4

Zachariah - http://www.gzhq.net

Quote:

This is an update of my previous hack:
*** Add a banner image to each forum (VB 3.5x)
https://vborg.vbsupport.ru/showthread.php?t=94119
DEMO
- banner for an on-line game clan/guild.

*** Info:
  • This modification will Add an image banner w/ link Or paste in your own HTML code option per forum.
  • These files can be any image. (png, jpg, gif, ect).
  • This will be located after the $navbar on FORMDISPLAY and SHOWTREAD.
  • This images can be located on the localhost or on a remote server.

Changelog:
------------
1.7
- str_replace used to place hack at $navbar in FORUMDISPLAY, SHOWTHREAD.
- choice to show in thread per forum.
- Place $add_banner in template if str_replace fails to work.
- add_banner template added


1.6
Banner shows up on each thread
adds: 1 more template edit to the install
Requested by: - Ryan McBain

** Note: 1.5 - 1.6 needs only to edit SHOWTHREAD not Reinstall the XML files

1.5
Added HTML option
Added 3.x to VB 3.5 upgrade XML file.

--------------------------------------------------*/

Zachariah 11-28-2006 04:08 PM

1st post :D

*** Useage:
These files can be any image. (png, jpg, gif, ect) or paste your HTML code.

To add banners go to:

Forums & Moderators => Forum Manager => Edit/Add Forum =>
scroll do to the bottom enter your details.

This script has a few options.
-
By default install it will attempt to place itself
in FORUMDISPLAY, SHOWTHREAD under location "$navbar" in the templates. If for some
reason your banner does not show up you edit and place $add_banner within the templates.

Zachariah 11-28-2006 04:08 PM

Here is a simple JAVA random banner code you can paste in the HTML area of any forum.

EX:
This will show @ random.

image1.jpg @ http://www.yoursite1.com
image2.jpg @ http://www.yoursite2.com
image3.jpg @ http://www.yoursite3.com


Code:

<script language="javascript" type="text/javascript">
<!--
function banner() {
};

banner = new banner();
number = 0;

// bannerArray
banner[number++] = "<a href='http://www.yoursite1.com' target='_blank'><img src='/banners/image1.jpg' alt='' border='0' /></a>"
banner[number++] = "<a href='http://www.yoursite2.com' target='_blank'><img src='/banners/image2.jpg' alt='' border='0' /></a>"
banner[number++] = "<a href='http://www.yoursite3.com' target='_blank'><img src='/banners/image3.jpg' alt='' border='0' /></a>"
 
// keep adding items above here...

increment = Math.floor(Math.random() * number);
document.write(banner[increment]);

//-->
</script>

Useage: If you need more banners edit / add another row.
Code:

banner[number++] = "<a href='http://www.yoursite1.com' target='_blank'><img src='/banners/image1.jpg' alt='' border='0' /></a>"
Link of Destination
Image location

projectego 11-28-2006 05:46 PM

Thank you very much, Zachariah! ;)

[high]* projectego clicks install[/high]

Veer 11-28-2006 05:47 PM

WOW, Thanks a Lot Zachariah

*Installed*

ShackMaster 11-28-2006 05:49 PM

I'm not able to get this to work, either with a single banner or with the script for random banners.

Instead of placing the $add_banner in Forumdisplay and Showthread, could it be added in the Navbar template?

Replicators 11-28-2006 07:01 PM

What don't make sense is the 3.5.x version works just fine for the 3.6, so whats the sense in a update?

firstrebel 11-28-2006 07:01 PM

Installed then uninstalled, for a few reasons.

1] Could not get it to work, just got red X's, in fact got 2 red x's, and I had 5 image files in the scripts. Tried full URL and relative URL.

2] Putting this in each forum is a bit of a long job as I have 40+ forums and I could not get it to work on the forum homepage at all. I would have thought putting the code in the navbar template would be better, then they appear in forumhome and all other forums. I tried that but that didn't work either.

I am obviously doing something wrong, but what. One thing I can't work out is
Code:

href='http://www.yoursite1.com'
href='http://www.yoursite2.com'

what do I put if it's all on one site.

Bob

Jonathan Young 11-28-2006 10:15 PM

Hi i updated, then uninstall ed because i had a problem with my images displaying multiple times. I also reinstalled, images still show multiple times website www.bgleague.com/forum

Zachariah 11-28-2006 11:47 PM

Quote:

Originally Posted by ShackMaster (Post 1127423)
I'm not able to get this to work, either with a single banner or with the script for random banners.

Instead of placing the $add_banner in Forumdisplay and Showthread, could it be added in the Navbar template?

Yes you can but it will only show the banner image on forumdisplay and show thread.

EX:
On the forumdisplay:
Code:

$search_text = '$navbar';
$vbulletin->templatecache['FORUMDISPLAY'] = str_replace($search_text,
$search_text.fetch_template('add_banner'), $vbulletin->templatecache['FORUMDISPLAY']);

This looks @ the template FORUMDISPLAY for $navbar and if found it places the content of add_banner under it. If you have a custom style that has removed $navbar there is a option to place $add_banner.

Quote:

Originally Posted by Replicators (Post 1127475)
What don't make sense is the 3.5.x version works just fine for the 3.6, so whats the sense in a update?

Many do not look in old 3.5 area. :p

Quote:

Originally Posted by firstrebel (Post 1127476)
Installed then uninstalled, for a few reasons.

1] Could not get it to work, just got red X's, in fact got 2 red x's, and I had 5 image files in the scripts. Tried full URL and relative URL.

2] Putting this in each forum is a bit of a long job as I have 40+ forums and I could not get it to work on the forum homepage at all. I would have thought putting the code in the navbar template would be better, then they appear in forumhome and all other forums. I tried that but that didn't work either.

I am obviously doing something wrong, but what. One thing I can't work out is
Code:

href='http://www.yoursite1.com'
href='http://www.yoursite2.com'

what do I put if it's all on one site.

Bob

Take a look: Google image, Google News, Froogle

Code:

<script language="javascript" type="text/javascript">
<!--
function banner() {
};

banner = new banner();
number = 0;

// bannerArray
banner[number++] = "<a href='http://www.google.com/' target='_blank'><img src='http://www.google.com/intl/en_ALL/images/logo.gif' alt='' border='0' /></a>"
banner[number++] = "<a href='http://news.google.com/' target='_blank'><img src='http://news.google.com/images/news.gif' alt='' border='0' /></a>"
banner[number++] = "<a href='http://froogle.google.com/' target='_blank'><img src='http://froogle.google.com/froogle/intl/en_us/images/froogle_110tall.gif' alt='' border='0' /></a>"
 
// keep adding items above here...

increment = Math.floor(Math.random() * number);
document.write(banner[increment]);

//-->
</script>



All times are GMT. The time now is 10:06 AM.

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.01227 seconds
  • Memory Usage 1,751KB
  • 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
  • (6)bbcode_code_printable
  • (4)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