[geeklog-cvs] geeklog-1.3/public_html/staticpages index.php,1.9,1.10
dhaun at geeklog.net
dhaun at geeklog.net
Sun Mar 9 06:47:24 EST 2003
Update of /usr/cvs/geeklog/geeklog-1.3/public_html/staticpages
In directory internal.geeklog.net:/tmp/cvs-serv30721/public_html/staticpages
Modified Files:
index.php
Log Message:
Integrated Static Pages 1.3
Index: index.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/staticpages/index.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** index.php 7 Oct 2002 14:15:13 -0000 1.9
--- index.php 9 Mar 2003 11:47:22 -0000 1.10
***************
*** 3,7 ****
/* Reminder: always indent with 4 spaces (no tabs). */
// +---------------------------------------------------------------------------+
! // | Static Page Geeklog Plugin 0.1 |
// +---------------------------------------------------------------------------+
// | index.php |
--- 3,7 ----
/* Reminder: always indent with 4 spaces (no tabs). */
// +---------------------------------------------------------------------------+
! // | Static Page Geeklog Plugin 1.3 |
// +---------------------------------------------------------------------------+
// | index.php |
***************
*** 9,15 ****
// | |
// +---------------------------------------------------------------------------+
! // | Copyright (C) 2000,2001 by the following authors: |
// | |
// | Authors: Tony Bibbs - tony at tonybibbs.com |
// +---------------------------------------------------------------------------+
// | |
--- 9,16 ----
// | |
// +---------------------------------------------------------------------------+
! // | Copyright (C) 2000-2003 by the following authors: |
// | |
// | Authors: Tony Bibbs - tony at tonybibbs.com |
+ // | Tom Willett - twillett at users.sourceforge.net |
// +---------------------------------------------------------------------------+
// | |
***************
*** 32,79 ****
// $Id$
! require_once('../lib-common.php');
$error = 0;
! if (!empty($_USER['uid'])) {
! $result = DB_query("SELECT noboxes FROM {$_TABLES['userindex']} WHERE uid = '{$_USER['uid']}'");
! $U = DB_fetchArray($result);
}
! COM_setArgNames(array('page'));
! $page = COM_getArgument('page');
! if (empty($page)) {
! $error = 1;
}
! $count = DB_count($_TABLES['staticpage'],'sp_id',$page);
if ($count == 0 || $count > 1) {
! $error = 1;
}
if (!($error)) {
! $result = DB_query("SELECT * FROM {$_TABLES['staticpage']} WHERE sp_id = '$page'");
! $A = DB_fetchArray($result);
! $_CONF["pagetitle"] = stripslashes($A['sp_title']);
! if ($A['sp_format'] == 'allblocks' OR $A["sp_format"] == 'leftblocks') {
! $retval .= COM_siteHeader('menu');
! } else {
if ($A['sp_format'] <> 'blankpage') {
! $retval .= COM_siteHeader('none');
}
! }
if ($_SP_CONF['in_block'] == 1) {
$retval .= COM_startBlock (stripslashes ($A['sp_title']));
}
! $retval .= stripslashes($A['sp_content']);
if ($A['sp_format'] <> 'blankpage') {
! $curtime = COM_getUserDateTimeFormat($A['sp_date']);
! $retval .= '<p align="center"><br>' . $LANG_STATIC[lastupdated] . ' ' . $curtime[0];
! if (SEC_hasRights('staticpages.edit,staticpages.delete','OR')) {
! $retval .= '<br><a href="' . COM_buildURL ($_CONF['site_admin_url'] . '/plugins/staticpages/index.php?mode=edit&sp_id=' . $page) . '">';
! $retval .= $LANG_STATIC[edit] . "</a>";
! }
$retval .= '</p>';
}
--- 33,89 ----
// $Id$
! require_once ('../lib-common.php');
!
$error = 0;
! if (!empty ($_USER['uid'])) {
! $result = DB_query ("SELECT noboxes FROM {$_TABLES['userindex']} WHERE uid = '{$_USER['uid']}'");
! $U = DB_fetchArray ($result);
}
! COM_setArgNames (array ('page'));
! $page = COM_getArgument ('page');
! if (empty ($page)) {
! $error = 1;
}
! $result = DB_query ("SELECT * FROM {$_TABLES['staticpage']} WHERE (sp_id = '$page') AND " . SP_getPerms ());
! $count = DB_numRows ($result);
if ($count == 0 || $count > 1) {
! $error = 1;
}
if (!($error)) {
! $A = DB_fetchArray ($result);
! $_CONF["pagetitle"] = stripslashes ($A['sp_title']);
! if ($A['sp_format'] == 'allblocks' OR $A['sp_format'] == 'leftblocks') {
! $retval .= COM_siteHeader ('menu');
! } else {
if ($A['sp_format'] <> 'blankpage') {
! $retval .= COM_siteHeader ('none');
}
! }
if ($_SP_CONF['in_block'] == 1) {
$retval .= COM_startBlock (stripslashes ($A['sp_title']));
}
! //Check for type (ie html or php)
! if ($A['sp_php'] == 1) {
! $retval .= eval (stripslashes ($A['sp_content']));
! } else {
! $retval .= stripslashes ($A['sp_content']);
! }
if ($A['sp_format'] <> 'blankpage') {
! $curtime = COM_getUserDateTimeFormat ($A['sp_date']);
! $retval .= '<p align="center"><br>' . $LANG_STATIC['lastupdated']
! . ' ' . $curtime[0];
! if (SEC_hasAccess ($A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']) == 3) {
! $retval .= '<br><a href="' . COM_buildURL ($_CONF['site_admin_url']
! . '/plugins/staticpages/index.php?mode=edit&sp_id='
! . $page) . '">';
! $retval .= $LANG_STATIC['edit'] . "</a>";
! }
$retval .= '</p>';
}
***************
*** 82,105 ****
}
! if ($A['sp_format'] <> 'blankpage')
! {
!
if ($A['sp_format'] == 'allblocks' && $U['noboxes'] != 1) {
! $retval .= COM_siteFooter(true);
! }
! else
! {
! $retval .= COM_siteFooter();
}
-
}
!
// increment hit counter for page...is SQL compliant?
! DB_query("UPDATE {$_TABLES['staticpage']} SET sp_hits = sp_hits + 1 WHERE sp_id = '$page'");
} else {
! $retval .= COM_startBlock('error');
! $retval .= 'page does not exist';
! $retval .= COM_endBlock();
! }
echo $retval;
--- 92,128 ----
}
! if ($A['sp_format'] <> 'blankpage') {
if ($A['sp_format'] == 'allblocks' && $U['noboxes'] != 1) {
! $retval .= COM_siteFooter (true);
! } else {
! $retval .= COM_siteFooter ();
}
}
!
// increment hit counter for page...is SQL compliant?
! DB_query ("UPDATE {$_TABLES['staticpage']} SET sp_hits = sp_hits + 1 WHERE sp_id = '$page'");
} else {
! $failflg = DB_getItem ($_TABLES['staticpage'], 'sp_nf', "sp_id='$page'");
! if ($failflg) {
! $retval = COM_siteHeader ('menu');
! $retval .= COM_startBlock ($LANG_LOGIN[1]);
! $login = new Template ($_CONF['path_layout'] . 'submit');
! $login->set_file (array ('login'=>'submitloginrequired.thtml'));
! $login->set_var ('login_message', $LANG_LOGIN[2]);
! $login->set_var ('site_url', $_CONF['site_url']);
! $login->set_var ('lang_login', $LANG_LOGIN[3]);
! $login->set_var ('lang_newuser', $LANG_LOGIN[4]);
! $login->parse ('output', 'login');
! $retval .= $login->finish ($login->get_var ('output'));
! $retval .= COM_endBlock ();
! $retval .= COM_siteFooter (true);
! } else {
! $retval = COM_siteHeader ('menu');
! $retval .= COM_startBlock ($LANG_ACCESS['accessdenied']);
! $retval .= $LANG_STATIC['deny_msg'];
! $retval .= COM_endBlock ();
! $retval .= COM_siteFooter (true);
! }
! }
echo $retval;
More information about the geeklog-cvs
mailing list