From 80e2def8ef2125fd4d7d1312ee3993ab613f0846 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 11 Sep 2008 22:49:59 +0000 Subject: [PATCH] Code-style applied, surfbar URLs can now be edited --- .gitattributes | 5 +- inc/databases.php | 2 +- inc/fatal_errors.php | 4 +- inc/functions.php | 84 +++++----- inc/install-inc.php | 6 +- inc/language/de.php | 2 + inc/language/surfbar_de.php | 6 +- inc/libs/admins_functions.php | 10 +- inc/libs/cache_functions.php | 10 +- inc/libs/output_functions.php | 157 ------------------ inc/libs/rallye_functions.php | 8 +- inc/libs/register_functions.php | 2 +- inc/libs/rewrite_functions.php | 2 +- inc/libs/security_functions.php | 12 +- inc/libs/sponsor_functions.php | 14 +- inc/libs/task_functions.php | 2 +- inc/libs/user_functions.php | 2 +- inc/load_cache-admin.php | 6 +- inc/load_cache-config.php | 4 +- inc/load_cache-modreg.php | 4 +- inc/load_cache-refdepths.php | 4 +- inc/load_cache-refsystem.php | 2 +- inc/load_extensions.php | 2 +- inc/modules/admin/admin-inc.php | 94 ++++++++++- inc/modules/admin/overview-inc.php | 6 +- inc/modules/admin/what-admin_add.php | 12 +- inc/modules/admin/what-adminedit.php | 8 +- inc/modules/admin/what-admins_mails.php | 4 +- inc/modules/admin/what-config_admins.php | 8 +- inc/modules/admin/what-config_bonus.php | 2 +- inc/modules/admin/what-config_cats.php | 6 +- inc/modules/admin/what-config_email.php | 6 +- inc/modules/admin/what-config_mods.php | 4 +- inc/modules/admin/what-config_payouts.php | 8 +- inc/modules/admin/what-config_points.php | 8 +- .../admin/what-config_rallye_prices.php | 8 +- inc/modules/admin/what-config_register.php | 2 +- inc/modules/admin/what-config_rewrite.php | 2 +- inc/modules/admin/what-del_holiday.php | 2 +- inc/modules/admin/what-del_transfer.php | 2 +- inc/modules/admin/what-extensions.php | 16 +- inc/modules/admin/what-guest_add.php | 12 +- inc/modules/admin/what-guestedit.php | 12 +- inc/modules/admin/what-list_country.php | 4 +- inc/modules/admin/what-list_rallyes.php | 6 +- inc/modules/admin/what-list_sponsor.php | 2 +- inc/modules/admin/what-list_sponsor_pay.php | 6 +- inc/modules/admin/what-list_surfbar_urls.php | 13 +- inc/modules/admin/what-mem_add.php | 12 +- inc/modules/admin/what-memedit.php | 8 +- inc/modules/admin/what-overview.php | 2 +- inc/modules/admin/what-payments.php | 8 +- inc/modules/admin/what-refbanner.php | 6 +- inc/modules/admin/what-send_bonus.php | 2 +- inc/modules/admin/what-theme_check.php | 6 +- inc/modules/admin/what-theme_edit.php | 2 +- inc/modules/admin/what-unlock_emails.php | 4 +- inc/modules/admin/what-unlock_sponsor.php | 2 +- inc/modules/guest/what-register.php | 4 +- inc/modules/guest/what-sponsor_login.php | 28 ++-- inc/modules/guest/what-stats.php | 6 +- inc/modules/member/what-categories.php | 4 +- inc/modules/member/what-mydata.php | 2 +- inc/modules/member/what-order.php | 6 +- inc/modules/member/what-themes.php | 2 +- inc/mysql-manager.php | 4 +- inc/pool-update.php | 6 +- .../emails/admin/admin_del_surfbar_urls.tpl | 2 +- .../emails/admin/admin_edit_surfbar_urls.tpl | 30 ++++ .../member/member_edit_surfbar_urls.tpl | 25 +++ .../de/html/admin/admin_edit_surfbar_urls.tpl | 22 +++ .../admin/admin_edit_surfbar_urls_row.tpl | 16 ++ 72 files changed, 429 insertions(+), 383 deletions(-) delete mode 100644 inc/libs/output_functions.php create mode 100644 templates/de/emails/admin/admin_edit_surfbar_urls.tpl create mode 100644 templates/de/emails/member/member_edit_surfbar_urls.tpl create mode 100644 templates/de/html/admin/admin_edit_surfbar_urls.tpl create mode 100644 templates/de/html/admin/admin_edit_surfbar_urls_row.tpl diff --git a/.gitattributes b/.gitattributes index 2aa491be7a..e29c0e11d5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -196,7 +196,6 @@ inc/libs/newsletter_functions.php -text inc/libs/nickname_functions.php -text inc/libs/optimize_functions.php -text inc/libs/order_functions.php -text -inc/libs/output_functions.php -text inc/libs/payout_functions.php -text inc/libs/primera_functions.php -text inc/libs/rallye_functions.php -text @@ -592,6 +591,7 @@ templates/de/emails/admin/admin_autopurge_tsks.tpl -text templates/de/emails/admin/admin_autopurge_turbo.tpl -text templates/de/emails/admin/admin_autopurge_unconfirmed.tpl -text templates/de/emails/admin/admin_del_surfbar_urls.tpl -text +templates/de/emails/admin/admin_edit_surfbar_urls.tpl -text templates/de/emails/admin/admin_holiday_deactivated.tpl -text templates/de/emails/admin/admin_holiday_request.tpl -text templates/de/emails/admin/admin_holiday_unlock.tpl -text @@ -662,6 +662,7 @@ templates/de/emails/member/member_bonus.tpl -text templates/de/emails/member/member_contct.tpl -text templates/de/emails/member/member_del_surfbar_urls.tpl -text templates/de/emails/member/member_doubler.tpl -text +templates/de/emails/member/member_edit_surfbar_urls.tpl -text templates/de/emails/member/member_holiday_activated.tpl -text templates/de/emails/member/member_holiday_removed.tpl -text templates/de/emails/member/member_holiday_request.tpl -text @@ -859,6 +860,8 @@ templates/de/html/admin/admin_edit_rallyes_row.tpl -text templates/de/html/admin/admin_edit_sponsor_add_points.tpl -text templates/de/html/admin/admin_edit_sponsor_edit.tpl -text templates/de/html/admin/admin_edit_sponsor_sub_points.tpl -text +templates/de/html/admin/admin_edit_surfbar_urls.tpl -text +templates/de/html/admin/admin_edit_surfbar_urls_row.tpl -text templates/de/html/admin/admin_edit_user.tpl -text templates/de/html/admin/admin_email_archiv.tpl -text templates/de/html/admin/admin_email_archiv_row.tpl -text diff --git a/inc/databases.php b/inc/databases.php index ca325b7db3..3bdc5b46c9 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -114,7 +114,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // This current patch level -define('CURR_SVN_REVISION', "302"); +define('CURR_SVN_REVISION', "303"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/fatal_errors.php b/inc/fatal_errors.php index 6bb6a0ca55..05959f4e26 100644 --- a/inc/fatal_errors.php +++ b/inc/fatal_errors.php @@ -48,7 +48,7 @@ if ((sizeof($FATAL) > 0) || (!empty($FATAL[0]))) if (isBooleanConstantAndTrue('mxchange_installing')) { // While we are installing ouput other header than while it is installed... :-) $OUT = ""; - foreach ($FATAL as $key=>$value) { + foreach ($FATAL as $key => $value) { // Prepare content for the template $content = array( 'key' => ($key + 1), @@ -64,7 +64,7 @@ if ((sizeof($FATAL) > 0) || (!empty($FATAL[0]))) } elseif (isBooleanConstantAndTrue('mxchange_installed')) { // Display all runtime fatal errors $OUT = ""; - foreach ($FATAL as $key=>$value) { + foreach ($FATAL as $key => $value) { // Prepare content for the template $content = array( 'key' => ($key + 1), diff --git a/inc/functions.php b/inc/functions.php index c73058b0a5..de2c08a4a0 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -719,7 +719,7 @@ function LOAD_EMAIL_TEMPLATE($template, $content="", $UID="0") { $DATA[10] = $UID; // Replace variables - foreach ($REPLACER as $key=>$value) + foreach ($REPLACER as $key => $value) { if (isset($DATA[$key])) $content = str_replace($value, $DATA[$key], $content); } @@ -769,7 +769,7 @@ function LOAD_EMAIL_TEMPLATE($template, $content="", $UID="0") { $MAILID = $DATA[11]; // Replace variables - foreach ($REPLACER as $key=>$value) + foreach ($REPLACER as $key => $value) { if (isset($DATA[$key])) $content = str_replace($value, $DATA[$key], $content); } @@ -865,33 +865,30 @@ function LOAD_EMAIL_TEMPLATE($template, $content="", $UID="0") { $tmpl_file = @implode("", @file($file)); $tmpl_file = addslashes($tmpl_file); - // Compile code - $tmpl_file = COMPILE_CODE($tmpl_file); - // Run code - $tmpl_file = "\$content=\"".$tmpl_file."\";"; + $tmpl_file = "\$newContent=\"".COMPILE_CODE($tmpl_file)."\";"; eval($tmpl_file); - // Replace HTML confirm chars - $content = html_entity_decode($content); + // Replace HTML conform chars + $newContent = html_entity_decode($newContent); } elseif (!empty($template)) { // Template file not found! - $content = TEMPLATE_404.": ".$template."
+ $newContent = TEMPLATE_404.": ".$template."
".TEMPLATE_CONTENT." -
".print_r($content, true)."
+
".print_r($newContent, true)."
".TEMPLATE_DATA."
".print_r($DATA, true)."


"; // Debug mode not active? Then remove the HTML tags - if (!DEBUG_MODE) $content = strip_tags($content); + if (!DEBUG_MODE) $newContent = strip_tags($newContent); } else { // No template name supplied! - $content = NO_TEMPLATE_SUPPLIED; + $newContent = NO_TEMPLATE_SUPPLIED; } // Return compiled content - return COMPILE_CODE($content); + return COMPILE_CODE($newContent); } // function MAKE_TIME($H, $M, $S, $stamp) { @@ -983,20 +980,21 @@ function COMPILE_CODE($code, $simple = false, $constants = true, $full = true) { if ((count($matches) > 0) && (count($matches[0]) > 0)) { // Replace all matches $matchesFound = array(); - foreach ($matches[0] as $key=>$match) { + foreach ($matches[0] as $key => $match) { // Avoid replacing matches multiple times if (!isset($matchesFound[$match])) { // Not yet replaced! $code = str_replace($match, "\".".$match.".\"", $code); $matchesFound[$match] = 1; - } + } // END - if // Take all string elements if (("".bigintval($matches[4][$key])."" != $matches[4][$key]) && (!isset($matchesFound[$key."_".$matches[4][$key]]))) { // Replace it in the code - $code = str_replace("[".$matches[4][$key]."]", "['".$matches[4][$key]."']", $code); + $newMatch = str_replace("[".$matches[4][$key]."]", "['".$matches[4][$key]."']", $match); + $code = str_replace($match, $newMatch, $code); $matchesFound[$key."_".$matches[4][$key]] = 1; - } + } // END - if } } @@ -1025,9 +1023,9 @@ function array_pk_sort(&$array, $a_sort, $primary_key = 0, $order = -1, $nums = $dummy = $array; while ($primary_key < count($a_sort)) { - foreach ($dummy[$a_sort[$primary_key]] as $key=>$value) + foreach ($dummy[$a_sort[$primary_key]] as $key => $value) { - foreach ($dummy[$a_sort[$primary_key]] as $key2=>$value2) + foreach ($dummy[$a_sort[$primary_key]] as $key2 => $value2) { $match = false; if (!$nums) @@ -1044,7 +1042,7 @@ function array_pk_sort(&$array, $a_sort, $primary_key = 0, $order = -1, $nums = if ($match) { // We have found two different values, so let's sort whole array - foreach ($dummy as $sort_key=>$sort_val) + foreach ($dummy as $sort_key => $sort_val) { $t = $dummy[$sort_key][$key]; $dummy[$sort_key][$key] = $dummy[$sort_key][$key2]; @@ -1092,7 +1090,7 @@ function ADD_SELECTION($type, $DEFAULT, $prefix="", $id="0") break; case "month": // Month - foreach ($MONTH_DESCR as $month=>$descr) + foreach ($MONTH_DESCR as $month => $descr) { $OUT .= "