PDA

View Full Version : how to hide a forum from Specific gender?


afthl
03-05-2007, 09:19 PM
hi all


I want to hide a forum from Specific gender and I don't want to create a new usergroup I tried something but it dose not work, I don't know what is wrong
I have field to Specify the gender and it's Necessary in new registration
I want to hide forum nymber 21 from male.
I did this modefation in "forumhome_forumbit_level1_post"



<if condition=" $post['field5'] == 'male' AND $forum[forumid] == 21 ">

<else />
<tbody>
<tr align="center">
<td class="alt1Active" colspan="2" align="$stylevar[left]" id="f$forum[forumid]">

<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" id="forum_statusicon_$forum[forumid]" /></td>
<td><img src="$vboptions[cleargifurl]" alt="" width="9" height="1" border="0" /></td>
<td>
<div>
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
<if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
</div>
<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
<if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]" rel="nofollow">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
</td>
</tr>
</table>

</td>
<td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
<td class="alt1">$forum[threadcount]</td>
<td class="alt2">$forum[replycount]</td>
<if condition="$vboptions['showmoderatorcolumn']">
<td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
</if>
</tr>
</tbody>
<if condition="$childforumbits">
<tbody>
$childforumbits
</tbody>
</if>
</if>
is that right?

and what is the right way?

thanking you

Gray Matter
03-05-2007, 09:23 PM
First of all, you can't use "$post" in the conditional if you're using the conditional in the "forumhome_forumbit_level1_post" template.

You should also probably avoid using <else /> by just using a negative conditional. Try this:

<if condition="$userinfo['field5'] != 'male' AND $forum[forumid] == 21">
<tbody>
<tr align="center">
<td class="alt1Active" colspan="2" align="$stylevar[left]" id="f$forum[forumid]">

<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" id="forum_statusicon_$forum[forumid]" /></td>
<td><img src="$vboptions[cleargifurl]" alt="" width="9" height="1" border="0" /></td>
<td>
<div>
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
<if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
</div>
<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
<if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]" rel="nofollow">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
</td>
</tr>
</table>

</td>
<td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
<td class="alt1">$forum[threadcount]</td>
<td class="alt2">$forum[replycount]</td>
<if condition="$vboptions['showmoderatorcolumn']">
<td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
</if>
</tr>
</tbody>
<if condition="$childforumbits">
<tbody>
$childforumbits
</tbody>
</if>
</if>

afthl
03-05-2007, 09:47 PM
thank you for your help

but it didn't work

thanks

Gray Matter
03-05-2007, 10:38 PM
Is field 5 the gender field? Also, is it a single-selection menu with only "Male" and "Female" as the options?

Kirk Y
03-05-2007, 10:43 PM
I believe the options are case-sensitive too, so if it's Male in the Options, it must be == 'Male' in the conditional.

afthl
03-06-2007, 07:45 AM
thank you for your help

I put it in "forumhome_forumbit_level2_post"
and it works
but the second condition only
and I take care of the 'Male' as a case sensitive.

but it did not work it's only hide forum 21 from male and female !

what to do

Gray Matter
03-06-2007, 07:36 PM
thank you for your help

I put it in "forumhome_forumbit_level2_post"
and it works
but the second condition only
and I take care of the 'Male' as a case sensitive.

but it did not work it's only hide forum 21 from male and female !

what to do

I don't understand what you're trying to say. :confused:

afthl
03-06-2007, 08:32 PM
it dosn't care about the gender
it's only hiding the forum number 21 from both m/f