PDA

View Full Version : Filtering avatar depending upon post forum ID


theMusicMan
12-10-2004, 04:43 PM
I have two categories selected that then belong to the CMPS news forums but I only want to show the users avatar if the original post was made in one of those forums and not if it was made in the other.

You see, my usual vB News forum is one of the categories and all posts made to that forum are moderated. The fact that an avatar is shown is indicative of the fact that the post has been approved by a moderator. If a post is made into my other forun selected for news summaries on CMPS, then the fact that the avatar is not shown says that the team may need to take a closer look at this post.

I want to have 2 forums as feeders to the news summaries, but I don't want to moderate all posts to the 2nd one.

Can I use a template conditional within the news summary module that then doesn't show the users avatar depending on forum ID...??

Brian
12-10-2004, 04:45 PM
<if condition="$news['forumid'] == X">
$avatar
</if>

Our Sponsors
 

theMusicMan
12-11-2004, 03:19 AM
Thanks for the conditional Brian... here's the next question!! I am still very much learning about php and templates et al; where in the Newsbit template do I insert this code? I can't find $avatar to wrap that if conditional around, and I am wondering what the code actually means? i.e. if the post originates from forumid x, then populate the $avatar variable withe the users info...? is that what it means?

Cheers Brian

Brian
12-11-2004, 11:04 AM
Look for $newsavatarurl and that will show you where the news avatar is.

Our Sponsors
 

theMusicMan
12-11-2004, 05:49 PM
Brian

I found that reference and included the if conditional thus:

<table align="$stylevar[right]" cellspacing="4"><tr><td><img alt="" border="0" src="$newsavatarurl" title="$news[postusername]'s <if condition="$news['forumid'] == 19">$vbphrase[a_avatar]</if>" /></td></tr></table>


... still no joy though!!!

KW802
12-11-2004, 05:54 PM
Brian

I found that reference and included the if conditional thus:

<table align="$stylevar[right]" cellspacing="4"><tr><td><img alt="" border="0" src="$newsavatarurl" title="$news[postusername]'s <if condition="$news['forumid'] == 19">$vbphrase[a_avatar]</if>" /></td></tr></table>


... still no joy though!!!John,

You put the conditional in the wrong spot. ;) Try something like....<if condition="$news['forumid'] == 19">
<table align="$stylevar[right]" cellspacing="4">
<tr>
<td>
<img alt="" border="0" src="$newsavatarurl" title="$news[postusername]'s $vbphrase[a_avatar]" />
</td>
</tr>
</table>
</if>

Your mileage may vary. :)

theMusicMan
12-11-2004, 05:58 PM
Damn it Kevin.... sorry. Just realised what a total nob I am.... I put it in the right place and it all works fine.... thanks...