本文整理汇总了PHP中CBuser::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP CBuser::getInstance方法的具体用法?PHP CBuser::getInstance怎么用?PHP CBuser::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBuser
的用法示例。
在下文中一共展示了CBuser::getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getJoomlaAvatar
function getJoomlaAvatar($registerType, $profileLink, $user)
{
$html = '';
if ($registerType == 'jomsocial' && file_exists(JPATH_BASE . '/components/com_community/libraries/core.php')) {
$jsUser = CFactory::getUser($user->id);
$avatarURL = $jsUser->getThumbAvatar();
$html = $this->getAvatarHtml($avatarURL, $profileLink, "_self");
} else {
if ($registerType == 'easysocial' && file_exists(JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php')) {
$avatarURL = Foundry::user($user->id)->getAvatar();
$html = $this->getAvatarHtml($avatarURL, $profileLink, "_self");
} else {
if ($registerType == "communitybuilder" && file_exists(JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php')) {
include_once JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php';
$cbUser = CBuser::getInstance($user->id);
$avatar = $cbUser->getField('avatar', null, 'csv', 'none', 'list');
$html = $this->getAvatarHtml($avatar, $profileLink, "_self");
} else {
if ($registerType == 'kunena' && JFolder::exists(JPATH_SITE . '/components/com_kunena')) {
$db = JFactory::getDbo();
$query = "SELECT avatar FROM #__kunena_users WHERE userid = " . $user->id;
$db->setQuery($query);
$avatarURL = $db->loadResult();
if ($avatarURL) {
$avatarURL = JRoute::_('media/kunena/avatars/' . $avatarURL, false);
}
$html = $this->getAvatarHtml($avatarURL, $profileLink, "_self");
}
}
}
}
return $html;
}
示例2: onContentBeforeDisplay
/**
* @param string $context
* @param object $article
*/
public function onContentBeforeDisplay( $context, &$article )
{
if ( isset( $article->created_by ) || isset( $article->modified_by ) ) {
static $CB_loaded = 0;
if ( ! $CB_loaded++ ) {
if ( ( ! file_exists( JPATH_SITE . '/libraries/CBLib/CBLib/Core/CBLib.php' ) ) || ( ! file_exists( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' ) ) ) {
echo 'CB not installed'; return;
}
include_once( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' );
}
if ( ( isset( $article->created_by ) ) && $article->created_by ) {
$cbUserCreate = CBuser::getInstance( (int) $article->created_by, false );
if ( isset( $article->author ) ) {
$article->author = $cbUserCreate->getField( 'formatname', null, 'html', 'none', 'list', 0, true );
}
$article->created_by_alias = $cbUserCreate->getField( 'formatname', null, 'html', 'none', 'list', 0, true );
}
if ( ( isset( $article->modified_by ) ) && $article->modified_by ) {
$cbUserModify = CBuser::getInstance( (int) $article->modified_by, false );
$article->modified_by_name = $cbUserModify->getField( 'formatname', null, 'html', 'none', 'list', 0, true );
}
if ( ( isset( $article->contactid ) ) && $article->contactid ) {
$article->contactid = null;
}
}
}
示例3: showAbout
/**
* prepare frontend about render
*
* @param string $return
* @param GroupTable $group
* @param string $users
* @param string $invites
* @param array $counters
* @param array $buttons
* @param array $menu
* @param cbTabs $tabs
* @param UserTable $user
* @return array|null
*/
public function showAbout( &$return, &$group, &$users, &$invites, &$counters, &$buttons, &$menu, &$tabs, $user )
{
global $_CB_framework;
if ( CBGroupJive::isModerator( $user->get( 'id' ) ) || ( ( $group->get( 'published' ) == 1 ) && ( CBGroupJive::getGroupStatus( $user, $group ) >= 3 ) ) ) {
$menu[] = '<a href="' . $_CB_framework->pluginClassUrl( $this->element, true, array( 'action' => 'about', 'func' => 'edit', 'id' => (int) $group->get( 'id' ) ) ) . '"><span class="fa fa-edit"></span> ' . CBTxt::T( 'About' ) . '</a>';
}
$about = trim( $group->params()->get( 'about_content' ) );
if ( ( ! $about ) || ( $about == '<p></p>' ) ) {
return null;
}
CBGroupJive::getTemplate( 'about', true, true, $this->element );
if ( $this->params->get( 'groups_about_substitutions', 0 ) ) {
$about = CBuser::getInstance( (int) $user->get( 'id' ), false )->replaceUserVars( $about, false, false, null, false );
}
if ( $this->params->get( 'groups_about_content_plugins', 0 ) ) {
$about = Application::Cms()->prepareHtmlContentPlugins( $about );
}
return array( 'id' => 'about',
'title' => CBTxt::T( 'About' ),
'content' => HTML_groupjiveAbout::showAbout( $about, $group, $user, $this )
);
}
示例4: _getURL
protected function _getURL($user, $sizex, $sizey)
{
global $_CB_framework;
$app = JFactory::getApplication();
$user = KunenaFactory::getUser($user);
if ($app->getClientId() == 0) {
$cbclient_id = 1;
}
if ($app->getClientId() == 1) {
$cbclient_id = 2;
}
$_CB_framework->cbset('_ui', $cbclient_id);
// Get CUser object
$cbUser = null;
if ($user->userid) {
$cbUser = CBuser::getInstance($user->userid);
}
if ($cbUser === null) {
if ($sizex <= 90) {
return selectTemplate() . 'images/avatar/tnnophoto_n.png';
}
return selectTemplate() . 'images/avatar/nophoto_n.png';
}
if ($sizex <= 90) {
return $cbUser->getField('avatar', null, 'csv');
}
return $cbUser->getField('avatar', null, 'csv', 'none', 'list');
}
示例5: getAvatar
public function getAvatar($profile)
{
if (!$this->exists()) {
return false;
}
$user = CBuser::getInstance($profile->id);
// @task: Apply guest avatars when necessary.
if (!$profile->id) {
$avatar = selectTemplate() . 'images/avatar/tnnophoto_n.png';
return $avatar;
}
if (!$user) {
$user = CBuser::getInstance(null);
}
// Prevent CB from adding anything to the page.
ob_start();
$source = $user->getField('avatar', null, 'php');
$reset = ob_get_contents();
ob_end_clean();
unset($reset);
$source = $source['avatar'];
//incase we view from backend. we need to remove the /administrator/ from the path.
$avatar = str_replace('/administrator/', '/', $source);
return $avatar;
}
示例6: getAvatar
function getAvatar($userID, $email = NULL, $width = 50)
{
jimport('joomla.filesystem.folder');
jimport('joomla.application.component.model');
$mainframe =& JFactory::getApplication();
$params =& K2HelperUtilities::getParams('com_k2');
if (K2_CB && $userID != 'alias') {
$cbUser = CBuser::getInstance((int) $userID);
if (is_object($cbUser)) {
$avatar = $cbUser->getField('avatar', null, 'csv', 'none', 'profile');
return $avatar;
}
}
/*
// JomSocial Avatar integration
if(JFolder::exists(JPATH_SITE.DS.'components'.DS.'com_community') && $userID>0){
$userInfo = &CFactory::getUser($userID);
return $userInfo->getThumbAvatar();
}
*/
// Check for placeholder overrides
if (JFile::exists(JPATH_SITE . DS . 'templates' . DS . $mainframe->getTemplate() . DS . 'images' . DS . 'placeholder' . DS . 'user.png')) {
$avatarPath = 'templates/' . $mainframe->getTemplate() . '/images/placeholder/user.png';
} else {
$avatarPath = 'components/com_k2/images/placeholder/user.png';
}
// Continue with default K2 avatar determination
if ($userID == 'alias') {
$avatar = JURI::root(true) . '/' . $avatarPath;
} else {
if ($userID == 0) {
if ($params->get('gravatar') && !is_null($email)) {
$avatar = 'http://www.gravatar.com/avatar/' . md5($email) . '?s=' . $width . '&default=' . urlencode(JURI::root() . $avatarPath);
} else {
$avatar = JURI::root(true) . '/' . $avatarPath;
}
} else {
if (is_numeric($userID) && $userID > 0) {
JModel::addIncludePath(JPATH_SITE . DS . 'components' . DS . 'com_k2' . DS . 'models');
$model =& JModel::getInstance('Item', 'K2Model');
$profile = $model->getUserProfile($userID);
$avatar = is_null($profile) ? '' : $profile->image;
if (empty($avatar)) {
if ($params->get('gravatar') && !is_null($email)) {
$avatar = 'http://www.gravatar.com/avatar/' . md5($email) . '?s=' . $width . '&default=' . urlencode(JURI::root() . $avatarPath);
} else {
$avatar = JURI::root(true) . '/' . $avatarPath;
}
} else {
$avatar = JURI::root(true) . '/media/k2/users/' . $avatar;
}
}
}
}
if (!$params->get('userImageDefault') && $avatar == JURI::root(true) . '/' . $avatarPath) {
$avatar = '';
}
return $avatar;
}
示例7: showTags
/**
* @param TagTable[] $rows
* @param Tags $stream
* @param int $output 0: Normal, 1: Raw, 2: Inline, 3: Load , 4: Save
* @param UserTable $user
* @param UserTable $viewer
* @param cbPluginHandler $plugin
* @return null|string
*/
static public function showTags( $rows, $stream, $output, $user, $viewer, $plugin )
{
global $_PLUGINS;
CBActivity::loadHeaders( $output );
$sourceClean = htmlspecialchars( $stream->source() );
$tags = array();
$return = null;
$_PLUGINS->trigger( 'activity_onBeforeDisplayTags', array( &$return, &$rows, $stream, $output ) );
if ( $rows ) foreach ( $rows as $row ) {
$rowId = $sourceClean . 'Tag' . (int) $row->get( 'id' );
if ( is_numeric( $row->get( 'user' ) ) ) {
$name = CBuser::getInstance( (int) $row->get( 'user' ), false )->getField( 'formatname', null, 'html', 'none', 'list', 0, true );
} else {
$name = htmlspecialchars( $row->get( 'user' ) );
}
if ( ! $name ) {
continue;
}
$tags[] = '<span id="' . $rowId . '" class="streamTag">'
. $name
. '</span>';
}
if ( $tags ) {
$return .= ( ! in_array( $output, array( 1, 4 ) ) ? '<span class="' . $sourceClean . 'Tags streamTags">' : null );
if ( count( $tags ) > 2 ) {
$tagOne = array_shift( $tags );
$tagTwo = array_shift( $tags );
$moreTooltip = cbTooltip( null, '<div class="streamTagRow">' . implode( '</div><div class="streamTagRow">', $tags ) . '</div>', null, 'auto', null, null, null, 'data-hascbtooltip="true" data-cbtooltip-position-my="bottom center" data-cbtooltip-position-at="top center" data-cbtooltip-open-event="click" data-cbtooltip-close-event="click unfocus" data-cbtooltip-button-hide="true"' );
$more = '<a href="javascript: void(0);"' . $moreTooltip . '>' . CBTxt::T( 'TAGS_MORE', '%%COUNT%% more', array( '%%COUNT%%' => count( $tags ) ) ) . '</a>';
$return .= CBTxt::T( 'TAGS_MORE_THAN_TWO', '[tag_1], [tag_2], and [more]', array( '[tag_1]' => $tagOne, '[tag_2]' => $tagTwo, '[more]' => $more ) );
} elseif ( count( $tags ) > 1 ) {
$return .= CBTxt::T( 'TAGS_TWO', '[tag_1] and [tag_2]', array( '[tag_1]' => $tags[0], '[tag_2]' => $tags[1] ) );
} else {
$return .= $tags[0];
}
$return .= ( ! in_array( $output, array( 1, 4 ) ) ? '</span>' : null );
}
$return .= CBActivity::reloadHeaders( $output );
$_PLUGINS->trigger( 'activity_onAfterDisplayTags', array( &$return, $rows, $stream, $output ) );
return $return;
}
示例8: getProfileURL
public function getProfileURL($user, $task='', $xhtml = true)
{
$user = KunenaFactory::getUser($user);
if ($user->userid == 0) return false;
// Get CUser object
$cbUser = CBuser::getInstance( $user->userid );
if($cbUser === null) return false;
return cbSef( 'index.php?option=com_comprofiler&task=userProfile&user=' . $user->userid. getCBprofileItemid(), $xhtml );
}
示例9: showBlog
/**
* @param OrderedTable $row
* @param UserTable $user
* @param stdClass $model
* @param PluginTable $plugin
*/
static function showBlog($row, $user, $model, $plugin)
{
global $_CB_framework;
$_CB_framework->setPageTitle($row->get('title'));
$_CB_framework->appendPathWay(htmlspecialchars(CBTxt::T('Blogs')), $_CB_framework->userProfileUrl($row->get('user', $user->get('id')), true, 'cbblogsTab'));
$_CB_framework->appendPathWay(htmlspecialchars($row->get('title')), $_CB_framework->pluginClassUrl($plugin->element, true, array('action' => 'blogs', 'func' => 'show', 'id' => (int) $row->get('id'))));
$cbUser =& CBuser::getInstance((int) $row->get('user'), false);
$return = '<div class="blowShow">' . '<div class="blogsTitle page-header"><h3>' . $row->get('title') . ' <small>' . CBTxt::T('WRITTEN_BY_BLOG_AUTHOR', 'Written by [blog_author]', array('[blog_author]' => $cbUser->getField('formatname', null, 'html', 'none', 'list', 0, true))) . '</small></h3></div>' . '<div class="blogsHeader well well-sm">' . CBTxt::T('CATEGORY_CATEGORY', 'Category: [category]', array('[category]' => $row->get('category'))) . ' / ' . CBTxt::T('CREATED_CREATED', 'Created: [created]', array('[created]' => cbFormatDate($row->get('created')))) . ($row->get('modified') && $row->get('modified') != '0000-00-00 00:00:00' ? ' / ' . CBTxt::T('MODIFIED_MODIFIED', 'Modified: [modified]', array('[modified]' => cbFormatDate($row->get('modified')))) : null) . '</div>' . '<div class="blogsText">' . $row->get('blog_intro') . $row->get('blog_full') . '</div>' . '</div>';
echo $return;
}
示例10: showconsultation
/**
* @param OrderedTable $row
* @param UserTable $user
* @param stdClass $model
* @param PluginTable $plugin
*/
static function showconsultation( $row, $user, /** @noinspection PhpUnusedParameterInspection */ $model, $plugin, $bids )
{
global $_CB_framework;
$_CB_framework->setPageTitle( $row->get( 'title' ) );
$_CB_framework->appendPathWay( htmlspecialchars( CBTxt::T( 'consultations' ) ), $_CB_framework->userProfileUrl( $row->get( 'user', $user->get( 'id' ) ), true, 'cbconsultationsTab' ) );
$_CB_framework->appendPathWay( htmlspecialchars( $row->get( 'title' ) ), $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'consultations', 'func' => 'show', 'id' => (int) $row->get( 'id' ) ) ) );
$cbUser =& CBuser::getInstance( (int) $row->get( 'user' ), false );
$return = '<div class="blowShow">'
. '<div class="consultationsTitle page-header"><h3>' . $row->get( 'title' ) . ' <small>' . CBTxt::T( 'WRITTEN_BY_consultation_AUTHOR', 'Written by [consultation_author]', array( '[consultation_author]' => $cbUser->getField( 'formatname', null, 'html', 'none', 'list', 0, true ) ) ) . '</small></h3></div>'
. '<div class="consultationsHeader well well-sm">'
. CBTxt::T( 'CATEGORY_CATEGORY', 'Category: [category]', array( '[category]' => $row->get( 'category' ) ) )
. ' / ' . CBTxt::T( 'CREATED_CREATED', 'Created: [created]', array( '[created]' => cbFormatDate( $row->get( 'created' ) ) ) )
. ( $row->get( 'modified' ) && ( $row->get( 'modified' ) != '0000-00-00 00:00:00' ) ? ' / ' . CBTxt::T( 'MODIFIED_MODIFIED', 'Modified: [modified]', array( '[modified]' => cbFormatDate( $row->get( 'modified' ) ) ) ) : null )
. '</div>'
. '<div class="consultationsText">' . $row->get( 'consultation_intro' ) . $row->get( 'consultation_full' ) . '</div>'
. '</div>';
if($bids!=null){
$return .= '<script >
window.___gcfg = {
lang: \'ru\',
parsetags: \'onload\'
};
</script>
<script src="https://apis.google.com/js/platform.js" async defer></script>
';
$return .= '<h2>Ставки</h2>';
if(empty($bids)){
$return .= "Нет ставок";
}else{
$return .= '<table cellspacing="5" class="consultationsContainer table table-hover table-responsive">';
$return .= '<tr><th>Дата</th><th>Пользователь</th><th>e-mail</th><th>Цена</th><th></th></tr>';
foreach($bids as $key=>$value){
$return .='<tr>';
$return .= '<td>'.$value->bid_date.'</td>';
$return .= '<td>'.$value->name.'</td>';
$return .= '<td>'.$value->email.'</td>';
$return .= '<td>$'.$value->bid_price.'</td>';
$return .= '<td>';
if($key==0){
//Old version was using Goolge Hangouts for communications.
//$return .= '<g:hangout render="createhangout" hangout_type="normal" topic="'.addslashes($row->get('title')).'"
// invites="[{ id : \''.$value->email.'\', invite_type : \'EMAIL\' }]">
// </g:hangout>';
//New version is using CloudInterpreter
$return .= '<a target="_blank" href="http://dev.cloudinterpreter.com:8901/'.md5($row->get('id')).'"><button class="btn btn-success">Начать консультацию</button></a>';
}
$return .= '</td>';
$return .='</tr>';
}
$return .= '</table>';
}
}
echo $return;
}
示例11: replaceCbVars
/**
* Replaces CB variables and general variables left.
*
* @param string $numberFormat Format for the replacements
* @param int $user_id User id for user-variables replacements
* @param array $extraStrings Set of extra-strings for additional replacements
* @return string|null
*/
protected static function replaceCbVars($numberFormat, $user_id, $extraStrings)
{
global $_CB_framework;
if ($numberFormat) {
list($year, $month, $day) = self::_getYearMonthDay();
$uniqid = uniqid('');
$extraExtraStrings = array('YEAR' => $year, 'YEARSHORT' => substr($year, 2), 'MONTH' => $month, 'DAY' => $day, 'SITENAME' => $_CB_framework->getCfg('sitename'), 'SITEURL' => $_CB_framework->getCfg('live_site'), 'UNIQ_ID' => hexdec(substr($uniqid, 7)) . hexdec(substr($uniqid, 0, 7)), 'GROWING_ID' => $uniqid);
return trim(CBuser::getInstance($user_id)->replaceUserVars($numberFormat, false, false, array_merge($extraExtraStrings, $extraStrings), false));
} else {
return null;
}
}
示例12: showWhitelist
/**
* @param cbantispamWhitelistTable $row
* @param array $input
* @param string $type
* @param int|string $tab
* @param UserTable $user
* @param cbPluginHandler $plugin
*/
static public function showWhitelist( $row, $input, $type, $tab, $user, $plugin )
{
global $_CB_framework;
cbValidator::loadValidation();
$name = CBuser::getInstance( (int) $user->get( 'id' ), false )->getField( 'formatname', null, 'html', 'none', 'profile', 0, true );
$pageTitle = CBTxt::T( 'WHITELIST_NAME', 'Whitelist [name]', array( '[name]' => $name ) );
$_CB_framework->setPageTitle( $pageTitle );
$_CB_framework->appendPathWay( htmlspecialchars( CBTxt::T( 'Whitelists' ) ), $_CB_framework->userProfileUrl( (int) $user->get( 'id' ), true, $tab ) );
$_CB_framework->appendPathWay( htmlspecialchars( $pageTitle ), $_CB_framework->pluginClassUrl( $plugin->element, true, ( $row->get( 'id' ) ? array( 'action' => 'whitelist', 'func' => ( $type ? $type : 'edit' ), 'id' => (int) $row->get( 'id' ), 'usr' => (int) $user->get( 'id' ) ) : array( 'action' => 'whitelist', 'func' => ( $type ? $type : 'new' ), 'usr' => (int) $user->get( 'id' ) ) ) ) );
$return = '<div class="whitelistEdit">'
. '<form action="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'whitelist', 'func' => 'save', 'id' => (int) $row->get( 'id' ), 'usr' => (int) $user->get( 'id' ) ) ) . '" method="post" enctype="multipart/form-data" name="whitelistForm" id="whitelistForm" class="cb_form whitelistForm form-auto cbValidation">'
. ( $pageTitle ? '<div class="whitelistTitle page-header"><h3>' . $pageTitle . '</h3></div>' : null )
. '<div class="cbft_select cbtt_select form-group cb_form_line clearfix">'
. '<label for="type" class="col-sm-3 control-label">' . CBTxt::T( 'Type' ) . '</label>'
. '<div class="cb_field col-sm-9">'
. $input['type']
. getFieldIcons( 1, 1, null, CBTxt::T( 'Select the whitelist type. Type determines what value should be supplied.' ) )
. '</div>'
. '</div>'
. '<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
. '<label for="value" class="col-sm-3 control-label">' . CBTxt::T( 'Value' ) . '</label>'
. '<div class="cb_field col-sm-9">'
. $input['value']
. getFieldIcons( 1, 1, null, CBTxt::T( 'Input whitelist value in relation to the type. User type use the users user_id (e.g. 42). IP Address type use a full valid IP Address (e.g. 192.168.0.1). Email type use a fill valid email address (e.g. invalid@cb.invalid). Email Domain type use a full email address domain after @ (e.g. example.com).' ) )
. '</div>'
. '</div>'
. '<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">'
. '<label for="reason" class="col-sm-3 control-label">' . CBTxt::T( 'Reason' ) . '</label>'
. '<div class="cb_field col-sm-9">'
. $input['reason']
. getFieldIcons( 1, 0, null, CBTxt::T( 'Optionally input whitelist reason. Note this is for administrative purposes only.' ) )
. '</div>'
. '</div>'
. '<div class="form-group cb_form_line clearfix">'
. '<div class="col-sm-offset-3 col-sm-9">'
. '<input type="submit" value="' . htmlspecialchars( ( $row->get( 'id' ) ? CBTxt::T( 'Update Whitelist' ) : CBTxt::T( 'Create Whitelist' ) ) ) . '" class="whitelistButton whitelistButtonSubmit btn btn-primary"' . cbValidator::getSubmitBtnHtmlAttributes() . ' /> '
. ' <input type="button" value="' . htmlspecialchars( CBTxt::T( 'Cancel' ) ) . '" class="whitelistButton whitelistButtonCancel btn btn-default" onclick="if ( confirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to cancel? All unsaved data will be lost!' ) ) . '\' ) ) { location.href = \'' . $_CB_framework->userProfileUrl( (int) $user->get( 'id' ), false, $tab ) . '\'; }" />'
. '</div>'
. '</div>'
. cbGetSpoofInputTag( 'plugin' )
. '</form>'
. '</div>';
echo $return;
}
示例13: sendMail
/**
* Builds and sends e-mail
*
* @param UserTable $user
* @param string $mailFrom_email
* @param string $mailFrom_name
* @param string $mailTo
* @param string $mailSubject
* @param string $mailBody
* @param string $mailHtml
* @param string $mailCC
* @param string $mailBCC
* @param string $mailAttachments
* @param string[] $extraStrings
* @return void
*/
protected function sendMail( $user, $mailFrom_email, $mailFrom_name, $mailTo, $mailSubject, $mailBody, $mailHtml, $mailCC, $mailBCC, $mailAttachments, $extraStrings ) {
global $_CB_framework;
cbimport( 'cb.tabs' );
$cbUser = CBuser::getInstance( $user->id );
if ( ! $cbUser ) {
return;
}
$mailFrom_email = trim( $cbUser->replaceUserVars( $mailFrom_email, false, false, array(), false ) );
$mailFrom_name = trim( $cbUser->replaceUserVars( $mailFrom_name, false, false, array(), false ) );
$mailTo = trim( $cbUser->replaceUserVars( $mailTo, false, false, array(), false ) );
$mailCC = trim( $cbUser->replaceUserVars( $mailCC, false, false, array(), false ) );
$mailBCC = trim( $cbUser->replaceUserVars( $mailBCC, false, false, array(), false ) );
$mailSubject = trim( $cbUser->replaceUserVars( CBPTXT::T( $mailSubject ), false, false, $extraStrings, false ) );
$mailBody = trim( $cbUser->replaceUserVars( CBPTXT::T( $mailBody ), false, false, $extraStrings, false ) );
$mailAttachments = trim( $mailAttachments );
if ( $mailTo != '' ) {
$mailTo = preg_split( '/ *, */', $mailTo );
} else {
return;
}
if ( $mailCC != '' ) {
$mailCC = preg_split( '/ *, */', $mailCC );
} else {
$mailCC = null;
}
if ( $mailBCC != '' ) {
$mailBCC = preg_split( '/ *, */', $mailBCC );
} else {
$mailBCC = null;
}
if ( $mailAttachments != '' ) {
$mailAttachments = preg_split( '/ *, */', $mailAttachments );
} else {
$mailAttachments = null;
}
if ( $mailTo && ( $mailSubject || $mailBody ) ) {
comprofilerMail( $mailFrom_email, $mailFrom_name, $mailTo, $_CB_framework->getCfg( 'sitename' ).' - '.$mailSubject, $mailBody, $mailHtml, $mailCC, $mailBCC, $mailAttachments );
}
}
示例14: getCBUserid
protected function getCBUserid()
{
global $_CB_framework;
$cbpath = JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php';
if (file_exists($cbpath)) {
require_once $cbpath;
} else {
return null;
}
$userid = $_CB_framework->myId();
$cbUser = CBuser::getInstance((int) $userid);
if ($cbUser === null) {
return null;
}
return $userid;
}
示例15: editUser
function editUser( $uid = '0', $option = 'users' ) {
global $_CB_framework, $_PLUGINS;
$this->_importNeeded();
$msg = checkCBpermissions( array($uid), "edit", true );
if ($msg) {
echo "<script type=\"text/javascript\"> alert('".$msg."'); window.history.go(-1);</script>\n";
exit;
}
$_PLUGINS->loadPluginGroup('user');
$cbUser =& CBuser::getInstance( $uid );
$cmsUserExists = ( $uid != 0 ) && ( $cbUser !== null );
if ( ! $cmsUserExists ) {
$cbUser =& CBuser::getInstance( null );
}
$user =& $cbUser->getUserData();
/*
$user = new moscomprofilerUser( $_CB_database );
$cmsUserExists = $user->load( (int) $uid );
*/
$comprofilerExists = ( $user->user_id != null );
if ( $cmsUserExists && $comprofilerExists ) {
// Edit existing CB user:
$newCBuser = '0';
} else {
$newCBuser = '1';
if ( $cmsUserExists ) {
// Edit existing CMS (but new CB) user:
$user->approved = '1';
$user->confirmed = '1';
} else {
// New user:
$user->block = '0';
$user->approved = '1';
$user->confirmed = '1';
$user->sendEmail = '0';
$user->gid = $_CB_framework->acl->get_group_id( $_CB_framework->getCfg( 'new_usertype' ), 'ARO' );
$user->gids = array( $user->gid );
}
}
$null = null;
$usersView = _CBloadView( 'user' );
$usersView->edituser( $user, $option, $newCBuser, $null );
}