Announcement

Collapse
No announcement yet.

Hide Thread & Post Count with If Statement

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • bogene2020
    replied
    Jake Thank You very much for going the extra lenght . I know you didn't even have to bother with this template mod .

    I just figured out my problem and I got it working

    I had to change 2 templates

    forumhome_forumbit_level1_post &
    forumhome_forumbit_level2_post

    with

    Code:
    [COLOR=#007700]<[/COLOR][COLOR=#0000bb]td [/COLOR][COLOR=#007700]class=[/COLOR][COLOR=#dd0000]"alt1"[/COLOR][COLOR=#007700]><if [/COLOR][COLOR=#0000bb]condition[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#dd0000]"is_member_of($bbuserinfo, 1,2,3,4 )"[/COLOR][COLOR=#007700]>[/COLOR][COLOR=#0000bb]Private[/COLOR][COLOR=#007700]<else />[/COLOR][COLOR=#0000bb]$forum[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]threadcount[/COLOR][COLOR=#007700]]</if></[/COLOR][COLOR=#0000bb]td[/COLOR][COLOR=#007700]>[/COLOR]
    [COLOR=#007700]<[/COLOR][COLOR=#0000bb]td [/COLOR][COLOR=#007700]class=[/COLOR][COLOR=#dd0000]"alt2""[/COLOR][COLOR=#007700][COLOR=#007700]><if [/COLOR][COLOR=#0000bb]condition[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#dd0000]"is_member_of($bbuserinfo, 1,2,3,4 )"[/COLOR][COLOR=#007700]>[/COLOR][COLOR=#0000bb]Private[/COLOR][COLOR=#007700]<else />[/COLOR][/COLOR][COLOR=#0000bb]$forum[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]replycount[/COLOR][COLOR=#007700]]</if></[COLOR=#0000bb]td[/COLOR][COLOR=#007700]>[/COLOR][/COLOR]

    Leave a comment:


  • Jake Bunce
    replied
    What is the URL to your forum?

    Leave a comment:


  • bogene2020
    replied
    Thanks for helping me so much but I still cant get this to work . I have the code like below . It looks like it should work but its not .

    PHP Code:
    <td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
    <
    td class="alt1"><if condition="is_member_of($bbuserinfo, 1,2,3,4 )">Private<else />$forum[threadcount]</if></td>
    <
    td class="alt2">$forum[replycount]</td>
    <if 
    condition="$vboptions['showmoderatorcolumn']">
    <
    td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td

    Leave a comment:


  • Jake Bunce
    replied
    In the context of the template code, add the colored code:

    Code:
    <td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
    <td class="alt1">[color=blue]<if condition="is_member_of($bbuserinfo, [color=red]X, Y, Z[/color])">Private<else />[/color]$forum[threadcount][color=blue]</if>[/color]</td>
    <td class="alt2">$forum[replycount]</td>

    Leave a comment:


  • bogene2020
    replied
    I used this statement and I have put it in the code towards the bottom but I still see the thread and post count . Maybe I am not inserting the code in the right place .

    PHP Code:
    <if condition="is_member_of($bbuserinfo, 1, 2, 3, 4)">Private<else />$forum[threadcount]</if> 
    PHP Code:
    <tr align="center">
    <
    td class="alt2"><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" /></td>
    <
    td class="alt1Active" align="$stylevar[left]id="f$forum[forumid]">
    <
    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>
    <
    td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
    <
    td class="alt1">$forum[threadcount]</td>
    <
    td class="alt2">$forum[replycount]</td>
    <if 
    condition="$vboptions['showmoderatorcolumn']">
    <if 
    condition="is_member_of($bbuserinfo, 1, 2, 3, 4)">Private<else />$forum[threadcount]</if>
    <
    td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
    </if>
    </
    tr>
    $childforumbits 

    Leave a comment:


  • Jake Bunce
    replied
    Only change the red part. Don't use leading zeros in the numbers.

    Leave a comment:


  • bogene2020
    replied
    I can't get the if statement to work . I must be doing something wrong .
    I have tried the 3 statements below .

    PHP Code:
    <if condition="is_member_of($bbuserinfo[usergroupid], 1, 2, 3,4)">Private<else />$forum[threadcount]</if>
     
    <if 
    condition="!is_member_of($bbuserinfo[usergroupid],1,2,3,4)">Private<else />$forum[threadcount]</if>
     
    <if 
    condition="is_member_of($bbuserinfo, 01, 02, 03, 04)">Private<else />$forum[threadcount]</if> 

    </DIV>

    Leave a comment:


  • Jake Bunce
    replied
    You can use a condition like this:

    Code:
    <if condition="is_member_of($bbuserinfo, [color=red]X, Y, Z[/color])">Private<else />$forum[threadcount]</if>
    Where X, Y, Z is a comma list of usergroupids that will see "Private."

    Leave a comment:


  • bogene2020
    replied
    I have that set to No already but if you look at this link under the thread column and the post column . It says private . Mine shows me private under the last post but I want to make the thread count and post count private too . Thanks

    Leave a comment:


  • Jake Bunce
    replied
    The "private" option is here:

    Admin CP -> vBulletin Options -> Forums Listings Display Options -> Show Private Forums

    Leave a comment:


  • bogene2020
    started a topic Hide Thread & Post Count with If Statement

    Hide Thread & Post Count with If Statement

    Hi,
    I would like to be able to hide my thread and post count from certain usergroups . Infact I only want moderators and admins to be able to see the counts in the forum display . I want it to look like http://www.webforumz.com/subscriber-only-forums/

    I believe I have to edit the forumhome_forumbit_level2_post
    What do I edit . I have included my forumhome_forumbit_level2_post

    Or is there a way to hide the threads and the posts columns from certain usergroups . I looked thru the vb manual and I cant figure it out . Thanks

    PHP Code:
    <tr align="center">
    <
    td class="alt2"><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" /></td>
    <
    td class="alt1Active" align="$stylevar[left]id="f$forum[forumid]">
    <
    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>
    <
    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>
    $childforumbits 
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X