Renamed ifSqlHasZeroNums() to ifSqlHasZeroNumRows() and improved some queries.
[mailer.git] / inc / modules / guest / what-active.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 11/26/2004 *
4  * ===================                          Last change: 11/26/2004 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : what-active.php                                  *
8  * -------------------------------------------------------------------- *
9  * Short description : Today active members list                        *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Liste heutiger aktiver Mitglieder                *
12  * -------------------------------------------------------------------- *
13  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
14  * Copyright (c) 2009 - 2015 by Mailer Developer Team                   *
15  * For more information visit: http://mxchange.org                      *
16  *                                                                      *
17  * This program is free software; you can redistribute it and/or modify *
18  * it under the terms of the GNU General Public License as published by *
19  * the Free Software Foundation; either version 2 of the License, or    *
20  * (at your option) any later version.                                  *
21  *                                                                      *
22  * This program is distributed in the hope that it will be useful,      *
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
25  * GNU General Public License for more details.                         *
26  *                                                                      *
27  * You should have received a copy of the GNU General Public License    *
28  * along with this program; if not, write to the Free Software          *
29  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
30  * MA  02110-1301  USA                                                  *
31  ************************************************************************/
32
33 // Some security stuff...
34 if (!defined('__SECURITY')) {
35         exit();
36 } // END - if
37
38 // Add description as navigation point
39 addYouAreHereLink('guest', __FILE__);
40
41 if ((!isExtensionActive('active')) && (!isAdmin())) {
42         displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=active%}');
43         return;
44 } // END - if
45
46 // Check for members who were active only this day
47 $result = sqlQuery("SELECT
48         `userid`,
49         `last_online`
50 FROM
51         `{?_MYSQL_PREFIX?}_user_data`
52 WHERE
53         `last_online` >= {?START_TDAY?} AND
54         `status`='CONFIRMED'
55         " . runFilterChain('user_exclusion_sql', ' ') . "
56 ORDER BY
57         `last_online` DESC
58 LIMIT {?active_limit?}", __FILE__, __LINE__);
59
60 // Entries found?
61 if (!ifSqlHasZeroNumRows($result)) {
62         // At least one member was online so let's load them all
63         $OUT = '';
64         while ($content = sqlFetchArray($result)) {
65                 // If ext-nickname is not installed, set 'nickname' to empty
66                 if (!isExtensionActive('nickname')) {
67                         $content['nickname'] = '';
68                 } // END - if
69
70                 // Translate comma
71                 $content['last_online'] = generateDateTime($content['last_online'], '2');
72
73                 // Load template
74                 $OUT .= loadTemplate('guest_list_active_row', TRUE, $content);
75         } // END - while
76 } else {
77         // No member was online today! :-(
78         $OUT = loadTemplate('guest_list_active_row_none', TRUE);
79 }
80
81 // Load template
82 loadTemplate('guest_list_active', FALSE, $OUT);
83
84 // [EOF]
85 ?>