FreiChat related discussions
How to get friends ONLY

Hey hi i have integrated Freichat into a social networing website developed in PHP. I want to show only friends of the users . I also changed the function get_buddies() placed into /freichat/server/drivers/custom.php but it is showing " Loading Friends ".

I also changed from freichat Backend " EveryOne to Only your buddies".

can you please tell me how can i get only the friends of user.

please reply soon as possible......

Hey hi i have integrated Freichat into a social networing website developed in PHP. I want to show only friends of the users . I also changed the function get_buddies() placed into /freichat/server/drivers/custom.php but it is showing " Loading Friends ". I also changed from freichat Backend " EveryOne to Only your buddies". can you please tell me how can i get only the friends of user. please reply soon as possible......
Ankit singh

Your query written in get_buddies() may be wrong .

make sure your get_list() in Custom.php looks like following:

public function getList() {

$user_list = null;

if (trim($this->ug_ids) != "") //if blank fetch all users
return $this->get_users_by_group();

if ($this->show_name == 'guest') {
$user_list = $this->get_guests();
} else if ($this->show_name == 'user') {
$user_list = $this->get_users();
} else if ($this->show_name == 'buddy') {
$user_list = $this->get_buddies();
} else {
$this->freichat_debug('USER parameters for show_name are wrong.');
}
return $user_list;
}

Your query written in get_buddies() may be wrong . make sure your get_list() in Custom.php looks like following: <code> public function getList() { $user_list = null; if (trim($this->ug_ids) != "") //if blank fetch all users return $this->get_users_by_group(); if ($this->show_name == 'guest') { $user_list = $this->get_guests(); } else if ($this->show_name == 'user') { $user_list = $this->get_users(); } else if ($this->show_name == 'buddy') { $user_list = $this->get_buddies(); } else { $this->freichat_debug('USER parameters for show_name are wrong.'); } return $user_list; } </code>
Necessity is the mother of all inventions!

Thanks for your response!!!!!!!!

You have written the get_list()...

I found the get_list() in base.php and custom.php .....
Then should i have to change in both files for in cutom.php ???
&&
In base.php there is also get_buddies() ..Like This

public function get_buddies() {
$this->get_users();
}

So i have to write the Query there also.

Thanks for your response!!!!!!!! You have written the get_list()... I found the get_list() in base.php and custom.php ..... Then should i have to change in both files for in cutom.php ??? && In base.php there is also get_buddies() ..Like This public function get_buddies() { $this->get_users(); } So i have to write the Query there also.
Ankit singh

No, you do not have to change both files(Only Custom.php needs to be changed) , and also no need to change both the queries .

No, you do not have to change both files(Only Custom.php needs to be changed) , and also no need to change both the queries .
Necessity is the mother of all inventions!
102
3
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