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


PHP cmsUser::getUserAvatarUrl方法代码示例

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


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

示例1: mod_user_friend

function mod_user_friend($mod, $cfg)
{
    $inDB = cmsDatabase::getInstance();
    $inUser = cmsUser::getInstance();
    if (!$inUser->id) {
        return false;
    }
    if ($cfg['view_type'] == 'table') {
        $sql = "SELECT\r\n                CASE\r\n                WHEN f.from_id = {$inUser->id}\r\n                THEN f.to_id\r\n                WHEN f.to_id = {$inUser->id}\r\n                THEN f.from_id\r\n                END AS user_id, u.login, u.nickname, u.is_deleted, p.imageurl\r\n                FROM cms_user_friends f\r\n                INNER JOIN cms_online o ON o.user_id = CASE WHEN f.from_id = {$inUser->id} THEN f.to_id WHEN f.to_id = {$inUser->id} THEN f.from_id END\r\n                LEFT JOIN cms_users u ON u.id = o.user_id\r\n                LEFT JOIN cms_user_profiles p ON p.user_id = u.id\r\n                WHERE (from_id = {$inUser->id} OR to_id = {$inUser->id}) AND is_accepted =1 LIMIT " . $cfg['limit'];
    } else {
        $sql = "SELECT\r\n                CASE\r\n                WHEN f.from_id = {$inUser->id}\r\n                THEN f.to_id\r\n                WHEN f.to_id = {$inUser->id}\r\n                THEN f.from_id\r\n                END AS user_id, u.login, u.nickname\r\n                FROM cms_user_friends f\r\n                INNER JOIN cms_online o ON o.user_id = CASE WHEN f.from_id = {$inUser->id} THEN f.to_id WHEN f.to_id = {$inUser->id} THEN f.from_id END\r\n                LEFT JOIN cms_users u ON u.id = o.user_id\r\n                WHERE (from_id = {$inUser->id} OR to_id = {$inUser->id}) AND is_accepted =1 LIMIT " . $cfg['limit'];
    }
    $result = $inDB->query($sql);
    $total = $inDB->num_rows($result);
    if ($total) {
        $friends = array();
        while ($friend = $inDB->fetch_assoc($result)) {
            $friend['avatar'] = $cfg['view_type'] == 'table' ? cmsUser::getUserAvatarUrl($friend['user_id'], 'small', $friend['imageurl'], $friend['is_deleted']) : false;
            $friend['user_link'] = cmsUser::getProfileLink($friend['login'], $friend['nickname']);
            $friends[$friend['user_id']] = $friend;
        }
    }
    cmsPage::initTemplate('modules', $cfg['tpl'])->assign('friends', $friends)->assign('total', $total)->assign('cfg', $cfg)->display($cfg['tpl']);
    return true;
}
开发者ID:deltas1,项目名称:icms1,代码行数:25,代码来源:module.php

示例2: mod_user_friend

function mod_user_friend($mod, $cfg) {
    if (!cmsCore::c('user')->id) {
        return false;
    }

    if ($cfg['view_type'] == 'table') {
        $sql = "SELECT
                CASE
                WHEN f.from_id = ". cmsCore::c('user')->id ."
                THEN f.to_id
                WHEN f.to_id = ". cmsCore::c('user')->id ."
                THEN f.from_id
                END AS user_id, u.login, u.nickname, u.is_deleted, p.imageurl
                FROM cms_user_friends f
                INNER JOIN cms_online o ON o.user_id = CASE WHEN f.from_id = ". cmsCore::c('user')->id ." THEN f.to_id WHEN f.to_id = ". cmsCore::c('user')->id ." THEN f.from_id END
                LEFT JOIN cms_users u ON u.id = o.user_id
                LEFT JOIN cms_user_profiles p ON p.user_id = u.id
                WHERE (from_id = ". cmsCore::c('user')->id ." OR to_id = ". cmsCore::c('user')->id .") AND is_accepted =1 LIMIT ". $cfg['limit'];
    } else {
        $sql = "SELECT
                CASE
                WHEN f.from_id = ". cmsCore::c('user')->id ."
                THEN f.to_id
                WHEN f.to_id = ". cmsCore::c('user')->id ."
                THEN f.from_id
                END AS user_id, u.login, u.nickname
                FROM cms_user_friends f
                INNER JOIN cms_online o ON o.user_id = CASE WHEN f.from_id = ". cmsCore::c('user')->id ." THEN f.to_id WHEN f.to_id = ". cmsCore::c('user')->id ." THEN f.from_id END
                LEFT JOIN cms_users u ON u.id = o.user_id
                WHERE (from_id = ". cmsCore::c('user')->id ." OR to_id = ". cmsCore::c('user')->id .") AND is_accepted =1 LIMIT ". $cfg['limit'];
    }

    $result = cmsCore::c('db')->query($sql) ;
    $total  = cmsCore::c('db')->num_rows($result);

    if ($total) {
        $friends = array();
        while ($friend = cmsCore::c('db')->fetch_assoc($result)) {
            $friend['avatar'] = ($cfg['view_type'] == 'table') ? cmsUser::getUserAvatarUrl($friend['user_id'], 'small', $friend['imageurl'], $friend['is_deleted']) : false;
            $friend['user_link'] = cmsUser::getProfileLink($friend['login'], $friend['nickname']);
            $friends[$friend['user_id']] = $friend;
        }
    }

    cmsPage::initTemplate('modules', $cfg['tpl'])->
        assign('friends', $friends)->
        assign('total', $total)->
        assign('cfg', $cfg)->
        display();

    return true;
}
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:52,代码来源:module.php

示例3: mod_respect

function mod_respect($mod, $cfg) {
    $cfg = array_merge(array(
        'view_aw'     => 0,
        'limit'       => 5,
        'order'       => 'desc',
        'show_awards' => 1
    ), $cfg);

    if ($cfg['order'] == 'rand') {
        $order_sql = 'RAND()';
    } else {
        $order_sql = 'awards_count DESC';
    }
    
    if (!$cfg['view_aw']) {
        $view_sql = '';
    } else {
        $view_sql = " AND a.title = '". $cfg['view_aw'] ."'";
    }

    $sql = "SELECT u.id, u.nickname, u.login, COUNT(a.id) as awards_count, p.imageurl, u.is_deleted
            FROM cms_users u, cms_user_profiles p, cms_user_awards a
            WHERE a.user_id = u.id AND p.user_id = u.id AND u.is_deleted = 0 AND u.is_locked = 0 ". $view_sql ."
            GROUP BY a.user_id
            ORDER BY ". $order_sql ."
            LIMIT ". $cfg['limit'];

    $result = cmsCore::c('db')->query($sql) ;

    if (!cmsCore::c('db')->num_rows($result)) { return false; }

    while($user = cmsCore::c('db')->fetch_assoc($result)) {
        $user['avatar'] = cmsUser::getUserAvatarUrl($user['id'], 'small', $user['imageurl'], $user['is_deleted']);

        if ($cfg['show_awards']) {
            $user['awards'] = cmsCore::c('db')->get_table('cms_user_awards', 'user_id='.$user['id'], 'id, title');
        }

        $users[] = $user;
    }

    cmsPage::initTemplate('modules', $cfg['tpl'])->
        assign('users', $users)->
        assign('cfg', $cfg)->
        display();

    return true;
}
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:48,代码来源:module.php

示例4: mod_respect

function mod_respect($module_id, $cfg)
{
    $inDB = cmsDatabase::getInstance();
    if (!isset($cfg['view_aw'])) {
        $cfg['view_aw'] = 0;
    }
    if (!isset($cfg['limit'])) {
        $cfg['limit'] = 5;
    }
    if (!isset($cfg['order'])) {
        $cfg['order'] = 'desc';
    }
    if (!isset($cfg['show_awards'])) {
        $cfg['show_awards'] = 1;
    }
    if ($cfg['order'] == 'rand') {
        $order_sql = 'RAND()';
    } else {
        $order_sql = 'awards_count DESC';
    }
    if (!$cfg['view_aw']) {
        $view_sql = '';
    } else {
        $view_sql = " AND a.title = '{$cfg['view_aw']}'";
    }
    $sql = "SELECT u.id, u.nickname, u.login, COUNT(a.id) as awards_count, p.imageurl, u.is_deleted\n            FROM cms_users u, cms_user_profiles p, cms_user_awards a\n            WHERE a.user_id = u.id AND p.user_id = u.id AND u.is_deleted = 0 AND u.is_locked = 0 {$view_sql}\n            GROUP BY a.user_id\n            ORDER BY {$order_sql}\n            LIMIT {$cfg['limit']}";
    $result = $inDB->query($sql);
    if (!$inDB->num_rows($result)) {
        return false;
    }
    while ($user = $inDB->fetch_assoc($result)) {
        $user['avatar'] = cmsUser::getUserAvatarUrl($user['id'], 'small', $user['imageurl'], $user['is_deleted']);
        if ($cfg['show_awards']) {
            $user['awards'] = $inDB->get_table('cms_user_awards', 'user_id=' . $user['id'], 'id, title');
        }
        $users[] = $user;
    }
    cmsPage::initTemplate('modules', 'mod_respect')->assign('users', $users)->assign('cfg', $cfg)->display('mod_respect.tpl');
    return true;
}
开发者ID:4uva4ek,项目名称:svato,代码行数:40,代码来源:module.php

示例5: getPost

 /**
  * Возвращает блог по ссылке или по id
  * @param int or string $id_or_link
  * @return array $blog
  */
 public function getPost($id_or_link = 0)
 {
     if (is_numeric($id_or_link)) {
         $where = "p.id = '{$id_or_link}'";
     } else {
         $where = "p.seolink = '{$id_or_link}'";
     }
     $sql = "SELECT p.*,\r\n\t\t\t\t\t   u.nickname as author_nickname,\r\n\t\t\t\t\t   u.login as author_login,\r\n\t\t\t\t\t   up.imageurl as author_image,\r\n\t\t\t\t\t   u.is_deleted as author_deleted\r\n\t\t\t\tFROM cms_blog_posts p\r\n\t\t\t\tLEFT JOIN cms_users u ON u.id = p.user_id\r\n\t\t\t\tLEFT JOIN cms_user_profiles up ON up.user_id = u.id\r\n\t\t\t\tWHERE {$where} LIMIT 1";
     $result = $this->inDB->query($sql);
     if (!$this->inDB->num_rows($result)) {
         return false;
     }
     global $_LANG;
     $post = $this->inDB->fetch_assoc($result);
     $post['feditdate'] = cmsCore::dateFormat($post['edit_date']);
     $post['fpubdate'] = cmsCore::dateDiffNow($post['pubdate']) . ' ' . $_LANG['BACK'] . ' (' . cmsCore::dateFormat($post['pubdate']) . ')';
     //Убираем тег [cut]
     $post['content_html'] = preg_replace('/\\[(cut=)\\s*(.*?)\\]/ui', '', $post['content_html']);
     $post['author_avatar'] = cmsUser::getUserAvatarUrl($post['user_id'], 'small', $post['author_image'], $post['author_deleted']);
     return cmsCore::callEvent('GET_POST', $post);
 }
开发者ID:deltas1,项目名称:icms1,代码行数:26,代码来源:blog.class.php

示例6: getUserWall

 /**
  * Возвращает html стены пользователя
  * @param int $selected
  * @param array $exclude
  * @return html
  */
 public static function getUserWall($target_id, $component = 'users', $my_profile = 0, $is_admin = 0)
 {
     $inDB = cmsDatabase::getInstance();
     $inUser = self::getInstance();
     cmsCore::loadLanguage('components/' . $component);
     if (!$my_profile && !$is_admin) {
         $my_profile = $inUser->is_admin;
     }
     $records = array();
     //получаем общее число записей на стене этого пользователя
     $total = $inDB->rows_count('cms_user_wall', "user_id = '{$target_id}' AND usertype = '{$component}'");
     if ($total) {
         $sql = "SELECT w.*, g.gender, g.imageurl, u.nickname as author, u.login as author_login, u.is_deleted, w.pubdate\n                    FROM cms_user_wall w\n\t\t\t\t\tINNER JOIN cms_users u ON u.id = w.author_id\n\t\t\t\t\tINNER JOIN cms_user_profiles g ON g.user_id = u.id\n                    WHERE w.user_id = '{$target_id}' AND w.usertype = '{$component}'\n                    ORDER BY w.pubdate DESC\n";
         if ($inDB->limit) {
             $sql .= "LIMIT {$inDB->limit}";
         }
         $result = $inDB->query($sql);
         $inDB->resetConditions();
         while ($record = $inDB->fetch_assoc($result)) {
             $record['is_today'] = time() - strtotime($record['pubdate']) < 86400;
             $record['fpubdate'] = $record['is_today'] ? cmsCore::dateDiffNow($record['pubdate']) : cmsCore::dateFormat($record['pubdate']);
             $record['avatar'] = cmsUser::getUserAvatarUrl($record['author_id'], 'small', $record['imageurl'], $record['is_deleted']);
             $records[] = $record;
         }
         $records = cmsCore::callEvent('GET_WALL_POSTS', $records);
     }
     ob_start();
     cmsPage::initTemplate('components', 'com_users_wall')->assign('records', $records)->assign('user_id', $inUser->id)->assign('target_id', $target_id)->assign('my_profile', $my_profile)->assign('is_admin', $is_admin)->assign('component', $component)->assign('total', $total)->assign('pagebar', cmsPage::getPagebar($total, $inDB->page, $inDB->perpage, 'javascript:wallPage(%page%)'))->display('com_users_wall.tpl');
     return ob_get_clean();
 }
开发者ID:vicktorwork,项目名称:cms1,代码行数:36,代码来源:user.class.php

示例7: getNotices

	private function getNotices(){

		global $_LANG;

        $sql = "SELECT m.*, m.from_id as sender_id {$this->inDB->select}
                FROM cms_user_msg m
                WHERE m.from_id < 0
                {$this->inDB->where}
                {$this->inDB->order_by}\n";

        if ($this->inDB->limit){
            $sql .= "LIMIT {$this->inDB->limit}";
        }

		$result = $this->inDB->query($sql);

		$this->inDB->resetConditions();

		if(!$this->inDB->num_rows($result)){ return false; }

		while ($msg = $this->inDB->fetch_assoc($result)){

            if ($msg['sender_id'] == USER_UPDATER){
                $msg['authorlink'] = $_LANG['SERVICE_UPDATE'];
            }
            if ($msg['sender_id'] == USER_MASSMAIL){
                $msg['authorlink'] = $_LANG['SERVICE_MAILING'];
            }
			$msg['fpubdate'] = cmsCore::dateFormat($msg['senddate'], true, true, true);
			$msg['user_img'] = cmsUser::getUserAvatarUrl($msg['sender_id'], 'small', '', '');

			$msgs[] = $msg;

		}

		return $msgs;

	}
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:38,代码来源:model.php

示例8: getPosts

 public function getPosts()
 {
     $inUser = cmsUser::getInstance();
     $sql = "SELECT p.id, p.thread_id, p.user_id, p.pubdate, p.editdate, p.edittimes, p.rating, p.attach_count, p.content_html, p.pinned,\r\n                       u.nickname, u.login, u.is_deleted, u.logdate, u.status,\r\n                       up.imageurl, up.signature_html, up.city, up.karma, g.access as group_access, g.is_admin {$this->inDB->select}\r\n                FROM cms_forum_posts p\r\n                {$this->inDB->join}\r\n                LEFT JOIN cms_users u ON u.id = p.user_id\r\n                LEFT JOIN cms_user_profiles up ON up.user_id = u.id\r\n                LEFT JOIN cms_user_groups g ON u.group_id = g.id\r\n                WHERE 1=1\r\n                {$this->inDB->where}\r\n                {$this->inDB->group_by}\r\n                {$this->inDB->order_by} \n";
     if ($this->inDB->limit) {
         $sql .= "LIMIT {$this->inDB->limit}";
     }
     $result = $this->inDB->query($sql);
     $this->inDB->resetConditions();
     if (!$this->inDB->num_rows($result)) {
         return array();
     }
     while ($post = $this->inDB->fetch_assoc($result)) {
         $post['fpubdate'] = cmsCore::dateFormat($post['pubdate']);
         $post['wday'] = cmsCore::dateToWday($post['pubdate']);
         $post['peditdate'] = cmsCore::dateFormat($post['editdate'], true, true);
         $post['post_count'] = $this->getUserPostsCount($post['user_id']);
         $post['avatar_url'] = cmsUser::getUserAvatarUrl($post['user_id'], 'small', $post['imageurl'], $post['is_deleted']);
         $post['flogdate'] = cmsUser::getOnlineStatus($post['user_id'], $post['logdate']);
         $post['userrank'] = $this->getForumUserRank($post);
         $post['user_awards'] = cmsUser::getAwardsList($post['user_id']);
         $post['attached_files'] = $this->config['fa_on'] && $post['attach_count'] ? $this->getPostAttachments($post['id']) : array();
         $end_min = $this->checkEditTime($post['pubdate']);
         $post['is_author'] = $post['user_id'] == cmsUser::getInstance()->id;
         $post['is_author_can_edit'] = (is_bool($end_min) ? $end_min : $end_min > 0) && $post['is_author'];
         if ($inUser->id) {
             $post['is_voted'] = $post['is_author'] ? true : cmsUser::isRateUser('forum_post', $inUser->id, $post['id']);
         } else {
             $post['is_voted'] = true;
         }
         $posts[] = $post;
     }
     $this->resetAbstractArray();
     return cmsCore::callEvent('GET_FORUM_POSTS', $posts);
 }
开发者ID:r2git,项目名称:icms1,代码行数:35,代码来源:model.php

示例9: getClubPreMembers

 public function getClubPreMembers($club_id, $role = '', $prem = '')
 {
     $club_members = array();
     $role_where = $role ? "AND c.role = '{$role}'" : '';
     $prem_where = $prem ? "AND premoderlist = '{$prem}'" : '';
     $sql = "SELECT c.user_id, c.role, u.nickname, u.login, u.status, u.logdate, p.karma, p.gender, p.imageurl as admin_avatar, u.is_deleted\n\t\t\t\tFROM cms_user_clubs c\n\t\t\t\tLEFT JOIN cms_users u ON u.id = c.user_id\n\t\t\t\tLEFT JOIN cms_user_profiles p ON p.user_id = u.id\n\t\t\t\tWHERE club_id = '{$club_id}' {$role_where} {$prem_where}\n\t\t\t\tORDER BY c.role DESC, u.logdate DESC\n";
     if ($this->inDB->limit) {
         $sql .= "LIMIT {$this->inDB->limit}";
     }
     $rs = $this->inDB->query($sql);
     $this->inDB->resetConditions();
     if (!$this->inDB->num_rows($rs)) {
         return $club_members;
     }
     while ($u = $this->inDB->fetch_assoc($rs)) {
         $u['admin_avatar'] = cmsUser::getUserAvatarUrl($u['user_id'], 'small', $u['admin_avatar'], $u['is_deleted']);
         $u['is_online'] = cmsUser::isOnline($u['user_id']);
         $u['logdate'] = cmsCore::dateFormat($u['logdate'], true, true);
         $club_members[] = $u;
     }
     return $club_members;
 }
开发者ID:4uva4ek,项目名称:svato,代码行数:22,代码来源:model.php

示例10: getComments

 /**
  * Получаем комментарии по заданным параметрам
  * @return array
  */
 public function getComments($only_published = true, $is_tree = false, $from_module = false)
 {
     $inUser = cmsUser::getInstance();
     $comments = array();
     global $_LANG;
     $published = $only_published ? 'c.published = 1' : '1=1';
     $sql = "SELECT c.*,\r\n\t\t\t\t\t   IFNULL(u.nickname, 0) as nickname,\r\n\t\t\t\t\t   IFNULL(u.login, 0) as login,\r\n\t\t\t\t\t   IFNULL(u.is_deleted, 0) as is_deleted,\r\n\t\t\t\t\t   IFNULL(p.imageurl, 0) as imageurl,\r\n\t\t\t\t\t   IFNULL(p.gender, 0) as gender\r\n                FROM cms_comments c\r\n\t\t\t\tLEFT JOIN cms_users u ON u.id = c.user_id\r\n\t\t\t\tLEFT JOIN cms_user_profiles p ON p.user_id = u.id\r\n                WHERE {$published}\r\n\t\t\t\t\t{$this->inDB->where}\r\n\r\n                {$this->inDB->group_by}\r\n\r\n                {$this->inDB->order_by}\n";
     if ($this->inDB->limit) {
         $sql .= "LIMIT {$this->inDB->limit}";
     }
     $result = $this->inDB->query($sql);
     $this->inDB->resetConditions();
     if (!$this->inDB->num_rows($result)) {
         return array();
     }
     while ($comment = $this->inDB->fetch_assoc($result)) {
         $comment['level'] = 0;
         $comment['is_editable'] = $this->isEditable($comment['pubdate']);
         $comment['fpubdate'] = cmsCore::dateFormat($comment['pubdate'], true, true);
         if ($comment['guestname']) {
             $comment['author'] = $comment['guestname'];
             $comment['is_profile'] = false;
             $comment['ip'] = in_array($this->config['cmm_ip'], array(1, 2)) ? $comment['ip'] : '';
         } else {
             $comment['author']['nickname'] = $comment['nickname'];
             $comment['author']['login'] = $comment['login'];
             $comment['is_profile'] = true;
             $comment['user_image'] = cmsUser::getUserAvatarUrl($comment['user_id'], 'small', $comment['imageurl'], $comment['is_deleted']);
             $comment['ip'] = $this->config['cmm_ip'] == 2 && $comment['ip'] ? $comment['ip'] : '';
         }
         switch ($comment['gender']) {
             case 'm':
                 $comment['gender'] = $_LANG['COMMENTS_MALE'];
                 break;
             case 'f':
                 $comment['gender'] = $_LANG['COMMENTS_FEMALE'];
                 break;
             default:
                 $comment['gender'] = $_LANG['COMMENTS_GENDER'];
         }
         $comment['show'] = !$this->config['min_karma'] || $comment['rating'] >= $this->config['min_karma_show'] || cmsUser::userIsAdmin($comment['user_id']);
         $comment['is_my'] = $inUser->id == $comment['user_id'];
         if ($inUser->id) {
             $comment['is_voted'] = $comment['is_my'] ? true : cmsUser::isRateUser('comment', $inUser->id, $comment['id']);
         } else {
             $comment['is_voted'] = true;
         }
         $comments[] = $comment;
     }
     if ($is_tree) {
         $comments = $this->buildTree(0, 0, $comments);
     }
     return $from_module ? cmsCore::callEvent('GET_COMMENTS_MODULE', $comments) : cmsCore::callEvent('GET_COMMENTS', $comments);
 }
开发者ID:deltas1,项目名称:icms1,代码行数:58,代码来源:model.php


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