]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/rallye_functions.php
* Member template added for the surfbar which notifies the user that the URL is
[mailer.git] / inc / libs / rallye_functions.php
index e67677e419cd6082706fbbc28e779f21cbe559a2..2a4f228c1f6c8e919f7eee267f893dbfb81b76c8 100644 (file)
@@ -135,20 +135,12 @@ VALUES ('%s', '%s', '%s', '%s')",
                }
        }
 
-       // Send email to admin
+       // Choose the right admin template
        $templ = "admin_rallye_no_notify";
        if ($notify == "Y") $templ = "admin_rallye_notify";
-       if (GET_EXT_VERSION("admins") < "0.4.1")
-       {
-               // Use old method to send out
-               $msg = LOAD_EMAIL_TEMPLATE($templ, $prices, 0);
-               SEND_ADMIN_EMAILS(RALLYE_ADMIN_NOTIFY.$title, $msg);
-       }
-        else
-       {
-               // Use new system to send out
-               SEND_ADMIN_EMAILS_PRO(RALLYE_ADMIN_NOTIFY.$title, $templ, $prices, "0");
-       }
+
+       // Send email to admin
+       SEND_ADMIN_NOTIFICATION(RALLYE_ADMIN_NOTIFY.$title, $templ, $prices, "0");
 
        // Free memory
        SQL_FREERESULT($result_user);
@@ -473,17 +465,7 @@ LIMIT 1", array(bigintval($uid), $since), __FILE__, __LINE__);
        }
 
        // Send mail to admin
-       if (GET_EXT_VERSION("admins") < "0.4.1")
-       {
-               // Use old method to send out
-               $msg = LOAD_EMAIL_TEMPLATE($templ, $cnt, 0);
-               SEND_ADMIN_EMAILS(RALLYE_ADMIN_EXPIRED.": ".$title, $msg);
-       }
-        else
-       {
-               // Use new system to send out
-               SEND_ADMIN_EMAILS_PRO(RALLYE_ADMIN_EXPIRED.": ".$title, $templ, $cnt, 0);
-       }
+       SEND_ADMIN_NOTIFICATION(RALLYE_ADMIN_EXPIRED.": ".$title, $templ, $cnt, 0);
 
        // Add task
        $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_task_system (status, task_type, subject, text, task_created)
@@ -691,17 +673,7 @@ function RALLYE_DELETE_EXPIRED_RALLYES()
                        $DATA['now_t']  = MAKE_DATETIME(time(), "1");
 
                        // Send mail to admin
-                       if (GET_EXT_VERSION("admins") < "0.4.1")
-                       {
-                               // Use old method to send out
-                               $msg = LOAD_EMAIL_TEMPLATE("admin_rallye_purged", "", 0);
-                               SEND_ADMIN_EMAILS(RALLYE_ADMIN_PURGED.": ".$title, $msg);
-                       }
-                        else
-                       {
-                               // Use new system to send out
-                               SEND_ADMIN_EMAILS_PRO(RALLYE_ADMIN_PURGED.": ".$title, "admin_rallye_purged", "", 0);
-                       }
+                       SEND_ADMIN_NOTIFICATION(RALLYE_ADMIN_PURGED.": ".$title, "admin_rallye_purged", "", 0);
 
                        // Purge whole rallye
                        $result_purge = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_rallye_data WHERE id=%d LIMIT 1",
@@ -770,22 +742,22 @@ function RALLYE_TEMPLATE_SELECTION($name="template", $default="")
 //
 function RALLYE_GET_REFCOUNT($uid, $old=0)
 {
-       global $REF_SYSTEM, $REF_DEPTHS, $_CONFIG;
+       global $_CONFIG;
        // Check current refs
        if (GET_EXT_VERSION("cache") >= "0.1.2")
        {
                // Get refs from cache
                $cnt = 0;
-               foreach ($REF_SYSTEM['userid'] as $id=>$u_id)
+               foreach ($cacheArray['ref_system']['userid'] as $id=>$u_id)
                {
-                       if (($u_id == $uid) && ($REF_SYSTEM['level'][$id] == 0))
+                       if (($u_id == $uid) && ($cacheArray['ref_system']['level'][$id] == 0))
                        {
-                               foreach ($REF_DEPTHS['level'] as $level)
+                               foreach ($cacheArray['ref_depths']['level'] as $level)
                                {
-                                       if (($level == $REF_SYSTEM['level'][$id]) && ($level == 0))
+                                       if (($level == $cacheArray['ref_system']['level'][$id]) && ($level == 0))
                                        {
                                                // Level does exist so abort here
-                                               $cnt = $REF_SYSTEM['counter'][$id];
+                                               $cnt = $cacheArray['ref_system']['counter'][$id];
                                                //* DEBUG: */ echo "*".$uid."/".$cnt."*<br />";
                                                break;
                                        }
@@ -800,7 +772,7 @@ function RALLYE_GET_REFCOUNT($uid, $old=0)
                        }
                }
                //* DEBUG: */ echo "<PRE>";
-               //* DEBUG: */ print_r($REF_SYSTEM);
+               //* DEBUG: */ print_r($cacheArray['ref_system']);
                //* DEBUG: */ echo "</PRE>";
                //* DEBUG: */ die();