From: Mutwin K. <mu...@us...> - 2004-10-15 11:49:26
|
Update of /cvsroot/fuwiki/fuwiki_1_0/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29539/install Modified Files: fix_0.5.php tables_cache.sql Log Message: 1.0RC1 fixes Index: fix_0.5.php =================================================================== RCS file: /cvsroot/fuwiki/fuwiki_1_0/install/fix_0.5.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** fix_0.5.php 13 Oct 2004 20:28:28 -0000 1.1.1.1 --- fix_0.5.php 15 Oct 2004 11:49:05 -0000 1.2 *************** *** 2,15 **** require("../settings.inc"); $link = mysql_connect(_MYSQL_HOST, _MYSQL_USER, _MYSQL_PASS); ! mysql_select_db(_MYSQL_DATABASE, $link); $query = "SELECT id, name FROM wikis_cache;"; $res = mysql_query($query, $link); while($a = mysql_fetch_array($res)) { ! $query = "UPDATE wikis_cache SET name='".rawurldecode($a["name"])."' where id=".$a["id"]." LIMIT 1;"; $r = mysql_query($query, $link); } ?> \ No newline at end of file --- 2,35 ---- require("../settings.inc"); + + function decode($str) { + $str = rawurldecode($str); + if(substr_count($str, utf8_decode("ü")) == 0 && substr_count($str, utf8_decode("ä")) == 0 && substr_count($str, utf8_decode("ö")) == 0 && substr_count($str, utf8_decode("Ã")) == 0) + return utf8_decode($str); + + return $str; + } $link = mysql_connect(_MYSQL_HOST, _MYSQL_USER, _MYSQL_PASS); ! mysql_select_db("fuwiki", $link); $query = "SELECT id, name FROM wikis_cache;"; $res = mysql_query($query, $link); while($a = mysql_fetch_array($res)) { ! $query = "UPDATE wikis_cache SET name='".decode($a["name"])."' WHERE id=".$a["id"]." LIMIT 1;"; $r = mysql_query($query, $link); } + echo "updated wikis_cache\n"; + + $query = "SELECT id, name, revision FROM wikis;"; + $res = mysql_query($query, $link); + while($a = mysql_fetch_array($res)) + { + $query = "UPDATE wikis SET name='".decode($a["name"])."' WHERE id=".$a["id"]." LIMIT 1;"; + $r = mysql_query($query, $link); + } + + echo "updated wikis\n"; + ?> \ No newline at end of file Index: tables_cache.sql =================================================================== RCS file: /cvsroot/fuwiki/fuwiki_1_0/install/tables_cache.sql,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** tables_cache.sql 13 Oct 2004 20:28:28 -0000 1.1.1.1 --- tables_cache.sql 15 Oct 2004 11:49:05 -0000 1.2 *************** *** 6,12 **** `name` tinytext, `text` longtext, - `category1` int(11) default '0', - `category2` int(11) default NULL, - `category3` int(11) default NULL, PRIMARY KEY (`id`) ); --- 6,9 ---- |