./inc/extensions/ext-yoomedia.php:55:// @TODO Only deprecated when 'network' is ready! setExtensionDeprecated('Y');
./inc/extensions-functions.php:370:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) )
./inc/extensions-functions.php:481: // @TODO Extension is loaded, what next?
-./inc/footer.php:47: // @TODO Rewrite these all into filters
./inc/functions.php:1346: // @TODO Remove this if() block if all is working fine
./inc/functions.php:222: // @TODO Remove this sanity-check if all is fine
./inc/functions.php:225: // @TODO Try to rewrite all $DATA to $content
./inc/modules/member/what-unconfirmed.php:132: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
./inc/modules/order.php:75: // @TODO Unused: 2,4
./inc/monthly/monthly_bonus.php:70: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1599: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
-./inc/mysql-manager.php:1807: // @TODO Rewrite this to $content = SQL_FETCHARRAY()
-./inc/mysql-manager.php:2123: // @TODO This can be somehow rewritten
+./inc/mysql-manager.php:1592: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
+./inc/mysql-manager.php:1800: // @TODO Rewrite this to $content = SQL_FETCHARRAY()
+./inc/mysql-manager.php:2116: // @TODO This can be somehow rewritten
./inc/mysql-manager.php:220: // @TODO Nothing helped???
./inc/mysql-manager.php:255: // @TODO Rewrite this to a filter
./inc/mysql-manager.php:576: // @TODO Try to rewrite this to one or more functions
./mailid.php:135: // @TODO Rewrite this to a filter
./mailid.php:215: // @TODO Rewrite this to a dynamic include or so
./mailid.php:94: // @TODO Rewrite this to a filter
-./mailid_top.php:135: // @TODO Rewrite this to a filter
-./mailid_top.php:182: // @TODO Rewrite this to a filter
-./mailid_top.php:189: // @TODO Rewrite this to a filter
-./mailid_top.php:225: // @TODO Rewrite these blocks to filter
-./mailid_top.php:260: // @TODO Try to rewrite the following unset()
-./mailid_top.php:92: // @TODO Rewrite this to a filter
+./mailid_top.php:139: // @TODO Rewrite this to a filter
+./mailid_top.php:186: // @TODO Rewrite this to a filter
+./mailid_top.php:193: // @TODO Rewrite this to a filter
+./mailid_top.php:229: // @TODO Rewrite these blocks to filter
+./mailid_top.php:264: // @TODO Try to rewrite the following unset()
+./mailid_top.php:96: // @TODO Rewrite this to a filter
./view.php:72: // @TODO No banner found, output some default banner
### ### DEPRECATION FOLLOWS: ### ###
./inc/functions.php:249: // @DEPRECATED Try to rewrite the if() condition
} // END - if
// Version number
-setThisExtensionVersion('0.2.3');
+setThisExtensionVersion('0.2.4');
// Version history array (add more with , '0.1.0' and so on)
-setExtensionVersionHistory(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'));
+setExtensionVersionHistory(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'));
// Keep this extension always active!
setExtensionAlwaysActive('Y');
case 'remove': // Do stuff when removing extension
// SQL commands to run
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_other'");
+
+ // Unregister filter
+ unregisterFilter('page_footer', 'DISPLAY_DEBUG_SQL', false, true, getExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Fehlende Konfiguration hinzugefügt.");
break;
+
+ case '0.2.4': // SQL queries for v0.2.4
+ // Register filter
+ registerFilter('page_footer', 'DISPLAY_DEBUG_SQL', false, true, getExtensionDryRun());
+
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Filter zum Anzeigen (Debug) von ausgeführten SQL-Anweisungen hinzugefügt.");
+ break;
}
break;
}
// Version number
-setThisExtensionVersion('0.0');
+setThisExtensionVersion('0.0.1');
// Version history array (add more with , '0.1.0' and so on)
-setExtensionVersionHistory(array('0.0'));
+setExtensionVersionHistory(array('0.0', '0.0.1'));
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
break;
case 'remove': // Do stuff when removing extension
- // SQL commands to run
+ // Unregister filter
+ unregisterFilter('page_footer', 'DISPLAY_UBERWACH_SNIPPET', false, true, getExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
case 'update': // Update an extension
switch (getCurrentExtensionVersion()) {
case '0.0.1': // SQL queries for v0.0.1
- addExtensionSql('');
+ registerFilter('page_footer', 'DISPLAY_UBERWACH_SNIPPET', false, true, getExtensionDryRun());
// Update notes (these will be set as task text!)
- setExtensionUpdateNotes('');
+ setExtensionUpdateNotes("Filter zum Anzeigen des Snippets hinzugefügt");
break;
} // END - switch
break;
registerFilter('init', 'TRIGGER_SENDING_POOL');
registerFilter('init', 'DETERMINE_USERNAME');
registerFilter('init', 'DETERMINE_WHAT_ACTION');
+ registerFilter('init', 'COUNT_MODULE');
registerFilter('init', 'UPDATE_LOGIN_DATA');
registerFilter('init', 'ACTIVATE_EXCHANGE');
// Exclude some users
registerFilter('exclude_users', 'HTML_INCLUDE_USERS');
+
+ // Handling of fatal errors
+ registerFilter('handle_fatal_errors', 'HANDLE_FATAL_ERRORS');
+
+ // Page footer filters
+ registerFilter('page_footer', 'HANDLE_FATAL_ERRORS');
+ registerFilter('page_footer', 'DISPLAY_COPYRIGHT');
+ registerFilter('page_footer', 'DISPLAY_PARSING_TIME');
}
// "Registers" a new filter function
setConfigEntry('CACHE_BUSTER', getConfig('RAND_NUMBER'));
}
+// Update module counter
+function FILTER_COUNT_MODULE () {
+ // Do count all other modules but not accesses on CSS file css.php!
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `clicks`=`clicks`+1 WHERE `module`='%s' LIMIT 1",
+ array(getModule()), __FUNCTION__, __LINE__);
+}
+
+// Handles fatal errors
+function FILTER_HANDLE_FATAL_ERRORS () {
+ // Do we have errors to handle and right output mode?
+ if ((getTotalFatalErrors() == 0) || (getOutputMode() != 0)) {
+ // Abort executing here
+ return false;
+ } // END - if
+
+ // Set content type
+ setContentType('text/html');
+
+ // Load config here
+ loadIncludeOnce('inc/load_config.php');
+
+ // Set unset variable
+ if (empty($check)) $check = '';
+
+ // Default is none
+ $content = '';
+
+ // Installation phase or regular mode?
+ if ((isInstallationPhase())) {
+ // While we are installing ouput other header than while it is installed... :-)
+ $OUT = '';
+ foreach (getFatalArray() as $key => $value) {
+ // Prepare content for the template
+ $content = array(
+ 'key' => ($key + 1),
+ 'value' => $value
+ );
+
+ // Load row template
+ $OUT .= loadTemplate('install_fatal_row', true, $content);
+ }
+
+ // Load main template
+ $content = loadTemplate('install_fatal_table', true, $OUT);
+ } elseif (isInstalled()) {
+ // Display all runtime fatal errors
+ $OUT = '';
+ foreach (getFatalArray() as $key => $value) {
+ // Prepare content for the template
+ $content = array(
+ 'key' => ($key + 1),
+ 'value' => $value
+ );
+
+ // Load row template
+ $OUT .= loadTemplate('runtime_fatal_row', true, $content);
+ }
+
+ // Load main template
+ $content = loadTemplate('runtime_fatal_table', true, $OUT);
+ }
+
+ // Message to regular users (non-admin)
+ $CORR = getMessage('FATAL_REPORT_ERRORS');
+
+ // PHP warnings fixed
+ if ($check == 'done') {
+ if (isAdmin()) $CORR = getMessage('FATAL_CORRECT_ERRORS');
+ } // END - if
+
+ // Remember all in array
+ $content = array(
+ 'rows' => $content,
+ 'corr' => $CORR
+ );
+
+ // Load footer
+ loadIncludeOnce('inc/header.php');
+
+ // Load main template
+ loadTemplate('fatal_errors', false, $content);
+
+ // Delete all to prevent double-display
+ initFatalMessages();
+
+ // Load footer
+ loadIncludeOnce('inc/footer.php');
+
+ // Abort here
+ shutdown();
+}
+
+// Filter for displaying copyright line
+function FILTER_DISPLAY_COPYRIGHT () {
+ // Shall we display the copyright notice?
+ if ((!isGetRequestElementSet('frame')) && (basename($_SERVER['PHP_SELF']) != 'mailid_top.php') && ((getConfig('WRITE_FOOTER') == 'Y') || (isInstalling())) && ($GLOBALS['header_sent'] == 2)) {
+ // Backlink enabled?
+ if ((getConfig('ENABLE_BACKLINK') == 'Y') || (isInstalling())) {
+ // Copyright with backlink, thanks! :-)
+ loadTemplate('copyright_backlink');
+ } else {
+ // No backlink in Copyright note
+ loadTemplate('copyright');
+ }
+ } // END - if
+}
+
+// Filter for displaying parsing time
+function FILTER_DISPLAY_PARSING_TIME () {
+ // Shall we display the parsing time and number of queries?
+ // 1234 5 54 4 5 5 4 4 5 543 3 4432 2 33 2 2 21
+ if ((((isExtensionInstalledAndNewer('sql_patches', '0.4.1')) && (getConfig('show_timings') == 'Y') && (!isGetRequestElementSet('frame'))) || (isInstallationPhase())) && (getOutputMode() == 0) && ($GLOBALS['header_sent'] == 2)) {
+ // Then display it here
+ displayParsingTime();
+ } // END - if
+}
+
// [EOF]
?>
// Footer disabled or already sent?
// 1234 5 54 45 5 5 543 3 321
if ((((!isset($GLOBALS['footer_sent'])) || (($GLOBALS['footer_sent'] != 1) && ($GLOBALS['footer_sent'] != 2))) && (getOutputMode() != 1))) {
- // @TODO Rewrite these all into filters
- // Handle fatal errors
- handleFatalErrors();
-
- // Shall we display the copyright notice?
- if ((!isGetRequestElementSet('frame')) && (basename($_SERVER['PHP_SELF']) != 'mailid_top.php') && ((getConfig('WRITE_FOOTER') == 'Y') || (isInstalling())) && ($GLOBALS['header_sent'] == 2)) {
- // Backlink enabled?
- if ((getConfig('ENABLE_BACKLINK') == 'Y') || (isInstalling())) {
- // Copyright with backlink, thanks! :-)
- loadTemplate('copyright_backlink');
- } else {
- // No backlink in Copyright note
- loadTemplate('copyright');
- }
- } // END - if
-
- // Shall we display the parsing time and number of queries?
- // 1234 5 54 4 5 5 4 4 5 543 3 4432 2 33 2 2 21
- if ((((isExtensionInstalledAndNewer('sql_patches', '0.4.1')) && (getConfig('show_timings') == 'Y') && (!isGetRequestElementSet('frame'))) || (isInstallationPhase())) && (getOutputMode() == 0) && ($GLOBALS['header_sent'] == 2)) {
- // Then display it here
- displayParsingTime();
- } // END - if
-
- // Shall we display SQL queries?
- if ((isAdmin()) && (isExtensionInstalledAndNewer('other', '0.2.2')) && (getConfig('display_debug_sqls') == 'Y') && (!isGetRequestElementSet('frame')) && ($GLOBALS['header_sent'] == 2)) {
- // Then display it here
- displayDebugSqls();
- } // END - if
-
- // Shall we include the uberwach snippet?
- if ((!isGetRequestElementSet('frame')) && (isExtensionActive('uberwach')) && (getModule() != 'admin') && ($GLOBALS['header_sent'] == 2)) {
- // Then display it here
- loadUberwachSnippet();
- } // END - if
+ // Run the filter, sweet huh?
+ runFilterChain('page_footer');
// Load page footer
loadTemplate('page_footer');
-
- // And the last closing HTML tag
- outputHtml('</html>');
} // END - if
// Footer has been reached
return $ret;
}
-// Handles fatal errors
-function handleFatalErrors () {
- // Do we have errors to handle and right output mode?
- if ((getTotalFatalErrors() == 0) || (getOutputMode() != 0)) {
- // Abort executing here
- return false;
- } // END - if
-
- // Set content type
- setContentType('text/html');
-
- // Load config here
- loadIncludeOnce('inc/load_config.php');
-
- // Set unset variable
- if (empty($check)) $check = '';
-
- // Default is none
- $content = '';
-
- // Installation phase or regular mode?
- if ((isInstallationPhase())) {
- // While we are installing ouput other header than while it is installed... :-)
- $OUT = '';
- foreach (getFatalArray() as $key => $value) {
- // Prepare content for the template
- $content = array(
- 'key' => ($key + 1),
- 'value' => $value
- );
-
- // Load row template
- $OUT .= loadTemplate('install_fatal_row', true, $content);
- }
-
- // Load main template
- $content = loadTemplate('install_fatal_table', true, $OUT);
- } elseif (isInstalled()) {
- // Display all runtime fatal errors
- $OUT = '';
- foreach (getFatalArray() as $key => $value) {
- // Prepare content for the template
- $content = array(
- 'key' => ($key + 1),
- 'value' => $value
- );
-
- // Load row template
- $OUT .= loadTemplate('runtime_fatal_row', true, $content);
- }
-
- // Load main template
- $content = loadTemplate('runtime_fatal_table', true, $OUT);
- }
-
- // Message to regular users (non-admin)
- $CORR = getMessage('FATAL_REPORT_ERRORS');
-
- // PHP warnings fixed
- if ($check == 'done') {
- if (isAdmin()) $CORR = getMessage('FATAL_CORRECT_ERRORS');
- } // END - if
-
- // Remember all in array
- $content = array(
- 'rows' => $content,
- 'corr' => $CORR
- );
-
- // Load footer
- loadIncludeOnce('inc/header.php');
-
- // Load main template
- loadTemplate('fatal_errors', false, $content);
-
- // Delete all to prevent double-display
- initFatalMessages();
-
- // Load footer
- loadIncludeOnce('inc/footer.php');
-
- // Abort here
- shutdown();
-}
-
// Print code with line numbers
function linenumberCode ($code) {
if (!is_array($code)) $codeE = explode("\n", $code); else $codeE = $code;
loadTemplate('admin_other_sqls', false, $OUT);
}
+// Filter for debugging SQLs
+function FILTER_DISPLAY_DEBUG_SQL () {
+ // Shall we display SQL queries?
+ if ((isAdmin()) && (isExtensionInstalledAndNewer('other', '0.2.2')) && (getConfig('display_debug_sqls') == 'Y') && (!isGetRequestElementSet('frame')) && ($GLOBALS['header_sent'] == 2)) {
+ // Then display it here
+ displayDebugSqls();
+ } // END - if
+}
+
// [EOF]
?>
// Some security stuff...
if (!defined('__SECURITY')) {
die();
-}
+} // END - if
// Loads the snippet for the uberwach action
function loadUberwachSnippet () {
loadTemplate('uberwach_snippet');
}
-//
+// Filter for displaying uberwach snippet
+function FILTER_DISPLAY_UBERWACH_SNIPPET () {
+ // Shall we include the uberwach snippet?
+ if ((!isGetRequestElementSet('frame')) && (isExtensionActive('uberwach')) && (getModule() != 'admin') && ($GLOBALS['header_sent'] == 2)) {
+ // Then display it here
+ loadUberwachSnippet();
+ } // END - if
+}
+
+// [EOF]
?>
// URL was constructed
if (getTotalFatalErrors() > 0) {
// Handle fatal errors
- handleFatalErrors();
+ runFilterChain('handle_fatal_errors');
} else {
// Load URL
redirectToUrl($URL);
// Check module for permissions
$checkModule = checkModulePermissions();
- // Cound module here
- countModuleHit(getModule());
-
// Admin module should be accessable by guests to login
if ((getModule() == 'admin') && ($checkModule == 'admin_only')) {
// This is fine and can be ignored
}
// Handle fatal errors
-handleFatalErrors();
+runFilterChain('handle_fatal_errors');
// [EOF]
?>
loadTemplate('admin_settings_saved', false, $content);
}
-// Update module counter
-function countModuleHit($mod) {
- // Do count all other modules but not accesses on CSS file css.php!
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `clicks`=`clicks`+1 WHERE `module`='%s' LIMIT 1",
- array($mod), __FUNCTION__, __LINE__);
-}
-
// Get action value from mode (admin/guest/member) and what-value
function getModeAction ($mode, $what) {
// Init status
loadIncludeOnce('inc/header.php');
// Handle fatal errors
-handleFatalErrors();
+runFilterChain('handle_fatal_errors');
// Here start's our installtion stuff
loadIncludeOnce('inc/install-inc.php');
// Handle fatal errors again
-handleFatalErrors();
+runFilterChain('handle_fatal_errors');
// Load main installation table
loadTemplate('install_main', false, $GLOBALS['install_content']);
// Is the extension active
redirectOnUninstalledExtension('mailid');
-// Secure all data
+// Init variables
$url_userid = 0;
$url_bid = 0;
$url_mid = 0;
$code = 0;
$mode = '';
+// Secure all data
if (isGetRequestElementSet('userid')) $url_userid = bigintval(getRequestElement('userid'));
if (isGetRequestElementSet('mailid')) $url_mid = bigintval(getRequestElement('mailid'));
if (isGetRequestElementSet('bonusid')) $url_bid = bigintval(getRequestElement('bonusid'));
if (isGetRequestElementSet('code')) $code = bigintval(getRequestElement('code'));
if (isGetRequestElementSet('mode')) $mode = getRequestElement('mode');
-// 01 1 12 2 2 21 1 22 10
+// 01 1 12 2 2 21 1 22 10
if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErrors() == 0)) {
// No image? Then output header
if ($mode != 'img') loadIncludeOnce('inc/header.php');
list($lid, $ltype) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
+ // Init result here with invalid to avoid possible missing variable
+ $result_mailid = false;
+
// @TODO Rewrite this to a filter
switch ($ltype) {
case 'NORMAL':
<td width="10" class="seperator"> </td>
<td align="right" width="275">{--ADMIN_MEDIADATA_MT_START--}:</td>
<td width="10" class="seperator"> </td>
- <td align="center" width="275">{?__MT_START?}</td>
+ <td align="center" width="275">$content[mt_start]</td>
<td width="10" class="seperator"> </td>
</tr>
<tr>
<td align="right" width="275">{--ADMIN_MEDIADATA_MT_STAGE--}:</td>
<td width="10" class="seperator"> </td>
<td align="center" width="275"><input type="text" name="mt_stage"
- class="admin_normal" value="{?__MT_STAGE?}" size="6" maxlength="20" />
+ class="admin_normal" value="{?mt_stage?}" size="6" maxlength="20" />
</td>
<td width="10" class="seperator"> </td>
</tr>