From: Roland Häder Date: Tue, 23 Sep 2008 03:21:59 +0000 (+0000) Subject: Surfbar continued (unfinished) and some updates: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=51d65692668408a44920ce069a37c5fa4f5ba257;p=mailer.git Surfbar continued (unfinished) and some updates: - Surfbar extended with member actions, undelete, un-/pause and migrate (incomplete) from mail orders - Several admin templates fixed where the member selection box was used - Other misc fixes --- diff --git a/.gitattributes b/.gitattributes index 9d237d6244..3acdc2afb7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -627,6 +627,7 @@ templates/de/emails/admin/admin_support-reflink.tpl -text templates/de/emails/admin/admin_support-unconfirmed.tpl -text templates/de/emails/admin/admin_surfbar_url_confirmed.tpl -text templates/de/emails/admin/admin_surfbar_url_reg.tpl -text +templates/de/emails/admin/admin_surfbar_url_rejected.tpl -text templates/de/emails/admin/admin_surfbar_url_unlock.tpl -text templates/de/emails/admin/admin_transfer_ap.tpl -text templates/de/emails/admin/admin_transfer_points.tpl -text @@ -695,6 +696,7 @@ templates/de/emails/member/member_support-reflink.tpl -text templates/de/emails/member/member_support-unconfirmed.tpl -text templates/de/emails/member/member_surfbar_url_confirmed.tpl -text templates/de/emails/member/member_surfbar_url_reg.tpl -text +templates/de/emails/member/member_surfbar_url_rejected.tpl -text templates/de/emails/member/member_surfbar_url_unlock.tpl -text templates/de/emails/member/member_transfer_recipient.tpl -text templates/de/emails/member/member_transfer_sender.tpl -text @@ -1063,6 +1065,8 @@ templates/de/html/admin/admin_theme_edit_row.tpl -text templates/de/html/admin/admin_theme_import.tpl -text templates/de/html/admin/admin_theme_installed.tpl -text templates/de/html/admin/admin_theme_list.tpl -text +templates/de/html/admin/admin_undelete_surfbar_urls.tpl -text +templates/de/html/admin/admin_undelete_surfbar_urls_row.tpl -text templates/de/html/admin/admin_unlock_emails.tpl -text templates/de/html/admin/admin_unlock_emails_redir.tpl -text templates/de/html/admin/admin_unlock_emails_redir_row.tpl -text diff --git a/inc/databases.php b/inc/databases.php index f569eade7c..629140b684 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -113,7 +113,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // This current patch level -define('CURR_SVN_REVISION', "385"); +define('CURR_SVN_REVISION', "386"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index 08fa584ef9..f5569d760c 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -38,13 +38,13 @@ if (!defined('__SECURITY')) { } // Version number -$EXT_VERSION = "0.4.7"; +$EXT_VERSION = "0.4.8"; // Auto-set extension version if (!isset($EXT_VER)) $EXT_VER = $EXT_VERSION; // Version history array (add more with , "0.1" and so on) -$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "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", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7"); +$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "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", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7", "0.4.8"); switch ($EXT_LOAD_MODE) { @@ -616,6 +616,13 @@ PRIMARY KEY (id) // Update notes (these will be set as task text!) $UPDATE_NOTES = "Fehlgeschlagene Login-Versuche werden nun mitgezählt und der letzte vermerkt."; break; + + case "0.4.8": // SQL queries for v0.4.8 + $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_task_system ADD INDEX (subject)"; + + // Update notes (these will be set as task text!) + $UPDATE_NOTES = "Index für Betreff eingefügt."; + break; } break; diff --git a/inc/extensions/ext-surfbar.php b/inc/extensions/ext-surfbar.php index 8505ed56da..69f2dc2640 100644 --- a/inc/extensions/ext-surfbar.php +++ b/inc/extensions/ext-surfbar.php @@ -55,17 +55,17 @@ case "register": // Do stuff when installtion is running (modules.php?module=adm `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0', `url` VARCHAR(255) NOT NULL DEFAULT '', -`last_salt` VARCHAR( 255 ) NOT NULL DEFAULT '', -`reward` FLOAT(10,5) UNSIGNED NOT NULL DEFAULT '0.00000', -`costs` FLOAT(10,5) UNSIGNED NOT NULL DEFAULT '0.00000', +`payment_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +`last_salt` VARCHAR(255) NOT NULL DEFAULT '', `views_total` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0', -`status` ENUM('PENDING','CONFIRMED','LOCKED','STOPPED','REJECTED','DELETED') NOT NULL DEFAULT 'CONFIRMED', +`status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED') NOT NULL DEFAULT 'PENDING', `registered` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `last_locked` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00', `lock_reason` VARCHAR(255) NOT NULL DEFAULT '', `reject_reason` VARCHAR(255) NOT NULL DEFAULT '', PRIMARY KEY(`id`), -UNIQUE KEY `userid_url` (`userid`, `url`) +UNIQUE KEY `userid_url` (`userid`, `url`), +INDEX (`payment_id`) ) TYPE=MyISAM COMMENT='Surfbar URLs'"; // Reload locks @@ -108,9 +108,9 @@ INDEX (`userid`,`url_id`) $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_actions`"; $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_actions` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, -`status` ENUM('PENDING','CONFIRMED','LOCKED','STOPPED','REJECTED','DELETED') NOT NULL DEFAULT 'PENDING', +`status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED') NOT NULL DEFAULT 'PENDING', `action` ENUM('EDIT','DELETE','PAUSE','UNPAUSE','FRAMETEST','RETREAT','RESUBMIT') NULL DEFAULT NULL, -`new_status` ENUM('PENDING','CONFIRMED','LOCKED','STOPPED','REJECTED','DELETED') NULL DEFAULT NULL, +`new_status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED') NULL DEFAULT NULL, PRIMARY KEY (`id`), INDEX (`status`) ) TYPE=MyISAM COMMENT='Surfbar Member Actions'"; @@ -118,20 +118,24 @@ INDEX (`status`) // Member actions $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('PENDING','RETREAT','DELETED')"; $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('PENDING','FRAMETEST',NULL)"; - $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('CONFIRMED','EDIT','PENDING')"; - $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('CONFIRMED','DELETE','DELETED')"; - $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('CONFIRMED','PAUSE','PAUSED')"; - $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('CONFIRMED','FRAMETEST',NULL)"; + $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('ACTIVE','EDIT','PENDING')"; + $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('ACTIVE','DELETE','DELETED')"; + $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('ACTIVE','PAUSE','PAUSED')"; + $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('ACTIVE','FRAMETEST',NULL)"; $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('LOCKED','DELETE','DELETED')"; $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('LOCKED','FRAMETEST',NULL)"; $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('LOCKED','RESUBMIT','PENDING')"; $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('STOPPED','EDIT','PENDING')"; $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('STOPPED','DELETE','DELETED')"; - $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('STOPPED','UNPAUSE','CONFIRMED')"; + $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('STOPPED','UNPAUSE','PENDING')"; $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('REJECTED','EDIT','PENDING')"; $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('REJECTED','DELETE','DELETED')"; $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('REJECTED','FRAMETEST',NULL)"; $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('REJECTED','RESUBMIT','PENDING')"; + $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('MIGRATED','EDIT','PENDING')"; + $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('MIGRATED','DELETE','DELETED')"; + $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('MIGRATED','FRAMETEST',NULL)"; + $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_surfbar_actions` (`status`,`action`,`new_status`) VALUES('MIGRATED','RESUBMIT','PENDING')"; // Config entries $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_pay_model` ENUM('STATIC','DYNAMIC') NOT NULL DEFAULT 'STATIC'"; @@ -143,6 +147,7 @@ INDEX (`status`) $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_max_order` INT(7) UNSIGNED NOT NULL DEFAULT 10"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_restart_time` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(60*6).""; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_autostart` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_migrate_urls` ENUM('Y','N') NOT NULL DEFAULT 'Y'"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_total_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_daily_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_yester_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; @@ -150,6 +155,7 @@ INDEX (`status`) $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_monthly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_stats_reload` BIGINT(20) UNSIGNED NOT NULL DEFAULT 30"; $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_purge_deleted` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(ONE_DAY*7).""; + $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_purge_migrated` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(ONE_DAY*3).""; // Member menus $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar',NULL,'Surfbar','Y','Y',4)"; diff --git a/inc/functions.php b/inc/functions.php index 90fc0dfde3..a71c939e37 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -837,7 +837,7 @@ function LOAD_EMAIL_TEMPLATE($template, $content="", $UID="0") { // Template file not found! $newContent = TEMPLATE_404.": ".$template."
".TEMPLATE_CONTENT." -
".print_r($newContent, true)."
+
".print_r($content, true)."
".TEMPLATE_DATA."
".print_r($DATA, true)."


"; diff --git a/inc/language/cache_de.php b/inc/language/cache_de.php index 20bdf2c0d6..c66f0fc989 100644 --- a/inc/language/cache_de.php +++ b/inc/language/cache_de.php @@ -46,7 +46,7 @@ define('ADMIN_CACHE_STATS_TITLE', "Statistiken des Caching-Systems"); define('ADMIN_CACHE_DB_HITS', "Zugriffe auf die Datenbank"); define('ADMIN_CACHE_HITS', "Zugriffe auf den Cache"); define('ADMIN_CACHE_PERCENTS', "Prozentual (*)"); -define('ADMIN_CACHE_NOTES', "(*): Es ist normal, dass die Prozente später sehr niedrig sind, da trotz vieler eingesparter Zugriffe immer noch deutlich mehr Zugriffe auf die Datenbank gemacht werden."); +define('ADMIN_CACHE_NOTES', "(*): Sollten bei Ihnen die Prozente unter 50% liegen und Sie nicht vor September 2008 das Script *neu* installiert haben, so ist dies kein Grund zur Besorgnis. Im Normalfall sollten die Prozente seit eigenen Revisionen im September 2008 (R300+) über 50% liegen."); define('ADMIN_TOTAL_HITS', "Gesamtzugriffe"); define('CACHE_CANNOT_UNLINK_1', "Kann nicht die Cache-Datei "); define('CACHE_CANNOT_UNLINK_2', " vom Server entfernen!"); diff --git a/inc/language/surfbar_de.php b/inc/language/surfbar_de.php index ed6f45856b..6b6d171830 100644 --- a/inc/language/surfbar_de.php +++ b/inc/language/surfbar_de.php @@ -48,11 +48,12 @@ define('ADMIN_CONFIG_SURFBAR_PAYMENT_MODEL_STATIC', "Statische Werte verwenden." define('ADMIN_CONFIG_SURFBAR_PAYMENT_MODEL_DYNAMIC', "Dynamische Werte errechnen."); define('ADMIN_CONFIG_SURFBAR_DYNAMIC_PERCENT', "Prozent auf dynamische Vergütung/ Verweildauer/Reload-Sperre:"); define('ADMIN_CONFIG_SURFBAR_MAX_ORDER', "Maximal durch Mitglied in Surfbar buchbare URLs:"); -define('ADMIN_CONFIG_SURFBAR_RESTART_TIME', "Ruhezeit der Surfbar, wenn alle URLs in Reload-Lock sind: (*)"); +define('ADMIN_CONFIG_SURFBAR_RESTART_TIME', "Ruhezeit der Surfbar, wenn alle URLs in Reload-Lock sind: "); define('ADMIN_CONFIG_SURFBAR_AUTOSTART', "Surfbar soll nach Ruhezeit automatisch starten?"); define('ADMIN_CONFIG_SURFBAR_STATS_RELOAD', "Reload-Zeit der Statistik unterhalb der beworbenen Seite:"); define('ADMIN_CONFIG_SURFBAR_PURGE_DELETED', "Verweildauer gelöschter URLs in der Datenbank:"); -define('ADMIN_CONFIG_SURFBAR_NOTE', "(*): Es wird empfohlen, die Ruhezeit etwas länger als die Reload-Sperre einzustellen."); +define('ADMIN_CONFIG_SURFBAR_PURGE_MIGRATED', "Verweildauer migrierter URLs in der Datenbank:"); +define('ADMIN_CONFIG_SURFBAR_NOTE', "Hinweise: Es wird empfohlen, die Ruhezeit etwas länger als die Reload-Sperre einzustellen. Migrierte URLs sind aus Mailbuchungen übernommene URLs, die das Mitglied noch bestätigen muss."); // General admin text define('ADMIN_SURFBAR_NO_REF_LEVELS_FOUND', "Zur Zeit sind keine Referal-Ebenen für die Surfbar eingestellt.
\nBitte installieren Sie die Erweiterung surfbar neu."); @@ -66,11 +67,12 @@ define('ADMIN_SURFBAR_STATUS', "URL-Status"); define('ADMIN_SURFBAR_REGISTERED', "URL aufgenommen"); define('ADMIN_SURFBAR_LAST_LOCKED', "Zuletzt gesperrt"); define('ADMIN_SURFBAR_LOCK_REASON', "Sperrgrund"); -define('ADMIN_SURFBAR_EDIT_URL', "URL ändern"); -define('ADMIN_SURFBAR_EDIT_URL_NOW', "URL jetzt ändern"); -define('ADMIN_SURFBAR_DEL_URL', "URL löschen"); +define('ADMIN_SURFBAR_EDIT_URL', "URLs ändern"); +define('ADMIN_SURFBAR_EDIT_URL_NOW', "URLs jetzt ändern"); +define('ADMIN_SURFBAR_DEL_URL', "URLs löschen"); define('ADMIN_SURFBAR_DEL_URL_NOW', "URLs jetzt entfernen"); define('ADMIN_SURFBAR_UNDELETE_URL', "Löschung zurücknehmen"); +define('ADMIN_SURFBAR_UNDELETE_URL_NOW', "URLs jetzt wiederherstellen"); define('ADMIN_SURFBAR_UNLOCK_URL', "URL ent-/sperren"); define('ADMIN_SURFBAR_LOCK_URL_NOW', "URL jetzt ent-/sperren"); define('ADMIN_SURFBAR_CONFIRM_URL', "URL(s) freigeben"); @@ -80,12 +82,14 @@ define('ADMIN_SURFBAR_UNLOCK_FAILED', "Freischaltung fehlgeschlagen. Bitte nachs define('ADMIN_SURFBAR_URL_ADDED', "URL wurde der Surfbar hinzugefügt."); define('ADMIN_SURFBAR_URL_NOT_ADDED', "URL wurde wegen Fehler nicht hinzugefügt. Ist die URL bereits vorhanden?"); define('ADMIN_SURFBAR_ADD_URL', "URL hinzufügen"); +define('ADMIN_BUILD_STATUS_HANDLER', "Status-Handler"); // Admin titles define('ADMIN_SURFBAR_LIST_URLS_TITLE', "Surfbar - URLs aufisten"); define('ADMIN_SURFBAR_DELETE_URLS_TITLE', "Surfbar - URLs entfernen"); define('ADMIN_SURFBAR_EDIT_URLS_TITLE', "Surfbar - URLs editieren"); define('ADMIN_SURFBAR_LOCK_URLS_TITLE', "Surfbar - URLs sperren/entsperren"); +define('ADMIN_SURFBAR_UNDELETE_URLS_TITLE', "Surfbar - gelöschte URLs wiederherstellen"); // Member titles define('MEMBER_SURFBAR_LIST_TITLE', "Ihre URLs in der Surfbar verwalten"); @@ -103,34 +107,40 @@ define('MEMBER_SURFBAR_LAST_LOCKED', "Letzte Sperre"); define('MEMBER_SURFBAR_LOCK_REASON', "Sperrgrund"); define('MEMBER_SURFBAR_ACTIONS', "Aktionen"); define('MEMBER_SURFBAR_TEST_URL', "URL anzeigen"); -define('MEMBER_SURFBAR_LIST_NOTE', "Bitte beachten Sie, dass Editieren und erneutes Aktivieren von gestoppten URLs eine Freischaltung durch unsere Administratoren nötig ist."); -define('MEMBER_SURFBAR_ACTION_DONE', "Ausgew&aumml;hlte Aktion ausgeführt."); +define('MEMBER_SURFBAR_LIST_NOTE', "Bitte beachten Sie, dass Editieren, erneutes Aktivieren von gestoppten URLs und nochmalige Anmeldung nach Ablehnung eine Freischaltung durch unsere Administratoren nötig ist."); +define('MEMBER_SURFBAR_ACTION_DONE', "Ausgewählte Aktion ausgeführt."); define('MEMBER_SURFBAR_ACTION_FAILED', "Ausgewählte Aktion konnte nicht vollständig ausgeführt werden!"); // Subject lines for admins -define('ADMIN_SURFBAR_NOTIFY_URL_UNLOCK_SUBJECT', "URL in Surfbar gebucht"); -define('ADMIN_SURFBAR_NOTIFY_URL_REG_SUBJECT', "Mitglied hat URL in Surfbar gebucht"); -define('ADMIN_SURFBAR_NOTIFY_URL_CONFIRMED_SUBJECT', "URL in Surfbar freigegeben"); +define('ADMIN_SURFBAR_NOTIFY_URL_UNLOCK_SUBJECT', "[Surfbar:] URL hinzugefügt durch Admin"); +define('ADMIN_SURFBAR_NOTIFY_URL_REG_SUBJECT', "[Surfbar:] Mitgliedsbuchung einer URL"); +define('ADMIN_SURFBAR_NOTIFY_URL_ACTIVE_SUBJECT', "[Surfbar:] Freigabe einer URL"); +define('ADMIN_SURFBAR_NOTIFY_URL_DELETED_SUBJECT', "[Surfbar:] URL gelöscht"); +define('ADMIN_SURFBAR_NOTIFY_URL_REJECTED_SUBJECT', "[Surfbar:] URL abgelehnt"); +define('ADMIN_SURFBAR_NOTIFY_DEFAULT_SUBJECT', "Problem in Surfbar-Betreff"); // Auto-generated admin subject lines define('ADMIN_DEL_SURFBAR_URLS_SUBJECT', "[Surfbar:] URL entfernt"); define('ADMIN_EDIT_SURFBAR_URLS_SUBJECT', "[Surfbar:] URL geändert"); -define('ADMIN_CONFIRMED_SURFBAR_URLS_SUBJECT', "[Surfbar:] Freigabe einer URL"); +define('ADMIN_ACTIVE_SURFBAR_URLS_SUBJECT', "[Surfbar:] Freigabe einer URL"); define('ADMIN_LOCKED_SURFBAR_URLS_SUBJECT', "[Surfbar:] Sperrung einer URL"); // Subject lines for members define('MEMBER_SURFBAR_NOTIFY_URL_UNLOCK_SUBJECT', "Ihre URL wurde in die Surfbar aufgenommen"); define('MEMBER_SURFBAR_NOTIFY_URL_REG_SUBJECT', "Ihre URL in der Surfbar wartet auf Freischaltung"); -define('MEMBER_SURFBAR_NOTIFY_URL_CONFIRMED_SUBJECT', "Ihre URL wurde für die Surfbar freigegeben"); +define('MEMBER_SURFBAR_NOTIFY_URL_ACTIVE_SUBJECT', "Ihre URL wurde für die Surfbar freigegeben"); +define('MEMBER_SURFBAR_NOTIFY_URL_DELETED_SUBJECT', "Löschung Ihrer URL aus der Surfbar"); +define('MEMBER_SURFBAR_NOTIFY_URL_REJECTED_SUBJECT', "Ihre URL wurde für die Surfbar abgelehnt!"); +define('MEMBER_SURFBAR_NOTIFY_DEFAULT_SUBJECT', "[Fehler:] Bitte leiten Sie diese Mail an uns weiter!"); // Auto-generated member subject lines define('MEMBER_DEL_SURFBAR_URLS_SUBJECT', "Ihre URL wurde aus der Surfbar entfernt"); define('MEMBER_EDIT_SURFBAR_URLS_SUBJECT', "Änderung Ihrer URL in der Surfbar"); define('MEMBER_LOCKED_SURFBAR_URLS_SUBJECT', "Sperrung Ihrer URL in Surfbar, bitte AGBs beachten!"); -define('MEMBER_CONFIRMED_SURFBAR_URLS_SUBJECT', "Freigabe Ihrer URL in Surfbar"); +define('MEMBER_ACTIVE_SURFBAR_URLS_SUBJECT', "Freigabe Ihrer URL in Surfbar"); // URL status -define('SURFBAR_URL_STATUS_CONFIRMED', "Freigegeben"); +define('SURFBAR_URL_STATUS_ACTIVE', "Freigegeben"); define('SURFBAR_URL_STATUS_LOCKED', "Gesperrt"); define('SURFBAR_URL_STATUS_PENDING', "Wartend"); define('SURFBAR_URL_STATUS_STOPPED', "Angehalten"); @@ -140,10 +150,16 @@ define('SURFBAR_URL_STATUS_DELETED', "Gelöscht"); // Member actions - submit buttons define('MEMBER_SURFBAR_ACTION_RETREAT_SUBMIT', "Zurücknehmen"); define('MEMBER_SURFBAR_ACTION_FRAMETEST_SUBMIT', "Framkiller-Test"); +define('MEMBER_SURFBAR_ACTION_EDIT_SUBMIT', "Ändern"); +define('MEMBER_SURFBAR_ACTION_DELETE_SUBMIT', "Löschen"); +define('MEMBER_SURFBAR_ACTION_RESUBMIT_SUBMIT', "Nochmal anmelden"); // Member actions - button titles define('MEMBER_SURFBAR_ACTION_RETREAT_TITLE', "Nehmen Sie hiermit Ihre Buchung wieder zurück, falls Sie diese doch nicht bewerben wollten."); define('MEMBER_SURFBAR_ACTION_FRAMETEST_TITLE', "Testen Sie die Seite auf Framekiller hin, diese sind in unserer Surfbar grundsätzlich nicht gestattet."); +define('MEMBER_SURFBAR_ACTION_EDIT_TITLE', "Ändern Sie hier Ihre URL, wenn diese nicht stimmen sollte. Allerdings wird Ihre URL dann auf Freischaltung wartend gesetzt, damit wir sie vor Aufnahme nochmals kontrollieren können."); +define('MEMBER_SURFBAR_ACTION_DELETE_TITLE', "Löschen Sie URLs, die in unserem System nicht mehr beworben werden sollen. Ihre URL wird dann als zu Löschen markiert und wird dann von uns entgültig gelöscht. Dies gilt als Vorsichtsmaßnahme."); +define('MEMBER_SURFBAR_ACTION_RESUBMIT_TITLE', "Melden Sie Ihre URL erneut an, wenn Sie diese an unsere AGBs angepasst haben, wie z.B. Framekiller oder Hardcore/Erotik entfernt. Diese sind bei uns nicht gestattet."); // ?> diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php index 9d4ebe630d..dcf0902e2a 100644 --- a/inc/libs/surfbar_functions.php +++ b/inc/libs/surfbar_functions.php @@ -58,12 +58,8 @@ function SURFBAR_ADMIN_ADD_URL ($url) { return false; } - // Do we have fixed or dynamic payment model? - $reward = SURFBAR_DETERMINE_REWARD(); - $costs = SURFBAR_DETERMINE_COSTS(); - // Register the new URL - return SURFBAR_REGISTER_URL($url, "0", $reward, $costs, "0", "CONFIRMED", "unlock"); + return SURFBAR_REGISTER_URL($url, "0", "0", "ACTIVE", "unlock"); } // Admin function for unlocking URLs function SURFBAR_ADMIN_UNLOCK_URL_IDS ($IDs) { @@ -85,7 +81,33 @@ function SURFBAR_ADMIN_UNLOCK_URL_IDS ($IDs) { // Update the status for all ids foreach ($IDs as $id => $dummy) { // Test all ids through (ignores failed) - $done = (($done) && (SURFBAR_CHANGE_STATUS($id, "PENDING", "CONFIRMED"))); + $done = (($done) && (SURFBAR_CHANGE_STATUS($id, "PENDING", "ACTIVE"))); + } // END - if + + // Return total status + return $done; +} +// Admin function for rejecting URLs +function SURFBAR_ADMIN_REJECT_URL_IDS ($IDs) { + // Is this an admin or invalid array? + if (!IS_ADMIN()) { + // Not admin or invalid IDs array + return false; + } elseif (!is_array($IDs)) { + // No array + return false; + } elseif (count($IDs) == 0) { + // Empty array + return false; + } + + // Set to true to make AND expression valid if first URL got unlocked + $done = true; + + // Update the status for all ids + foreach ($IDs as $id => $dummy) { + // Test all ids through (ignores failed) + $done = (($done) && (SURFBAR_CHANGE_STATUS($id, "PENDING", "REJECTED"))); } // END - if // Return total status @@ -115,12 +137,8 @@ function SURFBAR_MEMBER_ADD_URL ($url) { return false; } - // Do we have fixed or dynamic payment model? - $reward = SURFBAR_DETERMINE_REWARD(); - $costs = SURFBAR_DETERMINE_COSTS(); - // Register the new URL - return SURFBAR_REGISTER_URL($url, $GLOBALS['userid'], $reward, $costs); + return SURFBAR_REGISTER_URL($url, $GLOBALS['userid']); } // Create list of actions depending on status for the user function SURFBAR_MEMBER_ACTIONS ($urlId, $status) { @@ -161,13 +179,83 @@ function SURFBAR_MEMBER_ACTIONS ($urlId, $status) { } // Do the member form request function SURFBAR_MEMBER_DO_FORM ($formData, $URLs) { + global $SURFBAR_CACHE; + + // By default no action is performed + $performed = false; + // Is this a member? if (!IS_MEMBER()) { // No member! return false; + } elseif ((!isset($formData['id'])) || (!isset($formData['action']))) { + // Important form elements are missing! + return false; + } elseif (!isset($URLs[$formData['id']])) { + // ID not found in cache + return false; + } elseif (!SURFBAR_VALIDATE_MEMBER_ACTION_STATUS($formData['action'], $URLs[$formData['id']]['status'])) { + // Action not allowed for current URL status + return false; + } + + // Create the function name for selected action + $functionName = sprintf("SURFBAR_MEMBER_%s_ACTION", strtoupper(SQL_ESCAPE($formData['action']))); + + // Is the function there? + if (function_exists($functionName)) { + // Add new status + $URLs[$formData['id']]['new_status'] = $SURFBAR_CACHE['new_status']; + + // Extract URL data for call-back + $urlData = array($URLs[$formData['id']]); + + // Action found so execute it + $performed = call_user_func_array($functionName, $urlData); + } else { + // Log invalid request + DEBUG_LOG(__FUNCTION__.": action={$formData['action']},id={$formData['id']},function={$functionName}"); + } + + // Return status + return $performed; +} +// Validate if the requested action can be performed on current URL status +function SURFBAR_VALIDATE_MEMBER_ACTION_STATUS ($action, $status) { + global $SURFBAR_CACHE; + + // Search for the requested action/status combination in database + $result = SQL_QUERY_ESC("SELECT new_status FROM "._MYSQL_PREFIX."_surfbar_actions WHERE action='%s' AND status='%s' LIMIT 1", + array($action, $status), __FILE__, __LINE__); + + // Is the entry there? + $isValid = (SQL_NUMROWS($result) == 1); + + // Fetch the new status if found + if ($isValid) { + list($SURFBAR_CACHE['new_status']) = SQL_FETCHROW($result); } // END - if - /* DEBUG: */ die("
".print_r($formData, true)."
".print_r($URLs, true)."
"); + // Free result + SQL_FREERESULT($result); + + // Return status + return $isValid; +} +// +// ----------------------------------------------------------------------------- +// Member actions +// ----------------------------------------------------------------------------- +// +// Retreat an URL +function SURFBAR_MEMBER_RETREAT_ACTION ($urlData) { + // Create the data array for next function call + $data = array( + $urlData['id'] => $urlData + ); + + // Simply change the status here + return SURFBAR_CHANGE_STATUS ($urlData['id'], $urlData['status'], $urlData['new_status'], $data); } // // ----------------------------------------------------------------------------- @@ -202,7 +290,7 @@ function SURFBAR_GET_URL_DATA ($searchTerm, $column="id", $order="id", $sort="AS } // END - if // Look up the record - $result = SQL_QUERY_ESC("SELECT id, userid, url, reward, costs, views_total, status, registered, last_locked, lock_reason + $result = SQL_QUERY_ESC("SELECT id, userid, url, views_total, status, registered, last_locked, lock_reason FROM "._MYSQL_PREFIX."_surfbar_urls WHERE %s='%s' ORDER BY %s %s @@ -231,7 +319,7 @@ ORDER BY %s %s return $lastUrlData; } // Registers an URL with the surfbar. You should have called SURFBAR_LOOKUP_BY_URL() first! -function SURFBAR_REGISTER_URL ($url, $uid, $reward, $costs, $paymentId=0, $status="PENDING", $addMode="reg") { +function SURFBAR_REGISTER_URL ($url, $uid, $paymentId=0, $status="PENDING", $addMode="reg") { global $_CONFIG; // Make sure by the user registered URLs are always pending @@ -242,8 +330,6 @@ function SURFBAR_REGISTER_URL ($url, $uid, $reward, $costs, $paymentId=0, $statu 'url' => $url, 'frametester' => FRAMETESTER($url), 'uid' => $uid, - 'reward' => $reward, - 'costs' => $costs, 'status' => $status ); @@ -252,8 +338,6 @@ function SURFBAR_REGISTER_URL ($url, $uid, $reward, $costs, $paymentId=0, $statu // Translate status, reward and costs $content['status'] = SURFBAR_TRANSLATE_STATUS($content['status']); - $content['reward'] = TRANSLATE_COMMA($content['reward']); - $content['costs'] = TRANSLATE_COMMA($content['costs']); // If in reg-mode we notify admin if (($addMode == "reg") || ($_CONFIG['surfbar_notify_admin_unlock'] == "Y")) { @@ -276,12 +360,10 @@ function SURFBAR_INSERT_URL_BY_ARRAY ($urlData) { if (empty($uid)) $uid = 0; // Just run the insert query for now - SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_surfbar_urls (userid, url, reward, costs, status) VALUES('%s', '%s', %s, %s, '%s')", + SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_surfbar_urls (userid, url, status) VALUES(%s, '%s', '%s')", array( $uid, $urlData['url'], - (float)$urlData['reward'], - (float)$urlData['costs'], $urlData['status'] ), __FILE__, __LINE__ ); @@ -294,11 +376,14 @@ function SURFBAR_NOTIFY_ADMIN ($messageType, $content) { // Prepare template name $templateName = sprintf("admin_surfbar_%s", $messageType); + // Set default subject if following eval() wents wrong + $subject = ADMIN_SURFBAR_NOTIFY_DEFAULT_SUBJECT; + // Prepare subject $eval = sprintf("\$subject = ADMIN_SURFBAR_NOTIFY_%s_SUBJECT;", strtoupper($messageType) ); - eval($eval); + @eval($eval); // Send the notification out return SEND_ADMIN_NOTIFICATION($subject, $templateName, $content, $content['uid']); @@ -313,11 +398,14 @@ function SURFBAR_NOTIFY_USER ($messageType, $content) { // Prepare template name $templateName = sprintf("member_surfbar_%s", $messageType); + // Set default subject if following eval() wents wrong + $subject = MEMBER_SURFBAR_NOTIFY_DEFAULT_SUBJECT; + // Prepare subject $eval = sprintf("\$subject = MEMBER_SURFBAR_NOTIFY_%s_SUBJECT;", strtoupper($messageType) ); - eval($eval); + @eval($eval); // Load template $mailText = LOAD_EMAIL_TEMPLATE($templateName, $content); @@ -343,7 +431,7 @@ function SURFBAR_TRANSLATE_STATUS ($status) { return $statusTranslated; } // Determine reward -function SURFBAR_DETERMINE_REWARD () { +function SURFBAR_DETERMINE_REWARD ($onlyMin=false) { global $_CONFIG; // Static values are default @@ -352,23 +440,18 @@ function SURFBAR_DETERMINE_REWARD () { // Do we have static or dynamic? if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") { // "Calculate" dynamic reward - $reward += SURFBAR_CALCULATE_DYNAMIC_ADD(); + if ($onlyMin) { + $reward += SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE(); + } else { + $reward += SURFBAR_CALCULATE_DYNAMIC_ADD(); + } } // END - if // Return reward return $reward; } -// "Calculate" dynamic add -function SURFBAR_CALCULATE_DYNAMIC_ADD () { - // Get min/max values - $min = SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE(); - $max = SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE(); - - // "Calculate" dynamic part and return it - return mt_rand($min, $max); -} // Determine costs -function SURFBAR_DETERMINE_COSTS () { +function SURFBAR_DETERMINE_COSTS ($onlyMin=false) { global $_CONFIG; // Static costs is default @@ -377,12 +460,25 @@ function SURFBAR_DETERMINE_COSTS () { // Do we have static or dynamic? if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") { // "Calculate" dynamic costs - $costs += SURFBAR_CALCULATE_DYNAMIC_ADD(); + if ($onlyMin) { + $costs += SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE(); + } else { + $costs += SURFBAR_CALCULATE_DYNAMIC_ADD(); + } } // END - if // Return costs return $costs; } +// "Calculate" dynamic add +function SURFBAR_CALCULATE_DYNAMIC_ADD () { + // Get min/max values + $min = SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE(); + $max = SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE(); + + // "Calculate" dynamic part and return it + return mt_rand($min, $max); +} // Determine right template name function SURFBAR_DETERMINE_TEMPLATE_NAME() { // Default is the frameset @@ -446,8 +542,8 @@ LIMIT 1", // Return result return $isFull; } -// Get total amount of URLs of given status for current user or of CONFIRMED URLs by default -function SURFBAR_GET_TOTAL_URLS ($status="CONFIRMED", $excludeUserId="") { +// Get total amount of URLs of given status for current user or of ACTIVE URLs by default +function SURFBAR_GET_TOTAL_URLS ($status="ACTIVE", $excludeUserId="") { // Determine depleted user account $UIDs = SURFBAR_DETERMINE_DEPLETED_USERIDS(); @@ -694,14 +790,14 @@ function SURFBAR_DETERMINE_DEPLETED_USERIDS() { // Get all userid except logged in one $result = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_surfbar_urls -WHERE userid NOT IN (%s,0) AND status='CONFIRMED' +WHERE userid NOT IN (%s,0) AND status='ACTIVE' GROUP BY userid ORDER BY userid ASC", array($GLOBALS['userid']), __FILE__, __LINE__); } else { // Get all userid $result = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_surfbar_urls -WHERE status='CONFIRMED' +WHERE status='ACTIVE' GROUP BY userid ORDER BY userid ASC", __FILE__, __LINE__); } @@ -766,9 +862,13 @@ function SURFBAR_DETERMINE_WAIT_TIME () { return $time; } // Changes the status of an URL from given to other -function SURFBAR_CHANGE_STATUS ($urlId, $prevStatus, $newStatus) { - // Get URL data for status comparison - $data = SURFBAR_GET_URL_DATA($urlId); +function SURFBAR_CHANGE_STATUS ($urlId, $prevStatus, $newStatus, $data=array()) { + global $_CONFIG; + + // Get URL data for status comparison if missing + if (count($data) == 0) { + $data = SURFBAR_GET_URL_DATA($urlId); + } // END - if // Is the status like prevStatus is saying? if ($data[$urlId]['status'] != $prevStatus) { @@ -776,9 +876,12 @@ function SURFBAR_CHANGE_STATUS ($urlId, $prevStatus, $newStatus) { return false; } // END - if + // Update the status now - SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_surfbar_urls SET status='%s' WHERE id=%s LIMIT 1", - array($newStatus, bigintval($urlId)), __FILE__, __LINE__); + // ---------------------- Commented out for debugging member actions! ----------------------- + //SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_surfbar_urls SET status='%s' WHERE id=%s LIMIT 1", + // array($newStatus, bigintval($urlId)), __FILE__, __LINE__); + // ---------------------- Commented out for debugging member actions! ----------------------- // Was that fine? if (SQL_AFFECTEDROWS() != 1) { @@ -789,8 +892,8 @@ function SURFBAR_CHANGE_STATUS ($urlId, $prevStatus, $newStatus) { // Prepare content for notification routines $data[$urlId]['uid'] = $data[$urlId]['userid']; $data[$urlId]['frametester'] = FRAMETESTER($data[$urlId]['url']); - $data[$urlId]['reward'] = TRANSLATE_COMMA($data[$urlId]['reward']); - $data[$urlId]['costs'] = TRANSLATE_COMMA($data[$urlId]['costs']); + $data[$urlId]['reward'] = TRANSLATE_COMMA($_CONFIG['surfbar_static_reward']); + $data[$urlId]['costs'] = TRANSLATE_COMMA($_CONFIG['surfbar_static_costs']); $data[$urlId]['status'] = SURFBAR_TRANSLATE_STATUS($newStatus); $data[$urlId]['registered'] = MAKE_DATETIME($data[$urlId]['registered'], "2"); $newStatus = strtolower($newStatus); @@ -824,10 +927,10 @@ function SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE () { $addon += abs(log($onlineUsers / $totalUsers + 1) * $percent * $totalUsers); // Get total URLs - $totalUrls = SURFBAR_GET_TOTAL_URLS("CONFIRMED", "0"); + $totalUrls = SURFBAR_GET_TOTAL_URLS("ACTIVE", "0"); // Get user's total URLs - $userUrls = SURFBAR_GET_TOTAL_USER_URLS(0, "CONFIRMED"); + $userUrls = SURFBAR_GET_TOTAL_USER_URLS(0, "ACTIVE"); // Calculate addon if ($totalUrls > 0) { @@ -859,7 +962,7 @@ function SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE () { $addon += abs($max * $percent * $totalUsers); // Get total URLs - $totalUrls = SURFBAR_GET_TOTAL_URLS("CONFIRMED", "0"); + $totalUrls = SURFBAR_GET_TOTAL_URLS("ACTIVE", "0"); // Calculate addon $addon += abs($max * $percent * $totalUrls); @@ -946,7 +1049,7 @@ LEFT JOIN "._MYSQL_PREFIX."_surfbar_salts AS sbs ON sbu.id=sbs.url_id LEFT JOIN "._MYSQL_PREFIX."_surfbar_locks AS l ON sbu.id=l.url_id -WHERE sbu.userid NOT IN (".implode(",", $UIDs).") AND sbu.status='CONFIRMED'".$ADD." +WHERE sbu.userid NOT IN (".implode(",", $UIDs).") AND sbu.status='ACTIVE'".$ADD." GROUP BY sbu.id", __FILE__, __LINE__); // Log last query @@ -967,7 +1070,7 @@ function SURFBAR_GET_USER_URLS () { $URLs = array(); // Begin the query - $result = SQL_QUERY_ESC("SELECT u.id, u.url, u.views_total, u.status, UNIX_TIMESTAMP(u.registered) AS registered, UNIX_TIMESTAMP(u.last_locked) AS last_locked, u.lock_reason AS lock_reason + $result = SQL_QUERY_ESC("SELECT u.id, u.userid, u.url, u.views_total, u.status, UNIX_TIMESTAMP(u.registered) AS registered, UNIX_TIMESTAMP(u.last_locked) AS last_locked, u.lock_reason AS lock_reason FROM "._MYSQL_PREFIX."_surfbar_urls AS u WHERE u.userid=%s AND u.status != 'DELETED' ORDER BY u.id ASC", @@ -1059,7 +1162,7 @@ LEFT JOIN "._MYSQL_PREFIX."_surfbar_salts AS sbs ON sbu.id=sbs.url_id LEFT JOIN "._MYSQL_PREFIX."_surfbar_locks AS l ON sbu.id=l.url_id -WHERE sbu.userid NOT IN (".implode(",", $UIDs).") AND sbu.status='CONFIRMED'".$ADD." +WHERE sbu.userid NOT IN (".implode(",", $UIDs).") AND sbu.status='ACTIVE'".$ADD." GROUP BY sbu.id ORDER BY l.last_surfed ASC, sbu.id ASC LIMIT %s,1", @@ -1073,7 +1176,7 @@ LEFT JOIN "._MYSQL_PREFIX."_surfbar_salts AS sbs ON sbu.id=sbs.url_id LEFT JOIN "._MYSQL_PREFIX."_surfbar_locks AS l ON sbu.id=l.url_id -WHERE sbu.userid != %s AND sbu.status='CONFIRMED' AND sbu.id=%s +WHERE sbu.userid != %s AND sbu.status='ACTIVE' AND sbu.id=%s LIMIT 1", array($GLOBALS['userid'], bigintval($urlId)), __FILE__, __LINE__ ); diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 14f5067367..2c3dffea5d 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -585,7 +585,7 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) { } } // -function ADD_MEMBER_SELECTION_BOX ($def="0", $add_all=false, $return=false, $none=false) +function ADD_MEMBER_SELECTION_BOX ($def="0", $add_all=false, $return=false, $none=false, $field="userid") { // Output selection form with all confirmed user accounts listed $result = SQL_QUERY("SELECT userid, surname, family FROM "._MYSQL_PREFIX."_user_data ORDER BY userid", __FILE__, __LINE__); @@ -614,8 +614,8 @@ function ADD_MEMBER_SELECTION_BOX ($def="0", $add_all=false, $return=false, $non // Load template LOAD_TEMPLATE("admin_member_selection_box", false, $GLOBALS['what']); } else { - // Return content - return "\n"; + // Return content in selection frame + return "\n"; } } // @@ -946,14 +946,90 @@ function ADMIN_BUILD_LIST ($listType, $IDs, $table, $columns, $filterFunctions, // Load master template LOAD_TEMPLATE("admin_".$listType."_".$table."", false, $OUT); } +// Change status of "build" list +function ADMIN_BUILD_STATUS_HANDLER ($mode, $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $statusArray) { + // All valid entries? (We hope so here!) + if ((is_array($IDs)) && (count($IDs) > 0) && (count($columns) == count($filterFunctions)) && (count($columns) == count($extraValues)) && (count($statusArray) > 0)) { + // "Walk" through all entries + foreach ($IDs as $id => $sel) { + // Construct SQL query + $SQL = "UPDATE "._MYSQL_PREFIX."_".$table." SET"; + + // Load data of entry + $result = SQL_QUERY_ESC("SELECT * FROM "._MYSQL_PREFIX."_%s WHERE %s=%s LIMIT 1", + array($table, $idColumn, $id), __FILE__, __LINE__); + + // Fetch the data + $content = SQL_FETCHARRAY($result); + + // Free the result + SQL_FREERESULT($result); + + // Add all status entries (e.g. status column last_updated or so) + $newStatus = "UNKNOWN"; + $oldStatus = "UNKNOWN"; + $statusColumn = "unknown"; + foreach ($statusArray as $column => $statusInfo) { + // Does the entry exist? + if ((isset($content[$column])) && (isset($statusInfo[$content[$column]]))) { + // Add these entries for update + $SQL .= sprintf(" %s='%s',", SQL_ESCAPE($column), SQL_ESCAPE($statusInfo[$content[$column]])); + + // Remember status + if ($statusColumn == "unknown") { + // Always (!!!) change status column first! + $oldStatus = $content[$column]; + $newStatus = $statusInfo[$oldStatus]; + $statusColumn = $column; + } // END - if + } elseif (isset($content[$column])) { + // Unfinished! + mxchange_die("{--".__FUNCTION__."--}:UNFINISHED: id={$id}/{$column}[".gettype($statusInfo)."] = {$content[$column]}"); + } + } // END - foreach + + // Add other columns as well + foreach ($_POST as $key => $entries) { + // Skip id, raw userid and 'do_lock' + if (!in_array($key, array($idColumn, 'uid_raw', 'do_lock'))) { + // Are there brackets () at the end? + if (substr($entries[$id], -2, 2) == "()") { + // Direct SQL command found + $SQL .= sprintf(" %s=%s,", SQL_ESCAPE($key), SQL_ESCAPE($entries[$id])); + } else { + // Add regular entry + $SQL .= sprintf(" %s='%s',", SQL_ESCAPE($key), SQL_ESCAPE($entries[$id])); + } + } // END - if + } // END - if + + // Finish SQL statement + $SQL = substr($SQL, 0, -1) . " WHERE ".$idColumn."=".bigintval($id)." AND ".$statusColumn."='".$oldStatus."' LIMIT 1"; + + // Run the SQL + SQL_QUERY($SQL, __FILE__, __LINE__); + + // Do we have an URL? + if (isset($content['url'])) { + // Then add a framekiller test as well + $content['frametester'] = FRAMETESTER($content['url']); + } // END - if + + // Send "build mails" out + ADMIN_SEND_BUILD_MAILS($mode, $table, $content, $id, $statusInfo[$content[$column]]); + } // END - foreach + } // END - if +} // Delete rows by given ID numbers function ADMIN_DELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunctions=array(), $extraValues=array(), $deleteNow=false, $idColumn="id", $userIdColumn="userid") { // All valid entries? (We hope so here!) if ((is_array($IDs)) && (count($IDs) > 0) && (count($columns) == count($filterFunctions)) && (count($columns) == count($extraValues))) { // Shall we delete here or list for deletion? if ($deleteNow) { - // Delete them + // The base SQL command: $SQL = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_%s WHERE %s IN (%s)"; + + // Delete them all $idList = ""; foreach ($IDs as $id => $sel) { // Is there a userid? @@ -974,7 +1050,7 @@ function ADMIN_DELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFu // Add id number $idList .= $id.","; - } // END - if + } // END - foreach // Run the query SQL_QUERY($SQL, array($table, $idColumn, substr($idList, 0, -1)), __FILE__, __LINE__); @@ -1040,7 +1116,9 @@ function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunc // Then add a framekiller test as well $content['frametester'] = FRAMETESTER($content[$key]); } // END - if - } + } // END - foreach + + // Finish SQL command $SQL = substr($SQL, 0, -1) . " WHERE ".$idColumn."=".bigintval($id)." LIMIT 1"; // Run this query @@ -1085,79 +1163,27 @@ function ADMIN_LOCK_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunc // Shall we un-/lock here or list for locking? if ($lockNow) { // Un-/lock entries - foreach ($IDs as $id => $sel) { - // Construct SQL query - $SQL = "UPDATE "._MYSQL_PREFIX."_".$table." SET"; - - // Load data of entry - $result = SQL_QUERY_ESC("SELECT * FROM "._MYSQL_PREFIX."_%s WHERE %s=%s LIMIT 1", - array($table, $idColumn, $id), __FILE__, __LINE__); - - // Fetch the data - $content = SQL_FETCHARRAY($result); - - // Free the result - SQL_FREERESULT($result); - - // Add all status entries (e.g. status column last_updated or so) - $newStatus = "UNKNOWN"; - $oldStatus = "UNKNOWN"; - $statusColumn = "unknown"; - foreach ($statusArray as $column => $statusInfo) { - // Does the entry exist? - if ((isset($content[$column])) && (isset($statusInfo[$content[$column]]))) { - // Add these entries for update - $SQL .= sprintf(" %s='%s',", SQL_ESCAPE($column), SQL_ESCAPE($statusInfo[$content[$column]])); - - // Remember status - if ($statusColumn == "unknown") { - // Always (!!!) change status column first! - $oldStatus = $content[$column]; - $newStatus = $statusInfo[$oldStatus]; - $statusColumn = $column; - } // END - if - } elseif (isset($content[$column])) { - // Unfinished! - die("UNFINISHED: {$column}[".gettype($statusInfo)."] = {$content[$column]}"); - } - } // END - foreach - - // Add other columns as well - foreach ($_POST as $key => $entries) { - // Skip id, raw userid and 'do_lock' - if (!in_array($key, array($idColumn, 'uid_raw', 'do_lock'))) { - // Are there brackets () at the end? - if (substr($entries[$id], -2, 2) == "()") { - // Direct SQL command found - $SQL .= sprintf(" %s=%s,", SQL_ESCAPE($key), SQL_ESCAPE($entries[$id])); - } else { - // Add regular entry - $SQL .= sprintf(" %s='%s',", SQL_ESCAPE($key), SQL_ESCAPE($entries[$id])); - } - } // END - if - } // END - if - - // Finish SQL statement - $SQL = substr($SQL, 0, -1) . " WHERE ".$idColumn."=".bigintval($id)." AND ".$statusColumn."='".$oldStatus."' LIMIT 1"; - - // Run the SQL - SQL_QUERY($SQL, __FILE__, __LINE__); - - // Do we have an URL? - if (isset($content['url'])) { - // Then add a framekiller test as well - $content['frametester'] = FRAMETESTER($content['url']); - } // END - if - - // Send "build mails" out - ADMIN_SEND_BUILD_MAILS("lock", $table, $content, $id, $statusInfo[$content[$column]]); - } // END - if + ADMIN_BUILD_STATUS_HANDLER("lock", $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn); } else { // List for editing ADMIN_BUILD_LIST("lock", $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn); } } // END - if } +// Undelete rows by given ID numbers +function ADMIN_UNDELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunctions=array(), $extraValues=array(), $statusArray=array(), $lockNow=false, $idColumn="id", $userIdColumn="userid") { + // All valid entries? (We hope so here!) + if ((is_array($IDs)) && (count($IDs) > 0) && (count($columns) == count($filterFunctions)) && (count($columns) == count($extraValues)) && ((!$lockNow) || (count($statusArray) == 1))) { + // Shall we un-/lock here or list for locking? + if ($lockNow) { + // Undelete entries + ADMIN_BUILD_STATUS_HANDLER("undelete", $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $statusArray); + } else { + // List for editing + ADMIN_BUILD_LIST("undelete", $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn); + } + } // END - if +} // Checks proxy settins by fetching check-updates3.php from www.mxchange.org function ADMIN_TEST_PROXY_SETTINGS ($settingsArray) { global $_CONFIG; diff --git a/inc/modules/admin/what-config_beg.php b/inc/modules/admin/what-config_beg.php index f624247aa5..05f92154a3 100644 --- a/inc/modules/admin/what-config_beg.php +++ b/inc/modules/admin/what-config_beg.php @@ -160,7 +160,7 @@ if (isset($_POST['ok'])) } // Add data to constant __MEMBER_SELECTION - ADD_MEMBER_SELECTION_BOX($_CONFIG['beg_uid'], false, true, true); + define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX($_CONFIG['beg_uid'], false, true, true, "beg_uid")); // Load form template LOAD_TEMPLATE("admin_config_beg"); diff --git a/inc/modules/admin/what-config_bonus.php b/inc/modules/admin/what-config_bonus.php index 5c4b671a2d..f979a22360 100644 --- a/inc/modules/admin/what-config_bonus.php +++ b/inc/modules/admin/what-config_bonus.php @@ -86,7 +86,7 @@ if (isset($_POST['ok'])) define('__TLINES_VALUE', $_CONFIG['bonus_lines']); // Transfer options to template __MEMBER_SELECTION - ADD_MEMBER_SELECTION_BOX($_CONFIG['bonus_uid'], false, true, true); + define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX($_CONFIG['bonus_uid'], false, true, true)); // Initialize array for the points list $RANKS = explode(";", $_CONFIG['bonus_ranks']); diff --git a/inc/modules/admin/what-config_doubler.php b/inc/modules/admin/what-config_doubler.php index c9b54ddaf1..88110e3935 100644 --- a/inc/modules/admin/what-config_doubler.php +++ b/inc/modules/admin/what-config_doubler.php @@ -124,7 +124,7 @@ if (isset($_POST['ok'])) { } // Transfer options (!!!) to __MEMBER_SELECTION - ADD_MEMBER_SELECTION_BOX($_CONFIG['doubler_uid'], false, true, true); + define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX($_CONFIG['doubler_uid'], false, true, true, "doubler_uid")); // Number of rows to display (option lines!!!) define('__DOUBLER_DISPLAY_NEW', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), $_CONFIG['doubler_display_new'])); diff --git a/inc/modules/admin/what-config_refid.php b/inc/modules/admin/what-config_refid.php index 46b26debac..22ca2ee2ed 100644 --- a/inc/modules/admin/what-config_refid.php +++ b/inc/modules/admin/what-config_refid.php @@ -45,7 +45,7 @@ if (isset($_POST['ok'])) { ADMIN_SAVE_SETTINGS($_POST); } else { // Prepare contants for the template - ADD_MEMBER_SELECTION_BOX($_CONFIG['def_refid'], false, true, true); + define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX($_CONFIG['def_refid'], false, true, true, "def_refid")); switch ($_CONFIG['refid_target']) { case "index": define('__DEF_RT_INDEX', " selected=\"selected\""); define('__DEF_RT_REGISTER', ""); break; diff --git a/inc/modules/admin/what-config_surfbar.php b/inc/modules/admin/what-config_surfbar.php index 8533ba0414..409b105073 100644 --- a/inc/modules/admin/what-config_surfbar.php +++ b/inc/modules/admin/what-config_surfbar.php @@ -63,7 +63,9 @@ if (isset($_POST['ok'])) { // @TODO Rewrite this to tiny selection boxes 'surfbar_stats_reload' => $_CONFIG['surfbar_stats_reload'], // @TODO Rewrite this to tiny selection boxes - 'surfbar_purge_deleted' => $_CONFIG['surfbar_purge_deleted'] + 'surfbar_purge_deleted' => $_CONFIG['surfbar_purge_deleted'], + // @TODO Rewrite this to tiny selection boxes + 'surfbar_purge_migrated' => $_CONFIG['surfbar_purge_migrated'] ); // Prepare payment model for template diff --git a/inc/modules/admin/what-config_title.php b/inc/modules/admin/what-config_title.php index c4c97606c4..9d1c0399a9 100644 --- a/inc/modules/admin/what-config_title.php +++ b/inc/modules/admin/what-config_title.php @@ -53,7 +53,7 @@ if (isset($_POST['ok'])) define('__CFG_TITLE_RIGHT' , $_CONFIG['title_right']); define('__CFG_TITLE_DECOS' , ADD_SELECTION("yn", $_CONFIG['enable_title_deco'], "enable_title_deco")); define('__CFG_TITLE_MOD_SHOW' , ADD_SELECTION("yn", $_CONFIG['enable_mod_title'] , "enable_mod_title" )); - define('__CFG_TITLE_WHAT_SHOW', ADD_SELECTION("yn", $_CONFIG['title_what_show'] , "enable_what_title")); + define('__CFG_TITLE_WHAT_SHOW', ADD_SELECTION("yn", $_CONFIG['enable_what_title'], "enable_what_title")); // Load template LOAD_TEMPLATE("admin_config_title"); diff --git a/inc/modules/admin/what-list_surfbar_urls.php b/inc/modules/admin/what-list_surfbar_urls.php index 9cf67c054f..b1c9f5a216 100644 --- a/inc/modules/admin/what-list_surfbar_urls.php +++ b/inc/modules/admin/what-list_surfbar_urls.php @@ -59,9 +59,9 @@ if (isset($_POST['edit'])) { ADMIN_EDIT_ENTRIES_CONFIRM( $_POST['id'], "surfbar_urls", - array("", ""), - array('reward' => "REVERT_COMMA", 'costs' => "REVERT_COMMA"), - array('reward' => "", 'costs' => ""), + array(), + array(), + array(), true ); } elseif (isset($_POST['delete'])) { @@ -95,12 +95,12 @@ if (isset($_POST['edit'])) { array(), array(), array(), - array("status" => array("CONFIRMED" => "LOCKED", "LOCKED" => "CONFIRMED")), + array("status" => array("ACTIVE" => "LOCKED", "LOCKED" => "ACTIVE")), true ); } elseif (isset($_POST['undelete'])) { // Undelete selected URLs. This does only work for deleted URLs... ;-) - ADMIN_LOCK_ENTRIES_CONFIRM( + ADMIN_UNDELETE_ENTRIES_CONFIRM( $_POST['id'], "surfbar_urls", array("id", "userid", "url", "registered", "status"), @@ -110,13 +110,13 @@ if (isset($_POST['edit'])) { $show = false; } elseif (isset($_POST['do_undelete'])) { // Undelete selected URLs. This does only work for deleted URLs... ;-) - ADMIN_LOCK_ENTRIES_CONFIRM( + ADMIN_UNDELETE_ENTRIES_CONFIRM( $_POST['id'], "surfbar_urls", array(), array(), array(), - array("status" => array("DELETED" => "CONFIRMED"), + array("status" => array("DELETED" => "ACTIVE")), true ); } @@ -125,7 +125,7 @@ if (isset($_POST['edit'])) { if (!$show) return false; // List all URLs -$result = SQL_QUERY("SELECT id, userid, url, reward, costs, views_total, status, UNIX_TIMESTAMP(registered) AS registered, UNIX_TIMESTAMP(last_locked) AS last_locked, lock_reason +$result = SQL_QUERY("SELECT id, userid, url, views_total, status, UNIX_TIMESTAMP(registered) AS registered, UNIX_TIMESTAMP(last_locked) AS last_locked, lock_reason FROM "._MYSQL_PREFIX."_surfbar_urls ORDER BY id ASC", __FILE__, __LINE__); @@ -138,8 +138,6 @@ if (SQL_NUMROWS($result) > 0) { $content['sw'] = $SW; $content['userid'] = ADMIN_USER_PROFILE_LINK($content['userid']); $content['url'] = FRAMETESTER($content['url']); - $content['reward'] = TRANSLATE_COMMA($content['reward']); - $content['costs'] = TRANSLATE_COMMA($content['costs']); $content['views_total'] = TRANSLATE_COMMA($content['views_total']); $content['status'] = SURFBAR_TRANSLATE_STATUS($content['status']); $content['registered'] = MAKE_DATETIME($content['registered'], 2); diff --git a/inc/modules/admin/what-unlock_emails.php b/inc/modules/admin/what-unlock_emails.php index 1d68063407..dd2eac0e65 100644 --- a/inc/modules/admin/what-unlock_emails.php +++ b/inc/modules/admin/what-unlock_emails.php @@ -77,7 +77,7 @@ INNER JOIN "._MYSQL_PREFIX."_payments AS pay ON po.payment_id=pay.id WHERE po.id=%s LIMIT 1", - array($id), __FILE__, __LINE__); + array($id), __FILE__, __LINE__); // Load data $DATA = SQL_FETCHARRAY($result); diff --git a/inc/modules/admin/what-unlock_surfbar_urls.php b/inc/modules/admin/what-unlock_surfbar_urls.php index 4bae745901..b11221535c 100644 --- a/inc/modules/admin/what-unlock_surfbar_urls.php +++ b/inc/modules/admin/what-unlock_surfbar_urls.php @@ -62,7 +62,7 @@ if ((isset($_POST['unlock'])) && (is_array($_POST['id'])) && (count($_POST['id'] } // List all URLs -$result = SQL_QUERY("SELECT id, userid, url, reward, costs, UNIX_TIMESTAMP(registered) AS registered +$result = SQL_QUERY("SELECT id, userid, url, UNIX_TIMESTAMP(registered) AS registered FROM "._MYSQL_PREFIX."_surfbar_urls WHERE status='PENDING' ORDER BY id ASC", __FILE__, __LINE__); @@ -76,8 +76,6 @@ if (SQL_NUMROWS($result) > 0) { $content['sw'] = $SW; $content['userid'] = ADMIN_USER_PROFILE_LINK($content['userid']); $content['url'] = FRAMETESTER($content['url']); - $content['costs'] = TRANSLATE_COMMA($content['costs']); - $content['reward'] = TRANSLATE_COMMA($content['reward']); $content['registered'] = MAKE_DATETIME($content['registered'], 2); // Load row template diff --git a/inc/modules/frametester.php b/inc/modules/frametester.php index f605ae5824..4e3f4f3054 100644 --- a/inc/modules/frametester.php +++ b/inc/modules/frametester.php @@ -54,8 +54,7 @@ if (!empty($_GET['order'])) { // This fixes a white page $_POST['url'] = $url; - // Update his login data - UPDATE_LOGIN_DATA(); + // Mode is member $MODE = "member"; } else { // Matching line not found! diff --git a/inc/modules/member/what-surfbar_book.php b/inc/modules/member/what-surfbar_book.php index 528c3d2b9b..e2fa03b55c 100644 --- a/inc/modules/member/what-surfbar_book.php +++ b/inc/modules/member/what-surfbar_book.php @@ -69,8 +69,8 @@ if (!SURFBAR_IF_USER_BOOK_MORE_URLS()) { } else { // Prepare some content $content = array( - 'reward' => TRANSLATE_COMMA(SURFBAR_DETERMINE_REWARD()), - 'costs' => TRANSLATE_COMMA(SURFBAR_DETERMINE_COSTS()), + 'reward' => TRANSLATE_COMMA(SURFBAR_DETERMINE_REWARD(true)), + 'costs' => TRANSLATE_COMMA(SURFBAR_DETERMINE_COSTS(true)), 'max_order' => $_CONFIG['surfbar_max_order'], 'curr_order' => SURFBAR_GET_TOTAL_USER_URLS() ); diff --git a/inc/modules/member/what-surfbar_list.php b/inc/modules/member/what-surfbar_list.php index 05657ff174..8879d19843 100644 --- a/inc/modules/member/what-surfbar_list.php +++ b/inc/modules/member/what-surfbar_list.php @@ -48,7 +48,7 @@ $URLs = SURFBAR_GET_USER_URLS(); // Are there entries or form is submitted? if ((isset($_POST['ok'])) && (isset($_POST['action'])) && (isset($_POST['id']))) { // Process the form - if (SURFBAR_MEMBER_DO_FORM($_POST)) { + if (SURFBAR_MEMBER_DO_FORM($_POST, $URLs)) { // Action performed LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_SURFBAR_ACTION_DONE); } else { diff --git a/inc/modules/member/what-surfbar_start.php b/inc/modules/member/what-surfbar_start.php index a5f81030d0..5730b73b9c 100644 --- a/inc/modules/member/what-surfbar_start.php +++ b/inc/modules/member/what-surfbar_start.php @@ -59,7 +59,7 @@ if ($_CONFIG['surfbar_pay_model'] == "DYNAMIC") { // Total URLs $content = array( 'surfbar_dynamic_percent' => TRANSLATE_COMMA($_CONFIG['surfbar_dynamic_percent']), - 'surfbar_total_urls' => SURFBAR_GET_TOTAL_URLS("CONFIRMED", "0"), + 'surfbar_total_urls' => SURFBAR_GET_TOTAL_URLS("ACTIVE", "0"), 'surfbar_user_urls' => SURFBAR_GET_TOTAL_USER_URLS(), 'surfbar_total_online' => SURFBAR_DETERMINE_TOTAL_ONLINE(), 'surfbar_total_users' => TRANSLATE_COMMA(GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true)), diff --git a/inc/modules/order.php b/inc/modules/order.php index c0164a51d7..110ae78277 100644 --- a/inc/modules/order.php +++ b/inc/modules/order.php @@ -68,9 +68,6 @@ if (empty($URL)) { // Finally is the entry valid? if (SQL_AFFECTEDROWS() == 1) { - // Update his login data - UPDATE_LOGIN_DATA(); - // Load personal data... $result = SQL_QUERY_ESC("SELECT gender, surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 2774a3ba1c..5433a771ee 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -583,10 +583,16 @@ function WHAT_IS_VALID($act, $wht, $type="guest") // function IS_MEMBER() { - global $status, $LAST; + global $status, $LAST, $cacheArray; if (!is_array($LAST)) $LAST = array(); $ret = false; + // is the cache entry there? + if (isset($cacheArray['is_member'])) { + // Then return it + return $cacheArray['is_member']; + } // END - if + // Fix "deleted" cookies first FIX_DELETED_COOKIES(array('userid', 'u_hash', 'lifetime')); @@ -639,29 +645,26 @@ function IS_MEMBER() unset($GLOBALS['userid']); } + // Cache status + $cacheArray['is_member'] = $ret; + // Return status return $ret; } // -function UPDATE_LOGIN_DATA ($UPDATE=true) { +function UPDATE_LOGIN_DATA () { global $LAST, $_CONFIG; if (!is_array($LAST)) $LAST = array(); - // Are the required cookies set? - if ((!isset($GLOBALS['userid'])) || (!isSessionVariableSet('u_hash')) || (!isSessionVariableSet('lifetime'))) { - // Nope, then return here to caller function - return false; - } else { - // Secure user ID - $GLOBALS['userid'] = bigintval(get_session('userid')); - } + // Recheck if logged in + if (!IS_MEMBER()) return false; + + // Secure user ID + $GLOBALS['userid'] = bigintval(get_session('userid')); // Extract last online time (life) and how long is auto-login valid (time) $newl = time() + bigintval(get_session('lifetime')); - // Recheck if logged in - if (!IS_MEMBER()) return false; - // Load last module and last online time $result = SQL_QUERY_ESC("SELECT last_module, last_online FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { diff --git a/inc/pool-update.php b/inc/pool-update.php index 509e04b754..f5d6a9b36f 100644 --- a/inc/pool-update.php +++ b/inc/pool-update.php @@ -56,7 +56,7 @@ if ($HTML_EXT) { } // Reset variables -$cnt = 0; $cnt2 = 0; $LAST_SENT_ID = 0; $cnt_back = array("0"); $points_BACK = array("0"); +$cnt = 0; $cnt2 = 0; $LAST_SENT_ID = 0; $cnt_back = array("0"); $pointsBack = array("0"); if (SQL_NUMROWS($result_main) > 0) { while ($DATA = SQL_FETCHROW($result_main)) @@ -273,7 +273,7 @@ if (SQL_NUMROWS($result_main) > 0) { if ($uid > 0) { - // User does not exists, pay points back + // User does exist so pay the points back $points = GET_PAY_POINTS($DATA[5]); $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_points SET points=points+%s WHERE userid=%s AND ref_depth=0 LIMIT 1", array($points, bigintval($DATA[1])), __FILE__, __LINE__); @@ -287,7 +287,7 @@ if (SQL_NUMROWS($result_main) > 0) } // Add points together and remove user - $points_BACK[$DATA[1]] += $points; + $pointsBack[$DATA[1]] += $points; } $cnt_back[$DATA[1]]++; } @@ -301,8 +301,8 @@ if (SQL_NUMROWS($result_main) > 0) } } } - if ((sizeof($points_BACK) > 0) && (!empty($points_BACK[0]))) { - foreach ($points_BACK as $uid => $PB) { + if ((sizeof($pointsBack) > 0) && (!empty($pointsBack[0]))) { + foreach ($pointsBack as $uid => $PB) { // Add points only when we have points left to add and a valid user ID if (($PB > 0) && ($uid > 0)) { // Prepare content diff --git a/install.php b/install.php index 3e394cc273..4cad098b71 100644 --- a/install.php +++ b/install.php @@ -15,14 +15,10 @@ * Short description : Installation script. Please delete this file * * after successfully installation or ANYONE can re-setup * * your mail exchange script!!! * - * * - * First of all setup the base URL. * * -------------------------------------------------------------------- * * Kurzbeschreibung : Installationsscript. Bitte loeschen Sie diese * * Datei nach der fertiggestellten Installation oder JEDER * * kann Ihr Mailtausch-Script neu einstellen!!! * - * * - * Als erstes sollten Sie die Basis-URL einstellen. * * -------------------------------------------------------------------- * * * * -------------------------------------------------------------------- * @@ -53,7 +49,8 @@ require ("inc/libs/security_functions.php"); // Init "action" and "what" global $what, $action; -$GLOBALS['what'] = ""; $GLOBALS['action'] = ""; +$GLOBALS['what'] = ""; +$GLOBALS['action'] = ""; // Set module $GLOBALS['module'] = "install"; @@ -65,16 +62,15 @@ require ("inc/config.php"); require (PATH."inc/header.php"); // Reload page to page=welcome when it is not specified -if (!isset($_GET['page'])) -{ +if (!isset($_GET['page'])) { LOAD_URL("install.php?page=welcome"); -} +} // END - if // Already installed? if ((isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered'))) { // Add fatal message ADD_FATAL(ALREADY_INSTALLED); -} +} // END - if // Does something goes wrong? if ((sizeof($FATAL == 0)) && (empty($FATAL[0]))) { diff --git a/mailid.php b/mailid.php index 746217aa62..fcb310d01b 100644 --- a/mailid.php +++ b/mailid.php @@ -111,8 +111,13 @@ if (isBooleanConstantAndTrue('mxchange_installed')) if (SQL_NUMROWS($result) == 1) { // Load data list($pool, $URL, $EXTRA_TITLE) = SQL_FETCHROW($result); + + // Free result SQL_FREERESULT($result); + // Compile extra title + $EXTRA_TITLE = COMPILE_CODE($EXTRA_TITLE); + // Is the user's ID unlocked? $result = SQL_QUERY_ESC("SELECT status, gender, surname, family FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1", array($url_uid), __FILE__, __LINE__); diff --git a/modules.php b/modules.php index b24aee4126..72cd6943e0 100644 --- a/modules.php +++ b/modules.php @@ -67,9 +67,6 @@ if (IS_MEMBER()) { list($s, $f) = SQL_FETCHROW($result); $username = $s." ".$f; - // Update only cookies and no login data! - UPDATE_LOGIN_DATA(false); - // Additionally admin? if (IS_ADMIN()) { // Add it diff --git a/templates/de/emails/admin/admin_del_surfbar_urls.tpl b/templates/de/emails/admin/admin_del_surfbar_urls.tpl index b27cb31f25..87d0352da7 100644 --- a/templates/de/emails/admin/admin_del_surfbar_urls.tpl +++ b/templates/de/emails/admin/admin_del_surfbar_urls.tpl @@ -8,10 +8,6 @@ Gebuchte URL: $content[url] ------------------------------------------ User-ID: $content[userid] ------------------------------------------ -Kosten/Aufruf: $content[costs] {!POINTS!} ------------------------------------------- -Vergütung/Aufruf: $content[reward] {!POINTS!} ------------------------------------------- Status: $content[status] ------------------------------------------ Aufrufe gesamt: $content[views_total] diff --git a/templates/de/emails/admin/admin_edit_surfbar_urls.tpl b/templates/de/emails/admin/admin_edit_surfbar_urls.tpl index f04fdcb9e4..6474ad6202 100644 --- a/templates/de/emails/admin/admin_edit_surfbar_urls.tpl +++ b/templates/de/emails/admin/admin_edit_surfbar_urls.tpl @@ -13,12 +13,6 @@ $content[frametester] Alte User-ID: $DATA[userid] Neue User-ID: $content[userid] ------------------------------------------ -Alte Kosten/Aufruf: $DATA[costs] {!POINTS!} -Neue Kosten/Aufruf: $content[costs] {!POINTS!} ------------------------------------------- -Alte Vergütung/Aufruf: $DATA[reward] {!POINTS!} -Neue Vergütung/Aufruf: $content[reward] {!POINTS!} ------------------------------------------- Angemeldet: $DATA[registered] ------------------------------------------ ID in der Surfbar: $DATA[id] diff --git a/templates/de/emails/admin/admin_lock_confirmed_surfbar_urls.tpl b/templates/de/emails/admin/admin_lock_confirmed_surfbar_urls.tpl index 492b03a2db..2d77e64422 100644 --- a/templates/de/emails/admin/admin_lock_confirmed_surfbar_urls.tpl +++ b/templates/de/emails/admin/admin_lock_confirmed_surfbar_urls.tpl @@ -11,10 +11,6 @@ $content[frametester] ------------------------------------------ User-ID: $content[userid] ------------------------------------------ -Kosten/Aufruf: $content[costs] {!POINTS!} ------------------------------------------- -Vergütung/Aufruf: $content[reward] {!POINTS!} ------------------------------------------- Sperrgrund: $content[lock_reason] ------------------------------------------ Letzte Sperrung: $content[last_locked] diff --git a/templates/de/emails/admin/admin_lock_locked_surfbar_urls.tpl b/templates/de/emails/admin/admin_lock_locked_surfbar_urls.tpl index c1db5196de..80696d4540 100644 --- a/templates/de/emails/admin/admin_lock_locked_surfbar_urls.tpl +++ b/templates/de/emails/admin/admin_lock_locked_surfbar_urls.tpl @@ -11,10 +11,6 @@ $content[frametester] ------------------------------------------ User-ID: $content[userid] ------------------------------------------ -Kosten/Aufruf: $content[costs] {!POINTS!} ------------------------------------------- -Vergütung/Aufruf: $content[reward] {!POINTS!} ------------------------------------------- Sperrgrund: $content[lock_reason] ------------------------------------------ Letzte Sperrung: $content[last_locked] diff --git a/templates/de/emails/admin/admin_surfbar_url_confirmed.tpl b/templates/de/emails/admin/admin_surfbar_url_confirmed.tpl index 0051031721..0ee32fc7f3 100644 --- a/templates/de/emails/admin/admin_surfbar_url_confirmed.tpl +++ b/templates/de/emails/admin/admin_surfbar_url_confirmed.tpl @@ -13,10 +13,6 @@ User-ID: $content[uid] ------------------------------------------ Angemeldet: $content[registered] ------------------------------------------ -Kosten/Aufruf: $content[costs] {!POINTS!} ------------------------------------------- -Vergütung/Aufruf: $content[reward] {!POINTS!} ------------------------------------------- Status: $content[status] ------------------------------------------ ID in der Surfbar: $content[id] diff --git a/templates/de/emails/admin/admin_surfbar_url_reg.tpl b/templates/de/emails/admin/admin_surfbar_url_reg.tpl index 1d86efc8a1..eb593b2173 100644 --- a/templates/de/emails/admin/admin_surfbar_url_reg.tpl +++ b/templates/de/emails/admin/admin_surfbar_url_reg.tpl @@ -13,10 +13,6 @@ $content[frametester] ------------------------------------------ User-ID: $content[uid] ------------------------------------------ -Kosten/Aufruf: $content[costs] {!POINTS!} ------------------------------------------- -Vergütung/Aufruf: $content[reward] {!POINTS!} ------------------------------------------- Status: $content[status] ------------------------------------------ ID in der Surfbar: $content[insert_id] diff --git a/templates/de/emails/admin/admin_surfbar_url_rejected.tpl b/templates/de/emails/admin/admin_surfbar_url_rejected.tpl new file mode 100644 index 0000000000..c380d0ee31 --- /dev/null +++ b/templates/de/emails/admin/admin_surfbar_url_rejected.tpl @@ -0,0 +1,24 @@ +{--HELLO_ADMIN--}, + +Ein Administrator hat soeben folgende URL in der Surfbar abgelehnt. + +Hier sind alle Daten von der URL: +------------------------------------------ +Gebuchte URL: $content[url] +------------------------------------------ +Framekiller-Test: +$content[frametester] +------------------------------------------ +User-ID: $content[uid] +------------------------------------------ +Angemeldet: $content[registered] +------------------------------------------ +Status: $content[status] +------------------------------------------ +ID in der Surfbar: $content[id] +------------------------------------------ + +{--ADMIN_THANX--} + {--YOUR--} {!MAIN_TITLE!} {--SCRIPT--} + +{!URL!}/admin.php diff --git a/templates/de/emails/member/member_edit_surfbar_urls.tpl b/templates/de/emails/member/member_edit_surfbar_urls.tpl index 99d4881131..ce9df31e67 100644 --- a/templates/de/emails/member/member_edit_surfbar_urls.tpl +++ b/templates/de/emails/member/member_edit_surfbar_urls.tpl @@ -6,10 +6,6 @@ Hier sind alle Daten dazu: ------------------------------------------ Gebuchte URL: $DATA[url] ------------------------------------------ -Neue Vergütung/Aufruf: $content[reward] {!POINTS!} ------------------------------------------- -Neue Kosten/Aufruf: $content[costs] {!POINTS!} ------------------------------------------- Aufrufe gesamt: $DATA[views_total] ------------------------------------------ Angemeldet: $DATA[registered] diff --git a/templates/de/emails/member/member_surfbar_url_rejected.tpl b/templates/de/emails/member/member_surfbar_url_rejected.tpl new file mode 100644 index 0000000000..8a0c19e0d4 --- /dev/null +++ b/templates/de/emails/member/member_surfbar_url_rejected.tpl @@ -0,0 +1,19 @@ +{--HELLO--} Mitglied, + +Ihre gebuchte URL wurde von uns in unserer Surfbar abgelehnt. Bitte halten Sie sich an unsere AGBs und binden Sie keine Framekiller in Ihre Webseite ein. Diese stören unsere Surfbar. + +Hier sind alle Daten: +------------------------------------------ +Gebuchte URL: $content[url] +------------------------------------------ +Ihre User-ID: $content[uid] +------------------------------------------ +Status: $content[status] +------------------------------------------ +ID in der Surfbar: $content[id] +------------------------------------------ + +Mit freundlichem Gruss, + Ihr {!MAIN_TITLE!} Team + +{!URL!} ({!WEBMASTER!}) diff --git a/templates/de/html/admin/admin_config_beg.tpl b/templates/de/html/admin/admin_config_beg.tpl index d909842aea..e11767e688 100644 --- a/templates/de/html/admin/admin_config_beg.tpl +++ b/templates/de/html/admin/admin_config_beg.tpl @@ -60,10 +60,9 @@ {--ADMIN_BEG_USERID--}:   - + + {!__MEMBER_SELECTION!} +   @@ -85,7 +84,7 @@ -   +   diff --git a/templates/de/html/admin/admin_config_bonus.tpl b/templates/de/html/admin/admin_config_bonus.tpl index db613358d6..fa70120de7 100644 --- a/templates/de/html/admin/admin_config_bonus.tpl +++ b/templates/de/html/admin/admin_config_bonus.tpl @@ -257,7 +257,7 @@   diff --git a/templates/de/html/admin/admin_config_doubler.tpl b/templates/de/html/admin/admin_config_doubler.tpl index c3cc7525a3..3d48b98022 100644 --- a/templates/de/html/admin/admin_config_doubler.tpl +++ b/templates/de/html/admin/admin_config_doubler.tpl @@ -131,10 +131,9 @@ {--ADMIN_DOUBLER_USERID--}:   - + + {!__MEMBER_SELECTION!} +   diff --git a/templates/de/html/admin/admin_config_refid.tpl b/templates/de/html/admin/admin_config_refid.tpl index d52e1f3db6..f79ec6a991 100644 --- a/templates/de/html/admin/admin_config_refid.tpl +++ b/templates/de/html/admin/admin_config_refid.tpl @@ -15,10 +15,9 @@   {--ADMIN_SELECT_DEF_REFID--}:   - + + {!__MEMBER_SELECTION!} +   diff --git a/templates/de/html/admin/admin_config_reg_pro.tpl b/templates/de/html/admin/admin_config_reg_pro.tpl index 328ec85517..d9904478f5 100644 --- a/templates/de/html/admin/admin_config_reg_pro.tpl +++ b/templates/de/html/admin/admin_config_reg_pro.tpl @@ -52,4 +52,4 @@   - \ No newline at end of file + diff --git a/templates/de/html/admin/admin_config_surfbar.tpl b/templates/de/html/admin/admin_config_surfbar.tpl index c172e6b8f3..8af5f8ea85 100644 --- a/templates/de/html/admin/admin_config_surfbar.tpl +++ b/templates/de/html/admin/admin_config_surfbar.tpl @@ -86,6 +86,15 @@ +   + + + {--ADMIN_CONFIG_SURFBAR_PURGE_MIGRATED--} + + + + +   diff --git a/templates/de/html/admin/admin_edit_surfbar_urls.tpl b/templates/de/html/admin/admin_edit_surfbar_urls.tpl index e625a71421..cd9e90ac3e 100644 --- a/templates/de/html/admin/admin_edit_surfbar_urls.tpl +++ b/templates/de/html/admin/admin_edit_surfbar_urls.tpl @@ -1,19 +1,17 @@
- - - - + $content - diff --git a/templates/de/html/admin/admin_edit_surfbar_urls_row.tpl b/templates/de/html/admin/admin_edit_surfbar_urls_row.tpl index 5864657bdb..1c9d9149da 100644 --- a/templates/de/html/admin/admin_edit_surfbar_urls_row.tpl +++ b/templates/de/html/admin/admin_edit_surfbar_urls_row.tpl @@ -7,10 +7,4 @@ - - diff --git a/templates/de/html/admin/admin_list_surfbar_urls.tpl b/templates/de/html/admin/admin_list_surfbar_urls.tpl index c3de9b260d..475132b8e2 100644 --- a/templates/de/html/admin/admin_list_surfbar_urls.tpl +++ b/templates/de/html/admin/admin_list_surfbar_urls.tpl @@ -1,7 +1,7 @@
+ {--ADMIN_SURFBAR_EDIT_URLS_TITLE--}
{--_UID--}{--ADMIN_TEST_URL--}{--ADMIN_SURFBAR_REWARD--}{--ADMIN_SURFBAR_COSTS--}{--ADMIN_TEST_URL--}
- {!POINTS!} - - {!POINTS!} -
- @@ -9,8 +9,6 @@ - - @@ -19,7 +17,7 @@ $content - - - diff --git a/templates/de/html/admin/admin_undelete_surfbar_urls.tpl b/templates/de/html/admin/admin_undelete_surfbar_urls.tpl new file mode 100644 index 0000000000..c772260968 --- /dev/null +++ b/templates/de/html/admin/admin_undelete_surfbar_urls.tpl @@ -0,0 +1,22 @@ + +
+ {--ADMIN_SURFBAR_LIST_URLS_TITLE--}
{--ID_SELECT--} {--_UID--} {--ADMIN_TEST_URL--}{--ADMIN_SURFBAR_REWARD--}{--ADMIN_SURFBAR_COSTS--} {--ADMIN_SURFBAR_VIEWS_TOTAL--} {--ADMIN_SURFBAR_STATUS--} {--ADMIN_SURFBAR_REGISTERED--}
{--ADMIN_TEST_URL--} - $content[reward] {!POINTS!} - - $content[costs] {!POINTS!} - $content[views_total]
+ + + + + + + + + +$content + + + +
+ {--ADMIN_SURFBAR_UNDELETE_URLS_TITLE--} +
{--_UID--}{--ADMIN_TEST_URL--}{--ADMIN_SURFBAR_STATUS--}{--ADMIN_SURFBAR_REGISTERED--}
+
diff --git a/templates/de/html/admin/admin_undelete_surfbar_urls_row.tpl b/templates/de/html/admin/admin_undelete_surfbar_urls_row.tpl new file mode 100644 index 0000000000..8e10a5e78a --- /dev/null +++ b/templates/de/html/admin/admin_undelete_surfbar_urls_row.tpl @@ -0,0 +1,16 @@ + + + + + $content[userid] + + + {--ADMIN_TEST_URL--} + + + $content[status] + + + $content[registered] + + diff --git a/templates/de/html/admin/admin_unlock_surfbar_urls.tpl b/templates/de/html/admin/admin_unlock_surfbar_urls.tpl index 5761720e08..ac635514b9 100644 --- a/templates/de/html/admin/admin_unlock_surfbar_urls.tpl +++ b/templates/de/html/admin/admin_unlock_surfbar_urls.tpl @@ -1,7 +1,7 @@
- @@ -9,13 +9,11 @@ - - $content - - - diff --git a/templates/de/html/member/member_surfbar_book_dynamic.tpl b/templates/de/html/member/member_surfbar_book_dynamic.tpl index 7336c0d7b5..3ad33dad59 100644 --- a/templates/de/html/member/member_surfbar_book_dynamic.tpl +++ b/templates/de/html/member/member_surfbar_book_dynamic.tpl @@ -1,7 +1,7 @@
- URL in Surfbar buchen: + URL in Surfbar buchen - Dynamisch:
@@ -9,10 +9,10 @@
- Jeder Seiten-Aufruf durch andere Mitglieder kostet Ihnen mindestens $content[costs] {!POINTS!}. Surfen Sie mit - der Surfbar erhalten Sie mindestens $content[reward] - {!POINTS!} auf Ihr Konto gutgeschrieben.
+ Jeder Seiten-Aufruf durch andere Mitglieder kostet Ihnen mindestens + $content[costs] {!POINTS!}. Surfen Sie mit der Surfbar + erhalten Sie mindestens $content[reward] {!POINTS!} auf + Ihr Konto gutgeschrieben.

Sie haben bereits $content[curr_order] von maximal $content[max_order] erlaubten URLs gebucht. @@ -24,3 +24,10 @@
+ +
+ Die maximalen Kosten bzw. Einnahmen pro Surfbaraufruf richten sich nach + verschiedenen Faktoren. Schauen Sie unter Surfbar starten + nach, wenn Sie genaueres dazu wissen möchten. +
diff --git a/templates/de/html/member/member_surfbar_book_static.tpl b/templates/de/html/member/member_surfbar_book_static.tpl index 49385e17ce..7622733995 100644 --- a/templates/de/html/member/member_surfbar_book_static.tpl +++ b/templates/de/html/member/member_surfbar_book_static.tpl @@ -1,7 +1,7 @@
- URL in Surfbar buchen: + URL in Surfbar buchen - Statisch:
+ {--EDIT_DEL_REFDEPTH--}
{--ID_SELECT--} {--_UID--} {--ADMIN_TEST_URL--}{--ADMIN_SURFBAR_REWARD--}{--ADMIN_SURFBAR_COSTS--} {--ADMIN_SURFBAR_REGISTERED--}
{--ADMIN_TEST_URL--} - $content[reward] {!POINTS!} - - $content[costs] {!POINTS!} - $content[registered]