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


PHP AZLib::reload_captcha方法代码示例

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


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

示例1: feedback


//.........这里部分代码省略.........
     if ($user_item) {
         if (User::id()) {
             $sender_user_name = User::user_name();
         } else {
             // set guest cookie
             $week = 60 * 60 * 24 * 365 + TIME_NOW;
             AZLib::my_setcookie("guest_name", $sender_user_name, $week);
             AZLib::my_setcookie("guest_email", $sender_email, $week);
         }
         $up_up_count = '';
         if ($content != '') {
             $comment = array('content' => $content, 'item_id' => $item['id'], 'time' => TIME_NOW, 'order_time' => TIME_NOW, 'post_ip' => AZLib::ip(), 'parent_id' => $parent_id, 'receiver_user_id' => $item['user_id'], 'receiver_user_name' => $item['user_name'], 'display' => 1);
             if (User::id()) {
                 if ($item['user_id'] == User::id()) {
                     //Chuyển trạng thái đã trả lời khi comment chính topic của mình!
                     $comment['status'] = 1;
                 }
                 $comment['sender_user_id'] = User::id();
                 $comment['sender_user_name'] = User::user_name();
             } else {
                 $comment['sender_user_id'] = 0;
                 $comment['sender_user_name'] = $sender_user_name;
                 $comment['sender_email'] = $sender_email;
             }
             if ($comment_row && $comment_row['sender_user_id'] && $comment_row['sender_user_id'] != $item['user_id']) {
                 $comment['replied_user_id'] = $comment_row['sender_user_id'];
                 $comment['replied_user_name'] = $comment_row['sender_user_name'];
             } elseif ($comment_row && $comment_row['sender_user_id'] == $item['user_id']) {
                 $comment['replied_status'] = 1;
             }
             $id = DB::insert('comment', $comment);
             if ($id) {
                 if (!User::id()) {
                     AZLib::reload_captcha();
                 }
                 if ($parent_id) {
                     $re = DB::query("SELECT id FROM comment WHERE item_id = {$item['id']} AND parent_id = {$parent_id} AND display = 1 ORDER BY id DESC LIMIT 3,1");
                     if ($re) {
                         if ($row = mysql_fetch_assoc($re)) {
                             if ($row) {
                                 DB::query("UPDATE comment SET display = 0 WHERE parent_id = {$parent_id} AND display = 1 AND id<={$row['id']}");
                             }
                         }
                     }
                     if ($comment_id == $parent_id) {
                         if (User::is_login() && $item['user_id'] == User::id()) {
                             DB::query("UPDATE comment SET have_child = have_child + 1, order_time = " . time() . ", status=1 WHERE id = {$parent_id}");
                         } else {
                             DB::query("UPDATE comment SET have_child = have_child + 1, order_time = " . time() . " WHERE id = {$parent_id}");
                         }
                     } else {
                         DB::query("UPDATE comment SET have_child = have_child + 1, order_time = " . time() . " WHERE id = {$parent_id}");
                         if (User::is_login() && $item['user_id'] == User::id()) {
                             DB::query("UPDATE comment SET status=1 WHERE id = {$comment_id}");
                             //Cập nhật đã đọc - trả lời cho feed
                             DB::query("UPDATE feed SET status = 1 WHERE ref_id = {$comment_id} AND type=1");
                         }
                     }
                     if (User::is_login()) {
                         //Nếu là thành viên
                         //Cập nhật lại replied_status nếu chưa được check!
                         if ($item['user_id'] != User::id() && $comment_row['replied_user_id'] == User::id() && $comment_row['replied_status'] == 0) {
                             DB::query("UPDATE comment SET replied_status=1 WHERE id = {$comment_id}");
                             //Cập nhật đã đọc - trả lời cho feed
                             DB::query("UPDATE feed SET status = 1 WHERE ref_id = {$comment_id} AND type=2");
                             //Cập nhật comment mới cho chính mình
开发者ID:duynhan07,项目名称:elink,代码行数:67,代码来源:ajax_comment.ajax.php

示例2: fn_comment


//.........这里部分代码省略.........
     }
     if (!User::is_login()) {
         $captcha = AZLib::getParam('captcha');
         if (!isset($_SESSION["enbac_validate"]) || $captcha == '' || $captcha != $_SESSION["enbac_validate"]) {
             echo "<comments><content>false_captcha</content></comments>";
             exit;
         }
     }
     $content = preg_replace("/\n/", "<br />", $content);
     $content = str_replace('<br /><br />', '&nbsp;', $content);
     if ($comment_row) {
         if ($comment_row['parent_id']) {
             $parent_id = $comment_row['parent_id'];
             //$sender_user_name 	= $comment_row['sender_user_name'];
             $sender_user_name = User::user_name();
             if ($comment_row['sender_user_id']) {
                 $content = '@<a href="' . WEB_DIR . $comment_row['sender_user_name'] . '" class="fast_reply_link" title="' . $sender_user_name . '">' . $comment_row['sender_user_name'] . '</a>: ' . $content;
             } else {
                 $content = '<font color="#999">@<span style="text-decoration:underline">' . $sender_user_name . '</span> </font>: ' . $content;
             }
         } else {
             $parent_id = $comment_row['id'];
         }
     } else {
         $parent_id = 0;
     }
     // set guest cookie
     if (!User::id()) {
         $week = 60 * 60 * 24 * 365 + TIME_NOW;
         AZLib::my_setcookie("guest_name", $sender_user_name, $week);
         AZLib::my_setcookie("guest_email", $sender_email, $week);
     }
     $user_entry_comment = array('content' => $content, 'entry_id' => $user_entry['id'], 'time' => TIME_NOW, 'order_time' => TIME_NOW, 'post_ip' => AZLib::ip(), 'parent_id' => $parent_id, 'receiver_user_id' => $user_entry['user_id'], 'display' => 1, 'receiver_user_name' => $user_entry['user_name']);
     if (User::id()) {
         $user_entry_comment['sender_user_id'] = User::id();
     } else {
         $user_entry_comment['sender_user_id'] = 0;
         $user_entry_comment['sender_email'] = $sender_email;
     }
     $user_entry_comment['sender_user_name'] = $sender_user_name;
     if ($comment_row && $comment_row['sender_user_id'] && $comment_row['sender_user_id'] != $user_entry['user_id']) {
         //Lưu lại người được trả lời
         $user_entry_comment['replied_user_id'] = $comment_row['sender_user_id'];
         $user_entry_comment['replied_user_name'] = $comment_row['sender_user_name'];
     } elseif ($comment_row && $comment_row['sender_user_id'] == $user_entry['user_id']) {
         $user_entry_comment['replied_status'] = 1;
     }
     $id = DB::insert('user_entry_comment', $user_entry_comment);
     if ($id) {
         if (!User::id()) {
             AZLib::reload_captcha();
         }
         if ($parent_id) {
             $re = DB::query("SELECT id FROM user_entry_comment WHERE parent_id = {$parent_id} AND display = 1 ORDER BY id DESC LIMIT 3,1");
             if ($re) {
                 if ($row = mysql_fetch_assoc($re)) {
                     if ($row) {
                         DB::query("UPDATE user_entry_comment SET display = 0 WHERE parent_id = {$comment_id} AND display = 1 AND id<={$row['id']}");
                     }
                 }
             }
             if ($comment_id == $parent_id) {
                 if (User::is_login() && $user_entry['user_id'] == User::id()) {
                     DB::query("UPDATE user_entry_comment SET have_child = have_child + 1, order_time = " . time() . ", status=1 WHERE id = {$parent_id}");
                 } else {
                     DB::query("UPDATE user_entry_comment SET have_child = have_child + 1, order_time = " . time() . " WHERE id = {$parent_id}");
                 }
             } else {
                 DB::query("UPDATE user_entry_comment SET have_child = have_child + 1, order_time = " . time() . " WHERE id = {$parent_id}");
                 if (User::is_login() && $user_entry['user_id'] == User::id()) {
                     DB::query("UPDATE user_entry_comment SET status=1 WHERE id = {$comment_id}");
                 }
             }
             //Cập nhật đã đọc - trả lời cho feed
             DB::query("UPDATE feed SET status = 1 WHERE ref_id = {$comment_id} AND type=5");
             //Cập nhật lại replied_status nếu chưa được check!
             if (User::is_login() && $comment_row['replied_user_id'] == User::id() && $comment_row['replied_status'] == 0) {
                 DB::query("UPDATE user_entry_comment SET replied_status=1 WHERE id = {$comment_id}");
                 //Cập nhật đã đọc - trả lời cho feed
                 DB::query("UPDATE feed SET status = 1 WHERE ref_id = {$comment_id} AND type=6");
             }
         }
     }
     $total_feedback = DB::count('user_entry_comment', 'entry_id="' . $user_entry['id'] . '"');
     DB::update_id('user_entry', array('reply_count' => $total_feedback), $user_entry['id']);
     $xml = "<comments><content><![CDATA[" . AZLib::parseBBCode($content) . "]]></content><post_time>vài giây trước</post_time>";
     $xml .= "<id>" . $id % 3 . "</id><parent_id>{$parent_id}</parent_id></comments>";
     echo $xml;
     $user_item = User::getUser($user_entry['user_id']);
     if ($user_item && $user_item['email'] && $user_item['email_alert'] && $user_item['id'] != User::id()) {
         if (User::id()) {
             $sender_email = '';
         }
         $link = WEB_ROOT . '?page=user_entry&user_name=' . $user_entry['user_name'] . '&cmd_entry=view&entry_id=' . $user_entry['id'] . '&ebname=' . AZLib::safe_title($user_entry['title']);
         $link = AZRewrite::formatUrl($link);
         $title = "<a href='{$link}' target='_blank' style='text-decoration:none;color:#003399;'><font color='#003399'>{$user_entry['title']}</font></a>";
         AZLib::addCronJob('entry_comment', AZLib::parseBBCode($content, true), $user_item['id'], User::id() ? User::user_name() : $sender_user_name, $sender_email, $user_entry['id'], $title, $link);
     }
     System::halt();
 }
开发者ID:duynhan07,项目名称:elink,代码行数:101,代码来源:ajax_shop.ajax.php


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