Beispiel #1
0
    if ($arr_post_read[0] < $arr_count['last_post'] && $posted) {
        ++$count;
    }
}
//=== nothing here? kill the page
if ($count == 0) {
    $HTMLOUT .= '<br /><br /><table border="0" cellspacing="10" cellpadding="10" width="400px">
		<tr><td class="three"align="center">
		<h1>No unread posts!</h1>You are up to date on all topics you\'ve posted in.<br /><br />
		</td></tr></table><br /><br />';
    $HTMLOUT .= $links . '<br />';
} else {
    //=== get stuff for the pager
    $page = isset($_GET['page']) ? (int) $_GET['page'] : 0;
    $perpage = isset($_GET['perpage']) ? (int) $_GET['perpage'] : 20;
    list($menu, $LIMIT) = pager_new($count, $perpage, $page, 'forums.php?action=view_unread_posts' . (isset($_GET['perpage']) ? '&amp;perpage=' . $perpage : ''));
    //=== top and bottom stuff
    $the_top_and_bottom = '<br /><table border="0" cellspacing="0" cellpadding="0" width="90%">
		<tr><td class="three" align="center" valign="middle">' . ($count > $perpage ? $menu : '') . '</td>
		</tr></table>';
    //=== main huge query:
    $res_unread = sql_query('SELECT t.id AS topic_id, t.topic_name AS topic_name, t.last_post, t.post_count, 
t.views, t.topic_desc, t.locked, t.sticky, t.poll_id, t.forum_id, t.rating_sum, t.num_ratings,
f.name AS forum_name, f.description AS forum_desc,
p.post_title, p.body, p.icon,
u.id, u.username, u.class, u.donor, u.suspended, u.warned, u.enabled, u.chatpost, u.leechwarn, u.pirate, u.king
FROM topics AS t
LEFT JOIN posts AS p ON t.last_post = p.id
LEFT JOIN forums as f ON f.id = t.forum_id
LEFT JOIN users AS u on u.id = t.user_id
WHERE ' . ($CURUSER['class'] < UC_STAFF ? 'p.status = \'ok\' AND t.status = \'ok\' AND' : ($CURUSER['class'] < $min_delete_view_class ? 'p.status != \'deleted\' AND t.status != \'deleted\'  AND' : '')) . ' f.min_class_read <= ' . $CURUSER['class'] . ' 
Beispiel #2
0
    $parent_forum_res = sql_query('SELECT name AS parent_forum_name FROM forums WHERE id=' . $parent_forum_id . ' LIMIT 1');
    $parent_forum_arr = mysql_fetch_assoc($parent_forum_res);
    if ($arr['parent_forum'] > 0) {
        $child = '<span style="font-size: x-small;"> [ child-board ]</span>';
        $parent_forum_name = '<img src="pic/arrow_next.gif" alt="&#9658;" title="&#9658;" /> 
			<a class="altlink" href="forums.php?action=view_forum&amp;forum_id=' . $parent_forum_id . '">' . htmlentities($parent_forum_arr['parent_forum_name'], ENT_QUOTES) . '</a>';
    }
}
//=== Get topic count
$res = sql_query('SELECT COUNT(id) FROM topics 	WHERE  ' . ($CURUSER['class'] < UC_STAFF ? ' status = \'ok\' AND' : ($CURUSER['class'] < $min_delete_view_class ? ' status != \'deleted\'  AND' : '')) . '  forum_id=' . $forum_id);
$row = mysql_fetch_row($res);
$count = $row[0];
//=== get stuff for the pager
$page = isset($_GET['page']) ? (int) $_GET['page'] : 0;
$perpage = $CURUSER['topicsperpage'] !== 0 ? $CURUSER['topicsperpage'] : (isset($_GET['perpage']) ? (int) $_GET['perpage'] : 20);
list($menu, $LIMIT) = pager_new($count, $perpage, $page, 'forums.php?action=view_forum&amp;forum_id=' . $forum_id . (isset($_GET['perpage']) ? '&amp;perpage=' . $perpage : ''));
//=== Get topics data
$topic_res = sql_query('SELECT * FROM topics WHERE  ' . ($CURUSER['class'] < UC_STAFF ? ' status = \'ok\' AND' : ($CURUSER['class'] < $min_delete_view_class ? ' status != \'deleted\'  AND' : '')) . '  forum_id=' . $forum_id . ' ORDER BY sticky, last_post DESC ' . $LIMIT);
$location_bar = '<h1><a class="altlink" href="index.php">' . $INSTALLER09['site_name'] . '</a>  <img src="pic/arrow_next.gif" alt="&#9658;" title="&#9658;" /> 
			<a class="altlink" href="forums.php">Forums</a> ' . $parent_forum_name . ' <img src="pic/arrow_next.gif" alt="&#9658;" title="&#9658;" />
			<a class="altlink" href="forums.php?action=view_forum&amp;forum_id=' . $forum_id . '">' . $forum_name . $child . '</a></h1>
			' . $mini_menu . '
			<br /><br />';
if ($count > 0) {
    while ($topic_arr = mysql_fetch_assoc($topic_res)) {
        $topic_id = $topic_arr['id'];
        $locked = $topic_arr['locked'] == 'yes';
        $sticky = $topic_arr['sticky'] == 'yes';
        $topic_poll = $topic_arr['poll_id'] > 0;
        //=== topic status
        $topic_status = $topic_arr['status'];
        $HTMLOUT .= '</table>';
    } else {
        $HTMLOUT .= $lang['vph_sorry_no_mem_found'];
    }
    $HTMLOUT .= $arr_count[0] > $perpage ? '<br />' . $menu . '' : '<br /><br />';
    echo stdhead() . $HTMLOUT . stdfoot();
    die;
}
$res_count = sql_query('SELECT COUNT(p.id) AS count FROM posts AS p LEFT JOIN topics AS t ON p.topic_id = t.id LEFT JOIN forums AS f ON f.id = t.forum_id WHERE ' . ($CURUSER['class'] < UC_STAFF ? 'p.status = \'ok\' AND t.status = \'ok\' AND' : ($CURUSER['class'] < $min_delete_view_class ? 'p.status != \'deleted\' AND t.status != \'deleted\'  AND' : '')) . ' p.user_id = ' . sqlesc($member_id) . ' AND f.min_class_read <= ' . $CURUSER['class']);
$arr_count = mysqli_fetch_row($res_count);
$count = $arr_count[0];
//=== get stuff for the pager
$page = isset($_GET['page']) ? (int) $_GET['page'] : 0;
$perpage = isset($_GET['perpage']) ? (int) $_GET['perpage'] : 20;
$subscription_on_off = isset($_GET['s']) ? $_GET['s'] == 1 ? '<br /><div style="font-weight: bold;">' . $lang['fe_sub_to_topic'] . ' <img src="pic/forums/subscribe.gif" alt=" " width="25"></div>' : '<br /><div style="font-weight: bold;">' . $lang['fe_unsub_to_topic'] . ' <img src="pic/forums/unsubscribe.gif" alt=" " width="25"></div>' : '';
list($menu, $LIMIT) = pager_new($count, $perpage, $page, 'forums.php?action=member_post_history&amp;id=' . $member_id . (isset($_GET['perpage']) ? '&amp;perpage=' . $perpage : ''));
$res = sql_query('SELECT p.id AS post_id, p.topic_id, p.user_id, p.added, p.body, p.edited_by, p.edit_date, p.icon, p.post_title, p.bbcode, p.post_history, p.edit_reason, p.ip, p.status AS post_status, p.anonymous, t.id AS topic_id, t.topic_name, t.forum_id, t.sticky, t.locked, t.poll_id, t.status AS topic_status, f.name AS forum_name, f.description FROM posts AS p LEFT JOIN topics AS t ON p.topic_id = t.id LEFT JOIN forums AS f ON f.id = t.forum_id WHERE  ' . ($CURUSER['class'] < UC_STAFF ? 'p.status = \'ok\' AND t.status = \'ok\' AND' : ($CURUSER['class'] < $min_delete_view_class ? 'p.status != \'deleted\' AND t.status != \'deleted\'  AND' : '')) . ' p.user_id = ' . sqlesc($member_id) . ' AND f.min_class_read <= ' . $CURUSER['class'] . ' ORDER BY p.id ' . $ASC_DESC . $LIMIT);
//== get user info
$user_res = sql_query('SELECT id, username, class, donor, suspended, warned, enabled, chatpost, leechwarn, pirate, king, title, avatar, offensive_avatar FROM users WHERE id = ' . sqlesc($member_id));
$user_arr = mysqli_fetch_assoc($user_res);
if ($count == 0) {
    stderr($lang['gl_sorry'], $user_arr['username'] != '' ? print_user_stuff($user_arr) . ' ' . $lang['vmp_has_no_posts_look'] . '!' : $lang['fe_no_mem_with_id']);
}
$links = '<span style="text-align: center;"><a class="altlink" href="forums.php">' . $lang['fe_forums_main'] . '</a> |  ' . $mini_menu . '<br /><br /></span>';
$the_top_and_bottom = '<tr><td class="three" colspan="3" align="center">' . ($count > $perpage ? $menu : '') . '</td></tr>';
$HTMLOUT .= '<h1>' . $count . ' ' . $lang['fe_posts_by'] . ' ' . print_user_stuff($user_arr) . '</h1>' . $links . '
	<div><a class="altlink" href="forums.php?action=member_post_history&amp;id=' . $member_id . '" title="' . $lang['vmp_view_posts_new_to_old'] . '">' . $lang['vmp_sort_by_newest_posts_1st'] . '</a> || 
	<a class="altlink" href="forums.php?action=member_post_history&amp;id=' . $member_id . '&amp;ASC_DESC=ASC" title="' . $lang['vmp_view_posts_old_to_new'] . '">' . $lang['vmp_sort_by_oldest_posts_1st'] . '</a></div><br />';
$HTMLOUT .= '<a name="top"></a><table border="0" cellspacing="5" cellpadding="10" width="90%">' . $the_top_and_bottom;
//=== lets start the loop \o/
while ($arr = mysqli_fetch_assoc($res)) {
Beispiel #4
0
    $other_box_info = '<p align="center"><span style="color: red;">***</span><span style="font-weight: bold;">please note:</span>
                                            you have a max of <span style="font-weight: bold;">' . $maxbox . '</span> PMs for all mail boxes that are not either 
                                            <span style="font-weight: bold;">inbox</span> or <span style="font-weight: bold;">sentbox</span>.</p>';
}
//==== get count from PM boxs & get image & % box full
//=== get stuff for the pager
$res_count = sql_query('SELECT COUNT(id) FROM messages WHERE ' . ($mailbox === PM_INBOX ? 'receiver = ' . sqlesc($CURUSER['id']) . ' AND location = 1' : ($mailbox === PM_SENTBOX ? 'sender = ' . sqlesc($CURUSER['id']) . ' AND (saved = \'yes\' || unread= \'yes\') AND draft = \'no\' ' : 'receiver = ' . sqlesc($CURUSER['id'])) . ' AND location = ' . sqlesc($mailbox))) or sqlerr(__FILE__, __LINE__);
$arr_count = mysqli_fetch_row($res_count);
$messages = $arr_count[0];
//==== get count from PM boxs & get image & % box full
$filled = $messages > 0 ? $messages / $maxbox * 100 : 0;
//$filled = (($messages / $maxbox) * 100);
$mailbox_pic = get_percent_completed_image(round($filled), $maxpic);
$num_messages = number_format($filled, 0);
$link = 'pm_system.php?action=view_mailbox&amp;box=' . $mailbox . ($perpage < $messages ? '&amp;page=' . $page : '') . '&amp;order_by=' . $order_by . $desc_asc;
list($menu, $LIMIT) = pager_new($messages, $perpage, $page, $link);
//=== get message info we need to display then all nice and tidy like \o/
$res = sql_query('SELECT m.id AS message_id, m.sender, m.receiver, m.added, m.subject, m.unread, m.urgent,
                            u.id, u.username, u.uploaded, u.downloaded, u.warned, u.suspended, u.enabled, u.donor, u.class, u.avatar, u.offensive_avatar, u.leechwarn, u.chatpost, u.pirate, u.king, f.id AS friend, b.id AS blocked
                            FROM messages AS m 
                            LEFT JOIN users AS u ON u.id=m.' . ($mailbox === PM_SENTBOX ? 'receiver' : 'sender') . ' 
                            LEFT JOIN friends AS f ON f.userid = ' . $CURUSER['id'] . ' AND f.friendid = m.sender
                            LEFT JOIN blocks AS b ON b.userid = ' . $CURUSER['id'] . ' AND b.blockid = m.sender
                            WHERE ' . ($mailbox === PM_INBOX ? 'receiver = ' . $CURUSER['id'] . ' AND location = 1' : ($mailbox === PM_SENTBOX ? 'sender = ' . $CURUSER['id'] . ' AND (saved = \'yes\' || unread= \'yes\') AND draft = \'no\' ' : 'receiver = ' . $CURUSER['id'] . ' AND location = ' . sqlesc($mailbox))) . ' 
                            ORDER BY ' . $order_by . (isset($_GET['ASC']) ? ' ASC ' : ' DESC ') . $LIMIT) or sqlerr(__FILE__, __LINE__);
//=== Start Page
//echo stdhead(htmlsafechars($mailbox_name));
//=== let's make the table
$HTMLOUT .= $h1_thingie . $top_links . '
    <a name="pm"></a>
    <form action="pm_system.php" method="post" name="checkme" onsubmit="return ValidateForm(this,\'pm\')">
$count = $row[0];
//=== nothing here? kill the page
if ($count == 0) {
    $HTMLOUT .= '<br /><br /><table border="0" cellspacing="10" cellpadding="10" width="400px">
		<tr><td class="three"align="center">
		<h1>' . $lang['sub_no_subscript_found'] . '!</h1>' . $lang['sub_you_have_yet_sub_forums'] . ' 
		<span style="font-weight: bold;font-style: italic;">' . $lang['sub_subscrib_to_forum'] . '</span> ' . $lang['sub_no_subscript_found_msg1'] . '.<br /><br />
		' . $lang['sub_to_be_notified_via_pm'] . ' <a class="altlink" href="my.php">' . $lang['sub_profile'] . '</a> 
		' . $lang['sub_page_and_set'] . ' <span style="font-weight: bold;">' . $lang['sub_pm_on_subcript'] . '</span> ' . $lang['sub_to_yes'] . '.<br /><br />
		</td></tr></table><br /><br />';
    $HTMLOUT .= $links . '<br />';
}
//=== get stuff for the pager
$page = isset($_GET['page']) ? (int) $_GET['page'] : 0;
$perpage = isset($_GET['perpage']) ? (int) $_GET['perpage'] : 20;
list($menu, $LIMIT) = pager_new($count, $perpage, $page, $INSTALLER09['baseurl'] . '/forums.php?action=subscriptions' . (isset($_GET['perpage']) ? '&amp;perpage=' . $perpage : ''));
//=== top and bottom stuff
$the_top_and_bottom = '<table border="0" cellspacing="0" cellpadding="0" width="90%">
	<tr><td class="three" align="center" valign="middle">' . ($count > $perpage ? $menu : '') . '</td>
	</tr></table>';
//=== get the info
$res = sql_query('SELECT s.id AS subscribed_id, t.id AS topic_id, t.topic_name, t.topic_desc, t.last_post, t.views, t.post_count, t.locked, t.sticky, t.poll_id, t.user_id, t.anonymous AS tan, p.id AS post_id, p.added, p.user_id, p.anonymous AS pan, u.username, u.id, u.class, u.donor, u.suspended, u.warned, u.enabled, u.chatpost, u.leechwarn, u.pirate, u.king, u.perms, u.offensive_avatar FROM subscriptions AS s LEFT JOIN topics as t ON s.topic_id = t.id LEFT JOIN posts as p ON t.last_post = p.id LEFT JOIN forums AS f ON f.id = t.forum_id LEFT JOIN users AS u ON u.id = p.user_id WHERE ' . ($CURUSER['class'] < UC_STAFF ? 'p.status = \'ok\' AND t.status = \'ok\' AND' : ($CURUSER['class'] < $min_delete_view_class ? 'p.status != \'deleted\' AND t.status != \'deleted\'  AND' : '')) . ' s.user_id = ' . $CURUSER['id'] . ' AND f.min_class_read < ' . sqlesc($CURUSER['class']) . ' AND s.user_id = ' . sqlesc($CURUSER['id']) . '  ORDER BY t.id DESC ' . $LIMIT);
while ($topic_arr = mysqli_fetch_assoc($res)) {
    $topic_id = (int) $topic_arr['topic_id'];
    $locked = $topic_arr['locked'] == 'yes';
    $sticky = $topic_arr['sticky'] == 'yes';
    $topic_poll = $topic_arr['poll_id'] > 0;
    $last_post_username = $topic_arr['pan'] == 'no' && $topic_arr['username'] !== '' ? print_user_stuff($topic_arr) : '[<i>' . $lang['fe_anonymous'] . '</i>]';
    $last_post_id = (int) $topic_arr['last_post'];
    //=== Get author / first post info
    $first_post_res = sql_query('SELECT p.added, p.icon, p.body, p.user_id, p.anonymous, u.id, u.username, u.class, u.donor, u.suspended, u.warned, u.enabled, u.chatpost, u.leechwarn, u.pirate, u.king FROM posts AS p LEFT JOIN users AS u ON p.user_id = u.id WHERE ' . ($CURUSER['class'] < UC_STAFF ? 'p.status = \'ok\' AND' : ($CURUSER['class'] < $min_delete_view_class ? 'p.status != \'deleted\' AND' : '')) . ' topic_id=' . sqlesc($topic_id) . ' ORDER BY id DESC LIMIT 1');
Beispiel #6
0
        $HTMLOUT .= $count == 10 ? '<br /><br />' : '';
        if (!strcmp($L, $letter)) {
            $HTMLOUT .= ' <span class="btn" style="background:orange;">' . strtoupper($L) . '</span>';
        } else {
            $HTMLOUT .= ' <a href="staffpanel.php?tool=invite_tree&amp;action=invite_tree&amp;letter=' . $L . '"><span class="btn">' . strtoupper($L) . '</span></a>';
        }
        $count++;
    }
    $HTMLOUT .= '</div><br />';
    //=== get stuff for the pager
    $page = isset($_GET['page']) ? (int) $_GET['page'] : 0;
    $perpage = isset($_GET['perpage']) ? (int) $_GET['perpage'] : 20;
    $res_count = @sql_query('SELECT COUNT(id) FROM users WHERE ' . $query);
    $arr_count = mysqli_fetch_row($res_count);
    $count = $arr_count[0] > 0 ? $arr_count[0] : 0;
    list($menu, $LIMIT) = pager_new($count, $perpage, $page, 'staffpanel.php?tool=invite_tree&amp;action=invite_tree');
    $HTMLOUT .= $arr_count[0] > $perpage ? '' . $menu . '<br /><br />' : '<br /><br />';
    if ($arr_count[0] > 0) {
        $res = sql_query('SELECT users.*, countries.name, countries.flagpic FROM users FORCE INDEX ( username ) LEFT JOIN countries ON country = countries.id WHERE ' . $query . ' ORDER BY username ' . $LIMIT);
        $HTMLOUT .= '<table border="1" cellspacing="0" cellpadding="5">

			<tr><td class="colhead" align="left">User name</td>
			<td class="colhead">Registered</td>
			<td class="colhead">Last access</td>
			<td class="colhead" align="left">Class</td>
			<td class="colhead">Country</td>
			<td class="colhead">Edit</td></tr>';
        while ($row = mysqli_fetch_assoc($res)) {
            $country = $row['name'] != NULL ? '<td style="padding: 0px" align="center"><img src="' . $INSTALLER09['pic_base_url'] . 'flag/' . (int) $row['flagpic'] . '" alt="' . htmlsafechars($row['name']) . '" /></td>' : '<td align="center">---</td>';
            $HTMLOUT .= '<tr><td align="left">' . format_username($row) . '</td>
		<td>' . get_date($row['added'], '') . '</td><td>' . get_date($row['last_access'], '') . '</td>
        $AND .= ' AND p.added >= ' . (TIME_NOW - $search_when);
    }
    if ($selected_forums_undone) {
        $AND .= $selected_forums_undone;
    }
    //=== just do the minimum to get the count
    $res_count = sql_query('SELECT p.id, MATCH (' . $search_where . ') AGAINST (' . sqlesc($search) . ' IN BOOLEAN MODE) AS relevance 
			FROM posts AS p LEFT JOIN topics AS t ON p.topic_id = t.id LEFT JOIN forums AS f ON t.forum_id = f.id 
			WHERE MATCH (' . $search_where . ') AGAINST (' . sqlesc($search) . 'IN BOOLEAN MODE) 
			AND ' . ($CURUSER['class'] < UC_STAFF ? 'p.status = \'ok\' AND t.status = \'ok\' AND' : ($CURUSER['class'] < $min_delete_view_class ? 'p.status != \'deleted\' AND t.status != \'deleted\'  AND' : '')) . ' 
			f.min_class_read <= ' . $CURUSER['class'] . $AND . ' HAVING relevance > 0.2');
    $count = mysqli_num_rows($res_count);
    //=== get stuff for the pager
    $page = isset($_GET['page']) ? (int) $_GET['page'] : 0;
    $perpage = isset($_GET['perpage']) ? (int) $_GET['perpage'] : 10;
    list($menu, $LIMIT) = pager_new($count, $perpage, $page, 'forums.php?action=search' . (isset($_GET['perpage']) ? '&amp;perpage=' . $perpage : '') . $pager_links);
    $order_by = isset($_GET['sort_by']) && $_GET['sort_by'] === 'date' ? 'p.added ' : 'relevance ';
    $ASC_DESC = isset($_GET['asc_desc']) && $_GET['asc_desc'] === 'ASC' ? ' ASC ' : ' DESC ';
    //=== main search... could split it up for list / post thing, but it's only a couple of things so it seems pointless...
    $res = sql_query('SELECT p.id AS post_id, p.body, p.post_title, p.added, p.icon, p.edited_by, p.edit_reason, p.edit_date, p.bbcode, p.anonymous AS pan, t.anonymous AS tan, t.id AS topic_id, t.topic_name AS   topic_title, t.topic_desc, t.post_count, t.views, t.locked, t.sticky, t.poll_id, t.num_ratings, t.rating_sum, f.id AS forum_id, f.name AS forum_name, f.description AS forum_desc, u.id, u.username, u.class, u.donor, u.suspended, u.warned, u.enabled, u.chatpost, u.leechwarn, u.pirate, u.king,  u.title, u.avatar, u.offensive_avatar, MATCH (' . $search_where . ') AGAINST (' . sqlesc($search) . ' IN BOOLEAN MODE) AS relevance FROM posts AS p LEFT JOIN topics AS t ON p.topic_id = t.id LEFT JOIN forums AS f ON t.forum_id = f.id LEFT JOIN users AS u ON p.user_id = u.id WHERE MATCH (' . $search_where . ') AGAINST (' . sqlesc($search) . ' IN BOOLEAN MODE) AND ' . ($CURUSER['class'] < UC_STAFF ? 'p.status = \'ok\' AND t.status = \'ok\' AND' : ($CURUSER['class'] < $min_delete_view_class ? 'p.status != \'deleted\' AND t.status != \'deleted\'  AND' : '')) . ' f.min_class_read <= ' . $CURUSER['class'] . $AND . ' HAVING relevance > 0.2 ORDER BY ' . $order_by . $ASC_DESC . $LIMIT);
    //=== top and bottom stuff
    $the_top_and_bottom = '<table border="0" cellspacing="0" cellpadding="0" width="90%">
	<tr><td class="three" align="center" valign="middle">' . ($count > $perpage ? $menu : '') . '</td>
	</tr></table>';
    //=== nothing here? kill the page
    if ($count == 0) {
        $content .= '<br /><a name="results"></a><br /><table border="0" cellspacing="10" cellpadding="10" width="800px">
	<tr><td class="forum_head_dark"align="center">
	' . $lang['sea_nothing_found'] . ' 
	</td></tr>
	<tr><td class="three"align="center">
$class = get_access(basename($_SERVER['REQUEST_URI']));
class_check($class);
$lang = array_merge($lang, load_language('ad_hit_and_run'));
if (XBT_TRACKER === false) {
    $query = isset($_GET['really_bad']) ? 'SELECT COUNT(*) FROM snatched LEFT JOIN users ON users.id = snatched.userid WHERE snatched.finished = \'yes\' AND snatched.hit_and_run > 0 AND users.hit_and_run_total > 2' : 'SELECT COUNT(*) FROM `snatched` WHERE `finished` = \'yes\' AND `hit_and_run` > 0';
} else {
    $query = isset($_GET['really_bad']) ? 'SELECT COUNT(*) FROM xbt_files_users LEFT JOIN users ON users.id = xbt_files_users.uid WHERE xbt_files_users.completed >= \'1\' AND xbt_files_users.hit_and_run > 0 AND users.hit_and_run_total > 2' : 'SELECT COUNT(*) FROM `xbt_files_users` WHERE `completed` >= \'1\' AND `hit_and_run` > 0';
}
$HTMLOUT = '';
//=== get stuff for the pager
$page = isset($_GET['page']) ? (int) $_GET['page'] : 0;
$perpage = isset($_GET['perpage']) ? (int) $_GET['perpage'] : 15;
$res_count = sql_query($query) or sqlerr(__FILE__, __LINE__);
$arr_count = mysqli_fetch_row($res_count);
$count = $arr_count[0] > 0 ? $arr_count[0] : 0;
list($menu, $LIMIT) = pager_new($count, $perpage, $page, 'staffpanel.php?tool=hit_and_run');
if (XBT_TRACKER === false) {
    $query_2 = isset($_GET['really_bad']) ? 'SELECT s.torrentid, s.userid, s.hit_and_run, s.downloaded AS dload, s.uploaded AS uload, s.seedtime, s.start_date, s.complete_date, p.id, p.torrent, p.seeder, u.id, u.avatar, u.username, u.uploaded AS up, u.downloaded AS down, u.class, u.hit_and_run_total, u.donor, u.warned, u.enabled, u.leechwarn, u.chatpost, u.pirate, u.king, u.suspended, t.owner, t.name, t.added AS torrent_added, t.seeders AS numseeding, t.leechers AS numleeching FROM snatched AS s LEFT JOIN users AS u ON u.id = s.userid LEFT JOIN peers AS p ON p.torrent=s.torrentid AND p.userid=s.userid LEFT JOIN torrents AS t ON t.id=s.torrentid WHERE finished = \'yes\' AND hit_and_run > 0 AND u.hit_and_run_total > 2 ORDER BY userid ' . $LIMIT : 'SELECT s.torrentid, s.userid, s.hit_and_run, s.downloaded AS dload, s.uploaded AS uload, s.seedtime, s.start_date, s.complete_date, p.id, p.torrent, p.seeder, u.id, u.avatar, u.username, u.uploaded AS up, u.downloaded AS down, u.class, u.hit_and_run_total, u.donor, u.warned, u.enabled, u.leechwarn, u.chatpost, u.pirate, u.king, u.suspended, t.owner, t.name, t.added AS torrent_added, t.seeders AS numseeding, t.leechers AS numleeching FROM snatched AS s LEFT JOIN users AS u ON u.id = s.userid LEFT JOIN peers AS p ON p.torrent=s.torrentid AND p.userid=s.userid LEFT JOIN torrents AS t ON t.id=s.torrentid WHERE `finished` = \'yes\' AND `hit_and_run` > 0 ORDER BY `userid` ' . $LIMIT;
} else {
    $query_2 = isset($_GET['really_bad']) ? 'SELECT x.fid, x.uid, x.hit_and_run, x.downloaded AS dload, x.uploaded AS uload, x.seedtime, x.started, x.completedtime, x.active, u.id, u.avatar, u.username, u.uploaded AS up, u.downloaded AS down, u.class, u.hit_and_run_total, u.donor, u.warned, u.enabled, u.leechwarn, u.chatpost, u.pirate, u.king, u.suspended, t.owner, t.name, t.added AS torrent_added, t.seeders AS numseeding, t.leechers AS numleeching FROM xbt_files_users AS x LEFT JOIN users AS u ON u.id = x.uid LEFT JOIN torrents AS t ON t.id=x.fid WHERE completed >= \'1\' AND hit_and_run > 0 AND u.hit_and_run_total > 2 ORDER BY uid ' . $LIMIT : 'SELECT x.fid, x.uid, x.hit_and_run, x.downloaded AS dload, x.uploaded AS uload, x.seedtime, x.started, x.completedtime, x.active, u.id, u.avatar, u.username, u.uploaded AS up, u.downloaded AS down, u.class, u.hit_and_run_total, u.donor, u.warned, u.enabled, u.leechwarn, u.chatpost, u.pirate, u.king, u.suspended, t.owner, t.name, t.added AS torrent_added, t.seeders AS numseeding, t.leechers AS numleeching FROM xbt_files_users AS x LEFT JOIN users AS u ON u.id = x.uid LEFT JOIN torrents AS t ON t.id=x.fid WHERE `completed` >= \'1\' AND `hit_and_run` > 0 ORDER BY `uid` ' . $LIMIT;
}
$hit_and_run_rez = sql_query($query_2) or sqlerr(__FILE__, __LINE__);
$HTMLOUT .= '<h2>' . (!isset($_GET['really_bad']) ? $lang['hitnrun_chance'] : $lang['hitnrun_nochance']) . '</h2><br /> 
		<a class="altlink" href="staffpanel.php?tool=hit_and_run">' . $lang['hitnrun_show_current'] . '</a> || <a class="altlink" href="staffpanel.php?tool=hit_and_run&amp;really_bad=show_them">' . $lang['hitnrun_show_disabled'] . '</a><br /><br />
		' . ($arr_count[0] > $perpage ? '<p>' . $menu . '</p>' : '') . '
		<table>' . (mysqli_num_rows($hit_and_run_rez) > 0 ? '<tr><td  class="colhead">' . $lang['hitnrun_avatar'] . '</td>
		<td  class="colhead"><b>' . $lang['hitnrun_member'] . '</b></td>
		<td class="colhead"><b>' . $lang['hitnrun_torrent'] . '</b></td>
		<td class="colhead"><b>' . $lang['hitnrun_times'] . '</b></td>
		<td class="colhead"><b>' . $lang['hitnrun_stats'] . '</b></td>
		<td class="colhead">' . $lang['hitnrun_actions'] . '</td>' : '<tr><td>' . $lang['hitnrun_none'] . '</td>') . '</tr>';
Beispiel #9
0
 <td class="two" align="right">Report Request</td>
 <td class="two" align="left"><form action="report.php?type=Request&amp;id=' . $id . '" method="post">
 <input type="submit" class="button_med" value="Report This Request" onmouseover="this.className=\'button_med_hover\'" onmouseout="this.className=\'button_med\'" />
 For breaking the <a class="altlink" href="rules.php">rules</a></form></td>
 </tr>
 </table>';
       $HTMLOUT .= '<h1>Comments for ' . htmlsafechars($arr['request_name'], ENT_QUOTES) . '</h1><p><a name="startcomments"></a></p>';
       $commentbar = '<p align="center"><a class="index" href="requests.php?action=add_comment&amp;id=' . $id . '">Add a comment</a></p>';
       $count = (int) $arr['comments'];
       if (!$count) {
           $HTMLOUT .= '<h2>No comments yet</h2>';
       } else {
           //=== get stuff for the pager
           $page = isset($_GET['page']) ? (int) $_GET['page'] : 0;
           $perpage = isset($_GET['perpage']) ? (int) $_GET['perpage'] : 20;
           list($menu, $LIMIT) = pager_new($count, $perpage, $page, 'requests.php?action=request_details&amp;id=' . $id, ($perpage == 20 ? '' : '&amp;perpage=' . $perpage) . '#comments');
           $subres = sql_query('SELECT c.request, c.id AS comment_id, c.text, c.added, c.editedby, c.editedat, u.id, u.username, u.warned, u.suspended, u.enabled, u.donor, u.class, u.avatar, u.offensive_avatar, u.leechwarn, u.chatpost, u.pirate, u.king, u.title FROM comments AS c LEFT JOIN users AS u ON c.user = u.id WHERE c.request = ' . sqlesc($id) . ' ORDER BY c.id ' . $LIMIT) or sqlerr(__FILE__, __LINE__);
           $allrows = array();
           while ($subrow = mysqli_fetch_assoc($subres)) {
               $allrows[] = $subrow;
           }
           $HTMLOUT .= $commentbar . '<a name="comments"></a>';
           $HTMLOUT .= $count > $perpage ? '' . $menu . '<br />' : '<br />';
           $HTMLOUT .= comment_table($allrows);
           $HTMLOUT .= $count > $perpage ? '' . $menu . '<br />' : '<br />';
       }
       $HTMLOUT .= $commentbar;
       echo stdhead('Request details for: ' . htmlsafechars($arr['request_name'], ENT_QUOTES), true, $stdhead) . $HTMLOUT . stdfoot($stdfoot);
       break;
       //===========================================================================================//
       //====================================    add new request      ========================================//
Beispiel #10
0
$count = $row[0];
//=== nothing here? kill the page
if ($count == 0) {
    $HTMLOUT .= '<br /><br /><table border="0" cellspacing="10" cellpadding="10" width="400px">
		<tr><td class="three"align="center">
		<h1>No Subscriptions Found!</h1>You are not yet subscribed to any forums... To subscribe to a forum, click the 
		<span style="font-weight: bold;font-style: italic;">Subscribe to this Forum</span> link on the thread page.<br /><br />
		To be notified via PM when there is a new post, go to your <a class="altlink" href="my.php">profile</a> 
		page and set <span style="font-weight: bold;">PM on Subscriptions</span> to yes.<br /><br />
		</td></tr></table><br /><br />';
    $HTMLOUT .= $links . '<br />';
}
//=== get stuff for the pager
$page = isset($_GET['page']) ? (int) $_GET['page'] : 0;
$perpage = isset($_GET['perpage']) ? (int) $_GET['perpage'] : 20;
list($menu, $LIMIT) = pager_new($count, $perpage, $page, 'forums.php?action=subscriptions' . (isset($_GET['perpage']) ? '&amp;perpage=' . $perpage : ''));
//=== top and bottom stuff
$the_top_and_bottom = '<table border="0" cellspacing="0" cellpadding="0" width="90%">
		<tr><td class="three" align="center" valign="middle">' . ($count > $perpage ? $menu : '') . '</td>
		</tr></table>';
//=== get the info
$res = sql_query('SELECT s.id AS subscribed_id, t.id AS topic_id, t.topic_name, t.topic_desc, t.last_post,  t.views, t.post_count, t.locked, t.sticky, t.poll_id, t.user_id,
p.id AS post_id, p.added,
u.username, u.id, u.class, u.donor, u.suspended, u.warned, u.enabled, u.chatpost, u.leechwarn, u.pirate, u.king
FROM subscriptions AS s 
LEFT JOIN topics as t ON s.topic_id = t.id 
LEFT JOIN posts as p ON t.last_post = p.id 
LEFT JOIN forums AS f ON f.id = t.forum_id 
LEFT JOIN users AS u ON u.id = p.user_id 
WHERE ' . ($CURUSER['class'] < UC_STAFF ? 'p.status = \'ok\' AND t.status = \'ok\' AND' : ($CURUSER['class'] < $min_delete_view_class ? 'p.status != \'deleted\' AND t.status != \'deleted\'  AND' : '')) . ' 
s.user_id = ' . $CURUSER['id'] . ' AND f.min_class_read < ' . $CURUSER['class'] . ' AND s.user_id = ' . $CURUSER['id'] . '  ORDER BY t.id DESC ' . $LIMIT);