本文整理汇总了PHP中CUserHelper类的典型用法代码示例。如果您正苦于以下问题:PHP CUserHelper类的具体用法?PHP CUserHelper怎么用?PHP CUserHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CUserHelper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _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
示例2: onUserLogin
/**
* This method should handle any login logic and report back to the subject
* For Joomla 1.6, onLoginUser is now onUserLogin
*
* @access public
* @param array holds the user data
* @param array extra options
* @return boolean True on success
* @since 1.6
*/
public function onUserLogin($user, $options)
{
$app = JFactory::getApplication();
$cUser = CFactory::getUser(CUserHelper::getUserId($user['username']));
if ($cUser->block) {
$app->setUserState('users.login.form.return', 'index.php?option=com_users&view=profile');
}
return $this->onLoginUser($user, $options);
}
开发者ID:Jougito,项目名称:DynWeb,代码行数:19,代码来源:jomsocialuser.php
示例3: _buildQuery
public function _buildQuery()
{
$db = JFactory::getDBO();
$mainframe = JFactory::getApplication();
$jinput = $mainframe->input;
$actor = $jinput->get('actor', '', 'NONE');
//JRequest::getVar( 'actor' , '' );
$archived = JRequest::getInt('archived', 0);
$app = $jinput->get('app', 'none', 'NONE');
//JRequest::getVar( 'app' , 'none' );
$where = array();
$userId = 0;
if (!empty($actor)) {
$userId = CUserHelper::getUserId($actor);
}
if ($userId != 0) {
$where[] = 'actor=' . $db->Quote($userId) . ' ';
}
if ($archived != 0) {
$archived = $archived - 1;
$where[] = 'archived=' . $db->Quote($archived) . ' ';
}
if ($app != 'none') {
$where[] = 'app=' . $db->Quote($app);
}
$query = 'SELECT * FROM ' . $db->quoteName('#__community_activities');
if (!empty($where)) {
for ($i = 0; $i < count($where); $i++) {
if ($i == 0) {
$query .= ' WHERE ';
} else {
$query .= ' AND ';
}
$query .= $where[$i];
}
}
$query .= ' ORDER BY created DESC';
return $query;
}
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:39,代码来源:activities.php
示例4: _updateFirstLastName
public function _updateFirstLastName($user, $profileType = COMMUNITY_DEFAULT_PROFILE)
{
$profileModel = CFactory::getModel('profile');
$filter = array('fieldcode' => 'FIELD_FAMILYNAME');
$fields = $profileModel->getAllFields($filter, $profileType);
if (!empty($fields)) {
$isUseFirstLastName = CUserHelper::isUseFirstLastName();
if ($isUseFirstLastName) {
$tmpUserModel = CFactory::getModel('register');
$mySess = JFactory::getSession();
$tmpUser = $tmpUserModel->getTempUser($mySess->get('JS_REG_TOKEN', ''));
$fullname = array();
$fullname[$profileModel->getFieldId('FIELD_GIVENNAME')] = $tmpUser->firstname;
$fullname[$profileModel->getFieldId('FIELD_FAMILYNAME')] = $tmpUser->lastname;
$pModel = $this->getModel('profile');
$pModel->saveProfile($user->id, $fullname);
}
}
}
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:19,代码来源:register.php
示例5: ajaxeditComment
public function ajaxeditComment($id, $value, $photoId = 0)
{
$config = CFactory::getConfig();
$my = CFactory::getUser();
$actModel = CFactory::getModel('activities');
$objResponse = new JAXResponse();
$json = array();
if ($my->id == 0) {
$this->blockUnregister();
}
$wall = JTable::getInstance('wall', 'CTable');
$wall->load($id);
$cid = isset($wall->contentid) ? $wall->contentid : null;
$activity = $actModel->getActivity($cid);
$ownPost = $my->id == $wall->post_by;
$targetPost = $activity->target == $my->id;
$allowEdit = COwnerHelper::isCommunityAdmin() || ($ownPost || $targetPost) && !empty($my->id);
$value = trim($value);
if (empty($value)) {
$json['error'] = JText::_('COM_COMMUNITY_CANNOT_EDIT_COMMENT_ERROR');
} else {
if ($config->get('wallediting') && $allowEdit) {
$params = new CParameter($wall->params);
//if photo id is not 0, this wall is appended with a picture
if ($photoId > 0 && $params->get('attached_photo_id') != $photoId) {
//lets check if the photo belongs to the uploader
$photo = JTable::getInstance('Photo', 'CTable');
$photo->load($photoId);
if ($photo->creator == $my->id && $photo->albumid == '-1') {
$params->set('attached_photo_id', $photoId);
//sets the status to ready so that it wont be deleted on cron run
$photo->status = 'ready';
$photo->store();
}
} else {
if ($photoId == -1) {
//if there is nothing, remove the param if applicable
//delete from db and files
$photoModel = CFactory::getModel('photos');
$photoTable = $photoModel->getPhoto($params->get('attached_photo_id'));
$photoTable->delete();
$params->set('attached_photo_id', 0);
}
}
$wall->params = $params->toString();
$wall->comment = $value;
$wall->store();
$CComment = new CComment();
$value = $CComment->stripCommentData($value);
// Need to perform basic formatting here
// 1. support nl to br,
// 2. auto-link text
$CTemplate = new CTemplate();
$value = $origValue = $CTemplate->escape($value);
$value = CStringHelper::autoLink($value);
$value = nl2br($value);
$value = CUserHelper::replaceAliasURL($value);
$value = CStringHelper::getEmoticon($value);
$json['comment'] = $value;
$json['originalComment'] = $origValue;
// $objResponse->addScriptCall("joms.jQuery('div[data-commentid=" . $id . "] .cStream-Content span.comment').html", $value);
// $objResponse->addScriptCall('joms.jQuery("div[data-commentid=' . $id . '] [data-type=stream-comment-editor] textarea").val', $origValue);
// $objResponse->addScriptCall('joms.jQuery("div[data-commentid=' . $id . '] [data-type=stream-comment-editor] textarea").removeData', 'initialized');
// if ($photoId == -1) {
// $objResponse->addScriptCall('joms.jQuery("div[data-commentid=' . $id . '] .joms-stream-thumb").parent().remove', '');
// $objResponse->addScriptCall('joms.jQuery("div[data-commentid=' . $id . '] .joms-stream-attachment").css("display", "none").attr("data-no_thumb", 1);');
// $objResponse->addScriptCall('joms.jQuery("div[data-commentid=' . $id . '] .joms-thumbnail").html', '<img/>');
// } else if ($photoId != 0) {
// $objResponse->addScriptCall('joms.jQuery("div[data-commentid=' . $id . '] .joms-fetch-wrapper").remove', '');
// $objResponse->addScriptCall('joms.jQuery("div[data-commentid=' . $id . '] .joms-stream-thumb").parent().remove', '');
// $objResponse->addScriptCall('joms.jQuery("div[data-commentid=' . $id . '] [data-type=stream-comment-content] .cStream-Meta").before', '<div style="padding: 5px 0"><img class="joms-stream-thumb" src="' . JUri::root(true) ."/". $photo->thumbnail . '" /></div>');
// $objResponse->addScriptCall('joms.jQuery("div[data-commentid=' . $id . '] .joms-stream-attachment").css("display", "block").removeAttr("data-no_thumb");');
// $objResponse->addScriptCall('joms.jQuery("div[data-commentid=' . $id . '] .joms-thumbnail img").attr("src", "' . JUri::root(true) ."/". $photo->thumbnail . '").attr("data-photo_id", "0").data("photo_id", 0);');
// }
} else {
$json['error'] = JText::_('COM_COMMUNITY_NOT_ALLOWED_TO_EDIT');
}
}
if (!isset($json['error'])) {
$json['success'] = true;
}
die(json_encode($json));
}
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:83,代码来源:system.php
示例6: array_reverse
if (!is_array($users)) {
$users = array_reverse(explode(',', $users));
}
$user = CFactory::getUser($users[0]);
$date = JFactory::getDate($act->created);
if ($config->get('activitydateformat') == "lapse") {
$createdTime = CTimeHelper::timeLapse($date);
} else {
$createdTime = $date->format($config->get('profileDateFormat'));
}
$isPhotoModal = $config->get('album_mode') == 1;
?>
<div class="joms-stream__header">
<div class= "joms-avatar--stream <?php
echo CUserHelper::onlineIndicator($user);
?>
">
<?php
if (count($users) > 1 && false) {
// added false for now because we have to show the last user avatar
?>
<svg class="joms-icon" viewBox="0 0 16 16">
<use xlink:href="<?php
echo CRoute::getURI();
?>
#joms-icon-users"></use>
</svg>
<?php
} else {
?>
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:31,代码来源:activities.likes.php
示例7: 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
示例8: getBlockUserHTML
function getBlockUserHTML($userId, $isBlocked)
{
return CUserHelper::getBlockUserHTML($userId, $isBlocked);
}
开发者ID:bizanto,项目名称:Hooked,代码行数:4,代码来源:user.php
示例9: foreach
?>
</div>
<!-- Group's Members @ Sidebar -->
<?php
if ($members) {
?>
<div id="joms-group--members" class="joms-tab__content">
<ul class="joms-list--photos clearfix">
<?php
foreach ($members as $member) {
?>
<li class="joms-list__item">
<div class="joms-avatar <?php
echo CUserHelper::onlineIndicator($member);
?>
">
<a href="<?php
echo CUrlHelper::userLink($member->id);
?>
">
<img
src="<?php
echo $member->getThumbAvatar();
?>
"
title="<?php
echo CTooltip::cAvatarTooltip($member);
?>
"
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:31,代码来源:single.php
示例10: cGenerateUserAliasLinks
/**
* Deprecated since 1.8
* Use CUserHelper::replaceAliasURL instead.
*/
function cGenerateUserAliasLinks($message)
{
return CUserHelper::replaceAliasURL($message);
}
开发者ID:Jougito,项目名称:DynWeb,代码行数:8,代码来源:linkgenerator.php
示例11: editDetails
/**
* Edits a user details
*
* @access public
* @param array An associative array to display the editing of the fields
*/
function editDetails(&$data)
{
$mainframe =& JFactory::getApplication();
// access check
CFactory::setActiveProfile();
if (!$this->accessAllowed('registered')) {
return;
}
$my = CFactory::getUser();
$config = CFactory::getConfig();
$pathway =& $mainframe->getPathway();
$pathway->addItem(JText::_($my->getDisplayName()), CRoute::_('index.php?option=com_community&view=profile&userid=' . $my->id));
$pathway->addItem(JText::_('CC EDIT DETAILS'), '');
$document =& JFactory::getDocument();
$document->setTitle(JText::_('CC EDIT DETAILS'));
$js = 'assets/validate-1.5';
$js .= $config->getBool('usepackedjavascript') ? '.pack.js' : '.js';
CAssets::attach($js, 'js');
$this->showSubmenu();
$connectModel = CFactory::getModel('Connect');
$associated = $connectModel->isAssociated($my->id);
CFactory::load('helpers', 'owner');
CFactory::load('libraries', 'facebook');
$fbHtml = '';
if ($config->get('fbconnectkey') && $config->get('fbconnectsecret')) {
CFactory::load('libraries', 'facebook');
$facebook = new CFacebook();
$fbHtml = $facebook->getLoginHTML();
}
// If FIELD_GIVENNAME & FIELD_FAMILYNAME is in use
CFactory::load('helpers', 'user');
$isUseFirstLastName = CUserHelper::isUseFirstLastName();
$jConfig =& JFactory::getConfig();
CFactory::load('libraries', 'apps');
$app =& CAppPlugins::getInstance();
$appFields = $app->triggerEvent('onFormDisplay', array('jsform-profile-editdetails'));
$beforeFormDisplay = CFormElement::renderElements($appFields, 'before');
$afterFormDisplay = CFormElement::renderElements($appFields, 'after');
$tmpl = new CTemplate();
$tmpl->set('beforeFormDisplay', $beforeFormDisplay);
$tmpl->set('afterFormDisplay', $afterFormDisplay);
$tmpl->set('fbHtml', $fbHtml);
$tmpl->set('jConfig', $jConfig);
$tmpl->set('params', $data->params);
$tmpl->set('user', $my);
$tmpl->set('config', $config);
$tmpl->set('associated', $associated);
$tmpl->set('isAdmin', COwnerHelper::isCommunityAdmin());
$tmpl->set('offsetList', $data->offsetList);
$tmpl->set('isUseFirstLastName', $isUseFirstLastName);
echo $tmpl->fetch('profile.edit.details');
}
开发者ID:bizanto,项目名称:Hooked,代码行数:58,代码来源:view.html.php
示例12:
//break if it has more than 3
?>
<li class="joms-list__item">
<a href="<?php
echo CRoute::_('index.php?option=com_community&view=groups&task=viewdiscussion&groupid=' . $disc->groupid . '&topicid=' . $disc->id);
?>
">
<?php
echo $disc->title;
?>
</a>
<?php
if ($disc->lastmessage != null) {
?>
<span class="joms-block"><?php
echo JHTML::_('string.truncate', CUserHelper::replaceAliasURL($disc->lastmessage, false, true), 150);
?>
</span>
<?php
}
?>
<div class="joms-text--light joms-text--small">
<a href="<?php
echo CRoute::_('index.php?option=com_community&view=groups&task=viewdiscussion&groupid=' . $disc->groupid . '&topicid=' . $disc->id);
?>
">
<?php
echo JText::sprintf(CStringHelper::isPlural($disc->count) ? 'COM_COMMUNITY_TOTAL_REPLIES_MANY' : 'COM_COMMUNITY_GROUPS_DISCUSSION_REPLY_COUNT', $disc->count);
?>
</a>
开发者ID:Jougito,项目名称:DynWeb,代码行数:30,代码来源:groups.module.relateddiscussion.php
示例13: display
/**
* Frontpage display
* @param type $tpl
*/
public function display($tpl = null)
{
/**
* Init variables
*/
$config = CFactory::getConfig();
$document = JFactory::getDocument();
$usersConfig = JComponentHelper::getParams('com_users');
$my = CFactory::getUser();
$model = CFactory::getModel('user');
/**
* Opengraph
*/
CHeadHelper::setType('website', JText::sprintf('COM_COMMUNITY_FRONTPAGE_TITLE', $config->get('sitename')));
/**
* Init document
*/
$feedLink = CRoute::_('index.php?option=com_community&view=frontpage&format=feed');
$feed = '<link rel="alternate" type="application/rss+xml" title="' . JText::_('COM_COMMUNITY_SUBSCRIBE_RECENT_ACTIVITIES_FEED') . '" href="' . $feedLink . '"/>';
$document->addCustomTag($feed);
// Process headers HTML output
$headerHTML = '';
$tmpl = new CTemplate();
$alreadyLogin = 0;
/* User is logged */
if ($my->id != 0) {
$headerHTML = $tmpl->fetch('frontpage.members');
$alreadyLogin = 1;
} else {
/* User is not logged */
$uri = CRoute::_('index.php?option=com_community&view=' . $config->get('redirect_login'), false);
$uri = base64_encode($uri);
$fbHtml = '';
/* Facebook login */
if ($config->get('fbconnectkey') && $config->get('fbconnectsecret') && !$config->get('usejfbc')) {
$facebook = new CFacebook();
$fbHtml = $facebook->getLoginHTML();
}
/* Joomla! Facebook Connect */
if ($config->get('usejfbc')) {
if (class_exists('JFBCFactory')) {
$providers = JFBCFactory::getAllProviders();
foreach ($providers as $p) {
$fbHtml .= $p->loginButton();
}
}
}
//hero image
$heroImage = JURI::root() . 'components/com_community/assets/frontpage-image-default.jpg';
if (file_exists(COMMUNITY_PATH_ASSETS . 'frontpage-image.jpg')) {
$heroImage = JURI::root() . 'components/com_community/assets/frontpage-image.jpg';
} else {
if (file_exists(COMMUNITY_PATH_ASSETS . 'frontpage-image.png')) {
$heroImage = JURI::root() . 'components/com_community/assets/frontpage-image.png';
}
}
//add the hero image as the image metatdata
$imgMeta = '<meta property="og:image" content="' . $heroImage . '"/>';
$document->addCustomTag($imgMeta);
$themeModel = CFactory::getModel('theme');
$settings = $themeModel->getSettings();
/* Generate header HTML for guest */
if ($settings['general']['enable-frontpage-login']) {
$headerHTML = $tmpl->set('allowUserRegister', $usersConfig->get('allowUserRegistration'))->set('heroImage', $heroImage)->set('fbHtml', $fbHtml)->set('useractivation', $usersConfig->get('useractivation'))->set('return', $uri)->set('settings', $settings)->fetch('frontpage/guest');
} else {
$headerHTML = '';
}
}
/* Get site members count */
$totalMembers = $model->getMembersCount();
$latestActivitiesData = $this->showLatestActivities();
$latestActivitiesHTML = $latestActivitiesData['HTML'];
$tmpl = new CTemplate();
$tmpl->set('totalMembers', $totalMembers)->set('my', $my)->set('alreadyLogin', $alreadyLogin)->set('header', $headerHTML)->set('userActivities', $latestActivitiesHTML)->set('config', $config)->set('customActivityHTML', $this->getCustomActivityHTML());
$status = new CUserStatus();
if ($my->authorise('community.view', 'frontpage.statusbox')) {
// Add default status box
CUserHelper::addDefaultStatusCreator($status);
if (COwnerHelper::isCommunityAdmin() && $config->get('custom_activity')) {
$template = new CTemplate();
$template->set('customActivities', CActivityStream::getCustomActivities());
$creator = new CUserStatusCreator('custom');
$creator->title = JText::_('COM_COMMUNITY_CUSTOM');
$creator->html = $template->fetch('status.custom');
$status->addCreator($creator);
}
}
/**
* Misc variables
* @since 3.3
* Move out variable init in side template into view
*/
$moduleCount = count(JModuleHelper::getModules('js_side_frontpage')) + count(JModuleHelper::getModules('js_side_top')) + count(JModuleHelper::getModules('js_side_bottom')) + count(JModuleHelper::getModules('js_side_frontpage_top')) + count(JModuleHelper::getModules('js_side_frontpage_bottom')) + count(JModuleHelper::getModules('js_side_frontpage_stacked')) + count(JModuleHelper::getModules('js_side_top_stacked')) + count(JModuleHelper::getModules('js_side_bottom_stacked')) + count(JModuleHelper::getModules('js_side_frontpage_top_stacked')) + count(JModuleHelper::getModules('js_side_frontpage_bottom_stacked'));
$jinput = JFactory::getApplication()->input;
/**
* @todo 3.3
//.........这里部分代码省略.........
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:101,代码来源:view.html.php
示例14: nl2br
<?php
echo $discussion['created_interval'];
?>
</small>
</span>
</div>
</div>
<div class="joms-stream__body">
<?php
// Escape content
$discussion['comment'] = CTemplate::escape($discussion['comment']);
$discussion['comment'] = CStringHelper::autoLink($discussion['comment']);
$discussion['comment'] = nl2br($discussion['comment']);
$discussion['comment'] = CStringHelper::getEmoticon($discussion['comment']);
$discussion['comment'] = CStringHelper::converttagtolink($discussion['comment']);
$discussion['comment'] = CUserHelper::replaceAliasURL($discussion['comment']);
echo substr($discussion['comment'], 0, 250);
if (strlen($discussion['comment']) > 250) {
echo ' ...';
}
// @TODO: DRY
$video = JTable::getInstance('Video', 'CTable');
if ($video->init($params->get('url'))) {
$video->isValid();
} else {
$video = false;
}
if (is_object($video)) {
?>
<div class="joms-media--video joms-js--video"
data-type="<?php
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:31,代码来源:groups.discussion.updates.php
示例15: ajaxUpdate
/**
* Update the status of current user
*/
public function ajaxUpdate($message = '')
{
$filter = JFilterInput::getInstance();
$message = $filter->clean($message, 'string');
$cache = CFactory::getFastCache();
$cache->clean(array('activities'));
if (!COwnerHelper::isRegisteredUser()) {
return $this->ajaxBlockUnregister();
}
$mainframe = JFactory::getApplication();
$jinput = $mainframe->input;
$objResponse = new JAXResponse();
//@rule: In case someone bypasses the status in the html, we enforce the character limit.
$config = CFactory::getConfig();
if (JString::strlen($message) > $config->get('statusmaxchar')) {
$message = JHTML::_('string.truncate', $message, $config->get('statusmaxchar'));
}
//trim it here so that it wun go into activities stream.
$message = JString::trim($message);
$my = CFactory::getUser();
$status = $this->getModel('status');
// @rule: Spam checks
if ($config->get('antispam_akismet_status')) {
//CFactory::load( 'libraries' , 'spamfilter' );
$filter = CSpamFilter::getFilter();
$filter->setAuthor($my->getDisplayName());
$filter->setMessage($message);
$filter->setEmail($my->email);
$filter->setURL(CRoute::_('index.php?option=com_community&view=profile&userid=' . $my->id));
$filter->setType('message');
$filter->setIP($_SERVER['REMOTE_ADDR']);
if ($filter->isSpam()) {
$objResponse->addAlert(JText::_('COM_COMMUNITY_STATUS_MARKED_SPAM'));
return $objResponse->sendResponse();
}
}
$status->update($my->id, $message);
//set user status for current session.
$today = JFactory::getDate();
$message2 = empty($message) ? ' ' : $message;
$my->set('_status', $message2);
$my->set('_posted_on', $today->toSql());
$profileid = $jinput->get->get('userid', 0, 'INT');
//JRequest::getVar('userid' , 0 , 'GET');
if (COwnerHelper::isMine($my->id, $profileid)) {
$objResponse->addScriptCall("joms.jQuery('#profile-status span#profile-status-message').html('" . addslashes($message) . "');");
}
//CFactory::load( 'helpers' , 'string' );
// $message = CStringHelper::escape( $message );
if (!empty($message)) {
$act = new stdClass();
$act->cmd = 'profile.status.update';
$act->actor = $my->id;
$act->target = $my->id;
//CFactory::load( 'helpers' , 'linkgenerator' );
// @rule: Autolink hyperlinks
$message = CLinkGeneratorHelper::replaceURL($message);
// @rule: Autolink to users profile when message contains @username
$message = CUserHelper::replaceAliasURL($message);
$privacyParams = $my->getParams();
$act->title = $message;
$act->content = '';
$act->app = 'profile';
$act->cid = $my->id;
$act->access = $privacyParams->get('privacyProfileView');
$act->comment_id = CActivities::COMMENT_SELF;
$act->comment_type = 'profile.status';
$act->like_id = CActivities::LIKE_SELF;
$act->like_type = 'profile.status';
//add user points
//CFactory::load( 'libraries' , 'userpoints' );
if (CUserPoints::assignPoint('profile.status.update')) {
//only assign act if user points is set to true
CActivityStream::add($act);
}
//now we need to reload the activities streams (since some report regarding update status from hello me we disabled update the stream, cuz hellome usually called out from jomsocial page)
$friendsModel = CFactory::getModel('friends');
$memberSince = CTimeHelper::getDate($my->registerDate);
$friendIds = $friendsModel->getFriendIds($my->id);
//include_once(JPATH_COMPONENT .'/libraries/activities.php');
$act = new CActivityStream();
$params = $my->getParams();
$limit = !empty($params) ? $params->get('activityLimit', '') : '';
//$html = $act->getHTML($my->id, $friendIds, $memberSince, $limit );
$status = $my->getStatus();
$status = str_replace(array("\r\n", "\n", "\r"), "", $status);
$status = addslashes($status);
// also update hellome module if available
$script = "joms.jQuery('.joms-js--mod-hellome-label').html('" . $status . "');";
$script .= "joms.jQuery('.joms-js--mod-hellome-loading').hide();";
$objResponse->addScriptCall($script);
}
return $objResponse->sendResponse();
}
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:97,代码来源:status.php
示例16:
"
alt=""
<?php
echo $params->get('show_image', 2) == 1 ? 'data-author="' . $comment->post_by . '"' : '';
?>
/>
</a>
</div>
<?php
}
?>
<div class="joms-stream__meta">
"<?php
echo CUserHelper::replaceAliasURL(CStringHelper::escape($comment->comment), false, true);
?>
" by
<a href="<?php
echo CRoute::_('index.php?option=com_community&view=profiles&userid=' . $comment->post_by);
?>
"><?php
echo CFactory::getUser($comment->post_by)->getDisplayName();
?>
</a>
<div class="joms-text--light"><small><?php
echo $createdTime;
?>
</small></div>
</div>
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:31,代码来源:default.php
示例17:
?>
<li class="joms-list__item">
<?php
if (in_array($row->user->id, $featuredList)) {
?>
<div class="joms-ribbon__wrapper">
<span class="joms-ribbon"><?php
echo JText::_('COM_COMMUNITY_FEATURED');
?>
</span>
</div>
<?php
}
?>
<div class="joms-list__avatar <?php
echo CUserHelper::onlineIndicator($row->user);
?>
">
<a href="<?php
echo $row->user->profileLink;
?>
" class="joms-avatar">
<img data-author="<?php
echo $row->user->id;
?>
" src="<?php
echo $row->user->getThumbAvatar();
?>
" alt="<?php
echo $row->user->getDisplayName();
?>
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:31,代码来源:request-sent.php
示例18: ajaxRemoveUserTag
public function ajaxRemoveUserTag($id, $type = 'comment')
{
$my = CFactory::getUser();
if ($my->id == 0) {
$this->ajaxBlockUnregister();
}
// Remove tag.
$updatedMessage = CApiActivities::removeUserTag($id, $type);
$origValue = $updatedMessage;
$value = CStringHelper::autoLink($origValue);
$value = nl2br($value);
$value = CUserHelper::replaceAliasURL($value);
$value = CStringHelper::getEmoticon($value);
$json = array('success' => true, 'unparsed' => $origValue, 'data' => $value);
die(json_encode($json));
}
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:16,代码来源:activities.php
示例19: defined
* The PHP code portions are distributed under the GPL license. If not otherwise stated, all images, manuals, cascading style sheets, and included JavaScript *are NOT GPL, and are released under the IJOOMLA Proprietary Use License v1.0
* More info at https://www.jomsocial.com/license-agreement
*/
defined('_JEXEC') or die;
?>
<div class="joms-js--member-module">
<div class="joms-gap"></div>
<ul class="joms-list--thumbnail clearfix">
<?php
if (count($members) > 0) {
foreach ($members as $member) {
?>
<li class="joms-list__item">
<div class="joms-avatar <?php
echo $filter == 4 ? 'joms-online' : CUserHelper::onlineIndicator($member);
?>
">
<a href="<?php
echo CRoute::_('index.php?option=com_community&view=profile&userid=' . $member->id);
?>
">
<img src="<?php
echo $member->getThumbAvatar();
?>
"
title="<?php
echo CTooltip::cAvatarTooltip($member);
?>
"
alt="<?php
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:31,代码来源:default.php
示例20:
echo $stream->actor->getThumbAvatar();
?>
" alt="<?php
echo $stream->actor->getDisplayName();
?>
">
</a>
</div>
<?php
} else {
?>
<div class="joms-stream__header">
<div class="joms-avatar--stream <?php
echo CUserHelper::onlineIndicator($stream->actor);
?>
">
<img src="components/com_community/assets/user-Male-thumb.png" alt="male" data-author="<?php
echo $stream->actor->id;
?>
" />
</div>
<?php
}
?>
<div class="joms-stream__meta">
<?php
echo $stream->headline;
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:31,代码来源:base-extended.php
注:本文中的CUserHelper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论