• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CUrlHelper类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: friends

 public function friends($data = null)
 {
     $mainframe = JFactory::getApplication();
     $jinput = $mainframe->input;
     $document = JFactory::getDocument();
     $id = JRequest::getCmd('userid', 0);
     $sorted = $jinput->get->get('sort', 'latest', 'STRING');
     //JRequest::getVar( 'sort' , 'latest' , 'GET' );
     $filter = JRequest::getWord('filter', 'all', 'GET');
     $isMine = $id == $my->id && $my->id != 0;
     $my = CFactory::getUser();
     $id = $id == 0 ? $my->id : $id;
     $user = CFactory::getUser($id);
     $friends = CFactory::getModel('friends');
     $blockModel = CFactory::getModel('block');
     $document->setLink(CRoute::_('index.php?option=com_community'));
     $rows = $friends->getFriends($id, $sorted, true, $filter);
     // Hide submenu if we are viewing other's friends
     if ($isMine) {
         $document->setTitle(JText::_('COM_COMMUNITY_FRIENDS_MY_FRIENDS'));
     } else {
         $document->setTitle(JText::sprintf('COM_COMMUNITY_FRIENDS_ALL_FRIENDS', $user->getDisplayName()));
     }
     $sortItems = array('latest' => JText::_('COM_COMMUNITY_SORT_RECENT_FRIENDS'), 'online' => JText::_('COM_COMMUNITY_ONLINE'));
     $resultRows = array();
     // @todo: preload all friends
     foreach ($rows as $row) {
         $user = CFactory::getUser($row->id);
         $obj = clone $row;
         $obj->friendsCount = $user->getFriendCount();
         $obj->profileLink = CUrlHelper::userLink($row->id);
         $obj->isFriend = true;
         $obj->isBlocked = $blockModel->getBlockStatus($user->id, $my->id);
         $resultRows[] = $obj;
     }
     unset($rows);
     foreach ($resultRows as $row) {
         if (!$row->isBlocked) {
             // load individual item creator class
             $item = new JFeedItem();
             $item->title = strip_tags($row->name);
             $item->link = CRoute::_('index.php?option=com_community&view=profile&userid=' . $row->id);
             $item->description = '<img src="' . JURI::base() . $row->_thumb . '" alt="" />&nbsp;' . $row->_status;
             $item->date = $row->lastvisitDate;
             $item->category = '';
             //$row->category;
             $item->description = CString::str_ireplace('_QQQ_', '"', $item->description);
             // Make sure url is absolute
             $item->description = CString::str_ireplace('href="/', 'href="' . JURI::base(), $item->description);
             // loads item info into rss array
             $document->addItem($item);
         }
     }
 }
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:54,代码来源:view.feed.php


示例2: getLargeAvatar

 /**
  * Get large avatar use for cropping
  * @return string
  */
 public function getLargeAvatar()
 {
     $config = CFactory::getConfig();
     $largeAvatar = $config->getString('imagefolder') . '/avatar/profile-' . JFile::getName($this->avatar);
     if (JFile::exists(JPATH_ROOT . '/' . $largeAvatar)) {
         return CUrlHelper::avatarURI($largeAvatar) . '?' . md5(time());
         /* adding random param to prevent browser caching */
     } else {
         return $this->getAvatar();
     }
 }
开发者ID:SMARTRESPONSOR,项目名称:SMARTRESPONSOR,代码行数:15,代码来源:profile.php


示例3: getAvatar

 public function getAvatar()
 {
     // Get the avatar path. Some maintance/cleaning work: We no longer store
     // the default avatar in db. If the default avatar is found, we reset it
     // to empty. In next release, we'll rewrite this portion accordingly.
     // We allow the default avatar to be template specific.
     if ($this->avatar == 'components/com_community/assets/user.png') {
         $this->avatar = '';
         $this->store();
     }
     CFactory::load('helpers', 'url');
     $avatar = CUrlHelper::avatarURI($this->avatar, 'user.png');
     return $avatar;
 }
开发者ID:Simarpreet05,项目名称:joomla,代码行数:14,代码来源:profile.php


示例4: getAvatar

 public function getAvatar()
 {
     // Get the avatar path. Some maintance/cleaning work: We no longer store
     // the default avatar in db. If the default avatar is found, we reset it
     // to empty. In next release, we'll rewrite this portion accordingly.
     // We allow the default avatar to be template specific.
     $profileModel = CFactory::getModel('Profile');
     $gender = $profileModel->getGender($this->userid);
     if (empty($gender)) {
         $gender = 'Male';
     }
     if ($this->avatar == 'components/com_community/assets/user-' . JText::_($gender) . '.png') {
         $this->avatar = '';
         $this->store();
     }
     $avatar = CUrlHelper::avatarURI($this->avatar, 'user-' . JText::_($gender) . '.png');
     return $avatar;
 }
开发者ID:Jougito,项目名称:DynWeb,代码行数:18,代码来源:profile.php


示例5: foreach

    <h3 class="app-box-header"><?php 
echo JText::sprintf('COM_COMMUNITY_EVENTS_CONFIRMED_GUESTS');
?>
</h3>
    <?php 
if ($eventMembersCount > 0) {
    ?>
        <div class="app-box-content">
            <ul class="cThumbsList cResetList clearfix">
                <?php 
    if ($eventMembers) {
        foreach ($eventMembers as $member) {
            ?>
                    <li>
                        <a href="<?php 
            echo CUrlHelper::userLink($member->id);
            ?>
">
                            <img class="cAvatar jomNameTips" src="<?php 
            echo $member->getThumbAvatar();
            ?>
" title="<?php 
            echo CTooltip::cAvatarTooltip($member);
            ?>
" alt="" />
                        </a>
                    </li>
                <?php 
        }
    }
    ?>
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:31,代码来源:events.members.html.php


示例6:

?>
    <div>

        <?php 
if ($bulletins) {
    for ($i = 0; $i < count($bulletins); $i++) {
        $row =& $bulletins[$i];
        ?>
                    <div class="joms-stream__container joms-stream--discussion">
                        <div class="joms-stream__header <?php 
        echo CUserHelper::onlineIndicator($row->creator);
        ?>
">
                            <div class="joms-avatar--stream">
                                <a href="<?php 
        echo CUrlHelper::userLink($row->creator->id);
        ?>
">
                                    <img data-author="<?php 
        echo $row->creator->id;
        ?>
"
                                         src="<?php 
        echo $row->creator->getThumbAvatar();
        ?>
"
                                         alt="<?php 
        echo $row->creator->getDisplayName();
        ?>
"/>
                                </a>
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:31,代码来源:groups.bulletinlist.php


示例7:

            <div class="joms-avatar">
                <img src="<?php 
        echo $row->user->getThumbAvatar();
        ?>
" alt="<?php 
        echo $row->user->getDisplayName();
        ?>
" >
            </div>
        </div>
        <div class="joms-popover__content joms-js--frequest-msg-<?php 
        echo $row->connection_id;
        ?>
">
            <h5><a href="<?php 
        echo CUrlHelper::userLink($row->user->id);
        ?>
"><?php 
        echo $row->user->getDisplayName();
        ?>
</a></h5>
            <?php 
        echo $row->msg;
        ?>
        </div>
        <div class="joms-popover__actions joms-js--frequest-btn-<?php 
        echo $row->connection_id;
        ?>
">
            <button class="joms-button--neutral joms-button--small" onclick="joms.api.friendReject('<?php 
        echo $row->connection_id;
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:31,代码来源:friend-request.php


示例8: formatComment

 /**
  * Return formatted comment given the wall item
  */
 public static function formatComment($wall)
 {
     $config = CFactory::getConfig();
     $my = CFactory::getUser();
     $actModel = CFactory::getModel('activities');
     $like = new CLike();
     $likeCount = $like->getLikeCount('comment', $wall->id);
     $isLiked = $like->userLiked('comment', $wall->id, $my->id);
     $user = CFactory::getUser($wall->post_by);
     // Censor if the user is banned
     if ($user->block) {
         $wall->comment = $origComment = JText::_('COM_COMMUNITY_CENSORED');
     } else {
         // strip out the comment data
         $CComment = new CComment();
         $wall->comment = $CComment->stripCommentData($wall->comment);
         // Need to perform basic formatting here
         // 1. support nl to br,
         // 2. auto-link text
         $CTemplate = new CTemplate();
         $wall->comment = $origComment = $CTemplate->escape($wall->comment);
         $wall->comment = CStringHelper::autoLink($wall->comment);
     }
     $commentsHTML = '';
     $commentsHTML .= '<div class="cComment wall-coc-item" id="wall-' . $wall->id . '"><a href="' . CUrlHelper::userLink($user->id) . '"><img src="' . $user->getThumbAvatar() . '" alt="" class="wall-coc-avatar" /></a>';
     $date = new JDate($wall->date);
     $commentsHTML .= '<a class="wall-coc-author" href="' . CUrlHelper::userLink($user->id) . '">' . $user->getDisplayName() . '</a> ';
     $commentsHTML .= $wall->comment;
     $commentsHTML .= '<span class="wall-coc-time">' . CTimeHelper::timeLapse($date);
     $cid = isset($wall->contentid) ? $wall->contentid : null;
     $activity = $actModel->getActivity($cid);
     $ownPost = $my->id == $wall->post_by;
     $allowRemove = $my->authorise('community.delete', 'walls', $wall);
     $canEdit = $config->get('wallediting') && $my->id == $wall->post_by || COwnerHelper::isCommunityAdmin();
     // only poster can edit
     if ($allowRemove) {
         $commentsHTML .= ' <span class="wall-coc-remove-link">&#x2022; <a href="#removeComment">' . JText::_('COM_COMMUNITY_WALL_REMOVE') . '</a></span>';
     }
     $commentsHTML .= '</span>';
     $commentsHTML .= '</div>';
     $editHTML = '';
     if ($config->get('wallediting') && $ownPost || COwnerHelper::isCommunityAdmin()) {
         $editHTML .= '<a href="javascript:" class="joms-button--edit">';
         $editHTML .= '<svg viewBox="0 0 16 16" class="joms-icon"><use xlink:href="' . CRoute::getURI() . '#joms-icon-pencil"></use></svg>';
         $editHTML .= '<span>' . JText::_('COM_COMMUNITY_EDIT') . '</span>';
         $editHTML .= '</a>';
     }
     $removeHTML = '';
     if ($allowRemove) {
         $removeHTML .= '<a href="javascript:" class="joms-button--remove">';
         $removeHTML .= '<svg viewBox="0 0 16 16" class="joms-icon"><use xlink:href="' . CRoute::getURI() . '#joms-icon-remove"></use></svg>';
         $removeHTML .= '<span>' . JText::_('COM_COMMUNITY_WALL_REMOVE') . '</span>';
         $removeHTML .= '</a>';
     }
     $removeTagHTML = '';
     if (CActivitiesHelper::hasTag($my->id, $wall->comment)) {
         $removeTagHTML = '<span><a data-action="remove-tag" data-id="' . $wall->id . '" href="javascript:">' . JText::_('COM_COMMUNITY_WALL_REMOVE_TAG') . '</a></span>';
     }
     /* user deleted */
     if ($user->guest == 1) {
         $userLink = '<span class="cStream-Author">' . $user->getDisplayName() . '</span> ';
     } else {
         $userLink = '<a class="cStream-Avatar cStream-Author cFloat-L" href="' . CUrlHelper::userLink($user->id) . '"> <img class="cAvatar" src="' . $user->getThumbAvatar() . '"> </a> ';
     }
     $params = $wall->params;
     $paramsHTML = '';
     $image = (array) $params->get('image');
     $photoThumbnail = false;
     if ($params->get('attached_photo_id') > 0) {
         $photo = JTable::getInstance('Photo', 'CTable');
         $photo->load($params->get('attached_photo_id'));
         $photoThumbnail = $photo->getThumbURI();
         $paramsHTML .= '<div style="padding: 5px 0"><img class="joms-stream-thumb" src="' . $photoThumbnail . '" /></div>';
     } else {
         if ($params->get('title')) {
             $video = self::detectVideo($params->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-relative joms-js--comment-preview">';
                 if ($user->id == $my->id || COwnerHelper::isCommunityAdmin()) {
//.........这里部分代码省略.........
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:101,代码来源:wall.php


示例9: stdClass

// Setup group table
$group = $this->group;
// Setup Discussion Table
$discussion = JTable::getInstance('Discussion', 'CTable');
$discussion->load($act->cid);
$discussionLink = CRoute::_('index.php?option=com_community&view=groups&task=viewdiscussion&groupid=' . $group->id . '&topicid=' . $discussion->id);
if ($user->block) {
    $discussion->title = $discussion->message = JText::_('COM_COMMUNITY_CENSORED');
}
// Load params
$action = $act->params->get('action');
$actors = $act->params->get('actors');
$this->set('actors', $actors);
$stream = new stdClass();
$stream->actor = $user;
$stream->target = null;
$stream->datetime = $createdTime;
$stream->headline = '<a href="' . CUrlHelper::userLink($user->id) . '">' . $user->getDisplayName() . '</a> ' . JTEXT::_('COM_COMMUNITY_GROUPS_NEW_GROUP_DISCUSSION') . '<span class="joms-stream__time"><small>' . $stream->datetime . '</small></span>';
$stream->message = "";
$stream->group = $group;
$stream->groupid = $group->id;
$stream->attachments = array();
$stream->link = $discussionLink;
$stream->title = $discussion->title;
$stream->access = $act->access;
$attachment = new stdClass();
$attachment->type = 'create_discussion';
$attachment->message = $this->escape(JHTML::_('string.truncate', $discussion->message, $config->getInt('streamcontentlength'), true, false));
$stream->attachments[] = $attachment;
$this->set('stream', $stream);
$this->load('activities.stream');
开发者ID:Jougito,项目名称:DynWeb,代码行数:31,代码来源:activities.groups.discussion.create.php


示例10: JRegistry

$bulletin->load($act->cid);
// get created date time
$date = JFactory::getDate($act->created);
if ($config->get('activitydateformat') == "lapse") {
    $createdTime = CTimeHelper::timeLapse($date);
} else {
    $createdTime = $date->format($config->get('profileDateFormat'));
}
// Load params
$param = new JRegistry($this->act->params);
$action = $param->get('action');
$actors = $param->get('actors');
$this->set('actors', $actors);
$stream = new stdClass();
$stream->actor = $user;
$stream->target = null;
$stream->datetime = $createdTime;
$stream->headline = '<a class="joms-stream-author" href="' . CUrlHelper::userLink($user->id) . '">' . $user->getDisplayName() . '</a> ' . JTEXT::_('COM_COMMUNITY_GROUPS_NEW_GROUP_NEWS') . '<p class="joms-share-meta date">' . $stream->datetime . '</p>';
$stream->message = "";
$stream->group = $group;
$stream->groupid = $group->id;
$stream->attachments = array();
$stream->title = $bulletin->title;
$stream->link = CRoute::_('index.php?option=com_community&view=groups&task=viewbulletin&groupid=' . $group->id . '&bulletinid=' . $bulletin->id);
$stream->access = $act->access;
$attachment = new stdClass();
$attachment->type = 'create_announcement';
$attachment->message = $this->escape(JHTML::_('string.truncate', $bulletin->message, $config->getInt('streamcontentlength'), true, false));
$stream->attachments[] = $attachment;
$this->set('stream', $stream);
$this->load('activities.stream');
开发者ID:SMARTRESPONSOR,项目名称:SMARTRESPONSOR,代码行数:31,代码来源:activities.groups.bulletin.php


示例11:

if ($my->id == $user1->id) {
    $you = $user1;
    $other = $user2;
}
if ($my->id == $user2->id) {
    $you = $user2;
    $other = $user1;
}
?>
<div class="joms-stream__body no-head">
    <p>
        <svg viewBox="0 0 16 16" class="joms-icon">
            <use xlink:href="<?php 
echo CRoute::getURI();
?>
#joms-icon-user"></use>
        </svg>
        <?php 
if (!is_null($you)) {
    // @todo: use sprintf with language code
    echo JText::sprintf('COM_COMMUNITY_STREAM_MY_FRIENDS', $other->getDisplayName(), CUrlHelper::userLink($other->id));
    ?>
        <?php 
} else {
    // @todo: use sprintf with language code
    echo JText::sprintf('COM_COMMUNITY_STREAM_OTHER_FRIENDS', $user1->getDisplayName(), $user2->getDisplayName(), CUrlHelper::userLink($user1->id), CUrlHelper::userLink($user2->id));
}
?>
    </p>
</div>
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:30,代码来源:friend-connect.php


示例12: _streamShowLikes

 /**
  * Display the full list of people who likes this stream item
  *
  * @param <type> $objResponse
  * @param <type> $actid
  * @param <type> $like_type
  * @param <type> $like_id
  */
 private function _streamShowLikes($objResponse, $actid, $like_type, $like_id, $target = '')
 {
     $my = CFactory::getUser();
     $like = new CLike();
     $likes = $like->getWhoLikes($like_type, $like_id);
     $canUnlike = false;
     $likeHTML = '';
     $likeUsers = array();
     foreach ($likes as $user) {
         $likeUsers[] = '<a href="' . CUrlHelper::userLink($user->id) . '">' . $user->getDisplayName() . '</a>';
         if ($my->id == $user->id) {
             $canUnlike = true;
         }
     }
     if (count($likeUsers) != 0) {
         if ($target === 'popup') {
             $tmpl = new CTemplate();
             $tmpl->set('users', $likes);
             $likeHTML = $tmpl->fetch('ajax.stream.showothers');
         } else {
             $likeHTML .= implode(", ", $likeUsers);
             $likeHTML = CStringHelper::isPlural(count($likeUsers)) ? JText::sprintf('COM_COMMUNITY_LIKE_THIS_MANY_LIST', $likeHTML) : JText::sprintf('COM_COMMUNITY_LIKE_THIS_LIST', $likeHTML);
         }
     }
     return $likeHTML;
 }
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:34,代码来源:system.php


示例13: array

	    <!--NEWS FEED AVATAR-->

			<!--NEWS FEED CONTENT-->
	    <div class="newsfeed-content">
				<div class="newsfeed-content-top">

				<?php 
            // Put user header link if necessary
            if ($apptype == 'group' && $act->eventid) {
                // For group event, show the arrow indicator (using <span class="com_icons com_icons12 com_icons-inline com_icons-rarr">»</span>)
                echo '<div class="newsfeed-content-actor"><a href="' . CUrlHelper::userLink($act->actor) . '">' . $actor->getDisplayName() . '</a> <span class="com_icons com_icons12 com_icons-inline com_icons-rarr">»</span> <a href="' . CUrlHelper::eventLink($act->eventid) . '">' . $act->appTitle . '</a></div>';
            } else {
                ?>
						<div class="newsfeed-content-actor">
							<strong><a class="actor-link" href="<?php 
                echo CUrlHelper::userLink($act->actor);
                ?>
"><?php 
                echo $actor->getDisplayName();
                ?>
</a></strong>
						</div>
						<?php 
            }
            // Order of replacement
            $order = array("\r\n", "\n", "\r");
            $replace = '<br/>';
            // Processes \r\n's first so they aren't converted twice.
            $messageDisplay = str_replace($order, $replace, $act->title);
            echo $messageDisplay;
            ?>
开发者ID:SMARTRESPONSOR,项目名称:SMARTRESPONSOR,代码行数:31,代码来源:activities.apps.php


示例14: elseif

        if ($video->groupid) {
            $group = JTable::getInstance('Group', 'CTable');
            $group->load($video->groupid);
            echo JText::sprintf('COM_COMMUNITY_VIDEOS_FROM_GROUP', '<a href="' . CUrlHelper::groupLink($group->id) . '">' . $group->name . '</a>');
        } elseif ($video->eventid) {
            $event = JTable::getInstance('Event', 'CTable');
            $event->load($video->eventid);
            echo JText::sprintf('COM_COMMUNITY_VIDEOS_FROM_EVENT', '<a href="' . CUrlHelper::eventLink($event->id) . '">' . $event->title . '</a>');
        } elseif ($params->get('activity_id')) {
            $targetUser = CFactory::getUser($params->get('target_id'));
            ?>
                        ▶ <?php 
            echo CLinkGeneratorHelper::getUserURL($targetUser->id, $targetUser->getDisplayName());
            ?>
 <a href="<?php 
            echo CUrlHelper::streamURI($params->get('activity_id'), $targetUser->id);
            ?>
"><?php 
            echo JText::_('COM_COMMUNITY_SINGULAR_STREAM');
            ?>
</a>
                    <?php 
        }
        ?>
                </small>

            </li>
            <?php 
    }
    //end foreach
    ?>
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:31,代码来源:list.php


示例15:

        <div class="clr"></div>
        <div class="group-discussion-author small">
            <?php 
        if (isset($row->lastreplier) && !empty($row->lastreplier)) {
            ?>
            <span class="groups-news-author">
                <?php 
            echo JText::sprintf('CC DISCUSSION LAST REPLIED', '<a href="' . CUrlHelper::userLink($row->lastreplier->post_by->id) . '">' . $row->lastreplier->post_by->getDisplayName() . '</a>', JHTML::_('date', $row->lastreplier->date, JText::_('DATE_FORMAT_LC')));
            ?>
            </span>
            <?php 
        } else {
            ?>
            <span class="groups-news-author">
				<?php 
            echo JText::sprintf('CC DISCUSS STARTED BY', '<a href="' . CUrlHelper::userLink($row->user->id) . '">' . $row->user->getDisplayName() . '</a>');
            ?>
			</span>
            <?php 
        }
        ?>
        </div>
	</div>
	<?php 
    }
} else {
    ?>
	<div class="empty"><?php 
    echo JText::_('CC NO DISCUSSIONS');
    ?>
</div>
开发者ID:bizanto,项目名称:Hooked,代码行数:31,代码来源:groups.discussionlist.php


示例16: getThumbAvatar

 /**
  * @deprecated Since 2.0
  */
 public function getThumbAvatar($id, $thumb)
 {
     $thumb = CUrlHelper::avatarURI($thumb, 'event_thumb.png');
     return $thumb;
 }
开发者ID:SMARTRESPONSOR,项目名称:SMARTRESPONSOR,代码行数:8,代码来源:events.php


示例17: changeAvatar


//.........这里部分代码省略.........
             /**
              * Generate activity stream
              * @todo Should we use CApiActivities::add
              */
             // do not have to generate a stream if the user is not the user itself (eg admin change user avatar)
             if (CUserPoints::assignPoint('profile.avatar.upload') && $my->id == CFactory::getUser()->id) {
                 $act = new stdClass();
                 $act->cmd = 'profile.avatar.upload';
                 $act->actor = $userid;
                 $act->target = 0;
                 $act->title = '';
                 $act->content = '';
                 $act->access = $my->_cparams->get("privacyPhotoView", 0);
                 $act->app = 'profile.avatar.upload';
                 /* Profile app */
                 $act->cid = isset($photo->id) && $photo->id ? $photo->id : 0;
                 $act->verb = 'upload';
                 /* We uploaded new avatar - NOT change avatar */
                 $act->params = $params;
                 $params->set('photo_id', $photo->id);
                 $params->set('album_id', $photo->albumid);
                 $act->comment_id = CActivities::COMMENT_SELF;
                 $act->comment_type = 'profile.avatar.upload';
                 $act->like_id = CActivities::LIKE_SELF;
                 $act->like_type = 'profile.avatar.upload';
             }
             break;
         case 'group':
             CUserPoints::assignPoint('group.avatar.upload');
             /**
              * Generate activity stream
              * @todo Should we use CApiActivities::add
              */
             $act = new stdClass();
             $act->cmd = 'groups.avatar.upload';
             $act->actor = $userid;
             $act->target = 0;
             $act->title = '';
             $act->content = '';
             $act->app = 'groups.avatar.upload';
             /* Groups app */
             $act->cid = $id;
             $act->groupid = $id;
             $act->verb = 'update';
             /* We do update */
             $params->set('photo_id', $photo->id);
             $params->set('album_id', $photo->albumid);
             $act->comment_id = CActivities::COMMENT_SELF;
             $act->comment_type = 'groups.avatar.upload';
             $act->like_id = CActivities::LIKE_SELF;
             $act->like_type = 'groups.avatar.upload';
             break;
         case 'event':
             //CUserPoints::assignPoint('events.avatar.upload'); @disabled since 4.0
             /**
              * Generate activity stream
              * @todo Should we use CApiActivities::add
              */
             $act = new stdClass();
             $act->cmd = 'events.avatar.upload';
             $act->actor = $userid;
             $act->target = 0;
             $act->title = '';
             $act->content = '';
             $act->app = 'events.avatar.upload';
             /* Events app */
             $act->cid = $id;
             $act->eventid = $id;
             $act->verb = 'update';
             /* We do update */
             $act->comment_id = CActivities::COMMENT_SELF;
             $act->comment_type = 'events.avatar.upload';
             $act->like_id = CActivities::LIKE_SELF;
             $act->like_type = 'events.avatar.upload';
             break;
     }
     //we only generate stream if the uploader is the user himself, not admin or anyone else
     if (isset($act) && $my->id == $id || $type != 'profile') {
         // $return = CApiActivities::add($act);
         /**
          * use internal Stream instead use for 3rd part API
          */
         $return = CActivityStream::add($act, $params->toString());
         //add the reference to the activity so that we can do something when someone update the avatar
         if ($type == 'profile') {
             // overwrite the params because some of the param might be updated through $my object above
             $cTableParams = $my->_cparams;
         } else {
             $cTableParams = new JRegistry($cTable->params);
         }
         $cTableParams->set('avatar_activity_id', $return->id);
         $cTable->params = $cTableParams->toString();
         $cTable->store();
     }
     if (method_exists($cTable, 'getLargeAvatar')) {
         $this->_showUploadError(false, $cTable->getLargeAvatar(), CUrlHelper::avatarURI($thumbnail, 'user_thumb.png'));
     } else {
         $this->_showUploadError(false, $cTable->getAvatar(), CUrlHelper::avatarURI($thumbnail, 'user_thumb.png'));
     }
 }
开发者ID:Jougito,项目名称:DynWeb,代码行数:101,代码来源:photos.php


示例18: viewGroup

 /**
  * Displays specific groups
  **/
 public function viewGroup($group)
 {
     $mainframe =& JFactory::getApplication();
     CFactory::load('libraries', 'tooltip');
     CFactory::load('libraries', 'wall');
     CFactory::load('libraries', 'window');
     CFactory::load('libraries', 'videos');
     CFactory::load('libraries', 'activities');
     CFactory::load('helpers', 'group');
     CWindow::load();
     $config = CFactory::getConfig();
     $document = JFactory::getDocument();
     $groupLib = new CGroups();
     // Load appropriate models
     $groupModel = CFactory::getModel('groups');
     $wallModel = CFactory::getModel('wall');
     $userModel = CFactory::getModel('user');
     $discussModel = CFactory::getModel('discussions');
     $bulletinModel = CFactory::getModel('bulletins');
     $photosModel = CFactory::getModel('photos');
     $activityModel = CFactory::getModel('activities');
     //$groupid		= JRequest::getInt( 'groupid' , '' );
     //CError::assert( $groupid , '' , '!empty' , __FILE__ , __LINE__ );
     $editGroup = JRequest::getVar('edit', false, 'GET');
     $editGroup = $editGroup == 1 ? true : false;
     $params = $group->getParams();
     CFactory::load('helpers', 'string');
     $document->setMetaData('title', CStringHelper::escape($group->name));
     $document->setMetaData('description', CStringHelper::escape(strip_tags($group->description)));
     $document->addCustomTag('<link rel="image_src" href="' . JURI::root() . $group->thumb . '" />');
     // @rule: Test if the group is unpublished, don't display it at all.
     if (!$group->published) {
         $this->_redirectUnpublishGroup();
         return;
     }
     // Show submenu
     $this->showSubmenu();
     // Set the group info to contain proper <br>
     $group->description = nl2br($group->description);
     $this->addPathway(JText::_('COM_COMMUNITY_GROUPS'), CRoute::_('index.php?option=com_community&view=groups'));
     $this->addPathway(JText::sprintf('COM_COMMUNITY_GROUPS_NAME_TITLE', $group->name), '');
     // Load the current browsers data
     $my = CFactory::getUser();
     // If user are invited
     $isInvited = $groupModel->isInvited($my->id, $group->id);
     // Get members list for display
     //$members	= $groupModel->getAllMember($group->id);
     //Set limit for member listing on view group page
     $limit = 12;
     $approvedMembers = $groupModel->getMembers($group->id, $limit, true, false, true);
     CError::assert($approvedMembers, 'array', 'istype', __FILE__, __LINE__);
     $membersCount = $groupModel->total;
     // Is there any my friend is the member of this group?
     $join = '';
     $friendsCount = 0;
     if ($isInvited) {
         // Get the invitors
         $invitors = $groupModel->getInvitors($my->id, $group->id);
         if (count($invitors) == 1) {
             $user = CFactory::getUser($invitors[0]->creator);
             $join = '<a href="' . CUrlHelper::userLink($user->id) . '">' . $user->getDisplayName() . '</a>';
         } else {
             for ($i = 0; $i < count($invitors); $i++) {
                 $user = CFactory::getUser($invitors[$i]->creator);
                 if ($i + 1 == count($invitors)) {
                     $join .= ' ' . JText::_('COM_COMMUNITY_AND') . ' ' . '<a href="' . CUrlHelper::userLink($user->id) . '">' . $user->getDisplayName() . '</a>';
                 } else {
                     $join .= ', ' . '<a href="' . CUrlHelper::userLink($user->id) . '">' . $user->getDisplayName() . '</a>';
                 }
             }
         }
         // Get users friends in this group
         $friendsCount = $groupModel->getFriendsCount($my->id, $group->id);
     }
     $admins = $groupModel->getAdmins($group->id, $limit, CC_RANDOMIZE);
     // Get list of unapproved members
     $groupModel->getMembers($group->id, null, false);
     $unapproved = $groupModel->total;
     //Get list of approved members
     // Test if the current user is admin
     $isAdmin = $groupModel->isAdmin($my->id, $group->id);
     // Test if the current browser is a member of the group
     $isMember = $groupModel->isMember($my->id, $group->id);
     $waitingApproval = false;
     // Test if the current user is banned from this group
     $isBanned = $group->isBanned($my->id);
     // Attach avatar of the member
     // Pre-load multiple users at once
     $userids = array();
     $limitloop = $limit;
     foreach ($approvedMembers as $uid) {
         $userids[] = $uid->id;
         if (--$limitloop < 1) {
             break;
         }
     }
     CFactory::loadUsers($userids);
//.........这里部分代码省略.........
开发者ID:Simarpreet05,项目名称:joomla,代码行数:101,代码来源:view.html.php


示例19:

                                <?php 
        } else {
            ?>
                                    <img src="<?php 
            echo $message->avatar;
            ?>
" alt="" >
                                <?php 
        }
        ?>
                            </a>
                        </div>

                        <div class="joms-comment__body">
                            <a href="<?php 
        echo $task == 'sent' && !empty($message->smallAvatar[0]) ? CUrlHelper::userLink($message->to[0]) : CUrlHelper::userLink($message->user->id);
        ?>
">
                                <strong>
                                    <?php 
        if ($task == 'sent' && !empty($message->smallAvatar[0])) {
            echo $message->to_name[0];
        } else {
            echo $message->from_name;
        }
        ?>
                                </strong>
                            </a>
                            <?php 
        $count = --$message->recipientCount;
        if ($count > 0) {
开发者ID:Jougito,项目名称:DynWeb,代码行数:31,代码来源:inbox.list.php


示例20: defined

defined('_JEXEC') or die;
?>
<ul class ="cDetailList clrfix">
	<li class="avatarWrap">
		<a href="<?php 
echo $event->contentid ? CUrlHelper::groupeventLink($event->id, $event->contentid) : CUrlHelper::eventLink($event->id);
?>
"><img style="width: 64px; height: auto" class="cAvatar" src="<?php 
echo $event->getThumbAvatar();
?>
" /></a>
	</li>
	<li class="detailWrap">

		<strong><a href="<?php 
echo $event->contentid ? CUrlHelper::groupeventLink($event->id, $event->contentid) : CUrlHelper::eventLink($event->id);
?>
"><?php 
echo strip_tags($event->title);
?>
</a></strong>
		<small>
			<?php 
if (strlen(strip_tags($event->description))) {
    echo JHTML::_('string.truncate', strip_tags($event->description), $config->getInt('streamcontentlength')) . '<br />';
}
?>
			<?php 
echo $event->getStartDateHTML();
?>
<br />
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:31,代码来源:activity.events.update.php



注:本文中的CUrlHelper类示例整理自Github/MSDocs等源码


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CUrlManager类代码示例发布时间:2022-05-20
下一篇:
PHP CUrl类代码示例发布时间:2022-05-20
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap