PDA

View Full Version : left (and right) sidebars.. another question


ogetbilo
06-09-2004, 09:19 AM
I followed the instructions in
http://www.vbadvanced.com/membersarea.php?do=viewmanual&productid=4&pageid=6
to get left and right sidebars displayed in my forum's homepage.
Fine, it is working as desired. But now some of my users say they want to have the forum home page without any sidebars. So I thought I can do this with some if conditionals (ie I can let users select whether they want to see the sidebar or not).

I first went to 'add new user profile field'.
I created a multiple-selection checkbox field with only one content: "use plain forumhome page". If this is checked, the sidebars should not show up on the forumhome page. The field was given a name 'field11'.

Then I opened the vba_portal template

I replaced




<if condition="$show['left_column']">

<td width="$vba_options[portal_leftcolwidth]">

$home[leftblocks]

</td>

<!-- Spacer Cell -->
<td width="$vba_options[portal_colspacing]"><img alt="" src="$vboptions[bburl]/$vboptions[cleargifurl]" width="$vba_options[portal_colspacing]" /></td>
<!-- / Spacer Cell -->

</if>

with

<if condition="THIS_SCRIPT == 'index' AND $bbuserinfo[field11]">
<else/>
<if condition="$show['left_column']">

<td width="$vba_options[portal_leftcolwidth]">

$home[leftblocks]

</td>

<!-- Spacer Cell -->
<td width="$vba_options[portal_colspacing]"><img alt="" src="$vboptions[bburl]/$vboptions[cleargifurl]" width="$vba_options[portal_colspacing]" /></td>
<!-- / Spacer Cell -->

</if>
</if>

to disable the left column on forumhome page for those who check the checkbox 'field11'.

But it's not working. No matter whether that checkbox is checked or not, the left column does not show on the forumhome page, as well as on the vbaCMPS page.

What did I do wrong?

Brian
06-09-2004, 10:35 AM
Just remove the if conditions in that template, open your index.php file, and look for:

eval('$HTML = "' . fetch_template('FORUMHOME') . '";');
print_portal_output($home, $HTML);

Replace that with:

if ($bbuserinfo['field11'])
{
eval('print_output("' . fetch_template('FORUMHOME') . '");');
}
else
{
eval('$HTML = "' . fetch_template('FORUMHOME') . '";');
print_portal_output($home, $HTML);
}

Our Sponsors
 

ogetbilo
06-09-2004, 11:37 AM
Thanks Brian, that worked:)

but is there a way to solve the problem templatewise? I was trying to put further field options for dislaying the right column, left column, both, etc...