本文整理汇总了PHP中functions::display_user方法的典型用法代码示例。如果您正苦于以下问题:PHP functions::display_user方法的具体用法?PHP functions::display_user怎么用?PHP functions::display_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类functions
的用法示例。
在下文中一共展示了functions::display_user方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_top
function get_top($order = 'postforum')
{
$req = mysql_query("SELECT * FROM `users` WHERE `{$order}` > 0 ORDER BY `{$order}` DESC LIMIT 9");
if (mysql_num_rows($req)) {
$out = '';
while ($res = mysql_fetch_assoc($req)) {
$out .= $i % 2 ? '<div class="list2">' : '<div class="list1">';
$out .= functions::display_user($res, array('header' => '<b>' . $res[$order] . '</b>')) . '</div>';
++$i;
}
return $out;
} else {
return '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
}
}
示例2: round
$fls = @filesize('../files/forum/attach/' . $res['filename']);
$fls = round($fls / 1024, 0);
$att_ext = strtolower(functions::format('./files/forum/attach/' . $res['filename']));
$pic_ext = array('gif', 'jpg', 'jpeg', 'png');
if (in_array($att_ext, $pic_ext)) {
// Если картинка, то выводим предпросмотр
$file = '<div><a href="index.php?act=file&id=' . $res['id'] . '">';
$file .= '<img src="thumbinal.php?file=' . urlencode($res['filename']) . '" alt="' . $lng_forum['click_to_view'] . '" /></a></div>';
} else {
// Если обычный файл, выводим значок и ссылку
$file = ($res['del'] ? '<img src="../images/del.png" width="16" height="16" />' : '') . '<img src="../images/system/' . $res['filetype'] . '.png" width="16" height="16" /> ';
}
$file .= '<a href="index.php?act=file&id=' . $res['id'] . '">' . htmlspecialchars($res['filename']) . '</a><br />';
$file .= '<small><span class="gray">' . $lng_forum['size'] . ': ' . $fls . ' kb.<br />' . $lng_forum['downloaded'] . ': ' . $res['dlcount'] . ' ' . $lng_forum['time'] . '</span></small>';
$arg = array('iphide' => 1, 'sub' => $file, 'body' => $text);
echo functions::display_user($res_u, $arg);
echo '</div>';
}
echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
if ($total > $kmess) {
// Постраничная навигация
echo '<p>' . functions::display_pagination('index.php?act=files&' . (isset($_GET['new']) ? 'new' : 'do=' . $do) . $lnk . '&', $start, $total, $kmess) . '</p>' . '<p><form action="index.php" method="get">' . '<input type="hidden" name="act" value="files"/>' . '<input type="hidden" name="do" value="' . $do . '"/>' . $input . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' >>"/></form></p>';
}
} else {
echo '<div class="list1">' . $lng['list_empty'] . '</div>';
}
} else {
/*
-----------------------------------------------------------------
Выводим список разделов, в которых есть файлы
-----------------------------------------------------------------
示例3: defined
* @copyright Copyright (C) 2008-2011 JohnCMS Community
* @license LICENSE.txt (see attached file)
* @version VERSION.txt (see attached file)
* @author http://johncms.com/about
*/
defined('_IN_JOHNCMS') or die('Error: restricted access');
/*
-----------------------------------------------------------------
История активности
-----------------------------------------------------------------
*/
$textl = htmlspecialchars($user['name']) . ': ' . $lng_profile['activity'];
require '../incfiles/head.php';
echo '<div class="phdr"><a href="profile.php?user=' . $user['id'] . '"><b>' . $lng['profile'] . '</b></a> | ' . $lng_profile['activity'] . '</div>';
$menu = array(!$mod ? '<b>' . $lng['messages'] . '</b>' : '<a href="profile.php?act=activity&user=' . $user['id'] . '">' . $lng['messages'] . '</a>', $mod == 'topic' ? '<b>' . $lng['themes'] . '</b>' : '<a href="profile.php?act=activity&mod=topic&user=' . $user['id'] . '">' . $lng['themes'] . '</a>', $mod == 'comments' ? '<b>' . $lng['comments'] . '</b>' : '<a href="profile.php?act=activity&mod=comments&user=' . $user['id'] . '">' . $lng['comments'] . '</a>');
echo '<div class="topmenu">' . functions::display_menu($menu) . '</div>' . '<div class="user"><p>' . functions::display_user($user, array('iphide' => 1)) . '</p></div>';
switch ($mod) {
case 'comments':
/*
-----------------------------------------------------------------
Список сообщений в Гостевой
-----------------------------------------------------------------
*/
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `guest` WHERE `user_id` = '" . $user['id'] . "'" . ($rights >= 1 ? '' : " AND `adm` = '0'")), 0);
echo '<div class="phdr"><b>' . $lng['comments'] . '</b></div>';
if ($total > $kmess) {
echo '<div class="topmenu">' . functions::display_pagination('profile.php?act=activity&mod=comments&user=' . $user['id'] . '&', $start, $total, $kmess) . '</div>';
}
$req = mysql_query("SELECT * FROM `guest` WHERE `user_id` = '" . $user['id'] . "'" . ($rights >= 1 ? '' : " AND `adm` = '0'") . " ORDER BY `id` DESC LIMIT {$start}, {$kmess}");
if (mysql_num_rows($req)) {
$i = 0;
示例4: preg_replace
echo '<p><a href="index.php?act=say&id=' . $id . '&yes&cyt">' . $lng_forum['agree'] . '</a> | <a href="index.php?id=' . $type1['refid'] . '">' . $lng_forum['not_agree'] . '</a></p>';
require '../incfiles/end.php';
exit;
}
}
$msg_pre = functions::checkout($msg, 1, 1);
if ($set_user['smileys']) {
$msg_pre = functions::smileys($msg_pre, $datauser['rights'] ? 1 : 0);
}
$msg_pre = preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '<div class="quote">\\1</div>', $msg_pre);
echo '<div class="phdr"><b>' . $lng_forum['topic'] . ':</b> ' . $th1['text'] . '</div>';
$qt = str_replace("<br/>", "\r\n", $qt);
$qt = trim(preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '', $qt));
$qt = functions::checkout($qt, 0, 2);
if (!empty($_POST['msg']) && !isset($_POST['submit'])) {
echo '<div class="list1">' . functions::display_user($datauser, array('iphide' => 1, 'header' => '<span class="gray">(' . functions::display_date(time()) . ')</span>', 'body' => $msg_pre)) . '</div>';
}
echo '<form name="form" action="index.php?act=say&id=' . $id . '&start=' . $start . (isset($_GET['cyt']) ? '&cyt' : '') . '" method="post"><div class="gmenu">';
if (isset($_GET['cyt'])) {
// Форма с цитатой
echo '<p><b>' . $type1['from'] . '</b> <span class="gray">(' . $vr . ')</span></p>' . '<p><h3>' . $lng_forum['cytate'] . '</h3>' . '<textarea rows="' . $set_user['field_h'] . '" name="citata">' . (empty($_POST['citata']) ? $qt : functions::checkout($_POST['citata'])) . '</textarea>' . '<br /><small>' . $lng_forum['cytate_help'] . '</small></p>';
} else {
// Форма с репликой
echo '<p><h3>' . $lng_forum['reference'] . '</h3>' . '<input type="radio" value="0" ' . (!$txt ? 'checked="checked"' : '') . ' name="txt" /> <b>' . $type1['from'] . '</b>,<br />' . '<input type="radio" value="2" ' . ($txt == 2 ? 'checked="checked"' : '') . ' name="txt" /> <b>' . $type1['from'] . '</b>, ' . $lng_forum['reply_1'] . ',<br />' . '<input type="radio" value="3" ' . ($txt == 3 ? 'checked="checked"' : '') . ' name="txt" /> <b>' . $type1['from'] . '</b>, ' . $lng_forum['reply_2'] . ' (<a href="index.php?act=post&id=' . $type1['id'] . '">' . $vr . '</a>) ' . $lng_forum['reply_3'] . ',<br />' . '<input type="radio" value="4" ' . ($txt == 4 ? 'checked="checked"' : '') . ' name="txt" /> <b>' . $type1['from'] . '</b>, ' . $lng_forum['reply_4'] . '</p>';
}
echo '<p><h3>' . $lng_forum['post'] . '</h3>';
if (!$is_mobile) {
echo '</p><p>' . bbcode::auto_bb('form', 'msg');
}
echo '<textarea rows="' . $set_user['field_h'] . '" name="msg">' . (empty($_POST['msg']) ? '' : functions::checkout($_POST['msg'])) . '</textarea></p>' . '<p><input type="checkbox" name="addfiles" value="1" ' . (isset($_POST['addfiles']) ? 'checked="checked" ' : '') . '/> ' . $lng_forum['add_file'];
if ($set_user['translit']) {
示例5: defined
* @author http://johncms.com/about
*/
defined('_IN_JOHNCMS') or die('Error: restricted access');
require '../incfiles/head.php';
$topic_vote = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_forum_vote` WHERE `type` = '1' AND `topic` = '{$id}'"), 0);
if ($topic_vote == 0) {
echo functions::display_error($lng['error_wrong_data']);
require '../incfiles/end.php';
exit;
} else {
$topic_vote = mysql_fetch_array(mysql_query("SELECT `name`, `time`, `count` FROM `cms_forum_vote` WHERE `type` = '1' AND `topic` = '{$id}' LIMIT 1"));
echo '<div class="phdr">' . $lng_forum['voting_users'] . ' «<b>' . htmlentities($topic_vote['name'], ENT_QUOTES, 'UTF-8') . '</b>»</div>';
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_forum_vote_users` WHERE `topic`='{$id}'"), 0);
$req = mysql_query("SELECT `cms_forum_vote_users`.*, `users`.`rights`, `users`.`lastdate`, `users`.`name`, `users`.`sex`, `users`.`status`, `users`.`datereg`, `users`.`id`\n FROM `cms_forum_vote_users` LEFT JOIN `users` ON `cms_forum_vote_users`.`user` = `users`.`id`\n WHERE `cms_forum_vote_users`.`topic`='{$id}' LIMIT {$start},{$kmess}");
$i = 0;
while ($res = mysql_fetch_array($req)) {
echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
echo functions::display_user($res, array('iphide' => 1));
echo '</div>';
++$i;
}
if ($total == 0) {
echo '<div class="menu">' . $lng_forum['voting_users_empty'] . '</div>';
}
echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
if ($total > $kmess) {
echo '<p>' . functions::display_pagination('index.php?act=users&id=' . $id . '&', $start, $total, $kmess) . '</p>' . '<p><form action="index.php?act=users&id=' . $id . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' >>"/></form></p>';
}
echo '<p><a href="index.php?id=' . $id . '">' . $lng_forum['to_topic'] . '</a></p>';
}
require '../incfiles/end.php';
示例6: isset
}
echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
if ($total > $kmess) {
echo '<p>' . functions::display_pagination('profile.php?act=karma&mod=new&', $start, $total, $kmess) . '</p>' . '<p><form action="profile.php?act=karma&mod=new" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' >>"/></form></p>';
}
echo '<p><a href="profile.php">' . $lng['profile'] . '</a></p>';
break;
default:
/*
-----------------------------------------------------------------
Главная страница Кармы, список отзывов
-----------------------------------------------------------------
*/
$type = isset($_GET['type']) ? abs(intval($_GET['type'])) : 0;
$menu = array($type == 2 ? '<b>' . $lng_karma['all'] . '</b>' : '<a href="profile.php?act=karma&user=' . $user['id'] . '&type=2">' . $lng_karma['all'] . '</a>', $type == 1 ? '<b>' . $lng_karma['positive'] . '</b>' : '<a href="profile.php?act=karma&user=' . $user['id'] . '&type=1">' . $lng_karma['positive'] . '</a>', !$type ? '<b>' . $lng_karma['negative'] . '</b>' : '<a href="profile.php?act=karma&user=' . $user['id'] . '">' . $lng_karma['negative'] . '</a>');
echo '<div class="phdr"><a href="profile.php?user=' . $user['id'] . '"><b>' . $lng['profile'] . '</b></a> | ' . $lng['karma'] . '</div>' . '<div class="topmenu">' . functions::display_menu($menu) . '</div>' . '<div class="user"><p>' . functions::display_user($user, array('iphide' => 1)) . '</p></div>';
$karma = $user['karma_plus'] - $user['karma_minus'];
if ($karma > 0) {
$images = ($user['karma_minus'] ? ceil($user['karma_plus'] / $user['karma_minus']) : $user['karma_plus']) > 10 ? '2' : '1';
echo '<div class="gmenu">';
} else {
if ($karma < 0) {
$images = ($user['karma_plus'] ? ceil($user['karma_minus'] / $user['karma_plus']) : $user['karma_minus']) > 10 ? '-2' : '-1';
echo '<div class="rmenu">';
} else {
$images = 0;
echo '<div class="menu">';
}
}
echo '<table width="100%"><tr><td width="22" valign="top"><img src="' . $set['homeurl'] . '/images/k_' . $images . '.gif"/></td><td>' . '<b>' . $lng['karma'] . ' (' . $karma . ')</b>' . '<div class="sub">' . '<span class="green">' . $lng['vote_for'] . ' (' . $user['karma_plus'] . ')</span> | ' . '<span class="red">' . $lng['vote_against'] . ' (' . $user['karma_minus'] . ')</span>';
echo '</div></td></tr></table></div>';
示例7: defined
* @package JohnCMS
* @link http://johncms.com
* @copyright Copyright (C) 2008-2011 JohnCMS Community
* @license LICENSE.txt (see attached file)
* @version VERSION.txt (see attached file)
* @author http://johncms.com/about
*/
defined('_IN_JOHNCMS') or die('Error: restricted access');
$textl = $lng['users_list'];
$headmod = 'userlist';
require '../incfiles/head.php';
/*
-----------------------------------------------------------------
Выводим список пользователей
-----------------------------------------------------------------
*/
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `users`"), 0);
echo '<div class="phdr"><a href="index.php"><b>' . $lng['community'] . '</b></a> | ' . $lng['users_list'] . '</div>';
if ($total > $kmess) {
echo '<div class="topmenu">' . functions::display_pagination('index.php?act=userlist&', $start, $total, $kmess) . '</div>';
}
$req = mysql_query("SELECT `id`, `name`, `sex`, `lastdate`, `datereg`, `status`, `rights`, `ip`, `browser`, `rights` FROM `users` WHERE `preg` = 1 ORDER BY `datereg` DESC LIMIT {$start}, {$kmess}");
for ($i = 0; ($res = mysql_fetch_assoc($req)) !== false; $i++) {
echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
echo functions::display_user($res) . '</div>';
}
echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
if ($total > $kmess) {
echo '<div class="topmenu">' . functions::display_pagination('index.php?act=userlist&', $start, $total, $kmess) . '</div>' . '<p><form action="index.php?act=userlist" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' >>"/>' . '</form></p>';
}
echo '<p><a href="search.php">' . $lng['search_user'] . '</a><br />' . '<a href="index.php">' . $lng['back'] . '</a></p>';
示例8: preg_replace
if (!isset($_GET['yes'])) {
$lng_faq = core::load_lng('faq');
echo '<p>' . $lng_faq['forum_rules_text'] . '</p>';
echo '<p><a href="index.php?act=nt&id=' . $id . '&yes">' . $lng_forum['agree'] . '</a> | <a href="index.php?id=' . $id . '">' . $lng_forum['not_agree'] . '</a></p>';
require '../incfiles/end.php';
exit;
}
}
$msg_pre = functions::checkout($msg, 1, 1);
if ($set_user['smileys']) {
$msg_pre = functions::smileys($msg_pre, $datauser['rights'] ? 1 : 0);
}
$msg_pre = preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '<div class="quote">\\1</div>', $msg_pre);
echo '<div class="phdr"><a href="index.php?id=' . $id . '"><b>' . $lng['forum'] . '</b></a> | ' . $lng_forum['new_topic'] . '</div>';
if ($msg && $th && !isset($_POST['submit'])) {
echo '<div class="list1"><img src="../theme/default/images/op.gif" border="0" alt="op" /> <span style="font-weight: bold">' . $th . '</span></div>' . '<div class="list2">' . functions::display_user($datauser, array('iphide' => 1, 'header' => '<span class="gray">(' . functions::display_date(time()) . ')</span>', 'body' => $msg_pre)) . '</div>';
}
echo '<form name="form" action="index.php?act=nt&id=' . $id . '" method="post">' . '<div class="gmenu">' . '<p><h3>' . $lng['section'] . '</h3>' . '<a href="index.php?id=' . $res_c['id'] . '">' . $res_c['text'] . '</a> | <a href="index.php?id=' . $res_r['id'] . '">' . $res_r['text'] . '</a></p>' . '<p><h3>' . $lng_forum['new_topic_name'] . '</h3>';
echo '<select name="tiento">
<option value="0">No Prefix</option>
<option value="1">Discuss</option>
<option value="2">Share</option>
<option value="3">Info</option>
<option value="4">Tutorial</option>
<option value="5">Help</option>
<option value="6">Ask</option>
<option value="7">Request</option>
<option value="8">Movie</option>
<option value="9">Ongoing</option>
<option value="10">Completed</option>
</select>
示例9: defined
// Project site: http://johncms.com //
// Support site: http://gazenwagen.com //
////////////////////////////////////////////////////////////////////////////////
// Lead Developer: Oleg Kasyanov (AlkatraZ) alkatraz@gazenwagen.com //
// Development Team: Eugene Ryabinin (john77) john77@gazenwagen.com //
// Dmitry Liseenko (FlySelf) flyself@johncms.com //
////////////////////////////////////////////////////////////////////////////////
*/
defined('_IN_JOHNCMS') or die('Error: restricted access');
$textl = $lng['profile'] . ' | ' . $lng['guestbook'];
$headmod = 'my_guest';
if ($user_id && $user['id'] == $user_id) {
$datauser['comm_old'] = $datauser['comm_count'];
}
require '../incfiles/head.php';
$context_top = '<div class="phdr"><a href="profile.php?user=' . $user['id'] . '"><b>' . $lng['profile'] . '</b></a> | ' . $lng['guestbook'] . '</div>' . '<div class="user"><p>' . functions::display_user($user, array('iphide' => 1)) . '</p></div>';
/*
-----------------------------------------------------------------
Параметры Гостевой
-----------------------------------------------------------------
*/
$arg = array('comments_table' => 'cms_users_guestbook', 'object_table' => 'users', 'script' => 'profile.php?act=guestbook', 'sub_id_name' => 'user', 'sub_id' => $user['id'], 'owner' => $user['id'], 'owner_delete' => true, 'owner_reply' => true, 'title' => $lng['comments'], 'context_top' => $context_top);
/*
-----------------------------------------------------------------
Показываем комментарии
-----------------------------------------------------------------
*/
$comm = new comments($arg);
/*
-----------------------------------------------------------------
Обновляем счетчик непрочитанного
示例10: mysql_query
$req = mysql_query("SELECT * FROM `users` WHERE `rights` = '7' ORDER BY `name` ASC");
if (mysql_num_rows($req)) {
echo '<div class="bmenu">' . $lng['administrators'] . '</div>';
while (($res = mysql_fetch_assoc($req)) !== false) {
echo $adm % 2 ? '<div class="list2">' : '<div class="list1">';
echo functions::display_user($res, array('header' => '<b>ID:' . $res['id'] . '</b>'));
echo '</div>';
++$adm;
}
}
$req = mysql_query("SELECT * FROM `users` WHERE `rights` = '6' ORDER BY `name` ASC");
if (mysql_num_rows($req)) {
echo '<div class="bmenu">' . $lng['supermoders'] . '</div>';
while (($res = mysql_fetch_assoc($req)) !== false) {
echo $smd % 2 ? '<div class="list2">' : '<div class="list1">';
echo functions::display_user($res, array('header' => '<b>ID:' . $res['id'] . '</b>'));
echo '</div>';
++$smd;
}
}
$req = mysql_query("SELECT * FROM `users` WHERE `rights` BETWEEN '1' AND '5' ORDER BY `name` ASC");
if (mysql_num_rows($req)) {
echo '<div class="bmenu">' . $lng['moders'] . '</div>';
while (($res = mysql_fetch_assoc($req)) !== false) {
echo $mod % 2 ? '<div class="list2">' : '<div class="list1">';
echo functions::display_user($res, array('header' => '<b>ID:' . $res['id'] . '</b>'));
echo '</div>';
++$mod;
}
}
echo '<div class="phdr">' . $lng['total'] . ': ' . ($sw + $adm + $smd + $mod) . '</div>' . '<p><a href="index.php?act=usr">' . $lng['users_list'] . '</a><br />' . '<a href="index.php">' . $lng['admin_panel'] . '</a></p>';
示例11: while
if (mysql_num_rows($req)) {
$i = 0;
while ($res = mysql_fetch_assoc($req)) {
$res['ip'] = ip2long($res['ip']);
$posttime = ' <span class="gray">(' . functions::display_date($res['time']) . ')</span>';
$page = ceil(mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `refid` = '" . $res['refid'] . "' AND `id` " . ($set_forum['upfp'] ? ">=" : "<=") . " '" . $res['fid'] . "'"), 0) / $kmess);
$text = mb_substr($res['text'], 0, 500);
$text = functions::checkout($text, 1, 0);
$text = preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '<div class="quote">\\1</div>', $text);
$theme = mysql_fetch_assoc(mysql_query("SELECT `id`, `text` FROM `forum` WHERE `id` = '" . $res['refid'] . "'"));
$text = '<b>' . $theme['text'] . '</b> <a href="../forum/index.php?id=' . $theme['id'] . '&page=' . $page . '">>></a><br />' . $text;
$subtext = '<span class="gray">' . $lng_forum['filter_to'] . ':</span> ';
$subtext .= '<a href="index.php?act=forum&mod=hposts&tsort=' . $theme['id'] . '">' . $lng_forum['by_theme'] . '</a> | ';
$subtext .= '<a href="index.php?act=forum&mod=hposts&usort=' . $res['user_id'] . '">' . $lng_forum['by_author'] . '</a>';
echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
echo functions::display_user($res, array('header' => $posttime, 'body' => $text, 'sub' => $subtext));
echo '</div>';
++$i;
}
if ($rights == 9) {
echo '<form action="index.php?act=forum&mod=hposts' . $link . '" method="POST"><div class="rmenu"><input type="submit" name="delpost" value="' . $lng['delete_all'] . '" /></div></form>';
}
} else {
echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
}
echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
if ($total > $kmess) {
echo '<div class="topmenu">' . functions::display_pagination('index.php?act=forum&mod=hposts&', $start, $total, $kmess) . '</div>' . '<p><form action="index.php?act=forum&mod=hposts" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' >>"/>' . '</form></p>';
}
}
break;
示例12: defined
////////////////////////////////////////////////////////////////////////////////
// JohnCMS Mobile Content Management System //
// Project site: http://johncms.com //
// Support site: http://gazenwagen.com //
////////////////////////////////////////////////////////////////////////////////
// Lead Developer: Oleg Kasyanov (AlkatraZ) alkatraz@gazenwagen.com //
// Development Team: Eugene Ryabinin (john77) john77@gazenwagen.com //
// Dmitry Liseenko (FlySelf) flyself@johncms.com //
////////////////////////////////////////////////////////////////////////////////
*/
defined('_IN_JOHNCMS') or die('Error: restricted access');
/*
-----------------------------------------------------------------
Подробная информация, контактные данные
-----------------------------------------------------------------
*/
$textl = htmlspecialchars($user['name']) . ': ' . $lng['information'];
require '../incfiles/head.php';
echo '<div class="phdr"><a href="profile.php?user=' . $user['id'] . '"><b>' . $lng['profile'] . '</b></a> | ' . $lng['information'] . '</div>';
if ($user['id'] == $user_id || $rights >= 7 && $rights > $user['rights']) {
echo '<div class="topmenu"><a href="profile.php?act=edit&user=' . $user['id'] . '">' . $lng['edit'] . '</a></div>';
}
echo '<div class="user"><p>' . functions::display_user($user, array('iphide' => 1)) . '</p></div>' . '<div class="list2"><p>' . '<h3><img src="../images/contacts.png" width="16" height="16" class="left" /> ' . $lng_profile['personal_data'] . '</h3>' . '<ul>';
if (file_exists('../files/users/photo/' . $user['id'] . '_small.jpg')) {
echo '<a href="../files/users/photo/' . $user['id'] . '.jpg"><img src="../files/users/photo/' . $user['id'] . '_small.jpg" alt="' . $user['name'] . '" border="0" /></a>';
}
echo '<li><span class="gray">' . $lng_profile['name'] . ':</span> ' . (empty($user['imname']) ? '' : $user['imname']) . '</li>' . '<li><span class="gray">' . $lng_profile['birt'] . ':</span> ' . (empty($user['dayb']) ? '' : sprintf("%02d", $user['dayb']) . '.' . sprintf("%02d", $user['monthb']) . '.' . $user['yearofbirth']) . '</li>' . '<li><span class="gray">' . $lng_profile['city'] . ':</span> ' . (empty($user['live']) ? '' : $user['live']) . '</li>' . '<li><span class="gray">' . $lng_profile['about'] . ':</span> ' . (empty($user['about']) ? '' : '<br />' . functions::smileys(bbcode::tags($user['about']))) . '</li>' . '</ul></p><p>' . '<h3><img src="../images/mail.png" width="16" height="16" class="left" /> ' . $lng_profile['communication'] . '</h3><ul>' . '<li><span class="gray">' . $lng_profile['phone_number'] . ':</span> ' . (empty($user['mibile']) ? '' : $user['mibile']) . '</li>' . '<li><span class="gray">E-mail:</span> ';
if (!empty($user['mail']) && $user['mailvis'] || $rights >= 7 || $user['id'] == $user_id) {
echo $user['mail'] . ($user['mailvis'] ? '' : '<span class="gray"> [' . $lng_profile['hidden'] . ']</span>');
}
echo '</li>' . '<li><span class="gray">ICQ:</span> ' . (empty($user['icq']) ? '' : $user['icq']) . '</li>' . '<li><span class="gray">Skype:</span> ' . (empty($user['skype']) ? '' : $user['skype']) . '</li>' . '<li><span class="gray">Jabber:</span> ' . (empty($user['jabber']) ? '' : $user['jabber']) . '</li>' . '<li><span class="gray">' . $lng_profile['site'] . ':</span> ' . (empty($user['www']) ? '' : bbcode::tags($user['www'])) . '</li>' . '</ul></p></div>' . '<div class="phdr"><a href="profile.php?user=' . $user['id'] . '">' . $lng['back'] . '</a></div>';
示例13: __construct
//.........这里部分代码省略.........
mysql_query("DELETE FROM `" . $this->comments_table . "` WHERE `id` = '" . $this->item . "'");
}
// Вычитаем баллы из статистики пользователя
$req_u = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $res['user_id'] . "'");
if (mysql_num_rows($req_u)) {
$res_u = mysql_fetch_assoc($req_u);
$count = $res_u['komm'] > $count ? $res_u['komm'] - $count : 0;
mysql_query("UPDATE `users` SET `komm` = '{$count}' WHERE `id` = '" . $res['user_id'] . "'");
}
// Обновляем счетчик комментариев
$this->msg_total(1);
}
header('Location: ' . str_replace('&', '&', $this->url));
} else {
echo '<div class="phdr"><a href="' . $this->url . '"><b>' . $arg['title'] . '</b></a> | ' . core::$lng['delete'] . '</div>' . '<div class="rmenu"><p>' . core::$lng['delete_confirmation'] . '<br />' . '<a href="' . $this->url . '&mod=del&item=' . $this->item . '&yes">' . core::$lng['delete'] . '</a> | ' . '<a href="' . $this->url . '">' . core::$lng['cancel'] . '</a><br />' . '<div class="sub">' . core::$lng['clear_user_msg'] . '<br />' . '<span class="red"><a href="' . $this->url . '&mod=del&item=' . $this->item . '&yes&all">' . core::$lng['clear'] . '</a></span>' . '</div></p></div>' . '<div class="phdr"><a href="' . $this->url . '">' . core::$lng['back'] . '</a></div>';
}
}
break;
default:
if (!empty($arg['context_top'])) {
echo $arg['context_top'];
}
/*
-----------------------------------------------------------------
Добавляем новый комментарий
-----------------------------------------------------------------
*/
if (!$this->ban && !functions::is_ignor($this->owner) && isset($_POST['submit']) && ($message = $this->msg_check(1)) !== false) {
if (empty($message['error'])) {
// Записываем комментарий в базу
$this->add_comment($message['text']);
$this->total = $this->msg_total(1);
$_SESSION['code'] = $message['code'];
} else {
// Показываем ошибки, если есть
echo functions::display_error($message['error']);
$this->total = $this->msg_total();
}
} else {
$this->total = $this->msg_total();
}
/*
-----------------------------------------------------------------
Показываем форму ввода
-----------------------------------------------------------------
*/
if (!$this->ban && !functions::is_ignor($this->owner)) {
echo $this->msg_form();
}
/*
-----------------------------------------------------------------
Показываем список комментариев
-----------------------------------------------------------------
*/
echo '<div class="phdr"><b>' . $arg['title'] . '</b></div>';
if ($this->total > $kmess) {
echo '<div class="topmenu">' . functions::display_pagination($this->url . '&', $start, $this->total, $kmess) . '</div>';
}
if ($this->total) {
$req = mysql_query("SELECT `" . $this->comments_table . "`.*, `" . $this->comments_table . "`.`id` AS `subid`, `users`.`rights`, `users`.`lastdate`, `users`.`sex`, `users`.`status`, `users`.`datereg`, `users`.`id`\n FROM `" . $this->comments_table . "` LEFT JOIN `users` ON `" . $this->comments_table . "`.`user_id` = `users`.`id`\n WHERE `sub_id` = '" . $this->sub_id . "' ORDER BY `subid` DESC LIMIT {$start}, {$kmess}");
$i = 0;
while (($res = mysql_fetch_assoc($req)) !== false) {
$attributes = unserialize($res['attributes']);
$res['name'] = $attributes['author_name'];
$res['ip'] = $attributes['author_ip'];
$res['ip_via_proxy'] = isset($attributes['author_ip_via_proxy']) ? $attributes['author_ip_via_proxy'] : 0;
$res['browser'] = $attributes['author_browser'];
echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
$menu = array($this->access_reply ? '<a href="' . $this->url . '&mod=reply&item=' . $res['subid'] . '">' . core::$lng['reply'] . '</a>' : '', $this->access_edit ? '<a href="' . $this->url . '&mod=edit&item=' . $res['subid'] . '">' . core::$lng['edit'] . '</a>' : '', $this->access_delete ? '<a href="' . $this->url . '&mod=del&item=' . $res['subid'] . '">' . core::$lng['delete'] . '</a>' : '');
$text = functions::checkout($res['text'], 1, 1);
if (core::$user_set['smileys']) {
$text = functions::smileys($text, $res['rights'] >= 1 ? 1 : 0);
}
if (isset($attributes['edit_count'])) {
$text .= '<br /><span class="gray"><small>' . core::$lng['edited'] . ': <b>' . $attributes['edit_name'] . '</b>' . ' (' . functions::display_date($attributes['edit_time']) . ') <b>' . '[' . $attributes['edit_count'] . ']</b></small></span>';
}
if (!empty($res['reply'])) {
$reply = functions::checkout($res['reply'], 1, 1);
if (core::$user_set['smileys']) {
$reply = functions::smileys($reply, $attributes['reply_rights'] >= 1 ? 1 : 0);
}
$text .= '<div class="' . ($attributes['reply_rights'] ? '' : 'g') . 'reply"><small>' . '<a href="' . core::$system_set['homeurl'] . '/users/profile.php?user=' . $attributes['reply_id'] . '"><b>' . $attributes['reply_name'] . '</b></a>' . ' (' . functions::display_date($attributes['reply_time']) . ')</small><br/>' . $reply . '</div>';
}
$user_arg = array('header' => ' <span class="gray">(' . functions::display_date($res['time']) . ')</span>', 'body' => $text, 'sub' => functions::display_menu($menu), 'iphide' => core::$user_rights ? false : true);
echo functions::display_user($res, $user_arg);
echo '</div>';
++$i;
}
} else {
echo '<div class="menu"><p>' . core::$lng['list_empty'] . '</p></div>';
}
echo '<div class="phdr">' . core::$lng['total'] . ': ' . $this->total . '</div>';
if ($this->total > $kmess) {
echo '<div class="topmenu">' . functions::display_pagination($this->url . '&', $start, $this->total, $kmess) . '</div>' . '<p><form action="' . $this->url . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . core::$lng['to_page'] . ' >>"/>' . '</form></p>';
}
if (!empty($arg['context_bottom'])) {
echo $arg['context_bottom'];
}
}
}
示例14: mysql_result
/*
-----------------------------------------------------------------
Выводим список пользователей, ожидающих подтверждения регистрации
-----------------------------------------------------------------
*/
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `preg` = '0'"), 0);
if ($total > $kmess) {
echo '<div class="topmenu">' . functions::display_pagination('index.php?act=reg&', $start, $total, $kmess) . '</div>';
}
if ($total) {
$req = mysql_query("SELECT * FROM `users` WHERE `preg` = '0' ORDER BY `id` DESC LIMIT {$start},{$kmess}");
$i = 0;
while (($res = mysql_fetch_assoc($req)) !== false) {
$link = array('<a href="index.php?act=reg&mod=approve&id=' . $res['id'] . '">' . $lng['approve'] . '</a>', '<a href="index.php?act=reg&mod=del&id=' . $res['id'] . '">' . $lng['delete'] . '</a>', '<a href="index.php?act=reg&mod=delip&ip=' . $res['ip'] . '">' . $lng['reg_del_ip'] . '</a>');
echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
echo functions::display_user($res, array('header' => '<b>ID:' . $res['id'] . '</b>', 'sub' => functions::display_menu($link)));
echo '</div>';
++$i;
}
} else {
echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
}
echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
if ($total > $kmess) {
echo '<div class="topmenu">' . functions::display_pagination('index.php?act=reg&', $start, $total, $kmess) . '</div>' . '<p><form action="index.php?act=reg" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' >>"/>' . '</form></p>';
}
echo '<p>';
if ($total) {
echo '<a href="index.php?act=reg&mod=massapprove">' . $lng['reg_approve_all'] . '</a><br /><a href="index.php?act=reg&mod=massdel">' . $lng['reg_del_all'] . '</a><br />';
}
echo '<a href="index.php">' . $lng['admin_panel'] . '</a></p>';
示例15: defined
* @package JohnCMS
* @link http://johncms.com
* @copyright Copyright (C) 2008-2011 JohnCMS Community
* @license LICENSE.txt (see attached file)
* @version VERSION.txt (see attached file)
* @author http://johncms.com/about
*/
defined('_IN_JOHNCMS') or die('Error: restricted access');
/*
-----------------------------------------------------------------
Статистика
-----------------------------------------------------------------
*/
$textl = htmlspecialchars($user['name']) . ': ' . $lng['statistics'];
require '../incfiles/head.php';
echo '<div class="phdr"><a href="profile.php?user=' . $user['id'] . '"><b>' . $lng['profile'] . '</b></a> | ' . $lng['statistics'] . '</div>' . '<div class="user"><p>' . functions::display_user($user, array('iphide' => 1)) . '</p></div>' . '<div class="list2">' . '<p><h3><img src="../images/rate.gif" width="16" height="16" class="left" /> ' . $lng['statistics'] . '</h3><ul>';
if ($rights >= 7) {
if (!$user['preg'] && empty($user['regadm'])) {
echo '<li>' . $lng_profile['awaiting_registration'] . '</li>';
} elseif ($user['preg'] && !empty($user['regadm'])) {
echo '<li>' . $lng_profile['registration_approved'] . ': ' . $user['regadm'] . '</li>';
} else {
echo '<li>' . $lng_profile['registration_free'] . '</li>';
}
}
echo '<li><span class="gray">' . ($user['sex'] == 'm' ? $lng_profile['registered_m'] : $lng_profile['registered_w']) . ':</span> ' . date("d.m.Y", $user['datereg']) . '</li>' . '<li><span class="gray">' . ($user['sex'] == 'm' ? $lng_profile['stayed_m'] : $lng_profile['stayed_w']) . ':</span> ' . functions::timecount($user['total_on_site']) . '</li>';
$lastvisit = time() > $user['lastdate'] + 300 ? date("d.m.Y (H:i)", $user['lastdate']) : false;
if ($lastvisit) {
echo '<li><span class="gray">' . $lng['last_visit'] . ':</span> ' . $lastvisit . '</li>';
}
echo '</ul></p><p>' . '<h3><img src="../images/activity.gif" width="16" height="16" class="left" /> ' . $lng_profile['activity'] . '</h3><ul>' . '<li><span class="gray">' . $lng['forum'] . ':</span> <a href="profile.php?act=activity&user=' . $user['id'] . '">' . $user['postforum'] . '</a></li>' . '<li><span class="gray">' . $lng['guestbook'] . ':</span> <a href="profile.php?act=activity&mod=comments&user=' . $user['id'] . '">' . $user['postguest'] . '</a></li>' . '<li><span class="gray">' . $lng['comments'] . ':</span> ' . $user['komm'] . '</li>' . '</ul></p>' . '<p><h3><img src="../images/award.png" width="16" height="16" class="left" /> ' . $lng_profile['achievements'] . '</h3>';