New naming convention applied to many functions, see #118 for details
[mailer.git] / inc / modules / member / what-unconfirmed.php
index 78449324e601d0ac5834007b6017014b4bea87d7..73eff91ad6b0ad403c47d99656a675c7236be0cd 100644 (file)
@@ -41,9 +41,9 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('mailid')) && (!IS_ADMIN())) {
-       LOAD_URL('modules.php?module=login');
+       redirectToUrl('modules.php?module=login');
 }
 
 // Add description as navigation point
@@ -54,7 +54,7 @@ if ((REQUEST_ISSET_GET(('bonusid'))) && (EXT_IS_ACTIVE('bonus'))) {
        // Display bonus mail by loading it's full data
        $result_data = SQL_QUERY_ESC("SELECT id, subject, timestamp, cat_id, points, text, is_notify, data_type, time, url
 FROM `{!_MYSQL_PREFIX!}_bonus`
-WHERE id=%s LIMIT 1",
+WHERE `id`=%s LIMIT 1",
                array(bigintval(REQUEST_GET('bonusid'))), __FILE__, __LINE__);
 
        // Load data
@@ -63,17 +63,17 @@ WHERE id=%s LIMIT 1",
        // Translate some data
        $content['subject']   = COMPILE_CODE($content['subject']);
        $content['text']      = COMPILE_CODE($content['text']);
-       $content['timestamp'] = MAKE_DATETIME($content['timestamp'], '2');
-       $content['category']  = GET_CATEGORY($content['cat_id']);
-       $content['points']    = TRANSLATE_COMMA($content['points']);
-       $content['is_notify'] = TRANSLATE_YESNO($content['is_notify']);
-       $content['sender']    = _ADMIN_SHORT;
-       $content['time']      = CREATE_FANCY_TIME($content['time']);
+       $content['timestamp'] = generateDateTime($content['timestamp'], '2');
+       $content['category']  = getCategory($content['cat_id']);
+       $content['points']    = translateComma($content['points']);
+       $content['is_notify'] = translateYesNo($content['is_notify']);
+       $content['sender']    = getMessage('_ADMIN_SHORT');
+       $content['time']      = createFancyTime($content['time']);
        $content['uid']       = getUserId();
 
        // Get timestamp from insert
        $content['user_status'] = sprintf(getMessage('MEMBER_MAIL_BONUS_CONFIRMED_ON'),
-               MAKE_DATETIME(USER_STATS_GET_TIMESTAMP('bonusid', $content['id']), '2')
+               generateDateTime(getTimestampFromUserStats('bonusid', $content['id']), '2')
        );
 
        // Display it depending on mail (data) type
@@ -98,15 +98,15 @@ WHERE s.id=%s LIMIT 1",
        // Translate some data
        $content['subject']   = COMPILE_CODE($content['subject']);
        $content['text']      = COMPILE_CODE($content['text']);
-       $content['timestamp'] = MAKE_DATETIME($content['timestamp'], '2');
-       $content['category']  = GET_CATEGORY($content['cat_id']);
-       $content['points']    = TRANSLATE_COMMA($content['points']);
-       $content['time']      = CREATE_FANCY_TIME($content['time']);
+       $content['timestamp'] = generateDateTime($content['timestamp'], '2');
+       $content['category']  = getCategory($content['cat_id']);
+       $content['points']    = translateComma($content['points']);
+       $content['time']      = createFancyTime($content['time']);
        $content['uid']       = getUserId();
 
        // Get timestamp from insert
        $content['user_status'] = sprintf(getMessage('MEMBER_MAIL_NORMAL_CONFIRMED_ON'),
-               MAKE_DATETIME(USER_STATS_GET_TIMESTAMP('mailid', $content['id']), '2')
+               generateDateTime(getTimestampFromUserStats('mailid', $content['id']), '2')
        );
 
        // Display it depending on mail (data) type
@@ -149,7 +149,7 @@ LIMIT 1",
                        break;
 
                case 'BONUS':
-                       $result_data = SQL_QUERY_ESC("SELECT subject, timestamp, cat_id, points, 0 FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1",
+                       $result_data = SQL_QUERY_ESC("SELECT subject, timestamp, cat_id, points, 0 FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`=%s LIMIT 1",
                         array(bigintval($id2)), __FILE__, __LINE__);
                        $type = 'bonusid'; $DATA = $id2; $PROBLEM = getMessage('BONUS_MAIL_PROBLEM');
                        break;
@@ -193,9 +193,9 @@ LIMIT 1",
                                'type'    => $type,
                                'subject' => $subject,
                                'sender'  => $sender,
-                               'stamp'   => MAKE_DATETIME($timestamp, '2'),
-                               'cat'     => GET_CATEGORY($cat),
-                               'points'  => TRANSLATE_COMMA($pay),
+                               'stamp'   => generateDateTime($timestamp, '2'),
+                               'cat'     => getCategory($cat),
+                               'points'  => translateComma($pay),
                        );
 
                        // Load row template
@@ -234,7 +234,7 @@ LIMIT 1",
        SQL_FREERESULT($result);
 
        // Remember total points
-       define('__TOTAL_POINTS', TRANSLATE_COMMA($sum));
+       define('__TOTAL_POINTS', translateComma($sum));
 
        // Remember all generated rows in constant for the template
        define('__UNCONFIRMED_ROWS', $OUT);