Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #31  
Old 01-08-2008, 08:47 AM
buurman's Avatar
buurman buurman is offline
 
Join Date: Apr 2002
Location: Amsterdam
Posts: 140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Kirk, works great!! also made a rotating header logo.

happy I found your replys
Reply With Quote
  #32  
Old 02-04-2008, 01:28 PM
kronnos kronnos is offline
 
Join Date: Apr 2006
Posts: 241
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Kirk Y View Post
Okay, let me see if I can explain it better:

Add a New Plugin using Hook Location "global_start".
Code:
$random_number = rand(1, 5);

$random_banner[1] = '<a href="http://www.link1.com/"><img src="path/to/banner1.gif" alt="" border="0" /></a>';
$random_banner[2] = '<a href="http://www.link2.com/"><img src="path/to/banner2.gif" alt="" border="0" /></a>';
$random_banner[3] = '<a href="http://www.link3.com/"><img src="path/to/banner3.gif" alt="" border="0" /></a>';
$random_banner[4] = '<a href="http://www.link4.com/"><img src="path/to/banner4.gif" alt="" border="0" /></a>';
$random_banner[5] = '<a href="http://www.link5.com/"><img src="path/to/banner5.gif" alt="" border="0" /></a>';
Remember to change all the Image Paths to the location of the banners you want to display.

Then edit whatever template you'd like to display the random banner in and stick this code wherever you'd like it to show:
Code:
$random_banner[$random_number]
What if I would want to have just 2 banner options but not show them randomly, instead if its forum home, then show one ad if its something else show another?
Reply With Quote
  #33  
Old 02-04-2008, 02:18 PM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Then you don't need to use this plugin.

Instead use template conditionals to output a header based on what page the user is viewing.

Example:
Code:
<if condition="THIS_SCRIPT == 'index">Show this only on the Index<else />Show this on pages other than the Index</if>
That's a very basic example, if you'd like some more information: http://www.vbulletin.com/docs/html/t...e_conditionals
Reply With Quote
  #34  
Old 02-04-2008, 05:51 PM
kronnos kronnos is offline
 
Join Date: Apr 2006
Posts: 241
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Kirk Y View Post
Then you don't need to use this plugin.

Instead use template conditionals to output a header based on what page the user is viewing.

Example:
Code:
<if condition="THIS_SCRIPT == 'index">Show this only on the Index<else />Show this on pages other than the Index</if>
That's a very basic example, if you'd like some more information: http://www.vbulletin.com/docs/html/t...e_conditionals
Tried it but it still doesn't work. It just shows both in one ad block. Could it be that the ad block does not allow php code?

--------------- Added [DATE]1202145412[/DATE] at [TIME]1202145412[/TIME] ---------------

This is the code i tried but it shows the ad code and the text:

<if condition="THIS_SCRIPT == 'index'">

<center><script type="text/javascript"><!--
google_ad_client = "pub-8336492106717154";
//120x60, created 1/25/08
google_ad_slot = "4645103244";
google_ad_width = 120;
google_ad_height = 60;
google_cpa_choice = ""; // on file
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<center/>


<else />


This text


</if>
Reply With Quote
  #35  
Old 02-04-2008, 07:37 PM
Ranger269 Ranger269 is offline
 
Join Date: Feb 2008
Location: Houston
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MoT3rror View Post

Execution Order: 1
I was wondering about that. The default setting I had was "5" so I left it that way and the banner works fine.

I didn't understand just what that was for?

Should I change it to "1"?
Reply With Quote
  #36  
Old 02-04-2008, 09:45 PM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kronnos View Post
Tried it but it still doesn't work. It just shows both in one ad block. Could it be that the ad block does not allow php code?
What template are you using this in; and on what version of vBulletin? I tested the code you supplied above and it worked perfectly for me.

Quote:
Originally Posted by Ranger269 View Post
I was wondering about that. The default setting I had was "5" so I left it that way and the banner works fine.

I didn't understand just what that was for?

Should I change it to "1"?
Execution orders allow Plugins within a modification which utilize the same hook to be run in a specific order. ie. Plugin A gathers the UserID, Plugin B executes a query based on the userid, and Plugin C displays something based on the query. Thus Plugin A must be run before Plugin B and Plugin B must be run before Plugin C. This can be achieved by setting the Execution Orders of the three plugins to 1, 2, and 3 (respectively).
Reply With Quote
  #37  
Old 02-05-2008, 01:41 AM
Ranger269 Ranger269 is offline
 
Join Date: Feb 2008
Location: Houston
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Kirk Y View Post

Execution orders allow Plugins within a modification which utilize the same hook to be run in a specific order. ie. Plugin A gathers the UserID, Plugin B executes a query based on the userid, and Plugin C displays something based on the query. Thus Plugin A must be run before Plugin B and Plugin B must be run before Plugin C. This can be achieved by setting the Execution Orders of the three plugins to 1, 2, and 3 (respectively).
Thanks!

I'm having trouble with two rotating banners on the same forum...

https://vborg.vbsupport.ru/showthread.php?t=169672

I had both plugins set at 5 which was the default, so I changed them to 1 & 2.

But it still didn't fix the problem.
Reply With Quote
  #38  
Old 02-05-2008, 03:41 AM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well execution orders wouldn't matter in that instance. I'm going to bet your problem is that you're not using different variable names for each banner.

ie: $random_banner and then $random_banner2
Reply With Quote
  #39  
Old 02-05-2008, 04:13 AM
Ranger269 Ranger269 is offline
 
Join Date: Feb 2008
Location: Houston
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Kirk Y View Post
Well execution orders wouldn't matter in that instance. I'm going to bet your problem is that you're not using different variable names for each banner.

ie: $random_banner and then $random_banner2
That's what I figured the problem was but I didn't know how to do it.

Code:
<div align="center">$random_banner[$random_number]</div>
When I tried adding a "2" between "number" and "]", it made the bottom banner disapear.

Can you tell me what code I need and if both of them need to be changed or only the bottom one?
Reply With Quote
  #40  
Old 02-05-2008, 06:06 AM
kronnos kronnos is offline
 
Join Date: Apr 2006
Posts: 241
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Kirk Y View Post
What template are you using this in; and on what version of vBulletin? I tested the code you supplied above and it worked perfectly for me.
I'm Using Ultimate Side Columns and trying to paste this code into one of the left column blocks.
Reply With Quote
Reply

Thread Tools
Display Modes

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 08:00 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.05336 seconds
  • Memory Usage 2,265KB
  • Queries Executed 11 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (5)bbcode_code
  • (8)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete