Help
Ask questions about how to do or fix things in Arrowchat
User avatar
JLesinski
Customer
 
Posts: 29
Joined: 27 Oct 2010, 17:01

 

by JLesinski 17 Jan 2011, 10:15

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
User avatar
GAbrams
Customer
 
Posts: 3
Joined: 16 Jan 2011, 14:21

 

by GAbrams 17 Jan 2011, 14:13

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.
User avatar
JLesinski
Customer
 
Posts: 29
Joined: 27 Oct 2010, 17:01

 

by JLesinski 17 Jan 2011, 15:59

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.
User avatar
Jason
Customer
 
Posts: 2356
Joined: 12 Dec 2009, 16:06

 

by Jason 17 Jan 2011, 16:36

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)) {
User avatar
Staff Bot
ArrowChat Team
 
Posts: 8996
Joined: 07 Nov 2012, 13:41

 

by Staff Bot 07 Nov 2012, 12:40

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.