当前位置: 首页>>代码示例>>PHP>>正文


PHP AZLib::delete_messages方法代码示例

本文整理汇总了PHP中AZLib::delete_messages方法的典型用法代码示例。如果您正苦于以下问题:PHP AZLib::delete_messages方法的具体用法?PHP AZLib::delete_messages怎么用?PHP AZLib::delete_messages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AZLib的用法示例。


在下文中一共展示了AZLib::delete_messages方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: action_pm

 function action_pm()
 {
     $act_ = Url::get('act_');
     $pm_id = (int) Url::get('pm_id', 0);
     $content = trim(AZLib::getParam('content'));
     $title_pm = '';
     $json = "";
     if (!User::is_login()) {
         $json = '({"msg":"no_login"})';
         echo $json;
         exit;
     }
     if (User::is_block()) {
         $json = '({"msg":"no_perm"})';
         echo $json;
         exit;
     }
     if ($pm_id) {
         $message_topic = DB::select('message_topics', "mt_id={$pm_id}");
         if ($message_topic && User::id() == $message_topic['mt_owner_id']) {
             $message_text = DB::select('message_text', "msg_id={$message_topic['mt_msg_id']}");
             if (!$message_text) {
                 DB::delete('message_topics', "mt_id={$pm_id}");
                 $json = '({"msg":"no_perm"})';
                 echo $json;
                 exit;
             }
         } else {
             $json = '({"msg":"no_perm"})';
             echo $json;
             exit;
         }
         if ($act_ == 'reply' && $content || $act_ == 'skip' || $act_ == 'delete') {
             $json = '({"msg":"success"';
             if ($act_ == 'reply' && $content) {
                 if (AZLib::checkBadWord($content)) {
                     $json = '({"msg":"bad_word"})';
                     echo $json;
                     exit;
                 }
                 $title_pm = $message_topic['mt_title'];
                 if ($message_topic['mt_ref_id']) {
                     $ref_id = $message_topic['mt_ref_id'];
                 } else {
                     $ref_id = $pm_id;
                 }
                 //if(strpos($title_pm,'Re:')!==0){
                 //	$title_pm="Re: $title_pm";
                 //}
                 if (AZLib::isBlackList(User::id(), $message_topic['mt_from_id'])) {
                     if ($message_topic['mt_read'] == 0) {
                         DB::query("UPDATE message_topics SET mt_read=1 WHERE mt_id={$pm_id}");
                     }
                     $json = '({"msg":"blacklist"})';
                     echo $json;
                     exit;
                 }
                 $user = User::getUser($message_topic['mt_from_id']);
                 if ($user) {
                     $id_mess = AZLib::Send_pm(User::id(), User::user_name(), $user, $title_pm, $content, 0, $ref_id);
                     if (!$id_mess) {
                         $json = '({"msg":"unsuccess"})';
                         echo $json;
                         exit;
                     }
                 }
                 if ($message_topic['mt_read'] == 0) {
                     DB::query("UPDATE message_topics SET mt_read=1 WHERE mt_id={$pm_id}");
                     //Cập nhật đã đọc - trả lời cho feed
                     DB::query("UPDATE feed SET status = 1 WHERE ref_id = {$pm_id} AND type=4");
                     DB::query('UPDATE user SET total_pm = total_pm-1 WHERE id=' . User::id() . ' AND total_pm>0');
                     User::getUser(User::id(), 0, 1);
                 }
             } elseif ($act_ == 'delete') {
                 AZLib::delete_messages($pm_id);
                 //Cập nhật đã đọc - trả lời cho feed
                 DB::query("DELETE FROM feed WHERE ref_id = {$pm_id} AND type=4");
             } else {
                 if ($message_topic['mt_read'] == 0) {
                     DB::query("UPDATE message_topics SET mt_read=1 WHERE mt_id={$pm_id}");
                     DB::query('UPDATE user SET total_pm = total_pm-1 WHERE id=' . User::id() . ' AND total_pm>0');
                     User::getUser(User::id(), 0, 1);
                 }
                 //Cập nhật đã đọc - trả lời cho feed
                 DB::query("UPDATE feed SET status = 1 WHERE ref_id = {$pm_id} AND type=4");
             }
             DB::query('UPDATE user SET total_pm = total_pm-1 WHERE id=' . User::id() . ' AND total_pm>0');
             User::getUser(User::id(), 0, 1);
             $json .= "})";
             echo $json;
             exit;
         } else {
             $json = '({"msg":"short_content"})';
             exit;
         }
     }
     $json = "({'msg':'no_perm'})";
     echo $json;
 }
开发者ID:duynhan07,项目名称:elink,代码行数:99,代码来源:ajax_shop_giaodich.ajax.php


注:本文中的AZLib::delete_messages方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。