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


PHP UserClass::get_avatar方法代码示例

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


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

示例1: get_comments

 public function get_comments($act_id)
 {
     $query_str = "select * from cs_activity_comment where act_id={$act_id} order by create_at desc;";
     $result = $this->dbObj->query($query_str);
     $array = array();
     if (is_object($result)) {
         if ($result->num_rows > 0) {
             while ($row = $result->fetch_assoc()) {
                 $array[] = $row;
             }
         }
     }
     $userObj = new UserClass();
     foreach ($array as $key => $item) {
         $author_id = $item['author_id'];
         $query_str = "select name from cs_user where uid={$author_id};";
         $user = $this->dbObj->query($query_str)->fetch_assoc();
         $array[$key]['author_name'] = $user['name'];
         $array[$key]['author_avatar'] = $userObj->get_avatar($author_id);
         $array[$key]['create_at'] = $this->encode_time($item['create_at']);
     }
     return $array;
 }
开发者ID:Knightnoob,项目名称:cs-xiyoulinux,代码行数:23,代码来源:activity.class.php

示例2: get_activity

 public function get_activity($arg, $arg1, $arg2 = "", $arg3 = "")
 {
     switch ($arg) {
         case 'index':
             $query_str = "select * from cs_activity order by mid desc limit {$arg1}," . ($arg1 + 1) . ";";
             break;
         case 'mid':
             $query_str = "select * from cs_activity where mid<{$arg1} order by mid desc limit {$arg2}," . ($arg2 + 1) . ";";
             break;
         case 'uid':
             $query_str = "select * from cs_activity where uid={$arg1} order by mid desc limit {$arg2}," . ($arg2 + 1) . " ;";
             break;
         case 'uid_mid':
             $query_str = "select * from cs_activity where uid={$arg1} and mid<{$arg2} order by mid desc limit {$arg3}," . ($arg3 + 1) . " ;";
             break;
         default:
             return false;
             break;
     }
     $mresult = $this->dbObj->query($query_str)->fetch_assoc();
     if (!isset($mresult['uid'])) {
         return false;
     }
     $uid = $mresult['uid'];
     $mid = $mresult['mid'];
     $href = $mresult['href'];
     $query_str = "select name from cs_user where uid={$uid};";
     $uresult = $this->dbObj->query($query_str)->fetch_assoc();
     $name = $uresult['name'];
     $action = json_decode($mresult['action']);
     $action_text = $action->{'text'};
     $action_color = $action->{'color'};
     $des = $mresult['mdescribe'];
     $message = $mresult['message'];
     $userObj = new UserClass();
     $avatar = $userObj->get_avatar($uid);
     date_default_timezone_set("PRC");
     $a = strtotime($mresult['rdate']);
     $b = time() - $a;
     if ($b < 1 * 60) {
         $time = $b - floor($b / 60) * 60 . "秒前";
     } else {
         if ($b <= 5 * 60) {
             $time = floor($b / 60) . "分钟" . ($b - floor($b / 60) * 60) . "秒前";
         } else {
             if ($b < 1 * 3600) {
                 $time = floor($b / 60) . "分钟前";
             } else {
                 if ($b < 24 * 3600) {
                     $time = floor($b / 3600) . "小时前";
                 } else {
                     if ($b <= 24 * 3600 * 7) {
                         $time = floor($b / 3600 / 24) . "天前";
                     } else {
                         $time = $mresult['rdate'];
                     }
                 }
             }
         }
     }
     $array = array("name" => $name, "actiontext" => $action_text, "actioncolor" => $action_color, "mdescribe" => $des, "message" => $message, "time" => $time, "avatar" => $avatar, "mid" => $mid, "profile" => "profile.php?uid=" . $uid, "href" => $href);
     return $array;
 }
开发者ID:scentsoul,项目名称:cs-xiyoulinux,代码行数:63,代码来源:activity.class.php

示例3: dirname

}
require_once dirname(__FILE__) . '/smarty.php';
require_once dirname(__FILE__) . '/includes/mail.class.php';
require_once dirname(__FILE__) . '/includes/user.class.php';
require_once dirname(__FILE__) . '/includes/plugin.class.php';
setcookie('uid', $_SESSION['uid'], time() + 3600);
$login_uid = $_SESSION['uid'];
$_COOKIE['uid'] = $login_uid;
//获取登录用户信息
$CUser = new UserClass();
//获取登录用户名
$json_str = $CUser->get_userinfo($login_uid);
$user_obj = json_decode($json_str);
$username = $user_obj[0]->name;
//获取登录用户头像
$user_avatar = $CUser->get_avatar($login_uid);
//获取登录用户权限
$user_privilege = $CUser->get_privilege($_SESSION['uid']);
//获取站内信信息
$CMail = new MailClass($login_uid);
//获取未读站内信数量
$json_str = $CMail->get_mail_count();
$result_array = json_decode($json_str);
$unread_mail_count = $result_array->unread;
//获取站内信数组
$json_str = $CMail->get_mail_list(1);
$unread_mail_array = json_decode($json_str);
$unread_mail_list = array();
if (!isset($unread_mail_array->result)) {
    foreach ($unread_mail_array as $mail_obj) {
        $fromuser_avatar = $CUser->get_avatar($mail_obj->fromuid);
开发者ID:Knightnoob,项目名称:cs-xiyoulinux,代码行数:31,代码来源:init.php

示例4: UserClass

error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
require_once 'init.php';
require_once 'includes/activity.class.php';
$login_uid = $_COOKIE['uid'];
if (isset($_GET['uid'])) {
    $info_uid = $_GET["uid"];
} else {
    $info_uid = $login_uid;
}
$userObj = new UserClass();
$json = $userObj->get_userinfo($info_uid);
$result = json_decode($json, true);
$user_info = $result[0];
$user_info["issame"] = $info_uid == $login_uid;
$user_info['uid'] = $info_uid;
$user_info['avatar'] = $userObj->get_avatar($info_uid);
$activityObj = new ActivityClass();
for ($i = 0; $i < 10; ++$i) {
    $tmp = $activityObj->get_activity('uid', $info_uid, $i);
    if ($tmp == false) {
        break;
    }
    $activity_list[] = $tmp;
}
$sql = "SELECT uid, password FROM cs_user WHERE uid=" . $info_uid . ";";
$dbObj = new DBClass();
$result = $dbObj->query($sql);
$result_info = $result->fetch_assoc();
$temp_time = (string) (time() + 24 * 3600);
$temp_str = $result_info['uid'] . $result_info['password'] . $temp_time;
$token = md5($temp_str);
开发者ID:Knightnoob,项目名称:cs-xiyoulinux,代码行数:31,代码来源:profile.php

示例5: get_my_list

 public function get_my_list($uid)
 {
     $sql = "SELECT * FROM `app_lecture_info` WHERE uid = {$uid};";
     $result = $this->Csdb->query($sql);
     if ($result->num_rows <= 0) {
         if (is_object($result)) {
             $result->close();
         }
         return false;
     } else {
         $lecture_list = array();
         while ($row = $result->fetch_assoc()) {
             $CUser = new UserClass();
             $json_str = $CUser->get_userinfo($row["uid"]);
             $author = json_decode($json_str);
             $row["lecture_author"] = $author[0]->name;
             $row["lecture_author_avatar"] = $CUser->get_avatar($row["uid"]);
             array_push($lecture_list, $row);
         }
         return $lecture_list;
     }
 }
开发者ID:Knightnoob,项目名称:cs-xiyoulinux,代码行数:22,代码来源:lecture.class.php

示例6: array

        $smarty->assign('quesnum', $result->num_rows);
    }
    $searcharray[] = array("picture" => "", "href" => "", "title" => "", "writer" => "", "answer" => "没有相关搜索结果。。。", "time" => "");
    /*if($mansql->num_rows==0)
      {
      $smarty->assign('mannum', $result->num_rows);
          $manArray[] = array("type"=>"","manhref"=>"","manname"=>"", "inf"=>"无相关人物信息");
      }*/
} else {
    $smarty->assign('quesnum', $result->num_rows);
    while ($row = $result->fetch_assoc()) {
        $uid = $row['uid'];
        $sql = "select * from `cs_user` where uid = '{$uid}'";
        $namesql = $dbObj->query($sql);
        $rowi = $namesql->fetch_assoc();
        $image = $userObj->get_avatar($uid);
        $writerhref = "profile.php?uid=" . $uid;
        $searcharray[] = array("picture" => "{$image}", "writerhref" => $writerhref, "href" => $row['href'], "title" => $row['mdescribe'], "writer" => $rowi['name'], "answer" => $row['message'], "time" => $row['rdate']);
        /*  if(in_array($uid,$uidarray))
             {
               continue;
             }
             $uidarray[] = $uid;
             if(check_online($uid))
             {
                     $type = "text-success";
             }
             else
             {
                     $type = "";
             }
开发者ID:Knightnoob,项目名称:cs-xiyoulinux,代码行数:31,代码来源:search.php


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