]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-beg.php
The yearly copyright-update commit. 2009, 2010 are now copyrighted on the developer...
[mailer.git] / inc / modules / member / what-beg.php
index f28f4964f64366cc693e602a874d52de2865db4c..0780e5e466fd8d5352ec13e08a15b91cd472e0ed 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 01/09/2005 *
- * ================                             Last change: 01/09/2005 *
+ * Mailer v0.2.1-FINAL                                Start: 01/09/2005 *
+ * ===================                          Last change: 01/09/2005 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : 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,19 @@ if ((!isExtensionActive('beg')) && (!isAdmin())) {
        return;
 } // END - if
 
-// Get userid
-$userid = getUserId();
-
-if (isExtensionActive('nickname')) {
-       // Load nickname
-       $data = 'nickname';
+// Prepare constants
+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 = getUserId(); $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]
 ?>