X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fmember%2Fwhat-beg.php;h=624d1483d4ca1f1afca182cb3eefba33cad5545b;hb=a74cbdf4f8838f216ebb1a201943575177ffe9a5;hp=8e0ca1077e9b57f7ab425c159d73605b6ef72f06;hpb=e2148142f8b1a8f40fd6e7ca32185569c5a9083e;p=mailer.git diff --git a/inc/modules/member/what-beg.php b/inc/modules/member/what-beg.php index 8e0ca1077e..624d1483d4 100644 --- a/inc/modules/member/what-beg.php +++ b/inc/modules/member/what-beg.php @@ -18,6 +18,7 @@ * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * + * Copyright (c) 2009, 2010 by Mailer Developer Team * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -51,45 +52,20 @@ if ((!isExtensionActive('beg')) && (!isAdmin())) { return; } // END - if -// Get userid -$userid = getMemberId(); - -if (isExtensionActive('nickname')) { - // Load nickname - $data = 'nickname'; +// Prepare constants +// @TODO Can't this be moved into EL? +if ((isExtensionActive('nickname')) && (getUserData('nickname') != '')) { + // Get nickname + $content['userid'] = getUserData('nickname'); } else { - // Load userid - $data = 'userid'; + // Get userid + $content['userid'] = getMemberId(); } -// Run SQL command -$result = SQL_QUERY_ESC("SELECT - `".$data."`, `beg_clicks` -FROM - `{?_MYSQL_PREFIX?}_user_data` -WHERE - `userid`=%s -LIMIT 1", array($userid), __FILE__, __LINE__); - -list($userid, $clicks) = SQL_FETCHROW($result); - -// Free result -SQL_FREERESULT($result); - -// Set user id when no nickname was found -$nickname = true; -if (empty($userid)) { $userid = getMemberId(); $nickname = false; } - -// Prepare constants -$content['userid'] = $userid; -$content['clicks'] = $clicks; -$content['points'] = translateComma(getConfig('beg_points')); -$content['points_max'] = translateComma(getConfig('beg_points_max')); -$content['timeout'] = createFancyTime(getConfig('beg_timeout')); // @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout'))); // Load template -loadTemplate('member_' . substr(basename(__FILE__), 5, -4), false, $content); +loadTemplate('member_beg', false, $content); // [EOF] ?>