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


All times are GMT. The time now is 03:51 PM.

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.01108 seconds
  • Memory Usage 1,737KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete