本文整理汇总了PHP中AZLib::isBlackList方法的典型用法代码示例。如果您正苦于以下问题:PHP AZLib::isBlackList方法的具体用法?PHP AZLib::isBlackList怎么用?PHP AZLib::isBlackList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AZLib
的用法示例。
在下文中一共展示了AZLib::isBlackList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: transaction
function transaction()
{
// viet luu but
header("Content-type: application/xml");
if (!User::is_login()) {
echo "<comments><content>no_login</content></comments>";
exit;
} else {
if (User::is_block()) {
echo "<comments><content>no_perm</content></comments>";
exit;
}
if (AZLib::isBlackList(User::$current->data['id'], AZLib::getParam('user_id'))) {
echo "<comments><content>blacklist</content></comments>";
exit;
}
if (AZLib::checkBadWord(AZLib::getParam('content'))) {
echo "<comments><content>bad_word</content></comments>";
exit;
}
$user_id = AZLib::getParam('user_id');
if (!($user = User::getUser($user_id))) {
echo "<comments><content>no_perm</content></comments>";
exit;
}
$content = preg_replace("/\n/", "<br />", Url::get('content'));
$content = str_replace('<br /><br />', ' ', $content);
$comment_content = $content;
$id = DB::insert('comment_user', array('content' => $comment_content, 'time' => TIME_NOW, 'post_ip' => AZLib::ip(), 'sender_user_id' => User::id(), 'sender_user_name' => User::user_name(), 'receiver_user_id' => $user['id'], 'receiver_user_name' => $user['user_name'], 'is_read' => 0));
if ($id) {
DB::query('UPDATE user set total_comment_user=total_comment_user+1 WHERE id=' . $user['id']);
// so luu but
User::getUser($user['id'], 0, 1);
if ($user['email'] && $user['email_alert'] && $user['id'] != User::id()) {
//Add to cron job:
$link = WEB_ROOT . AZRewrite::formatUrl('?page=shop&user_name=' . $user['user_name'] . '&mode=comment');
AZLib::addCronJob('user_comment', AZLib::parseBBCode($comment_content, true), $user['id'], User::user_name(), '', 0, '', $link);
}
}
$time = $up_time = date('H:i | ');
$xml = "<comments><content><![CDATA[" . AZLib::parseBBCode($comment_content) . "]]></content><post_time>{$time}</post_time></comments>";
echo $xml;
System::halt();
}
}
示例2: feedback
function feedback()
{
header("Content-type: application/xml");
$pattern = '/^xe360/i';
$content = trim(AZLib::getParam('content'));
$comment_id = (int) Url::get('comment_id', 0);
$sender_user_name = trim(AZLib::getParam('user_name'));
$sender_email = trim(AZLib::getParam('sender_email'));
$comment_row = array();
if (isset($_COOKIE['setTimeOutComment'])) {
if (time() - $_COOKIE['setTimeOutComment'] <= 30) {
// 30 giay
echo "<comments><content>time_out</content></comments>";
exit;
}
} else {
AZLib::my_setcookie("setTimeOutComment", time(), 30 + TIME_NOW);
// 30 giay
}
if (preg_match($pattern, $sender_user_name) || preg_match($pattern, $sender_email) || preg_match($pattern, $content)) {
echo "<comments><content>bad_word</content></comments>";
exit;
}
if (User::is_login() && User::is_block()) {
echo "<comments><content>no_perm</content></comments>";
exit;
}
if ($comment_id) {
$comment_row = DB::select('comment', "id={$comment_id}");
if (!$comment_row) {
echo "<comments><content>no_perm</content></comments>";
exit;
}
if (User::is_login() && $comment_row['sender_user_id'] == User::id()) {
//Không được trả lời cho chính mình!
echo "<comments><content>no_perm</content></comments>";
exit;
}
if (!($item = Item::get_item($comment_row['item_id']))) {
echo "<comments><content>no_perm</content></comments>";
exit;
}
} else {
$item_id = (int) Url::get('item_id', 0);
if (!$item_id || !($item = Item::get_item($item_id))) {
echo "<comments><content>no_perm</content></comments>";
exit;
}
}
$item_memcache = $item;
if (AZLib::isBlackList(User::id(), $item['user_id'])) {
echo "<comments><content>blacklist</content></comments>";
exit;
}
if (!User::is_login() && AZLib::checkBadWord($sender_user_name)) {
echo "<comments><content>bad_word</content></comments>";
exit;
}
if ($item["state"] == 1 && !User::have_permit(ADMIN_ITEM)) {
echo "<comments><content>no_perm</content></comments>";
exit;
}
$username = strtolower($sender_user_name);
if (!User::is_login() && (strlen($username) < 3 || strlen($sender_email) < 3 || $username == 'admin' || $username == 'administrator' || $username == 'moderator' || $username == 'enbac')) {
echo "<comments><content>bad_word</content></comments>";
exit;
}
if (AZLib::checkBadWord($content)) {
echo "<comments><content>bad_word</content></comments>";
exit;
}
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 />', ' ', $content);
$receiver_user_id = 0;
$receiver_username = '';
if ($comment_id) {
if ($comment_row['parent_id']) {
$receiver_user_id = $comment_row['sender_user_id'];
$receiver_username = $comment_row['sender_user_name'];
if ($receiver_user_id) {
$content = '@<a href="' . WEB_DIR . $receiver_username . '" class="fast_reply_link" title="' . $receiver_username . '">' . $receiver_username . '</a>: ' . $content;
} else {
$content = '<font color="#999">@<span style="text-decoration:underline">' . $receiver_username . '</span> </font>: ' . $content;
}
$parent_id = $comment_row['parent_id'];
} else {
$parent_id = $comment_row['id'];
}
} else {
$parent_id = 0;
}
$user_item = User::getUser($item['user_id']);
if ($user_item) {
//.........这里部分代码省略.........
示例3: 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;
}
示例4: fn_comment
function fn_comment()
{
header("Content-type: application/xml");
$content = trim(AZLib::getParam('content'));
$comment_id = (int) Url::get('comment_id', 0);
$comment_row = array();
if ($content == '') {
echo "<comments><content>no_perm</content></comments>";
exit;
}
if (User::is_login()) {
if (User::is_block()) {
echo "<comments><content>no_perm</content></comments>";
exit;
}
$sender_user_name = User::user_name();
$sender_email = '';
} else {
$sender_user_name = AZLib::getParam('user_name');
$sender_email = AZLib::getParam('sender_email', '');
$username_lower = strtolower($sender_user_name);
if (strlen($username_lower) < 3 || $username_lower == 'admin' || $username_lower == 'administrator' || $username_lower == 'moderator' || $username_lower == 'enbac') {
echo "<comments><content>bad_word</content></comments>";
exit;
}
}
if ($comment_id) {
$comment_row = DB::select("user_entry_comment", "id={$comment_id}");
if (!$comment_row || $comment_row && User::is_login() && $comment_row['sender_user_id'] == User::id()) {
//Không được trả lời cho chính mình!
echo "<comments><content>no_perm</content></comments>";
exit;
}
$entry_id = $comment_row['entry_id'];
} else {
$entry_id = (int) Url::get('entry_id', 0);
}
if (!$entry_id || !($user_entry = DB::select('user_entry', "id={$entry_id}"))) {
echo "<comments><content>no_perm</content></comments>";
exit;
}
if (User::is_login() && AZLib::isBlackList(User::id(), $user_entry['user_id'])) {
echo "<comments><content>blacklist</content></comments>";
exit;
}
if (!User::is_login() && AZLib::checkBadWord($sender_user_name) || AZLib::checkBadWord($content)) {
echo "<comments><content>bad_word</content></comments>";
exit;
}
if (AZLib::checkBadWord($content)) {
echo "<comments><content>bad_word</content></comments>";
exit;
}
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 />', ' ', $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);
//.........这里部分代码省略.........