mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 04:38:27 +01:00
More nextprev sorting
This commit is contained in:
parent
4054f9f4b4
commit
a55e0be3de
@ -2,7 +2,7 @@
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
@ -17,11 +17,12 @@
|
||||
require_once('../../class2.php');
|
||||
if (!plugInstalled('chatbox_menu'))
|
||||
{
|
||||
header("Location: ".e_BASE."index.php");
|
||||
header('Location: '.e_BASE.'index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
include_lan(e_PLUGIN."chatbox_menu/languages/".e_LANGUAGE."/".e_LANGUAGE.".php");
|
||||
|
||||
require_once(HEADERF);
|
||||
|
||||
$sql->db_Select("menus", "*", "menu_name='chatbox_menu'");
|
||||
@ -73,30 +74,35 @@ if($_POST['moderate'] && CB_MOD)
|
||||
}
|
||||
|
||||
// when coming from search.php
|
||||
if (strstr(e_QUERY, "fs")) {
|
||||
$cgtm = str_replace(".fs", "", e_QUERY);
|
||||
if (strstr(e_QUERY, "fs"))
|
||||
{
|
||||
$cgtm = intval(str_replace(".fs", "", e_QUERY));
|
||||
$fs = TRUE;
|
||||
}
|
||||
// end search
|
||||
|
||||
if (e_QUERY ? $from = e_QUERY : $from = 0);
|
||||
if (e_QUERY ? $from = intval(e_QUERY) : $from = 0);
|
||||
|
||||
$chat_total = $sql->db_Count("chatbox");
|
||||
$chat_total = $sql->db_Count('chatbox');
|
||||
|
||||
$qry_where = (CB_MOD ? "1" : "cb_blocked=0");
|
||||
|
||||
// when coming from search.php calculate page number
|
||||
if ($fs) {
|
||||
if ($fs)
|
||||
{
|
||||
$page_count = 0;
|
||||
$row_count = 0;
|
||||
$sql->db_Select("chatbox", "*", "{$qry_where} ORDER BY cb_datestamp DESC");
|
||||
while ($row = $sql -> db_Fetch()) {
|
||||
if ($row['cb_id'] == $cgtm) {
|
||||
while ($row = $sql -> db_Fetch())
|
||||
{
|
||||
if ($row['cb_id'] == $cgtm)
|
||||
{
|
||||
$from = $page_count;
|
||||
break;
|
||||
}
|
||||
$row_count++;
|
||||
if ($row_count == 30) {
|
||||
if ($row_count == 30)
|
||||
{
|
||||
$row_count = 0;
|
||||
$page_count += 30;
|
||||
}
|
||||
@ -159,11 +165,14 @@ if($message)
|
||||
$ns->tablerender("", $message);
|
||||
}
|
||||
|
||||
$parms = "{$chat_total},30,{$from},".e_SELF.'?[FROM]';
|
||||
$text .= "<div class='nextprev'>".$tp->parseTemplate("{NEXTPREV={$parms}}").'</div>';
|
||||
|
||||
$ns->tablerender(CHATBOX_L20, $text);
|
||||
|
||||
|
||||
require_once(e_HANDLER."np_class.php");
|
||||
$ix = new nextprev("chat.php", $from, 30, $chat_total, CHATBOX_L21);
|
||||
//require_once(e_HANDLER."np_class.php");
|
||||
//$ix = new nextprev("chat.php", $from, 30, $chat_total, CHATBOX_L21);
|
||||
|
||||
require_once(FOOTERF);
|
||||
?>
|
14
top.php
14
top.php
@ -2,7 +2,7 @@
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2011 e107 Inc (e107.org)
|
||||
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
@ -12,7 +12,7 @@
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
require_once ('class2.php');
|
||||
require_once('class2.php');
|
||||
|
||||
$ns = e107::getRender();
|
||||
$pref = e107::getPref();
|
||||
@ -50,7 +50,7 @@ else
|
||||
}
|
||||
|
||||
|
||||
require_once (HEADERF);
|
||||
require_once(HEADERF);
|
||||
if ($action == 'active')
|
||||
{
|
||||
require_once (e_HANDLER.'userclass_class.php');
|
||||
@ -124,7 +124,7 @@ if ($action == 'active')
|
||||
|
||||
$ftotal = $sql->db_Count('forum_t', '(*)', 'WHERE `thread_parent` = 0');
|
||||
$parms = "{$ftotal},{$view},{$from},".e_SELF.'?[FROM].active.forum.'.$view;
|
||||
$text .= '<br />'.$tp->parseTemplate("{NEXTPREV={$parms}}");
|
||||
$text .= "<div class='nextprev'>".$tp->parseTemplate("{NEXTPREV={$parms}}").'</div>';
|
||||
$ns->tablerender(LAN_7, $text, 'nfp');
|
||||
/*
|
||||
require_once (e_HANDLER.'np_class.php');
|
||||
@ -195,7 +195,7 @@ if ($action == 'top')
|
||||
{
|
||||
$ftotal = $sql->db_Count('user', '(*)', 'WHERE `user_forums` > 0');
|
||||
$parms = "{$ftotal},{$view},{$from},".e_SELF.'?[FROM].top.forum.'.$view;
|
||||
$text .= '<br />'.$tp->parseTemplate("{NEXTPREV={$parms}}");
|
||||
$text .= "<div class='nextprev'>".$tp->parseTemplate("{NEXTPREV={$parms}}").'</div>';
|
||||
}
|
||||
$ns->tablerender(TOP_LAN_0, $text);
|
||||
/*
|
||||
@ -256,7 +256,7 @@ if ($action == 'top')
|
||||
$ns->tablerender(TOP_LAN_3, $text);
|
||||
}
|
||||
|
||||
if ($subaction == "chat" || $subaction == "all")
|
||||
if ($subaction == 'chat' || $subaction == 'all')
|
||||
{
|
||||
$top_forum_posters = $sql->db_Select("user", "*", "`user_chats` > 0 ORDER BY user_chats DESC LIMIT 0, 10");
|
||||
$text = "
|
||||
@ -305,5 +305,5 @@ if ($action == 'top')
|
||||
$ns->tablerender(TOP_LAN_5, $text);
|
||||
}
|
||||
}
|
||||
require_once (FOOTERF);
|
||||
require_once(FOOTERF);
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user