[geeklog-cvs] geeklog-1.3/public_html index.php,1.65,1.66 usersettings.php,1.102,1.103
dhaun at iowaoutdoors.org
dhaun at iowaoutdoors.org
Tue Sep 28 04:28:51 EDT 2004
Update of /var/cvs/geeklog-1.3/public_html
In directory www:/tmp/cvs-serv17704
Modified Files:
index.php usersettings.php
Log Message:
Fixed bug #190: Properly pick up number of stories per page from the topic settings; allow user to set stories/page to 0 to get the default number; fixed hard-coded default value in admin template.
Index: usersettings.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/usersettings.php,v
retrieving revision 1.102
retrieving revision 1.103
diff -C2 -d -r1.102 -r1.103
*** usersettings.php 28 Aug 2004 15:55:33 -0000 1.102
--- usersettings.php 28 Sep 2004 08:28:49 -0000 1.103
***************
*** 300,309 ****
$A = DB_fetchArray($result);
! // if 'maxstories' is empty (for a new user account) set it to the
! // default value from config.php
! if (empty($A['maxstories'])) {
! $A['maxstories'] = $_CONF['limitnews'];
! } else if ($A['maxstories'] < $_CONF['minnews']) {
! $A['maxstories'] = $_CONF['minnews'];
}
--- 300,311 ----
$A = DB_fetchArray($result);
! // 'maxstories' may be 0, in which case it will pick up the default
! // setting for the current topic or $_CONF['limitnews'] (see index.php)
! if (empty ($A['maxstories'])) {
! $A['maxstories'] = 0;
! } else if ($A['maxstories'] > 0) {
! if ($A['maxstories'] < $_CONF['minnews']) {
! $A['maxstories'] = $_CONF['minnews'];
! }
}
***************
*** 939,944 ****
$A['maxstories'] = COM_applyFilter ($A['maxstories'], true);
! if ($A['maxstories'] < $_CONF['minnews']) {
! $A['maxstories'] = $_CONF['minnews'];
}
--- 941,950 ----
$A['maxstories'] = COM_applyFilter ($A['maxstories'], true);
! if (empty ($A['maxstories'])) {
! $A['maxstories'] = 0;
! } else if ($A['maxstories'] > 0) {
! if ($A['maxstories'] < $_CONF['minnews']) {
! $A['maxstories'] = $_CONF['minnews'];
! }
}
Index: index.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/index.php,v
retrieving revision 1.65
retrieving revision 1.66
diff -C2 -d -r1.65 -r1.66
*** index.php 23 Sep 2004 14:20:59 -0000 1.65
--- index.php 28 Sep 2004 08:28:49 -0000 1.66
***************
*** 89,117 ****
}
- $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);
- if ($U['maxstories'] >= $_CONF['minnews']) {
- $maxstories = $U['maxstories'];
- }
- if ((!empty($topic)) && ($maxstories == 0)) {
- $tmp = DB_query("SELECT limitnews FROM {$_TABLES['topics']} WHERE tid = '{$topic}'");
- $T = DB_fetchArray($tmp);
- if ($T['limitnews'] >= $_CONF['minnews']) {
- $maxstories = $T['limitnews'];
- }
- }
- if ($maxstories == 0) {
- $maxstories = $_CONF['limitnews'];
- }
- $U['maxstories'] = $maxstories;
} else {
! $U['maxstories'] = $_CONF['limitnews'];
! /* HELPME: should we check for topic "limitnews" value? */
}
! $limit = $U['maxstories'];
// Geeklog now allows for articles to be published in the future. Because of
--- 89,115 ----
}
if (isset ($_USER['uid']) && ($_USER['uid'] > 1)) {
! $result = DB_query("SELECT maxstories,tids,aids FROM {$_TABLES['userindex']} WHERE uid = '{$_USER['uid']}'");
$U = DB_fetchArray($result);
} else {
! $U['maxstories'] = 0;
}
! $maxstories = 0;
! if ($U['maxstories'] >= $_CONF['minnews']) {
! $maxstories = $U['maxstories'];
! }
! if ((!empty ($topic)) && ($maxstories == 0)) {
! $topiclimit = DB_getItem ($_TABLES['topics'], 'limitnews',
! "tid = '{$topic}'");
! if ($topiclimit >= $_CONF['minnews']) {
! $maxstories = $topiclimit;
! }
! }
! if ($maxstories == 0) {
! $maxstories = $_CONF['limitnews'];
! }
!
! $limit = $maxstories;
// Geeklog now allows for articles to be published in the future. Because of
More information about the geeklog-cvs
mailing list