Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-29-2014, 01:08 PM
Simon2323 Simon2323 is offline
 
Join Date: Feb 2012
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 03-29-2014, 01:51 PM
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Posts: 6,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thats because guests should never be allowed to post as 99% are spam bots
Reply With Quote
  #3  
Old 03-29-2014, 02:20 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #4  
Old 03-29-2014, 02:35 PM
Simon2323 Simon2323 is offline
 
Join Date: Feb 2012
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 View Post
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.
Reply With Quote
  #5  
Old 03-29-2014, 02:38 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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'] == ' '">
Reply With Quote
  #6  
Old 03-29-2014, 02:42 PM
Simon2323 Simon2323 is offline
 
Join Date: Feb 2012
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 03-29-2014, 02:51 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Maybe this:
Code:
<vb:if condition="$post['usergroupid'] <= 1">
Reply With Quote
  #8  
Old 03-29-2014, 03:30 PM
Simon2323 Simon2323 is offline
 
Join Date: Feb 2012
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #9  
Old 03-29-2014, 04:16 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ForceHSS View Post
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.
Reply With Quote
  #10  
Old 03-29-2014, 04:39 PM
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Posts: 6,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Its not unhelpful its a fact everyone here will agree if you allow guests to post then most will be spam bots
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:19 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.04439 seconds
  • Memory Usage 2,252KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete