FreiChat related discussions
Problems with avatar

Hi, i see its not rare that people cant add custom avatar :) So i integrated successfully your grate plugin, all works fine. Now i'm trying to make custom avatar, and so far got nothing working... In config chat showing only for loggedin users, so i did:

public function get_users() {

//do not delete below comment
//CUSTOM_USERS_QUERY_START
$query = "SELECT DISTINCT status_mesg,username,session_id,status,guest,in_room,X.user_profile_avatar
FROM frei_session, friends_user AS X
WHERE time>" . $this->online_time2 . "
AND session_id!=" . $_SESSION[$this->uid . 'usr_ses_id'] . "
AND status!=2
AND status!=0
AND guest=0
AND X.user_id= session_id";
//CUSTOM_USERS_QUERY_END
//do not delete above comment

$list = $this->db->query($query)->fetchAll();
return $list;
}

In hardcode :
$avatar_table_name='friends_user'; //specifies the table where avatar information is stored
$avatar_column_name='user_profile_avatar'; //specifies the column name where the avatar url is stored

in log file i keep recieving Wrong method defined! Have no idea what does it even mean :)

After all manipulations no luck to get users avatar... Hope you could help me :)

Hi, i see its not rare that people cant add custom avatar :) So i integrated successfully your grate plugin, all works fine. Now i'm trying to make custom avatar, and so far got nothing working... In config chat showing only for loggedin users, so i did: public function get_users() { //do not delete below comment //CUSTOM_USERS_QUERY_START $query = "SELECT DISTINCT status_mesg,username,session_id,status,guest,in_room,X.user_profile_avatar FROM frei_session, friends_user AS X WHERE time>" . $this->online_time2 . " AND session_id!=" . $_SESSION[$this->uid . 'usr_ses_id'] . " AND status!=2 AND status!=0 AND guest=0 AND X.user_id= session_id"; //CUSTOM_USERS_QUERY_END //do not delete above comment $list = $this->db->query($query)->fetchAll(); return $list; } In hardcode : $avatar_table_name='friends_user'; //specifies the table where avatar information is stored $avatar_column_name='user_profile_avatar'; //specifies the column name where the avatar url is stored in log file i keep recieving Wrong method defined! Have no idea what does it even mean :) After all manipulations no luck to get users avatar... Hope you could help me :)

Hi,

You could have integrated your avatars during installation itself .

After all manipulations no luck to get users avatar... Hope you could help me :)

Do you get a wrong url for the avatar in the user list or do you get the default avatar ?

Hi, You could have integrated your avatars during installation itself . <em>After all manipulations no luck to get users avatar... Hope you could help me :)</em> Do you get a wrong url for the avatar in the user list or do you get the default avatar ?
Necessity is the mother of all inventions!

Try this:

Go to freichat/hardcode.php

Replace

$avatar_field_name = 'avatar';

with
$avatar_field_name = 'user_profile_avatar';

Try this: Go to freichat/hardcode.php Replace <code> $avatar_field_name = 'avatar'; </code> with <code> $avatar_field_name = 'user_profile_avatar'; </code>
Necessity is the mother of all inventions!

$avatar_table_name='friends_user'; //specifies the table where avatar information is stored
$avatar_column_name='user_profile_avatar'; //specifies the column name where the avatar url is stored
$avatar_userid='id'; //specifies the userid to the user to get the user's avatar
$avatar_reference_user='id'; //specifies the reference to the user to get the user's avatar in user table
$avatar_reference_avatar='id'; //specifies the reference to the user to get the user's avatar in avatar
$avatar_field_name=$avatar_column_name; //to avoid unnecessary file changes , *do not change

maybe i need to change ids? user id for example in my table is user_id

$avatar_table_name='friends_user'; //specifies the table where avatar information is stored $avatar_column_name='user_profile_avatar'; //specifies the column name where the avatar url is stored $avatar_userid='id'; //specifies the userid to the user to get the user's avatar $avatar_reference_user='id'; //specifies the reference to the user to get the user's avatar in user table $avatar_reference_avatar='id'; //specifies the reference to the user to get the user's avatar in avatar $avatar_field_name=$avatar_column_name; //to avoid unnecessary file changes , *do not change maybe i need to change ids? user id for example in my table is user_id

keep getting this http://www.gravatar.com/avatar/917556cda4dd3d3f0b56c0afbb018887?s=24&d=wavatar
from where it takes it? maby i can change it somewhere in freichat code?

keep getting this http://www.gravatar.com/avatar/917556cda4dd3d3f0b56c0afbb018887?s=24&d=wavatar from where it takes it? maby i can change it somewhere in freichat code?

maybe i need to change ids? user id for example in my table is user_id


No that will not make any difference because you have hardcoded your query . Those variables are only used when freichat auto generates query based on
your table during installation.

Are your avatars stored in the users table or in some other table ?

freichat will return default avatar only if , your query does not return the avatar url or if the url is empty .

Please check what result are you getting from the database : Just add
var_dump($list);

before
return $list;


Then check the response of the freichat GET request in developer tools(chrome) -> network tab

Also , please try this too:

Replace your query with

SELECT DISTINCT f.status_mesg,f.username,f.session_id,f.status,f.guest,f.in_room,a.user_profile_avatar
FROM frei_session AS f LEFT JOIN friends_user AS a ON f.session_id = a.user_id
WHERE f.time>" . $this->online_time2 . "
AND f.session_id!=" . $_SESSION[$this->uid . 'usr_ses_id'] . "
AND f.status!=2
AND f.status!=0
AND f.guest=0
<em> maybe i need to change ids? user id for example in my table is user_id </em> No that will not make any difference because you have hardcoded your query . Those variables are only used when freichat auto generates query based on your table during installation. Are your avatars stored in the users table or in some other table ? freichat will return default avatar only if , your query does not return the avatar url or if the url is empty . Please check what result are you getting from the database : Just add <code> var_dump($list); </code> before <code> return $list; </code> Then check the response of the freichat GET request in developer tools(chrome) -> network tab Also , please try this too: Replace your query with <code> SELECT DISTINCT f.status_mesg,f.username,f.session_id,f.status,f.guest,f.in_room,a.user_profile_avatar FROM frei_session AS f LEFT JOIN friends_user AS a ON f.session_id = a.user_id WHERE f.time>" . $this->online_time2 . " AND f.session_id!=" . $_SESSION[$this->uid . 'usr_ses_id'] . " AND f.status!=2 AND f.status!=0 AND f.guest=0 </code>
Necessity is the mother of all inventions!
138
8
0
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft