Some missing brackes added, sponsor guest modules now depends on extension
[mailer.git] / inc / modules / guest / what-sponsor_infos.php
index 886cbcc965dc1acdb5207a994afa89ffd08d669c..39cf47fe7ea9c0158da1e5ddaee4a35bfccea267 100644 (file)
 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
@@ -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,
@@ -92,17 +95,13 @@ if ($num_act > 0)
                        $OUT_PAY .= LOAD_TEMPLATE("guest_sponsor_pay_row", true, $content);
                        $SW = 3 - $SW;
                }
-       }
-        else
-       {
+       } else {
                // No pay types setuped so far!
                $OUT_PAY = "<TR><TD colspan=\"2\">
   ".LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_NO_ACTIONS_ACTIVATED)."
 </TD></TR>";
        }
-}
- else
-{
+} else {
        // No actions activated so far!
        $OUT_ACT = "<TR><TD colspan=\"2\" class=\"bottom2\" style=\"padding-top: 10px; padding-bottom: 10px\">
   ".LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_NO_ACTIONS_ACTIVATED)."