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


PHP AZLib::BBCode方法代码示例

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


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

示例1: edit_user_info

 function edit_user_info()
 {
     $user_id = (int) Url::get('user_id', 0);
     $info = AZLib::getParam('id');
     $value = AZLib::getParam('value');
     $input = array();
     $output = '';
     if ($user_id && (User::have_permit(ADMIN_USER) || User::id() == $user_id && !User::is_block())) {
         if ($info == 'up_item') {
             if (User::is_admin()) {
                 $user = DB::select('user', "id={$user_id}");
                 if (User::is_root()) {
                     $value = (int) $value;
                     $input = array('up_item' => $value > 0 ? $value : 0);
                     $output = '<b>' . $value . '</b>';
                     echo $output;
                     $admin = User::$current->data;
                     if ($user) {
                         $up_count = $value - $user['up_item'];
                         if ($up_count != 0) {
                             //type: 0:Tiền mặt; 1:thu tại nhà; 2:chuyển khoản; 3:Free, KM; 8:Online
                             $up_log_sql = "INSERT INTO up_log (`user_id`,\t`user_name`,\t\t\t`admin_id`,\t\t`admin_name`,\t\t\t`time`,\t `up_count`,`up_before`,\t\t`up_after`,\t`price`,\t`type`,\t\t`note`)\r\n\t                                                VALUES ({$user['id']},\t'{$user['user_name']}',{$admin['id']},\t'{$admin['user_name']}'," . TIME_NOW . ",{$up_count},'{$user['up_item']}',{$value},\t\t0,\t\t\t3,\t\t\t'')";
                             DB::query($up_log_sql);
                             if ($up_count > 0) {
                                 $update = DB::query('UPDATE user SET up_item=up_item + ' . $up_count . ' WHERE id=' . $user_id);
                             } else {
                                 $update = DB::query('UPDATE user SET up_item=up_item - ' . abs($up_count) . ' WHERE id=' . $user_id);
                             }
                             //DB::Update('user',$input,"id=$user_id");
                             User::getUser($user_id, 0, 1);
                         }
                     }
                 } else {
                     $output = "<b>" . (int) $user['up_item'] . "</b>";
                     echo $output;
                 }
                 exit;
             } else {
                 $output = '<b>' . $value . '</b>';
                 echo $output;
                 exit;
             }
         } elseif (!AZLib::checkBadWord($value) || User::have_permit(ADMIN_USER)) {
             $output = 'Ch&#7913;c n&#259;ng n&#224;y &#273;ang &#273;&#432;&#7907;c b&#7893; sung. &#7844;n F5 &#273;&#7875; t&#7843;i l&#7841;i trang.';
             if ($info == 'blast') {
                 $input = array('blast' => $value);
                 $userblast = ' ' . AZLib::BBCode(AZLib::cleanHtml($value));
                 if (strpos($userblast, 'http://')) {
                     $user_blast = $userblast;
                     while (strpos($user_blast, 'http://')) {
                         $tmp = substr($user_blast, strpos($user_blast, 'http://'));
                         if (strpos($tmp, ' ') || strpos($tmp, '<')) {
                             if (strpos($tmp, ' ') && strpos($tmp, '<') && strpos($tmp, ' ') > strpos($tmp, '<')) {
                                 $blast_url = substr($tmp, 0, strpos($tmp, '<'));
                             } else {
                                 $blast_url = substr($tmp, 0, strpos($tmp, ' '));
                             }
                         } else {
                             $blast_url = $tmp;
                         }
                         $user_blast = str_replace($blast_url, '', $user_blast);
                     }
                     $new_blast_url = ' <a href="' . $blast_url . '" target="_blank">Click here</a>';
                     $userblast = substr($user_blast . $new_blast_url, 1);
                 }
                 $user = User::getUser($user_id);
                 if ($value) {
                     //blast không trống
                     if ($value != $user['blast']) {
                         //Thay đổi blast
                         DB::delete("feed", "user_id={$user_id} AND type = 8");
                         //thêm vào feed cho các thành viên theo đuôi
                         DB::query("INSERT INTO \tfeed \t(type, \tuser_id,  act_user_id,  time)\r\n                                                    VALUES\t(8,\t\t{$user_id}, {$user_id}, " . TIME_NOW . ")");
                     }
                 } else {
                     //Xoá blast
                     DB::delete("feed", "user_id={$user_id} AND type = 8");
                 }
                 $output = $userblast . ' <img src="style/images/icon/icon_edit.gif" title="Click để sửa..." alt="Click để sửa..." class="hand_point" rel="blast" align="absmiddle">';
             } elseif ($info == 'address') {
                 $input = array('address' => trim($value));
                 $output = AZLib::word_limit($value, 12, '');
             } elseif ($info == 'mobile_phone') {
                 $value = preg_replace("/[^0-9]/", "", $value);
                 if (!AZLib::is_mobile($value)) {
                     $value = '';
                 }
                 $input = array('mobile_phone' => trim($value));
                 $output = AZLib::word_limit($value, 10, '');
             } elseif ($info == 'home_phone') {
                 if (User::have_permit(ADMIN_USER) || User::$current->data['phone_verify'] == 0) {
                     $value = preg_replace("/[^0-9]/", "", $value);
                     if (AZLib::is_mobile($value) || substr($value, 0, 1) != "0") {
                         $value = '';
                     }
                     $input = array('home_phone' => trim($value));
                     $output = AZLib::word_limit($value, 10, '');
                 }
             } elseif ($info == 'yahoo_id') {
                 $input = array('yahoo_id' => trim($value));
//.........这里部分代码省略.........
开发者ID:duynhan07,项目名称:elink,代码行数:101,代码来源:ajax_user.ajax.php


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