// Merges $GLOBALS['config'] with data in given array
function mergeConfig ($newConfig) {
$GLOBALS['config'] = merge_array(getConfigArray(), $newConfig);
+
+ // Remove all cached entries
}
// Increment or init with given value or 1 as default the given config entry
loadCurrentExtensionInclude();
// Is this extension deprecated?
- if ((isExtensionDeprecated()) && (getExtensionMode() != 'test')) {
+ if ((isExtensionDeprecated()) && (!in_array(getExtensionMode(), array('test', 'update')))) {
// Deactivate the extension
doDeactivateExtension($ext_name);
// Is the extension installed?
if (!isExtensionInstalled($ext_name)) {
// Non-installed extensions cannot be activated
- debug_report_bug(__FUNCTION__, __LINE__, 'Tried to deactivate non-installed extension ' . $ext_name);
+ debug_report_bug(__FUNCTION__, __LINE__, 'Tried to deactivate non-installed extension ' . $ext_name . ',getExtensionMode()=' . getExtensionMode());
} // END - if
// Activate the extension
} // END - if
// Version number
-setThisExtensionVersion('0.1.8');
+setThisExtensionVersion('0.1.9');
// Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.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'));
+setExtensionVersionHistory(array('0.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'));
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
// Update notes
setExtensionUpdateNotes("Doppler-Gutschriften werden nun über die Tabelle <strong>{OPEN_CONFIG}_MYSQL_PREFIX{CLOSE_CONFIG}_points_data</strong> verwaltet.");
break;
+
+ case '0.1.9': // SQL queries for v0.1.9
+ // Total payed out points from your doublers
+ addConfigAddSql('doubler_used', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000');
+
+ // Update notes
+ setExtensionUpdateNotes("Fehlender Konfigurationseintrag <strong>doubler_used</strong> hinzgefügt.");
+ break;
} // END - switch
break;
('homeads', 'homeADS', 'http://www.homeads.de/?ref=1540', '|', '|', 'GET', 'WINDOWS-1252','N'),
('fucoexsponsor', 'FuCoExSponsor.net', 'http://fucoexsponsor.net/index.php?seite=anmeldung&ref=Quix0r', '|', '|', 'GET', 'ISO-8859-1','N'),
('adconvention', 'AdConvention', 'http://www.adconvention.de?ref=233', '|', '|', 'GET', 'WINDOWS-1252','N'),
-('ad-hit', 'Ad-Hit.de', 'http://www.ad-hit.de?ref=41', '|', '|', 'GET', 'WINDOWS-1252', 'N'");
+('ad-hit', 'Ad-Hit.de', 'http://www.ad-hit.de?ref=41', '|', '|', 'GET', 'WINDOWS-1252', 'N')");
// Network type handlers - A3H
addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_network_types` (`network_type_id`,`network_id`,`network_type_handle`,`network_type_api_url`,`network_type_click_url`,`network_type_banner_url`) VALUES
} // END - if
// Add it to response
+ //* DEBUG: */ print 'line='.$line.'<br />';
$response[] = $line;
} // END - while
'ADMIN_CONFIG_YOOMEDIA_SID' => "Seiten-Id:",
'ADMIN_CONFIG_YOOMEDIA_PASSWD' => "Interface-Passwort:",
'ADMIN_CONFIG_YOOMEDIA_TM_MAX_RELOAD' => "Maximale Reloadzeit der Kampagnen in Stunden:",
- 'ADMIN_CONFIG_YOOMEDIA_TM_MIN_WAIT' => "Mindestaufenthalt in Sekunden:",
+ 'ADMIN_CONFIG_YOOMEDIA_TM_MIN_WAIT' => "Maximaler Mindestaufenthalt in Sekunden:",
'ADMIN_CONFIG_YOOMEDIA_TM_CLICKS_REMAIN' => "Mindestanzahl der restlichen Klicks:",
'ADMIN_CONFIG_YOOMEDIA_TM_MIN_PAY' => "Mindestvergütung der Kampagne:",
'ADMIN_CONFIG_YOOMEDIA_EROTIC_ALLOWED' => "Kampagnen mit erotischen Inhalt anzeigen?",
'ADMIN_CONFIG_YOOMEDIA_EROTIC_NOTE' => "<strong>Hinweise:</strong> Sollten Sie Erotik in Ihrem {?mt_word?} anzeigen wollen, so sollten Sie einen Jugendschutzbeauftragten haben und diesen im Impressum nennen. Das gesamte Entwicklerteam 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.",
'ADMIN_CONFIG_YOOMEDIA_TEST_FAILED' => "Konfigurationsdaten stimmen nicht überein. Details entnehmen Sie bitte der Datei <u>{?CACHE_PATH?}debug.log</u>.",
-// Generic admin strings
+ // Generic admin strings
'ADMIN_YOOMEDIA_REQUESTS_DEPLETED' => "Ihr Abfragekonto der API ist erschöpft. Bitte surfen Sie auf <a href=\"http://www.yoomedia.de?ref=1715\" target=\"_blank\">www.YooMedia.de</a> und loggen Sie sich ein, um manuell Mails zu versenden.",
'ADMIN_YOOMEDIA_INVALID_RESULT' => "Ungültige Antwort von der API erhalten. Ist <a href=\"http://www.yoomedia.de?ref=1715\" target=\"_blank\">www.yoomedia.de</a> erreichbar?",
'ADMIN_YOOMEDIA_PREPARE_MAIL' => "Bonusmail vorbereiten",
'ADMIN_YOOMEDIA_SEND_MAIL_TITLE' => "Textmail aus Yoo!Media API 2.0 versenden",
'ADMIN_YOOMEDIA_RECEIVER_ARE_ALL_NOTE' => "Es werden in der jeweiligen Kategorie alle verfügbaren Empfänger ausgewählt.",
-// Subject lines
+ // Subject lines
'ADMIN_YOOMEDIA_SUBJECT_PREFIX' => "Admin-Paidmail:",
'ADMIN_YOOMEDIA_ENTER_URL_NOTE' => "Die URL wird automatisch für Sie konstruiert.",
-// Admin header lines
+ // Admin header lines
'ADMIN_YOOMEDIA_TM_ID' => "Id",
'ADMIN_YOOMEDIA_TM_NAME' => "Betreff",
'ADMIN_YOOMEDIA_TM_RELOAD' => "Reloadzeit",
'ADMIN_YOOMEDIA_TM_PAY' => "Vergütung",
'ADMIN_YOOMEDIA_TM_ACTIONS' => "Aktionen",
-// Error messages for admin
+ // Error messages for admin
'ADMIN_YOOMEDIA_ERROR_UNKNOWN_ERROR' => "Unbekannter/leerer Fehler von API erhalten. Möglicherweise keine API-Daten angegeben.",
'ADMIN_YOOMEDIA_ERROR_FAILED' => "Allgemeiner Fehler von API, nicht weiter spezifiziert.",
'ADMIN_YOOMEDIA_ERROR_TITLE' => "Fehler bei Abfrage der Yoo!Media API 2.0",
return false;
} // END - if
- // Transfer config data
+ // Remove 'ok'
+ unset($data['ok']);
+
+ // Merge config
mergeConfig($data);
// Temporary allow maximum
- setConfigEntry('yoomedia_tm_max_reload' , 100000);
- setConfigEntry('yoomedia_tm_min_wait' , 0);
- setConfigEntry('yoomedia_tm_clicks_remain', 10);
- setConfigEntry('yoomedia_tm_min_pay' , 0);
- setConfigEntry('yoomedia_erotic_allowed' , 1);
+ setConfigEntry('yoomedia_tm_max_reload' , '100000');
+ setConfigEntry('yoomedia_tm_min_wait' , '1000');
+ setConfigEntry('yoomedia_tm_clicks_remain', '10');
+ setConfigEntry('yoomedia_tm_min_pay' , '0.00001');
+ setConfigEntry('yoomedia_erotic_allowed' , '1');
// Query the API with a test request without couting it
// If zero reply comes back the data is invalid!
// Log the response if failed
if ((count($response) == 0) && ($errorCode > 0)) {
// Queries depleted (as we count here!)
- logDebugMessage(__FUNCTION__, __LINE__, 'Requested depleted. Maxmimum was: ' . getConfig('yoomedia_requests_total'));
+ logDebugMessage(__FUNCTION__, __LINE__, 'Requested depleted. Maxmimum was: ' . getConfig('yoomedia_requests_total') . ',errorCode=' . $errorCode);
$errorCode = -1;
} elseif ((($errorCode <= 4) && ($errorCode > 0)) || ($errorCode >= 8)) {
// An error has returned from the account
logDebugMessage(__FUNCTION__, __LINE__, 'Unexpected error code ' . $errorCode . ' received.');
} elseif ((count($response) > 0) && ($errorCode != 0)) {
// Log serialized raw response
- logDebugMessage(__FUNCTION__, __LINE__, 'Raw response=' . base64_encode(serialize($response)));
+ logDebugMessage(__FUNCTION__, __LINE__, 'errorCode=' . $errorCode . ',response=' . base64_encode(serialize($response)));
$errorCode = -1;
} else {
// This is fine, because the result array is okay and the response code on element 8 is fine
// Get the raw response
$response = YOOMEDIA_QUERY_API('out_textmail.php');
+ // By default an empty result is returned
+ $result = array();
+
// Parse the response
- $result = YOOMEDIA_PARSE_RESPONSE($response, 'textmail');
+ if (count($response) > 0) {
+ $result = YOOMEDIA_PARSE_RESPONSE($response, 'textmail');
+ } // END - if
// Return result
return $result;
// If we have no result, abort here
if (count($dummy) == 0) {
// Empty response from API
- logDebugMessage(__FUNCTION__, __LINE__, 'Empy result from API received.');
+ debug_report_bug(__FUNCTION__, __LINE__, 'Empty result from API received. response()=' . count($response) . ',type=' . $type);
return array();
} // END - if
// Use only the first element
$code = bigintval($codeArray[0]);
} elseif (!empty($response[0])) {
- // Begin with extraction
- $codeArray = explode(' ', $response[0]['id']);
- $code = $codeArray[0];
- $codeArray = explode('<br />', $code);
- $code = $codeArray[0];
- $codeArray = explode('<br>', $code);
- $code = $codeArray[0];
-
- // Remove all new-line characters
- $codeArray = explode("\n", $code);
- $code = $codeArray[0];
-
- // Remove carrige-return
- $code = str_replace("\n", '', $code);
+ // Merge response together
+ $parts = explode('|', implode('', $response));
+
+ // If we have only one part, we got an error
+ if (count($parts) > 1) {
+ // All fine
+ $code = '0';
+ } else {
+ // Begin with extraction of error code
+ $codeArray = explode(' ', $response[0]);
+ $code = $codeArray[0];
+ $codeArray = explode('<br />', $code);
+ $code = $codeArray[0];
+ $codeArray = explode('<br>', $code);
+ $code = $codeArray[0];
+
+ // Remove all new-line characters
+ $codeArray = explode("\n", $code);
+ $code = $codeArray[0];
+
+ // Remove carrige-return
+ $code = trim(str_replace("\n", '', $code));
+
+ // Is it still empty?
+ if (empty($code)) {
+ // Then fix it
+ $code = -999;
+ } // END - if
+ }
} elseif (count($response) == 0) {
// All fine, but empty result
- $code = 0;
+ $code = '0';
} else {
// Should not happen!
debug_report_bug(__FUNCTION__, __LINE__, 'Cannot parse response. Raw response:<pre>' . print_r($response, true) . '</pre>');
}
- // Fix empty code to bad
- if (empty($code)) {
- $code = -999;
- } // END - if
-
// Return error code
return $code;
}
createNewExtensionTask($ext_name);
} // END - if
} else {
- // Test-drive extension in update mode
+ // Test-drive extension
loadExtension($ext_name, 'test');
// Get extension version
'subject' => $taskData['subject'],
'add' => $add,
'text' => $taskData['text'],
- 'task_created' => generateDateTime($taskData['task_created'], 1),
+ 'task_created' => generateDateTime($taskData['task_created'], '1'),
'extension' => $ext_name
);
$OUT .= '<div class="notice">{--ADMIN_EXTENSION_ALREADY_REGISTERED--}</div>';
// Close task but not already closed, solved, deleted or update tasks
- if ((!in_array($taskData['status'], array('CLOSED','DELETED','SOLVED'))) && ($taskData['task_type'] != 'EXTENSION_UPDATE')) {
+ if ((!in_array($taskData['status'], array('CLOSED', 'DELETED', 'SOLVED'))) && ($taskData['task_type'] != 'EXTENSION_UPDATE')) {
// Solve the task
runFilterChain('solve_task', $taskData['id']);
} // END - if
// Extension updates are installed automatically
$OUT .= '<div class="notice medium">{--ADMIN_EXTENSION_UPDATED--}</div>';
- // Close task
+ // Close task if not closed or deleted
if (!in_array($taskData['status'], array('CLOSED', 'DELETED'))) {
// Solve the task
runFilterChain('solve_task', $taskData['id']);
{--ADMIN_CONFIG_YOOMEDIA_TM_MIN_PAY--}
</td>
<td style="padding-left: 10px">
- <input type="text" class="form_field" name="yoomedia_tm_min_pay" size="3" maxlength="6" value="{?yoomedia_tm_min_pay?}" />
+ <input type="text" class="form_field" name="yoomedia_tm_min_pay" size="5" maxlength="20" value="{?yoomedia_tm_min_pay?}" />
</td>
</tr>
<tr>