]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/order.php
Surfbar text updated, more masks applied, footer/timing removed in frametester module
[mailer.git] / inc / modules / order.php
index f64f69be1d55430c86af0f5198e4f19a31d4ae0b..e51354e30e89598b5f833d2e416755d06795bd7f 100644 (file)
 
 // Some security stuff...
 $URL = "";
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
+if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
-}
- elseif ((!EXT_IS_ACTIVE("order")) && (!IS_ADMIN()))
-{
+} elseif ((!EXT_IS_ACTIVE("order")) && (!IS_ADMIN())) {
        ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "order");
        return;
-}
- elseif (!IS_LOGGED_IN())
-{
+} elseif (!IS_LOGGED_IN()) {
        // Sorry, no guest access!
        $URL = URL."/modules.php?module=index";
-}
- elseif (empty($_GET['order']))
-{
+} elseif (empty($_GET['order'])) {
        // You cannot call this module directly!
        $URL = URL."/modules.php?module=login&what=order";
 }
 
 // When URL is empty nothing bad happend here
-if (empty($URL))
-{
+if (empty($URL)) {
        // Is the auto-send mechanism active or inactive?
-       if ($_CONFIG['autosend_active'] == "Y")
-       {
+       if ($_CONFIG['autosend_active'] == "Y") {
                // Auto-send is active
                define('ADMIN_AUTOSEND',  COMPILE_CODE(ADMIN_AUTOSEND_ACTIVE));
                define('MEMBER_AUTOSEND', COMPILE_CODE(MEMBER_AUTOSEND_ACTIVE));
                $type = "NEW";
-       }
-        else
-       {
+       } else {
                // Auto-send is inactive
                define('ADMIN_AUTOSEND',  COMPILE_CODE(ADMIN_AUTOSEND_INACTIVE));
                define('MEMBER_AUTOSEND', COMPILE_CODE(MEMBER_AUTOSEND_INACTIVE));
@@ -78,8 +67,7 @@ if (empty($URL))
         array($type, bigintval($_GET['order']), $GLOBALS['userid']), __FILE__, __LINE__);
 
        // Finally is the entry valid?
-       if (SQL_AFFECTEDROWS($link) == 1)
-       {
+       if (SQL_AFFECTEDROWS($link) == 1) {
                // Update his login data
                UPDATE_LOGIN_DATA();
 
@@ -101,13 +89,12 @@ if (empty($URL))
 
                // Update used points
                $ADD = "";
-               if ($_CONFIG['order_max'] == "ORDER") $ADD = ", mail_orders=mail_orders+1";
+               if ($_CONFIG['order_max_full'] == "ORDER") $ADD = ", mail_orders=mail_orders+1";
                $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET used_points=used_points+%s".$ADD." WHERE userid=%d LIMIT 1",
                 array($USED, $GLOBALS['userid']), __FILE__, __LINE__);
 
                // Update mediadata as well
-               if (GET_EXT_VERSION("mediadata") >= "0.0.4")
-               {
+               if (GET_EXT_VERSION("mediadata") >= "0.0.4") {
                        // Update database
                        MEDIA_UPDATE_ENTRY(array("total_points"), "sub", $USED);
                }
@@ -117,28 +104,21 @@ if (empty($URL))
                SEND_EMAIL($email, MEMBER_NEW_QUEUE, $msg_mem);
 
                // Notify admins about this
-               if (GET_EXT_VERSION("admins") >= "0.4.1")
-               {
+               if (GET_EXT_VERSION("admins") >= "0.4.1") {
                        SEND_ADMIN_EMAILS_PRO(ADMIN_NEW_QUEUE, "order-admin", "", $GLOBALS['userid']);
-               }
-                else
-               {
+               } else {
                        $msg_admin = LOAD_EMAIL_TEMPLATE("order-admin", "", $GLOBALS['userid']);
                        SEND_ADMIN_EMAILS(ADMIN_NEW_QUEUE, $msg_admin);
                }
 
                // Output back bottom
                LOAD_TEMPLATE("member_order-back", false);
-       }
-        else
-       {
+       } else {
                // Matching line not found or already "placed" in send queue
                $URL = URL."/modules.php?module=login";
                LOAD_URL($URL);
        }
-}
- else
-{
+} else {
        // Redirect...
        LOAD_URL($URL);
 }