]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/guest/what-beg.php
Huge rewrite of default parameters, ext-network continued:
[mailer.git] / inc / modules / guest / what-beg.php
index 413f0240099e178ee6802f371abb726003f986b8..557f9ae292da1a85922f0c219466ea3ba04d9b13 100644 (file)
@@ -17,7 +17,7 @@
  * Needs to be in all Files and every File needs "svn propset           *
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
 
 // Some security stuff...
 if (!defined('__SECURITY')) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
-       require($INC);
-} elseif ((!EXT_IS_ACTIVE('beg')) && (!IS_ADMIN())) {
-       addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'beg');
-       return;
-}
+       die();
+} // END - if
 
 // Add description as navigation point
-ADD_DESCR('guest', __FILE__);
+addMenuDescription('guest', __FILE__);
+
+if ((!isExtensionActive('beg')) && (!isAdmin())) {
+       loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('beg'));
+       return;
+} // END - if
 
 // Prepare constants
-define('__BEG_POINTS'    , TRANSLATE_COMMA(getConfig('beg_points')));
-define('__BEG_POINTS_MAX', TRANSLATE_COMMA(getConfig('beg_points_max')));
-if ($GLOBALS['refid'] > 0) {
-       // Take referal ID from URL/Cookie
-       define('__BEG_UID'       , $GLOBALS['refid']);
-} else {
-       // Take default referal ID
-       define('__BEG_UID'       , getConfig('def_refid'));
-}
+$content['points']     = translateComma(getConfig('beg_points'));
+$content['points_max'] = translateComma(getConfig('beg_points_max'));
+$content['userid']     = determineReferalId();
 
 // Selection boxes are now the default
-define('__BEG_TIMEOUT'    , CREATE_FANCY_TIME(getConfig('beg_timeout')));
-define('__BEG_UID_TIMEOUT', CREATE_FANCY_TIME(getConfig('beg_uid_timeout')));
+$content['timeout'] = createFancyTime(getConfig('beg_timeout'));
+// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout')));
 
 // Load final template
-LOAD_TEMPLATE("guest_".substr(basename(__FILE__), 5, -4));
+loadTemplate('guest_beg', false, $content);
 
-//
+// [EOF]
 ?>