本文整理汇总了PHP中XoopsUser::user_avatar方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsUser::user_avatar方法的具体用法?PHP XoopsUser::user_avatar怎么用?PHP XoopsUser::user_avatar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsUser
的用法示例。
在下文中一共展示了XoopsUser::user_avatar方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showFriends
/**
* @desc Visualiza la lista de amigos del usuario
**/
function showFriends()
{
global $xoopsOption, $tpl, $db, $xoopsUser, $xoopsModuleConfig, $pag, $xoopsConfig;
$xoopsOption['template_main'] = 'gs_panel_friends.html';
include 'header.php';
$mc =& $xoopsModuleConfig;
GSFunctions::makeHeader();
//Barra de Navegación
$sql = "SELECT COUNT(*) FROM " . $db->prefix('gs_friends') . " WHERE gsuser='" . $xoopsUser->uid() . "'";
$page = isset($pag) ? $pag : '';
$limit = 30;
list($num) = $db->fetchRow($db->query($sql));
if ($page > 0) {
$page -= 1;
}
$start = $page * $limit;
$tpages = (int) ($num / $limit);
if ($num % $limit > 0) {
$tpages++;
}
$pactual = $page + 1;
if ($pactual > $tpages) {
$rest = $pactual - $tpages;
$pactual = $pactual - $rest + 1;
$start = ($pactual - 1) * $limit;
}
if ($tpages > 1) {
if ($mc['urlmode']) {
$urlnav = 'cpanel/friends';
} else {
$urlnav = 'cpanel.php?by=cpanel/friends';
}
$nav = new GsPageNav($num, $limit, $start, 'pag', $urlnav, 0);
$tpl->assign('friendsNavPage', $nav->renderNav(4, 1));
}
$showmax = $start + $limit;
$showmax = $showmax > $num ? $num : $showmax;
$tpl->assign('lang_showing', sprintf(__('Sowing friends %u to %u from %u.', 'galleries'), $start + 1, $showmax, $num));
$tpl->assign('limit', $limit);
$tpl->assign('pag', $pactual);
//Fin de barra de navegación
$sql = "SELECT * FROM " . $db->prefix('gs_friends') . " WHERE gsuser='" . $xoopsUser->uid() . "'";
$sql .= " LIMIT {$start},{$limit}";
$result = $db->query($sql);
while ($row = $db->fetchArray($result)) {
$xu = new XoopsUser($row['uid']);
$tpl->append('users', array('uid' => $xu->uid(), 'uname' => $xu->uname(), 'link' => XOOPS_URL . "/modules/galleries/" . ($mc['urlmode'] ? "usr/" . $xu->uname() . "/" : "user.php?id=usr/" . $xu->uname()), 'avatar' => RMEvents::get()->run_event('rmcommon.get.avatar', $xu->email(), 0, $xu->user_avatar() != '' ? XOOPS_URL . '/uploads/avatars/' . $xu->user_avatar() : GS_URL . '/images/avatar.png')));
}
$tpl->assign('lang_uname', __('User name', 'galleries'));
$tpl->assign('lang_newfriend', __('New Friend', 'galleries'));
$tpl->assign('lang_del', __('Delete', 'galleries'));
$tpl->assign('lang_confirm', __('Do you really wish to delete specified friend?', 'galleries'));
$tpl->assign('lang_confirms', __('Do you really wish to delete selected friends?', 'galleries'));
$tpl->assign('form_action_add', GSFunctions::get_url() . ($mc['urlmode'] ? 'cp/add/' : '?cp=add'));
$tpl->assign('form_action_del', GSFunctions::get_url() . ($mc['urlmode'] ? 'cp/delete/' : '?cp=delete'));
$tpl->assign('delete_link', GSFunctions::get_url() . ($mc['urlmode'] ? 'cp/deletefriend/pag/' . $pactual . '/id/' : '?cp=deletefriend&page=' . $pactual . '&id='));
RMTemplate::get()->add_style('panel.css', 'galleries');
createLinks();
include 'footer.php';
}
示例2: sanitize
$created = sanitize(date("d-m-Y H:i:s", $row['com_created']));
$modified = sanitize(date("d-m-Y H:i:s", $row['com_modified']));
$userid = sanitize($row['com_uid']);
$ip = sanitize($row['com_ip']);
$title = sanitize($row['com_title']);
$text = sanitize($row['com_text']);
$signature = sanitize($row['com_sig']);
$status = sanitize($row['com_status']);
$params = sanitize($row['com_exparams']);
$dohtml = sanitize($row['dohtml']);
$dosmiley = sanitize($row['dosmiley']);
$xcode = sanitize($row['doxcode']);
$doimage = sanitize($row['doimage']);
$linebreak = sanitize($row['dobr']);
$user = new XoopsUser($row['com_uid']);
$avatar = $user->user_avatar($row['com_uid']);
$rank = $user->rank($row['com_uid']);
$rank_title = $rank['title'];
$rank_image = XOOPS_UPLOAD_URL . "/" . $rank['image'];
$regdate = date("d-m-Y", $user->user_regdate($row['com_uid']));
$userLocation = $user->user_from($row['com_uid']);
$numposts = $user->getVar("posts");
$checkstatus = $user->isOnline();
if ($checkstatus > 0) {
$status = "Online";
} else {
$status = "Offline";
}
if ($icon = '') {
$comment_image = '';
} else {
示例3: while
$xoopsTpl->assign('sort_email', "<a href='" . XOOPS_URL . "/modules/membership/index.php?sortby=email" . $pagenav_args . "'>" . _MA_MSHIP_EMAIL . "</a>");
$xoopsTpl->assign('sort_pm', "<a href='" . XOOPS_URL . "/modules/membership/index.php?sortby=email" . $pagenav_args . "'>" . _MA_MSHIP_PM . "</a>");
$xoopsTpl->assign('sort_url', "<a href='" . XOOPS_URL . "/modules/membership/index.php?sortby=url" . $pagenav_args . "'>" . _MA_MSHIP_URL . "</a>");
if ($is_admin) {
$xoopsTpl->assign('functions', "<a href='" . XOOPS_URL . "/modules/membership/index.php?sortby=email" . $pagenav_args . "'>" . _MA_MSHIP_FUNCTIONS . "</a>");
}
if ($d_sortby != $sortby) {
$pagenav_args .= '&sortby=' . $sortby;
}
$num_users = $xoopsDB->getRowsNum($result);
//number of users per sorted and limit query
if ($totalcount > 0) {
while ($userinfo = $xoopsDB->fetchArray($result)) {
$userinfo = new XoopsUser($userinfo['uid']);
$user = array();
$avatar = $userinfo->user_avatar();
if ($avatar == 'blank.gif' && $xoopsModuleConfig['defaultavatar']) {
$user['avatar'] = "<img src='" . XOOPS_URL . "/modules/membership/images/davatar.gif' alt='' width='64' height='64' />";
} else {
$user['avatar'] = "<img src='" . XOOPS_URL . "/uploads/" . $userinfo->user_avatar() . "' alt='' width='64' height='64' />";
}
$user['nickname'] = "<a href='" . XOOPS_URL . "/userinfo.php?uid=" . $userinfo->uid() . "'>" . $userinfo->uname("E") . "</a>";
$user['regdate'] = formatTimeStamp($userinfo->user_regdate(), "m");
$showmail = 0;
if ($userinfo->user_viewemail()) {
$showmail = 1;
} else {
if ($is_admin) {
$showmail = 1;
}
}
示例4: time
if (is_object($xoopsModule)) {
$online_handler->write($uid, $uname, time(), $xoopsModule->getVar('mid'), $_SERVER['REMOTE_ADDR']);
} else {
$online_handler->write($uid, $uname, time(), 0, $_SERVER['REMOTE_ADDR']);
}
$onlines = $online_handler->getAll();
$userlist='';
if (false != $onlines) {
$total = count($onlines);
$count = 0;
for ($i = 0; $i < $total; $i++) {
if (($onlines[$i]['online_uid'] > 0) && ($onlines[$i]['online_uid']!=$uid)) {
$count++;
$user = new XoopsUser($onlines[$i]['online_uid']);
$avatar =$user->user_avatar();
if ($avatar!='blank.gif') {
$avatarURL = XOOPS_URL."/uploads/".$avatar;
} else {
$avatarURL = XOOPS_URL."/modules/xim/images/default_avatar.png";
}
$config = im_Getconfig($onlines[$i]['online_uname']);
$status = $config['status'];
$userid=$onlines[$i]['online_uid'];
$username = $onlines[$i]['online_uname'];
$userlist .= <<<EOD
{"id":"$userid","n":"$username","a":"$avatarURL","status":$status},
EOD;
}
示例5: sendChat
function sendChat() {
global $xoopsDB, $xoopsUser;
$from = $_SESSION['xoopsUserId'];
$to = $_POST['to'];
$message = $_POST['message'];
$user = new XoopsUser($from);
$uname = $user->uname();
$avatar =$user->user_avatar();
if ($avatar!='blank.gif') {
$avatarURL = XOOPS_URL."/uploads/".$avatar;
} else {
$avatarURL = XOOPS_URL."/modules/xim/images/default_avatar.png";
}
$_SESSION['openChatBoxes'][$_POST['to']] = date('Y-m-d H:i:s', time());
$config = im_Getconfig($user);
$soundUrl = XOOPS_URL.'/modules/xim/media/0.mp3';
$status = $config['status'];
$messagesan = sanitize($message);
header('Content-type: application/json');
echo '{"message":"'.$messagesan.'"}';
if (!isset($_SESSION['chatHistory'][$_POST['to']])) {
$_SESSION['chatHistory'][$_POST['to']] = '';
}
$_SESSION['chatHistory'][$_POST['to']] .= <<<EOD
{"s":"1","n":"{$uname}","a":"$avatarURL","f":"{$to}","m":"{$messagesan}","q":"$soundUrl","p":"$status"},
EOD;
unset($_SESSION['tsChatBoxes'][$_POST['to']]);
$sql = "insert into ".$xoopsDB->prefix(xim_chat)." (".$xoopsDB->prefix(xim_chat).".from,".$xoopsDB->prefix(xim_chat).".to,message,sent) values ('".mysql_real_escape_string($from)."', '".mysql_real_escape_string($to)."','".mysql_real_escape_string($message)."',NOW())";
$query = $xoopsDB->query($sql);
//echo "1";
exit(0);
}