define('SERVER_URL', "http://www.mxchange.org");
// This current patch level
-define('CURR_SVN_REVISION', "304");
+define('CURR_SVN_REVISION', "305");
// Take a prime number which is long (if you know a longer one please try it out!)
define('_PRIME', 591623);
}
// Version number
-$EXT_VERSION = "0.3.8";
+$EXT_VERSION = "0.3.9";
// Auto-set extension version
if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
// Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = array("0.0", "0.1", "0.2", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8");
+$EXT_VER_HISTORY = array("0.0", "0.1", "0.2", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9");
switch ($EXT_LOAD_MODE)
{
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Hash-Erstellung von <STRONG>md5()</STRONG> auf bessere Funktion <STRONG>generateHash()</STRONG> umgestellt.";
break;
+
+ case "0.3.9": // SQL queries for v0.3.8
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` CHANGE `birth_day` `birth_day` SMALLINT(2) UNSIGNED ZEROFILL NOT NULL DEFAULT '01',
+CHANGE `birth_month` `birth_month` SMALLINT(2) UNSIGNED ZEROFILL NOT NULL DEFAULT '01',
+CHANGE `birth_year` `birth_year` SMALLINT(4) UNSIGNED ZEROFILL NOT NULL DEFAULT '1970'";
+
+ // Update notes (these will be set as task text!)
+ $UPDATE_NOTES = "Datenbankspalten umgestellt auf SMALLINT() UNSIGNED ZEROFILL.";
+ break;
}
break;
// Save some RAM...
unset($dummy);
- if ((isBooleanConstantAndTrue('__DAILY_RESET')) && ($_CONFIG['birthday_points'] > 0))
- {
+ if ((isBooleanConstantAndTrue('__DAILY_RESET')) && ($_CONFIG['birthday_points'] > 0)) {
// Daily reset was run and we shall pay points so we start checking for members who
// has a birthday for today
$INC_POOL[] = sprintf("%sinc/mails/birthday_mails.php", PATH);
$SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, descr, sort) VALUES('wernis', 'list_wernis', 'Wernis-Anfragen auflisten', 'Listet alle Wernis-Auszahlungsanfragen Ihrer Mitglieder auf.', 2)";
// Member menu
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (action, what, title, visible, locked, sort) VALUES('main', 'wernis', 'Wernis-Ein-/Auszahlungen', 'N', 'N', '11')";
+ $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (action, what, title, visible, locked, sort) VALUES('main', 'wernis', 'Wernis-Ein-/Auszahlungen', 'N', 'N', 11)";
+
+ // Guest menu
+ $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_guest_menu (action, what, title, visible, locked, sort) VALUES('main', 'wernis_portal', 'WDS66-News', 'N', 'N', 7)";
break;
case "remove": // Do stuff when removing extension
// SQL commands to run
$SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_wernis";
$SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='wernis'";
- $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE action='main' AND what='wernis' LIMIT 1";
+ $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='wernis' LIMIT 1";
+ $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_guest_menu WHERE what='wernis_portal' LIMIT 1";
break;
case "activate": // Do stuff when admin activates this extension
$INC = sprintf("%sinc/modules/guest/what-%s.php", PATH, $GLOBALS['what']);
$IS_VALID = WHAT_IS_VALID(GET_ACTION("guest", $GLOBALS['what']), $GLOBALS['what'], "guest");
-if (FILE_READABLE($INC)) && ($IS_VALID)) {
+if ((FILE_READABLE($INC)) && ($IS_VALID)) {
// Ok, we finally load the guest action module
require_once($INC);
} elseif ($IS_VALID) {
************************************************************************/
// Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
+if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
-}
- elseif (!EXT_IS_ACTIVE("online"))
-{
+} elseif (!EXT_IS_ACTIVE("online")) {
// Just skip this extension
return;
}
// Total visitors online
$total = SQL_NUMROWS($result_guests) + SQL_NUMROWS($result_members) + SQL_NUMROWS($result_admins);
-if ($_CONFIG['mad_counter'] < $total)
-{
+if ($_CONFIG['mad_counter'] < $total) {
// Update counter
UPDATE_CONFIG(array("mad_timestamp", "mad_count"), array(time(), $total));
$_CONFIG['mad_counter'] = $total;
// Output table
LOAD_TEMPLATE("online_now");
-if (EXT_IS_ACTIVE("active"))
-{
+if (EXT_IS_ACTIVE("active")) {
// Add link to "we were active today" page
LOAD_TEMPLATE("guest_menu_bottom", false, "<A class=\"menu_blur\" href=\"".URL."/modules.php?module=index&what=active\">".$_CONFIG['menu_blur_spacer'].GUEST_ACTIVE_LINK."</A>");
}
************************************************************************/
// Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
+if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
require($INC);
}
array(
"textinput" => "hidden",
"sitelink" => "http://www.wds66.com",
- "refid" => "10437",
+ "refid" => bigintval($_CONFIG['wernis_refid']),
"reflink" => "/ref.php?refid=",
)
);
require ("inc/config.php");
// Redirect only to registration page when this script is installed
-if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_installed')))
-{
+if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_installed'))) {
// Base URL for redirection
switch ($_CONFIG['refid_target'])
{
// Get referral ID from ref or refid variable
if (!empty($_GET['ref'])) $ref = secureString($_GET['ref']);
- elseif (!empty($_GET['refid'])) $ref = bigintval($_GET['refid']);
+ elseif (!empty($_GET['refid'])) $ref = secureString($_GET['refid']);
- if (!empty($ref))
- {
- // Test if nickname ($test == "0") or ID
- $test = "".round($ref)."";
- if ((EXT_IS_ACTIVE("nickname")) && ($test != $ref))
- {
+ if (!empty($ref)) {
+ // Test if nickname or numeric id
+ if ((EXT_IS_ACTIVE("nickname")) && ($ref != "".bigintval($ref)."")) {
// Nickname in URL, so load the ID
- $result = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE nickname='%s' LIMIT 1", array($ref), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE nickname='%s' LIMIT 1",
+ array($ref), __FILE__, __LINE__);
list($ref) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
- }
+ } // END - if
// Also edit this 0 !
if (empty($ref)) $ref = "0";
// Update ref counter
$result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET ref_clicks=ref_clicks+1 WHERE userid=%s LIMIT 1",
- array(bigintval($ref)), __FILE__, __LINE__);
- }
- else
- {
+ array(bigintval($ref)), __FILE__, __LINE__);
+ } else {
// No refid and we add our refid (don't forget to set $def_refid!)
$URL = URL."/index.php";
}
+
// Load the URL
LOAD_URL($URL);
- // Redirection should be done here
-}
- else
-{
+} else {
// You have to configure first!
LOAD_URL("install.php");
}