1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

More nextprev sorting

This commit is contained in:
SteveD 2013-01-13 12:07:36 +00:00
parent 4054f9f4b4
commit a55e0be3de
2 changed files with 179 additions and 170 deletions

View File

@ -2,7 +2,7 @@
/* /*
* e107 website system * 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 * Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
* *
@ -17,11 +17,12 @@
require_once('../../class2.php'); require_once('../../class2.php');
if (!plugInstalled('chatbox_menu')) if (!plugInstalled('chatbox_menu'))
{ {
header("Location: ".e_BASE."index.php"); header('Location: '.e_BASE.'index.php');
exit; exit;
} }
include_lan(e_PLUGIN."chatbox_menu/languages/".e_LANGUAGE."/".e_LANGUAGE.".php"); include_lan(e_PLUGIN."chatbox_menu/languages/".e_LANGUAGE."/".e_LANGUAGE.".php");
require_once(HEADERF); require_once(HEADERF);
$sql->db_Select("menus", "*", "menu_name='chatbox_menu'"); $sql->db_Select("menus", "*", "menu_name='chatbox_menu'");
@ -73,30 +74,35 @@ if($_POST['moderate'] && CB_MOD)
} }
// when coming from search.php // when coming from search.php
if (strstr(e_QUERY, "fs")) { if (strstr(e_QUERY, "fs"))
$cgtm = str_replace(".fs", "", e_QUERY); {
$cgtm = intval(str_replace(".fs", "", e_QUERY));
$fs = TRUE; $fs = TRUE;
} }
// end search // 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"); $qry_where = (CB_MOD ? "1" : "cb_blocked=0");
// when coming from search.php calculate page number // when coming from search.php calculate page number
if ($fs) { if ($fs)
{
$page_count = 0; $page_count = 0;
$row_count = 0; $row_count = 0;
$sql->db_Select("chatbox", "*", "{$qry_where} ORDER BY cb_datestamp DESC"); $sql->db_Select("chatbox", "*", "{$qry_where} ORDER BY cb_datestamp DESC");
while ($row = $sql -> db_Fetch()) { while ($row = $sql -> db_Fetch())
if ($row['cb_id'] == $cgtm) { {
if ($row['cb_id'] == $cgtm)
{
$from = $page_count; $from = $page_count;
break; break;
} }
$row_count++; $row_count++;
if ($row_count == 30) { if ($row_count == 30)
{
$row_count = 0; $row_count = 0;
$page_count += 30; $page_count += 30;
} }
@ -159,11 +165,14 @@ if($message)
$ns->tablerender("", $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); $ns->tablerender(CHATBOX_L20, $text);
require_once(e_HANDLER."np_class.php"); //require_once(e_HANDLER."np_class.php");
$ix = new nextprev("chat.php", $from, 30, $chat_total, CHATBOX_L21); //$ix = new nextprev("chat.php", $from, 30, $chat_total, CHATBOX_L21);
require_once(FOOTERF); require_once(FOOTERF);
?> ?>

14
top.php
View File

@ -2,7 +2,7 @@
/* /*
* e107 website system * 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 * Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
* *
@ -12,7 +12,7 @@
* $Id$ * $Id$
* *
*/ */
require_once ('class2.php'); require_once('class2.php');
$ns = e107::getRender(); $ns = e107::getRender();
$pref = e107::getPref(); $pref = e107::getPref();
@ -50,7 +50,7 @@ else
} }
require_once (HEADERF); require_once(HEADERF);
if ($action == 'active') if ($action == 'active')
{ {
require_once (e_HANDLER.'userclass_class.php'); require_once (e_HANDLER.'userclass_class.php');
@ -124,7 +124,7 @@ if ($action == 'active')
$ftotal = $sql->db_Count('forum_t', '(*)', 'WHERE `thread_parent` = 0'); $ftotal = $sql->db_Count('forum_t', '(*)', 'WHERE `thread_parent` = 0');
$parms = "{$ftotal},{$view},{$from},".e_SELF.'?[FROM].active.forum.'.$view; $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'); $ns->tablerender(LAN_7, $text, 'nfp');
/* /*
require_once (e_HANDLER.'np_class.php'); require_once (e_HANDLER.'np_class.php');
@ -195,7 +195,7 @@ if ($action == 'top')
{ {
$ftotal = $sql->db_Count('user', '(*)', 'WHERE `user_forums` > 0'); $ftotal = $sql->db_Count('user', '(*)', 'WHERE `user_forums` > 0');
$parms = "{$ftotal},{$view},{$from},".e_SELF.'?[FROM].top.forum.'.$view; $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); $ns->tablerender(TOP_LAN_0, $text);
/* /*
@ -256,7 +256,7 @@ if ($action == 'top')
$ns->tablerender(TOP_LAN_3, $text); $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"); $top_forum_posters = $sql->db_Select("user", "*", "`user_chats` > 0 ORDER BY user_chats DESC LIMIT 0, 10");
$text = " $text = "
@ -305,5 +305,5 @@ if ($action == 'top')
$ns->tablerender(TOP_LAN_5, $text); $ns->tablerender(TOP_LAN_5, $text);
} }
} }
require_once (FOOTERF); require_once(FOOTERF);
?> ?>