X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-sponsor_infos.php;h=39cf47fe7ea9c0158da1e5ddaee4a35bfccea267;hb=54e76b6d9565fda3c0ecec664f8487b945c7e937;hp=7e0f927854210b40610960d95463890275755a23;hpb=dbe56bb043ba16ca1ec1e9efa9effdc1f0612261;p=mailer.git diff --git a/inc/modules/guest/what-sponsor_infos.php b/inc/modules/guest/what-sponsor_infos.php index 7e0f927854..39cf47fe7e 100644 --- a/inc/modules/guest/what-sponsor_infos.php +++ b/inc/modules/guest/what-sponsor_infos.php @@ -34,10 +34,17 @@ if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); +} elseif ((!EXT_IS_ACTIVE("sponsor"))) { + if (IS_ADMIN()) { + ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "sponsor")); + } else { + ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "sponsor"); + } + return; } // Add description as navigation point -ADD_DESCR("guest", basename(__FILE__)); +ADD_DESCR("guest", __FILE__); // Remove result_act unset($result_act); @@ -51,12 +58,10 @@ WHERE m.action='actions' AND r.is_active='Y' ORDER BY m.sort ASC", __FILE__, __LINE__); $num_act = SQL_NUMROWS($result_act); -if ($num_act > 0) -{ +if ($num_act > 0) { // Load all actions $OUT_ACT = ""; $SW = 2; - while (list($title, $conv, $name) = SQL_FETCHROW($result_act)) - { + while (list($title, $conv, $name) = SQL_FETCHROW($result_act)) { // Prepare data for the row template $content = array( 'sw' => $SW, @@ -68,16 +73,14 @@ if ($num_act > 0) // Load row template and switch color $OUT_ACT .= LOAD_TEMPLATE("guest_sponsor_act_row", true, $content); $SW = 3 - $SW; - } + } // END - while // Check for pay types $result_pay = SQL_QUERY("SELECT pay_name, pay_rate, pay_min_count, pay_currency FROM "._MYSQL_PREFIX."_sponsor_paytypes ORDER BY pay_name", __FILE__, __LINE__); - if (SQL_NUMROWS($result_pay) > 0) - { + if (SQL_NUMROWS($result_pay) > 0) { // Load all pay types $OUT_PAY = ""; $SW = 2; - while (list($name, $rate, $min, $curr) = SQL_FETCHROW($result_pay)) - { + while (list($name, $rate, $min, $curr) = SQL_FETCHROW($result_pay)) { // Prepare data for the row template $content = array( 'sw' => $SW, @@ -85,30 +88,20 @@ if ($num_act > 0) 'rate' => TRANSLATE_COMMA($rate), 'min' => $min, 'curr' => $curr, - 'price' => $min, + 'price' => TRANSLATE_COMMA($min), ); - if (!ereg(",", $content['price'])) - { - // Add missing zeros - $content['price'] .= ",".str_repeat("0", $_CONFIG['max_comma']); - } - // Load row template and switch color $OUT_PAY .= LOAD_TEMPLATE("guest_sponsor_pay_row", true, $content); $SW = 3 - $SW; } - } - else - { + } else { // No pay types setuped so far! $OUT_PAY = " ".LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_NO_ACTIONS_ACTIVATED)." "; } -} - else -{ +} else { // No actions activated so far! $OUT_ACT = " ".LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_NO_ACTIONS_ACTIVATED)."