inc/extensions/ext-yoomedia.php -text
inc/fatal_errors.php -text
inc/filters.php -text
+inc/fix_filters.php -text
inc/footer.php -text
inc/functions.php -text
inc/gen_mediadata.php -text
$querytimeBefore = array_sum(explode(' ', microtime()));
// Run SQL command
- //* DEBUG: */ echo $sql_string."<br />\n";
+ //* DEBUG: */ print $sql_string."<br />\n";
$result = mysql_query($sql_string, SQL_GET_LINK())
or addFatalMessage(__FUNCTION__, __LINE__, $F." (".$L."):".mysql_error()."<br />
Query string:<br />
".$sql_string);
+ //* DEBUG: */ print __LINE__ . ': numRows=' . SQL_NUMROWS($result) . ',affected=' . SQL_AFFECTEDROWS() . "<br />\n";
// Ending time
$querytimeAfter = array_sum(explode(' ', microtime()));
// And load SQL queries in order of version history
for ($idx = ($start + 1); $idx < count($history); $idx++) {
// Set current extension name
- //* DEBUG: */ print __FUNCTION__.'['.__LINE__.':] ext_name='.$ext_name.'<br />';
+ //* DEBUG: */ print __FUNCTION__.'['.__LINE__.':] ext_name='.$ext_name."<br />\n";
EXT_SET_CURR_NAME($ext_name);
// Set extension version
if (!defined('__SECURITY')) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
require($INC);
-}
+} // END - if
// Version number
-EXT_SET_VERSION('0.6.2');
+EXT_SET_VERSION('0.6.3');
// Version history array (add more with , '0.1.0' and so on)
-EXT_SET_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', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2'));
+EXT_SET_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', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3'));
switch ($EXT_LOAD_MODE)
{
// Update notes (these will be set as task text!)
EXT_SET_UPDATE_NOTES("Abhängigkeit von <u>ext-user</u> gesetzt.");
break;
+
+ case '0.6.3': // SQL queries for v0.6.3
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("Filter-Tabelle bereinigt um doppelte Einträge und Unique-Key auf <em>filter_name</em> und <em>filter_function</em> zusammen gesetzt.");
+
+ // Include special filte
+ loadIncludeOnce('inc/fix_filters.php');
+ break;
}
break;
--- /dev/null
+<?php
+/************************************************************************
+ * MXChange v0.2.1 Start: 10/06/2009 *
+ * =============== Last change: 10/06/2009 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : fix_filters.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Fixes dublicate entries in filters table *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Repariert doppelte Eintraege in filters-Tabelle *
+ * -------------------------------------------------------------------- *
+ * $Revision:: 1004 $ *
+ * $Date:: 2009-04-03 09:32:14 +0000 (Fri, 03 Apr 2009) $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: quix0r $ *
+ * Needs to be in all Files and every File needs "svn propset *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder *
+ * For more information visit: http://www.mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+ $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
+ require($INC);
+} // END - if
+
+// Get all filters
+$result = SQL_QUERY('SELECT
+ `filter_name`, `filter_function`
+FROM
+ `{!_MYSQL_PREFIX!}_filters`
+ORDER BY
+ `filter_name` ASC, `filter_function` ASC', __FILE__, __LINE__);
+
+// Do we have entries? (we should have!)
+if (SQL_NUMROWS($result) > 0) {
+ // Load row by row
+ while ($filter = SQL_FETCHARRAY($result)) {
+ // Now search again for this filter and get it's total count
+ $count = GET_TOTAL_DATA($filter['filter_name'], 'filters', 'filter_id', 'filter_name', true, sprintf(" AND `filter_function`='%s'", $filter['filter_function']));
+
+ // Do we have more than one entry?
+ if ($count > 1) {
+ // Then clean them up, except one
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_filters` WHERE `filter_name`='%s' AND `filter_function`='%s' LIMIT %s",
+ array($filter['filter_name'], $filter['filter_function'], ($count - 1)), __FILE__, __LINE__);
+ } // END - while
+ } // END - while
+} else {
+ // @TODO Why does this happen? In installation phase of sql_patches?
+ debug_report_bug(basename(__FILE__) . ' did run with no filters in database.');
+}
+
+// Free result
+SQL_FREERESULT($result);
+
+// Now insert our unqiue key
+SQL_QUERY("ALTER TABLE `{!_MYSQL_PREFIX!}_filters` ADD UNIQUE `name_function` (`filter_name` , `filter_function`)", __FILE__, __LINE__);
+
+// [EOF]
+?>
// Exclude '.', '..' and entries in $excludeArray automatically
if (in_array($baseFile, $excludeArray, true)) {
// Exclude them
- //* DEBUG: */ print 'excluded=' . $baseFile . '<br />';
+ //* DEBUG: */ print 'excluded=' . $baseFile . "<br />\n";
continue;
} // END - if
// Check if the base filename matches an exclusion pattern and if the pattern is not empty
if ((!empty($excludePattern)) && (preg_match($excludePattern, $baseFile, $match))) {
// These Lines are only for debugging!!
- //* DEBUG: */ print 'baseDir:' . $baseDir . '<br />';
- //* DEBUG: */ print 'baseFile:' . $baseFile . '<br />';
- //* DEBUG: */ print 'FQFN:' . $FQFN . '<br />';
+ //* DEBUG: */ print 'baseDir:' . $baseDir . "<br />\n";
+ //* DEBUG: */ print 'baseFile:' . $baseFile . "<br />\n";
+ //* DEBUG: */ print 'FQFN:' . $FQFN . "<br />\n";
// Exclude this one
continue;
if (!empty($updateMode)) {
// Update entry
// @TODO Find a way for updating $_CONFIG here
- $all .= sprintf("%s=%s%s%s,", $entry, $entry, $updateMode, (float)$values[$idx]);
+ $all .= sprintf("`%s`=%s%s%s,", $entry, $entry, $updateMode, (float)$values[$idx]);
} else {
// Check if string or number
if (($values[$idx] + 0) === $values[$idx]) {
// Number detected
- $all .= sprintf("%s=%s,", $entry, (float)$values[$idx]);
+ $all .= sprintf("`%s`=%s,", $entry, (float)$values[$idx]);
} elseif ($values[$idx] == 'UNIX_TIMESTAMP()') {
// Function UNIX_TIMESTAMP() detected
- $all .= sprintf("%s=%s,", $entry, $values[$idx]);
+ $all .= sprintf("`%s`=%s,", $entry, $values[$idx]);
} else {
// String detected
- $all .= sprintf("%s='%s',", $entry, SQL_ESCAPE($values[$idx]));
+ $all .= sprintf("`%s`='%s',", $entry, SQL_ESCAPE($values[$idx]));
}
}