Ticket #344: comm_moderation.patch
| File comm_moderation.patch, 2.1 kB (added by eavdmeer, 4 months ago) |
|---|
-
community_member_add.php
old new 10 10 11 11 if (isset ($parameter)) { 12 12 $friend_id= $parameter[0]; 13 if(!record_exists('friends','friend',$friend_id,'owner',$USER->ident)){14 $f = new StdClass;15 $f->owner = $USER->ident;16 $f->friend = $friend_id;17 $f->ident = insert_record('friends',$f);18 }19 else{20 $f = get_record('friends','friend',$friend_id,'owner',$USER->ident);21 }22 13 $run_result= array (); 23 14 if (!empty ($friend_id) && logged_on) { 24 15 if (user_info("user_type", $friend_id) == "community") { 25 16 if ($friend= get_record('users', 'ident', $friend_id)) { 26 17 $owner= get_record('users', 'ident', $friend->owner); 27 18 if ($friend->moderation == "no") { 19 if(!record_exists('friends','friend',$friend_id,'owner',$USER->ident)){ 20 $f = new StdClass; 21 $f->owner = $USER->ident; 22 $f->friend = $friend_id; 23 $f->ident = insert_record('friends',$f); 24 } 25 else{ 26 $f = get_record('friends','friend',$friend_id,'owner',$USER->ident); 27 } 28 28 $run_result[]= sprintf(__gettext("You joined %s."), stripslashes($friend->name)); 29 29 if (user_flag_get("emailnotifications", $owner->ident)) { 30 30 $message_body= sprintf(__gettext("%s has joined %s!\n\nTo visit this user's profile, click on the following link:\n\n\t%s\n\nTo view all community members, click here:\n\n\t%s\n\nRegards,\n\nThe %s team."), $_SESSION['name'], $friend->name, $CFG->wwwroot . user_info("username", $USER->ident) . "/", $CFG->wwwroot . $friend->username . "/community/members", $CFG->sitename);
