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
Sidebar Anywhere Enhancement - Custom Blocks Per Forum or Page Details »»
Sidebar Anywhere Enhancement - Custom Blocks Per Forum or Page
Version: 1.00, by addamroy addamroy is offline
Developer Last Online: Jan 2018 Show Printable Version Email this Page

Category: Add-On Releases - Version: 4.1.x Rating:
Released: 03-13-2013 Last Update: Never Installs: 11
Template Edits
Re-useable Code Translations  
No support by the author.

I came up with this after downloading and installing the Sidebar Anywhere by BOP5 mod.

I didn't get permission from him or anyone to post this here, I hope the title isn't a big deal it's just a template mod I made up that allowed me to further build upon the features that mod made possible.

That MOD in a nutshell lets you display your forum sidebar on any or all pages of your forum. ie forumdisplay pages, showthread pages, profile pages, etc.

The problem was the sidebar was the exact same on each page, there is no way to show one block here, and a different block there, while keeping the sidebar on the homepage the same. Basically I wanted to create 'different sidebars' on the various forum pages.

Well unfortunately with the way vbulletin works, manual template edits could only get me so far but this DOES give me new options to work with.

Here's what is accomplish with this:

1 - Display the standard sidebar blocks on your HOMEPAGE only. ie the Forum Threads, Forum Posts, Group Discussions, and Tag Cloud blocks.

2 - Create any number of Custom HTML/PHP blocks that only show in certain forums or on certain pages, etc.

Essentially what's happening here, is your main sidebar stays the same on your homepage and remains unaffected, HOWEVER you will have the ability to create new custom sidebars on any forum pages using Custom HTML/PHP blocks.

You could display certain advertisements, sponsors, links, graphics etc in certain sections giving you the ability to further customize your forum utilizing the Sidebar Anywhere mod by BOP5.

Instructions:
Edit your default block_ templates. Styles & Templates > Style Manager > Your Style > Edit Templates > Block_Templates

You need to ADD the following code bits to the TOP AND BOTTOM of each of the following block templates (block_newposts, block_threads, block_tagcloud, block_sgdiscussions)

Add to the very TOP of each template:
Code:
<vb:if condition="THIS_SCRIPT == 'index'">
Add to the very BOTTOM of each template:
Code:
</vb:if>
This will restrict the main forum sidebar blocks to your forum's homepage (index page), change 'index' to suit your needs if your forum is modified as such.

Create a new template with conditionals FOR EACH block you'd like to create that displays only in certain sections, on certain pages, to certain usergroups etc.

STEP 1 - Copy the contents of your block_html template

STEP 2 - Create a new template. Style Manager > Your Style > Add New Template

In the title field, call it block_html_SOMETHINGHERE replace SOMETHINGHERE with an identifier you choose. For example if you want this block to show only in your classifieds section if you have one, you might call your template block_html_classifieds

In the template field, paste the copied content from your existing block_html template from step 1.

BEFORE YOU SAVE THE TEMPLATE, do step 3.

STEP 3 - This is where the magic happens, we're going to simply wrap conditionals around everything to display the block where you want it, and to who you want.

At the very TOP you will add your opening conditionals.
For the sake of example, we will show this block only in a certain forum, and only to guests. (Your classifieds section maybe)

At the very TOP of this new template, ADD the following code:
Code:
<vb:if condition="$GLOBALS[forumid] == xx">
<vb:if condition="$show['guest']">
Replace xx with the forumid of the forum you want to display this block in.

At the very BOTTOM of this new template, ADD the following code:
Code:
</vb:if>
</vb:if>
Save your new template now.

STEP 4 - Add your new Block to the Sidebar. Forums & Moderators > Forum Blocks Manager > Add Block

Use block type: Custom HTML/PHP

Enter the content of your new custom block as you normally would.

In the "Template To Use" field at the bottom of the new block page, enter the name of the template you created in step 2 and 3. ie in this example, we would enter block_html_classifieds here

Save the block.

That's it! This new block will display only in the forum you selected and to guests.

For a larger list of conditionals you can play around with to really get your sidebar(s) going there is a good list here
http://www.forumthemes.com/helpful-t...nals-list.html

It's a 4 step process per forum block you want to add. You could always use a conditional to show the block on every page EXCEPT the homepage, or every forum EXCEPT one or two, etc etc.

If any section of the forum doesn't have any sidebar blocks that will display there, even with the Sidebar Anywhere mod activated, no sidebar will be shown at all and the page will be unaffected .

I hope this helps some of you! If I was better at coding I'd like to be able to include instructions for conditionalizing the forum posts, forum threads, tag cloud and discussions blocks to use with sidebar anywhere, unfortunately the Custom HTML/PHP block is the only one reasonably easy to customize as needed because it gives you the option to utilize a specific template we create.

Check out my other Template Modifications for 4.x!

[Postbit-Legacy Hack] Attractive User Info Boxes for Posts

Link Private Forums to thread instead of error message

Change Thread Title Color for Specific Forums on Homepage

Change Background Color for Specific Forums on Homepage

Change Title Color of Specific Forums on Homepage

Thread Starter Image in Postbit for OP

CUSTOM BUTTONS that look like your forum!

Custom User Rank Box in Posts

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:
ELROBLE, f4vn

Comments
  #2  
Old 03-14-2013, 02:37 PM
tanzeelniazi tanzeelniazi is offline
 
Join Date: Apr 2012
Posts: 375
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any screenshoot ?
Reply With Quote
  #3  
Old 03-14-2013, 04:25 PM
addamroy addamroy is offline
 
Join Date: Sep 2010
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tanzeelniazi View Post
Any screenshoot ?
It will look no different from the sidebar you currently have. Only difference is it will show custom html/php blocks using conditionals.

For screenshots of how the sidebar itself looks in general, see BOP5's thread for the Sidebar Anywhere Mod. I didn't code the MOD or alter the appearance, simply enabled a way to wrap conditionals around the forum blocks.

https://vborg.vbsupport.ru/showthread.php?t=283307
Reply With Quote
Благодарность от:
Gecuba
  #4  
Old 03-15-2013, 10:32 PM
Manuel94 Manuel94 is offline
 
Join Date: Jan 2013
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can create a mod that puts the sidebar on every page without changing the custom graphics? Using the plugin so far put the sidebar always change. People are looking for a mod that does not change the sidebar that every person you customize!
Reply With Quote
  #5  
Old 03-15-2013, 11:53 PM
addamroy addamroy is offline
 
Join Date: Sep 2010
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what?
Reply With Quote
  #6  
Old 03-27-2013, 11:12 AM
BlogTwits BlogTwits is offline
 
Join Date: May 2012
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This looks great. is anybody using this? Any live sites using this?
Reply With Quote
  #7  
Old 09-26-2013, 10:37 AM
obglobal.net obglobal.net is offline
 
Join Date: Jan 2013
Posts: 203
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So can I get this working on 4.2.1?

Cheers.
Reply With Quote
  #8  
Old 11-12-2013, 04:14 PM
NoamRodrik NoamRodrik is offline
 
Join Date: Aug 2011
Location: Israel
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Re-upload like please?
Reply With Quote
  #9  
Old 02-08-2014, 08:28 PM
vicking74 vicking74 is offline
 
Join Date: Apr 2010
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Addamroy

I am interested in this mod let me configure of course pay.

Thanks
Reply With Quote
  #10  
Old 06-15-2014, 09:42 AM
behcet behcet is offline
 
Join Date: Apr 2007
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

tnx, worked.
How to "this forumid" in block ?
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 04:00 AM.


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.05023 seconds
  • Memory Usage 2,327KB
  • Queries Executed 24 (?)
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
  • (4)bbcode_code
  • (1)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
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (3)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • 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