本文整理汇总了PHP中CRoute类的典型用法代码示例。如果您正苦于以下问题:PHP CRoute类的具体用法?PHP CRoute怎么用?PHP CRoute使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CRoute类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: display
function display($data = null)
{
$mainframe = JFactory::getApplication();
$config = CFactory::getConfig();
$document =& JFactory::getDocument();
$document->setTitle(JText::sprintf('CC FRONTPAGE TITLE', $config->get('sitename')));
$document->setLink(CRoute::_('index.php?option=com_community'));
$my = CFactory::getUser();
CFactory::load('libraries', 'activities');
CFactory::load('helpers', 'string');
$act = new CActivityStream();
$rows = $act->getFEED('', '', null, $mainframe->getCfg('feed_limit'));
if ($config->get('showactivitystream') == COMMUNITY_SHOW || $config->get('showactivitystream') == COMMUNITY_MEMBERS_ONLY && $my->id != 0) {
foreach ($rows->data as $row) {
if ($row->type != 'title') {
// load individual item creator class
$item = new JFeedItem();
// cannot escape the title. it's already formated. we should
// escape it during CActivityStream::add
//$item->title = CStringHelper::escape($row->title);
$item->title = $row->title;
$item->link = CRoute::_('index.php?option=com_community&view=profile&userid=' . $row->actor);
$item->description = "<img src=\"{$row->favicon}\" alt=\"\"/> " . $row->title;
$item->date = $row->createdDate;
$item->category = '';
//$row->category;
// Make sure url is absolute
$item->description = JString::str_ireplace('href="/', 'href="' . JURI::base(), $item->description);
// loads item info into rss array
$document->addItem($item);
}
}
}
}
开发者ID:bizanto,项目名称:Hooked,代码行数:34,代码来源:view.feed.php
示例2: getProfileLink
public function getProfileLink($user_id, &$object, &$attribs = array())
{
$user = CFactory::getUser($user_id);
//parameters
$params = $this->params;
if (!$user || $params->get('view_individual_link', '1') == 0) {
return true;
}
JHTML::_('behavior.tooltip');
$name = $user->getDisplayName();
$url = CRoute::_('index.php?option=com_community&view=profile&userid=' . $user_id);
switch ($params->get('view_individual_link', '1')) {
case 2:
$avatar = $user->getThumbAvatar();
$text = '<img class="hasTip" src="' . $avatar . '" title="' . $name . '"/>';
break;
case 1:
default:
$text = JText::_('PLG_TRACKS_JOMSOCIAL_VIEW_USER_PROFILE');
break;
}
$attribs = array_merge($attribs, array('alt' => $user->get('username')));
$object->text = JHTML::link($url, $text, $attribs);
return true;
}
开发者ID:julienV,项目名称:Joomla-Tracks,代码行数:25,代码来源:jomsocial.php
示例3: getRegistrationURL
public function getRegistrationURL()
{
$usersConfig = JComponentHelper::getParams('com_users');
if ($usersConfig->get('allowUserRegistration')) {
return CRoute::_('index.php?option=com_community&view=register');
}
}
开发者ID:laiello,项目名称:senluonirvana,代码行数:7,代码来源:login.php
示例4: injectTags
/**
* Inject data from paramter to content tags ({}) .
*
* @param $content Original content with content tags.
* @param $params Text contain all values need to be replaced.
* @param $html Auto detect url tag and insert inline.
* @return $text The content after replacing.
**/
public static function injectTags($content, $paramsTxt, $html = false)
{
$params = new CParameter($paramsTxt);
preg_match_all("/{(.*?)}/", $content, $matches, PREG_SET_ORDER);
if (!empty($matches)) {
foreach ($matches as $val) {
$replaceWith = JString::trim($params->get($val[1], null));
if (!is_null($replaceWith)) {
//if the replacement start with 'index.php', we can CRoute it
if (JString::strpos($replaceWith, 'index.php') === 0) {
$replaceWith = CRoute::getExternalURL($replaceWith);
}
if ($html) {
$replaceUrl = $params->get($val[1] . '_url', null);
if (!is_null($replaceUrl)) {
if ($val[1] == 'stream') {
$replaceUrl .= '#activity-stream-container';
}
//if the replacement start with 'index.php', we can CRoute it
if (JString::strpos($replaceUrl, 'index.php') === 0) {
$replaceUrl = CRoute::getExternalURL($replaceUrl);
}
$replaceWith = '<a href="' . $replaceUrl . '">' . $replaceWith . '</a>';
}
}
$content = CString::str_ireplace($val[0], $replaceWith, $content);
}
}
}
return $content;
}
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:39,代码来源:content.php
示例5: getInboxLink
public function getInboxLink($text)
{
if (!$text) {
$text = JText::_('COM_KUNENA_PMS_INBOX');
}
return CKunenaLink::GetHrefLink(CRoute::_('index.php?option=com_community&view=inbox'), $text, '', 'follow');
}
开发者ID:redigy,项目名称:Kunena-1.6,代码行数:7,代码来源:private.php
示例6: send
/**
* Do a batch send
*/
function send($total = 100)
{
$mailqModel = CFactory::getModel('mailq');
$userModel = CFactory::getModel('user');
$mails = $mailqModel->get($total);
$jconfig = JFactory::getConfig();
$mailer = JFactory::getMailer();
$config = CFactory::getConfig();
$senderEmail = $jconfig->getValue('mailfrom');
$senderName = $jconfig->getValue('fromname');
if (empty($mails)) {
return;
}
CFactory::load('helpers', 'string');
foreach ($mails as $row) {
// @rule: only send emails that is valid.
// @rule: make sure recipient is not blocked!
$userid = $userModel->getUserFromEmail($row->recipient);
$user = CFactory::getUser($userid);
if (!$user->isBlocked() && !JString::stristr($row->recipient, 'foo.bar')) {
$mailer->setSender(array($senderEmail, $senderName));
$mailer->addRecipient($row->recipient);
$mailer->setSubject($row->subject);
$tmpl = new CTemplate();
$raw = isset($row->params) ? $row->params : '';
$params = new JParameter($row->params);
$base = $config->get('htmlemail') ? 'email.html' : 'email.text';
if ($config->get('htmlemail')) {
$row->body = JString::str_ireplace(array("\r\n", "\r", "\n"), '<br />', $row->body);
$mailer->IsHTML(true);
} else {
//@rule: Some content might contain 'html' tags. Strip them out since this mail should never contain html tags.
$row->body = CStringHelper::escape(strip_tags($row->body));
}
$tmpl->set('content', $row->body);
$tmpl->set('template', rtrim(JURI::root(), '/') . '/components/com_community/templates/' . $config->get('template'));
$tmpl->set('sitename', $config->get('sitename'));
$row->body = $tmpl->fetch($base);
// Replace any occurences of custom variables within the braces scoe { }
if (!empty($row->body)) {
preg_match_all("/{(.*?)}/", $row->body, $matches, PREG_SET_ORDER);
foreach ($matches as $val) {
$replaceWith = $params->get($val[1], null);
//if the replacement start with 'index.php', we can CRoute it
if (strpos($replaceWith, 'index.php') === 0) {
$replaceWith = CRoute::getExternalURL($replaceWith);
}
if (!is_null($replaceWith)) {
$row->body = JString::str_ireplace($val[0], $replaceWith, $row->body);
}
}
}
unset($tmpl);
$mailer->setBody($row->body);
$mailer->send();
}
$mailqModel->markSent($row->id);
$mailer->ClearAllRecipients();
}
}
开发者ID:bizanto,项目名称:Hooked,代码行数:63,代码来源:mailq.php
示例7: getProfileURL
public function getProfileURL($userid, $task='', $xhtml = true) {
// Make sure that user profile exist.
if (!$userid || CFactory::getUser($userid) === null) {
return false;
}
return CRoute::_('index.php?option=com_community&view=profile&userid=' . (int) $userid, $xhtml);
}
开发者ID:BillVGN,项目名称:PortalPRP,代码行数:7,代码来源:profile.php
示例8: _getMutualFriendsHTML
public static function _getMutualFriendsHTML($userid = null)
{
$my = CFactory::getUser();
if ($my->id == $userid) {
return;
}
$friendsModel = CFactory::getModel('Friends');
$friends = $friendsModel->getFriends($userid, 'latest', false, 'mutual');
$html = "<ul class='joms-list--friend single-column'>";
if (sizeof($friends)) {
foreach ($friends as $friend) {
$html .= "<li class='joms-list__item'>";
$html .= "<div class='joms-list__avatar'>";
$html .= '<div class="joms-avatar ' . CUserHelper::onlineIndicator($friend) . '"><a href="' . CRoute::_('index.php?option=com_community&view=profile&userid=' . $friend->id) . '">';
$html .= '<img src="' . $friend->getThumbAvatar() . '" data-author="' . $friend->id . '" />';
$html .= "</a></div></div>";
$html .= "<div class='joms-list__body'>";
$html .= CFriendsHelper::getUserCog($friend->id, null, null, true);
$html .= CFriendsHelper::getUserFriendDropdown($friend->id);
$html .= '<a href="' . CRoute::_('index.php?option=com_community&view=profile&userid=' . $friend->id) . '">';
$html .= '<h4 class="joms-text--username">' . $friend->getDisplayName() . '</h4></a>';
$html .= '<span class="joms-text--title">' . JText::sprintf('COM_COMMUNITY_TOTAL_MUTUAL_FRIENDS', CFriendsHelper::getTotalMutualFriends($friend->id)) . '</span>';
$html .= "</div></li>";
}
$html .= "</ul>";
} else {
$html .= JText::_('COM_COMMUNITY_NO_MUTUAL_FRIENDS');
}
return $html;
}
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:30,代码来源:mutualfriends.php
示例9: getMembersData
function getMembersData(&$params)
{
$model = CFactory::getModel('user');
$db = JFactory::getDBO();
$limit = $params->get('count', '5');
$query = 'SELECT ' . $db->quoteName('userid') . ' FROM ' . $db->quoteName('#__community_users') . ' AS a ' . ' INNER JOIN ' . $db->quoteName('#__users') . ' AS b ON a.' . $db->quoteName('userid') . '=b.' . $db->quoteName('id') . ' WHERE ' . $db->quoteName('thumb') . '!=' . $db->Quote('components/com_community/assets/default_thumb.jpg') . ' ' . ' AND ' . $db->quoteName('block') . '=' . $db->Quote(0) . ' ' . ' ORDER BY ' . $db->quoteName('points') . ' DESC ' . ' LIMIT ' . $limit;
$db->setQuery($query);
$row = $db->loadObjectList();
if ($db->getErrorNum()) {
JError::raiseError(500, $db->stderr());
}
$_members = array();
if (!empty($row)) {
foreach ($row as $data) {
$user = CFactory::getUser($data->userid);
$_obj = new stdClass();
$_obj->id = $data->userid;
$_obj->name = $user->getDisplayName();
$_obj->avatar = $user->getThumbAvatar();
$CUserPoints = new CUserPoints();
$_obj->karma = $CUserPoints->getPointsImage($user);
$_obj->userpoints = $user->_points;
$_obj->link = CRoute::_('index.php?option=com_community&view=profile&userid=' . $data->userid);
$_members[] = $_obj;
}
}
return $_members;
}
开发者ID:Jougito,项目名称:DynWeb,代码行数:28,代码来源:helper.php
示例10: onPromoteData
function onPromoteData($id)
{
$db = JFactory::getDBO();
$Itemid = JRequest::getInt('Itemid');
$jschk = $this->_chkextension();
if (!empty($jschk)) {
$query = "SELECT cf.id FROM #__community_fields as cf\n\t\t\t\t\t\t\t\tLEFT JOIN #__community_fields_values AS cfv ON cfv.field_id=cf.id\n\t\t\t\t\t\t\t\t\tWHERE cf.name like '%About me%' AND cfv.user_id=" . $id;
$db->setQuery($query);
$fieldid = $db->loadresult();
$query = "SELECT u.name AS title, cu.avatar AS image, cfv.value AS bodytext\n\t\t\t\t\t\t\t\t\tFROM #__users AS u\n\t\t\t\t\t\t\t\t\tLEFT JOIN #__community_users AS cu ON u.id=cu.userid\n\t\t\t\t\t\t\t\t\tLEFT JOIN #__community_fields_values AS cfv ON cu.userid=cfv.user_id\n\t\t\t\t\t\t\t\t\tLEFT JOIN #__community_fields AS cf ON cfv.field_id=cf.id\n\t\t\t\t\t\t\t\t\tWHERE cu.userid =" . $id;
if ($fieldid) {
$query .= " AND cfv.field_id=" . $fieldid;
}
$db->setQuery($query);
$previewdata = $db->loadObjectlist();
if (!$fieldid) {
$previewdata[0]->bodytext = '';
}
// Include Jomsocial core
$jspath = JPATH_ROOT . DS . 'components' . DS . 'com_community';
include_once $jspath . DS . 'libraries' . DS . 'core.php';
$previewdata[0]->url = JUri::root() . substr(CRoute::_('index.php?option=com_community&view=profile&userid=' . $id), strlen(JUri::base(true)) + 1);
if ($previewdata[0]->image == '') {
$previewdata[0]->image = 'components/com_community/assets/user-Male.png';
}
return $previewdata;
} else {
return '';
}
}
开发者ID:politik86,项目名称:test2,代码行数:30,代码来源:plug_promote_jsprofile.php
示例11: getProfileURL
public function getProfileURL($userid, $task='', $xhtml = true)
{
if ($userid == 0) return false;
// Get CUser object
$user = CFactory::getUser($userid);
if($user === null) return false;
return CRoute::_('index.php?option=com_community&view=profile&userid='.$userid, $xhtml);
}
开发者ID:rich20,项目名称:Kunena,代码行数:8,代码来源:profile.php
示例12: eventLink
/**
* Create a link to a event page
*
* @param id integer ther user id
* @param route bool do we want to wrap it with Jroute func ?
*/
public static function eventLink($id, $route = true)
{
$url = 'index.php?option=com_community&view=events&task=viewevent&eventid=' . $id;
if ($route) {
$url = CRoute::_($url);
}
return $url;
}
开发者ID:bizanto,项目名称:Hooked,代码行数:14,代码来源:url.php
示例13: getLink
/**
* Retrieves the profile link
*
* @since 5.0
* @access public
* @param string
* @return
*/
public function getLink()
{
if (!EB::jomsocial()->exists()) {
return parent::getLink();
}
$link = CRoute::_('index.php?option=com_community&view=profile&userid=' . $this->profile->id);
return $link;
}
开发者ID:knigherrant,项目名称:decopatio,代码行数:16,代码来源:client.php
示例14: profile
/**
* Displays the viewing profile page.
*
* @access public
* @param array An associative array to display the fields
*/
public function profile(&$data)
{
$mainframe = JFactory::getApplication();
$friendsModel = CFactory::getModel('friends');
$showfriends = JRequest::getVar('showfriends', false);
$userid = JRequest::getVar('userid', '');
$user = CFactory::getUser($userid);
$linkUrl = CRoute::_('index.php?option=com_community&view=profile&userid=' . $user->id);
$document = JFactory::getDocument();
$document->setTitle(JText::sprintf('COM_COMMUNITY_USERS_FEED_TITLE', $user->getDisplayName()));
$document->setDescription(JText::sprintf('COM_COMMUNITY_USERS_FEED_DESCRIPTION', $user->getDisplayName(), $user->lastvisitDate));
$document->setLink($linkUrl);
include_once JPATH_COMPONENT . '/libraries/activities.php';
$act = new CActivityStream();
$friendIds = $friendsModel->getFriendIds($user->id);
$friendIds = $showfriends ? $friendIds : null;
$rows = $act->getFEED($user->id, $friendIds, null, $mainframe->getCfg('feed_limit'));
// add the avatar image
$rssImage = new JFeedImage();
$rssImage->url = $user->getThumbAvatar();
$rssImage->link = $linkUrl;
$rssImage->width = 64;
$rssImage->height = 64;
$document->image = $rssImage;
//CFactory::load( 'helpers' , 'string' );
//CFactory::load( 'helpers' , 'time' );
foreach ($rows->data as $row) {
if ($row->type != 'title') {
// Get activities link
$pattern = '/<a href=\\"(.*?)\\"/';
preg_match_all($pattern, $row->title, $matches);
// Use activity owner link when activity link is not available
if (!empty($matches[1][1])) {
$linkUrl = $matches[1][1];
} else {
if (!empty($matches[1][0])) {
$linkUrl = $matches[1][0];
}
}
// load individual item creator class
$item = new JFeedItem();
$item->title = $row->title;
$item->link = $linkUrl;
$item->description = "<img src=\"{$row->favicon}\" alt=\"\" /> " . $row->title;
$item->date = CTimeHelper::getDate($row->createdDateRaw)->toRFC822();
$item->category = '';
//$row->category;
$item->description = CString::str_ireplace('_QQQ_', '"', $item->description);
// Make sure url is absolute
$pattern = '/href="(.*?)index.php/';
$replace = 'href="' . JURI::base() . 'index.php';
$string = $item->description;
$item->description = preg_replace($pattern, $replace, $string);
// loads item info into rss array
$document->addItem($item);
}
}
}
开发者ID:Jougito,项目名称:DynWeb,代码行数:64,代码来源:view.feed.php
示例15: getUserProfileUrl
function getUserProfileUrl($integration_option, $userid)
{
//$cominvitexHelper=new cominvitexHelper();
//$invitex_settings=$cominvitexHelper->getconfigData();
//$params=JComponentHelper::getParams('com_jlike');
//$integration_option=$invitex_settings['reg_direct'];
//$integration_option='JomSocial'
$link = '';
if ($integration_option == 'Joomla') {
//$itemid=jgiveFrontendHelper::getItemId('option=com_users');
$link = '';
} else {
if ($integration_option == 'Community Builder') {
$cbpath = JPATH_ROOT . DS . 'components' . DS . 'com_community';
if ($cbpath) {
//$itemid=$cominvitexHelper->getItemId('option=com_comprofiler');
$link = JUri::root() . substr(JRoute::_('index.php?option=com_comprofiler&task=userprofile&user=' . $userid . '&Itemid=' . $itemid), strlen(JUri::base(true)) + 1);
}
} else {
if ($integration_option == 'JomSocial') {
$jspath = JPATH_ROOT . DS . 'components' . DS . 'com_community';
if ($jspath) {
$link = '';
if (file_exists($jspath)) {
include_once $jspath . DS . 'libraries' . DS . 'core.php';
$link = JUri::root() . substr(CRoute::_('index.php?option=com_community&view=profile&userid=' . $userid), strlen(JUri::base(true)) + 1);
}
}
} else {
if ($integration_option == 'Jomwall') {
$awdpath = JPATH_ROOT . DS . 'components' . DS . 'com_awdwall';
if ($awdpath) {
if (!class_exists('AwdwallHelperUser')) {
require_once JPATH_SITE . DS . 'components' . DS . 'com_awdwall' . DS . 'helpers' . DS . 'user.php';
}
$awduser = new AwdwallHelperUser();
$Itemid = $awduser->getComItemId();
$link = JRoute::_('index.php?option=com_awdwall&view=awdwall&layout=mywall&wuid=' . $userid . '&Itemid=' . $Itemid);
}
} else {
if ($integration_option == 'EasySocial') {
$espath = JPATH_ROOT . DS . 'components' . DS . 'com_easysocial';
if ($espath) {
$link = '';
if (file_exists($espath)) {
require_once JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php';
$user = Foundry::user($userid);
$link = JRoute::_($user->getPermalink());
}
}
}
}
}
}
}
return $link;
}
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:57,代码来源:profiledata.php
示例16: add_stream
function add_stream($listing_id, $cids, $ctype = '')
{
include_once JPATH_BASE . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'core.php';
// load language strings for this component so we get translated activity stream messages
$lang =& JFactory::getLanguage();
$lang->load('com_relate');
$sql = "SELECT id, title, catid FROM #__content WHERE id = '{$listing_id}'";
$this->_db->setQuery($sql);
$listing = $this->_db->loadObject();
$listing_title = $listing->title;
$listing_href = CRoute::_('index.php?option=com_content&view=article&catid=' . $listing->catid . '&id=' . $listing->id);
$listing_link = '<a href="' . $listing_href . '">' . $listing_title . '</a>';
if ($ctype != '') {
$content_type = $ctype;
$category_id = 1;
$is_listing = false;
} else {
$sql = "SELECT l.id, l.catid, l.title, c.title AS cat_title FROM #__categories c, #__content l " . "WHERE c.id = l.catid AND l.id IN (" . implode(",", $cids) . ")";
$this->_db->setQuery($sql);
$content = $this->_db->loadObjectList('id');
$is_listing = true;
}
foreach ($cids as $cid) {
if ($is_listing) {
$content_title = $content[$cid]->title;
$content_type = $content[$cid]->cat_title;
$category_id = $content[$cid]->catid;
$content_id = $content[$cid]->id;
$href = CRoute::_('index.php?option=com_content&view=article&catid=' . $category_id . '&id=' . $content_id);
$content_link = '<a href="' . $href . '">' . $content_title . '</a>';
$content_info = $content_link . ' (' . $content_type . ')';
} else {
$content_id = $cid;
$tab = '';
if ($content_type == "photo") {
$tab = '#bilder';
} else {
if ($content_type == "video") {
$tab = '#video';
}
}
$content_link = '<a href="' . $listing_href . $tab . '">' . JText::_("a {$content_type}") . '</a>';
$content_info = $content_link;
}
$act = new stdClass();
$act->cmd = 'wall.write';
$act->actor = JFactory::getUser()->id;
$act->target = 0;
$act->title = JText::sprintf('RELATION ADDED', $content_info, $listing_link);
$act->content = '';
$act->app = 'wall';
$act->cid = $content_id;
CFactory::load('libraries', 'activities');
CActivityStream::add($act);
}
}
开发者ID:bizanto,项目名称:Hooked,代码行数:56,代码来源:relate.php
示例17: getThumb
static function getThumb($userId, $imageClass = '', $anchorClass = '')
{
CFactory::load('helpers', 'string');
$user = CFactory::getUser($userId);
$imageClass = !empty($imageClass) ? ' class="' . $imageClass . '"' : '';
$anchorClass = !empty($anchorClass) ? ' class="' . $anchorClass . '"' : '';
$data = '<a href="' . CRoute::_('index.php?option=com_community&view=profile&userid=' . $user->id) . '"' . $anchorClass . '>';
$data .= '<img src="{user:thumbnail:' . $userId . '}" alt="' . CStringHelper::escape($user->getDisplayName()) . '"' . $imageClass . ' />';
$data .= '</a>';
return $data;
}
开发者ID:bizanto,项目名称:Hooked,代码行数:11,代码来源:user.php
示例18: 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="" /> ' . $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
示例19: removeProfilePicture
/**
* When user remove Avatar then set to default avatar as profile pix
*/
static function removeProfilePicture()
{
//when admin remove any avatar of user by admin panel then get userid
// at default value,if user remove self avatar.(when fron end user login)
$userId = JRequest::getVar('userid', JFactory::getUser()->id, 'POST');
$pType = XiptLibProfiletypes::getUserData($userId, 'PROFILETYPE');
$newPath = XiptLibProfiletypes::getProfiletypeData($pType, 'avatar');
self::_removeProfilePicture($userId, $pType, $newPath);
$view = JRequest::getVar('view', 'profile', 'GET');
//$task = JRequest::getVar('task','profile','GET');
JFactory::getApplication()->redirect(CRoute::_("index.php?option=com_community&view={$view}&userid={$userId}", false), JText::_('CC_PROFILE_PICTURE_REMOVED'));
}
开发者ID:Simarpreet05,项目名称:joomla,代码行数:15,代码来源:avatar.php
示例20: updateProfile
/**
* Once a user changed their profile, request them to update their profile
**/
public function updateProfile()
{
$profileType = JRequest::getVar('profileType', '');
$document = JFactory::getDocument();
$document->setTitle(JText::_('CC MULTIPROFILE UPDATE'));
$my = CFactory::getUser();
$this->addPathway(JText::_('CC PROFILE'), CRoute::_('index.php?option=com_community&view=profile&userid=' . $my->id));
$this->addPathway(JText::_('CC MULTIPROFILE CHANGE TYPE'), CRoute::_('index.php?option=com_community&view=multiprofile&task=changeprofile'));
$this->addPathway(JText::_('CC MULTIPROFILE UPDATE'));
$model = CFactory::getModel('profile');
$profileType = JRequest::getVar('profileType', 0);
// Get all published custom field for profile
$filter = array('published' => '1', 'registration' => '1');
// $fields =& $model->getAllFields( $filter , $profileType );
$result = $model->getEditableProfile($my->id, $profileType);
$empty_html = array();
$post = JRequest::get('post');
// Bind result from previous post into the field object
if (!empty($post)) {
foreach ($fields as $group) {
$field = $group->fields;
for ($i = 0; $i < count($field); $i++) {
$fieldid = $field[$i]->id;
$fieldType = $field[$i]->type;
if (!empty($post['field' . $fieldid])) {
if (is_array($post['field' . $fieldid])) {
if ($fieldType != 'date') {
$values = $post['field' . $fieldid];
$value = '';
foreach ($values as $listValue) {
$value .= $listValue . ',';
}
$field[$i]->value = $value;
} else {
$field[$i]->value = $post['field' . $fieldid];
}
} else {
$field[$i]->value = $post['field' . $fieldid];
}
}
}
}
}
$config =& CFactory::getConfig();
$js = 'assets/validate-1.5' . ($config->getBool('usepackedjavascript') ? '.pack.js' : '.js');
CAssets::attach($js, 'js');
$profileType = JRequest::getVar('profileType', 0, 'GET');
CFactory::load('libraries', 'profile');
$tmpl = new CTemplate();
$tmpl->set('fields', $result['fields']);
$tmpl->set('profileType', $profileType);
echo $tmpl->fetch('multiprofile.update');
}
开发者ID:bizanto,项目名称:Hooked,代码行数:56,代码来源:view.html.php
注:本文中的CRoute类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论