Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Logo Rotation Details »»
Logo Rotation
Version: 0.7, by thunderclap82 thunderclap82 is offline
Developer Last Online: Apr 2019 Show Printable Version Email this Page

Category: Forum Display Enhancements - Version: 4.0.x Rating:
Released: 10-20-2010 Last Update: Never Installs: 22
Uses Plugins Template Edits
Re-useable Code Code Changes  
No support by the author.

I had a client who wanted a rotating logo system that allowed them to have fancy transitions and have each logo link to a specific page. No mod I could find allowed this so, utilizing a jQuery app called Nivo Slider, I've managed to create exactly what they wanted.

Please note that I've only attempted this with a fixed theme. I do not know how it will behave with a fluid one. If someone wants to test it and let me know I'll make changes to the instructions as necessary.

DEMO

Special Thanks: Lynne for helping me get the plug-in portion working properly.

Requirement: Nivo Slider

1. Download and decompress the Nivo Slider archive.
2. Upload the files jquery.nivo.slider.pack.js and nivo-slider.css to your forums 'clientscript' folder.
3. Go to vB AdminCP --> Plugins & Products --> Plugin Manager --> Add New Plugin. Enter the following information:

Product: vBulletin
Hook Location: template_register_var
Title: Nivo Logo Rotator
Execution Order: 5
Plugin PHP Code:

Code:
$templater = vB_Template::create('banner_rotator');
$templatevalues['banner_rotator'] = $templater->render();
vB_Template::preRegister('header', $templatevalues);
4. Save the Plugin.
5. Go to vB AdminCP --> Styles & Templates --> Style Manager --> Add New Template. Enter the following information:

Title: banner_rotator
Template:

Code:
<link rel="stylesheet" href="clientscript/nivo-slider.css" type="text/css" media="screen" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script src="clientscript/jquery.nivo.slider.pack.js" type="text/javascript"></script>

<div id="slider">
<a href="your URL"><img src="link to your image file" /></a>
</div>

<vb:literal>
<script type="text/javascript">
$(window).load(function() {
var total = $('#slider img').length;
var rand = Math.floor(Math.random()*total);
	$('#slider').nivoSlider({
		effect:'random',
		slices:15,
		animSpeed:500,
		pauseTime:7000,
                startSlide:rand,
		directionNav:false,
		directionNavHide:true,
		controlNav:false,
		controlNavThumbs:false,
                controlNavThumbsFromRel:false,
		keyboardNav:true,
		pauseOnHover:true,
		manualAdvance:false,
		captionOpacity:0.8,
		beforeChange: function(){},
		afterChange: function(){},
		slideshowEnd: function(){}
	});
});
</script>
</vb:literal>
(Note: There are a lot of customizations for Nivo here, so I suggest you looking over the official website to get an idea of what you can do. These settings change the logo every seven seconds or so. Also, with each new logo you can click on it and be taken to a different URL.)

6. Save.
7. Edit the additional.css template. Add at the bottom:

Code:
/* CSS for Banner_Rotator */
.banner_rotator
#slider {
	position:relative;
	background:url(images/loading.gif) no-repeat 50% 50%; 
}
#slider img {
	position:absolute;
	top:0px;
	left:0px;
	display:none;
}
#slider a{
	display:block;
}
8. Save.
9. Edit the header template. Find:

Code:
<div><a name="top" href="{vb:raw vboptions.forumhome}.php{vb:raw session.sessionurl_q}" class="logo-image"><img src="{vb:stylevar titleimage}" alt="{vb:rawphrase x_powered_by_vbulletin, {vb:raw vboptions.bbtitle}}" /></a></div>
Delete or comment it out, then replace add:

Code:
<div style="width:XXXpx; height:XXXpx;">
{vb:raw banner_rotator}
</div>
(Replace the "XXX" in width and height to that suite your graphic. Width might need a little extra room so experiment a bit.)

10. Save.

You should now have a rotating logo in the header of your vB forum.

Version History
0.7: Added code at step 9 to help lock the header dimensions for your logo.
0.6: Fixed IE bug
0.5: Initial Release

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 11-05-2010, 06:33 AM
tekram's Avatar
tekram tekram is offline
 
Join Date: Jan 2005
Location: Germany
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes make it to 4.0.8 please....
Reply With Quote
  #23  
Old 11-05-2010, 06:30 PM
thunderclap82 thunderclap82 is offline
 
Join Date: Nov 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The developer of my theme has said he plans to have the theme updated for 4.0.8 within a week. Once I can upgrade successfully I will look into the 4.0.8 issue.
Reply With Quote
  #24  
Old 11-06-2010, 03:39 PM
abbasbsp's Avatar
abbasbsp abbasbsp is offline
 
Join Date: Jun 2008
Location: Indonesian, yogyakarta
Posts: 205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by thunderclap82 View Post
Is your template fixed or fluid? If it's fixed create a banner the exact size you want with the logo in the middle.
Why not be made by using the code, so that all can be used template, I'm sure you can and be able to find a solution under centering logo
Reply With Quote
  #25  
Old 11-24-2010, 01:25 AM
thunderclap82 thunderclap82 is offline
 
Join Date: Nov 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I upgraded to vB 4.0.8 today and the rotating logo still works fine. I'm not sure why others are having the problem mentioned above.
Reply With Quote
  #26  
Old 12-07-2010, 03:39 AM
baghdad4ever baghdad4ever is offline
 
Join Date: Apr 2007
Location: baghdad
Posts: 443
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by thunderclap82 View Post
I upgraded to vB 4.0.8 today and the rotating logo still works fine. I'm not sure why others are having the problem mentioned above.
we put like that


Code:
<div id="slider">
<a href="your URL"><img src="link to your image file" /></a>
<a href="your URL"><img src="link to your image file" /></a>
<a href="your URL"><img src="link to your image file" /></a>
<a href="your URL"><img src="link to your image file" /></a>
<a href="your URL"><img src="link to your image file" /></a>
</div>
is that right???


note : in the demo site the login area gone away behind the banner
Reply With Quote
  #27  
Old 12-08-2010, 01:32 AM
thunderclap82 thunderclap82 is offline
 
Join Date: Nov 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by baghdad4ever View Post
we put like that


Code:
<div id="slider">
<a href="your URL"><img src="link to your image file" /></a>
<a href="your URL"><img src="link to your image file" /></a>
<a href="your URL"><img src="link to your image file" /></a>
<a href="your URL"><img src="link to your image file" /></a>
<a href="your URL"><img src="link to your image file" /></a>
</div>
is that right???
Yes. That's exactly right.

Quote:
note : in the demo site the login area gone away behind the banner
I was working on some other template issues. The site should be fine again.
Reply With Quote
  #28  
Old 12-08-2010, 09:28 AM
baghdad4ever baghdad4ever is offline
 
Join Date: Apr 2007
Location: baghdad
Posts: 443
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for your update

plz i have 2 questions

1- how to center the logo

2- how to show the login area above the logo

bec now the login behind logo

thanks again
Reply With Quote
  #29  
Old 12-08-2010, 03:41 PM
thunderclap82 thunderclap82 is offline
 
Join Date: Nov 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by baghdad4ever View Post
1- how to center the logo

2- how to show the login area above the logo
1. To center modify the following code:

Code:
<div style="width:XXXpx; height:XXXpx; align:center;">
{vb:raw banner_rotator}
</div>
2. It all depends on your template. Move the header code around to see where it best fits.
Reply With Quote
  #30  
Old 12-08-2010, 05:31 PM
baghdad4ever baghdad4ever is offline
 
Join Date: Apr 2007
Location: baghdad
Posts: 443
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by thunderclap82 View Post
1. To center modify the following code:

Code:
<div style="width:XXXpx; height:XXXpx; align:center;">
{vb:raw banner_rotator}
</div>
2. It all depends on your template. Move the header code around to see where it best fits.
thanks

now the logo go to left and not in the center !!!

how to fix that?
Reply With Quote
  #31  
Old 12-08-2010, 05:56 PM
thunderclap82 thunderclap82 is offline
 
Join Date: Nov 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try changing "align:center;" to "align-text:center;". I'm not sure if that will work but give it a try. Otherwise, try using <center></center> around the <div></div>.
Reply With Quote
Reply


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 02:18 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.10107 seconds
  • Memory Usage 2,340KB
  • Queries Executed 26 (?)
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
  • (9)bbcode_code
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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