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>


Zachariah 11-28-2006 11:49 PM

Quote:

Originally Posted by Jonathan Young (Post 1127621)
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

Ok the reason you seen 2 sets of images:

*** How to Upgrade:

*** Edit 2 Template(s) : FORUMDISPLAY, SHOWTHREAD no longer need the code below:

Find:
$navbar

below remove:

Quote:

<if condition="$foruminfo['banner'] AND $foruminfo['bannerlink']"><center><a href="$foruminfo[bannerlink]" target="_blank"><img src="$foruminfo[banner]" alt="$foruminfo[banneralt]" border="0" /></a></center><br />
<else />
<if condition="$foruminfo['banner']"><center><img src="$foruminfo[banner]" alt="$foruminfo[banneralt]" border="0" /></center><br />
<else />
<if condition="$foruminfo['bannercode']"><center>$foruminfo[bannercode]</center><br />
</if>
</if>
</if>
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.

ShackMaster 11-28-2006 11:52 PM

Code:

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

Is this the code that is supposed to be on my forumdisplay after loading the .xml? Cause that code is nowhere to be found.

ShackMaster 11-28-2006 11:57 PM

I tried placing $add_banner in forumdisplay, but it still doesn't work.

Zachariah 11-29-2006 12:26 AM

Quote:

Originally Posted by ShackMaster (Post 1127695)
I tried placing $add_banner in forumdisplay, but it still doesn't work.

The code above is used in the script to "search" the Forumdisplay template for $navbar and try to place the banner template "add_banner" under.


Do you have $navbar in your Forumdisply template ?
- If so this should show up after you edit a forum and add the needed image, target link, or custom HTML code.

If there is no $navbar in your Forumdisplay then you need to add $add_banner in your template.

I have 2 banners now -

http://www.gzhq.net/forums/forumdisplay.php?f=47

Code:

<body>
$header
$add_banner
$navbar

The one the hack places and the same thing above the $navbar because I edited the template.

What have you placed in the AdminCP in the space for the image in the forum you edited ?

Barakat 11-29-2006 01:00 AM

installed . thanks

Jonathan Young 11-29-2006 01:24 AM

Okay, works fine now. Only thing that seems weird is that everything in the forum edit is in a longer form. By that i mean like 3 words a line, then down like a list, then it shows the field, but it doesn't seem to affect the added image part. If you need a screen shot, i can send one if requested.

sensimilla 11-29-2006 04:57 AM

Great share Zachariah thanks again

abramelin 11-29-2006 06:30 AM

lovely mod but doesnt this bad for seo?

firstrebel 11-29-2006 02:57 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?

Try THIS

Bob

computer1 11-29-2006 04:04 PM

Thx for this hack this I like :)

but howe can I put in more and one banners let say if I have 8 banners
some I wont to put in howe shuld I do that ????
so all the banners rotate

Zachariah 11-29-2006 05:11 PM

Quote:

Originally Posted by computer1 (Post 1128140)
Thx for this hack this I like :)

but howe can I put in more and one banners let say if I have 8 banners
some I wont to put in howe shuld I do that ????
so all the banners rotate

https://vborg.vbsupport.ru/showpost....47&postcount=3

computer1 11-29-2006 06:07 PM

Quote:

Originally Posted by Zachariah (Post 1127347)
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

plz help me I?m not so familay whit this I wont to put this code to the top of my first page on the board I?m not shure if that is to the header page howe can I do that so all the banners display whit the loggo my template is tangerina

EasyTarget 11-29-2006 06:51 PM

thanks for the hack.
just some feature suggestions..
option to have it auto apply to child forums
option to enable/disable the main banner

michaelsilvia 12-01-2006 05:17 AM

This is a great hack!

Is there a way to do this with headers? I would like to have my header changed based on the forum ID. I am working with vb.com, but they are simply showing me conditionals, but that takes up a LOT of space in the header.

Mike

BobbyBig 02-06-2007 02:04 AM

Great hack, just what I was searching for.
Installed.

Zachariah 02-06-2007 03:11 AM

Quote:

Originally Posted by EasyTarget (Post 1128222)
thanks for the hack.
just some feature suggestions..
option to have it auto apply to child forums
option to enable/disable the main banner

Sexy :D

Quote:

Originally Posted by michaelsilvia (Post 1129217)
This is a great hack!

Is there a way to do this with headers? I would like to have my header changed based on the forum ID. I am working with vb.com, but they are simply showing me conditionals, but that takes up a LOT of space in the header.

Mike

You can use this in the header template with a few changes it can show a default image if none is filled out and if on any other VB page that is not a forum.

giorgiotave 02-27-2007 08:07 AM

Hello Zachariah,

this modification work very great :)

i have one question: if i want use more Add Banner in my Forum, how can make?

For example, i want put different 4 banner in Header, in Footer and another place.

I need to install 3 different Add Banner...

You can suggestion for me?

raiderlax 03-03-2007 05:56 AM

For some reason the google adsense code is not showing up here, but it shows up on the other forums.

Here: http://talkfitness.org/forumdisplay.php?f=2

BobbyBig 03-22-2007 08:57 PM

Zachariah this is one of the best mods i have seen around.
I really like the way we can set it per Forum.

I really would like to see more options for a forum:

- in the Forum there will be also advertisement between different Threads
- in the Threads of this Forum will be advertisement between different Postings

I really would love you for this :)

regards

Zachariah 03-22-2007 09:00 PM

Quote:

Originally Posted by BobbyBig (Post 1209894)
Zachariah this is one of the best mods i have seen around.
I really like the way we can set it per Forum.

I really would like to see more options for a forum:

- in the Forum there will be also advertisement between different Threads
- in the Threads of this Forum will be advertisement between different Postings

I really would love you for this :)

regards

Good Idea :D

vuiveclub_net 04-17-2007 05:40 PM

Is the a way we can allow the moderator of that forum create his/her own header/footer ??? This seems like only Admin create every single header.

maamon 04-18-2007 02:47 AM

شكرا على ملف المنتج

Zachariah 04-18-2007 04:47 PM

Quote:

Originally Posted by maamon (Post 1230164)
شكرا على ملف المنتج

I do not understand.

robert_2004 04-18-2007 04:48 PM

yeah.... maamon's right.

stevebullman 08-28-2007 08:32 PM

not sure what im doing wrong but i dont get any images come up, just red crosses

Zachariah 08-28-2007 09:30 PM

Quote:

Originally Posted by stevebullman (Post 1327639)
not sure what im doing wrong but i dont get any images come up, just red crosses

Red images usably means that the URL's to the images are off.
- Right click on the broke image and go to properties. It should tell you more info on the location of where the script thinks your images are.

asw 08-28-2007 10:08 PM

Installed on 3.6.8 and working flawlessly! Many thanks for this hack! :up:

jmw 08-28-2007 10:29 PM

Quote:

Originally Posted by asw (Post 1327689)
Installed on 3.6.8 and working flawlessly! Many thanks for this hack! :up:

Good to know.

stevebullman 08-29-2007 12:36 PM

Quote:

Originally Posted by Zachariah (Post 1327672)
Red images usably means that the URL's to the images are off.
- Right click on the broke image and go to properties. It should tell you more info on the location of where the script thinks your images are.


thanks, i actually had the path wrong, im new to all this still....works a treat now!
the random banner code you put the 3rd post down is particularly useful as it works in red tygers ad management hack also!:)

MotMann 09-04-2007 12:40 PM

I have that one and its not correct working:

PHP Code:

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

banner = new banner(); 
number 0

// bannerArray 
banner[number1] = "<!-- ebay Affili -->
<script language="
JavaScript" type='text/javascript'>
// <!--<[CDATA[
    era_width = '728';
    era_height = '90';
    era_layout = 'img';
    era_color_title = '000000';
    era_itemtype = '0';
    era_publisher='xxxxxxxx';
    era_color_bg = 'FFFFFF';
// ]]> -->
</script>
<script language="
JavaScript" type='text/javascript' src='http://api.xxxxxxxx.de/js/show_ads.js'></script> 
<!-- eBay Affili -->"

banner[number2] = "<!-- BEGIN PARTNER PROGRAM - DO NOT CHANGE THE PARAMETERS OF THE HYPERLINK -->
<script language="
JavaScript" type="text/javascript">
  //<!--<[CDATA[
    am_referrer = 'xxxxxxxx';
    am_template = '1';

    am_color_text = '000000';
    am_color_title = '000000';
    am_color_border = '000000';
    am_color_background = 'FFFFFF';
    am_color_price = 'FF0000';
    am_color_link = '3333FF';

    am_stmo = '1';
    am_tsr = '02';
  // ]]> -->
</script>
<script language="
JavaScript" type="text/javascript" src="http://banners.xxxxxx.de/show_ads.js"></script>
<!-- END PARTNER PROGRAM -->"


 
// keep adding items above here... 

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

//-->
</script> 

any idea?


All times are GMT. The time now is 04:54 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.01949 seconds
  • Memory Usage 1,862KB
  • 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
  • (10)bbcode_code_printable
  • (1)bbcode_php_printable
  • (17)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
  • (40)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