vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Avatar for Guest Usergroup (https://vborg.vbsupport.ru/showthread.php?t=310012)

Simon2323 03-29-2014 01:08 PM

Avatar for Guest Usergroup
 
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:

Code:

<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:

Code:

<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 [DATE]1396103759[/DATE] at [TIME]1396103759[/TIME] ---------------

Quote:

Originally Posted by ForceHSS (Post 2490223)
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,
Code:

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

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

<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 [DATE]1396104661[/DATE] at [TIME]1396104661[/TIME] ---------------

@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:
Code:

<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

Quote:

Originally Posted by ForceHSS (Post 2490223)
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

Quote:

Originally Posted by Simon2323 (Post 2490249)
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

Quote:

Originally Posted by ForceHSS (Post 2490270)
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

Quote:

Originally Posted by Simon2323 (Post 2490339)
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


All times are GMT. The time now is 12:35 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01020 seconds
  • Memory Usage 1,744KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete