當前位置: 首頁>>代碼示例>>PHP>>正文


PHP users::getuserinfoById方法代碼示例

本文整理匯總了PHP中users::getuserinfoById方法的典型用法代碼示例。如果您正苦於以下問題:PHP users::getuserinfoById方法的具體用法?PHP users::getuserinfoById怎麽用?PHP users::getuserinfoById使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在users的用法示例。


在下文中一共展示了users::getuserinfoById方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: approveUpdate

 public function approveUpdate($id)
 {
     global $mysql, $data, $item, $langArray, $meta, $config;
     $setQuery = '';
     if (isset($_POST['price']) && is_numeric($_POST['price']) && $_POST['price'] != '0') {
         $_POST['price'] = str_replace(',', '.', $_POST['price']);
         $setQuery .= " `price` = '" . sql_quote($_POST['price']) . "', ";
     }
     //獲取當前作品曆史數據
     $mysql->query("\n\t\t\tSELECT *\n\t\t\tFROM `temp_items`\n\t\t\tWHERE `item_id` = '" . intval($item['id']) . "'\n\t\t\tLIMIT 1\n\t\t");
     $temp_item_data = $mysql->fetch_array();
     //獲取作品信息
     $item_info = $this->get($item['id']);
     //檢測縮略圖更新狀態
     if (!empty($temp_item_data['thumbnail'])) {
         $setQuery .= " `thumbnail` = '" . sql_quote($temp_item_data['thumbnail']) . "', ";
         unlink(DATA_SERVER_PATH . '/uploads/' . $this->uploadFileDirectory . $item['id'] . '/' . $item_info["thumbnail"]);
     }
     //檢測封麵更新狀態
     if (!empty($temp_item_data['first_preview'])) {
         $setQuery .= " `theme_preview` = '" . sql_quote($temp_item_data['first_preview']) . "', ";
         unlink(DATA_SERVER_PATH . '/uploads/' . $this->uploadFileDirectory . $item['id'] . '/' . $item_info["theme_preview"]);
     }
     //檢測文件包更新狀態
     if (!empty($temp_item_data['main_file'])) {
         $setQuery .= " `main_file` = '" . sql_quote($temp_item_data['main_file']) . "', ";
         $setQuery .= " `main_file_name` = '" . sql_quote($temp_item_data['main_file_name']) . "', ";
         unlink(DATA_SERVER_PATH . '/uploads/' . $this->uploadFileDirectory . $item['id'] . '/' . $item_info["main_file"]);
     }
     //刪除原預覽圖
     $preview_arr = json_decode($temp_item_data['theme_preview'], 1);
     if (!empty($preview_arr) && is_array($preview_arr)) {
         $base_dir = DATA_SERVER_PATH . '/uploads/' . $this->uploadFileDirectory . $item['id'] . '/preview/';
         foreach ($preview_arr as $dir) {
             $file_info = pathinfo($dir);
             $file = $base_dir . $file_info['basename'];
             //刪除文件
             unlink($file);
         }
     }
     //更改作品狀態
     $mysql->query("\n\t\t\tUPDATE `items`\n\t\t\tSET {$setQuery}\n\t\t\t `status` = 'active'\n\t\t\tWHERE `id` = '" . intval($item['id']) . "'\n\t\t\tLIMIT 1\n\t\t");
     //更新預覽圖狀態
     $sql = " `status` = 1";
     $this->update_preview_by_upload_queue($item['id'], $sql);
     //獲取用戶信息
     require_once ROOT_PATH . '/apps/users/models/users.class.php';
     $user = new users();
     $user_info = $user->getuserinfoById($item['user_id']);
     //通過用戶id獲取關聯客服
     //            require_once ROOT_PATH.'/apps/service/models/service.class.php';
     //            $service = new service();
     //            $theservice = $service->getserviceByuserid($item['user_id']);
     //            $item_url = $config['domain'].'/'.$languageURL.'items/'.$item['id'];
     //            $item_url = '<a href="'.$item_url.'" target="_blank">'.$item_url.'</a>';
     //            #給用戶發郵件
     //            require_once ENGINE_PATH.'/classes/email.class.php';
     //            $emailClass = new email();
     //
     //            $emailClass->fromEmail = 'no-reply@'.$config['domain'];
     //            $emailClass->contentType = 'text/html';
     //            $emailClass->subject = '你的作品['.$item['name'].']更新審核通過啦!';
     //            $emailClass->message = 'Hi!['.$user_info['username'].']:<br />
     //								&nbsp;&nbsp;&nbsp;&nbsp;恭喜你的作品更新審核通過啦!<br />
     //								&nbsp;&nbsp;&nbsp;&nbsp;作品名稱:['.$item['name'].']<br />
     //								&nbsp;&nbsp;&nbsp;&nbsp;作品地址:['.$item_url.']<br />
     //								&nbsp;&nbsp;&nbsp;&nbsp;又可以賺錢啦!<br />
     //                                <br />
     //								&nbsp;&nbsp;&nbsp;&nbsp;專屬小編:['.$theservice['user_name'].']<br />
     //								&nbsp;&nbsp;&nbsp;&nbsp;['.$meta['meta_title'].']<br />
     //								&nbsp;&nbsp;&nbsp;&nbsp;['.date('Y-m-d H:i:s',time()).']<br />';
     //        require_once ROOT_PATH.'/apps/system/models/system.class.php';
     //        $system = new system();
     //        $smtp = $system ->is_smtp();
     //        $smtpconf=$system->getAllKeyValue();
     //        if($smtp){
     //            $emailClass->email_sock($smtpconf["smtp_host"],$smtpconf["smtp_port"],0,'error',10,1,$smtpconf["smtp_user"],$smtpconf["smtp_pass"],$smtpconf["smtp_from"]);
     //            $emailClass->send_mail_sock($emailClass->subject,$emailClass->message,$user_info['email'],$smtpconf["smtp_from_name"]) ;
     //            unset($emailClass);
     //        }else {
     //            $emailClass->to($user_info['email']);
     //            $emailClass->send();
     //            unset($emailClass);
     //        }
     $this->deleteUpdate($item['id']);
     return true;
 }
開發者ID:yunsite,項目名稱:demila,代碼行數:87,代碼來源:items.class.php

示例2: IN

            array_shift($categoryParent);
            $whereQuery = " AND `id` IN (SELECT `item_id` FROM `items_to_category` WHERE `categories` LIKE '%," . intval($categoryID) . ",%') ";
        } else {
            $categoryParent = array('data' => '');
        }
        require_once ROOT_PATH . '/apps/items/models/items.class.php';
        require_once ROOT_PATH . '/apps/users/models/users.class.php';
        $itemsClass = new items();
        $users = new users();
        $order = '`datetime` DESC';
        $items = $itemsClass->getAll(0, 40, " `status` = 'active' " . $whereQuery, $order);
        $categories = $categoriesClass->getAll();
        $res_data = array();
        foreach ($items as $data) {
            //用戶信息
            $user_info = $users->getuserinfoById($data['user_id']);
            $data['user_info']['item-author'] = $user_info['nickname'];
            $item_categories = array();
            foreach ($data['categories'] as $cat) {
                foreach ($cat as $c_cat) {
                    $item_categories[] = $categories[$c_cat]['name'];
                }
            }
            $data['item_categories'] = $item_categories;
            $res_data[] = $data;
        }
        echo json_encode(array('data' => $res_data));
    } else {
        echo json_encode(array('data' => ''));
    }
} else {
開發者ID:yunsite,項目名稱:demila,代碼行數:31,代碼來源:categories.php


注:本文中的users::getuserinfoById方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。