]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/guest/what-sponsor_reg.php
New naming convention applied to many functions, see #118 for details
[mailer.git] / inc / modules / guest / what-sponsor_reg.php
index 7c5ca54b5165502ef58493152d4bd623c78284f4..fbd31a5ef6cffa2852f38e28966d2f6b750ab878 100644 (file)
 
 // Some security stuff...
 if (!defined('__SECURITY')) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif ((!EXT_IS_ACTIVE('sponsor'))) {
-       addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'sponsor');
+       addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'sponsor'));
        return;
 }
 
@@ -131,7 +131,7 @@ if (IS_FORM_SENT()) {
        if (!REQUEST_ISSET_POST(('url'))) {
                // Homepage URL is empty
                $FORM_ERRORS[] = getMessage('SPONSOR_URL_IS_EMPTY');
-       } elseif (!VALIDATE_URL(REQUEST_POST('url'))) {
+       } elseif (!isUrlValid(REQUEST_POST('url'))) {
                // Homepage URL is invalid
                $FORM_ERRORS[] = getMessage('SPONSOR_URL_IS_INVALID');
                REQUEST_SET_POST('url', '');
@@ -206,7 +206,7 @@ if ((IS_FORM_SENT()) && (count($FORM_ERRORS) == 0)) {
        // Calulate points
        $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
@@ -238,16 +238,16 @@ WHERE id='%s' LIMIT 1", array(REQUEST_POST('pay_type')), __FILE__, __LINE__);
                        define('__EMAIL'    , REQUEST_POST('email'));
                        define('__SURNAME'  , REQUEST_POST('surname'));
                        define('__FAMILY'   , REQUEST_POST('family'));
-                       define('__GENDER'   , TRANSLATE_GENDER(REQUEST_POST('gender')));
-                       define('__TIMESTAMP', MAKE_DATETIME(time(), 0));
+                       define('__GENDER'   , translateGender(REQUEST_POST('gender')));
+                       define('__TIMESTAMP', generateDateTime(time(), 0));
                        define('__PASSWORD' , REQUEST_POST('pass1'));
 
                        // Generate email and send it to the new sponsor
                        $EMAIL_MSG = LOAD_EMAIL_TEMPLATE("sponsor_confirm", $hash);
-                       SEND_EMAIL(REQUEST_POST('email'), getMessage('SPONSOR_PLEASE_CONFIRM_SUBJ'), $EMAIL_MSG);
+                       sendEmail(REQUEST_POST('email'), getMessage('SPONSOR_PLEASE_CONFIRM_SUBJ'), $EMAIL_MSG);
 
                        // Send mail to admin
-                       SEND_ADMIN_NOTIFICATION(getMessage('ADMIN_NEW_SPONSOR'), "admin_sponsor_reg", $hash);
+                       sendAdminNotification(getMessage('ADMIN_NEW_SPONSOR'), "admin_sponsor_reg", $hash);
 
                        // Output message: DONE
                        $message = $messageArray['added'];
@@ -287,7 +287,7 @@ ORDER BY pay_name", __FILE__, __LINE__);
                while ($content = SQL_FETCHARRAY($result)) {
                        // Prepare content for output
                        $content['sw']  = $SW;
-                       $content['res'] = TRANSLATE_COMMA($content['pay_rate'] * $content['pay_min_count']);
+                       $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);
@@ -396,7 +396,7 @@ ORDER BY pay_name", __FILE__, __LINE__);
                // Prepare referal things
                if (!REQUEST_ISSET_GET(('refid'))) {
                        // No referal link
-                       define('__SPONSOR_REFID', "0");
+                       define('__SPONSOR_REFID', '0');
                } else  {
                        // Referal ID transmitted, we don't care here if it is right or not
                        define('__SPONSOR_REFID', bigintval(REQUEST_GET('refid')));