templates/de/html/install/install_page1.tpl -text
templates/de/html/install/install_page2.tpl -text
templates/de/html/install/install_page3.tpl -text
+templates/de/html/install/install_page5.tpl -text
templates/de/html/install/install_welcome.tpl -text
templates/de/html/js/.htaccess -text
templates/de/html/js/js_uberwach.tpl -text
-### WARNING: THIS FILE IS AUTO-GENERATED BY ./DOCS/todo-builder.sh (1000/quix0r) ###
+### WARNING: THIS FILE IS AUTO-GENERATED BY DOCS/todo-builder.sh (1000/quix0r) ###
### DO NOT EDIT THIS FILE. ###
./beg.php:195: // @TODO Opps, what is missing here???
./doubler.php:269:// @TODO Rewrite all constants
./inc/extensions.php:358:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) )
./inc/extensions.php:440: // @TODO Extension is loaded, what next?
./inc/footer.php:50: // @TODO Rewrite these all into filters
-./inc/functions.php:1236: // @TODO Rewrite this unnice code
-./inc/functions.php:1297: // @TODO Remove this if() block if all is working fine
-./inc/functions.php:1597: // @TODO This can be, somehow, rewritten
+./inc/functions.php:1238: // @TODO Rewrite this unnice code
+./inc/functions.php:1299: // @TODO Remove this if() block if all is working fine
+./inc/functions.php:1599: // @TODO This can be, somehow, rewritten
./inc/functions.php:214: // @TODO Remove this sanity-check if all is fine
-./inc/functions.php:2404: // @TODO The status should never be empty
-./inc/functions.php:2495: // @TODO shouldn't do the unset and the reloading $GLOBALS['cache_instance']->destroyCacheFile() Or a new methode like forceCacheReload('revision')?
+./inc/functions.php:2406: // @TODO The status should never be empty
+./inc/functions.php:2497: // @TODO shouldn't do the unset and the reloading $GLOBALS['cache_instance']->destroyCacheFile() Or a new methode like forceCacheReload('revision')?
./inc/functions.php:253: // @TODO Fine all templates which are using these direct variables and rewrite them.
./inc/functions.php:254: // @TODO After this step is done, this else-block is history
-./inc/functions.php:2558:// @TODO Please describe this function
-./inc/functions.php:2570: searchDirsRecursive($next_dir, $last_changed); // @TODO small change to API to $last_changed = searchDirsRecursive($next_dir, $time);
-./inc/functions.php:2653: // @TODO Add a little more infos here
-./inc/functions.php:2664: // @TODO This cannot be rewritten to app_die(), try to find a solution for this.
-./inc/functions.php:2822: // @TODO Are these convertions still required?
-./inc/functions.php:2840:// @TODO Rewrite this function to use readFromFile() and writeToFile()
-./inc/functions.php:475:// @TODO Rewrite this to an extension 'smtp'
+./inc/functions.php:2560:// @TODO Please describe this function
+./inc/functions.php:2572: searchDirsRecursive($next_dir, $last_changed); // @TODO small change to API to $last_changed = searchDirsRecursive($next_dir, $time);
+./inc/functions.php:2655: // @TODO Add a little more infos here
+./inc/functions.php:2666: // @TODO This cannot be rewritten to app_die(), try to find a solution for this.
+./inc/functions.php:2824: // @TODO Are these convertions still required?
+./inc/functions.php:2842:// @TODO Rewrite this function to use readFromFile() and writeToFile()
+./inc/functions.php:398: // @TODO Extension 'msg' does not exist
+./inc/functions.php:477:// @TODO Rewrite this to an extension 'smtp'
./inc/install-inc.php:20: * @TODO Rewrite all constants in this include file *
./inc/language/de.php:1159:// @TODO Rewrite these two constants
./inc/language/de.php:1175:// @TODO Rewrite these five constants
./inc/libs/rallye_functions.php:697: // @TODO Rewrite this to our API function
./inc/libs/register_functions.php:53: // @TODO Rewrite these constants
./inc/libs/register_functions.php:62: // @TODO Rewrite these constants, too
-./inc/libs/surfbar_functions.php:1481: // @TODO This can be somehow rewritten
+./inc/libs/register_functions.php:97:// @TODO This function is no longer used???
+./inc/libs/surfbar_functions.php:1495: // @TODO This can be somehow rewritten
./inc/libs/surfbar_functions.php:954: // @TODO Invalid salt should be refused
./inc/libs/task_functions.php:261: // @TODO These can be rewritten to filter
./inc/libs/task_functions.php:53:// @TODO Move all extension-dependent queries into filters
-./inc/libs/user_functions.php:317: // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content);
-./inc/libs/user_functions.php:342: // @TODO Make this filter working: $URL = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON));
-./inc/libs/user_functions.php:377: // @TODO Can this query be merged with above query?
+./inc/libs/user_functions.php:311: // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content);
+./inc/libs/user_functions.php:336: // @TODO Make this filter working: $URL = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON));
+./inc/libs/user_functions.php:371: // @TODO Can this query be merged with above query?
./inc/libs/yoomedia_functions.php:65: $response = YOOMEDIA_QUERY_API('out_textmail.php', true); // @TODO Ask Yoo!Media for test script
./inc/load_config.php:77: // @TODO Rewrite them to avoid this else block
./inc/load_extensions.php:13: * @TODO Rewrite this whole file to load_cache-extensions.php *
./inc/modules/admin/what-admins_mails.php:100: // @TODO Rewrite this constant
./inc/modules/admin/what-admins_mails.php:173: // @TODO Rewrite this constant
./inc/modules/admin/what-admins_mails.php:61: // @TODO Can this be rewritten???
-./inc/modules/admin/what-chk_regs.php:62: // @TODO Rewritings: sname->surname,fname->family,ip->REMOTE_ADDR,ref->refid,hash->user_hash in template
-./inc/modules/admin/what-chk_regs.php:81: // @TODO Rewrite this constant
+./inc/modules/admin/what-chk_regs.php:66: // @TODO Rewritings: sname->surname,fname->family,ip->REMOTE_ADDR,ref->refid,hash->user_hash in template
+./inc/modules/admin/what-chk_regs.php:85: // @TODO Rewrite this constant
./inc/modules/admin/what-config_admins.php:154: // @TODO Rewrite this to filter 'run_sqls'
./inc/modules/admin/what-config_admins.php:164: // @TODO This causes the whole (!) menu cache being rebuild
./inc/modules/admin/what-config_cache.php:94: // @TODO Rewrite all constants
./inc/modules/admin/what-config_points.php:267: // @TODO Rewritings: lvl->level, per->percents in template
./inc/modules/admin/what-config_rallye_prices.php:203: // @TODO Rewritings: level->price_level, infos->info in template
./inc/modules/admin/what-config_rallye_prices.php:220: // @TODO Rewrite these two constants
-./inc/modules/admin/what-config_rallye_prices.php:248: // @TODO Rewritings: aid->admin_id, alogin->login in template
+./inc/modules/admin/what-config_rallye_prices.php:255: // @TODO Rewritings: aid->admin_id, alogin->login in template
./inc/modules/admin/what-config_register.php:68: // @TODO Move this HTML code into a template
./inc/modules/admin/what-config_register.php:85:// @TODO Rewrite this constant
./inc/modules/admin/what-config_rewrite.php:97: // @TODO Rewrite this constant
./inc/modules/admin/what-guest_add.php:123: // @TODO This can be somehow rewritten to a function
./inc/modules/admin/what-guest_add.php:62: // @TODO Cant this be rewritten?
./inc/modules/admin/what-guest_add.php:78: // @TODO This can be somehow rewritten to a function
-./inc/modules/admin/what-guestedit.php:284: // @TODO Rewrite this constant
+./inc/modules/admin/what-guestedit.php:277: // @TODO Rewrite this constant
+./inc/modules/admin/what-list_autopurge.php:105: // @TODO Rewrite this constant
./inc/modules/admin/what-list_autopurge.php:55:// @TODO Rewrite those lines to filter
-./inc/modules/admin/what-list_autopurge.php:78: // @TODO Rewritings: sname->surname,fname->family in templates
-./inc/modules/admin/what-list_autopurge.php:98: // @TODO Rewrite this constant
+./inc/modules/admin/what-list_autopurge.php:85: // @TODO Rewritings: sname->surname,fname->family in templates
./inc/modules/admin/what-list_beg.php:85: // @TODO Rewrite templates so s/fname will be replaced by surname/family
./inc/modules/admin/what-list_beg.php:86: // @TODO to shorten this block. Please also do so with uid->userid
./inc/modules/admin/what-list_cats.php:92: // @TODO Rewrite this constant
./inc/modules/admin/what-list_rallyes.php:231: // @TODO Rewrite this constant
./inc/modules/admin/what-list_rallyes.php:255: // @TODO Rewritings: uid->userid,opoints->curr_points,old->refs in template
./inc/modules/admin/what-list_rallyes.php:309: // @TODO Rewritings: aid->admin_id in template
-./inc/modules/admin/what-list_sponsor.php:155: // @TODO Rewritings: sname->surname,fname->family,ip->remote_addr in template
-./inc/modules/admin/what-list_sponsor.php:178: // @TODO Rewrite this constant
+./inc/modules/admin/what-list_sponsor.php:168: // @TODO Rewritings: sname->surname,fname->family,ip->remote_addr in template
+./inc/modules/admin/what-list_sponsor.php:191: // @TODO Rewrite this constant
./inc/modules/admin/what-list_sponsor.php:73: // @TODO Rewrite this huge amount of constants
./inc/modules/admin/what-list_task.php:129: // @TODO Rewrite these templates to one and add $OUT
./inc/modules/admin/what-list_task.php:164: // @TODO Rewritings: admin->assigned_admin,uid->userid,type->task_type_msg in template
./inc/modules/admin/what-list_task.php:176: // @TODO Rewrite this to $OUT .= ..., true, ...
./inc/modules/admin/what-list_task.php:180: // @TODO Rewrite this to $OUT .= ..., true, ...
./inc/modules/admin/what-list_transfer.php:83:// @TODO Rewrite these constants
-./inc/modules/admin/what-list_unconfirmed.php:116: // @TODO Rewritings: uid->userid
-./inc/modules/admin/what-list_unconfirmed.php:68: // @TODO This constant might be unused?
-./inc/modules/admin/what-list_unconfirmed.php:80: // @TODO "Please do not call me directly." Should be rewritten to a nice selection depending on ext-bonus
-./inc/modules/admin/what-list_unconfirmed.php:90: // @TODO Rewrite this to $content = SQL_FETCHARRAY(), look some lines above for two differrent queries
+./inc/modules/admin/what-list_unconfirmed.php:128: // @TODO Rewritings: uid->userid
+./inc/modules/admin/what-list_unconfirmed.php:75: // @TODO This constant might be unused?
+./inc/modules/admin/what-list_unconfirmed.php:87: // @TODO "Please do not call me directly." Should be rewritten to a nice selection depending on ext-bonus
+./inc/modules/admin/what-list_unconfirmed.php:97: // @TODO Rewrite this to $content = SQL_FETCHARRAY(), look some lines above for two differrent queries
./inc/modules/admin/what-list_user.php:160: // @TODO Rewrite these to filters
./inc/modules/admin/what-list_user.php:285: // @TODO Rewrite this into a filter
./inc/modules/admin/what-list_user.php:337: // @TODO Rewrite this into a filter
./inc/modules/admin/what-lock_user.php:133: // @TODO Rewrite these all constants
./inc/modules/admin/what-logs.php:69: // @TODO Fix content-type here
./inc/modules/admin/what-logs.php:72: // @TODO Fix content-type here
-./inc/modules/admin/what-mem_add.php:121: // @TODO This can be somehow rewritten to a function
-./inc/modules/admin/what-mem_add.php:63: // @TODO Cant this be rewritten?
-./inc/modules/admin/what-mem_add.php:79: // @TODO This can be somehow rewritten to a function
-./inc/modules/admin/what-memedit.php:252: // @TODO Rewrite this constant
-./inc/modules/admin/what-memedit.php:288: // @TODO Rewrite this constant
+./inc/modules/admin/what-mem_add.php:126: // @TODO This can be somehow rewritten to a function
+./inc/modules/admin/what-mem_add.php:65: // @TODO Cant this be rewritten?
+./inc/modules/admin/what-mem_add.php:81: // @TODO This can be somehow rewritten to a function
+./inc/modules/admin/what-memedit.php:262: // @TODO Rewrite this constant
+./inc/modules/admin/what-memedit.php:298: // @TODO Rewrite this constant
./inc/modules/admin/what-payments.php:154: // @TODO Rewritings: title->mail_title, pay->payment in template
./inc/modules/admin/what-refbanner.php:127: // @TODO Rewrite this constant
./inc/modules/admin/what-refbanner.php:150: // @TODO Rewritings: alt->alternate,cnt->counter,clx->clicks in template
./inc/modules/guest/what-mediadata.php:186:// @TODO Rewrite these all if-blocks to filters
./inc/modules/guest/what-mediadata.php:49:// @TODO Rewrite all constants
./inc/modules/guest/what-mediadata.php:69: // @TODO Find a better formular than this one
-./inc/modules/guest/what-register.php:196: // @TODO Rewrite these all to a single filter
-./inc/modules/guest/what-register.php:273: // @TODO Rewrite this to a filter
+./inc/modules/guest/what-register.php:208: // @TODO Rewrite these all to a single filter
+./inc/modules/guest/what-register.php:286: // @TODO Rewrite this to a filter
+./inc/modules/guest/what-register.php:60: * @TODO Commented out, do we need this ugly code?
./inc/modules/guest/what-sponsor_infos.php:67: // @TODO Rewritings: conv->conv_rate,name->conv_name in template
./inc/modules/guest/what-sponsor_infos.php:87: // @TODO Rewritings: name->pay_name,min->pay_min_count,min->pay_min_count,curr->pay_currency
./inc/modules/guest/what-sponsor_reg.php:284: // @TODO Swap this HTML code to templates
./inc/modules/member/what-bonus.php:55: // @TODO Rewrite this to a filter
./inc/modules/member/what-categories.php:112: // @TODO Rewrite this to use $OUT .= ...
./inc/modules/member/what-mydata.php:53:// @TODO Try to rewrite this constant
-./inc/modules/member/what-order.php:411: // @TODO Rewrite this to a filter
-./inc/modules/member/what-order.php:506: // @TODO Rewrite this old lost code to a template
+./inc/modules/member/what-nickname.php:87: // @TODO Rewrite this constant
+./inc/modules/member/what-order.php:444: // @TODO Rewrite this to a filter
+./inc/modules/member/what-order.php:543: // @TODO Rewrite this old lost code to a template
./inc/modules/member/what-payout.php:132: // @TODO Rewritings: acc->target_account,bank->target_bank in templates
./inc/modules/member/what-payout.php:148: // @TODO Rewrite this constant
./inc/modules/member/what-payout.php:182: // @TODO Rewrite these constants
./inc/modules/member/what-payout.php:235: // @TODO Rewrite this to a filter
./inc/modules/member/what-points.php:54:// @TODO Should we rewrite this to a filter?
./inc/modules/member/what-reflinks.php:105: // @TODO Rewritings: alt->alternate,cnt->counter,cks->clicks,uid->userid in template
-./inc/modules/member/what-transfer.php:116: // @TODO Rewrite all these constants to array elements
-./inc/modules/member/what-transfer.php:247: // @TODO Try to rewrite his to $content = SQL_FETCHARRAY(), see some lines above for two different queries
-./inc/modules/member/what-transfer.php:309: // @TODO Rewrite these constants
-./inc/modules/member/what-transfer.php:317: // @TODO Rewrite these constants
-./inc/modules/member/what-transfer.php:329: // @TODO This should be somehow rewritten to $content = SQL_FETCHARRAY(), see switch() block above for SQL queries
-./inc/modules/member/what-transfer.php:364: // @TODO Rewrite these constants
-./inc/modules/member/what-transfer.php:451: // @TODO Rewrite all these constants
+./inc/modules/member/what-transfer.php:115: // @TODO Rewrite all these constants to array elements
+./inc/modules/member/what-transfer.php:246: // @TODO Try to rewrite his to $content = SQL_FETCHARRAY(), see some lines above for two different queries
+./inc/modules/member/what-transfer.php:308: // @TODO Rewrite these constants
+./inc/modules/member/what-transfer.php:316: // @TODO Rewrite these constants
+./inc/modules/member/what-transfer.php:328: // @TODO This should be somehow rewritten to $content = SQL_FETCHARRAY(), see switch() block above for SQL queries
+./inc/modules/member/what-transfer.php:363: // @TODO Rewrite these constants
+./inc/modules/member/what-transfer.php:450: // @TODO Rewrite all these constants
./inc/modules/member/what-unconfirmed.php:134: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
+./inc/modules/order.php:76: // @TODO Unused: 2,4
+./inc/monthly/monthly_bonus.php:71: // @TODO Rewrite this to a filter
./inc/mysql-manager.php:1574: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
./inc/mysql-manager.php:1617: // @TODO Rewrite this to a filter
./inc/mysql-manager.php:1769: // @TODO Rewrite this to a filter
./mailid_top.php:223: // @TODO Rewrite these constants
./mailid_top.php:228: // @TODO Rewrite these blocks to filter
./mailid_top.php:89: // @TODO Rewrite this to a filter
-./show_bonus.php:104: // @TODO Rewrite this constant
+./show_bonus.php:108: // @TODO Rewrite this constant
./surfbar.php:73: // @TODO Display quick login form here or redirect as configured
### ### DEPRECATION FOLLOWS: ### ###
./inc/functions.php:238: // @DEPRECATED Try to rewrite the if() condition
if (''.(REQUEST_GET('uid') + 0).'' !== ''.REQUEST_GET('uid').'') {
if (EXT_IS_ACTIVE('nickname')) {
// Maybe we have found a nickname?
- $result = SQL_QUERY_ESC("SELECT userid, beg_clicks, ref_payout, status, last_online FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' LIMIT 1",
- array(REQUEST_GET('uid')), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `userid`, `beg_clicks`, `ref_payout`, `status`, `last_online` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `nickname`='%s' LIMIT 1",
+ array(REQUEST_GET('uid')), __FILE__, __LINE__);
} else {
// Nickname entered but nickname is not active
$msg = getCode('EXTENSION_PROBLEM');
}
} else {
// Direct userid
- $result = SQL_QUERY_ESC("SELECT userid, beg_clicks, ref_payout, status, last_online FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(bigintval(REQUEST_GET('uid'))), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `userid`, `beg_clicks`, `ref_payout`, `status`, `last_online` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
+ array(bigintval(REQUEST_GET('uid'))), __FILE__, __LINE__);
}
// Check if locked in so don't pay points
// User id valid and not webmaster's id?
if (($uid > 0) && (getConfig('beg_uid') != $uid)) {
// Update counter
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET beg_clicks=beg_clicks+1 WHERE userid=%s AND `status`='CONFIRMED' LIMIT 1",
- array($uid), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `beg_clicks`=`beg_clicks`+1 WHERE `userid`=%s AND `status`='CONFIRMED' LIMIT 1",
+ array($uid), __FILE__, __LINE__);
// Check for last entry for userid w/o IP number
$result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_beg_ips` WHERE (timeout > (UNIX_TIMESTAMP() - ".getConfig('beg_timeout').") OR (timeout > (UNIX_TIMESTAMP() - ".getConfig('beg_uid_timeout').") AND `userid`=%s)) AND (remote_ip='%s' OR sid='%s') LIMIT 1",
// Check if link is not clicked so far
$result = SQL_QUERY_ESC("SELECT b.points, d.gender, d.surname, d.family, d.status, d.ref_payout
-FROM `{!_MYSQL_PREFIX!}_user_birthday` AS b
-INNER JOIN `{!_MYSQL_PREFIX!}_user_data` AS d
-ON b.userid=d.userid
-WHERE b.userid=%s AND b.chk_value='%s' LIMIT 1",
-array($uid, $chk), __FILE__, __LINE__);
+FROM
+ `{!_MYSQL_PREFIX!}_user_birthday` AS b
+INNER JOIN
+ `{!_MYSQL_PREFIX!}_user_data` AS d
+ON
+ b.userid=d.userid
+WHERE
+ b.userid=%s AND b.chk_value='%s'
+LIMIT 1",
+ array($uid, $chk), __FILE__, __LINE__);
//* DEBUG: */ echo "uid=".$uid.",chk=".$chk." (".strlen($chk).'/'.strlen(REQUEST_GET('check')).'/'.SQL_NUMROWS($result).")<br />\n";
// Prepare content
} // END - if
// Is the request parameter set?
- if (REQUEST_ISSET_POST(('request'))) {
+ if (REQUEST_ISSET_POST('request')) {
// Handle the request
if (DEBUG_HANDLE_REQUEST(REQUEST_POST('request'))) {
// Construct FQFN for the module
$INC = sprintf("inc/debug/%s/request_%s",
- getConfig('debug_mode'),
- SQL_ESCAPE(REQUEST_POST('request'))
+ getConfig('debug_mode'),
+ SQL_ESCAPE(REQUEST_POST('request'))
);
// Is the module there? Else we log it!
} // END - if
// Probe for referal ID
-if (REQUEST_ISSET_GET(('refid'))) $GLOBALS['refid'] = REQUEST_GET(('refid'));
+if (REQUEST_ISSET_GET('refid')) $GLOBALS['refid'] = REQUEST_GET('refid');
// Only check this if refid is provided!
if ($GLOBALS['refid'] > 0) {
// Do we have nickname or userid set?
if (isNicknameUsed($GLOBALS['refid'])) {
// Nickname in URL, so load the ID
- $result = SQL_QUERY_ESC("SELECT userid, status FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' LIMIT 1",
- array(bigintval($GLOBALS['refid'])), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `userid`, `status` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `nickname`='%s' LIMIT 1",
+ array(bigintval($GLOBALS['refid'])), __FILE__, __LINE__);
} else {
// Direct userid entered
- $result = SQL_QUERY_ESC("SELECT userid, status FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(bigintval($GLOBALS['refid'])), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT userid, status FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
+ array(bigintval($GLOBALS['refid'])), __FILE__, __LINE__);
}
// Load data
REQUEST_SET_POST('points', bigintval(REQUEST_POST('points')));
// Begin with doubling process
- if ((REQUEST_ISSET_POST(('userid'))) && (REQUEST_ISSET_POST(('pass'))) && (REQUEST_ISSET_POST(('points')))) {
+ if ((REQUEST_ISSET_POST('userid')) && (REQUEST_ISSET_POST('pass')) && (REQUEST_ISSET_POST('points'))) {
// Probe for nickname extension and if a nickname was entered
if (isNickNameUsed(REQUEST_POST('userid'))) {
// Nickname in URL, so load the ID
- $result = SQL_QUERY_ESC("SELECT userid, status, password FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' LIMIT 1",
- array(REQUEST_POST('userid')), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `userid`, `status`, `password` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `nickname`='%s' LIMIT 1",
+ array(REQUEST_POST('userid')), __FILE__, __LINE__);
} else {
// Direct userid entered
- $result = SQL_QUERY_ESC("SELECT userid, status, password FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(bigintval(REQUEST_POST('userid'))), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `userid`, `status, `password` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
+ array(bigintval(REQUEST_POST('userid'))), __FILE__, __LINE__);
}
// Load data
if (($points - getConfig('doubler_left') - REQUEST_POST('points') * getConfig('doubler_charge')) >= 0)
// Enough points are left so let's continue with the doubling process
// Create doubling "account" width *DOUBLED* points
- SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_doubler` (userid, refid, points, remote_ip, timemark, completed, is_ref) VALUES ('%s','%s','%s','".detectRemoteAddr()."', UNIX_TIMESTAMP(), 'N','N')",
- array($uid, bigintval($GLOBALS['refid']), bigintval(REQUEST_POST('points') * 2)), __FILE__, __LINE__);
+ SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_doubler` (`userid`, `refid`, `points`, `remote_ip`, `timemark`, `completed`, `is_ref`) VALUES ('%s','%s','%s','".detectRemoteAddr()."', UNIX_TIMESTAMP(), 'N','N')",
+ array($uid, bigintval($GLOBALS['refid']), bigintval(REQUEST_POST('points') * 2)), __FILE__, __LINE__);
// Subtract entered points
SUB_POINTS('doubler', $uid, REQUEST_POST('points'));
// Add second line for the referal but only when uid != refid
if (($GLOBALS['refid'] > 0) && ($GLOBALS['refid'] != $uid)) {
// 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(
- bigintval($GLOBALS['refid']),
- bigintval(REQUEST_POST('points') * 2 * getConfig('doubler_ref'))
- ), __FILE__, __LINE__);
+ 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(
+ bigintval($GLOBALS['refid']),
+ bigintval(REQUEST_POST('points') * 2 * getConfig('doubler_ref'))
+ ), __FILE__, __LINE__);
// And that's why we don't want to you more than one referal level of doubler-points. ^^^
} // END - if
// Wrong password or account not found
define('__ERROR_MSG', getMessage('DOUBLER_FORM_404_MEMBER'));
}
- } elseif (!REQUEST_ISSET_POST(('userid'))) {
+ } elseif (!REQUEST_ISSET_POST('userid')) {
// Login not entered
define('__ERROR_MSG', getMessage('DOUBLER_FORM_404_LOGIN'));
- } elseif (!REQUEST_ISSET_POST(('pass'))) {
+ } elseif (!REQUEST_ISSET_POST('pass')) {
// Password not entered
define('__ERROR_MSG', getMessage('DOUBLER_FORM_404_PASSWORD'));
- } elseif (!REQUEST_ISSET_POST(('points'))) {
+ } elseif (!REQUEST_ISSET_POST('points')) {
// points not entered
define('__ERROR_MSG', getMessage('DOUBLER_FORM_404_POINTS'));
}
loadIncludeOnce('inc/header.php');
// Code set?
-if (REQUEST_ISSET_GET(('code'))) {
+if (REQUEST_ISSET_GET('code')) {
// Generate image
GENERATE_IMAGE(bigintval(REQUEST_GET('code')));
} elseif (REQUEST_ISSET_GET('tag')) {
// Tag set so create the IFN (Include-FileName)
$INC = sprintf("inc/img/tag-%s.php",
- REQUEST_GET('tag')
+ REQUEST_GET('tag')
);
// Include is readable?
// Init SQLs
INIT_SQLS();
- // Ok, let's have a look...
- $since = getConfig(('ap_inactive_since'));
-
// Init exclusion list
$EXCLUDE_LIST = '';
if (getConfig('def_refid') > 0) {
FROM `{!_MYSQL_PREFIX!}_user_data` AS d
WHERE d.`status`='CONFIRMED' AND d.joined < (UNIX_TIMESTAMP() - %s) AND d.last_online < (UNIX_TIMESTAMP() - %s) AND d.ap_notified < (UNIX_TIMESTAMP() - %s)
".$EXCLUDE_LIST."
-ORDER BY d.userid", array($since, $since, $since), __FILE__, __LINE__);
+ORDER BY d.userid",
+ array(,
+ getConfig('ap_inactive_since'),
+ getConfig('ap_inactive_since'),
+ getConfig('ap_inactive_since')
+ ), __FILE__, __LINE__);
if (SQL_NUMROWS($result_inactive) > 0) {
// Prepare variables and constants...
sendEmail($content['email'], getMessage('AUTOPURGE_MEMBER_INACTIVE_SUBJECT'), $msg);
// Update this account
- ADD_SQL(SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET ap_notified=UNIX_TIMESTAMP() WHERE userid=%s LIMIT 1",
- array(bigintval($content['userid'])), __FILE__, __LINE__, false));
+ ADD_SQL(SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `ap_notified`=UNIX_TIMESTAMP() WHERE `userid`=%s LIMIT 1",
+ array(bigintval($content['userid'])), __FILE__, __LINE__, false));
} // END - while
// Remove last comma
$UIDs = str_replace(", ", "\n", substr($UIDs, 0, -2));
// Send mail notification to admin
- sendAdminNotification(getMessage('AUTOPURGE_ADMIN_INACTIVE_SUBJECT'), "admin_autopurge_inactive", $UIDs, '');
+ sendAdminNotification(getMessage('AUTOPURGE_ADMIN_INACTIVE_SUBJECT'), 'admin_autopurge_inactive', $UIDs, '');
} // END - if
// Free memory
// Now let's have a look for inactive accounts we want to delete we newly use the same exclude list
// here for e.g. excluding holiday users
- $time = getConfig(('ap_in_time'));
$result_inactive = SQL_QUERY_ESC("SELECT d.userid, d.email, d.last_online
FROM `{!_MYSQL_PREFIX!}_user_data` AS d
-WHERE `status`='CONFIRMED' AND joined < (UNIX_TIMESTAMP() - %s) AND `last_online` < (UNIX_TIMESTAMP() - %s) AND ap_notified < (UNIX_TIMESTAMP() - %s)
+WHERE `status`='CONFIRMED' AND `joined` < (UNIX_TIMESTAMP() - %s) AND `last_online` < (UNIX_TIMESTAMP() - %s) AND `ap_notified` < (UNIX_TIMESTAMP() - %s)
".$EXCLUDE_LIST."
ORDER BY `userid` ASC",
- array($since, $since, $time), __FILE__, __LINE__);
+ array(
+ getConfig('ap_inactive_since'),
+ getConfig('ap_inactive_since'),
+ getConfig('ap_in_time')
+ ), __FILE__, __LINE__);
+
if (SQL_NUMROWS($result_inactive) > 0) {
// Prepare variable...
$UIDs = '';
// Delete inactive accounts
while ($content = SQL_FETCHARRAY($result_inactive)) {
// Remember userids for the admin
- $UIDs .= $content['userid'].", ";
+ $UIDs .= $content['userid'] . ', ';
// Get date/time from timestamp
$content['last_online'] = generateDateTime($content['last_online'], '0');
// Finnaly delete this inactive account
- deleteUserAccount($content['userid'], LOAD_EMAIL_TEMPLATE("member_autopurge_delete", $content['last_online'], ''));
+ deleteUserAccount($content['userid'], LOAD_EMAIL_TEMPLATE('member_autopurge_delete', $content['last_online'], ''));
} // END - while
// Remove last comma
// Send mail notification to admin
if (getConfig('ap_in_notify') == 'Y') {
- sendAdminNotification(getMessage('AUTOPURGE_ADMIN_DELETE_SUBJECT'), "admin_autopurge_delete", $UIDs, '');
+ sendAdminNotification(getMessage('AUTOPURGE_ADMIN_DELETE_SUBJECT'), 'admin_autopurge_delete', $UIDs, '');
} // END - if
} // END - if
// Search for mails from deleted members?
if (getConfig('ap_del_mails') == 'Y') {
// Okay, let's check for them...
- $since = getConfig(('ap_dm_timeout'));
- $result_mails = SQL_QUERY_ESC("SELECT sender
+ $result_mails = SQL_QUERY_ESC("SELECT `sender`
FROM `{!_MYSQL_PREFIX!}_pool`
-WHERE data_type='DELETED' AND timestamp <= (UNIX_TIMESTAMP() - %s)
-ORDER BY sender ASC",
- array($since), __FILE__, __LINE__);
+WHERE data_type='DELETED' AND `timestamp` <= (UNIX_TIMESTAMP() - %s)
+ORDER BY `sender` ASC",
+ array(getConfig('ap_dm_timeout')), __FILE__, __LINE__);
// Reset counter...
$DELETED = 0;
// Okay, check for their sender's
while ($content = SQL_FETCHARRAY($result_mails)) {
// Check now...
- $fount = SQL_NUMROWS(SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
+ $fount = SQL_NUMROWS(SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
array(bigintval($content['sender'])), __FILE__, __LINE__));
if ($found == 0) {
// Okay we found some mails!
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_pool` WHERE sender=%s",
- array(bigintval($content['sender'])), __FILE__, __LINE__);
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_pool` WHERE `sender`=%s",
+ array(bigintval($content['sender'])), __FILE__, __LINE__);
$DELETED += SQL_AFFECTEDROWS();
- // Reset query (to prevent possible errors) ...
- $since = getConfig(('ap_dm_timeout'));
- $result_mails = SQL_QUERY_ESC("SELECT sender
+ // Reset query (to prevent possible errors) ...;
+ $result_mails = SQL_QUERY_ESC("SELECT `sender`
FROM `{!_MYSQL_PREFIX!}_pool`
WHERE data_type='DELETED' AND timestamp <= (UNIX_TIMESTAMP() - %s)
-ORDER BY sender ASC",
- array($since), __FILE__, __LINE__);
+ORDER BY `sender` ASC",
+ array(getConfig('ap_dm_timeout')), __FILE__, __LINE__);
}
}
}
// Free memory
SQL_FREERESULT($result_mails);
- // Now let's check for stats entries as well
- $since = getConfig(('ap_dm_timeout'));
- $result_mails = SQL_QUERY_ESC("SELECT sender
+ // Now let's check for stats entries as well;
+ $result_mails = SQL_QUERY_ESC("SELECT `sender`
FROM `{!_MYSQL_PREFIX!}_user_stats`
-WHERE data_type='DELETED' AND timestamp_send <= (UNIX_TIMESTAMP() - %s)
-ORDER BY sender ASC",
- array($since), __FILE__, __LINE__);
+WHERE `data_type`='DELETED' AND `timestamp_send` <= (UNIX_TIMESTAMP() - %s)
+ORDER BY `sender` ASC",
+ array(getConfig('ap_dm_timeout')), __FILE__, __LINE__);
// Do we have "purged" mails?
if (SQL_NUMROWS($result_mails) > 0) {
// Okay, check for their sender's
while ($content = SQL_FETCHARRAY($result_mails)) {
// Check now...
- $found = SQL_NUMROWS(SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($content['sender'])), __FILE__, __LINE__));
+ $found = SQL_NUMROWS(SQL_QUERY_ESC("SELECT `userid` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
+ array(bigintval($content['sender'])), __FILE__, __LINE__));
if ($found == 0) {
// Okay we found some mails!
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE sender=%s", array(bigintval($content['sender'])), __FILE__, __LINE__);
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE `sender`=%s",
+ array(bigintval($content['sender'])), __FILE__, __LINE__);
$DELETED += SQL_AFFECTEDROWS();
// Reset query (to prevent possible errors) ...
- $since = getConfig(('ap_dm_timeout'));
- $result_mails = SQL_QUERY_ESC("SELECT sender
+ $result_mails = SQL_QUERY_ESC("SELECT `sender`
FROM `{!_MYSQL_PREFIX!}_user_stats`
WHERE data_type='DELETED' AND timestamp_send <= (UNIX_TIMESTAMP() - %s)
-ORDER BY sender ASC",
- array($since), __FILE__, __LINE__);
+ORDER BY `sender` ASC",
+ array(getConfig('ap_dm_timeout')), __FILE__, __LINE__);
}
}
}
// Do we have deleted mails and the admin want's to receive a notification
if (($DELETED > 0) && (getConfig('ap_dm_notify') == 'Y')) {
// Send out email to admin
- sendAdminNotification(getMessage('AUTOPURGE_ADMIN_DEL_MAILS_SUBJECT'), "admin_autopurge_del_mails", $DELETED, '');
+ sendAdminNotification(getMessage('AUTOPURGE_ADMIN_DEL_MAILS_SUBJECT'), 'admin_autopurge_del_mails', $DELETED, '');
} // END - if
}
// Check version (must be > 0.0)
if ((GET_EXT_VERSION('task') > '0.0') && (getConfig('ap_tasks') == 'Y')) {
- // Since when shall we purge?
- $since = getConfig(('ap_tasks_time'));
-
// Purge deleted tasks (no notification to admin)
SQL_QUERY_ESC("DELETE LOW_PRIORITY
FROM `{!_MYSQL_PREFIX!}_task_system`
-WHERE `status`='DELETED' AND task_created <= (UNIX_TIMESTAMP() - %s)",
- array($since), __FILE__, __LINE__);
+WHERE `status`='DELETED' AND `task_created` <= (UNIX_TIMESTAMP() - %s)",
+ array(getConfig('ap_tasks_time')), __FILE__, __LINE__);
// Get deleted rows
$DELETED = SQL_AFFECTEDROWS();
// Shall I auto-purge unconfirmed accounts?
if (getConfig('autopurge_unconfirmed') == 'Y') {
- // Init variables and find unconfirmed accounts which I shall auto-purge
- $time = getConfig(('ap_un_time'));
- $result_uncon = SQL_QUERY_ESC("SELECT userid, email, joined
+ // Init variables and find unconfirmed accounts which I shall auto-purge;
+ $result_uncon = SQL_QUERY_ESC("SELECT `userid`, `email`, `joined`
FROM `{!_MYSQL_PREFIX!}_user_data`
-WHERE `status`='UNCONFIRMED' AND joined < (UNIX_TIMESTAMP() - %s)
-ORDER BY userid ASC",
- array($time), __FILE__, __LINE__);
+WHERE `status`='UNCONFIRMED' AND `joined` < (UNIX_TIMESTAMP() - %s)
+ORDER BY `userid` ASC",
+ array(getConfig('ap_un_time')), __FILE__, __LINE__);
if (SQL_NUMROWS($result_uncon) > 0) {
// Prepare variable...
$UIDs = '';
// Delete inactive accounts
while ($content = SQL_FETCHARRAY($result_uncon)) {
// Remember userids for the admin
- $UIDs .= $content['userid'].", ";
+ $UIDs .= $content['userid'] . ', ';
// Get date/time from timestamp
$content['joined'] = generateDateTime($content['joined'], '0');
// Finnaly delete this inactive account
- deleteUserAccount($content['userid'], LOAD_EMAIL_TEMPLATE("member_autopurge_unconfirmed", $content['joined'], ''));
+ deleteUserAccount($content['userid'], LOAD_EMAIL_TEMPLATE('member_autopurge_unconfirmed', $content['joined'], ''));
} // END - while
// Remove last comma
// Send mail notification to admin
if (getConfig('ap_un_notify') == 'Y') {
- sendAdminNotification(getMessage('AUTOPURGE_ADMIN_UNCONFIRMED_SUBJECT'), "admin_autopurge_unconfirmed", $UIDs, '');
+ sendAdminNotification(getMessage('AUTOPURGE_ADMIN_UNCONFIRMED_SUBJECT'), 'admin_autopurge_unconfirmed', $UIDs, '');
} // END - if
} // END - if
}
// Shall we run the reset scripts? If a day has changed, maybe also a week/month has changed... Simple! :D
-// 01 2 3 32 2 3321 1 221 1 221 1 221 1 23 321 1 10
-if ((date('d', getConfig('last_update')) != date('d', time())) && (!isInstalling()) && (isInstalled()) && (isAdminRegistered()) && (!REQUEST_ISSET_GET(('register'))) && (getOutputMode() != 1)) {
+// 01 2 3 32 2 3321 1 221 1 221 1 221 1 2 21 1 22 10
+if ((date('d', getConfig('last_update')) != date('d', time())) && (!isInstalling()) && (isInstalled()) && (isAdminRegistered()) && (!REQUEST_ISSET_GET('register')) && (getOutputMode() != 1)) {
// Tell every module we are in reset-mode!
enableResetMode();
incrementConfigEntry('db_hits', getConfig('db_hits_run'));
// Update counter for db/cache
- updateConfiguration(array('db_hits', 'cache_hits'), array(getConfig(('db_hits')), getConfig(('cache_hits'))));
+ updateConfiguration(array('db_hits', 'cache_hits'), array(getConfig('db_hits'), getConfig('cache_hits')));
} // END - if
// Close database link and forget the link
- $close = mysql_close(SQL_GET_LINK()) or addFatalMessage(__FUNCTION__, __LINE__, $F." (".$L."):".mysql_error());
+ $close = mysql_close(SQL_GET_LINK())
+ or addFatalMessage(__FUNCTION__, __LINE__, $F . ' (' . $L . '):'.mysql_error());
// Close link
SQL_SET_LINK(null);
$query = 'failed';
if ($strip === true) {
- $strip = "true";
+ $strip = 'true';
} else {
- $strip = "false";
+ $strip = 'false';
}
if ($secure === true) {
- $secure = "true";
+ $secure = 'true';
} else {
- $secure = "false";
+ $secure = 'false';
}
$eval = "\$query = sprintf(\"".$qstring."\"";
}
} // END - foreach
$eval .= ");";
- //
+
// Debugging
//
//* DEBUG: */ $fp = fopen(constant('PATH')."inc/cache/escape_debug.log", 'a') or app_die(__FILE__, __LINE__, "Cannot write debug.log!");
// Was the eval() command fine?
if ($query == 'failed') {
// Something went wrong?
- debug_report_bug("eval={$eval}");
+ debug_report_bug('eval=' . $eval);
} // END - if
if ($run === true) {
// Determine index/fulltext/unique word
$noIndex = (
(
- strpos($sql, 'INDEX') === false
+ strpos($sql, 'INDEX') === false
) && (
- strpos($sql, 'FULLTEXT') === false
+ strpos($sql, 'FULLTEXT') === false
) && (
- strpos($sql, 'UNIQUE') === false
+ strpos($sql, 'UNIQUE') === false
)
);
$columnName = str_replace('`', '', $tableArray[4]);
// Get column information
- $result = SQL_QUERY_ESC("SHOW COLUMNS FROM %s LIKE '%s'",
- array($tableName, $columnName), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SHOW COLUMNS FROM `%s` LIKE '%s'",
+ array($tableName, $columnName), __FILE__, __LINE__);
// Do we have no entry on ADD or an entry on DROP?
// 123 4 4 3 3 4 4 32 23 4 4 3 3 4 4 321
// Show indexes
$result = SQL_QUERY_ESC("SHOW INDEX FROM `%s`",
- array($tableName), __FILE__, __LINE__);
+ array($tableName), __FILE__, __LINE__);
// Walk through all
$skip = false;
if (empty($GLOBALS['doubler_uid'])) $GLOBALS['doubler_uid'] = 0;
// Check for doubles which we can pay out
-$min = getConfig(('doubler_min') * 2);
$result_total = SQL_QUERY_ESC("SELECT DISTINCT d.id, d.userid, d.points, d.remote_ip, d.timemark
FROM `{!_MYSQL_PREFIX!}_doubler` AS d
LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS u
ON d.userid=u.userid
WHERE u.`status`='CONFIRMED' AND d.points <= %s AND d.points >= %s AND d.completed='N' AND d.is_ref='N'
-ORDER BY d.timemark", array($DOUBLER_POINTS, $min), __FILE__, __LINE__);
+ORDER BY d.timemark",
+ array(
+ $DOUBLER_POINTS,
+ getConfig(('doubler_min') * 2)
+ ), __FILE__, __LINE__);
// Check for accounts with limitation
$result_main = SQL_QUERY_ESC("SELECT DISTINCT d.id, d.userid, d.points, d.remote_ip, d.timemark
ON d.userid=u.userid
WHERE u.`status`='CONFIRMED' AND d.points <= %s AND d.points >= %s AND d.completed='N' AND d.is_ref='N'
ORDER BY d.timemark
-LIMIT %d", array($DOUBLER_POINTS, $min, getConfig('doubler_max_sent')), __FILE__, __LINE__);
+LIMIT %d",
+ array(
+ $DOUBLER_POINTS,
+ getConfig(('doubler_min') * 2),
+ getConfig('doubler_max_sent')
+ ), __FILE__, __LINE__);
// Do we have entries found?
if (((SQL_NUMROWS($result_total) > 0) && (getConfig('doubler_sent_all') == 'Y')) || ((SQL_NUMROWS($result_main) == getConfig('doubler_group_sent')) && (getConfig('doubler_sent_all') != 'Y'))) {
// Only double when points are enougth!
if ($DOUBLER_POINTS >= $content['points']) {
// Check for his ref points
- $ref = GET_TOTAL_DATA($content['userid'], 'doubler', 'points', 'refid', false, " AND completed='N' AND is_ref='Y'");
+ $ref = GET_TOTAL_DATA($content['userid'], 'doubler', 'points', 'refid', false, " AND `completed`='N' AND `is_ref`='Y'");
// Zero refid when empty (might be helpful!)
if (empty($ref)) $ref = 0;
if (($ref > 0) && ($GLOBALS['doubler_uid'] == $content['userid']) && (!empty($ref))) {
// Referal points found so add them and set line(s) to completed='Y'
$content['points'] += $ref;
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_doubler` SET completed='Y' WHERE refid=%s AND completed='N' AND is_ref='Y'",
- array(bigintval($content['userid'])), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_doubler` SET `completed`='Y' WHERE `refid`=%s AND `completed`='N' AND `is_ref`='Y'",
+ array(bigintval($content['userid'])), __FILE__, __LINE__);
} else {
// No referal points found
$ref = 0;
} // END - if
// Set entry as "payed"
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_doubler` SET completed='Y' WHERE `id`=%s LIMIT 1",
- array(bigintval($content['id'])), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_doubler` SET `completed`='Y' WHERE `id`=%s LIMIT 1",
+ array(bigintval($content['id'])), __FILE__, __LINE__);
$okay = false;
+
// Check for jackpot inclusion in doubling process
if (($jackpot > 0) && ($jackpot >= $content['points']) && (getConfig('doubler_jackpot') == 'Y')) {
// Subtract points from jackpot
} // END - if
// Exclude also webmaster's ID in taking points from webmaster's account
- if (($user > 0) && ($user >= $content['points']) && (!$okay) && (getConfig('doubler_uid') > 0) && ($content['userid'] != getConfig('doubler_uid'))) {
+ if (($user > 0) && ($user >= $content['points']) && ($okay === false) && (getConfig('doubler_uid') > 0) && ($content['userid'] != getConfig('doubler_uid'))) {
// Add points to used points
- SUB_POINTS("doubler_payout", getConfig('doubler_uid'), $content['points']);
+ SUB_POINTS('doubler_payout', getConfig('doubler_uid'), $content['points']);
// Okay, done!
$okay = true;
} // END - if
// Update doubler's account only when others are not updated
- if (!$okay) {
+ if ($okay === false) {
// Add points to used doubler points
updateConfiguration('doubler_used', $content['points'], '+');
} // END - if
// Prepare array
$content = array(
- // Doubler transmission ID
+ // Doubler transmission ID
'id' => $content['id'],
- // Doubled points
+ // Doubled points
'points' => translateComma($content['points']),
- // Timemark
+ // Timemark
'when' => generateDateTime($content['timemark'], '2'),
- // IP number when the member submitted the doubling form
+ // IP number when the member submitted the doubling form
'ip' => $content['remote_ip'],
);
// Load mail template and send mail away...
- $msg = LOAD_EMAIL_TEMPLATE("member_doubler", $content, $content['userid']);
+ $msg = LOAD_EMAIL_TEMPLATE('member_doubler', $content, $content['userid']);
sendEmail($content['userid'], getMessage('DOUBLER_MEMBER_SUBJECT'), $msg);
} // END - if
} // END - while
}
// "Runs" the given filters, data is optional and can be any type of data
-function runFilterChain ($filterName, $data = null, $silentAbort = true) {
+function runFilterChain ($filterName, $data = null) {
// Is that filter chain there?
if (!isset($GLOBALS['filters']['chains'][$filterName])) {
// We should find all these non-existing filter chains
eval($eval);
// Set from header
- if ((!eregi("@", $toEmail)) && ($toEmail > 0)) {
+ if ((!eregi('@', $toEmail)) && ($toEmail > 0)) {
// Value detected, is the message extension installed?
- if (EXT_IS_ACTIVE("msg")) {
+ // @TODO Extension 'msg' does not exist
+ if (EXT_IS_ACTIVE('msg')) {
ADD_MESSAGE_TO_BOX($toEmail, $subject, $message, $HTML);
return;
} else {
// Load email address
- $result_email = SQL_QUERY_ESC("SELECT email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($toEmail)), __FUNCTION__, __LINE__);
+ $result_email = SQL_QUERY_ESC("SELECT `email` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
+ array(bigintval($toEmail)), __FUNCTION__, __LINE__);
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):numRows=".SQL_NUMROWS($result_email)."<br />\n";
// Does the user exist?
$keys = getConfig('SITE_KEY').getConfig('ENCRYPT_SEPERATOR').getConfig('DATE_KEY');
if (isConfigEntrySet('secret_key')) $keys .= getConfig('ENCRYPT_SEPERATOR').getConfig('secret_key');
if (isConfigEntrySet('file_hash')) $keys .= getConfig('ENCRYPT_SEPERATOR').getConfig('file_hash');
- $keys .= getConfig('ENCRYPT_SEPERATOR').date("d-m-Y (l-F-T)", getConfig(('patch_ctime')));
+ $keys .= getConfig('ENCRYPT_SEPERATOR') . date("d-m-Y (l-F-T)", getConfig('patch_ctime'));
if (isConfigEntrySet('master_salt')) $keys .= getConfig('ENCRYPT_SEPERATOR').getConfig('master_salt');
// Build string from misc data
}
// Generate an email link
-function generateMemberEmailLink ($email, $table = 'admins') {
+function generateEmailLink ($email, $table = 'admins') {
// Default email link (INSECURE! Spammer can read this by harvester programs)
$EMAIL = 'mailto:' . $email;
// Check for several extensions
if ((EXT_IS_ACTIVE('admins')) && ($table == 'admins')) {
// Create email link for contacting admin in guest area
- $EMAIL = adminsCreateEmailLink($email);
+ $EMAIL = generateAdminEmailLink($email);
} elseif ((EXT_IS_ACTIVE('user')) && (GET_EXT_VERSION('user') >= '0.3.3') && ($table == 'user_data')) {
// Create email link for contacting a member within admin area (or later in other areas, too?)
- $EMAIL = USER_generateMemberEmailLink($email);
+ $EMAIL = generateEmailLink($email, 'user_data');
} elseif ((EXT_IS_ACTIVE('sponsor')) && ($table == 'sponsor_data')) {
// Create email link to contact sponsor within admin area (or like the link above?)
- $EMAIL = SPONSOR_generateMemberEmailLink($email);
+ $EMAIL = generateEmailLink($email, 'sponsor_data');
}
// Shall I close the link when there is no admin?
$server = $_SERVER['PHP_SELF'].getConfig('ENCRYPT_SEPERATOR').detectUserAgent().getConfig('ENCRYPT_SEPERATOR').getenv('SERVER_SOFTWARE').getConfig('ENCRYPT_SEPERATOR').detectRemoteAddr();
// Build key string
- $keys = getConfig('SITE_KEY').getConfig('ENCRYPT_SEPERATOR').getConfig('DATE_KEY').getConfig('ENCRYPT_SEPERATOR').getConfig('secret_key').getConfig('ENCRYPT_SEPERATOR').getConfig('file_hash').getConfig('ENCRYPT_SEPERATOR').date("d-m-Y (l-F-T)", getConfig(('patch_ctime'))).getConfig('ENCRYPT_SEPERATOR').getConfig('master_salt');
+ $keys = getConfig('SITE_KEY').getConfig('ENCRYPT_SEPERATOR').getConfig('DATE_KEY').getConfig('ENCRYPT_SEPERATOR').getConfig('secret_key').getConfig('ENCRYPT_SEPERATOR').getConfig('file_hash').getConfig('ENCRYPT_SEPERATOR').date("d-m-Y (l-F-T)", getConfig('patch_ctime')).getConfig('ENCRYPT_SEPERATOR').getConfig('master_salt');
// Additional data
$data = $plainText.getConfig('ENCRYPT_SEPERATOR').uniqid(mt_rand(), true).getConfig('ENCRYPT_SEPERATOR').time();
// Is the extension there?
if (EXT_IS_ACTIVE('admins')) {
// Admin found
- $admin = "<a href=\"".adminsCreateEmailLink(getAdminEmail($aid))."\">" . $login."</a>";
+ $admin = "<a href=\"".generateEmailLink(getAdminEmail($aid), 'admins')."\">" . $login."</a>";
} else {
// Extension not found
$admin = sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'admins');
$tmp = $FQFN . '.tmp';
// Open the source file
- $fp = fopen($FQFN, 'r') or OUTPUT_HTML('<strong>READ:</strong> ' . $FQFN . "<br />\n");
+ $fp = fopen($FQFN, 'r') or OUTPUT_HTML('<strong>READ:</strong> ' . $FQFN . '<br />');
// Is the resource valid?
if (is_resource($fp)) {
// Open temporary file
- $fp_tmp = fopen($tmp, 'w') or OUTPUT_HTML('<strong>WRITE:</strong> ' . $tmp . "<br />\n");
+ $fp_tmp = fopen($tmp, 'w') or OUTPUT_HTML('<strong>WRITE:</strong> ' . $tmp . '<br />');
// Is the resource again valid?
if (is_resource($fp_tmp)) {
} else {
$next++;
}
- }
+ } // END - if
// Write to temp file
fputs($fp_tmp, $line);
// Remove CRLF
$message = str_replace("\r", '', str_replace("\n", '', $message));
- // Log this message away
- $fp = fopen(constant('PATH')."inc/cache/debug.log", 'a') or app_die(__FUNCTION__, __LINE__, "Cannot write logfile debug.log!");
- fwrite($fp, date("d.m.Y|H:i:s", time())."|" . getModule()."|".basename($funcFile)."|" . $line."|".strip_tags($message)."\n");
+ // Log this message away, we better don't call app_die() here to prevent an endless loop
+ $fp = fopen(constant('PATH') . 'inc/cache/debug.log', 'a') or die(__FUNCTION__, __LINE__, 'Cannot write logfile debug.log!');
+ fwrite($fp, date('d.m.Y|H:i:s', time()) . '|' . getModule() . '|' . basename($funcFile) . '|' . $line . '|' . strip_tags($message)."\n");
fclose($fp);
} // END - if
}
// Is the reset set or old sql_patches?
if ((!isResetModeEnabled()) || (EXT_VERSION_IS_OLDER('sql_patches', '0.4.5'))) {
// Then abort here
- DEBUG_LOG(__FUNCTION__, __LINE__, "Cannot run reset! Please report this bug. Thanks");
+ DEBUG_LOG(__FUNCTION__, __LINE__, 'Cannot run reset! Please report this bug. Thanks');
} // END - if
// Get more daily reset scripts
$GLOBALS['refid'] = bigintval(getSession('refid'));
} elseif ((GET_EXT_VERSION('sql_patches') != '') && (getConfig('def_refid') > 0)) {
// Set default refid as refid in URL
- $GLOBALS['refid'] = getConfig(('def_refid'));
+ $GLOBALS['refid'] = getConfig('def_refid');
} elseif ((GET_EXT_VERSION('user') >= '0.3.4') && (getConfig('select_user_zero_refid')) == 'Y') {
// Select a random user which has confirmed enougth mails
$GLOBALS['refid'] = determineRandomReferalId();
// Init variables
$mysql = array();
-if ((REQUEST_ISSET_POST(('mysql'))) && (is_array(REQUEST_POST('mysql')))) $mysql = REQUEST_POST('mysql');
+if ((REQUEST_ISSET_POST('mysql')) && (is_array(REQUEST_POST('mysql')))) $mysql = REQUEST_POST('mysql');
// Check if both passwords from SMTP are matching
if ((REQUEST_ISSET_GET('page') && (REQUEST_GET('page') == 5))) {
// Okay, we have to check it
- if (REQUEST_ISSET_POST(('smtp_user')) && (!REQUEST_ISSET_POST(('smtp_host')))) {
+ if (REQUEST_ISSET_POST('smtp_user') && (!REQUEST_ISSET_POST('smtp_host'))) {
// Hostname not set
- OUTPUT_HTML(getMessage('INSTALL_SMTP_HOSTNAME_EMPTY')."<br />");
+ OUTPUT_HTML(getMessage('INSTALL_SMTP_HOSTNAME_EMPTY') . '<br />');
REQUEST_SET_GET('page', 3);
} // END - if
- if ((!REQUEST_ISSET_POST(('smtp_pass1'))) && (REQUEST_ISSET_POST(('smtp_pass2')))) {
+ if ((!REQUEST_ISSET_POST('smtp_pass1')) && (REQUEST_ISSET_POST('smtp_pass2'))) {
// Password is empty
- OUTPUT_HTML(getMessage('INSTALL_SMTP_PASS1_EMPTY')."<br />");
+ OUTPUT_HTML(getMessage('INSTALL_SMTP_PASS1_EMPTY') . '<br />');
REQUEST_SET_GET('page', 3);
} // END - if
- if ((REQUEST_ISSET_POST(('smtp_pass1'))) && (!REQUEST_ISSET_POST(('smtp_pass2')))) {
+ if ((REQUEST_ISSET_POST('smtp_pass1')) && (!REQUEST_ISSET_POST('smtp_pass2'))) {
// Password repeat is empty
- OUTPUT_HTML(getMessage('INSTALL_SMTP_PASS2_EMPTY')."<br />");
+ OUTPUT_HTML(getMessage('INSTALL_SMTP_PASS2_EMPTY') . '<br />');
REQUEST_SET_GET('page', 3);
} // END - if
if (REQUEST_POST('smtp_pass1') != REQUEST_POST('smtp_pass1')) {
// Passwords are not matching
- OUTPUT_HTML(getMessage('INSTALL_SMTP_PASS_MISMATCH')."<br />");
+ OUTPUT_HTML(getMessage('INSTALL_SMTP_PASS_MISMATCH') . '<br />');
REQUEST_SET_GET('page', 3);
} // END - if
} // END - if
if (empty($mysql['prefix'])) $mysql['prefix'] = 'mxchange';
if (empty($mysql['type'])) $mysql['type'] = 'MyISAM';
if (getTotalFatalErrors() > 0) {
- OUTPUT_HTML("<span class=\"install_fatal\">");
+ OUTPUT_HTML('<span class="install_fatal">');
foreach (getFatalArray() as $key => $err) {
- OUTPUT_HTML(" <strong>·</strong> {--FATAL_NO--}".($key + 1).": ".$err."<br />");
+ OUTPUT_HTML('<strong>·</strong> {--FATAL_NO--}' . ($key + 1) . ': ' . $err . '<br />');
}
- OUTPUT_HTML("</span><br />");
+ OUTPUT_HTML('</span><br />');
}
define('__MYSQL_HOST' , $mysql['host']);
define('__MYSQL_DBASE' , $mysql['dbase']);
$smtpPass2 = getConfig('SMTP_PASSWORD');
// Overwrite it with the data from sent (failed) form
- if (REQUEST_ISSET_POST(('smtp_host'))) $smtpHost = REQUEST_POST('smtp_host');
- if (REQUEST_ISSET_POST(('smtp_user'))) $smtpUser = REQUEST_POST('smtp_user');
- if (REQUEST_ISSET_POST(('smtp_pass'))) {
+ if (REQUEST_ISSET_POST('smtp_host')) $smtpHost = REQUEST_POST('smtp_host');
+ if (REQUEST_ISSET_POST('smtp_user')) $smtpUser = REQUEST_POST('smtp_user');
+ if (REQUEST_ISSET_POST('smtp_pass')) {
$smtpPass1 = REQUEST_POST('smtp_pass');
$smtpPass2 = REQUEST_POST('smtp_pass');
} // END - if
define('__SMTP_HOST', REQUEST_POST('smtp_host'));
define('__SMTP_USER', REQUEST_POST('smtp_user'));
define('__SMTP_PASS', REQUEST_POST('smtp_pass1'));
- OUTPUT_HTML("<form action=\"{!__BURL_ACTION!}/install.php?page=finalize\" method=\"POST\" target=\"_self\">
-<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"install_main\">
-<tr>
- <td colspan=\"2\" align=\"center\">
- <div class=\"install\">{--HEADER_TEXT_PAGE5--}</strong>
- </td>
-</tr>
-<tr><td colspan=\"2\" height=\"21\" class=\"seperator\"> </td></tr>
-<tr>
- <td colspan=\"2\"><span class=\"install_text\">
- {--TEXT_PAGE_5--}
- </span></td>
-</tr>
-<tr><td colspan=\"2\" height=\"21\" class=\"seperator\"> </td></tr>
-<tr>
- <td class=\"install\" align=\"right\">{--LANG_OUTPUT_MODE--}: </td>
- <td>
- <select name=\"omode\" size=\"1\" class=\"install_select\">
- <option value=\"render\">{--MODE_RENDER--}</option>
- <option value=\"direct\">{--MODE_DIRECT--}</option>
- </select>
- </td>
-</tr>
-<tr><td colspan=\"2\" height=\"10\" class=\"seperator\"> </td></tr>
-<tr>
- <td class=\"install\" align=\"right\">{--WARN_NO_PASSWORD--}: </td>
- <td>
- <select name=\"warn_no_pass\" size=\"1\" class=\"install_select\">
- <option value=\"Y\">{--YES--}</option>
- <option value=\"N\">{--NO--}</option>
- </select>
- </td>
-</tr>
-<tr><td colspan=\"2\" height=\"10\" class=\"seperator\"> </td></tr>
-<tr>
- <td class=\"install\" align=\"right\">{--LANG_WRITE_FOOTER--}: </td>
- <td>
- <select name=\"wfooter\" size=\"1\" class=\"install_select\">
- <option value=\"Y\">{--YES--}</option>
- <option value=\"N\">{--NO--}</option>
- </select>
- </td>
-</tr>
-<tr><td colspan=\"2\" height=\"10\" class=\"seperator\"> </td></tr>
-<tr>
- <td class=\"install\" align=\"right\">{--INSTALL_ENABLE_BACKLINK--}: </td>
- <td>
- <select name=\"blink\" size=\"1\" class=\"install_select\">
- <option value=\"Y\">{--YES--}</option>
- <option value=\"N\">{--NO--}</option>
- </select>
- </td>
-</tr>
-<tr><td colspan=\"2\" height=\"21\" class=\"seperator\"> </td></tr>
-<tr>
- <td colspan=\"2\" align=\"center\">");
+
+ // MySQL data
+ $content = '';
foreach ($mysql as $key => $value) {
- OUTPUT_HTML(" <input type=\"hidden\" name=\"mysql[".$key."]\" value=\"".$value."\" />");
+ $content .= " <input type=\"hidden\" name=\"mysql[" . $key . "]\" value=\"" . $value . "\" />\n";
}
- OUTPUT_HTML(" <input type=\"hidden\" name=\"spath\" value=\"{!__SPATH_VALUE!}\" />
- <input type=\"hidden\" name=\"burl\" value=\"{!__BURL_VALUE!}\" />
- <input type=\"hidden\" name=\"title\" value=\"{!__TITLE_VALUE!}\" />
- <input type=\"hidden\" name=\"slogan\" value=\"{!__SLOGAN_VALUE!}\" />
- <input type=\"hidden\" name=\"email\" value=\"{!__EMAIL_VALUE!}\" />
- <input type=\"hidden\" name=\"smtp_host\" value=\"{!__SMTP_HOST!}\" />
- <input type=\"hidden\" name=\"smtp_user\" value=\"{!__SMTP_USER!}\" />
- <input type=\"hidden\" name=\"smtp_pass\" value=\"{!__SMTP_PASS!}\" />
- <input type=\"submit\" class=\"admin_submit submit\" name=\"finalize\" value=\"{--NEXT_PAGE--}\" class=\"install_submit\" />
- </td>
-</tr>
-<tr><td colspan=\"2\" height=\"21\" class=\"seperator\"> </td></tr>
-</table>
-</form>");
+ define('__MYSQL_DATA', $content);
+
+ // Load template
+ LOAD_TEMPLATE('install_page5');
break;
case 'finalize': // Write captured data to files
}
// Create email link to admins's account
-function adminsCreateEmailLink ($email, $mod='admin') {
+function generateAdminEmailLink ($email, $mod = 'admin') {
// Is it an email?
- if (strpos($email, "@") !== false) {
+ if (strpos($email, '@') !== false) {
// Create email link
$result = SQL_QUERY_ESC("SELECT `id`
-FROM `{!_MYSQL_PREFIX!}_admins`
-WHERE `email`='%s' LIMIT 1",
+FROM
+ `{!_MYSQL_PREFIX!}_admins`
+WHERE
+ `email`='%s'
+LIMIT 1",
array($email), __FUNCTION__, __LINE__);
// Is there an entry?
// List all admin accounts
function adminsListAdminAccounts() {
// Select all admin accounts
- $result = SQL_QUERY("SELECT id, login, email, default_acl AS mode, la_mode FROM `{!_MYSQL_PREFIX!}_admins` ORDER BY login ASC", __FUNCTION__, __LINE__);
+ $result = SQL_QUERY("SELECT `id`, `login`, `email`, `default_acl` AS mode, `la_mode` FROM `{!_MYSQL_PREFIX!}_admins` ORDER BY `login` ASC", __FUNCTION__, __LINE__);
$OUT = ''; $SW = 2;
while ($content = SQL_FETCHARRAY($result)) {
// Compile some variables
// Prepare some more data
$content['sw'] = $SW;
- $content['email_link'] = generateMemberEmailLink($content['id']);
+ $content['email_link'] = generateEmailLink($content['id'], 'admins');
// Load row template and switch color
$OUT .= LOAD_TEMPLATE('admin_list_admins_row', true, $content);
// Filter for adding extra data to the query
function FILTER_ADD_EXTRA_SQL_DATA ($add = '') {
// Is the admins extension updated? (should be!)
- if (GET_EXT_VERSION('admins') >= '0.3.0') $add .= ", default_acl AS def_acl";
- if (GET_EXT_VERSION('admins') >= '0.6.7') $add .= ", la_mode";
- if (GET_EXT_VERSION('admins') >= '0.7.2') $add .= ", login_failures, UNIX_TIMESTAMP(last_failure) AS last_failure";
+ if (GET_EXT_VERSION('admins') >= '0.3.0') $add .= ', `default_acl` AS def_acl';
+ if (GET_EXT_VERSION('admins') >= '0.6.7') $add .= ', `la_mode`';
+ if (GET_EXT_VERSION('admins') >= '0.7.2') $add .= ', `login_failures`, UNIX_TIMESTAMP(`last_failure`) AS last_failure';
// Return it
return $add;
function AUTOPURGE_ADD_POINTS($uid, $points) {
// Check if he has locked points or not
- $result = SQL_QUERY_ESC("SELECT ref_payout FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(bigintval($uid)), __FUNCTION__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `ref_payout` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
+ array(bigintval($uid)), __FUNCTION__, __LINE__);
list($payout) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
if (($payout > 0) && (!empty($payout))) {
// Yes, he has.
- $target = "locked_points";
+ $target = 'locked_points';
} elseif ($payout == '0') {
// No, he has not
- $target = "points";
+ $target = 'points';
}
// Add points...
$jackpot += $points;
} else {
// .. to user's account
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_points` SET %s=%s+%s WHERE userid=%s AND ref_depth=0 LIMIT 1",
- array($target, $target, $points, bigintval($uid)), __FUNCTION__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_points` SET `%s`=`%s`+%s WHERE `userid`=%s AND `ref_depth`=0 LIMIT 1",
+ array($target, $target, $points, bigintval($uid)), __FUNCTION__, __LINE__);
// Update mediadata as well
- if ((GET_EXT_VERSION('mediadata') >= '0.0.4') && ($target == "points")) {
+ if ((GET_EXT_VERSION('mediadata') >= '0.0.4') && ($target == 'points')) {
// Update database
MEDIA_UPDATE_ENTRY(array('total_points'), 'add', $points);
- }
+ } // END - if
// Send out mail to user
- $msg = LOAD_EMAIL_TEMPLATE("member_autopurge_points", translateComma($points), $uid);
+ $msg = LOAD_EMAIL_TEMPLATE('member_autopurge_points', translateComma($points), $uid);
sendEmail($uid, getMessage('AUTOPURGE_MEMBER_SUBJECT'), $msg);
}
}
// ... what will the email address be out the @... ;-)
$PARTS = array();
- while (ereg("@", $test)) {
- $pos = strpos($test, "@");
+ while (ereg('@', $test)) {
+ $pos = strpos($test, '@');
$test2 = substr($test, 0, $pos);
// First check backwards
if (!in_array($check, $GLOBALS['valid_email_chars'])) {
// Char found so we end here
break;
- }
+ } // END - if
$idx--;
- }
+ } // END - while
if ($idx > 0) {
// Starting mark is found
$check2 = substr($test, 0, ($idx + 1));
$test = substr($test, ($idx + 1));
- }
+ } // END - if
// And now go forward...
$idx = 0;
while ($idx < strlen($test)) {
$check = substr($test, $idx, 1);
- if ((!in_array($check, $GLOBALS['valid_email_chars'])) && ($check != "@")) {
+ if ((!in_array($check, $GLOBALS['valid_email_chars'])) && ($check != '@')) {
// Char found so end here again
break;
- }
+ } // END - if
$idx++;
- }
+ } // END - while
if ($idx > 0) {
// Maybe this is the email address?
$check = substr($test, 0, $idx);
- }
+ } // END - if
// Now replace the email against anchor with mailto and pray...
- $PARTS[] = $check2."<a href=\"mailto:".$check."\">".$check."</a>";
+ $PARTS[] = $check2 . "<a href=\"" . generateEmailLink($check, 'user_data') . "\">" . $check . "</a>";
// Remove email from testing string (see above why...)
$test = substr($test, strlen($check));
// ... what will the email address be out the @... ;-)
$PARTS = array();
- while (ereg("@", $test)) {
- $pos = strpos($test, "@");
+ while (ereg('@', $test)) {
+ $pos = strpos($test, '@');
$test2 = substr($test, 0, $pos);
// First check backwards
$idx = 0;
while ($idx < strlen($test)) {
$check = substr($test, $idx, 1);
- if ((!in_array($check, $GLOBALS['valid_email_chars'])) && ($check != "@")) {
+ if ((!in_array($check, $GLOBALS['valid_email_chars'])) && ($check != '@')) {
// Char found so end here again
break;
}
}
// Now replace the email against anchor with mailto and pray...
- $PARTS[] = $check2.$check;
+ $PARTS[] = $check2 . $check;
// Remove email from testing string (see above why...)
$test = substr($test, strlen($check));
$DATA['title'] = $title;
$DATA['id'] = $id; // ID for the rallye details link
$DATA['ref'] = 0;
- $DATA['refs'] = GET_TOTAL_DATA($uid, "user_data", 'userid', "refid", true);
+ $DATA['refs'] = GET_TOTAL_DATA($uid, 'user_data', 'userid', "refid", true);
// Load prices
$prices = RALLYE_ADD_PRICES($id);
$code = SURFBAR_GENERATE_VALIDATION_CODE($urlId, $salt);
// Return result of checking hashes and salts
- //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, '---'.$code."|".$check.'---', false);
- //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "+++".$salt."|".SURFBAR_GET_DATA('last_salt')."+++", false);
+ //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, '---'.$code.'|'.$check.'---', false);
+ //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "+++".$salt.'|'.SURFBAR_GET_DATA('last_salt')."+++", false);
return (($code == $check) && ($salt == SURFBAR_GET_DATA('last_salt')));
}
if ((IS_MEMBER()) && ($limit == 0)) {
// Then add this as well
$UIDs['uid'][getUserId()] = getUserId();
- $UIDs['points'][getUserId()] = GET_TOTAL_DATA(getUserId(), "user_points", "points") - GET_TOTAL_DATA(getUserId(), "user_data", "used_points");
+ $UIDs['points'][getUserId()] = GET_TOTAL_DATA(getUserId(), 'user_points', 'points') - GET_TOTAL_DATA(getUserId(), 'user_data', 'used_points');
$UIDs['notified'][getUserId()] = 0;
// Get all userid except logged in one
- $result = SQL_QUERY_ESC("SELECT u.userid, UNIX_TIMESTAMP(d.surfbar_low_notified) AS notified
-FROM `{!_MYSQL_PREFIX!}_surfbar_urls` AS u
-INNER JOIN `{!_MYSQL_PREFIX!}_user_data` AS d
-ON u.userid=d.userid
-WHERE u.userid NOT IN (%s,0) AND u.`status`='ACTIVE'
-GROUP BY u.userid
-ORDER BY u.userid ASC",
- array(getUserId()), __FUNCTION__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT
+ u.userid, UNIX_TIMESTAMP(d.surfbar_low_notified) AS notified
+FROM
+ `{!_MYSQL_PREFIX!}_surfbar_urls` AS u
+INNER JOIN
+ `{!_MYSQL_PREFIX!}_user_data` AS d
+ON
+ u.userid=d.userid
+WHERE
+ u.userid NOT IN (%s,0) AND u.`status`='ACTIVE'
+GROUP BY
+ u.userid
+ORDER BY
+ u.userid ASC",
+ array(getUserId()), __FUNCTION__, __LINE__);
} else {
// Get all userid
- $result = SQL_QUERY("SELECT u.userid, UNIX_TIMESTAMP(d.surfbar_low_notified) AS notified
-FROM `{!_MYSQL_PREFIX!}_surfbar_urls` AS u
-INNER JOIN `{!_MYSQL_PREFIX!}_user_data` AS d
-ON u.userid=d.userid
-WHERE u.`status`='ACTIVE'
-GROUP BY u.userid
-ORDER BY u.userid ASC", __FUNCTION__, __LINE__);
+ $result = SQL_QUERY("SELECT
+ u.userid, UNIX_TIMESTAMP(d.surfbar_low_notified) AS notified
+FROM
+ `{!_MYSQL_PREFIX!}_surfbar_urls` AS u
+INNER JOIN
+ `{!_MYSQL_PREFIX!}_user_data` AS d
+ON
+ u.userid=d.userid
+WHERE
+ u.`status`='ACTIVE'
+GROUP BY
+ u.userid
+ORDER BY
+ u.userid ASC", __FUNCTION__, __LINE__);
}
// Load all userid
while ($content = SQL_FETCHARRAY($result)) {
// Get total points
- $points = GET_TOTAL_DATA($content['userid'], "user_points", "points") - GET_TOTAL_DATA($content['userid'], "user_data", "used_points");
+ $points = GET_TOTAL_DATA($content['userid'], 'user_points', 'points') - GET_TOTAL_DATA($content['userid'], 'user_data', 'used_points');
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "uid={$content['userid']},points={$points}", false);
// Shall we add this to ignore?
} // END - while
// Sort whole array by title
- array_pk_sort($themesArray, array("theme_name"));
+ array_pk_sort($themesArray, array('theme_name'));
// Construct selection form for the box template
$OUT = '';
);
// Return generated selection
- return LOAD_TEMPLATE("theme_select_form", true, $content);
+ return LOAD_TEMPLATE('theme_select_form', true, $content);
}
// Get version from name
// Is the extension 'theme' installed?
if (!EXT_IS_ACTIVE('theme')) {
// Then abort here
- return "!.!";
+ return '!.!';
} // END - if
- // Default version "number"
- $cver = "?.?";
+ // Default version 'number'
+ $cver = '?.?';
// Is the cache entry there?
if (isset($GLOBALS['cache_array']['themes']['theme_ver'][$name])) {
incrementConfigEntry('cache_hits');
} elseif (GET_EXT_VERSION('cache') != '0.1.8') {
// Load version from database
- $result = SQL_QUERY_ESC("SELECT theme_ver FROM `{!_MYSQL_PREFIX!}_themes` WHERE theme_path='%s' LIMIT 1",
- array($name), __FUNCTION__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `theme_ver` FROM `{!_MYSQL_PREFIX!}_themes` WHERE `theme_path`='%s' LIMIT 1",
+ array($name), __FUNCTION__, __LINE__);
// Entry found?
if (SQL_NUMROWS($result) == 1) {
incrementConfigEntry('cache_hits');
} elseif (GET_EXT_VERSION('cache') != '0.1.8') {
// Check if current theme is already imported or not
- $result = SQL_QUERY_ESC("SELECT theme_active FROM `{!_MYSQL_PREFIX!}_themes` WHERE theme_path='%s' AND theme_active='Y' LIMIT 1",
- array($name), __FUNCTION__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `theme_active` FROM `{!_MYSQL_PREFIX!}_themes` WHERE `theme_path`='%s' AND `theme_active`='Y' LIMIT 1",
+ array($name), __FUNCTION__, __LINE__);
// Is the theme active and installed?
$active = (SQL_NUMROWS($result) == 1);
// Is the extension 'theme' installed?
if (!EXT_IS_ACTIVE('theme')) {
// Then abort here
- return "default";
+ return 'default';
} // END - if
// Get the Uni* name
incrementConfigEntry('cache_hits');
} elseif (GET_EXT_VERSION('cache') != '0.1.8') {
// Check if current theme is already imported or not
- $result = SQL_QUERY_ESC("SELECT theme_name FROM `{!_MYSQL_PREFIX!}_themes` WHERE theme_path='%s' AND theme_active='Y' LIMIT 1",
- array($name), __FUNCTION__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `theme_name` FROM `{!_MYSQL_PREFIX!}_themes` WHERE `theme_path`='%s' AND `theme_active`='Y' LIMIT 1",
+ array($name), __FUNCTION__, __LINE__);
// Load theme name
list($name) = SQL_FETCHROW($result);
$GLOBALS['curr_theme'] = getCurrentTheme();
// Check if new theme is selcted
-if ((REQUEST_ISSET_POST(('new_theme'))) && (REQUEST_POST('new_theme') != $GLOBALS['curr_theme'])) {
+if ((REQUEST_ISSET_POST('new_theme')) && (REQUEST_POST('new_theme') != $GLOBALS['curr_theme'])) {
// Set new theme for guests
$newTheme = REQUEST_POST('new_theme');
ADD_INC_TO_POOL(sprintf("%stheme/%s/theme.php", constant('PATH'), $newTheme));
} // END - if
-//
+// [EOF]
?>
$add = "&page=".REQUEST_GET('page')."&offset=".REQUEST_GET('offset');
// Add status or mode
- if (REQUEST_ISSET_GET(('status'))) $add .= "&mode=".REQUEST_GET(('status'));
- elseif (REQUEST_ISSET_GET('mode')) $add .= "&mode=".REQUEST_GET('mode');
+ if (REQUEST_ISSET_GET('status')) $add .= '&mode=' . REQUEST_GET('status');
+ elseif (REQUEST_ISSET_GET('mode')) $add .= '&mode=' . REQUEST_GET('mode');
// Makes order by links..
if ($letter == "front") $letter = getMessage('_ALL2');
// Prepare array with all possible sorters
$list = array(
- 'userid' => getMessage('_UID'),
- 'family' => getMessage('FAMILY_NAME'),
- 'email' => getMessage('ADDY'),
- 'REMOTE_ADDR' => getMessage('REMOTE_IP')
+ 'userid' => getMessage('_UID'),
+ 'family' => getMessage('FAMILY_NAME'),
+ 'email' => getMessage('ADDY'),
+ 'REMOTE_ADDR' => getMessage('REMOTE_IP')
);
// Add nickname if extension is installed
foreach ($list as $sort => $title) {
if ($sortby == $sort) {
- $OUT .= "<strong>".$title."</strong> | ";
+ $OUT .= "<strong>" . $title . "</strong> | ";
} else {
- $OUT .= "<a href=\"{!URL!}/modules.php?module=admin&what=list_user&letter=".$letter."&sortby=".$sort.$add."\">".$title."</a> | ";
+ $OUT .= "<a href=\"{!URL!}/modules.php?module=admin&what=list_user&letter=" . $letter . "&sortby=" . $sort.$add . "\">" . $title . "</a> | ";
}
} // END - foreach
define('__SORT_LIST', substr($OUT, 0, -13));
// Load template
- $OUT = LOAD_TEMPLATE("admin_list_user_sort", true);
+ $OUT = LOAD_TEMPLATE('admin_list_user_sort', true);
if ($return === true) {
// Return code
return $OUT;
// Add page navigation
function ADD_PAGENAV ($PAGES, $offset, $show_form, $colspan,$return=false) {
- if (!$show_form) {
- // Empty row
- define('__FORM_HEADER', "<tr><td colspan=\"".$colspan."\" class=\"seperator\"> </td></tr>");
- } else {
+ if ($show_form) {
// Load form for changing number of lines
- define('__FORM_HEADER', LOAD_TEMPLATE("admin_list_user_sort_form", true));
- }
-
- if (!$show_form) {
- // Add line with bottom border
- define('__FORM_FOOTER', "<tr><td colspan=\"{!__COLSPAN2!}\" class=\"seperator bottom2\"> </td></tr>");
+ define('__FORM_HEADER', LOAD_TEMPLATE('admin_list_user_sort_form', true));
+ define('__FORM_FOOTER', '<tr><td colspan="{!__COLSPAN2!}" class="seperator bottom2"> </td></tr>');
} else {
- // Add line without bottom border
- define('__FORM_FOOTER', "<tr><td colspan=\"{!__COLSPAN2!}\" class=\"seperator bottom2\"> </td></tr>");
+ // Empty row
+ define('__FORM_HEADER', '<tr><td colspan="' . $colspan . '" class="seperator"> </td></tr>');
+ define('__FORM_FOOTER', '<tr><td colspan="{!__COLSPAN2!}" class="seperator bottom2"> </td></tr>');
}
$OUT = '';
for ($page = 1; $page <= $PAGES; $page++) {
if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == '1'))) {
- $OUT .= "<strong>-";
+ $OUT .= '<strong>-';
} else {
if (!REQUEST_ISSET_GET('letter')) REQUEST_SET_GET('letter', getMessage('_ALL2'));
if (!REQUEST_ISSET_GET('sortby')) REQUEST_SET_GET('sortby', 'userid');
// Base link
- $OUT .= "<a href=\"{!URL!}/modules.php?module=admin&what=".getWhat();
+ $OUT .= '<a href="{!URL!}/modules.php?module=admin&what=' . getWhat();
// Add status or mode
- if (REQUEST_ISSET_GET(('status'))) $OUT .= "&mode=".REQUEST_GET(('status'));
- elseif (REQUEST_ISSET_GET('mode')) $OUT .= "&mode=".REQUEST_GET('mode');
+ if (REQUEST_ISSET_GET('status')) $OUT .= '&mode=' . REQUEST_GET('status');
+ elseif (REQUEST_ISSET_GET('mode')) $OUT .= '&mode=' . REQUEST_GET('mode');
// Letter and so on
- $OUT .= "&letter=".REQUEST_GET('letter')."&sortby=".REQUEST_GET('sortby')."&page=".$page."&offset=".$offset."\">";
+ $OUT .= '&letter=' . REQUEST_GET('letter') . '&sortby=' . REQUEST_GET('sortby') . '&page=' . $page . '&offset=' . $offset . '">';
}
$OUT .= $page;
if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == '1'))) {
- $OUT .= "-</strong>";
+ $OUT .= '-</strong>';
} else {
- $OUT .= "</a>";
+ $OUT .= '</a>';
}
- if ($page < $PAGES) $OUT .= " | ";
+ if ($page < $PAGES) $OUT .= ' | ';
} // END - for
define('__PAGENAV_LIST', $OUT);
// Load template
- $OUT = LOAD_TEMPLATE("admin_list_user_pagenav", true);
+ $OUT = LOAD_TEMPLATE('admin_list_user_pagenav', true);
if ($return === true) {
// Return code
return $OUT;
}
// Create email link to user's account
-function USER_generateMemberEmailLink($email, $mod='admin') {
+function generateUserEmailLink($email, $mod='admin') {
// Show contact link only if user is confirmed by default
$locked = " AND `status`='CONFIRMED'";
// But admins shall always see it
if (IS_ADMIN()) $locked = '';
- $result = SQL_QUERY_ESC("SELECT userid
+ $result = SQL_QUERY_ESC("SELECT `userid`
FROM `{!_MYSQL_PREFIX!}_user_data`
-WHERE `email`='%s'".$locked." LIMIT 1",
- array($email), __FUNCTION__, __LINE__);
+WHERE `email`='%s'" . $locked." LIMIT 1",
+ array($email), __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load userid
list($uid) = SQL_FETCHROW($result);
// Look for random user
$result = SQL_QUERY_ESC("SELECT `userid` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED' AND `rand_confirmed` >= %s ORDER BY `rand_confirmed` DESC LIMIT %s, 1",
- array(getConfig('user_min_confirmed'), $randNum), __FUNCTION__, __LINE__);
+ array(getConfig('user_min_confirmed'), $randNum), __FUNCTION__, __LINE__);
// Do we have one entry there?
if (SQL_NUMROWS($result) == 1) {
list($refid) = SQL_FETCHROW($result);
// Reset this user's counter
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `rand_confirmed`=0 WHERE userid=%s LIMIT 1",
- array($refid), __FUNCTION__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `rand_confirmed`=0 WHERE `userid`=%s LIMIT 1",
+ array($refid), __FUNCTION__, __LINE__);
} // END - if
// Free result
// Check login data
if ((EXT_IS_ACTIVE('nickname')) && (NICKNAME_IS_ACTIVE($uid))) {
// Nickname entered
- $result = SQL_QUERY_ESC("SELECT userid, password, last_online".$lastOnline." FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' AND `status`='CONFIRMED' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `userid`, `password`, `last_online`" . $lastOnline . " FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `nickname`='%s' AND `status`='CONFIRMED' LIMIT 1",
array($uid), __FUNCTION__, __LINE__);
} else {
// Direct userid entered
- $result = SQL_QUERY_ESC("SELECT userid, password, last_online".$lastOnline." FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND `status`='CONFIRMED' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `userid`, `password`, `last_online`" . $lastOnline . " FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s AND `status`='CONFIRMED' LIMIT 1",
array($uid, $content['hash']), __FUNCTION__, __LINE__);
}
// ... and update database
// @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content);
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET password='%s' WHERE userid=%s AND `status`='CONFIRMED' LIMIT 1",
- array($content['hash'], $uid), __FUNCTION__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `password`='%s' WHERE `userid`=%s AND `status`='CONFIRMED' LIMIT 1",
+ array($content['hash'], $uid), __FUNCTION__, __LINE__);
// No login bonus by default
$GLOBALS['bonus_payed'] = false;
if (!empty($content['last_login'])) $probe = time() - $content['last_login'];
if ((GET_EXT_VERSION('bonus') >= '0.2.2') && ($probe >= getConfig('login_timeout'))) {
// Add login bonus to user's account
- $add = sprintf(", login_bonus=login_bonus+%s",
+ $add = sprintf(", `login_bonus`=`login_bonus`+%s",
(float)getConfig('login_bonus')
);
$GLOBALS['bonus_payed'] = true;
// Subtract login bonus from userid's account or jackpot
- if ((GET_EXT_VERSION('bonus') >= '0.3.5') && (getConfig('bonus_mode') != "ADD")) BONUS_POINTS_HANDLER('login_bonus');
+ if ((GET_EXT_VERSION('bonus') >= '0.3.5') && (getConfig('bonus_mode') != 'ADD')) BONUS_POINTS_HANDLER('login_bonus');
} // END - if
// Calculate new hash with the secret key and master salt together
// Try to set session data (which shall normally always work!)
if ((setSession('userid', $uid )) && (setSession('u_hash', $content['hash']))) {
// Update database records
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET total_logins=total_logins+1".$add." WHERE userid=%s LIMIT 1",
- array($uid), __FUNCTION__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `total_logins`=`total_logins +1" . $add . " WHERE `userid`=%s LIMIT 1",
+ array($uid), __FUNCTION__, __LINE__);
if (SQL_AFFECTEDROWS() == 1) {
// Procedure to checking for login data
if (($GLOBALS['bonus_payed']) && (EXT_IS_ACTIVE('bonus'))) {
}
} elseif (GET_EXT_VERSION('sql_patches') >= '0.6.1') {
// Update failture counter
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET login_failures=login_failures+1,last_failure=NOW() WHERE userid=%s LIMIT 1",
- array($uid), __FUNCTION__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `login_failures`=`login_failures`+1,`last_failure`=NOW() WHERE `userid`=%s LIMIT 1",
+ array($uid), __FUNCTION__, __LINE__);
// Wrong password!
$URL = 'modules.php?module=index&what=login&login='.getCode('WRONG_PASS');
} elseif (((isNicknameUsed($content['userid'])) && (!empty($content['userid']))) || ($content['userid'] == $uid)) {
// Other account status?
// @TODO Can this query be merged with above query?
- $result = SQL_QUERY_ESC("SELECT status FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array($uid), __FUNCTION__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT status FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
+ array($uid), __FUNCTION__, __LINE__);
// Entry found?
if (SQL_NUMROWS($result) == 1) {
// Probe userid/nickname
if ((EXT_IS_ACTIVE('nickname')) && (NICKNAME_IS_ACTIVE($uid))) {
// Nickname entered
- $result = SQL_QUERY_ESC("SELECT userid, status FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' OR email='%s' LIMIT 1",
- array($uid, $email), __FUNCTION__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `userid`, `status` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `nickname`='%s' OR `email`='%s' LIMIT 1",
+ array($uid, $email), __FUNCTION__, __LINE__);
} elseif (($uid > 0) && (empty($email))) {
// Direct userid entered
- $result = SQL_QUERY_ESC("SELECT userid, status FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(bigintval($uid)), __FUNCTION__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `userid`, `status` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
+ array(bigintval($uid)), __FUNCTION__, __LINE__);
} elseif (!empty($email)) {
// Email entered
- $result = SQL_QUERY_ESC("SELECT userid, status FROM `{!_MYSQL_PREFIX!}_user_data` WHERE email='%s' LIMIT 1",
- array($email), __FUNCTION__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `userid`, `status` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `email`='%s' LIMIT 1",
+ array($email), __FUNCTION__, __LINE__);
} else {
// Userid not set!
DEBUG_LOG(__FUNCTION__, __LINE__, 'Userid is not set! BUG!');
if ($status == 'CONFIRMED') {
// Ooppps, this was missing! ;-) We should update the database...
$NEW_PASS = generatePassword();
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET password='%s' WHERE userid=%s LIMIT 1",
- array(generateHash($NEW_PASS), $uid), __FUNCTION__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `password`='%s' WHERE `userid`=%s LIMIT 1",
+ array(generateHash($NEW_PASS), $uid), __FUNCTION__, __LINE__);
// Prepare data and message for email
$msg = LOAD_EMAIL_TEMPLATE('new-pass', array('new_pass' => $NEW_PASS), $uid);
if ((getConfig('yoomedia_requests_remain') > 0) || (!$countQuery)) {
// Prepare the low-level request
$requestString = sprintf("http://www.yoomedia.de/interface_2.0/%s?id=%s&sid=%s&pw=%s&reload=%s&ma=%s&uebrig=%s&verguetung=%s&erotik=%s",
- $script,
- getConfig(('yoomedia_id')),
- getConfig(('yoomedia_sid')),
- getConfig('yoomedia_passwd'),
- getConfig(('yoomedia_tm_max_reload')),
- getConfig(('yoomedia_tm_min_wait')),
- getConfig(('yoomedia_tm_clicks_remain')),
- getConfig(('yoomedia_tm_min_pay')),
- getConfig(('yoomedia_erotic_allowed'))
+ $script,
+ getConfig('yoomedia_id'),
+ getConfig('yoomedia_sid'),
+ getConfig('yoomedia_passwd'),
+ getConfig('yoomedia_tm_max_reload'),
+ getConfig('yoomedia_tm_min_wait'),
+ getConfig('yoomedia_tm_clicks_remain'),
+ getConfig('yoomedia_tm_min_pay'),
+ getConfig('yoomedia_erotic_allowed')
);
// Run the query
$responseLine = trim(implode("\n", $dummy));
// Last line should never be a pipe!
- if (substr($responseLine, -1, 1) == "|") $responseLine = substr($responseLine, 0, -1);
+ if (substr($responseLine, -1, 1) == '|') $responseLine = substr($responseLine, 0, -1);
// Now, explode all in one array
- $dataArray = explode("|", $responseLine);
+ $dataArray = explode('|', $responseLine);
// Now make the result array with two dimensions
$cnt = 0; $entry = 0;
// Is no admin registered?
if (!isAdminRegistered()) {
// Admin is not registered so we have to inform the user
- if ((isFormSent()) && ((!REQUEST_ISSET_POST('login')) || (!REQUEST_ISSET_POST(('pass'))) || (strlen(REQUEST_POST('pass')) < 4))) {
+ if ((isFormSent()) && ((!REQUEST_ISSET_POST('login')) || (!REQUEST_ISSET_POST('pass')) || (strlen(REQUEST_POST('pass')) < 4))) {
REQUEST_SET_POST('ok', '***');
} // END - if
if (!empty($ret)) $loginMessage = $ret;
// No password entered?
- if (!REQUEST_ISSET_POST(('pass'))) $passwdMessage = getMessage('ADMIN_NO_PASS');
+ if (!REQUEST_ISSET_POST('pass')) $passwdMessage = getMessage('ADMIN_NO_PASS');
// Or password too short?
if (strlen(REQUEST_POST('pass')) < 4) $passwdMessage = getMessage('ADMIN_SHORT_PASS');
redirectToUrl('modules.php?module=admin&logout=1');
} // END - if
- if (REQUEST_ISSET_GET(('register'))) {
+ if (REQUEST_ISSET_GET('register')) {
// Registration of first admin is done
if (REQUEST_GET('register') == 'done') LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_REGISTER_DONE'));
} // END - if
// Check if the admin has submitted data or not
- if ((isFormSent()) && ((!REQUEST_ISSET_POST('login')) || (!REQUEST_ISSET_POST(('pass'))) || (strlen(REQUEST_POST('pass')) < 4))) {
+ if ((isFormSent()) && ((!REQUEST_ISSET_POST('login')) || (!REQUEST_ISSET_POST('pass')) || (strlen(REQUEST_POST('pass')) < 4))) {
REQUEST_SET_POST('ok', '***');
} // END - if
if ((!empty($ret)) && (REQUEST_POST('ok') == '404')) $loginMessage = $ret;
// No password entered?
- if (!REQUEST_ISSET_POST(('pass'))) $passwdMessage = getMessage('ADMIN_NO_PASS');
+ if (!REQUEST_ISSET_POST('pass')) $passwdMessage = getMessage('ADMIN_NO_PASS');
// Or password too short?
if (strlen(REQUEST_POST('pass')) < 4) $passwdMessage = getMessage('ADMIN_SHORT_PASS');
// Load login form template
LOAD_TEMPLATE('admin_login_form', false, $content);
} // END - if
-} elseif (REQUEST_ISSET_GET(('logout'))) {
+} elseif (REQUEST_ISSET_GET('logout')) {
// Only try to remove cookies
if (destroyAdminSession()) {
// Load logout template
- if (REQUEST_ISSET_GET(('register'))) {
+ if (REQUEST_ISSET_GET('register')) {
// Secure input
- $register = REQUEST_GET(('register'));
+ $register = REQUEST_GET('register');
// Special logout redirect for installation of given extension
LOAD_TEMPLATE(sprintf("admin_logout_%s_install", $register));
// Entry found?
if (SQL_NUMROWS($result_user) == 1) {
list($gender, $sname, $fname, $email) = SQL_FETCHROW($result_user);
- $add = "<li>{--ADMIN_MEMBER_UID--}: <strong>".generateUserProfileLink($uid)." (<a href=\"".generateMemberEmailLink($email, "user_data")."\">".translateGender($gender)." ".$sname." ".$fname."</a>)</strong></li>";
+ $add = "<li>{--ADMIN_MEMBER_UID--}: <strong>".generateUserProfileLink($uid, 'user_data')." (<a href=\"".generateEmailLink($email, 'user_data')."\">".translateGender($gender)." ".$sname." ".$fname."</a>)</strong></li>";
} else {
// Invalid userid, so log and zero it
DEBUG_LOG(__FUNCTION__, __LINE__, 'Invalid userid=' . $uid . '-> Not found!');
}
} elseif (REQUEST_ISSET_GET('uid')) {
// User ID found in URL so we use this give him some credits
- $result = SQL_QUERY_ESC("SELECT surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND `status`='CONFIRMED' LIMIT 1",
- array(bigintval(REQUEST_GET('uid'))), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `surname`, `family`, `email` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s AND `status`='CONFIRMED' LIMIT 1",
+ array(bigintval(REQUEST_GET('uid'))), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Selected user does exist
list($sname, $fname, $email) = SQL_FETCHROW($result);
} else {
// Opps, missing form here
// @TODO Rewrite these both constants
- define('__USER_VALUE', "<a href=\"".generateMemberEmailLink($email, "user_data")."\">".$sname." ".$fname."</a>");
+ define('__USER_VALUE', "<a href=\"".generateEmailLink($email, 'user_data')."\">".$sname." ".$fname."</a>");
define('__UID' , bigintval(REQUEST_GET('uid')));
- LOAD_TEMPLATE("admin_add_points");
+ LOAD_TEMPLATE('admin_add_points');
}
} else {
// User not found!
ADD_DESCR ('admin', basename(__FILE__));
// Check for accounts
-$result = SQL_QUERY("SELECT userid, gender, surname, family, email, REMOTE_ADDR, refid, user_hash
-FROM `{!_MYSQL_PREFIX!}_user_data`
-WHERE `status`='UNCONFIRMED'
-ORDER BY userid ASC", __FILE__, __LINE__);
+$result = SQL_QUERY("SELECT
+ `userid`, `gender`, `surname`, `family`, `email`, `REMOTE_ADDR`, `refid`, `user_hash`
+FROM
+ `{!_MYSQL_PREFIX!}_user_data`
+WHERE
+ `status`='UNCONFIRMED'
+ORDER BY
+ `userid` ASC", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// We have some (new?) registrations!
'gender' => translateGender($content['gender']),
'sname' => $content['surname'],
'fname' => $content['family'],
- 'email' => "<a href=\"".generateMemberEmailLink($content['email'], "user_data")."\">".$content['email']."</a>",
+ 'email' => "<a href=\"".generateEmailLink($content['email'], 'user_data')."\">".$content['email']."</a>",
'ip' => $content['REMOTE_ADDR'],
'ref' => $content['refid'],
'hash' => $content['user_hash'],
REQUEST_UNSET_POST('ok');
} else {
// Remove entries
- REQUEST_UNSET_POST(('day'));
- REQUEST_UNSET_POST(('month'));
- REQUEST_UNSET_POST(('year'));
+ REQUEST_UNSET_POST('day');
+ REQUEST_UNSET_POST('month');
+ REQUEST_UNSET_POST('year');
// Remember timestamp
REQUEST_SET_POST('mt_start', $STAMP);
// Start of this exchange
if (getConfig('mt_start') > 0) {
// Only show start
- define('__MT_START', "<strong>".generateDateTime(getConfig('mt_start'), '3')."</strong>");
+ define('__MT_START', '<strong>' . generateDateTime(getConfig('mt_start'), '3') . '</strong>');
} else {
// Make start editable
define('__MT_START',
- ADD_SELECTION("day" , date('d', time())).
- ADD_SELECTION("month", date('m', time())).
- ADD_SELECTION("year", -1)
+ ADD_SELECTION('day' , date('d', time())).
+ ADD_SELECTION('month', date('m', time())).
+ ADD_SELECTION('year', -1)
);
}
define('__MT_STAGE', getConfig('mt_stage'));
// Load template
- LOAD_TEMPLATE("admin_config_mediadata");
+ LOAD_TEMPLATE('admin_config_mediadata');
}
//
LOAD_TEMPLATE("admin_points_edit");
} else {
// Referal levels
- $result = SQL_QUERY("SELECT id, level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` ORDER BY level", __FILE__, __LINE__);
+ $result = SQL_QUERY("SELECT `id`, `level`, `percents` FROM `{!_MYSQL_PREFIX!}_refdepths` ORDER BY `level` ASC", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// Make referal levels editable and deletable
$OUT = ''; $SW = 2;
);
// Load row template and switch color
- $OUT .= LOAD_TEMPLATE("admin_points_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('admin_points_row', true, $content);
$SW = 3 - $SW;
}
define('__LEVEL_ROWS', $OUT);
// Load main template
- LOAD_TEMPLATE("admin_points");
+ LOAD_TEMPLATE('admin_points');
}
// Form for adding new referal levels
- LOAD_TEMPLATE("admin_add_reflvl");
+ LOAD_TEMPLATE('admin_add_reflvl');
}
-} elseif (REQUEST_GET('sub') == "points") {
+} elseif (REQUEST_GET('sub') == 'points') {
// First points for registration and other fixed points including new add-mode for one-time referal bonus...
define('P_REG_VALUE', getConfig('points_register'));
define('P_REF_VALUE', getConfig('points_ref'));
// Load templates
- LOAD_TEMPLATE("admin_config_sub_points");
+ LOAD_TEMPLATE('admin_config_sub_points');
} else {
// Display selection box
- LOAD_TEMPLATE("admin_config_points");
+ LOAD_TEMPLATE('admin_config_points');
}
//
);
// Load row template and switch color
- $OUT .= LOAD_TEMPLATE("admin_config_rallye_prices_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('admin_config_rallye_prices_row', true, $content);
$SW = 3 - $SW;
} // END - while
define('__RALLYE_ID', REQUEST_GET('rallye'));
// Load main template
- LOAD_TEMPLATE("admin_config_rallye_prices");
+ LOAD_TEMPLATE('admin_config_rallye_prices');
}
}
// Add form for adding new price level
if (!REQUEST_ISSET_POST('edit')) {
- LOAD_TEMPLATE("admin_add_rallye_prices", false, REQUEST_GET('rallye'));
+ LOAD_TEMPLATE('admin_add_rallye_prices', false, REQUEST_GET('rallye'));
}
} else {
// No rallye selected so display all available without prices
- $result = SQL_QUERY("SELECT d.id, d.admin_id, d.start_time, d.end_time, d.title, a.login, d.is_active
-FROM `{!_MYSQL_PREFIX!}_rallye_data` AS d, `{!_MYSQL_PREFIX!}_admins` AS a
-WHERE d.admin_id=a.id ORDER BY start_time DESC", __FILE__, __LINE__);
+ $result = SQL_QUERY("SELECT
+ d.id, d.admin_id, d.start_time, d.end_time, d.title, a.login, d.is_active
+FROM
+ `{!_MYSQL_PREFIX!}_rallye_data` AS d,
+LEFT JOIN
+ `{!_MYSQL_PREFIX!}_admins` AS a
+ON
+ d.admin_id=a.id
+ORDER BY
+ `d.start_time` DESC", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// List found rallyes
$OUT = ''; $SW = 2;
'select' => $select,
'title' => $content['title'],
'aid' => $content['admin_id'],
- 'email_link' => generateMemberEmailLink($content['admin_id']),
+ 'email_link' => generateEmailLink($content['admin_id']),
'alogin' => $content['login'],
'start' => generateDateTime($content['start_time'], '3'),
'end' => generateDateTime($content['end_time'], '3'),
);
// Load row template and switch color
- $OUT .= LOAD_TEMPLATE("admin_list_rallye_prices_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('admin_list_rallye_prices_row', true, $content);
$SW = 3 - $SW;
}
define('__RALLYE_ROWS', $OUT);
// Load main template
- LOAD_TEMPLATE("admin_list_rallye_prices");
+ LOAD_TEMPLATE('admin_list_rallye_prices');
} else {
// No rallyes setup so far
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('RALLYE_NO_RALLYES_SETUP'));
// Init counter for deleted mails
$cnt = 0;
-if (REQUEST_ISSET_GET(('mid'))) {
+if (REQUEST_ISSET_GET('mid')) {
// Load email data
- $result = SQL_QUERY_ESC("SELECT id, sender, subject, url, timestamp, payment_id FROM `{!_MYSQL_PREFIX!}_pool` WHERE `id`=%s LIMIT 1",
- array(bigintval(REQUEST_GET('mid'))), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `id`, `sender`, `subject`, `url`, `timestamp`, `payment_id` FROM `{!_MYSQL_PREFIX!}_pool` WHERE `id`=%s LIMIT 1",
+ array(bigintval(REQUEST_GET('mid'))), __FILE__, __LINE__);
// Delete mail only once
if (SQL_NUMROWS($result) == 1) {
sendEmail($sender, getMessage('MEMBER_ORDER_DELETED'), $msg_user);
// Fetch right stats_id from pool
- $result_pool = SQL_QUERY_ESC("SELECT s.id FROM `{!_MYSQL_PREFIX!}_user_stats` AS s
-LEFT JOIN `{!_MYSQL_PREFIX!}_pool` AS p
-ON s.pool_id=p.id
-WHERE s.pool_id=%s LIMIT 1",
- array(bigintval(REQUEST_GET('mid'))), __FILE__, __LINE__);
+ $result_pool = SQL_QUERY_ESC("SELECT
+ s.id
+FROM
+ `{!_MYSQL_PREFIX!}_user_stats` AS s
+LEFT JOIN
+ `{!_MYSQL_PREFIX!}_pool` AS p
+ON
+ s.pool_id=p.id
+WHERE
+ s.pool_id=%s
+LIMIT 1",
+ array(bigintval(REQUEST_GET('mid'))), __FILE__, __LINE__);
if (SQL_NUMROWS($result_pool) == 1) {
// Fetch stats id
list($stats_id) = SQL_FETCHROW($result_pool);
// Get all user links
- $links = GET_TOTAL_DATA($stats_id, "user_links", 'userid', "stats_id", true);
+ $links = GET_TOTAL_DATA($stats_id, 'user_links', 'userid', 'stats_id', true);
// Reset sent mails for recipient(s)
- reduceRecipientReceivedMails("stats_id", REQUEST_GET('mid'), $links);
+ reduceRecipientReceivedMails('stats_id', REQUEST_GET('mid'), $links);
// Calc total points and pay them back
$totalPoints = $links * $price;
// Delete mail from queue
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_pool` WHERE `id`=%s LIMIT 1",
- array(bigintval(REQUEST_GET('mid'))), __FILE__, __LINE__);
+ array(bigintval(REQUEST_GET('mid'))), __FILE__, __LINE__);
$cnt += SQL_AFFECTEDROWS();
// Output link for manually removing stats entry
// Mail already deleted!
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_NORMAL_MAIL_ALREADY_DELETED'));
}
-} elseif (REQUEST_ISSET_GET(('pid'))) {
+} elseif (REQUEST_ISSET_GET('pid')) {
// Remove stats entries
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s LIMIT 1",
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE `pool_id`=%s LIMIT 1",
array(bigintval(REQUEST_GET('pid'))), __FILE__, __LINE__);
// Output message
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_USER_STATS_REMOVED'));
-} elseif ((REQUEST_ISSET_GET(('bid'))) && (EXT_IS_ACTIVE('bonus'))) {
+} elseif ((REQUEST_ISSET_GET('bid')) && (EXT_IS_ACTIVE('bonus'))) {
// Load data from bonus mail
- $result = SQL_QUERY_ESC("SELECT id, subject, url, timestamp, mails_sent FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`=%s",
- array(bigintval(REQUEST_GET('bid'))), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `id`, `subject`, `url`, `timestamp`, `mails_sent` FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`=%s",
+ array(bigintval(REQUEST_GET('bid'))), __FILE__, __LINE__);
// Delete mail only once
if (SQL_NUMROWS($result) == 1) {
// Load data
- list ($id, $subject, $url, $timestamp, $sent) = SQL_FETCHROW($result);
+ list($id, $subject, $url, $timestamp, $sent) = SQL_FETCHROW($result);
// Reset sent mails for recipient(s)
reduceRecipientReceivedMails('bonus_id', REQUEST_GET('bid'), $sent);
// Delete bonus mail entirely from database
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`=%s LIMIT 1",
- array(bigintval(REQUEST_GET('bid'))), __FILE__, __LINE__);
+ array(bigintval(REQUEST_GET('bid'))), __FILE__, __LINE__);
$cnt += SQL_AFFECTEDROWS();
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s",
- array(bigintval(REQUEST_GET('bid'))), __FILE__, __LINE__);
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_links` WHERE `bonus_id`=%s",
+ array(bigintval(REQUEST_GET('bid'))), __FILE__, __LINE__);
$cnt += SQL_AFFECTEDROWS();
// Prepare data for the template
define('__CNT' , $cnt);
// Load template
- LOAD_TEMPLATE("admin_del_email_bonus");
+ LOAD_TEMPLATE('admin_del_email_bonus');
} else {
// Mail already deleted!
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_BONUS_MAIL_ALREADY_DELETED'));
// Free result
SQL_FREERESULT($result);
-} elseif ((REQUEST_ISSET_GET(('nid'))) && (GET_EXT_VERSION('bonus') >= '0.8.7')) {
+} elseif ((REQUEST_ISSET_GET('nid')) && (GET_EXT_VERSION('bonus') >= '0.8.7')) {
// Load data from bonus mail
- $result = SQL_QUERY_ESC("SELECT id, subject, url, timestamp FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`=%s",
- array(bigintval(REQUEST_GET('nid'))), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `id`, `subject`, `url`, `timestamp` FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`=%s",
+ array(bigintval(REQUEST_GET('nid'))), __FILE__, __LINE__);
// Delete mail only once
if (SQL_NUMROWS($result) == 1) {
// Delete bonus mail entirely from database
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`=%s LIMIT 1",
- array(bigintval(REQUEST_GET('nid'))), __FILE__, __LINE__);
+ array(bigintval(REQUEST_GET('nid'))), __FILE__, __LINE__);
$cnt += SQL_AFFECTEDROWS();
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s",
- array(bigintval(REQUEST_GET('nid'))), __FILE__, __LINE__);
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_links` WHERE `bonus_id`=%s",
+ array(bigintval(REQUEST_GET('nid'))), __FILE__, __LINE__);
$cnt += SQL_AFFECTEDROWS();
// Prepare data for the template
define('__CNT' , $cnt);
// Load template
- LOAD_TEMPLATE("admin_del_email_notify");
+ LOAD_TEMPLATE('admin_del_email_notify');
} else {
// Mail already deleted!
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_NOTIFY_MAIL_ALREADY_DELETED'));
ADD_MEMBER_SELECTION_BOX();
} else {
// Realy want to delete?
- $result = SQL_QUERY_ESC("SELECT email, surname, family FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `email`, `surname`, `family` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
array(bigintval(REQUEST_GET('uid'))), __FILE__, __LINE__);
// Found a row?
if (SQL_NUMROWS($result) == 1) {
// Load data
list ($email, $sname, $fname) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
// Prepare content
$content = array(
- 'email' => generateMemberEmailLink($email, "user_data"),
+ 'email' => generateEmailLink($email, 'user_data'),
'surname' => $sname,
'family' => $fname,
'header' => sprintf(getMessage('ADMIN_HEADER_DEL_ACCOUNT'), REQUEST_GET('uid')),
);
// Display form
- LOAD_TEMPLATE("admin_del_user", false, $content);
+ LOAD_TEMPLATE('admin_del_user', false, $content);
} else {
// Account does not exists!
LOAD_TEMPLATE('admin_settings_saved', false, "<div class=\"admin_failed\">".sprintf(getMessage('ADMIN_MEMBER_404'), REQUEST_GET('uid'))."</div>");
if ((REQUEST_ISSET_GET('id')) && (REQUEST_ISSET_GET('mode'))) {
// Check for selected sponsor
- $result = SQL_QUERY_ESC("SELECT company, position, gender, surname, family, street_nr1, street_nr2, zip, city, country, phone, fax, cell, email, url, tax_ident, receive_warnings, warning_interval FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `id`='%s' LIMIT 1",
- array(bigintval(REQUEST_GET('id'))), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == 1) {
+ $result_main = SQL_QUERY_ESC("SELECT
+ `company`, `position`, `gender`, `surname`, `family`,
+ `street_nr1`, `street_nr2`, `zip`, `city`, `country`,
+ `phone`, `fax`, `cell`, `email`, `url`, `tax_ident`,
+ `receive_warnings`, `warning_interval`
+FROM
+ `{!_MYSQL_PREFIX!}_sponsor_data`
+WHERE
+ `id`='%s'
+LIMIT 1",
+ array(bigintval(REQUEST_GET('id'))), __FILE__, __LINE__);
+ if (SQL_NUMROWS($result_main) == 1) {
// Load sponsor details
- $DATA = SQL_FETCHARRAY($result);
- SQL_FREERESULT($result);
+ $DATA = SQL_FETCHARRAY($result_main);
// Prepare all data for the template
// Sponsor's ID
define('__SPONSOR_ID' , bigintval(REQUEST_GET('id')));
+
// Company's data
define('__COMPANY' , $DATA['company']);
define('__POSITION' , $DATA['position']);
define('__TAX_IDENT' , $DATA['tax_ident']);
+
// Personal data
- switch ($DATA['gender'])
- {
+ switch ($DATA['gender']) {
case 'M':
define('__GENDER_M', ' selected="selected"');
define('__GENDER_F', '');
// Sponsor was found
if ((isFormSent()) || (REQUEST_ISSET_POST('edit'))) {
// Perform action on mode
- switch (REQUEST_GET('mode'))
- {
- case "add_points": // Add points
+ switch (REQUEST_GET('mode')) {
+ case 'add_points': // Add points
if (strval(REQUEST_POST('points')) > 0) {
// Replace german decimal comma with computer's decimal dot
$POINTS = strval(convertCommaToDot(REQUEST_POST('points')));
// Add points to account
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET points_amount=points_amount+%s WHERE `id`='%s' LIMIT 1",
- array($POINTS, bigintval(REQUEST_GET('id'))), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET `points_amount`=`points_amount`+%s WHERE `id`='%s' LIMIT 1",
+ array($POINTS, bigintval(REQUEST_GET('id'))), __FILE__, __LINE__);
// Remember points /reason for the template
define('__POINTS' , translateComma($POINTS));
define('__REASON' , REQUEST_POST('reason'));
// Send email
- $msg = LOAD_EMAIL_TEMPLATE("sponsor_add_points", REQUEST_POST('reason'), true);
+ $msg = LOAD_EMAIL_TEMPLATE('sponsor_add_points', REQUEST_POST('reason'), true);
sendEmail(__EMAIL, ADMIN_SPONSOR_ADD_POINTS_SUBJ, $msg);
$message = ADMIN_SPONSOR_POINTS_ADDED;
} else {
}
break;
- case "sub_points": // Subtract points
+ case 'sub_points': // Subtract points
if (strval(REQUEST_POST('points')) > 0) {
// Replace german decimal comma with computer's decimal dot
$POINTS = strval(convertCommaToDot(REQUEST_POST('points')));
// Add points to account
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET points_used=points_used+%s WHERE `id`='%s' LIMIT 1",
- array($POINTS, bigintval(REQUEST_GET('id'))), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET `points_used`=`points_used`+%s WHERE `id`='%s' LIMIT 1",
+ array($POINTS, bigintval(REQUEST_GET('id'))), __FILE__, __LINE__);
// Remember points /reason for the template
define('__POINTS' , translateComma($POINTS));
define('__REASON' , REQUEST_POST('reason'));
// Send email
- $msg = LOAD_EMAIL_TEMPLATE("sponsor_sub_points", REQUEST_POST('reason'), true);
+ $msg = LOAD_EMAIL_TEMPLATE('sponsor_sub_points', REQUEST_POST('reason'), true);
sendEmail(__EMAIL, ADMIN_SPONSOR_SUB_POINTS_SUBJ, $msg);
$message = ADMIN_SPONSOR_POINTS_SUBTRACTED;
} else {
}
// Convert time selection
- $DATA = array(); $id = "warning_interval_ye"; $skip = false;
+ $DATA = array(); $id = 'warning_interval_ye'; $skip = false;
convertSelectionsToTimestamp(REQUEST_POST_ARRAY(), $DATA, $id, $skip);
// Save the sponsor
REQUEST_POST('gender' , translateGender(REQUEST_POST('gender')));
REQUEST_POST('warning_interval', createFancyTime(REQUEST_POST('warning_interval')));
- if (!$PASS) REQUEST_SET_POST('pass1', getMessage('SPONSOR_PASS_UNCHANGED'));
+ if ($PASS === false) REQUEST_SET_POST('pass1', getMessage('SPONSOR_PASS_UNCHANGED'));
// Load email template and send the mail away
- $msg = LOAD_EMAIL_TEMPLATE("admin_sponsor_edit", REQUEST_POST_ARRAY(), false);
+ $msg = LOAD_EMAIL_TEMPLATE('admin_sponsor_edit', REQUEST_POST_ARRAY(), false);
sendEmail(REQUEST_POST('email'), getMessage('ADMIN_SPONSOR_EDIT_SUBJECT'), $msg);
break;
} // END - if
} elseif (isFileReadable(sprintf("%stemplates/%s/html/admin/%s.tpl", constant('PATH'), getLanguage(), $TPL))) {
// Create mailto link
- define('__SPONSOR_VALUE', "<a href=\"mailto:{!__EMAIL!}\">{!__SURNAME!} {!__FAMILY!}</a>");
+ define('__SPONSOR_VALUE', "<a href=\"" . generateEmailLink(constant('__EMAIL'), 'sponsor_data') . "\">{!__SURNAME!} {!__FAMILY!}</a>");
// Load mode template
LOAD_TEMPLATE($TPL);
// Sponsor not found!
LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('ADMIN_SPONSOR_404'), bigintval(REQUEST_GET('id'))));
}
+
+ // Free result
+ SQL_FREERESULT($result_main);
} else {
// Not called by what-list_sponsor.php
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_CALL_NOT_DIRECTLY'));
if (REQUEST_ISSET_POST('sel')) $chk = countPostSelection();
// List all menu points and make them editable
-if ((REQUEST_ISSET_POST('edit')) && ($chk > 0) && (!IS_DEMO()))
-{
+if ((REQUEST_ISSET_POST('edit')) && ($chk > 0) && (!IS_DEMO())) {
// Edit menu entries
define('__SUB_VALUE', $SUB);
define('__CHK_VALUE', $chk);
$cnt = 0; $OUT = ''; $SW = 2;
- foreach (REQUEST_POST('sel') as $sel => $confirm)
- {
- if ($confirm == 1)
- {
+ foreach (REQUEST_POST('sel') as $sel => $confirm) {
+ if ($confirm == 1) {
$cnt++;
- $result = SQL_QUERY_ESC("SELECT title, action, what FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE ".$AND." AND id=%s LIMIT 1",
- array(bigintval($sel)), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == 1)
- {
+ $result = SQL_QUERY_ESC("SELECT `title`, `action`, `what` FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
+ array(bigintval($sel)), __FILE__, __LINE__);
+ if (SQL_NUMROWS($result) == 1) {
// Entry found so we load the stuff...
list($menu, $act, $wht) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
$DATA = array(
'cnt' => $cnt,
'sel' => $sel,
'menu' => $menu,
'sw' => $SW,
);
- $OUT .= LOAD_TEMPLATE("admin_gmenu_edit_row", true, $DATA);
- }
- else
- {
+ $OUT .= LOAD_TEMPLATE('admin_gmenu_edit_row', true, $DATA);
+ } else {
// Entry not found?
$content = array(
'sw' => $SW,
'sel' => $sel
);
- $OUT .= LOAD_TEMPLATE("admin_menu_404_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('admin_menu_404_row', true, $content);
}
+ SQL_FREERESULT($result);
$SW = 3 - $SW;
- }
- }
+ } // END - if
+ } // END - foreach
+
define('__MENU_ROWS', $OUT);
define('__CNT_VALUE', $cnt);
// Load template
- LOAD_TEMPLATE("admin_gmenu_edit_form");
+ LOAD_TEMPLATE('admin_gmenu_edit_form');
} elseif ((REQUEST_ISSET_POST('del')) && (!IS_DEMO())) {
// Del menu entries with or without confirmation
define('__SUB_VALUE', $SUB);
define('__CHK_VALUE', $chk);
- $cnt = 0; $OUT = ''; $SW = 2;
+ $cnt = 0;
+ $OUT = '';
+ $SW = 2;
+
foreach (REQUEST_POST('sel') as $sel => $confirm) {
if ($confirm == 1) {
$cnt++;
- $result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE ".$AND." AND id=%s LIMIT 1",
- array(bigintval($sel)), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `title` FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
+ array(bigintval($sel)), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Entry found so we load the stuff...
list($menu) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
$DATA = array(
'cnt' => $cnt,
'menu' => $menu,
'sel' => $sel,
'sw' => $SW,
);
- $OUT .= LOAD_TEMPLATE("admin_gmenu_delete_row", true, $DATA);
+ $OUT .= LOAD_TEMPLATE('admin_gmenu_delete_row', true, $DATA);
} else {
// Entry not found?
$content = array(
'sw' => $SW,
'sel' => $sel
);
- $OUT .= LOAD_TEMPLATE("admin_menu_404_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('admin_menu_404_row', true, $content);
}
+ SQL_FREERESULT($result);
$SW = 3 - $SW;
}
}
define('__CNT_VALUE', $cnt);
// Load template
- LOAD_TEMPLATE("admin_gmenu_delete");
+ LOAD_TEMPLATE('admin_gmenu_delete');
} elseif ((isFormSent()) && (!IS_DEMO())) {
// An action is done...
- switch (REQUEST_POST('ok'))
- {
+ switch (REQUEST_POST('ok')) {
case 'edit': // Edit menu
foreach (REQUEST_POST('sel') as $sel => $menu) {
// Secure selector
// Update entry
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `title`='%s', `action`='%s', `what`='%s' WHERE ".$AND." AND id=%s LIMIT 1",
- array($menu, REQUEST_POST('sel_action', $sel), REQUEST_POST('sel_what', $sel), $sel),__FILE__, __LINE__);
- }
+ array($menu, REQUEST_POST('sel_action', $sel), REQUEST_POST('sel_what', $sel), $sel),__FILE__, __LINE__);
+ } // END - foreach
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SETTINGS_SAVED'));
break;
foreach (REQUEST_POST('sel') as $sel => $menu) {
// Delete enty
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE ".$AND." AND id=%s LIMIT 1",
- array(bigintval($sel)), __FILE__, __LINE__);
- }
+ array(bigintval($sel)), __FILE__, __LINE__);
+ } // END - foreach
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SETTINGS_SAVED'));
break;
// Update entry
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='%s', `locked`='%s' WHERE ".$AND." AND id=%s LIMIT 1",
- array(REQUEST_POST('visible', $sel), REQUEST_POST('locked', $sel), $sel), __FILE__, __LINE__);
- }
+ array(REQUEST_POST('visible', $sel), REQUEST_POST('locked', $sel), $sel), __FILE__, __LINE__);
+ } // END - foreach
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SETTINGS_SAVED'));
break;
default: // Unexpected action
define('__OK_VALUE', REQUEST_POST('ok'));
DEBUG_LOG(__FILE__, __LINE__, sprintf("Unsupported action %s detected.", REQUEST_POST('ok')));
- LOAD_TEMPLATE("admin_menu_unknown_okay");
+ LOAD_TEMPLATE('admin_menu_unknown_okay');
break;
- }
-} elseif ((REQUEST_ISSET_POST(('status'))) && ($chk > 0) && (!IS_DEMO())) {
+ } // END - switch
+} elseif ((REQUEST_ISSET_POST('status')) && ($chk > 0) && (!IS_DEMO())) {
// Change status (visible / locked)
define('__SUB_VALUE', $SUB);
define('__CHK_VALUE', $chk);
// Load template
$SW = 2; $cnt = 0; $OUT = '';
- foreach (REQUEST_POST('sel') as $sel => $confirm)
- {
- if ($confirm == 1)
- {
+ foreach (REQUEST_POST('sel') as $sel => $confirm) {
+ if ($confirm == 1) {
$cnt++;
$result = SQL_QUERY_ESC("SELECT title, visible, locked FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE ".$AND." AND id=%s LIMIT 1",
- array(bigintval($sel)), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == 1)
- {
+ array(bigintval($sel)), __FILE__, __LINE__);
+ if (SQL_NUMROWS($result) == 1) {
// Entry found so we load the stuff...
list($menu, $vis, $locked) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
$content = array(
'cnt' => $cnt,
'menu' => $menu,
// Load template
$OUT .= LOAD_TEMPLATE('admin_menu_status_row', true, $content);
- }
- else
- {
+ } else {
// Entry not found?
$content = array(
'sw' => $SW,
);
$OUT .= LOAD_TEMPLATE('admin_menu_404_row', true, $content);
}
+
+ SQL_FREERESULT($result);
$SW = 3 - $SW;
- }
- }
+ } // END - if
+ } // END - foreach
define('__CNT_VALUE', $cnt);
define('__MENU_ROWS', $OUT);
// Load template
LOAD_TEMPLATE('admin_gmenu_status');
} else {
- if ((REQUEST_ISSET_GET(('act'))) && (REQUEST_ISSET_GET(('tid'))) && (REQUEST_ISSET_GET(('fid')))) {
+ if ((REQUEST_ISSET_GET('act')) && (REQUEST_ISSET_GET('tid')) && (REQUEST_ISSET_GET('fid'))) {
// Get IDs
- if (REQUEST_ISSET_GET(('w'))) {
+ if (REQUEST_ISSET_GET('w')) {
// Sub menus selected
$result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
- array(REQUEST_GET('act'), bigintval(REQUEST_GET('tid'))), __FILE__, __LINE__);
+ array(REQUEST_GET('act'), bigintval(REQUEST_GET('tid'))), __FILE__, __LINE__);
list($tid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
$result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
- array(REQUEST_GET('act'), bigintval(REQUEST_GET('fid'))), __FILE__, __LINE__);
+ array(REQUEST_GET('act'), bigintval(REQUEST_GET('fid'))), __FILE__, __LINE__);
list($fid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
} else {
// Main menu selected
$result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
- array(bigintval(REQUEST_GET('tid'))), __FILE__, __LINE__);
+ array(bigintval(REQUEST_GET('tid'))), __FILE__, __LINE__);
list($tid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
$result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
- array(bigintval(REQUEST_GET('fid'))), __FILE__, __LINE__);
+ array(bigintval(REQUEST_GET('fid'))), __FILE__, __LINE__);
list($fid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
}
if ((!empty($tid)) && (!empty($fid))) {
// Sort menu
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `sort`='%s' WHERE ".$AND." AND id=%s LIMIT 1",
- array(bigintval(REQUEST_GET('tid')), bigintval($fid)), __FILE__, __LINE__);
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `sort`='%s' WHERE ".$AND." AND id=%s LIMIT 1",
- array(bigintval(REQUEST_GET('fid')), bigintval($tid)), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `sort`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
+ array(bigintval(REQUEST_GET('tid')), bigintval($fid)), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `sort`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
+ array(bigintval(REQUEST_GET('fid')), bigintval($tid)), __FILE__, __LINE__);
} // END - if
} // END - if
} else {
// List sub menus
$result = SQL_QUERY_ESC("SELECT `id`,`action`,`what`,`title`,`sort` FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC",
- array($SUB), __FILE__, __LINE__);
+ array($SUB), __FILE__, __LINE__);
}
// Get number of menu entries
if (empty($content['what'])) $content['what'] = ' ';
if (empty($content['title'])) $content['title'] = ' ';
+ // Prepapre content
$content = array(
'sw' => $SW,
'id' => $content['id'],
'title' => $content['title'],
'navi' => $NAVI,
'mode' => 'guest'
- );
- $OUT .= LOAD_TEMPLATE('admin_menu_overview_row', true, $content);
- $SW = 3 - $SW;
- }
+ );
+
+ // Load row template
+ $OUT .= LOAD_TEMPLATE('admin_menu_overview_row', true, $content);
+ $SW = 3 - $SW;
+ } // END - while
// Free memory
SQL_FREERESULT($result);
if (EXT_IS_ACTIVE('beg')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('beg_uid')."";
if (EXT_IS_ACTIVE('bonus')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('bonus_uid')."";
if (EXT_IS_ACTIVE('doubler')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('doubler_uid')."";
-if (GET_EXT_VERSION('holiday') >= '0.1.3') $EXCLUDE_LIST .= " AND d.`holiday_active`='N'";
+if (GET_EXT_VERSION('holiday') >= '0.1.3') $EXCLUDE_LIST .= " AND d.holiday_active='N'";
// Check for all accounts
-$result = SQL_QUERY_ESC("SELECT DISTINCT d.userid, d.gender, d.surname, d.family, d.email, d.joined, d.last_online, d.ap_notified
-FROM `{!_MYSQL_PREFIX!}_user_data` AS d
-WHERE d.`status`='CONFIRMED' AND d.joined < (UNIX_TIMESTAMP() - %s) AND d.last_online < (UNIX_TIMESTAMP() - %s) AND d.ap_notified < (UNIX_TIMESTAMP() - %s)
-".$EXCLUDE_LIST."
-ORDER BY d.userid",
-array(
-getConfig('ap_inactive_since'),
-getConfig('ap_inactive_since'),
-getConfig('ap_inactive_since')
-), __FILE__, __LINE__);
+$result = SQL_QUERY_ESC("SELECT DISTINCT
+ d.userid, d.gender, d.surname, d.family, d.email, d.joined, d.last_online, d.ap_notified
+FROM
+ `{!_MYSQL_PREFIX!}_user_data` AS d
+WHERE
+ d.`status`='CONFIRMED' AND
+ d.joined < (UNIX_TIMESTAMP() - %s) AND
+ d.last_online < (UNIX_TIMESTAMP() - %s) AND
+ d.ap_notified < (UNIX_TIMESTAMP() - %s)
+ ".$EXCLUDE_LIST."
+ORDER BY
+ d.userid ASC",
+ array(
+ getConfig('ap_inactive_since'),
+ getConfig('ap_inactive_since'),
+ getConfig('ap_inactive_since')
+ ), __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// Ok, we have found some inactive accounts
'gender' => translateGender($content['gender']),
'sname' => $content['surname'],
'fname' => $content['family'],
- 'email' => "<a href=\"".generateMemberEmailLink($content['email'], "user_data")."\">".$content['email']."</a>",
+ 'email' => "<a href=\"".generateEmailLink($content['email'], 'user_data')."\">".$content['email']."</a>",
'joined' => generateDateTime($content['joined'], '2'),
'last' => generateDateTime($content['last_online'], '2'),
'notified' => generateDateTime($content['ap_notified'], '2'),
);
// Load row template
- $OUT .= LOAD_TEMPLATE("admin_list_autopurge_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('admin_list_autopurge_row', true, $content);
$SW = 3 - $SW;
}
define('__AUTOPURGE_ROWS', $OUT);
// Load main template
- LOAD_TEMPLATE("admin_list_autopurge");
+ LOAD_TEMPLATE('admin_list_autopurge');
} else {
// All members are active or you don't have any registered
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_AUTOPURGE_ALL_ACTIVE'));
// @TODO to shorten this block. Please also do so with uid->userid
$content = array(
'uid' => $content['userid'],
- 'email' => generateMemberEmailLink($content['email'], "user_data"),
+ 'email' => generateEmailLink($content['email'], 'user_data'),
'gender' => translateGender($content['gender']),
'sname' => $content['surname'],
'fname' => $content['family'],
// Prepare content
$content['uid'] = generateUserProfileLink($content['uid']);
- $content['email'] = generateMemberEmailLink($content['email'], "user_data");
+ $content['email'] = generateEmailLink($content['email'], 'user_data');
$content['gender'] = translateGender($content['gender']);
$content['points'] = translateComma($content['points']);
$content['last'] = generateDateTime($content['last'], '2');
if (REQUEST_ISSET_GET('uid')) {
// Check if the user already exists
- $result = SQL_QUERY_ESC("SELECT surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(bigintval(REQUEST_GET('uid'))), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `surname`, `family`, `email` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
+ array(bigintval(REQUEST_GET('uid'))), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Loads surname, family's name and the email address
list($sname, $fname, $email) = SQL_FETCHROW($result);
define('__CATS_BASE' , "<a href=\"{!URL!}/modules.php?module=admin&uid=");
define('__UID' , bigintval(REQUEST_GET('uid')));
define('__MEMBER_LINKS', generateMemberAdminActionLinks(constant('__UID')));
- define('__EMAIL' , "<a href=\"".generateMemberEmailLink($email, "user_data")."\">".$sname." ".$fname."</a>");
+ define('__EMAIL' , "<a href=\"".generateEmailLink($email, 'user_data')."\">".$sname." ".$fname."</a>");
// Ok, list categories of this user
- $result_cats = SQL_QUERY("SELECT id, cat FROM `{!_MYSQL_PREFIX!}_cats` ORDER BY `sort`", __FILE__, __LINE__);
+ $result_cats = SQL_QUERY("SELECT `id`, `cat` FROM `{!_MYSQL_PREFIX!}_cats` ORDER BY `sort` ASC", __FILE__, __LINE__);
if (SQL_NUMROWS($result_cats) > 0) {
// List categories
$cnt = 1; $OUT = ''; $SW = 2;
while ($content = SQL_FETCHARRAY($result_cats)) {
// Check user's selection
- $result_user = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE userid=%s AND cat_id=%s LIMIT 1",
+ $result_user = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE `userid`=%s AND `cat_id`=%s LIMIT 1",
array(bigintval(REQUEST_GET('uid')), bigintval($content['id'])), __FILE__, __LINE__);
// Set selection
$content['sel'] = $selection;
// Load row template and switch colors + count up
- $OUT .= LOAD_TEMPLATE("admin_list_cats_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('admin_list_cats_row', true, $content);
$SW = 3 - $SW; $cnt++;
} // END - while
define('__CATS_ROWS', $OUT);
// Load main template
- LOAD_TEMPLATE("admin_list_cats");
+ LOAD_TEMPLATE('admin_list_cats');
} else {
// No categories selected! :-(
- LOAD_TEMPLATE("admin_list_cats_404");
+ LOAD_TEMPLATE('admin_list_cats_404');
}
} else {
// User not found
);
// Load row template
- $OUT .= LOAD_TEMPLATE("admin_list_links_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('admin_list_links_row', true, $content);
} else {
// Load template for error
- $OUT .= LOAD_TEMPLATE("admin_list_links_problem",
+ $OUT .= LOAD_TEMPLATE('admin_list_links_problem',
array(
'sw' => $SW,
'problem' => $PROBLEM,
// Remember list in constant for the template
define('__SNAME_VALUE', $sname);
define('__FNAME_VALUE', $fname);
- define('__EMAIL_VALUE', "<a href=\"".generateMemberEmailLink($email, "user_data")."\">".$email."</a>");
+ define('__EMAIL_VALUE', "<a href=\"" . generateEmailLink($email, 'user_data') . "\">".$email."</a>");
define('__EMAIL_LIST' , $OUT);
define('__NUMS_VALUE' , $nums);
define('__UID' , bigintval(REQUEST_GET('uid')));
// Load final template
- LOAD_TEMPLATE("admin_list_links");
+ LOAD_TEMPLATE('admin_list_links');
}
} else {
// No mails left to confirm
SQL_FREERESULT($result);
// Konstante bauen
- define('PAYOUT_USERDATA_VALUE', "<a href=\"".generateMemberEmailLink($email, "user_data")."\">".translateGender($gender)." ".$surname." ".$family."</a>");
+ define('PAYOUT_USERDATA_VALUE', "<a href=\"".generateEmailLink($email, 'user_data')."\">".translateGender($gender)." ".$surname." ".$family."</a>");
- if ((REQUEST_GET('do') == "accept") && (!empty($email))) {
+ if ((REQUEST_GET('do') == 'accept') && (!empty($email))) {
// Ok, now we can output the form or execute accepting
if (isFormSent()) {
// Obtain payout type and other data
- $result = SQL_QUERY_ESC("SELECT payout_id FROM `{!_MYSQL_PREFIX!}_user_payouts` WHERE `id`=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `payout_id` FROM `{!_MYSQL_PREFIX!}_user_payouts` WHERE `id`=%s LIMIT 1",
array(bigintval(REQUEST_GET('pid'))), __FILE__, __LINE__);
list($ptype) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
if (!empty($ptype)) {
// Obtain data from payout type
- $result = SQL_QUERY_ESC("SELECT from_account, from_pass, engine_url, engine_ret_ok, engine_ret_failed, pass_enc, allow_url FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE `id`=%s LIMIT 1",
- array(bigintval($ptype)), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `from_account`, `from_pass`, `engine_url`, `engine_ret_ok`, `engine_ret_failed`, `pass_enc`, `allow_url`
+FROM
+ `{!_MYSQL_PREFIX!}_payout_types`
+WHERE
+ `id`=%s
+LIMIT 1",
+ array(bigintval($ptype)), __FILE__, __LINE__);
list($fuid, $fpass, $eurl, $eok, $failed, $eenc, $allow) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
if (!empty($eurl)) {
// Ok, run URL...
$eurl = COMPILE_CODE($eurl);
- switch ($eenc)
- {
- case "md5":
+ switch ($eenc) {
+ case 'md5':
$fpass = md5($fpass);
$tpass = md5($tpass);
break;
- case "base64":
+ case 'base64':
$fpass = base64_encode($fpass);
$tpass = base64_encode($tpass);
break;
array(bigintval(REQUEST_GET('pid'))), __FILE__, __LINE__);
// Send out mail
- $msg = LOAD_EMAIL_TEMPLATE("member_payout_accepted", REQUEST_POST('text'), $uid);
+ $msg = LOAD_EMAIL_TEMPLATE('member_payout_accepted', REQUEST_POST('text'), $uid);
// Output message
if ($allow == 'Y') {
);
// Load template
- LOAD_TEMPLATE("admin_payout_accept_form", false, $content);
+ LOAD_TEMPLATE('admin_payout_accept_form', false, $content);
}
- } elseif ((REQUEST_GET('do') == "reject") && (!empty($email))) {
+ } elseif ((REQUEST_GET('do') == 'reject') && (!empty($email))) {
// Ok, now we can output the form or execute rejecting
if (isFormSent()) {
if ($task > 0) {
// Clear task
runFilterChain('solve_task', $task);
- }
+ } // END - if
// Clear payout request
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_payouts` SET `status`='REJECTED' WHERE `id`=%s LIMIT 1",
- array(bigintval(REQUEST_GET('pid'))), __FILE__, __LINE__);
+ array(bigintval(REQUEST_GET('pid'))), __FILE__, __LINE__);
// Send out mail
- $msg = LOAD_EMAIL_TEMPLATE("member_payout_rejected", REQUEST_POST('text'), $uid);
+ $msg = LOAD_EMAIL_TEMPLATE('member_payout_rejected', REQUEST_POST('text'), $uid);
// Output message
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('PAYOUT_REJECTED_NOTIFIED'));
);
// Load template
- LOAD_TEMPLATE("admin_payout_reject_form", false, $content);
+ LOAD_TEMPLATE('admin_payout_reject_form', false, $content);
}
} else {
// Cannot load user data
} else {
if (!REQUEST_ISSET_GET('do')) REQUEST_SET_GET('do', '');
- if (REQUEST_GET('do') == "delete") {
+ if (REQUEST_GET('do') == 'delete') {
// Delete all requests
- $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_payouts`", __FILE__, __LINE__);
- }
+ $result = SQL_QUERY("TRUNCATE `{!_MYSQL_PREFIX!}_user_payouts`", __FILE__, __LINE__);
+ } // END - if
// Search for payouts
- $result = SQL_QUERY("SELECT p.id, p.userid AS uid, p.payout_total, p.target_account, p.target_bank, t.type, p.payout_timestamp, p.status, t.allow_url AS allow, p.target_url AS url, p.link_text AS alt, p.banner_url AS banner
-FROM `{!_MYSQL_PREFIX!}_user_payouts` AS p, `{!_MYSQL_PREFIX!}_payout_types` AS t
-WHERE p.payout_id=t.id
-ORDER BY p.payout_timestamp DESC", __FILE__, __LINE__);
+ $result = SQL_QUERY("SELECT
+ p.id, p.userid AS uid, p.payout_total, p.target_account,
+ p.target_bank, t.type, p.payout_timestamp, p.status,
+ t.allow_url AS allow, p.target_url AS url, p.link_text AS alt,
+ p.banner_url AS banner
+FROM
+ `{!_MYSQL_PREFIX!}_user_payouts` AS p
+LEFT JOIN
+ `{!_MYSQL_PREFIX!}_payout_types` AS t
+ON
+ p.payout_id=t.id
+ORDER BY
+ p.payout_timestamp DESC", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// List found payouts
$OUT = ''; $SW = 2;
while ($content = SQL_FETCHARRAY($result)) {
- if ($content['status'] == "NEW") {
+ if ($content['status'] == 'NEW') {
// Generate links for direct accepting and rejecting
$content['status'] = "<a href=\"{!URL!}/modules.php?module=admin&what=list_payouts&do=accept&pid=".$content['id']."\">".PAYOUT_ACCEPT_PAYOUT."</a> | <a href=\"{!URL!}/modules.php?module=admin&what=list_payouts&do=reject&pid=".$content['id']."\">".PAYOUT_REJECT_PAYOUT."</a>";
} else {
// Banner/Textlink views/clicks request
if (!empty($content['banner'])) {
// Load template for the banner
- $content['target_account'] = LOAD_TEMPLATE("admin_list_payouts_banner", true, $content);
+ $content['target_account'] = LOAD_TEMPLATE('admin_list_payouts_banner', true, $content);
} else {
// Textlink
- $content['target_account'] = LOAD_TEMPLATE("admin_list_payouts_txt", true, $content);
+ $content['target_account'] = LOAD_TEMPLATE('admin_list_payouts_txt', true, $content);
}
// Admins can addionally test the URL for framekillers
);
// Add row and switch color
- $OUT .= LOAD_TEMPLATE("admin_list_payouts_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('admin_list_payouts_row', true, $content);
$SW = 3 - $SW;
}
define('__PAYOUT_ROWS', $OUT);
// Load final template
- LOAD_TEMPLATE("admin_list_payouts");
+ LOAD_TEMPLATE('admin_list_payouts');
} else {
// No payout requests are sent so far
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('PAYOUT_ADMIN_NO_REQUESTS_FOUND'));
}
}
-//
+
+// [EOF]
?>
if (($content['refs'] > 0) || ($cnt > 0)) {
// Insert link to referal list
//* DEBUG: */ echo '-'.$content['userid'].'/'.$cnt.'/'.$content['refs']."-<br />";
- $cnt = generateUserProfileLink($content['userid'], $cnt, "list_refs");
- $content['refs'] = generateUserProfileLink($content['userid'], $content['refs'], "list_refs");
+ $cnt = generateUserProfileLink($content['userid'], $cnt, 'list_refs');
+ $content['refs'] = generateUserProfileLink($content['userid'], $content['refs'], 'list_refs');
} // END - if
// Get user points
- $points = GET_TOTAL_DATA($content['userid'], "user_points", "points", 'userid', false, " AND ref_depth=1 LIMIT 1");
+ $points = GET_TOTAL_DATA($content['userid'], 'user_points', 'points', 'userid', false, " AND `ref_depth`=1 LIMIT 1");
//* DEBUG: */ echo basename(__FILE__).":uid={$content['userid']},points={$points},opoints={$content['curr_points']}<br />\n";
// Prepare content
$content = array(
'select' => "<input type=\"checkbox\" name=\"sel[".$content['id']."]\" class=\"admin_normal\" value=\"1\" />",
'aid' => $content['admin_id'],
- 'email_link' => generateMemberEmailLink($content['admin_id']),
+ 'email_link' => generateEmailLink($content['admin_id']),
'alogin' => $content['alogin'],
'id' => $content['id'],
'sw' => $SW,
'refs_link' => '0',
'surname' => $data['surname'],
'family' => $data['family'],
- 'email' => "[<a href=\"".generateMemberEmailLink($data['email'], "user_data")."\">".$data['email']."</a>]",
+ 'email' => "[<a href=\"".generateEmailLink($data['email'], 'user_data')."\">".$data['email']."</a>]",
'status' => translateUserStatus($data['status']),
'registered' => generateDateTime($data['joined'], '3'),
);
'refs_link' => '0',
'surname' => $levels['surname'],
'family' => $levels['family'],
- 'email' => "[<a href=\"".generateMemberEmailLink($levels['email'], "user_data")."\">".$levels['email']."</a>]",
+ 'email' => "[<a href=\"".generateEmailLink($levels['email'], 'user_data')."\">".$levels['email']."</a>]",
'status' => translateUserStatus($levels['status']),
'registered' => generateDateTime($levels['joined'], '3'),
);
// Check if referal count is larger 0 and update link
- if ($refs_cnt > 0) $content['refs_link'] = generateUserProfileLink($levels['userid'], $refs_cnt, "list_refs");
+ if ($refs_cnt > 0) $content['refs_link'] = generateUserProfileLink($levels['userid'], $refs_cnt, 'list_refs');
// Load template for level one
- $OUT .= LOAD_TEMPLATE("admin_list_refs_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('admin_list_refs_row', true, $content);
// Switch colors
$SW = 3 - $SW;
// Load main template
if (EXT_IS_ACTIVE('refback')) {
- LOAD_TEMPLATE("admin_list_refs2", false, $content);
+ LOAD_TEMPLATE('admin_list_refs2', false, $content);
} else {
- LOAD_TEMPLATE("admin_list_refs", false, $content);
+ LOAD_TEMPLATE('admin_list_refs', false, $content);
}
} elseif (EXT_IS_ACTIVE('refback')) {
// No levels found, very bad!
define('__SPONSOR_PHONE' , $DATA['phone']);
define('__SPONSOR_FAX' , $DATA['fax']);
define('__SPONSOR_CELL' , $DATA['cell']);
- define('__SPONSOR_EMAIL' , "mailto:".$DATA['email']);
+ define('__SPONSOR_EMAIL' , generateEmailLink($DATA['email'], 'sponsor_data'));
define('__SPONSOR_EMAIL_VALUE', $DATA['email']);
define('__SPONSOR_URL' , DEREFERER($DATA['url']));
// Timestamps
// Sponsor not found
LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('ADMIN_SPONSOR_404'), REQUEST_GET('id')));
}
-} elseif (REQUEST_ISSET_GET(('rid'))) {
+} elseif (REQUEST_ISSET_GET('rid')) {
// Search for sponsor
$result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `id`='%s' LIMIT 1",
- array(bigintval(REQUEST_GET('rid'))), __FILE__, __LINE__);
+ array(bigintval(REQUEST_GET('rid'))), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Free memory
SQL_FREERESULT($result);
// Sponsor found so let's list all his referals
- $result = SQL_QUERY_ESC("SELECT id, gender, surname, family, email, status, sponsor_created, last_online, points_amount, points_used, remote_addr, ref_count
-FROM `{!_MYSQL_PREFIX!}_sponsor_data`
-WHERE refid='%s' ORDER BY `id`",
+ $result = SQL_QUERY_ESC("SELECT
+ `id`, `gender`, `surname`, `family`, `email`, `status`,
+ `sponsor_created`, `last_online`, `points_amount`, `points_used`,
+ `remote_addr`, `ref_count`
+FROM
+ `{!_MYSQL_PREFIX!}_sponsor_data`
+WHERE
+ `refid`='%s'
+ORDER BY
+ `id` ASC",
array(bigintval(REQUEST_GET('rid'))), __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
}
} else {
// List all sponsors
- $result_main = SQL_QUERY("SELECT id, gender, surname, family, email, status, sponsor_created, last_online, points_amount, points_used, remote_addr
-FROM `{!_MYSQL_PREFIX!}_sponsor_data` ORDER BY `id`", __FILE__, __LINE__);
+ $result_main = SQL_QUERY("SELECT
+ `id`, `gender`, `surname`, `family`, `email`, `status`,
+ `sponsor_created`, `last_online`, `points_amount`, `points_used`, `remote_addr`
+FROM
+ `{!_MYSQL_PREFIX!}_sponsor_data`
+ORDER BY
+ `id` ASC", __FILE__, __LINE__);
+
if (SQL_NUMROWS($result_main) > 0) {
// At least one sponsor found!
$OUT = ''; $SW = 2;
'gender' => translateGender($content['gender']),
'sname' => $content['surname'],
'fname' => $content['family'],
- 'email' => "mailto:".$content['email'],
+ 'email' => generateEmailLink($content['email'], 'sponsor_data'),
'status' => sponsorTranslateUserStatus($content['status']),
'created' => generateDateTime($content['sponsor_created'], '2'),
'last' => generateDateTime($content['last_online'], '2'),
);
// Load row template
- $OUT .= LOAD_TEMPLATE("admin_list_sponsor_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('admin_list_sponsor_row', true, $content);
$SW = 3 - $SW;
}
define('__SPONSOR_ROWS', $OUT);
// Load final template
- LOAD_TEMPLATE("admin_list_sponsor");
+ LOAD_TEMPLATE('admin_list_sponsor');
} else {
// No sponsors registered so far
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_SPONSOR_NONE_REGISTERED'));
if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
require($INC);
-}
+} // END - if
// Add description as navigation point
ADD_DESCR('admin', __FILE__);
if (REQUEST_ISSET_POST('add')) {
// Check input variables
- if (!REQUEST_ISSET_POST(('pay_name'))) REQUEST_UNSET_POST('add');
- if ((round(REQUEST_POST('pay_rate')) == 0) || (!REQUEST_ISSET_POST(('pay_rate')))) REQUEST_UNSET_POST('add');
+ if (!REQUEST_ISSET_POST('pay_name')) REQUEST_UNSET_POST('add');
+ if ((round(REQUEST_POST('pay_rate')) == 0) || (!REQUEST_ISSET_POST('pay_rate'))) REQUEST_UNSET_POST('add');
REQUEST_SET_POST('pay_min_count', bigintval(REQUEST_POST('pay_min_count')));
- if ((REQUEST_POST('pay_min_count') == 0) || (!REQUEST_ISSET_POST(('pay_min_count')))) REQUEST_UNSET_POST('add');
- if (!REQUEST_ISSET_POST(('pay_currency'))) REQUEST_UNSET_POST('add');
+ if ((REQUEST_POST('pay_min_count') == 0) || (!REQUEST_ISSET_POST('pay_min_count'))) REQUEST_UNSET_POST('add');
+ if (!REQUEST_ISSET_POST('pay_currency')) REQUEST_UNSET_POST('add');
} elseif ((REQUEST_ISSET_POST('edit')) || (REQUEST_ISSET_POST('del')) || (REQUEST_ISSET_POST('change')) || (REQUEST_ISSET_POST('remove'))) {
// Check if at least one entry was selected
$id = bigintval($id);
// Save entry
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_paytypes`
-SET pay_name='%s', pay_rate='%s', pay_min_count='%s', pay_currency='%s' WHERE `id`='%s' LIMIT 1",
+ SQL_QUERY_ESC("UPDATE
+ `{!_MYSQL_PREFIX!}_sponsor_paytypes`
+SET
+ `pay_name`='%s',
+ `pay_rate`='%s',
+ `pay_min_count`='%s',
+ `pay_currency`='%s'
+WHERE
+ `id`='%s'
+LIMIT 1",
array(
- REQUEST_POST('name', $id),
- REQUEST_POST('rate', $id),
- bigintval(REQUEST_POST('min', $id)),
- REQUEST_POST('curr', $id),
- $id
+ REQUEST_POST('name', $id),
+ REQUEST_POST('rate', $id),
+ bigintval(REQUEST_POST('min', $id)),
+ REQUEST_POST('curr', $id),
+ $id
), __FILE__, __LINE__);
}
foreach (REQUEST_POST('id') as $id => $sel) {
// Remove entry
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` WHERE `id`='%s' LIMIT 1",
- array(bigintval($id)), __FILE__, __LINE__);
+ array(bigintval($id)), __FILE__, __LINE__);
}
// Generate message
if (!empty($message)) {
// Output message
LOAD_TEMPLATE('admin_settings_saved', false, $message);
- }
+ } // END - if
}
if (REQUEST_ISSET_POST('add')) {
// Check if entry with same name does exists
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` WHERE pay_name='%s' LIMIT 1",
- array(REQUEST_POST('pay_name')), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` WHERE `pay_name`='%s' LIMIT 1",
+ array(REQUEST_POST('pay_name')), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 0) {
// No entry found so add this line
- SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_paytypes` (pay_name, pay_rate, pay_min_count, pay_currency) VALUES ('%s','%s','%s','%s')",
- array(
- htmlspecialchars(REQUEST_POST('pay_name')),
- convertCommaToDot(REQUEST_POST('pay_rate')),
- bigintval(REQUEST_POST('pay_min_count')),
- htmlspecialchars(REQUEST_POST('pay_currency'))
- ), __FILE__, __LINE__);
+ SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_paytypes` (`pay_name`, `pay_rate`, `pay_min_count`, `pay_currency`) VALUES ('%s','%s','%s','%s')",
+ array(
+ REQUEST_POST('pay_name'),
+ convertCommaToDot(REQUEST_POST('pay_rate')),
+ bigintval(REQUEST_POST('pay_min_count')),
+ REQUEST_POST('pay_currency')
+ ), __FILE__, __LINE__);
// Payment type added!
$message = sprintf(getMessage('ADMIN_SPONSOR_PAYTYPE_ADDED'), REQUEST_POST('pay_name'));
$OUT = ''; $SW = 2;
foreach (REQUEST_POST('id') as $id => $sel) {
// Load entry
- $result = SQL_QUERY_ESC("SELECT pay_name, pay_rate, pay_min_count, pay_currency FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` WHERE `id`='%s' LIMIT 1",
- array(bigintval($id)), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `pay_name`, `pay_rate`, `pay_min_count`, `pay_currency` FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` WHERE `id`='%s' LIMIT 1",
+ array(bigintval($id)), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load data
list($name, $rate, $min, $curr) = SQL_FETCHROW($result);
if (REQUEST_ISSET_POST('edit')) {
// Edit entry
- $OUT .= LOAD_TEMPLATE("admin_list_sponsor_pay_edit_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('admin_list_sponsor_pay_edit_row', true, $content);
} else {
// Delete entry
- $OUT .= LOAD_TEMPLATE("admin_list_sponsor_pay_del_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('admin_list_sponsor_pay_del_row', true, $content);
}
} else {
// Entry invalid
- $OUT .= LOAD_TEMPLATE("admin_list_sponsor_pay_404", true, $id);
+ $OUT .= LOAD_TEMPLATE('admin_list_sponsor_pay_404', true, $id);
}
// Switch colors
// Load main template depending on mode (edit/delete)
if (REQUEST_ISSET_POST('edit')) {
// Load main edit template
- LOAD_TEMPLATE("admin_list_sponsor_pay_edit");
+ LOAD_TEMPLATE('admin_list_sponsor_pay_edit');
} else {
// Load main delete template
- LOAD_TEMPLATE("admin_list_sponsor_pay_del");
+ LOAD_TEMPLATE('admin_list_sponsor_pay_del');
}
} else {
// Load all payment types
- $result = SQL_QUERY("SELECT id, pay_name, pay_rate, pay_min_count, pay_currency FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` ORDER BY pay_name",
+ $result = SQL_QUERY("SELECT `id`, `pay_name`, `pay_rate`, `pay_min_count`, `pay_currency` FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` ORDER BY `pay_name` ASC",
__FILE__, __LINE__);
// Do we have some paytypes setup?
);
// Add row
- $OUT .= LOAD_TEMPLATE("admin_list_sponsor_pay_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('admin_list_sponsor_pay_row', true, $content);
// Switch colors
$SW = 3 - $SW;
define('__LIST_ROWS', $OUT);
// Load list template
- define('__LIST_CONTENT', LOAD_TEMPLATE("admin_list_sponsor_pay", true));
+ define('__LIST_CONTENT', LOAD_TEMPLATE('admin_list_sponsor_pay', true));
} else {
// Noting setup so far!
define('__LIST_CONTENT', LOAD_TEMPLATE('admin_settings_saved', true, getMessage('ADMIN_SPONSOR_NO_PAYTYPES')));
}
// Add new payment types here
- define('__ADD_CONTENT', LOAD_TEMPLATE("admin_add_sponsor_paytype", true));
+ define('__ADD_CONTENT', LOAD_TEMPLATE('admin_add_sponsor_paytype', true));
// Load final template
- LOAD_TEMPLATE("admin_sponsor_paytypes");
+ LOAD_TEMPLATE('admin_sponsor_paytypes');
}
//
$listed = false;
// List confirmation links from normal or bonus mails
-if (REQUEST_ISSET_GET(('mid'))) {
+if (REQUEST_ISSET_GET('mid')) {
// SQL query for mail data
- $sql = "SELECT DISTINCT s.id, p.sender, p.subject, p.text, p.url, p.timestamp, s.max_rec FROM `{!_MYSQL_PREFIX!}_pool` AS p
-LEFT JOIN `{!_MYSQL_PREFIX!}_user_stats` AS s
-ON p.id=s.pool_id
-WHERE p.id='".REQUEST_GET('mid')."' LIMIT 1";
+ $sql = "SELECT
+ s.id, p.sender, p.subject, p.text, p.url, p.timestamp, s.max_rec
+FROM
+ `{!_MYSQL_PREFIX!}_pool` AS p
+LEFT JOIN
+ `{!_MYSQL_PREFIX!}_user_stats` AS s
+ON
+ p.id=s.pool_id
+WHERE
+ p.id='".REQUEST_GET('mid')."'
+LIMIT 1";
// Column, type and ID for member's mail
- $col = "stats_id"; $type = "NORMAL"; $ID = '-1';
+ $col = 'stats_id'; $type = 'NORMAL'; $ID = '-1';
// Load admin_list_unconfirmed template
$listed = true; $DATA = REQUEST_GET('mid'); $LINK = 'mailid';
-} elseif ((REQUEST_ISSET_GET(('bid'))) && (EXT_IS_ACTIVE('bonus'))) {
+} elseif ((REQUEST_ISSET_GET('bid')) && (EXT_IS_ACTIVE('bonus'))) {
// @TODO This constant might be unused?
define('__LIST_UNCON_TITLE', getMessage('LIST_UNCONFIRMED_BONUS_LINKS'));
// SQL query for mail data (both ids are required for compatiblity to above normal mail
- $sql = "SELECT id, id, subject, text, url, timestamp, mails_sent FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`='".REQUEST_GET('bid')."' LIMIT 1";
+ $sql = "SELECT `id`, `id`, `subject`, `text`, `url`, `timestamp`, `mails_sent` FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`='".REQUEST_GET('bid')."' LIMIT 1";
// Column, type and ID for member's mail
- $col = 'bonus_id'; $type = "BONUS"; $ID = REQUEST_GET('bid');
+ $col = 'bonus_id'; $type = 'BONUS'; $ID = REQUEST_GET('bid');
// Load admin_list_unconfirmed template
$listed = true; $DATA = $ID; $LINK = 'bonusid';
// Load unconfirmed mail links. Hmmm, this select query is pretty cool
// but it does only show unconfirmed mail links from existing user
// accounts. So if you have delete one you did not see those links
- //
- $result = SQL_QUERY_ESC("SELECT DISTINCT l.userid, u.status, u.surname, u.family, u.gender, u.email
-FROM `{!_MYSQL_PREFIX!}_user_links` AS l
-LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS u
-ON l.userid=u.userid
-WHERE l.%s='%s' ORDER BY l.userid LIMIT %s",
- array($col, $ID, bigintval($max)),__FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT
+ l.userid, u.status, u.surname, u.family, u.gender, u.email
+FROM
+ `{!_MYSQL_PREFIX!}_user_links` AS l
+LEFT JOIN
+ `{!_MYSQL_PREFIX!}_user_data` AS u
+ON
+ l.userid=u.userid
+WHERE
+ l.%s='%s' ORDER BY l.userid LIMIT %s",
+ array($col, $ID, bigintval($max)),__FILE__, __LINE__);
+
+ // Total number of unconfirmed mails
$unconfirmed = SQL_NUMROWS($result);
if ($unconfirmed > 0) {
// At least one link left to confirm
-
$OUT = ''; $SW = 2;
while ($content = SQL_FETCHARRAY($result)) {
// Prepare data for the row template
'uid' => $content['userid'],
'link' => $LINK,
'id' => $ID,
- 'email' => "<a href=\"".generateMemberEmailLink($content['email'], "user_data")."\">".translateGender($content['gender'])." ".$content['surname']." ".$content['family']."</a>",
+ 'email' => "<a href=\"".generateEmailLink($content['email'], 'user_data')."\">".translateGender($content['gender'])." ".$content['surname']." ".$content['family']."</a>",
'status' => translateUserStatus($content['status']),
);
// Load row template and switch colors
- $OUT .= LOAD_TEMPLATE("admin_list_unconfirmed_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('admin_list_unconfirmed_row', true, $content);
$SW = 3 - $SW;
}
// Render it in our new listing
- $OUT = LOAD_TEMPLATE("admin_list_unconfirmed_list", true, $OUT);
+ $OUT = LOAD_TEMPLATE('admin_list_unconfirmed_list', true, $OUT);
// Free memory
SQL_FREERESULT($result);
);
// Load final template
- LOAD_TEMPLATE("admin_list_unconfirmed", false, $content);
+ LOAD_TEMPLATE('admin_list_unconfirmed', false, $content);
} elseif (REQUEST_GET('mid') > 0) {
// Data in pool or in user_stats not found, so let's find out where data is missing
$result1 = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_pool` WHERE `id`=%s LIMIT 1",
- array(bigintval($ID)), __FILE__, __LINE__);
- $result2 = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s LIMIT 1",
- array(bigintval($ID)), __FILE__, __LINE__);
+ array(bigintval($ID)), __FILE__, __LINE__);
+ $result2 = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE `pool_id`=%s LIMIT 1",
+ array(bigintval($ID)), __FILE__, __LINE__);
+
if (SQL_NUMROWS($result1) == 1) {
// pool table
LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('ADMIN_UNCONFIRMED_POOL_MISSING'), $ID));
// Free memory
SQL_FREERESULT($result1);
SQL_FREERESULT($result2);
- } elseif (REQUEST_ISSET_GET(('bid'))) {
+ } elseif (REQUEST_ISSET_GET('bid')) {
// Data in bonus table not found
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_UNCONFIRMED_INVALID_LINK'));
}
define('_LINKS', $LINKS);
define('_ADMIN_LINKS', generateMemberAdminActionLinks($uid, $DATA['status']));
$DATA['gender'] = translateGender($DATA['gender']);
- $DATA['email_link'] = generateMemberEmailLink($DATA['email'], "user_data");
+ $DATA['email_link'] = generateEmailLink($DATA['email'], 'user_data');
$DATA['status'] = translateUserStatus($DATA['status']);
$DATA['last_online'] = generateDateTime($DATA['last_online'], '0');
$DATA['used_points'] = translateComma($DATA['used_points']);
$DATA['joined'] = generateDateTime($DATA['joined'], '0');
$DATA['last_update'] = generateDateTime($DATA['last_update'], '0');
$DATA['last_profile_sent'] = generateDateTime($DATA['last_profile_sent'], '0');
- $DATA['total'] = translateComma(GET_TOTAL_DATA($uid, "user_points", "points"));
- $DATA['locked'] = translateComma(GET_TOTAL_DATA($uid, "user_points", "locked_points"));
+ $DATA['total'] = translateComma(GET_TOTAL_DATA($uid, 'user_points', 'points'));
+ $DATA['locked'] = translateComma(GET_TOTAL_DATA($uid, 'user_points', 'locked_points'));
$DATA['lock_timestamp'] = generateDateTime($DATA['lock_timestamp'], '2');
// Is the lock reason not set?
if ($content['refid'] > 0) $content['refid'] = generateUserProfileLink($content['refid']);
// Get number of unconfirmed mails
- $LINKS = GET_TOTAL_DATA($content['userid'], "user_links", 'id', 'userid', true);
+ $LINKS = GET_TOTAL_DATA($content['userid'], 'user_links', 'id', 'userid', true);
if ($LINKS > 0) $LINKS = $base."&what=list_links&uid=".$content['userid']."\">".translateComma($LINKS)."</a>]";
// Set link to sent mails if present
if (empty($content['nickname']) || $content['nickname'] == $content['userid']) $content['nickname'] = '---';
// Calculate total points
- $pointsTotal = GET_TOTAL_DATA($content['userid'], "user_points", "points") - GET_TOTAL_DATA($content['userid'], "user_data", "used_points");
+ $pointsTotal = GET_TOTAL_DATA($content['userid'], 'user_points', 'points') - GET_TOTAL_DATA($content['userid'], 'user_data', 'used_points');
// Clickrate
$clickRate = 0;
$content['sw'] = $SW;
$content['uid'] = generateUserProfileLink($content['userid']);
$content['gender'] = translateGender($content['gender']);
- $content['email'] = "[<a href=\"".generateMemberEmailLink($content['email'], "user_data")."\">".$content['email']."</a>]";
+ $content['email'] = "[<a href=\"".generateEmailLink($content['email'], 'user_data')."\">".$content['email']."</a>]";
$content['addr'] = $content['REMOTE_ADDR'];
$content['links'] = $LINKS;
$content['alinks'] = generateMemberAdminActionLinks($content['userid'], $content['status']);
$content['points'] = translateComma($pointsTotal);
$content['rate'] = translateComma($clickRate);
- $content['locked'] = translateComma(GET_TOTAL_DATA($content['userid'], "user_points", "locked_points"));
+ $content['locked'] = translateComma(GET_TOTAL_DATA($content['userid'], 'user_points', 'locked_points'));
$content['lock_timestamp'] = generateDateTime($content['lock_timestamp'], '2');
$content['status'] = translateUserStatus($content['status']);
// Prepare mail for delivery
YOOMEDIA_PREPARE_MAIL_DELIVERY(REQUEST_POST_ARRAY());
return;
-} elseif (REQUEST_ISSET_POST(('sent'))) {
+} elseif (REQUEST_ISSET_POST('sent')) {
// Sent mail
YOOMEDIA_SEND_BONUS_MAIL(REQUEST_POST_ARRAY(), 'normal');
} elseif (REQUEST_ISSET_POST('remove')) {
// Add mail to exclude list
YOOMEDIA_EXCLUDE_MAIL(REQUEST_POST_ARRAY(), 'normal');
-} elseif (REQUEST_ISSET_POST(('unlist'))) {
+} elseif (REQUEST_ISSET_POST('unlist')) {
// Remove mail from exclude list
YOOMEDIA_UNLIST_MAIL(REQUEST_POST_ARRAY(), 'normal');
}
}
// Create email link
- define('__EMAIL_LINK', '<a href="mailto:' . $email . '">{!__GENDER!} {!__SURNAME!} {!__FAMILY!}</a>');
+ define('__EMAIL_LINK', '<a href="' . generateEmailLink($email, 'sponsor_data') . '">{!__GENDER!} {!__SURNAME!} {!__FAMILY!}</a>');
// Display form
LOAD_TEMPLATE('admin_lock_sponsor');
$URL = ADMIN_CREATE_USERID_LINK(REQUEST_GET('uid'));
} else {
$result = SQL_QUERY_ESC("SELECT email, surname, family FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(bigintval(REQUEST_GET('uid'))), __FILE__, __LINE__);
+ array(bigintval(REQUEST_GET('uid'))), __FILE__, __LINE__);
// Entry found?
if (SQL_NUMROWS($result) == 1) {
// Transfer data to constants for the template
// @TODO Rewrite these all constants
- define('__EMAIL', generateMemberEmailLink($email, 'user_data'));
+ define('__EMAIL', generateEmailLink($email, 'user_data'));
define('__SNAME', $sname);
define('__FNAME', $fname);
define('__UID' , bigintval(REQUEST_GET('uid')));
if (!isFormSent()) {
// Create arrays
- $menus = array(); $titles = array(); $below = array();
+ $menus = array();
+ $titles = array();
+ $below = array();
// 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`",
- __FILE__, __LINE__);
+ $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) {
// Read menu structure
// @TODO Cant this be rewritten?
// Remove double eintries
// @TODO This can be somehow rewritten to a function
- $prev = ''; $dmy = $menus; $dmy2 = $titles; $dmy3 = $below;
+ $prev = '';
+ $dmy = $menus;
+ $dmy2 = $titles;
+ $dmy3 = $below;
foreach ($menus as $key => $value) {
if ($value == $prev) {
// Remove entries
foreach ($below as $key => $m) {
if (is_array($m)) {
foreach ($m as $key2 => $m2) {
- $OUT .= " <option value=\"".$m2."\">".$titles[$key][$key2];
+ $OUT .= " <option value=\"" . $m2 . "\">" . $titles[$key][$key2];
foreach ($menus as $k => $v) {
if (($v == $key) && (!is_array($v))) {
$OUT .= " (" . $titles[$k] . ')';
- }
- }
+ } // END - if
+ } // END - foreach
$OUT .= "</option>\n";
- }
+ } // END - foreach
} else {
- $OUT .= " <option value=\"".$m."\">".$titles[$key]."</option>\n";
+ $OUT .= " <option value=\"" . $m . "\">" . $titles[$key] . "</option>\n";
}
}
$OUT .= "</select>";
define('__BELOW_SELECTION' , $OUT);
- define('__WHAT_SELECTION' , ADMIN_MAKE_MENU_SELECTION('member', 'what', "name"));
- define('__ACTION_SELECTION', ADMIN_MAKE_MENU_SELECTION('member', 'action', "menu"));
+ define('__WHAT_SELECTION' , ADMIN_MAKE_MENU_SELECTION('member', 'what' , 'name'));
+ define('__ACTION_SELECTION', ADMIN_MAKE_MENU_SELECTION('member', 'action', 'menu'));
// Display form
- LOAD_TEMPLATE("admin_member_add");
+ LOAD_TEMPLATE('admin_member_add');
} elseif (!IS_DEMO()) {
// Insert new menu entry
- if (REQUEST_ISSET_POST(('menu'))) {
+ if (REQUEST_ISSET_POST('menu')) {
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('%s','%s','%s','%s','%s','%s')",
- array(
- REQUEST_POST('menu'),
- REQUEST_POST('name'),
- REQUEST_POST('title'),
- REQUEST_POST('visible'),
- REQUEST_POST('active'),
- bigintval(REQUEST_POST('sort')),
- ), __FILE__, __LINE__);
+ array(
+ REQUEST_POST('menu'),
+ REQUEST_POST('name'),
+ REQUEST_POST('title'),
+ REQUEST_POST('visible'),
+ REQUEST_POST('active'),
+ bigintval(REQUEST_POST('sort')),
+ ), __FILE__, __LINE__);
} else {
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`title`,`visible`,`locked`,`sort`) VALUES ('%s','%s','%s','%s','%s')",
- array(
- REQUEST_POST('name'),
- REQUEST_POST('title'),
- REQUEST_POST('visible'),
- REQUEST_POST('active'),
- bigintval(REQUEST_POST('sort')),
- ), __FILE__, __LINE__);
+ array(
+ REQUEST_POST('name'),
+ REQUEST_POST('title'),
+ REQUEST_POST('visible'),
+ REQUEST_POST('active'),
+ bigintval(REQUEST_POST('sort')),
+ ), __FILE__, __LINE__);
}
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SETTINGS_SAVED'));
} else {
if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
require($INC);
-}
+} // END - if
// Add description as navigation point
ADD_DESCR('admin', __FILE__);
if (REQUEST_ISSET_GET('sub')) {
$AND = sprintf("`action`='%s' AND `what` IS NOT NULL", REQUEST_GET('sub'));
$SUB = REQUEST_GET('sub');
-}
+} // END - if
// Get count of (maybe) selected menu points
$chk = 0;
foreach (REQUEST_POST('sel') as $sel => $confirm) {
if ($confirm == 1) {
$cnt++;
- $result = SQL_QUERY_ESC("SELECT title, action, what FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE ".$AND." AND id=%s LIMIT 1",
- array(bigintval($sel)), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `title`, `action`, `what` FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
+ array(bigintval($sel)), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Entry found so we load the stuff...
list($menu, $act, $wht, $descr) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
$content = array(
'cnt' => $cnt,
'sel' => $sel,
'menu' => $menu,
'sw' => $SW,
- 'act' => ADMIN_MAKE_MENU_SELECTION('member', "act", "sel_act[".$sel."]", $act),
+ 'act' => ADMIN_MAKE_MENU_SELECTION('member', 'act' , 'sel_act[' . $sel . ']', $act),
'what' => ADMIN_MAKE_MENU_SELECTION('member', 'what', 'sel_what[' . $sel . ']', $wht),
);
+
// Load template
- $OUT .= LOAD_TEMPLATE("admin_mmenu_edit_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('admin_mmenu_edit_row', true, $content);
} else {
// Entry not found?
$content = array(
'sw' => $SW,
'sel' => $sel
);
- $OUT .= LOAD_TEMPLATE("admin_menu_404_row", true, $content);
+
+ // Load template
+ $OUT .= LOAD_TEMPLATE('admin_menu_404_row', true, $content);
}
+ SQL_FREERESULT($result);
$SW = 3 - $SW;
}
}
define('__CNT_VALUE', $cnt);
// Load template
- LOAD_TEMPLATE("admin_mmenu_edit");
+ LOAD_TEMPLATE('admin_mmenu_edit');
} elseif ((REQUEST_ISSET_POST('del')) && ($chk > 0) && (!IS_DEMO())) {
// Del menu entries with or without confirmation
define('__SUB_VALUE', $SUB);
foreach (REQUEST_POST('sel') as $sel => $confirm) {
if ($confirm == 1) {
$cnt++;
- $result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE ".$AND." AND id=%s LIMIT 1",
- array(bigintval($sel)), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `title` FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
+ array(bigintval($sel)), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Entry found so we load the stuff...
list($title) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
$content = array(
'cnt' => $cnt,
'sel' => $sel,
'title' => $title
);
- $OUT .= LOAD_TEMPLATE("admin_mmenu_delete_row", true, $content);
+
+ // Load template
+ $OUT .= LOAD_TEMPLATE('admin_mmenu_delete_row', true, $content);
} else {
// Entry not found?
$content = array(
'sw' => $SW,
'sel' => $sel
);
- $OUT .= LOAD_TEMPLATE("admin_menu_404_row", true, $content);
+
+ // Load template
+ $OUT .= LOAD_TEMPLATE('admin_menu_404_row', true, $content);
}
- }
- }
+ SQL_FREERESULT($result);
+ } // END - if
+ } // END - foreach
define('__MENU_ROWS', $OUT);
define('__CNT_VALUE', $cnt);
// Load template
- LOAD_TEMPLATE("admin_mmenu_delete");
-} elseif ((REQUEST_ISSET_POST(('status'))) && ($chk > 0) && (!IS_DEMO())) {
+ LOAD_TEMPLATE('admin_mmenu_delete');
+} elseif ((REQUEST_ISSET_POST('status')) && ($chk > 0) && (!IS_DEMO())) {
// Change status (visible / locked)
define('__SUB_VALUE', $SUB);
define('__CHK_VALUE', $chk);
if ($confirm == 1) {
$cnt++;
$result = SQL_QUERY_ESC("SELECT title, visible, locked FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE ".$AND." AND id=%s LIMIT 1",
- array(bigintval($sel)), __FILE__, __LINE__);
+ array(bigintval($sel)), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Entry found so we load the stuff...
list($menu, $vis, $locked) = SQL_FETCHROW($result);
// Load template
$OUT .= LOAD_TEMPLATE('admin_menu_status_row', true, $content);
- }
- else
- {
+ } else {
// Entry not found?
$content = array(
'sw' => $SW,
'sel' => $sel
);
+
+ // Load template
$OUT .= LOAD_TEMPLATE('admin_menu_404_row', true, $content);
}
$SW = 3 - $SW;
- }
- }
+ } // END - if
+ } // END - foreach
define('__MENU_ROWS', $OUT);
define('__CNT_VALUE', $cnt);
- //
+
+ // Load template
LOAD_TEMPLATE('admin_mmenu_status');
} elseif ((isFormSent()) && (!IS_DEMO())) {
// An act is done...
$AND = "(`what` = '' OR `what` IS NULL)";
$sel = bigintval($sel);
if (!empty($SUB)) $AND = "`action`='".$SUB."'";
- switch (REQUEST_POST('ok'))
- {
+ switch (REQUEST_POST('ok')) {
case 'edit': // Edit menu
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `title`='%s', `action`='%s', `what`='%s' WHERE ".$AND." AND id=%s LIMIT 1",
- array($menu, REQUEST_POST('sel_act', $sel), REQUEST_POST('sel_what', $sel), $sel), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `title`='%s', `action`='%s', `what`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
+ array($menu, REQUEST_POST('sel_act', $sel), REQUEST_POST('sel_what', $sel), $sel), __FILE__, __LINE__);
break;
case 'del': // Delete menu
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE ".$AND." AND id=%s LIMIT 1",
- array($sel), __FILE__, __LINE__);
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
+ array($sel), __FILE__, __LINE__);
break;
case 'status': // Change status of menus
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='%s', `locked`='%s' WHERE ".$AND." AND id=%s LIMIT 1",
- array(REQUEST_POST('visible', $sel), REQUEST_POST('locked', $sel), $sel), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='%s', `locked`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
+ array(REQUEST_POST('visible', $sel), REQUEST_POST('locked', $sel), $sel), __FILE__, __LINE__);
break;
- }
+ } // END - switch
break;
- }
+ } // END - foreach
// Load template
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SETTINGS_SAVED'));
} else {
- if ((REQUEST_ISSET_GET(('act'))) && (REQUEST_ISSET_GET(('tid'))) && (REQUEST_ISSET_GET(('fid')))) {
+ if ((REQUEST_ISSET_GET('act')) && (REQUEST_ISSET_GET('tid')) && (REQUEST_ISSET_GET('fid'))) {
// Init
$tid = ''; $fid = '';
// Get IDs
- if (REQUEST_ISSET_GET(('w'))) {
+ if (REQUEST_ISSET_GET('w')) {
// Sub menus selected
$result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
- array(bigintval(REQUEST_GET('act')), bigintval(REQUEST_GET('tid'))), __FILE__, __LINE__);
+ array(bigintval(REQUEST_GET('act')), bigintval(REQUEST_GET('tid'))), __FILE__, __LINE__);
list($tid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
$result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
- array(bigintval(REQUEST_GET('act')), bigintval(REQUEST_GET('fid'))), __FILE__, __LINE__);
+ array(bigintval(REQUEST_GET('act')), bigintval(REQUEST_GET('fid'))), __FILE__, __LINE__);
list($fid) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
} else {
// Main menu selected
$result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
- array(bigintval(REQUEST_GET('tid'))), __FILE__, __LINE__);
+ array(bigintval(REQUEST_GET('tid'))), __FILE__, __LINE__);
list($tid) = SQL_FETCHROW($result);
$result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
- array(bigintval(REQUEST_GET('fid'))), __FILE__, __LINE__);
+ array(bigintval(REQUEST_GET('fid'))), __FILE__, __LINE__);
list($fid) = SQL_FETCHROW($result);
}
if ((!empty($tid)) && (!empty($fid))) {
// Sort menu
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `sort`='%s' WHERE ".$AND." AND id=%s LIMIT 1",
- array(bigintval(REQUEST_GET('tid')), bigintval($fid)), __FILE__, __LINE__);
+ array(bigintval(REQUEST_GET('tid')), bigintval($fid)), __FILE__, __LINE__);
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `sort`='%s' WHERE ".$AND." AND id=%s LIMIT 1",
- array(bigintval(REQUEST_GET('fid')), bigintval($tid)), __FILE__, __LINE__);
+ array(bigintval(REQUEST_GET('fid')), bigintval($tid)), __FILE__, __LINE__);
} // END - -fi
}
if (!empty($SUB)) {
// Edit sub menus
- $result = SQL_QUERY("SELECT id, action, what, title, sort FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE ".$AND." AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC", __FILE__, __LINE__);
+ $result = SQL_QUERY("SELECT `id`, `action`, `what`, `title`, `sort` FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE ".$AND." AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC", __FILE__, __LINE__);
} else {
// Edit main menus
- $result = SQL_QUERY("SELECT id, action, what, title, sort FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC", __FILE__, __LINE__);
+ $result = SQL_QUERY("SELECT `id`, `action`, `what`, `title`, `sort` FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC", __FILE__, __LINE__);
}
+ // Get total menu entries
$max = SQL_NUMROWS($result);
+
+ // Some are there?
if ($max > 0) {
// Set sub value
// @TODO Rewrite this constant
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_ALL_POINTS_SUBTRACTED'));
} else {
// Display form add points
- LOAD_TEMPLATE("admin_sub_points_all");
+ LOAD_TEMPLATE('admin_sub_points_all');
}
} elseif (REQUEST_ISSET_GET('uid')) {
// User ID found in URL so we use this give him some credits
- $result = SQL_QUERY_ESC("SELECT surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND `status`='CONFIRMED' LIMIT 1",
- array(bigintval(REQUEST_GET('uid'))),__FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `surname`, `family`, `email` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s AND `status`='CONFIRMED' LIMIT 1",
+ array(bigintval(REQUEST_GET('uid'))),__FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Selected user does exist
$content = SQL_FETCHARRAY($result);
if ((isFormSent()) && (REQUEST_ISSET_POST(('points')))) {
// Ok, add to used points and send an email to him...
- SUB_POINTS("admin_single", bigintval(REQUEST_GET('uid')), REQUEST_POST('points'));
+ SUB_POINTS('admin_single', bigintval(REQUEST_GET('uid')), REQUEST_POST('points'));
// Add more content
$content['text'] = SQL_ESCAPE(REQUEST_POST('reason'));
$content['points'] = bigintval(REQUEST_POST('points'));
// Load email and send it away
- $msg = LOAD_EMAIL_TEMPLATE("sub-points", $content, bigintval(REQUEST_GET('uid')));
+ $msg = LOAD_EMAIL_TEMPLATE('sub-points', $content, bigintval(REQUEST_GET('uid')));
sendEmail($content['email'], getMessage('ADMIN_SUB_SUBJ'), $msg);
// Output message
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_POINTS_SUBTRACTED'));
} else {
// @TODO Rewrite these constants
- define('__USER_VALUE', "<a href=\"".generateMemberEmailLink($content['email'], "user_data")."\">".$content['surname']." ".$content['family']."</a>");
+ define('__USER_VALUE', "<a href=\"".generateEmailLink($content['email'], 'user_data')."\">".$content['surname']." ".$content['family']."</a>");
define('__UID', bigintval(REQUEST_GET('uid')));
// Load form
- LOAD_TEMPLATE("admin_sub_points");
+ LOAD_TEMPLATE('admin_sub_points');
}
} else {
// User not found!
}
// Add seperator
- OUTPUT_HTML("<br />");
+ OUTPUT_HTML('<br />');
}
// Begin listing of all pending sponsor accounts
$result = SQL_QUERY("SELECT
- id, gender, surname, family, email, remote_addr, sponsor_created
+ `id`, `gender`, `surname`, `family`, `email`, `remote_addr`, `sponsor_created`
FROM
`{!_MYSQL_PREFIX!}_sponsor_data`
WHERE
'gender' => translateGender($content['gender']),
'surname' => $content['surname'],
'family' => $content['family'],
- 'email' => "mailto:".$content['email'],
+ 'email' => generateEmailLink($content['email'], 'sponsor_data'),
'remote' => $content['remote_addr'],
'created' => generateDateTime($content['sponsor_created'], '2'),
);
// Load row template and switch colors
- $OUT .= LOAD_TEMPLATE("admin_unlock_sponsor_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('admin_unlock_sponsor_row', true, $content);
$SW = 3 - $SW;
}
define('__SPONSOR_ROWS', $OUT);
// Load template
- LOAD_TEMPLATE("admin_unlock_sponsor");
+ LOAD_TEMPLATE('admin_unlock_sponsor');
} else {
// No pending accounts found
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_SPONSOR_NONE_PENDING'));
// Base directory (should be moved to database)
$usage = getConfig('usage_base') . '/';
-if (REQUEST_ISSET_GET(('image'))) {
+if (REQUEST_ISSET_GET('image')) {
if (REQUEST_GET('type') == 'usage') {
$FQFN = sprintf("%s%s/usage.png",
- constant('PATH'),
- getConfig('usage_base')
+ constant('PATH'),
+ getConfig('usage_base')
);
} else {
if (strpos(REQUEST_GET('image'), "\\") > 0) REQUEST_SET_GET('image', substr(REQUEST_GET('image'), 0, strpos(REQUEST_GET('image'), "\\")));
$FQFN = sprintf("%s%s/%s_usage_%s.png",
- constant('PATH'),
- getConfig('usage_base'),
- REQUEST_GET(('type')),
- REQUEST_GET(('image'))
+ constant('PATH'),
+ getConfig('usage_base'),
+ REQUEST_GET('type'),
+ REQUEST_GET('image')
);
}
imagedestroy($image);
}
shutdown();
-} elseif (!REQUEST_ISSET_GET(('usage'))) {
+} elseif (!REQUEST_ISSET_GET('usage')) {
$FQFN = sprintf("%s%s/index.html",
- constant('PATH'),
- getConfig('usage_base')
+ constant('PATH'),
+ getConfig('usage_base')
);
} else {
$FQFN = sprintf("%s%s/usage_%s.html",
- constant('PATH'),
- getConfig('usage_base'),
- REQUEST_GET(('usage'))
+ constant('PATH'),
+ getConfig('usage_base'),
+ REQUEST_GET('usage')
);
}
// Until here...
// Replace URLs
- $content = str_replace("usage.png", "{!URL!}/modules.php?module=admin&what=".getWhat()."&type=usage&image=usage", $content);
- $content = str_replace("daily_usage_", "{!URL!}/modules.php?module=admin&what=".getWhat()."&type=daily&image=", $content);
- $content = str_replace("hourly_usage_", "{!URL!}/modules.php?module=admin&what=".getWhat()."&type=hourly&image=", $content);
- $content = str_replace("ctry_usage_", "{!URL!}/modules.php?module=admin&what=".getWhat()."&type=ctry&image=", $content);
- $content = str_replace("usage_", "{!URL!}/modules.php?module=admin&what=".getWhat()."&usage=", str_replace(".html", '', $content));
+ $content = str_replace('usage.png' , '{!URL!}/modules.php?module=admin&what='.getWhat().'&type=usage&image=usage', $content);
+ $content = str_replace('daily_usage_' , '{!URL!}/modules.php?module=admin&what='.getWhat().'&type=daily&image=' , $content);
+ $content = str_replace('hourly_usage_', '{!URL!}/modules.php?module=admin&what='.getWhat().'&type=hourly&image=' , $content);
+ $content = str_replace('ctry_usage_' , '{!URL!}/modules.php?module=admin&what='.getWhat().'&type=ctry&image=' , $content);
+ $content = str_replace('usage_' , '{!URL!}/modules.php?module=admin&what='.getWhat().'&usage=' , str_replace('.html', '', $content));
// Disabled due to too much trouble
- //$content = str_replace("HREF=\'http://', "href=\"{!URL!}/modules.php?module=loader&url=http://", $content);
+ //$content = str_replace("HREF=\"http://", "href=\"{!URL!}/modules.php?module=loader&url=http://", $content);
$test = strtolower($content);
// Do we need to strip out above and including <body> plus trailing </html> tag?
} // END - if
// Output code
- OUTPUT_HTML("<div align=\"left\">
- ".$content."
-</div>");
+ OUTPUT_HTML($content);
} else {
// Nothing to load, then we have no directory 'usage'
LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('ADMIN_USAGE_DIRECTORY_404'), getConfig('usage_base')));
if (!defined('__SECURITY')) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
require($INC);
-}
+} // END - if
$mode = 'guest';
-if (REQUEST_ISSET_GET(('order'))) {
+if (REQUEST_ISSET_GET('order')) {
// Order number placed, is he also logged in?
if (IS_MEMBER()) {
// Ok, test passed... :)
- $result = SQL_QUERY_ESC("SELECT subject, url FROM `{!_MYSQL_PREFIX!}_pool` WHERE `id`=%s AND sender=%s AND data_type='TEMP' LIMIT 1",
- array(bigintval(REQUEST_GET('order')), getUserId()), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `subject`, `url` FROM `{!_MYSQL_PREFIX!}_pool` WHERE `id`=%s AND `sender`=%s AND `data_type`='TEMP' LIMIT 1",
+ array(bigintval(REQUEST_GET('order')), getUserId()), __FILE__, __LINE__);
// Finally is the entry valid?
if (SQL_NUMROWS($result) == 1) {
// He is no longer logged in
redirectToUrl('modules.php?module=index&what=login');
}
-}
+} // END - if
if ((REQUEST_ISSET_POST('url')) || (REQUEST_ISSET_GET('url')) || (REQUEST_ISSET_GET('frame'))) {
// Default URL is ours
// Ok, write the ref-points to this user and his parent-ref
unset($GLOBALS['ref_level']);
- // Shall I "pay" the referal points imidiately?
+ // Shall I 'pay' the referal points imidiately?
if (getConfig('ref_payout') == '0') {
- // Yes, "pay" it now
+ // Yes, 'pay' it now
$locked = false;
} else {
- // No, "pay" it later
+ // No, 'pay' it later
$locked = true;
}
if ((isUserIdSet()) && (isSessionVariableSet('u_hash'))) {
// Maybe, then continue with it
$uid = getUserId();
-} elseif ((REQUEST_ISSET_POST('id')) && (REQUEST_ISSET_POST(('password'))) && (isFormSent())) {
+} elseif ((REQUEST_ISSET_POST('id')) && (REQUEST_ISSET_POST('password')) && (isFormSent())) {
// Set userid and crypt password when login data was submitted
if ((EXT_IS_ACTIVE('nickname')) && (NICKNAME_IS_ACTIVE(REQUEST_POST('id')))) {
// Nickname entered
// Direct userid entered
$uid = bigintval(REQUEST_POST('id'));
}
-} elseif (REQUEST_ISSET_POST(('new_pass'))) {
+} elseif (REQUEST_ISSET_POST('new_pass')) {
// New password requested
$uid = 0;
if (REQUEST_ISSET_POST('id')) $uid = REQUEST_POST('id');
}
// Set unset variables
-if (!REQUEST_ISSET_POST(('new_pass'))) REQUEST_SET_POST('new_pass', '');
+if (!REQUEST_ISSET_POST('new_pass')) REQUEST_SET_POST('new_pass', '');
if (!REQUEST_ISSET_GET('login')) REQUEST_SET_GET('login' , '');
if (IS_MEMBER()) {
} elseif (isFormSent()) {
// Try the login (see inc/libs/user_functions.php)
$URL = USER_DO_LOGIN(REQUEST_POST('id'), REQUEST_POST('password'));
-} elseif ((REQUEST_ISSET_POST(('new_pass'))) && (isset($uid))) {
+} elseif ((REQUEST_ISSET_POST('new_pass')) && (isset($uid))) {
// Try the userid/email lookup (see inc/libs/user_functions.php)
$errorCode = USER_DO_NEW_PASSWORD(REQUEST_POST('email'), $uid);
}
$cats = 0;
$ipTimedOut = false;
+/**
+ * @TODO Commented out, do we need this ugly code?
if (!isFormSent()) REQUEST_UNSET_POST('ok');
-if (!REQUEST_ISSET_POST(('agree'))) REQUEST_SET_POST('agree' , '');
-if (!REQUEST_ISSET_POST(('addy'))) REQUEST_SET_POST('addy' , '');
-if (!REQUEST_ISSET_POST(('surname'))) REQUEST_SET_POST('surname' , '');
-if (!REQUEST_ISSET_POST(('family'))) REQUEST_SET_POST('family' , '');
+if (!REQUEST_ISSET_POST('agree')) REQUEST_SET_POST('agree' , '');
+if (!REQUEST_ISSET_POST('addy')) REQUEST_SET_POST('addy' , '');
+if (!REQUEST_ISSET_POST('surname')) REQUEST_SET_POST('surname' , '');
+if (!REQUEST_ISSET_POST('family')) REQUEST_SET_POST('family' , '');
if (!REQUEST_ISSET_POST('pass1')) REQUEST_SET_POST('pass1' , '');
if (!REQUEST_ISSET_POST('pass2')) REQUEST_SET_POST('pass2' , '');
-if (!REQUEST_ISSET_POST(('day'))) REQUEST_SET_POST('day' , '');
-if (!REQUEST_ISSET_POST(('month'))) REQUEST_SET_POST('month' , '');
-if (!REQUEST_ISSET_POST(('year'))) REQUEST_SET_POST('year' , '');
-if (!REQUEST_ISSET_POST(('max_mails'))) REQUEST_SET_POST('max_mails' , '');
-if (!REQUEST_ISSET_POST(('street_nr'))) REQUEST_SET_POST('street_nr' , '');
+if (!REQUEST_ISSET_POST('day')) REQUEST_SET_POST('day' , '');
+if (!REQUEST_ISSET_POST('month')) REQUEST_SET_POST('month' , '');
+if (!REQUEST_ISSET_POST('year')) REQUEST_SET_POST('year' , '');
+if (!REQUEST_ISSET_POST('max_mails')) REQUEST_SET_POST('max_mails' , '');
+if (!REQUEST_ISSET_POST('street_nr')) REQUEST_SET_POST('street_nr' , '');
if (!REQUEST_ISSET_POST('zip')) REQUEST_SET_POST('zip' , '');
-if (!REQUEST_ISSET_POST(('city'))) REQUEST_SET_POST('city' , '');
-if (!REQUEST_ISSET_POST(('cntry'))) REQUEST_SET_POST('cntry' , '');
-if (!REQUEST_ISSET_POST(('country_code'))) REQUEST_SET_POST('country_code', '1');
+if (!REQUEST_ISSET_POST('city')) REQUEST_SET_POST('city' , '');
+if (!REQUEST_ISSET_POST('cntry')) REQUEST_SET_POST('cntry' , '');
+if (!REQUEST_ISSET_POST('country_code')) REQUEST_SET_POST('country_code', '1');
+*/
// Default refid is zero
REQUEST_SET_POST('refid', 0);
if ($GLOBALS['refid'] > 0) {
// Test if the refid is valid
- $result = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(bigintval($GLOBALS['refid'])), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `userid` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
+ array(bigintval($GLOBALS['refid'])), __FILE__, __LINE__);
// Userid found?
//* DEBUG: */ die("refid={$GLOBALS['refid']}/numRows=".SQL_NUMROWS($result)."");
// Did he enter a valid email address? (we really don't care about
// that, he has to click on a confirmation link :P )
- if ((!REQUEST_ISSET_POST(('addy'))) || (!isEmailValid(REQUEST_POST('addy')))) {
+ if ((!REQUEST_ISSET_POST('addy')) || (!isEmailValid(REQUEST_POST('addy')))) {
REQUEST_SET_POST('addy', '!');
$isFailed = true;
} // END - if
// And what about surname and family's name?
- if (!REQUEST_ISSET_POST(('surname'))) {
+ if (!REQUEST_ISSET_POST('surname')) {
REQUEST_SET_POST('surname', '!');
$isFailed = true;
} // END - if
- if (!REQUEST_ISSET_POST(('family'))) {
+ if (!REQUEST_ISSET_POST('family')) {
REQUEST_SET_POST('family', '!');
$isFailed = true;
} // END - if
// Write his welcome-points
$result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_points` WHERE userid=%s AND ref_depth=0 LIMIT 1",
- array(bigintval($userid)), __FILE__, __LINE__);
+ array(bigintval($userid)), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 0) {
// Add only when the line was not found (maybe some more secure?)
- $locked = "points";
+ $locked = 'points';
if (getConfig('ref_payout') > 0) $locked = "locked_points"; // Pay him later. First he has to confirm some mails!
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_points` (userid, ref_depth, ".$locked.") VALUES (%s,0,'%s')",
- array(bigintval($userid), getConfig('points_register')), __FILE__, __LINE__);
+ array(bigintval($userid), getConfig('points_register')), __FILE__, __LINE__);
// Update mediadata as well
- if ((GET_EXT_VERSION('mediadata') >= '0.0.4') && ($locked == "points")) {
+ if ((GET_EXT_VERSION('mediadata') >= '0.0.4') && ($locked == 'points')) {
// Update database
MEDIA_UPDATE_ENTRY(array('total_points'), 'add', getConfig('points_register'));
} // END - if
// Check submitted form data
//
// 1. Salutation / Surname / family name
- if (!REQUEST_ISSET_POST(('gender'))) {
+ if (!REQUEST_ISSET_POST('gender')) {
// Surname is empty
$FORM_ERRORS[] = getMessage('SPONSOR_NO_GENDER_SELECTED');
- }
+ } // END - if
- if (!REQUEST_ISSET_POST(('surname'))) {
+ if (!REQUEST_ISSET_POST('surname')) {
// Surname is empty
$FORM_ERRORS[] = getMessage('SPONSOR_SURNAME_IS_EMPTY');
- }
+ } // END - if
- if (!REQUEST_ISSET_POST(('family'))) {
+ if (!REQUEST_ISSET_POST('family')) {
// Surname is empty
$FORM_ERRORS[] = getMessage('SPONSOR_FAMILY_IS_EMPTY');
- }
+ } // END - if
// 2. Company name
- // 012 3 32 23 4 43 3 4 4321 12 3 32 2 3 3210
- if (((!REQUEST_ISSET_POST(('company'))) && ((REQUEST_ISSET_POST(('tax_ident'))) || (REQUEST_ISSET_POST(('position'))))) || ((REQUEST_ISSET_POST(('company'))) && (!REQUEST_ISSET_POST(('tax_ident'))))) {
- if (!REQUEST_ISSET_POST(('company'))) {
+ // 012 3 32 23 4 43 3 4 4321 12 3 32 2 3 3210
+ if (((!REQUEST_ISSET_POST('company')) && ((REQUEST_ISSET_POST('tax_ident')) || (REQUEST_ISSET_POST('position')))) || ((REQUEST_ISSET_POST('company')) && (!REQUEST_ISSET_POST('tax_ident')))) {
+ if (!REQUEST_ISSET_POST('company')) {
// Company name is empty
$FORM_ERRORS[] = getMessage('SPONSOR_COMPANY_IS_EMPTY');
- } elseif (!REQUEST_ISSET_POST(('tax_ident'))) {
+ } elseif (!REQUEST_ISSET_POST('tax_ident')) {
// Tax ident number name is empty
$FORM_ERRORS[] = getMessage('SPONSOR_TAX_IDENT_IS_EMPTY');
}
- if (!REQUEST_ISSET_POST(('position'))) {
+ if (!REQUEST_ISSET_POST('position')) {
// Not fatal but not nice: position in company is empty
$FORM_ERRORS[] = getMessage('SPONSOR_POSITION_IS_EMPTY');
- }
- }
+ } // END - if
+ } // END - if
// 3. Street and number
- if (!REQUEST_ISSET_POST(('street_nr1'))) {
+ if (!REQUEST_ISSET_POST('street_nr1')) {
// Street name and house number are empty
$FORM_ERRORS[] = getMessage('SPONSOR_STREET_NR1_IS_EMPTY');
- } elseif ((REQUEST_ISSET_POST(('street_nr2'))) && (!REQUEST_ISSET_POST(('street_nr1')))) {
+ } elseif ((REQUEST_ISSET_POST('street_nr2')) && (!REQUEST_ISSET_POST('street_nr1'))) {
// 1st line for street is empty, but 2nd line not
$FORM_ERRORS[] = getMessage('SPONSOR_STREET_NR1_IS_EMPTY_2_NOT');
}
// 4. Country code
- if (!REQUEST_ISSET_POST(('country'))) {
+ if (!REQUEST_ISSET_POST('country')) {
// Country code is empty
$FORM_ERRORS[] = getMessage('SPONSOR_COUNTRY_IS_EMPTY');
} elseif (strlen(REQUEST_POST('country')) != 2) {
}
// 4. City
- if (!REQUEST_ISSET_POST(('city'))) {
+ if (!REQUEST_ISSET_POST('city')) {
// City is empty
$FORM_ERRORS[] = getMessage('SPONSOR_CITY_IS_EMPTY');
- }
+ } // END - if
// 5. Phone number
- if (!REQUEST_ISSET_POST(('phone'))) {
+ if (!REQUEST_ISSET_POST('phone')) {
// City is empty
$FORM_ERRORS[] = getMessage('SPONSOR_PHONE_IS_EMPTY');
- }
+ } // END - if
// 6. Homepage URL
if (!REQUEST_ISSET_POST('url')) {
}
// 7. Light validation of email address
- if ((!REQUEST_ISSET_POST('email')) || (REQUEST_POST('email') == "@")) {
+ if ((!REQUEST_ISSET_POST('email')) || (REQUEST_POST('email') == '@')) {
// Email is invalid/empty
$FORM_ERRORS[] = getMessage('SPONSOR_EMAIL_IS_INVALID');
} elseif (SPONSOR_FOUND_EMAIL_DB(REQUEST_POST('email'))) {
}
// 8. Pay type selected?
- if (!REQUEST_ISSET_POST(('pay_type'))) {
+ if (!REQUEST_ISSET_POST('pay_type')) {
// Not pay type selected
$FORM_ERRORS[] = getMessage('SPONSOR_NO_PAYTYPE_SELECTED');
- }
+ } // END - if
// 9. Interval of mails
- if (!REQUEST_ISSET_POST(('warning_interval'))) {
+ if (!REQUEST_ISSET_POST('warning_interval')) {
// No warning interval selected
$FORM_ERRORS[] = getMessage('SPONSOR_NO_WARNING_INTERVAL_SELECTED');
- }
+ } // END - if
// 10. Mail notifications disabled/enabled
- if (!REQUEST_ISSET_POST(('receive_warnings'))) {
+ if (!REQUEST_ISSET_POST('receive_warnings')) {
// Option not selected!
$FORM_ERRORS[] = getMessage('SPONSOR_NO_RECEIVE_WARNINGS_SELECTED');
- }
+ } // END - if
// Did he enter his password twice?
if (((!REQUEST_ISSET_POST('pass1')) || (!REQUEST_ISSET_POST('pass2'))) || ((REQUEST_POST('pass1') != REQUEST_POST('pass2')) && (REQUEST_ISSET_POST('pass1')) && (REQUEST_ISSET_POST('pass2')))) {
}
// Check if he has accepted the terms&conditions
- if (!REQUEST_ISSET_POST(('terms'))) {
+ if (!REQUEST_ISSET_POST('terms')) {
// Homepage URL is empty
$FORM_ERRORS[] = getMessage('SPONSOR_TERMS_NOT_ACCEPTED');
- }
+ } // END - if
// If there is something wrong/missing stop registration
if (count($FORM_ERRORS) > 0) REQUEST_UNSET_POST('ok');
);
// Calulate points
- $result = SQL_QUERY_ESC("SELECT (pay_rate * pay_min_count) AS points, pay_min_count AS pay, pay_currency AS curr
+ $result = SQL_QUERY_ESC("SELECT (`pay_rate` * `pay_min_count`) AS points, `pay_min_count` AS pay, `pay_currency` AS curr
FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes`
-WHERE `id`='%s' LIMIT 1", array(REQUEST_POST('pay_type')), __FILE__, __LINE__);
+WHERE `id`='%s' LIMIT 1",
+ array(REQUEST_POST('pay_type')), __FILE__, __LINE__);
list($points, $pay, $curr) = SQL_FETCHROW($result);
// Free memory
$STATUS = SPONSOR_HANDLE_SPONSOR(REQUEST_POST_ARRAY(), true, $messageArray, true);
// Check the status of the registration process
- switch ($STATUS)
- {
- case "added": // Sponsor successfully added with account status = UNCONFIRMED!
+ switch ($STATUS) {
+ case 'added': // Sponsor successfully added with account status = UNCONFIRMED!
// Check for his ID number
- $result = SQL_QUERY_ESC("SELECT id, hash FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE email='%s' LIMIT 1",
- array(REQUEST_POST('email')), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `id`, `hash` FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `email`='%s' LIMIT 1",
+ array(REQUEST_POST('email')), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// ID found so let's load it for the confirmation email
list($id, $hash) = SQL_FETCHROW($result);
define('__PASSWORD' , REQUEST_POST('pass1'));
// Generate email and send it to the new sponsor
- $EMAIL_MSG = LOAD_EMAIL_TEMPLATE("sponsor_confirm", $hash);
+ $EMAIL_MSG = LOAD_EMAIL_TEMPLATE('sponsor_confirm', $hash);
sendEmail(REQUEST_POST('email'), getMessage('SPONSOR_PLEASE_CONFIRM_SUBJ'), $EMAIL_MSG);
// Send mail to admin
- sendAdminNotification(getMessage('ADMIN_NEW_SPONSOR'), "admin_sponsor_reg", $hash);
+ sendAdminNotification(getMessage('ADMIN_NEW_SPONSOR'), 'admin_sponsor_reg', $hash);
// Output message: DONE
$message = $messageArray['added'];
LOAD_TEMPLATE('admin_settings_saved', false, $message);
} else {
// Check for payment types
- $result = SQL_QUERY("SELECT id, pay_name, pay_rate, pay_currency, pay_min_count
+ $result = SQL_QUERY("SELECT `id`, `pay_name`, `pay_rate`, `pay_currency`, `pay_min_count`
FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes`
-ORDER BY pay_name", __FILE__, __LINE__);
+ORDER BY `pay_name`", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// Load all types...
// @TODO Swap this HTML code to templates
$content['res'] = translateComma($content['pay_rate'] * $content['pay_min_count']);
// Load row template and switch color
- $OUT .= LOAD_TEMPLATE("guest_sponsor_payment_row", false, $content);
+ $OUT .= LOAD_TEMPLATE('guest_sponsor_payment_row', false, $content);
$SW = 3 - $SW;
}
$OUT .= "</table>\n";
define('__URL' , COMPILE_CODE(REQUEST_POST('url')));
// Check for gender selection
- switch (REQUEST_POST('gender'))
- {
+ switch (REQUEST_POST('gender')) {
case 'M': // Male
define('__GENDER_M' , ' selected="selected"');
define('__GENDER_F' , '');
define('__GENDER_F' , '');
define('__GENDER_C' , ' selected="selected"');
break;
- }
+ } // END - if
// Check for receive_warnings
- switch (REQUEST_POST('receive_warnings'))
- {
+ switch (REQUEST_POST('receive_warnings')) {
case 'Y':
define('__REC_Y' , ' selected="selected"');
define('__REC_N' , '');
define('__REC_Y' , '');
define('__REC_N' , ' selected="selected"');
break;
- }
+ } // END - if
// Errors found
$OUT = "<P align=\"center\">
}
// Prepare referal things
- if (!REQUEST_ISSET_GET(('refid'))) {
+ if (!REQUEST_ISSET_GET('refid')) {
// No referal link
define('__SPONSOR_REFID', '0');
} else {
}
// Display registration form
- LOAD_TEMPLATE("guest_sponsor_reg");
+ LOAD_TEMPLATE('guest_sponsor_reg');
} else {
// Nothing added so far
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SPONSOR_PAYMENT_LIST_IS_EMPTY'));
'uid' => $content['userid'],
'nick' => $content['nickname'],
'logins' => $content['total_logins'],
- 'points' => translateComma(GET_TOTAL_DATA($content['userid'], "user_points", "points")),
+ 'points' => translateComma(GET_TOTAL_DATA($content['userid'], 'user_points', 'points')),
'last' => generateDateTime($content['last_online'], '3'),
);
);
// Load row template
- $OUT .= LOAD_TEMPLATE("guest_top10_empty5", true, $content);
+ $OUT .= LOAD_TEMPLATE('guest_top10_empty5', true, $content);
$SW = 3 - $SW;
} // END - for
} // END - if
);
// Load row template
- $OUT .= LOAD_TEMPLATE("guest_top10_row_earner", true, $content);
+ $OUT .= LOAD_TEMPLATE('guest_top10_row_earner', true, $content);
// Switch colors and count one up
$SW = 3 - $SW; $cnt++;
);
// Load row template
- $OUT .= LOAD_TEMPLATE("guest_top10_empty4", true, $content);
+ $OUT .= LOAD_TEMPLATE('guest_top10_empty4', true, $content);
$SW = 3 - $SW;
} // END - for
} // END - if
'uid' => $content['userid'],
'refs' => $content['refs'],
'nick' => $content['nickname'],
- 'points' => translateComma(GET_TOTAL_DATA($content['userid'], "user_points", "points")),
+ 'points' => translateComma(GET_TOTAL_DATA($content['userid'], 'user_points', 'points')),
'last' => generateDateTime($content['last_online'], '3')
);
ADD_DESCR('member', __FILE__);
// Autopurge installed?
-$lastOnline = "%s"; $ONLINE = '';
+$lastOnline = "%s";
+$ONLINE = '';
+
if (EXT_IS_ACTIVE('autopurge')) {
// Use last online timestamp to keep inactive members away from here
$lastOnline = " AND `last_online` >= (UNIX_TIMESTAMP() - %s)";
$ONLINE = getConfig('ap_inactive_since');
-}
+} // END - if
-// Let's check if there are some points left we can "pay"...
-$result = SQL_QUERY_ESC("SELECT userid, beg_points AS beg, last_online FROM `{!_MYSQL_PREFIX!}_user_data`
-WHERE beg_points > 0 AND `status`='CONFIRMED'".$lastOnline."
-ORDER BY beg_points DESC, last_online DESC, userid LIMIT %s",
-array($ONLINE, getConfig('beg_ranks')), __FILE__, __LINE__);
+// Let's check if there are some points left we can 'pay'...
+$result = SQL_QUERY_ESC("SELECT
+ `userid`, `beg_points` AS beg, `last_online`
+FROM
+ `{!_MYSQL_PREFIX!}_user_data`
+WHERE
+ `beg_points` > 0 AND `status`='CONFIRMED'".$lastOnline."
+ORDER BY
+ `beg_points` DESC, `last_online` DESC, `userid` ASC LIMIT %s",
+ array(
+ $ONLINE,
+ getConfig('beg_ranks')
+ ), __FILE__, __LINE__);
// Reset temporary variable and check for users
$OUT = '';
);
// Load row template
- $OUT .= LOAD_TEMPLATE("member_list_beg_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('member_list_beg_row', true, $content);
// Count one up and switch colors
$cnt++; $SW = 3 - $SW;
}
} else {
// No one is interested in our "active rallye" ! :-(
- $OUT = LOAD_TEMPLATE("member_beg_404", true);
+ $OUT = LOAD_TEMPLATE('member_beg_404', true);
}
// Free memory
define('__BEG_ROWS', $OUT);
// Load final template
-LOAD_TEMPLATE("member_list_beg");
+LOAD_TEMPLATE('member_list_beg');
//
?>
$ONLINE = getConfig('ap_inactive_since');
}
-// Let's check if there are some points left we can "pay"...
-$result = SQL_QUERY_ESC("SELECT userid, ".$USE." AS points, last_online FROM `{!_MYSQL_PREFIX!}_user_data`
-WHERE ".$USE." > 0 AND `status`='CONFIRMED'".$lastOnline."
-ORDER BY points DESC, last_online DESC, userid
+// Let's check if there are some points left we can 'pay'...
+$result = SQL_QUERY_ESC("SELECT
+ `userid`, `".$USE."` AS points, `last_online`
+FROM
+ `{!_MYSQL_PREFIX!}_user_data`
+WHERE
+ `".$USE."` > 0 AND `status`='CONFIRMED'".$lastOnline."
+ORDER BY
+ `points` DESC,
+ last_online DESC,
+ userid ASC
LIMIT %s",
-array($ONLINE, getConfig('bonus_ranks')), __FILE__, __LINE__);
+ array(
+ $ONLINE,
+ getConfig('bonus_ranks')
+ ), __FILE__, __LINE__);
// Reset temporary variable and check for users
$OUT = '';
);
// Load row template
- $OUT .= LOAD_TEMPLATE("member_bonus_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('member_bonus_row', true, $content);
// Count one up and switch colors
$cnt++; $SW = 3 - $SW;
}
} else {
// No one is interested in our "active rallye" ! :-(
- $OUT = LOAD_TEMPLATE("member_bonus_404", true);
+ $OUT = LOAD_TEMPLATE('member_bonus_404', true);
}
// Free memory
define('__BONUS_ROWS', $OUT);
// Load final template
-LOAD_TEMPLATE("member_bonus");
+LOAD_TEMPLATE('member_bonus');
//
?>
if (isFormSent()) {
// Nickname was submitted so let's check if it is not already in use
- if (REQUEST_ISSET_POST(('nickname'))) {
+ if (REQUEST_ISSET_POST('nickname')) {
// Check if nickname is valid
- $PATTERN = "[".getConfig('nickname_pattern')."]{".getConfig('nickname_length').",}";
+ $PATTERN = '[' . getConfig('nickname_pattern') . ']{' . getConfig('nickname_length') . ',}';
if (ereg($PATTERN, REQUEST_POST('nickname'), $array)) {
// Entered nickname is valid?
if ($array[0] == REQUEST_POST('nickname')) $isValid = true;
if ($isValid === true) {
// Look for nickname in database (we only need just one entry so don't worry about the "LIMIT 1" !
- $result = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' AND userid != '%s' LIMIT 1",
- array(REQUEST_POST('nickname'), getUserId()), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `userid` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `nickname`='%s' AND `userid` != '%s' LIMIT 1",
+ array(REQUEST_POST('nickname'), getUserId()), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 0) {
// Nickname not in use, so set it now
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET nickname='%s' WHERE userid=%s LIMIT 1",
- array(REQUEST_POST('nickname'), getUserId()), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `nickname`='%s' WHERE `userid`=%s LIMIT 1",
+ array(REQUEST_POST('nickname'), getUserId()), __FILE__, __LINE__);
$content = getMessage('NICKNAME_SAVED');
} else {
// Free result
LOAD_TEMPLATE('admin_settings_saved', false, $content);
} else {
// Load current nickname
+ // @TODO Rewrite this constant
define('__NICKNAME', NICKNAME_GET_NICK(getUserId()));
// Do we have already submit the form?
- if (REQUEST_ISSET_POST(('nickname'))) {
+ if (REQUEST_ISSET_POST('nickname')) {
LOAD_TEMPLATE('admin_settings_saved', false, "<div class=\"member_failed\">{--NICKNAME_IS_INVALID--}</div");
} // END - if
// Load Template
- LOAD_TEMPLATE("member_nickname_form");
+ LOAD_TEMPLATE('member_nickname_form');
}
//
if (getConfig('order_max_full') == 'MAX') $ALLOWED = $MAXI;
// Now check his points amount
-$total = GET_TOTAL_DATA(getUserId(), "user_points", "points") - GET_TOTAL_DATA(getUserId(), "user_data", "used_points");;
+$total = GET_TOTAL_DATA(getUserId(), 'user_points', 'points') - GET_TOTAL_DATA(getUserId(), 'user_data', 'used_points');;
if (($HOLIDAY == 'Y') && (GET_EXT_VERSION('holiday') >= '0.1.3')) {
// Holiday is active!
// Continue with the frametester, we first need to store the data temporary in the pool
//
// First we would like to store the data and get it's pool position back...
- $result = SQL_QUERY_ESC("SELECT id, data_type
-FROM `{!_MYSQL_PREFIX!}_pool`
-WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1",
- array(getUserId(), REQUEST_POST('url'), getConfig('url_tlock')), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `id`, `data_type`
+FROM
+ `{!_MYSQL_PREFIX!}_pool`
+WHERE
+ `sender`=%s AND `url`='%s' AND `timestamp` > (UNIX_TIMESTAMP() - %s)
+LIMIT 1",
+ array(
+ getUserId(),
+ REQUEST_POST('url'),
+ getConfig('url_tlock')
+ ), __FILE__, __LINE__);
$type = 'TEMP'; $id = 0;
if (SQL_NUMROWS($result) == 1) {
// Shall I test the subject line against URLs?
if (getConfig('test_subj') == 'Y') {
// Check the subject line for issues
- REQUEST_SET_POST('subject', str_replace("\\", "[nl]", substr(REQUEST_POST('subject'), 0, 200)));
+ REQUEST_SET_POST('subject', str_replace("\\", '[nl]', substr(REQUEST_POST('subject'), 0, 200)));
if ((strpos(strtolower(REQUEST_POST('subject')), 'http://') > -1) || (strpos(strtolower(REQUEST_POST('subject')), "www") > -1)) {
// URL in subject found
$URL = 'modules.php?module=login&what=order&msg=' . getCode('SUBJ_URL');
list($blist) = SQL_FETCHROW($result);
// Create redirect-URL
- $URL = 'modules.php?module=login&what=order&msg=' . getCode('BLIST_URL')."&blist=".$blist;
+ $URL = 'modules.php?module=login&what=order&msg=' . getCode('BLIST_URL') . '&blist=' . $blist;
} // END - if
// Free result
REQUEST_SET_POST('text', HTML_CHECK_TAGS(REQUEST_POST('text')));
// Maybe invalid tags found?
- if (!REQUEST_ISSET_POST(('text'))) $URL = 'modules.php?module=login&what=order&msg=' . getCode('INVALID_TAGS')."&id=".$id;
+ if (!REQUEST_ISSET_POST('text')) $URL = 'modules.php?module=login&what=order&msg=' . getCode('INVALID_TAGS')."&id=".$id;
} else {
// Remove any HTML code
REQUEST_SET_POST('text', str_replace('<', '{OPEN_HTML}', str_replace('>', '{CLOSE_HTML}', REQUEST_POST('text'))));
} // END - if
// Check for userids
- $result = SQL_QUERY_ESC("SELECT DISTINCT c.userid FROM `{!_MYSQL_PREFIX!}_user_cats` AS c
-LEFT JOIN `{!_MYSQL_PREFIX!}_user_data` AS d
-ON c.userid=d.userid
-WHERE c.cat_id=%s AND c.userid != '%s' AND d.`status`='CONFIRMED' AND d.receive_mails > 0".$add."
-ORDER BY d.%s %s",
- array(
- bigintval(REQUEST_POST('cat')),
- getUserId(),
- getConfig('order_select'),
- getConfig('order_mode'),
- ), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT
+ c.userid
+FROM
+ `{!_MYSQL_PREFIX!}_user_cats` AS c
+LEFT JOIN
+ `{!_MYSQL_PREFIX!}_user_data` AS d
+ON
+ c.userid=d.userid
+WHERE
+ c.cat_id=%s AND c.userid != '%s' AND d.`status`='CONFIRMED' AND d.receive_mails > 0".$add."
+ORDER BY
+ d.%s %s",
+ array(
+ bigintval(REQUEST_POST('cat')),
+ getUserId(),
+ getConfig('order_select'),
+ getConfig('order_mode'),
+ ), __FILE__, __LINE__);
// Do we enougth receivers left?
if (SQL_NUMROWS($result) >= REQUEST_POST('receiver')) {
while ($content = SQL_FETCHARRAY($result)) {
if ($HOLIDAY) {
// Check for his holiday status
- $result_holiday = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_holidays`
-WHERE userid=%s AND holiday_start < UNIX_TIMESTAMP() AND holiday_end > UNIX_TIMESTAMP() LIMIT 1",
- array(bigintval($content['userid'])), __FILE__, __LINE__);
+ $result_holiday = SQL_QUERY_ESC("SELECT
+ `id`
+FROM
+ `{!_MYSQL_PREFIX!}_user_holidays`
+WHERE
+ `userid`=%s AND `holiday_start` < UNIX_TIMESTAMP() AND `holiday_end` > UNIX_TIMESTAMP()
+LIMIT 1",
+ array(bigintval($content['userid'])), __FILE__, __LINE__);
if (SQL_NUMROWS($result_holiday) == 1) $content['userid'] = 0; // Exclude user who are in holiday
// Free memory
$MAX_SEND = count($TEST);
// Update receiver list
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET receive_mails=receive_mails-1 WHERE userid IN (%s) LIMIT %s",
- array(str_replace(';', ", ", $RECEIVER), $MAX_SEND), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `receive_mails`=`receive_mails`-1 WHERE `userid` IN (%s) LIMIT %s",
+ array(str_replace(';', ", ", $RECEIVER), $MAX_SEND), __FILE__, __LINE__);
// Is calculated max receivers larger than wanted receivers then reset it
if ($MAX_SEND > REQUEST_POST('receiver')) $MAX_SEND = REQUEST_POST('receiver');
$id = 0;
if (EXT_IS_ACTIVE('html_mail')) {
// HTML extension is active
- SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_pool` (sender, subject, text, receivers, payment_id, data_type, timestamp, url, cat_id, target_send, zip, html_msg)
+ SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_pool` (`sender`, `subject`, `text`, `receivers`, `payment_id`, `data_type`, `timestamp`, `url`, `cat_id`, `target_send`, `zip`, `html_msg`)
VALUES ('%s','%s','%s','%s','%s','TEMP','%s','%s','%s','%s','%s','%s')",
- array(
- getUserId(),
- REQUEST_POST('subject'),
- REQUEST_POST('text'),
- $RECEIVER,
- bigintval(REQUEST_POST('type')),
- $TIME,
- REQUEST_POST('url'),
- bigintval(REQUEST_POST('cat')),
- $MAX_SEND,
- bigintval(REQUEST_POST('zip')),
- REQUEST_POST('html')
- ), __FILE__, __LINE__);
+ array(
+ getUserId(),
+ REQUEST_POST('subject'),
+ REQUEST_POST('text'),
+ $RECEIVER,
+ bigintval(REQUEST_POST('type')),
+ $TIME,
+ REQUEST_POST('url'),
+ bigintval(REQUEST_POST('cat')),
+ $MAX_SEND,
+ bigintval(REQUEST_POST('zip')),
+ REQUEST_POST('html')
+ ), __FILE__, __LINE__);
} else {
// No HTML extension is active
- SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_pool` (sender, subject, text, receivers, payment_id, data_type, timestamp, url, cat_id, target_send, zip)
+ SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_pool` (`sender`, `subject`, `text`, `receivers`, `payment_id`, `data_type`, `timestamp`, `url`, `cat_id`, `target_send`, `zip`)
VALUES ('%s','%s','%s','%s','%s','TEMP','%s','%s','%s','%s','%s')",
- array(
- getUserId(),
- REQUEST_POST('subject'),
- REQUEST_POST('text'),
- $RECEIVER,
- bigintval(REQUEST_POST('type')),
- $TIME,
- REQUEST_POST('url'),
- bigintval(REQUEST_POST('cat')),
- $MAX_SEND,
- bigintval(REQUEST_POST('zip')),
- ), __FILE__, __LINE__);
+ array(
+ getUserId(),
+ REQUEST_POST('subject'),
+ REQUEST_POST('text'),
+ $RECEIVER,
+ bigintval(REQUEST_POST('type')),
+ $TIME,
+ REQUEST_POST('url'),
+ bigintval(REQUEST_POST('cat')),
+ $MAX_SEND,
+ bigintval(REQUEST_POST('zip')),
+ ), __FILE__, __LINE__);
}
} else {
// Change current order
if (EXT_IS_ACTIVE('html_mail')) {
// HTML extension is active
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET
-subject='%s',
-text='%s',
-receivers='%s',
-payment_id=%s,
-timestamp=UNIX_TIMESTAMP(),
-url='%s',
-cat_id=%s,
-target_send=%s,
-zip=%s,
-html_msg='%s'
-WHERE `id`=%s LIMIT 1",
- array(
- REQUEST_POST('subject'),
- REQUEST_POST('text'),
- $RECEIVER,
- bigintval(REQUEST_POST('type')),
- REQUEST_POST('url'),
- bigintval(REQUEST_POST('cat')),
- $MAX_SEND,
- bigintval(REQUEST_POST('zip')),
- REQUEST_POST('html'),
- bigintval($id)
- ), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE
+ `{!_MYSQL_PREFIX!}_pool`
+SET
+ `subject`='%s',
+ `text`='%s',
+ `receivers`='%s',
+ `payment_id`=%s,
+ `timestamp`=UNIX_TIMESTAMP(),
+ `url`='%s',
+ `cat_id`=%s,
+ `target_send`=%s,
+ `zip`=%s,
+ `html_msg`='%s'
+WHERE
+ `id`=%s
+LIMIT 1",
+ array(
+ REQUEST_POST('subject'),
+ REQUEST_POST('text'),
+ $RECEIVER,
+ bigintval(REQUEST_POST('type')),
+ REQUEST_POST('url'),
+ bigintval(REQUEST_POST('cat')),
+ $MAX_SEND,
+ bigintval(REQUEST_POST('zip')),
+ REQUEST_POST('html'),
+ bigintval($id)
+ ), __FILE__, __LINE__);
} else {
// No HTML extension is active
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET
-subject='%s',
-text='%s',
-receivers='%s',
-payment_id=%s,
-timestamp=UNIX_TIMESTAMP(),
-url='%s',
-cat_id=%s,
-target_send=%s,
-zip=%s
-WHERE `id`=%s LIMIT 1",
- array(
- REQUEST_POST('subject'),
- REQUEST_POST('text'),
- $RECEIVER,
- bigintval(REQUEST_POST('type')),
- REQUEST_POST('url'),
- bigintval(REQUEST_POST('cat')),
- $MAX_SEND,
- bigintval(REQUEST_POST('zip')),
- bigintval($id)
- ), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE
+ `{!_MYSQL_PREFIX!}_pool`
+SET
+ `subject`='%s',
+ `text`='%s',
+ `receivers`='%s',
+ `payment_id`=%s,
+ `timestamp`=UNIX_TIMESTAMP(),
+ `url`='%s',
+ `cat_id`=%s,
+ `target_send`=%s,
+ `zip`=%s
+WHERE
+ `id`=%s
+LIMIT 1",
+ array(
+ REQUEST_POST('subject'),
+ REQUEST_POST('text'),
+ $RECEIVER,
+ bigintval(REQUEST_POST('type')),
+ REQUEST_POST('url'),
+ bigintval(REQUEST_POST('cat')),
+ $MAX_SEND,
+ bigintval(REQUEST_POST('zip')),
+ bigintval($id)
+ ), __FILE__, __LINE__);
}
}
// Do we need to get the ID number?
if ($id == 0) {
// Order is placed as temporary. We need to get it's id for the frametester
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_pool` WHERE sender=%s AND subject='%s' AND payment_id=%s AND data_type='TEMP' AND timestamp=%s LIMIT 1",
- array(
- getUserId(),
- REQUEST_POST('subject'),
- bigintval(REQUEST_POST('type')),
- $TIME
- ), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_pool` WHERE `sender`=%s AND `subject`='%s' AND `payment_id`=%s AND `data_type`='TEMP' AND `timestamp`=%s LIMIT 1",
+ array(
+ getUserId(),
+ REQUEST_POST('subject'),
+ bigintval(REQUEST_POST('type')),
+ $TIME
+ ), __FILE__, __LINE__);
list($id) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('MEMBER_ORDER_ALLOWED_EXHAUSTED'));
} elseif (($links < getConfig('unconfirmed')) && ($mmails == '1')) {
// Display order form
- $result_cats = SQL_QUERY("SELECT id, cat FROM `{!_MYSQL_PREFIX!}_cats`".$whereStatement." ORDER BY `sort`", __FILE__, __LINE__);
+ $result_cats = SQL_QUERY("SELECT
+ `id`, `cat`
+FROM
+ `{!_MYSQL_PREFIX!}_cats`
+".$whereStatement."
+ORDER BY
+ `sort` ASC", __FILE__, __LINE__);
if (SQL_NUMROWS($result_cats) > 0) {
if ($total > 0) {
// Initialize array...
$CATS['name'][] = $content['cat'];
// Select users in current category
- $result_uids = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE cat_id=%s AND userid != '%s' ORDER BY `userid` ASC",
- array(bigintval($content['id']), getUserId()), __FILE__, __LINE__);
+ $result_uids = SQL_QUERY_ESC("SELECT `userid` FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE `cat_id`=%s AND `userid` != '%s' ORDER BY `userid` ASC",
+ array(bigintval($content['id']), getUserId()), __FILE__, __LINE__);
$uid_cnt = 0;
while (list($ucat) = SQL_FETCHROW($result_uids)) {
$HOL_ACTIVE = false;
if ($HOLIDAY) {
// Check user's holiday status
- $result_holiday = SQL_QUERY_ESC("SELECT DISTINCT d.userid FROM `{!_MYSQL_PREFIX!}_user_data` AS d
-LEFT JOIN `{!_MYSQL_PREFIX!}_user_holidays` AS h
-ON d.userid=h.userid
-WHERE d.userid=%s AND d.receive_mails > 0 AND d.`status`='CONFIRMED' AND d.`holiday_active`='Y'
-AND h.holiday_start < UNIX_TIMESTAMP() AND h.holiday_end > UNIX_TIMESTAMP()
-LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__);
+ $result_holiday = SQL_QUERY_ESC("SELECT
+ d.userid FROM `{!_MYSQL_PREFIX!}_user_data` AS d
+LEFT JOIN
+ `{!_MYSQL_PREFIX!}_user_holidays` AS h
+ON
+ d.userid=h.userid
+WHERE
+ d.userid=%s AND d.receive_mails > 0 AND d.`status`='CONFIRMED' AND d.`holiday_active`='Y' AND
+ h.holiday_start < UNIX_TIMESTAMP() AND h.holiday_end > UNIX_TIMESTAMP()
+LIMIT 1",
+ array(bigintval($ucat)), __FILE__, __LINE__);
if (SQL_NUMROWS($result_holiday) == 1) {
// Holiday is active!
$HOL_ACTIVE = true;
if (!$HOL_ACTIVE) {
// Check if the user want's to receive mails?
- $result_ver = SQL_QUERY_ESC("SELECT zip FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s".$HTML." AND receive_mails > 0 AND `status`='CONFIRMED' LIMIT 1",
- array(bigintval($ucat)), __FILE__, __LINE__);
+ $result_ver = SQL_QUERY_ESC("SELECT `zip` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s".$HTML." AND `receive_mails` > 0 AND `status`='CONFIRMED' LIMIT 1",
+ array(bigintval($ucat)), __FILE__, __LINE__);
if ((SQL_NUMROWS($result_ver) == 1) && (REQUEST_ISSET_POST('zip')) && (getConfig('order_multi_page') == 'Y')) {
list($zip) = SQL_FETCHROW($result_ver);
SQL_FREERESULT($result_cats);
// Now we need to load the mail types...
- $result = SQL_QUERY("SELECT id, price, payment, mail_title FROM `{!_MYSQL_PREFIX!}_payments` ORDER BY payment", __FILE__, __LINE__);
+ $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) {
// Check for message ID in URL
$message = '';
- switch (REQUEST_GET('msg'))
- {
+ switch (REQUEST_GET('msg')) {
case getCode('URL_TLOCK'):
$result = SQL_QUERY_ESC("SELECT timestamp FROM `{!_MYSQL_PREFIX!}_pool` WHERE `id`=%s LIMIT 1",
- array(bigintval(REQUEST_GET('id'))), __FILE__, __LINE__);
+ array(bigintval(REQUEST_GET('id'))), __FILE__, __LINE__);
- // Load timestamp from last order
- list($LORDER) = SQL_FETCHROW($result);
- $LORDER = generateDateTime($LORDER, '1');
+ // Load timestamp from last order
+ list($LORDER) = SQL_FETCHROW($result);
+ $LORDER = generateDateTime($LORDER, '1');
- // Free memory
- SQL_FREERESULT($result);
+ // Free memory
+ SQL_FREERESULT($result);
- // Calculate hours...
- $STD = round(getConfig('url_tlock') / 60 / 60);
+ // Calculate hours...
+ $STD = round(getConfig('url_tlock') / 60 / 60);
- // Minutes...
- $MIN = round((getConfig('url_tlock') - $STD * 60 * 60) / 60);
+ // Minutes...
+ $MIN = round((getConfig('url_tlock') - $STD * 60 * 60) / 60);
- // And seconds
- $SEC = getConfig('url_tlock') - $STD * 60 * 60 - $MIN * 60;
+ // And seconds
+ $SEC = getConfig('url_tlock') - $STD * 60 * 60 - $MIN * 60;
- // Finally contruct the message
- // @TODO Rewrite this old lost code to a template
- $message = "{--MEMBER_URL_TIME_LOCK--}<br />{--CONFIG_URL_TLOCK--} ".$STD."
+ // Finally contruct the message
+ // @TODO Rewrite this old lost code to a template
+ $message = "{--MEMBER_URL_TIME_LOCK--}<br />{--CONFIG_URL_TLOCK--} ".$STD."
{--_HOURS--}, ".$MIN." {--_MINUTES--} {--_AND--} ".$SEC." {--_SECONDS--}<br />
{--MEMBER_LAST_TLOCK--}: ".$LORDER;
- break;
+ break;
case getCode('OVERLENGTH'):
$message = getMessage('MEMBER_TEXT_OVERLENGTH');
DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown error code %s detected.", REQUEST_GET('msg')));
$message = sprintf(getMessage('UNKNOWN_CODE'), REQUEST_GET('msg'));
break;
- }
+ } // END - switch
if (!empty($message)) {
// We got system message so we drop it out to the user
$total = translateComma($total);
// Check how many mail orders he has placed today and how many he's allowed to send
- switch (getConfig('order_max_full'))
- {
+ switch (getConfig('order_max_full')) {
case 'MAX': // He is allowed to send as much as possible
define('ORDER_MAX_VALUE', getMessage('MEMBER_ORDER_ALLOWED_MAX'));
break;
DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown order_mas_full config detected.", getConfig('order_max_full')));
define('ORDER_MAX_VALUE', getMessage('MEMBER_ORDER_ALLOWED_UNKNOWN'));
break;
- }
+ } // END - switch
// Load final template
- LOAD_TEMPLATE("member_order_points", false, $total);
+ LOAD_TEMPLATE('member_order_points', false, $total);
// Reset variables
$OLD_ORDER = false; $subject = ''; $text = ''; $target = '';
// Check if we already have an order placed and make it editable
- $result = SQL_QUERY_ESC("SELECT subject, text, payment_id, timestamp, url, target_send, cat_id, zip FROM `{!_MYSQL_PREFIX!}_pool` WHERE sender=%s AND data_type='TEMP' LIMIT 1",
- array(getUserId()), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT
+ `subject`, `text`, `payment_id`, `timestamp`, `url`, `target_send`, `cat_id`, `zip`
+FROM
+ `{!_MYSQL_PREFIX!}_pool`
+WHERE
+ `sender`=%s AND `data_type`='TEMP'
+LIMIT 1",
+ array(getUserId()), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Old order found
// Free result
SQL_FREERESULT($result);
- if ((REQUEST_ISSET_POST(('data'))) || ((getConfig('order_multi_page') != 'Y') && ((!IS_ADMIN()) && (!EXT_IS_ACTIVE('html_mail'))))) {
+ if ((REQUEST_ISSET_POST('data')) || ((getConfig('order_multi_page') != 'Y') && ((!IS_ADMIN()) && (!EXT_IS_ACTIVE('html_mail'))))) {
// Pre-output categories
$CAT = '';
foreach ($CATS['id'] as $key => $value) {
if (REQUEST_ISSET_POST('zip')) {
// Output entered ZIP code
- define('ZIP_OUTPUT', LOAD_TEMPLATE("member_order-zip2", true, REQUEST_POST('zip')));
+ define('ZIP_OUTPUT', LOAD_TEMPLATE('member_order-zip', true, REQUEST_POST('zip')));
} else {
define('ZIP_OUTPUT', "<tr><td colspan=\"5\" height=\"5\" class=\"seperator\"> </td></tr>");
}
// HTML extension
if ((EXT_IS_ACTIVE('html_mail')) && (REQUEST_POST('html') == 'Y')) {
// Extension is active so output valid HTML tags
- define('MEMBER_HTML_EXTENSION', LOAD_TEMPLATE("member_order-html_ext", true, HTML_ADD_VALID_TAGS()));
+ define('MEMBER_HTML_EXTENSION', LOAD_TEMPLATE('member_order-html_ext', true, HTML_ADD_VALID_TAGS()));
} else {
// Extension not active and/or class not uploaded
define('MEMBER_HTML_EXTENSION', "<tr><td colspan=\"5\"><input type=\"hidden\" name=\"html\" value=\"N\"> /</td></tr>");
}
// Output form for page 2
- LOAD_TEMPLATE("member_order_page2");
+ LOAD_TEMPLATE('member_order_page2');
} else {
// Remember maybe entered ZIP code in constant
$add = '';
if (EXT_IS_ACTIVE('html_mail')) {
// Add some content when html extension is active
if ((getConfig('order_multi_page') == 'Y') || (IS_ADMIN())) $add = "<tr><td colspan=\"2\" class=\"seperator bottom2\" height=\"5\"> </td></tr>\n";
- define('MEMBER_HTML_EXTENSION', LOAD_TEMPLATE("member_order-html_intro", true));
+ define('MEMBER_HTML_EXTENSION', LOAD_TEMPLATE('member_order-html_intro', true));
} else {
// No HTML extension installed
define('MEMBER_HTML_EXTENSION', "<tr><td colspan=\"2\"><input type=\"hidden\" name=\"html\" value=\"N\" /></td></tr>");
'add' => $add
);
}
- define('MEMBER_ZIP_CONTENT', LOAD_TEMPLATE("member_order-zip1", true, $content));
+ define('MEMBER_ZIP_CONTENT', LOAD_TEMPLATE('member_order-zip1', true, $content));
} else {
// No
define('MEMBER_ZIP_CONTENT', '');
}
// Output form for page 1 (ZIP code or HTML)
- LOAD_TEMPLATE("member_order_page1");
+ LOAD_TEMPLATE('member_order_page1');
}
} else {
// No mail types defined
// Something important is missing...
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('PRIMERA_MEMBER_API_DATA_MISSING'));
return;
-}
+} // END - if
// Init the content array and points
-$content = array(); $points = false;
+$content = array();
+$points = false;
// Is the mode set (payout only)
if (!REQUEST_ISSET_GET('mode')) {
$content['refid'] = getConfig(('primera_refid'));
// Get Primus id
- $result = SQL_QUERY_ESC("SELECT primera_userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(getUserId()), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `primera_userid` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
+ array(getUserId()), __FILE__, __LINE__);
// Are there some entries?
if (SQL_NUMROWS($result) == 1) {
// Is there an ID?
if ((!empty($content['primera_nickname'])) && (!REQUEST_ISSET_GET('mode'))) {
// Then use an other "mode"
- REQUEST_SET_GET('mode', "list");
+ REQUEST_SET_GET('mode', 'list');
// And load all rows!
$result = SQL_QUERY_ESC("SELECT `id`,`primera_account`,`primera_amount`,`primera_timestamp`,`primera_type` FROM `{!_MYSQL_PREFIX!}_user_primera` WHERE `userid` = %s ORDER BY `primera_timestamp` DESC",
- array(getUserId()), __FILE__, __LINE__);
+ array(getUserId()), __FILE__, __LINE__);
// Load all rows
$content['rows'] = ''; $SW = 2;
SQL_FREERESULT($result);
} else {
// Mode pay
- REQUEST_SET_GET('mode', "pay");
+ REQUEST_SET_GET('mode', 'pay');
}
} // END - if
-if (REQUEST_GET('mode') == "pay") {
+
+if (REQUEST_GET('mode') == 'pay') {
// Get total points and check if the user can request a payout
- $points = GET_TOTAL_DATA(getUserId(), "user_points", "points") - GET_TOTAL_DATA(getUserId(), "user_data", "used_points");
+ $points = GET_TOTAL_DATA(getUserId(), 'user_points', 'points') - GET_TOTAL_DATA(getUserId(), 'user_data', 'used_points');
// No dots here...
$points = explode('.', $points);
}
// Add points to content array
- $content['points'] = $points;
- $content['min_points'] = translateComma(getConfig('primera_min_payout'));
+ $content['points'] = $points;
+ $content['min_points'] = translateComma(getConfig('primera_min_payout'));
// Get Primera id
$content['primera_nickname'] = '';
- $result = SQL_QUERY_ESC("SELECT primera_userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(getUserId()), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `primera_userid` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
+ array(getUserId()), __FILE__, __LINE__);
// Are there some entries?
if (SQL_NUMROWS($result) == 1) {
if ((isFormSent()) && (REQUEST_ISSET_GET('mode'))) {
// Check input data depending on the mode and execute the requested mode
switch (REQUEST_GET('mode')) {
- case "pay": // Payout this exchange -> Primus
+ case 'pay': // Payout this exchange -> Primus
// Is the user ID and password set?
if (!REQUEST_ISSET_POST(('primera_nickname'))) {
// Nothing entered in Primus nickname
// Default is locked!
$locked = true;
- // Shall I "pay" the referal points imidiately?
+ // Shall I 'pay' the referal points imidiately?
if (getConfig('ref_payout') == '0') {
- // Yes, "pay" it now
+ // Yes, 'pay' it now
$locked = false;
} // END - if
// Remove points from account
- SUB_POINTS("primera_payout", getUserId(), REQUEST_POST('amount'));
+ SUB_POINTS('primera_payout', getUserId(), REQUEST_POST('amount'));
// Update primera nickname
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `primera_userid`=%s WHERE userid=%s LIMIT 1",
- array(REQUEST_POST('primera_nickname'), getUserId()), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `primera_userid`=%s WHERE `userid`=%s LIMIT 1",
+ array(REQUEST_POST('primera_nickname'), getUserId()), __FILE__, __LINE__);
// All done!
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('PRIMERA_MEMBER_PAYOUT_DONE'));
return;
- } elseif ((GET_PRIMERA_ERROR_CODE() == "user_failed") || (GET_PRIMERA_ERROR_CODE() == "own_failed") || (GET_PRIMERA_ERROR_CODE() == "amount_failed") || (GET_PRIMERA_ERROR_CODE() == "api_amount_failed")) {
+ } elseif ((GET_PRIMERA_ERROR_CODE() == 'user_failed') || (GET_PRIMERA_ERROR_CODE() == 'own_failed') || (GET_PRIMERA_ERROR_CODE() == 'amount_failed') || (GET_PRIMERA_ERROR_CODE() == 'api_amount_failed')) {
// Wrong login data
LOAD_TEMPLATE('admin_settings_saved', false, GET_PRIMERA_ERROR_MESSAGE());
} else {
// Was the form submitted?
if ((REQUEST_ISSET_POST('edit')) && (REQUEST_ISSET_POST('id'))) {
// Okay, has the user entered some values?
- if (REQUEST_ISSET_POST(('percents'))) {
+ if (REQUEST_ISSET_POST('percents')) {
// Revert german commta for testing
$percents = convertCommaToDot(REQUEST_POST('percents'));
// Add description as navigation point
ADD_DESCR('member', __FILE__);
-if (REQUEST_ISSET_POST(('member_theme'))) {
+if (REQUEST_ISSET_POST('member_theme')) {
// Save theme to member's profile
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET curr_theme='%s' WHERE userid=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `curr_theme`='%s' WHERE `userid`=%s LIMIT 1",
array(REQUEST_POST('member_theme'), getUserId()), __FILE__, __LINE__);
// Set new theme for guests
if (REQUEST_ISSET_GET('mode')) $mode = REQUEST_GET('mode');
// Check for "faker"
-if (($opt_in == 'N') && ($mode == "new")) $mode = '';
+if (($opt_in == 'N') && ($mode == 'new')) $mode = '';
-switch ($mode)
-{
- case "new": // Start new transfer
+switch ($mode) {
+ case 'new': // Start new transfer
// Get total points and subtract the balance amount from it = maximum transferable points
- $total = GET_TOTAL_DATA(getUserId(), "user_points", "points") - GET_TOTAL_DATA(getUserId(), "user_data", "used_points");
+ $total = GET_TOTAL_DATA(getUserId(), 'user_points', 'points') - GET_TOTAL_DATA(getUserId(), 'user_data', 'used_points');
// Remember maximum value for template
define('__TRANSFER_MAX_VALUE', round($total - getConfig('transfer_balance') - 0.5));
$valid_pass = ($pass == generateHash(REQUEST_POST('password'), $pass));
// Test transfer amount
- $valid_amount = ((REQUEST_ISSET_POST(('points'))) && (REQUEST_POST('points') <= constant('__TRANSFER_MAX_VALUE')));
+ $valid_amount = ((REQUEST_ISSET_POST('points')) && (REQUEST_POST('points') <= constant('__TRANSFER_MAX_VALUE')));
// Test reason for transfer
- $valid_reason = (REQUEST_ISSET_POST(('reason')));
+ $valid_reason = (REQUEST_ISSET_POST('reason'));
// Test if a recipient is selected
$valid_recipient = (REQUEST_POST('to_uid') > 0);
// Check for nickname extension and set additional data
- $nick = false; $add = ", userid";
+ $nick = false; $add = ', `userid`';
if (EXT_IS_ACTIVE('nickname')) {
- $add = ", nickname";
+ $add = ', `nickname`';
$nick = true;
}
// Re-check receivers and own personal data
- $result = SQL_QUERY_ESC("SELECT userid, gender, surname, family, email".$add." FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid IN ('%s','%s') AND `status`='CONFIRMED' ORDER BY userid LIMIT 2",
- array(getUserId(), bigintval(REQUEST_POST('to_uid'))), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `userid`, `gender`, `surname`, `family`, `email`".$add." FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid` IN ('%s','%s') AND `status`='CONFIRMED' ORDER BY `userid` ASC LIMIT 2",
+ array(getUserId(), bigintval(REQUEST_POST('to_uid'))), __FILE__, __LINE__);
$valid_data = (SQL_NUMROWS($result) == 2);
if ($valid_code && $valid_pass && $valid_amount && $valid_reason && $valid_recipient) {
define('__TRANS_ID', bigintval(generateRandomCode("10", mt_rand(0, 99999), getUserId(), REQUEST_POST('reason'))));
// Add entries to both tables
- SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_transfers_in` (userid, from_uid, points, reason, time_trans, trans_id) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP(),'%s')",
- array(bigintval(REQUEST_POST('to_uid')), getUserId(), bigintval(REQUEST_POST('points')), REQUEST_POST('reason'), __TRANS_ID),
+ SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_transfers_in` (`userid`, `from_uid`, `points`, `reason`, `time_trans`, `trans_id`) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP(),'%s')",
+ array(bigintval(REQUEST_POST('to_uid')), getUserId(), bigintval(REQUEST_POST('points')), REQUEST_POST('reason'), __TRANS_ID),
__FILE__, __LINE__);
- SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_transfers_out` (userid, to_uid, points, reason, time_trans, trans_id) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP(),'%s')",
- array(getUserId(), bigintval(REQUEST_POST('to_uid')), bigintval(REQUEST_POST('points')), REQUEST_POST('reason'), __TRANS_ID),
+ SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_transfers_out` (`userid`, `to_uid`, `points`, `reason`, `time_trans`, `trans_id`) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP(),'%s')",
+ array(getUserId(), bigintval(REQUEST_POST('to_uid')), bigintval(REQUEST_POST('points')), REQUEST_POST('reason'), __TRANS_ID),
__FILE__, __LINE__);
// Add points to account *directly* ...
// Load member list
if (EXT_IS_ACTIVE('nickname')) {
// Load userid and nickname
- $result = SQL_QUERY_ESC("SELECT userid, nickname FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED' AND opt_in='Y' AND userid != '%s' ORDER BY `userid` ASC",
+ $result = SQL_QUERY_ESC("SELECT `userid`, `nickname` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED' AND `opt_in`='Y' AND `userid` != '%s' ORDER BY `userid` ASC",
array(getUserId()), __FILE__, __LINE__);
} else {
// Load only userid
- $result = SQL_QUERY_ESC("SELECT userid, userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED' AND opt_in='Y' AND userid != '%s' ORDER BY `userid` ASC",
+ $result = SQL_QUERY_ESC("SELECT `userid`, `userid` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED' AND `opt_in`='Y' AND `userid` != '%s' ORDER BY `userid` ASC",
array(getUserId()), __FILE__, __LINE__);
}
switch ($mode)
{
case 'list_in':
- $sql = "SELECT trans_id, from_uid, points, reason, time_trans FROM `{!_MYSQL_PREFIX!}_user_transfers_in` WHERE userid=%s ORDER BY time_trans DESC LIMIT ".getConfig('transfer_max');
+ $sql = "SELECT `trans_id`, `from_uid`, `points`, `reason`, `time_trans` FROM `{!_MYSQL_PREFIX!}_user_transfers_in` WHERE `userid`=%s ORDER BY `time_trans` DESC LIMIT ".getConfig('transfer_max');
// @TODO Rewrite these constants
$NOTHING = getMessage('TRANSFER_NO_INCOMING_TRANSFERS');
define('__TRANSFER_SUM', getMessage('TRANSFER_TOTAL_INCOMING'));
break;
case 'list_out':
- $sql = "SELECT trans_id, to_uid, points, reason, time_trans FROM `{!_MYSQL_PREFIX!}_user_transfers_out` WHERE userid=%s ORDER BY time_trans DESC LIMIT ".getConfig('transfer_max');
+ $sql = "SELECT `trans_id`, `to_uid`, `points`, `reason`, `time_trans` FROM `{!_MYSQL_PREFIX!}_user_transfers_out` WHERE `userid`=%s ORDER BY `time_trans` DESC LIMIT ".getConfig('transfer_max');
// @TODO Rewrite these constants
$NOTHING = getMessage('TRANSFER_NO_OUTGOING_TRANSFERS');
define('__TRANSFER_SUM', getMessage('TRANSFER_TOTAL_OUTGOING'));
LOAD_TEMPLATE('member_transfer_list');
break;
- case 'list_all': // List all transactions
- // We fill a temporary table with data from both tables. This is much easier
- // to code and unstand by you as sub-SELECT queries. I know this is not the
- // fastest way but it shall be fine for now.
- //
- // First of all create the temporary table
- $result = SQL_QUERY("CREATE TEMPORARY TABLE `{!_MYSQL_PREFIX!}_transfers_tmp` (
+ case 'list_all': // List all transactions
+ // We fill a temporary table with data from both tables. This is much easier
+ // to code and unstand by you as sub-SELECT queries. I know this is not the
+ // fastest way but it shall be fine for now.
+ //
+ // First of all create the temporary table
+ $result = SQL_QUERY("CREATE TEMPORARY TABLE `{!_MYSQL_PREFIX!}_transfers_tmp` (
trans_id VARCHAR(12) NOT NULL DEFAULT '',
party_uid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
points BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
KEY(party_uid)
) TYPE=HEAP", __FILE__, __LINE__);
- // Let's begin with the incoming list
- $result = SQL_QUERY_ESC("SELECT trans_id, from_uid, points, reason, time_trans FROM `{!_MYSQL_PREFIX!}_user_transfers_in` WHERE userid=%s ORDER BY `id` LIMIT %s",
- array(getUserId(), getConfig('transfer_max')), __FILE__, __LINE__);
- while ($DATA = SQL_FETCHROW($result)) {
- $DATA[] = 'IN';
- $DATA = implode("','", $DATA);
- $res_temp = SQL_QUERY("INSERT INTO `{!_MYSQL_PREFIX!}_transfers_tmp` (trans_id, party_uid, points, reason, time_trans, trans_type) VALUES ('".$DATA."')", __FILE__, __LINE__);
- }
+ // Let's begin with the incoming list
+ $result = SQL_QUERY_ESC("SELECT `trans_id`, `from_uid`, `points`, `reason`, `time_trans` FROM `{!_MYSQL_PREFIX!}_user_transfers_in` WHERE `userid`=%s ORDER BY `id` ASC LIMIT %s",
+ array(getUserId(), getConfig('transfer_max')), __FILE__, __LINE__);
+ while ($DATA = SQL_FETCHROW($result)) {
+ $DATA[] = 'IN';
+ $DATA = implode("','", $DATA);
+ $res_temp = SQL_QUERY("INSERT INTO `{!_MYSQL_PREFIX!}_transfers_tmp` (`trans_id`, `party_uid`, `points`, `reason`, `time_trans`, `trans_type`) VALUES ('".$DATA."')", __FILE__, __LINE__);
+ }
- // Free memory
- SQL_FREERESULT($result);
+ // Free memory
+ SQL_FREERESULT($result);
- // As the last table transfer data from outgoing table to temporary
- $result = SQL_QUERY_ESC("SELECT trans_id, to_uid, points, reason, time_trans FROM `{!_MYSQL_PREFIX!}_user_transfers_out` WHERE userid=%s ORDER BY `id` LIMIT %s",
- array(getUserId(), getConfig('transfer_max')), __FILE__, __LINE__);
- while ($DATA = SQL_FETCHROW($result)) {
- $DATA[] = 'OUT';
- $DATA = implode("','", $DATA);
- $res_temp = SQL_QUERY("INSERT INTO `{!_MYSQL_PREFIX!}_transfers_tmp` (trans_id, party_uid, points, reason, time_trans, trans_type) VALUES ('".$DATA."')", __FILE__, __LINE__);
- }
+ // As the last table transfer data from outgoing table to temporary
+ $result = SQL_QUERY_ESC("SELECT `trans_id`, `to_uid`, `points`, `reason`, `time_trans` FROM `{!_MYSQL_PREFIX!}_user_transfers_out` WHERE `userid`=%s ORDER BY `id` LIMIT %s",
+ array(getUserId(), getConfig('transfer_max')), __FILE__, __LINE__);
+ while ($DATA = SQL_FETCHROW($result)) {
+ $DATA[] = 'OUT';
+ $DATA = implode("','", $DATA);
+ $res_temp = SQL_QUERY("INSERT INTO `{!_MYSQL_PREFIX!}_transfers_tmp` (`trans_id`, `party_uid`, `points`, `reason`, `time_trans`, `trans_type`) VALUES ('".$DATA."')", __FILE__, __LINE__);
+ } // END - while
- // Free memory
- SQL_FREERESULT($result);
+ // Free memory
+ SQL_FREERESULT($result);
- $total = 0;
- if (SQL_NUMROWS($result) > 0) {
- // Search for entries
- $result = SQL_QUERY("SELECT party_uid, trans_id, points, reason, time_trans, trans_type FROM `{!_MYSQL_PREFIX!}_transfers_tmp` ORDER BY time_trans DESC",
- __FILE__, __LINE__);
-
- // Output rows
- $OUT = ''; $SW = 2;
- while ($content = SQL_FETCHARRAY($result)) {
- // Rewrite points
- if ($content['trans_type'] == 'OUT') $content['points'] = '-'.$content['points']."";
-
- // Prepare content for template
- $content['sw'] = $SW;
- $content['time'] = generateDateTime($content['time_trans'], '3');
- $content['points'] = translateComma($content['points']);
-
- // Load row template
- $OUT .= LOAD_TEMPLATE("member_transfer_row", true, $content);
-
- // Add points and switch color
- $total += $content['points'];
- $SW = 3 - $SW;
- } // END - while
-
- // Free memory
- SQL_FREERESULT($result);
- } else {
- // Nothing for in and out
- $OUT = "<tr>
+ $total = 0;
+ if (SQL_NUMROWS($result) > 0) {
+ // Search for entries
+ $result = SQL_QUERY("SELECT `party_uid`, `trans_id`, `points`, `reason`, `time_trans`, `trans_type` FROM `{!_MYSQL_PREFIX!}_transfers_tmp` ORDER BY `time_trans` DESC",
+ __FILE__, __LINE__);
+
+ // Output rows
+ $OUT = ''; $SW = 2;
+ while ($content = SQL_FETCHARRAY($result)) {
+ // Rewrite points
+ if ($content['trans_type'] == 'OUT') $content['points'] = '-'.$content['points']."";
+
+ // Prepare content for template
+ $content['sw'] = $SW;
+ $content['time'] = generateDateTime($content['time_trans'], '3');
+ $content['points'] = translateComma($content['points']);
+
+ // Load row template
+ $OUT .= LOAD_TEMPLATE('member_transfer_row', true, $content);
+
+ // Add points and switch color
+ $total += $content['points'];
+ $SW = 3 - $SW;
+ } // END - while
+
+ // Free memory
+ SQL_FREERESULT($result);
+ } else {
+ // Nothing for in and out
+ $OUT = "<tr>
<td colspan=\"5\" align=\"center\" class=\"bottom2\" height=\"70\">
".LOAD_TEMPLATE('admin_settings_saved', true, getMessage('TRANSFER_NO_INOUT_TRANSFERS'))."
</td>
</tr>";
- }
+ }
+
+ // ... and add them to a constant for the template
+ // @TODO Rewrite all these constants
+ define('__TRANSFER_ROWS', $OUT);
- // ... and add them to a constant for the template
- // @TODO Rewrite all these constants
- define('__TRANSFER_ROWS', $OUT);
+ // Remeber total amount
+ define('__TRANSFER_TOTAL_VALUE', $total);
- // Remeber total amount
- define('__TRANSFER_TOTAL_VALUE', $total);
+ // Set title
+ define('__TRANSFER_TITLE', getMessage('TRANSFER_LIST_ALL'));
- // Set title
- define('__TRANSFER_TITLE', getMessage('TRANSFER_LIST_ALL'));
+ // Set "balance" word
+ define('__TRANSFER_SUM', getMessage('TRANSFER_TOTAL_BALANCE'));
- // Set "balance" word
- define('__TRANSFER_SUM', getMessage('TRANSFER_TOTAL_BALANCE'));
+ // Load final template
+ LOAD_TEMPLATE('member_transfer_list');
- // Load final template
- LOAD_TEMPLATE('member_transfer_list');
+ // At the end we don't need a temporary table in memory
+ $result = SQL_QUERY("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_transfers_tmp`", __FILE__, __LINE__);
- // At the end we don't need a temporary table in memory
- $result = SQL_QUERY("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_transfers_tmp`", __FILE__, __LINE__);
+ // Free some memory...
+ SQL_FREERESULT($result);
+ break;
- // Free some memory...
- SQL_FREERESULT($result);
- break;
+ case '': // Overview page
+ // Check incoming transfers
+ $total = GET_TOTAL_DATA(getUserId(), 'user_transfers_in', 'id', 'userid', true);
+ if ($total > 0) {
+ define('__TRANSFER_IN_LINK', "<a href=\"{!URL!}/modules.php?module=login&what=transfer&mode=list_in\">".$dmy."</a>");
+ } else {
+ define('__TRANSFER_IN_LINK', $dmy);
+ }
- case '': // Overview page
- // Check incoming transfers
- $result = SQL_QUERY_ESC("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_user_transfers_in` WHERE userid=%s", array(getUserId()), __FILE__, __LINE__);
- list($dmy) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
+ // Check outgoing transfers
+ $dmy = GET_TOTAL_DATA(getUserId(), 'user_transfers_out', 'id', 'userid', true);
- $total=$dmy;
- if ($dmy > 0) {
- define('__TRANSFER_IN_LINK', "<a href=\"{!URL!}/modules.php?module=login&what=transfer&mode=list_in\">".$dmy."</a>");
- } else {
- define('__TRANSFER_IN_LINK', $dmy);
- }
+ // Add to total amount
+ $total += $dmy;
- // Check outgoing transfers
- $result = SQL_QUERY_ESC("SELECT COUNT(id) FROM `{!_MYSQL_PREFIX!}_user_transfers_out` WHERE userid=%s", array(getUserId()), __FILE__, __LINE__);
- list($dmy) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
+ if ($dmy > 0) {
+ define('__TRANSFER_OUT_LINK', "<a href=\"{!URL!}/modules.php?module=login&what=transfer&mode=list_out\">".$dmy."</a>");
+ } else {
+ define('__TRANSFER_OUT_LINK', $dmy);
+ }
- $total+=$dmy;
- if ($dmy > 0) {
- define('__TRANSFER_OUT_LINK', "<a href=\"{!URL!}/modules.php?module=login&what=transfer&mode=list_out\">".$dmy."</a>");
- } else {
- define('__TRANSFER_OUT_LINK', $dmy);
- }
+ // Total transactions
+ if ($total > 0) {
+ define('__TRANSFER_ALL_LINK', "<a href=\"{!URL!}/modules.php?module=login&what=transfer&mode=list_all\">".$total."</a>");
+ } else {
+ define('__TRANSFER_ALL_LINK', $total);
+ }
- // Total transactions
- if ($total > 0) {
- define('__TRANSFER_ALL_LINK', "<a href=\"{!URL!}/modules.php?module=login&what=transfer&mode=list_all\">".$total."</a>");
- } else {
- define('__TRANSFER_ALL_LINK', $total);
- }
+ if (isFormSent()) {
+ // Save settings
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `opt_in`='%s' WHERE `userid`=%s LIMIT 1",
+ array(REQUEST_POST('opt_in'), getUserId()), __FILE__, __LINE__);
+
+ // Rember for next switch() command
+ $opt_in = REQUEST_POST('opt_in');
+
+ // "Settings saved..."
+ LOAD_TEMPLATE('admin_settings_saved', false, "<div class=\"member_done\">{--SETTINGS_SAVED--}</div>");
+ } // END - if
+
+ switch ($opt_in) {
+ case 'Y':
+ define('__TRANSFER_ALLOW_Y', ' checked="checked"');
+ define('__TRANSFER_ALLOW_N', '');
+ define('__TRANSFER_NEW_LINK', "<a href=\"{!URL!}/modules.php?module=login&what=transfer&mode=new\">{--TRANSFER_NOW_LINK--}</a>");
+ break;
- if (isFormSent()) {
- // Save settings
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET opt_in='%s' WHERE userid=%s LIMIT 1",
- array(REQUEST_POST('opt_in'), getUserId()), __FILE__, __LINE__);
-
- // Rember for next switch() command
- $opt_in = REQUEST_POST('opt_in');
-
- // "Settings saved..."
- LOAD_TEMPLATE('admin_settings_saved', false, "<div class=\"member_done\">{--SETTINGS_SAVED--}</div>");
- } // END - if
-
- switch ($opt_in) {
- case 'Y':
- define('__TRANSFER_ALLOW_Y', ' checked="checked"');
- define('__TRANSFER_ALLOW_N', '');
- define('__TRANSFER_NEW_LINK', "<a href=\"{!URL!}/modules.php?module=login&what=transfer&mode=new\">{--TRANSFER_NOW_LINK--}</a>");
- break;
-
- case 'N':
- define('__TRANSFER_ALLOW_Y', '');
- define('__TRANSFER_ALLOW_N', ' checked="checked"');
- define('__TRANSFER_NEW_LINK', getMessage('TRANSFER_PLEASE_ALLOW_OPT_IN'));
- break;
- } // END - switch
-
- // Check for latest out-transfers
- $result = SQL_QUERY_ESC("SELECT time_trans
-FROM `{!_MYSQL_PREFIX!}_user_transfers_out`
-WHERE time_trans > (UNIX_TIMESTAMP() - %s) AND `userid`=%s
-ORDER BY time_trans DESC
+ case 'N':
+ define('__TRANSFER_ALLOW_Y', '');
+ define('__TRANSFER_ALLOW_N', ' checked="checked"');
+ define('__TRANSFER_NEW_LINK', getMessage('TRANSFER_PLEASE_ALLOW_OPT_IN'));
+ break;
+ } // END - switch
+
+ // Check for latest out-transfers
+ $result = SQL_QUERY_ESC("SELECT
+ `time_trans`
+FROM
+ `{!_MYSQL_PREFIX!}_user_transfers_out`
+WHERE
+ `time_trans` > (UNIX_TIMESTAMP() - %s) AND `userid`=%s
+ORDER BY
+ `time_trans` DESC
LIMIT 1",
- array(getConfig('transfer_timeout'), getUserId()), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == 0) {
- // Load template
- define('__TRANSFER_SETTINGS_CONTENT', LOAD_TEMPLATE("member_transfer_settings", true));
- } else {
- // Load newest transaction
- list($newest) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
- define('__TRANSFER_SETTINGS_CONTENT', sprintf(getMessage('TRANSFER_LATEST_IS'), generateDateTime($newest, '3')));
- }
+ array(getConfig('transfer_timeout'), getUserId()), __FILE__, __LINE__);
+ if (SQL_NUMROWS($result) == 0) {
+ // Load template
+ define('__TRANSFER_SETTINGS_CONTENT', LOAD_TEMPLATE('member_transfer_settings', true));
+ } else {
+ // Load newest transaction
+ list($newest) = SQL_FETCHROW($result);
+ define('__TRANSFER_SETTINGS_CONTENT', sprintf(getMessage('TRANSFER_LATEST_IS'), generateDateTime($newest, '3')));
+ }
- // Load template
- LOAD_TEMPLATE("member_transfer_overview");
- break;
-}
+ // Free result
+ SQL_FREERESULT($result);
+
+ // Load template
+ LOAD_TEMPLATE('member_transfer_overview');
+ break;
+} // END - switch
//
?>
} elseif (!IS_MEMBER()) {
// Sorry, no guest access!
$URL = 'modules.php?module=index';
-} elseif (!REQUEST_ISSET_GET(('order'))) {
+} elseif (!REQUEST_ISSET_GET('order')) {
// You cannot call this module directly!
$URL = 'modules.php?module=login&what=order';
}
}
// Update sending pool
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET data_type='%s' WHERE `id`=%s AND sender=%s AND data_type='TEMP' LIMIT 1",
- array($type, bigintval(REQUEST_GET('order')), getUserId()), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET `data_type`='%s' WHERE `id`=%s AND `sender`=%s AND `data_type`='TEMP' LIMIT 1",
+ array($type, bigintval(REQUEST_GET('order')), getUserId()), __FILE__, __LINE__);
// Finally is the entry valid?
if (SQL_AFFECTEDROWS() == 1) {
- // Load personal data...
- $result = SQL_QUERY_ESC("SELECT gender, surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(getUserId()), __FILE__, __LINE__);
- list($gender, $sname, $fname, $email) = SQL_FETCHROW($result);
+ // @TODO Unused: 2,4
+ // Load mail again... 0 1 2 3 4 5 6 7
+ $result = SQL_QUERY_ESC("SELECT `subject`, `text`, `receivers`, `payment_id`, `timestamp`, `url`, cat_id`, `target_send` FROM `{!_MYSQL_PREFIX!}_pool` WHERE `id`=%s AND `sender`=%s LIMIT 1",
+ array(bigintval(REQUEST_GET('order')), getUserId()), __FILE__, __LINE__);
+ $content = SQL_FETCHARRAY($result);
SQL_FREERESULT($result);
-
- // Load mail again... 0 1 2 3 4 5 6 7
- $result = SQL_QUERY_ESC("SELECT subject, text, receivers, payment_id, timestamp, url, cat_id, target_send FROM `{!_MYSQL_PREFIX!}_pool` WHERE `id`=%s AND sender=%s LIMIT 1",
- array(bigintval(REQUEST_GET('order')), getUserId()), __FILE__, __LINE__);
- $DATA = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
- if (empty($DATA[0])) $DATA[0] = getMessage('DEFAULT_SUBJECT_LINE');
+ if (empty($content['subject'])) $content['subject'] = getMessage('DEFAULT_SUBJECT_LINE');
// Calculate used points
- $USED = $DATA[7] * getPaymentPoints($DATA[3]);
+ $USED = $content['target_send'] * getPaymentPoints($content['payment_id']);
// Update used points
$add = '';
if (getConfig('order_max_full') == 'ORDER') $add = ', mail_orders=mail_orders+1';
SUB_POINTS('order', getUserId(), $USED);
- // Prepare content
- $content = array(
- 'blocks' => getConfig('max_send'),
- 'subject' => $DATA[0],
- 'text' => $DATA[1],
- 'payment' => getPaymentTitlePrice($DATA[3]),
- 'category' => getCategory($DATA[6]),
- 'url' => $DATA[5]
- );
+ // Compile content
+ $content['block'] = getConfig('max_send');
+ $content['payment'] = getPaymentTitlePrice($content['payment_id']);
+ $content['category'] = getCategory($content['cat_id']);
// Send an email to the user
$msg_mem = LOAD_EMAIL_TEMPLATE('order-member', $content, getUserId());
- sendEmail($email, getMessage('MEMBER_NEW_QUEUE'), $msg_mem);
+ sendEmail(getUserId(), getMessage('MEMBER_NEW_QUEUE'), $msg_mem);
// Notify admins about this
sendAdminNotification(getMessage('ADMIN_NEW_QUEUE'), 'order-admin', $content, getUserId());
redirectToUrl($URL);
}
-//
+// [EOF]
?>
// Check if form was submitted or not
if (isFormSent()) {
// Check passwords
- if (!REQUEST_ISSET_POST(('pass_old'))) {
+ if (!REQUEST_ISSET_POST('pass_old')) {
// No current password entered
$message = getMessage('SPONSOR_NO_CURRENT_PASSWORD_ENTERED');
} elseif (md5(REQUEST_POST('pass_old')) != getSession('sponsorpass')) {
// Check if form was submitted or not
if (isFormSent()) {
// Check passwords
- if (!REQUEST_ISSET_POST(('password'))) {
+ if (!REQUEST_ISSET_POST('password')) {
// No current password entered
$message = SPONSOR_NO_CURRENT_PASSWORD_ENTERED;
} elseif (md5(REQUEST_POST('password')) != getSession('sponsorpass')) {
if (($curr != getConfig('last_month')) && (getConfig('last_month') > 0) && (getConfig('beg_ranks') > 0) && (getOutputMode() != 1)) {
// Extension 'autopurge' is inactive or purging of inactive accounts is deactivated
$whereStatement1 = '';
- $whereStatement2 = getConfig(('beg_ranks'));
// Shall we exclude webmaster's own userid?
if ((getConfig('beg_include_own') != 'Y') && (getConfig('beg_uid') > 0)) {
// Exclude it
- $whereStatement1 = sprintf(" AND userid != %s", getConfig(('beg_uid')));
+ $whereStatement1 = sprintf(" AND `userid` != %s", getConfig('beg_uid'));
} // END - if
- // Let's check if there are some points left we can "pay"...
+ // Let's check if there are some points left we can 'pay'...
if (EXT_IS_ACTIVE('autopurge')) {
// Use last online stamp only when autopurge for inactive members is activated
if ((getConfig('ap_inactive_since') > 0) && (getConfig('beg_active') == 'Y')) {
// Okay, include last online timestamp
- $whereStatement1 .= sprintf(" AND `last_online` >= (UNIX_TIMESTAMP() - %s)", getConfig(('ap_inactive_since')));;
+ $whereStatement1 .= sprintf(" AND `last_online` >= (UNIX_TIMESTAMP() - %s)", getConfig('ap_inactive_since'));
} // END - if
} // END - if
// SQL string to check for accounts
- $result_main = SQL_QUERY_ESC("SELECT userid, email, gender, surname, family, beg_points AS points
-FROM `{!_MYSQL_PREFIX!}_user_data`
-WHERE `status`='CONFIRMED'".$whereStatement1." AND beg_points > 0
-ORDER BY beg_points DESC, userid
+ $result_main = SQL_QUERY_ESC("SELECT `userid`, `email`, `gender`, `surname`, `family`, `beg_points` AS points
+FROM
+ `{!_MYSQL_PREFIX!}_user_data`
+WHERE
+ `status`='CONFIRMED'" . $whereStatement1 . " AND `beg_points` > 0
+ORDER BY
+ `beg_points` DESC, `userid` ASC
LIMIT %s",
- array($whereStatement2), __FILE__, __LINE__);
+ array(getConfig('beg_ranks')), __FILE__, __LINE__);
if (SQL_NUMROWS($result_main) > 0) {
// Load our winners...
$content['points'] = translateComma($content['points']);
// Load email template and email it away
- $msg = LOAD_EMAIL_TEMPLATE("member_beg", $content, bigintval($content['userid']));
+ $msg = LOAD_EMAIL_TEMPLATE('member_beg', $content, bigintval($content['userid']));
sendEmail($content['email'], getMessage('BEG_MONTHLY_RALLYE'), $msg);
} // END - while
// Reset accounts
- $result = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET beg_points=0.00000 WHERE beg_points > 0", __FILE__, __LINE__);
+ $result = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `beg_points`=0.00000 WHERE `beg_points` > 0", __FILE__, __LINE__);
} // END - if
// Free memory
if (($curr != getConfig('last_month')) && (getConfig('bonus_ranks') > 0) && (getOutputMode() != 1)) {
// Extension 'autopurge' is inactive or purging of inactive accounts is deactivated
$whereStatement1 = "WHERE `status`='CONFIRMED'";
- $whereStatement2 = getConfig(('bonus_ranks'));
+ $whereStatement2 = getConfig('bonus_ranks');
// Shall I keep inactive members away from here? (mostly wanted in an "active-rallye" ...)
if (EXT_IS_ACTIVE('autopurge')) {
if (getConfig('ap_inactive_since') > 0) {
// Okay, include last online timestamp
$whereStatement1 = sprintf("WHERE `status`='CONFIRMED' AND `last_online` >= (UNIX_TIMESTAMP() - %s)", getConfig('ap_inactive_since'));
- $whereStatement2 = getConfig(('bonus_ranks'));
+ $whereStatement2 = getConfig('bonus_ranks');
} // END - if
} // END - if
// Add more bonus points here
$add = '';
- if (getConfig('bonus_click_yn') == 'Y') $add .= " + turbo_bonus";
- if (getConfig('bonus_login_yn') == 'Y') $add .= " + login_bonus";
- if (getConfig('bonus_order_yn') == 'Y') $add .= " + bonus_order";
- if (getConfig('bonus_stats_yn') == 'Y') $add .= " + bonus_stats";
- if (getConfig('bonus_ref_yn') == 'Y') $add .= " + bonus_ref";
+ // @TODO Rewrite this to a filter
+ if (getConfig('bonus_click_yn') == 'Y') $add .= " + `turbo_bonus`";
+ if (getConfig('bonus_login_yn') == 'Y') $add .= " + `login_bonus`";
+ if (getConfig('bonus_order_yn') == 'Y') $add .= " + `bonus_order`";
+ if (getConfig('bonus_stats_yn') == 'Y') $add .= " + `bonus_stats`";
+ if (getConfig('bonus_ref_yn') == 'Y') $add .= " + `bonus_ref`";
// Shall we add some entries?
if (!empty($add)) {
- $whereStatement1 .= " AND (0".$add.") > 0";
+ $whereStatement1 .= " AND (0" . $add . ") > 0";
} // END - if
// Run SQL string to check for accounts
- $result_main = SQL_QUERY_ESC("SELECT userid, email, gender, surname, family, (0".$add.") AS points
-FROM `{!_MYSQL_PREFIX!}_user_data`
+ $result_main = SQL_QUERY_ESC("SELECT `userid`, `email`, `gender`, `surname`, `family`, (0".$add.") AS points
+FROM
+ `{!_MYSQL_PREFIX!}_user_data`
".$whereStatement1."".$add."
-ORDER BY points DESC, userid
+ORDER BY
+ `points` DESC,
+ `userid` ASC
LIMIT %s",
array($whereStatement2), __FILE__, __LINE__);
if ($countRows === true) {
// Count whole table
$result = SQL_QUERY_ESC("SELECT COUNT(`%s`) FROM `{!_MYSQL_PREFIX!}_%s`".$add,
- array($lookFor, $tableName), __FUNCTION__, __LINE__);
+ array($lookFor, $tableName), __FUNCTION__, __LINE__);
} else {
// Sum whole table
$result = SQL_QUERY_ESC("SELECT SUM(`%s`) FROM `{!_MYSQL_PREFIX!}_%s`".$add,
- array($lookFor, $tableName), __FUNCTION__, __LINE__);
+ array($lookFor, $tableName), __FUNCTION__, __LINE__);
}
} elseif (($countRows === true) || ($lookFor == 'userid')) {
// Count rows
//* DEBUG: */ echo "COUNT!<br />\n";
$result = SQL_QUERY_ESC("SELECT COUNT(`%s`) FROM `{!_MYSQL_PREFIX!}_%s` WHERE `%s`='%s'".$add,
- array($lookFor, $tableName, $whereStatement, $search), __FUNCTION__, __LINE__);
+ array($lookFor, $tableName, $whereStatement, $search), __FUNCTION__, __LINE__);
} else {
// Add all rows
//* DEBUG: */ echo "SUM!<br />\n";
$result = SQL_QUERY_ESC("SELECT SUM(`%s`) FROM `{!_MYSQL_PREFIX!}_%s` WHERE `%s`='%s'".$add,
- array($lookFor, $tableName, $whereStatement, $search), __FUNCTION__, __LINE__);
+ array($lookFor, $tableName, $whereStatement, $search), __FUNCTION__, __LINE__);
}
// Load row
// And sent it away
sendEmail($email, getMessage('SUBJECT_DIRECT_PAYMENT'), $msg);
- if (!REQUEST_ISSET_GET(('mid'))) LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_POINTS_ADDED'));
+ if (!REQUEST_ISSET_GET('mid')) LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_POINTS_ADDED'));
}
// Maybe there's another ref?
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['ref_level'][$uid]}<br />\n";
// Update counter
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_refsystem` SET counter=counter+1 WHERE userid=%s AND level='%s' LIMIT 1",
- array(bigintval($uid), $GLOBALS['cache_array']['ref_level'][$uid]), __FUNCTION__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_refsystem` SET `counter`=`counter`+1 WHERE `userid`=%s AND `level`='%s' LIMIT 1",
+ array(bigintval($uid), $GLOBALS['cache_array']['ref_level'][$uid]), __FUNCTION__, __LINE__);
// When no entry was updated then we have to create it here
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):updated=".SQL_AFFECTEDROWS()."<br />\n";
if (SQL_AFFECTEDROWS() < 1) {
// First count!
- SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_refsystem` (userid, level, counter) VALUES (%s,%s,1)",
- array(bigintval($uid), $GLOBALS['cache_array']['ref_level'][$uid]), __FUNCTION__, __LINE__);
+ SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_refsystem` (`userid`, `level`, `counter`) VALUES (%s,%s,1)",
+ array(bigintval($uid), $GLOBALS['cache_array']['ref_level'][$uid]), __FUNCTION__, __LINE__);
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid}<br />\n";
} // END - if
// Check for his referal
- $result = SQL_QUERY_ESC("SELECT refid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(bigintval($uid)), __FUNCTION__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `refid` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
+ array(bigintval($uid)), __FUNCTION__, __LINE__);
// Load refid
list($ref) = SQL_FETCHROW($result);
// because we need it when there is no ext-admins installed
function SEND_ADMIN_EMAILS ($subj, $msg) {
// Load all admin email addresses
- $result = SQL_QUERY("SELECT email FROM `{!_MYSQL_PREFIX!}_admins` ORDER BY `id` ASC", __FUNCTION__, __LINE__);
+ $result = SQL_QUERY("SELECT `email` FROM `{!_MYSQL_PREFIX!}_admins` ORDER BY `id` ASC", __FUNCTION__, __LINE__);
while ($content = SQL_FETCHARRAY($result)) {
// Send the email out
sendEmail($content['email'], $subj, $msg);
$isUsed = $GLOBALS['cache_probe_nicknames'][$userid];
} else {
// Determine it
- $isUsed = ((EXT_IS_ACTIVE('nickname')) && ((''.round($userid).'') != $userid));
+ $isUsed = ((EXT_IS_ACTIVE('nickname')) && (('' . round($userid) . '') != $userid));
// And write it to the cache
$GLOBALS['cache_probe_nicknames'][$userid] = $isUsed;
if ($ltype == 'BONUS') $sender = 0;
// Is the user's ID unlocked?
- $result = SQL_QUERY_ESC("SELECT status, gender, surname, family, ref_payout FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT status, gender, surname, family, ref_payout FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
array($url_uid), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load data
if ($status == 'CONFIRMED') {
// Update last activity
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET last_online=UNIX_TIMESTAMP(), `last_module`='mailid_top' WHERE userid=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET last_online=UNIX_TIMESTAMP(), `last_module`='mailid_top' WHERE `userid`=%s LIMIT 1",
array($url_uid), __FILE__, __LINE__);
// User has confirmed his account so we can procede...
// @TODO Rewrite these blocks to filter
if (GET_EXT_VERSION('user') >= '0.1.2') {
// Update counter
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET mails_confirmed=mails_confirmed + 1 WHERE userid=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET mails_confirmed=mails_confirmed + 1 WHERE `userid`=%s LIMIT 1",
array($url_uid), __FILE__, __LINE__);
// Update random confirmed as well?
if (GET_EXT_VERSION('user') >= '0.3.4') {
// Update second counter
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET rand_confirmed=rand_confirmed + 1 WHERE userid=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET rand_confirmed=rand_confirmed + 1 WHERE `userid`=%s LIMIT 1",
array($url_uid), __FILE__, __LINE__);
} // END - if
} // END - if
} // END - if
// Count down ref_payout value
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET ref_payout=ref_payout-1 WHERE userid=%s AND ref_payout > 0 LIMIT 1",
- array($url_uid), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `ref_payout`=`ref_payout`-1 WHERE `userid`=%s AND `ref_payout` > 0 LIMIT 1",
+ array($url_uid), __FILE__, __LINE__);
// Add points
unset($GLOBALS['ref_level']);
// Check if logged in
if (IS_MEMBER()) {
// Is still logged in so we welcome him with his name
- $result = SQL_QUERY_ESC("SELECT surname, family FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(getUserId()), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT surname, family FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
+ array(getUserId()), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load surname and family's name and build the username
list($s, $f) = SQL_FETCHROW($result);
}
// Get referal ID from ref or refid variable
-if (REQUEST_ISSET_GET(('ref'))) $ref = REQUEST_GET('ref');
-elseif (REQUEST_ISSET_GET(('refid'))) $ref = REQUEST_GET('refid');
+if (REQUEST_ISSET_GET('ref')) $ref = REQUEST_GET('ref');
+ elseif (REQUEST_ISSET_GET('refid')) $ref = REQUEST_GET('refid');
if (!empty($ref)) {
// Test if nickname or numeric id
// Include header
loadIncludeOnce('inc/header.php');
-if ((REQUEST_GET('uid') > 0) && (REQUEST_GET('d') > 0) && (REQUEST_ISSET_GET(('t')))) {
+if ((REQUEST_GET('uid') > 0) && (REQUEST_GET('d') > 0) && (REQUEST_ISSET_GET('t'))) {
// Set row name
$t = '';
switch (REQUEST_GET('t')) {
// Valid type?
if (!empty($t)) {
// Check for data
- $result = SQL_QUERY_ESC("SELECT DISTINCT d.gender, d.surname, d.family, b.level, b.points
-FROM `{!_MYSQL_PREFIX!}_user_data` AS d
-RIGHT JOIN `{!_MYSQL_PREFIX!}_bonus_turbo` AS b
-ON d.userid=b.userid
-WHERE d.`status`='CONFIRMED' AND d.userid=%s AND b.%s=%s
+ $result = SQL_QUERY_ESC("SELECT d.gender, d.surname, d.family, b.level, b.points
+FROM
+ `{!_MYSQL_PREFIX!}_user_data` AS d
+RIGHT JOIN
+ `{!_MYSQL_PREFIX!}_bonus_turbo` AS b
+ON
+ d.userid=b.userid
+WHERE
+ d.`status`='CONFIRMED' AND d.userid=%s AND b.%s=%s
LIMIT 1",
- array(bigintval(REQUEST_GET('uid')), $t, bigintval(REQUEST_GET('d'))), __FILE__, __LINE__);
+ array(bigintval(REQUEST_GET('uid')), $t, bigintval(REQUEST_GET('d'))), __FILE__, __LINE__);
// Entry found?
if (SQL_NUMROWS($result) == 1) {
// Get referal ID from ref or refid variable
$ref = 0;
-if (REQUEST_ISSET_GET(('ref'))) $ref = bigintval(REQUEST_GET('ref'));
-elseif (REQUEST_ISSET_GET(('refid'))) $ref = bigintval(REQUEST_GET('refid'));
+if (REQUEST_ISSET_GET('ref')) $ref = bigintval(REQUEST_GET('ref'));
+ elseif (REQUEST_ISSET_GET('refid')) $ref = bigintval(REQUEST_GET('refid'));
if (!empty($ref)) {
// We have an refid here. So we simply add it
// Load template for stopped surfbar
LOAD_TEMPLATE('surfbar_stopped', false, $content);
}
-} elseif ((REQUEST_ISSET_GET(('check'))) && (REQUEST_ISSET_GET('id')) && (REQUEST_ISSET_GET(('salt')))) {
+} elseif ((REQUEST_ISSET_GET('check')) && (REQUEST_ISSET_GET('id')) && (REQUEST_ISSET_GET('salt'))) {
// Dummy next id get
SURFBAR_DETERMINE_NEXT_ID(REQUEST_GET('id'));
--- /dev/null
+<form action="{!__BURL_ACTION!}/install.php?page=finalize" method="POST" target="_self">
+<table border="0" cellspacing="0" cellpadding="0" class="install_main">
+<tr>
+ <td colspan="2" align="center">
+ <div class="install">{--HEADER_TEXT_PAGE5--}</strong>
+ </td>
+</tr>
+<tr><td colspan="2" height="21" class="seperator"> </td></tr>
+<tr>
+ <td colspan="2"><span class="install_text">
+ {--TEXT_PAGE_5--}
+ </span></td>
+</tr>
+<tr><td colspan="2" height="21" class="seperator"> </td></tr>
+<tr>
+ <td class="install" align="right">{--LANG_OUTPUT_MODE--}: </td>
+ <td>
+ <select name="omode" size="1" class="install_select">
+ <option value="render">{--MODE_RENDER--}</option>
+ <option value="direct">{--MODE_DIRECT--}</option>
+ </select>
+ </td>
+</tr>
+<tr><td colspan="2" height="10" class="seperator"> </td></tr>
+<tr>
+ <td class="install" align="right">{--WARN_NO_PASSWORD--}: </td>
+ <td>
+ <select name="warn_no_pass" size="1" class="install_select">
+ <option value="Y">{--YES--}</option>
+ <option value="N">{--NO--}</option>
+ </select>
+ </td>
+</tr>
+<tr><td colspan="2" height="10" class="seperator"> </td></tr>
+<tr>
+ <td class="install" align="right">{--LANG_WRITE_FOOTER--}: </td>
+ <td>
+ <select name="wfooter" size="1" class="install_select">
+ <option value="Y">{--YES--}</option>
+ <option value="N">{--NO--}</option>
+ </select>
+ </td>
+</tr>
+<tr><td colspan="2" height="10" class="seperator"> </td></tr>
+<tr>
+ <td class="install" align="right">{--INSTALL_ENABLE_BACKLINK--}: </td>
+ <td>
+ <select name="blink" size="1" class="install_select">
+ <option value="Y">{--YES--}</option>
+ <option value="N">{--NO--}</option>
+ </select>
+ </td>
+</tr>
+<tr><td colspan="2" height="21" class="seperator"> </td></tr>
+<tr>
+ <td colspan="2" align="center">
+ {!__MYSQL_DATA!}
+ <input type="hidden" name="spath" value="{!__SPATH_VALUE!}" />
+ <input type="hidden" name="burl" value="{!__BURL_VALUE!}" />
+ <input type="hidden" name="title" value="{!__TITLE_VALUE!}" />
+ <input type="hidden" name="slogan" value="{!__SLOGAN_VALUE!}" />
+ <input type="hidden" name="email" value="{!__EMAIL_VALUE!}" />
+ <input type="hidden" name="smtp_host" value="{!__SMTP_HOST!}" />
+ <input type="hidden" name="smtp_user" value="{!__SMTP_USER!}" />
+ <input type="hidden" name="smtp_pass" value="{!__SMTP_PASS!}" />
+ <input type="submit" class="admin_submit submit" name="finalize" value="{--NEXT_PAGE--}" class="install_submit" />
+ </td>
+</tr>
+<tr><td colspan="2" height="21" class="seperator"> </td></tr>
+</table>
+</form>