A lot constants rewritten to array elements
authorRoland Häder <roland@mxchange.org>
Sat, 10 Oct 2009 22:03:54 +0000 (22:03 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 10 Oct 2009 22:03:54 +0000 (22:03 +0000)
12 files changed:
DOCS/TODOs.txt
mailid.php
mailid_top.php
templates/de/html/mailid/mailid_confirm_buttom.tpl
templates/de/html/mailid/mailid_enter_code.tpl
templates/de/html/mailid/mailid_frames.tpl
templates/de/html/mailid/mailid_points_done.tpl
templates/de/html/mailid/mailid_points_done2.tpl
templates/de/html/mailid/mailid_points_failed.tpl
templates/de/html/mailid/mailid_points_locked.tpl
templates/de/html/mailid/mailid_points_locked2.tpl
templates/de/html/mailid/mailid_timer.tpl

index 0d09469..79e5a0b 100644 (file)
 ./inc/wrapper-functions.php:159:// @TODO Implement $decompress
 ./inc/wrapper-functions.php:389:// @TODO Do some more sanity check here
 ./mailid.php:140:                                      // @TODO Rewrite this to a filter
-./mailid.php:185:                                                      // @TODO Rewrite these constants
 ./mailid.php:221:      // @TODO Rewrite this to a filter
 ./mailid.php:96:               // @TODO Rewrite this to a filter
 ./mailid_top.php:136:                                  // @TODO Rewrite this to a filter
 ./mailid_top.php:183:                                                  // @TODO Rewrite this to a filter
 ./mailid_top.php:190:                                                                  // @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:227:                                                                  // @TODO Rewrite these blocks to filter
 ./mailid_top.php:89:           // @TODO Rewrite this to a filter
 ./show_bonus.php:108:                  // @TODO Rewrite this constant
 ./view.php:72:         // @TODO No banner found, output some default banner
index 34de985..c0caa5a 100644 (file)
@@ -148,7 +148,7 @@ if (($url_uid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErrors
                                                                $time      = getPaymentPoints($pay, 'time');
                                                                $payment   = getPaymentPoints($pay, 'payment');
                                                                $isValid   = true;
-                                                       }
+                                                       } // END - if
 
                                                        // Free memory
                                                        SQL_FREERESULT($result);
@@ -156,7 +156,7 @@ if (($url_uid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErrors
 
                                                case 'BONUS':
                                                        $result = SQL_QUERY_ESC("SELECT points, time FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`=%s LIMIT 1",
-                                                       array($url_bid), __FILE__, __LINE__);
+                                                               array($url_bid), __FILE__, __LINE__);
                                                        if (SQL_NUMROWS($result) == 1) {
                                                                list($points, $time) = SQL_FETCHROW($result);
                                                                $payment = '0.00000';
@@ -180,13 +180,13 @@ if (($url_uid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErrors
                                                // If time is zero seconds we have a sponsor mail. 1 Second shall be set to avoid problems
                                                if (($time == '0') && ($payment > 0)) { $URL = constant('URL'); $time = '1'; }
                                                if (($time > 0) && (($payment > 0) || ($points > 0))) {
-                                                       // He can confirm this mail!
                                                        // Export data into constants for the template
-                                                       // @TODO Rewrite these constants
-                                                       define('_UID_VALUE' , $url_uid);
-                                                       define('_TYPE_VALUE', $type);
-                                                       define('_DATA_VALUE', $urlId);
-                                                       define('_URL_VALUE' , DEREFERER($URL));
+                                                       $content = array(
+                                                               'uid'  => $url_uid,
+                                                               'type' => $type,
+                                                               'data' => $urlId,
+                                                               'url'  => DEREFERER($URL)
+                                                       );
 
                                                        // Load template
                                                        LOAD_TEMPLATE('mailid_frames');
index 3457613..f670abb 100644 (file)
@@ -220,9 +220,8 @@ if (($url_uid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErrors
                                                                        }
 
                                                                        // Export data into constants for the template
-                                                                       // @TODO Rewrite these constants
-                                                                       define('_POINTS_VALUE'   , translateComma($payment));
-                                                                       define('_TEMPLATE_BANNER', LOAD_TEMPLATE('mailid_banner', true));
+                                                                       $content['points'] = translateComma($payment);
+                                                                       $content['banner'] = LOAD_TEMPLATE('mailid_banner', true);
 
                                                                        // Only when user extension = v0.1.2: Update mails-confirmed counter
                                                                        // @TODO Rewrite these blocks to filter
@@ -270,22 +269,22 @@ if (($url_uid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErrors
                                                                                                // Shall I exclude the webmaster's own userid from the active-rallye?
                                                                                                if ((((getConfig('bonus_uid') == $url_uid) && (getConfig('bonus_include_own') == 'Y')) || (getConfig('bonus_uid') != $url_uid)) && (getConfig('def_refid') != $url_uid)) {
                                                                                                        // Add points and remember ranking are done in this function....
-                                                                                                       BONUS_ADD_TURBO_POINTS($urlId, $url_uid, $type);
+                                                                                                       BONUS_ADD_TURBO_POINTS($payment, $url_uid, $type);
 
                                                                                                        // Set template to mailid_points_done2 which contains a link to the ranking list
                                                                                                        $template = 'mailid_points_done2';
                                                                                                        if ($locked) $template = 'mailid_points_locked2';
-                                                                                                       define('_UID_VALUE' , $url_uid);
-                                                                                                       define('_TYPE_VALUE', $type);
-                                                                                                       define('_DATA_VALUE', translateComma($urlId));
+                                                                                                       $content['uid']  = $url_uid;
+                                                                                                       $content['type'] = $type;
+                                                                                                       $content['data'] = translateComma($payment);
                                                                                                } // END - if
                                                                                        } // END - if
                                                                                } // END - if
 
                                                                                // Load total points
-                                                                               define('__TOTAL_POINTS', translateComma(
-                                                                               GET_TOTAL_DATA($url_uid, 'user_points', 'points') -
-                                                                               GET_TOTAL_DATA($url_uid, 'user_data', 'used_points'))
+                                                                               $content['total'] = translateComma(
+                                                                                       GET_TOTAL_DATA($url_uid, 'user_points', 'points') -
+                                                                                       GET_TOTAL_DATA($url_uid, 'user_data', 'used_points')
                                                                                );
 
                                                                                // Load template
@@ -301,7 +300,7 @@ if (($url_uid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErrors
 
                                                                        // Remove link from table
                                                                        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_links` WHERE `id`=%s LIMIT 1",
-                                                                       array(bigintval($lid)), __FILE__, __LINE__);
+                                                                               array(bigintval($lid)), __FILE__, __LINE__);
                                                                        break;
 
                                                                case 'img':
@@ -311,18 +310,18 @@ if (($url_uid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErrors
                                                                case 'confirm':
                                                                        if ($code > 0) {
                                                                                // Export data into constants for the template
-                                                                               define('_CODE_VALUE', $code);
-                                                                               define('_UID_VALUE' , $url_uid );
-                                                                               define('_TYPE_VALUE', $type);
-                                                                               define('_DATA_VALUE', $urlId);
-                                                                               define('_TEMPLATE_BANNER', LOAD_TEMPLATE('mailid_banner', true));
+                                                                               $content['code'] = $code;
+                                                                               $content['uid']  = $url_uid;
+                                                                               $content['type'] = $type;
+                                                                               $content['data']   = $urlId;
+                                                                               $content['banner'] = LOAD_TEMPLATE('mailid_banner', true);
                                                                                if (getConfig('code_length') > 0) {
                                                                                        // Generate Code
                                                                                        define('_IMAGE_CODE', generateCaptchaCode($code, $type, $urlId, $url_uid));
                                                                                        $templ = 'mailid_enter_code';
                                                                                } else {
                                                                                        // Disabled code
-                                                                                       define('__GFX_CODE', $img_code);
+                                                                                       $content['gfx'] = $img_code;
                                                                                        $templ = 'mailid_confirm_buttom';
                                                                                }
 
@@ -334,13 +333,13 @@ if (($url_uid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErrors
                                                                case '':
                                                                        // Ok, all data is valid and loaded. Finally let's output the timer... :-)
                                                                        // Export data into constants for the template
-                                                                       define('_TIME_VALUE', $time);
-                                                                       define('_TIM2_VALUE', strlen($time));
-                                                                       define('_UID_VALUE' , $url_uid );
-                                                                       define('_TYPE_VALUE', $type);
-                                                                       define('_DATA_VALUE', $urlId);
-                                                                       define('_RAND_VALUE', mt_rand(0, 99999));
-                                                                       define('_TEMPLATE_BANNER', LOAD_TEMPLATE('mailid_banner', true));
+                                                                       $content['time'] = $time;
+                                                                       $content['tim2'] = strlen($time);
+                                                                       $content['uid']  = $url_uid;
+                                                                       $content['type'] = $type;
+                                                                       $content['data'] = $urlId;
+                                                                       $content['rand'] = mt_rand(0, 99999);
+                                                                       $content['banner'] = LOAD_TEMPLATE('mailid_banner', true);
 
                                                                        // Load template
                                                                        LOAD_TEMPLATE('mailid_timer');
index 8fda6ef..9fda0be 100644 (file)
@@ -2,9 +2,9 @@
        <tr>
                <td width="10" class="seperator">&nbsp;</td>
                <td width="220" align="center">
-                       <form action="{!URL!}/mailid_top.php?uid={!_UID_VALUE!}&amp;{!_TYPE_VALUE!}={!_DATA_VALUE!}&amp;mode=add&amp;code={!_CODE_VALUE!}" method="post" style="margin-bottom: 0px">
+                       <form action="{!URL!}/mailid_top.php?uid=$content[uid]&amp;$content[type]=$content[data]&amp;mode=add&amp;code=$content[code]" method="post" style="margin-bottom: 0px">
                                {--MAILID_CLICK_BUTTON--}:<br />
-                               <input type="hidden" name="gfx_check" value="{!__GFX_CODE!}" />
+                               <input type="hidden" name="gfx_check" value="{!$content[gfx]!}" />
                                <input type="submit" class="member_submit" name="ok" value="{--SUBMIT_CODE--}" />
                        </form>
                </td>
@@ -15,7 +15,7 @@
                                <td height="3" class="seperator">&nbsp;</td>
                        </tr>
                        <tr>
-                               <td align="center">{--_TEMPLATE_BANNER--}</td>
+                               <td align="center">$content[banner]</td>
                        </tr>
                        <tr>
                                <td height="4" class="seperator">&nbsp;</td>
index f080e90..8f0cf6c 100644 (file)
@@ -4,7 +4,7 @@
                <td width="10" class="seperator">&nbsp;</td>
                <td width="220" align="center">
                <form
-                       action="{!URL!}/mailid_top.php?uid={!_UID_VALUE!}&amp;{!_TYPE_VALUE!}={!_DATA_VALUE!}&amp;mode=add&amp;code={--_CODE_VALUE!}"
+                       action="{!URL!}/mailid_top.php?uid=$content[uid]&amp;$content[type]=$content[data]&amp;mode=add&amp;code={--_CODE_VALUE!}"
                        method="post" style="margin-bottom: 0px">{--ENTER_CODE--}:
                {--_IMAGE_CODE--}<br />
                <input type="text" name="gfx_check" class="member_normal" size="5"
@@ -19,7 +19,7 @@
                                <td height="3" class="seperator">&nbsp;</td>
                        </tr>
                        <tr>
-                               <td align="center">{--_TEMPLATE_BANNER--}</td>
+                               <td align="center">$content[banner]</td>
                        </tr>
                        <tr>
                                <td height="4" class="seperator">&nbsp;</td>
index fe9471e..76ad742 100644 (file)
@@ -1,6 +1,6 @@
 <frameset rows="120,*" frameborder="no" framespacing="0" border="0">
-       <frame name="mailid_top" src="{!URL!}/mailid_top.php?uid={!_UID_VALUE!}&amp;{!_TYPE_VALUE!}={!_DATA_VALUE!}">
-       <frame name="mailid_url" src="{--_URL_VALUE!}">
+       <frame name="mailid_top" src="{!URL!}/mailid_top.php?uid=$content[uid]&amp;$content[type]=$content[data]" />
+       <frame name="mailid_url" src="$content[url]" />
 </frameset>
 <noframes>
        Ihr Browser unterst&uuml;tzt keine frames!
index a9e7bbb..35b04ff 100644 (file)
@@ -3,8 +3,8 @@
 <tr>
 <td width="10" class="seperator">&nbsp;</td>
 <td width="220" align="center">{--THANX_POINTS_ADDED_1--}<strong
-    class="member_done">{--_POINTS_VALUE!}</strong>&nbsp;{--THANX_POINTS_ADDED_2--}<br />
-  {--MAILID_TOTAL_POINTS1--} <div class="member_done">{!__TOTAL_POINTS!}
+    class="member_done">$content[points]</strong>&nbsp;{--THANX_POINTS_ADDED_2--}<br />
+  {--MAILID_TOTAL_POINTS1--} <div class="member_done">$content[total]
 {!POINTS!}</div> {--MAILID_TOTAL_POINTS2--}</td>
 <td width="10" class="seperator">&nbsp;</td>
 <td align="center">
@@ -14,7 +14,7 @@ class="member_banner dashed">
       <td height="3" class="seperator">&nbsp;</td>
     </tr>
     <tr>
-      <td align="center">{--_TEMPLATE_BANNER--}</td>
+      <td align="center">$content[banner]</td>
     </tr>
     <tr>
       <td height="4" class="seperator">&nbsp;</td>
index 3e7b413..83bfc9f 100644 (file)
@@ -4,12 +4,12 @@
        <tr>
                <td width="10" class="seperator">&nbsp;</td>
                <td width="220" align="center"><div class="tiny">
-               {--THANX_POINTS_ADDED_1--}<span class="member_done">{--_POINTS_VALUE!}</span>&nbsp;{--THANX_POINTS_ADDED_2--}<br />
-               {--MAILID_TOTAL_POINTS1--} <span class="member_done">{!__TOTAL_POINTS!}
+               {--THANX_POINTS_ADDED_1--}<span class="member_done">$content[points]</span>&nbsp;{--THANX_POINTS_ADDED_2--}<br />
+               {--MAILID_TOTAL_POINTS1--} <span class="member_done">$content[total]
                {!POINTS!}</span> {--MAILID_TOTAL_POINTS2--}<br />
                <br />
                <a
-                       href="{!URL!}/show_bonus.php?uid={!_UID_VALUE!}&amp;t={!_TYPE_VALUE!}&amp;d={!_DATA_VALUE!}"
+                       href="{!URL!}/show_bonus.php?uid=$content[uid]&amp;t=$content[type]&amp;d=$content[data]"
                        target="_blank">{--BONUS_SHOW_TURBO_BONUS--} </span></td>
                <td width="10" class="seperator">&nbsp;</td>
                <td align="center">
@@ -19,7 +19,7 @@
                                <td height="3" class="seperator">&nbsp;</td>
                        </tr>
                        <tr>
-                               <td align="center">{--_TEMPLATE_BANNER--}</td>
+                               <td align="center">$content[banner]</td>
                        </tr>
                        <tr>
                                <td height="4" class="seperator">&nbsp;</td>
index 41e15d9..4f795ee 100644 (file)
@@ -3,7 +3,7 @@
        <tr>
                <td width="10" class="seperator">&nbsp;</td>
                <td width="220" align="center">{--POINTS_NOT_ADDED_1--}<strong
-                       class="member_failed">{--_POINTS_VALUE!}</strong>&nbsp;{--POINTS_NOT_ADDED_2--}
+                       class="member_failed">$content[points]</strong>&nbsp;{--POINTS_NOT_ADDED_2--}
                </td>
                <td width="10" class="seperator">&nbsp;</td>
                <td align="center">
@@ -13,7 +13,7 @@
                                <td height="3" class="seperator">&nbsp;</td>
                        </tr>
                        <tr>
-                               <td align="center">{--_TEMPLATE_BANNER--}</td>
+                               <td align="center">$content[banner]</td>
                        </tr>
                        <tr>
                                <td height="4" class="seperator">&nbsp;</td>
index 325ab9f..5a6e613 100644 (file)
@@ -3,7 +3,7 @@
        <tr>
                <td width="10" class="seperator">&nbsp;</td>
                <td width="220" align="center">{--THANX_POINTS_LOCKED_1--}<strong
-                       class="member_done">{--_POINTS_VALUE!}</strong>&nbsp;{--THANX_POINTS_LOCKED_2--}<br />
+                       class="member_done">$content[points]</strong>&nbsp;{--THANX_POINTS_LOCKED_2--}<br />
                </td>
                <td width="10" class="seperator">&nbsp;</td>
                <td align="center">
@@ -13,7 +13,7 @@
                                <td height="3" class="seperator">&nbsp;</td>
                        </tr>
                        <tr>
-                               <td align="center">{--_TEMPLATE_BANNER--}</td>
+                               <td align="center">$content[banner]</td>
                        </tr>
                        <tr>
                                <td height="4" class="seperator">&nbsp;</td>
index 9f03f78..1bb6a53 100644 (file)
@@ -4,10 +4,10 @@
        <tr>
                <td width="10" class="seperator">&nbsp;</td>
                <td width="220" align="center"><div class="tiny">
-               {--THANX_POINTS_LOCKED_1--}<span class="member_done">{--_POINTS_VALUE!}</span>&nbsp;{--THANX_POINTS_LOCKED_2--}<br />
+               {--THANX_POINTS_LOCKED_1--}<span class="member_done">$content[points]</span>&nbsp;{--THANX_POINTS_LOCKED_2--}<br />
                <br />
                <a
-                       href="{!URL!}/show_bonus.php?uid={!_UID_VALUE!}&amp;t={!_TYPE_VALUE!}&amp;d={!_DATA_VALUE!}"
+                       href="{!URL!}/show_bonus.php?uid=$content[uid]&amp;t=$content[type]&amp;d=$content[data]"
                        target="_blank">{--BONUS_SHOW_TURBO_BONUS--} </span></td>
                <td width="10" class="seperator">&nbsp;</td>
                <td align="center">
@@ -17,7 +17,7 @@
                                <td height="3" class="seperator">&nbsp;</td>
                        </tr>
                        <tr>
-                               <td align="center">{--_TEMPLATE_BANNER--}</td>
+                               <td align="center">$content[banner]</td>
                        </tr>
                        <tr>
                                <td height="4" class="seperator">&nbsp;</td>
index a95f42e..30c594f 100644 (file)
@@ -14,7 +14,7 @@ function StartCounter() {
        Timer--;
        document.confirm.counter.value = Timer;
        if (Timer == 0) {
-               document.location.href="{!URL!}/mailid_top.php?uid={!_UID_VALUE!}&{!_TYPE_VALUE!}={!_DATA_VALUE!}&mode=confirm&code={--_RAND_VALUE!}";
+               document.location.href="{!URL!}/mailid_top.php?uid=$content[uid]&$content[type]=$content[data]&mode=confirm&code=$content[rand]";
                clearInterval(Counter);
        }
 }
@@ -34,8 +34,8 @@ function StartCounter() {
                                <td align="center">
                                <form name="confirm" style="margin-top: 0px; margin-bottom: 0px">
                                {--MEMBER_TIME_COUNTER_1--} <input type="text" name="counter"
-                                       size="{--_TIM2_VALUE!}" readonly class="member_normal"
-                                       value="{--_TIME_VALUE!}">&nbsp;{--_SECONDS--}
+                                       size="$content[tim2]" readonly class="member_normal"
+                                       value="$content[time]">&nbsp;{--_SECONDS--}
                                {--MEMBER_TIME_COUNTER_2--}</form>
                                </td>
                        </tr>
@@ -52,7 +52,7 @@ function StartCounter() {
                                <td height="3" class="seperator">&nbsp;</td>
                        </tr>
                        <tr>
-                               <td align="center">{--_TEMPLATE_BANNER--}</td>
+                               <td align="center">$content[banner]</td>
                        </tr>
                        <tr>
                                <td height="4" class="seperator">&nbsp;</td>