X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fmember%2Fwhat-reflinks.php;h=4a88da8c96099c45b4ee9d5bee809ac65b96d2df;hb=c47144dd555bbab4acdf9085e4623900dedb0e7c;hp=2e3caa73b60cbe51ce8138468dce88a78af38776;hpb=963e55ca1ea79e255f235e359cde9f7862191dc5;p=mailer.git diff --git a/inc/modules/member/what-reflinks.php b/inc/modules/member/what-reflinks.php index 2e3caa73b6..4a88da8c96 100644 --- a/inc/modules/member/what-reflinks.php +++ b/inc/modules/member/what-reflinks.php @@ -6,9 +6,9 @@ * -------------------------------------------------------------------- * * File : what-reflinks.php * * -------------------------------------------------------------------- * - * Short description : Referral links * + * Short description : Referal links * * -------------------------------------------------------------------- * - * Kurzbeschreibung : Referral-Links * + * Kurzbeschreibung : Referal-Links * * -------------------------------------------------------------------- * * * * -------------------------------------------------------------------- * @@ -40,62 +40,52 @@ if (!defined('__SECURITY')) { } // Add description as navigation point -ADD_DESCR("member", basename(__FILE__)); - -// Load current referral clicks -$result = SQL_QUERY_ESC("SELECT ref_clicks FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1", - array($GLOBALS['userid']), __FILE__, __LINE__); +ADD_DESCR("member", __FILE__); +// Load current referal clicks +$result = SQL_QUERY_ESC("SELECT ref_clicks FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", + array($GLOBALS['userid']), __FILE__, __LINE__); list($c) = SQL_FETCHROW($result); SQL_FREERESULT($result); -OUTPUT_HTML("".YOUR_PERSONAL_REFLINK.":
-".URL."/ref.php?ref=".$GLOBALS['userid']."
+OUTPUT_HTML("
".YOUR_PERSONAL_REFLINK.":
+{!URL!}/ref.php?ref=".$GLOBALS['userid']."

"); -if (EXT_IS_ACTIVE("nickname")) -{ +if (EXT_IS_ACTIVE("nickname")) { // Add nickname link when nickname is entered $nick = NICKNAME_GET_NICK($GLOBALS['userid']); - if (!empty($nick)) - { + if (!empty($nick)) { // Display nickname link OUTPUT_HTML(NICKNAME_YOUR_REFLINK.":
-".URL."/ref.php?ref=".$nick."
+{!URL!}/ref.php?ref=".$nick."

"); - } - else - { + } else { // Display link to nickname form - OUTPUT_HTML("".NO_NICKNAME_SET."
-".PLEASE_CLICK_NICKNAME_FORM.""); + OUTPUT_HTML("
".NO_NICKNAME_SET."
+".PLEASE_CLICK_NICKNAME_FORM.""); } } // Clicks on your reflink -OUTPUT_HTML(YOUR_REFCLICKS.": ".$c." ".CLICKS."


"); -$whereStatement = " WHERE visible='Y'"; +OUTPUT_HTML(YOUR_REFCLICKS.": ".$c." ".CLICKS."


"); +$whereStatement = " WHERE `visible`='Y'"; if (IS_ADMIN()) $whereStatement = ""; -$result = SQL_QUERY("SELECT id, url, alternate, counter, clicks FROM "._MYSQL_PREFIX."_refbanner", __FILE__, __LINE__); +$result = SQL_QUERY("SELECT id, url, alternate, counter, clicks FROM `{!_MYSQL_PREFIX!}_refbanner`", __FILE__, __LINE__); -if (SQL_NUMROWS($result) > 0) -{ +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) - { + while (list($id, $url, $alt, $count, $clks) = SQL_FETCHROW($result)) { + $test = str_replace(URL, constant('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)) - { + $fp = GET_URL($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) - { + foreach ($fp as $f) { $file .= $f; } } @@ -127,6 +117,9 @@ if (SQL_NUMROWS($result) > 0) // Load final template LOAD_TEMPLATE("member_reflinks_table", false, $GLOBALS['userid']); +} else { + // No refbanner found! + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('MEMBER_NO_REFBANNER_FOUND')); } // Free result