Introduced new wrapper functions to make the code more readable, new extension ext...
authorRoland Häder <roland@mxchange.org>
Tue, 9 Mar 2010 23:48:16 +0000 (23:48 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 9 Mar 2010 23:48:16 +0000 (23:48 +0000)
46 files changed:
.gitattributes
beg.php
debug.php
inc/classes/rdf.class.php
inc/db/lib-mysql3.php
inc/extensions-functions.php
inc/extensions/ext-report.php [new file with mode: 0644]
inc/filters.php
inc/install-inc.php
inc/libs/admins_functions.php
inc/libs/jackpot_functions.php
inc/libs/mediadata_functions.php
inc/libs/rallye_functions.php
inc/libs/refback_functions.php
inc/libs/register_functions.php
inc/libs/surfbar_functions.php
inc/libs/yoomedia_functions.php
inc/modules/admin/admin-inc.php
inc/modules/admin/what-add_rallye.php
inc/modules/admin/what-config_admins.php
inc/modules/admin/what-config_cats.php
inc/modules/admin/what-config_email.php
inc/modules/admin/what-config_mods.php
inc/modules/admin/what-config_payouts.php
inc/modules/admin/what-config_rallye_prices.php
inc/modules/admin/what-extensions.php
inc/modules/admin/what-list_country.php
inc/modules/admin/what-list_sponsor_pay.php
inc/modules/admin/what-list_surfbar_urls.php
inc/modules/admin/what-list_yoomedia_tm.php
inc/modules/admin/what-optimize.php
inc/modules/admin/what-refbanner.php
inc/modules/admin/what-unlock_emails.php
inc/modules/guest/what-login.php
inc/modules/guest/what-sponsor_reg.php
inc/modules/member/what-categories.php
inc/modules/member/what-nickname.php
inc/modules/member/what-refback.php
inc/mysql-manager.php
inc/pool/pool-bonus.php
inc/pool/pool-user.php
inc/wrapper-functions.php
mailid.php
mailid_top.php
modules.php
templates/de/html/ext/ext_report.tpl [new file with mode: 0644]

index 03996dc968abf49a0d3f3dd61c803e0d4315db6d..f2fb25c472b766a1f623be6ef5a95eaa977b90a3 100644 (file)
@@ -170,6 +170,7 @@ inc/extensions/ext-refsell.php -text
 inc/extensions/ext-register.php -text
 inc/extensions/ext-removeip.php -text
 inc/extensions/ext-repair.php -text
+inc/extensions/ext-report.php -text
 inc/extensions/ext-rewrite.php -text
 inc/extensions/ext-safe.php -text
 inc/extensions/ext-seo.php -text
@@ -1358,6 +1359,7 @@ templates/de/html/ext/ext_refsell.tpl -text
 templates/de/html/ext/ext_register.tpl -text
 templates/de/html/ext/ext_removeip.tpl -text
 templates/de/html/ext/ext_repair.tpl -text
+templates/de/html/ext/ext_report.tpl -text
 templates/de/html/ext/ext_rewrite.tpl -text
 templates/de/html/ext/ext_safe.tpl -text
 templates/de/html/ext/ext_seo.tpl -text
diff --git a/beg.php b/beg.php
index febde55fec0c46647dc17886468ed65ae34f75e7..397fdf302c1495e9f27edfac4f639463ee938cca 100644 (file)
--- a/beg.php
+++ b/beg.php
@@ -108,7 +108,7 @@ if (isGetRequestParameterSet('userid')) {
                        array(getUserData('userid'), detectRemoteAddr(), session_id()), __FILE__, __LINE__);
 
                // Entry not found, points set and not logged in?
-               if (((SQL_NUMROWS($result) == '0') || (isAdmin())) && ($points > 0) && (!isMember()) && (getConfig('beg_pay_mode') == 'NONE')) {
+               if (((SQL_HASZERONUMS($result)) || (isAdmin())) && ($points > 0) && (!isMember()) && (getConfig('beg_pay_mode') == 'NONE')) {
 
                        // Admin is testing?
                        if (!isAdmin()) {
index 55381b148a5c67ea035713cb1471bdb9398c2c01..44af72c5451d0dfb5510ca0c5afea756002b84eb 100644 (file)
--- a/debug.php
+++ b/debug.php
@@ -48,7 +48,7 @@ $GLOBALS['output_mode'] = -1;
 require('inc/config-global.php');
 
 // Redirect only to registration page when this script is installed
-if ((isExtensionActive('debug')) && (getTotalFatalErrors() == '0')) {
+if ((isExtensionActive('debug')) && (!ifFatalErrorsDetected())) {
        // Is the request parameter set?
        if (isPostRequestParameterSet('request')) {
                // Handle the request
index c74eada6fbed6715bc17f71af1c8dd9dc4aaa895..9c9a0a2ff0d5ee108ad9784a3158de2ef9999a5d 100644 (file)
@@ -1025,7 +1025,7 @@ class fase4_rdf {
 
                $_cache_f = $this->_cache_dir.$this->_cached_file;
 
-               if ( (!file_exists($_cache_f)) || (filemtime($_cache_f) < $this->_refresh) || (filesize($_cache_f) == '0')) {
+               if ( (!file_exists($_cache_f)) || (filemtime($_cache_f) < $this->_refresh) || (filesize($_cache_f) == 0)) {
                        // We have to parse the remote file
                        $this->_use_cached_file = false;
                        // --> we want to provide proper Information for Use in
@@ -1385,7 +1385,7 @@ class fase4_rdf {
                                        }
                                        $i++;
                                }
-                               if ((count($dummy) > 0) && (count($reply) == '0') && (!$isContent)) {
+                               if ((count($dummy) > 0) && (count($reply) == 0) && (!$isContent)) {
                                        // Transfer content from dummy
                                        $reply = $content;
                                }
index c7cc26c7fae8ee02da7c98dd0d3e0e6d7f889995..77568f03380826e86581249321a966a92d884ee8 100644 (file)
@@ -135,6 +135,9 @@ Query string:<br />
 
 // SQL num rows
 function SQL_NUMROWS ($result) {
+       // Valid link resource?
+       if (!SQL_IS_LINK_UP()) return false;
+
        // Link is not up, no rows by default
        $lines = false;
 
@@ -145,9 +148,9 @@ function SQL_NUMROWS ($result) {
 
                // Is the result empty? Then we have an error!
                if (empty($lines)) $lines = '0';
-       } elseif (SQL_IS_LINK_UP()) {
-               // No resource given, no lines found!
-               $lines = '0';
+       } else {
+               // No resource given, please fix this
+               trigger_error('No resource given! result[]=' . gettype($result));
        }
 
        // Return lines
@@ -403,14 +406,14 @@ function SQL_ALTER_TABLE ($sql, $F, $L) {
 
                        // Do we have no entry on ADD or an entry on DROP?
                        // 123           4       4     3    3      4           4          32    23           4       4     3    3      4            4          321
-                       if (((SQL_NUMROWS($result) == '0') && (strpos($sql, 'ADD') !== false)) || ((SQL_NUMROWS($result) == 1) && (strpos($sql, 'DROP') !== false))) {
+                       if (((SQL_HASZERONUMS($result)) && (strpos($sql, 'ADD') !== false)) || ((SQL_NUMROWS($result) == 1) && (strpos($sql, 'DROP') !== false))) {
                                // Do the query
                                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Executing: ' . $sql);
                                $result = SQL_QUERY($sql, $F, $L, false);
 
                                // Skip further attempt(s)
                                break;
-                       } elseif ((((SQL_NUMROWS($result) == 1) && (strpos($sql, 'ADD') !== false)) || ((SQL_NUMROWS($result) == '0') && (strpos($sql, 'DROP') !== false))) && ($columnName != 'KEY')) {
+                       } elseif ((((SQL_NUMROWS($result) == 1) && (strpos($sql, 'ADD') !== false)) || ((SQL_HASZERONUMS($result)) && (strpos($sql, 'DROP') !== false))) && ($columnName != 'KEY')) {
                                // Abort here because it is alreay there
                                //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Skipped: ' . $sql);
                                break;
@@ -545,5 +548,11 @@ function SQL_IS_LINK_UP () {
        return $linkUp;
 }
 
+// Wrapper function to make code more readable
+function SQL_HASZERONUMS ($result) {
+       // Just pass it through
+       return (SQL_NUMROWS($result) === 0);
+}
+
 // [EOF]
 ?>
index a33aabce0f13c33ae093a8315cf57f4f0c3310e7..743f97281f7ba3a345559218d5eba0316139385f 100644 (file)
@@ -282,7 +282,7 @@ function registerExtension ($ext_name, $task_id, $dry_run = false, $logout = tru
                } // END - for
 
                // Is there no update?
-               if (countExtensionUpdateDependencies(getCurrentExtensionName()) == '0') {
+               if (countExtensionUpdateDependencies(getCurrentExtensionName()) == 0) {
                        // Then test is passed!
                        $test = true;
                } // END - if
diff --git a/inc/extensions/ext-report.php b/inc/extensions/ext-report.php
new file mode 100644 (file)
index 0000000..975f9dd
--- /dev/null
@@ -0,0 +1,97 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 03/10/2010 *
+ * ===================                          Last change: 03/10/2010 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-report.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Automated bug-reporting extension                *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Automatisierte Bugmelde-Erweiterung              *
+ * -------------------------------------------------------------------- *
+ * $Revision:: 856                                                    $ *
+ * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. March 2009)             $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author:: stelzi                                                   $ *
+ * Needs to be in all Files and every File needs "svn propset           *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       die();
+} // END - if
+
+// Version number
+setThisExtensionVersion('0.0');
+
+// Version history array (add more with , '0.1.0' and so on)
+setExtensionVersionHistory(array('0.0'));
+
+// This extension is in development (non-productive)
+enableExtensionProductive(false);
+
+switch (getExtensionMode()) {
+       case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
+               // SQL commands to run
+               break;
+
+       case 'remove': // Do stuff when removing extension
+               // SQL commands to run
+               break;
+
+       case 'activate': // Do stuff when admin activates this extension
+               // SQL commands to run
+               break;
+
+       case 'deactivate': // Do stuff when admin deactivates this extension
+               // SQL commands to run
+               break;
+
+       case 'update': // Update an extension
+               switch (getCurrentExtensionVersion()) {
+                       case '0.0.1': // SQL queries for v0.0.1
+                               addExtensionSql('');
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes('');
+                               break;
+               } // END - switch
+               break;
+
+       case 'modify': // When the extension got modified
+               break;
+
+       case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
+               break;
+
+       case 'init': // Do stuff when extension is initialized
+               break;
+
+       default: // Unknown extension mode
+               logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
+               break;
+} // END - switch
+
+// [EOF]
+?>
index 36d843b78d8582cbcfc4df3b2fa89d3c17cc79dd..a7a36334f8e61603a01017d486d8c7f26bd4d6c0 100644 (file)
@@ -754,7 +754,7 @@ function FILTER_COUNT_MODULE () {
 // Handles fatal errors
 function FILTER_HANDLE_FATAL_ERRORS () {
        // Do we have errors to handle and right output mode?
-       if ((getTotalFatalErrors() == '0') || (getOutputMode() != 0)) {
+       if ((!ifFatalErrorsDetected()) || (getOutputMode() != '0')) {
                // Abort executing here
                return false;
        } // END - if
index c45dc021bd2bcb9c67a6c271cd8389e319d8dc21..25150d184e5f416d5268c69772afbbfbca5e238c 100644 (file)
@@ -100,7 +100,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) {
                        if (empty($mysql['host']))   $mysql['host']   = 'localhost';
                        if (empty($mysql['prefix'])) $mysql['prefix'] = 'mxchange';
                        if (empty($mysql['type']))   $mysql['type']   = 'MyISAM';
-                       if (getTotalFatalErrors() > 0) {
+                       if (ifFatalErrorsDetected()) {
                                addToInstallContent('<div class="install_fatal">');
                                foreach (getFatalArray() as $key => $err) {
                                        addToInstallContent('<div class="para"><strong>&middot;</strong>&nbsp;{--FATAL_NO--}' . ($key + 1) . ':&nbsp;' . $err . '</div>');
@@ -203,7 +203,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) {
                                                        addFatalMessage(__FILE__, __LINE__, getMessage('INSTALL_MISSING_DUMPS'));
                                                } // END - if
 
-                                               if (getTotalFatalErrors() == '0') {
+                                               if (!ifFatalErrorsDetected()k) {
                                                        // Set type and prefix from POST data
                                                        setConfigEntry('_TABLE_TYPE'  , postRequestParameter('mysql', 'type'));
                                                        setConfigEntry('_MYSQL_PREFIX', postRequestParameter('mysql', 'prefix'));
@@ -228,7 +228,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) {
                                                        //* DEBUG: */ die('<pre>'.print_r(getSqls(), true).'</pre>');
 
                                                        // Are some SQLs found?
-                                                       if (countSqls() == '0') {
+                                                       if (countSqls() == 0) {
                                                                // Abort here
                                                                addFatalMessage(__FILE__, __LINE__, getMessage('INSTALL_SQL_IMPORT_FAILED'));
                                                                return;
@@ -243,7 +243,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) {
                                        } // END - if
                                } // END - if
 
-                               if (getTotalFatalErrors() > 0) {
+                               if (ifFatalErrorsDetected()) {
                                        $OUT = '';
                                        foreach (getFatalArray() as $value) {
                                                $OUT .= '    <li>' . $value . '</li>';
index f86d80446e3003863557f790cbc8e78204b76d2a..e0424383fbfd88db20236932c865e1ce6a130017 100644 (file)
@@ -431,7 +431,7 @@ function sendAdminsEmails ($subj, $template, $content, $userid) {
        // Check which admin shall receive this mail
        $result = SQL_QUERY_ESC("SELECT `admin_id` FROM `{?_MYSQL_PREFIX?}_admins_mails` WHERE `mail_template`='%s' ORDER BY `admin_id` ASC",
                array($template), __FUNCTION__, __LINE__);
-       if (SQL_NUMROWS($result) == '0') {
+       if (SQL_HASZERONUMS($result)) {
                // Create new entry (to all admins)
                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_admins_mails` (`admin_id`, `mail_template`) VALUES (0, '%s')",
                        array($template), __FUNCTION__, __LINE__);
index cc71ba6730669ebffa8508b023b073ccd10185da..b2e567049fd2773aeee6f26298f9b954f5c83329 100644 (file)
@@ -52,7 +52,7 @@ function getJackpotPoints () {
        $result = SQL_QUERY("SELECT `points` FROM `{?_MYSQL_PREFIX?}_jackpot` WHERE `ok`='ok' LIMIT 1", __FUNCTION__, __LINE__);
 
        // Do we have an entry?
-       if (SQL_NUMROWS($result) == '0') {
+       if (SQL_HASZERONUMS($result)) {
                // No, so create line
                SQL_QUERY("INSERT INTO `{?_MYSQL_PREFIX?}_jackpot` (`ok`, `points`) VALUES ('ok','0.00000')", __FUNCTION__, __LINE__);
        } else {
index 7f9b1dd359c6fc1bb20b0d92d017211af90f9285..db14350b4d8cd085bedb9a358eb5921cdfe6c8b2 100644 (file)
@@ -50,7 +50,7 @@ function updateMediadataEntry ($keys_array, $mode, $value) {
                        // First check if it does exist
                        $result_media = SQL_QUERY_ESC("SELECT media_key FROM `{?_MYSQL_PREFIX?}_mediadata`
 WHERE media_key = '%s' LIMIT 1", array($key), __FUNCTION__, __LINE__);
-                       if (SQL_NUMROWS($result_media) == '0') {
+                       if (SQL_NUMROWS($result_media) == 0) {
                                // Not found so we create it (mode will be ignored here!)
                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_mediadata` (media_key, media_value) VALUES ('%s', '%s')",
                                array($key, $value), __FUNCTION__, __LINE__);
index 0744b6b32c535c3083d4084007623ebc4d669a5a..59c1f0192f29f6005113ce91fa2cea04f8588a34 100644 (file)
@@ -86,7 +86,7 @@ function autostartReferalRallyes ($result) {
                // Check if line is already included...
                $result_ref = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_rallye_users` WHERE `rallye_id`=%s AND `userid`=%s LIMIT 1",
                        array(bigintval($id), bigintval($content['userid'])), __FUNCTION__, __LINE__);
-               if (SQL_NUMROWS($result_ref) == '0') {
+               if (SQL_NUMROWS($result_ref) == 0) {
                        // Free memory
                        SQL_FREERESULT($result_ref);
 
index ff6f2dbf4319ea3bc3104d91d2b9236749b25ba7..9278ccc5554807e2534dbfd703434e63bac77664 100644 (file)
@@ -218,7 +218,7 @@ function updateRefbackTable ($userid) {
 
                                // Do we have no entry?
                                //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):userid={$userid},level={$GLOBALS['refback_level']},ref={$GLOBALS['refback_refid'][$GLOBALS['refback_level']]},minus={$minus},numRows=".SQL_NUMROWS($result)." - FOUND!<br />");
-                               if (SQL_NUMROWS($result) == '0') {
+                               if (SQL_HASZERONUMS($result)) {
                                        // Insert this level
                                        //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):userid={$userid},level={$GLOBALS['refback_level']},ref={$GLOBALS['refback_refid'][$GLOBALS['refback_level']]} - ADD!<br />");
                                        SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_refs` (`userid`,`level`,`refid`) VALUES (%s,%s,%s)",
@@ -239,7 +239,7 @@ function updateRefbackTable ($userid) {
 
                                        // Do we have no entry?
                                        //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):userid={$userid},level=".($GLOBALS['refback_level']-$minus).",ref={$GLOBALS['refback_refid'][$GLOBALS['refback_level']]},numRows=".SQL_NUMROWS($result)." - BACK!<br />");
-                                       if (SQL_NUMROWS($result) == '0') {
+                                       if (SQL_HASZERONUMS($result)) {
                                                // Insert this level
                                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_refs` (`userid`,`level`,`refid`) VALUES (%s,%s,%s)",
                                                        array(bigintval($userid), ($GLOBALS['refback_level']-$minus), bigintval($GLOBALS['refback_refid'][$GLOBALS['refback_level']])), __FUNCTION__, __LINE__);
@@ -373,7 +373,7 @@ function updateMemberRefbackPercents ($id, $percents) {
        $dummy = getArrayFromUserRefbackData($id);
 
        // Is this valid?
-       if (count($dummy) == '0') {
+       if (count($dummy) == 0) {
                // id does not belong to user!
                $status['message'] = getMessage('MEMBER_REFBACK_ERROR_ID_MISMATCH');
                return $status;
index 5a50b7df0741121bac180c4c2b534d8017e23b75..d73f86568fe9d32b1e0f5aa40e7611e26cfb8d02 100644 (file)
@@ -381,7 +381,7 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF
        // @TODO Wether the registration bonus should only be added to user directly or through referal system should be configurable
        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid`=%s AND `ref_depth`=0 LIMIT 1",
                array($userid), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) == '0') {
+       if (SQL_HASZERONUMS($result)) {
                // Add only when the line was not found (maybe some more secure?)
                $locked = 'points';
 
index 354b33b3a44fb0aeac07ed0f7c66ab82198f9c86..e62d6835f0f7660b37a47a36306a4836e2eb3dbf 100644 (file)
@@ -109,7 +109,7 @@ function SURFBAR_ADMIN_UNLOCK_URL_IDS ($IDs) {
        } elseif (!is_array($IDs)) {
                // No array
                return false;
-       } elseif (count($IDs) == '0') {
+       } elseif (count($IDs) == 0) {
                // Empty array
                return false;
        }
@@ -136,7 +136,7 @@ function SURFBAR_ADMIN_REJECT_URL_IDS ($IDs) {
        } elseif (!is_array($IDs)) {
                // No array
                return false;
-       } elseif (count($IDs) == '0') {
+       } elseif (count($IDs) == 0) {
                // Empty array
                return false;
        }
@@ -553,12 +553,25 @@ function SURFBAR_GET_URL_DATA ($searchTerm, $column = 'id', $order = 'id', $sort
        } // END - if
 
        // Look up the record
-       $result = SQL_QUERY_ESC("SELECT id, userid, url, views_total, views_max, views_allowed, status, registered, last_locked, lock_reason, views_max, views_allowed, fixed_reload
-FROM `{?_MYSQL_PREFIX?}_surfbar_urls`
-WHERE %s='%s'".$add."
-ORDER BY %s %s
+       $result = SQL_QUERY_ESC("SELECT
+       `id`, `userid`, `url`,
+       `views_total`, `views_max`, `views_allowed`, `status`,
+       UNIX_TIMESTAMP(`registered`) AS `registered`, UNIX_TIMESTAMP(`last_locked`) AS `last_locked`, `lock_reason`,
+       `views_max`, `views_allowed`, `fixed_reload`
+FROM
+       `{?_MYSQL_PREFIX?}_surfbar_urls`
+WHERE
+       `%s`='%s'".$add."
+ORDER BY
+       `%s` %s
 %s",
-       array($column, $searchTerm, $order, $sort, $limit), __FUNCTION__, __LINE__);
+               array(
+                       $column,
+                       $searchTerm,
+                       $order,
+                       $sort,
+                       $limit
+               ), __FUNCTION__, __LINE__);
 
        // Is there at least one record?
        if (SQL_NUMROWS($result) > 0) {
@@ -640,14 +653,14 @@ function SURFBAR_INSERT_URL_BY_ARRAY ($urlData) {
 
        // Just run the insert query for now
        SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_urls` (userid,url,status,views_max,views_allowed,fixed_reload) VALUES (%s,'%s','%s',%s,%s,%s)",
-       array(
-       $userid,
-       $urlData['url'],
-       $urlData['status'],
-       $urlData['limit'],
-       $urlData['limit'],
-       $urlData['reload']
-       ), __FUNCTION__, __LINE__
+               array(
+                       $userid,
+                       $urlData['url'],
+                       $urlData['status'],
+                       $urlData['limit'],
+                       $urlData['limit'],
+                       $urlData['reload']
+               ), __FUNCTION__, __LINE__
        );
 
        // Return insert id
@@ -875,7 +888,7 @@ function SURFBAR_GET_TOTAL_URLS ($status = 'ACTIVE', $excludeUserId = '0') {
        $userids = SURFBAR_DETERMINE_DEPLETED_USERIDS();
 
        // If we dont get any user ids back, there are no URLs
-       if (count($userids['userid']) == '0') {
+       if (count($userids['userid']) == 0) {
                // No user ids found, no URLs!
                return 0;
        } // END - if
@@ -1245,7 +1258,7 @@ function SURFBAR_CHANGE_STATUS ($urlId, $prevStatus, $newStatus, $data=array())
        $newStatus = strtolower($newStatus);
 
        // Get URL data for status comparison if missing
-       if ((!is_array($data)) || (count($data) == '0')) {
+       if ((!is_array($data)) || (count($data) == 0)) {
                // Fetch missing URL data
                $data = SURFBAR_GET_URL_DATA($urlId);
        } // END - if
index ef00bd8e29f0b0e95dd936f6f8cff371a6f7812e..ab92eba1d2f2ff54cb2e28f4e38e02e311fb677b 100644 (file)
@@ -119,7 +119,7 @@ function YOOMEDIA_TEST_CONFIG ($data) {
        $errorCode = YOOMEDIA_GET_ERRORCODE_FROM_RESULT($response);
 
        // Log the response if failed
-       if (count($response) == '0') {
+       if (count($response) == 0) {
                // Queries depleted (as we count here!)
                logDebugMessage(__FUNCTION__, __LINE__, 'Requested depleted. Maxmimum was: ' . getConfig('yoomedia_requests_total'));
                $errorCode = -1;
index 76d9c6666c1b3979292b222b13ea4f75786613b0..914622a461b6ea7edb2b6a54fd1b1ea298295451 100644 (file)
@@ -52,7 +52,7 @@ function addAdminAccount ($adminLogin, $passHash, $adminEmail) {
                array($adminLogin), __FUNCTION__, __LINE__);
 
        // Is the entry there?
-       if (SQL_NUMROWS($result) == '0') {
+       if (SQL_HASZERONUMS($result)) {
                // Ok, let's create the admin login
                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_admins` (`login`, `password`, `email`) VALUES ('%s', '%s', '%s')",
                        array(
@@ -1091,7 +1091,7 @@ function sendAdminPasswordResetLink ($email) {
                array($email), __FUNCTION__, __LINE__);
 
        // Is there an account?
-       if (SQL_NUMROWS($result) == '0') {
+       if (SQL_HASZERONUMS($result)) {
                // No account found!
                return getMessage('ADMIN_NO_LOGIN_WITH_EMAIL');
        } // END - if
index d4346aa5e9e22434b0008dd2155a0c33b1930a42..0cb4d2e5aed861f8f4a74c3ca1ca2fe20e73ae7a 100644 (file)
@@ -54,7 +54,7 @@ if (isFormSent()) {
        $result = SQL_QUERY_ESC("SELECT id, admin_id FROM `{?_MYSQL_PREFIX?}_rallye_data` WHERE (start_time <= %s AND end_time >= %s) OR (start_time >= %s AND start_time <= %s) LIMIT 1",
                array($START, $START, $START, $END), __FILE__, __LINE__);
 
-       if (SQL_NUMROWS($result) == '0') {
+       if (SQL_HASZERONUMS($result)) {
                // Ok, start and end time did not overlap
                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_rallye_data` (admin_id, title, descr, template, start_time, end_time, auto_add_new_user, is_active, send_notify)
 VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s')",
index 31ad63e1806db83b9780ced5c6d0027713c825f4..97834713aeed8cd0b2dca186ad2742f7a9e843ba 100644 (file)
@@ -174,7 +174,7 @@ if ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0)) {
                        // Main or sub menu selected
                        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admins_acls` WHERE admin_id=%s AND action_menu='%s' AND what_menu='%s' LIMIT 1",
                                array(bigintval(postRequestParameter('admin_id')), postRequestParameter('action_menu'), postRequestParameter('what_menu')), __FILE__, __LINE__);
-                       if (SQL_NUMROWS($result) == '0') {
+                       if (SQL_HASZERONUMS($result)) {
                                // Finally add the new ACL
                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_admins_acls` (admin_id, action_menu, what_menu, access_mode)
 VALUES ('%s','%s','%s','%s')",
index 2d1e5051d41d8b3f3aa5d51433e26ccbf2abdd0a..691f063d763ee122cc218139cb86678ce9d691ea 100644 (file)
@@ -53,7 +53,7 @@ if (isPostRequestParameterSet('add')) {
        // Add a new category
        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `cat`='%s' LIMIT 1",
                array(postRequestParameter('catname')), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) == '0') {
+       if (SQL_HASZERONUMS($result)) {
                // Category does not exists, we simply add it...
                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_cats` (`cat`, `visible`, `sort`) VALUES ('%s','%s','%s')",
                        array(
index 8f571d60118c54ae8f4c1bf967fa6bc349aa49ba..8d45685920d25a00026d85a9d7878b632a7a0196 100644 (file)
@@ -52,7 +52,7 @@ if (isPostRequestParameterSet(('add_max'))) {
        // Save all settings
        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE value='%s' LIMIT 1",
        array(bigintval(postRequestParameter('max'))), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) == '0') {
+       if (SQL_HASZERONUMS($result)) {
                // Add this value (including comment)
                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_max_receive` (value, comment) VALUES ('%s','%s')",
                array(bigintval(postRequestParameter('max')), postRequestParameter('comment')),__FILE__, __LINE__);
index 3c98f73df6103d1a5f8daae3eb4fbccd31a105a0..20488564182465e58a60c31c4e252ca9392a8832 100644 (file)
@@ -123,7 +123,7 @@ if (isPostRequestParameterSet('edit')) {
        loadTemplate('admin_settings_saved', false, getMessage('MODS_CHANGED'));
 }
 
-if (countPostSelection() == '0') {
+if (countPostSelection() == 0) {
        // Load module data (We do not need to check if there's at least one...)
        $result = SQL_QUERY('SELECT id, module, locked, hidden, admin_only, title, mem_only
 FROM `{?_MYSQL_PREFIX?}_mod_reg`
index 395d6087e47d60fed2818869e2f6f54856a1ff0e..bda7aff95f6e3cbcf2492e1ac4e7f0e919aa71f8 100644 (file)
@@ -51,7 +51,7 @@ if ((isPostRequestParameterSet('add')) && (isPostRequestParameterSet('title')) &
        // Add new payout type
        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_payout_types` WHERE type='%s' LIMIT 1",
        array(postRequestParameter('title')), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) == '0') {
+       if (SQL_HASZERONUMS($result)) {
                // Add now
                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_payout_types`
 (type, rate, min_points, from_account, from_pass, engine_url, engine_ret_ok, engine_ret_failed, pass_enc, allow_url)
index a4aca48501450efc8bc62957f1f31c10786bb587..0d08a22550afdbf06d3483c14c718b9ac2672810 100644 (file)
@@ -53,7 +53,7 @@ if (isGetRequestParameterSet('rallye')) {
                        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s AND `price_level`='%s' LIMIT 1",
                        array(bigintval(getRequestParameter('rallye')), bigintval(postRequestParameter('level'))), __FILE__, __LINE__);
 
-                       if (SQL_NUMROWS($result) == '0') {
+                       if (SQL_HASZERONUMS($result)) {
                                // Ok, new price level entered!
                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_rallye_prices` (rallye_id, price_level, points, info)
 VALUES ('%s','%s','%s','%s')",
index 94a7c2238b85c7d4a8435f0e4542e3ada8d29a4b..a9403850a7f71d8f408bb2a1ab5cab0998a9e4b0 100644 (file)
@@ -323,7 +323,7 @@ ORDER BY `ext_name` ASC", __FILE__, __LINE__);
                                        // ... so we can finally register and load it in registration mode
                                        if (registerExtension($ext_name, $ext_id)) {
                                                // Errors?
-                                               if (getTotalFatalErrors() == '0') {
+                                               if (!ifFatalErrorsDetected()) {
                                                        // Extension was found and successfully registered
                                                        loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_EXTENSION_REGISTERED', $ext_name));
 
index 13f412d21236616031c567a2d7edbb293941a45e..3026a3fb245399138b47bb8649d678eeb93796a8 100644 (file)
@@ -50,7 +50,7 @@ if ((isPostRequestParameterSet('add')) && (isPostRequestParameterSet(('code')))
        // Check if country code does already exist
        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_countries` WHERE code='%s' LIMIT 1",
        array(strtoupper(postRequestParameter('code'))), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) == '0') {
+       if (SQL_HASZERONUMS($result)) {
                // Save entry
                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_countries` (code, descr, is_active) VALUES ('%s','%s','%s')",
                array(
index fe4ee1849aa608ea8d45b8e6d6735aaf3b758456..d57c721c5191c251afe604dc40d1c887ae8db2f7 100644 (file)
@@ -50,7 +50,7 @@ $message = '';
 if (isPostRequestParameterSet('add')) {
        // Check input variables
        if (!isPostRequestParameterSet('pay_name')) unsetPostRequestParameter('add');
-       if ((round(postRequestParameter('pay_rate')) == '0') || (!isPostRequestParameterSet('pay_rate'))) unsetPostRequestParameter('add');
+       if ((round(postRequestParameter('pay_rate')) == 0) || (!isPostRequestParameterSet('pay_rate'))) unsetPostRequestParameter('add');
 
        setPostRequestParameter('pay_min_count', bigintval(postRequestParameter('pay_min_count')));
 
@@ -115,7 +115,7 @@ if (isPostRequestParameterSet('add')) {
        // Check if entry with same name does exists
        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `pay_name`='%s' LIMIT 1",
                array(postRequestParameter('pay_name')), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) == '0') {
+       if (SQL_HASZERONUMS($result)) {
                // No entry found so add this line
                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_paytypes` (`pay_name`, `pay_rate`, `pay_min_count`, `pay_currency`) VALUES ('%s','%s','%s','%s')",
                        array(
index 5bc5655ec0c74fa41f79542cdfd6b42856719e24..076a5c306588907ded20e1b9f8db32f466b81d0c 100644 (file)
@@ -49,7 +49,7 @@ addMenuDescription('admin', __FILE__);
 $show = true;
 
 // Check for 'id' element
-if ((countRequestPost() > 0) && ((!isPostRequestParameterSet('id')) || (!is_array(postRequestParameter('id'))) || (count(postRequestParameter('id')) == '0'))) {
+if ((countRequestPost() > 0) && ((!isPostRequestParameterSet('id')) || (!is_array(postRequestParameter('id'))) || (count(postRequestParameter('id')) == 0))) {
        // Not found so output message
        loadTemplate('admin_settings_saved', false, getMessage('ADMIN_SURFBAR_NO_SELECTIONS'));
 
index 58d120c46bd399503b5649e26865940b92a65431..41aa282d7ff4ed4e0f90ddd70221198291020a77 100644 (file)
@@ -81,7 +81,7 @@ if (getConfig('yoomedia_requests_remain') == '0') {
 $result = YOOMEDIA_GET_PARSED_RESULT_TEXTMAILS();
 
 // Sanity-check on result array
-if ((!is_array($result)) || (count($result) == '0') || (!isset($result[0]['id']))) {
+if ((!is_array($result)) || (count($result) == 0) || (!isset($result[0]['id']))) {
        // Invalid result
        loadTemplate('admin_settings_saved', false, getMessage('ADMIN_YOOMEDIA_INVALID_RESULT'));
        return false;
index d2a0773b57123e572e06c7fefddab19d152d389f..1290113e3acb6bf2ddca18a82f90a23d5890fedb 100644 (file)
@@ -66,7 +66,7 @@ foreach ($DATA['tables'] as $row_array) {
                $OPT = getMessage('OPTIMIZE_STATUS_OPTIMIZED');
                $B1 = '<strong>'; $B2 = '<strong>';
                $gain_tabs++;
-       } elseif (count(explode(' ', $row_array[2])) == '0') {
+       } elseif (count(explode(' ', $row_array[2])) == 0) {
                $OPT = getMessage('OPTIMIZE_STATUS_' . strtoupper($row_array[2]).'');
        }
 
index 7cbaf8b46e41dcb15ad6f95b1a52e7980ac8b22f..71f5ad53c76844f68e79cc77775817ab77c9e67a 100644 (file)
@@ -59,7 +59,7 @@ if (isFormSent()) {
                        // Check if banner is already added
                        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_refbanner` WHERE url='%s' LIMIT 1",
                        array(postRequestParameter('url')), __FILE__, __LINE__);
-                       if (SQL_NUMROWS($result) == '0') {
+                       if (SQL_HASZERONUMS($result)) {
                                // Add banner
                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_refbanner` (url, alternate, visible)
 VALUES ('%s','%s','%s')",
index bba0aa2b9afc6447ca5659cff5136d92b58430dd..194a3a0ff1c635e52b22d5d654c603a78b039ee5 100644 (file)
@@ -179,7 +179,7 @@ LIMIT 1",
                        // Lookup in blacklist
                        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_url_blacklist` WHERE `url`='%s' LIMIT 1",
                                array($url), __FILE__, __LINE__);
-                       if (SQL_NUMROWS($result) == '0') {
+                       if (SQL_HASZERONUMS($result)) {
                                // Did not find a record so we can add it... :)
                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_url_blacklist` (`url`,`pool_id`) VALUES ('%s',%s)",
                                        array($url, $id), __FILE__, __LINE__);
index 62cca5a2383fdcd99fbab3ccefe91e742cddc05e..caa950e645b78557451d185eaf89168301672848 100644 (file)
@@ -136,7 +136,7 @@ if (isExtensionActive('nickname')) {
 // Was an URL constructed?
 if (!empty($URL)) {
        // URL was constructed
-       if (getTotalFatalErrors() > 0) {
+       if (ifFatalErrorsDetected()) {
                // Handle fatal errors
                runFilterChain('handle_fatal_errors');
        } else {
index 312627aac8639292e259eb6aea75edee6c49f161..f1ccf3837a93c83af396a725ba971937993a860b 100644 (file)
@@ -199,7 +199,7 @@ if (isFormSent()) {
        if (count($FORM_ERRORS) > 0) unsetPostRequestParameter('ok');
 }
 
-if ((isFormSent()) && (count($FORM_ERRORS) == '0')) {
+if ((isFormSent()) && (count($FORM_ERRORS) == 0)) {
        // Generate message array
        $messageArray = array(
                'failed' => getMessage('SPONSOR_REGISTRATION_FAILED'),
index a870b6ab1c2153dff60811241d4a44df759cd20c..86263f07e8c26a7856f574434f11be56c51f8fdd 100644 (file)
@@ -83,7 +83,7 @@ if ($cats > 0) {
                                        $result_user = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `userid`=%s AND `cat_id`=%s LIMIT 1",
                                                array(getMemberId(), bigintval($cat)), __FILE__, __LINE__);
 
-                                       if (SQL_NUMROWS($result_user) == '0') {
+                                       if (!SQL_HASZERONUMS($result_user)) {
                                                $sql = "INSERT INTO `{?_MYSQL_PREFIX?}_user_cats` (userid, cat_id) VALUES ('%s','%s')";
                                        } // END - if
 
index bd40a66b78226519a2e7ca046fc8763ca36c9b02..7a9e7b511447e4500b7b0f879c56f1101be9f766 100644 (file)
@@ -70,7 +70,7 @@ if ($isValid === true) {
        // Look for nickname in database (we only need just one entry so don't worry about the "LIMIT 1" !)
        $result = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `nickname`='%s' AND `userid` != '%s' LIMIT 1",
                array(postRequestParameter('nickname'), getMemberId()), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) == '0') {
+       if (SQL_HASZERONUMS($result)) {
                // Nickname not in use, so set it now
                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `nickname`='%s' WHERE `userid`=%s LIMIT 1",
                        array(postRequestParameter('nickname'), getMemberId()), __FILE__, __LINE__);
index 5889f82ce3a00b70bf164df588b80689397cc164..844664376662c9b69e68ffe2e2058b8f600e529a 100644 (file)
@@ -69,7 +69,7 @@ if ((isPostRequestParameterSet('edit')) && (isPostRequestParameterSet('id'))) {
                $percents = convertCommaToDot(postRequestParameter('percents'));
 
                // Validate percents
-               if ((($percents >= getConfig('refback_min_perc')) || (round($percents) == '0')) && ($percents <= getConfig('refback_max_perc'))) {
+               if ((($percents >= getConfig('refback_min_perc')) || (round($percents) == 0)) && ($percents <= getConfig('refback_max_perc'))) {
                        // Change ref-back for this direct id
                        $status = updateMemberRefbackPercents(postRequestParameter('id'), postRequestParameter('percents'));
 
index 2aedbdb8cf4a184929ffdf4ff3e81035af6b5c4e..44e848747020d5efa5fb0dd5cc999045bfc4bde4 100644 (file)
@@ -80,7 +80,7 @@ function getModuleTitle ($module) {
        if (empty($data['title'])) {
                // No name found
                $data['title'] = sprintf("%s (%s)", getMessage('LANG_UNKNOWN_MODULE'), $module);
-               if (SQL_NUMROWS($result) == '0') {
+               if ((is_resource($result)) && (SQL_HASZERONUMS($result))) {
                        // Add module to database
                        $dummy = checkModulePermissions($module);
                } // END - if
@@ -1044,7 +1044,7 @@ function removeReceiver (&$receivers, $key, $userid, $pool_id, $stats_id = '', $
                                array($rowName, $stats_id, bigintval($userid), $type), __FUNCTION__, __LINE__);
 
                        // Was it *not* found?
-                       if (SQL_NUMROWS($result) == '0') {
+                       if (SQL_HASZERONUMS($result)) {
                                // So we add one!
                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_links` (`%s`, `userid`, `link_type`) VALUES ('%s','%s','%s')",
                                        array($rowName, $stats_id, bigintval($userid), $type), __FUNCTION__, __LINE__);
index 0787499781074d5f8224850a9426b5185c07a7ff..d904d52758b135fc7c2b0b800601fac29dea639c 100644 (file)
@@ -131,7 +131,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                                                } // END - if
 
                                                // Do we have send maximum mails?
-                                               if (($GLOBALS['pool_cnt'] >= getConfig('max_send')) || (countSelection($dummy) == '0')) {
+                                               if (($GLOBALS['pool_cnt'] >= getConfig('max_send')) || (countSelection($dummy) == 0)) {
                                                        // Yes, we have
                                                        //* DEBUG: */ print("*EXIT/L:".__LINE__."<br />");
                                                        break;
@@ -151,7 +151,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
 
                        // Close sending system
                        //* DEBUG: */ print("-L:".__LINE__.'/'.countSelection($dummy)."-<br />");
-                       if (countSelection($dummy) == '0') {
+                       if (countSelection($dummy) == 0) {
                                // Queue reached!
                                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_bonus` SET `data_type`='SEND', `target_send`=0, `receivers`='' WHERE `id`=%s LIMIT 1",
                                array(bigintval($DATA['id'])), __FILE__, __LINE__);
index 1abf8a079befa926fe1ef1d5814885b319fe5a38..981c43d62e098349be589cac75fe026c6b42392a 100644 (file)
@@ -101,7 +101,7 @@ if (SQL_NUMROWS($result_main) > 0) {
 
                                        // If there's no stats entry add it!
                                        //* DEBUG: */ outputHtml("!L:".__LINE__.'/'.SQL_NUMROWS($result_stats)."!<br />");
-                                       if (SQL_NUMROWS($result_stats) == '0') {
+                                       if (SQL_NUMROWS($result_stats) == 0) {
                                                // No entry was found, so we add him!
                                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_stats` (`pool_id` , `userid`, `cat_id`, `payment_id`, `subject`, `url` , `max_rec` , `timestamp_ordered`, `timestamp_sstart`) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s' , UNIX_TIMESTAMP())",
                                                        array(bigintval($DATA['id']), bigintval($DATA['sender']), bigintval($DATA['cat_id']), bigintval($DATA['payment_id']), $DATA['subject'], $DATA['url'], $DATA['target_send'], bigintval($DATA['timestamp'])), __FILE__, __LINE__);
index bb570f585aeee4b92253ce8aef94166df8c36d45..4a07785f7d8b9128c38affbd70bcc1f0109de9cd 100644 (file)
@@ -873,5 +873,11 @@ function isInStringIgnoreCase ($needle, $haystack) {
        return (isInString(strtolower($needle), strtolower($haystack)));
 }
 
+// Wrapper to check for if fatal errors where detected
+function ifFatalErrorsDetected () {
+       // Just call the inner function
+       return (getTotalFatalErrors() > 0);
+}
+
 // [EOF]
 ?>
index 5415fc5fc2062cc8beac2382dcc442678c9fd5e3..06acf208cad76b145324cd45ff910610bf197afa 100644 (file)
@@ -68,7 +68,7 @@ if (isGetRequestParameterSet('mailid'))  $url_mid    = bigintval(getRequestParam
 if (isGetRequestParameterSet('bonusid')) $url_bid    = bigintval(getRequestParameter('bonusid'));
 
 // 01           1        12            2    2            21    1                   22     10
-if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErrors() == '0')) {
+if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDetected())) {
        // Init result
        $result_link = false;
 
index 38349b669cc7db5bfd3d73eb2df37f0d5659c1a6..ff1cecd9a49baebb0d4b6f54676f8b3e72271cb5 100644 (file)
@@ -74,7 +74,7 @@ if (isGetRequestParameterSet('code'))    $code       = bigintval(getRequestParam
 if (isGetRequestParameterSet('mode'))    $mode       = getRequestParameter('mode');
 
 // 01           1        12            2    2            21    1                   22     10
-if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErrors() == '0')) {
+if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDetected())) {
        // No image? Then output header
        if ($mode != 'img') loadIncludeOnce('inc/header.php');
 
index 9868be46fb946ee8c8709ce61f2c4babb2843e1e..f2d1639a6c88f7e1554c53df40caec2c1f67dcbd 100644 (file)
@@ -77,7 +77,7 @@ $check = 'failed';
 if ((isExtensionActive('maintenance')) && (getConfig('maintenance') == 'Y') && (!isAdmin()) && (getModule() != 'admin')) {
        // Maintain mode is active and you are no admin
        addFatalMessage(__FILE__, __LINE__, getMessage('LANG_DOWN_MAINTAINCE'));
-} elseif ((SQL_IS_LINK_UP()) && (getTotalFatalErrors() == '0')) {
+} elseif ((SQL_IS_LINK_UP()) && (!ifFatalErrorsDetected())) {
        // Construct module name
        $GLOBALS['module_inc'] =  sprintf("inc/modules/%s.php", getModule());
 
@@ -89,10 +89,10 @@ if ((isExtensionActive('maintenance')) && (getConfig('maintenance') == 'Y') && (
                case 'mem_only': // Member-only access
                case 'done': // All fine!
                        // Does the module exists on local file system?
-                       if ((isIncludeReadable($GLOBALS['module_inc'])) && (getTotalFatalErrors() == '0')) {
+                       if ((isIncludeReadable($GLOBALS['module_inc'])) && (!ifFatalErrorsDetected())) {
                                // Module is valid, active and located on the local disc...
                                $isModuleValid = true;
-                       } elseif (getTotalFatalErrors() == '0') {
+                       } elseif (!ifFatalErrorsDetected()) {
                                // Module not found!
                                addFatalMessage(__FILE__, __LINE__, getMaskedMessage('LANG_MOD_REG_404', getModule()));
                        }
@@ -117,7 +117,7 @@ if ((isExtensionActive('maintenance')) && (getConfig('maintenance') == 'Y') && (
                        addFatalMessage(__FILE__, __LINE__, getMaskedMessage('LANG_MOD_REG_UNKNOWN', $check));
                        break;
        } // END - switch
-} elseif (getTotalFatalErrors() == '0') {
+} elseif (!ifFatalErrorsDetected()) {
        // MySQL problems!
        addFatalMessage(__FILE__, __LINE__, getMessage('MYSQL_ERRORS'));
 }
diff --git a/templates/de/html/ext/ext_report.tpl b/templates/de/html/ext/ext_report.tpl
new file mode 100644 (file)
index 0000000..d662bc4
--- /dev/null
@@ -0,0 +1,24 @@
+<div class="para">
+Lassen Sie das Script automatisiert Bug-Mails an mich schicken! Was Sie dazu
+brauchen ist noch nicht mal ein API-Key oder dergleichen. Installieren Sie
+dazu einfach diese Erweiterung und die Mails gehen in Kopie an mich raus.
+Sollten Sie diese Funktionalit&auml;t nicht mehr w&uuml;nschen, so deaktivieren
+Sie einfach die Erweiterung. Alternativ k&ouml;nnen Sie diese auch einfach
+wieder deinstallieren.
+</div>
+
+<div class="para">
+<strong>Wichtig:</strong> Es werden dabei (fast) keine Daten Ihrer Mitglieder
+oder von Ihren Administratorenaccounts gesendet! Es werden die
+Browserbezeichnung und die IP-Adresse sowie den Bug-Report selbst an mich
+geschickt. Sie k&ouml;nnen dies allerdings verhindern, in dem Sie es einfach im
+Adminbereich abschalten, dann wird ein Bindestrich als Browserbezeichnung bzw.
+0.0.0.0 als IP an mich gesendet.
+</div>
+
+<div class="para">
+Die Daten aus den Bugs werden stets vertraulich behandelt und unterliegen den
+aktuellen Datenschutzgesetzen. Es erfolgt ausnahmelos keine Weitergabe oder
+Weiterleitung in jeglicher Form an Dritte.
+</div>
+