PDA

View Full Version : Help with Forum Blocks


DrInternet
02-03-2012, 11:50 PM
How Can I Make A User Register To View A Forum Block just one block not all
am using htmll code in the block

is there any code should i insert ? thank you

kh99
02-04-2012, 01:20 AM
First copy the template block_html to another name, and edit your forum block and enter your new template name as "Template to Use" (at the bottom). Set the "Cache Time" to 0.

If you want the block to disappear completely, then add <vb:if condition="$bbuserinfo[userid] != 0">...</vb:if> around the existing code of your new template. If instead you want to show something else to guests, I think you could replace {vb:raw content} with

<vb:if condition="$bbuserinfo[userid] != 0">
{vb:raw content}
<vb:else />
Guest Message
</vb:if>

DrInternet
02-04-2012, 01:57 AM
First copy the template block_html to another name, and edit your forum block and enter your new template name as "Template to Use" (at the bottom). Set the "Cache Time" to 0.

If you want the block to disappear completely, then add <vb:if condition="$bbuserinfo[userid] != 0">...</vb:if> around the existing code of your new template. If instead you want to show something else to guests, I think you could replace {vb:raw content} with

<vb:if condition="$bbuserinfo[userid] != 0">
{vb:raw content}
<vb:else />
Guest Message
</vb:if>

Worked :up: just modified the code didnt change the cache time or copy the template

thank you kh99 for your help

kh99
02-04-2012, 10:02 AM
Glad you got it working, but I'm curious about how you did it. Were you using a php block, or did you put the template tags in your html?

DrInternet
04-10-2012, 12:07 AM
Glad you got it working, but I'm curious about how you did it. Were you using a php block, or did you put the template tags in your html?


Sorry For The Delay kh99

Using Php And Html

Original

<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>





Modified

<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:if condition="$bbuserinfo[userid] != 0">
{vb:raw content}
<vb:else />
To View Our Blocks You Need To Register <a href="register.php">Click Here to Register</a>
</vb:if>
</div>
</div>
</div>
<div class="underblock"></div>
</li>



Modified the Block_html in vb Styles