inc/autopurge/purge-tsks.php -text
inc/autopurge/purge-unconfirmed.php -text
inc/cache/.htaccess -text
+inc/cache/.revision -text
inc/check-reset.php -text
inc/config.php -text
inc/databases.php -text
templates/de/html/ext/ext_events.tpl -text
templates/de/html/ext/ext_holiday.tpl -text
templates/de/html/ext/ext_html_mail.tpl -text
+templates/de/html/ext/ext_logs.tpl -text
templates/de/html/ext/ext_mailid.tpl -text
templates/de/html/ext/ext_maintenance.tpl -text
templates/de/html/ext/ext_mediadata.tpl -text
templates/de/html/ext/ext_theme.tpl -text
templates/de/html/ext/ext_top10.tpl -text
templates/de/html/ext/ext_transfer.tpl -text
+templates/de/html/ext/ext_usage.tpl -text
templates/de/html/ext/ext_user.tpl -text
templates/de/html/ext/ext_wernis.tpl -text
templates/de/html/ext/ext_yoomedia.tpl -text
--- /dev/null
+new
\ No newline at end of file
// Replacement strings
$REPLACER = array(
- 'userid' => "%uid%", // User-ID
- 'surname' => "%vorname%", // Surname
- 'family' => "%nachname%", // Family name
- 'gender' => "%anrede%", // Gender
+ 'userid' => "%uid%", // User-ID
+ 'surname' => "%vorname%", // Surname
+ 'family' => "%nachname%", // Family name
+ 'gender' => "%anrede%", // Gender
);
// One day
define('SERVER_URL', "http://www.mxchange.org");
// Current SVN revision
-define('CURR_SVN_REVISION', "725");
+define('CURR_SVN_REVISION', getActualVersion(0));
+define('CURR_SVN_DATE' , getActualVersion(1));
+define('CURR_SVN_VERSION' , getActualVersion(2));
// Take a prime number which is long (if you know a longer one please try it out!)
define('_PRIME', 591623);
function SQL_QUERY ($sql_string, $F, $L) {
global $link, $CSS, $_CONFIG, $OK;
+ // Link is up?
+ if (!is_resource($link)) return false;
+
// Remove \t, \n and \r from queries they may confuse some MySQL version I have heard
$sql_string = str_replace("\t", " ", str_replace("\n", " ", str_replace("\r", " ", $sql_string)));
// Run SQL command
//* DEBUG: */ echo $sql_string."<br />\n";
- $result = @mysql_query($sql_string, $link)
+ $result = mysql_query($sql_string, $link)
or addFatalMessage($F." (".$L."):".mysql_error()."<br />
Query string:<br />
".$sql_string);
// Is the result a valid resource?
if (is_resource($result)) {
// Get the count of rows from database
- $lines = @mysql_num_rows($result);
+ $lines = mysql_num_rows($result);
// Is the result empty? Then we have an error!
if (empty($lines)) $lines = 0;
if (!is_resource($link)) return false;
// Get affected rows
- $lines = @mysql_affected_rows($link);
+ $lines = mysql_affected_rows($link);
// Return it
return $lines;
// Is a result resource set?
if (!is_resource($result)) return false;
- $DATA = @mysql_fetch_row($result);
+ $DATA = mysql_fetch_row($result);
return $DATA;
}
$row = array();
// Load row from database
- $row = @mysql_fetch_array($res);
+ $row = mysql_fetch_array($res);
// Return only arrays here
if (is_array($row)) {
// SQL result
function SQL_RESULT($res, $row, $field) {
- $result = @mysql_result($res, $row, $field);
+ $result = mysql_result($res, $row, $field);
return $result;
}
// SQL connect
function SQL_CONNECT($host, $login, $password, $F, $L) {
- $connect = @mysql_connect($host, $login, $password) or addFatalMessage($F." (".$L."):".mysql_error());
+ $connect = mysql_connect($host, $login, $password) or addFatalMessage($F." (".$L."):".mysql_error());
return $connect;
}
// SQL select database
function SQL_SELECT_DB($dbName, $link, $F, $L) {
$select = false;
if (is_resource($link)) {
- $select = @mysql_select_db($dbName, $link) or addFatalMessage($F." (".$L."):".mysql_error());
+ $select = mysql_select_db($dbName, $link) or addFatalMessage($F." (".$L."):".mysql_error());
}
return $select;
}
$link = null;
return $close;
}
+
// SQL free result
-function SQL_FREERESULT($result) {
+function SQL_FREERESULT ($result) {
if (!is_resource($result)) {
// Abort here
return false;
} // END - if
- $res = @mysql_free_result($result);
+ $res = mysql_free_result($result);
return $res;
}
+
// SQL string escaping
-function SQL_QUERY_ESC($qstring, $data, $file, $line, $run=true, $strip=true) {
+function SQL_QUERY_ESC ($qstring, $data, $file, $line, $run=true, $strip=true) {
global $link;
+ // Link is there?
+ if (!is_resource($link)) return false;
+
// Init variable
$query = "failed";
return $query;
}
}
+
// Get ID from last INSERT command
-function SQL_INSERTID() {
- return @mysql_insert_id();
+function SQL_INSERTID () {
+ global $link;
+ if (!is_resource($link)) return false;
+ return mysql_insert_id();
}
+
// Escape a string for the database
-function SQL_ESCAPE($str, $secureString=true,$strip=true) {
+function SQL_ESCAPE ($str, $secureString=true,$strip=true) {
global $link;
// Secure string first? (which is the default behaviour!)
return SQL_QUERY_ESC($SQL, array(bigintval($id)), $F, $L);
}
// ALTER TABLE wrapper function
-function SQL_ALTER_TABLE($sql, $F, $L) {
- // Shall we add?
- if (eregi("ADD", $sql) > 0) {
+function SQL_ALTER_TABLE ($sql, $F, $L) {
+ // This is the default result...
+ $result = false;
+
+ // Determine index/fulltext/unique word
+ $noIndex = ((eregi("INDEX", $sql) == false) && (eregi("FULLTEXT", $sql) == false) && (eregi("UNIQUE", $sql) == false);
+
+ // Shall we add/drop?
+ if (((eregi("ADD", $sql) > 0) || (eregi("DROP", $sql) > 0)) && ($noIndex)) {
// Extract table name
$tableArray = explode(" ", $sql);
$tableName = str_replace("`", "", $tableArray[2]);
$result = SQL_QUERY_ESC("SHOW COLUMNS FROM %s LIKE '%s'",
array($tableName, $columnName), $F, $L);
- // Do we have no entry?
- if (SQL_NUMROWS($result) == 0) {
+ // Do we have no entry on ADD or an entry on DROP?
+ if (((SQL_NUMROWS($result) == 0) && (eregi("ADD", $sql) > 0)) || ((SQL_NUMROWS($result) == 1) && (eregi("DROP", $sql) > 0))) {
// Do the query
- return SQL_QUERY($sql, $F, $L, false);
+ $result = SQL_QUERY($sql, $F, $L, false);
} // END - if
} else {
// Send it to the SQL_QUERY() function
- return SQL_QUERY($sql, $F, $L, false);
+ $result = SQL_QUERY($sql, $F, $L, false);
}
+
+ // Return result
+ return $result;
}
//
?>
case "remove": // Do stuff when removing extension
// SQL commands to run
- $SQLs[] = "DELETE LOW_PRIOIRTY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE what='logs' LIMIT 1";
+ $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE what='logs' LIMIT 1";
break;
case "activate": // Do stuff when admin activates this extension
{
case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called)
// SQL commands to run
- $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_other','Sonstige Einstellungen','Sonstige Einstellungen an Ihrem Mailtausch.','13')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_other','Sonstige Einstellungen','Sonstige Einstellungen an Ihrem Mailtausch.',13)";
break;
case "remove": // Do stuff when removing extension
//
// Sponsor data
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_data";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_data (
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_data`";
+ $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_sponsor_data` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
company VARCHAR(255) NOT NULL DEFAULT '',
position VARCHAR(255) NOT NULL DEFAULT '',
//
// Sponsor orders
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_orders";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_orders (
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_orders`";
+ $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_sponsor_orders` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
sponsorid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
aid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
//
// Pay-types
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_paytypes";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_paytypes (
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_paytypes`";
+ $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_sponsor_paytypes` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
pay_name VARCHAR(255) NOT NULL DEFAULT '',
pay_rate FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
//
// Points-to-action converting
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_action_convert";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_action_convert (
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_action_convert`";
+ $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_sponsor_action_convert` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
ext_name VARCHAR(255) NOT NULL DEFAULT 'sponsor',
conv_rate BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
//
// Sponsor menu system (default)
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_menu";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_menu (
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_menu`";
+ $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_sponsor_menu` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
action VARCHAR(255) NOT NULL DEFAULT '',
what VARCHAR(255) NULL DEFAULT NULL,
//
// Registry for performable actions by your sponsors
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_registry";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_registry (
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_registry`";
+ $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_sponsor_registry` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
aid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
ext_name VARCHAR(255) NOT NULL DEFAULT 'sponsor',
//
// URLs from the sponsors
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_urls";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_urls (
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_urls`";
+ $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_sponsor_urls` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
sponsorid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
url VARCHAR(255) NOT NULL DEFAULT 'http://',
//
// Banners of any size from the sponsors
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_banner";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_banner (
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_banner`";
+ $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_sponsor_banner` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
sponsorid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
url VARCHAR(255) NOT NULL DEFAULT 'http://',
//
// Campaigns
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_campaigns";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_campaigns (
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_campaigns`";
+ $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_sponsor_campaigns` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
sponsorid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
aid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
//
// Campaigns + URLs + Banner
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_campaign_assigns";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_campaign_assigns (
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_campaign_assigns`";
+ $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_sponsor_campaign_assigns` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
campaignid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
urlid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
//
// Allowed data to display (administrative)
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_admin_data";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_admin_data (
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_admin_data`";
+ $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_sponsor_admin_data` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
data_row VARCHAR(255) NOT NULL DEFAULT '',
display ENUM('Y','N') NOT NULL DEFAULT 'N',
//
// Allowed data to display (sponsor-side)
//
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_display_data";
- $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_sponsor_display_data (
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_display_data`";
+ $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_sponsor_display_data` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
sponsorid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
data_row VARCHAR(255) NOT NULL DEFAULT '',
//
// Default allowed data to display
//
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('id','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('company','Y')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('position','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('tax_ident','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('gender','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('surname','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('family','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('street_nr1','Y')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('street_nr2','Y')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('zip','Y')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('city','Y')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('country','Y')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('phone','Y')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('fax','Y')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('email','Y')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('url','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('password','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('remote_addr','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('sponsor_created','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('last_online','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('last_change','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('status','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('receive_warnings','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('warning_interval','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('points_amount','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('points_used','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('refid','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('ref_count','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('hash','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('last_pay','N')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_admin_data (data_row, display) VALUES ('last_curr','N')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('id','N')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('company','Y')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('position','N')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('tax_ident','N')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('gender','N')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('surname','N')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('family','N')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('street_nr1','Y')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('street_nr2','Y')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('zip','Y')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('city','Y')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('country','Y')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('phone','Y')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('fax','Y')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('email','Y')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('url','N')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('password','N')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('remote_addr','N')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('sponsor_created','N')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('last_online','N')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('last_change','N')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('status','N')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('receive_warnings','N')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('warning_interval','N')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('points_amount','N')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('points_used','N')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('refid','N')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('ref_count','N')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('hash','N')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('last_pay','N')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_admin_data` (data_row, display) VALUES ('last_curr','N')";
//
// Add default entries
//
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_registry (ext_name, is_active, aid, stamp_added) VALUES ('sponsor','N',".GET_CURRENT_ADMIN_ID().",UNIX_TIMESTAMP())";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_action_convert (ext_name, conv_rate, conv_name) VALUES ('sponsor','10','Mails')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_paytypes (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Standart-Paket', 5, 1000.00000, '€')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_paytypes (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Spar-Paket', 1, 200.00000, '€')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_paytypes (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Power-Paket', 10, 2000.00000, '€')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_paytypes (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Sponsor-Paket', 20, 4000.00000, '€')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_registry` (ext_name, is_active, aid, stamp_added) VALUES ('sponsor','N',".GET_CURRENT_ADMIN_ID().",UNIX_TIMESTAMP())";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_action_convert` (ext_name, conv_rate, conv_name) VALUES ('sponsor','10','Mails')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_paytypes` (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Standart-Paket', 5, 1000.00000, '€')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_paytypes` (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Spar-Paket', 1, 200.00000, '€')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_paytypes` (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Power-Paket', 10, 2000.00000, '€')";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_paytypes` (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Sponsor-Paket', 20, 4000.00000, '€')";
//
// Admin menu
//
//
// Guest menu
//
- $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_guest_menu` (action, what, title, sort) VALUES ('sponsor', NULL, 'Sponsoren', 2)";
- $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_guest_menu` (action, what, title, sort) VALUES ('sponsor','sponsor_reg','Anmeldung', 1)";
- $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_guest_menu` (action, what, title, sort) VALUES ('sponsor','sponsor_login','Einloggen', 2)";
- $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_guest_menu` (action, what, title, sort) VALUES ('sponsor','sponsor_infos','Infos/Preise', 3)";
- $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_guest_menu` (action, what, title, sort) VALUES ('sponsor','sponsor_agb','AGBs', 4)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_guest_menu` (`action`, `what`, `title`, `sort`) VALUES ('sponsor', NULL, 'Sponsoren', 2)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_guest_menu` (`action`, `what`, `title`, `sort`) VALUES ('sponsor','sponsor_reg','Anmeldung', 1)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_guest_menu` (`action`, `what`, `title`, `sort`) VALUES ('sponsor','sponsor_login','Einloggen', 2)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_guest_menu` (`action`, `what`, `title`, `sort`) VALUES ('sponsor','sponsor_infos','Infos/Preise', 3)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_guest_menu` (`action`, `what`, `title`, `sort`) VALUES ('sponsor','sponsor_agb','AGBs', 4)";
//
// Member menu
//
- $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (action, what, title, sort) VALUES ('main','sponsor','Unsere Sponsoren', 8)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`, `what`, `title`, `sort`) VALUES ('main','sponsor','Unsere Sponsoren', 8)";
//
// Add default menus to sponsor menu
//
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('main', NULL, 'Hauptauswahl','N', 1)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('main','welcome','Willkommen','N', 1)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('main','account','Ihr Account','N', 2)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('main','campaigns','Kampagnen','N', 3)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('main','urls','URL-Verwaltung','N', 4)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('main','banner','Banner-Verwaltung','N', 5)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('main','settings','Einstellungen','N', 6)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('main','fillup','Konto auffüllen','N', 7)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('main','stats','Statistiken','N', 8)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('main','inquiry','Kontaktanfrage','N', 9)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('main','refid','Referal-Link','N', 10)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('actions', NULL, 'Sponsorenaktionen','N', 2)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('actions','mail','Sponsor-Mail','N', 1)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('actions','banner','Banner buchen','N', 2)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('actions','text','Textlink buchen','N', 3)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('logout', NULL, 'Ausloggen','N', 3)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('logout','logout','Ausloggen','N', 1)";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_sponsor_menu (action, what, title, active, sort) VALUES ('logout','guest','Zum Gastbereich','N', 2)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main', NULL, 'Hauptauswahl','N', 1)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','welcome','Willkommen','N', 1)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','account','Ihr Account','N', 2)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','campaigns','Kampagnen','N', 3)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','list_urls','URL-Verwaltung','N', 4)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','list_banner','Banner-Verwaltung','N', 5)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','settings','Einstellungen','N', 6)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','fillup','Konto auffüllen','N', 7)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','stats','Statistiken','N', 8)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','inquiry','Kontaktanfrage','N', 9)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('main','refid','Referal-Link','N', 10)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('actions', NULL, 'Sponsorenaktionen','N', 2)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('actions','mail','Sponsor-Mail','N', 1)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('actions','banner','Banner buchen','N', 2)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('actions','text','Textlink buchen','N', 3)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('logout', NULL, 'Ausloggen','N', 3)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('logout','logout','Ausloggen','N', 1)";
+ $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_menu` (`action`, `what`, `title`, `active`, `sort`) VALUES ('logout','guest','Zum Gastbereich','N', 2)";
//
// General configuration stuff
//
case "remove": // Do stuff when removing extension
// SQL commands to run
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_data";
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_orders";
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_action_convert";
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_paytypes";
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_menu";
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_registry";
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_urls";
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_banner";
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_campaigns";
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_campaign_assigns";
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_admin_data";
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_sponsor_display_data";
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_data`";
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_orders`";
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_action_convert`";
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_paytypes`";
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_menu`";
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_registry`";
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_urls`";
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_banner`";
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_campaigns`";
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_campaign_assigns`";
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_admin_data`";
+ $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_sponsor_display_data`";
$SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE action='sponsor' OR what IN('repr_sponsor','sponsor_medit','sponsor_madd') LIMIT 20";
$SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_guest_menu` WHERE action='sponsor' LIMIT 5";
$SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_member_menu` WHERE what='sponsor' LIMIT 1";
// SQL commands to run
$SQLs[] = "UPDATE `"._MYSQL_PREFIX."_guest_menu` SET visible='Y', locked='N' WHERE action='sponsor' LIMIT 4";
$SQLs[] = "UPDATE `"._MYSQL_PREFIX."_member_menu` SET visible='Y', locked='N' WHERE what='sponsor' LIMIT 1";
- $SQLs[] = "UPDATE "._MYSQL_PREFIX."_sponsor_menu SET active='Y' WHERE active='N'";
- $SQLs[] = "UPDATE "._MYSQL_PREFIX."_sponsor_registry SET is_active='Y' WHERE is_active='N'";
+ $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_sponsor_menu` SET active='Y' WHERE active='N'";
+ $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_sponsor_registry` SET is_active='Y' WHERE is_active='N'";
break;
case "deactivate": // Do stuff when admin deactivates this extension
// SQL commands to run
$SQLs[] = "UPDATE `"._MYSQL_PREFIX."_guest_menu` SET visible='N', locked='Y' WHERE action='sponsor' LIMIT 4";
$SQLs[] = "UPDATE `"._MYSQL_PREFIX."_member_menu` SET visible='N', locked='Y' WHERE what='sponsor' LIMIT 1";
- $SQLs[] = "UPDATE "._MYSQL_PREFIX."_sponsor_menu SET active='N' WHERE active='Y'";
- $SQLs[] = "UPDATE "._MYSQL_PREFIX."_sponsor_registry SET is_active='N' WHERE is_active='Y'";
+ $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_sponsor_menu` SET active='N' WHERE active='Y'";
+ $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_sponsor_registry` SET is_active='N' WHERE is_active='Y'";
break;
case "update": // Update an extension
return $content;
}
+// Writes content to a file
+function WRITE_FILE ($FQFN, $content) {
+ // Is the function there?
+ if (function_exists('file_put_contents')) {
+ // Write it directly
+ file_put_contents($FQFN, $content);
+ } else {
+ // Write it with fopen
+ $fp = fopen($FQFN, 'w') or mxchange_die("Cannot write file ".basename($FQFN)."!");
+ fwrite($fp, $content);
+ fclose($fp);
+
+ // Set CHMOD rights
+ chmod($FQFN, 0644);
+ }
+}
+
// Generates an error code from given account status
function GEN_ERROR_CODE_FROM_ACCOUNT_STATUS ($status) {
// Default error code if unknown account status
} // END - if
}
+// "Getter" for revision/version data
+function getActualVersion ($type = 0) {
+ // By default nothing is new... ;-)
+ $new = false;
+
+ // FQFN of revision file
+ $FQFN = sprintf("%sinc/cache/.revision", PATH);
+
+ // Check for revision file
+ if (!FILE_READABLE($FQFN)) {
+ // Not found, so we need to create it
+ $new = true;
+ } else {
+ // Revision file found
+ $ins_vers = explode("\n", READ_FILE($FQFN));
+
+ // Is the content valid?
+ if ((!is_array($ins_vers)) || (count($ins_vers) <= 0) || (!isset($ins_vers[$type])) || ($ins_vers[0]) == "new") {
+ // File needs update!
+ $new = true;
+ } else {
+ // Revision-File has valid Data and isn't 'new' so return the Rev-Number
+ return trim($ins_vers[$type]);
+ }
+ }
+
+ if ($new) {
+ // no Revision-File or has no valid Data so read the Revision from the Server.
+ $version = GET_URL("check-updates3.php");
+
+ // Prepare content
+ $akt_vers[] = trim($version[10]);
+ $akt_vers[] = trim($version[9]);
+ $akt_vers[] = trim($version[8]);
+
+ // Write file
+ WRITE_FILE($FQFN, implode("\n", $akt_vers));
+
+ // Return requested content
+ return trim($akt_vers[$type]);
+ }
+}
//////////////////////////////////////////////////
// AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS //
//////////////////////////////////////////////////
$result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_refsystem WHERE level=0", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// Remove index temporaly
- SQL_QUERY("ALTER TABLE `"._MYSQL_PREFIX."_refsystem` DROP INDEX `userid_level`", __FILE__, __LINE__);
+ SQL_ALTER_TABLE("ALTER TABLE `"._MYSQL_PREFIX."_refsystem` DROP INDEX `userid_level`", __FILE__, __LINE__);
// Upgrade refsystem, ref-level 0 is silly here
SQL_QUERY("UPDATE "._MYSQL_PREFIX."_refsystem SET level=level+1", __FILE__, __LINE__);
// Add it again
- SQL_QUERY("ALTER TABLE `"._MYSQL_PREFIX."_refsystem` ADD UNIQUE `userid_level` ( `userid` , `level` )", __FILE__, __LINE__);
+ SQL_ALTER_TABLE("ALTER TABLE `"._MYSQL_PREFIX."_refsystem` ADD UNIQUE `userid_level` ( `userid` , `level` )", __FILE__, __LINE__);
// Rebuild cache
REBUILD_CACHE("refsystem", "refsystem");
$file_hash = sha1(GEN_PASS(mt_rand(128, 256)));
$file = PATH."inc/.secret/.".$file_hash;
+ // Count of chars to be taken from back of the string
+ $nums = mt_rand(40, 45);
+
+ // Generate secret key from a randomized string
+ $secretKey = substr(sha1(GEN_PASS(mt_rand(128, 256))), -$nums);
+
// File hash was never created
- $fp = @fopen($file, 'w') or mxchange_die("Cannot write secret key file!");
- if ($fp != false) {
- // Could write to secret file! So let's generate the secret key...
- // 1. Count of chars to be taken from back of the string
- $nums = mt_rand(40, 45);
- // 2. Generate secret key from a randomized string
- $secretKey = substr(sha1(GEN_PASS(mt_rand(128, 256))), -$nums);
- // 3. Write the key to the file
- fwrite($fp, $secretKey);
- // 4. Close file
- fclose($fp);
-
- // Change access rights for more security
- @chmod($file, 0644);
+ WRITE_FILE($file, $secretKey);
+ // Is the file there?
+ if (FILE_READABLE($file)) {
//* DEBUG: */ unlink($file);
//* DEBUG: */ $test = hexdec(get_session('u_hash')) / hexdec($secretKey);
//* DEBUG: */ $test = generateHash(str_replace('.', "", $test));
SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_config` SET file_hash='%s' WHERE config=0 LIMIT 1",
array($file_hash), __FILE__, __LINE__);
+ // Generate FQFN for .htaccess file
+ $FQFN = PATH."inc/.secret/.htaccess";
+
// Is the .htaccess file there?
- if (!FILE_READABLE(PATH."inc/.secret/.htaccess")) {
+ if (!FILE_READABLE($FQFN)) {
// Also create .htaccess file
- $fp = @fopen(PATH."inc/.secret/.htaccess", 'w') or mxchange_die("Cannot write to .htaccess file!");
- if ($fp != false) {
- // Add deny line to file
- fwrite($fp, "Deny from all");
-
- // Close the file
- fclose($fp);
- } // END - if
+ WRITE_FILE($FQFN, "Deny from all\n");
} // END - if
// Also update configuration
$SAVE = false;
} else {
// Do we want to add a new sponsor or update his data?
- $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE email='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT id FROM `"._MYSQL_PREFIX."_sponsor_data` WHERE email='%s' LIMIT 1",
array($POST['email']), __FILE__, __LINE__);
// Is a sponsor alread in the db?
// Update?
if ($UPDATE) {
// Update his data
- $SQL = "UPDATE "._MYSQL_PREFIX."_sponsor_data SET ";
+ $SQL = "UPDATE `"._MYSQL_PREFIX."_sponsor_data` SET ";
foreach ($DATA['keys'] as $k => $v) {
$SQL .= $v."='%s', ";
}
$VALUES = str_repeat("%s', '", count($DATA['values']) - 1);
// Generate string
- $SQL = "INSERT INTO "._MYSQL_PREFIX."_sponsor_data (".$KEYS.") VALUES ('".$VALUES."%s')";
+ $SQL = "INSERT INTO `"._MYSQL_PREFIX."_sponsor_data` (".$KEYS.") VALUES ('".$VALUES."%s')";
// Generate message
$MSG = SPONSOR_GET_MESSAGE(ADMIN_SPONSOR_ADDED, "added", $MSGs);
$ret = false;
if ((isSessionVariableSet('sponsorid'))) && (isSessionVariableSet('sponsorpass')))) {
// Check cookies against database records...
- $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_sponsor_data
+ $result = SQL_QUERY_ESC("SELECT id FROM `"._MYSQL_PREFIX."_sponsor_data`
WHERE id='%s' AND password='%s' AND status='CONFIRMED' LIMIT 1",
array(bigintval(get_session('sponsorid')), get_session('sponsorpass')), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
if (IS_ADMIN()) $WHERE = "";
// Load main menu entries
- $result_main = SQL_QUERY("SELECT action, title FROM "._MYSQL_PREFIX."_sponsor_menu
+ $result_main = SQL_QUERY("SELECT action, title FROM `"._MYSQL_PREFIX."_sponsor_menu`
WHERE (what='' OR what IS NULL) ".$WHERE."
ORDER BY sort", __FILE__, __LINE__);
if (SQL_NUMROWS($result_main) > 0)
while(list($action, $title_main) = SQL_FETCHROW($result_main))
{
// Load sub menus
- $result_sub = SQL_QUERY_ESC("SELECT what, title FROM "._MYSQL_PREFIX."_sponsor_menu
+ $result_sub = SQL_QUERY_ESC("SELECT what, title FROM `"._MYSQL_PREFIX."_sponsor_menu`
WHERE action='%s' AND what != '' AND what IS NOT NULL ".$WHERE."
ORDER BY sort", array($action), __FILE__, __LINE__);
if (SQL_NUMROWS($result_sub) > 0)
// Is sponsor?
if (IS_SPONSOR()) {
// Update last online timestamp
- SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data
+ SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_sponsor_data`
SET last_online=UNIX_TIMESTAMP()
WHERE id='%s' AND password='%s' LIMIT 1",
array(bigintval(get_session('sponsorid')), get_session('sponsorpass')), __FILE__, __LINE__);
$DATA = array();
// Prepare SQL string
- $SQL = "UPDATE "._MYSQL_PREFIX."_sponsor_data SET";
+ $SQL = "UPDATE `"._MYSQL_PREFIX."_sponsor_data` SET";
foreach ($POST as $key => $value) {
// Mmmmm, too less security here???
$SQL .= " ".strip_tags($key)."='%s',";
if (EXT_IS_ACTIVE("sponsor")) {
// List all sponsors
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_data ORDER BY id";
+ $SQLs[] = "SELECT id FROM `"._MYSQL_PREFIX."_sponsor_data` ORDER BY id";
$WHATs[] = "list_sponsor";
$DESCRs[] = TASK_ADMIN_LIST_SPONSOR;
$TITLEs[] = TASK_ADMIN_LIST_SPONSOR_TITLE;
// List confirmed sponsor accounts
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE status='CONFIRMED' ORDER BY id";
+ $SQLs[] = "SELECT id FROM `"._MYSQL_PREFIX."_sponsor_data` WHERE status='CONFIRMED' ORDER BY id";
$WHATs[] = "list_sponsor";
$DESCRs[] = TASK_ADMIN_LIST_SPONSOR_CONFIRMED;
$TITLEs[] = TASK_ADMIN_LIST_SPONSOR_CONFIRMED_TITLE;
// List unconfirmed sponsor accounts
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE status='UNCONFIRMED' ORDER BY id";
+ $SQLs[] = "SELECT id FROM `"._MYSQL_PREFIX."_sponsor_data` WHERE status='UNCONFIRMED' ORDER BY id";
$WHATs[] = "list_sponsor";
$DESCRs[] = TASK_ADMIN_LIST_SPONSOR_UNCONFIRMED;
$TITLEs[] = TASK_ADMIN_LIST_SPONSOR_UNCONFIRMED_TITLE;
// List locked sponsor accounts
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE status='LOCKED' ORDER BY id";
+ $SQLs[] = "SELECT id FROM `"._MYSQL_PREFIX."_sponsor_data` WHERE status='LOCKED' ORDER BY id";
$WHATs[] = "list_sponsor";
$DESCRs[] = TASK_ADMIN_LIST_SPONSOR_LOCKED;
$TITLEs[] = TASK_ADMIN_LIST_SPONSOR_LOCKED_TITLE;
// List waiting sponsor accounts to be approved
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE status='PENDING' ORDER BY id";
+ $SQLs[] = "SELECT id FROM `"._MYSQL_PREFIX."_sponsor_data` WHERE status='PENDING' ORDER BY id";
$WHATs[] = "unlock_sponsor";
$DESCRs[] = TASK_ADMIN_LIST_SPONSOR_PENDING;
$TITLEs[] = TASK_ADMIN_LIST_SPONSOR_PENDING_TITLE;
// Waiting payments
- $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_sponsor_orders WHERE pay_status='PENDING' ORDER BY id";
+ $SQLs[] = "SELECT id FROM `"._MYSQL_PREFIX."_sponsor_orders` WHERE pay_status='PENDING' ORDER BY id";
$WHATs[] = "list_sponsor_pays";
$DESCRs[] = TASK_ADMIN_LIST_SPONSOR_ORDERS;
$TITLEs[] = TASK_ADMIN_LIST_SPONSOR_ORDERS_TITLE;
if (!empty($_GET['id'])) {
// Check for selected sponsor
- $result = SQL_QUERY_ESC("SELECT email, gender, surname, family FROM "._MYSQL_PREFIX."_sponsor_data WHERE id='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT email, gender, surname, family FROM `"._MYSQL_PREFIX."_sponsor_data` WHERE id='%s' LIMIT 1",
array(bigintval($_GET['id'])), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Remove sponsor
SEND_EMAIL($email, SPONSOR_ADMIN_DEL_SUBJECT, $msg);
// Remove account
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_sponsor_data WHERE id='%s' LIMIT 1",
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_sponsor_data` WHERE id='%s' LIMIT 1",
array(bigintval($_GET['id'])), __FILE__, __LINE__);
// Remove orders
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_sponsor_orders WHERE sponsorid='%s' LIMIT 1",
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_sponsor_orders` WHERE sponsorid='%s' LIMIT 1",
array(bigintval($_GET['id'])), __FILE__, __LINE__);
// Output message
if ((!empty($_GET['id'])) && (!empty($_GET['mode']))) {
// Check for selected sponsor
- $result = SQL_QUERY_ESC("SELECT company, position, gender, surname, family, street_nr1, street_nr2, zip, city, country, phone, fax, cell, email, url, tax_ident, receive_warnings, warning_interval FROM "._MYSQL_PREFIX."_sponsor_data WHERE id='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT company, position, gender, surname, family, street_nr1, street_nr2, zip, city, country, phone, fax, cell, email, url, tax_ident, receive_warnings, warning_interval FROM `"._MYSQL_PREFIX."_sponsor_data` WHERE id='%s' LIMIT 1",
array(bigintval($_GET['id'])), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load sponsor details
$POINTS = strval(REVERT_COMMA($_POST['points']));
// Add points to account
- SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data SET points_amount=points_amount+%s WHERE id='%s' LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_sponsor_data` SET points_amount=points_amount+%s WHERE id='%s' LIMIT 1",
array($POINTS, bigintval($_GET['id'])), __FILE__, __LINE__);
// Remember points /reason for the template
$POINTS = strval(REVERT_COMMA($_POST['points']));
// Add points to account
- SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data SET points_used=points_used+%s WHERE id='%s' LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_sponsor_data` SET points_used=points_used+%s WHERE id='%s' LIMIT 1",
array($POINTS, bigintval($_GET['id'])), __FILE__, __LINE__);
// Remember points /reason for the template
// By default list menus
if (empty($SUB)) {
// List only main menus
- $result = SQL_QUERY("SELECT id, action, what, title, sort FROM `"._MYSQL_PREFIX."_guest_menu` WHERE (what='' OR what IS NULL) ORDER BY sort ASC", __FILE__, __LINE__);
+ $result = SQL_QUERY("SELECT `id`, `action`, `what`, `title`, `sort` FROM `"._MYSQL_PREFIX."_guest_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC", __FILE__, __LINE__);
} else {
// List sub menus
- $result = SQL_QUERY_ESC("SELECT id, action, what, title, sort FROM `"._MYSQL_PREFIX."_guest_menu` WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort ASC",
+ $result = SQL_QUERY_ESC("SELECT `id`, `action`, `what`, `title`, `sort` FROM `"._MYSQL_PREFIX."_guest_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC",
array($SUB), __FILE__, __LINE__);
}
if (!empty($_GET['id'])) {
// Show detailed informations to a sponsor
$result = SQL_QUERY_ESC("SELECT company, position, gender, surname, family, street_nr1, street_nr2, zip, city, country, phone, fax, cell, email, url, tax_ident, status, sponsor_created, last_online, last_change, receive_warnings, points_amount, points_used, remote_addr, warning_interval, refid, ref_count
-FROM "._MYSQL_PREFIX."_sponsor_data
+FROM `"._MYSQL_PREFIX."_sponsor_data`
WHERE id='%s' LIMIT 1",
array(bigintval($_GET['id'])), __FILE__, __LINE__);
}
// Check for sponsor's orders (only count)
- $result_orders = SQL_QUERY_ESC("SELECT COUNT(id) FROM "._MYSQL_PREFIX."_sponsor_orders WHERE sponsorid='%s'",
+ $result_orders = SQL_QUERY_ESC("SELECT COUNT(id) FROM `"._MYSQL_PREFIX."_sponsor_orders` WHERE sponsorid='%s'",
array(bigintval($_GET['id'])), __FILE__, __LINE__);
list($orders) = SQL_FETCHROW($result_orders);
SQL_FREERESULT($result_orders);
}
} elseif (!empty($_GET['rid'])) {
// Search for sponsor
- $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE id='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT id FROM `"._MYSQL_PREFIX."_sponsor_data` WHERE id='%s' LIMIT 1",
array(bigintval($_GET['rid'])), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Free memory
// Sponsor found so let's list all his referals
$result = SQL_QUERY_ESC("SELECT id, gender, surname, family, email, status, sponsor_created, last_online, points_amount, points_used, remote_addr, ref_count
-FROM "._MYSQL_PREFIX."_sponsor_data
+FROM `"._MYSQL_PREFIX."_sponsor_data`
WHERE refid='%s' ORDER BY id",
array(bigintval($_GET['rid'])), __FILE__, __LINE__);
} else {
// List all sponsors
$result_main = SQL_QUERY("SELECT id, gender, surname, family, email, status, sponsor_created, last_online, points_amount, points_used, remote_addr
-FROM "._MYSQL_PREFIX."_sponsor_data ORDER BY id", __FILE__, __LINE__);
+FROM `"._MYSQL_PREFIX."_sponsor_data` ORDER BY id", __FILE__, __LINE__);
if (SQL_NUMROWS($result_main) > 0) {
// At least one sponsor found!
$OUT = ""; $SW = 2;
$id = bigintval($id);
// Save entry
- SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_paytypes
+ SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_sponsor_paytypes`
SET pay_name='%s', pay_rate='%s', pay_min_count='%s', pay_currency='%s' WHERE id='%s' LIMIT 1",
array($_POST['name'][$id], $_POST['rate'][$id], bigintval($_POST['min'][$id]), $_POST['curr'][$id], $id),
__FILE__, __LINE__);
// Remove entries here...
foreach ($_POST['id'] as $id => $sel) {
// Remove entry
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_sponsor_paytypes WHERE id='%s' LIMIT 1",
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_sponsor_paytypes` WHERE id='%s' LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
}
if (isset($_POST['add'])) {
// Check if entry with same name does exists
- $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_sponsor_paytypes WHERE pay_name='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT id FROM `"._MYSQL_PREFIX."_sponsor_paytypes` WHERE pay_name='%s' LIMIT 1",
array($_POST['pay_name']), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 0) {
// No entry found so add this line
- SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_sponsor_paytypes (pay_name, pay_rate, pay_min_count, pay_currency)
+ SQL_QUERY_ESC("INSERT INTO `"._MYSQL_PREFIX."_sponsor_paytypes` (pay_name, pay_rate, pay_min_count, pay_currency)
VALUES ('%s','%s','%s','%s')",
array(htmlspecialchars($_POST['pay_name']), REVERT_COMMA($_POST['pay_rate']), bigintval($_POST['pay_min_count']), htmlspecialchars($_POST['pay_currency'])),
__FILE__, __LINE__);
$OUT = ""; $SW = 2;
foreach ($_POST['id'] as $id => $sel) {
// Load entry
- $result = SQL_QUERY_ESC("SELECT pay_name, pay_rate, pay_min_count, pay_currency FROM "._MYSQL_PREFIX."_sponsor_paytypes WHERE id='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT pay_name, pay_rate, pay_min_count, pay_currency FROM `"._MYSQL_PREFIX."_sponsor_paytypes` WHERE id='%s' LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load data
}
} else {
// Load all payment types
- $result = SQL_QUERY("SELECT id, pay_name, pay_rate, pay_min_count, pay_currency FROM "._MYSQL_PREFIX."_sponsor_paytypes ORDER BY pay_name",
+ $result = SQL_QUERY("SELECT id, pay_name, pay_rate, pay_min_count, pay_currency FROM `"._MYSQL_PREFIX."_sponsor_paytypes` ORDER BY pay_name",
__FILE__, __LINE__);
// Do we have some paytypes setup?
if (!empty($_GET['id'])) {
// Check for selected sponsor
- $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_sponsor_data WHERE id='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT id FROM `"._MYSQL_PREFIX."_sponsor_data` WHERE id='%s' LIMIT 1",
array(bigintval($_GET['id'])), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// ...
if (!empty($_GET['id'])) {
// Check for selected sponsor
- $result = SQL_QUERY_ESC("SELECT gender, surname, family, email, status FROM "._MYSQL_PREFIX."_sponsor_data WHERE id='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT gender, surname, family, email, status FROM `"._MYSQL_PREFIX."_sponsor_data` WHERE id='%s' LIMIT 1",
array(bigintval($_GET['id'])), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Get sponsor's current status and let only confirmed and locked status pass
SEND_EMAIL($email, $subject, $msg);
// Update sponsor's account
- SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data SET status='".$status."' WHERE id='%s' LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_sponsor_data` SET status='".$status."' WHERE id='%s' LIMIT 1",
array(bigintval($_GET['id'])), __FILE__, __LINE__);
} elseif (!empty($_POST['no'])) {
// No don't lock / unlock now!
// Load his personal data
$result_main = SQL_QUERY_ESC("SELECT gender, surname, family, email, remote_addr, sponsor_created, points_amount, refid
-FROM "._MYSQL_PREFIX."_sponsor_data
+FROM `"._MYSQL_PREFIX."_sponsor_data`
WHERE status='PENDING' AND id='%s' LIMIT 1",
array($id), __FILE__, __LINE__);
$refid = 0;
// Check for open payments and close them
$result = SQL_QUERY_ESC("SELECT DISTINCT so.aid, so.pay_count, so.pay_ordered, so.pay_status,
sp.pay_name, sp.pay_rate, sp.pay_currency
-FROM "._MYSQL_PREFIX."_sponsor_orders AS so
-LEFT JOIN "._MYSQL_PREFIX."_sponsor_paytypes AS sp
+FROM `"._MYSQL_PREFIX."_sponsor_orders` AS so
+LEFT JOIN `"._MYSQL_PREFIX."_sponsor_paytypes` AS sp
ON sp.id=so.payid
WHERE so.sponsorid='%s'
ORDER BY sp.pay_name",
SQL_FREERESULT($result_main);
// Unlock sponsor account
- SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data SET status='CONFIRMED'
+ SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_sponsor_data` SET status='CONFIRMED'
WHERE id='%s' AND status='PENDING' LIMIT 1",
array($id), __FILE__, __LINE__);
// Update, if applyable, referal count and points
if (($refid > 0) && ($refid != $id)) {
// Update referal account
- SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data
+ SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_sponsor_data`
SET points_amount=points_amount+%s, ref_count=ref_count+1
WHERE id='%s' LIMIT 1",
array(getConfig('sponsor_ref_points'), bigintval($refid)), __FILE__, __LINE__);
// Load referal's data
$result = SQL_QUERY_ESC("SELECT id, gender, surname, family, email,
(points_amount - points_used) AS points, receive_warnings, ref_count AS refs
-FROM "._MYSQL_PREFIX."_sponsor_data
+FROM `"._MYSQL_PREFIX."_sponsor_data`
WHERE id='%s' LIMIT 1",
array(bigintval($refid)), __FILE__, __LINE__);
$REFERRAL = SQL_FETCHARRAY($result);
// Begin listing of all pending sponsor accounts
$result = SQL_QUERY("SELECT id, gender, surname, family, email, remote_addr, sponsor_created
-FROM "._MYSQL_PREFIX."_sponsor_data
+FROM `"._MYSQL_PREFIX."_sponsor_data`
WHERE status='PENDING' ORDER BY id", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// Load all sponsor actions
$result_act = SQL_QUERY("SELECT DISTINCT m.title, c.conv_rate, c.conv_name
-FROM "._MYSQL_PREFIX."_sponsor_menu AS m
-LEFT JOIN "._MYSQL_PREFIX."_sponsor_action_convert AS c ON m.what=c.ext_name
-LEFT JOIN "._MYSQL_PREFIX."_sponsor_registry AS r ON m.what=r.ext_name
+FROM `"._MYSQL_PREFIX."_sponsor_menu` AS m
+LEFT JOIN `"._MYSQL_PREFIX."_sponsor_action_convert` AS c ON m.what=c.ext_name
+LEFT JOIN `"._MYSQL_PREFIX."_sponsor_registry` AS r ON m.what=r.ext_name
WHERE m.action='actions' AND r.is_active='Y'
ORDER BY m.sort ASC", __FILE__, __LINE__);
$num_act = SQL_NUMROWS($result_act);
} // END - while
// Check for pay types
- $result_pay = SQL_QUERY("SELECT pay_name, pay_rate, pay_min_count, pay_currency FROM "._MYSQL_PREFIX."_sponsor_paytypes ORDER BY pay_name", __FILE__, __LINE__);
+ $result_pay = SQL_QUERY("SELECT pay_name, pay_rate, pay_min_count, pay_currency FROM `"._MYSQL_PREFIX."_sponsor_paytypes` ORDER BY pay_name", __FILE__, __LINE__);
if (SQL_NUMROWS($result_pay) > 0) {
// Load all pay types
$OUT_PAY = ""; $SW = 2;
company, position, tax_ident,
street_nr1, street_nr2, country, zip, city, email, phone, fax, cell,
points_amount AS points, last_pay AS pay, last_curr AS curr
-FROM "._MYSQL_PREFIX."_sponsor_data
+FROM `"._MYSQL_PREFIX."_sponsor_data`
WHERE hash='%s' AND (status='UNCONFIRMED' OR status='EMAIL')
LIMIT 1", array($_GET['hash']), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Unconfirmed account or changed email address?
if ($SPONSOR['status'] == "UNCONFIRMED") {
// Set account to pending
- SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data SET status='PENDING'
+ SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_sponsor_data` SET status='PENDING'
WHERE id='%s' AND hash='%s' AND status='UNCONFIRMED' LIMIT 1",
array(bigintval($SPONSOR['id']), $_GET['hash']), __FILE__, __LINE__);
}
} elseif ($SPONSOR['status'] == "EMAIL") {
// Changed email adress need to be confirmed
- SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data SET status='CONFIRMED'
+ SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_sponsor_data` SET status='CONFIRMED'
WHERE id='%s' AND hash='%s' AND status='EMAIL' LIMIT 1",
array(bigintval($SPONSOR['id']), $_GET['hash']), __FILE__, __LINE__);
if (isset($_POST['ok'])) {
// Check email
$result = SQL_QUERY_ESC("SELECT id, hash, status, remote_addr, gender, surname, family, sponsor_created
-FROM "._MYSQL_PREFIX."_sponsor_data
+FROM `"._MYSQL_PREFIX."_sponsor_data`
WHERE email='%s' AND (status='UNCONFIRMED' OR status='EMAIL') LIMIT 1",
array($_POST['email']), __FILE__, __LINE__);
if (isset($_POST['ok'])) {
// Check email
$result = SQL_QUERY_ESC("SELECT id, hash, remote_addr, gender, surname, family, sponsor_created
-FROM "._MYSQL_PREFIX."_sponsor_data
+FROM `"._MYSQL_PREFIX."_sponsor_data`
WHERE email='%s' AND id='%s' AND status='CONFIRMED' LIMIT 1",
array($_POST['email'], bigintval($_POST['id'])), __FILE__, __LINE__);
// Entry found?
SEND_EMAIL($_POST['email'], SPONSOR_LOST_PASSWORD_SUBJ, $msg_sponsor);
// Update password
- SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data SET password='%s'
+ SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_sponsor_data` SET password='%s'
WHERE id='%s' LIMIT 1",
array(md5($SPONSOR['password']), bigintval($SPONSOR['id'])), __FILE__, __LINE__);
}
} elseif (isset($_POST['ok'])) {
// Check status and login data ...
- $result = SQL_QUERY_ESC("SELECT status FROM "._MYSQL_PREFIX."_sponsor_data
+ $result = SQL_QUERY_ESC("SELECT status FROM `"._MYSQL_PREFIX."_sponsor_data`
WHERE id='%s' AND password='%s' LIMIT 1",
array(bigintval($_POST['sponsorid']), md5($_POST['pass'])), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Calulate points
$result = SQL_QUERY_ESC("SELECT (pay_rate * pay_min_count) AS points, pay_min_count AS pay, pay_currency AS curr
-FROM "._MYSQL_PREFIX."_sponsor_paytypes
+FROM `"._MYSQL_PREFIX."_sponsor_paytypes`
WHERE id='%s' LIMIT 1", array($_POST['pay_type']), __FILE__, __LINE__);
list($points, $pay, $curr) = SQL_FETCHROW($result);
{
case "added": // Sponsor successfully added with account status = UNCONFIRMED!
// Check for his ID number
- $result = SQL_QUERY_ESC("SELECT id, hash FROM "._MYSQL_PREFIX."_sponsor_data WHERE email='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT id, hash FROM `"._MYSQL_PREFIX."_sponsor_data` WHERE email='%s' LIMIT 1",
array($_POST['email']), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1)
{
} else {
// Check for payment types
$result = SQL_QUERY("SELECT id, pay_name, pay_rate, pay_currency, pay_min_count
-FROM "._MYSQL_PREFIX."_sponsor_paytypes
+FROM `"._MYSQL_PREFIX."_sponsor_paytypes`
ORDER BY pay_name", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// Load all types...
gender, surname, family, street_nr1, street_nr2, zip, city, country,
phone, fax, cell, email, url,
status, receive_warnings
-FROM "._MYSQL_PREFIX."_sponsor_data
+FROM `"._MYSQL_PREFIX."_sponsor_data`
WHERE id='%s' AND password='%s' LIMIT 1",
array(bigintval(get_session('sponsorid')), get_session('sponsorpass')), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Data for the formular
$result = SQL_QUERY_ESC("SELECT status, receive_warnings, warning_interval, email, surname, family, gender
-FROM "._MYSQL_PREFIX."_sponsor_data
+FROM `"._MYSQL_PREFIX."_sponsor_data`
WHERE id='%s' AND password='%s' LIMIT 1",
array(bigintval(get_session('sponsorid')), get_session('sponsorpass')), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load some data
$result = SQL_QUERY_ESC("SELECT gender, surname, family, (points_amount - points_used) AS points
-FROM "._MYSQL_PREFIX."_sponsor_data
+FROM `"._MYSQL_PREFIX."_sponsor_data`
WHERE id='%s' AND password='%s' LIMIT 1",
array(bigintval(get_session('sponsorid')), get_session('sponsorpass')), __FILE__, __LINE__);
list($gender, $surname, $family, $points) = SQL_FETCHROW($result);
--- /dev/null
+Verwalten und Downloaden Sie die access_logs von Ihrem Server.
+<strong>Wichtig:</strong> Dies muss auch von Ihrem Server unterstützt
+sein!
-Platzhalter für spätere Updates. Vorsicht! Sichern Sie zuerst
-Ihre geänderten Templates ab!
+Diese Erweiterung erlaubt es Ihren Mitgliedern, Mails zu bestätigen. Sie
+gilt somit als "essential" und sollte immer installiert und aktiviert sein.
-Platzhalter für spätere Updates.
+Schalten Sie Ihren {!MT_WORD!} in den Wartungsmodus, wenn dieser mal nicht
+funktionieren sollte und Sie in Ruhe dran debuggen müssen. Bitte
+aktualisieren dann zuerst Ihre SVN-Version (SVN-Update) und falls Sie den
+Fehler nicht selber finden können, melden Sie sich bitte im
+<a href="http://forum.mxchange.org/" rel="external" target="_blank"
+ title="Direkt-Link zum Support-Forum">Forum</a> und/oder <a rel="external"
+ href="http://bugs.mxchange.org/" target="_blank"
+ title="Direkt-Link zum Bug-Tracker">Bug-Tracker</a>.<br />
+<br />
+Danke für Ihre Mithilfe bei der Suche nach Bugs! :-)
-Ausgelagerter Link "Profildaten ändern" aus dem
-Mitgliedsbereich. Dient als Platzhalter für spätere Versionen!
+Diese Erweiterung erlaubt es Ihren Mitgliedern, Ihre Profildaten zu
+ändern. Sie sollte daher in keinem {!MT_WORD!} fehlen und immer
+aktiviert sein.
-Andere Administrative Funktionen. Diese Erweiterung dient derzeit als
-Platzhalter, um das spätere Patchen der Datenbank zu erleichtern.
+Weitere wichtige Einstellungen zu Ihrem {!MT_WORD!}. Diese Erweiterung sollte
+immer installiert und aktiviert sein.
-Platzhalter für spätere Updates. Derzeit können Sie
-Pflichtfelder im Anmeldeformular (noch nicht im Mitgliedsbereich unter
-Profildaten ändern) vorgeben. Diese müsen dann bei der
-Anmeldung eingegeben werden.
+Das Anmeldeformular zu Ihrem {!MT_WORD!}. Bitte installieren Sie diese
+Erweiterung und aktivieren Sie diese auch.
--- /dev/null
+Schauen Sie sich Ihre Server-Statistiken - derzeit werden nur
+Webalizer-Statistiken unterstützt bequem aus Ihrem Adminbereich an.