Page 1 of 1

Avatar Not Showing for IPB 3.0

PostPosted: 17 Jan 2011, 10:15
by JLesinski
I have IPB and I am not having any Avatar images show up from my users. It just has the default image.



define('DB_USERTABLE_AVATAR','pp_thumb_photo');


This is the config.php file for the avatar

Re: Avatar Not Showing for IPB 3.0

PostPosted: 17 Jan 2011, 14:13
by GAbrams
Hi,

I am running IPB 3.14 and noticed the same thing.

I found it to be a problem in the file:

arrowchat/includes/functions_receive.php (the one for invision power board)

Check this section in the file and see if changing the 'if' statement line to what I have below fixes it. It fixed mine. I also just reported this in the ticket system here.

Look for:

Code: Select all
function getAvatar($image, $user_id) {
   global $INFO;


Change the line which follows that originally reads:

Code: Select all
    if (is_file(dirname(dirname(__FILE__)).'/uploads/'.$image)) {


With this replacement line:

Code: Select all
    if ($image) {


I'm not sure why the original line doesn't work. Their may be a better fix in line with the intent of the original code. But this has it working for now.

Re: Avatar Not Showing for IPB 3.0

PostPosted: 17 Jan 2011, 15:59
by JLesinski
Thanks - I went in to try and add that code but saw that I already had a reply from support. Here is what Jason sent in the support ticket


"You just needed another dirname() in the avatar function to fix the pathing."

No clue what that means but hopefully anyone else having this issue can either use GAbrams suggestion or the one from support to get it fixed.

Re: Avatar Not Showing for IPB 3.0

PostPosted: 17 Jan 2011, 16:36
by Jason
The problem with the current IP.Board avatar function is that it checks for yourdomain.com/arrowchat and doesn't account for yourdomain.com/forum/arrowchat if you have that instead.

Adding another dirname() in the function will fix this.

Gabrams solution might be a better solution as it won't matter where your arrowchat folder is located, but I'll have to check and make sure that people who don't have avatars have a blank image field in the database before implementing that solution.

One last thing, a better way to do it would be:

Code: Select all
if (empty($image)) {

Topic Closed

PostPosted: 07 Nov 2012, 12:40
by Staff Bot
This thread has been locked because the last post is greater than six months old. There is a good chance that the information in this thread is outdated. Please open a new topic if you wish to discuss this further.