View Single Post
Assign avatar for Guest or Anonymous
Old
  (#1 (permalink))
mikem
Senior Member
 
Status: Offline
Posts: 2,905
Join Date: Sep 2002
Assign avatar for Guest or Anonymous - 07-25-2003, 09:54 AM

If you allow guest posting in your Forums, then you may want to add this little hack in order for your Guest/Anonymous user to have an assigned default avatar.
To make this work do the following.

open modules/Forums/viewtopic.php
Find this line
Code:
if ( $postrow[$i]['user_avatar_type'] && $poster_id != ANONYMOUS && $postrow[$i]['user_allowavatar'] )
change it to this
Code:
if ( $postrow[$i]['user_avatar_type'] && $postrow[$i]['user_allowavatar'] )
Now you need to assign an Avatar to the Anonymous user in the Database.
Go to your Database table _users.
I recommend using phpMyadmin
Browse the users and select the Anonymous. This is usually user_id number 1.
The user_avatar field needs to be changed to whatever.gif (your guest avatar image name) Make sure you upload this Guest Avatar to both the modules/Forums/images/avatars and modules/Forums/images/avatars/gallery folders just in case your pathing is screwy. :wink:

If it doesn't work up to this point then open viewtopic.php and comment out or remove the following lines:

Code:
if ( $poster_id == ANONYMOUS )
{
$poster_avatar = '[img]'.  $images['guest_avatar'] .'[/img]';
 }
mikem
   
Reply With Quote