// Entry not found, points set and not logged in?
//* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'SQL_HASZERONUMS()=' . intval(SQL_HASZERONUMS($result)) . ',isAdmin()=' . intval(isAdmin()) . ',points=' . $points . ',isMember()=' . intval(isMember()) . ',getBegPayMode()=' . getBegPayMode());
- if ((ifSqlHasZeroNums($result)) && ($points > 0) && (getBegPayMode() == 'NONE') && ((!isMember()) || (isAdmin()))) {
+ if ((ifSqlHasZeroNumRows($result)) && ($points > 0) && (getBegPayMode() == 'NONE') && ((!isMember()) || (isAdmin()))) {
// Default is result from isAdmin(), mostly false
$isPayed = isAdmin();
ORDER BY
`userid` ASC", __FILE__, __LINE__);
-if (!ifSqlHasZeroNums($result_bonus)) {
+if (!ifSqlHasZeroNumRows($result_bonus)) {
// We found some mail orders...
while ($content = sqlFetchArray($result_bonus)) {
// Add points
`d`.`userid` ASC",
array($day, $month), __FILE__, __LINE__);
-if (!ifSqlHasZeroNums($result_birthday)) {
+if (!ifSqlHasZeroNumRows($result_birthday)) {
// Start sending out birthday mails
while ($content = sqlFetchArray($result_birthday)) {
// Calculate own timestamp for birthday and today
__FILE__, __LINE__);
// Entries found?
-if (!ifSqlHasZeroNums($result_main)) {
+if (!ifSqlHasZeroNumRows($result_main)) {
// Init SQLs
initSqls();
`userid` ASC", __FILE__, __LINE__);
// Are there some notifications to sent?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// We need to send-out notifications...
while ($content = sqlFetchArray($result)) {
// Translate timestamp
`userid` ASC", __FILE__, __LINE__);
//* DEBUG: */ debugOutput(basename(__FILE__) . ':payout=0;daily|numRows=' . sqlNumRows($result_daily));
-if (!ifSqlHasZeroNums($result_daily)) {
+if (!ifSqlHasZeroNumRows($result_daily)) {
// Init SQLs
initSqls();
), __FILE__, __LINE__);
//* DEBUG: */ debugOutput(basename(__FILE__) . ':payout=0;points|numRows=' . sqlNumRows($result_points));
- if (!ifSqlHasZeroNums($result_points)) {
+ if (!ifSqlHasZeroNumRows($result_points)) {
// Ok transfer points
while ($content2 = sqlFetchArray($result_points)) {
// Merge both arrays
`filter_id` ASC', __FUNCTION__, __LINE__);
// Are there entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Load all filters
while ($filterArray = sqlFetchArray($result)) {
// Get filter name and function
), __FUNCTION__, __LINE__);
// Are there entries left?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Load all names
while ($content = sqlFetchArray($result)) {
// Merge the $filterData array in
array(getMemberId()), __FUNCTION__, __LINE__);
// There should be entries left
- assert(!ifSqlHasZeroNums($result));
+ assert(!ifSqlHasZeroNumRows($result));
// Load all
$out = '';
`filter_function` ASC', __FILE__, __LINE__);
// Are there entries? (there should be!)
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// Load row by row
while ($filter = sqlFetchArray($result)) {
// Now search again for this filter and get it's total count
// Sanity-check: Is there ref level 0? If so, this must be fixed to NULL and `level` must be increased by one
$result = sqlQuery('SELECT `id` FROM `{?_MYSQL_PREFIX?}_refsystem` WHERE `level`=0', __FILE__, __LINE__);
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// Remove index temporaly
sqlQueryAlterTable('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` DROP INDEX `userid_level`', __FILE__, __LINE__);
`userid` ASC', __FILE__, __LINE__);
// Are there entries?
-if (!ifSqlHasZeroNums($result_direct)) {
+if (!ifSqlHasZeroNumRows($result_direct)) {
// When 'walk' through all users
while ($content = sqlFetchArray($result_direct)) {
// Update refback table
`userid` ASC', __FILE__, __LINE__);
// Are there entries? (there should be!)
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// Load row by row
while ($row = sqlFetchArray($result)) {
// Update the database again
array($template), __FUNCTION__, __LINE__);
// No entries found?
- if (ifSqlHasZeroNums($result)) {
+ if (ifSqlHasZeroNumRows($result)) {
// Is ext-admins' version at least 0.7.9?
if (isExtensionInstalledAndNewer('admins', '0.7.9')) {
// Create new entry (to all admins)
// Load rankings
$result = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_bonus_turbo` WHERE `%s`=%s ORDER BY `level` ASC LIMIT {?bonus_lines?}",
array($type, $data), __FUNCTION__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Output all ranks (levels)
for ($rank = 1; $rank <= sqlNumRows($result); $rank++) {
// Load data
$limit
), __FUNCTION__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// List entries
$OUT = '';
while ($content = sqlFetchArray($result)) {
`forced_ads_id` ASC', __FUNCTION__, __LINE__);
// Is there at least one entry?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Get all elements
while ($content = sqlFetchArray($result)) {
// Add it
`forced_costs_id` ASC", __FUNCTION__, __LINE__);
// Is there at least one entry?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Get all elements
while ($content = sqlFetchArray($result)) {
// Add it
), __FUNCTION__, __LINE__);
// Is there at least one entry?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Get all elements
while ($content = sqlFetchArray($result)) {
// Add it
`holiday_end` <= UNIX_TIMESTAMP()
ORDER BY
`userid` ASC", __FUNCTION__, __LINE__);
- if (!ifSqlHasZeroNums($result_stop)) {
+ if (!ifSqlHasZeroNumRows($result_stop)) {
// We foud at least one
$admin = '';
$result = sqlQuery("SELECT `points` FROM `{?_MYSQL_PREFIX?}_jackpot` WHERE `ok`='ok' LIMIT 1", __FUNCTION__, __LINE__);
// Is there an entry?
- if (ifSqlHasZeroNums($result)) {
+ if (ifSqlHasZeroNumRows($result)) {
// No, so create line
sqlQuery("INSERT INTO `{?_MYSQL_PREFIX?}_jackpot` (`ok`, `points`) VALUES ('ok','0.00000')", __FUNCTION__, __LINE__);
} else {
array(bigintval($networkId)), __FUNCTION__, __LINE__);
// Is there an entry?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Then add all
while ($row = sqlFetchArray($result)) {
// Add it with new index as it is no longer required
), __FUNCTION__, __LINE__);
// Are there records?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Load all but make new indexes as the old are not required
while ($row = sqlFetchArray($result)) {
// Add it
`network_short_name` ASC', __FUNCTION__, __LINE__);
// Are there entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// List all entries
$rows = array();
while ($row = sqlFetchArray($result)) {
), __FUNCTION__, __LINE__);
// Are there entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// List all entries
$rows = array();
while ($row = sqlFetchArray($result)) {
`t`.`network_type_handler` ASC', __FUNCTION__, __LINE__);
// Are there entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// List all entries
$rows = array();
while ($row = sqlFetchArray($result)) {
`network_array_sort` ASC', __FUNCTION__, __LINE__);
// Are there entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Get all entries
while ($row = sqlFetchArray($result)) {
// Add it to our global array
array(bigintval(getRequestElement('network_id'))), __FUNCTION__, __LINE__);
// Are there entries?
- if (ifSqlHasZeroNums($result)) {
+ if (ifSqlHasZeroNumRows($result)) {
// No, then abort here
displayMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_SET_ALL_404--}');
return;
array(bigintval(getRequestElement('network_id'))), __FUNCTION__, __LINE__);
// Are there entries?
- if (ifSqlHasZeroNums($result)) {
+ if (ifSqlHasZeroNumRows($result)) {
// No, then abort here
displayMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_SET_ALL_404--}');
return;
$ret['tables'] = array();
// Are there entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Fetch all rows
while ($row = sqlFetchArray($result)) {
$tot_data = $row['Data_length'];
array($points), __FUNCTION__, __LINE__);
// Some entries found?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Init output
$OUT = '';
array(bigintval($content['id']), bigintval($content['userid'])), __FUNCTION__, __LINE__);
// Is there an entry?
- if (ifSqlHasZeroNums($result_ref)) {
+ if (ifSqlHasZeroNumRows($result_ref)) {
// Add userid and his ref count to table
$result_ref = sqlQueryEscaped("SELECT
SUM(`p`.`points`) AS `points`
array($rallye), __FUNCTION__, __LINE__);
// Entries found?
- if (!ifSqlHasZeroNums($result_prices)) {
+ if (!ifSqlHasZeroNumRows($result_prices)) {
// Load prices
$prices = '';
if ($mode == PHP_EOL) {
), __FUNCTION__, __LINE__);
// Is this user added?
- if (ifSqlHasZeroNums($result)) {
+ if (ifSqlHasZeroNumRows($result)) {
// Add userid and his ref count to table
sqlQueryEscaped("INSERT INTO
`{?_MYSQL_PREFIX?}_rallye_users`
`expired`='Y'",
array($EXPIRE), __FUNCTION__, __LINE__);
- if (!ifSqlHasZeroNums($result_rallye)) {
+ if (!ifSqlHasZeroNumRows($result_rallye)) {
// Init SQLs
initSqls();
// Entries found?
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'numRows=' . sqlNumRows($result));
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Add all
while ($content = sqlFetchArray($result)) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refid=' . convertNullToZero($refid) . ',level=' . $level . ',userid=' . $content['userid']);
array(bigintval($userid), bigintval($level)), __FUNCTION__, __LINE__);
// Are there some entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Fetch all entries
while ($row = sqlFetchArray($result)) {
// Calculate click rate
`sort` ASC',
__FUNCTION__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// List alle visible modules (or all to the admin)
$OUT .= '<table border="0" cellspacing="0" cellpadding="0" width="100%">';
while ($content = sqlFetchArray($result)) {
" . $WHERE . "
ORDER BY
`sort` ASC", __FUNCTION__, __LINE__);
- if (!ifSqlHasZeroNums($result_main)) {
+ if (!ifSqlHasZeroNumRows($result_main)) {
// Load every menu and it's sub menus
while ($content = sqlFetchArray($result_main)) {
// Load sub menus
ORDER BY
`sort` ASC",
array($content['main_action']), __FUNCTION__, __LINE__);
- if (!ifSqlHasZeroNums($result_sub)) {
+ if (!ifSqlHasZeroNumRows($result_sub)) {
// Load sub menus
$SUB = '';
while ($content2 = sqlFetchArray($result_sub)) {
), __FUNCTION__, __LINE__);
// Is there at least one record?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Then load all!
while ($dataRow = sqlFetchArray($result)) {
// Shall we group these results?
array(getMemberId()), __FUNCTION__, __LINE__);
// Are there entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Load all rows
while ($row = sqlFetchArray($result)) {
// Add the row
array($status), __FUNCTION__, __LINE__);
// Some entries there?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Load all actions
// @TODO This can be somehow rewritten
while ($content = sqlFetchArray($result)) {
$content['bottom'] = 'bottom';
} // END - if
- if ((!ifSqlHasZeroNums($result)) && (!empty($WHATs[$key]))) {
+ if ((!ifSqlHasZeroNumRows($result)) && (!empty($WHATs[$key]))) {
if (empty($TITLEs[$key])) {
$TITLEs[$key] = '{--ADMIN_TASK_UNKNOWN_LIST_TITLE--}';
} // END - if
array($hash), __FILE__, __LINE__);
// One result should be found
- if (ifSqlHasZeroNums($result)) {
+ if (ifSqlHasZeroNumRows($result)) {
// Nothing found or tried to confirm twice?
displayMessage('{--GUEST_CONFIRMED_TWICE--}');
return;
// Check for accounts to be notified
$result_main = sqlQuery($sql, __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result_main)) {
+
+ if (!ifSqlHasZeroNumRows($result_main)) {
// Normal notification mails or bonus mails?
$sentBonusMails = ((getBegNotifyBonus() > 0) && ($mode == 'enable') && (isExtensionActive('bonus')));
// Check for accounts to be notified
$result_main = sqlQuery($sql, __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result_main)) {
+
+ if (!ifSqlHasZeroNumRows($result_main)) {
// Okay lets notify all users!
while ($content = sqlFetchArray($result_main)) {
// Update account
} else {
// No name found
$data['title'] = '{%message,UNKNOWN_MODULE_DETECTED_TITLE=' . $module . '%}';
- if ((is_resource($result)) && (ifSqlHasZeroNums($result))) {
+ if ((is_resource($result)) && (ifSqlHasZeroNumRows($result))) {
// Add module to database and ignore return value
checkModulePermissions($module);
} // END - if
array($adminLogin), __FUNCTION__, __LINE__);
// Is the entry there?
- if (ifSqlHasZeroNums($result)) {
+ if (ifSqlHasZeroNumRows($result)) {
// Is ext-admins installed and version at least 0.3.0?
if (isExtensionInstalledAndNewer('admins', '0.3.0')) {
// Ok, let's create the admin login
`id` DESC", __FUNCTION__, __LINE__);
// Are there entries?
- if (!ifSqlHasZeroNums($result_main)) {
+ if (!ifSqlHasZeroNumRows($result_main)) {
$OUT .= '<ul class="admin_menu_main">';
// Load all 'action' menus
array($mainContent['main_action']), __FUNCTION__, __LINE__);
// Remember the count for later checks
- setAdminMenuHasEntries($mainContent['main_action'], ((!ifSqlHasZeroNums($result_what)) && (($action == $mainContent['main_action']) || (isAdminMenuJavascriptEnabled()))));
+ setAdminMenuHasEntries($mainContent['main_action'], ((!ifSqlHasZeroNumRows($result_what)) && (($action == $mainContent['main_action']) || (isAdminMenuJavascriptEnabled()))));
// Start li-tag for sub menu content
$OUT .= '<li class="admin_menu_sub" id="action_menu_' . $mainContent['main_action'] . '"' . addStyleMenuContent('admin', $mainContent['main_action'], $action) . '>';
$SUB = TRUE;
// Are there entries?
- if (!ifSqlHasZeroNums($result_what)) {
+ if (!ifSqlHasZeroNumRows($result_what)) {
// Start HTML code
$OUT .= '<ul class="admin_menu_sub">';
$result = sqlQueryEscaped("SELECT `%s` AS `menu`, `title` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$what." ORDER BY `sort` ASC",
array($mode), __FUNCTION__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Load menu as selection
$OUT = '<select name="' . $mode . '_menu';
if (!isValidId($defid)) $OUT .= '[' . intval($defid) . ']';
array($email), __FUNCTION__, __LINE__);
// Is there an account?
- if (ifSqlHasZeroNums($result)) {
+ if (ifSqlHasZeroNumRows($result)) {
// No account found
return '{--ADMIN_NO_LOGIN_WITH_EMAIL--}';
} // END - if
`task_created` DESC",
array(getCurrentAdminId()), __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result_tasks)) {
+ if (!ifSqlHasZeroNumRows($result_tasks)) {
// New jobs found
$jobsDone = FALSE;
} // END - if
$result = sqlQueryEscaped("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 (ifSqlHasZeroNums($result)) {
+ if (ifSqlHasZeroNumRows($result)) {
// Ok, start and end time did not overlap
sqlQueryEscaped("INSERT INTO
`{?_MYSQL_PREFIX?}_rallye_data`
// Get all available main menus
$result = sqlQuery("SELECT `action`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC", __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Read menu structure
// @TODO Cant this be rewritten?
while ($content = sqlFetchArray($result)) {
foreach ($menus as $key_main => $value_main) {
$result = sqlQueryEscaped("SELECT `what`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC",
array($value_main), __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Init arrays
$menus[$value_main] = array();
$titles[$value_main] = array();
$result = sqlQuery("SELECT `id`, `action`, `what`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." ORDER BY `sort` ASC", __FILE__, __LINE__);
// Are there entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Init variables
$OUT = '';
$count = '0';
`m`.`admin_id` ASC,
`m`.`mail_template` ASC", __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Shall I change entries?
if (isFormSent('do_edit')) {
// Init SQLs
`imprint_id` ASC', __FILE__, __LINE__);
// Are there entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Load all entries
$OUT = '';
while ($content = sqlFetchArray($result)) {
), __FUNCTION__, __LINE__);
// Are there entries left?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Init row output
$OUT = '';
// Add new payout type
$result = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_payout_types` WHERE type='%s' LIMIT 1",
array(postRequestElement('title')), __FILE__, __LINE__);
- if (ifSqlHasZeroNums($result)) {
+ if (ifSqlHasZeroNumRows($result)) {
// Add now
sqlQueryEscaped("INSERT INTO
`{?_MYSQL_PREFIX?}_payout_types`
ORDER BY
`type` ASC', __FILE__, __LINE__);
-if ((!ifSqlHasZeroNums($result_type)) && ($display)) {
+if ((!ifSqlHasZeroNumRows($result_type)) && ($display)) {
// List all payout types
$OUT = '';
while ($content = sqlFetchArray($result_type)) {
} // END - if
// Does your members request payouts?
-if ((!ifSqlHasZeroNums($result_mem)) && ($display === TRUE)) {
+if ((!ifSqlHasZeroNumRows($result_mem)) && ($display === TRUE)) {
// Members has requested payouts
displayMessage('<a href="{%url=modules.php?module=admin&what=list_payouts%}">{--ADMIN_PAYOUT_LIST_REQUESTS--}</a>');
} elseif ($display === TRUE) {
} // END - if
} // END - if
-// We only need outgoing transfers
+$total = '0';
+
+// Only out-going transfers are needed
$result = sqlQuery('SELECT
`userid` AS `from_userid`,
`to_userid`,
ORDER BY
`trans_id` ASC', __FILE__, __LINE__);
-$total = '0';
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// Output rows
$OUT = '';
while ($content = sqlFetchArray($result)) {
`timestamp` ASC', __FILE__, __LINE__);
// Entries found?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// There are mail orders available
$OUT = '';
while ($content = sqlFetchArray($result)) {
// Free the result which we don't need
sqlFreeResult($result_maximum);
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// Mail orders are in pool so we can display them
// Add navigation table rows
sqlFreeResult($result_normal);
$MAIL = FALSE;
-if (!ifSqlHasZeroNums($result_list)) {
+if (!ifSqlHasZeroNumRows($result_list)) {
// Init rows
$OUT = '';
$MAIL = TRUE;
if ((isExtensionActive('bonus')) && (empty($WHO))) {
// Only check if bonus extension is active
- if (!ifSqlHasZeroNums($result_bonus)) outputHtml('<br /><br />');
+ if (!ifSqlHasZeroNumRows($result_bonus)) outputHtml('<br /><br />');
} // END - if
} // END - if
if ((isExtensionActive('bonus')) && (empty($WHO))) {
// Load bonus mails only when extension is active
- if (!ifSqlHasZeroNums($result_bonus)) {
+ if (!ifSqlHasZeroNumRows($result_bonus)) {
// Calculate pages
$numPages = round(sqlNumRows($result_bonus) / getMailsPage() + 0.5);
}
// Are there some entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Extensions are registered
$OUT = '';
while ($content = sqlFetchArray($result)) {
(`what`='' OR `what` IS NULL)
ORDER BY
`sort` ASC", __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result_menu)) {
+
+ if (!ifSqlHasZeroNumRows($result_menu)) {
// Read menu structure
// @TODO Cant this be rewritten?
while ($content = sqlFetchArray($result_menu)) {
`what` IS NOT NULL
ORDER BY `sort` ASC",
array($value_main), __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+
+ if (!ifSqlHasZeroNumRows($result)) {
// Initialize arrays
$menus[$value_main] = array();
$titles[$value_main] = array();
}
// Are there entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Init variables
$count = '0';
$OUT = '';
postRequestElement('action_menu'),
postRequestElement('what_menu')
), __FILE__, __LINE__);
- if (ifSqlHasZeroNums($result)) {
+ if (ifSqlHasZeroNumRows($result)) {
// Finally add the new ACL
sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_admins_acls` (
`admin_id`,
`id` ASC', __FILE__, __LINE__);
// Entries found?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// List ACLs
$OUT = '';
while ($content = sqlFetchArray($result)) {
ORDER BY
`d`.`userid` ASC", __FILE__, __LINE__);
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// Ok, we have found some inactive accounts
$OUT = '';
while ($content = sqlFetchArray($result)) {
`id` ASC', __FILE__, __LINE__);
// Is there at lease one package?
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// List all packages
$OUT = '';
while ($content = sqlFetchArray($result)) {
`last_online` DESC,
`userid` ASC", __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// List users
$OUT = ''; $count = 1; $total = '0';
while ($content = sqlFetchArray($result)) {
`last_online` DESC,
`userid` ASC", __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// List users
$OUT = '';
$count = 1;
$CATS = '';
if (isFormSent('add')) {
+ // Default message
+ $content = '<span class="bad">{--CATEGORY_ALREADY_EXISTS--}</span>';
+
// Add a new category
$result = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `cat`='%s' LIMIT 1",
array(postRequestElement('catname')), __FILE__, __LINE__);
- if (ifSqlHasZeroNums($result)) {
+
+ if (ifSqlHasZeroNumRows($result)) {
// Category does not exists, we simply add it...
sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_cats` (`cat`, `visible`, `sort`) VALUES ('%s','%s','%s')",
array(
postRequestElement('visible'),
bigintval(postRequestElement('parent') + 1)
), __FILE__, __LINE__);
+
+ // Category has been added
$content = '{--CATEGORY_ADDED--}';
- } else {
- // Category does already exists
- $content = '<span class="bad">{--CATEGORY_ALREADY_EXISTS--}</span>';
- }
+ } // END - if
// Free memory
sqlFreeResult($result);
$CATS = '';
// Load all categories
- $result = sqlQuery("SELECT `id`, `cat`, `visible`, `sort` FROM `{?_MYSQL_PREFIX?}_cats` ORDER BY `sort` ASC", __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ $result = sqlQuery("SELECT
+ `id`,
+ `cat`,
+ `visible`,
+ `sort`
+FROM
+ `{?_MYSQL_PREFIX?}_cats`
+ORDER BY
+ `sort` ASC", __FILE__, __LINE__);
+
+ if (!ifSqlHasZeroNumRows($result)) {
// Init variables
$OUT = '';
// Check if country code does already exist
$result = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_countries` WHERE `code`='%s' LIMIT 1",
array(strtoupper(postRequestElement('code'))), __FILE__, __LINE__);
- if (ifSqlHasZeroNums($result)) {
+ if (ifSqlHasZeroNumRows($result)) {
// Save entry
sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_countries` (`code`, `descr`, `is_active`) VALUES ('%s','%s','%s')",
array(
__FILE__, __LINE__);
// Are there entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// List all countries
$OUT = '';
while ($content = sqlFetchArray($result)) {
), __FILE__, __LINE__);
// Are there entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Init variable
$OUT = '';
`d`.`id` ASC', __FILE__, __LINE__);
// Are there entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Init variable
$OUT = '';
// Save all settings
$result = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE value='%s' LIMIT 1",
array(bigintval(postRequestElement('max'))), __FILE__, __LINE__);
- if (ifSqlHasZeroNums($result)) {
+ if (ifSqlHasZeroNumRows($result)) {
// Add this value (including comment)
sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_max_receive` (`value`, `comment`) VALUES ('%s','%s')",
array(bigintval(postRequestElement('max')), postRequestElement('comment')),__FILE__, __LINE__);
} else {
$result = sqlQuery("SELECT `id`, `value`, `comment` FROM `{?_MYSQL_PREFIX?}_max_receive` ORDER BY `value` ASC",
__FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// List already existing entries for editing
$OUT = '';
while ($content = sqlFetchArray($result)) {
ORDER BY
`h`.`userid` ASC", __FILE__, __LINE__);
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// List all holiday requests
$OUT = '';
while ($content = sqlFetchArray($result)) {
), __FILE__, __LINE__);
// Are there some entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Some unconfirmed mails left
if (getRequestElement('delete') == 'all') {
// Delete all unconfirmed mails by this user
), __FILE__, __LINE__);
// Are there entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// List all entries
$OUT = '';
while ($row = sqlFetchArray($result)) {
`network_short_name` ASC', __FILE__, __LINE__);
// Are there entries?
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// List all
$OUT = '';
while ($content = sqlFetchArray($result)) {
array(bigintval(getRequestElement('network_id'))), __FILE__, __LINE__);
// Are there entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// List all entries
$OUT = '';
while ($row = sqlFetchArray($result)) {
array(bigintval(getRequestElement('network_id'))), __FILE__, __LINE__);
// Are there entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// List all entries
$OUT = '';
while ($row = sqlFetchArray($result)) {
// Add limitation
if (!empty($SQL2)) $SQL2 .= $add;
-if ((isExtensionActive('bonus')) && (!ifSqlHasZeroNums($result_max)) && (!empty($SQL2))) {
+if ((isExtensionActive('bonus')) && (!ifSqlHasZeroNumRows($result_max)) && (!empty($SQL2))) {
// Run SQL query for notification mails
$result_bonus = sqlQuery($SQL2, __FILE__, __LINE__);
// Load bonus mails only when extension is active
- if (!ifSqlHasZeroNums($result_bonus)) {
+ if (!ifSqlHasZeroNumRows($result_bonus)) {
// Calculate pages
$numPages = round(sqlNumRows($result_bonus) / getMailsPage() + 0.5);
ORDER BY
`p`.`payout_timestamp` DESC', __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// List found payouts
$OUT = '';
while ($content = sqlFetchArray($result)) {
$result = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s AND `price_level`='%s' LIMIT 1",
array(bigintval(getRequestElement('rallye_id')), bigintval(postRequestElement('level'))), __FILE__, __LINE__);
- if (ifSqlHasZeroNums($result)) {
+ if (ifSqlHasZeroNumRows($result)) {
// Ok, new price level entered!
sqlQueryEscaped("INSERT INTO
`{?_MYSQL_PREFIX?}_rallye_prices`
$result = sqlQueryEscaped("SELECT `id`, `price_level`, `points`, `info` FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s ORDER BY `price_level` ASC",
array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Load all prices for the selected rallye
$OUT = '';
while ($content = sqlFetchArray($result)) {
`d`.`admin_id`=`a`.`id`
ORDER BY
`d`.`start_time` DESC", __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// List found rallyes
$OUT = '';
while ($content = sqlFetchArray($result)) {
ORDER BY
`userid` ASC",
array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
$OUT = '';
$content['rallye_id'] = bigintval(getRequestElement('rallye_id'));
while ($row = sqlFetchArray($result)) {
`start_time` DESC", __FILE__, __LINE__);
// Records found?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// List found rallyes
$OUT = '';
while ($data = sqlFetchArray($result)) {
`level` ASC", __FILE__, __LINE__);
// Are there some levels (VERY BAD IF NONE!)
- if (!ifSqlHasZeroNums($result_levels)) {
+ if (!ifSqlHasZeroNumRows($result_levels)) {
// List all ref levels or entries if no refback is installed
$OUT = '';
while ($levels = sqlFetchArray($result_levels)) {
//* DEBUG: */ debugOutput($userid.'/'.$levels['level'].'/'.sqlNumRows($result_refs));
// Is there levels?
- if (!ifSqlHasZeroNums($result_refs)) {
+ if (!ifSqlHasZeroNumRows($result_refs)) {
// Count entries
$totalReferrals = getUsersTotalReferrals($userid, $levels['level']);
$totalLockedReferrals = getUsersTotalLockedReferrals($userid, $levels['level']);
`id` ASC",
array(bigintval(getRequestElement('refid'))), __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// List refs now
// Free memory
sqlFreeResult($result);
ORDER BY
`id` ASC", __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result_main)) {
+ if (!ifSqlHasZeroNumRows($result_main)) {
// At least one sponsor found
$OUT = '';
while ($content = sqlFetchArray($result_main)) {
// Check if entry with same name does exists
$result = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `pay_name`='%s' LIMIT 1",
array(postRequestElement('pay_name')), __FILE__, __LINE__);
- if (ifSqlHasZeroNums($result)) {
+ if (ifSqlHasZeroNumRows($result)) {
// No entry found so add this line
sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_paytypes` (`pay_name`, `pay_rate`, `pay_min_count`, `pay_currency`) VALUES ('%s','%s','%s','%s')",
array(
__FILE__, __LINE__);
// Are there some payment types setup?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Prepare variables for listing
$OUT = '';
// Add description as navigation point
addYouAreHereLink('admin', __FILE__);
-// We only need outgoing transfers
+$total = '0';
+
+// Only out-going transfers are needed
$result = sqlQuery('SELECT
`userid` AS `from_userid`,
`to_userid`,
ORDER BY
`trans_id` ASC', __FILE__, __LINE__);
-$total = '0';
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// Output rows
$OUT = '';
while ($content = sqlFetchArray($result)) {
),__FILE__, __LINE__);
// Are there entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// At least one link left to confirm
$OUT = '';
while ($row = sqlFetchArray($result)) {
$result = sqlQuery($sql, __FILE__, __LINE__);
// Are there some entries?
- if (!ifSqlHasZeroNums($result_master)) {
+ if (!ifSqlHasZeroNumRows($result_master)) {
// Sorting links and number of pages
$templateContent['sort_links'] = addSortLinks(getRequestElement('letter'), getRequestElement('sortby'));
$templateContent['num_pages'] = $numPages;
`p`.`userid` ASC', __FILE__, __LINE__);
// Are there entries? (sorry, the XML functions cannot "produce" the above SQL statement)
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// Init amounts and points
$totalPoints = '0';
$amounts = array();
$content['email'] = '<a href="' . generateEmailLink($content['email'], 'user_data') . '">{%pipe,translateGender=' . $content['gender'] . '%} ' . $content['surname'] . ' ' . $content['family'] . '</a>';
// Ok, list categories of this user
- $result_cats = sqlQuery("SELECT `id`, `cat` FROM `{?_MYSQL_PREFIX?}_cats` ORDER BY `sort` ASC", __FILE__, __LINE__);
+ $result_cats = sqlQuery("SELECT
+ `id`,
+ `cat`
+FROM
+ `{?_MYSQL_PREFIX?}_cats`
+ORDER BY
+ `sort` ASC", __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result_cats)) {
+ if (!ifSqlHasZeroNumRows($result_cats)) {
// List categories
$count = 1; $OUT = '';
while ($row = sqlFetchArray($result_cats)) {
__FILE__, __LINE__);
// Are there some entries to display?
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// List all entries
$OUT = '';
while ($content = sqlFetchArray($result)) {
// Get all available main menus
$result = sqlQuery("SELECT `action`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC",
__FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Read menu structure
// @TODO Cant this be rewritten?
while ($content = sqlFetchArray($result)) {
foreach ($menus as $key_main => $value_main) {
$result = sqlQueryEscaped("SELECT `what`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='%s' AND `what` != '' ORDER BY `sort` ASC",
array($value_main), __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Initialize arrays
$menus[$value_main] = array();
$titles[$value_main] = array();
}
// Some are there?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
$count = '0'; $OUT = '';
while ($content = sqlFetchArray($result)) {
// Set sub value
`{?_MYSQL_PREFIX?}_payments`
ORDER BY
`time` ASC", __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+
+ if (!ifSqlHasZeroNumRows($result)) {
// Make referral levels editable and deletable
$OUT = '';
array(postRequestElement('url')), __FILE__, __LINE__);
// Was the banner found?
- if (ifSqlHasZeroNums($result)) {
+ if (ifSqlHasZeroNumRows($result)) {
// Add banner
sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_refbanner` (`url`, `alternate`, `visible`)
VALUES ('%s','%s','%s')",
$result = sqlQuery('SELECT `id`, `url`, `alternate`, `visible`, `counter`, `clicks` FROM `{?_MYSQL_PREFIX?}_refbanner` ORDER BY `url` ASC', __FILE__, __LINE__);
// Entries found?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Make referral banner editable and deletable
$OUT = '';
while ($content = sqlFetchArray($result)) {
// Go through all categories
$result = sqlQuery("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_cats` GROUP BY `userid` ORDER BY `userid` ASC", __FILE__, __LINE__);
-if (!ifSqlHasZeroNums($result)) {
+
+if (!ifSqlHasZeroNumRows($result)) {
// Nothing is removed for now... ;-)
$removedRows = '0';
__FILE__, __LINE__);
// Are there entries left?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Convert timestamp selections
$expirationTime = time() + createEpocheTimeFromSelections('coupon_default_time', postRequestArray());
`nl_receive`='Y'
ORDER BY
`userid` ASC", __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+
+ if (!ifSqlHasZeroNumRows($result)) {
// Members are available so we can send out the newsletter!
while ($content = sqlFetchArray($result)) {
// Construct mail...
array(bigintval(getRequestElement('url_id'))), __FILE__, __LINE__);
// Entries found?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Get all rows
$OUT = ''; $count = '0'; $visits = '0';
while ($content = sqlFetchArray($result)) {
`stats_userid` ASC", __FILE__, __LINE__);
// Entries found?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Get all rows
$OUT = ''; $urlArray = '0'; $visits = '0';
while ($content = sqlFetchArray($result)) {
ORDER BY
`theme_path` ASC", __FILE__, __LINE__);
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
while ($content = sqlFetchArray($result)) {
// Is the theme readable?
if (isThemeReadable($content['theme_path'])) {
ORDER BY
`timestamp` ASC", __FILE__, __LINE__);
-if ((!ifSqlHasZeroNums($result_main)) || (isFormSent('lock'))) {
+if ((!ifSqlHasZeroNumRows($result_main)) || (isFormSent('lock'))) {
if (isFormSent('accept')) {
if (ifPostContainsSelections()) {
// Accept mail orders
ORDER BY
`sp`.`pay_name` ASC",
array($content['id']), __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Payment does exist
while ($content2 = sqlFetchArray($result)) {
// Merge both arrays
ORDER BY
`id`", __FILE__, __LINE__);
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// Entries found so let's list them!
$OUT = '';
while ($content = sqlFetchArray($result)) {
loadTemplate('admin_mini_online', FALSE, $content);
// Check for online users
- $result = sqlQuery("SELECT `id`, `ip`, `userid`, `refid`, `module`, `action`, `what`, `is_member`, `is_admin`, `timestamp` FROM `{?_MYSQL_PREFIX?}_online` ORDER by `timestamp` DESC",
- __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ $result = sqlQuery("SELECT
+ `id`,
+ `ip`,
+ `userid`,
+ `refid`,
+ `module`,
+ `action`,
+ `what`,
+ `is_member`,
+ `is_admin`,
+ `timestamp`
+FROM
+ `{?_MYSQL_PREFIX?}_online`
+ORDER BY
+ `timestamp` DESC", __FILE__, __LINE__);
+
+ if (!ifSqlHasZeroNumRows($result)) {
// List all online users
$OUT = '';
while ($row = sqlFetchArray($result)) {
LIMIT {?active_limit?}", __FILE__, __LINE__);
// Entries found?
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// At least one member was online so let's load them all
$OUT = '';
while ($content = sqlFetchArray($result)) {
ORDER BY
`m`.`sort` ASC", __FILE__, __LINE__);
-if (!ifSqlHasZeroNums($result_act)) {
+if (!ifSqlHasZeroNumRows($result_act)) {
// Load all actions
while ($content = sqlFetchArray($result_act)) {
// Load row template and switch color
} // END - while
// Check for pay types
- $result_pay = sqlQuery('SELECT `pay_name`, `pay_rate`, `pay_min_count`, `pay_currency` FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` ORDER BY `pay_name` ASC', __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result_pay)) {
+ // @TODO Cache this static data
+ $result_pay = sqlQuery('SELECT
+ `pay_name`,
+ `pay_rate`,
+ `pay_min_count`,
+ `pay_currency`
+FROM
+ `{?_MYSQL_PREFIX?}_sponsor_paytypes`
+ORDER BY
+ `pay_name` ASC', __FILE__, __LINE__);
+
+ if (!ifSqlHasZeroNumRows($result_pay)) {
// Load all pay types
while ($content = sqlFetchArray($result_pay)) {
// Load row template and switch color
`{?_MYSQL_PREFIX?}_sponsor_paytypes`
ORDER BY
`pay_name` ASC', __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+
+ if (!ifSqlHasZeroNumRows($result)) {
// Load all types...
$OUT = '';
while ($content = sqlFetchArray($result)) {
$mem_t10 = sqlQuery('SELECT `counter`, `title` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `counter` > 0' . $AND . ' ORDER BY `counter` DESC LIMIT 0,10', __FILE__, __LINE__);
$OUT = '';
- if (!ifSqlHasZeroNums($guest_t10)) {
+ if (!ifSqlHasZeroNumRows($guest_t10)) {
// Guest clicks
$OUT .= loadTemplate('guest_stats_header', TRUE, '{--GUEST_TOP_GUEST_STATS--}');
while ($content = sqlFetchArray($guest_t10)) {
} // END - while
} // END - if
- if (!ifSqlHasZeroNums($mem_t10)) {
+ if (!ifSqlHasZeroNumRows($mem_t10)) {
// Member clicks
$OUT .= loadTemplate('guest_stats_header', TRUE, '{--GUEST_TOP_MEMBER_STATS--}');
while ($content = sqlFetchArray($mem_t10)) {
// Reset temporary variable and check for users
$OUT = '';
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// Load our winners...
$count = 1;
while ($content = sqlFetchArray($result)) {
// Reset temporary variable and check for users
$OUT = '';
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// Load our winners...
$count = 1;
while ($content = sqlFetchArray($result)) {
if (isAdmin()) $whereStatement = '';
// Get all categories
-$result = sqlQuery('SELECT `id`, `cat` FROM `{?_MYSQL_PREFIX?}_cats`' . $whereStatement . ' ORDER BY `sort` ASC', __FILE__, __LINE__);
+$result = sqlQuery('SELECT
+ `id`,
+ `cat`
+FROM
+ `{?_MYSQL_PREFIX?}_cats`
+' . $whereStatement . '
+ORDER BY
+ `sort` ASC', __FILE__, __LINE__);
// Are there entries?
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
$LEAST = FALSE;
if (isFormSent()) {
$count = '0';
`d`.`earning_sorting` ASC', __FILE__, __LINE__);
// Are there entries?
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// Init output
$OUT = '';
`u`.`cashed_on` DESC", array(getMemberId()), __FILE__, __LINE__);
// Are there entries?
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// Init variable
$OUT = '';
), __FILE__, __LINE__);
// Is it not in use?
- if (ifSqlHasZeroNums($result)) {
+ if (ifSqlHasZeroNumRows($result)) {
// Prepare array
$filterData = array(
'history_subject' => 'NICKNAME_CHANGED',
`sort` ASC', __FILE__, __LINE__);
// Some categories found?
- if (!ifSqlHasZeroNums($result_cats)) {
+ if (!ifSqlHasZeroNumRows($result_cats)) {
// Enought points left?
if ($totalPoints > 0) {
// Initialize array...
$result = sqlQuery("SELECT `id`, `price`, `payment`, `mail_title` FROM `{?_MYSQL_PREFIX?}_payments` WHERE `price` > 0 AND `payment` > 0 ORDER BY `payment` ASC", __FILE__, __LINE__);
$payments = array();
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Is the error code set?
if (isGetRequestElementSet('code')) {
// Display error message
array($payoutPoints), __FILE__, __LINE__);
// Some entries found?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Check for his payouts
$result_payouts = sqlQueryEscaped('SELECT
`p`.`id`,
ORDER BY
`p`.`payout_timestamp` DESC',
array(getMemberId()), __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result_payouts)) {
+ if (!ifSqlHasZeroNumRows($result_payouts)) {
// List all his requests
$OUT = '';
while ($content = sqlFetchArray($result_payouts)) {
`r`.`level` ASC', __FILE__, __LINE__);
// Are there some entries? (Shall be!)
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// List all levels
$OUT = '';
while ($content = sqlFetchArray($result)) {
$result = sqlQuery('SELECT `id`, `url`, `alternate`, `counter`, `clicks` FROM `{?_MYSQL_PREFIX?}_refbanner` ORDER BY `id` ASC', __FILE__, __LINE__);
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// List available ref banners
$OUT = '';
while ($row = sqlFetchArray($result)) {
`level` ASC', __FILE__, __LINE__);
// Are there some entries? (Shall be!)
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// List all levels
$OUT = '';
while ($content = sqlFetchArray($result)) {
array(getMemberId()), __FILE__, __LINE__);
// Are there mails left in pool?
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// Load all orders
$OUT = '';
while ($content = sqlFetchArray($result)) {
`timestamp_ordered` DESC',
array(getMemberId()), __FILE__, __LINE__);
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// Mail orders are in pool so we can display them
$OUT = '';
while ($content = sqlFetchArray($result)) {
$result = sqlQueryEscaped("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `status`='CONFIRMED'" . runFilterChain('user_exclusion_sql', ' ') . " AND `opt_in`='Y' AND `userid` != '%s' ORDER BY `userid` ASC",
array(getMemberId()), __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Load list
$OUT = '<select name="to_userid" size="1" class="form_select">
<option value="0">{--SELECT_NONE--}</option>';
$result = sqlQueryEscaped($sql, array(getMemberId()), __FILE__, __LINE__);
// Are there entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
$OUT = '';
while ($content = sqlFetchArray($result)) {
// Rewrite points, out is subtracted
array(getMemberId()), __FILE__, __LINE__);
$total = '0';
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Output rows
$OUT = '';
while ($content = sqlFetchArray($result)) {
}
// Mails left for confirmation?
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
// Please confirm these mails!
$sum = '0'; $OUT = '';
`d`.`userid` ASC
LIMIT {?beg_ranks?}", __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result_main)) {
+ if (!ifSqlHasZeroNumRows($result_main)) {
// Load our winners...
while ($content = sqlFetchArray($result_main)) {
// Add points to user's account directly
LIMIT {?bonus_ranks?}', __FILE__, __LINE__);
// Some entries were found?
- if (!ifSqlHasZeroNums($result_main)) {
+ if (!ifSqlHasZeroNumRows($result_main)) {
// Load our winners...
while ($content = sqlFetchArray($result_main)) {
// Make sure zero points are not mailed
array($mode), __FUNCTION__, __LINE__);
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'main_cnt=' . $main_cnt . ',getWhat()=' . getWhat());
- if (!ifSqlHasZeroNums($result_main)) {
+ if (!ifSqlHasZeroNumRows($result_main)) {
// There are menus available, so we simply display them... :)
$GLOBALS['rows'] = '';
while ($content = sqlFetchArray($result_main)) {
), __FUNCTION__, __LINE__);
// Are there some entries?
- if (!ifSqlHasZeroNums($result_sub)) {
+ if (!ifSqlHasZeroNumRows($result_sub)) {
// Init counter
$count = '0';
}
// Some entries are found?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
$OUT = '';
while ($content = sqlFetchArray($result)) {
$OUT .= ' <option value="' . $content['value'] . '"';
$ret = (!ifSqlHasZeroAffectedRows());
} else {
// Check found rows
- $ret = (!ifSqlHasZeroNums($result));
+ $ret = (!ifSqlHasZeroNumRows($result));
}
// Free memory
// Is the category id set?
if (!isValidId($cid)) {
// No category
- $data['cat'] = '{--_CATEGORY_NONE--}';
- } elseif (isValidId($cid)) {
- // Lookup the category in database
- $result = sqlQueryEscaped('SELECT `cat` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `id`=%s LIMIT 1',
- array(bigintval($cid)), __FUNCTION__, __LINE__);
- if (sqlNumRows($result) == 1) {
- // Category found... :-)
- $data = sqlFetchArray($result);
- } // END - if
+ return '{--_CATEGORY_NONE--}';
+ } // END - if
- // Free result
- sqlFreeResult($result);
+ // Lookup the category in database
+ $result = sqlQueryEscaped('SELECT `cat` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `id`=%s LIMIT 1',
+ array(bigintval($cid)), __FUNCTION__, __LINE__);
+
+ if (sqlNumRows($result) == 1) {
+ // Category found... :-)
+ $data = sqlFetchArray($result);
} // END - if
+ // Free result
+ sqlFreeResult($result);
+
// Return result
return $data['cat'];
}
), __FUNCTION__, __LINE__);
// Was it *not* found?
- if (ifSqlHasZeroNums($result)) {
+ if (ifSqlHasZeroNumRows($result)) {
// So we add one!
sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_user_links` (`%s`, `userid`, `link_type`) VALUES (%s,%s,'%s')",
array(
), __FUNCTION__, __LINE__);
// Is there rows?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Found data so add them as OPTION lines
while ($content = sqlFetchArray($result)) {
// Is extra set?
__FUNCTION__, __LINE__);
// Are there entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// ... and begin loading stuff
while ($content = sqlFetchArray($result)) {
// Transfer some data
);
// Are there entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Now load all userids for one big query!
$userids = array();
while ($data = sqlFetchArray($result)) {
$result = sqlQuery($sql, __FUNCTION__, __LINE__);
// Are there some URLs left?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// List all URLs
$OUT = '';
while ($row = sqlFetchArray($result)) {
$rows = array();
// Are there entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Load all entries
while ($row = sqlFetchArray($result)) {
array_push($rows, $row);
`timestamp` DESC", __FILE__, __LINE__);
// Some mails left?
- if (!ifSqlHasZeroNums($result_main)) {
+ if (!ifSqlHasZeroNumRows($result_main)) {
// Init SQLs here
initSqls();
$count_back = array(0);
$pointsBack = array(0);
-if (!ifSqlHasZeroNums($result_main)) {
+if (!ifSqlHasZeroNumRows($result_main)) {
// Parse all mails
while ($mailData = sqlFetchArray($result_main)) {
// Set mail order as 'active'. That means it will be sent out
// If there's no stats entry add it!
//* DEBUG: */ debugOutput('!L:'.__LINE__.'/'.sqlNumRows($result_stats).'!');
- if (ifSqlHasZeroNums($result_stats)) {
+ if (ifSqlHasZeroNumRows($result_stats)) {
// No entry was found, so we add him!
sqlQueryEscaped("INSERT INTO
`{?_MYSQL_PREFIX?}_user_stats`
(UNIX_TIMESTAMP() - `timestamp_ordered`) >= {?auto_purge?}
ORDER BY
`userid` ASC', __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Start deleting procedure
$userid = NULL;
$points = '0';
if (isExtensionActive('bonus', TRUE)) {
// Check for bonus campaigns
$result = sqlQuery("SELECT `id`, `points` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `data_type`='SEND' AND `timestamp` <= {?auto_purge?} ORDER BY `id` ASC", __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Start deleting procedure
$points = '0';
while ($content = sqlFetchArray($result)) {
// Check if confirmation links are purged or not
$result_links = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s",
array(bigintval($content['id'])), __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result_links)) {
+ if (!ifSqlHasZeroNumRows($result_links)) {
// At least one link was found, enougth to pay back the points
$points += $content['points'] * sqlNumRows($result_links);
ORDER BY
`userid` ASC", __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result_inactive)) {
+ if (!ifSqlHasZeroNumRows($result_inactive)) {
// Prepare variables and constants...
$userids = array();
$content['since'] = (getApInactiveSince() / 60 / 60);
ORDER BY
`userid` ASC", __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result_inactive)) {
+ if (!ifSqlHasZeroNumRows($result_inactive)) {
// Prepare userid array for admin...
$userids = array();
$deletedStats = '0';
// Is there "purged" mails?
-if (!ifSqlHasZeroNums($result_mails)) {
+if (!ifSqlHasZeroNumRows($result_mails)) {
// Okay, check for their sender's
while ($content = sqlFetchArray($result_mails)) {
// Check now...
`userid` ASC", __FILE__, __LINE__);
// Is there "purged" mails?
-if (!ifSqlHasZeroNums($result_mails)) {
+if (!ifSqlHasZeroNumRows($result_mails)) {
// Okay, check for their sender's
while ($content = sqlFetchArray($result_mails)) {
// Check now...
(UNIX_TIMESTAMP() - `task_created`) >= {?ap_tasks_time?}", __FILE__, __LINE__);
// Send out a notification?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Init output and load all rows
$output = ''; $ids = array();
while ($row = sqlFetchArray($result)) {
(UNIX_TIMESTAMP() - `joined`) >= {?ap_unconfirmed_time?}
ORDER BY
`userid` ASC", __FILE__, __LINE__);
- if (!ifSqlHasZeroNums($result_uncon)) {
+ if (!ifSqlHasZeroNumRows($result_uncon)) {
// Prepare variable...
$userids = '';
$content['time'] = (getApUnconfirmedTime() / 60 / 60);
), __FUNCTION__, __LINE__);
// Are there some entries?
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Fetch all entries
while ($row = sqlFetchArray($result)) {
// Init click rate with zero
}
// Wrapper function to make code more readable
-function ifSqlHasZeroNums ($result) {
+function ifSqlHasZeroNumRows ($result) {
// Just pass it through
return (sqlNumRows($result) === 0);
}
} // END - if
// Determine it
- $doesExist = (!ifSqlHasZeroNums($result));
+ $doesExist = (!ifSqlHasZeroNumRows($result));
// Free result
sqlFreeResult($result);
$result = sqlQuery('SHOW ENGINES', __FUNCTION__, __LINE__);
// Are there entries? (Bad if not)
- if (!ifSqlHasZeroNums($result)) {
+ if (!ifSqlHasZeroNumRows($result)) {
// Load all and check for active entries
while ($content = sqlFetchArray($result)) {
// Debug message