From: Roland Häder Date: Mon, 16 Mar 2009 18:58:38 +0000 (+0000) Subject: Double brackets removed, some fixes X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5d9f65a4efafdeda1f03cf03fc95421bc600b9dc;p=mailer.git Double brackets removed, some fixes --- diff --git a/inc/functions.php b/inc/functions.php index e5a3be66f8..025f936e7d 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -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 .= "-"; } 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 .= "-"; } else { diff --git a/inc/install-inc.php b/inc/install-inc.php index eea5429972..017c6faf35 100644 --- a/inc/install-inc.php +++ b/inc/install-inc.php @@ -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 diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php index adeb3001ff..21b7e00f7a 100644 --- a/inc/libs/user_functions.php +++ b/inc/libs/user_functions.php @@ -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 = "&page=".REQUEST_GET(('page'))."&offset=".REQUEST_GET(('offset')); + if (!REQUEST_ISSET_GET('offset')) REQUEST_SET_GET('offset', 0); + $add = "&page=".REQUEST_GET('page')."&offset=".REQUEST_GET('offset'); if (REQUEST_ISSET_GET(('mode'))) $add .= "&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 = "&page=".REQUEST_GET(('page'))."&offset=".REQUEST_GET(('offset')); + $add = "&page=".REQUEST_GET('page')."&offset=".REQUEST_GET('offset'); // Add status or mode if (REQUEST_ISSET_GET(('status'))) $add .= "&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 .= "-"; } 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 .= "-"; } else { $OUT .= ""; diff --git a/inc/modules/admin/what-add_points.php b/inc/modules/admin/what-add_points.php index d6936169e8..fb85e0ec97 100644 --- a/inc/modules/admin/what-add_points.php +++ b/inc/modules/admin/what-add_points.php @@ -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... diff --git a/inc/modules/admin/what-admin_add.php b/inc/modules/admin/what-admin_add.php index 3b92526c35..79dcaae432 100644 --- a/inc/modules/admin/what-admin_add.php +++ b/inc/modules/admin/what-admin_add.php @@ -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']; diff --git a/inc/modules/admin/what-email_archiv.php b/inc/modules/admin/what-email_archiv.php index 3e9cf6770b..a095f2310a 100644 --- a/inc/modules/admin/what-email_archiv.php +++ b/inc/modules/admin/what-email_archiv.php @@ -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 = "".$unconfirmed.""; } @@ -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')); } + // ?> diff --git a/inc/modules/admin/what-list_notifications.php b/inc/modules/admin/what-list_notifications.php index 80d14ee9bc..fbc84bf289 100644 --- a/inc/modules/admin/what-list_notifications.php +++ b/inc/modules/admin/what-list_notifications.php @@ -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 diff --git a/inc/modules/admin/what-list_payouts.php b/inc/modules/admin/what-list_payouts.php index 03cb3d3457..d0e56e9ed2 100644 --- a/inc/modules/admin/what-list_payouts.php +++ b/inc/modules/admin/what-list_payouts.php @@ -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'] = "".PAYOUT_ACCEPT_PAYOUT." | ".PAYOUT_REJECT_PAYOUT.""; diff --git a/inc/modules/admin/what-list_user.php b/inc/modules/admin/what-list_user.php index fbd7ada82d..20db760383 100644 --- a/inc/modules/admin/what-list_user.php +++ b/inc/modules/admin/what-list_user.php @@ -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 = "[