[geeklog-cvs] geeklog-1.3/public_html/admin story.php,1.113,1.114
vinny at iowaoutdoors.org
vinny at iowaoutdoors.org
Sat May 1 13:57:07 EDT 2004
- Previous message (by thread): [geeklog-cvs] geeklog-1.3/public_html article.php,1.42,1.43 index.php,1.56,1.57 lib-common.php,1.317,1.318 submit.php,1.65,1.66
- Next message (by thread): [geeklog-cvs] geeklog-1.3/public_html/admin/install install.php,1.64,1.65
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /var/cvs/geeklog-1.3/public_html/admin
In directory www:/tmp/cvs-serv15756/public_html/admin
Modified Files:
story.php
Log Message:
Removed DB calls from COM_article to improve performance.
Index: story.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/admin/story.php,v
retrieving revision 1.113
retrieving revision 1.114
diff -C2 -d -r1.113 -r1.114
*** story.php 10 Feb 2004 19:22:23 -0000 1.113
--- story.php 1 May 2004 17:57:05 -0000 1.114
***************
*** 92,96 ****
if (!empty($sid) && $mode == 'edit') {
! $result = DB_query("SELECT *,UNIX_TIMESTAMP(date) AS unixdate FROM {$_TABLES['stories']} WHERE sid = '$sid'");
$A = DB_fetchArray($result);
$access = SEC_hasAccess($A['owner_id'],$A['group_id'],$A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['perm_anon']);
--- 92,99 ----
if (!empty($sid) && $mode == 'edit') {
! $result = DB_query ("SELECT STRAIGHT_JOIN s.*, UNIX_TIMESTAMP(s.date) as day, "
! . "u.username, u.fullname, u.photo, t.topic, t.imageurl "
! . "FROM {$_TABLES['stories']} as s, {$_TABLES['users']} as u, {$_TABLES['topics']} as t "
! . "WHERE (s.uid = u.uid) AND (s.tid = t.tid) AND (sid = '$sid')");
$A = DB_fetchArray($result);
$access = SEC_hasAccess($A['owner_id'],$A['group_id'],$A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['perm_anon']);
***************
*** 113,117 ****
}
} elseif (!empty($sid) && $mode == 'editsubmission') {
! $result = DB_query("SELECT *,UNIX_TIMESTAMP(date) AS unixdate FROM {$_TABLES['storysubmission']} WHERE sid = '$sid'");
if (DB_numRows ($result) > 0) {
$A = DB_fetchArray($result);
--- 116,124 ----
}
} elseif (!empty($sid) && $mode == 'editsubmission') {
! $result = DB_query ("SELECT STRAIGHT_JOIN s.*, UNIX_TIMESTAMP(s.date) as day, "
! . "u.username, u.fullname, u.photo, t.topic, t.imageurl, t.group_id, "
! . "t.perm_owner, t.perm_group, t.perm_members, t.perm_anon "
! . "FROM {$_TABLES['storysubmission']} as s, {$_TABLES['users']} as u, {$_TABLES['topics']} as t "
! . "WHERE (s.uid = u.uid) AND (s.tid = t.tid) AND (sid = '$sid')");
if (DB_numRows ($result) > 0) {
$A = DB_fetchArray($result);
***************
*** 121,131 ****
$A['statuscode'] = 0;
$A['owner_id'] = $A['uid'];
- $result = DB_query ("SELECT group_id,perm_owner,perm_group,perm_members,perm_anon FROM {$_TABLES['topics']} WHERE tid = '{$A['tid']}'");
- $T = DB_fetchArray ($result);
- $A['group_id'] = $T['group_id'];
- $A['perm_owner'] = $T['perm_owner'];
- $A['perm_group'] = $T['perm_group'];
- $A['perm_members'] = $T['perm_members'];
- $A['perm_anon'] = $T['perm_anon'];
$access = 3;
$A['title'] = htmlspecialchars ($A['title']);
--- 128,131 ----
***************
*** 154,157 ****
--- 154,161 ----
} else {
$A = $HTTP_POST_VARS;
+ $res = DB_query("SELECT username, fullname, photo FROM {$_TABLES['users']} WHERE uid = {$A['uid']}");
+ $A += DB_fetchArray($res);
+ $res = DB_query("SELECT topic, imageurl FROM {$_TABLES['topics']} WHERE tid = '{$A['tid']}'");
+ $A += DB_fetchArray($res);
if (empty ($A['ampm'])) {
$A['ampm'] = $A['publish_ampm'];
- Previous message (by thread): [geeklog-cvs] geeklog-1.3/public_html article.php,1.42,1.43 index.php,1.56,1.57 lib-common.php,1.317,1.318 submit.php,1.65,1.66
- Next message (by thread): [geeklog-cvs] geeklog-1.3/public_html/admin/install install.php,1.64,1.65
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the geeklog-cvs
mailing list