[geeklog-cvs] Geeklog-1.x/public_html lib-common.php, 1.715, 1.716 usersettings.php, 1.173, 1.174
Dirk Haun
dhaun at qs1489.pair.com
Sun Aug 3 04:05:52 EDT 2008
Update of /cvsroot/geeklog/Geeklog-1.x/public_html
In directory qs1489.pair.com:/tmp/cvs-serv53349/public_html
Modified Files:
lib-common.php usersettings.php
Log Message:
Some minor Daily Digest improvements and code for future use
Index: usersettings.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/usersettings.php,v
retrieving revision 1.173
retrieving revision 1.174
diff -C2 -d -r1.173 -r1.174
*** usersettings.php 31 May 2008 19:49:36 -0000 1.173
--- usersettings.php 3 Aug 2008 08:05:50 -0000 1.174
***************
*** 314,344 ****
/**
- * Build a list of all topics the current user has access to
- *
- * @return string List of topic IDs, separated by spaces
- *
- */
- function buildTopicList ()
- {
- global $_TABLES;
-
- $topics = '';
-
- $result = DB_query ("SELECT tid FROM {$_TABLES['topics']}");
- $numrows = DB_numRows ($result);
- for ($i = 1; $i <= $numrows; $i++) {
- $A = DB_fetchArray ($result);
- if (SEC_hasTopicAccess ($A['tid'])) {
- if ($i > 1) {
- $topics .= ' ';
- }
- $topics .= $A['tid'];
- }
- }
-
- return $topics;
- }
-
- /**
* Displays user preferences
*
--- 314,317 ----
***************
*** 655,659 ****
"uid = {$_USER['uid']}");
if (empty ($user_etids)) { // an empty string now means "all topics"
! $user_etids = buildTopicList ();
} elseif ($user_etids == '-') { // this means "no topics"
$user_etids = '';
--- 628,633 ----
"uid = {$_USER['uid']}");
if (empty ($user_etids)) { // an empty string now means "all topics"
! $etids = USER_getAllowedTopics();
! $user_etids = implode(' ', $etids);
} elseif ($user_etids == '-') { // this means "no topics"
$user_etids = '';
***************
*** 1395,1400 ****
$etids = '';
if (sizeof ($ETIDS) > 0) {
! $allowed_etids = buildTopicList ();
! $AETIDS = explode (' ', $allowed_etids);
$etids = addslashes (implode (' ', array_intersect ($AETIDS, $ETIDS)));
}
--- 1369,1373 ----
$etids = '';
if (sizeof ($ETIDS) > 0) {
! $AETIDS = USER_getAllowedTopics();
$etids = addslashes (implode (' ', array_intersect ($AETIDS, $ETIDS)));
}
Index: lib-common.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/lib-common.php,v
retrieving revision 1.715
retrieving revision 1.716
diff -C2 -d -r1.715 -r1.716
*** lib-common.php 27 Jul 2008 09:11:29 -0000 1.715
--- lib-common.php 3 Aug 2008 08:05:50 -0000 1.716
***************
*** 368,373 ****
// Handle Who's Online block
! if( COM_isAnonUser() )
! {
// The following code handles anonymous users so they show up properly
DB_query( "DELETE FROM {$_TABLES['sessions']} WHERE remote_ip = '{$_SERVER['REMOTE_ADDR']}' AND uid = 1" );
--- 368,372 ----
// Handle Who's Online block
! if (COM_isAnonUser() && isset($_SERVER['REMOTE_ADDR']) {
// The following code handles anonymous users so they show up properly
DB_query( "DELETE FROM {$_TABLES['sessions']} WHERE remote_ip = '{$_SERVER['REMOTE_ADDR']}' AND uid = 1" );
***************
*** 3993,3996 ****
--- 3992,3999 ----
global $_CONF, $_TABLES, $LANG04, $LANG08, $LANG24;
+ if ($_CONF['emailstories'] == 0) {
+ return;
+ }
+
$subject = strip_tags( $_CONF['site_name'] . $LANG08[30] . strftime( '%Y-%m-%d', time() ));
***************
*** 4008,4012 ****
// For each user, pull the stories they want and email it to them
! for( $x = 1; $x <= $nrows; $x++ )
{
$U = DB_fetchArray( $users );
--- 4011,4015 ----
// For each user, pull the stories they want and email it to them
! for( $x = 0; $x < $nrows; $x++ )
{
$U = DB_fetchArray( $users );
***************
*** 4031,4035 ****
$TIDS = array();
! for( $i = 1; $i <= $trows; $i++ )
{
$T = DB_fetchArray( $tresult );
--- 4034,4038 ----
$TIDS = array();
! for( $i = 0; $i < $trows; $i++ )
{
$T = DB_fetchArray( $tresult );
More information about the geeklog-cvs
mailing list