PDA

View Full Version : Avatar for Guest Usergroup


Simon2323
03-29-2014, 01:08 PM
I have been searching all over and can not find the solution, tried to add few conditionals to postbit legacy without any luck.
I need to find a way to set one avatar image for unregistered/guest posts.
I tried using a ranks, but ranks do not show on the guest posts
any ideas?

I also see this question unanswered many times in this forum

ForceHSS
03-29-2014, 01:51 PM
Thats because guests should never be allowed to post as 99% are spam bots

ozzy47
03-29-2014, 02:20 PM
This is untested however..

Edit your "postbit" or "postbit_legacy" template..
Find these lines:

<vb:if condition="$post.avatarurl">
<img src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
<vb:else />
<img src="{vb:stylevar imgdir_misc}/unknown.gif" />
</vb:if>

And change it to this:

<vb:if condition="$post['usergroupid'] == 1">
<img src="http://something/guestavatar.jpg" />
<vb:else />
<vb:if condition="$post.avatarurl">
<img src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
<vb:else />
<img src="{vb:stylevar imgdir_misc}/unknown.gif" />
</vb:if>
</vb:if>

Simon2323
03-29-2014, 02:35 PM
i tried the above code and it did not work, it looks like vbuletin does not keep unregistered posts as part of any usergroup, when I look at my unregistered usergroup, it has zero members and when I assign a rank to that group it does not show in postbit,

--------------- Added 1396103759 at 1396103759 ---------------

Thats because guests should never be allowed to post as 99% are spam bots

i do not agree with it, and that is why I am looking for a solution.

ozzy47
03-29-2014, 02:38 PM
Try changing,
<vb:if condition="$post['usergroupid'] == 1">

To this:
<vb:if condition="$post['usergroupid'] == 0">

Or this:
<vb:if condition="$post['usergroupid'] == ' '">

Simon2323
03-29-2014, 02:42 PM
Thanks i will try, I was thinking about using less than 2? What would be the code for it?

--------------- Added 1396104661 at 1396104661 ---------------

@ozzy, thank you so very much, it worked with "0", now I need the code to resize it.

ozzy47
03-29-2014, 02:51 PM
Maybe this:
<vb:if condition="$post['usergroupid'] <= 1">

Simon2323
03-29-2014, 03:30 PM
Got it working, thank you so much @ozzy47

This is my final code:

<vb:if condition="$post['usergroupid'] == 0">
<center> <img src="http://path/images/avatars/guestavatar.jpg" /> </center>

works like a charm

Paul M
03-29-2014, 04:16 PM
Thats because guests should never be allowed to post as 99% are spam bots

They didnt ask for your opinion of whether guests should post.

If you cannot help then perhaps you should move on, not post unhelpful remarks.

ForceHSS
03-29-2014, 04:39 PM
Its not unhelpful its a fact everyone here will agree if you allow guests to post then most will be spam bots

ozzy47
03-29-2014, 04:53 PM
Got it working, thank you so much @ozzy47

This is my final code:

<vb:if condition="$post['usergroupid'] == 0">
<center> <img src="http://path/images/avatars/guestavatar.jpg" /> </center>

works like a charm

Excellent, glad is is working. :)

Simon2323
03-29-2014, 10:49 PM
Its not unhelpful its a fact everyone here will agree if you allow guests to post then most will be spam bots

I came here looking for solutions, not for opinions, but if you insist I must say I disagree with you, i allow guests to post in my forum and with good antispam measurements I have no problem with spam at all.
Sometimes people have something to say and they do not want to go thru the trouble of registering to a forum they might never come back, I know because I have been in that situation many times, i just pass on, haven't you?

I do not have problems with spam bots in my forum and guest are allowed to post. I also moderate their posts, but it is my choice and we are all very happy.

Once again thank ozzy for his help

ozzy47
03-29-2014, 11:00 PM
I came here looking for solutions, not for opinions, but if you insist I must say I disagree with you, i allow guests to post in my forum and with good antispam measurements I have no problem with spam at all.
Sometimes people have something to say and they do not want to go thru the trouble of registering to a forum they might never come back, I know because I have been in that situation many times, i just pass on, haven't you?

I do not have problems with spam bots in my forum and guest are allowed to post. I also moderate their posts, but it is my choice and we are all very happy.

Once again thank ozzy for his help

TBH, I would never allow guests to post on my forum, but I did not go into this as I figured you were already doing this, and had no issues. :)

But anyway, not a problem, glad to help. :D