本文整理汇总了PHP中UserPhoto函数的典型用法代码示例。如果您正苦于以下问题:PHP UserPhoto函数的具体用法?PHP UserPhoto怎么用?PHP UserPhoto使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UserPhoto函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: WriteDiscussion
function WriteDiscussion($Discussion, &$Sender, &$Session, $Alt)
{
$CssClass = 'Item';
$CssClass .= $Discussion->Bookmarked == '1' ? ' Bookmarked' : '';
$CssClass .= $Alt . ' ';
$CssClass .= $Discussion->Announce == '1' ? ' Announcement' : '';
$CssClass .= $Discussion->Closed == '1' ? ' Closed' : '';
$CssClass .= $Discussion->InsertUserID == $Session->UserID ? ' Mine' : '';
$CssClass .= $Discussion->CountUnreadComments > 0 && $Session->IsValid() ? ' New' : '';
$Sender->EventArguments['Discussion'] =& $Discussion;
$Sender->FireEvent('BeforeDiscussionName');
$DiscussionName = Gdn_Format::Text($Discussion->Name);
if ($DiscussionName == '') {
$DiscussionName = T('Blank Discussion Topic');
}
static $FirstDiscussion = TRUE;
if (!$FirstDiscussion) {
$Sender->FireEvent('BetweenDiscussion');
} else {
$FirstDiscussion = FALSE;
}
?>
<li class="<?php
echo $CssClass;
?>
">
<?php
echo UserPhoto(UserBuilder($Discussion, 'First'));
?>
<div class="ItemContent Discussion">
<?php
echo Anchor($DiscussionName, '/discussion/' . $Discussion->DiscussionID . '/' . Gdn_Format::Url($Discussion->Name) . ($Discussion->CountCommentWatch > 0 && C('Vanilla.Comments.AutoOffset') ? '/#Item_' . $Discussion->CountCommentWatch : ''), 'Title');
?>
<?php
$Sender->FireEvent('AfterDiscussionTitle');
?>
<div class="Meta">
<span class="Author"><?php
echo $Discussion->FirstName;
?>
</span>
<?php
echo '<span class="Counts' . ($Discussion->CountUnreadComments > 0 ? ' NewCounts' : '') . '">' . ($Discussion->CountUnreadComments > 0 ? $Discussion->CountUnreadComments . '/' : '') . $Discussion->CountComments . '</span>';
if ($Discussion->LastCommentID != '') {
echo '<span class="LastCommentBy">' . sprintf(T('Latest %1$s'), $Discussion->LastName) . '</span> ';
}
echo '<span class="LastCommentDate">' . Gdn_Format::Date($Discussion->LastDate) . '</span> ';
?>
</div>
</div>
</li>
<?php
}
示例2: WriteComment
function WriteComment($Comment, &$Sender, &$Session, $CurrentOffset)
{
$Author = UserBuilder($Comment, 'Insert');
$Sender->EventArguments['Comment'] =& $Comment;
$Sender->Options = '';
$CssClass = 'Item Comment';
$CssClass .= $Comment->InsertUserID == $Session->UserID ? ' Mine' : '';
?>
<li class="<?php
echo $CssClass;
?>
" id="Comment_<?php
echo $Comment->CommentID;
?>
">
<?php
WriteOptions($Comment, $Sender, $Session);
?>
<div class="Comment">
<div class="Meta">
<span class="Author">
<?php
echo UserPhoto($Author);
echo UserAnchor($Author);
?>
</span>
<span class="DateCreated">
<?php
echo Format::Date($Comment->DateInserted);
?>
</span>
<span class="Permalink">
<?php
echo Anchor(T('Permalink'), '/discussion/comment/' . $Comment->CommentID . '/#Comment_' . $Comment->CommentID, 'Permalink', array('name' => 'Item_' . $CurrentOffset));
?>
</span>
<?php
$Sender->FireEvent('AfterCommentMeta');
?>
</div>
<div class="Message"><?php
echo Format::To($Comment->Body, $Comment->Format);
?>
</div>
<?php
$Sender->FireEvent('AfterCommentBody');
?>
</div>
</li>
<?php
}
示例3: ToString
public function ToString($Results)
{
$UserIDs = array();
foreach ($Results as $Row) {
$UserIDs[] = $Row->{SS_ATTR_USERID};
///IMPORTANT, this is lowercase since grab results directly from sphinx
}
// print_r($Return); die;
$Sql = clone Gdn::Sql();
$Users = $Sql->Select('Photo, UserID, Name')->From('User')->WhereIn('UserID', $UserIDs)->Get()->ResultObject();
ob_start();
?>
<div id="People" class="Box People">
<h4 class="Header"><?php
echo T('People');
?>
</h4>
<ul class="PanelInfo PanelDiscussions">
<?php
foreach ($Users as $Row) {
?>
<li class="Item">
<?php
$User = UserBuilder($Row);
?>
<?php
echo UserPhoto($User);
echo UserAnchor($User);
?>
</li>
<?php
}
?>
</ul>
</div>
<?php
$String = ob_get_contents();
@ob_end_clean();
return $String;
}
示例4: RenderReactionRecord
/**
* Renders the reaction record for a specific item
*
* @param int $ID
* @param string $Type 'discussion', 'activity', or 'comment'
*/
function RenderReactionRecord($ID, $Type)
{
$Reactions = Yaga::ReactionModel()->GetRecord($ID, $Type);
$Limit = C('Yaga.Reactions.RecordLimit');
$ReactionCount = count($Reactions);
$i = 0;
foreach ($Reactions as $Reaction) {
$i++;
// Limit the record if there are a lot of reactions
if ($i <= $Limit || $Limit <= 0) {
$User = Gdn::UserModel()->GetID($Reaction->UserID);
$DateTitle = sprintf(T('Yaga.Reactions.RecordFormat'), $User->Name, $Reaction->Name, Gdn_Format::Date($Reaction->DateInserted, '%B %e, %Y'));
$String = UserPhoto($User, array('Size' => 'Small', 'title' => $DateTitle));
$String .= '<span class="ReactSprite Reaction-' . $Reaction->ActionID . ' ' . $Reaction->CssClass . '"></span>';
$Wrapttributes = array('class' => 'UserReactionWrap', 'data-userid' => $User->UserID, 'title' => $DateTitle);
echo Wrap($String, 'span', $Wrapttributes);
}
if ($Limit > 0 && $i >= $ReactionCount && $ReactionCount > $Limit) {
echo Plural($ReactionCount - $Limit, 'Yaga.Reactions.RecordLimit.Single', 'Yaga.Reactions.RecordLimit.Plural');
}
}
}
示例5: UserPhoto
?>
" class="<?php
echo $CssClass;
?>
">
<div class="Discussion">
<div class="Item-Header DiscussionHeader">
<div class="AuthorWrap">
<span class="Author">
<?php
if ($UserPhotoFirst) {
echo UserPhoto($Author);
echo UserAnchor($Author, 'Username');
} else {
echo UserAnchor($Author, 'Username');
echo UserPhoto($Author);
}
echo FormatMeAction($Discussion);
?>
</span>
<span class="AuthorInfo">
<?php
echo WrapIf(htmlspecialchars(GetValue('Title', $Author)), 'span', array('class' => 'MItem AuthorTitle'));
echo WrapIf(htmlspecialchars(GetValue('Location', $Author)), 'span', array('class' => 'MItem AuthorLocation'));
$this->FireEvent('AuthorInfo');
?>
</span>
</div>
<div class="Meta DiscussionMeta">
<span class="MItem DateCreated">
<?php
示例6: trim
$Class = trim($Class);
$Format = empty($Message->Format) ? 'Display' : $Message->Format;
$Author = UserBuilder($Message, 'Insert');
?>
<li id="<?php
echo $Message->MessageID;
?>
"<?php
echo $Class == '' ? '' : ' class="' . $Class . '"';
?>
>
<div class="ConversationMessage">
<div class="Meta">
<span class="Author">
<?php
echo UserPhoto($Author, 'Photo');
echo UserAnchor($Author, 'Name');
?>
</span>
<span class="DateCreated"><?php
echo Format::Date($Message->DateInserted);
?>
</span>
<span class="ItemLink"><a name="Item_<?php
echo $CurrentOffset;
?>
" class="Item"></a></span>
</div>
<div class="Message"><?php
echo Format::To($Message->Body, $Format);
?>
示例7: Wrap
?>
<ul class="PopList Popin">
<?php
if (count($this->Data('Discussions'))) {
?>
<li class="Item Title">
<?php
echo Wrap($this->Data('Title'), 'strong');
?>
</li>
<?php
foreach ($this->Data('Discussions') as $Row) {
?>
<li class="Item">
<div class="Author Photo"><?php
echo UserPhoto($Row, array('Px' => 'First'));
?>
</div>
<div class="ItemContent">
<b class="Subject"><?php
echo Anchor($Row->Name, $Row->Url . '#latest');
?>
</b>
<div class="Meta">
<?php
echo ' <span class="MItem">' . Plural($Row->CountComments, '%s comment', '%s comments') . '</span> ';
if ($Row->CountUnreadComments === TRUE) {
echo ' <strong class="HasNew"> ' . T('new') . '</strong> ';
} elseif ($Row->CountUnreadComments > 0) {
echo ' <strong class="HasNew"> ' . Plural($Row->CountUnreadComments, '%s new', '%s new plural') . '</strong> ';
}
示例8: ConcatSep
if (!isset($PhotoUser)) {
$PhotoUser = $User;
}
$Subject = ConcatSep(', ', $Subject, FormatUsername($User, 'You'));
}
}
if (!isset($PhotoUser)) {
$PhotoUser = UserBuilder($Row, 'LastMessage');
}
?>
<li class="Item" rel="<?php
echo Url("/messages/{$Row['ConversationID']}#latest");
?>
">
<div class="Author Photo"><?php
echo UserPhoto($PhotoUser);
?>
</div>
<div class="ItemContent">
<b class="Subject"><?php
echo Anchor($Subject, "/messages/{$Row['ConversationID']}#latest");
?>
</b>
<?php
$Excerpt = SliceString(Gdn_Format::PlainText($Row['LastBody'], $Row['LastFormat']), 80);
echo Wrap(nl2br($Excerpt), 'div', array('class' => 'Excerpt'));
?>
<div class="Meta">
<?php
echo ' <span class="MItem">' . Plural($Row['CountMessages'], '%s message', '%s messages') . '</span> ';
if ($Row['CountNewMessages'] > 0) {
示例9: T
">
<h2 class="H"><?php
echo T($Editing ? 'Edit Comment' : 'Leave a Comment');
?>
</h2>
<div class="CommentFormWrap">
<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();
echo $this->Form->Errors();
// $CommentOptions = array('MultiLine' => TRUE, 'format' => GetValueR('Comment.Format', $this));
$this->FireEvent('BeforeBodyField');
echo $this->Form->BodyBox('Body', array('Table' => 'Comment', 'tabindex' => 1));
$this->FireEvent('AfterBodyField');
示例10: WriteReply
public static function WriteReply(&$Sender, &$Session)
{
?>
<li class="Reply" id="Comment_<?php
echo $Sender->CurrentReply->CommentID;
?>
">
<?php
// Delete comment
if ($Session->CheckPermission('Vanilla.Comments.Delete', $Sender->Discussion->CategoryID)) {
echo Anchor(T('Delete'), 'vanilla/discussion/deletecomment/' . $Sender->CurrentReply->CommentID . '/' . $Session->TransientKey(), 'DeleteReply');
}
?>
<ul class="Info<?php
echo $Sender->CurrentReply->InsertUserID == $Session->UserID ? ' Author' : '';
?>
">
<li class="Author"><?php
$Author = UserBuilder($Sender->CurrentReply, 'Insert');
echo UserPhoto($Author);
echo UserAnchor($Author);
?>
</li>
<li class="Created"><?php
echo Gdn_Format::Date($Sender->CurrentReply->DateInserted);
?>
</li>
<li class="Permalink"><?php
echo Anchor(T('Permalink'), '/discussion/comment/' . (isset($Sender->CurrentComment) ? $Sender->CurrentComment->CommentID : $Sender->ReplyCommentID) . '/#Comment_' . $Sender->CurrentReply->CommentID, T('Permalink'));
?>
</li>
</ul>
<div class="Body"><?php
echo Gdn_Format::To($Sender->CurrentReply->Body, $Sender->CurrentReply->Format);
?>
</div>
</li>
<?php
}
示例11: WriteComment
/**
* $Object is either a Comment or the original Discussion.
*/
function WriteComment($Object, $Sender, $Session, $CurrentOffset) {
$Alt = ($CurrentOffset % 2) != 0;
$Author = UserBuilder($Object, 'Insert');
$Type = property_exists($Object, 'CommentID') ? 'Comment' : 'Discussion';
$Sender->EventArguments['Object'] = $Object;
$Sender->EventArguments['Type'] = $Type;
$Sender->EventArguments['Author'] = $Author;
$CssClass = 'Item Comment';
$Permalink = GetValue('Url', $Object, FALSE);
if ($Type == 'Comment') {
$Sender->EventArguments['Comment'] = $Object;
$Id = 'Comment_'.$Object->CommentID;
if ($Permalink === FALSE)
$Permalink = '/discussion/comment/'.$Object->CommentID.'/#Comment_'.$Object->CommentID;
} else {
$Sender->EventArguments['Discussion'] = $Object;
$CssClass .= ' FirstComment';
$Id = 'Discussion_'.$Object->DiscussionID;
if ($Permalink === FALSE)
$Permalink = '/discussion/'.$Object->DiscussionID.'/'.Gdn_Format::Url($Object->Name).'/p1';
}
$Sender->EventArguments['CssClass'] = &$CssClass;
$Sender->Options = '';
$CssClass .= $Object->InsertUserID == $Session->UserID ? ' Mine' : '';
if ($Alt)
$CssClass .= ' Alt';
$Alt = !$Alt;
if (!property_exists($Sender, 'CanEditComments'))
$Sender->CanEditComments = $Session->CheckPermission('Vanilla.Comments.Edit', TRUE, 'Category', 'any') && C('Vanilla.AdminCheckboxes.Use');
$Sender->FireEvent('BeforeCommentDisplay');
?>
<li class="<?php echo $CssClass; ?>" id="<?php echo $Id; ?>">
<div class="Comment">
<div class="Meta">
<?php $Sender->FireEvent('BeforeCommentMeta'); ?>
<span class="Author">
<?php
echo UserPhoto($Author);
echo UserAnchor($Author);
?>
</span>
<span class="DateCreated">
<?php
echo Anchor(Gdn_Format::Date($Object->DateInserted), $Permalink, 'Permalink', array('name' => 'Item_'.($CurrentOffset+1), 'rel' => 'nofollow'));
?>
</span>
<?php
WriteOptionList($Object, $Sender, $Session);
if ($Type == 'Comment' && $Sender->CanEditComments) {
if (!property_exists($Sender, 'CheckedComments'))
$Sender->CheckedComments = $Session->GetAttribute('CheckedComments', array());
$ItemSelected = InSubArray($Id, $Sender->CheckedComments);
echo '<div class="Administration"><input type="checkbox" name="'.$Type.'ID[]" value="'.$Id.'"'.($ItemSelected?' checked="checked"':'').' /></div>';
}
?>
<div class="CommentInfo">
<?php $Sender->FireEvent('CommentInfo'); ?>
</div>
<?php $Sender->FireEvent('AfterCommentMeta'); ?>
</div>
<div class="Message">
<?php
$Sender->FireEvent('BeforeCommentBody');
$Object->FormatBody = Gdn_Format::To($Object->Body, $Object->Format);
$Sender->FireEvent('AfterCommentFormat');
$Object = $Sender->EventArguments['Object'];
echo $Object->FormatBody;
?>
</div>
<?php $Sender->FireEvent('AfterCommentBody'); ?>
</div>
</li>
<?php
$Sender->FireEvent('AfterComment');
}
示例12: 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">
<?php
echo GetOptions($Row);
echo "<{$H}>";
echo Anchor($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
}
?>
</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');
?>
</div>
<?php
}
?>
</div>
</td>
</tr>
<?php
if ($WriteChildren === 'rows') {
foreach ($Children as $ChildRow) {
WriteTableRow($ChildRow, $Depth + 1);
}
}
}
示例13: DisplayPhoto
/**
* Display user photo for first user in each discussion.
*/
protected function DisplayPhoto($Sender)
{
// Build user object & output photo
$FirstUser = UserBuilder($Sender->EventArguments['Discussion'], 'First');
echo UserPhoto($FirstUser);
}
示例14: WriteCommentFormHeader
function WriteCommentFormHeader()
{
$Session = Gdn::Session();
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);
}
}
示例15: WriteClassic
function WriteClassic($Results, $WriteText, $CssClass)
{
if (sizeof($Results) == 0) {
//make sure there is something here
return '';
}
ob_start();
?>
<div class="SphinxSearch">
<ul class="DataList">
<?php
foreach ($Results as $Row) {
?>
<?php
$Author->Photo = $Row->UserPhoto;
$Author->Name = $Row->UserName;
$Author->UserID = $Row->UserID;
$TitleURL = $Row->IsComment ? 'discussion/comment/' . $Row->CommentID . '/#Comment_' . $Row->CommentID : DiscussionLink($Row, FALSE);
//if the comment is from the orignal discussion poster, simply link to the front page of that
?>
<li class="Item">
<div class="ItemContent">
<h4 class="Title"><?php
echo Anchor($Row->Title, $TitleURL, FALSE, array('class' => 'HasToolTip'));
?>
</h4>
<?php
if ($WriteText) {
?>
<div class="Message Excerpt">
<?php
//echo nl2br(SliceString($Row->Body, SS_BODY_LIMIT)); This seemed to make MARKDOWN posts look correct - JJB
?>
<?php
echo SliceString($Row->Body, SS_BODY_LIMIT);
?>
</div>
<?php
}
?>
<div class="Meta">
<span class="MItem"><?php
echo UserPhoto($Author, array('LinkClass' => '', 'ImageClass' => 'ProfilePhotoSmall PhotoWrap'));
?>
</span>
<span class="MItem"><?php
echo Anchor($Row->UserName, UserUrl($Author));
?>
</span>
<span class="MItem"><?php
echo Anchor(Gdn_Format::Date($Row->DateInserted), 'discussion/' . $Row->DiscussionID . '/' . Gdn_Format::Url($Row->Title) . '/p1');
?>
</span>
<span class="MItem"><?php
echo Anchor($Row->CatName, 'discussion/' . $Row->DiscussionID . '/' . Gdn_Format::Url($Row->Title) . '/p1');
?>
</span>
</div>
</div>
</li>
<?php
}
?>
</ul>
</div>
<?php
$String = ob_get_contents();
@ob_end_clean();
return $String;
}