|
|||
I've created two profile types: Business and Individual
What I would like to do is set all the business profiles to auto-approve friends. I've customized the registration page to insert the member id of the business profile that is selected on the registration form to frnd_id. It works like a champ... However, because the business profiles don't auto approve, it simply inserts the member id of the business, but does not actually ADD the friend. I'm guessing this is because its not passing back to the member the member id of the business. In theory, I could pass the data same as I have done with an insert to the business profile friend id...but I'm not sure that would make a difference. Perhaps the best way to do this would be to automate a friend request through the form, but then I would need to have that business auto approve that request... Is this not currently a feature? If not, I should add it to the modifications thread. Auto approve friend requests would be really handy for businesses. On MySpace, this is done at the front end. When a user signs up, a friend request is sent to "Tom" who auto accepts...I'd like to be able to do the same thing. Suggestions about how to go about this? |
|
|||
Hi,
As far as I understand you have a dropdown on the registration page. That dropdown has business profiles and a new user can select any. After registration the new user and the selected profile will become friends. If I misunerstood something, please correct me. Such a thing can't be found in the frontend but there is one place in the code that does just that. You can copy-paste that code to any place you need. When user X sends a friend request to Y and Y sends a request to X their requests auto-approve. You can check engine/pages/add_frnds_next.php. Here is this code: Code:
...
$sql->query("SELECT 1 FROM ".DB_DEFAULT_PREFIX."add_friends WHERE member_id ={$frnd_id} AND friend_id ={$member_id}");
//to check if another person has sent a friend request too (then just make them friends)
if ($sql->num_rows())
{
require_once 'engine/pages/frnds_request.php';
$sql->query("DELETE FROM ".DB_DEFAULT_PREFIX."add_friends WHERE member_id ={$frnd_id} AND friend_id ={$member_id}");
$frnds_request = new frnds_request();
$frnds_request->add_frnd($member_id, $frnd_id, 'single');
$frnds_request->add_frnd($frnd_id, $member_id, 'single');
NFIFriends::create($member_id, $frnd_id);
$this->load_page('home');
}
...
|





Linear Mode
