本文整理汇总了PHP中Avatar::getAvatarURL方法的典型用法代码示例。如果您正苦于以下问题:PHP Avatar::getAvatarURL方法的具体用法?PHP Avatar::getAvatarURL怎么用?PHP Avatar::getAvatarURL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Avatar
的用法示例。
在下文中一共展示了Avatar::getAvatarURL方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showDiffPage
//.........这里部分代码省略.........
$rdel = '';
$ldel = '';
if ($wgUser->isAllowed('deleterevision')) {
$revdel = SpecialPage::getTitleFor('Revisiondelete');
if (!$this->mOldRev->userCan(Revision::DELETED_RESTRICTED)) {
// If revision was hidden from sysops
$ldel = wfMsgHtml('rev-delundel');
} else {
$ldel = $sk->makeKnownLinkObj($revdel, wfMsgHtml('rev-delundel'), 'target=' . urlencode($this->mOldRev->mTitle->getPrefixedDbkey()) . '&oldid=' . urlencode($this->mOldRev->getId()));
// Bolden oversighted content
if ($this->mOldRev->isDeleted(Revision::DELETED_RESTRICTED)) {
$ldel = "<strong>{$ldel}</strong>";
}
}
$ldel = " <tt>(<small>{$ldel}</small>)</tt> ";
// We don't currently handle well changing the top revision's settings
if ($this->mNewRev->isCurrent()) {
// If revision was hidden from sysops
$rdel = wfMsgHtml('rev-delundel');
} else {
if (!$this->mNewRev->userCan(Revision::DELETED_RESTRICTED)) {
// If revision was hidden from sysops
$rdel = wfMsgHtml('rev-delundel');
} else {
$rdel = $sk->makeKnownLinkObj($revdel, wfMsgHtml('rev-delundel'), 'target=' . urlencode($this->mNewRev->mTitle->getPrefixedDbkey()) . '&oldid=' . urlencode($this->mNewRev->getId()));
// Bolden oversighted content
if ($this->mNewRev->isDeleted(Revision::DELETED_RESTRICTED)) {
$rdel = "<strong>{$rdel}</strong>";
}
}
}
$rdel = " <tt>(<small>{$rdel}</small>)</tt> ";
}
if ($this->mOldRev) {
/*$oldHeader = '<div id="mw-diff-otitle1"><strong>'.$this->mOldtitle.'</strong></div>' .
'<div id="mw-diff-otitle2">' . $sk->revUserTools( $this->mOldRev, true ) . "</div>" .
'<div id="mw-diff-otitle3">' . $oldminor . $sk->revComment( $this->mOldRev, !$diffOnly, true ) . $ldel . "</div>" .
'<div id="mw-diff-otitle4">' . $prevlink .'</div>';*/
$comment = $oldminor . $sk->revComment($this->mOldRev, !$diffOnly, true) . $ldel;
//INTL: Avatar database data doesn't exist for sites other than English
if ($wgLanguageCode == 'en') {
$av = '<img src="' . Avatar::getAvatarURL($this->mOldRev->mUserText) . '" class="diff_avatar" />';
}
//$userToolsString = $sk->revUserTools( $this->mOldRev, true );
//$userParts = explode("(", $userToolsString, 2);
//$userName = $userParts[0];
//$userTools = "(" . $userParts[1];
$userName = $sk->userLink($this->mOldRev->getUser(), $this->mOldRev->getUserText());
$userTools = $sk->userToolLinks($this->mOldRev->getUser(), $this->mOldRev->getUserText());
$oldHeader = '<div id="mw-diff-otitle1"><h4>' . $prevlink . $this->mOldtitle . '</h4></div>' . '<div class="diff_details">' . $av . '<div id="mw-diff-otitle1a">' . wfMsg('diff_by') . ' ' . $userName . '</div>' . '<div id="mw-diff-otitle2">' . $this->mOldDate . "</div>" . '<div id="mw-diff-otitle2b">' . $userTools . "</div>";
if ($comment != "") {
$oldHeader .= '<div id="mw-diff-otitle3" class="rccomment"><div class="">' . $comment . '</div></div>';
}
$oldHeader .= '</div>';
} else {
$oldHeader = wfMsg('diff_noprev');
}
/*$newHeader = '<div id="mw-diff-ntitle1"><strong>'.$this->mNewtitle.'</strong></div>' .
'<div id="mw-diff-ntitle2">' . $sk->revUserTools( $this->mNewRev, true ) . "</div>" .
'<div id="mw-diff-ntitle2a">' . $rollback . "</div>" .
'<div id="mw-diff-ntitle3">' . $newminor . $sk->revComment( $this->mNewRev, !$diffOnly, true ) . $rdel . "</div>" .
'<div id="mw-diff-ntitle4">' . $nextlink . $patrol . '</div>';*/
$comment = $newminor . $sk->revComment($this->mNewRev, !$diffOnly, true) . $rdel;
//INTL: Avatar database data doesn't exist for sites other than English
if ($wgLanguageCode == 'en') {
$av = '<img src="' . Avatar::getAvatarURL($this->mNewRev->mUserText) . '" class="diff_avatar" />';
}
//$userToolsString = $sk->revUserTools( $this->mNewRev, true );
//$userParts = explode("(", $userToolsString, 2);
//$userName = $userParts[0];
//$userTools = "(" . $userParts[1];
$userName = $sk->userLink($this->mNewRev->getUser(), $this->mNewRev->getUserText());
$userTools = $sk->userToolLinks($this->mNewRev->getUser(), $this->mNewRev->getUserText());
$thumbsHtml = "";
$thumbHeader = "";
$th_diff_div = "";
if ($wgUser->getId() != 0 && $wgTitle->getText() != "RCPatrol" && $wgTitle->getText() != "RCPatrolGuts" && $this->mNewRev->getTitle()->getNamespace() == NS_MAIN) {
$oldId = $this->mNewRev->getPrevious();
$oldId = $oldId ? $oldId->getId() : -1;
// Only show thumbs up for diffs that look back one revision
if (class_exists('ThumbsUp')) {
if ($oldId == -1 || $this->mOldRev && $oldId == $this->mOldRev->getId()) {
$params = array('title' => $this->mNewRev->getTitle(), 'new' => $this->mNewid, 'old' => $oldId, 'vandal' => 0);
$thumbsHtml = ThumbsUp::getThumbsUpButton($params, true);
//$thumbHeader = 'class="th_diff_h4"';
$th_diff_div = 'class="th_diff_div"';
}
}
}
$newHeader = '<div id="mw-diff-ntitle1" ' . $th_diff_div . '><h4 ' . $thumbHeader . '>' . $this->mNewtitle . ' ' . $nextlink . '</h4></div>' . '<div class="diff_details">' . $av . $thumbsHtml . '<div id="mw-diff-ntitle1a">' . wfMsg('diff_by') . ' ' . $userName . '</div>' . '<div id="mw-diff-ntitle2">' . $this->mNewDate . "</div>" . '<div id="mw-diff-ntitle2b">' . $userTools . "</div>" . '<div id="mw-diff-ntitle4" style="text-align:left">' . $rollback . $nextlink . $patrol . '</div>';
if ($comment != "") {
$newHeader .= '<div id="mw-diff-ntitle3" class="rccomment"><div class="">' . $comment . '</div></div>';
}
$newHeader .= '</div>';
$this->showDiff($oldHeader, $newHeader);
if (!$diffOnly) {
$this->renderNewRevision();
}
wfProfileOut($fname);
}
示例2: execute
function execute($par)
{
global $wgUser, $wgOut;
$wgOut->disable();
header("Content-type: text/plain;");
header('Expires: ' . gmdate('D, d M Y H:i:s', 0) . ' GMT');
header("Cache-Control: private, must-revalidate, max-age=0");
if ($wgUser->getID() == 0) {
return;
}
if (self::isUserBlocked()) {
self::updateRemote();
return;
}
$avatar = wfGetPad(Avatar::getAvatarURL($wgUser->getName()));
$result = "";
$result .= "UniqueID={$wgUser->getID()}\n";
$result .= "Name={$wgUser->getName()}\n";
$result .= "Email={$wgUser->getEmail()}\n";
$result .= "Avatar={$avatar}\n";
$result .= "CurrentDate=" . date("r") . "\n";
$result .= "Groups=" . implode(',', $wgUser->getGroups()) . "\n";
wfDebug("ProxyConnect: returning {$result}\n");
print $result;
self::updateRemote();
return;
}
示例3: setAvatar
public static function setAvatar($user)
{
global $wgVanillaDB;
$fname = "Vanilla::setAvatar";
wfProfileIn($fname);
$db = new Database($wgVanillaDB['host'], $wgVanillaDB['user'], $wgVanillaDB['password'], $wgVanillaDB['dbname']);
// get vanilla user id
$vid = $db->selectField('GDN_UserAuthentication', array('UserID'), array('ForeignUserKey' => $user->getID()));
if (!$vid) {
return false;
}
$updates = array("Photo" => Avatar::getAvatarURL($user->getName()));
$opts = array('UserID' => $vid);
$db->update('GDN_User', $updates, $opts);
wfDebug("Vanilla: Updating avatar " . print_r($updates, true) . print_r($opts, true) . "\n");
wfProfileOut($fname);
return true;
}
示例4: setVars
function setVars(&$vars)
{
global $wgUser;
$vars['js'] = HtmlSnips::makeUrlTags('js', array('fblink.js'), '/extensions/wikihow/fblogin', true);
$vars['css'] = HtmlSnips::makeUrlTags('css', array('fblink.css'), '/extensions/wikihow/fblogin', true);
$facebook = $this->facebook;
$result = $facebook->api('/me');
$vars['fbName'] = $this->truncate($result['name']);
$vars['fbEmployer'] = $this->truncate($result['work'][0]['employer']['name']);
$vars['fbSchool'] = $this->truncate($result['education'][0]['school']['name']);
$vars['fbEmail'] = $this->truncate($result['email']);
$vars['fbLocation'] = $this->truncate($result['location']['name']);
$vars['fbPicUrl'] = FBLogin::getPicUrl($result['id'], 'normal');
$vars['newAcct'] = $wgUser->getName();
$vars['whPicUrl'] = wfGetPad(Avatar::getAvatarURL($wgUser->getName()));
$whId = $this->isAlreadyLinked($result['id']);
$vars['showWarning'] = $whId ? true : false;
$vars['oldAcct'] = $this->getUsername($whId);
}
示例5: array
<?php
require_once 'commandLine.inc';
$db = DatabaseBase::factory('mysql');
$db->open($wgVanillaDB['host'], $wgVanillaDB['user'], $wgVanillaDB['password'], $wgVanillaDB['dbname']);
$oldignore = $db->ignoreErrors(true);
$res = $db->select('GDN_UserAuthentication', array('UserID', 'ForeignUserKey'));
$updates = array();
while ($row = $db->fetchObject($res)) {
$u = User::newFromID($row->ForeignUserKey);
$url = Avatar::getAvatarURL($u->getName());
$updates[$row->UserID] = $url;
}
foreach ($updates as $userid => $url) {
echo "Updating {$userid} with avatar {$url}\n";
$db->update("GDN_User", array("Photo" => $url), array("UserID" => $userid));
}
示例6: onDifferenceEngineNewHeader
function onDifferenceEngineNewHeader($differenceEngine, &$newHeader, $formattedRevisionTools, $nextlink, $rollback, $newminor, $diffOnly, $rdel, $unhide)
{
global $wgLanguageCode, $wgTitle;
$user = $differenceEngine->getUser();
$newRevisionHeader = $differenceEngine->getRevisionHeader($differenceEngine->mNewRev, 'complete', 'new') . ' ' . implode(' ', $formattedRevisionTools);
$newDaysAgo = wfTimeAgo($differenceEngine->mNewRev->getTimestamp());
//INTL: Avatar database data doesn't exist for sites other than English
if ($wgLanguageCode == 'en') {
$av = '<img src="' . Avatar::getAvatarURL($differenceEngine->mNewRev->getUserText()) . '" class="diff_avatar" />';
}
$thumbsHtml = "";
$thumbHeader = "";
$th_diff_div = "";
if ($user->getId() != 0 && $wgTitle->getText() != "RCPatrol" && $wgTitle->getText() != "RCPatrolGuts" && $differenceEngine->mNewRev->getTitle()->getNamespace() == NS_MAIN) {
$oldId = $differenceEngine->mNewRev->getPrevious();
$oldId = $oldId ? $oldId->getId() : -1;
// Only show thumbs up for diffs that look back one revision
if (class_exists('ThumbsUp')) {
if ($oldId == -1 || $differenceEngine->mOldRev && $oldId == $differenceEngine->mOldRev->getId()) {
$params = array('title' => $differenceEngine->mNewRev->getTitle(), 'new' => $differenceEngine->mNewid, 'old' => $oldId, 'vandal' => 0);
$thumbsHtml = ThumbsUp::getThumbsUpButton($params, true);
$th_diff_div = 'class="th_diff_div"';
}
}
}
$newHeader = '<div id="mw-diff-ntitle1" ' . $th_diff_div . '><h4 ' . $thumbHeader . '>' . $newRevisionHeader . $nextlink . '</h4></div>' . '<div id="mw-diff-ntitle2">' . $av . $thumbsHtml . '<div id="mw-diff-oinfo">' . Linker::revUserTools($differenceEngine->mNewRev, !$unhide) . " {$rollback} " . '<br /><div id="mw-diff-ndaysago">' . $newDaysAgo . '</div>' . "</div>" . '<div id="mw-diff-ntitle4">' . $differenceEngine->markPatrolledLink() . '</div>' . "</div>" . '<div id="mw-diff-ntitle3" class="rccomment">' . $newminor . Linker::revComment($differenceEngine->mNewRev, !$diffOnly, !$unhide) . $rdel . '</div>';
return true;
}
示例7: insertAvatarIntoDiscussion
static function insertAvatarIntoDiscussion($discussionText)
{
$text = "";
$parts = preg_split('@(<p class="de_user".*</p>)@im', $discussionText, 0, PREG_SPLIT_DELIM_CAPTURE);
for ($i = 0; $i < sizeof($parts); $i++) {
if (preg_match('@(<p class="de_user".*</p>)@im', $parts[$i])) {
$pos = strpos($parts[$i], 'href="/User:');
$endpos = strpos($parts[$i], '"', $pos + 12);
$username = substr($parts[$i], $pos + 12, $endpos - $pos - 12);
$len = strlen('<p class="de_user">');
$text .= substr($parts[$i], 0, $len) . "<img src='" . wfGetPad(Avatar::getAvatarURL($username)) . "' />" . substr($parts[$i], $len);
} else {
$text .= $parts[$i];
}
}
return $text;
}
示例8: getTopLevelSuggestions
function getTopLevelSuggestions($map, $cats)
{
$dbr = wfGetDB(DB_SLAVE);
$cat1 = $cats[0];
$cat2 = sizeof($cats) > 1 ? $cats[1] : $cats[0];
$top = array($cat1, $cat2);
$suggests = array();
$users = array();
$catresults = array();
$catarray = "(";
for ($i = 0; $i < count($cats); $i++) {
if ($i > 0) {
$catarray .= ",";
}
$catarray .= "'{$map[$cats[$i]]}'";
}
$catarray .= ")";
$randstr = wfRandom();
$conds = array('st_used' => 0, 'st_traffic_volume' => 2, "st_random >= {$randstr}");
if (count($cats) > 0) {
$conds[] = "st_category IN {$catarray}";
}
$rows = $dbr->select('suggested_titles', array('st_title', 'st_user', 'st_user_text', 'st_category'), $conds, __METHOD__, array('ORDER BY' => 'st_random', 'GROUP BY' => 'st_category'));
if ($dbr->numRows($rows) == 0) {
$conds = array('st_used=0', 'st_traffic_volume' => 2, "st_random >= {$randstr}");
$rows = $dbr->select('suggested_titles', array('st_title', 'st_user', 'st_user_text', 'st_category'), $conds, __METHOD__, array('ORDER BY' => 'st_random', 'GROUP BY' => 'st_category'));
for ($i = 0; $i < 2; $i++) {
$row = $dbr->fetchRow($rows);
$t = Title::makeTitle(NS_MAIN, $row['st_title']);
$suggests[] = $t;
$users[] = $row['st_user_text'];
$userids[] = $row['st_user'];
$catresults[] = $row['st_category'];
}
} elseif ($dbr->numRows($rows) == 1) {
$row = $dbr->fetchRow($rows);
$t = Title::makeTitle(NS_MAIN, $row['st_title']);
$suggests[] = $t;
$users[] = $row['st_user_text'];
$userids[] = $row['st_user'];
$catresults[] = $row['st_category'];
$randstr = wfRandom();
$conds = array('st_used=0', 'st_traffic_volume' => 2, "st_random >= {$randstr}", "st_category IN {$catarray}", "st_title != '" . $row['st_title'] . "'");
$rows2 = $dbr->select('suggested_titles', array('st_title', 'st_user', 'st_user_text', 'st_category'), $conds, __METHOD__, array('ORDER BY' => 'st_random', 'GROUP BY' => 'st_category'));
if ($dbr->numRows($rows2) >= 1) {
$row = $dbr->fetchRow($rows2);
$t = Title::makeTitle(NS_MAIN, $row['st_title']);
$suggests[] = $t;
$users[] = $row['st_user_text'];
$userids[] = $row['st_user'];
$catresults[] = $row['st_category'];
} else {
$conds = array('st_used=0', 'st_traffic_volume' => 2, "st_random >= {$randstr}");
$rows = $dbr->select('suggested_titles', array('st_title', 'st_user', 'st_user_text', 'st_category'), $conds, __METHOD__, array('ORDER BY' => 'st_random', 'GROUP BY' => 'st_category'));
$row = $dbr->fetchRow($rows);
$t = Title::makeTitle(NS_MAIN, $row['st_title']);
$suggests[] = $t;
$users[] = $row['st_user_text'];
$userids[] = $row['st_user'];
$catresults[] = $row['st_category'];
}
} else {
for ($i = 0; $i < 2; $i++) {
$row = $dbr->fetchRow($rows);
$t = Title::makeTitle(NS_MAIN, $row['st_title']);
$suggests[] = $t;
$users[] = $row['st_user_text'];
$userids[] = $row['st_user'];
$catresults[] = $row['st_category'];
}
}
$s = '';
for ($i = 0; $i < 2; $i++) {
if ($i == 1) {
//add 'or'
$s .= '<div class="top_suggestion_or">OR</div>';
}
if ($userids[$i] > 0) {
$u = User::newFromName($users[$i]);
$user_line = "<a href='{$u->getUserPage()->getFullURL()}'>{$u->getName()}</a>";
} else {
$user_line = wfMsg('anonymous');
}
$s .= '<div class="top_suggestion_box">' . '<div class="category">' . $catresults[$i] . '</div>' . '<div class="title">' . $suggests[$i]->getText() . '</div>' . '<div class="requestor"><img src="' . Avatar::getAvatarURL($users[$i]) . '"/>' . '<a href="/Special:CreatePage/' . $suggests[$i]->getPartialURL() . '" class="button secondary">Write</a>' . 'Requested By<br />' . $user_line . '</div>' . '</div>';
}
$s .= '<br class="clearall" />';
return $s;
}
示例9: getForm
function getForm($new_window = false, $title = null, $return_result = false)
{
global $wgUser, $wgTitle, $wgRequest;
wfLoadExtensionMessages('Postcomment');
$postbtn = " class= 'button primary' ";
$prevbtn = " class= 'button secondary' ";
if ($title == null) {
$title = $wgTitle;
}
if (!$title->userCanEdit()) {
return;
}
if (!$wgUser->isAllowed('edit')) {
return;
}
$action = $wgRequest->getVal('action');
// just for talk pages
if (!$title->isTalkPage() || $action != '' || $wgRequest->getVal('diff', null) != null) {
return;
}
if (!$title->userCanEdit()) {
echo wfMsg('postcomment_discussionprotected');
return;
}
$sk = $wgUser->getSkin();
$user_str = "";
if ($wgUser->getID() == 0) {
$user_str = wfMsg('postcomment_notloggedin');
} else {
$link = $sk->makeLinkObj($wgUser->getUserPage(), $wgUser->getName());
$user_str = wfMsg('postcomment_youareloggedinas', $link);
}
$msg = wfMsg('postcomment_addcommentdiscussionpage');
$previewPage = Title::makeTitle(NS_SPECIAL, "PostcommentPreview");
$me = Title::makeTitle(NS_SPECIAL, "Postcomment");
$pc = Title::newFromText("Postcomment", NS_SPECIAL);
if ($title->getNamespace() == NS_USER_TALK) {
$msg = wfMsg('postcomment_leaveamessagefor', $title->getText());
}
$id = rand(0, 10000);
$newpage = $wgTitle->getArticleId() == 0 ? "true" : "false";
$fc = null;
$pass_captcha = true;
if ($wgUser->getID() == 0) {
$fc = new FancyCaptcha();
}
$result = "<div id='postcomment_newmsg_{$id}'></div>\n\t\t\t<script type='text/javascript'>\n\t\t\t\tvar gPreviewText = \"" . wfMsg('postcomment_generatingpreview') . "\";\n\t\t\t\tvar gPreviewURL = \"{$previewPage->getFullURL()}\";\n\t\t\t\tvar gPostURL = \"{$me->getFullURL()}\";\n\t\t\t\tvar gPreviewMsg = \"" . wfMsg('postcomment_previewmessage') . "\";\n\t\t\t\tvar gNewpage = {$newpage};\n\t\t\t</script>\n\t\t\t<script type='text/javascript' src='" . wfGetPad('/extensions/min/f/extensions/Postcomment/postcomment.js?') . WH_SITEREV . "'></script>\n\t\t\t<div id='postcomment_progress_{$id}' style='display:none;'><center><img src='" . wfGetPad('/extensions/Postcomment/upload.gif') . "' alt='Sending...'/></center></div>\n\t\t\t";
//XXCHANGED Vu added for google analytics tracking gat
if ($wgTitle->getNamespace() == NS_TALK) {
$result .= "<form id=\"gatDiscussionPost\" name=\"postcommentForm_{$id}\" method=\"post\" action=\"{$pc->getFullURL()}\" " . ($new_window ? "target='_blank'" : "") . " onsubmit='return postcommentPublish(\"postcomment_newmsg_{$id}\", document.postcommentForm_{$id});'>";
} else {
if ($wgTitle->getNamespace() == NS_USER_TALK) {
$result .= "<form id=\"gatTalkPost\" name=\"postcommentForm_{$id}\" method=\"post\" action=\"{$pc->getFullURL()}\" " . ($new_window ? "target='_blank'" : "") . " onsubmit='return postcommentPublish(\"postcomment_newmsg_{$id}\", document.postcommentForm_{$id});'>";
} else {
$result .= "<form name=\"postcommentForm_{$id}\" method=\"post\" action=\"{$pc->getFullURL()}\" " . ($new_window ? "target='_blank'" : "") . " onsubmit='return postcommentPublish(\"postcomment_newmsg_{$id}\", document.postcommentForm_{$id});'>";
}
}
$avatar = Avatar::getAvatarURL($wgUser->getName());
if ($avatar) {
$user_icon = 'background-image: url(' . $avatar . ')';
}
$result .= "\n\t\t\t<input name=\"target\" type=\"hidden\" value=\"" . htmlspecialchars($title->getPrefixedDBkey()) . "\"/>\n\t <a name=\"postcomment\"></a>\n\t <a name=\"post\"></a>\n\t\t\t<textarea class=\"postcommentForm_textarea\" tabindex='3' rows='15' cols='100' name=\"comment_text_{$id}\" id=\"comment_text_{$id}\" placeholder=\"{$msg}\" style=\"{$user_icon}\"></textarea>\n\t <div class=\"postcommentForm_buttons\">\n\t\t\t\t<input tabindex='4' type='button' onclick='postcommentPreview(\"{$id}\");' value=\"" . wfMsg('postcomment_preview') . "\" {$prevbtn} />\n\t\t\t\t<input tabindex='5' type='submit' value=\"" . wfMsg('postcomment_post') . "\" id='postcommentbutton_{$id}' {$postbtn} />\n\t\t\t</div>\n\t\t\t<div class=\"postcommentForm_details\">\n\t\t\t\t{$user_str}\n\t\t\t\t" . ($pass_captcha ? "" : "<br><br/><font color='red'>Sorry, that phrase was incorrect, try again.</font><br/><br/>") . "\n\t\t\t\t" . ($fc == null ? "" : $fc->getForm('')) . "\n\t\t\t</div>\n\t </form>\n\t\t\t<div id='postcomment_preview_{$id}' class='postcomment_preview'></div>\n\t\t\t";
//add anchor link
$return = '<a name="leave-a-message" id="leave-a-message"></a>' . $return;
if ($return_result) {
return $result;
} else {
echo $result;
}
}
示例10: getUserInfo
/**
*
* For a given user id, returns the html
* for an avatar to be displayed on the right
* rail or in the info box
*
*/
static function getUserInfo($user_id)
{
if ($user_id) {
$u = new User();
$u->setID($user_id);
$img = Avatar::getAvatarURL($u->getName());
if ($img == '') {
$img = Avatar::getDefaultPicture();
} else {
$img = "<img src='{$img}' />";
}
$avatar = "<span><a href='{$u->getUserPage()->getFullURL()}' target='_blank' class='tooltip'>{$img}</a>";
$avatar .= "<span class='tooltip_span'>Hi, I'm {$u->getName()}</span></span>";
$avatar .= "<a target='new' href='{$u->getUserPage()->getFullURL()}'>{$u->getName()}</a>";
}
return $avatar;
}