本文整理汇总了PHP中userAnchor函数的典型用法代码示例。如果您正苦于以下问题:PHP userAnchor函数的具体用法?PHP userAnchor怎么用?PHP userAnchor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了userAnchor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: categoriesController_afterDiscussionLabels_handler
/**
*
*
* @param $Sender
* @param $Args
*/
public function categoriesController_afterDiscussionLabels_handler($Sender, $Args)
{
if (c('Vanilla.Discussions.Layout') != 'table') {
if (val('FirstUser', $Args)) {
echo '<span class="MItem DiscussionAuthor">' . userAnchor(val('FirstUser', $Args)) . '</span>';
}
}
}
示例2: categoriesController_afterDiscussionLabels_handler
/**
*
*
* @param $Sender
* @param $Args
*/
public function categoriesController_afterDiscussionLabels_handler($Sender, $Args)
{
if (!$this->hasLayoutTables() || isMobile()) {
if (val('FirstUser', $Args)) {
echo '<span class="MItem DiscussionAuthor">' . userAnchor(val('FirstUser', $Args)) . '</span>';
}
}
}
示例3: discussionModel_afterSaveDiscussion_handler
/**
* Post every new discussion to HipChat.
*
* @param PostController $sender
* @param array $args
*/
public function discussionModel_afterSaveDiscussion_handler($sender, $args)
{
// Make sure we have a valid discussion.
if (!$args['Discussion'] || !val('DiscussionID', $args['Discussion'])) {
return;
}
// Only trigger for new discussions.
if (!$args['Insert']) {
return;
}
// Prep HipChat message.
$author = Gdn::userModel()->getID(val('InsertUserID', $args['Discussion']));
$message = sprintf('%1$s: %2$s', userAnchor($author), anchor(val('Name', $args['Discussion']), discussionUrl($args['Discussion'])));
// Say it.
self::sayInHipChat($message);
}
示例4: anchor
<h3><?php
echo anchor(htmlspecialchars($Row['Title']), $Row['Url']);
?>
</h3>
<div class="Item-Body Media">
<?php
$Photo = userPhoto($Row, array('LinkClass' => 'Img'));
if ($Photo) {
echo $Photo;
}
?>
<div class="Media-Body">
<div class="Meta">
<?php
echo ' <span class="MItem-Author">' . sprintf(t('by %s'), userAnchor($Row)) . '</span>';
echo Bullet(' ');
echo ' <span clsss="MItem-DateInserted">' . Gdn_Format::date($Row['DateInserted'], 'html') . '</span> ';
if (isset($Row['Breadcrumbs'])) {
echo Bullet(' ');
echo ' <span class="MItem-Location">' . Gdn_Theme::Breadcrumbs($Row['Breadcrumbs'], false) . '</span> ';
}
if (isset($Row['Notes'])) {
echo ' <span class="Aside Debug">debug(' . $Row['Notes'] . ')</span>';
}
?>
</div>
<div class="Summary">
<?php
echo $Row['Summary'];
?>
示例5: printf
<?php
if (!defined('APPLICATION')) {
exit;
}
?>
<h1><?php
printf(t('Delete User: %s'), userAnchor($this->User));
?>
</h1>
<?php
echo $this->Form->open(array('class' => 'User'));
echo $this->Form->errors();
?>
<div class="Messages Errors" style="margin-bottom: 20px;">
<ul>
<li><?php
printf(t("By clicking the button below, you will be deleting the user account for %s forever."), wrap(htmlspecialchars($this->User->Name), 'strong'));
?>
</li>
<li><?php
if ($this->Method == 'keep') {
echo t("The user content will remain untouched.");
} else {
if ($this->Method == 'wipe') {
echo t("All of the user content will be replaced with a message stating the user has been deleted.");
} else {
echo t("The user content will be completely deleted.");
}
}
?>
示例6: t
">
<h2 class="H"><?php
echo t("Add a Message");
?>
</h2>
<div class="MessageFormWrap">
<div class="Form-HeaderWrap">
<div class="Form-Header">
<span class="Author">
<?php
if (c('Vanilla.Comment.UserPhotoFirst', true)) {
echo userPhoto($Session->User);
echo userAnchor($Session->User, 'Username');
} else {
echo userAnchor($Session->User, 'Username');
echo userPhoto($Session->User);
}
?>
</span>
</div>
</div>
<div class="Form-BodyWrap">
<div class="Form-Body">
<div class="FormWrapper FormWrapper-Condensed">
<?php
echo $this->Form->open(array('id' => 'Form_ConversationMessage', 'action' => url('/messages/addmessage/')));
echo $this->Form->errors();
// echo wrap($this->Form->textBox('Body', array('MultiLine' => true, 'class' => 'TextBox')), 'div', array('class' => 'TextBoxWrapper'));
echo $this->Form->bodyBox('Body', array('Table' => 'ConversationMessage', 'FileUpload' => true, 'tabindex' => 1));
echo '<div class="Buttons">', $this->Form->button('Send Message', array('class' => 'Button Primary', 'tabindex' => 1)), '</div>';
示例7: writeDiscussionRow
/**
* Writes a discussion in table row format.
*/
function writeDiscussionRow($Discussion, $Sender, $Session)
{
if (!property_exists($Sender, 'CanEditDiscussions')) {
$Sender->CanEditDiscussions = val('PermsDiscussionsEdit', CategoryModel::categories($Discussion->CategoryID)) && c('Vanilla.AdminCheckboxes.Use');
}
$CssClass = CssClass($Discussion);
$DiscussionUrl = $Discussion->Url;
if ($Session->UserID) {
$DiscussionUrl .= '#latest';
}
$Sender->EventArguments['DiscussionUrl'] =& $DiscussionUrl;
$Sender->EventArguments['Discussion'] =& $Discussion;
$Sender->EventArguments['CssClass'] =& $CssClass;
$First = UserBuilder($Discussion, 'First');
if ($Discussion->LastUserID) {
$Last = UserBuilder($Discussion, 'Last');
} else {
$Last = $First;
}
$Sender->EventArguments['FirstUser'] =& $First;
$Sender->EventArguments['LastUser'] =& $Last;
$Sender->fireEvent('BeforeDiscussionName');
$DiscussionName = $Discussion->Name;
// If there are no word character detected in the title treat it as if it is blank.
if (!preg_match('/\\w/u', $DiscussionName)) {
$DiscussionName = t('Blank Discussion Topic');
}
$Sender->EventArguments['DiscussionName'] =& $DiscussionName;
static $FirstDiscussion = true;
if (!$FirstDiscussion) {
$Sender->fireEvent('BetweenDiscussion');
} else {
$FirstDiscussion = false;
}
$Discussion->CountPages = ceil($Discussion->CountComments / $Sender->CountCommentsPerPage);
$FirstPageUrl = DiscussionUrl($Discussion, 1);
$LastPageUrl = DiscussionUrl($Discussion, val('CountPages', $Discussion)) . '#latest';
?>
<tr id="Discussion_<?php
echo $Discussion->DiscussionID;
?>
" class="<?php
echo $CssClass;
?>
">
<?php
$Sender->fireEvent('BeforeDiscussionContent');
?>
<?php
echo AdminCheck($Discussion, array('<td class="CheckBoxColumn"><div class="Wrap">', '</div></td>'));
?>
<td class="DiscussionName">
<div class="Wrap">
<span class="Options">
<?php
echo OptionsList($Discussion);
echo BookmarkButton($Discussion);
?>
</span>
<?php
$Sender->fireEvent('BeforeDiscussionTitle');
echo anchor($DiscussionName, $DiscussionUrl, 'Title') . ' ';
$Sender->fireEvent('AfterDiscussionTitle');
WriteMiniPager($Discussion);
echo NewComments($Discussion);
if ($Sender->data('_ShowCategoryLink', true)) {
echo CategoryLink($Discussion, ' ' . t('in') . ' ');
}
// Other stuff that was in the standard view that you may want to display:
echo '<div class="Meta Meta-Discussion">';
WriteTags($Discussion);
echo '</div>';
// if ($Source = val('Source', $Discussion))
// echo ' '.sprintf(t('via %s'), t($Source.' Source', $Source));
//
?>
</div>
</td>
<td class="BlockColumn BlockColumn-User FirstUser">
<div class="Block Wrap">
<?php
echo userPhoto($First, array('Size' => 'Small'));
echo userAnchor($First, 'UserLink BlockTitle');
echo '<div class="Meta">';
echo anchor(Gdn_Format::date($Discussion->FirstDate, 'html'), $FirstPageUrl, 'CommentDate MItem');
echo '</div>';
?>
</div>
</td>
<td class="BigCount CountComments">
<div class="Wrap">
<?php
// Exact Number
// echo number_format($Discussion->CountComments);
// Round Number
echo BigPlural($Discussion->CountComments, '%s comment');
?>
//.........这里部分代码省略.........
示例8: writeTableRow
function writeTableRow($Row, $Depth = 1)
{
$Children = $Row['Children'];
$WriteChildren = FALSE;
if (!empty($Children)) {
if ($Depth + 1 >= c('Vanilla.Categories.MaxDisplayDepth')) {
$WriteChildren = 'list';
} else {
$WriteChildren = 'rows';
}
}
$H = 'h' . ($Depth + 1);
?>
<tr class="<?php
echo CssClass($Row);
?>
">
<td class="CategoryName">
<div class="Wrap">
<?php
echo GetOptions($Row);
echo CategoryPhoto($Row);
echo "<{$H}>";
echo anchor(htmlspecialchars($Row['Name']), $Row['Url']);
Gdn::controller()->EventArguments['Category'] = $Row;
Gdn::controller()->fireEvent('AfterCategoryTitle');
echo "</{$H}>";
?>
<div class="CategoryDescription">
<?php
echo $Row['Description'];
?>
</div>
<?php
if ($WriteChildren === 'list') {
?>
<div class="ChildCategories">
<?php
echo wrap(t('Child Categories') . ': ', 'b');
echo CategoryString($Children, $Depth + 1);
?>
</div>
<?php
}
?>
</div>
</td>
<td class="BigCount CountDiscussions">
<div class="Wrap">
<?php
// echo "({$Row['CountDiscussions']})";
echo BigPlural($Row['CountAllDiscussions'], '%s discussion');
?>
</div>
</td>
<td class="BigCount CountComments">
<div class="Wrap">
<?php
// echo "({$Row['CountComments']})";
echo BigPlural($Row['CountAllComments'], '%s comment');
?>
</div>
</td>
<td class="BlockColumn LatestPost">
<div class="Block Wrap">
<?php
if ($Row['LastTitle']) {
?>
<?php
echo userPhoto($Row, array('Size' => 'Small', 'Px' => 'Last'));
echo anchor(SliceString(Gdn_Format::text($Row['LastTitle']), 100), $Row['LastUrl'], 'BlockTitle LatestPostTitle', array('title' => html_entity_decode($Row['LastTitle'])));
?>
<div class="Meta">
<?php
echo userAnchor($Row, 'UserLink MItem', 'Last');
?>
<span class="Bullet">•</span>
<?php
echo anchor(Gdn_Format::date($Row['LastDateInserted'], 'html'), $Row['LastUrl'], 'CommentDate MItem');
if (isset($Row['LastCategoryID'])) {
$LastCategory = CategoryModel::categories($Row['LastCategoryID']);
echo ' <span>', sprintf('in %s', anchor($LastCategory['Name'], CategoryUrl($LastCategory, '', '//'))), '</span>';
}
?>
</div>
<?php
}
?>
</div>
</td>
</tr>
<?php
if ($WriteChildren === 'rows') {
foreach ($Children as $ChildRow) {
WriteTableRow($ChildRow, $Depth + 1);
}
}
}
示例9: foreach
$Session = Gdn::session();
$Alt = FALSE;
foreach ($this->InvitationData->Format('Text')->result() as $Invitation) {
$Alt = $Alt == TRUE ? FALSE : TRUE;
?>
<tr class="js-invitation" data-id="<?php
echo $Invitation->InvitationID;
?>
">
<td class="Alt"><?php
if ($Invitation->AcceptedName == '') {
echo $Invitation->Email;
echo wrap(anchor(t('Uninvite'), "/profile/uninvite/{$Invitation->InvitationID}", 'Uninvite Hijack') . ' | ' . anchor(t('Send Again'), "/profile/sendinvite/{$Invitation->InvitationID}", 'SendAgain Hijack'), 'div');
} else {
$User = Gdn::userModel()->getID($Invitation->AcceptedUserID);
echo userAnchor($User);
echo wrap(anchor(t('Remove'), "/profile/deleteinvitation/{$Invitation->InvitationID}", 'Delete Hijack'), 'div');
}
if ($Invitation->AcceptedName == '') {
}
?>
</td>
<td><?php
echo Gdn_Format::date($Invitation->DateInserted, 'html');
?>
</td>
<td class="Alt"><?php
if ($Invitation->AcceptedName == '') {
echo t('Pending');
} else {
echo t('Accepted');
示例10: writeDiscussion
function writeDiscussion($Discussion, &$Sender, &$Session)
{
$CssClass = CssClass($Discussion);
$DiscussionUrl = $Discussion->Url;
$Category = CategoryModel::categories($Discussion->CategoryID);
if ($Session->UserID) {
$DiscussionUrl .= '#latest';
}
$Sender->EventArguments['DiscussionUrl'] =& $DiscussionUrl;
$Sender->EventArguments['Discussion'] =& $Discussion;
$Sender->EventArguments['CssClass'] =& $CssClass;
$First = UserBuilder($Discussion, 'First');
$Last = UserBuilder($Discussion, 'Last');
$Sender->EventArguments['FirstUser'] =& $First;
$Sender->EventArguments['LastUser'] =& $Last;
$Sender->fireEvent('BeforeDiscussionName');
$DiscussionName = $Discussion->Name;
if ($DiscussionName == '') {
$DiscussionName = t('Blank Discussion Topic');
}
$Sender->EventArguments['DiscussionName'] =& $DiscussionName;
static $FirstDiscussion = TRUE;
if (!$FirstDiscussion) {
$Sender->fireEvent('BetweenDiscussion');
} else {
$FirstDiscussion = FALSE;
}
$Discussion->CountPages = ceil($Discussion->CountComments / $Sender->CountCommentsPerPage);
?>
<li id="Discussion_<?php
echo $Discussion->DiscussionID;
?>
" class="<?php
echo $CssClass;
?>
">
<?php
if (!property_exists($Sender, 'CanEditDiscussions')) {
$Sender->CanEditDiscussions = val('PermsDiscussionsEdit', CategoryModel::categories($Discussion->CategoryID)) && c('Vanilla.AdminCheckboxes.Use');
}
$Sender->fireEvent('BeforeDiscussionContent');
// WriteOptions($Discussion, $Sender, $Session);
?>
<span class="Options">
<?php
echo OptionsList($Discussion);
echo BookmarkButton($Discussion);
?>
</span>
<div class="ItemContent Discussion">
<div class="Title">
<?php
echo AdminCheck($Discussion, array('', ' ')) . anchor($DiscussionName, $DiscussionUrl);
$Sender->fireEvent('AfterDiscussionTitle');
?>
</div>
<div class="Meta Meta-Discussion">
<?php
WriteTags($Discussion);
?>
<span class="MItem MCount ViewCount"><?php
printf(PluralTranslate($Discussion->CountViews, '%s view html', '%s views html', t('%s view'), t('%s views')), BigPlural($Discussion->CountViews, '%s view'));
?>
</span>
<span class="MItem MCount CommentCount"><?php
printf(PluralTranslate($Discussion->CountComments, '%s comment html', '%s comments html', t('%s comment'), t('%s comments')), BigPlural($Discussion->CountComments, '%s comment'));
?>
</span>
<span class="MItem MCount DiscussionScore Hidden"><?php
$Score = $Discussion->Score;
if ($Score == '') {
$Score = 0;
}
printf(Plural($Score, '%s point', '%s points', BigPlural($Score, '%s point')));
?>
</span>
<?php
echo NewComments($Discussion);
$Sender->fireEvent('AfterCountMeta');
if ($Discussion->LastCommentID != '') {
echo ' <span class="MItem LastCommentBy">' . sprintf(t('Most recent by %1$s'), userAnchor($Last)) . '</span> ';
echo ' <span class="MItem LastCommentDate">' . Gdn_Format::date($Discussion->LastDate, 'html') . '</span>';
} else {
echo ' <span class="MItem LastCommentBy">' . sprintf(t('Started by %1$s'), userAnchor($First)) . '</span> ';
echo ' <span class="MItem LastCommentDate">' . Gdn_Format::date($Discussion->FirstDate, 'html');
if ($Source = val('Source', $Discussion)) {
echo ' ' . sprintf(t('via %s'), t($Source . ' Source', $Source));
}
echo '</span> ';
}
if ($Sender->data('_ShowCategoryLink', true) && c('Vanilla.Categories.Use') && $Category) {
echo wrap(Anchor(htmlspecialchars($Discussion->Category), CategoryUrl($Discussion->CategoryUrlCode)), 'span', array('class' => 'MItem Category ' . $Category['CssClass']));
}
$Sender->fireEvent('DiscussionMeta');
?>
</div>
</div>
<?php
$Sender->fireEvent('AfterDiscussionContent');
//.........这里部分代码省略.........
示例11: SliceString
?>
" class="Item">
<?php
$this->fireEvent('BeforeItemContent');
?>
<div class="ItemContent">
<div class="Message"><?php
echo SliceString(Gdn_Format::text(Gdn_Format::to($Comment->Body, $Comment->Format), false), 250);
?>
</div>
<div class="Meta">
<span class="MItem"><?php
echo t('Comment in', 'in') . ' ';
?>
<b><?php
echo anchor(Gdn_Format::text($Comment->DiscussionName), $Permalink);
?>
</b></span>
<span class="MItem"><?php
printf(t('Comment by %s'), userAnchor($User));
?>
</span>
<span class="MItem"><?php
echo anchor(Gdn_Format::date($Comment->DateInserted), $Permalink);
?>
</span>
</div>
</div>
</li>
<?php
}
示例12: userPhoto
<li id="Message_<?php
echo $Message->MessageID;
?>
"<?php
echo $Class == '' ? '' : ' class="' . $Class . '"';
?>
>
<div id="Item_<?php
echo $CurrentOffset;
?>
" class="ConversationMessage">
<div class="Meta">
<span class="Author">
<?php
echo userPhoto($Author, 'Photo');
echo userAnchor($Author, 'Name');
?>
</span>
<span class="MItem DateCreated"><?php
echo Gdn_Format::date($Message->DateInserted, 'html');
?>
</span>
<?php
$this->fireEvent('AfterConversationMessageDate');
?>
</div>
<div class="Message">
<?php
$this->fireEvent('BeforeConversationMessageBody');
echo Gdn_Format::to($Message->Body, $Format);
$this->EventArguments['Message'] =& $Message;
示例13: writeActivityComment
function writeActivityComment($Comment, $Activity)
{
$Session = Gdn::session();
$Author = UserBuilder($Comment, 'Insert');
$PhotoAnchor = userPhoto($Author, 'Photo');
$CssClass = 'Item ActivityComment ActivityComment';
if ($PhotoAnchor != '') {
$CssClass .= ' HasPhoto';
}
?>
<li id="ActivityComment_<?php
echo $Comment['ActivityCommentID'];
?>
" class="<?php
echo $CssClass;
?>
">
<?php
if ($PhotoAnchor != '') {
?>
<div class="Author Photo"><?php
echo $PhotoAnchor;
?>
</div>
<?php
}
?>
<div class="ItemContent ActivityComment">
<?php
echo userAnchor($Author, 'Title Name');
?>
<div class="Excerpt"><?php
echo Gdn_Format::to($Comment['Body'], $Comment['Format']);
?>
</div>
<div class="Meta">
<span class="DateCreated"><?php
echo Gdn_Format::date($Comment['DateInserted'], 'html');
?>
</span>
<?php
if (ActivityModel::canDelete($Activity)) {
echo anchor(t('Delete'), "dashboard/activity/deletecomment?id={$Comment['ActivityCommentID']}&tk=" . $Session->TransientKey() . '&target=' . urlencode(Gdn_Url::Request()), 'DeleteComment');
}
?>
</div>
</div>
</li>
<?php
}
示例14: OtherRecordsMeta
echo OtherRecordsMeta($Row['Data']);
echo '<div class="Meta-Container">';
echo '<span class="Tags">';
echo '<span class="Tag Tag-' . $Row['Operation'] . '">' . t($Row['Operation']) . '</span> ';
echo '<span class="Tag Tag-' . $RecordLabel . '">' . anchor(t($RecordLabel), $Url) . '</span> ';
echo '</span>';
if (checkPermission('Garden.PersonalInfo.View') && $Row['RecordIPAddress']) {
echo ' <span class="Meta">', '<span class="Meta-Label">IP</span> ', IPAnchor($Row['RecordIPAddress'], 'Meta-Value'), '</span> ';
}
if ($Row['CountGroup'] > 1) {
echo ' <span class="Meta">', '<span class="Meta-Label">' . t('Reported') . '</span> ', wrap(Plural($Row['CountGroup'], '%s time', '%s times'), 'span', 'Meta-Value'), '</span> ';
// echo ' ', sprintf(t('%s times'), $Row['CountGroup']);
}
$RecordUser = Gdn::userModel()->getID($Row['RecordUserID'], DATASET_TYPE_ARRAY);
if ($Row['RecordName']) {
echo ' <span class="Meta">', '<span class="Meta-Label">' . sprintf(t('%s by'), t($RecordLabel)) . '</span> ', userAnchor($Row, 'Meta-Value', 'Record');
if ($RecordUser['Banned']) {
echo ' <span class="Tag Tag-Ban">' . t('Banned') . '</span>';
}
echo ' <span class="Count">' . plural($RecordUser['CountDiscussions'] + $RecordUser['CountComments'], '%s post', '%s posts') . '</span>';
echo '</span> ';
}
// Write custom meta information.
$CustomMeta = valr('Data._Meta', $Row, false);
if (is_array($CustomMeta)) {
foreach ($CustomMeta as $Key => $Value) {
echo ' <span class="Meta">', '<span class="Meta-Label">' . t($Key) . '</span> ', wrap(Gdn_Format::Html($Value), 'span', array('class' => 'Meta-Value')), '</span>';
}
}
echo '</div>';
?>
示例15: userAnchor
<tr id="<?php
echo "UserID_{$User->UserID}";
?>
"<?php
echo $Alt ? ' class="Alt"' : '';
?>
data-userid="<?php
echo $User->UserID;
?>
">
<!-- <td class="CheckboxCell"><input type="checkbox" name="LogID[]" value="<?php
echo $User->UserID;
?>
" /></td>-->
<td><strong><?php
echo userAnchor($User, 'Username');
?>
</strong></td>
<?php
if ($ViewPersonalInfo) {
?>
<td class="Alt"><?php
echo Gdn_Format::Email($User->Email);
?>
</td>
<?php
}
?>
<td style="max-width: 200px;">
<?php
$Roles = val('Roles', $User, array());