本文整理汇总了PHP中getNameFormat函数的典型用法代码示例。如果您正苦于以下问题:PHP getNameFormat函数的具体用法?PHP getNameFormat怎么用?PHP getNameFormat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getNameFormat函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: drawUserSomethings
/**
* Draws the user profile tab "Subscriptions" (if enabled, user is the profile owner, and something to display.
*
* @param UserTable $user
* @param boolean $itsmyself
* @param string $htmlSubscribed
* @return string
*/
public function drawUserSomethings($user, $itsmyself, $htmlSubscribed)
{
global $_CB_framework, $ueConfig;
$this->htmlSubscribed = $htmlSubscribed;
$subscriptions = $this->_model;
if (count($subscriptions) == 1) {
$subTxt = CBPTXT::T(cbpaidApp::settingsParams()->get('subscription_name', 'subscription'));
} else {
$subTxt = CBPTXT::T(cbpaidApp::settingsParams()->get('subscriptions_name', 'subscriptions'));
}
if ($itsmyself) {
$userName = null;
} else {
$userName = getNameFormat($user->name, $user->username, $ueConfig['name_format']);
}
if ($_CB_framework->getUi() == 1) {
if ($itsmyself) {
$this->htmlTabTitle = sprintf(CBPTXT::Th("Your current %s"), $subTxt);
} else {
$this->htmlTabTitle = sprintf(CBPTXT::Th("%s's current %s"), $userName, $subTxt);
}
} else {
if ($itsmyself) {
$this->htmlTabTitle = sprintf(CBPTXT::Th("Your current and past %s"), $subTxt);
} else {
$this->htmlTabTitle = sprintf(CBPTXT::Th("%s's current and past %s"), $userName, $subTxt);
}
}
return $this->display();
}
示例2: drawTab
/**
* Draws the user profile tab "Subscriptions" (if enabled, user is the profile owner, and something to display.
*
* @param string $htmlSubscriptionsAndUpgrades
* @param string $htmlInvoicesLink
* @param string $tabTitleText
* @param string $htmlTabDescription
* @return string
*/
public function drawTab($htmlSubscriptionsAndUpgrades, $htmlInvoicesLink, $tabTitleText, $htmlTabDescription)
{
global $ueConfig;
$this->htmlSubscriptionsAndUpgrades = $htmlSubscriptionsAndUpgrades;
$this->htmlInvoicesLink = $htmlInvoicesLink;
$this->htmlTabDescription = $htmlTabDescription;
$user = $this->_model;
$title = cbReplaceVars(CBPTXT::Th(cbUnHtmlspecialchars($tabTitleText)), $user);
if ($title) {
$name = getNameFormat($user->name, $user->username, $ueConfig['name_format']);
$title = sprintf($title, $name);
}
$this->htmlTabTitle = $title;
return $this->display();
}
示例3: getDisplayTab
/**
* Generates the HTML to display the user profile tab
* @param moscomprofilerTab $tab the tab database entry
* @param moscomprofilerUser $user the user being displayed
* @param int $ui 1 for front-end, 2 for back-end
* @return mixed either string HTML for tab content, or false if ErrorMSG generated
*/
function getDisplayTab($tab, $user, $ui)
{
global $_CB_framework, $_CB_database, $ueConfig;
$return = null;
if (!$ueConfig['allowConnections'] || isset($ueConfig['connectionDisplay']) && $ueConfig['connectionDisplay'] == 1 && $_CB_framework->myId() != $user->id) {
return null;
}
$params = $this->params;
$con_ShowTitle = $params->get('con_ShowTitle', '1');
$con_ShowSummary = $params->get('con_ShowSummary', '0');
$con_SummaryEntries = $params->get('con_SummaryEntries', '4');
$con_pagingenabled = $params->get('con_PagingEnabled', '1');
$con_entriesperpage = $params->get('con_EntriesPerPage', '10');
$pagingParams = $this->_getPaging(array(), array("connshow_"));
$showall = $this->_getReqParam("showall", false);
if ($con_ShowSummary && !$showall && $pagingParams["connshow_limitstart"] === null) {
$summaryMode = true;
$showpaging = false;
$con_entriesperpage = $con_SummaryEntries;
} else {
$summaryMode = false;
$showpaging = $con_pagingenabled;
}
$isVisitor = null;
if ($_CB_framework->myId() != $user->id) {
$isVisitor = "\n AND m.pending=0 AND m.accepted=1";
}
if ($showpaging || $summaryMode) {
//select a count of all applicable entries for pagination
if ($isVisitor) {
$contotal = $this->_getUserNumberOfConnections($user);
} else {
$query = "SELECT COUNT(*)" . "\n FROM #__comprofiler_members AS m" . "\n LEFT JOIN #__comprofiler AS c ON m.memberid=c.id" . "\n LEFT JOIN #__users AS u ON m.memberid=u.id" . "\n WHERE m.referenceid=" . (int) $user->id . "\n AND c.approved=1 AND c.confirmed=1 AND c.banned=0 AND u.block=0" . $isVisitor . "\n ";
$_CB_database->setQuery($query);
$contotal = $_CB_database->loadResult();
if (!is_numeric($contotal)) {
$contotal = 0;
}
}
}
if (!$showpaging || $pagingParams["connshow_limitstart"] === null || $con_entriesperpage > $contotal) {
$pagingParams["connshow_limitstart"] = "0";
}
$query = "SELECT m.*,u.name,u.email,u.username,c.avatar,c.avatarapproved, u.id " . "\n FROM #__comprofiler_members AS m" . "\n LEFT JOIN #__comprofiler AS c ON m.memberid=c.id" . "\n LEFT JOIN #__users AS u ON m.memberid=u.id" . "\n WHERE m.referenceid=" . (int) $user->id . "" . "\n AND c.approved=1 AND c.confirmed=1 AND c.banned=0 AND u.block=0" . $isVisitor . "\n ORDER BY m.membersince DESC, m.memberid ASC";
$_CB_database->setQuery($query, (int) ($pagingParams["connshow_limitstart"] ? $pagingParams["connshow_limitstart"] : 0), (int) $con_entriesperpage);
$connections = $_CB_database->loadObjectList();
if (!count($connections) > 0) {
$return .= _UE_NOCONNECTIONS;
return $return;
}
if ($con_ShowTitle) {
if ($_CB_framework->myId() == $user->id) {
$return .= "<h3 class=\"cbConTitle\">" . _UE_YOURCONNECTIONS . "</h3>";
} else {
$return .= "<h3 class=\"cbConTitle\">" . sprintf(_UE_USERSNCONNECTIONS, getNameFormat($user->name, $user->username, $ueConfig['name_format'])) . "</h3>";
}
}
$return .= $this->_writeTabDescription($tab, $user);
$live_site = $_CB_framework->getCfg('live_site');
$boxHeight = $ueConfig['thumbHeight'] + 46;
$boxWidth = $ueConfig['thumbWidth'] + 28;
foreach ($connections as $connection) {
$conAvatar = getFieldValue('image', $connection->avatar, $connection);
$emailIMG = getFieldValue('primaryemailaddress', $connection->email, $connection, null, 1);
$pmIMG = getFieldValue('pm', $connection->username, $connection, null, 1);
$onlineIMG = $ueConfig['allow_onlinestatus'] == 1 ? getFieldValue('status', null, $connection, null, 1) : "";
if ($connection->accepted == 1 && $connection->pending == 1) {
$actionIMG = '<img src="' . $live_site . '/components/com_comprofiler/images/pending.png" border="0" alt="' . _UE_CONNECTIONPENDING . "\" title=\"" . _UE_CONNECTIONPENDING . "\" /> <a href=\"" . cbSef("index.php?option=com_comprofiler&act=connections&task=removeConnection&connectionid=" . $connection->memberid) . "\" onclick=\"return confirmSubmit();\" ><img src=\"" . $live_site . "/components/com_comprofiler/images/publish_x.png\" border=\"0\" alt=\"" . _UE_REMOVECONNECTION . "\" title=\"" . _UE_REMOVECONNECTION . "\" /></a>";
} elseif ($connection->accepted == 1 && $connection->pending == 0) {
$actionIMG = "<a href=\"" . cbSef("index.php?option=com_comprofiler&act=connections&task=removeConnection&connectionid=" . $connection->memberid) . "\" onclick=\"return confirmSubmit();\" ><img src=\"" . $live_site . "/components/com_comprofiler/images/publish_x.png\" border=\"0\" alt=\"" . _UE_REMOVECONNECTION . "\" title=\"" . _UE_REMOVECONNECTION . "\" /></a>";
} elseif ($connection->accepted == 0) {
$actionIMG = "<a href=\"" . cbSef("index.php?option=com_comprofiler&act=connections&task=acceptConnection&connectionid=" . $connection->memberid) . '"><img src="' . $live_site . "/components/com_comprofiler/images/tick.png\" border=\"0\" alt=\"" . _UE_ACCEPTCONNECTION . "\" title=\"" . _UE_ACCEPTCONNECTION . "\" /></a> <a href=\"" . cbSef("index.php?option=com_comprofiler&act=connections&task=removeConnection&connectionid=" . $connection->memberid) . '"><img src="' . $live_site . "/components/com_comprofiler/images/publish_x.png\" border=\"0\" alt=\"" . _UE_REMOVECONNECTION . "\" title=\"" . _UE_DECLINECONNECTION . "\" /></a>";
}
$tipField = "<b>" . _UE_CONNECTEDSINCE . "</b> : " . dateConverter($connection->membersince, 'Y-m-d', $ueConfig['date_format']);
if (getLangDefinition($connection->type) != null) {
$tipField .= "<br /><b>" . _UE_CONNECTIONTYPE . "</b> : " . getConnectionTypes($connection->type);
}
if ($connection->description != null) {
$tipField .= "<br /><b>" . _UE_CONNECTEDCOMMENT . "</b> : " . htmlspecialchars($connection->description);
}
$tipTitle = _UE_CONNECTEDDETAIL;
$htmltext = $conAvatar;
$style = "style=\"padding:5px;\"";
$tooltipAvatar = cbFieldTip($ui, $tipField, $tipTitle, '250', '', $htmltext, '', $style, '', false);
if ($_CB_framework->myId() == $user->id) {
$return .= "<div class=\"connectionBox\" style=\"position:relative;height:" . ($boxHeight + 24) . "px;width:" . $boxWidth . "px;\">" . "<div style=\"position:absolute; top:3px; width:auto;left:5px;right:5px;\">" . $actionIMG . '</div>' . "<div style=\"position:absolute; top:18px; width:auto;left:5px;right:5px;\">" . $tooltipAvatar . '</div>' . "<div style=\"position:absolute; bottom:0px; width:auto;left:5px;right:5px;\">" . $onlineIMG . " " . getNameFormat($connection->name, $connection->username, $ueConfig['name_format']) . "<br /><a href=\"" . cbSef("index.php?option=com_comprofiler&task=userProfile&user=" . $connection->memberid) . '"><img src="' . $live_site . "/components/com_comprofiler/images/profiles.gif\" border=\"0\" alt=\"" . _UE_VIEWPROFILE . "\" title=\"" . _UE_VIEWPROFILE . "\" /></a> " . $emailIMG . " " . $pmIMG . "\n";
} else {
$return .= "<div class=\"connectionBox\" style=\"position:relative;height:" . $boxHeight . "px;width:" . $boxWidth . "px;\">" . "<div style=\"position:absolute; top:10px; width:auto;left:5px;right:5px;\">" . $tooltipAvatar . '</div>' . "<div style=\"position:absolute; bottom:0px; width:auto;left:5px;right:5px;\">" . $onlineIMG . " " . getNameFormat($connection->name, $connection->username, $ueConfig['name_format']) . "\n";
}
$return .= "</div></div>\n";
}
$return .= "<div style=\"clear:both;\"> </div>";
// Add paging control at end of list if paging enabled
//.........这里部分代码省略.........
示例4: sendNotification
/**
* Sends a PM or Email notification with substitutions based off configuration
*
* @param int $type 1: Email, 2: PM, 3: Moderators, 4: Auto
* @param UserTable|int|null $from
* @param UserTable|int|string $to
* @param string $subject
* @param string $body
* @param GroupTable $group
* @param array $extra
* @return bool
*/
static public function sendNotification( $type, $from, $to, $subject, $body, $group, $extra = array() )
{
global $_CB_framework, $_PLUGINS;
if ( ( ! $subject ) || ( ! $body ) || ( ! $group->get( 'id' ) ) || ( $group->get( 'published', 1 ) != 1 ) || ( ! $group->category()->get( 'published', 1 ) ) || ( ! $to ) ) {
return false;
}
if ( $from instanceof UserTable ) {
$fromUser = $from;
} elseif ( is_int( $from ) ) {
$fromUser = \CBuser::getUserDataInstance( $from );
} else {
$fromUser = null;
}
if ( $to instanceof UserTable ) {
$toUser = $to;
} elseif ( is_int( $to ) ) {
$toUser = \CBuser::getUserDataInstance( $to );
} else {
$toUser = null;
}
if ( $fromUser && $toUser && ( $fromUser->get( 'id' ) == $toUser->get( 'id' ) ) ) {
return false;
}
static $plugin = null;
static $params = null;
if ( ! $params ) {
$plugin = $_PLUGINS->getLoadedPlugin( 'user', 'cbgroupjive' );
$params = $_PLUGINS->getPluginParams( $plugin );
}
$notifyBy = (int) $params->get( 'notifications_notifyby', 1 );
$fromName = $params->get( 'notifications_from_name', null );
$fromEmail = $params->get( 'notifications_from_address', null );
$cbUser = \CBuser::getInstance( ( $fromUser ? (int) $fromUser->get( 'id' ) : ( $toUser ? (int) $toUser->get( 'id' ) : 0 ) ), false );
$user = $cbUser->getUserData();
$extras = array( 'category_id' => (int) $group->category()->get( 'id' ),
'category_name' => ( $group->category()->get( 'id' ) ? CBTxt::T( $group->category()->get( 'name' ) ) : CBTxt::T( 'Uncategorized' ) ),
'category' => '<a href="' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'categories', 'func' => 'show', 'id' => (int) $group->get( 'category' ) ) ) . '">' . ( $group->category()->get( 'id' ) ? CBTxt::T( $group->category()->get( 'name' ) ) : CBTxt::T( 'Uncategorized' ) ) . '</a>',
'group_id' => (int) $group->get( 'id' ),
'group_name' => htmlspecialchars( CBTxt::T( $group->get( 'name' ) ) ),
'group' => '<a href="' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'groups', 'func' => 'show', 'id' => (int) $group->get( 'id' ) ) ) . '">' . htmlspecialchars( CBTxt::T( $group->get( 'name' ) ) ) . '</a>',
'user' => '<a href="' . $_CB_framework->viewUrl( 'userprofile', false, array( 'user' => (int) $user->get( 'id' ) ) ) . '">' . getNameFormat( $user->get( 'name' ), $user->get( 'username' ), Application::Config()->get( 'name_format', 3 ) ) . '</a>'
);
if ( ! $toUser ) {
$extras['email'] = $to;
$extras['name'] = $to;
$extras['username'] = $to;
}
$extras = array_merge( $extras, $extra );
$subject = $cbUser->replaceUserVars( $subject, true, false, $extras, false );
$body = $cbUser->replaceUserVars( $body, false, false, $extras, false );
if ( $type == 4 ) {
$type = ( $notifyBy == 2 ? 2 : 1 );
}
$notification = new \cbNotification();
if ( $type == 3 ) {
// Moderator Notification:
$notification->sendToModerators( $subject, $body, false, 1 );
} elseif ( ( $type == 2 ) && $toUser ) {
// PM Notification:
if ( ! $toUser->get( 'id' ) ) {
return false;
}
$notification->sendUserPMSmsg( $toUser, 0, $subject, $body, true, false, 1, $extras );
} else {
// Email Notification:
if ( $toUser ) {
if ( ! $toUser->get( 'id' ) ) {
return false;
}
$notification->sendFromSystem( $toUser, $subject, $body, 1, 1, null, null, null, $extras, true, $fromName, $fromEmail );
} else {
$userTo = new UserTable();
//.........这里部分代码省略.........
示例5: _invoicesTitle
/**
* Computes text for the title of the invoices list
*
* @param int $invoicesNumber array of cbpaidPaymentBasket of Completed and Pending baskets
* @param UserTable $user reflecting the user being displayed (here null)
* @param boolean $itsmyself user is logged in user
* @param string $periodText if non-empty, text of the period showing invoices
* @return string
*/
protected function _invoicesTitle($invoicesNumber, $user, $itsmyself, $periodText)
{
global $ueConfig;
if ($itsmyself) {
if ($periodText) {
$plansTitle = sprintf(CBPTXT::Th("Your invoices of last %s"), htmlspecialchars($periodText));
} else {
if ($invoicesNumber == 1) {
$plansTitle = CBPTXT::Th("Your invoice");
} else {
$plansTitle = CBPTXT::Th("Your invoices");
}
}
} else {
if ($periodText) {
$plansTitle = sprintf(CBPTXT::Th("%s's invoices of last %s"), getNameFormat($user->name, $user->username, $ueConfig['name_format']), htmlspecialchars($periodText));
} else {
$plansTitle = sprintf(CBPTXT::Th("%s's invoices"), getNameFormat($user->name, $user->username, $ueConfig['name_format']));
}
}
return $plansTitle;
}
示例6: getDisplayTab
//.........这里部分代码省略.........
$return = null;
if (!$ueConfig['allowConnections'] || isset($ueConfig['connectionDisplay']) && $ueConfig['connectionDisplay'] == 1 && $_CB_framework->myId() != $user->id) {
return null;
}
$js = "if ( typeof confirmSubmit != 'function' ) {" . "function confirmSubmit() {" . "if ( confirm( '" . addslashes(CBTxt::T('UE_CONFIRMREMOVECONNECTION', 'Are you sure you want to remove this connection?')) . "' ) ) {" . "return true;" . "} else {" . "return false;" . "}" . "};" . "}";
$_CB_framework->document->addHeadScriptDeclaration($js);
$params = $this->params;
$con_ShowSummary = $params->get('con_ShowSummary', '0');
$con_SummaryEntries = $params->get('con_SummaryEntries', '4');
$con_pagingenabled = $params->get('con_PagingEnabled', '1');
$con_entriesperpage = $params->get('con_EntriesPerPage', '10');
$pagingParams = $this->_getPaging(array(), array('connshow_'));
$showall = $this->_getReqParam("showall", false);
if ($con_ShowSummary && !$showall && $pagingParams['connshow_limitstart'] === null) {
$summaryMode = true;
$showpaging = false;
$con_entriesperpage = $con_SummaryEntries;
} else {
$summaryMode = false;
$showpaging = $con_pagingenabled;
}
$isVisitor = null;
if ($_CB_framework->myId() != $user->id) {
$isVisitor = "\n AND m.pending=0 AND m.accepted=1";
}
if ($showpaging || $summaryMode) {
//select a count of all applicable entries for pagination
if ($isVisitor) {
$contotal = $this->_getUserNumberOfConnections($user);
} else {
$query = "SELECT COUNT(*)" . "\n FROM #__comprofiler_members AS m" . "\n LEFT JOIN #__comprofiler AS c ON m.memberid=c.id" . "\n LEFT JOIN #__users AS u ON m.memberid=u.id" . "\n WHERE m.referenceid=" . (int) $user->id . "\n AND c.approved=1 AND c.confirmed=1 AND c.banned=0 AND u.block=0" . $isVisitor;
$_CB_database->setQuery($query);
$contotal = $_CB_database->loadResult();
if (!is_numeric($contotal)) {
$contotal = 0;
}
}
} else {
$contotal = 0;
}
if (!$showpaging || $pagingParams['connshow_limitstart'] === null || $con_entriesperpage > $contotal) {
$pagingParams['connshow_limitstart'] = 0;
}
$query = "SELECT m.*,u.name,u.email,u.username,c.avatar,c.avatarapproved, u.id" . "\n FROM #__comprofiler_members AS m" . "\n LEFT JOIN #__comprofiler AS c ON m.memberid=c.id" . "\n LEFT JOIN #__users AS u ON m.memberid=u.id" . "\n WHERE m.referenceid=" . (int) $user->id . "" . "\n AND c.approved=1 AND c.confirmed=1 AND c.banned=0 AND u.block=0" . $isVisitor . "\n ORDER BY m.membersince DESC, m.memberid ASC";
$_CB_database->setQuery($query, (int) ($pagingParams['connshow_limitstart'] ? $pagingParams['connshow_limitstart'] : 0), (int) $con_entriesperpage);
$connections = $_CB_database->loadObjectList();
if (!count($connections) > 0) {
$return .= CBTxt::Th('UE_NOCONNECTIONS', 'This user has no current connections.');
return $return;
}
$return .= $this->_writeTabDescription($tab, $user);
foreach ($connections as $connection) {
$cbUser = CBuser::getInstance((int) $connection->id);
if (!$cbUser) {
$cbUser = CBuser::getInstance(null);
}
$tipField = getConnectionTab::renderConnectionToolTip($connection);
$tipTitle = CBTxt::T('UE_CONNECTEDDETAIL', 'Connection Details');
$htmlText = $cbUser->getField('avatar', null, 'html', 'none', 'list', 0, true);
$tooltip = cbTooltip(1, $tipField, $tipTitle, 300, null, $htmlText, null, 'style="display: inline-block; padding: 5px;"');
if ($connection->accepted == 1 && $connection->pending == 1) {
$actionImg = '<span class="fa fa-clock-o fa-lg" title="' . htmlspecialchars(CBTxt::T('UE_CONNECTIONPENDING', 'Connection Pending')) . '"></span>' . ' <a href="' . $_CB_framework->viewUrl('removeconnection', true, array('act' => 'connections', 'connectionid' => (int) $connection->memberid)) . '" onclick="return confirmSubmit();" >' . '<span class="fa fa-times-circle-o fa-lg" title="' . htmlspecialchars(CBTxt::T('UE_REMOVECONNECTION_DESC', 'Remove Connection to that user')) . '"></span>' . '</a>';
} elseif ($connection->accepted == 1 && $connection->pending == 0) {
$actionImg = '<a href="' . $_CB_framework->viewUrl('removeconnection', true, array('act' => 'connections', 'connectionid' => (int) $connection->memberid)) . '" onclick="return confirmSubmit();" >' . '<span class="fa fa-times-circle-o fa-lg" title="' . htmlspecialchars(CBTxt::T('UE_REMOVECONNECTION', 'Remove Connection')) . '"></span>' . '</a>';
} elseif ($connection->accepted == 0) {
$actionImg = '<a href="' . $_CB_framework->viewUrl('acceptconnection', true, array('act' => 'connections', 'connectionid' => (int) $connection->memberid)) . '" >' . '<span class="fa fa-check-circle-o fa-lg" title="' . htmlspecialchars(CBTxt::T('UE_ACCEPTCONNECTION', 'Accept Connection')) . '"></span>' . '</a>' . ' <a href="' . $_CB_framework->viewUrl('removeconnection', true, array('act' => 'connections', 'connectionid' => (int) $connection->memberid)) . '" onclick="return confirmSubmit();" >' . '<span class="fa fa-times-circle-o fa-lg" title="' . htmlspecialchars(CBTxt::T('UE_REMOVECONNECTION', 'Remove Connection')) . '"></span>' . '</a>';
} else {
$actionImg = null;
}
if ($_CB_framework->myId() == $user->id) {
$return .= '<div class="containerBox img-thumbnail">' . '<div class="containerBoxInner" style="min-height: 130px; min-width: 90px;">' . $actionImg . '<br />' . $cbUser->getField('onlinestatus', null, 'html', 'none', 'profile', 0, true, array('_imgMode' => 1)) . ' ' . $cbUser->getField('formatname', null, 'html', 'none', 'list', 0, true) . '<br />' . $tooltip . '<br />' . ' <a href="' . $_CB_framework->userProfileUrl((int) $connection->memberid) . '">' . '<span class="fa fa-user" title="' . htmlspecialchars(CBTxt::T('UE_VIEWPROFILE', 'View Profile')) . '"></span>' . '</a>' . ' ' . $cbUser->getField('email', null, 'html', 'none', 'profile', 0, true, array('_imgMode' => 1)) . ' ' . $cbUser->getField('pm', null, 'html', 'none', 'profile', 0, true, array('_imgMode' => 1)) . '</div>' . '</div>';
} else {
$return .= '<div class="containerBox img-thumbnail">' . '<div class="containerBoxInner" style="min-height: 100px; min-width: 90px;">' . $cbUser->getField('onlinestatus', null, 'html', 'none', 'profile', 0, true, array('_imgMode' => 1)) . ' ' . $cbUser->getField('formatname', null, 'html', 'none', 'list', 0, true) . '<br />' . $tooltip . '</div>' . '</div>';
}
}
$return .= '<div class="clearfix"></div>';
// Add paging control at end of list if paging enabled
if ($showpaging && $con_entriesperpage < $contotal) {
$return .= '<div class="text-center">' . $this->_writePaging($pagingParams, 'connshow_', $con_entriesperpage, $contotal) . '</div>';
}
if ($con_ShowSummary && $_CB_framework->myId() == $user->id || $summaryMode && $con_entriesperpage < $contotal) {
$return .= '<div class="connSummaryFooter clearfix">';
if ($_CB_framework->myId() == $user->id) {
// Manage connections link:
$return .= '<div id="connSummaryFooterManage" class="pull-left">' . '<a href="' . $_CB_framework->viewUrl('manageconnections') . '" >[' . CBTxt::Th('UE_MANAGECONNECTIONS', 'Manage Connections') . ']</a>' . '</div>';
}
if ($summaryMode && $con_entriesperpage < $contotal) {
// See all of user's ## connections
$return .= '<div id="connSummaryFooterSeeConnections" class="pull-right">' . '<a href="' . $this->_getAbsURLwithParam(array('showall' => 1)) . '">';
if ($_CB_framework->myId() == $user->id) {
$return .= sprintf(CBTxt::Th('UE_SEEALLNCONNECTIONS', 'See all %s connections'), $contotal);
} else {
$return .= sprintf(CBTxt::Th('UE_SEEALLOFUSERSNCONNECTIONS', 'See all of %s\'s %s connections'), getNameFormat($user->name, $user->username, $ueConfig['name_format']), "<strong>" . $contotal . "</strong>");
}
$return .= '</a>' . '</div>';
}
$return .= '</div>';
}
return $return;
}
示例7: getDisplayTab
/**
* Generates the HTML to display the user profile tab
*
* @param TabTable $tab the tab database entry
* @param UserTable $user the user being displayed
* @param int $ui 1 for front-end, 2 for back-end
* @return mixed Either string HTML for tab content, or false if ErrorMSG generated
*/
public function getDisplayTab($tab, $user, $ui)
{
global $ueConfig;
$params = $this->params;
$title = cbReplaceVars($params->get('title', '_UE_PROFILE_TITLE_TEXT'), $user);
$name = getNameFormat($user->name, $user->username, $ueConfig['name_format']);
$return = (sprintf($title, $name) ? '<div class="page-header cbProfileTitle"><h3>' . sprintf($title, $name) . '</h3></div>' : null) . $this->_writeTabDescription($tab, $user);
return $return;
}
示例8: _bbeditor
/**
* BBcode editor
*
* @uses $this->pbconfig->EnableRating, $this->pbconfig->ShowTitle, $this->pbconfig->ShowName, $this->pbconfig->ShowEmail, $this->pbconfig->UseLocation, $this->pbconfig->LocationField, $this->pbconfig->UseWebAddress, $this->pbconfig->WebField, $this->pbconfig->AllowBBCode, $this->pbconfig->AllowSmiles, $this->pbconfig->Captcha
*
* @param pbProfileBookEntry $item
* @param string $idTag
* @param string $htmlAreaLabel
* @param string $txtSubmit
* @param UserTable $curruser
* @param boolean $required
* @return string
*/
function _bbeditor( $item, $idTag, $htmlAreaLabel, $txtSubmit, $curruser, $required )
{
global $_CB_framework, $ueConfig;
$myId = Application::MyUser()->getUserId();
$newOrMe = ( ( $item->posterid == -1 ) || ( $item->posterid == $myId ) );
$htmltext = '<div class="cbpbEditorContainer" id="div' . $idTag . '">';
//get the CB initiatied form action path this is used for all forms
$base_url = $this->_getAbsURLwithParam( array() );
$htmltext .= '<form name="admin' . $idTag . '" id="admin' . $idTag . '" method="post" onsubmit="javascript: return pb_submitForm(this);" action="' . $base_url . "\">\n";
$htmltext .= '<input type="hidden" name="' . $this->_getPagingParamName( 'formaction' . $this->pbconfig->MainMode[0] ) . '" value="' . ( $item->_pbid ? 'edit' : 'new' ) . "\" />\n";
if ( $item->_pbid ) {
$htmltext .= '<input type="hidden" name="' . $this->_getPagingParamName( 'id' ) . '" value="' . $item->_pbid . "\" />\n";
}
if ( $this->pbconfig->AllowBBCode ) {
$editor = $this->getEditor( $idTag );
} else {
$editor = null;
}
$htmltext .= "<table width=\"100%\">\n";
$locationField = null;
//Check to see if the Location field should be used
if ( $this->pbconfig->UseLocation ) {
//Check to see if a registered user is logged in and if the admin has defined a a value for the location field
if ( $myId && ( $this->pbconfig->LocationField != 0 ) && $newOrMe ) {
$locationField = new FieldTable();
$locationField->load( $this->pbconfig->LocationField );
$naLocationField = $locationField->name;
//if they true then display the location value from the users cb profile in read only
$locationField = '<td class="titleCell">' . CBTxt::th( "Location" ) . ':<br /><input type="hidden" name="' . $this->_getPagingParamName( 'posterlocation' ) . '" value="' . htmlspecialchars( $curruser->$naLocationField ) . '" />' . htmlspecialchars( $curruser->$naLocationField ) . '</td>';
} else {
//else display an entry field to capture the location
$locationField = '<td class="titleCell">' . CBTxt::th( "Location" ) . ':<br /><input class="inputbox" type="text" name="' . $this->_getPagingParamName( 'posterlocation' ) . '" value="' . htmlspecialchars( $item->posterlocation ) . '" /></td>';
}
}
$webField = null;
if ( $this->pbconfig->UseWebAddress ) {
if ( $myId && ( $this->pbconfig->WebField != 0 ) && $newOrMe ) {
$webfield = new FieldTable();
$webfield->load( $this->pbconfig->WebField );
$naWebField = $webfield->name;
$webField = '<td class="titleCell">' . CBTxt::th( "Web Address" ) . ':<br /><input type="hidden" name="' . $this->_getPagingParamName( 'posterurl' ) . '" value="' . $curruser->$naWebField . '" />' . $this->_displayWebAddress( $curruser->$naWebField ) . '</td>';
} else {
$webField = '<td class="titleCell">' . CBTxt::th( "Web Address" ) . ':<br /><input class="inputbox" type="text" name="' . $this->_getPagingParamName( 'posterurl' ) . '" value="' . htmlspecialchars( $item->posterurl ) . '" /></td>';
}
}
$htmltext .= "\n<tr>";
if ( ! $myId ) {
$htmltext .= '<td class="titleCell">' . CBTxt::th( "Name" ) . ':<br /><input class="inputbox" type="text" name="' . $this->_getPagingParamName( 'postername' ) . '" value="' . htmlspecialchars( $item->postername ) . '" /></td>';
$htmltext .= '<td class="titleCell">' . CBTxt::th( "Email" ) . ':<br /><input class="inputbox" type="text" name="' . $this->_getPagingParamName( 'posteremail' ) . '" value="' . htmlspecialchars( $item->posteremail ) . '" /></td>';
} else {
$htmlName = ( $item->postername ? htmlspecialchars( $item->postername ) : getNameFormat( $curruser->name, $curruser->username, $ueConfig['name_format'] ) );
if ( $this->pbconfig->ShowName ) {
$htmltext .= '<td class="titleCell">' . CBTxt::th( "Name" ) . ':<br /><input type="hidden" name="' . $this->_getPagingParamName( 'postername' ) . '" value="' . $htmlName . '" />' . $htmlName . '</td>';
} else {
$htmltext .= '<td><input type="hidden" name="' . $this->_getPagingParamName( 'postername' ) . '" value="' . $htmlName . '" /></td>';
}
if ( $this->pbconfig->ShowEmail ) {
$htmltext .= '<td class="titleCell">' . CBTxt::th( "Email" ) . ':<br />';
if ( ! $item->posteremail || $myId == $item->posterid || Application::MyUser()->isAuthorizedToPerformActionOnAsset( 'core.manage', 'com_users' ) ) {
$htmltext .= '<input type="hidden" name="' . $this->_getPagingParamName( 'posteremail' ) . '" value="' . ( $item->posteremail ? htmlspecialchars( $item->posteremail ) : htmlspecialchars( $curruser->email ) ) . '" />' . ( $item->posteremail ? htmlspecialchars( $item->posteremail ) : htmlspecialchars( $curruser->email ) );
} else {
$htmltext .= CBTxt::th( "Hidden" );
}
} else {
if ( ! $item->posteremail || $myId == $item->posterid || Application::MyUser()->isAuthorizedToPerformActionOnAsset( 'core.manage', 'com_users' ) ) {
$htmltext .= '<td><input type="hidden" name="' . $this->_getPagingParamName( 'posteremail' ) . '" value="' . ( $item->posteremail ? htmlspecialchars( $item->posteremail ) : htmlspecialchars( $curruser->email ) ) . '" /></td>';
}
}
}
$htmltext .= '</tr>';
//Check to see if we are displaying the web address or location field. If we are then add a row for them
if ( $webField != null || $locationField != null ) {
$htmltext .= "\n<tr>" . $locationField . $webField . '</tr>';
}
$htmltext .= '<tr><td colspan="2">';
//Check to see if the admin has enabled rating for profile entries
if ( $this->pbconfig->EnableRating && ( $myId != $item->userid ) ) {
//Yep its enabled so get the ratings HTML/Code
$htmltext .= '<div class="titleCell">' . CBTxt::Th( "User Rating" ) . ':</div>'
//.........这里部分代码省略.........
示例9: cbSetTitlePath
/**
* Computes page title, sets page title and pathway
*
* @param UserTable $user
* @param string $thisUserTitle Title if it's the user displaying
* @param string $otherUserTitle Title if it's another user displayed
* @return string title (plaintext, without htmlspecialchars or slashes)
*/
function cbSetTitlePath($user, $thisUserTitle, $otherUserTitle)
{
global $ueConfig, $_CB_framework;
$title = null;
if ($_CB_framework->myId() == $user->id) {
if ($thisUserTitle) {
$title = $thisUserTitle;
}
} else {
if ($otherUserTitle) {
$name = getNameFormat($user->name, $user->username, $ueConfig['name_format']);
$title = sprintf($otherUserTitle, $name);
}
}
if ($title) {
$_CB_framework->setPageTitle($title);
$_CB_framework->appendPathWay(htmlspecialchars($title));
}
return $title;
}
示例10: getEditTab
/**
* Generates the HTML to display the user edit tab
*
* @param TabTable $tab the tab database entry
* @param UserTable $user the user being displayed
* @param int $ui 1 for front-end, 2 for back-end
* @return mixed either string HTML for tab content, or false if ErrorMSG generated
*/
public function getEditTab( $tab, $user, $ui ) {
global $ueConfig, $_CB_framework;
$return = '';
if ( ( $ui != 2 ) /* || ( $_CB_framework->myId() == $user->id ) */ ) {
return $return;
}
cbpaidErrorHandler::on();
if ( cbpaidApp::authoriseAction( 'cbsubs.usersubscriptionview' ) ) {
$params = $this->params;
$paidsubsManager =& cbpaidSubscriptionsMgr::getInstance();
$paidsubsManager->checkExpireMe( __FUNCTION__ );
if ( $user->id ) {
$basketsMgr =& cbpaidOrdersMgr::getInstance();
$basketsMgr->timeoutUnusedBaskets( $user->id );
}
$title = CBPTXT::Th( $params->get( 'profileTitle', "Your subscriptions" ));
if ( $title ) {
$name = getNameFormat( $user->name, $user->username, $ueConfig['name_format'] );
$return .= '<div class="contentheading" id="cbregProfileTitle">' . sprintf( $title, $name ) . "</div>\n";
}
$return .= $this->_writeTabDescription( $tab, $user );
$itsmyself = ( $_CB_framework->myId() == $user->id );
$subscriptionsGUI = new cbpaidControllerUI();
$return .= $subscriptionsGUI->getShowSubscriptionUpgrades( $user, $itsmyself );
}
cbpaidErrorHandler::off();
return $return;
/*
global $_CB_framework;
$params = $this->params;
$exampleText = $params->get('exampletext', 'Text Parameter not set!');
$xmlfile = $_CB_framework->getCfg( 'absolute_path' ) . '/components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/cbpaidsubscriptions.xml';
$this->userParams = new Registry( $user->cb_subs_params, $xmlfile, $maintagname='cbinstall', $attrname='type', $attrvalue='plugin', $paramsnode='params' );
$ret = $this->userParams->render( $pluginId=null, $tabId=null, $tag_name='userparams',$attr='class',$attrvalue='getcbpaidsubscriptionsTab', $control_name='subscriptionparams', $paramstextarea=false );
return $ret;
*/
}
示例11: _sendEmailMSG
function _sendEmailMSG($to, $from, $sub, $msg, $addPrefix = false, $mode = 0, $cc = null, $bcc = null, $attachment = null)
{
//BB: add html
global $_CB_framework, $ueConfig, $_SERVER;
if ($addPrefix) {
$uname = getNameFormat($from->name, $from->username, $ueConfig['name_format']);
$premessage = sprintf(_UE_SENDEMAILNOTICE, $uname, cb_html_entity_decode_all($_CB_framework->getCfg('sitename')), $_CB_framework->getCfg('live_site'));
if (isset($ueConfig['allow_email_replyto']) && $ueConfig['allow_email_replyto'] == 2) {
$premessage .= sprintf(_UE_SENDEMAILNOTICE_REPLYTO, $uname, $from->email);
}
$postmessage = sprintf(_UE_SENDEMAILNOTICE_DISCLAIMER, cb_html_entity_decode_all($_CB_framework->getCfg('sitename')));
// $premessage .= sprintf(_UE_SENDEMAILNOTICE_MESSAGEHEADER, $uname);
$msg = $premessage . $msg . $postmessage;
$from->name = $uname . " @ " . cb_html_entity_decode_all($_CB_framework->getCfg('sitename'));
// $ueConfig['reg_email_name']
}
// if (class_exists("mosPHPMailer")) {
$res = comprofilerMail($from->email, $from->name, $to->email, $sub, $msg, $mode, $cc, $bcc, $attachment, $from->replytoEmail, $from->replytoName);
/* } else if (function_exists( 'mosMail' )) {
$res = mosMail($from->email, $from->name, $to->email, $sub, $msg);
} else { //TODO drop this once we are dedicated to >= 4.5.2
$EOL = defined( 'PHP_EOL' ) ? PHP_EOL : '\n'; // assume Linux for old systems.
$header = "MIME-Version: 1.0" . $EOL;
$header .= "Content-type: text/plain; charset=" . $_CB_framework->outputCharset() . $EOL;
$header .= "Content-Transfer-encoding: 8bit" . $EOL;
$fromTag = $from->name." <" . $from->email . ">";
$header .= "From: ".$fromTag. $EOL;
$replyTag = $from->replytoName." <" . $from->replytoEmail . ">";
$header .= "Reply-To: ".$replyTag. $EOL;
$header .= "Organization: ".cb_html_entity_decode_all($_CB_framework->getCfg( 'sitename' )). $EOL;
$header .= "Message-ID: <".md5(uniqid(time()))."@{$_SERVER['SERVER_NAME']}>" . $EOL;
$header .= "Return-Path: ".$from->email. $EOL;
$header .= "X-Priority: 3" . $EOL;
$header .= "X-MSmail-Priority: Low" . $EOL;
$header .= "X-Mailer: PHP\r\n"; //hotmail and others dont like PHP mailer. --Microsoft Office Outlook, Build 11.0.5510
$header .= "X-Sender: ".$from->email. $EOL . $EOL;
$res = mail($to->email, $sub, $msg, $header);
}
*/
return $res;
}
示例12: getDisplayTab
/**
* Generates the HTML to display the user profile tab
* @param moscomprofilerTab $tab the tab database entry
* @param moscomprofilerUser $user the user being displayed
* @param int $ui 1 for front-end, 2 for back-end
* @return mixed either string HTML for tab content, or false if ErrorMSG generated
*/
function getDisplayTab($tab, $user, $ui)
{
global $ueConfig;
// Display user's name + "Profile Page"
$params = $this->params;
$title = cbReplaceVars($params->get('title', '_UE_PROFILE_TITLE_TEXT'), $user);
$name = getNameFormat($user->name, $user->username, $ueConfig['name_format']);
$return = '<div class="contentheading" id="cbProfileTitle">' . sprintf($title, $name) . "</div>\n";
$return .= $this->_writeTabDescription($tab, $user);
return $return;
}
示例13: manageConnections
static function manageConnections($connections, $actions, $total, &$connMgmtTabs, &$pagingParams, $perpage, $connecteds = null)
{
global $_CB_framework, $ueConfig, $_REQUEST;
$Itemid = $_CB_framework->itemid();
$ui = 1;
outputCbTemplate($ui);
initToolTip(1);
ob_start();
?>
var tabPanemyCon;
function showCBTabPaneMy( sName ) {
if (typeof tabPanemyCon != "undefined" ) {
switch ( sName.toLowerCase() ) {
case "<?php
echo strtolower(_UE_MANAGEACTIONS);
?>
":
case "manageactions":
case "0":
tabPanemyCon.setSelectedIndex( 0 );
break;
case "<?php
echo strtolower(_UE_MANAGECONNECTIONS);
?>
":
case "manageconnections":
case "1":
tabPanemyCon.setSelectedIndex( 1 );
break;
case "<?php
echo strtolower(_UE_CONNECTEDWITH);
?>
":
case "connectedfrom":
case "2":
tabPanemyCon.setSelectedIndex( 2 );
break;
}
}
}
<?php
$cbjavascript = ob_get_contents();
ob_end_clean();
$_CB_framework->outputCbJQuery($cbjavascript);
ob_start();
?>
function confirmSubmit() {
if (confirm("<?php
echo _UE_CONFIRMREMOVECONNECTION;
?>
"))
return true ;
else
return false ;
}
<?php
$cbjavascript = ob_get_contents();
ob_end_clean();
$_CB_framework->document->addHeadScriptDeclaration($cbjavascript);
$tabs = new cbTabs(0, $ui);
$cTypes = explode("\n", $ueConfig['connection_categories']);
$connectionTypes = array();
foreach ($cTypes as $cType) {
if (trim($cType) != null && trim($cType) != "") {
$connectionTypes[] = moscomprofilerHTML::makeOption(trim($cType), getLangDefinition(trim($cType)));
}
}
?>
<div class="contentheading"><?php
echo _UE_MANAGECONNECTIONS;
?>
</div><br />
<br />
<?php
echo $tabs->startPane("myCon");
// Tab 0: Manange Actions:
echo $tabs->startTab("myCon", _UE_MANAGEACTIONS . " (" . count($actions) . ")", "action");
if (!count($actions) > 0) {
echo "\t\t<div class=\"tab_Description\">" . _UE_NOACTIONREQUIRED . "</div>\n";
} else {
echo '<form method="post" action="' . cbSef('index.php?option=com_comprofiler&task=processConnectionActions' . ($Itemid ? "&Itemid=" . (int) $Itemid : "")) . '">';
echo "\t\t<div class=\"tab_Description\">" . _UE_CONNECT_ACTIONREQUIRED . "</div>\n";
// echo "<div style=\"width:100%;text-align:right;\"><input type=\"submit\" class=\"inputbox\" value=\""._UE_UPDATE."\" /></div>";
echo "<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" width=\"95%\">";
echo "<tr>";
echo "<td>";
foreach ($actions as $action) {
$conAvatar = null;
$conAvatar = getFieldValue('image', $action->avatar, $action);
$onlineIMG = $ueConfig['allow_onlinestatus'] == 1 ? getFieldValue('status', $action->isOnline, $action, null, 1) : "";
$tipField = "<b>" . _UE_CONNECTIONREQUIREDON . "</b> : " . dateConverter($action->membersince, 'Y-m-d', $ueConfig['date_format']);
if ($action->reason != null) {
$tipField .= "<br /><b>" . _UE_CONNECTIONMESSAGE . "</b> :<br />" . htmlspecialchars($action->reason, ENT_QUOTES);
}
$tipTitle = _UE_CONNECTIONREQUESTDETAIL;
$htmltext = $conAvatar;
$style = "style=\"padding:5px;\"";
$tooltip = cbFieldTip($ui, $tipField, $tipTitle, '250', '', $htmltext, '', $style, '', false);
echo "<div class=\"connectionBox\">";
echo $onlineIMG . ' ' . getNameFormat($action->name, $action->username, $ueConfig['name_format']) . "<br />" . $tooltip . "<br /><img src=\"components/com_comprofiler/images/tick.png\" border=\"0\" alt=\"" . _UE_ACCEPTCONNECTION . "\" title=\"" . _UE_ACCEPTCONNECTION . "\" /><input type=\"radio\" value=\"a\" checked=\"checked\" name=\"" . $action->id . "action\"/> <img src=\"components/com_comprofiler/images/publish_x.png\" border=\"0\" alt=\"" . _UE_DECLINECONNECTION . "\" title=\"" . _UE_DECLINECONNECTION . "\" /><input type=\"radio\" value=\"d\" name=\"" . $action->id . "action\"/><input type=\"hidden\" name=\"uid[]\" value=\"" . $action->id . "\" />";
//.........这里部分代码省略.........
示例14: userProfile
static function userProfile($user, $option, $submitvalue)
{
global $_CB_framework, $ueConfig, $_POST, $_PLUGINS;
$_PLUGINS->loadPluginGroup('user');
$_PLUGINS->trigger('onBeforeUserProfileRequest', array(&$user, 1));
if ($_PLUGINS->is_errors()) {
echo "<script type=\"text/javascript\">alert(\"" . $_PLUGINS->getErrorMSG() . "\"); window.history.go(-1); </script>\n";
exit;
}
$cbTemplate = HTML_comprofiler::_cbTemplateLoad();
$cbMyIsModerator = Application::MyUser()->isModeratorFor(Application::User((int) $user->id));
$cbUserIsModerator = Application::User((int) $user->id)->isGlobalModerator();
$showProfile = 1;
if ($user->banned != 0 || $user->block == 1 && $user->confirmed && $user->approved) {
if ($user->banned != 0) {
if ($_CB_framework->myId() != $user->id) {
$_CB_framework->enqueueMessage(CBTxt::T('UE_USERPROFILEBANNED', 'This profile has been banned by a moderator.') . ($user->bannedreason && $cbMyIsModerator ? '<p>' . nl2br($user->bannedreason) . '</p>' : null), 'error');
} else {
$_CB_framework->enqueueMessage(CBTxt::T('UE_BANNED_CHANGE_PROFILE', 'Your Profile is banned. Only you and moderators can see it.<br />Please follow the request of the moderator, then choose moderation / unban to submit a request for unbanning your profile.') . ($user->bannedreason ? '<p>' . nl2br($user->bannedreason) . '</p>' : null), 'error');
}
}
if ($user->block == 1) {
$_CB_framework->enqueueMessage(CBTxt::T('UE_USERPROFILEBLOCKED', 'This profile is no longer available.'), 'error');
}
if ($_CB_framework->myId() != $user->id && $cbMyIsModerator != 1) {
$showProfile = 0;
}
}
if (!$user->confirmed) {
$_CB_framework->enqueueMessage(CBTxt::T('UE_USER_NOT_CONFIRMED', 'This user has not yet confirmed his email address and account!'), 'error');
}
if (!$user->approved) {
$_CB_framework->enqueueMessage(CBTxt::T('UE_USER_NOT_APPROVED', 'This user has not yet been approved by a moderator!'), 'error');
}
if ((!$user->confirmed || !$user->approved) && $cbMyIsModerator != 1) {
$showProfile = 0;
}
if ($showProfile == 1) {
$results = $_PLUGINS->trigger('onBeforeUserProfileDisplay', array(&$user, 1, $cbUserIsModerator, $cbMyIsModerator));
if ($_PLUGINS->is_errors()) {
echo "<script type=\"text/javascript\">alert(\"" . $_PLUGINS->getErrorMSG() . "\"); window.history.go(-1); </script>\n";
exit;
}
$output = 'html';
$cbUser =& CBuser::getInstance($user->id);
$_CB_framework->displayedUser((int) $user->id);
$userViewTabs = $cbUser->getProfileView();
$_CB_framework->setPageTitle(cbUnHtmlspecialchars(getNameFormat($user->name, $user->username, $ueConfig['name_format'])));
$_CB_framework->appendPathWay(getNameFormat($user->name, $user->username, $ueConfig['name_format']));
outputCbTemplate(1);
initToolTip(1);
$pageClass = $_CB_framework->getMenuPageClass();
$return = '<div class="cbProfile cb_template cb_template_' . selectTemplate('dir') . ($pageClass ? ' ' . htmlspecialchars($pageClass) : null) . '">';
if (is_array($results)) {
$return .= implode('', $results);
}
$return .= $_PLUGINS->callTemplate($cbTemplate, 'Profile', 'drawProfile', array(&$user, &$userViewTabs), $output) . '</div>' . cbPoweredBy();
echo $return;
if ($_CB_framework->myId() != $user->id) {
recordViewHit($_CB_framework->myId(), $user->id, getenv('REMOTE_ADDR'));
}
$_PLUGINS->trigger('onAfterUserProfileDisplay', array($user, true));
$_CB_framework->setMenuMeta();
}
}
示例15: _notifyConnectionChange
/**
* Notifies connection changes
*
* @param int $userId
* @param int $connectionId
* @param string $msg
* @param string $subject
* @param string $messageHTML
* @param string $messageText
* @param string $userMessage
* @return boolean
*/
protected function _notifyConnectionChange( $userId, $connectionId, $msg, $subject, $messageHTML, $messageText, $userMessage = null )
{
global $_CB_framework, $ueConfig;
$rowFrom = new UserTable();
$rowFrom->load( (int) $userId );
$fromName = getNameFormat( $rowFrom->name, $rowFrom->username, $ueConfig['name_format'] );
$fromURL = 'index.php?option=com_comprofiler&view=userprofile&user=' . $userId . '&tab=1' . getCBprofileItemid(true);
$fromURL = cbSef( $fromURL );
if ( strncasecmp( 'http', $fromURL, 4 ) != 0 ) {
$fromURL = $_CB_framework->getCfg( 'live_site' ) . '/' . $fromURL;
}
$subject = sprintf( $subject, $fromName );
if ( $userMessage != null ) {
$messageHTML .= sprintf( str_replace( "\n", "\n<br />", CBTxt::T( 'UE_CONNECTIONMSGPREFIX', " %s included the following personal message:\n\n%s" ) ),
htmlspecialchars( $fromName ),
'<strong>' . htmlspecialchars( $userMessage ) . '</strong>' );
$messageText .= sprintf( str_replace( "\n", "\r\n", CBTxt::T( 'UE_CONNECTIONMSGPREFIX', " %s included the following personal message:\n\n%s" ) ),
$fromName,
$userMessage );
}
$notificationMsgHTML = sprintf( $messageHTML, '<strong><a href="' . $fromURL . '">' . htmlspecialchars( $fromName ) . '</a></strong>' );
$notificationMsgText = sprintf( $messageText, $fromName );
$manageURL = 'index.php?option=com_comprofiler&view=manageconnections' . getCBprofileItemid( true );
$manageURL = cbSef( $manageURL );
if ( strncasecmp( 'http', $manageURL, 4 ) != 0 ) {
$manageURL = $_CB_framework->getCfg( 'live_site' ) . '/' . $manageURL;
}
$notificationMsgHTML = $notificationMsgHTML
. "\n<br /><br /><a href=\"" . $manageURL . '">'
. CBTxt::T( 'UE_MANAGECONNECTIONS_LINK UE_MANAGECONNECTIONS', 'Manage Connections' )
. "</a>\n";
$notificationMsgText = $notificationMsgText
. "\r\n\r\n\r\n" . $fromName . ' '
. CBTxt::T( 'CONNECTION_PROFILE UE_PROFILE', 'Profile' )
. ': '
. cbUnHtmlspecialchars( $fromURL );
$notificationMsgText = $notificationMsgText
. "\r\n\r\n"
. CBTxt::T( 'UE_MANAGECONNECTIONS_URL_LABEL UE_MANAGECONNECTIONS', 'Manage Connections' )
. ': '
. cbUnHtmlspecialchars( $manageURL )
. "\r\n";
$notificationMsgHTML = '<div style="padding: 4px; margin: 4px 3px 6px 0px; background: #C44; font-weight: bold;" class="cbNotice">'
. CBTxt::T( 'UE_SENDPMSNOTICE', 'NOTE: This is a message generated automatically by the Connections system. It has the connecting user\'s address, so you can conveniently reply if you wish to.' )
. "</div>\n\n"
. $notificationMsgHTML;
$cbNotification = new cbNotification();
$cbNotification->sendFromUser( $connectionId, $userId, $subject, $notificationMsgHTML, $notificationMsgText );
$this->_setUserMSG( $msg );
return true;
}