本文整理汇总了PHP中getUserAvatar函数的典型用法代码示例。如果您正苦于以下问题:PHP getUserAvatar函数的具体用法?PHP getUserAvatar怎么用?PHP getUserAvatar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getUserAvatar函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUserList
function getUserList($cols = null, $where = "", $orderBy = "", $limit = null)
{
if ($cols == null || count($cols) == 0) {
$cols = array("userid", "privilegeid", "accessid", "name", "email", "address", "region", "country", "zipcode", "mobile", "avatar", "avatar_type");
}
$sql = _db(true)->_selectQ(_dbTable("users", true), $cols)->_where(array("blocked" => 'false'));
if (isset($_SESSION["SESS_PRIVILEGE_ID"]) && $_SESSION["SESS_PRIVILEGE_ID"] > ROLE_PRIME) {
//$sql=$sql->_where(" (site='".SITENAME."' OR site='*')");
$sql1 = _db(true)->_selectQ(_dbTable("access", true), "id")->_where(array("blocked" => 'false'))->_where(" (FIND_IN_SET('" . SITENAME . "',sites) OR sites='*')");
$sql = $sql->_query("accessid", $sql1);
}
if (strlen($where) > 0) {
$sql = $sql->_where(" ({$where})");
}
if (strlen($orderBy) > 0) {
$sql = $sql->_orderBy($orderBy);
}
if (is_array($limit)) {
$sql = $sql->_limit($limit);
} elseif (strlen($limit) > 0) {
$sql = $sql->_limit($limit);
}
$res = _dbQuery($sql, true);
$data = [];
if ($res) {
$data = _dbData($res, true);
_dbFree($res, true);
foreach ($data as $a => $row) {
$data[$a]['avatarlink'] = getUserAvatar($row);
}
}
return $data;
}
示例2: getUserInfo
function getUserInfo($userid = null)
{
if ($userid == null) {
$userid = $_SESSION['SESS_USER_ID'];
}
if (isset($_SESSION["USERINFO"][$userid])) {
return $_SESSION["USERINFO"][$userid];
}
$sql = _db(true)->_selectQ(_dbTable("users", true), "*")->_where(array("blocked" => 'false', "userid" => $userid));
$res = _dbQuery($sql, true);
$data = [];
if ($res) {
$data = _dbData($res, true);
_dbFree($res, true);
if (isset($data[0])) {
$data = $data[0];
}
}
$data['avatarlink'] = getUserAvatar($data);
$_SESSION["USERINFO"][$userid] = $data;
return $data;
}
示例3: checkLogin
public function checkLogin()
{
$is_bind = I("post.is_bind", 0, 'int');
$pwd = I('post.pwd');
$username = I('post.username');
if (checkEmail($username) == 'true') {
$info = M("user")->field("id,nickname")->where("email = '" . $username . "' AND pwd = '" . md5($pwd) . "'")->find();
} else {
$info = M("user")->field("id,nickname")->where("name = '" . $username . "' AND pwd = '" . md5($pwd) . "'")->find();
}
if (empty($info)) {
echo json_encode(array("error" => "您输入的用户名/邮箱/密码无效。"));
exit;
} else {
$userid = $info['id'];
}
$nickname = $info['nickname'];
$tip = "登录成功!";
if ($is_bind == 1) {
//若是绑定
$openid = getSessionCookie("openid");
if ($openid) {
$field = getSessionCookie("field");
$userinfo = M("user")->field('id,name')->where("" . $field . "= '" . $openid . "'")->find();
if (!$userinfo) {
//没有的话绑定账号,送积分和发广告,有绑定的话直接登录
// 绑定账号
M('user')->where("id = " . $userid . "")->save(array($field => $openid));
emptySessionCookie('type');
emptySessionCookie('openid');
}
}
}
setSessionCookie("userid", $userid);
setSessionCookie("username", getNickname($username, $nickname));
echo json_encode(array("username" => $username, "userid" => $userid, "avatar" => getUserAvatar($userid), "tip" => $tip, "error" => ""));
}
示例4: getIMG
$caption = getIMG(url() . "images/emoticons/poll.png") . " " . sprintf(_UPD_POLL, $user, "");
break;
case updTypeAnnouncement:
$markAsReadOp = "ma";
$clubname = "[" . _UNKNOWN . "]";
$result = sql_query("SELECT `cluName` FROM `clubs` " . "WHERE `cluid` = '" . $data["updUser"] . "' LIMIT 1");
if (mysql_num_rows($result) > 0) {
$clubname = mysql_result($result, 0);
}
$result = sql_query("SELECT `jouTitle`,LEFT(`jouEntry`,500) AS `jouText`,`jouAnnCreator` FROM `journals` " . "WHERE `jouid` = '" . $data["updObj"] . "'");
if (mysql_num_rows($result) > 0) {
$title = mysql_result($result, 0, 0);
$body = mysql_result($result, 0, 1);
$author = mysql_result($result, 0, 2);
$url = url("announcement/" . $data["updUser"] . "/" . $data["updObj"]);
$avatar = getUserAvatar("", $author, true);
}
$club = '<a href="' . url("club/" . $data["updUser"]) . '">' . $clubname . '</a>';
$caption = getIMG(url() . "images/emoticons/club2.png") . " " . sprintf(_UPD_ANNOUNCEMENT, $club, "");
break;
}
$jouDivId = "id_jou" . $key;
?>
<div id="<?php
echo $jouDivId;
?>
">
<div class="mar_left" style="margin-bottom : 0.2em;">
<?php
echo $caption;
?>
示例5: getMember
function getMember($mysqli, $userId)
{
if (doesuserExist($mysqli, $userId)) {
if ($stmt = $mysqli->prepare("SELECT id, username, email, firstName, lastName, dt, graduation_year FROM members WHERE id = ? LIMIT 1")) {
$stmt->bind_param("i", $userId);
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($id, $username, $email, $firstName, $lastName, $date, $graduationYear);
$stmt->fetch();
return array("id" => $id, "username" => $username, "email" => $email, "firstName" => $firstName, "lastName" => $lastName, "date" => date("l, F jS", strtotime($date)), "image" => getUserAvatar($mysqli, $userId), "graduationYear" => $graduationYear);
} else {
return "Faulty MYSQL Statement";
}
} else {
return "User does not exist";
}
}
示例6: nl2br
echo '<div style="display:block;min-height:60px;margin-left:70px;padding-bottom:20px;cursor: text;" id="' . $row->cmtid . '-edit">' . nl2br($row->cmttext) . '</div>';
echo '<div class="date">' . sprintf(JText::_('COM_DATSOGALLERY_ON'), $row->cmtname, strftime($ad_datef, (int) $row->cmtdate)) . '</div>';
if (array_intersect($is_admin, $userGroups)) {
echo '<div class="control"><a class="btn-delete">' . JText::_('COM_DATSOGALLERY_DELETE') . '</a> | ' . $action . ' | <a class="btn-spam">Spam</a></div>';
}
echo "</li>\n";
}
echo "</ul>\n";
} else {
echo '<div id="nocom"></div>';
}
if ($ad_anoncomment || $user->id) {
if ($ad_js || $ad_cb) {
$avatar = $user->id ? getUserAvatar($user->id) : getUserAvatar(0);
} elseif ($ad_kunena) {
$avatar = $user->id ? getUserAvatar($user->id) : getUserAvatar(0);
} else {
$avatar = getGravatar($user->email);
}
$brd = $ad_showsend2friend && $user->id ? '' : ' style="border-bottom: 1px solid #DCDCDC"';
?>
<div class="dg_body_background_comment"<?php
echo $brd;
?>
>
<div class="imgblock" style="position:relative;float:right"><?php
echo $avatar;
?>
</div>
<p>
<label for="cmtname"><?php
示例7: getUserAvatar
?>
<div class="sep largetext"><?php
echo _PROFILE;
?>
</div>
<div class="container2 notsowide">
<table cellspacing="0" cellpadding="4" border="0" width="100%">
<tr>
<td align="right" class="nowrap"><?php
echo _AVATAR;
?>
:</td>
<td width="100%">
<div id="avatar_current">
<?php
echo getUserAvatar("", $_auth["useid"]);
?>
<?php
$script = "make_invisible('avatar_current'); " . "make_visible('avatar_hint'); " . "make_visible('avatar_choose'); " . "return false;";
?>
<a href="" onclick="<?php
echo $script;
?>
">
<?php
echo getIMG(urlf() . "images/emoticons/edit.png", "") . " " . _CHANGE;
?>
</a>
</div>
<div id="avatar_choose" style="display: none">
<?php
示例8: while
$togo = $friendLimit;
while ($rowData = mysql_fetch_assoc($result)) {
if ($togo <= 0) {
break;
}
$togo--;
?>
<div class="<?php
echo $odd ? "f_left" : "f_right";
?>
mar_right mar_bottom">
<?php
if (!$odd) {
echo getUserLink($rowData["useid"]) . " ";
}
echo getUserAvatar("", $rowData["useid"], false, true);
if ($odd) {
echo " " . getUserLink($rowData["useid"]);
}
?>
</div>
<?php
$odd = !$odd;
if ($odd) {
echo '<div class="clear"> </div>';
}
}
?>
<?php
iefixEnd();
?>
示例9: isLoggedIn
<?php
$whereGuest = isLoggedIn() ? "" : " AND `useGuestAccess` = '1' ";
$result = sql_query("SELECT `useid`,`useUsername` FROM `users`, `useExtData` " . "WHERE `useUsername` = '" . addslashes($_cmd[1]) . "' AND `useid` = `useEid` {$whereGuest} LIMIT 1");
if (!($useData = mysql_fetch_assoc($result))) {
include INCLUDES . "p_notfound.php";
return;
}
$useUsername = strtolower($useData["useUsername"]);
$_pollUser = $useData["useid"];
$_documentTitle = $useData["useUsername"] . ": " . _FAVOURITES;
?>
<div class="header">
<div class="f_right mar_left a_center normaltext">
<?php
echo getUserAvatar("", $useData["useid"], true);
?>
</div>
<div class="f_left header_title">
<?php
echo $useData["useUsername"];
?>
<div class="subheader"><?php
echo _FAVOURITES;
?>
</div>
</div>
<?php
$active = 2;
include INCLUDES . "mod_usermenu.php";
?>
示例10: foreach
</script>
</head>
<body>
<h1><?php
echo $schoolName;
?>
</h1>
<h4><?php
echo $schoolLocation;
?>
</h4>
<h2>Members</h2>
<ul>
<?php
foreach ($members as $i => $member) {
$image = getUserAvatar($mysqli, $member["id"]);
$member = array_merge($member, array("image" => $image));
$members[$i] = $member;
?>
<li>
<a href="user.php?id=<?php
echo $member["id"];
?>
">
<img id="user_profile" width="50" height="50" src="<?php
echo $member["image"];
?>
" />
<?php
echo $member["firstName"] . " " . $member["lastName"];
示例11: commentAdd
function commentAdd()
{
$db = JFactory::getDBO();
$user = JFactory::getUser();
$post = JRequest::get('post');
$post = array_map('addslashes', $post);
$cmtip = getIpAddress();
jimport('joomla.mail.helper');
require JPATH_COMPONENT_ADMINISTRATOR . DS . 'config.datsogallery.php';
if ($post) {
if (refererCheck()) {
echo '<li class="dg_body_error_message"><div>' . refererCheck() . '</div></li>';
} elseif (blacklistCheck($cmtip)) {
echo '<li class="dg_body_error_message"><div>' . blacklistCheck($cmtip) . '</div></li>';
} elseif (empty($post['cmtname'])) {
echo '<li class="dg_body_error_message"><div>' . JText::_('COM_DATSOGALLERY_ENTER_NAME') . '</div></li>';
} elseif (empty($post['cmtmail'])) {
echo '<li class="dg_body_error_message"><div>' . JText::_('COM_DATSOGALLERY_ENTER_EMAIL') . '</div></li>';
} elseif (JMailHelper::isEmailAddress($post['cmtmail']) == false) {
echo '<li class="dg_body_error_message"><div>' . JText::_('COM_DATSOGALLERY_INVALID_EMAIL') . '</div></li>';
} elseif (empty($post['cmttext'])) {
echo '<li class="dg_body_error_message"><div>' . JText::_('COM_DATSOGALLERY_ENTER_COMMENT') . '</div></li>';
} elseif (empty($post['dgcaptchaval'])) {
echo '<li class="dg_body_error_message"><div>' . JText::_('COM_DATSOGALLERY_ENTER_CODE') . '</div></li>';
} else {
if (!$user->id && strlen($post['cmtname']) < 4) {
echo '<li class="dg_body_error_message"><div>' . JText::_('COM_DATSOGALLERY_NAME_IS_TOO_SHORT') . '</div></li>';
} elseif (empty($_SESSION['CAPTCHA']) || strtolower($post['dgcaptchaval']) != $_SESSION['CAPTCHA']) {
echo '<li class="dg_body_error_message"><div>' . JText::_('COM_DATSOGALLERY_SECURITY_NOT_VALUE') . '</div></li>';
} else {
$db->setQuery("INSERT INTO #__datsogallery_comments SET cmtpic='" . $post['cmtpic'] . "', cmtip='" . $cmtip . "', cmtname='" . $post['cmtname'] . "', cmtmail='" . $post['cmtmail'] . "', cmttext='" . $post['cmttext'] . "', cmtdate ='" . time() . "', published = 1");
$db->query();
echo "<li class=\"pane\">\n";
echo "<div class=\"imgblock\">";
if ($ad_js || $ad_cb || $ad_kunena) {
$avatar = $user->id ? getUserAvatar($user->id) : getUserAvatar(0);
} else {
$avatar = getGravatar($post['cmtmail']);
}
echo $avatar;
echo "</div>";
echo '<div style="display:block;min-height:60px;margin-left:70px;padding-bottom:20px">' . stripslashes(nl2br($post['cmttext'])) . '</div>';
echo '<div class="date">' . sprintf(JText::_('COM_DATSOGALLERY_ON'), $post['cmtname'], strftime($ad_datef, time())) . '</div>';
echo "</li>\n";
$db->setQuery('SELECT notify' . ' FROM #__datsogallery' . ' WHERE id = ' . $post['cmtpic']);
$unotify = $db->loadResult();
if ($ad_comment_notify && $unotify != 0) {
commentNotify($post['cmtpic'], $post['cmtname'], $post['cmtmail'], stripslashes(dgwordlimiter($post['cmttext'], $ad_comment_wl)));
}
}
}
exit;
}
}
示例12: showComment
//.........这里部分代码省略.........
:
</div>
<div class="reminder">
<?php
echo formatText($parData["comComment"], $parData["comNoEmoticons"], $parData["comNoBBCode"]);
?>
</div>
<?php
}
} elseif ($showParent && isset($comData["pmsid"])) {
$result = sql_query("SELECT * FROM `pms` WHERE `pmsid` = '" . $comData["comObj"] . "' LIMIT 1");
if ($parData = mysql_fetch_assoc($result)) {
if ($parData["pmsCreator"] == $_auth["useid"] || $parData["pmsPmUser"] == $_auth["useid"]) {
?>
<div class="caption reminder_cap">
<?php
echo sprintf(_WROTE, getUserLink($parData["pmsCreator"]));
?>
:
</div>
<div class="reminder">
<?php
echo formatText($parData["pmsComment"], $parData["pmsNoEmoticons"], $parData["pmsNoBBCode"]);
?>
</div>
<?php
}
}
}
if ($comData["comCreator"] != 0) {
?>
<div class="f_right mar_left a_center" style="position: relative; top: -3px; left: 3px">
<?php
echo getUserAvatar("", $comData["comCreator"], true);
?>
</div>
<?php
}
if (isset($comData["comSubject"])) {
if (!isset($comData["comSubjectDateHide"])) {
?>
<div class="smalltext mar_bottom"><?php
// Show IPs to moderators+ (as an acronym).
if (atLeastModerator() && isset($comData["comSubmitIp"]) && isset($comData["comEditIp"])) {
?>
<acronym style="cursor: help" title="Submitted from <?php
echo getDotDecIp($comData["comSubmitIp"]);
?>
, last edited from <?php
echo getDotDecIp($comData["comEditIp"]);
?>
">
<?php
}
printf(_COMMENT_POSTED_ON, gmdate($_auth["useDateFormat"], applyTimezone(strtotime($comData["comSubmitDate"]))));
// Close the acronym opened above.
if (atLeastModerator() && isset($comData["comSubmitIp"]) && isset($comData["comEditIp"])) {
?>
</acronym>
<?php
}
?>
</div><?php
}
?>
<div class="largetext mar_bottom"><b><?php
示例13: isset
echo _FAVOURITES;
?>
:</div>
<?php
$offset = isset($_GET["offset"]) ? intval($_GET["offset"]) : 0;
$limit = 30;
$whereGuest = isLoggedIn() ? "" : " AND `useGuestAccess` = '1' ";
$friendQuery = sql_query("SELECT SQL_CALC_FOUND_ROWS * FROM `favourites` " . "WHERE `favObj`='" . $objData['objid'] . "' {$whereGuest} ORDER BY `favSubmitDate` DESC LIMIT {$offset}, {$limit}");
$cntResult = sql_query("SELECT FOUND_ROWS()");
$totalCount = mysql_result($cntResult, 0);
?>
<div class="container2">
<?php
navControls($offset, $limit, $totalCount);
?>
<div class="clear"> </div>
<?php
while ($rowData = mysql_fetch_assoc($friendQuery)) {
?>
<div class="f_left a_center mar_right mar_bottom" style="height: 100px">
<?php
echo getUserAvatar("", $rowData["favCreator"], true);
?>
</div>
<?php
}
?>
<div class="clear"> </div>
</div>
</div>
示例14: fmtCallbackUsericon
function fmtCallbackUsericon($sender)
{
global $__maxIcons;
if ($__maxIcons <= 0) {
return '[' . _BBCODE_ICON . '=' . $sender[1] . ']';
}
$__maxIcons--;
$size = 100;
// default value
fmtParseParams($sender[1], $name, $size);
if ($size < 40) {
$size = 40;
}
// minimum value
if ($size > 100) {
$size = 100;
}
// maximum value
return getUserAvatar($name, 0, false, false, $size);
}
示例15: getMitgliederliste
function getMitgliederliste(array $params)
{
// Rückgabe-Variable definieren
$html = '';
// Modul für DB-Zugriff einbinden
require_once 'konfiguration.php';
// Verbindung zur Datenbank herstellen
// am System mit Host, Benutzernamen und Password anmelden
@mysql_connect(MYSQL_HOST, MYSQL_BENUTZER, MYSQL_KENNWORT) or die('Could not connect to mysql server.');
@mysql_select_db(MYSQL_DATENBANK) or die('Could not select database.');
mysql_set_charset('utf8');
// SQL-Befehl zurechtfuddeln,
// die aktuellen Mitglieder werden ermittelt
$sql = sprintf('
SELECT
`mitglieder`.*
FROM
`mitglieder`
WHERE
`mitglieder`.`status` = "%s" AND (`mitglieder`.`id` < 9996 OR `mitglieder`.`id` > 9999)
ORDER BY
%s ASC
', $params['Mitgliedsstatus'], $params['Sortierung']);
// zuvor definierte SQL-Anweisung ausführen
// Anzahl der Datensätze sollte größer als 0 sein um TRUE zurückzugeben
$db_erg = mysql_query($sql);
// Zählervariable initialisieren
$i = 0;
// es sind Datensätze vorhanden
if (mysql_num_rows($db_erg) > 0) {
// Überschrift für den Mitgliedsstatus ermitteln
$tabellenkopf = getMitgliedsstatus($params['Mitgliedsstatus']);
// erste Zeile festlegen für die entsprechende Mitgliedsgruppe
$html = sprintf('<tr><th colspan="6" bgcolor="#ccccff" style="border: 1px solid #8080ff; font-size: 11pt; color: navy;"><a name="%s">%s</a></th></tr>', $params['Mitgliedsstatus'], $tabellenkopf);
// Tabellenüberschriften
$html .= '<tr><td colspan="6" height="5"></td></tr>';
$html .= '<tr>';
$html .= '<th width="85" bgcolor="#666666" style="border-bottom: 1px solid #ffffff;"> </th>';
$html .= '<th align="left" width="210" bgcolor="#666666" style="color: #ffffff; border-bottom: 1px solid #ffffff;">Name</th>';
$html .= '<th align="left" width="140" bgcolor="#666666" style="color: #ffffff; border-bottom: 1px solid #ffffff;">Funktion</th>';
$html .= '<th align="left" width="120" bgcolor="#666666" style="color: #ffffff; border-bottom: 1px solid #ffffff;">Telefon</th>';
$html .= '<th align="left" width="250" bgcolor="#666666" style="color: #ffffff; border-bottom: 1px solid #ffffff;">eMail</th>';
$html .= '<th align="left" width="65" bgcolor="#666666" style="color: #ffffff; border-bottom: 1px solid #ffffff;"> </th>';
$html .= '</tr>';
while ($zeile = mysql_fetch_object($db_erg)) {
// Hintergrundfarbe für gerade/ungerade Zeilen festlegen
$bgColor = $i % 2 ? '#eeeeee' : '#cccccc';
// Avatar des aktuellen Mitglieds ermitteln
$avatar = getUserAvatar($zeile->id, $zeile->anrede);
// Name kürzen falls nötig
if (substr($zeile->nachname, strlen($zeile->nachname) - 2, 1) == ' ' || substr($zeile->nachname, strlen($zeile->nachname) - 3, 1) == ' ') {
// Name einkürzen, bsp: aus Koch C wird Koch
$zeile->nachname = substr($zeile->nachname, 0, strlen($zeile->nachname) - 2);
// führende und endende Leerzeichen entfernen falls vorhanden
$zeile->nachname = trim($zeile->nachname);
}
// eine neue Zeile für die Tabelle anlegen inkl. Hintergrundfarbe
$html .= sprintf('<tr bgcolor="%s" id="o%s">', $bgColor, $zeile->id);
$html .= sprintf('<td valign="top" align="center"><img src="%s" height="100" width="75" vspace="3" style="border: 1px solid #999999;" /></td>', $avatar);
$html .= sprintf('<td valign="top" align="left"><strong>%s %s</strong><br /><br />%s<br />%s %s</td>', nl2br($zeile->vorname), nl2br($zeile->nachname), $zeile->strasse, $zeile->plz, $zeile->ort);
$html .= sprintf('<td valign="top" align="left">%s</td>', nl2br($zeile->funktion));
$html .= sprintf('<td valign="top" align="left">%s<br />%s</td>', nl2br($zeile->telefon1), nl2br($zeile->mobil1));
// es wird geprüft, ob eine gültige eMail-Adresse eingetragen ist
if (!empty($zeile->email)) {
// eMail-Adresse zurückgeben
$html .= sprintf('
<td valign="top" align="left">
<a href="mailto:%s" class="mitgliederliste"><img src="./img/email_icon.png" border="0" align="left" /> %s</a>
</td>', $zeile->email, nl2br($zeile->email));
} else {
// keine eMail-Adresse hinterlegt
$html .= '<td></td>';
}
// Felder hinzufügen für Bearbeiten, Löschen und PDF-Druck
$html .= sprintf('
<td valign="top" align="left" nowrap>
<a href="mitglieder_edit.php?acb_nr=%s"><img src="./img/edit_icon.gif" border="0" vspace="3" title="bearbeiten" /></a>
<a onClick="mitglied_zurueckholen(\'%s\');" style="cursor: pointer;"><img src="./img/1468798748_Up.png" border="0" vspace="5" title="zurückholen" /></a>
<a href="pdf_mitglied.php?acb_nr=%s" target="_blank"><img src="./img/pdf_icon_16x19.png" border="0" vspace="3" title="PDF drucken" height="18" /></a>
</td>', $zeile->id, $zeile->id, $zeile->id);
// Ende der Zeile
$html .= '</tr>';
// Zähler erhöhen
$i++;
}
}
// Verbindung zur Datenbank schließen
mysql_free_result($db_erg);
// Rückgabe der Vorstandsmitglieder
return $html;
}