Ejemplo n.º 1
0
 public function account_save_profile($profile_row_name, $profile_row_name_val, $mno)
 {
     $mc = new myclass();
     $fullName = '';
     $isName = FALSE;
     echo "   profile_row_name_val =  {$profile_row_name_val}";
     $prn = explode(',', $profile_row_name);
     $prnv = explode('_new_', $profile_row_name_val);
     echo " rowname <br> ";
     print_r($prn);
     echo " values <br>";
     print_r($prnv);
     for ($i = 0; $i < count($prn); $i++) {
         #check if exist if its exist then return faild.
         $rn = $prn[$i];
         $rv = $prnv[$i];
         // $rv = str_replace('Your Firstname','',$rv);
         $rv = str_replace('Your Nickname / Alias', '', $rv);
         $rv = str_replace('Your Lastname', '', $rv);
         // if update the full name
         if ($rn == 'lastname' || $rn == 'firstname' || $rn == 'nickname' || $rn == 'middlename') {
             $rv = ucwords($rv);
             $isName = TRUE;
             $fullName .= $rv . ' ';
         }
         //if update the username
         if ($rn == 'username' || $rn == 'email') {
             update1('fs_member_accounts', $rn, $rv, array('mno', $mno));
         } else {
             update1('fs_members', $rn, $rv, array('mno', $mno));
         }
     }
     // If name is being updated then notify all the followers
     if ($isName == TRUE) {
         $_SESSION['noti_table_name'] = TRUE;
         $_SESSION['noti_type'] = 'change-name';
         $_SESSION['fullName'] = $fullName;
         $mc->send_notification_to_follower($mno);
         print 'send notification to follwers change name';
     } else {
         print 'failed to send notification maybe this is not changing name';
     }
     // add or updated keyword
     $mc->fs_search(array('type' => 'add-or-updated-keyword', 'table_name' => 'fs_members', 'table_id' => $mno));
 }
Ejemplo n.º 2
0
$_SESSION['mno'] = $mc->get_cookie('mno', 136);
$mno = $mc->get_cookie('mno', 136);
$comment = $_GET['comment'];
$table_id = $_GET['table_id'];
$table_name = $_GET['table_name'];
$action = $_GET['action'];
$option = $_GET['option'];
/** Insert flag */
if ($db->insert('fs_flag', array('mno' => $mno, 'table_id' => $table_id, 'table_name' => $table_name, 'comment' => $comment, 'action' => $action, 'option' => $option))) {
    echo "<div style='color:green' >You successfully flagged this post.</div>";
    /** setup message here */
    $message = 'Your post is being flagged please visit our posting rules to delete <a hre="http://google.com" >google.com </a>';
    /** send notification with the owner of this modal */
    $mc->set_session_notification($mno, $table_name, $table_id, 'flagged', '', '', 'flagged');
    //     $_SESSION['noti_action'] = 'flagged your post, please visit posting rule';
    //     $_SESSION['noti_type']  = 'flagged';
    //     $_SESSION['noti_link']  = 'google.com';
    $mc->send_notification_to_follower($_SESSION['mno']);
    /** To add flag message */
    //get owner of the modal
    $mno1 = $mc->get_modal_owner($table_name, $table_id);
    // this is to be change to no more insert only the returned msgno from the chat.php need to be session here to save time loading
    $msgno = $mc->fs_message(array('type' => 'get-or-add-message-id', 'mno' => $mno, 'mno1' => $mno1));
    // insert message
    $response = $mc->posted_modals_comment_Query(array('comment_query' => 'comment-insert', 'mno' => $mno, 'comment' => $message, 'table_name' => 'fs_message', 'table_id' => $msgno));
    // update time and current user sent a message
    $response = $mc->update_fs_table_auto(null, array('mno2' => $mno1, 'date' => $mc->date_time, 'status' => 1, 'idname' => 'msgno', 'idval' => $msgno), 'fs_message');
    // require('http://localhost/fs/new_fs/alphatest/fs_folders/modals/general_modals/gen.modals.func.php?action=messaging&type=insert-message&mno1=133&message=flagged message');
} else {
    echo "<div style='color:red' >Ohps, Something wrong. Failed to flag.</div>";
}