$who has joined your $sitename fan club
To view the profile for $who click the link below
$base/profile_view.php?user_id=$vid
";
send_notification($who,$what,$email,$notice);
//end send notification of addition to buddylist
if(isset($_SESSION['user_id']) && !empty($_SESSION['user_id'])){
update_activity_points();}
$topass['message']="You have successfully joined the fan club.
To see and manage the fan clubs you belong to click here";
}
} elseif($action=='delete') {
if (in_array($user_id,get_buddy_ids($_SESSION['user_id'],false))) {
$query="DELETE FROM user_buddies WHERE user_id='".$_SESSION['user_id']."' AND buddy_id='$user_id'";
if (!($res=mysql_query($query))) {error(mysql_error(),__LINE__,__FILE__);}
//start send notification to fan club owner
$who=get_name($_SESSION['user_id']);
$you=get_name($user_id);
$what="Removed you from his/her fan club";
$email=get_email($user_id);
$base=_BASEURL_;
$sitename=_SITENAME_;
$vid=$_SESSION['user_id'];
$notice="Dear $you
$who has $what
To view the profile for $who click the link below
$base/profile_view.php?user_id=$vid
"; send_notification($who,$what,$email,$notice); //end send notification of addition to buddylist $topass['message']="You have successfully removed the member from your fan club."; } else { $topass['message']="This member does not belong to your fan club."; } }elseif($action=='deletemyself') { if (in_array($user_id,get_whoadded_ids($_SESSION['user_id'],false))) { $query="DELETE FROM user_buddies WHERE buddy_id='".$_SESSION['user_id']."' AND user_id='$user_id'"; if (!($res=mysql_query($query))) {error(mysql_error(),__LINE__,__FILE__);} //start send notification to fan club owner $who=get_name($_SESSION['user_id']); $you=get_name($user_id); $what="Removed himself/herself fan your fan club"; $email=get_email($user_id); $base=_BASEURL_; $sitename=_SITENAME_; $vid=$_SESSION['user_id']; $notice="Dear $you
$who has $what
To view the profile for $who click the link below
$base/profile_view.php?user_id=$vid
"; send_notification($who,$what,$email,$notice); //end send notification of addition to buddylist $topass['message']="You have successfully removed yourself from the fan club."; } else { $topass['message']="You are trying to remove yourself from a fanclub to which you do not belong."; } } } if($action2=='addbuddybyname') { $name=addslashes_mq($_POST['name']); if(!isset($name)||empty($name)){ $topass['message']="No name has been entered."; redirect2page("clubs_list.php",$topass);} $existsname=existsname($name); if($existsname==0){ $topass['message']="No such member as $name exists. Cannot join a non-existent club"; redirect2page("clubs_list.php",$topass);} $user_id=get_userid_by_name($name); if (in_array($user_id,get_buddy_ids($_SESSION['user_id'],false))) { $topass['message']="You are already a member of this fan club."; } else { $query="INSERT INTO user_buddies SET user_id='".$_SESSION['user_id']."',buddy_id='$user_id'"; if (!($res=mysql_query($query))) {error(mysql_error(),__LINE__,__FILE__);} //start send notification to fan club owner $who=get_name($_SESSION['user_id']); $you=get_name($user_id); $what="Joined your fan club"; $email=get_email($user_id); $base=_BASEURL_; $sitename=_SITENAME_; $vid=$_SESSION['user_id']; $notice="Dear $you
$who has joined your $sitename fan club
To view the profile for $who click the link below
$base/profile_view.php?user_id=$vid
"; send_notification($who,$what,$email,$notice); //end send notification of addition to buddylist if(isset($_SESSION['user_id']) && !empty($_SESSION['user_id'])){ $myuser_id = $_SESSION['user_id']; update_activity_points();} $topass['message']="You are now a member of the fan club for: $who."; } } redirect2page("clubs_list.php",$topass); ?>