Go Back   Web Scribble Forums » webNetwork » webNetwork 3 » How Do I...
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-07-2009, 01:29 PM
Junior Member
 
Join Date: Sep 2009
Posts: 4
Default Auto Approve

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?
Reply With Quote
  #2 (permalink)  
Old 09-09-2009, 10:58 AM
Web Scribble Staff
 
Join Date: Jul 2009
Posts: 280
Default

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');
				}
...
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -5. The time now is 07:24 AM.