From: Roland Häder Date: Sun, 23 Nov 2008 23:49:05 +0000 (+0000) Subject: Unsupported/non-working extensions gollox and affiliblatt added, yoomedia extension... X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=commitdiff_plain;h=bf01243fde80bcd43029376788dc3ec341620c6d Unsupported/non-working extensions gollox and affiliblatt added, yoomedia extension fixed (typo in function name) --- diff --git a/.gitattributes b/.gitattributes index 08db658cbe..7164938b5a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1510,4 +1510,30 @@ theme/desert/images/help/left.jpg -text theme/desert/images/help/right.jpg -text theme/desert/images/help/up.jpg -text theme/desert/theme.php -text +unsupported/affiliblatt/inc/extensions/ext-affiliblatt.php -text +unsupported/affiliblatt/inc/language/affiliblatt_de.php -text +unsupported/affiliblatt/inc/libs/affiliblatt_functions.php -text +unsupported/affiliblatt/inc/modules/admin/what-config_affiliblatt.php -text +unsupported/affiliblatt/inc/modules/admin/what-list_affiliblatt_tm.php -text +unsupported/affiliblatt/inc/reset/reset_affiliblatt.php -text +unsupported/affiliblatt/templates/de/html/admin/admin_affiliblatt_error.tpl -text +unsupported/affiliblatt/templates/de/html/admin/admin_config_affiliblatt.tpl -text +unsupported/affiliblatt/templates/de/html/admin/admin_list_affiliblatt_tm.tpl -text +unsupported/affiliblatt/templates/de/html/admin/admin_list_affiliblatt_tm_already.tpl -text +unsupported/affiliblatt/templates/de/html/admin/admin_list_affiliblatt_tm_row.tpl -text +unsupported/affiliblatt/templates/de/html/admin/admin_send_affiliblatt.tpl -text +unsupported/affiliblatt/templates/de/html/ext/ext_affiliblatt.tpl -text +unsupported/gollox/inc/extensions/ext-gollox.php -text +unsupported/gollox/inc/language/gollox_de.php -text +unsupported/gollox/inc/libs/gollox_functions.php -text +unsupported/gollox/inc/modules/admin/what-config_gollox.php -text +unsupported/gollox/inc/modules/admin/what-list_gollox_tm.php -text +unsupported/gollox/inc/reset/reset_gollox.php -text +unsupported/gollox/templates/de/html/admin/admin_config_gollox.tpl -text +unsupported/gollox/templates/de/html/admin/admin_gollox_error.tpl -text +unsupported/gollox/templates/de/html/admin/admin_list_gollox_tm.tpl -text +unsupported/gollox/templates/de/html/admin/admin_list_gollox_tm_already.tpl -text +unsupported/gollox/templates/de/html/admin/admin_list_gollox_tm_row.tpl -text +unsupported/gollox/templates/de/html/admin/admin_send_gollox.tpl -text +unsupported/gollox/templates/de/html/ext/ext_gollox.tpl -text /view.php -text diff --git a/inc/databases.php b/inc/databases.php index a0cf9b0059..befcddf2a0 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -114,7 +114,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // This current patch level -define('CURR_SVN_REVISION', "545"); +define('CURR_SVN_REVISION', "546"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/libs/yoomedia_functions.php b/inc/libs/yoomedia_functions.php index 6cf2f20813..04deb26e9d 100644 --- a/inc/libs/yoomedia_functions.php +++ b/inc/libs/yoomedia_functions.php @@ -38,7 +38,7 @@ if (!defined('__SECURITY')) { } // Test if the extension settings did work -function YOOMEDIDA_TEST_CONFIG ($data) { +function YOOMEDIA_TEST_CONFIG ($data) { global $_CONFIG; // Is this admin? diff --git a/inc/modules/admin/what-config_yoomedia.php b/inc/modules/admin/what-config_yoomedia.php index 1fb95978c4..338dc08369 100644 --- a/inc/modules/admin/what-config_yoomedia.php +++ b/inc/modules/admin/what-config_yoomedia.php @@ -46,7 +46,7 @@ ADD_DESCR("admin", __FILE__); // Was the form submitted? if (isset($_POST['ok'])) { // Test Yoo!Media config - if (YOOMEDIDA_TEST_CONFIG($_POST)) { + if (YOOMEDIA_TEST_CONFIG($_POST)) { // Save settings ADMIN_SAVE_SETTINGS($_POST); } else { diff --git a/unsupported/affiliblatt/inc/extensions/ext-affiliblatt.php b/unsupported/affiliblatt/inc/extensions/ext-affiliblatt.php new file mode 100644 index 0000000000..fef5dfb884 --- /dev/null +++ b/unsupported/affiliblatt/inc/extensions/ext-affiliblatt.php @@ -0,0 +1,142 @@ +Vorsicht: Jede Aktualisierung dieser Liste kostet Ihnen eine Abfrage!',10)"; + + // Reload lock table + $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_affliliblatt_reload`"; + $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_affliliblatt_reload` ( +`id` BIGINT(20) NOT NULL AUTO_INCREMENT, +`type` VARCHAR(255) NOT NULL DEFAULT 'general', +`y_id` BIGINT(20) NOT NULL DEFAULT 0, +`y_reload` SMALLINT(6) NOT NULL DEFAULT 0, +`inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, +PRIMARY KEY (`id`), +UNIQUE `y_type` (`type`,`y_id`) +) TYPE=MyISAM COMMENT='Reload lock reminder for AffiliBlatt campaigns'"; + break; + +case "remove": // Do stuff when removing extension + // SQL commands to run + $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE `what` IN('config_affliliblatt','list_affliliblatt_tm') LIMIT 2"; + $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_affliliblatt_reload`"; + break; + +case "activate": // Do stuff when admin activates this extension + // SQL commands to run + break; + +case "deactivate": // Do stuff when admin deactivates this extension + // SQL commands to run + break; + +case "update": // Update an extension + switch ($EXT_VER) + { + case "0.0.1": // SQL queries for v0.0.1 + $SQLs[] = ""; + + // Update notes (these will be set as task text!) + $UPDATE_NOTES = ""; + break; + } + break; + +default: // Do stuff when extension is loaded + // The translation table + $affliliblattTranslationTable = array( + // Error messages + 'error_codes' => array( + 1 => 'wrong_pass', + 2 => 'wrong_sid', + 3 => 'website_locked', + 4 => 'api_data_error', + 5 => 'requests_depleted', + 6 => 'zero_result', + 10 => 'incomplete_request' + ), + // For text mails + 'textmail' => array( + 0 => 'id', + 1 => 'name', + 2 => 'reload', + 3 => 'wait', + 4 => 'remain', + 5 => 'pay', + 6 => 'text' + ) + ); + break; +} + +// Language file prefix +$EXT_LANG_PREFIX = "affliliblatt"; + +// Keep this extension always active! +$EXT_ALWAYS_ACTIVE = "Y"; + +// +?> diff --git a/unsupported/affiliblatt/inc/language/affiliblatt_de.php b/unsupported/affiliblatt/inc/language/affiliblatt_de.php new file mode 100644 index 0000000000..93138d0978 --- /dev/null +++ b/unsupported/affiliblatt/inc/language/affiliblatt_de.php @@ -0,0 +1,95 @@ +Hinweise: Sollten Sie Erotik in Ihrem {!MT_WORD!} anzeigen wollen, so sollten Sie einen Jugendschutzbeauftragten haben und diesen im Impressum nennen. Das gesamte MXChange-Team weisst darauf hin, dass niemand aus dem Team Ihnen hierzu rechtsberatende Hinweise geben kann. Auch im Community-Forum erfolgt keine Rechtsberatung! Etwaige Postings werden entweder kommentarlos gelöscht oder gesperrt."); +define('ADMIN_CONFIG_AFFILIBLATT_TEST_FAILED', "Konfigurationsdaten stimmen nicht überein. Details entnehmen Sie bitte der Datei inc/cache/debug.log."); + +// Generic admin strings +define('ADMIN_AFFILIBLATT_REQUESTS_DEPLETED', "Ihr Abfragekonto der API ist erschöpft. Bitte surfen Sie auf www.AffiliBlatt.de und loggen Sie sich ein, um manuell Mails zu versenden."); +define('ADMIN_AFFILIBLATT_INVALID_RESULT', "Ungültige Antwort von der API erhalten. Ist www.affliliblatt.de erreichbar?"); +define('ADMIN_AFFILIBLATT_PREPARE_MAIL', "Bonusmail vorbereiten"); +define('ADMIN_AFFILIBLATT_REMOVE_MAIL', "Mail entfernen"); +define('ADMIN_AFFILIBLATT_UNLIST_MAIL', "Aus Ausschlussliste nehmen"); +define('ADMIN_AFFILIBLATT_TEXTMAIL_ALREADY_SENT', "Textmail wurde %s bereits versendet."); +define('ADMIN_AFFILIBLATT_TEXTMAIL_SEND_AGAIN', "Textmail kann in %s erneut versendet werden."); +define('ADMIN_AFFILIBLATT_TEXTMAIL_MANUALLY_LOCKED', "Textmail wurde manuell gesperrt."); +define('ADMIN_LIST_AFFILIBLATT_TITLE', "Alle Textmails von der AffiliBlatt API 2.0 anzeigen"); +define('ADMIN_LIST_AFFILIBLATT_NOTE', "Hinweise: Mails mit 0 Sekunden Mindestaufenthalt sind meistens Framekiller-Mails. Sie können eine Mail nur erneut aussenden, wenn die Reload-Sperre abgelaufen ist!"); +define('ADMIN_AFFILIBLATT_SEND_MAIL_TITLE', "Textmail aus AffiliBlatt API 2.0 versenden"); +define('ADMIN_AFFILIBLATT_RECEIVER_ARE_ALL_NOTE', "Es werden in der jeweiligen Kategorie alle verfügbaren Empfänger ausgewählt."); + +// Subject lines +define('ADMIN_AFFILIBLATT_SUBJECT_PREFIX', "Paidmail:"); +define('ADMIN_AFFILIBLATT_ENTER_URL_NOTE', "Die URL wird automatisch für Sie konstruiert!"); + +// Admin header lines +define('ADMIN_AFFILIBLATT_TM_ID', "Id"); +define('ADMIN_AFFILIBLATT_TM_NAME', "Betreff"); +define('ADMIN_AFFILIBLATT_TM_RELOAD', "Reloadsperre"); +define('ADMIN_AFFILIBLATT_TM_WAIT', "Mindestaufenthalt"); +define('ADMIN_AFFILIBLATT_TM_REMAIN', "Klicks übrig"); +define('ADMIN_AFFILIBLATT_TM_PAY', "Vergütung"); +define('ADMIN_AFFILIBLATT_TM_ACTIONS', "Aktionen"); + +// Error messages for admin +define('ADMIN_AFFILIBLATT_ERROR_FAILED', "Allgemeiner Fehler von API, nicht weiter spezifiziert."); +define('ADMIN_AFFILIBLATT_ERROR_TITLE', "Fehler bei Abfrage der AffiliBlatt API 2.0"); +define('ADMIN_AFFILIBLATT_ERROR_WRONG_PASS', "Falsches Interfacepasswort angegeben."); +define('ADMIN_AFFILIBLATT_ERROR_WRONG_SID', "Falsche Seiten-ID verwendet."); +define('ADMIN_AFFILIBLATT_ERROR_WEBSITE_LOCKED', "Ihre Webseite (Werbefläche) wurde bei AffiliBlatt gesperrt."); +define('ADMIN_AFFILIBLATT_ERROR_API_DATA_ERROR', "Fehler in API-Daten erkannt."); +define('ADMIN_AFFILIBLATT_ERROR_REQUESTS_DEPLETED', "Abfrageguthaben erschöpft."); +define('ADMIN_AFFILIBLATT_ERROR_ZERO_RESULT', "Keine Buchungenz zur Auswahl gefunden."); +define('ADMIN_AFFILIBLATT_ERROR_INCOMPLETE_REQUEST', "Abfragedaten sind nicht komplett."); + +// +?> diff --git a/unsupported/affiliblatt/inc/libs/affiliblatt_functions.php b/unsupported/affiliblatt/inc/libs/affiliblatt_functions.php new file mode 100644 index 0000000000..e5617b1719 --- /dev/null +++ b/unsupported/affiliblatt/inc/libs/affiliblatt_functions.php @@ -0,0 +1,369 @@ + 10); +} + +// Queries the given AffiliBlatt API 2.0 script +function AFFILIBLATT_QUERY_API ($script, $countQuery = true) { + global $_CONFIG; + + // Init response array + $response = array(); + + // Enougth queries left? + if (($_CONFIG['affliliblatt_requests_remain'] > 0) || (!$countQuery)) { + // Prepare the low-level request + $requestString = sprintf("http://www.affliliblatt.de/interface_2.0/%s?id=%s&sid=%s&pw=%s&reload=%s&ma=%s&uebrig=%s&verguetung=%s&erotik=%s", + $script, + bigintval($_CONFIG['affliliblatt_id']), + bigintval($_CONFIG['affliliblatt_sid']), + $_CONFIG['affliliblatt_passwd'], + bigintval($_CONFIG['affliliblatt_tm_max_reload']), + bigintval($_CONFIG['affliliblatt_tm_min_wait']), + bigintval($_CONFIG['affliliblatt_tm_clicks_remain']), + bigintval($_CONFIG['affliliblatt_tm_min_pay']), + bigintval($_CONFIG['affliliblatt_erotic_allowed']) + ); + + // Run the query + $response = GET_URL($requestString); + + // Shall we count the query as used? + if ($countQuery) { + // Then update the config! + UPDATE_CONFIG("affliliblatt_requests_remain", 1, "-"); + } // END - if + } // END - if + + // Return the data + return $response; +} + +// "Getter" for a parsed result for all text mails. This means an array without +// the header lines will be returned +function AFFILIBLATT_GET_PARSED_RESULT_TEXTMAILS () { + // Get the raw response + $response = AFFILIBLATT_QUERY_API("out_textmail.php"); + + // Parse the response + $result = AFFILIBLATT_PARSE_RESPONSE($response, "textmail"); + + // Return result + return $result; +} + +// Parser function for AffiliBlatt API responses +function AFFILIBLATT_PARSE_RESPONSE ($response, $type) { + // Init result + $result = array(); + + // Cut off the header + $dummy = $response; + foreach ($response as $line) { + // Remove line + array_shift($dummy); + + // Is this line empty? + if (empty($line)) { + // Then stop here + break; + } // END - if + } // END - foreach + + // The result is now still raw, so we must split it up and trim spaces away + $responseLine = trim(implode("\n", $dummy)); + + // Last line should never be a pipe! + if (substr($responseLine, -1, 1) == "|") $responseLine = substr($responseLine, 0, -1); + + // Now, explode all in one array + $dataArray = explode("|", $responseLine); + + // Now make the result array with two dimensions + $cnt = 0; $entry = 0; + foreach ($dataArray as $line) { + // Add the line + $result[$entry][AFFILIBLATT_TRANSLATE_INDEX($type, $cnt)] = $line; + + // End of data of first entry reached? + if ($cnt == 6) { + // Then advance to next entry and reset counter + $entry++; + $cnt = 0; + } else { + // Count up + $cnt++; + } + } // END - foreach + + // Return it + return $result; +} + +// Prepares a bonus mail for delivery. Works only if extension "bonus" is active +function AFFILIBLATT_PREPARE_MAIL_DELIVERY ($data) { + global $_CONFIG; + + // Is this an admin? + if (!IS_ADMIN()) { + // Abort here + return false; + } elseif (!EXT_IS_ACTIVE("bonus")) { + // Abort here + return false; + } + + // Is the waiting time below one second? Then fix it to one (zero seconds are not yet supported!) + if ($data['wait'] < 1) $data['wait'] = 1; + + // Half of waiting time is a good reward! + $data['reward'] = round($data['wait'] / 2 + 0.4); + + // Is the reward below one? + if ($data['reward'] < 1) $data['reward'] = 1; + + // Add website id + $data['sid'] = $_CONFIG['affliliblatt_sid']; + + // Add total receivers + $data['all'] = TRANSLATE_COMMA(GET_TOTAL_RECEIVERS()); + + // Add categories + $data['categories'] = ADD_CATEGORY_OPTIONS("normal"); + + // Load template + LOAD_TEMPLATE("admin_send_affliliblatt", false, $data); +} + +// Adds the mail to the bonus mail pool +function AFFILIBLATT_SEND_BONUS_MAIL ($data, $mode) { + global $_CONFIG; + + // Is this an admin? + if (!IS_ADMIN()) { + // Abort here + return false; + } elseif (!EXT_IS_ACTIVE("bonus")) { + // Abort here + return false; + } + + // Add dummy receiver to avoid notice + $data['receiver'] = 0; + + // HTML or normal? (normal is default...) + $type = "t"; + if (($mode == "html") && (EXT_IS_ACTIVE("html"))) $type = "h"; + + // Auto-generate URL + $data['url'] = sprintf("http://www.affliliblatt.de/code/%s-mail.php?id=%s&sid=%s", + $type, + $data['id'], + $data['sid'] + ); + + // Lock this mail for new delivery + AFFILIBLATT_RELOAD_LOCK($data, $mode); + + // Call the lower function + ADD_NEW_BONUS_MAIL($data, $mode); +} + +// Lockdown given id +function AFFILIBLATT_EXCLUDE_MAIL ($data, $mode) { + // Search for the entry + if (AFFILIBLATT_CHECK_RELOAD($data['id'], $data['reload'], $mode) === false) { + // Convert mode for mails + $mode = AFFILIBLATT_CONVERT_MODE($mode); + + // Add the entry + $result = SQL_QUERY_ESC("INSERT INTO `"._MYSQL_PREFIX."_affliliblatt_reload` (`type`,`y_id`,`y_reload`,`inserted`) VALUES ('%s',%s,%s,'0000-00-00 00:00')", + array($mode, bigintval($data['id']), bigintval($data['reload'])), __FILE__, __LINE__); + } // END - if +} + +// Remove lock of given mail +function AFFILIBLATT_UNLIST_MAIL ($data, $mode) { + // Convert mode for mails + $mode = AFFILIBLATT_CONVERT_MODE($mode); + + // Add the entry + $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_affliliblatt_reload` WHERE `type`='%s' AND `y_id`=%s LIMIT 1", + array($mode, bigintval($data['id'])), __FILE__, __LINE__); +} + +// "Translates" the index number into an assosiative value +function AFFILIBLATT_TRANSLATE_INDEX ($type, $index) { + global $affliliblattTranslationTable; + + // Default is the index + $return = $index; + + // Is the element there? + if (isset($affliliblattTranslationTable[$type][$index])) { + // Use this element + $return = $affliliblattTranslationTable[$type][$index]; + } else { + // Not found! + DEBUG_LOG(__FUNCTION__, __LINE__, " type={$type},index={$index} not found."); + } + + // Return value + return $return; +} + +// "Translate" error code +function AFFILIBLATT_TRANSLATE_ERROR ($errorCode) { + global $affliliblattTranslationTable; + + // Default is "failed" + $return = "failed"; + + // Is the entry there? + if (isset($affliliblattTranslationTable['error_codes'][$errorCode])) { + // Entry found! + $return = $affliliblattTranslationTable['error_codes'][$errorCode]; + } else { + // Log missing entries + DEBUG_LOG(__FUNCTION__, __LINE__, " errorCode={$errorCode}"); + } + + // Return value + return $return; +} + +// Checks if the mail id is in reload lock +function AFFILIBLATT_CHECK_RELOAD ($id, $reload, $type) { + // Default is not in reload lock + $reloaded = false; + + // Query database + $result = SQL_QUERY_ESC("SELECT `id`, UNIX_TIMESTAMP(`inserted`) AS inserted FROM `"._MYSQL_PREFIX."_affliliblatt_reload` WHERE `type`='%s' AND `y_id`=%s LIMIT 1", + array($type, bigintval($id)), __FILE__, __LINE__); + + // Entry found? + if (SQL_NUMROWS($result) == 1) { + // Load time + list($id, $time) = SQL_FETCHROW($result); + + // Are we ready to sent again? + if (((time() - $time) >= ($reload * 60*60)) && ($time > 0)) { + // Remove entry + $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_affliliblatt_reload WHERE id=%s LIMIT 1", + array($id), __FILE__, __LINE__); + } else { + // Dont' sent again this mail + $reloaded = $time; + } + } // END - if + + // Free result + SQL_FREERESULT($result); + + // Return result + return $reloaded; +} + +// Lock given mail down for reload lock +function AFFILIBLATT_RELOAD_LOCK ($data, $mode) { + // Search for the entry + if (AFFILIBLATT_CHECK_RELOAD($data['id'], $data['reload'], $mode) === false) { + // Convert mode for mails + $mode = AFFILIBLATT_CONVERT_MODE($mode); + + // Add the entry + $result = SQL_QUERY_ESC("INSERT INTO `"._MYSQL_PREFIX."_affliliblatt_reload` (`type`,`y_id`,`y_reload`) VALUES ('%s',%s,%s)", + array($mode, bigintval($data['id']), bigintval($data['reload'])), __FILE__, __LINE__); + } // END - if +} + +// Convert mode for mails +function AFFILIBLATT_CONVERT_MODE ($mode) { + // Convert mode for normal/html + switch ($mode) { + case "normal": + $mode = "textmail"; + break; + + case "html": + $mode = "htmlmail"; + break; + } // END - switch + + // Return result + return $mode; +} + +// +?> diff --git a/unsupported/affiliblatt/inc/modules/admin/what-config_affiliblatt.php b/unsupported/affiliblatt/inc/modules/admin/what-config_affiliblatt.php new file mode 100644 index 0000000000..91dbe13d8e --- /dev/null +++ b/unsupported/affiliblatt/inc/modules/admin/what-config_affiliblatt.php @@ -0,0 +1,94 @@ + bigintval($_CONFIG['affliliblatt_id']), + 'affliliblatt_sid' => bigintval($_CONFIG['affliliblatt_sid']), + 'affliliblatt_passwd' => $_CONFIG['affliliblatt_passwd'], + 'affliliblatt_tm_max_reload' => bigintval($_CONFIG['affliliblatt_tm_max_reload']), + 'affliliblatt_tm_min_wait' => bigintval($_CONFIG['affliliblatt_tm_min_wait']), + 'affliliblatt_tm_clicks_remain' => bigintval($_CONFIG['affliliblatt_tm_clicks_remain']), + 'affliliblatt_tm_min_pay' => bigintval($_CONFIG['affliliblatt_tm_min_pay']) + ); + + // Erotic? + switch ($_CONFIG['affliliblatt_erotic_allowed']) { + case 0: // No erotic at all + define('__CFG_AFFILIBLATT_EROTIC_NONE' , " selected=\"selected\""); + define('__CFG_AFFILIBLATT_EROTIC_INCLUDE', ""); + define('__CFG_AFFILIBLATT_EROTIC_ONLY' , ""); + break; + + case 1: // Include erotic + define('__CFG_AFFILIBLATT_EROTIC_NONE' , ""); + define('__CFG_AFFILIBLATT_EROTIC_INCLUDE', " selected=\"selected\""); + define('__CFG_AFFILIBLATT_EROTIC_ONLY' , ""); + break; + + case 2: // Erotic only + define('__CFG_AFFILIBLATT_EROTIC_NONE' , ""); + define('__CFG_AFFILIBLATT_EROTIC_INCLUDE', ""); + define('__CFG_AFFILIBLATT_EROTIC_ONLY' , " selected=\"selected\""); + break; + } + + // Load template + LOAD_TEMPLATE("admin_config_affliliblatt", false, $content); +} + +// +?> diff --git a/unsupported/affiliblatt/inc/modules/admin/what-list_affiliblatt_tm.php b/unsupported/affiliblatt/inc/modules/admin/what-list_affiliblatt_tm.php new file mode 100644 index 0000000000..05f4adfa28 --- /dev/null +++ b/unsupported/affiliblatt/inc/modules/admin/what-list_affiliblatt_tm.php @@ -0,0 +1,142 @@ +", $code); + $code = $code[0]; + + // Output message + LOAD_TEMPLATE("admin_affliliblatt_error", false, sprintf("{--ADMIN_AFFILIBLATT_ERROR_%s--}", strtoupper(AFFILIBLATT_TRANSLATE_ERROR($code)))); + return false; +} + +// Prepare all entries +$OUT = ""; $SW = 2; +foreach ($result as $entry) { + // Translate some data + $entry['pay'] = TRANSLATE_COMMA($entry['pay'], true, 5); + $entry['remain'] = TRANSLATE_COMMA($entry['remain']); + $entry['sw'] = $SW; + + // Check reload lock + $reload = AFFILIBLATT_CHECK_RELOAD($entry['id'], $entry['reload'], "textmail"); + + // Is this mail already sent? + if ($reload !== false) { + // Init countdown + $countdown = 0; + + // Not manually locked? + if ($reload > 0) { + // Calculate countdown + $countdown = $reload + ($entry['reload'] * 60*60) - time(); + + // Countdown < 60 seconds and bigger zero? + if (($countdown < 60) && ($countdown > 0)) { + // Fix to one minute + $countdown = 60; + } // END - if + + // Add reload lock + $entry['already'] = sprintf(ADMIN_AFFILIBLATT_TEXTMAIL_SEND_AGAIN, CREATE_FANCY_TIME($countdown)); + } else { + // Never resentable unless manual removal + $entry['already'] = ADMIN_AFFILIBLATT_TEXTMAIL_MANUALLY_LOCKED; + } + + // Load row template for displaying + $OUT .= LOAD_TEMPLATE("admin_list_affliliblatt_tm_already", true, $entry); + } else { + // Load row template with buttons + $OUT .= LOAD_TEMPLATE("admin_list_affliliblatt_tm_row", true, $entry); + } + + // Switch color + $SW = 3 - $SW; +} // END - if + +// Load main template +LOAD_TEMPLATE("admin_list_affliliblatt_tm", false, $OUT); + +// +?> diff --git a/unsupported/affiliblatt/inc/reset/reset_affiliblatt.php b/unsupported/affiliblatt/inc/reset/reset_affiliblatt.php new file mode 100644 index 0000000000..d23db4b6da --- /dev/null +++ b/unsupported/affiliblatt/inc/reset/reset_affiliblatt.php @@ -0,0 +1,49 @@ + diff --git a/unsupported/affiliblatt/templates/de/html/admin/admin_affiliblatt_error.tpl b/unsupported/affiliblatt/templates/de/html/admin/admin_affiliblatt_error.tpl new file mode 100644 index 0000000000..62d64ff949 --- /dev/null +++ b/unsupported/affiliblatt/templates/de/html/admin/admin_affiliblatt_error.tpl @@ -0,0 +1,8 @@ + + + + + + + +
{--ADMIN_AFFILIBLATT_ERROR_TITLE--}
$content
diff --git a/unsupported/affiliblatt/templates/de/html/admin/admin_config_affiliblatt.tpl b/unsupported/affiliblatt/templates/de/html/admin/admin_config_affiliblatt.tpl new file mode 100644 index 0000000000..acbf552976 --- /dev/null +++ b/unsupported/affiliblatt/templates/de/html/admin/admin_config_affiliblatt.tpl @@ -0,0 +1,96 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ {--ADMIN_CONFIG_AFFILIBLATT_TITLE--} +
 
+ {--ADMIN_CONFIG_AFFILIBLATT_ID--} + + +
 
+ {--ADMIN_CONFIG_AFFILIBLATT_SID--} + + +
 
+ {--ADMIN_CONFIG_AFFILIBLATT_PASSWD--} + + +
 
+ {--ADMIN_CONFIG_AFFILIBLATT_TM_MAX_RELOAD--} + + +
 
+ {--ADMIN_CONFIG_AFFILIBLATT_TM_MIN_WAIT--} + + +
 
+ {--ADMIN_CONFIG_AFFILIBLATT_TM_CLICKS_REMAIN--} + + +
 
+ {--ADMIN_CONFIG_AFFILIBLATT_TM_MIN_PAY--} + + +
 
+ {--ADMIN_CONFIG_AFFILIBLATT_EROTIC_ALLOWED--} + + +
 
+
+ +
+ {--ADMIN_CONFIG_AFFILIBLATT_EROTIC_NOTE--} +
diff --git a/unsupported/affiliblatt/templates/de/html/admin/admin_list_affiliblatt_tm.tpl b/unsupported/affiliblatt/templates/de/html/admin/admin_list_affiliblatt_tm.tpl new file mode 100644 index 0000000000..369786bc3c --- /dev/null +++ b/unsupported/affiliblatt/templates/de/html/admin/admin_list_affiliblatt_tm.tpl @@ -0,0 +1,22 @@ + + + + + + + + + + + + + +$content + + + +
+ {--ADMIN_LIST_AFFILIBLATT_TITLE--} +
{--ADMIN_AFFILIBLATT_TM_ID--}{--ADMIN_AFFILIBLATT_TM_NAME--}{--ADMIN_AFFILIBLATT_TM_RELOAD--}{--ADMIN_AFFILIBLATT_TM_WAIT--}{--ADMIN_AFFILIBLATT_TM_REMAIN--}{--ADMIN_AFFILIBLATT_TM_PAY--}{--ADMIN_AFFILIBLATT_TM_ACTIONS--}
diff --git a/unsupported/affiliblatt/templates/de/html/admin/admin_list_affiliblatt_tm_already.tpl b/unsupported/affiliblatt/templates/de/html/admin/admin_list_affiliblatt_tm_already.tpl new file mode 100644 index 0000000000..1610a2d50c --- /dev/null +++ b/unsupported/affiliblatt/templates/de/html/admin/admin_list_affiliblatt_tm_already.tpl @@ -0,0 +1,22 @@ + + $content[id] +  $content[name] + $content[reload] {--_HOURS--} + $content[wait] {--_SECONDS--} + $content[remain] + $content[pay] € + + + + + +
+ $content[already] +
+ + + +
+
+ + diff --git a/unsupported/affiliblatt/templates/de/html/admin/admin_list_affiliblatt_tm_row.tpl b/unsupported/affiliblatt/templates/de/html/admin/admin_list_affiliblatt_tm_row.tpl new file mode 100644 index 0000000000..73fedd042d --- /dev/null +++ b/unsupported/affiliblatt/templates/de/html/admin/admin_list_affiliblatt_tm_row.tpl @@ -0,0 +1,23 @@ + + $content[id] +  $content[name] + $content[reload] {--_HOURS--} + $content[wait] {--_SECONDS--} + $content[remain] + $content[pay] € + +
+ + + + + + + + + + +
+
+ + diff --git a/unsupported/affiliblatt/templates/de/html/admin/admin_send_affiliblatt.tpl b/unsupported/affiliblatt/templates/de/html/admin/admin_send_affiliblatt.tpl new file mode 100644 index 0000000000..2f44b38330 --- /dev/null +++ b/unsupported/affiliblatt/templates/de/html/admin/admin_send_affiliblatt.tpl @@ -0,0 +1,77 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ {--ADMIN_AFFILIBLATT_SEND_MAIL_TITLE--} +
 
{--SELECT_CATEGORY--}: + +
 
{--ENTER_RECEIVER--}: + {--ADMIN_AFFILIBLATT_RECEIVER_ARE_ALL_NOTE--} +
 
{--ENTER_POINTS--}: + {!POINTS!} +
 
{--ENTER_SECONDS--}: + {--_SECONDS--} +
 
{--ENTER_SUBJECT--}: + +
 
{--ENTER_TEXT--}: + +
 
{--MEMBER_ENTER_URL--}: + http://www.affiliblatt.de/code/t-mail.php?id=$content[id]&sid=$content[sid] + + + +
+ {--ADMIN_AFFILIBLATT_ENTER_URL_NOTE--} +
 
+
diff --git a/unsupported/affiliblatt/templates/de/html/ext/ext_affiliblatt.tpl b/unsupported/affiliblatt/templates/de/html/ext/ext_affiliblatt.tpl new file mode 100644 index 0000000000..a340027f24 --- /dev/null +++ b/unsupported/affiliblatt/templates/de/html/ext/ext_affiliblatt.tpl @@ -0,0 +1,5 @@ +Erweiterung zur Anbindung an die API (Interface 2.0!) von [AffiliBlatt]. Diese Erweiterung +muss aktiviert sein, damit die täglichen freien Abfragen wieder +zurückgesetzt werden. diff --git a/unsupported/gollox/inc/extensions/ext-gollox.php b/unsupported/gollox/inc/extensions/ext-gollox.php new file mode 100644 index 0000000000..cf0d87bcbb --- /dev/null +++ b/unsupported/gollox/inc/extensions/ext-gollox.php @@ -0,0 +1,142 @@ +Vorsicht: Jede Aktualisierung dieser Liste kostet Ihnen eine Abfrage!',10)"; + + // Reload lock table + $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_gollox_reload`"; + $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_gollox_reload` ( +`id` BIGINT(20) NOT NULL AUTO_INCREMENT, +`type` VARCHAR(255) NOT NULL DEFAULT 'general', +`y_id` BIGINT(20) NOT NULL DEFAULT 0, +`y_reload` SMALLINT(6) NOT NULL DEFAULT 0, +`inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, +PRIMARY KEY (`id`), +UNIQUE `y_type` (`type`,`y_id`) +) TYPE=MyISAM COMMENT='Reload lock reminder for GolloX campaigns'"; + break; + +case "remove": // Do stuff when removing extension + // SQL commands to run + $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE `what` IN('config_gollox','list_gollox_tm') LIMIT 2"; + $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_gollox_reload`"; + break; + +case "activate": // Do stuff when admin activates this extension + // SQL commands to run + break; + +case "deactivate": // Do stuff when admin deactivates this extension + // SQL commands to run + break; + +case "update": // Update an extension + switch ($EXT_VER) + { + case "0.0.1": // SQL queries for v0.0.1 + $SQLs[] = ""; + + // Update notes (these will be set as task text!) + $UPDATE_NOTES = ""; + break; + } + break; + +default: // Do stuff when extension is loaded + // The translation table + $golloxTranslationTable = array( + // Error messages + 'error_codes' => array( + 1 => 'wrong_pass', + 2 => 'wrong_sid', + 3 => 'website_locked', + 4 => 'api_data_error', + 5 => 'requests_depleted', + 6 => 'zero_result', + 10 => 'incomplete_request' + ), + // For text mails + 'textmail' => array( + 0 => 'id', + 1 => 'name', + 2 => 'reload', + 3 => 'wait', + 4 => 'remain', + 5 => 'pay', + 6 => 'text' + ) + ); + break; +} + +// Language file prefix +$EXT_LANG_PREFIX = "gollox"; + +// Keep this extension always active! +$EXT_ALWAYS_ACTIVE = "Y"; + +// +?> diff --git a/unsupported/gollox/inc/language/gollox_de.php b/unsupported/gollox/inc/language/gollox_de.php new file mode 100644 index 0000000000..63d5523aa1 --- /dev/null +++ b/unsupported/gollox/inc/language/gollox_de.php @@ -0,0 +1,95 @@ +Hinweise: Sollten Sie Erotik in Ihrem {!MT_WORD!} anzeigen wollen, so sollten Sie einen Jugendschutzbeauftragten haben und diesen im Impressum nennen. Das gesamte MXChange-Team weisst darauf hin, dass niemand aus dem Team Ihnen hierzu rechtsberatende Hinweise geben kann. Auch im Community-Forum erfolgt keine Rechtsberatung! Etwaige Postings werden entweder kommentarlos gelöscht oder gesperrt."); +define('ADMIN_CONFIG_GOLLOX_TEST_FAILED', "Konfigurationsdaten stimmen nicht überein. Details entnehmen Sie bitte der Datei inc/cache/debug.log."); + +// Generic admin strings +define('ADMIN_GOLLOX_REQUESTS_DEPLETED', "Ihr Abfragekonto der API ist erschöpft. Bitte surfen Sie auf www.GolloX.de und loggen Sie sich ein, um manuell Mails zu versenden."); +define('ADMIN_GOLLOX_INVALID_RESULT', "Ungültige Antwort von der API erhalten. Ist www.gollox.de erreichbar?"); +define('ADMIN_GOLLOX_PREPARE_MAIL', "Bonusmail vorbereiten"); +define('ADMIN_GOLLOX_REMOVE_MAIL', "Mail entfernen"); +define('ADMIN_GOLLOX_UNLIST_MAIL', "Aus Ausschlussliste nehmen"); +define('ADMIN_GOLLOX_TEXTMAIL_ALREADY_SENT', "Textmail wurde %s bereits versendet."); +define('ADMIN_GOLLOX_TEXTMAIL_SEND_AGAIN', "Textmail kann in %s erneut versendet werden."); +define('ADMIN_GOLLOX_TEXTMAIL_MANUALLY_LOCKED', "Textmail wurde manuell gesperrt."); +define('ADMIN_LIST_GOLLOX_TITLE', "Alle Textmails von der GolloX API 2.0 anzeigen"); +define('ADMIN_LIST_GOLLOX_NOTE', "Hinweise: Mails mit 0 Sekunden Mindestaufenthalt sind meistens Framekiller-Mails. Sie können eine Mail nur erneut aussenden, wenn die Reload-Sperre abgelaufen ist!"); +define('ADMIN_GOLLOX_SEND_MAIL_TITLE', "Textmail aus GolloX API 2.0 versenden"); +define('ADMIN_GOLLOX_RECEIVER_ARE_ALL_NOTE', "Es werden in der jeweiligen Kategorie alle verfügbaren Empfänger ausgewählt."); + +// Subject lines +define('ADMIN_GOLLOX_SUBJECT_PREFIX', "Paidmail:"); +define('ADMIN_GOLLOX_ENTER_URL_NOTE', "Die URL wird automatisch für Sie konstruiert!"); + +// Admin header lines +define('ADMIN_GOLLOX_TM_ID', "Id"); +define('ADMIN_GOLLOX_TM_NAME', "Betreff"); +define('ADMIN_GOLLOX_TM_RELOAD', "Reloadsperre"); +define('ADMIN_GOLLOX_TM_WAIT', "Mindestaufenthalt"); +define('ADMIN_GOLLOX_TM_REMAIN', "Klicks übrig"); +define('ADMIN_GOLLOX_TM_PAY', "Vergütung"); +define('ADMIN_GOLLOX_TM_ACTIONS', "Aktionen"); + +// Error messages for admin +define('ADMIN_GOLLOX_ERROR_FAILED', "Allgemeiner Fehler von API, nicht weiter spezifiziert."); +define('ADMIN_GOLLOX_ERROR_TITLE', "Fehler bei Abfrage der GolloX API 2.0"); +define('ADMIN_GOLLOX_ERROR_WRONG_PASS', "Falsches Interfacepasswort angegeben."); +define('ADMIN_GOLLOX_ERROR_WRONG_SID', "Falsche Seiten-ID verwendet."); +define('ADMIN_GOLLOX_ERROR_WEBSITE_LOCKED', "Ihre Webseite (Werbefläche) wurde bei GolloX gesperrt."); +define('ADMIN_GOLLOX_ERROR_API_DATA_ERROR', "Fehler in API-Daten erkannt."); +define('ADMIN_GOLLOX_ERROR_REQUESTS_DEPLETED', "Abfrageguthaben erschöpft."); +define('ADMIN_GOLLOX_ERROR_ZERO_RESULT', "Keine Buchungenz zur Auswahl gefunden."); +define('ADMIN_GOLLOX_ERROR_INCOMPLETE_REQUEST', "Abfragedaten sind nicht komplett."); + +// +?> diff --git a/unsupported/gollox/inc/libs/gollox_functions.php b/unsupported/gollox/inc/libs/gollox_functions.php new file mode 100644 index 0000000000..86151ac95b --- /dev/null +++ b/unsupported/gollox/inc/libs/gollox_functions.php @@ -0,0 +1,369 @@ + 10); +} + +// Queries the given GolloX API 2.0 script +function GOLLOX_QUERY_API ($script, $countQuery = true) { + global $_CONFIG; + + // Init response array + $response = array(); + + // Enougth queries left? + if (($_CONFIG['gollox_requests_remain'] > 0) || (!$countQuery)) { + // Prepare the low-level request + $requestString = sprintf("http://www.gollox.de/interface_2.0/%s?id=%s&sid=%s&pw=%s&reload=%s&ma=%s&uebrig=%s&verguetung=%s&erotik=%s", + $script, + bigintval($_CONFIG['gollox_id']), + bigintval($_CONFIG['gollox_sid']), + $_CONFIG['gollox_passwd'], + bigintval($_CONFIG['gollox_tm_max_reload']), + bigintval($_CONFIG['gollox_tm_min_wait']), + bigintval($_CONFIG['gollox_tm_clicks_remain']), + bigintval($_CONFIG['gollox_tm_min_pay']), + bigintval($_CONFIG['gollox_erotic_allowed']) + ); + + // Run the query + $response = GET_URL($requestString); + + // Shall we count the query as used? + if ($countQuery) { + // Then update the config! + UPDATE_CONFIG("gollox_requests_remain", 1, "-"); + } // END - if + } // END - if + + // Return the data + return $response; +} + +// "Getter" for a parsed result for all text mails. This means an array without +// the header lines will be returned +function GOLLOX_GET_PARSED_RESULT_TEXTMAILS () { + // Get the raw response + $response = GOLLOX_QUERY_API("out_textmail.php"); + + // Parse the response + $result = GOLLOX_PARSE_RESPONSE($response, "textmail"); + + // Return result + return $result; +} + +// Parser function for GolloX API responses +function GOLLOX_PARSE_RESPONSE ($response, $type) { + // Init result + $result = array(); + + // Cut off the header + $dummy = $response; + foreach ($response as $line) { + // Remove line + array_shift($dummy); + + // Is this line empty? + if (empty($line)) { + // Then stop here + break; + } // END - if + } // END - foreach + + // The result is now still raw, so we must split it up and trim spaces away + $responseLine = trim(implode("\n", $dummy)); + + // Last line should never be a pipe! + if (substr($responseLine, -1, 1) == "|") $responseLine = substr($responseLine, 0, -1); + + // Now, explode all in one array + $dataArray = explode("|", $responseLine); + + // Now make the result array with two dimensions + $cnt = 0; $entry = 0; + foreach ($dataArray as $line) { + // Add the line + $result[$entry][GOLLOX_TRANSLATE_INDEX($type, $cnt)] = $line; + + // End of data of first entry reached? + if ($cnt == 6) { + // Then advance to next entry and reset counter + $entry++; + $cnt = 0; + } else { + // Count up + $cnt++; + } + } // END - foreach + + // Return it + return $result; +} + +// Prepares a bonus mail for delivery. Works only if extension "bonus" is active +function GOLLOX_PREPARE_MAIL_DELIVERY ($data) { + global $_CONFIG; + + // Is this an admin? + if (!IS_ADMIN()) { + // Abort here + return false; + } elseif (!EXT_IS_ACTIVE("bonus")) { + // Abort here + return false; + } + + // Is the waiting time below one second? Then fix it to one (zero seconds are not yet supported!) + if ($data['wait'] < 1) $data['wait'] = 1; + + // Half of waiting time is a good reward! + $data['reward'] = round($data['wait'] / 2 + 0.4); + + // Is the reward below one? + if ($data['reward'] < 1) $data['reward'] = 1; + + // Add website id + $data['sid'] = $_CONFIG['gollox_sid']; + + // Add total receivers + $data['all'] = TRANSLATE_COMMA(GET_TOTAL_RECEIVERS()); + + // Add categories + $data['categories'] = ADD_CATEGORY_OPTIONS("normal"); + + // Load template + LOAD_TEMPLATE("admin_send_gollox", false, $data); +} + +// Adds the mail to the bonus mail pool +function GOLLOX_SEND_BONUS_MAIL ($data, $mode) { + global $_CONFIG; + + // Is this an admin? + if (!IS_ADMIN()) { + // Abort here + return false; + } elseif (!EXT_IS_ACTIVE("bonus")) { + // Abort here + return false; + } + + // Add dummy receiver to avoid notice + $data['receiver'] = 0; + + // HTML or normal? (normal is default...) + $type = "t"; + if (($mode == "html") && (EXT_IS_ACTIVE("html"))) $type = "h"; + + // Auto-generate URL + $data['url'] = sprintf("http://www.gollox.de/code/%s-mail.php?id=%s&sid=%s", + $type, + $data['id'], + $data['sid'] + ); + + // Lock this mail for new delivery + GOLLOX_RELOAD_LOCK($data, $mode); + + // Call the lower function + ADD_NEW_BONUS_MAIL($data, $mode); +} + +// Lockdown given id +function GOLLOX_EXCLUDE_MAIL ($data, $mode) { + // Search for the entry + if (GOLLOX_CHECK_RELOAD($data['id'], $data['reload'], $mode) === false) { + // Convert mode for mails + $mode = GOLLOX_CONVERT_MODE($mode); + + // Add the entry + $result = SQL_QUERY_ESC("INSERT INTO `"._MYSQL_PREFIX."_gollox_reload` (`type`,`y_id`,`y_reload`,`inserted`) VALUES ('%s',%s,%s,'0000-00-00 00:00')", + array($mode, bigintval($data['id']), bigintval($data['reload'])), __FILE__, __LINE__); + } // END - if +} + +// Remove lock of given mail +function GOLLOX_UNLIST_MAIL ($data, $mode) { + // Convert mode for mails + $mode = GOLLOX_CONVERT_MODE($mode); + + // Add the entry + $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_gollox_reload` WHERE `type`='%s' AND `y_id`=%s LIMIT 1", + array($mode, bigintval($data['id'])), __FILE__, __LINE__); +} + +// "Translates" the index number into an assosiative value +function GOLLOX_TRANSLATE_INDEX ($type, $index) { + global $golloxTranslationTable; + + // Default is the index + $return = $index; + + // Is the element there? + if (isset($golloxTranslationTable[$type][$index])) { + // Use this element + $return = $golloxTranslationTable[$type][$index]; + } else { + // Not found! + DEBUG_LOG(__FUNCTION__, __LINE__, " type={$type},index={$index} not found."); + } + + // Return value + return $return; +} + +// "Translate" error code +function GOLLOX_TRANSLATE_ERROR ($errorCode) { + global $golloxTranslationTable; + + // Default is "failed" + $return = "failed"; + + // Is the entry there? + if (isset($golloxTranslationTable['error_codes'][$errorCode])) { + // Entry found! + $return = $golloxTranslationTable['error_codes'][$errorCode]; + } else { + // Log missing entries + DEBUG_LOG(__FUNCTION__, __LINE__, " errorCode={$errorCode}"); + } + + // Return value + return $return; +} + +// Checks if the mail id is in reload lock +function GOLLOX_CHECK_RELOAD ($id, $reload, $type) { + // Default is not in reload lock + $reloaded = false; + + // Query database + $result = SQL_QUERY_ESC("SELECT `id`, UNIX_TIMESTAMP(`inserted`) AS inserted FROM `"._MYSQL_PREFIX."_gollox_reload` WHERE `type`='%s' AND `y_id`=%s LIMIT 1", + array($type, bigintval($id)), __FILE__, __LINE__); + + // Entry found? + if (SQL_NUMROWS($result) == 1) { + // Load time + list($id, $time) = SQL_FETCHROW($result); + + // Are we ready to sent again? + if (((time() - $time) >= ($reload * 60*60)) && ($time > 0)) { + // Remove entry + $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_gollox_reload WHERE id=%s LIMIT 1", + array($id), __FILE__, __LINE__); + } else { + // Dont' sent again this mail + $reloaded = $time; + } + } // END - if + + // Free result + SQL_FREERESULT($result); + + // Return result + return $reloaded; +} + +// Lock given mail down for reload lock +function GOLLOX_RELOAD_LOCK ($data, $mode) { + // Search for the entry + if (GOLLOX_CHECK_RELOAD($data['id'], $data['reload'], $mode) === false) { + // Convert mode for mails + $mode = GOLLOX_CONVERT_MODE($mode); + + // Add the entry + $result = SQL_QUERY_ESC("INSERT INTO `"._MYSQL_PREFIX."_gollox_reload` (`type`,`y_id`,`y_reload`) VALUES ('%s',%s,%s)", + array($mode, bigintval($data['id']), bigintval($data['reload'])), __FILE__, __LINE__); + } // END - if +} + +// Convert mode for mails +function GOLLOX_CONVERT_MODE ($mode) { + // Convert mode for normal/html + switch ($mode) { + case "normal": + $mode = "textmail"; + break; + + case "html": + $mode = "htmlmail"; + break; + } // END - switch + + // Return result + return $mode; +} + +// +?> diff --git a/unsupported/gollox/inc/modules/admin/what-config_gollox.php b/unsupported/gollox/inc/modules/admin/what-config_gollox.php new file mode 100644 index 0000000000..ef99505357 --- /dev/null +++ b/unsupported/gollox/inc/modules/admin/what-config_gollox.php @@ -0,0 +1,94 @@ + bigintval($_CONFIG['gollox_id']), + 'gollox_sid' => bigintval($_CONFIG['gollox_sid']), + 'gollox_passwd' => $_CONFIG['gollox_passwd'], + 'gollox_tm_max_reload' => bigintval($_CONFIG['gollox_tm_max_reload']), + 'gollox_tm_min_wait' => bigintval($_CONFIG['gollox_tm_min_wait']), + 'gollox_tm_clicks_remain' => bigintval($_CONFIG['gollox_tm_clicks_remain']), + 'gollox_tm_min_pay' => bigintval($_CONFIG['gollox_tm_min_pay']) + ); + + // Erotic? + switch ($_CONFIG['gollox_erotic_allowed']) { + case 0: // No erotic at all + define('__CFG_GOLLOX_EROTIC_NONE' , " selected=\"selected\""); + define('__CFG_GOLLOX_EROTIC_INCLUDE', ""); + define('__CFG_GOLLOX_EROTIC_ONLY' , ""); + break; + + case 1: // Include erotic + define('__CFG_GOLLOX_EROTIC_NONE' , ""); + define('__CFG_GOLLOX_EROTIC_INCLUDE', " selected=\"selected\""); + define('__CFG_GOLLOX_EROTIC_ONLY' , ""); + break; + + case 2: // Erotic only + define('__CFG_GOLLOX_EROTIC_NONE' , ""); + define('__CFG_GOLLOX_EROTIC_INCLUDE', ""); + define('__CFG_GOLLOX_EROTIC_ONLY' , " selected=\"selected\""); + break; + } + + // Load template + LOAD_TEMPLATE("admin_config_gollox", false, $content); +} + +// +?> diff --git a/unsupported/gollox/inc/modules/admin/what-list_gollox_tm.php b/unsupported/gollox/inc/modules/admin/what-list_gollox_tm.php new file mode 100644 index 0000000000..60118c53ed --- /dev/null +++ b/unsupported/gollox/inc/modules/admin/what-list_gollox_tm.php @@ -0,0 +1,142 @@ +", $code); + $code = $code[0]; + + // Output message + LOAD_TEMPLATE("admin_gollox_error", false, sprintf("{--ADMIN_GOLLOX_ERROR_%s--}", strtoupper(GOLLOX_TRANSLATE_ERROR($code)))); + return false; +} + +// Prepare all entries +$OUT = ""; $SW = 2; +foreach ($result as $entry) { + // Translate some data + $entry['pay'] = TRANSLATE_COMMA($entry['pay'], true, 5); + $entry['remain'] = TRANSLATE_COMMA($entry['remain']); + $entry['sw'] = $SW; + + // Check reload lock + $reload = GOLLOX_CHECK_RELOAD($entry['id'], $entry['reload'], "textmail"); + + // Is this mail already sent? + if ($reload !== false) { + // Init countdown + $countdown = 0; + + // Not manually locked? + if ($reload > 0) { + // Calculate countdown + $countdown = $reload + ($entry['reload'] * 60*60) - time(); + + // Countdown < 60 seconds and bigger zero? + if (($countdown < 60) && ($countdown > 0)) { + // Fix to one minute + $countdown = 60; + } // END - if + + // Add reload lock + $entry['already'] = sprintf(ADMIN_GOLLOX_TEXTMAIL_SEND_AGAIN, CREATE_FANCY_TIME($countdown)); + } else { + // Never resentable unless manual removal + $entry['already'] = ADMIN_GOLLOX_TEXTMAIL_MANUALLY_LOCKED; + } + + // Load row template for displaying + $OUT .= LOAD_TEMPLATE("admin_list_gollox_tm_already", true, $entry); + } else { + // Load row template with buttons + $OUT .= LOAD_TEMPLATE("admin_list_gollox_tm_row", true, $entry); + } + + // Switch color + $SW = 3 - $SW; +} // END - if + +// Load main template +LOAD_TEMPLATE("admin_list_gollox_tm", false, $OUT); + +// +?> diff --git a/unsupported/gollox/inc/reset/reset_gollox.php b/unsupported/gollox/inc/reset/reset_gollox.php new file mode 100644 index 0000000000..d152d1ad83 --- /dev/null +++ b/unsupported/gollox/inc/reset/reset_gollox.php @@ -0,0 +1,49 @@ + diff --git a/unsupported/gollox/templates/de/html/admin/admin_config_gollox.tpl b/unsupported/gollox/templates/de/html/admin/admin_config_gollox.tpl new file mode 100644 index 0000000000..3c6219f6fe --- /dev/null +++ b/unsupported/gollox/templates/de/html/admin/admin_config_gollox.tpl @@ -0,0 +1,96 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ {--ADMIN_CONFIG_GOLLOX_TITLE--} +
 
+ {--ADMIN_CONFIG_GOLLOX_ID--} + + +
 
+ {--ADMIN_CONFIG_GOLLOX_SID--} + + +
 
+ {--ADMIN_CONFIG_GOLLOX_PASSWD--} + + +
 
+ {--ADMIN_CONFIG_GOLLOX_TM_MAX_RELOAD--} + + +
 
+ {--ADMIN_CONFIG_GOLLOX_TM_MIN_WAIT--} + + +
 
+ {--ADMIN_CONFIG_GOLLOX_TM_CLICKS_REMAIN--} + + +
 
+ {--ADMIN_CONFIG_GOLLOX_TM_MIN_PAY--} + + +
 
+ {--ADMIN_CONFIG_GOLLOX_EROTIC_ALLOWED--} + + +
 
+
+ +
+ {--ADMIN_CONFIG_GOLLOX_EROTIC_NOTE--} +
diff --git a/unsupported/gollox/templates/de/html/admin/admin_gollox_error.tpl b/unsupported/gollox/templates/de/html/admin/admin_gollox_error.tpl new file mode 100644 index 0000000000..21d31f6747 --- /dev/null +++ b/unsupported/gollox/templates/de/html/admin/admin_gollox_error.tpl @@ -0,0 +1,8 @@ + + + + + + + +
{--ADMIN_GOLLOX_ERROR_TITLE--}
$content
diff --git a/unsupported/gollox/templates/de/html/admin/admin_list_gollox_tm.tpl b/unsupported/gollox/templates/de/html/admin/admin_list_gollox_tm.tpl new file mode 100644 index 0000000000..4b4794e79e --- /dev/null +++ b/unsupported/gollox/templates/de/html/admin/admin_list_gollox_tm.tpl @@ -0,0 +1,22 @@ + + + + + + + + + + + + + +$content + + + +
+ {--ADMIN_LIST_GOLLOX_TITLE--} +
{--ADMIN_GOLLOX_TM_ID--}{--ADMIN_GOLLOX_TM_NAME--}{--ADMIN_GOLLOX_TM_RELOAD--}{--ADMIN_GOLLOX_TM_WAIT--}{--ADMIN_GOLLOX_TM_REMAIN--}{--ADMIN_GOLLOX_TM_PAY--}{--ADMIN_GOLLOX_TM_ACTIONS--}
diff --git a/unsupported/gollox/templates/de/html/admin/admin_list_gollox_tm_already.tpl b/unsupported/gollox/templates/de/html/admin/admin_list_gollox_tm_already.tpl new file mode 100644 index 0000000000..23363e8984 --- /dev/null +++ b/unsupported/gollox/templates/de/html/admin/admin_list_gollox_tm_already.tpl @@ -0,0 +1,22 @@ + + $content[id] +  $content[name] + $content[reload] {--_HOURS--} + $content[wait] {--_SECONDS--} + $content[remain] + $content[pay] € + + + + + +
+ $content[already] +
+ + + +
+
+ + diff --git a/unsupported/gollox/templates/de/html/admin/admin_list_gollox_tm_row.tpl b/unsupported/gollox/templates/de/html/admin/admin_list_gollox_tm_row.tpl new file mode 100644 index 0000000000..4bcbf29275 --- /dev/null +++ b/unsupported/gollox/templates/de/html/admin/admin_list_gollox_tm_row.tpl @@ -0,0 +1,23 @@ + + $content[id] +  $content[name] + $content[reload] {--_HOURS--} + $content[wait] {--_SECONDS--} + $content[remain] + $content[pay] € + +
+ + + + + + + + + + +
+
+ + diff --git a/unsupported/gollox/templates/de/html/admin/admin_send_gollox.tpl b/unsupported/gollox/templates/de/html/admin/admin_send_gollox.tpl new file mode 100644 index 0000000000..268d0658d0 --- /dev/null +++ b/unsupported/gollox/templates/de/html/admin/admin_send_gollox.tpl @@ -0,0 +1,77 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ {--ADMIN_GOLLOX_SEND_MAIL_TITLE--} +
 
{--SELECT_CATEGORY--}: + +
 
{--ENTER_RECEIVER--}: + {--ADMIN_GOLLOX_RECEIVER_ARE_ALL_NOTE--} +
 
{--ENTER_POINTS--}: + {!POINTS!} +
 
{--ENTER_SECONDS--}: + {--_SECONDS--} +
 
{--ENTER_SUBJECT--}: + +
 
{--ENTER_TEXT--}: + +
 
{--MEMBER_ENTER_URL--}: + http://www.gollox.de/code/t-mail.php?id=$content[id]&sid=$content[sid] + + + +
+ {--ADMIN_GOLLOX_ENTER_URL_NOTE--} +
 
+
diff --git a/unsupported/gollox/templates/de/html/ext/ext_gollox.tpl b/unsupported/gollox/templates/de/html/ext/ext_gollox.tpl new file mode 100644 index 0000000000..acc6850573 --- /dev/null +++ b/unsupported/gollox/templates/de/html/ext/ext_gollox.tpl @@ -0,0 +1,5 @@ +Erweiterung zur Anbindung an die API (Interface 2.0!) von [GolloX]. Diese Erweiterung +muss aktiviert sein, damit die täglichen freien Abfragen wieder +zurückgesetzt werden.