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


PHP CUserHelper::getThumb方法代码示例

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


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

示例1: _getWallHTML

 public static function _getWallHTML($wall, $wallComments, $appType, $isOwner, $processFunc, $templateFile, $banned = 0)
 {
     $my = CFactory::getUser();
     $user = CFactory::getUser($wall->post_by);
     $date = CTimeHelper::getDate($wall->date);
     $config = CFactory::getConfig();
     // @rule: for site super administrators we want to allow them to view the remove link
     $isOwner = COwnerHelper::isCommunityAdmin() ? true : $isOwner;
     $isEditable = CWall::isEditable($processFunc, $wall->id);
     $commentsHTML = '';
     $comment = new CComment();
     /*
      * @todo 3.3 revise what is this code about
      */
     // If the wall post is a user wall post (in profile pages), we
     // add wall comment feature
     if ($appType == 'user' || $appType == 'groups' || $appType == 'events') {
         if ($banned == 1) {
             $commentsHTML = $comment->getHTML($wallComments, 'wall-cmt-' . $wall->id, false);
         } else {
             $commentsHTML = $comment->getHTML($wallComments, 'wall-cmt-' . $wall->id, CWall::canComment($wall->type, $wall->contentid));
         }
     }
     $avatarHTML = CUserHelper::getThumb($wall->post_by, 'avatar');
     // Change '->created to lapse format if stream uses lapse format'
     if ($config->get('activitydateformat') == 'lapse') {
         $wall->created = CTimeHelper::timeLapse($date);
     } else {
         $wall->created = $date->Format(JText::_('DATE_FORMAT_LC2'), true);
     }
     $wallParam = new CParameter($wall->params);
     $photoThumbnail = '';
     $paramsHTML = '';
     $image = (array) $wallParam->get('image');
     if ($wallParam->get('attached_photo_id') > 0) {
         $photo = JTable::getInstance('Photo', 'CTable');
         $photo->load($wallParam->get('attached_photo_id'));
         $photoThumbnail = $photo->getThumbURI();
     } else {
         if ($wallParam->get('title')) {
             $video = self::detectVideo($wallParam->get('url'));
             if (is_object($video)) {
                 $paramsHTML .= '<div class="joms-media--video joms-js--video"';
                 $paramsHTML .= ' data-type="' . $video->type . '"';
                 $paramsHTML .= ' data-id="' . $video->id . '"';
                 $paramsHTML .= ' data-path="' . ($video->type === 'file' ? JURI::root(true) . '/' : '') . $video->path . '"';
                 $paramsHTML .= ' style="margin-top:10px;">';
                 $paramsHTML .= '<div class="joms-media__thumbnail">';
                 $paramsHTML .= '<img src="' . $video->getThumbnail() . '">';
                 $paramsHTML .= '<a href="javascript:" class="mejs-overlay mejs-layer mejs-overlay-play joms-js--video-play joms-js--video-play-' . $wall->id . '">';
                 $paramsHTML .= '<div class="mejs-overlay-button"></div>';
                 $paramsHTML .= '</a>';
                 $paramsHTML .= '</div>';
                 $paramsHTML .= '<div class="joms-media__body">';
                 $paramsHTML .= '<h4 class="joms-media__title">' . JHTML::_('string.truncate', $video->title, 50, true, false) . '</h4>';
                 $paramsHTML .= '<p class="joms-media__desc">' . JHTML::_('string.truncate', $video->description, $config->getInt('streamcontentlength'), true, false) . '</p>';
                 $paramsHTML .= '</div>';
                 $paramsHTML .= '</div>';
             } else {
                 $paramsHTML .= '<div class="joms-gap"></div>';
                 $paramsHTML .= '<div class="joms-media--album joms-js--comment-preview">';
                 if ($isOwner) {
                     $paramsHTML .= '<span data-action="remove-preview" class="joms-fetched-close" style="top:0;right:0;left:auto" onclick="joms.api.commentRemovePreview(\'' . $wall->id . '\');"><i class="joms-icon-remove"></i></span>';
                 }
                 if ($wallParam->get('image')) {
                     $paramsHTML .= '<div class="joms-media__thumbnail">';
                     $paramsHTML .= '<a href="' . $wallParam->get('link') ? $wallParam->get('link') : '#' . '">';
                     $paramsHTML .= '<img src="' . array_shift($image) . '" />';
                     $paramsHTML .= '</a>';
                     $paramsHTML .= '</div>';
                 }
                 $url = $wallParam->get('url') ? $wallParam->get('url') : '#';
                 $paramsHTML .= '<div class="joms-media__body">';
                 $paramsHTML .= '<h4 class="joms-media__title"><a href="' . $url . '">' . $wallParam->get('title') . '</a></h4>';
                 $paramsHTML .= '<p class="joms-media__desc">' . CStringHelper::trim_words($wallParam->get('description')) . '</p>';
                 if ($wallParam->get('link')) {
                     $paramsHTML .= '<cite>' . preg_replace('#^https?://#', '', $wallParam->get('link')) . '</cite>';
                 }
                 $paramsHTML .= '</div></div>';
             }
         }
     }
     $CComment = new CComment();
     $wall->originalComment = $wall->comment;
     $wall->comment = $CComment->stripCommentData($wall->comment);
     $CTemplate = new CTemplate();
     $wall->comment = CStringHelper::autoLink($wall->comment);
     $wall->comment = nl2br($wall->comment);
     $wall->comment = CUserHelper::replaceAliasURL($wall->comment);
     $wall->comment = CStringHelper::getEmoticon($wall->comment);
     $wall->comment = CStringHelper::converttagtolink($wall->comment);
     // convert to hashtag
     $canDelete = $my->authorise('community.delete', 'walls', $wall);
     $like = new CLike();
     $likeCount = $like->getLikeCount('comment', $wall->id);
     $isLiked = $like->userLiked('comment', $wall->id, $my->id) == COMMUNITY_LIKE;
     // Create new instance of the template
     $tmpl = new CTemplate();
     return $tmpl->set('id', $wall->id)->set('author', $user->getDisplayName())->set('avatarHTML', $avatarHTML)->set('authorLink', CUrlHelper::userLink($user->id))->set('created', $wall->created)->set('content', $wall->comment)->set('commentsHTML', $commentsHTML)->set('avatar', $user->getThumbAvatar())->set('isMine', $isOwner)->set('canDelete', $canDelete)->set('isEditable', $isEditable)->set('processFunc', $processFunc)->set('config', $config)->set('photoThumbnail', $photoThumbnail)->set('paramsHTML', $paramsHTML)->set('wall', $wall)->set('likeCount', $likeCount)->set('isLiked', $isLiked)->fetch($templateFile);
 }
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:100,代码来源:wall.php

示例2: cGetUserThumb

/**
 * Deprecated since 1.8
 * Use CUserHelper::getThumb instead. 
 */
function cGetUserThumb($userId, $imageClass = '', $anchorClass = '')
{
    return CUserHelper::getThumb($userId, $imageClass, $anchorClass);
}
开发者ID:bizanto,项目名称:Hooked,代码行数:8,代码来源:user.php

示例3: _getWallHTML

 function _getWallHTML($wall, $wallComments, $appType, $isOwner, $processFunc, $templateFile)
 {
     CFactory::load('helpers', 'url');
     CFactory::load('helpers', 'user');
     CFactory::load('helpers', 'videos');
     CFactory::load('libraries', 'comment');
     CFactory::load('helpers', 'owner');
     CFactory::load('helpers', 'time');
     $user = CFactory::getUser($wall->post_by);
     $date = CTimeHelper::getDate($wall->date);
     $config = CFactory::getConfig();
     // @rule: for site super administrators we want to allow them to view the remove link
     $isOwner = COwnerHelper::isCommunityAdmin() ? true : $isOwner;
     $isEditable = CWall::isEditable($processFunc, $wall->id);
     // Apply any post processing on the content
     $wall->comment = CWallLibrary::_processWallContent($wall->comment);
     $commentsHTML = '';
     $comment = new CComment();
     // If the wall post is a user wall post (in profile pages), we
     // add wall comment feature
     if ($appType == 'user' || $appType == 'groups' || $appType == 'events') {
         $commentsHTML = $comment->getHTML($wallComments, 'wall-cmt-' . $wall->id, CWall::canComment($wall->type, $wall->contentid));
     }
     $avatarHTML = CUserHelper::getThumb($wall->post_by, 'avatar');
     //var_dump($avatarHTML);exit;
     // @rule: We only allow editing of wall in 15 minutes
     $now = JFactory::getDate();
     $interval = CTimeHelper::timeIntervalDifference($wall->date, $now->toMySQL());
     $interval = COMMUNITY_WALLS_EDIT_INTERVAL - abs($interval);
     $editInterval = round($interval / 60);
     // Create new instance of the template
     $tmpl = new CTemplate();
     $tmpl->set('id', $wall->id);
     $tmpl->set('author', $user->getDisplayName());
     $tmpl->set('avatarHTML', $avatarHTML);
     $tmpl->set('authorLink', CUrlHelper::userLink($user->id));
     $tmpl->set('created', $date->toFormat(JText::_('DATE_FORMAT_LC2')));
     $tmpl->set('content', $wall->comment);
     $tmpl->set('commentsHTML', $commentsHTML);
     $tmpl->set('avatar', $user->getThumbAvatar());
     $tmpl->set('isMine', $isOwner);
     $tmpl->set('isEditable', $isEditable);
     $tmpl->set('editInterval', $editInterval);
     $tmpl->set('processFunc', $processFunc);
     $tmpl->set('config', $config);
     return $tmpl->fetch($templateFile);
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:47,代码来源:wall.php

示例4: getPhotoInfoHeader

 private function getPhotoInfoHeader($photo)
 {
     $date = CTimeHelper::getDate($photo->created);
     $config = CFactory::getConfig();
     $creator = CFactory::getUser($photo->creator);
     if ($config->get('activitydateformat') == 'lapse') {
         $created = CTimeHelper::timeLapse($date);
     } else {
         $created = $date->Format(JText::_('DATE_FORMAT_LC2'));
     }
     $userThumb = CUserHelper::getThumb($creator->id, 'avatar');
     $caption = $photo->caption;
     $template = new CTemplate();
     return $template->set('creator', $creator)->set('permission', $photo->permissions)->set('created', $created)->set('userThumb', $userThumb)->set('caption', $caption)->fetch('wall/info');
 }
开发者ID:Jougito,项目名称:DynWeb,代码行数:15,代码来源:photos.php

示例5: renderComment

 public function renderComment($cmtObj)
 {
     $my = CFactory::getUser();
     $user = CFactory::getUser($cmtObj->creator);
     // Process the text
     CFactory::load('helpers', 'string');
     $cmtObj->text = nl2br(CStringHelper::escape($cmtObj->text));
     //format the date
     $dateObject = CTimeHelper::getDate($cmtObj->date);
     $date = C_JOOMLA_15 == 1 ? $dateObject->toFormat(JText::_('DATE_FORMAT_LC2')) : $dateObject->Format(JText::_('DATE_FORMAT_LC2'));
     $html = '';
     $html .= '<div class="cComment">';
     CFactory::load('helpers', 'user');
     $html .= CUserHelper::getThumb($user->id, 'wall-coc-avatar');
     CFactory::load('helpers', 'string');
     $html = CStringHelper::replaceThumbnails($html);
     $html .= '<a class="wall-coc-author" href="' . CRoute::_('index.php?option=com_community&view=profile&userid=' . $user->id) . '">' . $user->getDisplayName() . '</a> ';
     $html .= JText::sprintf('COM_COMMUNITY_COMMENT_POSTED_ON', '<span class="wall-coc-date">' . $date . '</span>');
     CFactory::load('helpers', 'owner');
     if ($my->id == $user->id || COwnerHelper::isCommunityAdmin()) {
         $html .= ' | <a class="coc-remove coc-' . $cmtObj->creator . '" onclick="joms.comments.remove(this);" href="javascript:void(0)">' . JText::_('COM_COMMUNITY_REMOVE') . '</a>';
     }
     $html .= '<p>' . $cmtObj->text . '</p>';
     $html .= '</div>';
     return $html;
 }
开发者ID:Simarpreet05,项目名称:joomla,代码行数:26,代码来源:comment.php


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