当前位置: 首页>>代码示例>>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;未经允许,请勿转载。