Codezwiz

General PHP Nuke Help - How to set Default Avatar image for Forums??

Bazil -
Post subject: How to set Default Avatar image for Forums??
How do you set it so that a default image is set for a user if he/she does not set there own avatar image...
There is a file names blank.gif but unless the user chooses an image the URL location for the avatar is SITE/modules/Forums/images/avatars/... and thats it, it does not pull the image..
If a user chooses an avatar, then it works fine, as it is now, I have some test users that have a red X as an avatar.. elllh..

Also the only avatars that do work are the default BS ones that come with it, if a user tries to upload, it will take it, but produce a red X in there avatar...ugg..

Thanks again.
veef -
Post subject: re: How to set Default Avatar image for Forums??
In modules/Forums/config.php you can set what images you want used like so
<?php

@include("../../mainfile.php");
define('PHPBB_INSTALLED', true);

$images['default_avatar'] = "modules/Forums/images/blank.gif";
$images['guest_avatar'] = "modules/Forums/images/blank.gif";

?>


and for the uploaded avatars check to make sure the avatar directory has write permissions
Bazil -
Post subject: re: How to set Default Avatar image for Forums??
I had added the 2 lines :
$images['default_avatar'] = "modules/Forums/images/avatars/blank.gif";
$images['guest_avatar'] = "modules/Forums/images/avatars/blank.gif";

to that file in the propper place but it still will not call to the image... gonna have to dig into it more..

as for checking to see if that file is writable, how would I do that ?

Thanks again...
veef -
Post subject: re: How to set Default Avatar image for Forums??
Sorry that was what i had done for an older version, the newer version the code is in viewtopic.php
        $images['default_avatar'] = "modules/Forums/images/avatars/gallery/blank.gif";
        $images['guest_avatar'] = "modules/Forums/images/avatars/gallery/blank.gif";
        //
        // Default Avatar MOD - Begin
        //
        if ( empty($poster_avatar) && $poster_id != ANONYMOUS)
        {
                $poster_avatar = '<img src="'.  $images['default_avatar'] .'" alt="" border="0" />';
        }
        if ( $poster_id == ANONYMOUS )
        {
                $poster_avatar = '<img src="'.  $images['guest_avatar'] .'" alt="" border="0" />';
        }
        //
        // Default Avatar MOD - End


As for the write permissions you need to ftp into your server and CHMOD it to 755, it depends on which ftp client you use but generally if you right click the directory you should see the CHMOD command.
Bazil -
Post subject: re: How to set Default Avatar image for Forums??
OK getting closer now, haha..

I added the 2 lines of:
$images['default_avatar'] = "modules/Forums/images/avatars/gallery/blank.gif";
$images['guest_avatar'] = "modules/Forums/images/avatars/gallery/blank.gif";
Just before the line:
// Default Avatar MOD - Begin

and that worked for the forums postings if the user did not choose a default or if an anon. posts.. but as for the users profiles itself under the YOUR account link it still does not pull any avatar data red X again.. If I am undestanding this correct I think I will need to add those 2 lines to every page that renders the avatar. Am I getting closer?? I hope so. LOL


as for the uploads I found that too, I had changed it via FTP client to 777 for the folder, done..


Baby steps the only way to learn, I love it...thanks for the help !!
veef -
Post subject: re: How to set Default Avatar image for Forums??
No you do not need to add these lines anywhere else they are just to set what image you would like for users who do not choose an avatar, and anon users. For users who choose an avatar from the gallery that should show up if the path is correct in your forum configuration(which by default should be unless changed), for usesr who had uploaded they will need to upload again as it was never saved because the directory did not have write permissions. This applies to the avatar shown on your account page as well.


This post comes from Codezwiz
https://www.codezwiz.com

The URL for this post is:
https://www.codezwiz.com/ftopict-8197.html