]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/guest/what-rallyes.php
Heacy rewrite/cleanup:
[mailer.git] / inc / modules / guest / what-rallyes.php
index 43afabe64ddebad8cc450c4595834e51f45a3a64..d9dacfb81ad294412d04df6f39034002e753a210 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -55,7 +55,7 @@ outputHtml('<div align="center">');
 $ADD = " AND `d`.`is_active`='Y'";
 if (isAdmin()) $ADD = '';
 
-$result = SQL_QUERY("SELECT
+$result = sqlQuery("SELECT
        `d`.`id`,
        `d`.`admin_id`,
        `a`.`login`,
@@ -79,9 +79,9 @@ ORDER BY
        `d`.`end_time` ASC
 LIMIT 1", __FILE__, __LINE__);
 
-if (SQL_NUMROWS($result) == 1) {
+if (sqlNumRows($result) == 1) {
        // Found some (normally one...
-       $content = SQL_FETCHARRAY($result);
+       $content = sqlFetchArray($result);
 
        $expired = FALSE;
        if (($content['end_time'] < time()) && (getTotalConfirmedUser() >= $content['min_users']) && (getTotalRallyeWinners($content['id']) >= $content['min_prices'])) {
@@ -101,19 +101,13 @@ if (SQL_NUMROWS($result) == 1) {
        // Handle description...
        if ((empty($content['descr'])) && (!empty($content['template']))) {
                // Use description from template
-               $content['descr'] = loadTemplate('rallye_' . $content['template'], TRUE);
+               $content['descr'] = '{%template,LoadTemplate=rallye_' . $content['template'] . '%}';
        } // END - if
 
        // Set start and end time
        $content['start_time'] = generateDateTime($content['start_time'], 1);
        $content['end_time']   = generateDateTime($content['end_time']  , 1);
 
-       // Determine min_users
-       $content['min_users'] = determineReferralRallyeMinimumUsers($content['min_users']);
-
-       // Determine min prices (now in function)
-       $content['min_prices'] = determineReferralRallyeMinimumPrices($content['min_prices']);
-
        if ($expired === TRUE) {
                $content['prices']       = addReferralRallyeWinners('guest', $content['id']);
                $content['top_users']    = '<div align="center" class="big">' . $content['extras'] . '</div>';