]> git.mxchange.org Git - mailer.git/blobdiff - 0.2.1/inc/modules/member/what-reflinks.php
win32 to unix line delimiters changed
[mailer.git] / 0.2.1 / inc / modules / member / what-reflinks.php
index ecfd942e886088789ad733046a34fbe2ad721403..6b925bba1b84b51d6baed477fa03c06488550978 100644 (file)
-<?php\r
-/************************************************************************\r
- * MXChange v0.2.1                                    Start: 10/19/2003 *\r
- * ===============                              Last change: 09/10/2004 *\r
- *                                                                      *\r
- * -------------------------------------------------------------------- *\r
- * File              : what-reflinks.php                                *\r
- * -------------------------------------------------------------------- *\r
- * Short description : Referral links                                   *\r
- * -------------------------------------------------------------------- *\r
- * Kurzbeschreibung  : Referral-Links                                   *\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
-// Some security stuff...\r
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))\r
-{\r
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";\r
-       require($INC);\r
-}\r
- elseif (!IS_LOGGED_IN())\r
-{\r
-       LOAD_URL(URL."/modules.php?module=index");\r
-}\r
-\r
-// Add description as navigation point\r
-ADD_DESCR("member", basename(__FILE__));\r
-\r
-OPEN_TABLE("90%", "member_table member_content_align", "");\r
-\r
-// Load current referral clicks\r
-$result = SQL_QUERY_ESC("SELECT ref_clicks FROM "._MYSQL_PREFIX."_user_data WHERE userid=%d LIMIT 1",\r
- array($GLOBALS['userid']), __FILE__, __LINE__);\r
-\r
-list($c) = SQL_FETCHROW($result);\r
-SQL_FREERESULT($result);\r
-\r
-OUTPUT_HTML ("<FONT class=\"tiny\">".YOUR_PERSONAL_REFLINK.":<BR>\r
-<STRONG><A href=\"".URL."/ref.php?ref=".$GLOBALS['userid']."\" target=\"_blank\">".URL."/ref.php?ref=".$GLOBALS['userid']."</A></STRONG><BR>\r
-<BR>");\r
-\r
-if (EXT_IS_ACTIVE("nickname"))\r
-{\r
-       // Add nickname link when nickname is entered\r
-       $nick = NICKNAME_GET_NICK($GLOBALS['userid']);\r
-\r
-       if (!empty($nick))\r
-       {\r
-               // Display nickname link\r
-               OUTPUT_HTML (NICKNAME_YOUR_REFLINK.":<BR>\r
-<STRONG><A href=\"".URL."/ref.php?ref=".$nick."\" target=\"_blank\">".URL."/ref.php?ref=".$nick."</A></STRONG><BR>\r
-<BR>");\r
-       }\r
-        else\r
-       {\r
-               // Display link to nickname form\r
-               OUTPUT_HTML ("<STRONG class=\"guest_note\">".NO_NICKNAME_SET."</STRONG><BR>\r
-<A class=\"tiny\" href=\"".URL."/modules.php?module=login&amp;what=nickname\">".PLEASE_CLICK_NICKNAME_FORM."</A>");\r
-       }\r
-}\r
-\r
-// Clicks on your reflink\r
-OUTPUT_HTML (YOUR_REFCLICKS.": <STRONG>".$c."</STRONG> ".CLICKS."</FONT><BR><BR>");\r
-$WHERE = " WHERE visible='Y'";\r
-if (IS_ADMIN()) $WHERE = "";\r
-$result = SQL_QUERY("SELECT id, url, alternate, counter, clicks FROM "._MYSQL_PREFIX."_refbanner", __FILE__, __LINE__);\r
-\r
-if (SQL_NUMROWS($result) > 0)\r
-{\r
-       // List available ref banners\r
-       $SW = 2; $OUT = "";\r
-       while (list($id, $url, $alt, $count, $clks) = SQL_FETCHROW($result))\r
-       {\r
-               $test = str_replace(URL, PATH, $url); $size = 0;\r
-               if ($test == $url)\r
-               {\r
-                       // Download banner (I hope you keep the banner on same server???)\r
-                       $fp = @file($url); $file = "";\r
-                       if ((!empty($fp)) && (is_array($fp)) && (count($fp) > 0))\r
-                       {\r
-                               // Loads only found banner, when there is a 404 error this foreach() command\r
-                               // will cause an "Invalid argument supplied for foreach()" error\r
-                               foreach ($fp as $f)\r
-                               {\r
-                                       $file .= $f;\r
-                               }\r
-                       }\r
-                       $size = strlen($file);\r
-               }\r
-                elseif (file_exists($test))\r
-               {\r
-                       $size = filesize($test);\r
-               }\r
-               if ($size > 0) $alt .= " (".TRANSLATE_COMMA(round($size/102.4)/10)." ".KBYTES.")";\r
-\r
-               // Load banner data\r
-               $content = array(\r
-                       'sw'  => $SW,\r
-                       'url' => $url,\r
-                       'alt' => $alt,\r
-                       'cnt' => $count,\r
-                       'cks' => $clks,\r
-                       'uid' => $GLOBALS['userid'],\r
-                       'id'  => $id,\r
-               );\r
-\r
-               // Add row\r
-               $OUT .= LOAD_TEMPLATE("member_reflinks_row", true, $content);\r
-\r
-               // Switchcolors\r
-               $SW = 3 - $SW;\r
-       }\r
-\r
-       define('__REFLINKS_ROWS', $OUT);\r
-\r
-       // Load final template\r
-       LOAD_TEMPLATE("member_reflinks_table", false, $GLOBALS['userid']);\r
-}\r
-\r
-// Free result\r
-SQL_FREERESULT($result);\r
-\r
-CLOSE_TABLE();\r
-//\r
-?>\r
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 10/19/2003 *
+ * ===============                              Last change: 09/10/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-reflinks.php                                *
+ * -------------------------------------------------------------------- *
+ * Short description : Referral links                                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Referral-Links                                   *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * 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("90%", "member_table member_content_align", "");
+
+// Load current referral clicks
+$result = SQL_QUERY_ESC("SELECT ref_clicks FROM "._MYSQL_PREFIX."_user_data WHERE userid=%d LIMIT 1",
+ array($GLOBALS['userid']), __FILE__, __LINE__);
+
+list($c) = SQL_FETCHROW($result);
+SQL_FREERESULT($result);
+
+OUTPUT_HTML ("<FONT class=\"tiny\">".YOUR_PERSONAL_REFLINK.":<BR>
+<STRONG><A href=\"".URL."/ref.php?ref=".$GLOBALS['userid']."\" target=\"_blank\">".URL."/ref.php?ref=".$GLOBALS['userid']."</A></STRONG><BR>
+<BR>");
+
+if (EXT_IS_ACTIVE("nickname"))
+{
+       // Add nickname link when nickname is entered
+       $nick = NICKNAME_GET_NICK($GLOBALS['userid']);
+
+       if (!empty($nick))
+       {
+               // Display nickname link
+               OUTPUT_HTML (NICKNAME_YOUR_REFLINK.":<BR>
+<STRONG><A href=\"".URL."/ref.php?ref=".$nick."\" target=\"_blank\">".URL."/ref.php?ref=".$nick."</A></STRONG><BR>
+<BR>");
+       }
+        else
+       {
+               // Display link to nickname form
+               OUTPUT_HTML ("<STRONG class=\"guest_note\">".NO_NICKNAME_SET."</STRONG><BR>
+<A class=\"tiny\" href=\"".URL."/modules.php?module=login&amp;what=nickname\">".PLEASE_CLICK_NICKNAME_FORM."</A>");
+       }
+}
+
+// Clicks on your reflink
+OUTPUT_HTML (YOUR_REFCLICKS.": <STRONG>".$c."</STRONG> ".CLICKS."</FONT><BR><BR>");
+$WHERE = " WHERE visible='Y'";
+if (IS_ADMIN()) $WHERE = "";
+$result = SQL_QUERY("SELECT id, url, alternate, counter, clicks FROM "._MYSQL_PREFIX."_refbanner", __FILE__, __LINE__);
+
+if (SQL_NUMROWS($result) > 0)
+{
+       // List available ref banners
+       $SW = 2; $OUT = "";
+       while (list($id, $url, $alt, $count, $clks) = SQL_FETCHROW($result))
+       {
+               $test = str_replace(URL, PATH, $url); $size = 0;
+               if ($test == $url)
+               {
+                       // Download banner (I hope you keep the banner on same server???)
+                       $fp = @file($url); $file = "";
+                       if ((!empty($fp)) && (is_array($fp)) && (count($fp) > 0))
+                       {
+                               // Loads only found banner, when there is a 404 error this foreach() command
+                               // will cause an "Invalid argument supplied for foreach()" error
+                               foreach ($fp as $f)
+                               {
+                                       $file .= $f;
+                               }
+                       }
+                       $size = strlen($file);
+               }
+                elseif (file_exists($test))
+               {
+                       $size = filesize($test);
+               }
+               if ($size > 0) $alt .= " (".TRANSLATE_COMMA(round($size/102.4)/10)." ".KBYTES.")";
+
+               // Load banner data
+               $content = array(
+                       'sw'  => $SW,
+                       'url' => $url,
+                       'alt' => $alt,
+                       'cnt' => $count,
+                       'cks' => $clks,
+                       'uid' => $GLOBALS['userid'],
+                       'id'  => $id,
+               );
+
+               // Add row
+               $OUT .= LOAD_TEMPLATE("member_reflinks_row", true, $content);
+
+               // Switchcolors
+               $SW = 3 - $SW;
+       }
+
+       define('__REFLINKS_ROWS', $OUT);
+
+       // Load final template
+       LOAD_TEMPLATE("member_reflinks_table", false, $GLOBALS['userid']);
+}
+
+// Free result
+SQL_FREERESULT($result);
+
+CLOSE_TABLE();
+//
+?>