Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-03-2012, 06:44 PM
invitezone invitezone is offline
 
Join Date: Mar 2008
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Forum Block in single Forum

Hi all,

I am trying to add a forum block that I want to display only in one of my subforums.
I am using it to create a menu that relates only to that single sub forum.

Any advice on how I could achieve this?

Thank you all for your usual helpfulness.
Reply With Quote
  #2  
Old 10-06-2012, 12:57 PM
invitezone invitezone is offline
 
Join Date: Mar 2008
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone got any infor on doing this please?
Reply With Quote
  #3  
Old 10-06-2012, 01:21 PM
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Posts: 6,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

have you done a search for a plugin for it
Reply With Quote
  #4  
Old 10-06-2012, 01:34 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you creating a "Custom HTML/PHP" forum block? You can try this: Go to the style manager and copy the code of the "block_html" template, then create a new template and paste the code and surround it with an if, like this:

Code:
<vb:if condition="$GLOBALS['forumid'] == X">

// code from block_html goes here

</vb:if>
(of course you'll replace X with your forumid).

Then at the bottom of forum block configuration page there's a "Template to Use" field. You can put the name of your new template there.
Reply With Quote
  #5  
Old 10-07-2012, 07:53 PM
invitezone invitezone is offline
 
Join Date: Mar 2008
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ForceHSS View Post
have you done a search for a plugin for it
basic starting point, so yes of course I have...

Quote:
Originally Posted by kh99 View Post
Are you creating a "Custom HTML/PHP" forum block? You can try this: Go to the style manager and copy the code of the "block_html" template, then create a new template and paste the code and surround it with an if, like this:

Code:
<vb:if contents="$GLOBALS['forumid'] == X'>

// code from block_html goes here

</vb:if>
(of course you'll replace X with your forumid).

Then at the bottom of forum block configuration page there's a "Template to Use" field. You can put the name of your new template there.
Excellent just the kind of info I was after. Really appreciate the help, I will give that a try.

Thanks again
Reply With Quote
  #6  
Old 10-21-2012, 11:53 AM
invitezone invitezone is offline
 
Join Date: Mar 2008
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok so I tried this, but when I save the new template i get this error...

Code:
The following error occurred when attempting to evaluate this template:

Parse error: syntax error, unexpected ')' in /home/digitale/public_html/includes/adminfunctions_template.php(5432) : eval()'d code on line 1

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.



Here is the template that im trying to save...

Code:
<vb:if contents="$GLOBALS['forumid'] == 156'>
<li>
	<div class="block smaller">
		<div class="blocksubhead">
			<a class="collapse" id="collapse_block_html_{vb:raw blockinfo.blockid}" href="{vb:raw relpath}#top"><img alt="" src="{vb:stylevar imgdir_button}/collapse_40b.png" id="collapseimg_html_{vb:raw blockinfo.blockid}"/></a>
			<span class="blocktitle">{vb:raw blockinfo.title}</span>
		</div>
		<div class="widget_content blockbody floatcontainer">
		<div id="block_html_{vb:raw blockinfo.blockid}" class="blockrow">
			{vb:raw content}
		</div>
		</div>
	</div>
	<div class="underblock"></div>
</li>
</vb:if>
Reply With Quote
  #7  
Old 10-21-2012, 01:47 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's my fault, there's a mistake in the code I posted. The first line should be:
Code:
<vb:if condition="$GLOBALS['forumid'] == 156">

Sorry.
Reply With Quote
  #8  
Old 10-21-2012, 02:01 PM
invitezone invitezone is offline
 
Join Date: Mar 2008
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

appreciate the help buddy,
I'll go try it out and let you know how it goes

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

same issue

Code:
<vb:if contents="$GLOBALS['forumid'] == 156">
<li>
	<div class="block smaller">
		<div class="blocksubhead">
			<a class="collapse" id="collapse_block_html_{vb:raw blockinfo.blockid}" href="{vb:raw relpath}#top"><img alt="" src="{vb:stylevar imgdir_button}/collapse_40b.png" id="collapseimg_html_{vb:raw blockinfo.blockid}"/></a>
			<span class="blocktitle">{vb:raw blockinfo.title}</span>
		</div>
		<div class="widget_content blockbody floatcontainer">
		<div id="block_html_{vb:raw blockinfo.blockid}" class="blockrow">
			{vb:raw content}
		</div>
		</div>
	</div>
	<div class="underblock"></div>
</li>
</vb:if>
Reply With Quote
  #9  
Old 10-21-2012, 02:10 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh, yeah - it's "condition", not "contents":
Code:
<vb:if condition="$GLOBALS['forumid'] == 156">

I have no idea what I was thinking that day.
Reply With Quote
  #10  
Old 10-21-2012, 02:21 PM
invitezone invitezone is offline
 
Join Date: Mar 2008
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well it has accepted it now, but nothing shows up in my forumid 156
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 12:18 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.07231 seconds
  • Memory Usage 2,256KB
  • Queries Executed 13 (?)
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
  • (7)bbcode_code
  • (2)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
  • (1)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_postinfo_query
  • fetch_postinfo
  • 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