} elseif (!IS_MEMBER()) {
LOAD_URL("modules.php?module=index");
} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) {
- ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg");
+ addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "beg");
return;
}
// Run SQL command
$result = SQL_QUERY_ESC("SELECT ".$data.", beg_clicks
-FROM `"._MYSQL_PREFIX."_user_data`
+FROM `{!_MYSQL_PREFIX!}_user_data`
WHERE userid=%s
LIMIT 1", array($uid), __FILE__, __LINE__);
list($uid, $clicks) = SQL_FETCHROW($result);
if (empty($uid)) { $uid = $GLOBALS['userid']; $nickname = false; }
// 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);
-}
+define('__BEG_UID' , $uid);
+define('__BEG_CLICKS' , $clicks);
+define('__BEG_POINTS' , TRANSLATE_COMMA(getConfig('beg_points')));
+define('__BEG_POINTS_MAX' , TRANSLATE_COMMA(getConfig('beg_points_max')));
+define('__BEG_TIMEOUT' , CREATE_FANCY_TIME(getConfig('beg_timeout')));
+define('__BEG_UID_TIMEOUT', CREATE_FANCY_TIME(getConfig('beg_uid_timeout')));
// Load template
LOAD_TEMPLATE("member_".substr(basename(__FILE__), 5, -4));