branched
[mailer.git] / 0.2.1 / inc / modules / member / what-points.php
diff --git a/0.2.1/inc/modules/member/what-points.php b/0.2.1/inc/modules/member/what-points.php
deleted file mode 100644 (file)
index c094e51..0000000
+++ /dev/null
@@ -1,234 +0,0 @@
-<?php
-/************************************************************************
- * MXChange v0.2.1                                    Start: 10/19/2003 *
- * ===============                              Last change: 11/12/2004 *
- *                                                                      *
- * -------------------------------------------------------------------- *
- * File              : what-points.php                                  *
- * -------------------------------------------------------------------- *
- * Short description : All your collected points...                     *
- * -------------------------------------------------------------------- *
- * Kurzbeschreibung  : Alle Ihrer gesammelten Punkte                    *
- * -------------------------------------------------------------------- *
- *                                                                      *
- * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder                           *
- * For more information visit: http://www.mxchange.org                  *
- *                                                                      *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or    *
- * (at your option) any later version.                                  *
- *                                                                      *
- * This program is distributed in the hope that it will be useful,      *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
- * GNU General Public License for more details.                         *
- *                                                                      *
- * You should have received a copy of the GNU General Public License    *
- * along with this program; if not, write to the Free Software          *
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
- * MA  02110-1301  USA                                                  *
- ************************************************************************/
-
-// Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
-       require($INC);
-}
- elseif (!IS_LOGGED_IN())
-{
-       LOAD_URL(URL."/modules.php?module=index");
-}
-
-// Add description as navigation point
-ADD_DESCR("member", basename(__FILE__));
-
-OPEN_TABLE("100%", "member_content member_content_align", "");
-$result_depths = SQL_QUERY("SELECT level, percents FROM "._MYSQL_PREFIX."_refdepths ORDER BY level", __FILE__, __LINE__);
-$depths = SQL_NUMROWS($result_depths);
-
-// Add many more rows for the login/turbo/ref/order bonus
-if (!EXT_IS_ACTIVE("bonus")) $depths += 1;
-if (GET_EXT_VERSION("bonus") >= "0.2.2") $depths += 6;
-if (GET_EXT_VERSION("bonus") >= "0.4.4") $depths += 4;
-
-// Remember row count in constant
-define('__ROWS_VALUE', ($depths*2+15));
-
-// Init some vars...
-$TPTS = "0"; $TREF = "0"; $TLOCK = "0"; $OUT = "";
-
-// Load ref levels
-while (list($lvl, $per) = SQL_FETCHROW($result_depths))
-{
-       // Initialize ref-count
-       $REFS = "0";
-
-       // Load referral points
-       $result_points = SQL_QUERY_ESC("SELECT points, locked_points FROM "._MYSQL_PREFIX."_user_points WHERE userid=%d AND ref_depth='%s' LIMIT 1", array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result_points) == 1)
-       {
-               list($POINTS, $LOCKED) = SQL_FETCHROW($result_points);
-               SQL_FREERESULT($result_points);
-               // Also count locked points
-               $TPTS += $POINTS; $TLOCK += $LOCKED;
-       }
-        else
-       {
-               $POINTS = "0.00000"; $LOCKED = "0.00000";
-       }
-
-       // Load referral counts
-       $result_refs = SQL_QUERY_ESC("SELECT counter FROM "._MYSQL_PREFIX."_refsystem WHERE userid=%d AND level='%s' LIMIT 1", array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result_refs) == 1)
-       {
-               list($REFS) = SQL_FETCHROW($result_refs);
-               SQL_FREERESULT($result_refs);
-               $TREF += $REFS;
-       }
-        else
-       {
-               $REFS = "0";
-       }
-
-       // Transfer data to array for template
-       $content = array(
-               'lvl'    => $lvl,
-               'per'    => $per,
-               'points' => TRANSLATE_COMMA($POINTS),
-               'refs'   => $REFS,
-       );
-
-       // Output row
-       $OUT .= LOAD_TEMPLATE("member_points_row", true, $content);
-}
-
-// Free memory
-SQL_FREERESULT($result_depths);
-
-// Put rows to constant for the main template
-define('__REF_LEVEL_ROWS', $OUT);
-
-$result = SQL_QUERY_ESC("SELECT used_points, ref_payout FROM "._MYSQL_PREFIX."_user_data WHERE userid=%d LIMIT 1",
- array($GLOBALS['userid']), __FILE__, __LINE__);
-list($USED, $PAY) = SQL_FETCHROW($result);
-SQL_FREERESULT($result);
-
-// Initialize variables
-$CONFIRMED = "---"; $SENT = "---"; $RECEIVED = "---";
-
-// Only user >= v0.1.2: Fetch confirmed mails counter
-if (GET_EXT_VERSION("user") >= "0.1.2")
-{
-       $ADD = "";
-       if (GET_EXT_VERSION("user") >= "0.1.4")
-       {
-               $ADD = ", emails_sent, emails_received";
-       }
-       $result = SQL_QUERY_ESC("SELECT mails_confirmed".$ADD." FROM "._MYSQL_PREFIX."_user_data WHERE userid=%d LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__);
-       list($CONFIRMED, $SENT, $RECEIVED) = SQL_FETCHROW($result);
-       SQL_FREERESULT($result);
-
-       // Please update the user extension if you see 3 dashes
-       if (empty($SENT))     $SENT     = "---";
-       if (empty($RECEIVED)) $RECEIVED = "---";
-}
- else
-{
-       // Please update!
-       $CONFIRMED = "---";
-}
-
-// If TLOCK is 0 add 3 zeros for floating
-if ($TLOCK == "0") $TLOCK = "0.00000";
-
-// Remember several values in constants
-define('__USED_VALUE' , TRANSLATE_COMMA($USED));
-define('__TPTS_VALUE' , TRANSLATE_COMMA($TPTS - $USED));
-define('__TREF_VALUE' , $TREF);
-define('__TLOCK_VALUE', TRANSLATE_COMMA($TLOCK));
-
-// Fixes a bug when there is no bonus extension installed
-if (GET_EXT_VERSION("bonus") < "0.4.4") $CONFIG['bonus_active'] = "X";
-
-// Display login bonus and turbo-click bonus
-if ((GET_EXT_VERSION("bonus") >= "0.2.2") && (EXT_IS_ACTIVE("bonus")) && ($CONFIG['bonus_active'] == "Y"))
-{
-       $ADD = ", 0, 0, 0";
-       if (GET_EXT_VERSION("bonus") >= "0.4.4") $ADD = ", bonus_ref, bonus_order, bonus_stats";
-
-       // Load data
-       $result = SQL_QUERY_ESC("SELECT login_bonus, turbo_bonus".$ADD." FROM "._MYSQL_PREFIX."_user_data WHERE userid=%d LIMIT 1",
-        array($GLOBALS['userid']), __FILE__, __LINE__);
-
-       // We don't add this points now. This will be done after each month
-       list($login, $turbo, $ref, $order, $stats) = SQL_FETCHROW($result);
-       SQL_FREERESULT($result);
-
-       // Prepare constants
-       define('__TURBO_VALUE',  TRANSLATE_COMMA($turbo));
-       define('__LOGIN_VALUE',  TRANSLATE_COMMA($login));
-
-       if (GET_EXT_VERSION("bonus") >= "0.4.4")
-       {
-               // Add referral, stats and order bonys
-               define('__REF_VALUE'  ,  TRANSLATE_COMMA($ref));
-               define('__ORDER_VALUE',  TRANSLATE_COMMA($order));
-               define('__STATS_VALUE',  TRANSLATE_COMMA($stats));
-       }
-
-       // Total bonus points
-       define('__TTOTAL_VALUE', TRANSLATE_COMMA($turbo + $login + $ref + $order + $stats));
-
-       // Output rows
-       define('__SPECIAL_ROWS', LOAD_TEMPLATE("member_points_bonus_rows", true));
-}
- elseif ($CONFIG['bonus_active'] == "N")
-{
-       // Bonus active rallye deactivated
-       define('__SPECIAL_ROWS', LOAD_TEMPLATE("member_points_bonus_disabled", true));
-}
- elseif ((IS_ADMIN()) && (GET_EXT_VERSION("bonus") < "0.2.2") && (EXT_IS_ACTIVE("bonus")))
-{
-       // Please upgrade your bonus extension to v0.2.2 or newer!
-       define('__SPECIAL_ROWS', LOAD_TEMPLATE("member_points_upgrade"));
-}
- else
-{
-       // Members shall see no special rows here
-       define('__SPECIAL_ROWS', "");
-}
-
-// Remeber values for the final template
-define('__PAY_VALUE'      , $PAY);
-define('__CONFIRMED_VALUE', $CONFIRMED);
-define('__RECEIVE_VALUE'  , $RECEIVED);
-define('__SENT_VALUE'     , $SENT);
-
-// Load final template
-if (EXT_IS_ACTIVE("user")) {
-       // Load template when required extension is there
-       LOAD_TEMPLATE("member_points");
-} elseif (IS_ADMIN()) {
-       // Missing extension
-       ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "user"));
-} else {
-       // Message for user
-       LOAD_TEMPLATE("admin_settings_saved", false, PROBLEM_POINTS_OVERVIEW_UNAVAILABLE);
-}
-
-if (EXT_IS_ACTIVE("payout"))
-{
-       // Payput extension is installed and active so we can check if the user has enougth points
-       PAYOUT_OUTPUT_PAYOUT_LIST(str_replace(",", ".", ($TPTS - $USED)));
-}
-if (EXT_IS_ACTIVE("wernis"))
-{
-       // Payput extension is installed and active so we can check if the user has enougth points
-       WERNIS_OUTPUT_WERNIS_LIST(str_replace(",", ".", ($TPTS - $USED)));
-}
-CLOSE_TABLE();
-//
-?>