]> git.mxchange.org Git - mailer.git/blobdiff - 0.2.1/show_bonus.php
win32 to unix line delimiters changed
[mailer.git] / 0.2.1 / show_bonus.php
index ebf4acd774e3dd32a244a7bb1ffaeee25a036d88..7e83f9b096f05262f7d724fabc37ba1629198e94 100644 (file)
-<?php\r
-/************************************************************************\r
- * MXChange v0.2.1                                    Start: 11/13/2004 *\r
- * ===============                              Last change: 11/14/2004 *\r
- *                                                                      *\r
- * -------------------------------------------------------------------- *\r
- * File              : show_bonus.php                                   *\r
- * -------------------------------------------------------------------- *\r
- * Short description : Show ranking list for turbo-bonus                *\r
- * -------------------------------------------------------------------- *\r
- * Kurzbeschreibung  : Rankliste fuer Turbo-Bonus anzeigen              *\r
- * -------------------------------------------------------------------- *\r
- *                                                                      *\r
- * -------------------------------------------------------------------- *\r
- * Copyright (c) 2003 - 2008 by Roland Haeder                           *\r
- * For more information visit: http://www.mxchange.org                  *\r
- *                                                                      *\r
- * This program is free software; you can redistribute it and/or modify *\r
- * it under the terms of the GNU General Public License as published by *\r
- * the Free Software Foundation; either version 2 of the License, or    *\r
- * (at your option) any later version.                                  *\r
- *                                                                      *\r
- * This program is distributed in the hope that it will be useful,      *\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of       *\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *\r
- * GNU General Public License for more details.                         *\r
- *                                                                      *\r
- * You should have received a copy of the GNU General Public License    *\r
- * along with this program; if not, write to the Free Software          *\r
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *\r
- * MA  02110-1301  USA                                                  *\r
- ************************************************************************/\r
-\r
-// Load security stuff here (Oh, I hope this is not unsecure? Am I paranoia??? ;-) )\r
-require_once("inc/libs/security_functions.php");\r
-\r
-// Init "action" and "what"\r
-global $what, $action;\r
-$GLOBALS['what'] = ""; $GLOBALS['action'] = "";\r
-if (!empty($_GET['action'])) $GLOBALS['action'] = secureString($_GET['action']);\r
-if (!empty($_GET['what'])) $GLOBALS['what'] = secureString($_GET['what']);\r
-\r
-// Set this because we have no module in URI\r
-$GLOBALS['module'] = "show_bonus"; $CSS = 0;\r
-\r
-// Load the required file(s)\r
-require ("inc/config.php");\r
-\r
-// List only rankings when script is installed\r
-if (defined('mxchange_installed') && (mxchange_installed))\r
-{\r
-       // Include header\r
-       include(PATH."inc/header.php");\r
-\r
-       if (($_GET['uid'] > 0) && ($_GET['d'] > 0) && (!empty($_GET['t'])))\r
-       {\r
-               // Set row name\r
-               $t = "";\r
-               switch ($_GET['t'])\r
-               {\r
-               case "bonusid":\r
-                       $t = "bonus_id";\r
-                       break;\r
-\r
-               case "mailid":\r
-                       $t = "mail_id";\r
-                       break;\r
-               }\r
-               if (!empty($t))\r
-               {\r
-                       // Check for data\r
-                       $result = SQL_QUERY_ESC("SELECT DISTINCT d.sex, d.surname, d.family, b.level, b.points\r
-FROM "._MYSQL_PREFIX."_user_data AS d\r
-RIGHT JOIN "._MYSQL_PREFIX."_bonus_turbo AS b\r
-ON d.userid=b.userid\r
-WHERE d.status='CONFIRMED' AND d.userid=%d AND b.".$t."='%s' LIMIT 1",\r
- array(bigintval($_GET['uid']), bigintval($_GET['d'])), __FILE__, __LINE__);\r
-                       if (SQL_NUMROWS($result) == 1)\r
-                       {\r
-                               // Load data\r
-                               list($sex, $sname, $fname, $level, $points) = SQL_FETCHROW($result);\r
-\r
-                               // Prepare constants for the pre-template\r
-                               define('__SALUT'    , TRANSLATE_SEX($sex));\r
-                               define('__SNAME'    , $sname);\r
-                               define('__FNAME'    , $fname);\r
-                               define('__RANK'     , $level);\r
-                               define('__POINTS'   , $points);\r
-                               define('__MAILID'   , $_GET['d']);\r
-                               define('__RANK_ROWS', BONUS_MAKE_RANK_ROWS(bigintval($_GET['d']), $t, bigintval($_GET['uid'])));\r
-\r
-                               // Constant created within previous function which contains informations for current user's ranking position:\r
-                               //   __YOUR_RANKING_LINE\r
-\r
-                               // Load pre-template\r
-                               define('__BONUS_MSG', LOAD_TEMPLATE("show_bonus_msg", true));\r
-                       }\r
-                        else\r
-                       {\r
-                               // No data found\r
-                               define('__BONUS_MSG', "<FONT class=\"guest_failed\">".BONUS_SHOW_NO_DATA."</FONT>");\r
-                       }\r
-\r
-                       // Free memory\r
-                       SQL_FREERESULT($result);\r
-               }\r
-                else\r
-               {\r
-                       // Wrong type entered\r
-                       define('__BONUS_MSG', "<FONT class=\"guest_failed\">".BONUS_SHOW_WRONG_TYPE."</FONT>");\r
-               }\r
-       }\r
-        else\r
-       {\r
-               // Wrong call!\r
-               define('__BONUS_MSG', "<FONT class=\"guest_failed\">".BONUS_SHOW_WRONG_CALL."</FONT>");\r
-       }\r
-\r
-       // Load send_bonus header template (for your banners, e.g.?)\r
-       define('__BONUS_HEADER', LOAD_TEMPLATE("show_bonus_header", true));\r
-\r
-       // Load show_bonus footer template (for your banners, e.g.?)\r
-       define('__BONUS_FOOTER', LOAD_TEMPLATE("show_bonus_footer", true));\r
-\r
-       // Total ranks who can win\r
-       define('__BONUS_TOTAL_RANKS', $CONFIG['bonus_ranks']);\r
-\r
-       // Load final template\r
-       LOAD_TEMPLATE("show_bonus");\r
-\r
-       // Include footer\r
-       include(PATH."inc/footer.php");\r
-}\r
- else\r
-{\r
-       // You have to configure first!\r
-       LOAD_URL(URL."/install.php");\r
-}\r
-// Really all done here... ;-)\r
-?>\r
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/13/2004 *
+ * ===============                              Last change: 11/14/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : show_bonus.php                                   *
+ * -------------------------------------------------------------------- *
+ * Short description : Show ranking list for turbo-bonus                *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Rankliste fuer Turbo-Bonus anzeigen              *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * 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                                                  *
+ ************************************************************************/
+
+// Load security stuff here (Oh, I hope this is not unsecure? Am I paranoia??? ;-) )
+require_once("inc/libs/security_functions.php");
+
+// Init "action" and "what"
+global $what, $action;
+$GLOBALS['what'] = ""; $GLOBALS['action'] = "";
+if (!empty($_GET['action'])) $GLOBALS['action'] = secureString($_GET['action']);
+if (!empty($_GET['what'])) $GLOBALS['what'] = secureString($_GET['what']);
+
+// Set this because we have no module in URI
+$GLOBALS['module'] = "show_bonus"; $CSS = 0;
+
+// Load the required file(s)
+require ("inc/config.php");
+
+// List only rankings when script is installed
+if (defined('mxchange_installed') && (mxchange_installed))
+{
+       // Include header
+       include(PATH."inc/header.php");
+
+       if (($_GET['uid'] > 0) && ($_GET['d'] > 0) && (!empty($_GET['t'])))
+       {
+               // Set row name
+               $t = "";
+               switch ($_GET['t'])
+               {
+               case "bonusid":
+                       $t = "bonus_id";
+                       break;
+
+               case "mailid":
+                       $t = "mail_id";
+                       break;
+               }
+               if (!empty($t))
+               {
+                       // Check for data
+                       $result = SQL_QUERY_ESC("SELECT DISTINCT d.sex, d.surname, d.family, b.level, b.points
+FROM "._MYSQL_PREFIX."_user_data AS d
+RIGHT JOIN "._MYSQL_PREFIX."_bonus_turbo AS b
+ON d.userid=b.userid
+WHERE d.status='CONFIRMED' AND d.userid=%d AND b.".$t."='%s' LIMIT 1",
+ array(bigintval($_GET['uid']), bigintval($_GET['d'])), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result) == 1)
+                       {
+                               // Load data
+                               list($sex, $sname, $fname, $level, $points) = SQL_FETCHROW($result);
+
+                               // Prepare constants for the pre-template
+                               define('__SALUT'    , TRANSLATE_SEX($sex));
+                               define('__SNAME'    , $sname);
+                               define('__FNAME'    , $fname);
+                               define('__RANK'     , $level);
+                               define('__POINTS'   , $points);
+                               define('__MAILID'   , $_GET['d']);
+                               define('__RANK_ROWS', BONUS_MAKE_RANK_ROWS(bigintval($_GET['d']), $t, bigintval($_GET['uid'])));
+
+                               // Constant created within previous function which contains informations for current user's ranking position:
+                               //   __YOUR_RANKING_LINE
+
+                               // Load pre-template
+                               define('__BONUS_MSG', LOAD_TEMPLATE("show_bonus_msg", true));
+                       }
+                        else
+                       {
+                               // No data found
+                               define('__BONUS_MSG', "<FONT class=\"guest_failed\">".BONUS_SHOW_NO_DATA."</FONT>");
+                       }
+
+                       // Free memory
+                       SQL_FREERESULT($result);
+               }
+                else
+               {
+                       // Wrong type entered
+                       define('__BONUS_MSG', "<FONT class=\"guest_failed\">".BONUS_SHOW_WRONG_TYPE."</FONT>");
+               }
+       }
+        else
+       {
+               // Wrong call!
+               define('__BONUS_MSG', "<FONT class=\"guest_failed\">".BONUS_SHOW_WRONG_CALL."</FONT>");
+       }
+
+       // Load send_bonus header template (for your banners, e.g.?)
+       define('__BONUS_HEADER', LOAD_TEMPLATE("show_bonus_header", true));
+
+       // Load show_bonus footer template (for your banners, e.g.?)
+       define('__BONUS_FOOTER', LOAD_TEMPLATE("show_bonus_footer", true));
+
+       // Total ranks who can win
+       define('__BONUS_TOTAL_RANKS', $CONFIG['bonus_ranks']);
+
+       // Load final template
+       LOAD_TEMPLATE("show_bonus");
+
+       // Include footer
+       include(PATH."inc/footer.php");
+}
+ else
+{
+       // You have to configure first!
+       LOAD_URL(URL."/install.php");
+}
+// Really all done here... ;-)
+?>