[geeklog-cvs] geeklog-1.3/public_html index.php,1.53,1.54
dhaun at geeklog.net
dhaun at geeklog.net
Mon Feb 2 14:09:24 EST 2004
Update of /usr/cvs/geeklog/geeklog-1.3/public_html
In directory geeklog_prod:/tmp/cvs-serv22051
Modified Files:
index.php
Log Message:
Added parameter checking
Index: index.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/index.php,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** index.php 16 Nov 2003 21:44:18 -0000 1.53
--- index.php 2 Feb 2004 19:09:21 -0000 1.54
***************
*** 6,17 ****
// +---------------------------------------------------------------------------+
// | index.php |
- // | Geeklog homepage. |
// | |
// +---------------------------------------------------------------------------+
! // | Copyright (C) 2000,2001 by the following authors: |
// | |
! // | Authors: Tony Bibbs - tony at tonybibbs.com |
! // | Mark Limburg - mlimburg at users.sourceforge.net |
! // | Jason Wittenburg - jwhitten at securitygeeks.com |
// +---------------------------------------------------------------------------+
// | |
--- 6,18 ----
// +---------------------------------------------------------------------------+
// | index.php |
// | |
+ // | Geeklog homepage. |
// +---------------------------------------------------------------------------+
! // | Copyright (C) 2000-2004 by the following authors: |
// | |
! // | Authors: Tony Bibbs - tony at tonybibbs.com |
! // | Mark Limburg - mlimburg at users.sourceforge.net |
! // | Jason Whittenburg - jwhitten at securitygeeks.com |
! // | Dirk Haun - dirk at haun-online.de |
// +---------------------------------------------------------------------------+
// | |
***************
*** 51,61 ****
}
! if (isset ($HTTP_GET_VARS['page'])) {
$page = $HTTP_GET_VARS['page'];
}
- if (empty ($page)) {
- // If no page sent then assume the first.
- $page = 1;
- }
require_once('lib-common.php');
--- 52,59 ----
}
! $page = 1;
! if (isset ($HTTP_GET_VARS['page']) && is_numeric ($HTTP_GET_VARS['page'])) {
$page = $HTTP_GET_VARS['page'];
}
require_once('lib-common.php');
***************
*** 74,78 ****
$display .= COM_siteHeader();
if (isset ($HTTP_GET_VARS['msg'])) {
! $display .= COM_showMessage ($HTTP_GET_VARS['msg']);
}
--- 72,76 ----
$display .= COM_siteHeader();
if (isset ($HTTP_GET_VARS['msg'])) {
! $display .= COM_showMessage (COM_applyFilter ($HTTP_GET_VARS['msg'], true));
}
***************
*** 81,101 ****
// Requires a plugin to have a function called plugin_centerblock_<plugin_name>
$displayBlock = PLG_showCenterblock (1, $page, $topic); // top blocks
! if ($displayBlock != "") {
! $display .= $displayBlock;
! // Check if theme has added the template which allows the centerblock to span the top over the rightblocks
! if (file_exists($_CONF['path_layout'] . 'topcenterblock-span.thtml')) {
! $topspan = new Template($_CONF['path_layout']);
! $topspan->set_file (array ('topspan'=>'topcenterblock-span.thtml'));
! $topspan->parse ('output', 'topspan');
! $display .= $topspan->finish ($topspan->get_var('output'));
! $GLOBALS['centerspan'] = true;
! }
} else {
! $display .= $displayBlock;
}
$maxstories = 0;
! if (!empty($_USER['uid'])) {
$result = DB_query("SELECT noboxes,maxstories,tids,aids FROM {$_TABLES['userindex']} WHERE uid = '{$_USER['uid']}'");
$U = DB_fetchArray($result);
--- 79,100 ----
// Requires a plugin to have a function called plugin_centerblock_<plugin_name>
$displayBlock = PLG_showCenterblock (1, $page, $topic); // top blocks
! if (!empty ($displayBlock)) {
! $display .= $displayBlock;
! // Check if theme has added the template which allows the centerblock
! // to span the top over the rightblocks
! if (file_exists($_CONF['path_layout'] . 'topcenterblock-span.thtml')) {
! $topspan = new Template($_CONF['path_layout']);
! $topspan->set_file (array ('topspan'=>'topcenterblock-span.thtml'));
! $topspan->parse ('output', 'topspan');
! $display .= $topspan->finish ($topspan->get_var('output'));
! $GLOBALS['centerspan'] = true;
! }
} else {
! $display .= $displayBlock;
}
$maxstories = 0;
! if (isset ($_USER['uid']) && ($_USER['uid'] > 1)) {
$result = DB_query("SELECT noboxes,maxstories,tids,aids FROM {$_TABLES['userindex']} WHERE uid = '{$_USER['uid']}'");
$U = DB_fetchArray($result);
***************
*** 178,186 ****
$sql .= "ORDER BY featured DESC, date DESC";
! $result = DB_query ("SELECT *,unix_timestamp(date) AS day " . $sql
. " LIMIT $offset, $limit");
$nrows = DB_numRows ($result);
! $data = DB_query ("SELECT count(*) AS count " . $sql);
$D = DB_fetchArray ($data);
$num_pages = ceil ($D['count'] / $limit);
--- 177,185 ----
$sql .= "ORDER BY featured DESC, date DESC";
! $result = DB_query ("SELECT *,UNIX_TIMESTAMP(date) AS day " . $sql
. " LIMIT $offset, $limit");
$nrows = DB_numRows ($result);
! $data = DB_query ("SELECT COUNT(*) AS count " . $sql);
$D = DB_fetchArray ($data);
$num_pages = ceil ($D['count'] / $limit);
More information about the geeklog-cvs
mailing list