Double brackets removed, some fixes
authorRoland Häder <roland@mxchange.org>
Mon, 16 Mar 2009 18:58:38 +0000 (18:58 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 16 Mar 2009 18:58:38 +0000 (18:58 +0000)
inc/functions.php
inc/install-inc.php
inc/libs/user_functions.php
inc/modules/admin/what-add_points.php
inc/modules/admin/what-admin_add.php
inc/modules/admin/what-email_archiv.php
inc/modules/admin/what-list_notifications.php
inc/modules/admin/what-list_payouts.php
inc/modules/admin/what-list_user.php
inc/modules/admin/what-unlock_sponsor.php

index e5a3be66f846d15ca8b2c5668c048ead30873d70..025f936e7db9d5948d3b07c773464e628173c5b4 100644 (file)
@@ -1679,7 +1679,7 @@ function ADD_EMAIL_NAV ($PAGES, $offset, $show_form, $colspan, $return=false) {
        $NAV = '';
        for ($page = 1; $page <= $PAGES; $page++) {
                // Is the page currently selected or shall we generate a link to it?
-               if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET(('page'))) && ($page == "1"))) {
+               if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == "1"))) {
                        // Is currently selected, so only highlight it
                        $NAV .= "<strong>-";
                } else {
@@ -1693,7 +1693,7 @@ function ADD_EMAIL_NAV ($PAGES, $offset, $show_form, $colspan, $return=false) {
                        $NAV .= "\">";
                }
                $NAV .= $page;
-               if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET(('page'))) && ($page == "1"))) {
+               if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == "1"))) {
                        // Is currently selected, so only highlight it
                        $NAV .= "-</strong>";
                } else {
index eea54299728eeef13f7aa9e3fdd7a1dd21463fc4..017c6faf35b44e1a30bb8bfad9e81daa27ca1115 100644 (file)
@@ -51,7 +51,7 @@ $mysql = array();
 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))) {
+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')))) {
                // Hostname not set
index adeb3001ff0265ee3b8d11a634f5aa7f0ae5eaff..21b7e00f7a20b51d66056739ec70ee8b14a1d212 100644 (file)
@@ -44,8 +44,8 @@ if (!defined('__SECURITY')) {
 
 // Add links for selecting some users
 function alpha ($sortby, $colspan, $return=false) {
-       if (!REQUEST_ISSET_GET(('offset'))) REQUEST_SET_GET('offset', 0);
-       $add = "&amp;page=".REQUEST_GET(('page'))."&amp;offset=".REQUEST_GET(('offset'));
+       if (!REQUEST_ISSET_GET('offset')) REQUEST_SET_GET('offset', 0);
+       $add = "&amp;page=".REQUEST_GET('page')."&amp;offset=".REQUEST_GET('offset');
        if (REQUEST_ISSET_GET(('mode'))) $add .= "&amp;mode=".REQUEST_GET(('mode'));
 
        /* Creates the list of letters and makes them a link. */
@@ -86,11 +86,11 @@ function alpha ($sortby, $colspan, $return=false) {
 // Add links for sorting
 function SortLinks ($letter, $sortby, $colspan, $return=false) {
        $OUT = '';
-       if (!REQUEST_ISSET_GET(('offset'))) REQUEST_SET_GET('offset', 0);
-       if (!REQUEST_ISSET_GET(('page')))   REQUEST_SET_GET('page'  , 0);
+       if (!REQUEST_ISSET_GET('offset')) REQUEST_SET_GET('offset', 0);
+       if (!REQUEST_ISSET_GET('page'))   REQUEST_SET_GET('page'  , 0);
 
        // Add page and offset
-       $add = "&amp;page=".REQUEST_GET(('page'))."&amp;offset=".REQUEST_GET(('offset'));
+       $add = "&amp;page=".REQUEST_GET('page')."&amp;offset=".REQUEST_GET('offset');
 
        // Add status or mode
        if (REQUEST_ISSET_GET(('status'))) $add .= "&amp;mode=".REQUEST_GET(('status'));
@@ -153,7 +153,7 @@ function ADD_PAGENAV ($PAGES, $offset, $show_form, $colspan,$return=false) {
 
        $OUT = '';
        for ($page = 1; $page <= $PAGES; $page++) {
-               if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET(('page'))) && ($page == "1"))) {
+               if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == "1"))) {
                        $OUT .= "<strong>-";
                } else {
                        if (!REQUEST_ISSET_GET(('letter'))) REQUEST_SET_GET('letter', getMessage('_ALL2'));
@@ -172,7 +172,7 @@ function ADD_PAGENAV ($PAGES, $offset, $show_form, $colspan,$return=false) {
 
                $OUT .= $page;
 
-               if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET(('page'))) && ($page == "1"))) {
+               if (($page == REQUEST_GET('page')) || ((!REQUEST_ISSET_GET('page')) && ($page == "1"))) {
                        $OUT .= "-</strong>";
                } else  {
                        $OUT .= "</a>";
index d6936169e84088d3acb7e7f96020c31db2256072..fb85e0ec97edda7a88c072031ecb9069b79cadf1 100644 (file)
@@ -59,7 +59,7 @@ if (REQUEST_GET('uid') == "all") {
                        __FILE__, __LINE__);
 
                // Process all entries
-               while ($content = SQL_FETCHROW($result_main)) {
+               while ($content = SQL_FETCHARRAY($result_main)) {
                        // Remove depth to prevent booking errors. This is a bad coding
                        // practice, thats also why we need to write this project from
                        // scratch...
index 3b92526c35347adea2022c470601f7cf1e7e1383..79dcaae43232f9b77255b9e4ee60f2e016f8208e 100644 (file)
@@ -76,20 +76,21 @@ if (!IS_FORM_SENT())
                // Remove double eintries
                // @TODO This can be somehow rewritten to a function
                $prev = ''; $dmy = $menus; $dmy2 = $titles; $dmy3 = $below;
-               foreach ($menus as $key => $value)
-               {
-                       if ($value == $prev)
-                       {
+               foreach ($menus as $key => $value) {
+                       if ($value == $prev) {
                                unset($dmy[$key]);
                                unset($dmy2[$key]);
                                unset($dmy3[$key]);
-                       }
-                        else
-                       {
+                       } else {
                                $prev = $value;
                        }
-               }
-               $menus = $dmy; $titles = $dmy2; $below = $dmy3;
+               } // END - foreach
+
+               // Write dummys back to our array
+               $menus  = $dmy;  unset($dmy);
+               $titles = $dmy2; unset($dmy2);
+               $below  = $dmy3; unset($dmy3);
+
                // Load sub menus :)
                foreach ($menus as $key_main => $value_main) {
                        $result = SQL_QUERY_ESC("SELECT what, title, sort FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`",
@@ -101,9 +102,9 @@ if (!IS_FORM_SENT())
                                $below[$value_main] = array();
 
                                // Read menu structure
-                               while ($content = SQL_FETCHROW($result)) {
+                               while ($content = SQL_FETCHARRAY($result)) {
                                        // Menu actions
-                                       $menus[$value_main][] = $content['action'];
+                                       $menus[$value_main][] = $content['what'];
 
                                        // Menu titles
                                        $titles[$value_main][] = $content['title'];
index 3e9cf6770b5b0d22148e1262eb018a1fa36d97ac..a095f2310a3f0c6bc38e0f5f7bbff56810080a0c 100644 (file)
@@ -58,8 +58,8 @@ $sql = "SELECT id, sender, subject, text, receivers, payment_id, data_type, time
 $result_normal = SQL_QUERY($sql, __FILE__, __LINE__);
 
 // Set offset an current page to default values
-if (!REQUEST_ISSET_GET(('page')))   REQUEST_GET('page')   = "1";
-if (!REQUEST_ISSET_GET(('offset'))) REQUEST_SET_GET('offset', getConfig('mails_page'));
+if (!REQUEST_ISSET_GET('page'))   REQUEST_SET_GET('page'  , "1");
+if (!REQUEST_ISSET_GET('offset')) REQUEST_SET_GET('offset', getConfig('mails_page'));
 
 // Add limitation to SQL string
 $sql .= " LIMIT ".(REQUEST_GET('offset') * REQUEST_GET('page') - REQUEST_GET('offset')).", ".REQUEST_GET('offset');
@@ -71,35 +71,29 @@ $result = SQL_QUERY($sql, __FILE__, __LINE__);
 $PAGES = round(SQL_NUMROWS($result_normal) / getConfig('mails_page') + 0.5);
 SQL_FREERESULT($result_normal);
 
-if (SQL_NUMROWS($result) > 0)
-{
+if (SQL_NUMROWS($result) > 0) {
        // Mail orders are in pool so we can display them
 
        // Add navigation table rows
-       if ($PAGES > 1)
-       {
+       if ($PAGES > 1) {
                define('__TOP_EMAIL_NAV'   , ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), true , "3", true));
                define('__BOTTOM_EMAIL_NAV', ADD_EMAIL_NAV($PAGES, getConfig('mails_page'), false, "3", true));
-       }
-        else
-       {
+       } else {
                define('__TOP_EMAIL_NAV'   , '');
                define('__BOTTOM_EMAIL_NAV', '');
        }
 
        $OUT = ''; $SW = 2;
-       while ($pool = SQL_FETCHROW($result))
-       {
+       while ($pool = SQL_FETCHROW($result)) {
                // Check sent mails and clicks
                $result_mails = SQL_QUERY_ESC("SELECT max_rec, clicks FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s LIMIT 1",
-                array(bigintval($pool[0])), __FILE__, __LINE__);
+                       array(bigintval($pool[0])), __FILE__, __LINE__);
                list($sent, $clicks) = SQL_FETCHROW($result_mails);
                SQL_FREERESULT($result_mails);
 
                // Unconfirmed mails
                $unconfirmed = $sent - $clicks;
-               if ($unconfirmed > 0)
-               {
+               if ($unconfirmed > 0) {
                        // Add link to list_unconfirmed what-file
                        $unconfirmed = "<strong><a href=\"{!URL!}/modules.php?module=admin&amp;what=list_unconfirmed&amp;mid=".$pool[0]."\">".$unconfirmed."</a></strong>";
                }
@@ -138,5 +132,6 @@ if (SQL_NUMROWS($result) > 0)
        // No mail orders fond
        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_NO_MAILS_IN_POOL'));
 }
+
 //
 ?>
index 80d14ee9bcf8c3f7cf61aaac95b1a0def75f795f..fbc84bf289552ea79a302c942c028b65496c3641 100644 (file)
@@ -50,8 +50,8 @@ $WHO = _ALL;
 $SQL2 = '';
 
 // Set offset an current page to default values
-if (!REQUEST_ISSET_GET(('page')))   REQUEST_GET('page')   = "1";
-if (!REQUEST_ISSET_GET(('offset'))) REQUEST_SET_GET('offset', getConfig('mails_page'));
+if (!REQUEST_ISSET_GET('page'))   REQUEST_GET('page')   = "1";
+if (!REQUEST_ISSET_GET('offset')) REQUEST_SET_GET('offset', getConfig('mails_page'));
 
 if ((EXT_IS_ACTIVE('bonus')) && ($WHO == getMessage('_ALL'))) {
        // Bonus mails sent by you
index 03cb3d3457edc8d65f65adb9885178b93ec1a8e4..d0e56e9ed21a367f7558ca541739489f1bf32acf 100644 (file)
@@ -222,7 +222,7 @@ ORDER BY p.payout_timestamp DESC", __FILE__, __LINE__);
        if (SQL_NUMROWS($result) > 0) {
                // List found payouts
                $OUT = ''; $SW = 2;
-               while ($content = SQL_FETCHROW($result)) {
+               while ($content = SQL_FETCHARRAY($result)) {
                        if ($content['status'] == "NEW") {
                                // Generate links for direct accepting and rejecting
                                $content['status'] = "<a href=\"{!URL!}/modules.php?module=admin&amp;what=list_payouts&amp;do=accept&amp;pid=".$content['id']."\">".PAYOUT_ACCEPT_PAYOUT."</a>&nbsp;|&nbsp;<a href=\"{!URL!}/modules.php?module=admin&amp;what=list_payouts&amp;do=reject&amp;pid=".$content['id']."\">".PAYOUT_REJECT_PAYOUT."</a>";
index fbd7ada82d83453688b2d74cd76619a6c8acfb1b..20db760383ab18ed52f28a1f82bafe33fa77e501 100644 (file)
@@ -92,7 +92,7 @@ if (EXT_IS_ACTIVE('country')) {
 // Init unset data (bad that we change $_GET here!)
 if (!REQUEST_ISSET_GET(('letter'))) { REQUEST_SET_GET('letter', getMessage('_ALL2')); }
 if (!REQUEST_ISSET_GET(('sortby'))) { REQUEST_SET_GET('sortby', 'userid');            }
-if (!REQUEST_ISSET_GET(('page')))   { REQUEST_SET_GET('page'  , "1");                 }
+if (!REQUEST_ISSET_GET('page'))   { REQUEST_SET_GET('page'  , "1");                 }
 
 // Set base URL
 $BASE = "[<a href=\"{!URL!}/modules.php?module=admin";
@@ -250,8 +250,8 @@ LIMIT 1",
        // Activate the extension please!
        $PAGES = round(SQL_NUMROWS($result_master) / getConfig('user_limit') + 0.5);
 
-       if (!REQUEST_ISSET_GET(('page')))   REQUEST_SET_GET('page'  , "1");
-       if (!REQUEST_ISSET_GET(('offset'))) REQUEST_SET_GET('offset', getConfig('user_limit'));
+       if (!REQUEST_ISSET_GET('page'))   REQUEST_SET_GET('page'  , "1");
+       if (!REQUEST_ISSET_GET('offset')) REQUEST_SET_GET('offset', getConfig('user_limit'));
 
        // Add limitation to SQL string and run him again
        $sql .= " LIMIT ".(REQUEST_GET('offset') * REQUEST_GET('page') - REQUEST_GET('offset')).", ".REQUEST_GET('offset');
index 7b90daf6fe65b494c0728ba6d4106a631ed1473d..7ece3c07a87f49d58fc386bbcc49b0fbd75c9280 100644 (file)
@@ -65,7 +65,7 @@ WHERE `status`='PENDING' AND id='%s' LIMIT 1",
 
                        if (SQL_NUMROWS($result_main) == 1) {
                                // Load data
-                               $content = SQL_FETCHROW($result_main);
+                               $content = SQL_FETCHARRAY($result_main);
 
                                // Check for open payments and close them
                                $result = SQL_QUERY_ESC("SELECT DISTINCT so.aid, so.pay_count, so.pay_ordered, so.pay_status,