本文整理汇总了PHP中user_online函数的典型用法代码示例。如果您正苦于以下问题:PHP user_online函数的具体用法?PHP user_online怎么用?PHP user_online使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了user_online函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login_check
function login_check()
{
global $smarty;
$email = @$_POST['email'];
$pass = @$_POST['loginpass'];
if (login_needcaptcha()) {
if (recaptcha_verify() !== true) {
login_error(_('The CAPTCHA you entered is incorrect'));
die;
}
}
$ret = user_verify($email, $pass);
if ($ret !== true) {
login_incfail();
login_error($ret);
die;
} else {
user_online($email);
login_resetfail();
$url = 'account.php';
header("Location: {$url}");
$smarty->assign('url', $url);
$smarty->display('templates/redirect.html');
}
}
示例2: check_permissions
function check_permissions()
{
if (user_online()) {
log_write("error", "You are already logged in, there is no need to revisit the login page.");
return 0;
} else {
return 1;
}
}
示例3: check_permissions
function check_permissions()
{
if (!user_online()) {
return 0;
}
if ($GLOBALS["config"]["AUTH_METHOD"] != "sql") {
log_write("error", "page", "User options can only be configured when using local user authentication");
return 0;
}
return 1;
}
示例4: error_render_noperms
function error_render_noperms()
{
// display a different message if the user isn't online
if (user_online()) {
$_SESSION["error"]["message"] = array("Sorry, your login permissions do not permit you to access this content.");
// end the page
$_SESSION["error"]["pagestate"] = 0;
} else {
error_render_nologin();
}
return 1;
}
示例5: reg_save
function reg_save()
{
global $smarty;
$email = @$_POST['email'];
$pass = @$_POST['loginpass'];
$pass2 = @$_POST['loginpass2'];
if ($pass == '' || $email == '') {
reg_main(_('Please enter email and password'));
return false;
}
if (strpos($email, '@') == false || strpos($email, '.') == false) {
reg_main(_('Invalid email address'));
return false;
}
if ($pass != $pass2) {
reg_main(_('Password does not match'));
return false;
}
if (recaptcha_verify() !== true) {
reg_main(_('The CAPTCHA you enter is not correct'));
return false;
}
if (INVITECODE_ENABLED == 1 && reg_checkinvite(@$_POST['invitecode']) == false) {
reg_main(_('The invite code is invalid or have been used'));
return false;
}
$ret = user_add($email, $pass);
if ($ret !== true) {
reg_main("<p>{$ret}</p>" . _('<p>Register fail, please contact us for help if you need.</p>'));
return false;
}
$user = user_get($email);
if (INVITECODE_ENABLED == 1) {
invite_use($_POST['invitecode'], $user['id']);
}
user_online($email);
$smarty->assign('tip_title', _('Register successed'));
$smarty->assign('tip_msg', _('You have registerd successfully'));
$smarty->assign('redirect_url', 'account.php');
$smarty->display('tip.html');
}
示例6: abs
############################################################################################
## Изменение заметки ##
############################################################################################
############################################################################################
## Изменение заметки ##
############################################################################################
case 'note':
if (isset($_GET['id'])) {
$id = abs(intval($_GET['id']));
} else {
$id = 0;
}
if ($id > 0) {
$data = DB::run()->queryFetch("SELECT * FROM contact WHERE contact_id=? AND contact_user=? LIMIT 1;", array($id, $log));
if (!empty($data)) {
echo '<img src="/images/img/edit.gif" alt="image" /> Заметка для пользователя <b>' . nickname($data['contact_name']) . '</b> ' . user_online($data['contact_name']) . ':<br /><br />';
echo '<div class="form">';
echo '<form method="post" action="contact.php?act=editnote&id=' . $id . '&start=' . $start . '&uid=' . $_SESSION['token'] . '">';
echo 'Заметка:<br />';
echo '<textarea cols="25" rows="5" name="msg">' . $data['contact_text'] . '</textarea><br />';
echo '<input value="Редактировать" name="do" type="submit" /></form></div><br />';
} else {
show_error('Ошибка редактирования заметки!');
}
} else {
show_error('Ошибка! Не выбран пользователь для добавления заметки!');
}
echo '<img src="/images/img/back.gif" alt="image" /> <a href="contact.php?start=' . $start . '">Вернуться</a><br />';
break;
############################################################################################
## Добавление заметки ##
示例7: bb_code
(<?php
echo $data['topics_posts'];
?>
)
</div>
<div>
<?php
echo bb_code($data['posts_text']);
?>
<br />
Написал: <?php
echo nickname($data['posts_user']);
?>
<?php
echo user_online($data['posts_user']);
?>
<small>(<?php
echo date_fixed($data['posts_time']);
?>
)</small><br />
<?php
if (is_admin() || empty($config['anonymity'])) {
?>
<span class="data">(<?php
echo $data['posts_brow'];
?>
, <?php
echo $data['posts_ip'];
?>
示例8: profile
<?php
}
?>
<b><?php
echo profile($data['commblog_author']);
?>
</b> <small>(<?php
echo date_fixed($data['commblog_time']);
?>
)</small><br />
<?php
echo user_title($data['commblog_author']);
?>
<?php
echo user_online($data['commblog_author']);
?>
</div>
<?php
if (!empty($log) && $log != $data['commblog_author']) {
?>
<div class="right">
<a href="blog.php?act=reply&id=<?php
echo $blogs['blogs_id'];
?>
&pid=<?php
echo $data['commblog_id'];
?>
&start=<?php
echo $start;
示例9: explode
$start = 0;
}
if ($total < $start + $config['lifelist']) {
$end = $total;
} else {
$end = $start + $config['lifelist'];
}
for ($i = $start; $i < $end; $i++) {
$data = explode("|", $file[$i]);
echo '<div class="b">' . $data[1] . '. <img src="../images/img/chel.gif" alt="image" /> ';
if ($uz == $data[2]) {
echo '<b><big><a href="../pages/anketa.php?uz=' . $data[2] . '&' . SID . '"><span style="color:#ff0000">' . nickname($data[2]) . '</span></a></big></b> ';
} else {
echo '<b><a href="../pages/anketa.php?uz=' . $data[2] . '&' . SID . '">' . nickname($data[2]) . '</a></b> ';
}
echo user_online($data[2]) . '</div>';
echo '<div>Провел на сайте: ' . makestime($data[3]) . '</div>';
}
page_jumpnavigation('lifelist.php?', $config['userlist'], $start, $total);
page_strnavigation('lifelist.php?', $config['userlist'], $start, $total);
############################################################################################
## Поиск пользователя ##
############################################################################################
if (empty($uz)) {
echo '<hr /><b>Поиск пользователя:</b><br />';
echo '<form action="lifelist.php?start=' . $start . '&' . SID . '" method="post">';
echo '<input name="uz" value="' . $log . '" />';
echo '<input type="submit" value="Искать" /></form><hr />';
} else {
$string = search_string(DATADIR . "datatmp/lifelist.dat", $uz, 2);
if ($string) {
示例10: isset
############################################################################################
## Просмотр по пользователям ##
############################################################################################
case 'view':
$uz = isset($_GET['uz']) ? check($_GET['uz']) : '';
if (user($uz)) {
$total = DB::run()->querySingle("SELECT COUNT(*) FROM `transfers` WHERE `trans_user`=?;", array($uz));
if ($total > 0) {
if ($start >= $total) {
$start = 0;
}
$queryhist = DB::run()->query("SELECT * FROM `transfers` WHERE `trans_user`=? ORDER BY `trans_time` DESC LIMIT " . $start . ", " . $config['listtransfers'] . ";", array($uz));
while ($data = $queryhist->fetch()) {
echo '<div class="b">';
echo '<div class="img">' . user_avatars($data['trans_user']) . '</div>';
echo '<b>' . profile($data['trans_user']) . '</b> ' . user_online($data['trans_user']) . ' ';
echo '<small>(' . date_fixed($data['trans_time']) . ')</small>';
echo '</div>';
echo '<div>';
echo 'Кому: ' . profile($data['trans_login']) . '<br />';
echo 'Сумма: ' . moneys($data['trans_summ']) . '<br />';
echo 'Комментарий: ' . $data['trans_text'] . '<br />';
echo '</div>';
}
page_strnavigation('transfers.php?act=view&uz=' . $uz . '&', $config['listtransfers'], $start, $total);
echo 'Всего операций: <b>' . $total . '</b><br /><br />';
} else {
show_error('Истории операций еще нет!');
}
} else {
show_error('Ошибка! Данный пользователь не найден!');
示例11: array_reverse
$file = array_reverse($file);
$total = count($file);
if ($total > 0) {
echo '<form action="kontakt.php?action=del&start=' . $start . '&uid=' . $_SESSION['token'] . '&' . SID . '" method="post">';
if ($start < 0 || $start > $total) {
$start = 0;
}
if ($total < $start + $config['kontaktlist']) {
$end = $total;
} else {
$end = $start + $config['kontaktlist'];
}
for ($i = $start; $i < $end; $i++) {
$data = explode("|", $file[$i]);
$num = $total - $i - 1;
echo '<div class="b">' . user_avatars($data[1]) . ' ' . ($i + 1) . '. <b><a href="anketa.php?uz=' . $data[1] . '&' . SID . '">' . nickname($data[1]) . '</a></b> ' . user_online($data[1]) . '</div>';
echo '<div>Дабавлен: ' . date_fixed($data[2]) . '<br />';
echo '<input type="checkbox" name="del[]" value="' . $num . '" /> ';
echo '<a href="privat.php?action=submit&uz=' . $data[1] . '&' . SID . '">Написать</a> | ';
echo '<a href="../games/perevod.php?uz=' . $data[1] . '&' . SID . '">Перевод</a></div>';
}
echo '<br /><input type="submit" value="Удалить выбранное" /></form>';
page_jumpnavigation('kontakt.php?', $config['kontaktlist'], $start, $total);
page_strnavigation('kontakt.php?', $config['kontaktlist'], $start, $total);
} else {
echo '<img src="../images/img/reload.gif" alt="image" /> <b>Контакт-лист пуст!</b><br />';
}
} else {
echo '<img src="../images/img/reload.gif" alt="image" /> <b>Контакт-лист пуст!</b><br />';
}
echo '<hr /><form method="post" action="kontakt.php?action=add&start=' . $start . '&uid=' . $_SESSION['token'] . '&' . SID . '">';
示例12: last_page
if ($start >= $total) {
$start = last_page($total, $config['postgallery']);
}
$is_admin = is_admin();
if ($is_admin) {
echo '<form action="index.php?act=delcomm&gid=' . $gid . '&start=' . $start . '&uid=' . $_SESSION['token'] . '" method="post">';
}
$querycomm = DB::run()->query("SELECT * FROM `commphoto` WHERE `commphoto_gid`=? ORDER BY `commphoto_time` ASC LIMIT " . $start . ", " . $config['postgallery'] . ";", array($gid));
while ($data = $querycomm->fetch()) {
echo '<div class="b">';
echo '<div class="img">' . user_avatars($data['commphoto_user']) . '</div>';
if ($is_admin) {
echo '<span class="imgright"><input type="checkbox" name="del[]" value="' . $data['commphoto_id'] . '" /></span>';
}
echo '<b>' . profile($data['commphoto_user']) . '</b> <small>(' . date_fixed($data['commphoto_time']) . ')</small><br />';
echo user_title($data['commphoto_user']) . ' ' . user_online($data['commphoto_user']) . '</div>';
if ($log == $data['commphoto_user'] && $data['commphoto_time'] + 600 > SITETIME) {
echo '<div class="right"><a href="index.php?act=editcomm&gid=' . $gid . '&cid=' . $data['commphoto_id'] . '&start=' . $start . '">Редактировать</a></div>';
}
echo '<div>' . bb_code($data['commphoto_text']) . '<br />';
if (is_admin() || empty($config['anonymity'])) {
echo '<span class="data">(' . $data['commphoto_brow'] . ', ' . $data['commphoto_ip'] . ')</span>';
}
echo '</div>';
}
if ($is_admin) {
echo '<span class="imgright"><input type="submit" value="Удалить выбранное" /></span></form>';
}
page_strnavigation('index.php?act=comments&gid=' . $gid . '&', $config['postgallery'], $start, $total);
}
if (empty($photo['photo_closed'])) {
示例13: isset
## Просмотр по пользователям ##
############################################################################################
case 'view':
$uz = isset($_GET['uz']) ? check($_GET['uz']) : '';
if (user($uz)) {
$total = DB::run()->querySingle("SELECT COUNT(*) FROM `banhist` WHERE `ban_user`=?;", array($uz));
if ($total > 0) {
if ($start >= $total) {
$start = 0;
}
$queryhist = DB::run()->query("SELECT * FROM `banhist` WHERE `ban_user`=? ORDER BY `ban_time` DESC LIMIT " . $start . ", " . $config['listbanhist'] . ";", array($uz));
echo '<form action="banhist.php?act=del&start=' . $start . '&uid=' . $_SESSION['token'] . '" method="post">';
while ($data = $queryhist->fetch()) {
echo '<div class="b">';
echo '<div class="img">' . user_avatars($data['ban_user']) . '</div>';
echo '<b>' . profile($data['ban_user']) . '</b> ' . user_online($data['ban_user']) . ' ';
echo '<small>(' . date_fixed($data['ban_time']) . ')</small><br />';
echo '<input type="checkbox" name="del[]" value="' . $data['ban_id'] . '" /> ';
echo '<a href="zaban.php?act=editban&uz=' . $data['ban_user'] . '">Изменить</a></div>';
echo '<div>';
if (!empty($data['ban_type'])) {
echo 'Причина: ' . bb_code($data['ban_reason']) . '<br />';
echo 'Срок: ' . formattime($data['ban_term']) . '<br />';
}
switch ($data['ban_type']) {
case '1':
$stat = '<span style="color:#ff0000">Забанил</span>:';
break;
case '2':
$stat = '<span style="color:#ffa500">Изменил</span>:';
break;
示例14: explode
}
if ($total < $start + $config['postgallery']) {
$end = $total;
} else {
$end = $start + $config['postgallery'];
}
for ($i = $start; $i < $end; $i++) {
$data = explode("|", $file[$i]);
$num = $total - $i - 1;
$data[0] = bb_code($data[0]);
echo '<div class="b"> ';
if ($is_admin) {
echo '<input type="checkbox" name="del[]" value="' . $num . '" /> ';
}
echo user_avatars($data[3]);
echo '<b><a href="../pages/anketa.php?uz=' . $data[3] . '&' . SID . '"> ' . nickname($data[3]) . ' </a></b> ' . user_title($data[3]) . user_online($data[3]);
echo '<small> (' . date_fixed($data[2]) . ')</small></div>';
echo '<div>' . $data[0] . '</div>';
}
if ($is_admin) {
echo '<br /><input type="submit" value="Удалить выбранное" /></form>';
}
page_jumpnavigation('index.php?action=komm&gid=' . $gid . '&', $config['postgallery'], $start, $total);
page_strnavigation('index.php?action=komm&gid=' . $gid . '&', $config['postgallery'], $start, $total);
} else {
show_error('Комментариев еще нет, будь первым!');
}
} else {
show_error('Комментариев еще нет, будь первым!');
}
} else {
示例15: die
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
**************************************************************************/
if (!defined('SCOUT_NUKE')) {
die("You have accessed this page illegally, please go use the main menu");
}
$username = $check['uname'];
$sql = $data->select_query("pms", "WHERE touser={$userid} AND type=3 ORDER BY date DESC");
$numpm = $data->num_rows($sql);
$inboxpm = array();
while ($temp = $data->fetch_array($sql)) {
$temp['touserid'] = $temp['touser'];
$temp['touser'] = get_username($temp['touser']);
$temp2 = $data->select_fetch_one_row("users", "WHERE id={$temp['fromuser']}", "uname");
$temp['fromuserid'] = $temp['fromuser'];
$temp['fromuser'] = get_username($temp['fromuser']);
$temp['subject'] = censor($temp['subject']);
$temp['userstatus'] = user_online($temp['fromuser']);
$inboxpm[] = $temp;
}
$location = "User Control Panel >> Saved Messages";
$tpl->assign("pm", $inboxpm);
$tpl->assign("numpm", $numpm);
$tpl->assign("onpage", "Savebox");
$pagenum = 1;