From: Roland Häder Date: Thu, 11 Sep 2008 22:49:59 +0000 (+0000) Subject: Code-style applied, surfbar URLs can now be edited X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=80e2def8ef2125fd4d7d1312ee3993ab613f0846;p=mailer.git Code-style applied, surfbar URLs can now be edited --- 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 .= "