vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Forum Block in single Forum (https://vborg.vbsupport.ru/showthread.php?t=288613)

invitezone 10-03-2012 06:44 PM

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.

invitezone 10-06-2012 12:57 PM

anyone got any infor on doing this please?

ForceHSS 10-06-2012 01:21 PM

have you done a search for a plugin for it

kh99 10-06-2012 01:34 PM

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.

invitezone 10-07-2012 07:53 PM

Quote:

Originally Posted by ForceHSS (Post 2371185)
have you done a search for a plugin for it

basic starting point, so yes of course I have...

Quote:

Originally Posted by kh99 (Post 2371187)
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 ;)

invitezone 10-21-2012 11:53 AM

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>


kh99 10-21-2012 01:47 PM

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.

invitezone 10-21-2012 02:01 PM

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>


kh99 10-21-2012 02:10 PM

Oh, yeah - it's "condition", not "contents":
Code:

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

I have no idea what I was thinking that day.

invitezone 10-21-2012 02:21 PM

well it has accepted it now, but nothing shows up in my forumid 156


All times are GMT. The time now is 04:58 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.01047 seconds
  • Memory Usage 1,746KB
  • 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
  • (7)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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