<?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 *
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Bettel-Link *
* -------------------------------------------------------------------- *
- * *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
* -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder *
- * For more information visit: http://www.mxchange.org *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team *
+ * For more information visit: http://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 *
// Some security stuff...
if (!defined('__SECURITY')) {
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
- require($INC);
-} elseif (!IS_MEMBER()) {
- LOAD_URL("modules.php?module=index");
-} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) {
- ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg");
- return;
+ exit();
+} elseif (!isMember()) {
+ redirectToIndexMemberOnlyModule();
}
// Add description as navigation point
-ADD_DESCR("member", basename(__FILE__));
-
-$uid = $GLOBALS['userid'];
-if (EXT_IS_ACTIVE("nickname"))
-{
- // Load nickname
- $data = "nickname";
-}
- else
-{
- // Load userid
- $data = "userid";
-}
+addYouAreHereLink('member', __FILE__);
-// Run SQL command
-$result = SQL_QUERY_ESC("SELECT ".$data.", beg_clicks FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1", array($uid), __FILE__, __LINE__);
-list($uid, $clicks) = SQL_FETCHROW($result);
-SQL_FREERESULT($result);
-
-// Set User-ID when no nickname was found
-$nickname = true;
-if (empty($uid)) { $uid = $GLOBALS['userid']; $nickname = false; }
+if ((!isExtensionActive('beg')) && (!isAdmin())) {
+ displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=beg%}');
+ return;
+} // END - if
// Prepare constants
-define('__BEG_UID' , $uid);
-define('__BEG_CLICKS' , $clicks);
-define('__BEG_POINTS' , TRANSLATE_COMMA($_CONFIG['beg_points']));
-define('__BEG_POINTS_MAX', TRANSLATE_COMMA($_CONFIG['beg_points_max']));
-
-if (function_exists('CREATE_FANCY_TIME'))
-{
- define('__BEG_TIMEOUT' , CREATE_FANCY_TIME($_CONFIG['beg_timeout']));
- define('__BEG_UID_TIMEOUT', CREATE_FANCY_TIME($_CONFIG['beg_uid_timeout']));
-}
- else
-{
- define('__BEG_TIMEOUT ' , round($_CONFIG['beg_timeout'] / 60)." ".MINUTES);
- define('__BEG_UID_TIMEOUT', round($_CONFIG['beg_uid_timeout'] / 60)." ".MINUTES);
+// @TODO Can't this be moved into EL?
+if ((isExtensionActive('nickname')) && (getUserData('nickname') != '')) {
+ // Get nickname
+ $content['userid'] = getUserData('nickname');
+} else {
+ // Get userid
+ $content['userid'] = getMemberId();
}
+// @TODO No more needed? define('__BEG_USERID_TIMEOUT', createFancyTime(getBegUseridTimeout()));
+
// Load template
-LOAD_TEMPLATE("member_".substr(basename(__FILE__), 5, -4));
+loadTemplate('member_beg', FALSE, $content);
-//
+// [EOF]
?>