} // END - if
// User id valid and not webmaster's id?
- if ((getUserData('userid') > 0) && (getConfig('beg_userid') != getUserData('userid'))) {
+ if ((isValidUserId(getUserData('userid'))) && (getConfig('beg_userid') != getUserData('userid'))) {
// Update counter
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `beg_clicks`=`beg_clicks`+1 WHERE `userid`=%s LIMIT 1",
array(getUserData('userid')), __FILE__, __LINE__);
// Entry not found, points set and not logged in?
if (((SQL_HASZERONUMS($result)) || (isAdmin())) && ($points > 0) && (!isMember()) && (getConfig('beg_pay_mode') == 'NONE')) {
-
// Admin is testing?
if (!isAdmin()) {
// Remember remote address, userid and timestamp for next click
incrementConfigEntry('doubler_points', $points);
// Add second line for the referal but only when userid != refid
- if ((determineReferalId() > 0) && (determineReferalId() != getUserData('userid'))) {
+ if ((isValidUserId(determineReferalId())) && (determineReferalId() != getUserData('userid'))) {
// Okay add a refid line and apply refid percents
SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_doubler` (`userid`, `refid`, `points`, `remote_ip`, `timemark`, `completed`, `is_ref`) VALUES ('%s',0,'%s','".detectRemoteAddr()."',UNIX_TIMESTAMP(),'N','Y')",
array(
s.timestamp_ordered <= (UNIX_TIMESTAMP() - {?auto_purge?})
ORDER BY
s.userid ASC", __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Start deleting procedure
$userid = '0'; $points = '0';
while ($content = SQL_FETCHARRAY($result)) {
if (isExtensionActive('bonus', true)) {
// Check for bonus campaigns
$result = SQL_QUERY("SELECT `id`, `points` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `data_type`='SEND' AND `timestamp` <= {?auto_purge?} ORDER BY `id` ASC", __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Start deleting procedure
$points = '0';
while ($content = SQL_FETCHARRAY($result)) {
// Check if confirmation links are purged or not
$result_links = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s",
array(bigintval($content['id'])), __FILE__, __LINE__);
- if (SQL_NUMROWS($result_links) > 0) {
+ if (!SQL_HASZERONUMS($result_links)) {
// At least one link was found, enougth to pay back the points
$points += $content['points'] * SQL_NUMROWS($result_links);
// Init exclusion list
// @TODO Rewrite these if() blocks to a filter
$EXCLUDE_LIST = '';
- if (getConfig('def_refid') > 0) {
- $EXCLUDE_LIST = ' AND d.`userid` != {?def_refid?}';
- } // END - if
-
+ if (isValidUserId(getConfig('def_refid'))) $EXCLUDE_LIST .= ' AND d.`userid` != {?def_refid?}';
// Check for more extensions
if (isExtensionActive('beg')) $EXCLUDE_LIST .= ' AND d.`userid` != {?beg_userid?}';
if (isExtensionActive('bonus')) $EXCLUDE_LIST .= ' AND d.`userid` != {?bonus_userid?}';
getApInactiveSince()
), __FILE__, __LINE__);
- if (SQL_NUMROWS($result_inactive) > 0) {
+ if (!SQL_HASZERONUMS($result_inactive)) {
// Prepare variables and constants...
$useridsContent = '';
$content['since'] = (getApInactiveSince() / 60 / 60);
ORDER BY
`userid` ASC", __FILE__, __LINE__);
- if (SQL_NUMROWS($result_inactive) > 0) {
+ if (!SQL_HASZERONUMS($result_inactive)) {
// Prepare variable...
$useridsContent = '';
$deletedStats = '0';
// Do we have "purged" mails?
-if (SQL_NUMROWS($result_mails) > 0) {
+if (!SQL_HASZERONUMS($result_mails)) {
// Okay, check for their sender's
while ($content = SQL_FETCHARRAY($result_mails)) {
// Check now...
`userid` ASC", __FILE__, __LINE__);
// Do we have "purged" mails?
-if (SQL_NUMROWS($result_mails) > 0) {
+if (!SQL_HASZERONUMS($result_mails)) {
// Okay, check for their sender's
while ($content = SQL_FETCHARRAY($result_mails)) {
// Check now...
`status`='UNCONFIRMED' AND `joined` < (UNIX_TIMESTAMP() - {?ap_unconfirmed_time?})
ORDER BY
`userid` ASC", __FILE__, __LINE__);
- if (SQL_NUMROWS($result_uncon) > 0) {
+ if (!SQL_HASZERONUMS($result_uncon)) {
// Prepare variable...
$userids = '';
$content['time'] = (getConfig('ap_unconfirmed_time') / 60 / 60);
`filter_id` ASC", __FUNCTION__, __LINE__);
// Are there entries?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Load all filters
while ($filterArray = SQL_FETCHARRAY($result)) {
// Get filter name and function
`filter_name` ASC, `filter_function` ASC', __FILE__, __LINE__);
// Do we have entries? (we should have!)
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// Load row by row
while ($filter = SQL_FETCHARRAY($result)) {
// Now search again for this filter and get it's total count
$useProxy = false;
// Are proxy settins set?
- if ((isConfigEntrySet('proxy_host')) && (getConfig('proxy_host') != '') && (isConfigEntrySet('proxy_port')) && (getConfig('proxy_port') > 0)) {
+ if (isProxyUsed()) {
// Then use it
$useProxy = true;
} // END - if
} elseif (isGetRequestParameterSet('ref')) {
// Set refid=ref (the referal link uses such variable)
$GLOBALS['refid'] = secureString(getRequestParameter('ref'));
- } elseif ((isSessionVariableSet('refid')) && (getSession('refid') > 0)) {
+ } elseif ((isSessionVariableSet('refid')) && (isValidUserId(getSession('refid')))) {
// Set session refid als global
$GLOBALS['refid'] = bigintval(getSession('refid'));
} elseif ((isExtensionInstalledAndNewer('user', '0.3.4')) && (isRandomReferalIdEnabled())) {
// Select a random user which has confirmed enougth mails
$GLOBALS['refid'] = determineRandomReferalId();
- } elseif ((isExtensionInstalledAndNewer('sql_patches', '0.1.2')) && (getConfig('def_refid') > 0)) {
+ } elseif ((isExtensionInstalledAndNewer('sql_patches', '0.1.2')) && (isValidUserId(getConfig('def_refid')))) {
// Set default refid as refid in URL
$GLOBALS['refid'] = getConfig('def_refid');
} else {
}
// Set cookie when default refid > 0
- if (!isSessionVariableSet('refid') || (!empty($GLOBALS['refid'])) || ((getSession('refid') == '0') && (isConfigEntrySet('def_refid')) && (getConfig('def_refid') > 0))) {
+ if (!isSessionVariableSet('refid') || (!empty($GLOBALS['refid'])) || ((!isValidUserId(getSession('refid'))) && (isConfigEntrySet('def_refid')) && (isValidUserId(getConfig('def_refid'))))) {
// Default is not found
$found = false;
// Sanity-check: Do we have ref level 0?
$result = SQL_QUERY("SELECT `id` FROM `{?_MYSQL_PREFIX?}_refsystem` WHERE `level`=0", __FILE__, __LINE__);
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// Remove index temporaly
SQL_ALTER_TABLE("ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` DROP INDEX `userid_level`", __FILE__, __LINE__);
u.userid ASC', __FILE__, __LINE__);
// Do we have entries?
-if (SQL_NUMROWS($result_direct) > 0) {
+if (!SQL_HASZERONUMS($result_direct) > 0) {
// When 'walk' through all users
while ($content = SQL_FETCHARRAY($result_direct)) {
// Init level
// Load rankings
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_bonus_turbo` WHERE `%s`=%s ORDER BY `level` ASC LIMIT {?bonus_lines?}",
array($type, $data), __FUNCTION__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Start generating the ranking list
$max = SQL_NUMROWS($result);
// Subtract points from...
switch (getConfig('bonus_mode')) {
case 'JACKPOT': // ... jackpot
- if ((isExtensionActive('jackpot')) && (subtractPointsFromJackpot($points) == -1) && (getConfig('bonus_userid') > 0)) {
+ if ((isExtensionActive('jackpot')) && (subtractPointsFromJackpot($points) == -1) && (isValidUserId(getConfig('bonus_userid')))) {
if ($total >= $points) {
// Subtract points from userid's account
subtractPointsFromJackpot('bonus_payout_jackpot', getConfig('bonus_userid'), $points);
$limit
), __FUNCTION__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// List entries
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
if (!empty($jackpot)) $points += $jackpot;
} // END - if
- if (getConfig('doubler_userid') > 0) {
+ if (isValidUserId(getConfig('doubler_userid'))) {
// Get user's points
$user = countSumTotalData(getConfig('doubler_userid'), 'user_points', 'points');
$points += $user;
`network_short_name` ASC", __FUNCTION__, __LINE__);
// Do we have entries?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// List all entries
$rows = array();
while ($row = SQL_FETCHARRAY($result)) {
), __FUNCTION__, __LINE__);
// Do we have entries?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// List all entries
$rows = array();
while ($row = SQL_FETCHARRAY($result)) {
t.`network_type_handle` ASC", __FUNCTION__, __LINE__);
// Do we have entries?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// List all entries
$rows = array();
while ($row = SQL_FETCHARRAY($result)) {
// Displays selected networks for editing
function doAdminNetworkProcessHandlenetworkForm () {
// Do we have selections?
- if (countPostSelection() > 0) {
+ if (ifPostContainsSelections()) {
// Something has been selected, so start displaying one by one
$OUT = '';
foreach (postRequestParameter('sel') as $id => $sel) {
// Handle network type form
function doAdminNetworkProcessHandlenetworktypeForm () {
// Do we have selections?
- if (countPostSelection() > 0) {
+ if (ifPostContainsSelections()) {
// Load network data
$networkData = getNetworkDataById(getRequestParameter('network'));
// Handle network request parameter form
function doAdminNetworkProcessHandlerequestparamsForm () {
// Do we have selections?
- if (countPostSelection() > 0) {
+ if (ifPostContainsSelections()) {
// Init cache array
$GLOBALS['network_params_disabled'] = array();
// Changes given networks
function doAdminNetworkProcessChangenetworkForm () {
// Do we have selections?
- if (countPostSelection() > 0) {
+ if (ifPostContainsSelections()) {
// By default nothing is updated
$updated = 0;
// Removes given networks
function doAdminNetworkProcessRemovenetworkForm () {
// Do we have selections?
- if (countPostSelection() > 0) {
+ if (ifPostContainsSelections()) {
// By default nothing is removed
$removed = 0;
// Changes given network type handlers
function doAdminNetworkProcessChangenetworktypeForm () {
// Do we have selections?
- if (countPostSelection() > 0) {
+ if (ifPostContainsSelections()) {
// By default nothing is updated
$updated = 0;
// Changes given network request parameters
function doAdminNetworkProcessChangenetworkparamForm () {
// Do we have selections?
- if (countPostSelection() > 0) {
+ if (ifPostContainsSelections()) {
// By default nothing is updated
$updated = 0;
// Removes given network type handlers
function doAdminNetworkProcessRemovenetworktypeForm () {
// Do we have selections?
- if (countPostSelection() > 0) {
+ if (ifPostContainsSelections()) {
// By default nothing is removed
$removed = 0;
// Removes given network request parameters
function doAdminNetworkProcessRemovenetworkparamForm () {
// Do we have selections?
- if (countPostSelection() > 0) {
+ if (ifPostContainsSelections()) {
// By default nothing is removed
$removed = 0;
$isAdmin = 'N';
// Valid userid?
- if ((isMemberIdSet()) && (getMemberId() > 0) && (isMember())) {
+ if (isMember()) {
// Is valid user
$userid = getMemberId();
$isMember = 'Y';
ORDER BY
`type` ASC",
array($points), __FUNCTION__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Now let's check
while ($content = SQL_FETCHARRAY($result)) {
// Are these points enougth?
array($rallye), __FUNCTION__, __LINE__);
// Entries found?
- if (SQL_NUMROWS($result_prices) > 0) {
+ if (!SQL_HASZERONUMS($result_prices)) {
// Load prices
if ($mode == "\n") $prices = '{--RALLYE_MEMBER_PRICES_ADDED--}:' . $mode . '------------------------------' . $mode;
`expired`='Y'",
array($EXPIRE), __FUNCTION__, __LINE__);
- if (SQL_NUMROWS($result_rallye) > 0) {
+ if (!SQL_HASZERONUMS($result_rallye)) {
// Init SQLs
initSqls();
// Entries found?
//* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):numRows=".SQL_NUMROWS($result)."<br />");
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Add all
while ($content = SQL_FETCHARRAY($result)) {
//* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):rid={$rid},level={$level},userid={$content['userid']}<br />");
array(bigintval($userid), bigintval($level)), __FUNCTION__, __LINE__);
// Are there some entries?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Fetch all entries
while ($row = SQL_FETCHARRAY($result)) {
// Add row
$result = SQL_QUERY("SELECT `id`, `cat`, `visible` FROM `{?_MYSQL_PREFIX?}_cats` ".$AND." ORDER BY `sort` ASC",
__FUNCTION__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// List alle visible modules (or all to the admin)
$OUT .= '<table border="0" cellspacing="0" cellpadding="0" width="100%">';
while ($content = SQL_FETCHARRAY($result)) {
if (isAdmin()) $WHERE = '';
// Load main menu entries
- $result_main = SQL_QUERY("SELECT action AS main_action, title AS main_title FROM `{?_MYSQL_PREFIX?}_sponsor_menu`
-WHERE (`what`='' OR `what` IS NULL) ".$WHERE."
-ORDER BY `sort`", __FUNCTION__, __LINE__);
- if (SQL_NUMROWS($result_main) > 0) {
+ $result_main = SQL_QUERY("SELECT
+ `action` AS `main_action`, `title` AS `main_title`
+FROM
+ `{?_MYSQL_PREFIX?}_sponsor_menu`
+WHERE
+ (`what`='' OR `what` IS NULL)
+ ".$WHERE."
+ORDER BY
+ `sort` ASC", __FUNCTION__, __LINE__);
+ if (!SQL_HASZERONUMS($result_main)) {
// Load every menu and it's sub menus
while ($content = SQL_FETCHARRAY($result_main)) {
// Load sub menus
- $result_sub = SQL_QUERY_ESC("SELECT what AS sub_what, title AS sub_title FROM `{?_MYSQL_PREFIX?}_sponsor_menu`
-WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ".$WHERE."
-ORDER BY `sort`",
+ $result_sub = SQL_QUERY_ESC("SELECT
+ `what` AS `sub_what`, `title` AS `sub_title`
+FROM
+ `{?_MYSQL_PREFIX?}_sponsor_menu`
+WHERE
+ `action`='%s' AND
+ `what` != '' AND
+ `what` IS NOT NULL
+ ".$WHERE."
+ORDER BY
+ `sort` ASC",
array($content['main_action']), __FUNCTION__, __LINE__);
- if (SQL_NUMROWS($result_sub) > 0) {
+ if (!SQL_HASZERONUMS($result_sub)) {
// Load sub menus
$SUB = '';
while ($content2 = SQL_FETCHARRAY($result_sub)) {
), __FUNCTION__, __LINE__);
// Is there at least one record?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Then load all!
while ($dataRow = SQL_FETCHARRAY($result)) {
// Shall we group these results?
function SURFBAR_PAY_POINTS () {
// Remove it from the URL owner
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.SURFBAR_GET_USERID().',costs='.SURFBAR_GET_COSTS().'', false);
- if (SURFBAR_GET_USERID() > 0) {
+ if (isValidUserId(SURFBAR_GET_USERID())) {
subtractPoints(sprintf("surfbar_%s", getConfig('surfbar_pay_model')), SURFBAR_GET_USERID(), SURFBAR_GET_COSTS());
} // END - if
array(getMemberId()), __FUNCTION__, __LINE__);
// Are there entries?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Load all rows
while ($row = SQL_FETCHARRAY($result)) {
// Add the row
array($status), __FUNCTION__, __LINE__);
// Some entries there?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Load all actions
// @TODO This can be somehow rewritten
while ($content = SQL_FETCHARRAY($result)) {
// Check for accounts to be notified
$result_main = SQL_QUERY($sql, __FILE__, __LINE__);
- if (SQL_NUMROWS($result_main) > 0) {
+ if (!SQL_HASZERONUMS($result_main)) {
// Normal notification mails or bonus mails?
$sentBonusMails = ((getConfig('beg_notify_bonus') > 0) && ($mode == 'enable') && (isExtensionActive('bonus')));
// Check for accounts to be notified
$result_main = SQL_QUERY($sql, __FILE__, __LINE__);
- if (SQL_NUMROWS($result_main) > 0) {
+ if (!SQL_HASZERONUMS($result_main)) {
// Okay lets notify all users!
while ($content = SQL_FETCHARRAY($result_main)) {
// Update account
`id` DESC", __FUNCTION__, __LINE__);
// Do we have entries?
- if (SQL_NUMROWS($result_main) > 0) {
+ if (!SQL_HASZERONUMS($result_main)) {
$OUT .= '<ul class="admin_menu_main">';
// @TODO Rewrite this to $content = SQL_FETCHARRAY()
while (list($menu, $title, $descr) = SQL_FETCHROW($result_main)) {
array($menu), __FUNCTION__, __LINE__);
// Remember the count for later checks
- setAdminMenuHasEntries($menu, ((SQL_NUMROWS($result_what) > 0) && ($action == $menu)));
+ setAdminMenuHasEntries($menu, ((!SQL_HASZERONUMS($result_what)) && ($action == $menu)));
// Do we have entries?
- if ((ifAdminMenuHasEntries($menu)) && (SQL_NUMROWS($result_what) > 0)) {
+ if ((ifAdminMenuHasEntries($menu)) && (!SQL_HASZERONUMS($result_what))) {
$GLOBALS['menu']['description'] = array();
$GLOBALS['menu']['title'] = array(); $SUB = true;
$OUT .= '<li class="admin_menu_sub"><ul class="admin_menu_sub">';
$result = SQL_QUERY_ESC("SELECT `%s` AS `menu`, `title` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$what." ORDER BY `sort` ASC",
array($mode), __FUNCTION__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Load menu as selection
$OUT = '<select name="' . $mode . '_menu';
if ((!empty($defid)) || ($defid == '0')) $OUT .= '[' . $defid . ']';
$NAV .= '<a href="{%url=modules.php?module=admin&what=' . getWhat() . '&page=' . $page . '&offset=' . $offset;
// Add userid when we shall show all mails from a single member
- if ((isGetRequestParameterSet('userid')) && (bigintval(getRequestParameter('userid')) > 0)) $NAV .= '&userid=' . bigintval(getRequestParameter('userid'));
+ if ((isGetRequestParameterSet('userid')) && (isValidUserId(getRequestParameter('userid')))) $NAV .= '&userid=' . bigintval(getRequestParameter('userid'));
// Close open anchor tag
$NAV .= '%}">';
`task_created` DESC",
array(getCurrentAdminId()), __FILE__, __LINE__);
- if (SQL_NUMROWS($result_tasks) > 0) {
+ if (!SQL_HASZERONUMS($result_tasks)) {
// New jobs found!
$jobsDone = false;
} // END - if
// Get all available main menus
$result = SQL_QUERY("SELECT action, title, sort FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort`", __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Read menu structure
// @TODO Cant this be rewritten?
while ($content = SQL_FETCHARRAY($result)) {
foreach ($menus as $key_main => $value_main) {
$result = SQL_QUERY_ESC("SELECT `what`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`",
array($value_main), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Init arrays
$menus[$value_main] = array();
$titles[$value_main] = array();
} // END - if
// List all menu points and make them editable
-if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Edit menu entries
// @TODO Kill all constants in this file
$content['sub'] = $SUB;
// Load template
loadTemplate('admin_amenu_edit_form', false, $content);
-} elseif ((isFormSent('del')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isFormSent('del')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Prepare misc content
$content['sub'] = $SUB;
$content['chk'] = countPostSelection();
setPostRequestParameter('sel', array($adminId => 1));
} // END - if
-if ((isFormSent('edit')) && (countPostSelection() > 0)) {
+if ((isFormSent('edit')) && (ifPostContainsSelections())) {
// Edit account(s)
adminsEditAdminAccount(postRequestArray());
} elseif ((isFormSent('change')) && (count(postRequestParameter('login')) > 0)) {
// Change admin accounts
adminsChangeAdminAccount(postRequestArray());
-} elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('del')) && (ifPostContainsSelections())) {
// Show admin accounts for deletetion
adminsDeleteAdminAccount(postRequestArray());
} else {
- if ((isFormSent('remove')) && (countPostSelection() > 0)) {
+ if ((isFormSent('remove')) && (ifPostContainsSelections())) {
// Remove accounts now
adminsRemoveAdminAccount(postRequestArray());
} // END - if
if (isFormSent('edit')) {
// Check if entires are checked
- if (countPostSelection() > 0) {
+ if (ifPostContainsSelections()) {
// Add option for events
$adminsList = generateOptionList('admins', 'id', 'login', '', 'email');
$rows = '';
m.admin_id ASC,
m.mail_template ASC", __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Shall I change entries?
if (isFormSent('change')) {
// Init SQLs
ORDER BY
`userid` ASC", __FILE__, __LINE__);
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// We have some (new?) registrations!
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
// Add description as navigation point
addMenuDescription('admin', __FILE__);
-if ((isFormSent('edit')) && (countPostSelection() > 0)) {
+if ((isFormSent('edit')) && (ifPostContainsSelections())) {
// Edit ACLs
$OUT = '';
foreach (postRequestParameter('sel') as $id => $selected) {
// Load main template
loadTemplate('admin_config_admins_edit', false, $OUT);
-} elseif ((isFormSent('change')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('change')) && (ifPostContainsSelections())) {
// Change entries
foreach (postRequestParameter('sel') as $id => $selected) {
// Secure id
// Entries changed
loadTemplate('admin_settings_saved', false, '{--ADMIN_ADMINS_ENTRIES_CHANGED--}');
-} elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('del')) && (ifPostContainsSelections())) {
// Delete ACLs
$OUT = '';
foreach (postRequestParameter('sel') as $id => $selected) {
// Load main template
loadTemplate('admin_config_admins_del', false, $OUT);
-} elseif ((isFormSent('remove')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('remove')) && (ifPostContainsSelections())) {
// Remove entries
// @TODO Rewrite this to filter 'run_sqls'
foreach (postRequestParameter('sel') as $id => $selected) {
$result_acls = SQL_QUERY('SELECT `id`, `admin_id`, `action_menu`, `what_menu`, `access_mode` FROM `{?_MYSQL_PREFIX?}_admins_acls` ORDER BY `admin_id` ASC, `id` ASC', __FILE__, __LINE__);
// Entries found?
- if (SQL_NUMROWS($result_acls) > 0) {
+ if (!SQL_HASZERONUMS($result_acls)) {
// List ACLs
$OUT = '';
while ($content = SQL_FETCHARRAY($result_acls)) {
// Display message
loadTemplate('admin_settings_saved', false, $TEXT);
} // END - if
-} elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('del')) && (ifPostContainsSelections())) {
// Delete categories
$OUT = '';
foreach (postRequestParameter('sel') as $id => $value) {
// Load main template
loadTemplate('admin_del_cats', false, $OUT);
-} elseif ((isFormSent('edit')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('edit')) && (ifPostContainsSelections())) {
// Edit categories
$OUT = '';
foreach (postRequestParameter('sel') as $id => $value) {
// Load all categories
$result = SQL_QUERY("SELECT `id`, `cat`, `visible`, `sort` FROM `{?_MYSQL_PREFIX?}_cats` ORDER BY `sort` ASC", __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Init variables
$OUT = '';
// Display message
loadTemplate('admin_settings_saved', false, $TEXT);
} // END - if
-} elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('del')) && (ifPostContainsSelections())) {
// Delete entries
$OUT = '';
foreach (postRequestParameter('sel') as $id => $value) {
// Load main template
loadTemplate('admin_config_email_del', false, $content);
-} elseif ((isFormSent('edit')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('edit')) && (ifPostContainsSelections())) {
// Edit entries
$OUT = '';
foreach (postRequestParameter('sel') as $id => $value) {
} else {
$result = SQL_QUERY("SELECT `id`, `value`, `comment` FROM `{?_MYSQL_PREFIX?}_max_receive` ORDER BY `value` ASC",
__FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// List already existing entries for editing
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
$result = SQL_QUERY('SELECT `imprint_key`,`imprint_value` FROM `{?_MYSQL_PREFIX?}_imprint_data` ORDER BY `imprint_id` ASC', __FILE__, __LINE__);
// Do we have entries?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Load all entries
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
if (postRequestParameter('mt_stage') <= getTotalConfirmedUser()) {
// Not enougth!
unsetPostRequestParameter('ok');
- }
-}
+ } // END - if
+} // END - if
if (isFormSent()) {
// Save data
if (isFormSent('edit')) {
// Check if at least one module is selected
- if (countPostSelection() > 0) {
+ if (ifPostContainsSelections()) {
// Output header
$OUT = '';
loadTemplate('admin_settings_saved', false, '{--ADMIN_MODS_CHANGED--}');
}
-if (countPostSelection() == 0) {
+if (!ifPostContainsSelections()) {
// 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`
$result_mem = SQL_QUERY("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_payouts` WHERE `status`='NEW' ORDER BY payout_timestamp DESC", __FILE__, __LINE__);
$display = true;
-if ((isFormSent('edit')) && (countPostSelection() > 0)) {
+if ((isFormSent('edit')) && (ifPostContainsSelections())) {
// Edit payout types
if ((isGetRequestParameterSet('ok')) && (getRequestParameter('ok') == 'ok')) {
// Init SQLs
// Load main template
loadTemplate('admin_config_payouts_edit', false, $OUT);
}
-} elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('del')) && (ifPostContainsSelections())) {
// Delete payout types
if ((isGetRequestParameterSet('ok')) && (getRequestParameter('ok') == 'ok')) {
// Init SQLs
ORDER BY
`type` ASC", __FILE__, __LINE__);
-if ((SQL_NUMROWS($result_type) > 0) && ($display)) {
+if ((!SQL_HASZERONUMS($result_type)) && ($display)) {
// List all payout types
$OUT = '';
while ($content = SQL_FETCHARRAY($result_type)) {
} // END - if
// Does your members request payouts?
-if ((SQL_NUMROWS($result_mem) > 0) && ($display)) {
+if ((!SQL_HASZERONUMS($result_mem)) && ($display)) {
// Members has requested payouts
loadTemplate('admin_settings_saved', false, '<a href="{%url=modules.php?module=admin&what=list_payouts%}">{--ADMIN_PAYOUT_LIST_REQUESTS--}</a>');
} elseif ($display) {
loadTemplate('admin_config_point_settings', false, $content);
} elseif (getRequestParameter('sub') == 'ref') {
// 12 3 32 2 3 32 2 3 4 43 21
- if ((isFormSent('del')) && (isPostRequestParameterSet('sel')) && (countPostSelection() > 0)) {
+ if ((isFormSent('del')) && (isPostRequestParameterSet('sel')) && (ifPostContainsSelections())) {
// Delete entries
$OUT = '';
foreach (postRequestParameter('sel') as $id => $value) {
// Load main template
loadTemplate('admin_points_del', false, $OUT);
- } elseif ((isFormSent('edit')) && (isPostRequestParameterSet('sel')) && (countPostSelection() > 0)) {
+ } elseif ((isFormSent('edit')) && (isPostRequestParameterSet('sel')) && (ifPostContainsSelections())) {
// Edit entries
$OUT = '';
foreach (postRequestParameter('sel') as $id => $value) {
} else {
// Referal levels
$result = SQL_QUERY("SELECT `id`, `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` ORDER BY `level` ASC", __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Make referal levels editable and deletable
$OUT = '';
}
} elseif (isFormSent('remove')) {
// Check if at last one line is selected
- if (countPostSelection() > 0) {
+ if (ifPostContainsSelections()) {
// Delete selected entries
foreach (postRequestParameter('sel') as $id => $sel) {
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `id`=%s LIMIT 1",
if (isFormSent('edit')) {
// Check if at last one line is selected
- if (countPostSelection() > 0) {
+ if (ifPostContainsSelections()) {
// Make selected editable
$OUT = '';
foreach (postRequestParameter('sel') as $id => $sel) {
}
} elseif (isFormSent('del')) {
// Check if at last one line is selected
- if (countPostSelection() > 0) {
+ if (ifPostContainsSelections()) {
// List all prices
$OUT = '';
foreach (postRequestParameter('sel') as $id => $sel) {
$result = SQL_QUERY_ESC("SELECT `id`, `price_level`, `points`, `info` FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s ORDER BY `price_level` ASC",
array(bigintval(getRequestParameter('rallye'))), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Load all prices for the selected rallye
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
d.admin_id=a.id
ORDER BY
d.start_time DESC", __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// List found rallyes
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
addMenuDescription('admin', __FILE__);
// Shall I delete selected holidays???
-if (countPostSelection() > 0) {
+if (ifPostContainsSelections()) {
// Delete multiple holiday requests (for list_holiday)
$cnt = '0';
foreach (postRequestParameter('sel') as $id => $sel) {
if (isFormSent('del')) {
// Delete entries from tables
- if (countPostSelection() > 0) {
+ if (ifPostContainsSelections()) {
// Init SQLs
initSqls();
`trans_id` ASC', __FILE__, __LINE__);
$total = '0';
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// Output rows
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
`timestamp` ASC", __FILE__, __LINE__);
// Entries found?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
if (isFormSent()) {
// Make mail editable...
$result = SQL_QUERY_ESC("SELECT `id`, `subject`, `text`, `url` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s LIMIT 1",
// Free the result which we don't need
SQL_FREERESULT($result_maximum);
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// Mail orders are in pool so we can display them
// Add navigation table rows
SQL_FREERESULT($result_normal);
$MAIL = false;
-if (SQL_NUMROWS($result_list) > 0) {
+if (!SQL_HASZERONUMS($result_list)) {
// Init rows
$OUT = '';
$MAIL = true;
if ((isExtensionActive('bonus')) && (empty($WHO))) {
// Only check if bonus extension is active
- if (SQL_NUMROWS($result_bonus) > 0) outputHtml('<br /><br />');
+ if (!SQL_HASZERONUMS($result_bonus)) outputHtml('<br /><br />');
} // END - if
}
if ((isExtensionActive('bonus')) && (empty($WHO))) {
// Load bonus mails only when extension is active
- if (SQL_NUMROWS($result_bonus) > 0) {
+ if (!SQL_HASZERONUMS($result_bonus)) {
// Calculate pages
$numPages = round(SQL_NUMROWS($result_bonus) / getConfig('mails_page') + 0.5);
// We are about to register a new extension
$do = 'register'; $taskId = bigintval(getRequestParameter('reg_ext'));
// The id comes from task management and it is - of course - *not* the extension's name!
-} elseif ((isFormSent('change')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isFormSent('change')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// De-/activate extensions
foreach (postRequestParameter('sel') as $taskId => $active) {
// Shall we keep the extension always active?
// Redirect to prevent missing cache in js.php
redirectToUrl('modules.php?module=admin&what=extensions&changed=' . countPostSelection());
-} elseif (((isFormSent('edit')) || (isPostRequestParameterSet('modify'))) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif (((isFormSent('edit')) || (isPostRequestParameterSet('modify'))) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Change settings like CSS file load
if (isPostRequestParameterSet('modify')) {
// Change entries
loadTemplate('admin_extensions_edit', false, $OUT);
$do = 'edit';
}
-} elseif ((isPostRequestParameterSet('delete')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isPostRequestParameterSet('delete')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// List extensions and when verbose is enabled SQL statements which will be executed
$OUT = '';
foreach (postRequestParameter('sel') as $taskId => $sel) {
// Load template
loadTemplate('admin_extensions_delete', false, $OUT);
$do = 'delete';
-} elseif ((isFormSent('remove')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isFormSent('remove')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Remove extensions from DB (you have to delete all files manually!)
$cache_update = '0';
foreach (postRequestParameter('sel') as $taskId => $active) {
}
// Are there some entries?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Extensions are registered
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
(`what`='' OR `what` IS NULL)
ORDER BY
`sort` ASC", __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Read menu structure
// @TODO Cant this be rewritten?
while ($content = SQL_FETCHARRAY($result)) {
`what` IS NOT NULL
ORDER BY `sort` ASC",
array($value_main), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Initialize arrays
$menus[$value_main] = array();
$titles[$value_main] = array();
} // END - if
// List all menu points and make them editable
-if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Edit menu entries
$content['sub'] = $SUB;
$content['chk'] = countPostSelection();
// Load template
loadTemplate('admin_gmenu_edit_form', false, $content);
-} elseif ((isFormSent('del')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isFormSent('del')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Del menu entries with or without confirmation
$content['sub'] = $SUB;
$content['chk'] = countPostSelection();
loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_UNKNOWN_OKAY', postRequestParameter('ok')));
break;
} // END - switch
-} elseif ((isPostRequestParameterSet('status')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isPostRequestParameterSet('status')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Change status (visible / locked)
$content['sub'] = $SUB;
$content['chk'] = countPostSelection();
// Exclude default referal id if set
// @TODO Rewrite those lines to filter
$EXCLUDE_LIST = '';
-if (getConfig('def_refid') > 0) {
- $EXCLUDE_LIST = ' AND d.userid != {?def_refid?}';
-} // END - if
-
-// Check for more extensions
+if (getConfig('def_refid') > 0) $EXCLUDE_LIST .= ' AND d.userid != {?def_refid?}';
if (isExtensionActive('beg')) $EXCLUDE_LIST .= ' AND d.userid != {?beg_userid?}';
if (isExtensionActive('bonus')) $EXCLUDE_LIST .= ' AND d.userid != {?bonus_userid?}';
if (isExtensionActive('doubler')) $EXCLUDE_LIST .= ' AND d.userid != {?doubler_userid?}';
ORDER BY
d.userid ASC", __FILE__, __LINE__);
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// Ok, we have found some inactive accounts
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
`id` ASC", __FILE__, __LINE__);
// Is there at lease one package?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// List all packages
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
`last_online` DESC,
`userid` ASC", __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// List users
$OUT = ''; $cnt = 1; $total = '0';
while ($content = SQL_FETCHARRAY($result)) {
`userid` ASC",
array($ONLINE), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// List users
$OUT = ''; $cnt = 1; $total = '0';
while ($content = SQL_FETCHARRAY($result)) {
// Ok, list categories of this user
$result_cats = SQL_QUERY("SELECT `id`, `cat` FROM `{?_MYSQL_PREFIX?}_cats` ORDER BY `sort` ASC", __FILE__, __LINE__);
- if (SQL_NUMROWS($result_cats) > 0) {
+ if (!SQL_HASZERONUMS($result_cats)) {
// List categories
$cnt = 1; $OUT = '';
while ($row = SQL_FETCHARRAY($result_cats)) {
// Display message
loadTemplate('admin_settings_saved', false, $message);
- }
+ } // END - if
// Load currenty setup country codes to list
$result = SQL_QUERY('SELECT id, code, descr, is_active FROM `{?_MYSQL_PREFIX?}_countries` ORDER BY code',
__FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// List all countries
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
ORDER BY
h.userid ASC", __FILE__, __LINE__);
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// List all holiday requests
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
array(getRequestParameter('network')), __FILE__, __LINE__);
// Do we have entries?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// List all entries
$OUT = '';
while ($row = SQL_FETCHARRAY($result)) {
array(getRequestParameter('network')), __FILE__, __LINE__);
// Do we have entries?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// List all entries
$OUT = '';
while ($row = SQL_FETCHARRAY($result)) {
`network_short_name` ASC', __FILE__, __LINE__);
// Do we have entries?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// List all
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
// Add limitation
if (!empty($SQL2)) $SQL2 .= $add;
-if ((isExtensionActive('bonus')) && (SQL_NUMROWS($result_max) > 0) && (!empty($SQL2))) {
+if ((isExtensionActive('bonus')) && (!SQL_HASHZERONUMS($result_max)) && (!empty($SQL2))) {
// Run SQL query for notification mails
$result_bonus = SQL_QUERY($SQL2, __FILE__, __LINE__);
// Load bonus mails only when extension is active
- if (SQL_NUMROWS($result_bonus) > 0) {
+ if (!SQL_HASZERONUMS($result_bonus)) {
// Calculate pages
$numPages = round(SQL_NUMROWS($result_bonus) / getConfig('mails_page') + 0.5);
ORDER BY
p.payout_timestamp DESC", __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// List found payouts
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
__FILE__, __LINE__);
// Are there some entries to display?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// List all entries
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
runFilterChain('run_sqls');
} elseif (isFormSent('remove')) {
// Delete rallyes
- if (countPostSelection() > 0) {
+ if (ifPostContainsSelections()) {
// Init SQLs
initSqls();
}
} elseif (isFormSent('change')) {
// Change rallye
- if (countSelection(postRequestParameter('title')) > 0) {
+ if (ifPostContainsSelections('title')) {
// Init SQLs
initSqls();
if (isFormSent('edit')) {
// Check for selections
- if (countPostSelection() > 0) {
+ if (ifPostContainsSelections()) {
// Make all selected and deactivated rallyes editable
$OUT = '';
foreach (postRequestParameter('sel') as $id => $selected) {
ORDER BY
`userid` ASC",
array(bigintval(getRequestParameter('rallye'))), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
$OUT = '';
$content['rallye'] = getRequestParameter('rallye');
while ($row = SQL_FETCHARRAY($result)) {
`start_time` DESC", __FILE__, __LINE__);
// Records found?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// List found rallyes
$OUT = '';
while ($data = SQL_FETCHARRAY($result)) {
`level` ASC", __FILE__, __LINE__);
// Are there some levels (VERY BAD IF NONE!)
- if (SQL_NUMROWS($result_levels) > 0) {
+ if (!SQL_HASZERONUMS($result_levels)) {
// List all ref levels or entries if no refback is installed
$OUT = '';
while ($levels = SQL_FETCHARRAY($result_levels)) {
//* DEBUG: */ debugOutput($userid.'/'.$levels['level'].'/'.SQL_NUMROWS($result_refs));
// Do we have levels?
- if (SQL_NUMROWS($result_refs) > 0) {
+ if (!SQL_HASZERONUMS($result_refs)) {
// Count entries
$menge = countSumTotalData($userid, 'user_data', 'userid', 'refid', true);
$menge_lck = countSumTotalData($userid, 'user_data', 'userid', 'refid', true, " AND `status` != 'CONFIRMED'");
`id` ASC",
array(bigintval(getRequestParameter('rid'))), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// List refs now
// Free memory
SQL_FREERESULT($result);
ORDER BY
`id` ASC", __FILE__, __LINE__);
- if (SQL_NUMROWS($result_main) > 0) {
+ if (!SQL_HASZERONUMS($result_main)) {
// At least one sponsor found!
$OUT = '';
while ($content = SQL_FETCHARRAY($result_main)) {
__FILE__, __LINE__);
// Do we have some paytypes setup?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Prepare variables for listing
$OUT = '';
`actions_action` ASC", __FILE__, __LINE__);
// Entries found?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// List all entries
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
`url_id` ASC", __FILE__, __LINE__);
// Do we have some URLs left?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// List all URLs
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
} // END - switch
if (!empty($whereStatement)) {
- if ((isPostRequestParameterSet('assign')) && (countPostSelection() > 0)) {
+ if ((isPostRequestParameterSet('assign')) && (ifPostContainsSelections())) {
// Assign / do tasks
loadIncludeOnce('inc/modules/admin/overview-inc.php');
if (empty($dmy)) $dmy = '';
`subject` ASC,
`task_created` DESC',
__FILE__, __LINE__);
- if ((countPostSelection() > 0) && (!isDemoModeActive())) {
+ if ((ifPostContainsSelections()) && (!isDemoModeActive())) {
// Only unassign / delete tasks when there are selected tasks posted
if (isPostRequestParameterSet('unassign')) {
// Unassign from tasks
`trans_id` ASC', __FILE__, __LINE__);
$total = '0';
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// Output rows
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
$result = SQL_QUERY($sql, __FILE__, __LINE__);
// Are there some entries?
- if (SQL_NUMROWS($result_master) > 0) {
+ if (!SQL_HASZERONUMS($result_master)) {
// We have some (new?) registrations!
$templateContent['colspan2'] = ($colspan + 2);
$templateContent['user_count'] = getTotalConfirmedUser();
__FILE__, __LINE__);
// Are there some entries to display?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// List all entries
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
// Get all available main menus
$result = SQL_QUERY("SELECT `action`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC",
__FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Read menu structure
// @TODO Cant this be rewritten?
while ($content = SQL_FETCHARRAY($result)) {
foreach ($menus as $key_main => $value_main) {
$result = SQL_QUERY_ESC("SELECT what, title, sort FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='%s' AND `what` != '' ORDER BY `sort`",
array($value_main), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Initialize arrays
$menus[$value_main] = array();
$titles[$value_main] = array();
} // END - if
// List all menu points and make them editable
-if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Edit menu entries
$content['sub'] = $SUB;
$content['chk'] = countPostSelection();
// Load template
loadTemplate('admin_mmenu_edit', false, $content);
-} elseif ((isFormSent('del')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isFormSent('del')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Del menu entries with or without confirmation
$content['sub'] = $SUB;
$content['chk'] = countPostSelection();
// Load template
loadTemplate('admin_mmenu_delete', false, $content);
-} elseif ((isPostRequestParameterSet('status')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isPostRequestParameterSet('status')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
// Change status (visible / locked)
$content['sub'] = $SUB;
$content['chk'] = countPostSelection();
// Output template
loadTemplate('admin_settings_saved', false, $content);
-} elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('del')) && (ifPostContainsSelections())) {
// Delete entries here
$OUT = '';
foreach (postRequestParameter('sel') as $id => $value) {
// Load main template
loadTemplate('admin_del_payments', false, $OUT);
-} elseif ((isFormSent('edit')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('edit')) && (ifPostContainsSelections())) {
// Edit entries
$OUT = '';
foreach (postRequestParameter('sel') as $id => $value) {
} else {
// Referal levels
$result = SQL_QUERY("SELECT `id`, `time`, `payment`, `mail_title`, `price` FROM `{?_MYSQL_PREFIX?}_payments` ORDER BY `time` ASC", __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Make referal levels editable and deletable
$OUT = '';
// Display message
loadTemplate('admin_settings_saved', false, $content);
-} elseif ((countPostSelection() > 0) && (isFormSent('edit'))) {
+} elseif ((ifPostContainsSelections()) && (isFormSent('edit'))) {
// Edit banner
$OUT = '';
foreach (postRequestParameter('sel') as $id => $sel) {
// Load main template
loadTemplate('admin_refbanner_edit', false, $OUT);
} else {
- if ((countPostSelection() > 0) && (isFormSent('del'))) {
+ if ((ifPostContainsSelections()) && (isFormSent('del'))) {
// Delete banner
foreach (postRequestParameter('sel') as $id => $sel) {
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_refbanner` WHERE `id`=%s LIMIT 1",
$result = SQL_QUERY('SELECT `id`, `url`, `alternate`, `visible`, `counter`, `clicks` FROM `{?_MYSQL_PREFIX?}_refbanner` ORDER BY `url` ASC', __FILE__, __LINE__);
// Entries found?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Make referal banner editable and deletable
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
// Go through all categories
$result = SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_cats` GROUP BY `userid` ORDER BY `userid` ASC", __FILE__, __LINE__);
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// Nothing is removed for now... ;-)
$REMOVED = '0';
`status`='CONFIRMED' AND `nl_receive`='Y'
ORDER BY
`userid` ASC", __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Members are available so we can send out the newsletter!
while ($content = SQL_FETCHARRAY($result)) {
// Construct mail...
array(bigintval(getRequestParameter('url_id'))), __FILE__, __LINE__);
// Entries found?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Get all rows
$OUT = ''; $cnt = '0'; $visits = '0';
while ($content = SQL_FETCHARRAY($result)) {
`stats_userid` ASC", __FILE__, __LINE__);
// Entries found?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Get all rows
$OUT = ''; $urlArray = '0'; $visits = '0';
while ($content = SQL_FETCHARRAY($result)) {
} // END - if
// Check for selected themes
-if (countPostSelection() > 0) {
+if (ifPostContainsSelections()) {
$OUT = '';
foreach (postRequestParameter('sel') as $id => $sel) {
$sql = '';
ORDER BY
`theme_path` ASC", __FILE__, __LINE__);
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
while ($content = SQL_FETCHARRAY($result)) {
// Construct IFN
$inc = sprintf("theme/%s/theme.php", $content['theme_path']);
ORDER BY
`timestamp` ASC", __FILE__, __LINE__);
-if ((SQL_NUMROWS($result_main) > 0) || (isFormSent('lock'))) {
+if ((!SQL_HASZERONUMS($result_main)) || (isFormSent('lock'))) {
if (isFormSent('accept')) {
- if (countPostSelection() > 0) {
+ if (ifPostContainsSelections()) {
// Accept mail orders
foreach (postRequestParameter('sel') as $id => $value) {
// Secure id number
// Mails unlocked for mail delivery
loadTemplate('admin_settings_saved', false, $message);
} elseif (isPostRequestParameterSet(('reject'))) {
- if (countPostSelection() > 0) {
+ if (ifPostContainsSelections()) {
// Reject mail orders
$OUT = '';
foreach (postRequestParameter('sel') as $id => $value) {
// Nothing selected
loadTemplate('admin_settings_saved', false, '{--ADMIN_MAILS_NOTHING_CHECKED--}');
}
- } elseif ((isFormSent('lock')) && (countPostSelection() > 0) && (getConfig('url_blacklist') == 'Y')) {
+ } elseif ((isFormSent('lock')) && (ifPostContainsSelections()) && (getConfig('url_blacklist') == 'Y')) {
// Lock URLs
foreach (postRequestParameter('sel') as $id => $url) {
// Secure id number
// Check if admin has submitted form
if (isFormSent()) {
// Does he have selected at least one sponsor?
- if (countSelection(postRequestParameter('id')) > 0) {
+ if (ifPostContainsSelections('id')) {
// At least one entry selected
foreach (postRequestParameter('id') as $id => $selected) {
// Secure id number and init $content
ORDER BY
sp.pay_name ASC",
array($content['id']), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Payment does exist
while ($content2 = SQL_FETCHARRAY($result)) {
// Merge both arrays
ORDER BY
`id`", __FILE__, __LINE__);
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// Entries found so let's list them!
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
`url_id` ASC", __FILE__, __LINE__);
// Do we have some URLs left?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// List all URLs
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
// Check for online users
$result = SQL_QUERY("SELECT `id`, `ip`, `userid`, `refid`, `module`, `action`, `what`, `is_member`, `is_admin`, `timestamp` FROM `{?_MYSQL_PREFIX?}_online` ORDER by `timestamp` DESC",
__FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// List all online users
$OUT = '';
while ($row = SQL_FETCHARRAY($result)) {
LIMIT {?active_limit?}", __FILE__, __LINE__);
// Entries found?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// At least one member was online so let's load them all
$OUT = '';
while (list($userid, $nick, $last) = SQL_FETCHROW($result)) {
WHERE m.`action`='actions' AND r.is_active='Y'
ORDER BY m.sort ASC", __FILE__, __LINE__);
-if (SQL_NUMROWS($result_act) > 0) {
+if (!SQL_HASZERONUMS($result_act)) {
// Load all actions
$OUT_ACT = '';
while ($content = SQL_FETCHARRAY($result_act)) {
// Check for pay types
$result_pay = SQL_QUERY('SELECT `pay_name`, `pay_rate`, `pay_min_count`, `pay_currency` FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` ORDER BY `pay_name` ASC', __FILE__, __LINE__);
- if (SQL_NUMROWS($result_pay) > 0) {
+ if (!SQL_HASZERONUMS($result_pay)) {
// Load all pay types
$OUT_PAY = '';
while ($content = SQL_FETCHARRAY($result_pay)) {
`{?_MYSQL_PREFIX?}_sponsor_paytypes`
ORDER BY
pay_name` ASC', __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Load all types...
// @TODO Swap this HTML code to templates
$OUT = '<table border="0" cellspacing="0" cellpadding="0" width="300" class="left right top">';
$mem_t10 = SQL_QUERY("SELECT `counter`, `title` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `counter` > 0".$AND." ORDER BY `counter` DESC LIMIT 0,10", __FILE__, __LINE__);
$OUT = '';
- if (SQL_NUMROWS($guest_t10) > 0) {
+ if (!SQL_HASZERONUMS($guest_t10)) {
// Guest clicks
$OUT .= loadTemplate('guest_stats_header', true, '{--GUEST_TOP_GUEST_STATS--}');
while ($content = SQL_FETCHARRAY($guest_t10)) {
} // END - while
} // END - if
- if (SQL_NUMROWS($mem_t10) > 0) {
+ if (!SQL_HASZERONUMS($mem_t10)) {
// Member clicks
$OUT .= loadTemplate('guest_stats_header', true, '{--GUEST_TOP_MEMBER_STATS--}');
while ($content = SQL_FETCHARRAY($mem_t10)) {
} // END - while
} // END - if
- if ((SQL_NUMROWS($guest_t10) > 0) || (SQL_NUMROWS($mem_t10) > 0)) {
+ if ((!SQL_HASZERONUMS($guest_t10)) || (!SQL_HASZERONUMS($mem_t10))) {
// Prepare content
$content = array(
'rows' => $OUT,
);
// Use proxy?
-if ((getConfig('proxy_host') != '') && (getConfig('proxy_port') > 0)) {
+if (isProxyUsed()) {
// Set proxy data
$rdf->set_proxy(getConfig('proxy_host'), getConfig('proxy_port'));
// Reset temporary variable and check for users
$OUT = '';
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// Load our winners...
$cnt = 1;
while ($content = SQL_FETCHARRAY($result)) {
// Reset temporary variable and check for users
$OUT = '';
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// Load our winners...
$cnt = 1;
while ($content = SQL_FETCHARRAY($result)) {
".$whereStatement."
ORDER BY
`sort` ASC", __FILE__, __LINE__);
- if (SQL_NUMROWS($result_cats) > 0) {
+ if (!SQL_HASZERONUMS($result_cats)) {
if ($total > 0) {
// Initialize array...
$categories = array(
$result = SQL_QUERY("SELECT `id`, `price`, `payment`, `mail_title` FROM `{?_MYSQL_PREFIX?}_payments` ORDER BY `payment` ASC", __FILE__, __LINE__);
$types = array();
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Check for message id in URL
$message = getMessageFromErrorCode(getRequestParameter('code'));
ORDER BY
`type` ASC",
array($totalPoints), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Free memory
SQL_FREERESULT($result);
ORDER BY
p.payout_timestamp DESC",
array(getMemberId()), __FILE__, __LINE__);
- if (SQL_NUMROWS($result_payouts) > 0) {
+ if (!SQL_HASZERONUMS($result_payouts)) {
// List all his requests
$OUT = '';
while ($content = SQL_FETCHARRAY($result_payouts)) {
r.level ASC', __FILE__, __LINE__);
// Are there some entries? (Shall be!)
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// List all levels
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
if (isAdmin()) $whereStatement = '';
$result = SQL_QUERY("SELECT `id`, `url`, `alternate`, `counter`, `clicks` FROM `{?_MYSQL_PREFIX?}_refbanner`", __FILE__, __LINE__);
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// List available ref banners
$OUT = '';
while ($row = SQL_FETCHARRAY($result)) {
`level` ASC', __FILE__, __LINE__);
// Are there some entries? (Shall be!)
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// List all levels
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
array(getMemberId()), __FILE__, __LINE__);
// Are there mails left in pool?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// Load all orders
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
`timestamp_ordered` DESC",
array(getMemberId()), __FILE__, __LINE__);
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// Mail orders are in pool so we can display them
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
$valid_reason = (isPostRequestParameterSet('reason'));
// Test if a recipient is selected
- $valid_recipient = (postRequestParameter('to_userid') > 0);
+ $valid_recipient = isValidUserId(postRequestParameter('to_userid'));
// Check for nickname extension and set additional data
// @TODO Rewrite this to a filter
array(getMemberId()), __FILE__, __LINE__);
}
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Load list
$OUT = "<select name=\"to_userid\" size=\"1\" class=\"member_select\">
<option value=\"0\">{--SELECT_NONE--}</option>\n";
$result = SQL_QUERY_ESC($sql, array(getMemberId()), __FILE__, __LINE__);
// Do we have entries?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
$OUT = '';
// @TODO This should be somehow rewritten to $row = SQL_FETCHARRAY(), see switch() block above for SQL queries
while (list($tid, $userid, $points, $reason, $stamp) = SQL_FETCHROW($result)) {
SQL_FREERESULT($result);
$total = '0';
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Search for entries
$result = SQL_QUERY("SELECT `party_userid`, `trans_id`, `points`, `reason`, `time_trans`, `trans_type` FROM `{?_MYSQL_PREFIX?}_transfers_tmp` ORDER BY `time_trans` DESC",
__FILE__, __LINE__);
}
// Mails left for confirmation?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
// Please confirm these mails!
$sum = '0'; $OUT = '';
$whereStatement1 = '';
// Shall we exclude webmaster's own userid?
- if ((getConfig('beg_include_own') != 'Y') && (getConfig('beg_userid') > 0)) {
+ if ((getConfig('beg_include_own') != 'Y') && (isValidUserId(getConfig('beg_userid')))) {
// Exclude it
$whereStatement1 = " AND `userid` != {?beg_userid?}";
} // END - if
`userid` ASC
LIMIT {?beg_ranks?}", __FILE__, __LINE__);
- if (SQL_NUMROWS($result_main) > 0) {
+ if (!SQL_HASZERONUMS($result_main)) {
// Load our winners...
while ($content = SQL_FETCHARRAY($result_main)) {
// Add points to user's account directly
LIMIT {?bonus_ranks?}", __FILE__, __LINE__);
// Some entries were found?
- if (SQL_NUMROWS($result_main) > 0) {
+ if (!SQL_HASZERONUMS($result_main)) {
// Load our winners...
while ($content = SQL_FETCHARRAY($result_main)) {
// Make sure zero points are not mailed
array($mode), __FUNCTION__, __LINE__);
//* DEBUG: */ debugOutput(__LINE__.'/'.$main_cnt.':'.getWhat().'*');
- if (SQL_NUMROWS($result_main) > 0) {
+ if (!SQL_HASZERONUMS($result_main)) {
// There are menus available, so we simply display them... :)
$GLOBALS['rows'] = '';
while ($content = SQL_FETCHARRAY($result_main)) {
array($mode, $content['action']), __FUNCTION__, __LINE__);
// Do we have some entries?
- if (SQL_NUMROWS($result_sub) > 0) {
+ if (!SQL_HASZERONUMS($result_sub)) {
// Init counter
$cnt = '0';
}
// Some entries are found?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
$OUT .= ' <option value="' . $content['value'] . '"';
} // END - if
// Points updated, maybe I shall send him an email?
- if (($sendNotify === true) && (getUserData('refid') > 0) && ($locked === false)) {
+ if (($sendNotify === true) && (isValidUserId(getUserData('refid'))) && ($locked === false)) {
// Prepare content
$content = array(
'percents' => $per,
}
// Maybe there's another ref?
- if ((getUserData('refid') > 0) && ($points > 0) && (getUserData('refid') != $userid) && ($add_mode == 'ref')) {
+ if ((isValidUserId(getUserData('refid'))) && ($points > 0) && (getUserData('refid') != $userid) && ($add_mode == 'ref')) {
// Then let's credit him here...
//* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>):userid='.$userid.',ref='.getUserData('refid').',points='.$points.' - ADVANCE!');
addPointsThroughReferalSystem(sprintf("%s_ref:%s", $subject, $GLOBALS['ref_level']), getUserData('refid'), $points, $sendNotify, getUserData('refid'), $locked);
), __FUNCTION__, __LINE__);
// Do we have rows?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Found data so add them as OPTION lines: $id is the value and $name is the "name" of the option
// @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
while (list($value, $title, $add) = SQL_FETCHROW($result)) {
__FUNCTION__, __LINE__);
// Do we have entries?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// ... and begin loading stuff
while ($content = SQL_FETCHARRAY($result)) {
// Transfer some data
), __FUNCTION__, __LINE__);
// Are there some entries?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Fetch all entries
while ($row = SQL_FETCHARRAY($result)) {
// Get total points of this user
array($column, bigintval($id), $count), __FUNCTION__, __LINE__);
// Are there entries?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// Now load all userids for one big query!
$userids = array();
while ($data = SQL_FETCHARRAY($result)) {
// Reset variables
$cnt2 = '0'; $lastSentId = '0'; $cnt_back = array(0); $pointsBack = array(0);
-if (SQL_NUMROWS($result_main) > 0) {
+if (!SQL_HASZERONUMS($result_main)) {
// Parse all mails
while ($DATA = SQL_FETCHARRAY($result_main, 0, false)) {
// Set mail order as 'active'. That means it will be sent out
__FILE__, __LINE__);
// Entries found?
-if (SQL_NUMROWS($result_main) > 0) {
+if (!SQL_HASZERONUMS($result_main)) {
// Init SQLs
initSqls();
`userid` ASC", __FILE__, __LINE__);
// Do we have some notifications to sent?
- if (SQL_NUMROWS($result) > 0) {
+ if (!SQL_HASZERONUMS($result)) {
// We need to send-out notifications...
while ($content = SQL_FETCHARRAY($result)) {
// Translate timestamp
// Load user's data
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "UID={$userid},template={$template},content[]=".gettype($content));
- if (($userid > 0) && (is_array($content))) {
+ if ((isValidUserId($userid)) && (is_array($content))) {
// If nickname extension is installed, fetch nickname as well
if ((isExtensionActive('nickname')) && (isNicknameUsed($userid))) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "NICKNAME!<br />");
// Checks wether a nickname or userid was entered and caches the result
function isNicknameUsed ($userid) {
- // Default is false
- $isUsed = false;
-
// Is the cache there
- if (isset($GLOBALS['is_nickname_used'][$userid])) {
- // Then use it
- $isUsed = $GLOBALS['is_nickname_used'][$userid];
- } else {
+ if (!isset($GLOBALS['is_nickname_used'][$userid])) {
// Determine it
- $isUsed = (('' . round($userid) . '') != $userid);
-
- // And write it to the cache
- $GLOBALS['is_nickname_used'][$userid] = $isUsed;
- }
+ $GLOBALS['is_nickname_used'][$userid] = (('' . round($userid) . '') != $userid);
+ } // END - if
// Return the result
- return $isUsed;
+ return $GLOBALS['is_nickname_used'][$userid];
}
// Getter for 'what' value
// Checks if current userid is set
function isCurrentUserIdSet () {
- return ((isset($GLOBALS['current_userid'])) && ($GLOBALS['current_userid'] > 0));
+ return ((isset($GLOBALS['current_userid'])) && (isValidUserId($GLOBALS['current_userid'])));
}
// Checks wether we are debugging template cache
$data = '{--USERNAME_GUEST--}';
// Can we fetch the user data?
- if (($userid > 0) && (fetchUserData($userid, $keyColumn))) {
+ if ((isValidUserId($userid)) && (fetchUserData($userid, $keyColumn))) {
// Now get the data back
$data = getUserData($valueColumn);
} // END - if
return $GLOBALS['ap_inactive_since'];
}
+// Checks wether proxy configuration is used
+function isProxyUsed () {
+ // Do we have cache?
+ if (!isset($GLOBALS['is_proxy_used'])) {
+ // Determine it
+ $GLOBALS['is_proxy_used'] = ((getExtensionVersion('sql_patches') >= '0.4.3') && (getConfig('proxy_host') != '') && (getConfig('proxy_port') > 0));
+ } // END - if
+
+ // Return cache
+ return $GLOBALS['is_proxy_used'];
+}
+
+// Checks wether POST data contains selections
+function ifPostContainsSelections ($element = 'sel') {
+ // Do we have cache?
+ if (!isset($GLOBALS['post_contains_selections'][$element])) {
+ // Determine it
+ $GLOBALS['post_contains_selections'][$element] = (countPostSelection($element) > 0);
+ } // END - if
+
+ // Return cache
+ return $GLOBALS['post_contains_selections'][$element];
+}
+
// [EOF]
?>
if (isGetRequestParameterSet('bonusid')) $url_bid = bigintval(getRequestParameter('bonusid'));
// 01 1 12 2 2 21 1 2210
-if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDetected())) {
+if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDetected())) {
// Init result
$result_link = false;
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)) && (!ifFatalErrorsDetected())) {
+if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDetected())) {
// No image? Then output header
if ($mode != 'img') loadIncludeOnce('inc/header.php');
// Load template
loadTemplate($template, false, $content);
- } elseif ($sender > 0) {
+ } elseif (isValidUserId($sender)) {
// Wrong image code! So add points to sender's account
addPointsDirectly('mailid_payback', $sender, $payment);
setSession('refid', determineReferalId());
// Is the refid valid?
- if (determineReferalId() > 0) {
+ if (isValidUserId(determineReferalId())) {
// Update ref counter
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_clicks`=`ref_clicks`+1 WHERE `userid`=%s LIMIT 1",
array(determineReferalId()), __FILE__, __LINE__);
// Include header
loadIncludeOnce('inc/header.php');
-if ((getRequestParameter('userid') > 0) && (getRequestParameter('d') > 0) && (isGetRequestParameterSet('t'))) {
+if ((isValidUserId(getRequestParameter('userid'))) && (getRequestParameter('d') > 0) && (isGetRequestParameterSet('t'))) {
// Set row name
$t = '';
switch (getRequestParameter('t')) {