[pLog-svn] r2128 - in plog/trunk: . bin-devel class class/action class/action/admin class/config class/controller class/dao class/dao/customfields class/data/validator class/database/adodb class/database/adodb/datadict class/database/adodb/docs class/database/adodb/drivers class/database/adodb/lang class/database/adodb/pear class/database/adodb/pear/Auth class/database/adodb/pear/Auth/Container class/database/adodb/perf class/database/adodb/session class/database/adodb/tests class/database/adodb/xsl class/file class/gallery/dao class/gallery/resizers class/locale class/logger/config class/mail class/net class/net/http/session class/object class/plugin class/security class/summary/action class/summary/dao class/summary/view class/template class/template/templatesets class/view class/view/admin class/xml/tree config js js/calendar js/htmlarea locale locale/unsupport release styles templates/admin templates/blueish templates/grey templates/rss templates/standard-with-plugins templates/summary templates/wizard tmp tools

oscar at devel.plogworld.net oscar at devel.plogworld.net
Tue May 31 10:28:32 GMT 2005


Author: oscar
Date: 2005-05-31 10:28:30 +0000 (Tue, 31 May 2005)
New Revision: 2128

Added:
   plog/trunk/class/action/admin/adminresourcesgroupaction.class.php
   plog/trunk/class/database/adodb/drivers/adodb-postgres8.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-sqlite.inc.php.bak
   plog/trunk/class/database/adodb/drivers/adodb-sybase_ase.inc.php
   plog/trunk/class/database/adodb/lang/adodb-da.inc.php
   plog/trunk/class/database/adodb/lang/adodb-esperanto.inc.php
   plog/trunk/class/database/adodb/lang/adodb-uk1251.inc.php
   plog/trunk/class/database/adodb/pear/
   plog/trunk/class/database/adodb/pear/Auth/
   plog/trunk/class/database/adodb/pear/Auth/Container/
   plog/trunk/class/database/adodb/pear/Auth/Container/ADOdb.php
   plog/trunk/class/database/adodb/pear/readme.Auth.txt
   plog/trunk/class/database/adodb/server.php
   plog/trunk/class/database/adodb/tests/
   plog/trunk/class/database/adodb/tests/benchmark.php
   plog/trunk/class/database/adodb/tests/client.php
   plog/trunk/class/database/adodb/tests/pdo.php
   plog/trunk/class/database/adodb/tests/test-datadict.php
   plog/trunk/class/database/adodb/tests/test-perf.php
   plog/trunk/class/database/adodb/tests/test-pgblob.php
   plog/trunk/class/database/adodb/tests/test-php5.php
   plog/trunk/class/database/adodb/tests/test-xmlschema.php
   plog/trunk/class/database/adodb/tests/test.php
   plog/trunk/class/database/adodb/tests/test2.php
   plog/trunk/class/database/adodb/tests/test3.php
   plog/trunk/class/database/adodb/tests/test4.php
   plog/trunk/class/database/adodb/tests/test5.php
   plog/trunk/class/database/adodb/tests/test_rs_array.php
   plog/trunk/class/database/adodb/tests/testcache.php
   plog/trunk/class/database/adodb/tests/testdatabases.inc.php
   plog/trunk/class/database/adodb/tests/testgenid.php
   plog/trunk/class/database/adodb/tests/testmssql.php
   plog/trunk/class/database/adodb/tests/testoci8.php
   plog/trunk/class/database/adodb/tests/testoci8cursor.php
   plog/trunk/class/database/adodb/tests/testpaging.php
   plog/trunk/class/database/adodb/tests/testpear.php
   plog/trunk/class/database/adodb/tests/testsessions.php
   plog/trunk/class/database/adodb/tests/time.php
   plog/trunk/class/database/adodb/tests/tmssql.php
   plog/trunk/class/database/adodb/tests/xmlschema.xml
   plog/trunk/class/database/adodb/xsl/
   plog/trunk/class/database/adodb/xsl/convert-0.1-0.2.xsl
   plog/trunk/class/database/adodb/xsl/convert-0.2-0.1.xsl
   plog/trunk/class/database/adodb/xsl/remove-0.2.xsl
   plog/trunk/locale/locale_fi_FI.php
   plog/trunk/locale/locale_ja_JP.php
   plog/trunk/locale/unsupport/
   plog/trunk/locale/unsupport/locale_zh_CN_gb2312.php
   plog/trunk/locale/unsupport/locale_zh_TW_big5.php
   plog/trunk/release/logging.properties.php.dist
   plog/trunk/styles/admin-ff.css
   plog/trunk/templates/admin/resourcesgroup.template
Removed:
   plog/trunk/class/database/adodb/pear/Auth/
   plog/trunk/class/database/adodb/pear/Auth/Container/
   plog/trunk/class/database/adodb/pear/Auth/Container/ADOdb.php
   plog/trunk/class/database/adodb/pear/readme.Auth.txt
   plog/trunk/class/database/adodb/tests/benchmark.php
   plog/trunk/class/database/adodb/tests/client.php
   plog/trunk/class/database/adodb/tests/pdo.php
   plog/trunk/class/database/adodb/tests/test-datadict.php
   plog/trunk/class/database/adodb/tests/test-perf.php
   plog/trunk/class/database/adodb/tests/test-pgblob.php
   plog/trunk/class/database/adodb/tests/test-php5.php
   plog/trunk/class/database/adodb/tests/test-xmlschema.php
   plog/trunk/class/database/adodb/tests/test.php
   plog/trunk/class/database/adodb/tests/test2.php
   plog/trunk/class/database/adodb/tests/test3.php
   plog/trunk/class/database/adodb/tests/test4.php
   plog/trunk/class/database/adodb/tests/test5.php
   plog/trunk/class/database/adodb/tests/test_rs_array.php
   plog/trunk/class/database/adodb/tests/testcache.php
   plog/trunk/class/database/adodb/tests/testdatabases.inc.php
   plog/trunk/class/database/adodb/tests/testgenid.php
   plog/trunk/class/database/adodb/tests/testmssql.php
   plog/trunk/class/database/adodb/tests/testoci8.php
   plog/trunk/class/database/adodb/tests/testoci8cursor.php
   plog/trunk/class/database/adodb/tests/testpaging.php
   plog/trunk/class/database/adodb/tests/testpear.php
   plog/trunk/class/database/adodb/tests/testsessions.php
   plog/trunk/class/database/adodb/tests/time.php
   plog/trunk/class/database/adodb/tests/tmssql.php
   plog/trunk/class/database/adodb/tests/xmlschema.xml
   plog/trunk/class/database/adodb/xsl/convert-0.1-0.2.xsl
   plog/trunk/class/database/adodb/xsl/convert-0.2-0.1.xsl
   plog/trunk/class/database/adodb/xsl/remove-0.2.xsl
   plog/trunk/locale/unsupport/locale_zh_CN_gb2312.php
   plog/trunk/locale/unsupport/locale_zh_TW_big5.php
   plog/trunk/templates/grey/demosites.template
Modified:
   plog/trunk/.htaccess
   plog/trunk/admin.php
   plog/trunk/bin-devel/build-svn.sh
   plog/trunk/class/Doxyfile
   plog/trunk/class/action/addcommentaction.class.php
   plog/trunk/class/action/admin/adminaction.class.php
   plog/trunk/class/action/admin/adminaddarticlecategoryaction.class.php
   plog/trunk/class/action/admin/adminaddblogaction.class.php
   plog/trunk/class/action/admin/adminaddlinkaction.class.php
   plog/trunk/class/action/admin/adminaddlinkcategoryaction.class.php
   plog/trunk/class/action/admin/adminaddlocaleaction.class.php
   plog/trunk/class/action/admin/adminaddresourceaction.class.php
   plog/trunk/class/action/admin/adminaddresourcealbumaction.class.php
   plog/trunk/class/action/admin/admincontrolcenteraction.class.php
   plog/trunk/class/action/admin/admindeletearticlecategoryaction.class.php
   plog/trunk/class/action/admin/admindeletegalleryitemsaction.class.php
   plog/trunk/class/action/admin/admindeletelinkaction.class.php
   plog/trunk/class/action/admin/admindeletelinkcategoryaction.class.php
   plog/trunk/class/action/admin/admindeletereferreraction.class.php
   plog/trunk/class/action/admin/admindeleteresourceaction.class.php
   plog/trunk/class/action/admin/admindeleteresourcealbumaction.class.php
   plog/trunk/class/action/admin/adminmainaction.class.php
   plog/trunk/class/action/admin/adminmarkcommentaction.class.php
   plog/trunk/class/action/admin/adminupdateglobalsettingsaction.class.php
   plog/trunk/class/action/admin/adminupdatelinkaction.class.php
   plog/trunk/class/action/admin/adminupdatelinkcategoryaction.class.php
   plog/trunk/class/action/admin/adminupdateresourceaction.class.php
   plog/trunk/class/action/admin/adminupdateresourcealbumaction.class.php
   plog/trunk/class/action/blogaction.class.php
   plog/trunk/class/action/commentaction.class.php
   plog/trunk/class/action/defaultaction.class.php
   plog/trunk/class/action/resourceserveraction.class.php
   plog/trunk/class/action/rssaction.class.php
   plog/trunk/class/action/viewarticleaction.class.php
   plog/trunk/class/config/configfilestorage.class.php
   plog/trunk/class/config/properties.class.php
   plog/trunk/class/controller/admincontrollermap.properties.php
   plog/trunk/class/dao/article.class.php
   plog/trunk/class/dao/articlecategories.class.php
   plog/trunk/class/dao/articlecomments.class.php
   plog/trunk/class/dao/articlenotifications.class.php
   plog/trunk/class/dao/articles.class.php
   plog/trunk/class/dao/blogs.class.php
   plog/trunk/class/dao/customfields/customfield.class.php
   plog/trunk/class/dao/customfields/customfieldsvalues.class.php
   plog/trunk/class/data/validator/usernamevalidator.class.php
   plog/trunk/class/database/adodb/datadict/datadict-access.inc.php
   plog/trunk/class/database/adodb/datadict/datadict-db2.inc.php
   plog/trunk/class/database/adodb/datadict/datadict-firebird.inc.php
   plog/trunk/class/database/adodb/datadict/datadict-generic.inc.php
   plog/trunk/class/database/adodb/datadict/datadict-ibase.inc.php
   plog/trunk/class/database/adodb/datadict/datadict-informix.inc.php
   plog/trunk/class/database/adodb/datadict/datadict-mssql.inc.php
   plog/trunk/class/database/adodb/datadict/datadict-mysql.inc.php
   plog/trunk/class/database/adodb/datadict/datadict-oci8.inc.php
   plog/trunk/class/database/adodb/datadict/datadict-postgres.inc.php
   plog/trunk/class/database/adodb/datadict/datadict-sapdb.inc.php
   plog/trunk/class/database/adodb/datadict/datadict-sybase.inc.php
   plog/trunk/class/database/adodb/docs/docs-adodb.htm
   plog/trunk/class/database/adodb/docs/docs-datadict.htm
   plog/trunk/class/database/adodb/docs/docs-oracle.htm
   plog/trunk/class/database/adodb/docs/docs-perf.htm
   plog/trunk/class/database/adodb/docs/docs-session.htm
   plog/trunk/class/database/adodb/docs/old-changelog.htm
   plog/trunk/class/database/adodb/drivers/adodb-access.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-ado.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-ado5.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-ado_access.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-ado_mssql.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-borland_ibase.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-csv.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-db2.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-fbsql.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-firebird.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-ibase.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-informix.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-informix72.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-ldap.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-mssql.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-mssqlpo.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-mysql.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-mysqli.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-mysqlt.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-netezza.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-oci8.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-oci805.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-oci8po.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-odbc.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-odbc_mssql.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-odbc_oracle.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-odbtp.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-odbtp_unicode.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-oracle.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-pdo.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-postgres.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-postgres64.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-postgres7.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-proxy.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-sapdb.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-sqlanywhere.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-sqlite.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-sqlitepo.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-sybase.inc.php
   plog/trunk/class/database/adodb/drivers/adodb-vfp.inc.php
   plog/trunk/class/database/adodb/lang/adodb-es.inc.php
   plog/trunk/class/database/adodb/perf/perf-db2.inc.php
   plog/trunk/class/database/adodb/perf/perf-informix.inc.php
   plog/trunk/class/database/adodb/perf/perf-mssql.inc.php
   plog/trunk/class/database/adodb/perf/perf-mysql.inc.php
   plog/trunk/class/database/adodb/perf/perf-oci8.inc.php
   plog/trunk/class/database/adodb/perf/perf-postgres.inc.php
   plog/trunk/class/database/adodb/pivottable.inc.php
   plog/trunk/class/database/adodb/rsfilter.inc.php
   plog/trunk/class/database/adodb/session/adodb-compress-bzip2.php
   plog/trunk/class/database/adodb/session/adodb-compress-gzip.php
   plog/trunk/class/database/adodb/session/adodb-cryptsession.php
   plog/trunk/class/database/adodb/session/adodb-encrypt-mcrypt.php
   plog/trunk/class/database/adodb/session/adodb-encrypt-md5.php
   plog/trunk/class/database/adodb/session/adodb-encrypt-secret.php
   plog/trunk/class/database/adodb/session/adodb-session-clob.php
   plog/trunk/class/database/adodb/session/adodb-session.php
   plog/trunk/class/database/adodb/toexport.inc.php
   plog/trunk/class/database/adodb/tohtml.inc.php
   plog/trunk/class/file/file.class.php
   plog/trunk/class/file/fileuploads.class.php
   plog/trunk/class/gallery/dao/galleryalbums.class.php
   plog/trunk/class/gallery/dao/galleryresources.class.php
   plog/trunk/class/gallery/resizers/galleryimagemagickresizer.class.php
   plog/trunk/class/locale/locale.class.php
   plog/trunk/class/locale/localefinder.class.php
   plog/trunk/class/locale/locales.class.php
   plog/trunk/class/logger/config/loggerconfigloader.class.php
   plog/trunk/class/mail/emailmessage.class.php
   plog/trunk/class/mail/emailservice.class.php
   plog/trunk/class/net/customrequestgenerator.class.php
   plog/trunk/class/net/customurlhandler.class.php
   plog/trunk/class/net/http/session/sessionmanager.class.php
   plog/trunk/class/net/linkparser.class.php
   plog/trunk/class/net/modrewriterequestgenerator.class.php
   plog/trunk/class/net/prettyrequestgenerator.class.php
   plog/trunk/class/net/prettyrequestparser.class.php
   plog/trunk/class/net/rawrequestgenerator.class.php
   plog/trunk/class/object/exception.class.php
   plog/trunk/class/plugin/pluginbase.class.php
   plog/trunk/class/plugin/pluginmanager.class.php
   plog/trunk/class/security/bayesianfilter.class.php
   plog/trunk/class/summary/action/activeaccountaction.class.php
   plog/trunk/class/summary/action/bloglistaction.class.php
   plog/trunk/class/summary/action/blogprofileaction.class.php
   plog/trunk/class/summary/action/dofinishregister.class.php
   plog/trunk/class/summary/action/doreadagreement.class.php
   plog/trunk/class/summary/action/dousercreation.class.php
   plog/trunk/class/summary/action/registeraction.class.php
   plog/trunk/class/summary/action/summaryaction.class.php
   plog/trunk/class/summary/action/summarycustompageaction.class.php
   plog/trunk/class/summary/action/summarydefaultaction.class.php
   plog/trunk/class/summary/action/summaryrssaction.class.php
   plog/trunk/class/summary/action/summarysearchaction.class.php
   plog/trunk/class/summary/action/summarysendresetemail.class.php
   plog/trunk/class/summary/action/userlistaction.class.php
   plog/trunk/class/summary/action/userprofileaction.class.php
   plog/trunk/class/summary/dao/summarystats.class.php
   plog/trunk/class/summary/view/doblogregistrationview.class.php
   plog/trunk/class/summary/view/summarybloglistview.class.php
   plog/trunk/class/summary/view/summarycachedview.class.php
   plog/trunk/class/summary/view/summaryuserlistview.class.php
   plog/trunk/class/summary/view/summaryview.class.php
   plog/trunk/class/template/cachecontrol.class.php
   plog/trunk/class/template/templatesets/templatesets.class.php
   plog/trunk/class/template/templateutils.class.php
   plog/trunk/class/view/admin/admineditpostview.class.php
   plog/trunk/class/view/admin/adminpostslistview.class.php
   plog/trunk/class/view/blogview.class.php
   plog/trunk/class/view/view.class.php
   plog/trunk/class/xml/tree/Node.php
   plog/trunk/class/xml/tree/Tree.php
   plog/trunk/config/config.properties.php
   plog/trunk/index.php
   plog/trunk/js/calendar/datetimepicker.js
   plog/trunk/js/htmlarea/htmlarea-plog-resourcelist.js
   plog/trunk/js/png.htc
   plog/trunk/locale/locale_ca_ES.php
   plog/trunk/locale/locale_de_DE.php
   plog/trunk/locale/locale_en_UK.php
   plog/trunk/locale/locale_es_ES.php
   plog/trunk/locale/locale_zh_CN.php
   plog/trunk/locale/locale_zh_TW.php
   plog/trunk/resserver.php
   plog/trunk/styles/admin.css
   plog/trunk/styles/png.css
   plog/trunk/styles/rss.css
   plog/trunk/styles/summary-ie.css
   plog/trunk/styles/summary.css
   plog/trunk/summary.php
   plog/trunk/templates/admin/dashboard.template
   plog/trunk/templates/admin/editpost.template
   plog/trunk/templates/admin/globalsettings_general.template
   plog/trunk/templates/admin/header.template
   plog/trunk/templates/admin/menus.xml
   plog/trunk/templates/admin/navigation.template
   plog/trunk/templates/admin/newpost.template
   plog/trunk/templates/admin/resourcelist.template
   plog/trunk/templates/admin/simpleerror.template
   plog/trunk/templates/blueish/commentform.template
   plog/trunk/templates/blueish/posttrackbacks.template
   plog/trunk/templates/grey/commentform.template
   plog/trunk/templates/grey/footer.template
   plog/trunk/templates/grey/grey.css
   plog/trunk/templates/grey/postandcomments.template
   plog/trunk/templates/rss/atom.template
   plog/trunk/templates/rss/rss090.template
   plog/trunk/templates/rss/rss10.template
   plog/trunk/templates/rss/rss20.template
   plog/trunk/templates/standard-with-plugins/commentform.template
   plog/trunk/templates/standard-with-plugins/delicious.template
   plog/trunk/templates/summary/blogprofile.template
   plog/trunk/templates/summary/blogslist.template
   plog/trunk/templates/summary/footer.template
   plog/trunk/templates/summary/index.template
   plog/trunk/templates/summary/recent.template
   plog/trunk/templates/summary/registerstep2.template
   plog/trunk/templates/summary/registerstep3.template
   plog/trunk/templates/summary/resetpassword.template
   plog/trunk/templates/summary/userlist.template
   plog/trunk/templates/summary/userprofile.template
   plog/trunk/templates/wizard/update1.template
   plog/trunk/templates/wizard/update4.template
   plog/trunk/tmp/
   plog/trunk/tools/retest.php
   plog/trunk/trackback.php
   plog/trunk/wizard.php
   plog/trunk/xmlrpc.php
Log:
Merged trunk/ and the plog-1.0.1 branch at revision r2127


Modified: plog/trunk/.htaccess
===================================================================
--- plog/trunk/.htaccess	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/.htaccess	2005-05-31 10:28:30 UTC (rev 2128)
@@ -106,10 +106,14 @@
  ForceType application/x-httpd-php
 </Files>
 
-ErrorDocument 401 /plog/error.php
-ErrorDocument 403 /plog/error.php
-ErrorDocument 404 /plog/error.php
+<Files user>
+ ForceType application/x-httpd-php
+</Files>
 
+ErrorDocument 401 /plog-1.0.1/error.php
+ErrorDocument 403 /plog-1.0.1/error.php
+ErrorDocument 404 /plog-1.0.1/error.php
 
 
 
+

Modified: plog/trunk/admin.php
===================================================================
--- plog/trunk/admin.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/admin.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,10 +1,13 @@
 <?php
+    // please enable the line below if you are having memory issues
+    //ini_set('memory_limit', "16M");
+
     if (!defined( "PLOG_CLASS_PATH" )) {
         define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
     }
 
     include_once( PLOG_CLASS_PATH."class/controller/admincontroller.class.php" );
-	include_once( PLOG_CLASS_PATH."class/net/http/session/sessionmanager.class.php" );
+    include_once( PLOG_CLASS_PATH."class/net/http/session/sessionmanager.class.php" );
     include_once( PLOG_CLASS_PATH."class/dao/userinfo.class.php" );
     include_once( PLOG_CLASS_PATH."class/dao/bloginfo.class.php" );
     include_once( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );
@@ -21,8 +24,8 @@
         die();
     }
 
-	// initialize the session
-	SessionManager::init();
+    // initialize the session
+    SessionManager::init();
 
     $controller = new AdminController();
 

Modified: plog/trunk/bin-devel/build-svn.sh
===================================================================
--- plog/trunk/bin-devel/build-svn.sh	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/bin-devel/build-svn.sh	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,144 +1,145 @@
-#!/bin/sh
-
-#
-# Script to generate distribution builds of pLog
-#
-# (c) 27-08-2004, the pLog Team
-#
-#
-# Requires two parameters: the name of the output package and the
-# CVS tag label that will be used to fetch the contents of the build. Therefore,
-# contents must be tagged _before_ running this script. 
-# The same CVS label must be used for both the plog_devel and plog_docs module.
-#
-
-#
-# server and repository path
-#
-SVNSERVER=http://devel.plogworld.net
-SVNREPO=/svn/plog/plog
-
-#
-# array with the files that we are going to remove before
-# making the package... Wildcards, complete paths, whatever
-# can be used here
-#
-TOREMOVE="include_files release/ locale/old/ templates/standard-with-plugins/ templates/grey-sf/ templates/default templates/plogworld bin-devel/ docs-devel/ class/database/adodb/docs class/database/adodb/drivers/adodb-ado5.inc.php class/database/adodb/drivers/adodb-ado.inc.php class/database/adodb/drivers/adodb-odbtp_unicode.inc.php class/database/adodb/drivers/adodb-odbtp.inc.php class/database/adodb/drivers/adodb-sqlitepo.inc.php class/database/adodb/drivers/adodb-netezza.inc.php class/database/adodb/drivers/adodb-ldap.inc.php class/database/adodb/drivers/adodb-access.inc.php class/database/adodb/drivers/adodb-ado_access.inc.php class/database/adodb/drivers/adodb-ado_mssql.inc.php class/database/adodb/drivers/adodb-borland_ibase.inc.php class/database/adodb/drivers/adodb-csv.inc.php class/database/adodb/drivers/adodb-db2.inc.php class/database/adodb/drivers/adodb-fbsql.inc.php class/database/adodb/drivers/adodb-firebird.inc.php class/database/adodb/drivers/adodb-ibase.inc.php class/database/adodb/drivers/adodb-informix.inc.php class/database/adodb/drivers/adodb-informix72.inc.php class/database/adodb/drivers/adodb-mssql.inc.php class/database/adodb/drivers/adodb-mssqlpo.inc.php class/database/adodb/drivers/adodb-oci8.inc.php class/database/adodb/drivers/adodb-oci8po.inc.php class/database/adodb/drivers/adodb-oci805.inc.php class/database/adodb/drivers/adodb-odbc_mssql.inc.php class/database/adodb/drivers/adodb-odbc_oracle.inc.php class/database/adodb/drivers/adodb-odbc.inc.php class/database/adodb/drivers/adodb-oracle.inc.php class/database/adodb/drivers/adodb-postgres.inc.php class/database/adodb/drivers/adodb-postgres7.inc.php class/database/adodb/drivers/adodb-postgres64.inc.php class/database/adodb/drivers/adodb-proxy.inc.php class/database/adodb/drivers/adodb-sapdb.inc.php class/database/adodb/drivers/adodb-sqlanywhere.inc.php class/database/adodb/drivers/adodb-sqlite.inc.php class/database/adodb/drivers/adodb-sybase.inc.php class/database/adodb/drivers/adodb-vfp.inc.php class/database/adodb/lang/adodb-ca.inc.php class/database/adodb/lang/adodb-cn.inc.php class/database/adodb/lang/adodb-cz.inc.php class/database/adodb/lang/adodb-de.inc.php class/database/adodb/lang/adodb-es.inc.php class/database/adodb/lang/adodb-fr.inc.php class/database/adodb/lang/adodb-it.inc.php class/database/adodb/lang/adodb-pt-br.inc.php class/database/adodb/lang/adodb-ru1251.inc.php class/database/adodb/lang/adodb-sv.inc.php class/database/adodb/perf/perf-db2.inc.php class/database/adodb/perf/perf-informix.inc.php class/database/adodb/perf/perf-mssql.inc.php class/database/adodb/perf/perf-oci8.inc.php class/database/adodb/perf/perf-postgres.inc.php class/database/adodb/session/ class/gallery/getid3/module.archive.rar.php class/gallery/getid3/module.archive.szip.php class/gallery/getid3/module.audio-video.bink.php class/gallery/getid3/module.audio-video.matroska.php class/gallery/getid3/module.audio-video.nsv.php class/gallery/getid3/module.audio.avr.php class/gallery/getid3/module.audio.bonk.php class/gallery/getid3/module.audio.la.php class/gallery/getid3/module.audio.lpac.php class/gallery/getid3/module.audio.monkey.php class/gallery/getid3/module.audio.optimfrog.php class/gallery/getid3/module.audio.rkau.php class/gallery/getid3/module.audio.shorten.php class/gallery/getid3/module.audio.tta.php class/gallery/getid3/module.audio.voc.php class/gallery/getid3/module.audio.vqf.php class/gallery/getid3/module.graphic.bmp.php class/gallery/getid3/module.graphpc.pcd.php class/gallery/getid3/module.misc.exe.php class/gallery/getid3/module.misc.iso.php dbperf.php locale/locale_en_US.php *.xcode tools/ locale/locale_it_IT.php class/database/adodb/lang/adodb-ar.inc.php class/database/adodb/lang/adodb-bg.inc.php class/database/adodb/lang/adodb-bgutf8.inc.php class/database/adodb/lang/adodb-hu.inc.php class/database/adodb/lang/adodb-nl.inc.php class/database/adodb/lang/adodb-pl.inc.php class/database/adodb/lang/adodb-ro.inc.php
-
-#
-# helper functions to print things in different colors
-#
-NOCOLOR='\e[0m'
-message()
-{
- echo -e "\033[01;32m$*$NOCOLOR"
-}
-
-warning()
-{
- echo -e "\033[01;33m$*$NOCOLOR"
-}
-
-error()
-{
- echo -e "\033[01;31m$*$NOCOLOR"
-}
-
-cleanup_exit()
-{
-	rm -rf $WORKDIR
-	rm -rf $WORKDIR-docs
-	exit $1
-}
-
-# check parameters
-if [ $# -lt 1 ]; then
-    echo "Makes a build off the latest SVN source code and packages it"
-    echo ""
-	echo "Usage: build-svn.sh label package-name"
-	echo ""
-	echo "If package-name is omitted, the name will plog-devel-current_date"
-	exit -1
-fi
-
-SVNTAG=$1
-
-# if there was no package name parameter, then build one using the current date
-if [ $# -eq 1 ]; then
-    PACKAGENAME=plog-devel-`date +%Y%m%d`
-else
-    PACKAGENAME=$2
-fi
-
-message "Using $PACKAGENAME as the package name"
-WORKDIR=$PACKAGENAME
-BUILDLABEL=$PACKAGENAME
-
-# determine whether code should be fetched from 
-# plog/trunk or plog/tags/xxxx
-if [ $SVNTAG == "HEAD" ]; then
-   SVNREPO=${SVNREPO}/trunk
-else
-   SVNREPO=${SVNREPO}/tags/${SVNTAG}
-fi
-
-# call the cvs command with the correct parameters
-message "Fetching the source code using $SVNTAG label..."
-REV=`svn checkout $SVNSERVER$SVNREPO $WORKDIR | tail -n 1 | cut -d ' ' -f 4 | tr -d . `
-
-if [ $? -eq 1 ]; then
-    echo "There was an error fetching the source code. Please try again."
-    exit 1
-fi
-
-# create the temp folder and give proper permissions to it
-message "Creating the temporary folders and setting permissions to 777..."
-if [ \! -d $WORKDIR/tmp ]; then
-	mkdir $WORKDIR/tmp
-fi
-chmod 777 $WORKDIR/tmp
-
-# create the gallery/ folder and make sure that it has the right permissions
-message "Creating the gallery/ folder and setting permissions to 777..."
-if [ \! -d $WORKDIR/gallery ]; then
-	mkdir $WORKDIR/gallery
-fi
-chmod 777 $WORKDIR/gallery
-
-# copy the generic config file and remove the dist/ folder since it is not needed
-message "Copying the generic config.properties.file..."
-cp -f $WORKDIR/release/config.properties.php.dist $WORKDIR/config/config.properties.php
-rm -rf $WORKDIR/dist
-
-# finally, update the version.php file
-message "Updating the version.php file..."
-echo "<?php" > $WORKDIR/version.php
-echo "\$version = \"${SVNTAG}_r${REV}\";" >> $WORKDIR/version.php
-echo "?>" >> $WORKDIR/version.php
-
-# remove all the annoying CVS/ folders
-message "Removing unneeded SVN folders..."
-find $WORKDIR/ -name ".svn" -exec rm -rf '{}' \; >& /dev/null
-
-# and remove all unnecessary files
-message "Removing unnecessary files...";
-for i in $TOREMOVE
-do
-  message "  -- removing $i"
-  rm -rf $WORKDIR/$i
-done
-
-# and create the .zip, tar.gz and .tar.bz2 packages
-message "Creating .zip package..."
-zip $BUILDLABEL.zip -r $WORKDIR  > /dev/null
-message "Creating .tar.gz package..."
-tar czvf $BUILDLABEL.tar.gz $WORKDIR > /dev/null
-message "Creating .tar.bz2 package..."
-tar cjvf $BUILDLABEL.tar.bz2 $WORKDIR > /dev/null
-
-# clean up the temporary folders
-message "Cleaning up..."
-cleanup_exit -1
-
-# done!
-message "Done!"
+#!/bin/sh
+
+#
+# Script to generate distribution builds of pLog
+#
+# (c) 27-08-2004, the pLog Team
+#
+#
+# Requires two parameters: the name of the output package and the
+# CVS tag label that will be used to fetch the contents of the build. Therefore,
+# contents must be tagged _before_ running this script. 
+# The same CVS label must be used for both the plog_devel and plog_docs module.
+#
+
+#
+# server and repository path
+#
+SVNSERVER=http://devel.plogworld.net
+SVNREPO=/svn/plog/plog
+
+#
+# array with the files that we are going to remove before
+# making the package... Wildcards, complete paths, whatever
+# can be used here
+#
+
+TOREMOVE="include_files release/ locale/old/ templates/standard-with-plugins/ templates/grey-sf/ templates/default templates/plogworld bin-devel/ docs-devel/ class/database/adodb/tests/ class/database/adodb/session/ class/database/adodb/pear/ class/database/adodb/xsl/ class/database/adodb/drivers/adodb-access.inc.php class/database/adodb/drivers/adodb-ado_access.inc.php class/database/adodb/drivers/adodb-ado_mssql.inc.php class/database/adodb/drivers/adodb-borland_ibase.inc.php class/database/adodb/drivers/adodb-csv.inc.php class/database/adodb/drivers/adodb-db2.inc.php class/database/adodb/drivers/adodb-fbsql.inc.php class/database/adodb/drivers/adodb-firebird.inc.php class/database/adodb/drivers/adodb-ibase.inc.php class/database/adodb/drivers/adodb-informix.inc.php class/database/adodb/drivers/adodb-informix72.inc.php class/database/adodb/drivers/adodb-mssql.inc.php class/database/adodb/drivers/adodb-mssqlpo.inc.php class/database/adodb/drivers/adodb-oci8.inc.php class/database/adodb/drivers/adodb-oci8po.inc.php class/database/adodb/drivers/adodb-oci805.inc.php class/database/adodb/drivers/adodb-odbc_mssql.inc.php class/database/adodb/drivers/adodb-odbc_oracle.inc.php class/database/adodb/drivers/adodb-odbc.inc.php class/database/adodb/drivers/adodb-oracle.inc.php class/database/adodb/drivers/adodb-postgres.inc.php class/database/adodb/drivers/adodb-postgres7.inc.php class/database/adodb/drivers/adodb-postgres64.inc.php class/database/adodb/drivers/adodb-proxy.inc.php class/database/adodb/drivers/adodb-sapdb.inc.php class/database/adodb/drivers/adodb-sqlanywhere.inc.php class/database/adodb/drivers/adodb-sqlite.inc.php class/database/adodb/drivers/adodb-sybase.inc.php class/database/adodb/drivers/adodb-vfp.inc.php class/database/adodb/lang/adodb-ca.inc.php class/database/adodb/lang/adodb-cn.inc.php class/database/adodb/lang/adodb-cz.inc.php class/database/adodb/lang/adodb-de.inc.php class/database/adodb/lang/adodb-es.inc.php class/database/adodb/lang/adodb-fr.inc.php class/database/adodb/lang/adodb-it.inc.php class/database/adodb/lang/adodb-pt-br.inc.php class/database/adodb/lang/adodb-ru1251.inc.php class/database/adodb/lang/adodb-sv.inc.php class/database/adodb/perf/perf-db2.inc.php class/database/adodb/perf/perf-informix.inc.php class/database/adodb/perf/perf-mssql.inc.php class/database/adodb/perf/perf-oci8.inc.php class/database/adodb/perf/perf-postgres.inc.php class/database/adodb/session/ class/gallery/getid3/module.archive.rar.php class/gallery/getid3/module.archive.szip.php class/gallery/getid3/module.audio-video.bink.php class/gallery/getid3/module.audio-video.matroska.php class/gallery/getid3/module.audio-video.nsv.php class/gallery/getid3/module.audio.avr.php class/gallery/getid3/module.audio.bonk.php class/gallery/getid3/module.audio.la.php class/gallery/getid3/module.audio.lpac.php class/gallery/getid3/module.audio.monkey.php class/gallery/getid3/module.audio.optimfrog.php class/gallery/getid3/module.audio.rkau.php class/gallery/getid3/module.audio.shorten.php class/gallery/getid3/module.audio.tta.php class/gallery/getid3/module.audio.voc.php class/gallery/getid3/module.audio.vqf.php class/gallery/getid3/module.graphic.bmp.php class/gallery/getid3/module.graphpc.pcd.php class/gallery/getid3/module.misc.exe.php class/gallery/getid3/module.misc.iso.php dbperf.php locale/locale_en_US.php *.xcode tools/ locale/locale_it_IT.php"
+
+#
+# helper functions to print things in different colors
+#
+NOCOLOR='\e[0m'
+message()
+{
+ echo -e "\033[01;32m$*$NOCOLOR"
+}
+
+warning()
+{
+ echo -e "\033[01;33m$*$NOCOLOR"
+}
+
+error()
+{
+ echo -e "\033[01;31m$*$NOCOLOR"
+}
+
+cleanup_exit()
+{
+	rm -rf $WORKDIR
+	rm -rf $WORKDIR-docs
+	exit $1
+}
+
+# check parameters
+if [ $# -lt 1 ]; then
+    echo "Makes a build off the latest SVN source code and packages it"
+    echo ""
+	echo "Usage: build-svn.sh label package-name"
+	echo ""
+	echo "If package-name is omitted, the name will plog-devel-current_date"
+	exit -1
+fi
+
+SVNTAG=$1
+
+# if there was no package name parameter, then build one using the current date
+if [ $# -eq 1 ]; then
+    PACKAGENAME=plog-devel-`date +%Y%m%d`
+else
+    PACKAGENAME=$2
+fi
+
+message "Using $PACKAGENAME as the package name"
+WORKDIR=$PACKAGENAME
+BUILDLABEL=$PACKAGENAME
+
+# determine whether code should be fetched from 
+# plog/trunk or plog/tags/xxxx
+if [ $SVNTAG == "HEAD" ]; then
+   SVNREPO=${SVNREPO}/trunk
+else
+   SVNREPO=${SVNREPO}/tags/${SVNTAG}
+fi
+
+# call the cvs command with the correct parameters
+message "Fetching the source code using $SVNTAG label..."
+REV=`svn checkout $SVNSERVER$SVNREPO $WORKDIR | tail -n 1 | cut -d ' ' -f 4 | tr -d . `
+
+if [ $? -eq 1 ]; then
+    echo "There was an error fetching the source code. Please try again."
+    exit 1
+fi
+
+# create the temp folder and give proper permissions to it
+message "Creating the temporary folders and setting permissions to 777..."
+if [ \! -d $WORKDIR/tmp ]; then
+	mkdir $WORKDIR/tmp
+fi
+chmod 777 $WORKDIR/tmp
+
+# create the gallery/ folder and make sure that it has the right permissions
+message "Creating the gallery/ folder and setting permissions to 777..."
+if [ \! -d $WORKDIR/gallery ]; then
+	mkdir $WORKDIR/gallery
+fi
+chmod 777 $WORKDIR/gallery
+
+# copy the generic config file and remove the dist/ folder since it is not needed
+message "Copying the generic config.properties.file..."
+cp -f $WORKDIR/release/config.properties.php.dist $WORKDIR/config/config.properties.php
+rm -rf $WORKDIR/dist
+
+# finally, update the version.php file
+message "Updating the version.php file..."
+echo "<?php" > $WORKDIR/version.php
+echo "\$version = \"${SVNTAG}_r${REV}\";" >> $WORKDIR/version.php
+echo "?>" >> $WORKDIR/version.php
+
+# remove all the annoying CVS/ folders
+message "Removing unneeded SVN folders..."
+find $WORKDIR/ -name ".svn" -exec rm -rf '{}' \; >& /dev/null
+
+# and remove all unnecessary files
+message "Removing unnecessary files...";
+for i in $TOREMOVE
+do
+  message "  -- removing $i"
+  rm -rf $WORKDIR/$i
+done
+
+# and create the .zip, tar.gz and .tar.bz2 packages
+message "Creating .zip package..."
+zip $BUILDLABEL.zip -r $WORKDIR  > /dev/null
+message "Creating .tar.gz package..."
+tar czvf $BUILDLABEL.tar.gz $WORKDIR > /dev/null
+message "Creating .tar.bz2 package..."
+tar cjvf $BUILDLABEL.tar.bz2 $WORKDIR > /dev/null
+
+# clean up the temporary folders
+message "Cleaning up..."
+cleanup_exit -1
+
+# done!
+message "Done!"

Modified: plog/trunk/class/Doxyfile
===================================================================
--- plog/trunk/class/Doxyfile	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/Doxyfile	2005-05-31 10:28:30 UTC (rev 2128)
@@ -416,7 +416,7 @@
 # directories like "/usr/src/myproject". Separate the files or directories 
 # with spaces.
 
-INPUT                  = object/ dao/ logger/ gallery/ locale/ config/ file/ database/ data/forms security/ xml/ controller/ mail/ bayesian/ misc/ net/ data/ view/ plugin/ template/ action/
+INPUT                  = object/ dao/ logger/ gallery/ locale/ config/ file/ database/ data/forms security/ xml/ controller/ mail/ bayesian/ misc/ net/ data/ view/ plugin/ template/ action/ summary/dao/
 
 # If the value of the INPUT tag contains directories, you can use the 
 # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 

Modified: plog/trunk/class/action/addcommentaction.class.php
===================================================================
--- plog/trunk/class/action/addcommentaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/addcommentaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -201,10 +201,12 @@
 			
 			// clean up the request, there's a parameter called 'userName' also used by
 			// ViewArticleAction but that doesn't have the same meaning so we better remove it
-			// before it's too late!
+			// before it's too late! We also need to add a new request commentUserName to replace
+			// original userName, in case developer need it in filter or event plugin.
 			$request = HttpVars::getRequest();
+			$request["commentUserName"] = $request["userName"];
 			$request["userName"] = "";
-			HttpVars::setRequest( $request );			
+			HttpVars::setRequest( $request ); 					
 						
 			// forward the action to ViewArticleAction
 			return BlogController::setForwardAction( "ViewArticle" );

Modified: plog/trunk/class/action/admin/adminaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/adminaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -139,6 +139,7 @@
             $this->_view->setValue( "blogsettings", $this->_blogInfo->getSettings());
             $this->_view->setValue( "op", $this->_actionInfo->_actionParamValue );
 			$this->_view->setValue( "locale", $this->_locale );
+			$this->_view->setValue( "config", $this->_config );
         }
 
         /**

Modified: plog/trunk/class/action/admin/adminaddarticlecategoryaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddarticlecategoryaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/adminaddarticlecategoryaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -80,7 +80,7 @@
 				$this->notifyEvent( EVENT_POST_CATEGORY_ADD, Array( "category" => &$category ));
 				
 				// clear the cache if everything went fine
-				CacheControl::resetBlogCache( $this->_blogInfo->getId());														
+				CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );														
 				
 				$this->setCommonData();				
             }

Modified: plog/trunk/class/action/admin/adminaddblogaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddblogaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/adminaddblogaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -62,7 +62,30 @@
 
                 return false;
             }
+            
+            // add a default category and a default post
+            $articleCategories = new ArticleCategories();
+            $articleCategory = new ArticleCategory( "General", "", $newBlogId, true );
+            $catId = $articleCategories->addArticleCategory( $articleCategory );
+            $config =& Config::getConfig();
+            $locale =& Locales::getLocale( $config->getValue( "default_locale" ));
+            $articleTopic = $locale->tr( "register_default_article_topic" );
+            $articleText  = $locale->tr( "register_default_article_text" );
+            $article = new Article( $articleTopic, 
+                                    $articleText, 
+                                    Array( $catId ), 
+                                    $this->_ownerId, 
+                                    $newBlogId, 
+                                    POST_STATUS_PUBLISHED, 
+                                    0, 
+                                    Array(), 
+                                    "welcome" );
+            $t = new Timestamp();
+            $article->setDateObject( $t );
+            $articles = new Articles();
+            $articles->addArticle( $article );            
 
+            // and inform everyone that everything went ok
 			$this->notifyEvent( EVENT_POST_BLOG_ADD, Array( "blog" => &$blog ));
             $this->_view = new AdminSiteBlogsListView( $this->_blogInfo );
             $this->_view->setSuccessMessage($this->_locale->pr("blog_added_ok", $blog->getBlog()));

Modified: plog/trunk/class/action/admin/adminaddlinkaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddlinkaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/adminaddlinkaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -78,7 +78,7 @@
             $this->setCommonData();
 			
 			// clear the cache
-			CacheControl::resetBlogCache( $this->_blogInfo->getId());
+			CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
 
             // better to return true if everything fine
             return true;

Modified: plog/trunk/class/action/admin/adminaddlinkcategoryaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddlinkcategoryaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/adminaddlinkcategoryaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -53,7 +53,7 @@
             }
 			else {
 				// clear the cache
-				CacheControl::resetBlogCache( $this->_blogInfo->getId());
+				CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
 				$this->_view->setSuccessMessage( $this->_locale->pr("link_category_added_ok", $mylinksCategory->getName()));	
 			}
 			

Modified: plog/trunk/class/action/admin/adminaddlocaleaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddlocaleaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/adminaddlocaleaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -105,8 +105,7 @@
 
             // and once it's there, we can do as if we were adding a locale code
             $upload = new FileUpload( $files["localeFile"] );
-            $regexp = "/locale_([a-z][a-z]_[A-Z][A-Z])\.php/";
-            $res = preg_match( $regexp, $upload->getFileName(), $matches );
+            $res = preg_match( REGEXP_VALID_LOCALE, $upload->getFileName(), $matches );
 		$localeCode = $matches[1];
 
 		// add the file to the list of locales

Modified: plog/trunk/class/action/admin/adminaddresourceaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddresourceaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/adminaddresourceaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -115,7 +115,7 @@
 			
 			// clear the cache no matter what happened... we should only clear it if there was at least one
 			// file uploaded but this way is not that bad after all...
-			CacheControl::resetBlogCache( $this->_blogInfo->getId());
+			CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
 			
 			if( $successMessage != "" ) $this->_view->setSuccessMessage( $successMessage );
 			if( $errorMessage != "" ) $this->_view->setErrorMessage( $errorMessage );

Modified: plog/trunk/class/action/admin/adminaddresourcealbumaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddresourcealbumaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/adminaddresourcealbumaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -65,7 +65,7 @@
                 $this->_view->setSuccessMessage( $this->_locale->pr( "album_added_ok", $album->getName()));
 				$this->notifyEvent( EVENT_POST_ALBUM_ADD, Array( "album" => &$album ));								
 				// clear the cache if everything went fine
-				CacheControl::resetBlogCache( $this->_blogInfo->getId());
+				CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
             }
             else {
                 $this->_view->setErrorMessage( $this->_locale->tr("error_adding_album" ) );

Modified: plog/trunk/class/action/admin/admincontrolcenteraction.class.php
===================================================================
--- plog/trunk/class/action/admin/admincontrolcenteraction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/admincontrolcenteraction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 
 	include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
-    include_once( PLOG_CLASS_PATH."class/view/admin/adminarticlecategorieslistview.class.php" );
+    include_once( PLOG_CLASS_PATH."class/view/admin/admintemplatedview.class.php" );	
 
     /**
      * \ingroup Action

Modified: plog/trunk/class/action/admin/admindeletearticlecategoryaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admindeletearticlecategoryaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/admindeletearticlecategoryaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -93,7 +93,7 @@
 				$this->_view->setErrorMessage( $errorMessage );
 			if( $successMessage != "" ) {
 				// and clear the cache to avoid outdated information
-				CacheControl::resetBlogCache( $this->_blogInfo->getId());			
+				CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );			
 				$this->_view->setSuccessMessage( $successMessage );
 			}
 				

Modified: plog/trunk/class/action/admin/admindeletegalleryitemsaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admindeletegalleryitemsaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/admindeletegalleryitemsaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -66,7 +66,7 @@
 			$this->setCommonData();
 			
 			// clear the cache
-			CacheControl::resetBlogCache( $this->_blogInfo->getId());
+			CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
 
             // better to return true if everything fine
             return true;		

Modified: plog/trunk/class/action/admin/admindeletelinkaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admindeletelinkaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/admindeletelinkaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -91,7 +91,7 @@
             $this->setCommonData();
 			
 			// clear the cache
-			CacheControl::resetBlogCache( $this->_blogInfo->getId());
+			CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
 
             // better to return true if everything fine
             return true;

Modified: plog/trunk/class/action/admin/admindeletelinkcategoryaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admindeletelinkcategoryaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/admindeletelinkcategoryaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -94,7 +94,7 @@
 			if( $successMessage != "" ) {
 				$this->_view->setSuccessMessage( $successMessage );
 				// clear the cache
-				CacheControl::resetBlogCache( $this->_blogInfo->getId());
+				CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
 			}
 				
             $this->setCommonData();

Modified: plog/trunk/class/action/admin/admindeletereferreraction.class.php
===================================================================
--- plog/trunk/class/action/admin/admindeletereferreraction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/admindeletereferreraction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -95,7 +95,7 @@
 			
 			if( $clearCache ) {
 				// clear the cache if needed
-				CacheControl::resetBlogCache( $this->_blogInfo->getId());			
+				CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );			
 			}
 
             $this->_view = new AdminReferrersView( $this->_blogInfo );

Modified: plog/trunk/class/action/admin/admindeleteresourceaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admindeleteresourceaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/admindeleteresourceaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -63,7 +63,7 @@
 				$this->notifyEvent( EVENT_PRE_RESOURCE_DELETE, Array( "resource" => &$resource ));
 
 				// clear the cache if everything went fine
-				CacheControl::resetBlogCache( $this->_blogInfo->getId());
+				CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
 			}
             else 
 				$this->_view->setErrorMessage( $this->_locale->pr("error_deleting_resource", $resource->getFileName()));

Modified: plog/trunk/class/action/admin/admindeleteresourcealbumaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admindeleteresourcealbumaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/admindeleteresourcealbumaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -69,7 +69,7 @@
 					$this->_view->setSuccessMessage( $this->_locale->pr("album_deleted_ok", $album->getName()));
 					$this->notifyEvent( EVENT_PRE_ALBUM_DELETE, Array( "album" => &$album ));						
 					// clear the cache
-					CacheControl::resetBlogCache( $this->_blogInfo->getId());
+					CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
 				}
                	else {
                		$this->_view->setErrorMessage( $this->_locale->pr("error_deleting_album", $album->getName()));

Modified: plog/trunk/class/action/admin/adminmainaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminmainaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/adminmainaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -37,7 +37,7 @@
 				
 				// check if the user really belongs to one or more blogs and if not, quit
 				$users = new Users();
-				$userBlogs = $users->getUsersBlogs( $this->_userInfo->getId());
+				$userBlogs = $users->getUsersBlogs( $this->_userInfo->getId(), BLOG_STATUS_ACTIVE );
 				if( count($userBlogs) == 0 ) {
 					$this->_view = new AdminSimpleErrorView();
 					$this->_view->setValue( "message", $this->_locale->tr("error_dont_belong_to_any_blog" ));
@@ -61,6 +61,14 @@
 				
 				return false;		 			 
 			}
+			
+			// if so, check that it is active
+			if( $this->_blogInfo->getStatus() != BLOG_STATUS_ACTIVE ) {
+				$this->_view = new AdminSimpleErrorView();
+				$this->_view->setValue( "message", $this->_locale->tr("error_incorrect_blog_id" ));
+				
+				return false;				
+			}
 
             // if the blog identifier is valid, now we should now check if the user belongs
             // to that blog so that we know for sure that nobody has tried to forge the
@@ -89,8 +97,16 @@
         function perform()
         {
 			// we don't have to worry about much more here, we can let the
-			// "newPost" action take care of everytyhing now...
-			AdminController::setForwardAction( "newPost" );
+			// $this->_nextAction action take care of everytyhing now...
+			// If $this->_nextAction is null, we use "newPost" as default nextAction
+				        
+	        $this->_nextAction = $this->_request->getValue( "action" );
+
+			if ( $this->_nextAction ) {
+				AdminController::setForwardAction( $this->_nextAction );
+		    } else {
+				AdminController::setForwardAction( "newPost" );
+			}
 			
             // better to return true if everything fine
             return true;

Modified: plog/trunk/class/action/admin/adminmarkcommentaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminmarkcommentaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/adminmarkcommentaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -181,7 +181,8 @@
             	// if things don't match... (like trying to set the status of an article
                 // from another blog, then quit...)
             	$this->_view = new AdminPostsListView( $this->_blogInfo );
-                $this->_view->setErrorMessage( $this->_locale->tr("error_incorrect_comment_id"));
+                $this->_view->setErrorMessage( $this->_locale->tr("error_incorrect_comment_id"));
+                $this->setCommonData();
                 return false;
             }
 

Copied: plog/trunk/class/action/admin/adminresourcesgroupaction.class.php (from rev 2126, plog/branches/plog-1.0.1/class/action/admin/adminresourcesgroupaction.class.php)

Modified: plog/trunk/class/action/admin/adminupdateglobalsettingsaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdateglobalsettingsaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/adminupdateglobalsettingsaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -27,13 +27,15 @@
 
             // the xmlrpc_ping_hosts requires special treatment, since we need to
             // split the input returned from the textbox into an array
-            $array = Array();
-            foreach(explode( "\r\n", $this->_newConfigOpts["xmlrpc_ping_hosts"] ) as $host ) {
-            	trim($host);
-            	if( $host != "" && $host != "\r\n" && $host != "\r" && $host != "\n" )
-                	array_push( $array, $host );
+            if( isset( $this->_newConfigOpts["xmlrpc_ping_hosts"])) {
+                $array = Array();
+                foreach(explode( "\r\n", $this->_newConfigOpts["xmlrpc_ping_hosts"] ) as $host ) {
+                	trim($host);
+                	if( $host != "" && $host != "\r\n" && $host != "\r" && $host != "\n" )
+                    	array_push( $array, $host );
+                }
+                $this->_newConfigOpts["xmlrpc_ping_hosts"] = $array;
             }
-            $this->_newConfigOpts["xmlrpc_ping_hosts"] = $array;
 
             // the 'locales' and 'arrays' settings are not coming from the request
             $configOpts = $this->_config->getAsArray();

Modified: plog/trunk/class/action/admin/adminupdatelinkaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdatelinkaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/adminupdatelinkaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -89,7 +89,7 @@
 			$this->notifyEvent( EVENT_POST_LINK_UPDATE, Array( "link" => &$link ));			
 			
 			// clear the cache
-			CacheControl::resetBlogCache( $this->_blogInfo->getId());
+			CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
 			
 			// and go back to the view with the list of links
             $this->_view = new AdminLinksListView( $this->_blogInfo );

Modified: plog/trunk/class/action/admin/adminupdatelinkcategoryaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdatelinkcategoryaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/adminupdatelinkcategoryaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -65,7 +65,7 @@
 			$this->notifyEvent( EVENT_POST_LINK_CATEGORY_UPDATE, Array( "linkcategory" => &$category ));			
 			
 			// clear the cache
-			CacheControl::resetBlogCache( $this->_blogInfo->getId());			
+			CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
 
             $this->_view = new AdminLinkCategoriesListView( $this->_blogInfo );
             $this->_view->setSuccessMessage( $this->_locale->pr("link_category_updated_ok", $category->getName()));

Modified: plog/trunk/class/action/admin/adminupdateresourceaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdateresourceaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/adminupdateresourceaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -85,7 +85,7 @@
 				$this->notifyEvent( EVENT_POST_RESOURCE_UPDATE, Array( "resource" => &$resource ));				
 				
 				// clear the cache
-				CacheControl::resetBlogCache( $this->_blogInfo->getId());				
+				CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
             }
 
             $this->setCommonData();

Modified: plog/trunk/class/action/admin/adminupdateresourcealbumaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdateresourcealbumaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/admin/adminupdateresourcealbumaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -88,7 +88,7 @@
             $this->setCommonData();
 			
 			// clear the cache
-			CacheControl::resetBlogCache( $this->_blogInfo->getId());			
+			CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
 
             // better to return true if everything fine
             return true;

Modified: plog/trunk/class/action/blogaction.class.php
===================================================================
--- plog/trunk/class/action/blogaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/blogaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -121,11 +121,19 @@
 
         /**
          * Sets some common information (dirty dirty...)
+		 * @param copyFormValues Whether the values from fields that were registered via
+		 * Action::registerFieldValidator() and Action::registerField() should be passed back to the view
+		 * as variables or not. It defaults to 'false' but this parameter is useful in those cases
+		 * when we would like to force an error to happen (not a validation error) and still keep the
+		 * form values.
+         * @see Action::setCommonData()
          */
-        function setCommonData()
+        function setCommonData( $copyFormValues = false )
         {
             $this->_view->setValue( "Year", $this->_session->getValue( 'Year'));
             $this->_view->setValue( "Month", $this->_session->getValue( 'Month' ));
+            
+            parent::setCommonData( $copyFormValues );
         }
 
         /**

Modified: plog/trunk/class/action/commentaction.class.php
===================================================================
--- plog/trunk/class/action/commentaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/commentaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,98 +1,99 @@
-<?php
-
-	include_once( PLOG_CLASS_PATH."class/action/blogaction.class.php" );
-    include_once( PLOG_CLASS_PATH."class/view/blogview.class.php" );
-	include_once( PLOG_CLASS_PATH."class/view/errorview.class.php" );
-    include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
-    include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
-    include_once( PLOG_CLASS_PATH."class/dao/articlecategories.class.php" );
-    include_once( PLOG_CLASS_PATH."class/dao/users.class.php" );
-    include_once( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
-
-    /**
-     * \ingroup Action
-     * @private
-     *
-     * Adds a comment
-     */
-	class CommentAction extends BlogAction 
-	{
-
-    	var $_articleId;
-        var $_parentId;
-
-		function ViewArticleAction( $actionInfo, $request )
-        {
-			$this->BlogAction( $actionInfo, $request );
-			
-			// data validation
-			$this->registerFieldValidator( "articleId", new IntegerValidator());
-            $this->setValidationErrorView( new ErrorView( $this->_blogInfo, "error_incorrect_article_id" ));
-        }
-
-        function perform()
-        {
-			// fetch the data and make some arrangements if needed
-        	$this->_parentId  = $this->_request->getValue( "parentId" );
-            $this->_articleId = $this->_request->getValue( "articleId" );	
-					
-            if( $this->_parentId < 0 || $this->_parentId == "" )
-            	$this->_parentId = 0;
-				
-            // check if comments are enabled
-            $blogSettings = $this->_blogInfo->getSettings();
-            if( !$blogSettings->getValue( "comments_enabled" )) {
-            	$this->_view = new ErrorView( $this->_blogInfo, "error_comments_not_enabled" );
-                $this->setCommonData();
-
-                return false;
-            }									
-
-            // fetch the article
-            $blogs    = new Blogs();
-            $articles = new Articles();
-            $article  = $articles->getBlogArticle( $this->_articleId, $this->_blogInfo->getId());
-			
-            // if there was a problem fetching the article, we give an error and quit
-            if( $article == false ) {
-            	$this->_view = new ErrorView( $this->_blogInfo );
-                $this->_view->setValue( "message", "error_fetching_article" );
-                $this->setCommonData();
-                return false;
-            }			
-
-        	$this->_view = new BlogView( $this->_blogInfo, "commentarticle", SMARTY_VIEW_CACHE_CHECK, 
-											   Array( "articleId" => $this->_articleId, "parentId" => $this->_parentId ));
-			// do nothing if the view was already cached
-			if( $this->_view->isCached()) 
-				return true;
-
-			// fetch the comments so far
-			$comments = new ArticleComments();
-			$postComments = $comments->getPostComments( $article->getId());
-			if( $this->_parentId > 0 ) {
-				// get a pre-set string for the subject field, for those users interested
-				$comment = $comments->getPostComment( $article->getId(), $this->_parentId );
-				// create the string
-				if( $comment ) {
-					$replyString = $this->_locale->tr("reply_string").$comment->getTopic();
-				}
-			}
-			
-
-            // if everything's fine, we set up the article object for the view
-            $this->_view->setValue( "category", $category );
-            $this->_view->setValue( "post", $article );
-            $this->_view->setValue( "user", $user );
-            $this->_view->setValue( "parentId", $parentId );
-			$this->_view->setValue( "comments", $postComments );
-			$this->_view->setValue( "postcomments", $postComments );
-			$this->_view->setValue( "topic", $replyString );
-	    
-            $this->setCommonData();
-
-            // and return everything normal
-            return true;
-        }
-    }
-?>
+<?php
+
+	include_once( PLOG_CLASS_PATH."class/action/blogaction.class.php" );
+    include_once( PLOG_CLASS_PATH."class/view/blogview.class.php" );
+	include_once( PLOG_CLASS_PATH."class/view/errorview.class.php" );
+    include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
+    include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
+    include_once( PLOG_CLASS_PATH."class/dao/articlecategories.class.php" );
+    include_once( PLOG_CLASS_PATH."class/dao/users.class.php" );
+    include_once( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
+
+    /**
+     * \ingroup Action
+     * @private
+     *
+     * Adds a comment
+     */
+	class CommentAction extends BlogAction 
+	{
+
+    	var $_articleId;
+        var $_parentId;
+
+		function ViewArticleAction( $actionInfo, $request )
+        {
+			$this->BlogAction( $actionInfo, $request );
+			
+			// data validation
+			$this->registerFieldValidator( "articleId", new IntegerValidator());
+            $this->setValidationErrorView( new ErrorView( $this->_blogInfo, "error_incorrect_article_id" ));
+        }
+
+        function perform()
+        {
+			// fetch the data and make some arrangements if needed
+        	$this->_parentId  = $this->_request->getValue( "parentId" );
+            $this->_articleId = $this->_request->getValue( "articleId" );	
+					
+            if( $this->_parentId < 0 || $this->_parentId == "" )
+            	$this->_parentId = 0;
+				
+            // check if comments are enabled
+            $blogSettings = $this->_blogInfo->getSettings();
+            if( !$blogSettings->getValue( "comments_enabled" )) {
+            	$this->_view = new ErrorView( $this->_blogInfo, "error_comments_not_enabled" );
+                $this->setCommonData();
+
+                return false;
+            }									
+
+            // fetch the article
+            $blogs    = new Blogs();
+            $articles = new Articles();
+            $article  = $articles->getBlogArticle( $this->_articleId, $this->_blogInfo->getId());
+			
+            // if there was a problem fetching the article, we give an error and quit
+            if( $article == false ) {
+            	$this->_view = new ErrorView( $this->_blogInfo );
+                $this->_view->setValue( "message", "error_fetching_article" );
+                $this->setCommonData();
+                return false;
+            }			
+
+        	$this->_view = new BlogView( $this->_blogInfo, "commentarticle", SMARTY_VIEW_CACHE_CHECK, 
+											   Array( "articleId" => $this->_articleId, "parentId" => $this->_parentId ));
+			// do nothing if the view was already cached
+			if( $this->_view->isCached()) 
+				return true;
+
+			// fetch the comments so far
+			$comments = new ArticleComments();
+			$postComments = $comments->getPostComments( $article->getId());
+			if( $this->_parentId > 0 ) {
+				// get a pre-set string for the subject field, for those users interested
+				$comment = $comments->getPostComment( $article->getId(), $this->_parentId );
+				// create the string
+				if( $comment ) {
+					$replyString = $this->_locale->tr("reply_string").$comment->getTopic();
+					$this->_view->setValue( "comment", $comment );
+				}
+			}
+
+            // if everything's fine, we set up the article object for the view
+            $this->_view->setValue( "category", $category );
+            $this->_view->setValue( "post", $article );
+            $this->_view->setValue( "user", $user );
+            $this->_view->setValue( "parentId", $this->_parentId );
+			$this->_view->setValue( "comments", $postComments );
+			$this->_view->setValue( "postcomments", $postComments );
+			$this->_view->setValue( "topic", $replyString );
+			$this->_view->setValue( "topic", $replyString );			
+	    
+            $this->setCommonData();
+
+            // and return everything normal
+            return true;
+        }
+    }
+?>

Modified: plog/trunk/class/action/defaultaction.class.php
===================================================================
--- plog/trunk/class/action/defaultaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/defaultaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -108,11 +108,25 @@
             if( isset($category) )
                 $this->_view->setValue( "category", $category );			
 			
+
+            $users = new Users();
+
+            // if we got a user user id, then we should first look up this id
+            // user in the database and see if it exists
+            if( $this->_userId > 0) {
+                $user = $users->getUserInfoFromId( $this->_userName );
+                if( !$user ) {
+                    $this->_view = new ErrorView( $this->_blogInfo );
+                    $this->_view->setValue( 'message', 'error_incorrect_user_id' );
+                    $this->setCommonData();
+                    return false;
+                }
+            } 
+
             // if we got a user name instead of a user id, then we
             // should first look up this user in the database and see if
             // it exists
             if( $this->_userName ) {
-				$users = new Users();
                 $user = $users->getUserInfoFromUsername( $this->_userName );
                 if( !$user ) {
                     $this->_view = new ErrorView( $this->_blogInfo );
@@ -125,9 +139,8 @@
                 $this->_userId = $user->getId();
             }
 
-            // export the user
-            if( isset($user) )
-                $this->_view->setValue( "user", $user );
+            // export the owner. The owner information should get from blogInfo directly
+            $this->_view->setValue( "owner", $this->_blogInfo->getOwnerInfo() );
 			
             $t = new Timestamp();
             $todayTimestamp = $t->getTimestamp();

Modified: plog/trunk/class/action/resourceserveraction.class.php
===================================================================
--- plog/trunk/class/action/resourceserveraction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/resourceserveraction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -41,42 +41,36 @@
          */
         function _getBlogInfo()
         {			
-        	$blogId = $this->_config->getValue('default_blog_id');
-			
 			// see if we're using subdomains
 			$config =& Config::getConfig();
 			if( $config->getValue( "subdomains_enabled" )) {
-				$url = new Url( $config->getValue( "subdomains_base_url"));			
-				$lp =  new LinkParser( $url->getHost());
-				$server = HttpVars::getServer();
-				$httpHost = $server["HTTP_HOST"];
-				$result = $lp->parseLink( $httpHost );
-				
-				if( $result["username"] != "" && $this->_request->getValue( 'user' ) == "" )
-					$this->_request->setValue( 'user', $result["username"] );
-				if( $result["blogname"] != "" && $this->_request->getValue( 'blogId' ) == "" ) 
-					$this->_request->setValue( 'blogId', $result["blogname"] );
+				$subdomainInfo = Subdomains::getSubdomainInfoFromRequest();
+
+				if( $subdomainInfo["username"] != "" && $this->_request->getValue( 'blogUserName' ) == "" )
+					$this->_request->setValue( 'blogUserName', $subdomainInfo["username"] );
+				if( $subdomainInfo["blogname"] != "" && $this->_request->getValue( 'blogName' ) == "" ) 
+					$this->_request->setValue( 'blogName', $subdomainInfo["blogname"] );				
 			}
 
-		$blogId = $this->_request->getValue( 'blogId' );
-		$blogName = $this->_request->getValue( 'blogName' );
-		$userId = $this->_request->getValue( 'userId' );
-		$userName = $this->_request->getValue( 'userName' );
+    		$blogId = $this->_request->getValue( 'blogId' );
+    		$blogName = $this->_request->getValue( 'blogName' );
+    		$userId = $this->_request->getValue( 'userId' );
+    		$userName = $this->_request->getValue( 'blogUserName' );
 			
             // if there is a "blogId" parameter, it takes precedence over the
             // "user" parameter.
-	    if( !$blogId && !$blogName ) {
+            if( !$blogId && !$blogName ) {
             	// check if there was a user parameter
-                if( $userParam ) {
+                 if( !empty($userName) ) {
                 	// if so, check to which blogs the user belongs
                 	$users = new Users();
-                	$userInfo = $users->getUserInfoFromUsername( $userName );
+                 	$userInfo = $users->getUserInfoFromUsername( $userName );
                     // if the user exists and is valid...
                 	if( $userInfo ) {
-                    	$userBlogs = $users->getUsersBlogs( $userInfo->getId());
+                    	$userBlogs = $users->getUsersBlogs( $userInfo->getId(), BLOG_STATUS_ACTIVE );
                         // check if he or she belogs to any blog. If he or she does, simply
                         // get the first one (any better rule for this?)
-                    	if( !empty($userBlogs)) {
+                    	if( !empty($userBlogs)) {						
 	                		$blogId = $userBlogs[0]->getId();
                         }
                     }
@@ -86,6 +80,10 @@
                     if( $this->_session->getValue('blogId') != '' ) {
                     	$blogId = $this->_session->getValue('blogId');
                     }
+                    else {
+                        // get the default blog id from the database
+                        $blogId = $this->_config->getValue('default_blog_id');                        
+                    }
                 }
             }
 			

Modified: plog/trunk/class/action/rssaction.class.php
===================================================================
--- plog/trunk/class/action/rssaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/rssaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -64,7 +64,8 @@
             // create an instance of a locale object
             $locale = Locales::getLocale( $localeCode );
 
-            // fetch the posts
+            // fetch the posts, though we are going to fetch the same amount in both branches
+			$amount = $blogSettings->getValue( "recent_posts_max", 15 );            
 			$t = new Timestamp();
 			if( $blogSettings->getValue( 'show_future_posts_in_calendar' )) {
 				$blogArticles = $articles->getBlogArticles( $this->_blogInfo->getId(), -1, $amount, 
@@ -72,7 +73,6 @@
 			}
 			else {
 				$today = $t->getTimestamp();
-				$amount = $blogSettings->getValue( "recent_posts_max", 15 );			
 				$blogArticles = $articles->getBlogArticles( $this->_blogInfo->getId(), -1, $amount, 
 															$categoryId, POST_STATUS_PUBLISHED, 0, $today );			
 			}

Modified: plog/trunk/class/action/viewarticleaction.class.php
===================================================================
--- plog/trunk/class/action/viewarticleaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/action/viewarticleaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -60,13 +60,30 @@
 		
 		/**
 		 * @private
-		 * updates the article referrers
+		 * updates the article referrers given an article
 		 */
-		function _updateArticleReferrers( $article )
-		{
+		function _updateArticleReferrers($article){
+			$this->_updateArticleReferrersById($article->getId());
+		}
+		/**
+		 * @private
+		 * updates the article referrers given an id
+		 */
+		function _updateArticleReferrersById($articleId){
 			$referrers = new Referers();
-			$referrers->addReferer( $_SERVER['HTTP_REFERER'], $article->getId(), $this->_blogInfo->getId());
+			$referrers->addReferer( $_SERVER['HTTP_REFERER'], 
+									$articleId, $this->_blogInfo->getId());
 		}
+		/**
+		 * @private
+		 * updates the article referrers, given a slug
+		 */
+		function _updateArticleReferrersByTitle($slug){
+			$id = $this->articles->getArticleIdFromName($slug);
+			// if the article isn't found, we will save a referrer to
+		    // the main page, since $id will be 0.
+			$this->_updateArticleReferrersById($id);
+		}
 		
 		/**
 		 * @private
@@ -96,10 +113,14 @@
 														  
 			if( $this->_view->isCached()) {
 				if( $this->_config->getValue( 'update_cached_article_reads', false )) {
-					if( $this->_articleId ) 
-						$this->articles->updateArticleNumReads( $this->_articleId );
-					else
+					if( $this->_articleId ){
+						$this->articles->updateArticleNumReads(	$this->_articleId );
+                        $this->_updateArticleReferrersById( $this->_articleId );
+                    }
+ 					else{
 						$this->articles->updateArticleNumReadsByName( $this->_articleName );
+                        $this->_updateArticleReferrersByTitle($this->_articleName );
+                    }
 				}
 				
 				return true;

Modified: plog/trunk/class/config/configfilestorage.class.php
===================================================================
--- plog/trunk/class/config/configfilestorage.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/config/configfilestorage.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -244,7 +244,7 @@
         {
         	$value = $this->_props->getValue( $key );
             if( $value == "" || $value == null )
-            	if( !isset( $defaultValue ) || is_null( $defaulValue ) )
+            	if( !isset( $defaultValue ) || is_null( $defaultValue ) )
                 	$value = $defaultValue;
 
             return $value;

Modified: plog/trunk/class/config/properties.class.php
===================================================================
--- plog/trunk/class/config/properties.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/config/properties.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -98,5 +98,16 @@
 		{
 			return array_values( $this->_props );
 		}
+		
+		/**
+		 * returns whether a given key exists in the table
+		 *
+		 * @param key The key name
+		 * @return True if the key exists, false otherwise
+		 */
+        function keyExists( $key )
+        {
+            return( array_key_exists( $key, $this->_props ));
+        }
 	}
 ?>

Modified: plog/trunk/class/controller/admincontrollermap.properties.php
===================================================================
--- plog/trunk/class/controller/admincontrollermap.properties.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/controller/admincontrollermap.properties.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -196,6 +196,7 @@
     $actions["deleteResource"] = "AdminDeleteResourceAction";
     // shows a window with all the resources
     $actions["resourceList"] = "AdminResourceListAction";
+    $actions["resourcesGroup"] = "AdminResourcesGroupAction";
     // edits a resource album
     $actions["editResourceAlbum"] = "AdminEditResourceAlbumAction";
     // updates a resource album

Modified: plog/trunk/class/dao/article.class.php
===================================================================
--- plog/trunk/class/dao/article.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/dao/article.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -54,7 +54,7 @@
          *
          * @param topic Topic of the article
          * @param text Text of the article
-         * @param category Identifier of the category under which the article will be included
+         * @param categories An array with the ids of all the categories to which this article belongs
          * @param user Identifier of the user who posted the article
          * @param blog Identifier of the blog to which the article belongs
          * @param status Can be either POST_STATUS_PUBLISHED, POST_STATUS_DRAFT or POST_STATUS_DELETED
@@ -713,7 +713,7 @@
 			if( $this->_fields == null ) {
 				// get the custom fields
 				$customFields = new CustomFieldsValues();
-				$fields = $customFields->getArticleCustomFieldsValues( $this->getId(), true );
+				$fields = $customFields->getArticleCustomFieldsValues( $this->getId(), $this->getBlog());
 				$this->setFields( $fields );			
 			}
 			
@@ -860,6 +860,44 @@
 			}
 			
 			return( $this->_nextArticle );
-		}		
+		}
+		
+		/**
+		 * returns all the resources which are linked in this post. It basically looks
+		 * at the "id" attribute of all links. When the resource has been added via the
+		 * "add resource" pop-up window from the "new post" and "edit post" pages
+		 * from the admin interface contains something like "res_XX" where "XX" is the
+		 * internal id of the resource.
+		 *
+		 * If this id attribute is not found this method will not work. We could not find
+		 * a better way to identify these resources...
+		 * 
+		 * @return An array of GalleryResource objects containing all the resources
+		 */
+		function getArticleResources()
+		{
+			include_once( PLOG_CLASS_PATH."class/data/stringutils.class.php" );
+			include_once( PLOG_CLASS_PATH."class/gallery/dao/galleryresources.class.php" );
+			
+			// extract all the "res_XX" values
+            $regexp ="/<a.*id=\"res_([0-9]+)\".*>.*<\/a>/im";
+			$resources = Array();
+			$galleryResources = new GalleryResources();
+    		if( preg_match_all( $regexp, $this->getText(), $out, PREG_SET_ORDER )) {
+				// process the results
+				foreach( $out as $match ) {
+					$resourceId = $match[1];
+					// try to load the resource
+					$resource = $galleryResources->getResource( $resourceId, $this->getBlog());					
+					if( $resource ) {
+						// add it to the array
+						$resources[] = $resource;
+						// and continue...	
+					}
+				}
+			}			
+
+			return( $resources );
+		}
 	}
 ?>

Modified: plog/trunk/class/dao/articlecategories.class.php
===================================================================
--- plog/trunk/class/dao/articlecategories.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/dao/articlecategories.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -162,7 +162,7 @@
 			$prefix = $this->getPrefix();		
 			$query = "SELECT c.id AS id, c.name AS name, c.url AS url, c.blog_id AS blog_id, 
 				          c.last_modification AS last_modification, c.in_main_page AS in_main_page, 
-						  c.parent_id AS parent_id, c.properties AS properties, 
+						  c.parent_id AS parent_id, c.description AS description, c.properties AS properties, 
 						  c.mangled_name AS mangled_name, IF(a.id IS NULL, 0, COUNT(*)) AS num_articles, a.date AS last_update 
 						  FROM {$prefix}articles_categories c LEFT JOIN {$prefix}article_categories_link l
 						  ON c.id=l.category_id LEFT JOIN {$prefix}articles a ON a.id = l.article_id";
@@ -447,7 +447,7 @@
 			$prefix = $this->getPrefix();
 			$query = "SELECT c.id AS id, c.name AS name, c.url AS url, c.blog_id AS blog_id, 
 				          c.last_modification AS last_modification, c.in_main_page AS in_main_page, 
-						  c.parent_id AS parent_id, c.properties AS properties, 
+						  c.parent_id AS parent_id, c.properties AS properties, c.description AS description,
 						  c.mangled_name AS mangled_name, IF(a.id IS NULL, 0, COUNT(*)) AS num_articles, a.date AS last_update 
 						  FROM {$prefix}articles_categories c LEFT JOIN {$prefix}article_categories_link l
 						  ON c.id=l.category_id LEFT JOIN {$prefix}articles a ON a.id = l.article_id 
@@ -489,7 +489,7 @@
 			$prefix = $this->getPrefix();
 			$query = "SELECT a.id as article_id, c.id AS id, c.name AS name, c.url AS url, c.blog_id AS blog_id, 
 				          c.last_modification AS last_modification, c.in_main_page AS in_main_page, 
-						  c.parent_id AS parent_id, c.properties AS properties, 
+						  c.parent_id AS parent_id, c.properties AS properties, c.description AS description,
 						  c.mangled_name AS mangled_name, IF(a.id IS NULL, 0, COUNT(*)) AS num_articles, a.date AS last_update 
 						  FROM {$prefix}articles_categories c LEFT JOIN {$prefix}article_categories_link l
 						  ON c.id=l.category_id LEFT JOIN {$prefix}articles a ON a.id = l.article_id 

Modified: plog/trunk/class/dao/articlecomments.class.php
===================================================================
--- plog/trunk/class/dao/articlecomments.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/dao/articlecomments.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,227 +1,227 @@
-<?php
-
-	include_once( PLOG_CLASS_PATH."class/dao/commentscommon.class.php" );
-	include_once( PLOG_CLASS_PATH."class/dao/usercomment.class.php" );
-
-    /**
-	 * \ingroup DAO
-	 *
-     * Model for the comments each article can have
-     */
-	class ArticleComments extends CommentsCommon 
-	{
-
-    	function ArticleComments()
-        {
-        	$this->CommentsCommon();
-        }
-
-		/**
-		 * Retrieves all the comments for a post
-		 *
-		 * @param artid The article identifier
-		 * @param order The order in which comments should be retrieved
-		 * @param status The status that the comment should have, use COMMENT_STATUS_ALL for
-		 * all possible statuses
-		 * @param page
-		 * @param itemsPerPage
-		 * @return False if error or an array of ArticleComments objects
-		 */
-		function getPostComments( $artid, $order = COMMENT_ORDER_NEWEST_FIRST, $status = COMMENT_STATUS_ALL, $page = -1, $itemsPerPage = DEFAULT_ITEMS_PER_PAGE )
-		{
-			return( CommentsCommon::getPostComments( $artid, $order, $status, COMMENT_TYPE_COMMENT, $page, $itemsPerPage ));
-		}
-		
-		/**
-		 * Retrieves all the comments for subquery of posts
-		 *
-		 * @private
-		 */
-		function getPostCommentsByIds( $ids, $order = COMMENT_ORDER_NEWEST_FIRST, $status = COMMENT_STATUS_ALL )
-		{
-			return( CommentsCommon::getPostCommentsByIds( $ids, $order, $status, COMMENT_TYPE_COMMENT ));
-		}
-		
-        /**
-         * Returns the total number of comments for a post
-		 *
-		 * @param artId the post id
-		 * @param status
-		 * @return The number of comments
-         */
-        function getNumPostComments( $artId, $status = COMMENT_STATUS_ALL )
-        {
-			return( CommentsCommon::getNumPostComments( $artId, $status, COMMENT_TYPE_COMMENT ));
-        }
-
-        /**
-         * Retrieves only one post from a given article
-         */
-        function getPostComment( $artid, $commentid )
-		{
-			return( CommentsCommon::getPostComment( $artid, $commentid, COMMENT_TYPE_COMMENT ));
-		}
-
-        /**
-         * Returns true if there already is a comment in the database with the same
-         * article_id field, topic, text, replying to the same comment, username and so on
-         * Useful in case we want to check if the user sent the same comment by mistake
-         * by pressing the 'reload' button twice or something...
-         *
-         * @return Returns true if there already is such comment or false otherwise.
-         */
-        function getIdenticalComment( $topic, $text, $articleId, $parentId = 0, $userName = "", $userEmail = "", $userUrl = "", $clientIp = "0.0.0.0" )
-        {
-			return( CommentsCommon::getIdenticalComment( $topic, $text, $articleId,
-			                                             $parentId, $userName, $userEmail,
-														 $userUrl, $clientIp, COMMENT_TYPE_COMMENT ));
-        }
-
-        /**
-         * code factored out and made to be reused through several functions here...
-         */
-        function _fillCommentInformation( $row )
-        {
-        	// ---
-            // this stuff is another disgusting hack to make comments
-            // be aware of time differences that may have been set by
-            // users in their blogs... actually, it will make the whole
-            // thing run a little bit slower because for every article
-            // that we fetch, we need to know the time difference
-            // and that means, additional accesses to the database :(
-            // But hey, users demand these things and we are not in the position
-            // to deny anything, are we? :P
-            // ---
-            // at the same time, we're going to brake some of our "nicely"
-            // implemented bussiness logic with the query below, bypassing all
-            // our objects and directly fetching info from the database, just for
-            // the sake of being able to do things with a single query rather
-            // than needing at least two to do the same. We would have to first
-            // find to which blog the given article belongs and then use another
-            // query to find its settings... If we do it this way, we can still
-            // do it in one query and get a nice BlogSettings object with the
-            // information that we need. Dirty but works :S
-            // ---
-            $prefix = $this->getPrefix();
-            $date = $row["date"];
-            $articleId = $row["article_id"];
-
-            // let's try and keep some kind of cache for this...
-            if( empty($this->_blogSettings[$articlId])) {
-            	$query = "SELECT DISTINCT b.settings AS settings
-                          FROM {$prefix}blogs b, {$prefix}articles a,
-                          {$prefix}articles_comments c
-                          WHERE c.article_id = a.id AND
-                          a.blog_id = b.id
-                          AND a.id = $articleId";
-                $result = $this->Execute( $query );
-				if( !$result ) 
-					return false;
-				
-                $tmpRow = $result->FetchRow();
-                $blogSettings = Blogs::getBlogSettingsFromField( $tmpRow["settings"] );
-                $this->_blogSettings[$articleId] = $blogSettings;
-            }
-            else {
-            	$blogSettings = $this->_blogSettings[$articleId];
-            }
-
-            $timeDiff = $blogSettings->getValue( "time_offset" );
-            // now that we've got the time difference, we can
-            // calculate what would the "real" date...
-            $date = Timestamp::getDateWithOffset( $date, $timeDiff );
-
-        	$comment = new UserComment( $row["article_id"],
-            							$row["parent_id"],
-                                        $row["topic"],
-                                        $row["text"],
-                                        $date,
-                                        $row["user_name"],
-                                        $row["user_email"],
-                                        $row["user_url"],
-                                        $row["client_ip"],
-                                        $row["spam_rate"],
-                                        $row["status"],
-                                        $row["id"] );
-
-            return $comment;
-        }
-
-		/**
-		 * Removes a comment from a post. It also updates all the other posts that
-         * have this one as the parent and makes them look as if they were 'top level'
-         * comments with no parent.
-         *
-         * @param artid The article identifier.
-         * @param commentid The comment identifier.
-		 */
-		function deletePostComment( $artid, $commentid )
-		{
-			return( CommentsCommon::deletePostComment( $artid, $commentid, COMMENT_TYPE_COMMENT ));
-		}
-		
-		/**
-		 * Removes a comment from a post. It also updates all the other posts that
-         * have this one as the parent and makes them look as if they were 'top level'
-         * comments with no parent.
-         *
-         * @param commentid The comment identifier.
-         * @param articleId The article identifier.		 
-		 */
-		function deleteComment( $commentid, $articleId = -1 )
-		{
-			return( $this->deletePostComment( $articleId, $commentid ));
-		}		
-
-        /**
-         * Removes all the comments from a post.
-         *
-         * @param artId The article identifier
-         */
-        function deletePostComments( $artId )
-        {
-			return( CommentsCommon::deletePostComments( $artId, COMMENT_TYPE_COMMENT ));
-        }
-
-        /**
-         * updates the status of a comment, regarding its spam status...
-         *
-         * @param commentId
-         * @param status
-         * @return true or false, depending...
-         */
-        function updateCommentStatus( $commentId, $status )
-        {
-			return( CommentsCommon::updateCommentStatus( $commentId, $status, COMMENT_TYPE_COMMENT ));
-        }
-
-        /**
-         * removes all comments marked as spam from the database
-         */
-        function purgeSpamComments()
-        {
-			return( CommentsCommon::purgeSpamComments( COMMENT_TYPE_COMMENT ));
-        }
-		
-		
-		/**
-		 * returns a single comment, identified by its... identifier :)
-		 */
-		function getComment( $id )
-		{
-			return( CommentsCommon::getComment( $id, COMMENT_TYPE_COMMENT ));
-		}
-		
-		/**
-		 * returns the lastest $maxItems comments received in the blog
-		 *
-		 * @param blogId
-		 * @param maxItems
-		 * @return An array of ArticleComment objects
-		 */
-		function getBlogComments( $blogId, $maxItems = 0, $articleStatus = POST_STATUS_PUBLISHED )
-		{
-			return( CommentsCommon::getBlogComments( $blogId, $maxItems, $articleStatus, COMMENT_TYPE_COMMENT ));
-		}
-	}
-?>
+<?php
+
+	include_once( PLOG_CLASS_PATH."class/dao/commentscommon.class.php" );
+	include_once( PLOG_CLASS_PATH."class/dao/usercomment.class.php" );
+
+    /**
+	 * \ingroup DAO
+	 *
+     * Model for the comments each article can have
+     */
+	class ArticleComments extends CommentsCommon 
+	{
+
+    	function ArticleComments()
+        {
+        	$this->CommentsCommon();
+        }
+
+		/**
+		 * Retrieves all the comments for a post
+		 *
+		 * @param artid The article identifier
+		 * @param order The order in which comments should be retrieved
+		 * @param status The status that the comment should have, use COMMENT_STATUS_ALL for
+		 * all possible statuses
+		 * @param page
+		 * @param itemsPerPage
+		 * @return False if error or an array of ArticleComments objects
+		 */
+		function getPostComments( $artid, $order = COMMENT_ORDER_NEWEST_FIRST, $status = COMMENT_STATUS_ALL, $page = -1, $itemsPerPage = DEFAULT_ITEMS_PER_PAGE )
+		{
+			return( CommentsCommon::getPostComments( $artid, $order, $status, COMMENT_TYPE_COMMENT, $page, $itemsPerPage ));
+		}
+		
+		/**
+		 * Retrieves all the comments for subquery of posts
+		 *
+		 * @private
+		 */
+		function getPostCommentsByIds( $ids, $order = COMMENT_ORDER_NEWEST_FIRST, $status = COMMENT_STATUS_ALL )
+		{
+			return( CommentsCommon::getPostCommentsByIds( $ids, $order, $status, COMMENT_TYPE_COMMENT ));
+		}
+		
+        /**
+         * Returns the total number of comments for a post
+		 *
+		 * @param artId the post id
+		 * @param status
+		 * @return The number of comments
+         */
+        function getNumPostComments( $artId, $status = COMMENT_STATUS_ALL )
+        {
+			return( CommentsCommon::getNumPostComments( $artId, $status, COMMENT_TYPE_COMMENT ));
+        }
+
+        /**
+         * Retrieves only one post from a given article
+         */
+        function getPostComment( $artid, $commentid )
+		{
+			return( CommentsCommon::getPostComment( $artid, $commentid, COMMENT_TYPE_COMMENT ));			
+		}
+
+        /**
+         * Returns true if there already is a comment in the database with the same
+         * article_id field, topic, text, replying to the same comment, username and so on
+         * Useful in case we want to check if the user sent the same comment by mistake
+         * by pressing the 'reload' button twice or something...
+         *
+         * @return Returns true if there already is such comment or false otherwise.
+         */
+        function getIdenticalComment( $topic, $text, $articleId, $parentId = 0, $userName = "", $userEmail = "", $userUrl = "", $clientIp = "0.0.0.0" )
+        {
+			return( CommentsCommon::getIdenticalComment( $topic, $text, $articleId,
+			                                             $parentId, $userName, $userEmail,
+														 $userUrl, $clientIp, COMMENT_TYPE_COMMENT ));
+        }
+
+        /**
+         * code factored out and made to be reused through several functions here...
+         */
+        function _fillCommentInformation( $row )
+        {
+        	// ---
+            // this stuff is another disgusting hack to make comments
+            // be aware of time differences that may have been set by
+            // users in their blogs... actually, it will make the whole
+            // thing run a little bit slower because for every article
+            // that we fetch, we need to know the time difference
+            // and that means, additional accesses to the database :(
+            // But hey, users demand these things and we are not in the position
+            // to deny anything, are we? :P
+            // ---
+            // at the same time, we're going to brake some of our "nicely"
+            // implemented bussiness logic with the query below, bypassing all
+            // our objects and directly fetching info from the database, just for
+            // the sake of being able to do things with a single query rather
+            // than needing at least two to do the same. We would have to first
+            // find to which blog the given article belongs and then use another
+            // query to find its settings... If we do it this way, we can still
+            // do it in one query and get a nice BlogSettings object with the
+            // information that we need. Dirty but works :S
+            // ---
+            $prefix = $this->getPrefix();
+            $date = $row["date"];
+            $articleId = $row["article_id"];
+
+            // let's try and keep some kind of cache for this...
+            if( empty($this->_blogSettings[$articlId])) {
+            	$query = "SELECT DISTINCT b.settings AS settings
+                          FROM {$prefix}blogs b, {$prefix}articles a,
+                          {$prefix}articles_comments c
+                          WHERE c.article_id = a.id AND
+                          a.blog_id = b.id
+                          AND a.id = $articleId";
+                $result = $this->Execute( $query );
+				if( !$result ) 
+					return false;
+				
+                $tmpRow = $result->FetchRow();
+                $blogSettings = Blogs::getBlogSettingsFromField( $tmpRow["settings"] );
+                $this->_blogSettings[$articleId] = $blogSettings;
+            }
+            else {
+            	$blogSettings = $this->_blogSettings[$articleId];
+            }
+
+            $timeDiff = $blogSettings->getValue( "time_offset" );
+            // now that we've got the time difference, we can
+            // calculate what would the "real" date...
+            $date = Timestamp::getDateWithOffset( $date, $timeDiff );
+
+        	$comment = new UserComment( $row["article_id"],
+            							$row["parent_id"],
+                                        $row["topic"],
+                                        $row["text"],
+                                        $date,
+                                        $row["user_name"],
+                                        $row["user_email"],
+                                        $row["user_url"],
+                                        $row["client_ip"],
+                                        $row["spam_rate"],
+                                        $row["status"],
+                                        $row["id"] );
+
+            return $comment;
+        }
+
+		/**
+		 * Removes a comment from a post. It also updates all the other posts that
+         * have this one as the parent and makes them look as if they were 'top level'
+         * comments with no parent.
+         *
+         * @param artid The article identifier.
+         * @param commentid The comment identifier.
+		 */
+		function deletePostComment( $artid, $commentid )
+		{
+			return( CommentsCommon::deletePostComment( $artid, $commentid, COMMENT_TYPE_COMMENT ));
+		}
+		
+		/**
+		 * Removes a comment from a post. It also updates all the other posts that
+         * have this one as the parent and makes them look as if they were 'top level'
+         * comments with no parent.
+         *
+         * @param commentid The comment identifier.
+         * @param articleId The article identifier.		 
+		 */
+		function deleteComment( $commentid, $articleId = -1 )
+		{
+			return( $this->deletePostComment( $articleId, $commentid ));
+		}		
+
+        /**
+         * Removes all the comments from a post.
+         *
+         * @param artId The article identifier
+         */
+        function deletePostComments( $artId )
+        {
+			return( CommentsCommon::deletePostComments( $artId, COMMENT_TYPE_COMMENT ));
+        }
+
+        /**
+         * updates the status of a comment, regarding its spam status...
+         *
+         * @param commentId
+         * @param status
+         * @return true or false, depending...
+         */
+        function updateCommentStatus( $commentId, $status )
+        {
+			return( CommentsCommon::updateCommentStatus( $commentId, $status, COMMENT_TYPE_COMMENT ));
+        }
+
+        /**
+         * removes all comments marked as spam from the database
+         */
+        function purgeSpamComments()
+        {
+			return( CommentsCommon::purgeSpamComments( COMMENT_TYPE_COMMENT ));
+        }
+		
+		
+		/**
+		 * returns a single comment, identified by its... identifier :)
+		 */
+		function getComment( $id )
+		{
+			return( CommentsCommon::getComment( $id, COMMENT_TYPE_COMMENT ));
+		}
+		
+		/**
+		 * returns the lastest $maxItems comments received in the blog
+		 *
+		 * @param blogId
+		 * @param maxItems
+		 * @return An array of ArticleComment objects
+		 */
+		function getBlogComments( $blogId, $maxItems = 0, $articleStatus = POST_STATUS_PUBLISHED )
+		{
+			return( CommentsCommon::getBlogComments( $blogId, $maxItems, $articleStatus, COMMENT_TYPE_COMMENT ));
+		}
+	}
+?>

Modified: plog/trunk/class/dao/articlenotifications.class.php
===================================================================
--- plog/trunk/class/dao/articlenotifications.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/dao/articlenotifications.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -75,9 +75,11 @@
           * mainly will need the email address!)
           * @param subject Subject of the message that will be sent to the user.
           * @param body Message that will be sent to the user.
+          * @param charset the encoding that will be used in the message (it should be based
+          * on the locale of the blog who is sending this message) It defaults to iso-8859-1
           * @return Returns true if the user was correctly notified or false otherwise.
           */
-         function notifyUser( $notification, $userInfo, $subject, $body )
+         function notifyUser( $notification, $userInfo, $subject, $body, $charset = 'iso-8859-1' )
          {
          	//print( "sending notification to ".$userInfo->getEmail()."<br/>");
             $message = new EmailMessage();
@@ -85,6 +87,7 @@
             $message->addTo( $userInfo->getEmail());
             $message->setSubject( "pLog Notification system" );
             $message->setBody( $body );
+            $message->setCharset( $charset );
 
             $service = new EmailService();
             return $service->sendMessage( $message );
@@ -111,12 +114,16 @@
 
             $articles = new Articles();
             $article  = $articles->getBlogArticle( $postId, $blogId );
+            
+            // get the correct character set
+            $blogLocale =& $blogInfo->getLocale();
+            $charset = $blogLocale->getCharset();
 
             $users = new Users();
             foreach( $artNotifs as $notif ) {
             	$userInfo = $users->getUserInfoFromId( $notif->getUserId());
                 $message = $this->renderMessageTemplate( $article, $blogInfo );
-            	$this->notifyUser( $notif, $userInfo, "pLog Notification", $message );
+            	$this->notifyUser( $notif, $userInfo, "pLog Notification", $message, $charset );
             }
          }
 

Modified: plog/trunk/class/dao/articles.class.php
===================================================================
--- plog/trunk/class/dao/articles.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/dao/articles.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -395,7 +395,6 @@
             $ids = substr($ids, 0, -1);          
 			$articleCategories = $this->categories->getArticleCategoriesByIds( $ids, $blogid );
 			$articleTexts = $this->getArticlesText( $ids );
-            //$fields = $this->customfields->getArticleCustomFieldsValuesByIds( $ids );
             
             foreach( $articles as $article ) {
             	$lastArticleId=$article->getId();
@@ -424,6 +423,26 @@
             
             return $fullarticles;
         }
+
+		/**
+		 * Takes an article name and returns the id
+		 * @param articleName an article "name" (the post 'slug')
+		 * @return articleId or 0 if unsuccessful
+		 */
+        function getArticleIdFromName($articleName){
+            $query = "SELECT id FROM ".$this->getPrefix()."articles ".
+                     " WHERE slug = '".Db::qstr($articleName)."'";
+
+            $result = $this->Execute($query);
+
+            if($row = $result->FetchRow()){
+			  if($row["id"])
+				return $row["id"];
+			}
+            return 0;
+        }		
+
+
 		
 		/**
 		 * returns the text of a bunch of articles, given their ids
@@ -435,7 +454,7 @@
 		function getArticlesText( $articleIds )
 		{
 			$prefix = $this->getPrefix();
-			$query = "SELECT * FROM {$prefix}articles_text WHERE
+			$query = "SELECT article_id,text,topic FROM {$prefix}articles_text WHERE
 			          article_id IN (".$articleIds.")";
 					  
             $result = $this->Execute( $query );
@@ -696,7 +715,7 @@
 		function getArticleText( $articleId )
 		{
 			$prefix = $this->getPrefix();
-			$query = "SELECT * FROM {$prefix}articles_text
+			$query = "SELECT text,topic FROM {$prefix}articles_text
 			          WHERE article_id = '".Db::qstr($articleId)."'";
 					  
 			$result = $this->Execute( $query );

Modified: plog/trunk/class/dao/blogs.class.php
===================================================================
--- plog/trunk/class/dao/blogs.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/dao/blogs.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -368,7 +368,6 @@
             $result = $this->Execute( $query );
 
             if( !$result ){
-                $this->log->error("add blog to db failed:".$this->DbError());
                 // FIXME: throw an exception?
                 return false;
             }
@@ -448,8 +447,11 @@
             if( !$result )
                 return Array();
 
-            // return all the rows straight from adodb
-            return( $result->GetRows());
+            $blogIds = Array();
+            while( $row = $result->FetchRow()) {
+                $blogIds[] = $row['id'];
+            }
+            return $blogIds;
         }
 
         /**

Modified: plog/trunk/class/dao/customfields/customfield.class.php
===================================================================
--- plog/trunk/class/dao/customfields/customfield.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/dao/customfields/customfield.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -79,7 +79,10 @@
 		
 		function getSearchable()
 		{
-			return( $this->_searchable == 1 );
+			if( $this->_searchable == 1 )
+				return 1;
+			else
+				return 0;
 		}
 		
 		function isSearchable()

Modified: plog/trunk/class/dao/customfields/customfieldsvalues.class.php
===================================================================
--- plog/trunk/class/dao/customfields/customfieldsvalues.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/dao/customfields/customfieldsvalues.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -42,10 +42,11 @@
 		 * the custom fields available for an article
 		 *
 		 * @param articleId The id of the article
+		 * @param the blog id to which the fields belong	 
 		 * @param includeHidden Whether to return hidden fields or not
 		 * @return An array of CustomFieldValue objects, or false if error
 		 */
-		function getArticleCustomFieldsValues( $articleId, $includeHidden = true )
+		function getArticleCustomFieldsValues( $articleId, $blogId, $includeHidden = true )
 		{					
 			//
 			// it's quite a big query and has a 'right outer join', but the whole point is that
@@ -59,9 +60,10 @@
 							 d.field_description AS field_description 
 							 FROM {$prefix}custom_fields_values v 
 							 RIGHT OUTER JOIN {$prefix}custom_fields_definition d 
-							 ON v.article_id = $articleId AND v.field_id = d.id";
+							 ON v.article_id = $articleId AND v.field_id = d.id
+							 WHERE d.blog_id = '".Db::qstr($blogId)."'";
 			if( !$includeHidden )
-				$query .= " WHERE d.hidden = 0 ";
+				$query .= " AND d.hidden = 0 ";
 			$query .= " ORDER BY date ASC";
 					  
 			$result = $this->Execute( $query );
@@ -80,7 +82,11 @@
 			return $fields;
 		}
 		
-		function getArticleCustomFieldsValuesByIds( $articleIds, $includeHidden = true )
+		/**
+		 * @private
+		 * @see getArticleCustomFieldsValues
+		 */
+		function getArticleCustomFieldsValuesByIds( $articleIds, $blogId, $includeHidden = true )
 		{					
 			//
 			// it's quite a big query and has a 'right outer join', but the whole point is that
@@ -94,9 +100,10 @@
 							 d.field_description AS field_description 
 							 FROM {$prefix}custom_fields_values v 
 							 RIGHT OUTER JOIN {$prefix}custom_fields_definition d 
-							 ON v.article_id IN (".$articleIds.") AND v.field_id = d.id";
+							 ON v.article_id IN (".$articleIds.") AND v.field_id = d.id
+							 WHERE d.blog_id = '".Db::qstr($blogId)."'";
 			if( !$includeHidden )
-				$query .= " WHERE d.hidden = 0 ";
+				$query .= " AND d.hidden = 0 ";
 			$query .= " ORDER BY date ASC";
 					  
 			$result = $this->Execute( $query );

Modified: plog/trunk/class/data/validator/usernamevalidator.class.php
===================================================================
--- plog/trunk/class/data/validator/usernamevalidator.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/data/validator/usernamevalidator.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -5,7 +5,7 @@
 	include_once( PLOG_CLASS_PATH."class/data/validator/rules/regexprule.class.php" );
 	include_once( PLOG_CLASS_PATH."class/data/validator/rules/filteredwordsrule.class.php" );
 	
-	define( "ONLY_ALPHANUMERIC_REGEXP", "^([A-za-z0-9]*)$" );
+	define( "ONLY_ALPHANUMERIC_REGEXP", "^([A-Za-z0-9]*)$" );
 
     /**
      * \ingroup Validator

Modified: plog/trunk/class/database/adodb/datadict/datadict-access.inc.php
===================================================================
--- plog/trunk/class/database/adodb/datadict/datadict-access.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/datadict/datadict-access.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: plog/trunk/class/database/adodb/datadict/datadict-db2.inc.php
===================================================================
--- plog/trunk/class/database/adodb/datadict/datadict-db2.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/datadict/datadict-db2.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: plog/trunk/class/database/adodb/datadict/datadict-firebird.inc.php
===================================================================
--- plog/trunk/class/database/adodb/datadict/datadict-firebird.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/datadict/datadict-firebird.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -21,7 +21,7 @@
 	{
 		switch($meta) {
 		case 'C': return 'VARCHAR';
-		case 'XL':
+		case 'XL': return 'VARCHAR(32000)'; 
 		case 'X': return 'VARCHAR(4000)'; 
 		
 		case 'C2': return 'VARCHAR'; // up to 32K

Modified: plog/trunk/class/database/adodb/datadict/datadict-generic.inc.php
===================================================================
--- plog/trunk/class/database/adodb/datadict/datadict-generic.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/datadict/datadict-generic.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: plog/trunk/class/database/adodb/datadict/datadict-ibase.inc.php
===================================================================
--- plog/trunk/class/database/adodb/datadict/datadict-ibase.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/datadict/datadict-ibase.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: plog/trunk/class/database/adodb/datadict/datadict-informix.inc.php
===================================================================
--- plog/trunk/class/database/adodb/datadict/datadict-informix.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/datadict/datadict-informix.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: plog/trunk/class/database/adodb/datadict/datadict-mssql.inc.php
===================================================================
--- plog/trunk/class/database/adodb/datadict/datadict-mssql.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/datadict/datadict-mssql.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -30,7 +30,7 @@
 		
 		$len = -1; // mysql max_length is not accurate
 		switch (strtoupper($t)) {
-
+		case 'R':
 		case 'INT': 
 		case 'INTEGER': return  'I';
 		case 'BIT':
@@ -47,10 +47,10 @@
 	function ActualType($meta)
 	{
 		switch(strtoupper($meta)) {
+
 		case 'C': return 'VARCHAR';
-		case 'XL':
-		case 'X': return 'TEXT';
-		
+		case 'XL': return 'TEXT';
+		case 'X': return 'VARCHAR(4000)'; ## could be varchar(8000), but we want compat with oracle
 		case 'C2': return 'NVARCHAR';
 		case 'X2': return 'NTEXT';
 		
@@ -60,6 +60,7 @@
 		case 'T': return 'DATETIME';
 		case 'L': return 'BIT';
 		
+		case 'R':		
 		case 'I': return 'INT'; 
 		case 'I1': return 'TINYINT';
 		case 'I2': return 'SMALLINT';
@@ -241,12 +242,9 @@
 		case 'BIGINT':
 			return $ftype;
 		}
-		if (strlen($fsize) && $ty != 'X' && $ty != 'B' && strpos($ftype,'(') === false) {
-			$ftype .= "(".$fsize;
-			if (strlen($fprec)) $ftype .= ",".$fprec;
-			$ftype .= ')';
-		}
-		return $ftype;
+    	if ($ty == 'T') return $ftype;
+    	return parent::_GetSize($ftype, $ty, $fsize, $fprec);    
+
 	}
 }
 ?>
\ No newline at end of file

Modified: plog/trunk/class/database/adodb/datadict/datadict-mysql.inc.php
===================================================================
--- plog/trunk/class/database/adodb/datadict/datadict-mysql.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/datadict/datadict-mysql.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -80,8 +80,8 @@
 	{
 		switch(strtoupper($meta)) {
 		case 'C': return 'VARCHAR';
-		case 'XL':
-		case 'X': return 'LONGTEXT';
+		case 'XL':return 'LONGTEXT';
+		case 'X': return 'TEXT';
 		
 		case 'C2': return 'VARCHAR';
 		case 'X2': return 'LONGTEXT';

Modified: plog/trunk/class/database/adodb/datadict/datadict-oci8.inc.php
===================================================================
--- plog/trunk/class/database/adodb/datadict/datadict-oci8.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/datadict/datadict-oci8.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: plog/trunk/class/database/adodb/datadict/datadict-postgres.inc.php
===================================================================
--- plog/trunk/class/database/adodb/datadict/datadict-postgres.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/datadict/datadict-postgres.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: plog/trunk/class/database/adodb/datadict/datadict-sapdb.inc.php
===================================================================
--- plog/trunk/class/database/adodb/datadict/datadict-sapdb.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/datadict/datadict-sapdb.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.50 6 July 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.50 6 July 2004  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: plog/trunk/class/database/adodb/datadict/datadict-sybase.inc.php
===================================================================
--- plog/trunk/class/database/adodb/datadict/datadict-sybase.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/datadict/datadict-sybase.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: plog/trunk/class/database/adodb/docs/docs-adodb.htm
===================================================================
--- plog/trunk/class/database/adodb/docs/docs-adodb.htm	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/docs/docs-adodb.htm	2005-05-31 10:28:30 UTC (rev 2128)
@@ -12,16 +12,14 @@
   border: 1px solid #ddd;
 }
 </style></head>
-<body bgcolor="#ffffff">
+<body bgcolor="#ffffff" text="black">
 
 <h2>ADOdb Library for PHP</h2>
-<p>V4.54 5 Nov 2004 (c) 2000-2004 John Lim (jlim#natsoft.com)</p>
+<p>V4.62 2 Apr 2005 (c) 2000-2005 John Lim (jlim#natsoft.com)</p>
 <p><font size="1">This software is dual licensed using BSD-Style and LGPL. This 
   means you can use it in compiled proprietary and commercial products.</font></p>
   
-  
-  <table border="1"><tbody><tr><td><font color="red">Kindly note that the ADOdb home page has moved to <a href="http://adodb.sourceforge.net/">http://adodb.sourceforge.net/</a> because of the persistent 
-  unreliability of http://php.weblogs.com. <b>Please change your links</b>!</font></td></tr></tbody></table>
+
 	<p>Useful ADOdb links:  <a href="http://adodb.sourceforge.net/#download">Download</a> &nbsp; <a href="http://adodb.sourceforge.net/#docs">Other Docs</a>
 
 </p><p><a href="#intro"><b>Introduction</b></a><b><br>
@@ -68,9 +66,9 @@
   <font size="2">Connections: <a href="#connect">Connect</a> <a href="#pconnect">PConnect</a> 
   <a href="#nconnect">NConnect</a> <a href="#isconnected">IsConnected</a><br>
   Executing SQL: <a href="#execute">Execute</a> <a href="#cacheexecute"><i>CacheExecute</i></a> 
-  <a href="#SelectLimit">SelectLimit</a> <a href="#cacheSelectLimit"><i>CacheSelectLimit</i></a> 
+  <a href="#selectlimit">SelectLimit</a> <a href="#cacheSelectLimit"><i>CacheSelectLimit</i></a> 
   <a href="#param">Param</a> <a href="#prepare">Prepare</a> <a href="#preparesp">PrepareSP</a> 
-  <a href="#inparameter">InParameter</a> <a href="#outparameter">OutParameter</a>
+  <a href="#inparameter">InParameter</a> <a href="#outparameter">OutParameter</a> <a href="#autoexecute">AutoExecute</a>
   <br>
   &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#getone">GetOne</a> 
   <a href="#cachegetone"><i>CacheGetOne</i></a> <a href="#getrow">GetRow</a> <a href="#cachegetrow"><i>CacheGetRow</i></a> 
@@ -81,9 +79,8 @@
   (oci8 only)<br>
   Generates SQL strings: <a href="#getupdatesql">GetUpdateSQL</a> <a href="#getinsertsql">GetInsertSQL</a> 
   <a href="#concat">Concat</a> <a href="#ifnull">IfNull</a> <a href="#length">length</a> <a href="#random">random</a> <a href="#substr">substr</a> 
-  <a href="#qstr">qstr</a> <a href="#param">Param</a> 
-  <a href="#prepare"></a><a href="#OffsetDate">OffsetDate</a> <a href="#SQLDate">SQLDate</a> 
-  <a href="#dbdate">DBDate</a> <a href="#dbtimestamp"></a> <a href="#dbtimestamp">DBTimeStamp</a>
+  <a href="#qstr">qstr</a> <a href="#param">Param</a>  <a href="#OffsetDate">OffsetDate</a> <a href="#SQLDate">SQLDate</a> 
+  <a href="#dbdate">DBDate</a>  <a href="#dbtimestamp">DBTimeStamp</a>
   <br>
   Blobs: <a href="#updateblob">UpdateBlob</a> <a href="#updateclob">UpdateClob</a> 
   <a href="#updateblobfile">UpdateBlobFile</a> <a href="#blobencode">BlobEncode</a> 
@@ -133,8 +130,9 @@
   <a href="#nextrecordset">NextRecordSet</a><br>
   Field Info:<a href="#fieldcount">FieldCount</a> <a href="#fetchfield">FetchField</a> 
   <a href="#metatype">MetaType</a><br>
-  Cleanup: <a href="#rsclose">Close</a></font> <font size="2"></font> 
-</p><p><font size="2"><a href="#rs2html"><b>rs2html</b></a>&nbsp; <a href="#exrs2html">example</a></font><br>
+  Cleanup: <a href="#rsclose">Close</a></font>  
+</p>
+<p><font size="2"><a href="#rs2html"><b>rs2html</b></a>&nbsp; <a href="#exrs2html">example</a></font><br>
   <a href="#adodiff">Differences between ADOdb and ADO</a><br>
   <a href="#driverguide"><b>Database Driver Guide<br>
   </b></a><b><a href="#changes">Change Log</a></b><br>
@@ -281,9 +279,7 @@
 	'persist', 'persistent', 'debug', 'fetchmode'
 	</td></tr><tr><td>Interbase/Firebird
 	</td><td>
-					 'dialect',
-					 'charset',
-					'buffers'
+					 'dialect','charset','buffers','role'
 	</td></tr><tr><td>M'soft ADO</td><td>
 					 'charpage'
 					
@@ -322,18 +318,68 @@
 <p><a name="connect_ex"> For most drivers, you can use the standard function: Connect($server, $user, $password, $database), or
 a </a><a href="dsnsupport">DSN</a> since ADOdb 4.51. Exceptions to this are listed below.
 </p><h4>PostgreSQL</h4>
-<p>PostgreSQL accepts connections using: </p>
+<p>PostgreSQL 7 and 8 accepts connections using: </p>
 <p>a. the standard connection string:</p>
-<pre>	$conn = &amp;ADONewConnection('postgres7'); <br>	$conn-&gt;PConnect('host=localhost port=5432 dbname=mary');</pre>
+<pre>	$conn = &amp;ADONewConnection('postgres');  <br>	$conn-&gt;PConnect('host=localhost port=5432 dbname=mary');</pre>
 <p> b. the classical 4 parameters:</p>
  <pre>	$conn-&gt;PConnect('localhost','userid','password','database');<br> </pre>
 <p>c. dsn:
-</p><pre>	$dsn = 'postgres7://user:pwd@localhost/mydb?persist';  # persist is optional<br>	$conn = ADONewConnection($dsn);  # no need for Connect/PConnect<br></pre>
+</p><pre>	$dsn = 'postgres://user:pwd@localhost/mydb?persist';  # persist is optional
+	$conn = ADONewConnection($dsn);  # no need for Connect/PConnect<br></pre>
 <a name="ldap"></a>
 
  <h4>LDAP</h4>
   <p>Here is an example of querying a LDAP server. Thanks to Josh Eldridge for the driver and this example:
-</p><pre> &lt;?php<br>require('/path/to/adodb.inc.php');<br><br>$host = 'ldap.baylor.edu';<br>$ldapbase = 'ou=People,o=Baylor University,c=US';<br><br>$ldap = NewADOConnection( 'ldap' );<br>$ldap-&gt;Connect( $host, $user_name='', $password='', $ldapbase );<br><br>echo "&lt;pre&gt;";<br><br>print_r( $ldap-&gt;ServerInfo() );<br>$ldap-&gt;SetFetchMode(ADODB_FETCH_ASSOC);<br>$userName = 'eldridge';<br>$filter="(|(CN=$userName*)(sn=$userName*)(givenname=$userName*)(uid=$userName*))";<br><br>$rs = $ldap-&gt;Execute( $filter );<br>if ($rs)<br>	while ($arr = $rs-&gt;FetchRow()) {<br>	     print_r($arr);	<br>	}<br><br>$rs = $ldap-&gt;Execute( $filter );<br>if ($rs) <br>	while (!$rs-&gt;EOF) {<br> 		print_r($rs-&gt;fields);	<br>		$rs-&gt;MoveNext();<br>	} <br>	<br>print_r( $ldap-&gt;GetArray( $filter ) );<br><br>print_r( $ldap-&gt;GetRow( $filter ) );<br><br>$ldap-&gt;Close();<br>echo "&lt;/pre&gt;";<br>?&gt;</pre>
+</p><pre>
+require('/path/to/adodb.inc.php');
+
+/* Make sure to set this BEFORE calling Connect() */
+$LDAP_CONNECT_OPTIONS = Array(
+	Array ("OPTION_NAME"=>LDAP_OPT_DEREF, "OPTION_VALUE"=>2),
+	Array ("OPTION_NAME"=>LDAP_OPT_SIZELIMIT,"OPTION_VALUE"=>100),
+	Array ("OPTION_NAME"=>LDAP_OPT_TIMELIMIT,"OPTION_VALUE"=>30),
+	Array ("OPTION_NAME"=>LDAP_OPT_PROTOCOL_VERSION,"OPTION_VALUE"=>3),
+	Array ("OPTION_NAME"=>LDAP_OPT_ERROR_NUMBER,"OPTION_VALUE"=>13),
+	Array ("OPTION_NAME"=>LDAP_OPT_REFERRALS,"OPTION_VALUE"=>FALSE),
+	Array ("OPTION_NAME"=>LDAP_OPT_RESTART,"OPTION_VALUE"=>FALSE)
+);
+$host = 'ldap.baylor.edu';
+$ldapbase = 'ou=People,o=Baylor University,c=US';
+
+$ldap = NewADOConnection( 'ldap' );
+$ldap->Connect( $host, $user_name='', $password='', $ldapbase );
+
+echo "&lt;pre>";
+
+print_r( $ldap->ServerInfo() );
+$ldap->SetFetchMode(ADODB_FETCH_ASSOC);
+$userName = 'eldridge';
+$filter="(|(CN=$userName*)(sn=$userName*)(givenname=$userName*)(uid=$userName*))";
+
+$rs = $ldap->Execute( $filter );
+if ($rs)
+	while ($arr = $rs->FetchRow()) {
+	     print_r($arr);	
+	}
+
+$rs = $ldap->Execute( $filter );
+if ($rs) 
+	while (!$rs->EOF) {
+ 		print_r($rs->fields);	
+		$rs->MoveNext();
+	} 
+	
+print_r( $ldap->GetArray( $filter ) );
+print_r( $ldap->GetRow( $filter ) );
+
+$ldap->Close();
+echo "&lt;/pre>";
+</pre>
+<p>Using DSN:
+<pre>
+$dsn = "ldap://ldap.baylor.edu/ou=People,o=Baylor University,c=US";
+$db = NewADOConnection($dsn);
+</pre>
 <h4>Interbase/Firebird</h4>
 You define the database in the $host parameter:
 <pre>	$conn = &amp;ADONewConnection('ibase'); <br>	$conn-&gt;PConnect('localhost:c:\ibase\employee.gdb','sysdba','masterkey');<br></pre>
@@ -341,9 +387,12 @@
 </p><pre>	$dsn = 'firebird://user:pwd@localhost/mydb?persist&amp;dialect=3';  # persist is optional<br>	$conn = ADONewConnection($dsn);  # no need for Connect/PConnect<br></pre>
 <h4>SQLite</h4>
 Sqlite will create the database file if it does not exist.
-<pre>	$conn = &amp;ADONewConnection('sqlite'); <br>	$conn-&gt;PConnect('c:\path\to\sqlite.db'); # sqlite will create if does not exist<br></pre>
+<pre>	$conn = &amp;ADONewConnection('sqlite');
+	$conn-&gt;PConnect('c:\path\to\sqlite.db'); # sqlite will create if does not exist<br></pre>
 <p>Or dsn:
-</p><pre>	$dsn = 'sqlite://user:pwd@localhost/mydb?persist';  # persist is optional<br>	$conn = ADONewConnection($dsn);  # no need for Connect/PConnect<br></pre>
+</p><pre>	$path = urlencode('c:\path\to\sqlite.db');
+	$dsn = "sqlite://$path/?persist";  # persist is optional
+	$conn = ADONewConnection($dsn);  # no need for Connect/PConnect<br></pre>
 <h4>Oracle (oci8)</h4>
 <p>With oci8, you can connect in multiple ways. Note that oci8 works fine with 
 newer versions of the Oracle, eg. 9i and 10g.</p>
@@ -362,14 +411,7 @@
 <p>f. ADOdb dsn:
 </p><pre>	$dsn = 'oci8://user:pwd@tnsname/?persist';  # persist is optional<br>	$conn = ADONewConnection($dsn);  # no need for Connect/PConnect<br>	<br>	$dsn = 'oci8://user:pwd@host/sid';<br>	$conn = ADONewConnection($dsn);<br>	<br>	$dsn = 'oci8://user:pwd@/';   # oracle on local machine<br>	$conn = ADONewConnection($dsn);<br></pre>
 <p>You can also set the charSet for Oracle 9.2 and later, supported since PHP 4.3.2, ADOdb 4.54:
-<pre>
-	$conn->charSet = 'we8iso8859p1';
-	$conn->Connect(...);
-	
-	# or
-	$dsn = 'oci8://user:pwd@tnsname/?charset=WE8MSWIN1252';
-	$db = ADONewConnection($dsn);
-</pre>
+</p><pre>	$conn-&gt;charSet = 'we8iso8859p1';<br>	$conn-&gt;Connect(...);<br>	<br>	# or<br>	$dsn = 'oci8://user:pwd@tnsname/?charset=WE8MSWIN1252';<br>	$db = ADONewConnection($dsn);<br></pre>
 <a name="dsnless"></a>
 <h4>DSN-less ODBC ( Access, MSSQL and DB2 examples)</h4>
 <p>ODBC DSN's can be created in the ODBC control panel, or you can use a DSN-less 
@@ -382,7 +424,7 @@
 For Microsoft SQL Server: 
 <pre>	$db =&amp; ADONewConnection('odbc_mssql');<br>	$dsn = <strong>"Driver={SQL Server};Server=localhost;Database=northwind;"</strong>;<br>	$db-&gt;Connect($dsn,'userid','password');<br></pre>
 or if you prefer to use the mssql extension (which is limited to mssql 6.5 functionality):
-<pre>	$db =&amp; ADONewConnection('mssql');<br>	$db-&gt;Execute("localhost', 'userid', 'password', 'northwind');<br></pre>
+<pre>	$db =&amp; ADONewConnection('mssql');<br>	$db-&gt;Execute('localhost', 'userid', 'password', 'northwind');<br></pre>
 For DB2:
 <pre>	$db =&amp; ADONewConnection('db2');<br>	$dsn = "driver={IBM db2 odbc DRIVER};Database=sample;hostname=localhost;port=50000;protocol=TCPIP;".<br>			"uid=root; pwd=secret";<br>	$db-&gt;Connect($dsn);<br></pre>
 <b>DSN-less Connections with ADO</b><br>
@@ -481,7 +523,7 @@
 <h3><a name="drivers"></a>Databases Supported</h3>
 The <i>name</i> below is the value you pass to NewADOConnection($name) to create a  connection object for that database.
 <p>
-<p> 
+</p><p> 
 </p><table border="1" width="100%">
   <tbody><tr valign="top"> 
     <td><b>Name</b></td>
@@ -562,7 +604,7 @@
       $db-&gt;PConnect('localhost:c:/ibase/employee.gdb', "sysdba", "masterkey") 
       to connect. Lacks Affected_Rows currently.<br>
       <br>
-      You can set $db-&gt;dialect, $db-&gt;buffers and $db-&gt;charSet before connecting.</font></td>
+      You can set $db-&gt;role, $db-&gt;dialect, $db-&gt;buffers and $db-&gt;charSet before connecting.</font></td>
     <td><font size="2">Y/N</font></td>
     <td><font size="2">Interbase client</font></td>
     <td><font size="2">Unix and Windows</font></td>
@@ -757,11 +799,19 @@
     <td height="34"><font size="2">?</font></td>
     <td height="34"><font size="2">?</font></td>
   </tr>
+     <tr valign="top"> 
+    <td><b><font size="2">pdo</font></b></td>
+    <td><font size="2">C</font></td>
+    <td><font size="2">Generic PDO driver for PHP5. </font></td>
+    <td><font size="2">Y</font></td>
+    <td><font size="2">PDO extension and database specific drivers</font></td>
+    <td><font size="2">Unix and Windows. </font></td>
+  </tr>
   <tr valign="top"> 
     <td><b><font size="2">postgres</font></b></td>
     <td><font size="2">A</font></td>
     <td><font size="2">Generic PostgreSQL driver. Currently identical to postgres7 
-      driver. </font></td>
+      driver.</font></td>
     <td><font size="2">Y</font></td>
     <td><font size="2">PostgreSQL client</font></td>
     <td><font size="2">Unix and Windows. </font></td>
@@ -783,6 +833,14 @@
     <td><font size="2">PostgreSQL client</font></td>
     <td><font size="2">Unix and Windows. </font></td>
   </tr>
+    <tr valign="top"> 
+    <td><b><font size="2">postgres8</font></b></td>
+    <td><font size="2">A</font></td>
+    <td><font size="2">PostgreSQL which supports version 8 functionality.</font></td>
+    <td><font size="2">Y</font></td>
+    <td><font size="2">PostgreSQL client</font></td>
+    <td><font size="2">Unix and Windows. </font></td>
+  </tr>
   <tr valign="top"> 
     <td><b><font size="2">sapdb</font></b></td>
     <td><font size="2">C</font></td>
@@ -831,9 +889,18 @@
     <td><font size="2">Sybase client</font></td>
     <td> <p><font size="2">Unix and Windows.</font></p></td>
   </tr>
+  
+    <tr valign="top"> 
+    <td><b><font size="2">sybase_ase</font></b></td>
+    <td><font size="2">C</font></td>
+    <td><font size="2">Sybase ASE. </font></td>
+    <td><font size="2">Y/N</font></td>
+    <td><font size="2">Sybase client</font></td>
+    <td> <p><font size="2">Unix and Windows.</font></p></td>
+  </tr>
   </tbody></table>
 
-</p><p>The "Tested" column indicates how extensively the code has been tested 
+<p></p><p>The "Tested" column indicates how extensively the code has been tested 
   and used. <br>
   A = well tested and used by many people<br>
   B = tested and usable, but some features might not be implemented<br>
@@ -944,7 +1011,7 @@
   Note: <i>php_track_errors</i> might have to be enabled for error messages to 
   be saved.</p>
 <h3> Example 4: Debugging<a name="ex4"></a></h3>
-<pre>&lt;?<br><b>include</b>('adodb.inc.php');	   # load code common to ADOdb<br>$<font color="#663300">conn</font> = &amp;ADONewConnection('access');	# create a connection<br>$<font color="#663300">conn</font>-&gt;PConnect('northwind');   # connect to MS-Access, northwind dsn<br><font color="#000000">$<font color="#663300">shipto</font> = <b>$conn-&gt;qstr</b>("John's Old Shoppe");<br>$<font color="#663300">sql</font> = "insert into orders (customerID,EmployeeID,OrderDate,ShipName) ";<br>$<font color="#663300">sql</font> .= "values ('ANATR',2,".$<font color="#663300">conn</font>-&gt;FormatDate(time()).",$shipto)";<br><b><font color="#336600">$<font color="#663300">conn</font>-&gt;debug = true;</font></b>
+<pre>&lt;?<br><b>include</b>('adodb.inc.php');	   # load code common to ADOdb<br>$<font color="#663300">conn</font> = &amp;ADONewConnection('access');	# create a connection<br>$<font color="#663300">conn</font>-&gt;PConnect('northwind');   # connect to MS-Access, northwind dsn<br><font>$<font color="#663300">shipto</font> = <b>$conn-&gt;qstr</b>("John's Old Shoppe");<br>$<font color="#663300">sql</font> = "insert into orders (customerID,EmployeeID,OrderDate,ShipName) ";<br>$<font color="#663300">sql</font> .= "values ('ANATR',2,".$<font color="#663300">conn</font>-&gt;FormatDate(time()).",$shipto)";<br><b><font color="#336600">$<font color="#663300">conn</font>-&gt;debug = true;</font></b>
 <b>if</b> ($<font color="#663300">conn</font>-&gt;Execute($sql) <b>=== false</b>) <b>print</b> 'error inserting';</font>
 ?&gt;
 </pre>
@@ -958,7 +1025,7 @@
 <p>Connect to MySQL database <i>agora</i>, and generate a &lt;select&gt; menu 
   from an SQL statement where the &lt;option&gt; captions are in the 1st column, 
   and the value to send back to the server is in the 2nd column.</p>
-<pre>&lt;?<br><b>include</b>('adodb.inc.php'); # load code common to ADOdb<br>$<font color="#663300">conn</font> = &amp;ADONewConnection('mysql');  # create a connection<br>$<font color="#663300">conn</font>-&gt;PConnect('localhost','userid','','agora');# connect to MySQL, agora db<br><font color="#000000">$<font color="#663300">sql</font> = 'select CustomerName, CustomerID from customers';<br>$<font color="#663300">rs</font> = $<font color="#663300">conn</font>-&gt;Execute($sql);<br><b>print</b> <b><font color="#336600">$<font color="#663300">rs</font>-&gt;GetMenu('GetCust','Mary Rosli');<br>?&gt;</font></b></font></pre>
+<pre>&lt;?<br><b>include</b>('adodb.inc.php'); # load code common to ADOdb<br>$<font color="#663300">conn</font> = &amp;ADONewConnection('mysql');  # create a connection<br>$<font color="#663300">conn</font>-&gt;PConnect('localhost','userid','','agora');# connect to MySQL, agora db<br><font>$<font color="#663300">sql</font> = 'select CustomerName, CustomerID from customers';<br>$<font color="#663300">rs</font> = $<font color="#663300">conn</font>-&gt;Execute($sql);<br><b>print</b> <b><font color="#336600">$<font color="#663300">rs</font>-&gt;GetMenu('GetCust','Mary Rosli');<br>?&gt;</font></b></font></pre>
 <p>Here we define a menu named GetCust, with the menu option 'Mary Rosli' selected. 
   See <a href="#getmenu"><font face="Courier New, Courier, mono">GetMenu</font></a><font face="Courier New, Courier, mono">()</font>. 
   We also have functions that return the recordset as an array: <font face="Courier New, Courier, mono"><a href="#getarray">GetArray</a>()</font>, 
@@ -967,7 +1034,26 @@
 <pre>&lt;?<br><b>include</b>('adodb.inc.php');	 # load code common to ADOdb<br>$<font color="#663300">conn1</font> = &amp;ADONewConnection('mysql');  # create a mysql connection<br>$<font color="#663300">conn2</font> = &amp;ADONewConnection('oracle');  # create a oracle connection<br><br>$conn1-&gt;PConnect($server, $userid, $password, $database);<br>$conn2-&gt;PConnect(false, $ora_userid, $ora_pwd, $oraname);<br><br>$conn1-&gt;Execute('insert ...');<br>$conn2-&gt;Execute('update ...');<br>?&gt;</pre>
 <p> 
 </p><h3>Example 7: Generating Update and Insert SQL<a name="ex7"></a></h3>
-ADOdb 1.31 and later supports two new recordset functions: GetUpdateSQL( ) and 
+<p>Since ADOdb 4.56, we support <a href="reference.functions.getupdatesql.html#autoexecute">AutoExecute()</a>, 
+which simplifies things by providing an advanced wrapper for GetInsertSQL() and GetUpdateSQL(). For example,
+an INSERT can be carried out with:
+
+<pre>
+    $record["firstname"] = "Bob"; 
+    $record["lastname"] = "Smith"; 
+    $record["created"] = time(); 
+    $insertSQL = $conn->AutoExecute($rs, $record, 'INSERT'); 
+</pre>
+
+and an UPDATE with:
+<pre>
+    $record["firstname"] = "Caroline"; 
+    $record["lastname"] = "Smith"; # Update Caroline's lastname from Miranda to Smith 
+    $insertSQL = $conn->AutoExecute($rs, $record, 'UPDATE', 'WHERE id = 1'); 
+</pre>
+<p>
+The rest of this section is out-of-date:
+<p>ADOdb 1.31 and later supports two new recordset functions: GetUpdateSQL( ) and 
 GetInsertSQL( ). This allow you to perform a "SELECT * FROM table query WHERE...", 
 make a copy of the $rs-&gt;fields, modify the fields, and then generate the SQL to 
 update or insert into the table automatically. 
@@ -981,7 +1067,7 @@
 </p><pre>&lt;?<br>#==============================================<br># SAMPLE GetUpdateSQL() and GetInsertSQL() code<br>#==============================================<br>include('adodb.inc.php');<br>include('tohtml.inc.php');<br><br>#==========================<br># This code tests an insert<br><br>$sql = "SELECT * FROM ADOXYZ WHERE id = -1"; <br># Select an empty record from the database<br><br>$conn = &amp;ADONewConnection("mysql");  # create a connection<br>$conn-&gt;debug=1;<br>$conn-&gt;PConnect("localhost", "admin", "", "test"); # connect to MySQL, testdb<br>$rs = $conn-&gt;Execute($sql); # Execute the query and get the empty recordset<br><br>$record = array(); # Initialize an array to hold the record data to insert<br><br># Set the values for the fields in the record<br># Note that field names are case-insensitive<br>$record["firstname"] = "Bob";<br>$record["lastNamE"] = "Smith";<br>$record["creaTed"] = time();<br><br># Pass the empty recordset and the array containing the data to insert<br># into the GetInsertSQL function. The function will process the data and return<br># a fully formatted insert sql statement.<br>$insertSQL = $conn-&gt;GetInsertSQL($rs, $record);<br><br>$conn-&gt;Execute($insertSQL); # Insert the record into the database<br><br>#==========================<br># This code tests an update<br><br>$sql = "SELECT * FROM ADOXYZ WHERE id = 1"; <br># Select a record to update<br><br>$rs = $conn-&gt;Execute($sql); # Execute the query and get the existing record to update<br><br>$record = array(); # Initialize an array to hold the record data to update<br><br># Set the values for the fields in the record<br># Note that field names are case-insensitive<br>$record["firstname"] = "Caroline";<br>$record["LasTnAme"] = "Smith"; # Update Caroline's lastname from Miranda to Smith<br><br># Pass the single record recordset and the array containing the data to update<br># into the GetUpdateSQL function. The function will process the data and return<br># a fully formatted update sql statement with the correct WHERE clause.<br># If the data has not changed, no recordset is returned<br>$updateSQL = $conn-&gt;GetUpdateSQL($rs, $record);<br><br>$conn-&gt;Execute($updateSQL); # Update the record in the database<br>$conn-&gt;Close();<br>?&gt;<br></pre>
 <a name="ADODB_FORCE_TYPE"></a>
 <b>$ADODB_FORCE_TYPE</b><p>
-The behaviour of GetUpdateSQL() and GetInsertSQL()  
+The behaviour of AutoExecute(), GetUpdateSQL() and GetInsertSQL()  
 when converting empty or null PHP variables to SQL is controlled by the
  global $ADODB_FORCE_TYPE variable. Set it to one of the values below. Default
   is ADODB_FORCE_VALUE (3):
@@ -991,8 +1077,7 @@
 </p><p>
 Note: the constant ADODB_FORCE_NULLS is obsolete since 4.52 and is ignored. Set $ADODB_FORCE_TYPE = ADODB_FORCE_NULL
 for equivalent behaviour.
-
-</p><p>
+<p>Since 4.62, the table name to be used can be overridden by setting $rs->tableName before AutoExecute(), GetInsertSQL() or GetUpdateSQL() is called.
 </p><h3>Example 8: Implementing Scrolling with Next and Previous<a name="ex8"></a></h3>
 <p> The following code creates a very simple recordset pager, where you can scroll 
   from page to page of a recordset.</p>
@@ -1065,7 +1150,7 @@
 <p>We provide some helper functions to export in comma-separated-value (CSV) and 
   tab-delimited formats:</p>
 <pre><b>include_once('/path/to/adodb/toexport.inc.php');</b><br>include_once('/path/to/adodb/adodb.inc.php');<br>
-$db = &amp;NewADOConnection('mysql');<br>$db-&gt;Connect($server, $userid, $password, $database);<br><br>$rs = $db-&gt;Execute('select fname as "First Name", surname as "Surname" from table');<br><br>print "&lt;pre&gt;";<br>print <b>rs2csv</b>($rs); # return a string, CSV format<p>print '&lt;hr&gt;';<br><br>$rs-&gt;MoveFirst(); # note, some databases do not support MoveFirst<br>print <b>rs2tab</b>($rs,<i>false</i>); # return a string, tab-delimited<br>						 # false == suppress field names in first line</p>print '&lt;hr&gt;';<br>$rs-&gt;MoveFirst();<br><b>rs2tabout</b>($rs); # send to stdout directly (there is also an rs2csvout function)<br>print "&lt;/pre&gt;";<br><br>$rs-&gt;MoveFirst();<br><b></b>$fp = fopen($path, "w");<br>if ($fp) {<br>  <b>rs2csvfile</b>($rs, $fp); # write to file (there is also an rs2tabfile function)<br>  fclose($fp);<br>}<br></pre>
+$db = &amp;NewADOConnection('mysql');<br>$db-&gt;Connect($server, $userid, $password, $database);<br><br>$rs = $db-&gt;Execute('select fname as "First Name", surname as "Surname" from table');<br><br>print "&lt;pre&gt;";<br>print <b>rs2csv</b>($rs); # return a string, CSV format<p>print '&lt;hr&gt;';<br><br>$rs-&gt;MoveFirst(); # note, some databases do not support MoveFirst<br>print <b>rs2tab</b>($rs,<i>false</i>); # return a string, tab-delimited<br>						 # false == suppress field names in first line</p>print '&lt;hr&gt;';<br>$rs-&gt;MoveFirst();<br><b>rs2tabout</b>($rs); # send to stdout directly (there is also an rs2csvout function)<br>print "&lt;/pre&gt;";<br><br>$rs-&gt;MoveFirst();<br>$fp = fopen($path, "w");<br>if ($fp) {<br>  <b>rs2csvfile</b>($rs, $fp); # write to file (there is also an rs2tabfile function)<br>  fclose($fp);<br>}<br></pre>
 <p> Carriage-returns or newlines are converted to spaces. Field names are returned 
   in the first line of text. Strings containing the delimiter character are quoted 
   with double-quotes. Double-quotes are double-quoted again. This conforms to 
@@ -1153,6 +1238,7 @@
 </pre>
 The following message will be logged in the error.log file: 
 <pre>(2001-10-28 14:20:38) mysql error: [1146: Table 'northwind.productsz' doesn't exist] in<br> EXECUTE("select * from productsz")<br></pre>
+<h3>PEAR_ERROR</h3>
 The second error handler is <b>adodb-errorpear.inc.php</b>. This will create a 
 PEAR_Error derived object whenever an error occurs. The last PEAR_Error object 
 created can be retrieved using ADODB_Pear_Error(). 
@@ -1176,7 +1262,11 @@
 <p> Note that we do not explicitly return a PEAR_Error object to you when an error 
   occurs. We return false instead. You have to call ADODB_Pear_Error() to get 
   the last error or use the PEAR_ERROR_DIE technique. 
-</p><h4>Error Messages</h4>
+</p>
+<h3>MetaError and MetaErrMsg</h3>
+ <p>If you need error messages that work across multiple databases, then use <a href="#metaerror">MetaError()</a>, which returns a virtualized error number, based on PEAR DB's error number system, and <a href=<a href="#metaerrmsg">MetaErrMsg()</a>.
+
+<h4>Error Messages</h4>
 <p>Error messages are outputted using the static method ADOConnnection::outp($msg,$newline=true). 
   By default, it sends the messages to the client. You can override this to perform 
   error-logging. 
@@ -1189,7 +1279,7 @@
    <p></p>
 <p>   <a href="#dsnsupport">More info and connection examples</a> on the DSN format.
 
- </p><h2><a name="pear"></a>PEAR Compatibility</h2>
+</p><h2><a name="pear"></a>PEAR Compatibility</h2>
   We support DSN's (see above), and the following functions:
  <pre><b> DB_Common</b>
  	query - returns PEAR_Error on error
@@ -1219,13 +1309,13 @@
   ) and CacheSelectLimit( ) functions. There are similar to the non-cache functions, 
   except that they take a new first parameter, $secs2cache. 
 </p><p> An example: 
-</p><pre><b>include</b>('adodb.inc.php'); # load code common to ADOdb<br>$ADODB_CACHE_DIR = '/usr/ADODB_cache';<br>$<font color="#663300">conn</font> = &amp;ADONewConnection('mysql');  # create a connection<br>$<font color="#663300">conn</font>-&gt;PConnect('localhost','userid','','agora');# connect to MySQL, agora db<br><font color="#000000">$<font color="#663300">sql</font> = 'select CustomerName, CustomerID from customers';<br>$<font color="#663300">rs</font> = $<font color="#663300">conn</font>-&gt;CacheExecute(15,$sql);</font></pre>
-<p><font color="#000000"> The first parameter is the number of seconds to cache 
+</p><pre><b>include</b>('adodb.inc.php'); # load code common to ADOdb<br>$ADODB_CACHE_DIR = '/usr/ADODB_cache';<br>$<font color="#663300">conn</font> = &amp;ADONewConnection('mysql');  # create a connection<br>$<font color="#663300">conn</font>-&gt;PConnect('localhost','userid','','agora');# connect to MySQL, agora db<br><font>$<font color="#663300">sql</font> = 'select CustomerName, CustomerID from customers';<br>$<font color="#663300">rs</font> = $<font color="#663300">conn</font>-&gt;CacheExecute(15,$sql);</font></pre>
+<p><font> The first parameter is the number of seconds to cache 
   the query. Subsequent calls to that query will used the cached version stored 
   in $ADODB_CACHE_DIR. To force a query to execute and flush the cache, call CacheExecute() 
   with the first parameter set to zero. Alternatively, use the CacheFlush($sql) 
   call. </font></p>
-<p><font color="#000000">For the sake of security, we recommend you set <i>register_globals=off</i> 
+<p><font>For the sake of security, we recommend you set <i>register_globals=off</i> 
   in php.ini if you are using $ADODB_CACHE_DIR.</font></p>
 <p>In ADOdb 1.80 onwards, the secs2cache parameter is optional in CacheSelectLimit() 
   and CacheExecute(). If you leave it out, it will use the $connection-&gt;cacheSecs 
@@ -1233,13 +1323,13 @@
 </p><pre>	$conn-&gt;Connect(...);<br>	$conn-&gt;cacheSecs = 3600*24; # cache 24 hours<br>	$rs = $conn-&gt;CacheExecute('select * from table');<br></pre>
 <p>Please note that magic_quotes_runtime should be turned off. <a href="http://phplens.com/lens/lensforum/msgs.php?LeNs#LensBM_forummsg">More 
   info</a>, and do not change $ADODB_FETCH_MODE (or SetFetchMode) 
-  as the cached recordset will use the $ADODB_FETCH_MODE set when the query was executed. <font color="#000000"> 
+  as the cached recordset will use the $ADODB_FETCH_MODE set when the query was executed. <font> 
 <h2><a name="pivot"></a>Pivot Tables</h2>
-</font> </p><p><font color="#000000">Since ADOdb 2.30, we support the generation of 
+</font> </p><p><font>Since ADOdb 2.30, we support the generation of 
 SQL to create pivot tables, also known as cross-tabulations. For further explanation 
 read this DevShed <a href="http://www.devshed.com/Server_Side/MySQL/MySQLWiz/">Cross-Tabulation 
 tutorial</a>. We assume that your database supports the SQL case-when expression. </font></p> 
-<font color="#000000"> 
+<font> 
 <p>In this example, we will use the Northwind database from Microsoft. In the 
   database, we have a products table, and we want to analyze this table by <i>suppliers 
   versus product categories</i>. We will place the suppliers on each row, and 
@@ -1293,11 +1383,11 @@
 	</td>
   </tr>
 </tbody></table>
-<font color="#000000"> 
-</font><p><font color="#000000">The following code will generate the SQL for a cross-tabulation: 
-</font></p><pre><font color="#000000"># Query the main "product" table<br># Set the rows to CompanyName<br># and the columns to the values of Categories<br># and define the joins to link to lookup tables <br># "categories" and "suppliers"<br>#<br> include "adodb/pivottable.php";<br> $sql = PivotTableSQL(<br> 	$gDB,                                      # adodb connection<br> 	'products p ,categories c ,suppliers s',   # tables<br>	'CompanyName',                             # rows (multiple fields allowed)<br>	'CategoryName',                            # column to pivot on <br>	'p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID' # joins/where<br>);<br></font></pre>
+<font> 
+</font><p><font>The following code will generate the SQL for a cross-tabulation: 
+</font></p><pre><font># Query the main "product" table<br># Set the rows to CompanyName<br># and the columns to the values of Categories<br># and define the joins to link to lookup tables <br># "categories" and "suppliers"<br>#<br> include "adodb/pivottable.php";<br> $sql = PivotTableSQL(<br> 	$gDB,                                      # adodb connection<br> 	'products p ,categories c ,suppliers s',   # tables<br>	'CompanyName',                             # rows (multiple fields allowed)<br>	'CategoryName',                            # column to pivot on <br>	'p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID' # joins/where<br>);<br></font></pre>
  
-<p><font color="#000000"> This will generate the following SQL:</font></p>
+<p><font> This will generate the following SQL:</font></p>
 <p><code><font size="2">SELECT CompanyName, <br>
   SUM(CASE WHEN CategoryName='Beverages' THEN 1 ELSE 0 END) AS "Beverages", 
   <br>
@@ -1320,9 +1410,9 @@
   and s.SupplierID= p.SupplierID <br>
   GROUP BY CompanyName</font></code></p>
 <p> You can also pivot on <i>numerical columns</i> and <i>generate totals</i> 
-	by using ranges. <font color="#000000">This code was revised in ADODB 2.41 
+	by using ranges. <font>This code was revised in ADODB 2.41 
 	and is not backward compatible.</font> The second example shows this:</p>
-<pre> $sql = PivotTableSQL(<br> 	$gDB,                                       # adodb connection<br> 	'products p ,categories c ,suppliers s',    # tables<br>	'CompanyName',                              #<font color="#000000"> rows (multiple fields allowed)</font>
+<pre> $sql = PivotTableSQL(<br> 	$gDB,                                       # adodb connection<br> 	'products p ,categories c ,suppliers s',    # tables<br>	'CompanyName',                              #<font> rows (multiple fields allowed)</font>
    array(                                       # column ranges
 	' 0 '      =&gt; 'UnitsInStock &lt;= 0',
 	"1 to 5"   =&gt; '0 &lt; UnitsInStock and UnitsInStock &lt;= 5',
@@ -1353,12 +1443,12 @@
 	and s.SupplierID= p.SupplierID <br>
 	GROUP BY CompanyName</font></code><font size="2"><br>
 	</font> </p>
-<font color="#000000"><hr>
+<font><hr>
 <h1>Class Reference<a name="ref"></a></h1>
 <p>Function parameters with [ ] around them are optional.</p>
 </font> 
 <h2>Global Variables</h2>
-<h3><font color="#000000"><a name="adodb_countrecs"></a></font>$ADODB_COUNTRECS</h3>
+<h3><font><a name="adodb_countrecs"></a></font>$ADODB_COUNTRECS</h3>
 <p>If the database driver API does not support counting the number of records 
 	returned in a SELECT statement, the function RecordCount() is emulated when 
 	the global variable $ADODB_COUNTRECS is set to true, which is the default. 
@@ -1366,8 +1456,8 @@
 	of memory for big recordsets. Set this variable to false for the best performance. 
 	This variable is checked every time a query is executed, so you can selectively 
 	choose which recordsets to count.</p>
-<h3><font color="#000000"><a name="adodb_cache_dir"></a>$ADODB_CACHE_DIR</font></h3>
-<font color="#000000"> 
+<h3><font><a name="adodb_cache_dir"></a>$ADODB_CACHE_DIR</font></h3>
+<font> 
 <p>If you are using recordset caching, this is the directory to save your recordsets 
   in. Define this before you call any caching functions such as CacheExecute( 
   ). We recommend setting <i>register_globals=off</i> in php.ini if you use this 
@@ -1377,154 +1467,155 @@
 </font> 
 <p>chown -R apache /path/to/adodb/cache<br>
   chgrp -R apache /path/to/adodb/cache </p>
-<font color="#000000">
-</font><h3><font color="#000000"><a name="adodb_ansi_padding_off"></a>$ADODB_ANSI_PADDING_OFF</font></h3>
-<p><font color="#000000">Determines whether to right trim CHAR fields (and also VARCHAR for ibase/firebird).
+<h3><font><a name="adodb_ansi_padding_off"></a>$ADODB_ANSI_PADDING_OFF</font></h3>
+<p><font>Determines whether to right trim CHAR fields (and also VARCHAR for ibase/firebird).
 Set to true to trim. Default is false. Currently works for oci8po, ibase and firebird 
 drivers. Added in ADOdb 4.01.
-</font></p><h3><font color="#000000"><font color="#000000"><a name="adodb_lang"></a></font>$ADODB_LANG</font></h3>
-<p><font color="#000000">Determines the language used in MetaErrorMsg(). The default is 'en', for English. 
+</font></p><h3><font><a name="adodb_lang"></a>$ADODB_LANG</font></h3>
+<p><font>Determines the language used in MetaErrorMsg(). The default is 'en', for English. 
 To find out what languages are supported, see the files 
 in adodb/lang/adodb-$lang.inc.php, where $lang is the supported langauge.
-</font></p><h3><font color="#000000"><a name="adodb_fetch_mode"></a>$ADODB_FETCH_MODE</font></h3>
-<p><font color="#000000">This is a global variable that determines how arrays are retrieved by recordsets. 
+</font></p><h3><font><a name="adodb_fetch_mode"></a>$ADODB_FETCH_MODE</font></h3>
+<p><font>This is a global variable that determines how arrays are retrieved by recordsets. 
   The recordset saves this value on creation (eg. in Execute( ) or SelectLimit( 
   )), and any subsequent changes to $ADODB_FETCH_MODE have no affect on existing 
   recordsets, only on recordsets created in the future.</font></p>
-<p><font color="#000000">The following constants are defined:</font></p>
+<p><font>The following constants are defined:</font></p>
  
-<p><font color="#000000">define('ADODB_FETCH_DEFAULT',0);<br>
+<p><font>define('ADODB_FETCH_DEFAULT',0);<br>
   define('ADODB_FETCH_NUM',1);<br>
   define('ADODB_FETCH_ASSOC',2);<br>
   define('ADODB_FETCH_BOTH',3); </font></p>
-<font color="#000000"> 
-</font><p><font color="#000000"> An example: 
-</font></p><pre><font color="#000000">	$ADODB_<b>FETCH_MODE</b> = ADODB_FETCH_NUM;<br>	$rs1 = $db-&gt;Execute('select * from table');<br>	$ADODB_<b>FETCH_MODE</b> = ADODB_FETCH_ASSOC;<br>	$rs2 = $db-&gt;Execute('select * from table');<br>	print_r($rs1-&gt;fields); # shows <i>array([0]=&gt;'v0',[1] =&gt;'v1')</i>
+<font> 
+</font><p><font> An example: 
+</font></p><pre><font>	$ADODB_<b>FETCH_MODE</b> = ADODB_FETCH_NUM;<br>	$rs1 = $db-&gt;Execute('select * from table');<br>	$ADODB_<b>FETCH_MODE</b> = ADODB_FETCH_ASSOC;<br>	$rs2 = $db-&gt;Execute('select * from table');<br>	print_r($rs1-&gt;fields); # shows <i>array([0]=&gt;'v0',[1] =&gt;'v1')</i>
 	print_r($rs2-&gt;fields); # shows <i>array(['col1']=&gt;'v0',['col2'] =&gt;'v1')</i>
 </font></pre>
-<p><font color="#000000"> As you can see in the above example, both recordsets store and use different 
+<p><font> As you can see in the above example, both recordsets store and use different 
 	fetch modes based on the $ADODB_FETCH_MODE setting when the recordset was 
 	created by Execute().</font></p>
-<p><font color="#000000">If no fetch mode is predefined, the fetch mode defaults to ADODB_FETCH_DEFAULT. 
+<p><font>If no fetch mode is predefined, the fetch mode defaults to ADODB_FETCH_DEFAULT. 
 	The behaviour of this default mode varies from driver to driver, so do not 
 	rely on ADODB_FETCH_DEFAULT. For portability, we recommend sticking to ADODB_FETCH_NUM 
 	or ADODB_FETCH_ASSOC. Many drivers do not support ADODB_FETCH_BOTH.</font></p>
-<p><font color="#000000"><strong>SetFetchMode Function</strong></font></p>
-<p><font color="#000000">Some programmers prefer to use a more object-oriented solution, where the fetch 
-	mode is set by a object function, <a href="#setfetchmode">SetFetchMode</a>. 
+<p><font><strong>SetFetchMode Function</strong></font></p>
+<p><font>If you have multiple connection objects, and want to have different fetch modes for each 
+connection, then use <a href="#setfetchmode">SetFetchMode</a>. 
 	Once this function is called for a connection object, that connection object 
 	will ignore the global variable $ADODB_FETCH_MODE and will use the internal 
 	fetchMode property exclusively.</font></p>
-<pre><font color="#000000">	$db-&gt;SetFetchMode(ADODB_FETCH_NUM);<br>	$rs1 = $db-&gt;Execute('select * from table');<br>	$db-&gt;SetFetchMode(ADODB_FETCH_ASSOC);<br>	$rs2 = $db-&gt;Execute('select * from table');<br>	print_r($rs1-&gt;fields); # shows <i>array([0]=&gt;'v0',[1] =&gt;'v1')</i>
+<pre><font>	$db-&gt;SetFetchMode(ADODB_FETCH_NUM);<br>	$rs1 = $db-&gt;Execute('select * from table');<br>	$db-&gt;SetFetchMode(ADODB_FETCH_ASSOC);<br>	$rs2 = $db-&gt;Execute('select * from table');<br>	print_r($rs1-&gt;fields); # shows <i>array([0]=&gt;'v0',[1] =&gt;'v1')</i>
 	print_r($rs2-&gt;fields); # shows <i>array(['col1']=&gt;'v0',['col2'] =&gt;'v1')</i></font></pre>
-<p><font color="#000000">To retrieve the previous fetch mode, you can use check the $db-&gt;fetchMode 
+<p><font>To retrieve the previous fetch mode, you can use check the $db-&gt;fetchMode 
 	property, or use the return value of SetFetchMode( ). 
-</font></p><p><font color="#000000"><strong><a name="adodb_assoc_case"></a>ADODB_ASSOC_CASE</strong></font></p>
-<p><font color="#000000">You can control the associative fetch case for certain drivers which behave 
+</font></p><p><font><strong><a name="adodb_assoc_case"></a>ADODB_ASSOC_CASE</strong></font></p>
+<p><font>You can control the associative fetch case for certain drivers which behave 
 	differently. For the sybase, oci8po, mssql, odbc and ibase drivers and all 
 	drivers derived from them, ADODB_ASSOC_CASE will by default generate recordsets 
 	where the field name keys are lower-cased. Use the constant ADODB_ASSOC_CASE 
 	to change the case of the keys. There are 3 possible values:</font></p>
-<p><font color="#000000">0 = assoc lowercase field names. $rs-&gt;fields['orderid']<br>
+<p><font>0 = assoc lowercase field names. $rs-&gt;fields['orderid']<br>
 	1 = assoc uppercase field names. $rs-&gt;fields['ORDERID']<br>
 	2 = use native-case field names. $rs-&gt;fields['OrderID'] -- this is the 
 	default since ADOdb 2.90</font></p>
-<p><font color="#000000">To use it, declare it before you incldue adodb.inc.php.</font></p>
-<p><font color="#000000">define('ADODB_ASSOC_CASE', 2); # use native-case for ADODB_FETCH_ASSOC<br>
+<p><font>To use it, declare it before you incldue adodb.inc.php.</font></p>
+<p><font>define('ADODB_ASSOC_CASE', 2); # use native-case for ADODB_FETCH_ASSOC<br>
 	include('adodb.inc.php'); </font></p>
-<h3><font color="#000000"><font color="#000000"><a name="force_type"></a></font>$ADODB_FORCE_TYPE</font></h3>
-<p><font color="#000000">See the <a href="#ADODB_FORCE_TYPE">GetUpdateSQL tutorial</a>.
+<h3><font><a name="force_type"></a>$ADODB_FORCE_TYPE</font></h3>
+<p><font>See the <a href="#ADODB_FORCE_TYPE">GetUpdateSQL tutorial</a>.
 </font></p><hr>
-<h2><font color="#000000">ADOConnection<a name="adoconnection"></a></font></h2>
-<p><font color="#000000">Object that performs the connection to the database, executes SQL statements 
+<h2><font>ADOConnection<a name="adoconnection"></a></font></h2>
+<p><font>Object that performs the connection to the database, executes SQL statements 
 	and has a set of utility functions for standardising the format of SQL statements 
 	for issues such as concatenation and date formats.</font></p>
-<h3><font color="#000000">ADOConnection Fields</font></h3>
-<p><font color="#000000"><b>databaseType</b>: Name of the database system we are connecting to. Eg. 
+<h3><font>ADOConnection Fields</font></h3>
+<p><font><b>databaseType</b>: Name of the database system we are connecting to. Eg. 
 	<b>odbc</b> or <b>mssql</b> or <b>mysql</b>.</font></p>
-<p><font color="#000000"><b>dataProvider</b>: The underlying mechanism used to connect to the database. 
+<p><font><b>dataProvider</b>: The underlying mechanism used to connect to the database. 
 	Normally set to <b>native</b>, unless using <b>odbc</b> or <b>ado</b>.</font></p>
-<p><font color="#000000"><b>host: </b>Name of server or data source name (DSN) to connect to.</font></p>
-<p><font color="#000000"><b>database</b>: Name of the database or to connect to. If ado is used, it 
+<p><font><b>host: </b>Name of server or data source name (DSN) to connect to.</font></p>
+<p><font><b>database</b>: Name of the database or to connect to. If ado is used, it 
 	will hold the ado data provider.</font></p>
-<p><font color="#000000"><b>user</b>: Login id to connect to database. Password is not saved for security 
+<p><font><b>user</b>: Login id to connect to database. Password is not saved for security 
 	reasons.</font></p>
-<p><font color="#000000"><b>raiseErrorFn</b>: Allows you to define an error handling function. See adodb-errorhandler.inc.php 
+<p><font><b>raiseErrorFn</b>: Allows you to define an error handling function. See adodb-errorhandler.inc.php 
 	for an example.</font></p>
-<p><font color="#000000"><b>debug</b>: Set to <i>true</i> to make debug statements to appear.</font></p>
-<p><font color="#000000"><b>concat_operator</b>: Set to '+' or '||' normally. The operator used to concatenate 
+<p><font><b>debug</b>: Set to <i>true</i> to make debug statements to appear.</font></p>
+<p><font><b>concat_operator</b>: Set to '+' or '||' normally. The operator used to concatenate 
 	strings in SQL. Used by the <b><a href="#concat">Concat</a></b> function.</font></p>
-<p><font color="#000000"><b>fmtDate</b>: The format used by the <b><a href="#dbdate">DBDate</a></b> 
+<p><font><b>fmtDate</b>: The format used by the <b><a href="#dbdate">DBDate</a></b> 
 	function to send dates to the database. is '#Y-m-d#' for Microsoft Access, 
 	and ''Y-m-d'' for MySQL.</font></p>
-<p><font color="#000000"><b>fmtTimeStamp: </b>The format used by the <b><a href="#dbtimestamp">DBTimeStamp</a></b> 
+<p><font><b>fmtTimeStamp: </b>The format used by the <b><a href="#dbtimestamp">DBTimeStamp</a></b> 
 	function to send timestamps to the database. </font></p>
-<p><font color="#000000"><b>true</b>: The value used to represent true.Eg. '.T.'. for Foxpro, '1' for 
+<p><font><b>true</b>: The value used to represent true.Eg. '.T.'. for Foxpro, '1' for 
 	Microsoft SQL.</font></p>
-<p><font color="#000000"><b>false: </b> The value used to represent false. Eg. '.F.'. for Foxpro, '0' 
+<p><font><b>false: </b> The value used to represent false. Eg. '.F.'. for Foxpro, '0' 
 	for Microsoft SQL.</font></p>
-<p><font color="#000000"><b>replaceQuote</b>: The string used to escape quotes. Eg. double single-quotes 
+<p><font><b>replaceQuote</b>: The string used to escape quotes. Eg. double single-quotes 
 	for Microsoft SQL, and backslash-quote for MySQL. Used by <a href="#qstr">qstr</a>.</font></p>
-<p><font color="#000000"><b>autoCommit</b>: indicates whether automatic commit is enabled. Default is 
+<p><font><b>autoCommit</b>: indicates whether automatic commit is enabled. Default is 
 	true.</font></p>
-<p><font color="#000000"><b>charSet</b>: set the default charset to use. Currently only interbase supports 
+<p><font><b>charSet</b>: set the default charset to use. Currently only interbase/firebird supports 
 	this.</font></p>
-<p><font color="#000000"><b>dialect</b>: set the default sql dialect to use. Currently only interbase 
+<p><font><b>dialect</b>: set the default sql dialect to use. Currently only interbase/firebird 
 	supports this.</font></p>
-<p><font color="#000000"><b>metaTablesSQL</b>: SQL statement to return a list of available tables. Eg. 
+	<p><font><b>role</b>: set the role. Currently only interbase/firebird 
+	supports this.</font></p>
+<p><font><b>metaTablesSQL</b>: SQL statement to return a list of available tables. Eg. 
 	<i>SHOW TABLES</i> in MySQL.</font></p>
-<p><font color="#000000"><b>genID</b>: The latest id generated by GenID() if supported by the database.</font></p>
-<p><font color="#000000"><b>cacheSecs</b>: The number of seconds to cache recordsets if CacheExecute() 
+<p><font><b>genID</b>: The latest id generated by GenID() if supported by the database.</font></p>
+<p><font><b>cacheSecs</b>: The number of seconds to cache recordsets if CacheExecute() 
 	or CacheSelectLimit() omit the $secs2cache parameter. Defaults to 60 minutes.</font></p>
-<p><font color="#000000"><b>sysDate</b>: String that holds the name of the database function to call 
+<p><font><b>sysDate</b>: String that holds the name of the database function to call 
 	to get the current date. Useful for inserts and updates.</font></p>
-<p><font color="#000000"><b>sysTimeStamp</b>: String that holds the name of the database function to 
+<p><font><b>sysTimeStamp</b>: String that holds the name of the database function to 
 	call to get the current timestamp/datetime value.</font></p>
-<p><font color="#000000"><b>leftOuter</b>: String that holds operator for left outer join, if known. 
+<p><font><b>leftOuter</b>: String that holds operator for left outer join, if known. 
 	Otherwise set to false.</font></p>
-<p><font color="#000000"><b>rightOuter</b>: String that holds operator for left outer join, if known. 
+<p><font><b>rightOuter</b>: String that holds operator for left outer join, if known. 
 	Otherwise set to false.</font></p>
-<p><font color="#000000"><b>ansiOuter</b>: Boolean that if true indicates that ANSI style outer joins 
+<p><font><b>ansiOuter</b>: Boolean that if true indicates that ANSI style outer joins 
 	are permitted. Eg. <i>select * from table1 left join table2 on p1=p2.</i></font></p>
-<p><font color="#000000"><b>connectSID</b>: Boolean that indicates whether to treat the $database parameter 
+<p><font><b>connectSID</b>: Boolean that indicates whether to treat the $database parameter 
 	in connects as the SID for the oci8 driver. Defaults to false. Useful for 
 	Oracle 8.0.5 and earlier.</font></p>
-<p><font color="#000000"><b>autoRollback</b>: Persistent connections are auto-rollbacked in PConnect( 
+<p><font><b>autoRollback</b>: Persistent connections are auto-rollbacked in PConnect( 
 	) if this is set to true. Default is false.</font></p>
 <hr>
-<h3><font color="#000000">ADOConnection Main Functions</font></h3>
-<p><font color="#000000"><b>ADOConnection( )</b></font></p>
-<p><font color="#000000">Constructor function. Do not call this directly. Use ADONewConnection( ) instead.</font></p>
-<p><font color="#000000"><b>Connect<a name="connect"></a>($host,[$user],[$password],[$database])</b></font></p>
-<p><font color="#000000">Non-persistent connect to data source or server $<b>host</b>, using userid 
+<h3><font>ADOConnection Main Functions</font></h3>
+<p><font><b>ADOConnection( )</b></font></p>
+<p><font>Constructor function. Do not call this directly. Use ADONewConnection( ) instead.</font></p>
+<p><font><b>Connect<a name="connect"></a>($host,[$user],[$password],[$database])</b></font></p>
+<p><font>Non-persistent connect to data source or server $<b>host</b>, using userid 
 	$<b>user </b>and password $<b>password</b>. If the server supports multiple 
 	databases, connect to database $<b>database</b>. </font></p>
-<p><font color="#000000">Returns true/false depending on connection success. Since 4.23, null is returned if the extension is not loaded.</font></p>
-<p><font color="#000000">ADO Note: If you are using a Microsoft ADO and not OLEDB, you can set the $database 
+<p><font>Returns true/false depending on connection success. Since 4.23, null is returned if the extension is not loaded.</font></p>
+<p><font>ADO Note: If you are using a Microsoft ADO and not OLEDB, you can set the $database 
 	parameter to the OLEDB data provider you are using.</font></p>
-<p><font color="#000000">PostgreSQL: An alternative way of connecting to the database is to pass the 
+<p><font>PostgreSQL: An alternative way of connecting to the database is to pass the 
 	standard PostgreSQL connection string in the first parameter $host, and the 
 	other parameters will be ignored.</font></p>
-<p><font color="#000000">For Oracle and Oci8, there are two ways to connect. First is to use the TNS 
+<p><font>For Oracle and Oci8, there are two ways to connect. First is to use the TNS 
 	name defined in your local tnsnames.ora (or ONAMES or HOSTNAMES). Place the 
 	name in the $database field, and set the $host field to false. Alternatively, 
 	set $host to the server, and $database to the database SID, this bypassed 
 	tnsnames.ora. 
-</font></p><p><font color="#000000">Examples: 
-</font></p><pre><font color="#000000"> # $oraname in tnsnames.ora/ONAMES/HOSTNAMES<br> $conn-&gt;Connect(false, 'scott', 'tiger', $oraname); <br> $conn-&gt;Connect('server:1521', 'scott', 'tiger', 'ServiceName'); # bypass tnsnames.ora</font></pre>
-<p><font color="#000000">There are many examples of connecting to a database.
+</font></p><p><font>Examples: 
+</font></p><pre><font> # $oraname in tnsnames.ora/ONAMES/HOSTNAMES<br> $conn-&gt;Connect(false, 'scott', 'tiger', $oraname); <br> $conn-&gt;Connect('server:1521', 'scott', 'tiger', 'ServiceName'); # bypass tnsnames.ora</font></pre>
+<p><font>There are many examples of connecting to a database.
 See  <a href="#connect_ex">Connection Examples</a> for many examples.
 
-</font></p><p><font color="#000000"><b>PConnect<a name="pconnect"></a>($host,[$user],[$password],[$database])</b></font></p>
-<p><font color="#000000">Persistent connect to data source or server $<b>host</b>, using userid $<b>user</b> 
+</font></p><p><font><b>PConnect<a name="pconnect"></a>($host,[$user],[$password],[$database])</b></font></p>
+<p><font>Persistent connect to data source or server $<b>host</b>, using userid $<b>user</b> 
 	and password $<b>password</b>. If the server supports multiple databases, 
 	connect to database $<b>database</b>.</font></p>
-<p><font color="#000000">We now perform a rollback on persistent connection for selected databases since 
+<p><font>We now perform a rollback on persistent connection for selected databases since 
 	2.21, as advised in the PHP manual. See change log or source code for which 
 	databases are affected. 
-</font></p><p><font color="#000000">Returns true/false depending on connection. Since 4.23, null is returned if the extension is not loaded.
+</font></p><p><font>Returns true/false depending on connection. Since 4.23, null is returned if the extension is not loaded.
 See Connect( ) above for more info.</font></p>
-<p><font color="#000000">Since ADOdb 2.21, we also support autoRollback. If you set:</font></p>
+<p><font>Since ADOdb 2.21, we also support autoRollback. If you set:</font></p>
  
 <pre> $conn = &amp;NewADOConnection('mysql');<br> $conn-&gt;autoRollback = true; # default is false<br> $conn-&gt;PConnect(...); # rollback here</pre>
 <p> Then when doing a persistent connection with PConnect( ), ADOdb will 
@@ -1541,111 +1632,110 @@
 <p>Always force a new connection. In contrast, PHP sometimes reuses connections 
 	when you use Connect() or PConnect(). Currently works only on mysql (PHP 4.3.0 
 	or later), postgresql and oci8-derived drivers. For other drivers, NConnect() works like 
-	Connect(). 
-<font color="#000000"> 
-</font></p><p><font color="#000000"><b>IsConnected( )<a name="isconnected"></a></b></font></p>
+	Connect().</p>
+<p><font><b>IsConnected( )<a name="isconnected"></a></b></font></p>
 <p>
-<font color="#000000">Returns true if connected to database. Added in 4.53.
+<font>Returns true if connected to database. Added in 4.53.
 
-</font></p><p><font color="#000000"><b>Execute<a name="execute"></a>($sql,$inputarr=false)</b></font></p>
-<p><font color="#000000">Execute SQL statement $<b>sql</b> and return derived class of ADORecordSet 
+</font></p><p><font><b>Execute<a name="execute"></a>($sql,$inputarr=false)</b></font></p>
+<p><font>Execute SQL statement $<b>sql</b> and return derived class of ADORecordSet 
 	if successful. Note that a record set is always returned on success, even 
 	if we are executing an insert or update statement. You can also pass in $sql a statement prepared 
 	in <a href="#prepare">Prepare()</a>.</font></p>
-<p><font color="#000000">Returns derived class of ADORecordSet. Eg. if connecting via mysql, then ADORecordSet_mysql 
+<p><font>Returns derived class of ADORecordSet. Eg. if connecting via mysql, then ADORecordSet_mysql 
 	would be returned. False is returned if there was an error in executing the 
 	sql.</font></p>
-<p><font color="#000000">The $inputarr parameter can be used for binding variables to parameters. Below 
+<p><font>The $inputarr parameter can be used for binding variables to parameters. Below 
 	is an Oracle example:</font></p>
-<pre><font color="#000000"> $conn-&gt;Execute("SELECT * FROM TABLE WHERE COND=:val", array('val'=&gt; $val));<br> </font></pre>
-<p><font color="#000000">Another example, using ODBC,which uses the ? convention:</font></p>
-<pre><font color="#000000">  $conn-&gt;Execute("SELECT * FROM TABLE WHERE COND=?", array($val));<br></font></pre>
-<font color="#000000"><a name="binding"></a>
+<pre><font> $conn-&gt;Execute("SELECT * FROM TABLE WHERE COND=:val", array('val'=&gt; $val));<br> </font></pre>
+<p><font>Another example, using ODBC,which uses the ? convention:</font></p>
+<pre><font>  $conn-&gt;Execute("SELECT * FROM TABLE WHERE COND=?", array($val));<br></font></pre>
+<font><a name="binding"></a>
 <i>Binding variables</i></font><p>
-<font color="#000000">Variable binding speeds the compilation and caching of SQL statements, leading 
+<font>Variable binding speeds the compilation and caching of SQL statements, leading 
 to higher performance. Currently Oracle, Interbase and ODBC supports variable binding. 
 Interbase/ODBC style ? binding is emulated in databases that do not support binding. 
 Note that you do not have to quote strings if you use binding.
-</font></p><p><font color="#000000"> Variable binding in the odbc, interbase and oci8po drivers. 
-</font></p><pre><font color="#000000">$rs = $db-&gt;Execute('select * from table where val=?', array('10'));<br></font></pre>
-<font color="#000000">Variable binding in the oci8 driver: 
-</font><pre><font color="#000000">$rs = $db-&gt;Execute('select name from table where val=:key', <br>  array('key' =&gt; 10));<br></font></pre>
-<font color="#000000"><a name="bulkbind"></a>
+</font></p><p><font> Variable binding in the odbc, interbase and oci8po drivers. 
+</font></p><pre><font>$rs = $db-&gt;Execute('select * from table where val=?', array('10'));<br></font></pre>
+<font>Variable binding in the oci8 driver: 
+</font><pre><font>$rs = $db-&gt;Execute('select name from table where val=:key', <br>  array('key' =&gt; 10));<br></font></pre>
+<font><a name="bulkbind"></a>
 <i>Bulk binding</i>
-</font><p><font color="#000000">Since ADOdb 3.80, we support bulk binding in Execute(), in which you pass in a 2-dimensional array to
+</font><p><font>Since ADOdb 3.80, we support bulk binding in Execute(), in which you pass in a 2-dimensional array to
 be bound to an INSERT/UPDATE or DELETE statement.
-</font></p><pre><font color="#000000">$arr = array(<br>	array('Ahmad',32),<br>	array('Zulkifli', 24),<br>	array('Rosnah', 21)<br>	);<br>$ok = $db-&gt;Execute('insert into table (name,age) values (?,?)',$arr);<br></font></pre>
-<p><font color="#000000">This provides very high performance as the SQL statement is prepared first. 
+</font></p><pre><font>$arr = array(<br>	array('Ahmad',32),<br>	array('Zulkifli', 24),<br>	array('Rosnah', 21)<br>	);<br>$ok = $db-&gt;Execute('insert into table (name,age) values (?,?)',$arr);<br></font></pre>
+<p><font>This provides very high performance as the SQL statement is prepared first. 
 The prepared statement is executed repeatedly for each array row until all rows are completed, 
 or until the first error. Very useful for importing data.
 
-</font></p><p><font color="#000000"><b>CacheExecute<a name="cacheexecute"></a>([$secs2cache,]$sql,$inputarr=false)</b></font></p>
-<p><font color="#000000">Similar to Execute, except that the recordset is cached for $secs2cache seconds 
+</font></p><p><font><b>CacheExecute<a name="cacheexecute"></a>([$secs2cache,]$sql,$inputarr=false)</b></font></p>
+<p><font>Similar to Execute, except that the recordset is cached for $secs2cache seconds 
 	in the $ADODB_CACHE_DIR directory, and $inputarr only accepts 1-dimensional arrays. 
 	If CacheExecute() is called again with the same $sql, $inputarr, 
 	and also the same database, same userid, and the cached recordset 
 	has not expired, the cached recordset is returned. 
-</font></p><pre><font color="#000000">  include('adodb.inc.php'); <br>  include('tohtml.inc.php');<br>  $ADODB_<b>CACHE_DIR</b> = '/usr/local/ADOdbcache';<br>  $conn = &amp;ADONewConnection('mysql'); <br>  $conn-&gt;PConnect('localhost','userid','password','database');<br>  $rs = $conn-&gt;<b>CacheExecute</b>(15, 'select * from table'); # cache 15 secs<br>  rs2html($rs); /* recordset to html table */  <br></font></pre>
-<p><font color="#000000"> Alternatively, since ADOdb 1.80, the $secs2cache parameter is optional:</font></p>
-<pre><font color="#000000">	$conn-&gt;Connect(...);<br>   	$conn-&gt;cacheSecs = 3600*24; // cache 24 hours<br>	$rs = $conn-&gt;CacheExecute('select * from table');<br></font></pre>
-<font color="#000000">If $secs2cache is omitted, we use the value 
+</font></p><pre><font>  include('adodb.inc.php'); <br>  include('tohtml.inc.php');<br>  $ADODB_<b>CACHE_DIR</b> = '/usr/local/ADOdbcache';<br>  $conn = &amp;ADONewConnection('mysql'); <br>  $conn-&gt;PConnect('localhost','userid','password','database');<br>  $rs = $conn-&gt;<b>CacheExecute</b>(15, 'select * from table'); # cache 15 secs<br>  rs2html($rs); /* recordset to html table */  <br></font></pre>
+<p><font> Alternatively, since ADOdb 1.80, the $secs2cache parameter is optional:</font></p>
+<pre><font>	$conn-&gt;Connect(...);<br>   	$conn-&gt;cacheSecs = 3600*24; // cache 24 hours<br>	$rs = $conn-&gt;CacheExecute('select * from table');<br></font></pre>
+<font>If $secs2cache is omitted, we use the value 
 in $connection-&gt;cacheSecs (default is 3600 seconds, or 1 hour). Use CacheExecute() 
 only with SELECT statements. 
-</font><p><font color="#000000">Performance note: I have done some benchmarks and found that they vary so greatly 
+</font><p><font>Performance note: I have done some benchmarks and found that they vary so greatly 
 	that it's better to talk about when caching is of benefit. When your database 
 	server is <i>much slower </i>than your Web server or the database is <i>very 
 	overloaded </i>then ADOdb's caching is good because it reduces the load on 
 	your database server. If your database server is lightly loaded or much faster 
 	than your Web server, then caching could actually reduce performance. </font></p>
-<p><font color="#000000"><b>ExecuteCursor<a name="executecursor"></a>($sql,$cursorName='rs',$parameters=false)</b></font></p>
-<p><font color="#000000">Execute an Oracle stored procedure, and returns an Oracle REF cursor variable as 
+<p><font><b>ExecuteCursor<a name="executecursor"></a>($sql,$cursorName='rs',$parameters=false)</b></font></p>
+<p><font>Execute an Oracle stored procedure, and returns an Oracle REF cursor variable as 
 	a regular ADOdb recordset. Does not work with any other database except oci8. 
 	Thanks to Robert Tuttle for the design.
-</font></p><pre><font color="#000000">    $db = ADONewConnection("oci8"); <br>    $db-&gt;Connect("foo.com:1521", "uid", "pwd", "FOO"); <br>    $rs = $db-&gt;ExecuteCursor("begin :cursorvar := getdata(:param1); end;", <br>					'cursorvar',<br>					array('param1'=&gt;10)); <br>    # $rs is now just like any other ADOdb recordset object<br>    rs2html($rs);</font></pre>
-<p><font color="#000000">ExecuteCursor() is a helper function that does the following internally: 
-</font></p><pre><font color="#000000">	$stmt = $db-&gt;Prepare("begin :cursorvar := getdata(:param1); end;", true); <br>	$db-&gt;Parameter($stmt, $cur, 'cursorvar', false, -1, OCI_B_CURSOR);<br>	$rs = $db-&gt;Execute($stmt,$bindarr);<br></font></pre>
-<p><font color="#000000">ExecuteCursor only accepts 1 out parameter. So if you have 2 out parameters, use:
-</font></p><pre><font color="#000000">	$vv = 'A%';<br>	$stmt = $db-&gt;PrepareSP("BEGIN list_tabs(:crsr,:tt); END;");<br>	$db-&gt;OutParameter($stmt, $cur, 'crsr', -1, OCI_B_CURSOR);<br>	$db-&gt;OutParameter($stmt, $vv, 'tt', 32); # return varchar(32)<br>	$arr = $db-&gt;GetArray($stmt);<br>	print_r($arr);<br>	echo " val = $vv"; ## outputs 'TEST'<br></font></pre>
-<font color="#000000">for the following PL/SQL:
-</font><pre><font color="#000000">	TYPE TabType IS REF CURSOR RETURN TAB%ROWTYPE;<br><br>	PROCEDURE list_tabs(tabcursor IN OUT TabType,tablenames IN OUT VARCHAR) IS<br>	BEGIN<br>		OPEN tabcursor FOR SELECT * FROM TAB WHERE tname LIKE tablenames;<br>		tablenames := 'TEST';<br>	END list_tabs;<br></font></pre>
-<p><font color="#000000"><b>SelectLimit<a name="selectlimit"></a>($sql,$numrows=-1,$offset=-1,$inputarr=false)</b></font></p>
-<p><font color="#000000">Returns a recordset if successful. Returns false otherwise. Performs a select 
+</font></p><pre><font>    $db = ADONewConnection("oci8"); <br>    $db-&gt;Connect("foo.com:1521", "uid", "pwd", "FOO"); <br>    $rs = $db-&gt;ExecuteCursor("begin :cursorvar := getdata(:param1); end;", <br>					'cursorvar',<br>					array('param1'=&gt;10)); <br>    # $rs is now just like any other ADOdb recordset object<br>    rs2html($rs);</font></pre>
+<p><font>ExecuteCursor() is a helper function that does the following internally: 
+</font></p><pre><font>	$stmt = $db-&gt;Prepare("begin :cursorvar := getdata(:param1); end;", true); <br>	$db-&gt;Parameter($stmt, $cur, 'cursorvar', false, -1, OCI_B_CURSOR);<br>	$rs = $db-&gt;Execute($stmt,$bindarr);<br></font></pre>
+<p><font>ExecuteCursor only accepts 1 out parameter. So if you have 2 out parameters, use:
+</font></p><pre><font>	$vv = 'A%';<br>	$stmt = $db-&gt;PrepareSP("BEGIN list_tabs(:crsr,:tt); END;");<br>	$db-&gt;OutParameter($stmt, $cur, 'crsr', -1, OCI_B_CURSOR);<br>	$db-&gt;OutParameter($stmt, $vv, 'tt', 32); # return varchar(32)<br>	$arr = $db-&gt;GetArray($stmt);<br>	print_r($arr);<br>	echo " val = $vv"; ## outputs 'TEST'<br></font></pre>
+<font>for the following PL/SQL:
+</font><pre><font>	TYPE TabType IS REF CURSOR RETURN TAB%ROWTYPE;<br><br>	PROCEDURE list_tabs(tabcursor IN OUT TabType,tablenames IN OUT VARCHAR) IS<br>	BEGIN<br>		OPEN tabcursor FOR SELECT * FROM TAB WHERE tname LIKE tablenames;<br>		tablenames := 'TEST';<br>	END list_tabs;<br></font></pre>
+<p><font><b>SelectLimit<a name="selectlimit"></a>($sql,$numrows=-1,$offset=-1,$inputarr=false)</b></font></p>
+<p><font>Returns a recordset if successful. Returns false otherwise. Performs a select 
 	statement, simulating PostgreSQL's SELECT statement, LIMIT $numrows OFFSET 
 	$offset clause.</font></p>
-<p><font color="#000000">In PostgreSQL, SELECT * FROM TABLE LIMIT 3 will return the first 3 records 
+<p><font>In PostgreSQL, SELECT * FROM TABLE LIMIT 3 will return the first 3 records 
 	only. The equivalent is <code>$connection-&gt;SelectLimit('SELECT * FROM TABLE',3)</code>. 
 	This functionality is simulated for databases that do not possess this feature.</font></p>
-<p><font color="#000000">And SELECT * FROM TABLE LIMIT 3 OFFSET 2 will return records 3, 4 and 5 (eg. 
+<p><font>And SELECT * FROM TABLE LIMIT 3 OFFSET 2 will return records 3, 4 and 5 (eg. 
 	after record 2, return 3 rows). The equivalent in ADOdb is <code>$connection-&gt;SelectLimit('SELECT 
 	* FROM TABLE',3,2)</code>.</font></p>
-<p><font color="#000000">Note that this is the <i>opposite</i> of MySQL's LIMIT clause. You can also 
+<p><font>Note that this is the <i>opposite</i> of MySQL's LIMIT clause. You can also 
 	set <code>$connection-&gt;SelectLimit('SELECT * FROM TABLE',-1,10)</code> to 
 	get rows 11 to the last row.</font></p>
-<p><font color="#000000">The last parameter $inputarr is for databases that support variable binding 
+<p><font>The last parameter $inputarr is for databases that support variable binding 
 	such as Oracle oci8. This substantially reduces SQL compilation overhead. 
 	Below is an Oracle example:</font></p>
-<pre><font color="#000000"> $conn-&gt;SelectLimit("SELECT * FROM TABLE WHERE COND=:val", 100,-1,array('val'=&gt; $val));<br> </font></pre>
-<p><font color="#000000">The oci8po driver (oracle portable driver) uses the more standard bind variable 
+<pre><font> $conn-&gt;SelectLimit("SELECT * FROM TABLE WHERE COND=:val", 100,-1,array('val'=&gt; $val));<br> </font></pre>
+<p><font>The oci8po driver (oracle portable driver) uses the more standard bind variable 
 	of ?: 
-</font></p><pre><font color="#000000"> $conn-&gt;SelectLimit("SELECT * FROM TABLE WHERE COND=?", 100,-1,array('val'=&gt; $val));<br></font></pre>
-<p><font color="#000000"> 
-</font></p><p><font color="#000000">Ron Wilson reports that SelectLimit does not work with UNIONs. 
-</font></p><p><font color="#000000"><b>CacheSelectLimit<a name="cacheselectlimit"></a>([$secs2cache,] $sql, $numrows=-1,$offset=-1,$inputarr=false)</b></font></p>
-<p><font color="#000000">Similar to SelectLimit, except that the recordset returned is cached for $secs2cache 
+</font></p><pre><font> $conn-&gt;SelectLimit("SELECT * FROM TABLE WHERE COND=?", 100,-1,array('val'=&gt; $val));<br></font></pre>
+<p><font> 
+</font></p><p><font>Ron Wilson reports that SelectLimit does not work with UNIONs. 
+</font></p><p><font><b>CacheSelectLimit<a name="cacheselectlimit"></a>([$secs2cache,] $sql, $numrows=-1,$offset=-1,$inputarr=false)</b></font></p>
+<p><font>Similar to SelectLimit, except that the recordset returned is cached for $secs2cache 
 	seconds in the $ADODB_CACHE_DIR directory. </font></p>
-<p><font color="#000000">Since 1.80, $secs2cache has been optional, and you can define the caching time 
+<p><font>Since 1.80, $secs2cache has been optional, and you can define the caching time 
 	in $connection-&gt;cacheSecs.</font></p>
  
-<pre><font color="#000000">	$conn-&gt;Connect(...);<br>   $conn-&gt;cacheSecs = 3600*24; // cache 24 hours<br>	$rs = $conn-&gt;CacheSelectLimit('select * from table',10);</font></pre>
-<font color="#000000"> 
-</font><p><font color="#000000"><b>CacheFlush<a name="cacheflush"></a>($sql=false,$inputarr=false)</b></font></p>
-<p><font color="#000000">Flush (delete) any cached recordsets for the SQL statement $sql in $ADODB_CACHE_DIR. 
-</font></p><p><font color="#000000">If no parameter is passed in, then all adodb_*.cache files are deleted. 
-</font></p><p><font color="#000000"> If you want to flush all cached recordsets manually, execute the following 
+<pre><font>	$conn-&gt;Connect(...);<br>   $conn-&gt;cacheSecs = 3600*24; // cache 24 hours<br>	$rs = $conn-&gt;CacheSelectLimit('select * from table',10);</font></pre>
+<font> 
+</font><p><font><b>CacheFlush<a name="cacheflush"></a>($sql=false,$inputarr=false)</b></font></p>
+<p><font>Flush (delete) any cached recordsets for the SQL statement $sql in $ADODB_CACHE_DIR. 
+</font></p><p><font>If no parameter is passed in, then all adodb_*.cache files are deleted. 
+</font></p><p><font> If you want to flush all cached recordsets manually, execute the following 
 	PHP code (works only under Unix): <br>
 	<code> &nbsp; system("rm -f `find ".$ADODB_CACHE_DIR." -name 
 	adodb_*.cache`");</code></font></p>
-<p><font color="#000000">For general cleanup of all expired files, you should use <a href="http://www.superscripts.com/tutorial/crontab.html">crontab</a> 
+<p><font>For general cleanup of all expired files, you should use <a href="http://www.superscripts.com/tutorial/crontab.html">crontab</a> 
 	on Unix, or at.exe on Windows, and a shell script similar to the following:<font face="Courier New, Courier, mono"><br>
 	#------------------------------------------------------ <br>
 	# This particular example deletes files in the TMPPATH <br>
@@ -1655,398 +1745,438 @@
 	AGED=7 <br>
 	find ${TMPPATH} -mtime +$AGED | grep "\.cache" | xargs rm -f <br>
 	</font> </font></p>
-<p><font color="#000000"><b>MetaError<a name="metaerror"></a>($errno=false)</b></font></p>
-<p><font color="#000000">Returns a virtualized error number, based on PEAR DB's error number system. You might
+<p><font><b>MetaError<a name="metaerror"></a>($errno=false)</b></font></p>
+<p><font>Returns a virtualized error number, based on PEAR DB's error number system. You might
 need to include adodb-error.inc.php before you call this function. The parameter $errno
 is the native error number you want to convert. If you do not pass any parameter, MetaError
 will call ErrorNo() for you and convert it. If the error number cannot be virtualized, MetaError 
 will return -1 (DB_ERROR).</font></p>
 
-<p><font color="#000000"><b>MetaErrorMsg<a name="metaerrormsg"></a>($errno)</b></font></p>
-<p><font color="#000000">Pass the error number returned by MetaError() for the equivalent textual error message.</font></p>
-<p><font color="#000000"><b>ErrorMsg<a name="errormsg"></a>()</b></font></p>
-<p><font color="#000000">Returns the last status or error message. The error message is reset after every 
+<p><font><b>MetaErrorMsg<a name="metaerrormsg"></a>($errno)</b></font></p>
+<p><font>Pass the error number returned by MetaError() for the equivalent textual error message.</font></p>
+<p><font><b>ErrorMsg<a name="errormsg"></a>()</b></font></p>
+<p><font>Returns the last status or error message. The error message is reset after every 
 call to Execute(). 
 </font></p><p>
-<font color="#000000">This can return a string even if 
+<font>This can return a string even if 
 	no error occurs. In general you do not need to call this function unless an 
 	ADOdb function returns false on an error. </font></p>
-<p><font color="#000000">Note: If <b>debug</b> is enabled, the SQL error message is always displayed 
+<p><font>Note: If <b>debug</b> is enabled, the SQL error message is always displayed 
 	when the <b>Execute</b> function is called.</font></p>
-<p><font color="#000000"><b>ErrorNo<a name="errorno"></a>()</b></font></p>
-<p><font color="#000000">Returns the last error number. The error number is reset after every call to Execute(). 
+<p><font><b>ErrorNo<a name="errorno"></a>()</b></font></p>
+<p><font>Returns the last error number. The error number is reset after every call to Execute(). 
 If 0 is returned, no error occurred.
 </font></p><p>
-<font color="#000000">Note that old versions of PHP (pre 4.0.6) do 
+<font>Note that old versions of PHP (pre 4.0.6) do 
 	not support error number for ODBC. In general you do not need to call this 
 	function unless an ADOdb function returns false on an error.</font></p>
 
-<p><font color="#000000"><b>SetFetchMode<a name="setfetchmode"></a>($mode)</b></font></p>
-<p><font color="#000000">Sets the current fetch mode for the connection and stores 
+<p><font><b>SetFetchMode<a name="setfetchmode"></a>($mode)</b></font></p>
+<p><font>Sets the current fetch mode for the connection and stores 
 	it in $db-&gt;fetchMode. Legal modes are ADODB_FETCH_ASSOC and ADODB_FETCH_NUM. 
 	For more info, see <a href="#adodb_fetch_mode">$ADODB_FETCH_MODE</a>.</font></p>
-<p><font color="#000000">Returns the previous fetch mode, which could be false 
+<p><font>Returns the previous fetch mode, which could be false 
 	if SetFetchMode( ) has not been called before.</font></p>
-<font color="#000000"> 
-</font><p><font color="#000000"><b>CreateSequence<a name="createseq"></a>($seqName = 'adodbseq',$startID=1)</b></font></p>
-<p><font color="#000000">Create a sequence. The next time GenID( ) is called, the value returned will 
+<font> 
+</font><p><font><b>CreateSequence<a name="createseq"></a>($seqName = 'adodbseq',$startID=1)</b></font></p>
+<p><font>Create a sequence. The next time GenID( ) is called, the value returned will 
 	be $startID. Added in 2.60. 
-</font></p><p><font color="#000000"><b>DropSequenceD<a name="dropseq"></a>($seqName = 'adodbseq')</b></font></p>
-<p><font color="#000000">Delete a sequence. Added in 2.60. 
-</font></p><p><font color="#000000"><b>GenID<a name="genid"></a>($seqName = 'adodbseq',$startID=1)</b></font></p>
-<p><font color="#000000">Generate a sequence number . Works for interbase, 
+</font></p><p><font><b>DropSequence<a name="dropseq"></a>($seqName = 'adodbseq')</b></font></p>
+<p><font>Delete a sequence. Added in 2.60. 
+</font></p><p><font><b>GenID<a name="genid"></a>($seqName = 'adodbseq',$startID=1)</b></font></p>
+<p><font>Generate a sequence number . Works for interbase, 
 	mysql, postgresql, oci8, oci8po, mssql, ODBC based (access,vfp,db2,etc) drivers 
 	currently. Uses $seqName as the name of the sequence. GenID() will automatically 
 	create the sequence for you if it does not exist (provided the userid has 
 	permission to do so). Otherwise you will have to create the sequence yourself. 
-</font></p><p><font color="#000000"> If your database driver emulates sequences, the name of the table is the sequence 
+</font></p><p><font> If your database driver emulates sequences, the name of the table is the sequence 
 	name. The table has one column, "id" which should be of type integer, or if 
 	you need something larger - numeric(16). 
-</font></p><p><font color="#000000"> For ODBC and databases that do not support sequences natively (eg mssql, mysql), 
+</font></p><p><font> For ODBC and databases that do not support sequences natively (eg mssql, mysql), 
 	we create a table for each sequence. If the sequence has not been defined 
 	earlier, it is created with the starting value set in $startID.</font></p>
-<p><font color="#000000">Note that the mssql driver's GenID() before 1.90 used to generate 16 byte GUID's.</font></p>
-<p><font color="#000000"><b>UpdateBlob<a name="updateblob"></a>($table,$column,$val,$where)</b></font></p>
-<font color="#000000">Allows you to store a blob (in $val) into $table into $column in a row at $where. 
-</font><p><font color="#000000"> Usage: 
-</font></p><p><font color="#000000"> 
-</font></p><pre><font color="#000000">	# for oracle<br>	$conn-&gt;Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, empty_blob())');<br>	$conn-&gt;UpdateBlob('blobtable','blobcol',$blobvalue,'id=1');<br>	<br>	# non oracle databases<br>	$conn-&gt;Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)');<br>	$conn-&gt;UpdateBlob('blobtable','blobcol',$blobvalue,'id=1');<br></font></pre>
-<p><font color="#000000"> Returns true if succesful, false otherwise. Supported by MySQL, PostgreSQL, 
+<p><font>Note that the mssql driver's GenID() before 1.90 used to generate 16 byte GUID's.</font></p>
+<p><font><b>UpdateBlob<a name="updateblob"></a>($table,$column,$val,$where)</b></font></p>
+<font>Allows you to store a blob (in $val) into $table into $column in a row at $where. 
+</font><p><font> Usage: 
+</font></p><p><font> 
+</font></p><pre><font>	# for oracle<br>	$conn-&gt;Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, empty_blob())');<br>	$conn-&gt;UpdateBlob('blobtable','blobcol',$blobvalue,'id=1');<br>	<br>	# non oracle databases<br>	$conn-&gt;Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)');<br>	$conn-&gt;UpdateBlob('blobtable','blobcol',$blobvalue,'id=1');<br></font></pre>
+<p><font> Returns true if succesful, false otherwise. Supported by MySQL, PostgreSQL, 
 	Oci8, Oci8po and Interbase drivers. Other drivers might work, depending on 
 	the state of development.</font></p>
-<p><font color="#000000">Note that when an Interbase blob is retrieved using SELECT, it still needs 
+<p><font>Note that when an Interbase blob is retrieved using SELECT, it still needs 
 	to be decoded using $connection-&gt;DecodeBlob($blob); to derive the original 
 	value in versions of PHP before 4.1.0. 
-</font></p><p><font color="#000000">For PostgreSQL, you can store your blob using blob oid's or as a bytea field. 
+</font></p><p><font>For PostgreSQL, you can store your blob using blob oid's or as a bytea field. 
 	You can use bytea fields but not blob oid's currently with UpdateBlob( ). 
 	Conversely UpdateBlobFile( ) supports oid's, but not bytea data.<br>
 	<br>
 	If you do not pass in an oid, then UpdateBlob() assumes that you are storing 
 	in bytea fields.
-</font></p><p><font color="#000000"><b>UpdateClob<a name="updateclob"></a>($table,$column,$val,$where)</b></font></p>
-<font color="#000000">Allows you to store a clob (in $val) into $table into $column in a row at $where. 
+	<p>If you do not have any blob fields, you can improve you can improve general SQL query performance by disabling blob handling with $connection->disableBlobs = true.
+</font></p><p><font><b>UpdateClob<a name="updateclob"></a>($table,$column,$val,$where)</b></font></p>
+<font>Allows you to store a clob (in $val) into $table into $column in a row at $where. 
 Similar to UpdateBlob (see above), but for Character Large OBjects. 
-</font><p><font color="#000000"> Usage:
-</font></p><pre><font color="#000000">	# for oracle<br>	$conn-&gt;Execute('INSERT INTO clobtable (id, clobcol) VALUES (1, empty_clob())');<br>	$conn-&gt;UpdateBlob('clobtable','clobcol',$clobvalue,'id=1');<br>	<br>	# non oracle databases<br>	$conn-&gt;Execute('INSERT INTO clobtable (id, clobcol) VALUES (1, null)');<br>	$conn-&gt;UpdateBlob('clobtable','clobcol',$clobvalue,'id=1');<br></font></pre>
-<p><font color="#000000"><b>UpdateBlobFile<a name="updateblobfile"></a>($table,$column,$path,$where,$blobtype='BLOB')</b></font></p>
-<p><font color="#000000">Similar to UpdateBlob, except that we pass in a file path to where the blob 
+</font><p><font> Usage:
+</font></p><pre><font>	# for oracle<br>	$conn-&gt;Execute('INSERT INTO clobtable (id, clobcol) VALUES (1, empty_clob())');<br>	$conn-&gt;UpdateBlob('clobtable','clobcol',$clobvalue,'id=1');<br>	<br>	# non oracle databases<br>	$conn-&gt;Execute('INSERT INTO clobtable (id, clobcol) VALUES (1, null)');<br>	$conn-&gt;UpdateBlob('clobtable','clobcol',$clobvalue,'id=1');<br></font></pre>
+<p><font><b>UpdateBlobFile<a name="updateblobfile"></a>($table,$column,$path,$where,$blobtype='BLOB')</b></font></p>
+<p><font>Similar to UpdateBlob, except that we pass in a file path to where the blob 
 	resides.
-</font></p><p><font color="#000000">For PostgreSQL, if you are using blob oid's, use this interface. This interface 
+</font></p><p><font>For PostgreSQL, if you are using blob oid's, use this interface. This interface 
 	does not support bytea fields.
-</font></p><p><font color="#000000">Returns true if successful, false otherwise. 
-</font></p><p><font color="#000000"><b>BlobEncode<a name="blobencode" id="blobencode"></a>($blob)</b> 
-</font></p><p><font color="#000000">Some databases require blob's to be encoded manually before upload. Note if 
+</font></p><p><font>Returns true if successful, false otherwise. 
+</font></p><p><font><b>BlobEncode<a name="blobencode" id="blobencode"></a>($blob)</b> 
+</font></p><p><font>Some databases require blob's to be encoded manually before upload. Note if 
 	you use UpdateBlob( ) or UpdateBlobFile( ) the conversion is done automatically 
 	for you and you do not have to call this function. For PostgreSQL, currently, 
 	BlobEncode() can only be used for bytea fields.
-</font></p><p><font color="#000000">Returns the encoded blob value.
-</font></p><p><font color="#000000">Note that there is a connection property called <em>blobEncodeType</em> which 
+</font></p><p><font>Returns the encoded blob value.
+</font></p><p><font>Note that there is a connection property called <em>blobEncodeType</em> which 
 	has 3 legal values: 
-</font></p><p><font color="#000000">false - no need to perform encoding or decoding.<br>
+</font></p><p><font>false - no need to perform encoding or decoding.<br>
 	'I' - blob encoding required, and returned encoded blob is a numeric value 
 	(no need to quote).<br>
 	'C' - blob encoding required, and returned encoded blob is a character value 
 	(requires quoting).
-</font></p><p><font color="#000000">This is purely for documentation purposes, so that programs that accept multiple 
+</font></p><p><font>This is purely for documentation purposes, so that programs that accept multiple 
 	database drivers know what is the right thing to do when processing blobs.
-</font></p><p><font color="#000000"><strong>BlobDecode<a name="blobdecode"></a>($blob, $maxblobsize = false)</strong> 
-</font></p><p><font color="#000000">Some databases require blob's to be decoded manually after doing a select statement. 
+</font></p><p><font><strong>BlobDecode<a name="blobdecode"></a>($blob, $maxblobsize = false)</strong> 
+</font></p><p><font>Some databases require blob's to be decoded manually after doing a select statement. 
 	If the database does not require decoding, then this function will return 
 	the blob unchanged. Currently BlobDecode is only required for one database, 
 	PostgreSQL, and only if you are using blob oid's (if you are using bytea fields, 
-	we auto-decode for you).</font> The default maxblobsize is set in $connection->maxblobsize, which 
-	is set to 256K in adodb 4.54. <p>
-	In ADOdb 4.54 and later, the blob is the return value. In earlier versions, the blob data is sent to stdout.</p><font color="#000000">
-</font></p><pre><font color="#000000">$rs = $db-&gt;Execute("select bloboid from postgres_table where id=$key");<br>$blob = $db-&gt;BlobDecode( reset($rs-&gt;fields) );</font></pre>
-<p><font color="#000000"><b>Replace<a name="replace"></a>($table, $arrFields, $keyCols,$autoQuote=false)</b></font></p>
-<p><font color="#000000">Try to update a record, and if the record is not found, an insert statement 
+	we auto-decode for you).</font> The default maxblobsize is set in $connection-&gt;maxblobsize, which 
+	is set to 256K in adodb 4.54. </p><p>
+	In ADOdb 4.54 and later, the blob is the return value. In earlier versions, the blob data is sent to stdout.</p><font>
+</font><p></p><pre><font>$rs = $db-&gt;Execute("select bloboid from postgres_table where id=$key");<br>$blob = $db-&gt;BlobDecode( reset($rs-&gt;fields) );</font></pre>
+<p><font><b>Replace<a name="replace"></a>($table, $arrFields, $keyCols,$autoQuote=false)</b></font></p>
+<p><font>Try to update a record, and if the record is not found, an insert statement 
 	is generated and executed. Returns 0 on failure, 1 if update statement worked, 
 	2 if no record was found and the insert was executed successfully. This differs 
 	from MySQL's replace which deletes the record and inserts a new record. This 
 	also means you cannot update the primary key. The only exception to this is 
 	Interbase and its derivitives, which uses delete and insert because of some 
 	Interbase API limitations. 
-</font></p><p><font color="#000000">The parameters are $table which is the table name, the $keyCols which is an 
-	associative array where the keys are the field names, and keyCols is the name 
+</font></p><p><font>The parameters are $table which is the table name, the $arrFields which is an 
+	associative array where the keys are the field names, and $keyCols is the name 
 	of the primary key, or an array of field names if it is a compound key. If 
 	$autoQuote is set to true, then Replace() will quote all values that are non-numeric; 
 	auto-quoting will not quote nulls. Note that auto-quoting will not work if 
 	you use SQL functions or operators. 
-</font></p><p><font color="#000000">Examples: 
-</font></p><pre><font color="#000000"># single field primary key<br>$ret = $db-&gt;Replace('atable', <br>	array('id'=&gt;1000,'firstname'=&gt;'Harun','lastname'=&gt;'Al-Rashid'),<br>	'id',$autoquote = true);	<br># generates UPDATE atable SET firstname='Harun',lastname='Al-Rashid' WHERE id=1000<br># or INSERT INTO atable (id,firstname,lastname) VALUES (1000,'Harun','Al-Rashid')<br><br># compound key<br>$ret = $db-&gt;Replace('atable2', <br>	array('firstname'=&gt;'Harun','lastname'=&gt;'Al-Rashid', 'age' =&gt; 33, 'birthday' =&gt; 'null'),<br>	array('lastname','firstname'),<br>	$autoquote = true);<br><br># no auto-quoting<br>$ret = $db-&gt;Replace('atable2', <br>	array('firstname'=&gt;"'Harun'",'lastname'=&gt;"'Al-Rashid'", 'age' =&gt; 'null'),<br>	array('lastname','firstname'));	<br></font></pre>
-<p><font color="#000000"><b>GetUpdateSQL<a name="getupdatesql"></a>(&amp;$rs, $arrFields, $forceUpdate=false,$magicq=false, $force=null)</b></font></p>
-<p><font color="#000000">Generate SQL to update a table given a recordset $rs, and the modified fields 
+</font></p><p><font>Examples: 
+</font></p><pre><font># single field primary key<br>$ret = $db-&gt;Replace('atable', <br>	array('id'=&gt;1000,'firstname'=&gt;'Harun','lastname'=&gt;'Al-Rashid'),<br>	'id',$autoquote = true);	<br># generates UPDATE atable SET firstname='Harun',lastname='Al-Rashid' WHERE id=1000<br># or INSERT INTO atable (id,firstname,lastname) VALUES (1000,'Harun','Al-Rashid')<br><br># compound key<br>$ret = $db-&gt;Replace('atable2', <br>	array('firstname'=&gt;'Harun','lastname'=&gt;'Al-Rashid', 'age' =&gt; 33, 'birthday' =&gt; 'null'),<br>	array('lastname','firstname'),<br>	$autoquote = true);<br><br># no auto-quoting<br>$ret = $db-&gt;Replace('atable2', <br>	array('firstname'=&gt;"'Harun'",'lastname'=&gt;"'Al-Rashid'", 'age' =&gt; 'null'),<br>	array('lastname','firstname'));	<br></font></pre>
+<p><font><b>AutoExecute<a name="autoexecute"></a>($table, $arrFields, $mode, $where=false, $forceUpdate=true,$magicq=false)</b></font></p>
+<p>Since ADOdb 4.56, you can automatically generate and execute INSERTs and UPDATEs on a given table with this
+function, which is a wrapper for GetInsertSQL() and GetUpdateSQL().
+<p>AutoExecute() inserts or updates $table given an array of $arrFields, where the keys are the field names and the array values are the 
+field values to store. Note that there is some overhead because the table is first queried to extract key information 
+before the SQL is generated. We generate an INSERT or UPDATE based on $mode (see below).
+<p>
+Legal values for $mode are 
+<ul>
+<li>'INSERT' or 1 or DB_AUTOQUERY_INSERT
+<li>'UPDATE' or 2 or DB_AUTOQUERY_UPDATE
+</ul>
+<p>You have to define the constants DB_AUTOQUERY_UPDATE and DB_AUTOQUERY_INSERT yourself or include adodb-pear.inc.php.
+<p>The $where clause is required if $mode == 'UPDATE'. If $forceUpdate=false then we will query the 
+database first and check if the field value returned by the query matches the current field value; only if they differ do we update that field.
+<p>Returns true on success, false on error.
+<p>An example of its use is:
+<pre>
+$record["firstName"] = "Carol";
+$record["lasTname"] = "Smith"; 
+$conn->AutoExecute($table,$record,'INSERT');
+# executes <i>"INSERT INTO $table (firstName,lasTname) values ('Carol',Smith')"</i>;
+
+$record["firstName"] = "Carol";
+$record["lasTname"] = "Jones"; 
+$conn->AutoExecute($table,$record,'UPDATE', "lastname like 'Sm%'");
+# executes <i>"UPDATE $table SET firstName='Carol',lasTname='Jones' WHERE lastname like 'Sm%'"</i>;
+</pre>
+<p>Note: One of the strengths of ADOdb's AutoExecute() is that only valid field names for $table are updated. If $arrFields
+contains keys that are invalid field names for $table, they are ignored. There is some overhead in doing this as we have to 
+query the database to get the field names, but given that you are not directly coding the SQL yourself, you probably aren't interested in
+speed at all, but convenience.
+<p>Since 4.62, the table name to be used can be overridden by setting $rs->tableName before AutoExecute(), GetInsertSQL() or GetUpdateSQL() is called.
+<p><font><b>GetUpdateSQL<a name="getupdatesql"></a>(&amp;$rs, $arrFields, $forceUpdate=false,$magicq=false, $force=null)</b></font></p>
+<p><font>Generate SQL to update a table given a recordset $rs, and the modified fields 
 	of the array $arrFields (which must be an associative array holding the column 
 	names and the new values) are compared with the current recordset. If $forceUpdate 
 	is true, then we also generate the SQL even if $arrFields is identical to 
 	$rs-&gt;fields. Requires the recordset to be associative. $magicq is used 
 	to indicate whether magic quotes are enabled (see qstr()). The field names in the array 
 	are case-insensitive.</font></p>
-<font color="#000000">	</font><p><font color="#000000">Since 4.52, we allow you to pass the $force type parameter, and this overrides the <a href="#ADODB_FORCE_TYPE">$ADODB_FORCE_TYPE</a>
+<font>	</font><p><font>Since 4.52, we allow you to pass the $force type parameter, and this overrides the <a href="#ADODB_FORCE_TYPE">$ADODB_FORCE_TYPE</a>
 	global variable.
-</font></p><p><font color="#000000"><b>GetInsertSQL<a name="getinsertsql"></a>(&amp;$rs, $arrFields,$magicq=false,$force=false)</b></font></p>
-<p><font color="#000000">Generate SQL to insert into a table given a recordset $rs. Requires the query 
+<p>Since 4.62, the table name to be used can be overridden by setting $rs->tableName before AutoExecute(), GetInsertSQL() or GetUpdateSQL() is called.
+</font></p><p><font><b>GetInsertSQL<a name="getinsertsql"></a>(&amp;$rs, $arrFields,$magicq=false,$force_type=false)</b></font></p>
+<p><font>Generate SQL to insert into a table given a recordset $rs. Requires the query 
 	to be associative. $magicq is used to indicate whether magic quotes are enabled 
 	(for qstr()). The field names in the array are case-insensitive.</font></p>
 <p>
-<font color="#000000">  Since 2.42, you can pass a  table name instead of a recordset into 
+<font>  Since 2.42, you can pass a  table name instead of a recordset into 
 GetInsertSQL (in $rs), and it will generate an insert statement for that table.
-</font></p><p><font color="#000000">Since 4.52, we allow you to pass the $force type parameter, and this overrides the <a href="#ADODB_FORCE_TYPE">$ADODB_FORCE_TYPE</a>
+</font></p><p><font>Since 4.52, we allow you to pass the $force_type parameter, and this overrides the <a href="#ADODB_FORCE_TYPE">$ADODB_FORCE_TYPE</a>
 	global variable.
-</font></p><p><font color="#000000"><b>PageExecute<a name="pageexecute"></a>($sql, $nrows, $page, $inputarr=false)</b> 
-</font></p><p><font color="#000000">Used for pagination of recordset. $page is 1-based. See <a href="#ex8">Example 
+<p>Since 4.62, the table name to be used can be overridden by setting $rs->tableName before AutoExecute(), GetInsertSQL() or GetUpdateSQL() is called.
+</font></p><p><font><b>PageExecute<a name="pageexecute"></a>($sql, $nrows, $page, $inputarr=false)</b> 
+</font></p><p><font>Used for pagination of recordset. $page is 1-based. See <a href="#ex8">Example 
   8</a>.</font></p>
  
-<p><font color="#000000"><b>CachePageExecute<a name="cachepageexecute"></a>($secs2cache, 
+<p><font><b>CachePageExecute<a name="cachepageexecute"></a>($secs2cache, 
   $sql, $nrows, $page, $inputarr=false)</b> </font></p>
-<p><font color="#000000">Used for pagination of recordset. $page is 1-based. See 
+<p><font>Used for pagination of recordset. $page is 1-based. See 
   <a href="#ex8">Example 8</a>. Caching version of PageExecute.</font></p>
-<font color="#000000"> 
+<font> 
 </font><p></p>
-<p><font color="#000000"><b>Close<a name="close"></a>( )</b></font></p>
-<p><font color="#000000">Close the database connection. PHP4 proudly states that we no longer have to 
+<p><font><b>Close<a name="close"></a>( )</b></font></p>
+<p><font>Close the database connection. PHP4 proudly states that we no longer have to 
   clean up at the end of the connection because the reference counting mechanism 
   of PHP4 will automatically clean up for us.</font></p>
-<font color="#000000">  </font><p><font color="#000000"><b>StartTrans<a name="starttrans"></a>( )</b></font></p>
-<font color="#000000">  </font><p><font color="#000000">Start a monitored transaction. As SQL statements are executed, ADOdb will monitor
+<font>  </font><p><font><b>StartTrans<a name="starttrans"></a>( )</b></font></p>
+<font>  </font><p><font>Start a monitored transaction. As SQL statements are executed, ADOdb will monitor
   for SQL errors, and if any are detected, when CompleteTrans() is called, we auto-rollback.
   </font></p><p>
-<font color="#000000">  </font></p><p><font color="#000000"> To understand why StartTrans() is superior to BeginTrans(), 
+<font>  </font></p><p><font> To understand why StartTrans() is superior to BeginTrans(), 
   let us examine a few ways of using BeginTrans().
   The following is the wrong way to use transactions: 
-</font></p><pre><font color="#000000">$DB-&gt;BeginTrans();<br>$DB-&gt;Execute("update table1 set val=$val1 where id=$id");<br>$DB-&gt;Execute("update table2 set val=$val2 where id=$id");<br>$DB-&gt;CommitTrans();<br></font></pre>
-<p><font color="#000000">because you perform no error checking. It is possible to update table1 and 
+</font></p><pre><font>$DB-&gt;BeginTrans();<br>$DB-&gt;Execute("update table1 set val=$val1 where id=$id");<br>$DB-&gt;Execute("update table2 set val=$val2 where id=$id");<br>$DB-&gt;CommitTrans();<br></font></pre>
+<p><font>because you perform no error checking. It is possible to update table1 and 
   for the update on table2 to fail. Here is a better way: 
-</font></p><pre><font color="#000000">$DB-&gt;BeginTrans();<br>$ok = $DB-&gt;Execute("update table1 set val=$val1 where id=$id");<br>if ($ok) $ok = $DB-&gt;Execute("update table2 set val=$val2 where id=$id");<br>if ($ok) $DB-&gt;CommitTrans();<br>else $DB-&gt;RollbackTrans();<br></font></pre>
-<p><font color="#000000">Another way is (since ADOdb 2.0): 
-</font></p><pre><font color="#000000">$DB-&gt;BeginTrans();<br>$ok = $DB-&gt;Execute("update table1 set val=$val1 where id=$id");<br>if ($ok) $ok = $DB-&gt;Execute("update table2 set val=$val2 where id=$id");<br>$DB-&gt;CommitTrans($ok);<br></font></pre>
-<p><font color="#000000"> Now it is a headache monitoring $ok all over the place. StartTrans() is an
+</font></p><pre><font>$DB-&gt;BeginTrans();<br>$ok = $DB-&gt;Execute("update table1 set val=$val1 where id=$id");<br>if ($ok) $ok = $DB-&gt;Execute("update table2 set val=$val2 where id=$id");<br>if ($ok) $DB-&gt;CommitTrans();<br>else $DB-&gt;RollbackTrans();<br></font></pre>
+<p><font>Another way is (since ADOdb 2.0): 
+</font></p><pre><font>$DB-&gt;BeginTrans();<br>$ok = $DB-&gt;Execute("update table1 set val=$val1 where id=$id");<br>if ($ok) $ok = $DB-&gt;Execute("update table2 set val=$val2 where id=$id");<br>$DB-&gt;CommitTrans($ok);<br></font></pre>
+<p><font> Now it is a headache monitoring $ok all over the place. StartTrans() is an
 improvement because it monitors all SQL errors for you. This is particularly
 useful if you are calling black-box functions in which SQL queries might be executed.
  Also all BeginTrans, CommitTrans and RollbackTrans calls inside a StartTrans block 
   will be disabled, so even if the black box function does a commit, it will be ignored.
-</font></p><pre><font color="#000000">$DB-&gt;StartTrans();<br>CallBlackBox();<br>$DB-&gt;Execute("update table1 set val=$val1 where id=$id");<br>$DB-&gt;Execute("update table2 set val=$val2 where id=$id");<br>$DB-&gt;CompleteTrans($ok);<br></font></pre>
-<p><font color="#000000">Note that a StartTrans blocks are nestable, the inner blocks are ignored.
- </font></p><p><font color="#000000"><b>CompleteTrans<a name="completetrans"></a>($autoComplete=true)</b></font></p>
-<font color="#000000">  </font><p><font color="#000000">Complete a transaction called with StartTrans(). This function monitors
+</font></p><pre><font>$DB-&gt;StartTrans();<br>CallBlackBox();<br>$DB-&gt;Execute("update table1 set val=$val1 where id=$id");<br>$DB-&gt;Execute("update table2 set val=$val2 where id=$id");<br>$DB-&gt;CompleteTrans($ok);<br></font></pre>
+<p><font>Note that a StartTrans blocks are nestable, the inner blocks are ignored.
+ </font></p><p><font><b>CompleteTrans<a name="completetrans"></a>($autoComplete=true)</b></font></p>
+<font>  </font><p><font>Complete a transaction called with StartTrans(). This function monitors
   for SQL errors, and will commit if no errors have occured, otherwise it will rollback. 
   Returns true on commit, false on rollback. If the parameter $autoComplete is true
   monitor sql errors and commit and rollback as appropriate. Set $autoComplete to false 
   to force rollback even if no SQL error detected.
-  </font></p><p><font color="#000000"><b>FailTrans<a name="failtrans"></a>( )</b></font></p>
-<font color="#000000">  </font><p><font color="#000000">Fail a transaction started with StartTrans(). The rollback will only occur when
+  </font></p><p><font><b>FailTrans<a name="failtrans"></a>( )</b></font></p>
+<font>  </font><p><font>Fail a transaction started with StartTrans(). The rollback will only occur when
   CompleteTrans() is called.
-    </font></p><p><font color="#000000"><b>HasFailedTrans<a name="hasfailedtrans"></a>( )</b></font></p>
-<font color="#000000">	</font><p><font color="#000000">Check whether smart transaction has failed, 
+    </font></p><p><font><b>HasFailedTrans<a name="hasfailedtrans"></a>( )</b></font></p>
+<font>	</font><p><font>Check whether smart transaction has failed, 
 	eg. returns true if there was an error in SQL execution or FailTrans() was called.
 	If not within smart transaction, returns false.
-</font></p><p><font color="#000000"><b>BeginTrans<a name="begintrans"></a>( )</b></font></p>
-<p><font color="#000000">Begin a transaction. Turns off autoCommit. Returns true if successful. Some 
+</font></p><p><font><b>BeginTrans<a name="begintrans"></a>( )</b></font></p>
+<p><font>Begin a transaction. Turns off autoCommit. Returns true if successful. Some 
   databases will always return false if transaction support is not available. 
    Any open transactions will be rolled back when the connection is closed. Among the
    databases that support transactions are Oracle, PostgreSQL, Interbase, MSSQL, certain
     versions of MySQL, DB2, Informix, Sybase, etc.</font></p>
-<font color="#000000"> </font><p><font color="#000000">Note that <a href="#starttrans">StartTrans()</a> and CompleteTrans() is a superior method of 
+<font> </font><p><font>Note that <a href="#starttrans">StartTrans()</a> and CompleteTrans() is a superior method of 
  handling transactions, available since ADOdb 3.40. For a explanation, see the <a href="#starttrans">StartTrans()</a> documentation.
 
-</font></p><p><font color="#000000">You can also use the ADOdb <a href="#errorhandling">error handler</a> to die 
+</font></p><p><font>You can also use the ADOdb <a href="#errorhandling">error handler</a> to die 
   and rollback your transactions for you transparently. Some buggy database extensions 
   are known to commit all outstanding tranasactions, so you might want to explicitly 
   do a $DB-&gt;RollbackTrans() in your error handler for safety. 
- </font></p><h4><font color="#000000">Detecting Transactions</font></h4>
-<font color="#000000"> </font><p><font color="#000000">Since ADOdb 2.50, you are able to detect when you are inside a transaction. Check
+ </font></p><h4><font>Detecting Transactions</font></h4>
+<font> </font><p><font>Since ADOdb 2.50, you are able to detect when you are inside a transaction. Check
  that $connection-&gt;transCnt &gt; 0. This variable is incremented whenever BeginTrans() is called,
  and decremented whenever RollbackTrans() or CommitTrans() is called.
-</font></p><p><font color="#000000"><b>CommitTrans<a name="committrans"></a>($ok=true)</b></font></p>
-<p><font color="#000000">End a transaction successfully. Returns true if successful. If the database 
+</font></p><p><font><b>CommitTrans<a name="committrans"></a>($ok=true)</b></font></p>
+<p><font>End a transaction successfully. Returns true if successful. If the database 
   does not support transactions, will return true also as data is always committed. 
 </font></p>
-<p><font color="#000000">If you pass the parameter $ok=false, the data is rolled back. See example in 
+<p><font>If you pass the parameter $ok=false, the data is rolled back. See example in 
   BeginTrans().</font></p>
-<p><font color="#000000"><b>RollbackTrans<a name="rollbacktrans"></a>( )</b></font></p>
-<p><font color="#000000">End a transaction, rollback all changes. Returns true if successful. If the 
+<p><font><b>RollbackTrans<a name="rollbacktrans"></a>( )</b></font></p>
+<p><font>End a transaction, rollback all changes. Returns true if successful. If the 
   database does not support transactions, will return false as data is never rollbacked. 
 </font></p>
-<font color="#000000"> 
-</font><p><font color="#000000"><b>GetAssoc<a name="getassoc1"></a>($sql,$inputarr=false,$force_array=false,$first2cols=false)</b></font></p>
-<p><font color="#000000">Returns an associative array for the given query $sql with optional bind parameters 
+<font> 
+</font><p><font><b>GetAssoc<a name="getassoc1"></a>($sql,$inputarr=false,$force_array=false,$first2cols=false)</b></font></p>
+<p><font>Returns an associative array for the given query $sql with optional bind parameters 
   in $inputarr. If the number of columns returned is greater to two, a 2-dimensional 
   array is returned, with the first column of the recordset becomes the keys 
   to the rest of the rows. If the columns is equal to two, a 1-dimensional array 
   is created, where the the keys directly map to the values (unless $force_array 
   is set to true, when an array is created for each value).
-</font></p><p><font color="#000000"> <font color="#000000">Examples:<a name="getassocex"></a></font></font></p>
+</font></p><p><font> Examples:<a name="getassocex"></a></font></p>
 
-<p><font color="#000000">We have the following data in a recordset:</font></p>
-<p><font color="#000000">row1: Apple, Fruit, Edible<br>
+<p><font>We have the following data in a recordset:</font></p>
+<p><font>row1: Apple, Fruit, Edible<br>
   row2: Cactus, Plant, Inedible<br>
   row3: Rose, Flower, Edible</font></p>
-<p><font color="#000000">GetAssoc will generate the following 2-dimensional associative 
+<p><font>GetAssoc will generate the following 2-dimensional associative 
   array:</font></p>
-<p><font color="#000000">Apple =&gt; array[Fruit, Edible]<br>
+<p><font>Apple =&gt; array[Fruit, Edible]<br>
   Cactus =&gt; array[Plant, Inedible]<br>
   Rose =&gt; array[Flower,Edible]</font></p>
-<p><font color="#000000">If the dataset is:</font></p>
-<p><font color="#000000"><font color="#000000"><font color="#000000">row1: Apple, 
-  Fruit<br>
-  row2: Cactus, Plant<br>
-  row3: Rose, Flower</font> </font></font></p>
-<p><font color="#000000"><font color="#000000">GetAssoc will generate the following 
-  1-dimensional associative array (with $force_array==false):</font></font></p>
-<p><font color="#000000">Apple =&gt; Fruit</font><br>
+<p><font>If the dataset is:</font></p>
+<p><font>row1: Apple, Fruit<br>
+row2: Cactus, Plant<br>
+row3: Rose, Flower </font></p>
+<p><font>GetAssoc will generate the following 1-dimensional associative
+  array (with $force_array==false):</font></p>
+<p><font>Apple =&gt; Fruit</font><br>
   Cactus=&gt;Plant<br>
-  Rose=&gt;Flower <font color="#000000"><font color="#000000"> </font></font><font color="#000000"><font color="#000000"></font></font></p>
-<p><font color="#000000">The function returns:</font></p>
-<p><font color="#000000">The associative array, or false if an error occurs.</font></p>
-<font color="#000000">
+  Rose=&gt;Flower </p>
+<p><font>The function returns:</font></p>
+<p><font>The associative array, or false if an error occurs.</font></p>
+<font>
 <p><b>CacheGetAssoc<a name="cachegetassoc"></a>([$secs2cache,] $sql,$inputarr=false,$force_array=false,$first2cols=false)</b></p>
-</font><font color="#000000"> 
-</font><p><font color="#000000">Caching version of <a href="#getassoc1">GetAssoc</a> function above.
-</font></p><p><font color="#000000"><b>GetOne<a name="getone"></a>($sql,$inputarr=false)</b></font></p>
-<p><font color="#000000">Executes the SQL and returns the first field of the first row. The recordset 
+</font>
+<p><font>Caching version of <a href="#getassoc1">GetAssoc</a> function above.
+</font></p><p><font><b>GetOne<a name="getone"></a>($sql,$inputarr=false)</b></font></p>
+<p><font>Executes the SQL and returns the first field of the first row. The recordset 
   and remaining rows are discarded for you automatically. If an error occur, false 
   is returned.</font></p>
-<p><font color="#000000"><b>GetRow<a name="getrow"></a>($sql,$inputarr=false)</b></font></p>
-<p><font color="#000000">Executes the SQL and returns the first row as an array. The recordset and remaining 
+<p><font><b>GetRow<a name="getrow"></a>($sql,$inputarr=false)</b></font></p>
+<p><font>Executes the SQL and returns the first row as an array. The recordset and remaining 
   rows are discarded for you automatically. If an error occurs, false is returned.</font></p>
-<p><font color="#000000"><b>GetAll<a name="getall"></a>($sql)</b></font></p>
+<p><font><b>GetAll<a name="getall"></a>($sql)</b></font></p>
 
-<p><font color="#000000">Executes the SQL and returns the all the rows as a 2-dimensional 
+<p><font>Executes the SQL and returns the all the rows as a 2-dimensional 
   array. The recordset is discarded for you automatically. If an error occurs, 
   false is returned.</font></p>
  <p><b>GetCol<a name="getcol"></a>($sql,$inputarr=false,$trim=false)</b></p>
 
-<p><font color="#000000">Executes the SQL and returns all elements of the first column as a 
+<p><font>Executes the SQL and returns all elements of the first column as a 
 1-dimensional array. The recordset is discarded for you automatically. If an error occurs, 
   false is returned.</font></p>
-<p><font color="#000000"><b>CacheGetOne<a name="cachegetone"></a>([$secs2cache,] 
+<p><font><b>CacheGetOne<a name="cachegetone"></a>([$secs2cache,] 
   $sql,$inputarr=false), CacheGetRow<a name="cachegetrow"></a>([$secs2cache,] $sql,$inputarr=false), CacheGetAll<a name="cachegetall"></a>([$secs2cache,] 
   $sql,$inputarr=false), CacheGetCol<a name="cachegetcol"></a>([$secs2cache,] 
   $sql,$inputarr=false,$trim=false)</b></font></p>
-<font color="#000000"> 
-<p>Similar to above Get* functions, except that the recordset is serialized and 
+<font> 
+</font><p><font>Similar to above Get* functions, except that the recordset is serialized and 
   cached in the $ADODB_CACHE_DIR directory for $secs2cache seconds. Good for speeding 
   up queries on rarely changing data. Note that the $secs2cache parameter is optional. 
   If omitted, we use the value in $connection-&gt;cacheSecs (default is 3600 seconds, 
-  or 1 hour).</p>
-<p><b>Prepare<a name="prepare"></a>($sql )</b></p>
-</font> 
-<p><font color="#000000">Prepares (compiles) an SQL query for repeated execution. Bind parameters
+  or 1 hour).</font></p>
+<p><font><b>Prepare<a name="prepare"></a>($sql )</b></font></p>
+ 
+<p><font>Prepares (compiles) an SQL query for repeated execution. Bind parameters
 are denoted by ?, except for the oci8 driver, which uses the traditional Oracle :varname
 convention. 
   </font></p>
-<p><font color="#000000">Returns an array containing the original sql statement 
+<p><font>Returns an array containing the original sql statement 
   in the first array element; the remaining elements of the array are driver dependent. 
   If there is an error, or we are emulating Prepare( ), we return the original 
   $sql string. This is because all error-handling has been centralized in Execute( 
   ).</font></p>
-<p><font color="#000000">Prepare( ) cannot be used with functions that use SQL 
+<p><font>Prepare( ) cannot be used with functions that use SQL 
   query rewriting techniques, e.g. PageExecute( ) and SelectLimit( ).</font></p>
 <p>Example:</p>
-<pre><font color="#000000">$stmt = $DB-&gt;Prepare('insert into table (col1,col2) values (?,?)');<br>for ($i=0; $i &lt; $max; $i++)<br></font>	$DB-&gt;<font color="#000000">Execute($stmt,array((string) rand(), $i));<br></font></pre>
-<font color="#000000"> 
-</font><p><font color="#000000">Also see InParameter(), OutParameter() and PrepareSP() below. Only supported internally by interbase, 
+<pre><font>$stmt = $DB-&gt;Prepare('insert into table (col1,col2) values (?,?)');<br>for ($i=0; $i &lt; $max; $i++)<br></font>	$DB-&gt;<font>Execute($stmt,array((string) rand(), $i));<br></font></pre>
+<font> 
+</font><p><font>Also see InParameter(), OutParameter() and PrepareSP() below. Only supported internally by interbase, 
   oci8 and selected ODBC-based drivers, otherwise it is emulated. There is no 
   performance advantage to using Prepare() with emulation. 
-</font></p><p><font color="#000000"> Important: Due to limitations or bugs in PHP, if you are getting errors when 
+</font></p><p><font> Important: Due to limitations or bugs in PHP, if you are getting errors when 
   you using prepared queries, try setting $ADODB_COUNTRECS = false before preparing. 
   This behaviour has been observed with ODBC. 
-</font></p><p><font color="#000000"><b>IfNull<a name="ifnull"></a>($field, $nullReplacementValue)</b></font></p>
-<p><font color="#000000">Portable IFNULL function (NVL in Oracle). Returns a string that represents 
+</font></p><p><font><b>IfNull<a name="ifnull"></a>($field, $nullReplacementValue)</b></font></p>
+<p><font>Portable IFNULL function (NVL in Oracle). Returns a string that represents 
   the function that checks whether a $field is null for the given database, and 
   if null, change the value returned to $nullReplacementValue. Eg.</font></p>
-<pre><font color="#000000">$sql = <font color="#993300">'SELECT '</font>.$db-&gt;IfNull('name', <font color="#993300">"'- unknown -'"</font>).<font color="#993300"> ' FROM table'</font>;</font></pre>
+<pre><font>$sql = <font color="#993300">'SELECT '</font>.$db-&gt;IfNull('name', <font color="#993300">"'- unknown -'"</font>).<font color="#993300"> ' FROM table'</font>;</font></pre>
 
-<p><font color="#000000"><b>length<a name="length"></a></b></font></p>
-<p><font color="#000000">This is not a function, but a property. Some databases have "length" and others "len"
+<p><font><b>length<a name="length"></a></b></font></p>
+<p><font>This is not a function, but a property. Some databases have "length" and others "len"
 as the function to measure the length of a string. To use this property:
-</font></p><pre><font color="#000000">  $sql = <font color="#993300">"SELECT "</font>.$db-&gt;length.<font color="#993300">"(field) from table"</font>;<br>  $rs = $db-&gt;Execute($sql);<br></font></pre>
+</font></p><pre><font>  $sql = <font color="#993300">"SELECT "</font>.$db-&gt;length.<font color="#993300">"(field) from table"</font>;<br>  $rs = $db-&gt;Execute($sql);<br></font></pre>
 
-<p><font color="#000000"><b>random<a name="random"></a></b></font></p>
-<p><font color="#000000">This is not a function, but a property. This is a string that holds the sql to
+<p><font><b>random<a name="random"></a></b></font></p>
+<p><font>This is not a function, but a property. This is a string that holds the sql to
 generate a random number between 0.0 and 1.0 inclusive.
 
-</font></p><p><font color="#000000"><b>substr<a name="substr"></a></b></font></p>
-<p><font color="#000000">This is not a function, but a property. Some databases have "substr" and others "substring"
+</font></p><p><font><b>substr<a name="substr"></a></b></font></p>
+<p><font>This is not a function, but a property. Some databases have "substr" and others "substring"
 as the function to retrieve a sub-string. To use this property:
-</font></p><pre><font color="#000000">  $sql = <font color="#993300">"SELECT "</font>.$db-&gt;substr.<font color="#993300">"(field, $offset, $length) from table"</font>;<br>  $rs = $db-&gt;Execute($sql);<br></font></pre>
-<p><font color="#000000">For all databases, the 1st parameter of <i>substr</i> is the field, the 2nd is the
+</font></p><pre><font>  $sql = <font color="#993300">"SELECT "</font>.$db-&gt;substr.<font color="#993300">"(field, $offset, $length) from table"</font>;<br>  $rs = $db-&gt;Execute($sql);<br></font></pre>
+<p><font>For all databases, the 1st parameter of <i>substr</i> is the field, the 2nd is the
 offset (1-based) to the beginning of the sub-string, and the 3rd is the length of the sub-string.
 
 
-</font></p><p><font color="#000000"><b>Param<a name="param"></a>($name)</b></font></p>
-<p><font color="#000000">Generates a bind placeholder portably. For most databases, the bind placeholder 
+</font></p><p><font><b>Param<a name="param"></a>($name)</b></font></p>
+<p><font>Generates a bind placeholder portably. For most databases, the bind placeholder 
   is "?". However some databases use named bind parameters such as Oracle, eg 
   ":somevar". This allows us to portably define an SQL statement with bind parameters: 
-</font></p><pre><font color="#000000"><font color="#000000">$sql = <font color="#993300">'insert into table (col1,col2) values ('</font>.$DB-&gt;Param('a').<font color="#993300">','</font>.$DB-&gt;Param('b').<font color="#993300">')'</font>;<br><font color="#006600"># generates 'insert into table (col1,col2) values (?,?)'<br># or        'insert into table (col1,col2) values (:a,:b)</font>'<br>$stmt = $DB-&gt;Prepare($sql);<br>$stmt = $DB-&gt;Execute($stmt,array('one','two'));<br></font></font></pre>
-<font color="#000000"><font color="#000000"> 
-</font></font><p></p>
-<p><font color="#000000"><font color="#000000"><b>PrepareSP</b><b><a name="preparesp"></a></b><b>($sql, $cursor=false )</b></font></font></p>
-<p><font color="#000000"><font color="#000000">When calling stored procedures in mssql and oci8 (oracle), and you might want 
-  to directly bind to parameters that return values, or for special LOB handling. 
-  PrepareSP() allows you to do so. 
-</font></font></p><p><font color="#000000"><font color="#000000">Returns the same array or $sql string as Prepare( ) above. If you do not need 
-  to bind to return values, you should use Prepare( ) instead.</font></font></p>
-<p><font color="#000000"><font color="#000000">The 2nd parameter, $cursor is not used except with oci8. Setting it to true will
-force OCINewCursor to be called; this is to support output REF CURSORs.
-</font></font></p><p><font color="#000000"><font color="#000000">For examples of usage of PrepareSP( ), see InParameter( ) below. 
-</font></font></p><p><font color="#000000"><font color="#000000">Note: in the mssql driver, preparing stored procedures requires a special function 
-  call, mssql_init( ), which is called by this function. PrepareSP( ) is available 
-  in all other drivers, and is emulated by calling Prepare( ). </font></font></p>
-<p><font color="#000000"><font color="#000000"><b> InParameter<a name="inparameter"></a>($stmt, $var, $name,
-  $maxLen = 4000, $type = false )</b></font></font></p>
-<font color="#000000"><font color="#000000">Binds a PHP variable as input to a stored procedure variable. The parameter <i>$stmt</i>
- is the value returned by PrepareSP(), <i>$var</i> is the PHP variable you want to bind, $name
- is the name of the stored procedure variable. Optional is <i>$maxLen</i>, the maximum length of the
- data to bind, and $type which is database dependant. 
- Consult <a href="http://php.net/mssql_bind">mssql_bind</a> and <a href="http://php.net/ocibindbyname">ocibindbyname</a> docs
-  at php.net for more info on legal values for $type. 
- </font></font><p>
-<font color="#000000"><font color="#000000">InParameter() is a wrapper function that calls Parameter() with $isOutput=false. 
-The advantage of this function is that it is self-documenting, because
-the $isOutput parameter is no longer needed.  Only for mssql 
-  and oci8 currently.
-  </font></font></p><p><font color="#000000"><font color="#000000">Here is an example using oci8:
-  </font></font></p><pre><font color="#000000"><font color="#000000"><font color="green"># For oracle, Prepare and PrepareSP are identical</font>
+</font></p><pre><font>$sql = <font color="#993300">'insert into table (col1,col2) values ('</font>.$DB-&gt;Param('a').<font color="#993300">','</font>.$DB-&gt;Param('b').<font color="#993300">')'</font>;<br><font color="#006600"># generates 'insert into table (col1,col2) values (?,?)'<br># or        'insert into table (col1,col2) values (:a,:b)</font>'<br>$stmt = $DB-&gt;Prepare($sql);<br>$stmt = $DB-&gt;Execute($stmt,array('one','two'));<br></font></pre>
+<font> </font>
+<p></p>
+<p><font><b>PrepareSP</b><b><a name="preparesp"></a></b><b>($sql,
+$cursor=false )</b></font></p>
+<p><font>When calling stored procedures in mssql and oci8 (oracle),
+    and you might want to directly bind to parameters that return values, or
+for special LOB handling. PrepareSP() allows you to do so. </font></p>
+<p><font>Returns the same array or $sql string as Prepare( )
+    above. If you do not need to bind to return values, you should use Prepare(
+  ) instead.</font></p>
+<p><font>The 2nd parameter, $cursor is not used except with oci8.
+    Setting it to true will force OCINewCursor to be called; this is to support
+output REF CURSORs. </font></p>
+<p><font>For examples of usage of PrepareSP( ), see InParameter(
+) below. </font></p>
+<p><font>Note: in the mssql driver, preparing stored procedures
+    requires a special function call, mssql_init( ), which is called by this
+    function. PrepareSP( ) is available in all other drivers, and is emulated
+  by calling Prepare( ). </font></p>
+<p><font><b> InParameter<a name="inparameter"></a>($stmt, $var,
+  $name, $maxLen = 4000, $type = false )</b></font></p>
+<font>Binds a PHP variable as input to a stored procedure variable.
+The parameter <i>$stmt</i> is the value returned by PrepareSP(), <i>$var</i> is
+the PHP variable you want to bind, $name is the name of the stored procedure
+variable. Optional is <i>$maxLen</i>, the maximum length of the data to bind,
+and $type which is database dependant. Consult <a href="http://php.net/mssql_bind">mssql_bind</a> and <a href="http://php.net/ocibindbyname">ocibindbyname</a> docs
+at php.net for more info on legal values for $type. </font>
+<p>
+<font>InParameter() is a wrapper function that calls Parameter()
+with $isOutput=false. The advantage of this function is that it is self-documenting,
+because the $isOutput parameter is no longer needed. Only for mssql and oci8
+currently. </font></p>
+<p><font>Here is an example using oci8: </font></p>
+<pre><font><font color="green"># For oracle, Prepare and PrepareSP are identical</font>
 $stmt = $db-&gt;PrepareSP(
-	<font color="#993300">"declare RETVAL integer; <br>	begin<br>	:RETVAL := </font><font color="#993300">SP_RUNSOMETHING</font><font color="#993300">(:myid,:group);<br>	end;"</font>);<br>$db-&gt;InParameter($stmt,$id,'myid');<br>$db-&gt;InParameter($stmt,$group,'group',64);<br>$db-&gt;OutParameter($stmt,$ret,'RETVAL');<br>$db-&gt;Execute($stmt);<br></font></font></pre>
-<p><font color="#000000"><font color="#000000"> The same example using mssql:</font></font></p>
-<font color="#000000"> 
-</font><pre><font color="#000000"><font color="#000000"><font color="green"># @RETVAL = SP_RUNSOMETHING @myid, at group</font>
+	<font color="#993300">"declare RETVAL integer; <br>	begin<br>	:RETVAL := </font><font color="#993300">SP_RUNSOMETHING</font><font color="#993300">(:myid,:group);<br>	end;"</font>);<br>$db-&gt;InParameter($stmt,$id,'myid');<br>$db-&gt;InParameter($stmt,$group,'group',64);<br>$db-&gt;OutParameter($stmt,$ret,'RETVAL');<br>$db-&gt;Execute($stmt);<br></font></pre>
+<p><font> The same example using mssql:</font></p>
+<font> 
+</font><pre><font><font color="green"># @RETVAL = SP_RUNSOMETHING @myid, at group</font>
 $stmt = $db-&gt;PrepareSP(<font color="#993333">'<font color="#993300">SP_RUNSOMETHING</font>'</font>); <br><font color="green"># note that the parameter name does not have @ in front!</font>
 $db-&gt;InParameter($stmt,$id,'myid');
 $db-&gt;InParameter($stmt,$group,'group',64);
-<font color="green"># return value in mssql - RETVAL is hard-coded name</font> <br>$db-&gt;OutParameter($stmt,$ret,'RETVAL');<br>$db-&gt;Execute($stmt); </font></font></pre>
+<font color="green"># return value in mssql - RETVAL is hard-coded name</font> <br>$db-&gt;OutParameter($stmt,$ret,'RETVAL');<br>$db-&gt;Execute($stmt); </font></pre>
 
-<p><font color="#000000">Note that the only difference between the oci8 and mssql implementations is $sql.</font></p>
-<font color="#000000">  </font><p>
-<font color="#000000"> If $type parameter is set to false, in mssql, $type will be dynamicly determined 
+<p><font>Note that the only difference between the oci8 and mssql implementations is $sql.</font></p>
+<p>
+<font> If $type parameter is set to false, in mssql, $type will be dynamicly determined 
 based on the type of the PHP variable passed <font face="Courier New, Courier, mono">(string 
 =&gt; SQLCHAR, boolean =&gt;SQLINT1, integer =&gt;SQLINT4 or float/double=&gt;SQLFLT8)</font>.
-</font></p><p><font color="#000000"> 
+</font></p><p><font> 
 In oci8, $type can be set to OCI_B_FILE (Binary-File), OCI_B_CFILE (Character-File), 
 OCI_B_CLOB (Character-LOB), OCI_B_BLOB (Binary-LOB) and OCI_B_ROWID (ROWID). To 
 pass in a null, use<font face="Courier New, Courier, mono"> $db-&gt;Parameter($stmt, 
 $null=null, 'param')</font>. 
-  </font></p><p><font color="#000000"><b> OutParameter<a name="outparameter"></a>($stmt, $var, $name, 
+  </font></p><p><font><b> OutParameter<a name="outparameter"></a>($stmt, $var, $name, 
   $maxLen = 4000, $type = false )</b></font></p>
-<font color="#000000">  Binds a PHP variable as output from a stored procedure variable. The parameter <i>$stmt</i>
+<font>  Binds a PHP variable as output from a stored procedure variable. The parameter <i>$stmt</i>
  is the value returned by PrepareSP(), <i>$var</i> is the PHP variable you want to bind, <i>$name</i>
  is the name of the stored procedure variable. Optional is <i>$maxLen</i>, the maximum length of the
  data to bind, and <i>$type</i> which is database dependant. 
-  </font><p>
-<font color="#000000">  OutParameter() is a wrapper function that calls Parameter() with $isOutput=true. 
+</font><p>
+<font>  OutParameter() is a wrapper function that calls Parameter() with $isOutput=true. 
   The advantage of this function is that it is self-documenting, because
 the $isOutput parameter is no longer needed.  Only for mssql 
   and oci8 currently.
 </font></p><p>
-<font color="#000000">For an example, see <a href="#inparameter">InParameter</a>.
+<font>For an example, see <a href="#inparameter">InParameter</a>.
 
-</font></p><p><font color="#000000"><b> Parameter<a name="parameter"></a>($stmt, $var, $name, $isOutput=false, 
+</font></p><p><font><b> Parameter<a name="parameter"></a>($stmt, $var, $name, $isOutput=false, 
   $maxLen = 4000, $type = false )</b></font></p>
-<p><font color="#000000">Note: This function is deprecated, because of the new InParameter() and OutParameter() functions.
+<p><font>Note: This function is deprecated, because of the new InParameter() and OutParameter() functions.
 These are superior because they are self-documenting, unlike Parameter().
-</font></p><p><font color="#000000">Adds a bind parameter suitable for return values or special data handling (eg. 
+</font></p><p><font>Adds a bind parameter suitable for return values or special data handling (eg. 
   LOBs) after a statement has been prepared using PrepareSP(). Only for mssql 
   and oci8 currently. The parameters are:<br>
   <br>
@@ -2059,16 +2189,16 @@
   [$<b>type</b>] Consult <a href="http://php.net/mssql_bind">mssql_bind</a> and 
   <a href="http://php.net/ocibindbyname">ocibindbyname</a> docs at php.net for 
   more info on legal values for type.</font></p>
-<p><font color="#000000">Lastly, in oci8, bind parameters can be reused without calling PrepareSP( ) 
+<p><font>Lastly, in oci8, bind parameters can be reused without calling PrepareSP( ) 
   or Parameters again. This is not possible with mssql. An oci8 example:</font></p>
-<pre><font color="#000000">$id = 0; $i = 0;<br>$stmt = $db-&gt;PrepareSP( <font color="#993300">"update table set val=:i where id=:id"</font>);<br>$db-&gt;Parameter($stmt,$id,'id');<br>$db-&gt;Parameter($stmt,$i, 'i');<br>for ($cnt=0; $cnt &lt; 1000; $cnt++) {<br>	$id = $cnt; <br>	$i = $cnt * $cnt; <font color="green"># works with oci8!</font>
+<pre><font>$id = 0; $i = 0;<br>$stmt = $db-&gt;PrepareSP( <font color="#993300">"update table set val=:i where id=:id"</font>);<br>$db-&gt;Parameter($stmt,$id,'id');<br>$db-&gt;Parameter($stmt,$i, 'i');<br>for ($cnt=0; $cnt &lt; 1000; $cnt++) {<br>	$id = $cnt; <br>	$i = $cnt * $cnt; <font color="green"># works with oci8!</font>
 	$db-&gt;Execute($stmt); <br>}</font></pre>
-<p><font color="#000000"><b>Bind<a name="bind"></a>($stmt, $var, $size=4001, $type=false, $name=false)</b></font></p>
+<p><font><b>Bind<a name="bind"></a>($stmt, $var, $size=4001, $type=false, $name=false)</b></font></p>
  
-<p><font color="#000000">This is a low-level function supported only by the oci8 
+<p><font>This is a low-level function supported only by the oci8 
   driver. <b>Avoid using</b> unless you only want to support Oracle. The Parameter( 
   ) function is the recommended way to go with bind variables.</font></p>
-<p><font color="#000000">Bind( ) allows you to use bind variables in your sql 
+<p><font>Bind( ) allows you to use bind variables in your sql 
   statement. This binds a PHP variable to a name defined in an Oracle sql statement 
   that was previously prepared using Prepare(). Oracle named variables begin with 
   a colon, and ADOdb requires the named variables be called :0, :1, :2, :3, etc. 
@@ -2080,7 +2210,7 @@
   OCI_B_CLOB (Character-LOB), OCI_B_BLOB (Binary-LOB) and OCI_B_ROWID (ROWID). 
   Lastly, instead of using the default :0, :1, etc names, you can define your 
   own bind-name using $name. 
-</p><p><font color="#000000">The following example shows 3 bind variables being used: 
+</p><p><font>The following example shows 3 bind variables being used: 
   p1, p2 and p3. These variables are bound to :0, :1 and :2.</font></p>
 <pre>$stmt = $DB-&gt;Prepare("insert into table (col0, col1, col2) values (:0, :1, :2)");<br>$DB-&gt;Bind($stmt, $p1);<br>$DB-&gt;Bind($stmt, $p2);<br>$DB-&gt;Bind($stmt, $p3);<br>for ($i = 0; $i &lt; $max; $i++) { <br>   $p1 = ?; $p2 = ?; $p3 = ?;<br>   $DB-&gt;Execute($stmt);<br>}</pre>
 <p>You can also use named variables:</p>
@@ -2141,7 +2271,7 @@
 create the table yourself). An example:
 </p><pre>	include('adodb.inc.php');<br>	include('adodb-perf.inc.php');<br>	adodb_perf::table('my_logsql_table');<br></pre>
 Also see <a href="docs-perf.htm">Performance Monitor</a>. 
-<p><font color="#000000"><b>fnExecute and fnCacheExecute properties<a name="fnexecute" id="fnexecute"></a></b></font></p>
+<p><font><b>fnExecute and fnCacheExecute properties<a name="fnexecute" id="fnexecute"></a></b></font></p>
 <p>These two properties allow you to define bottleneck functions for all sql statements 
   processed by ADOdb. This allows you to perform statistical analysis and query-rewriting 
   of your sql. 
@@ -2165,7 +2295,7 @@
 <p>The fnExecute function is called before the sql is parsed and executed, so 
   you can perform a query rewrite. If you are passing in a prepared statement, 
   then $sql is an array (see <a href="#prepare">Prepare</a>). The fnCacheExecute 
-  function is only called if the recordset returned was cached.<font color="#000000"> 
+  function is only called if the recordset returned was cached.<font> 
   The function parameters match the Execute and CacheExecute functions respectively, 
   except that $this (the connection object) is passed as the first parameter.</font></p>
 <p>Since ADOdb 3.91, the behaviour of fnExecute varies depending on whether the 
@@ -2175,524 +2305,629 @@
   of your own design. If this is the case, then have your function return a value. 
   If a value is returned, that value is returned immediately, without any further 
   processing. This is used internally by ADOdb to implement LogSQL() functionality. 
-</p><p> <font color="#000000"> 
-</font></p><hr>
-<h3><font color="#000000">ADOConnection Utility Functions</font></h3>
-<p><font color="#000000"><b>BlankRecordSet<a name="blankrecordset"></a>([$queryid])</b></font></p>
-<p><font color="#000000">No longer available - removed since 1.99.</font></p>
-<p><font color="#000000"><b>Concat<a name="concat"></a>($s1,$s2,....)</b></font></p>
-<p><font color="#000000">Generates the sql string used to concatenate $s1, $s2, etc together. Uses the 
+</p>
+<p>
+</p><hr>
+<h3><font>ADOConnection Utility Functions</font></h3>
+<p><font><b>BlankRecordSet<a name="blankrecordset"></a>([$queryid])</b></font></p>
+<p><font>No longer available - removed since 1.99.</font></p>
+<p><font><b>Concat<a name="concat"></a>($s1,$s2,....)</b></font></p>
+<p><font>Generates the sql string used to concatenate $s1, $s2, etc together. Uses the 
   string in the concat_operator field to generate the concatenation. Override 
   this function if a concatenation operator is not used, eg. MySQL.</font></p>
-<p><font color="#000000">Returns the concatenated string.</font></p>
-<p><font color="#000000"><b>DBDate<a name="dbdate"></a>($date)</b></font></p>
-<p><font color="#000000">Format the $<b>date</b> in the format the database accepts. This is used in 
+<p><font>Returns the concatenated string.</font></p>
+<p><font><b>DBDate<a name="dbdate"></a>($date)</b></font></p>
+<p><font>Format the $<b>date</b> in the format the database accepts. This is used in 
   INSERT/UPDATE statements; for SELECT statements, use <a href="#sqldate">SQLDate</a>. 
   The $<b>date</b> parameter can be a Unix integer timestamp or an ISO format 
   Y-m-d. Uses the fmtDate field, which holds the format to use. If null or false 
   or '' is passed in, it will be converted to an SQL null.</font></p>
-<p><font color="#000000">Returns the date as a quoted string.</font></p>
-<p><font color="#000000"><b>DBTimeStamp<a name="dbtimestamp"></a>($ts)</b></font></p>
-<p><font color="#000000">Format the timestamp $<b>ts</b> in the format the database accepts; this can 
+<p><font>Returns the date as a quoted string.</font></p>
+<p><font><b>DBTimeStamp<a name="dbtimestamp"></a>($ts)</b></font></p>
+<p><font>Format the timestamp $<b>ts</b> in the format the database accepts; this can 
   be a Unix integer timestamp or an ISO format Y-m-d H:i:s. Uses the fmtTimeStamp 
   field, which holds the format to use. If null or false or '' is passed in, it 
   will be converted to an SQL null.</font></p>
-<p><font color="#000000">Returns the timestamp as a quoted string.</font></p>
-<p><font color="#000000"><b>qstr<a name="qstr"></a>($s,[$magic_quotes_enabled</b>=false]<b>)</b></font></p>
-<p><font color="#000000">Quotes a string to be sent to the database. The $<b>magic_quotes_enabled</b> 
+<p><font>Returns the timestamp as a quoted string.</font></p>
+<p><font><b>qstr<a name="qstr"></a>($s,[$magic_quotes_enabled</b>=false]<b>)</b></font></p>
+<p><font>Quotes a string to be sent to the database. The $<b>magic_quotes_enabled</b> 
   parameter may look funny, but the idea is if you are quoting a string extracted 
   from a POST/GET variable, then pass get_magic_quotes_gpc() as the second parameter. 
   This will ensure that the variable is not quoted twice, once by <i>qstr</i> 
   and once by the <i>magic_quotes_gpc</i>.</font></p>
-<p><font color="#000000">Eg.<font face="Courier New, Courier, mono"> $s = $db-&gt;qstr(HTTP_GET_VARS['name'],get_magic_quotes_gpc());</font></font></p>
-<p><font color="#000000">Returns the quoted string.</font></p>
-<p><font color="#000000"><b>Quote<a name="quote"></a>($s)</b></font></p>
-<p><font color="#000000">Quotes the string $s, escaping the database specific quote character as appropriate. 
+<p><font>Eg.<font face="Courier New, Courier, mono"> $s = $db-&gt;qstr(HTTP_GET_VARS['name'],get_magic_quotes_gpc());</font></font></p>
+<p><font>Returns the quoted string.</font></p>
+<p><font><b>Quote<a name="quote"></a>($s)</b></font></p>
+<p><font>Quotes the string $s, escaping the database specific quote character as appropriate. 
   Formerly checked magic quotes setting, but this was disabled since 3.31 for 
   compatibility with PEAR DB. 
-</font></p><p><font color="#000000"><b>Affected_Rows<a name="affected_rows"></a>( )</b></font></p>
-<p><font color="#000000">Returns the number of rows affected by a update or delete statement. Returns 
+</font></p><p><font><b>Affected_Rows<a name="affected_rows"></a>( )</b></font></p>
+<p><font>Returns the number of rows affected by a update or delete statement. Returns 
   false if function not supported.</font></p>
-<p><font color="#000000">Not supported by interbase/firebird currently. </font></p>
-<p><font color="#000000"><b>Insert_ID<a name="inserted_id"></a>( )</b></font></p>
-<p><font color="#000000">Returns the last autonumbering ID inserted. Returns false if function not supported. 
+<p><font>Not supported by interbase/firebird currently. </font></p>
+<p><font><b>Insert_ID<a name="inserted_id"></a>( )</b></font></p>
+<p><font>Returns the last autonumbering ID inserted. Returns false if function not supported. 
 </font></p>
-<p><font color="#000000">Only supported by databases that support auto-increment or object id's, such 
+<p><font>Only supported by databases that support auto-increment or object id's, such 
   as PostgreSQL, MySQL and MS SQL Server currently. PostgreSQL returns the OID, which 
   can change on a database reload.</font></p>
-<p><font color="#000000"><b>RowLock<a name="rowlock"></a>($table,$where)</b></font></p>
-<p><font color="#000000">Lock a table row for the duration of a transaction. For example to lock record $id in table1:
-</font></p><pre><font color="#000000">	$DB-&gt;StartTrans();<br>	$DB-&gt;RowLock("table1","rowid=$id");<br>	$DB-&gt;Execute($sql1);<br>	$DB-&gt;Execute($sql2);<br>	$DB-&gt;CompleteTrans();<br></font></pre>
-<p><font color="#000000">Supported in db2, interbase, informix, mssql, oci8, postgres, sybase.
-</font></p><p><font color="#000000"><b>MetaDatabases<a name="metadatabases"></a>()</b></font></p>
-<p><font color="#000000">Returns a list of databases available on the server as an array. You have to 
+<p><font><b>RowLock<a name="rowlock"></a>($table,$where)</b></font></p>
+<p><font>Lock a table row for the duration of a transaction. For example to lock record $id in table1:
+</font></p><pre><font>	$DB-&gt;StartTrans();<br>	$DB-&gt;RowLock("table1","rowid=$id");<br>	$DB-&gt;Execute($sql1);<br>	$DB-&gt;Execute($sql2);<br>	$DB-&gt;CompleteTrans();<br></font></pre>
+<p><font>Supported in db2, interbase, informix, mssql, oci8, postgres, sybase.
+</font></p><p><font><b>MetaDatabases<a name="metadatabases"></a>()</b></font></p>
+<p><font>Returns a list of databases available on the server as an array. You have to 
   connect to the server first. Only available for ODBC, MySQL and ADO.</font></p>
-<p><font color="#000000"><b>MetaTables<a name="metatables"></a>($ttype = false, $showSchema = false, 
+<p><font><b>MetaTables<a name="metatables"></a>($ttype = false, $showSchema = false, 
   $mask=false)</b></font></p>
-<p><font color="#000000">Returns an array of tables and views for the current database as an array. 
+<p><font>Returns an array of tables and views for the current database as an array. 
   The array should exclude system catalog tables if possible. To only show tables, 
   use $db-&gt;MetaTables('TABLES'). To show only views, use $db-&gt;MetaTables('VIEWS'). 
   The $showSchema parameter currently works only for DB2, and when set to true, 
   will add the schema name to the table, eg. "SCHEMA.TABLE". </font></p>
-<p><font color="#000000">You can define a mask for matching. For example, setting $mask = 'TMP%' will 
+<p><font>You can define a mask for matching. For example, setting $mask = 'TMP%' will 
   match all tables that begin with 'TMP'. Currently only mssql, oci8, odbc_mssql 
   and postgres* support $mask. 
-</font></p><p><font color="#000000"><b>MetaColumns<a name="metacolumns"></a>($table,$toupper=true)</b></font></p>
-<p><font color="#000000">Returns an array of ADOFieldObject's, one field object for every column of 
+</font></p><p><font><b>MetaColumns<a name="metacolumns"></a>($table,$toupper=true)</b></font></p>
+<p><font>Returns an array of ADOFieldObject's, one field object for every column of 
   $table. A field object is a class instance with (name, type, max_length) defined.
   Currently Sybase does not recognise date types, and ADO cannot identify 
   the correct data type (so we default to varchar).   
- </font></p><p><font color="#000000"> The $toupper parameter determines whether we uppercase the table name 
+ </font></p><p><font> The $toupper parameter determines whether we uppercase the table name 
  (required for some databases).
- </font></p><p><font color="#000000">For schema support, pass in the $table parameter, "$schema.$tablename". This is only
+ </font></p><p><font>For schema support, pass in the $table parameter, "$schema.$tablename". This is only
  supported for selected databases.
-</font></p><p><font color="#000000"><b>MetaColumnNames<a name="metacolumnames"></a>($table,$numericIndex=false)</b></font></p>
-<p><font color="#000000">Returns an array of column names for $table. Since ADOdb 4.22, this is an associative array, with the
+</font></p><p><font><b>MetaColumnNames<a name="metacolumnames"></a>($table,$numericIndex=false)</b></font></p>
+<p><font>Returns an array of column names for $table. Since ADOdb 4.22, this is an associative array, with the
 keys in uppercase. Set $numericIndex=true if you want the old behaviour of numeric indexes (since 4.23).
 </font></p><p>
-<font color="#000000">e.g. array('FIELD1' =&gt; 'Field1', 'FIELD2'=&gt;'Field2')
+<font>e.g. array('FIELD1' =&gt; 'Field1', 'FIELD2'=&gt;'Field2')
 </font></p><p>
-</p><p><font color="#000000"><font color="#000000"><b>MetaPrimaryKeys<a name="metaprimarykeys"></a>($table, 
-  $owner=false)</b></font></font> 
-</p><p><font color="#000000">Returns an array containing column names that are the 
+</p><p><font><b>MetaPrimaryKeys<a name="metaprimarykeys"></a>($table,
+      $owner=false)</b></font> 
+</p>
+<p><font>Returns an array containing column names that are the 
   primary keys of $table. Supported by mysql, odbc (including db2, odbc_mssql, 
-  etc), mssql, postgres, interbase/firebird, oci8 currently. </font><font color="#000000"> 
-</font></p><p><font color="#000000">Views (and some tables) have primary keys, but sometimes this information is not available from the
+etc), mssql, postgres, interbase/firebird, oci8 currently. </font></p>
+<p><font>Views (and some tables) have primary keys, but sometimes this information is not available from the
 database. You can define a function  ADODB_View_PrimaryKeys($databaseType, $database, $view, $owner) that
 should return an array containing the fields that make up the primary key. If that function exists,
 it will be called when MetaPrimaryKeys() cannot find a primary key for a table or view.
-</font></p><pre><font color="#000000">// In this example: dbtype = 'oci8', $db = 'mydb', $view = 'dataView', $owner = false <br>function ADODB_View_PrimaryKeys($dbtype,$db,$view,$owner)<br>{<br>	switch(strtoupper($view)) {<br>	case 'DATAVIEW': return array('DATAID');<br>	default: return false;<br>	}<br>}<br><br>$db = NewADOConnection('oci8');<br>$db-&gt;Connect('localhost','root','','mydb'); <br>$db-&gt;MetaPrimaryKeys('dataView');<br></font></pre>
-<p><font color="#000000"><font color="#000000"><b>ServerInfo<a name="serverinfo" id="serverinfo"></a>($table)</b></font></font> 
-</p><p><font color="#000000">Returns an array of containing two elements 'description' 
+</font></p><pre><font>// In this example: dbtype = 'oci8', $db = 'mydb', $view = 'dataView', $owner = false <br>function ADODB_View_PrimaryKeys($dbtype,$db,$view,$owner)<br>{<br>	switch(strtoupper($view)) {<br>	case 'DATAVIEW': return array('DATAID');<br>	default: return false;<br>	}<br>}<br><br>$db = NewADOConnection('oci8');<br>$db-&gt;Connect('localhost','root','','mydb'); <br>$db-&gt;MetaPrimaryKeys('dataView');<br></font></pre>
+<p><font><b>ServerInfo<a name="serverinfo" id="serverinfo"></a>($table)</b></font> 
+</p>
+<p><font>Returns an array of containing two elements 'description' 
   and 'version'. The 'description' element contains the string description of 
   the database. The 'version' naturally holds the version number (which is also 
-  a string).</font><font color="#000000"> 
-</font></p><p><font color="#000000"><b>MetaForeignKeys<a name="metaforeignkeys"></a>($table, $owner=false, $upper=false)</b> 
-</font></p><p><font color="#000000">Returns an associate array of foreign keys, or false if not supported. For 
+a string).</font></p>
+<p><font><b>MetaForeignKeys<a name="metaforeignkeys"></a>($table, $owner=false, $upper=false)</b> 
+</font></p><p><font>Returns an associate array of foreign keys, or false if not supported. For 
   example, if table employee has a foreign key where employee.deptkey points to 
   dept_table.deptid, and employee.posn=posn_table.postionid and employee.poscategory=posn_table.category, 
   then $conn-&gt;MetaForeignKeys('employee') will return 
-</font></p><pre><font color="#000000">	array(<br>		'dept_table' =&gt; array('deptkey=deptid'),<br>		'posn_table' =&gt; array('posn=positionid','poscategory=category')<br>	)<br></font></pre>
-<p><font color="#000000">The optional schema or owner can be defined in $owner. If $upper is true, then 
+</font></p><pre><font>	array(<br>		'dept_table' =&gt; array('deptkey=deptid'),<br>		'posn_table' =&gt; array('posn=positionid','poscategory=category')<br>	)<br></font></pre>
+<p><font>The optional schema or owner can be defined in $owner. If $upper is true, then 
   the table names (array keys) are upper-cased. 
 </font></p><hr>
-<h2><font color="#000000">ADORecordSet<a name="adorecordset"></a></font></h2>
-<p><font color="#000000">When an SQL statement successfully is executed by <font face="Courier New, Courier, mono">ADOConnection-&gt;Execute($sql),</font>an 
+<h2><font>ADORecordSet<a name="adorecordset"></a></font></h2>
+<p><font>When an SQL statement successfully is executed by <font face="Courier New, Courier, mono">ADOConnection-&gt;Execute($sql),</font>an 
   ADORecordSet object is returned. This object contains a virtual cursor so we 
   can move from row to row, functions to obtain information about the columns 
   and column types, and helper functions to deal with formating the results to 
   show to the user.</font></p>
-<h3><font color="#000000">ADORecordSet Fields</font></h3>
-<p><font color="#000000"><b>fields: </b>Array containing the current row. This is not associative, but 
+<h3><font>ADORecordSet Fields</font></h3>
+<p><font><b>fields: </b>Array containing the current row. This is not associative, but 
   is an indexed array from 0 to columns-1. See also the function <b><a href="#fields">Fields</a></b>, 
   which behaves like an associative array.</font></p>
-<p><font color="#000000"><b>dataProvider</b>: The underlying mechanism used to connect to the database. 
+<p><font><b>dataProvider</b>: The underlying mechanism used to connect to the database. 
   Normally set to <b>native</b>, unless using <b>odbc</b> or <b>ado</b>.</font></p>
-<p><font color="#000000"><b>blobSize</b>: Maximum size of a char, string or varchar object before it 
+<p><font><b>blobSize</b>: Maximum size of a char, string or varchar object before it 
   is treated as a Blob (Blob's should be shown with textarea's). See the <a href="#metatype">MetaType</a> 
   function.</font></p>
-<p><font color="#000000"><b>sql</b>: Holds the sql statement used to generate this record set.</font></p>
-<p><font color="#000000"><b>canSeek</b>: Set to true if Move( ) function works.</font></p>
-<p><font color="#000000"><b>EOF</b>: True if we have scrolled the cursor past the last record.</font></p>
-<h3><font color="#000000">ADORecordSet Functions</font></h3>
-<p><font color="#000000"><b>ADORecordSet( )</b></font></p>
-<p><font color="#000000">Constructer. Normally you never call this function yourself.</font></p>
-<p><font color="#000000"><b>GetAssoc<a name="getassoc"></a>([$force_array])</b></font></p>
-<p><font color="#000000">Generates an associative array from the recordset. Note that is this function 
+<p><font><b>sql</b>: Holds the sql statement used to generate this record set.</font></p>
+<p><font><b>canSeek</b>: Set to true if Move( ) function works.</font></p>
+<p><font><b>EOF</b>: True if we have scrolled the cursor past the last record.</font></p>
+<h3><font>ADORecordSet Functions</font></h3>
+<p><font><b>ADORecordSet( )</b></font></p>
+<p><font>Constructer. Normally you never call this function yourself.</font></p>
+<p><font><b>GetAssoc<a name="getassoc"></a>([$force_array])</b></font></p>
+<p><font>Generates an associative array from the recordset. Note that is this function 
   is also <a href="#getassoc1">available</a> in the connection object. More details 
   can be found there.</font></p>
-<font color="#000000"><font color="#000000"> </font></font><font color="#000000"><font color="#000000">
-</font></font><p><font color="#000000"><font color="#000000"><b>GetArray<a name="getarray"></a>([$number_of_rows])</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Generate a 2-dimensional array of records from the current cursor position, 
-  indexed from 0 to $number_of_rows - 1. If $number_of_rows is undefined, till 
-  EOF.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>GetRows<a name="getrows"></a>([$number_of_rows])</b></font></font></p>
-<font color="#000000"><font color="#000000">Generate a 2-dimensional array of records from the current cursor position. Synonym 
-for GetArray() for compatibility with Microsoft ADO. 
-</font></font><p><font color="#000000"><font color="#000000"> <b>GetMenu<a name="getmenu"></a>($name, [$default_str=''], [$blank1stItem=true], 
-  [$multiple_select=false], [$size=0], [$moreAttr=''])</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Generate a HTML menu (&lt;select&gt;&lt;option&gt;&lt;option&gt;&lt;/select&gt;). 
-  The first column of the recordset (fields[0]) will hold the string to display 
-  in the option tags. If the recordset has more than 1 column, the second column 
-  (fields[1]) is the value to send back to the web server.. The menu will be given 
-  the name $<i>name</i>. 
-</font></font></p><p><font color="#000000"><font color="#000000"> If $<i>default_str</i> is defined, then if $<i>default_str</i> == fields[0], 
-  that field is selected. If $<i>blank1stItem</i> is true, the first option is 
-  empty. You can also set the first option strings by setting $blank1stItem = 
-  "$value:$text".</font></font></p>
-<p><font color="#000000"><font color="#000000">$<i>Default_str</i> can be array for a multiple select listbox.</font></font></p>
-<p><font color="#000000"><font color="#000000">To get a listbox, set the $<i>size</i> to a non-zero value (or pass $default_str 
-  as an array). If $<i>multiple_select</i> is true then a listbox will be generated 
-  with $<i>size</i> items (or if $size==0, then 5 items) visible, and we will 
-  return an array to a server. Lastly use $<i>moreAttr </i> to add additional 
-  attributes such as javascript or styles. </font></font></p>
-<p><font color="#000000"><font color="#000000">Menu Example 1: <code>GetMenu('menu1','A',true)</code> will generate a menu: 
-  <select name="menu1"><option> 
-    </option><option value="1" selected="selected">A 
-    </option><option value="2">B 
-    </option><option value="3">C 
-  </option></select>
-  for the data (A,1), (B,2), (C,3). Also see <a href="#ex5">example 5</a>.</font></font></p>
-<p><font color="#000000"><font color="#000000">Menu Example 2: For the same data, <code>GetMenu('menu1',array('A','B'),false)</code> 
-  will generate a menu with both A and B selected: <br>
-  <select name="menu1" multiple="multiple" size="3"><option value="1" selected="selected">A 
-    </option><option value="2" selected="selected">B 
-    </option><option value="3">C 
-  </option></select>
-</font></font></p><p><font color="#000000"><font color="#000000"> <b>GetMenu2<a name="getmenu2"></a>($name, [$default_str=''], [$blank1stItem=true], 
-  [$multiple_select=false], [$size=0], [$moreAttr=''])</b></font></font></p>
-<p><font color="#000000"><font color="#000000">This is nearly identical to GetMenu, except that the $<i>default_str</i> is 
-  matched to fields[1] (the option values).</font></font></p>
-<p><font color="#000000"><font color="#000000">Menu Example 3: Given the data in menu example 2, <code>GetMenu2('menu1',array('1','2'),false)</code> 
-  will generate a menu with both A and B selected in menu example 2, but this 
-  time the selection is based on the 2nd column, which holds the values to return 
-  to the Web server. 
-</font></font></p><p><font color="#000000"><font color="#000000"><b>UserDate<a name="userdate"></a>($str, [$fmt])</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Converts the date string $<i>str</i> to another format. The date format is Y-m-d,
-or Unix timestamp format. The default $<i>fmt</i> is Y-m-d.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>UserTimeStamp<a name="usertimestamp"></a>($str, [$fmt])</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Converts the timestamp string $<b>str</b> to another format. The timestamp 
-  format is Y-m-d H:i:s, as in '2002-02-28 23:00:12', or Unix timestamp format.
-   UserTimeStamp calls UnixTimeStamp to parse $<i>str</i>, and $<i>fmt</i> defaults to Y-m-d H:i:s if not defined. 
-</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>UnixDate<a name="unixdate"></a>($str)</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Parses the date string $<b>str</b> and returns it in unix mktime format (eg. 
-  a number indicating the seconds after January 1st, 1970). Expects the date to 
-  be in Y-m-d H:i:s format, except for Sybase and Microsoft SQL Server, where 
-  M d Y is also accepted (the 3 letter month strings are controlled by a global 
-  array, which might need localisation).</font></font></p>
-<p><font color="#000000"><font color="#000000">This function is available in both ADORecordSet and ADOConnection since 1.91.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>UnixTimeStamp<a name="unixtimestamp"></a>($str)</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Parses the timestamp string $<b>str</b>
-and returns it in unix mktime format (eg. a number indicating the
-seconds after January 1st, 1970). Expects the date to be in "Y-m-d,
-H:i:s" (1970-12-24, 00:00:00) or "Y-m-d H:i:s" (1970-12-24 00:00:00) or
-"YmdHis" (19701225000000) format, except for Sybase and Microsoft SQL
-Server, where "M d Y h:i:sA" (Dec 25 1970 00:00:00AM) is also accepted
-(the 3 letter month strings are controlled by a global array, which
-might need localisation).</font></font></p>
-<font color="#000000"> 
-</font><p><font color="#000000"><font color="#000000">This function is available in both ADORecordSet and ADOConnection 
-  since 1.91. </font></font></p>
-<p><font color="#000000"><font color="#000000"><b>OffsetDate<a name="offsetdate"></a>($dayFraction, 
-  $basedate=false)</b></font></font></p>
-<p><font color="#000000"><font color="#000000"><font color="#000000">Returns a string </font>with the 
-  native SQL functions to calculate future and past dates based on $basedate in 
-  a portable fashion. If $basedate is not defined, then the current date (at 12 
-  midnight) is used. Returns the SQL string that performs the calculation when 
-  passed to Execute(). </font></font></p>
-<p><font color="#000000"><font color="#000000">For example, in Oracle, to find the date and time that 
-  is 2.5 days from today, you can use:</font></font></p>
-<pre><font color="#000000"><font color="#000000"># get date one week from now<br>$fld = $conn-&gt;OffsetDate(7); // returns "(trunc(sysdate)+7")</font></font></pre>
-<pre><font color="#000000"><font color="#000000"># get date and time that is 60 hours from current date and time<br>$fld = $conn-&gt;OffsetDate(2.5, $conn-&gt;sysTimeStamp);	// returns "(sysdate+2.5)"</font>
-
-$conn-&gt;Execute("UPDATE TABLE SET dodate=$fld WHERE ID=$id");</font></pre>
-<p><font color="#000000"> This function is available for mysql, mssql, oracle, oci8 and postgresql drivers 
-  since 2.13. It might work with other drivers<font color="#000000"> provided 
-  they allow performing numeric day arithmetic on dates.</font></font></p>
-<font color="#000000"><font color="#000000"> 
-</font></font><p><font color="#000000"><font color="#000000"><font color="#000000"><b>SQLDate<a name="sqldate"></a>($dateFormat, $basedate=false)</b></font></font></font></p>
-<font color="#000000"><font color="#000000">Returns a string which contains the native SQL functions to format a date or date 
-column $basedate. This is used in SELECT statements. For INSERT/UPDATE statements, 
-use <a href="#dbdate">DBDate</a>. It uses a case-sensitive $dateFormat, which 
-supports: 
-</font></font><pre><font color="#000000"><font color="#000000"> Y: 4-digit Year<br> Q: Quarter (1-4)<br> M: Month (Jan-Dec)<br> m: Month (01-12)<br> d: Day (01-31)<br> H: Hour (00-23)<br> h: Hour (1-12)<br> i: Minute (00-59)<br> s: Second (00-60)<br> A: AM/PM indicator</font></font></pre>
-<p><font color="#000000"><font color="#000000">All other characters are treated as strings. You can also use \ to escape characters. 
-  Available on selected databases, including mysql, postgresql, mssql, oci8 and 
-  DB2. 
-</font></font></p><p><font color="#000000"><font color="#000000">This is useful in writing portable sql statements that GROUP BY on dates. For 
-  example to display total cost of goods sold broken by quarter (dates are stored 
-  in a field called postdate): 
-</font></font></p><pre><font color="#000000"><font color="#000000"> $sqlfn = $db-&gt;SQLDate('Y-\QQ','postdate'); # get sql that formats postdate to output 2002-Q1<br> $sql = "SELECT $sqlfn,SUM(cogs) FROM table GROUP BY $sqlfn ORDER BY 1 desc";<br> </font></font></pre>
-<p><font color="#000000"><font color="#000000"><b>MoveNext<a name="movenext"></a>( )</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Move the internal cursor to the next row. The <i>$this-&gt;fields</i> array is 
-  automatically updated. Returns false if unable to do so (normally because EOF 
-  has been reached), otherwise true. 
-</font></font></p><p><font color="#000000"><font color="#000000"> If EOF is reached, then the $this-&gt;fields array is set to false (this was 
-  only implemented consistently in ADOdb 3.30). For the pre-3.30 behaviour of 
-  $this-&gt;fields (at EOF), set the global variable $ADODB_COMPAT_FETCH = true.</font></font></p>
-<p><font color="#000000"><font color="#000000">Example:</font></font></p>
-<pre><font color="#000000"><font color="#000000">$rs = $db-&gt;Execute($sql);<br>if ($rs) <br>	while (!$rs-&gt;EOF) {<br> 		ProcessArray($rs-&gt;fields);	<br>		$rs-&gt;MoveNext();<br>	} </font></font></pre>
-<p><font color="#000000"><font color="#000000"><b>Move<a name="move"></a>($to)</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Moves the internal cursor to a specific row $<b>to</b>. Rows are zero-based 
-  eg. 0 is the first row. The <b>fields</b> array is automatically updated. For 
-  databases that do not support scrolling internally, ADOdb will simulate forward 
-  scrolling. Some databases do not support backward scrolling. If the $<b>to</b> 
-  position is after the EOF, $<b>to</b> will move to the end of the RecordSet 
-  for most databases. Some obscure databases using odbc might not behave this 
-  way.</font></font></p>
-<p><font color="#000000"><font color="#000000">Note: This function uses <i>absolute positioning</i>, unlike Microsoft's ADO.</font></font></p>
-<p><font color="#000000"><font color="#000000">Returns true or false. If false, the internal cursor is not moved in most implementations, 
-  so AbsolutePosition( ) will return the last cursor position before the Move( 
-  ). </font></font></p>
-<p><font color="#000000"><font color="#000000"><b>MoveFirst<a name="movefirst"></a>()</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Internally calls Move(0). Note that some databases do not support this function.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>MoveLast<a name="movelast"></a>()</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Internally calls Move(RecordCount()-1). Note that some databases do not support 
-  this function.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>GetRowAssoc</b><a name="getrowassoc"></a>($toUpper=true)</font></font></p>
-<p><font color="#000000"><font color="#000000">Returns an associative array containing the current row. The keys to the array 
-  are the column names. The column names are upper-cased for easy access. To get 
-  the next row, you will still need to call MoveNext(). </font></font></p>
-<p><font color="#000000"><font color="#000000">For example:<br>
-  Array ( [ID] =&gt; 1 [FIRSTNAME] =&gt; Caroline [LASTNAME] =&gt; Miranda [CREATED] =&gt; 
-  2001-07-05 ) </font></font></p>
-<p><font color="#000000"><font color="#000000">Note: do not use GetRowAssoc() with $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC. 
-  Because they have the same functionality, they will interfere with each other.</font></font></p>
-<font color="#000000"> 
-</font><p><font color="#000000"><font color="#000000"><b>AbsolutePage<a name="absolutepage"></a>($page=-1) 
-  </b></font></font></p>
-<p><font color="#000000">Returns the current page. Requires PageExecute()/CachePageExecute() to be called. 
+<font> </font>
+<p><font><b>GetArray<a name="getarray"></a>([$number_of_rows])</b></font></p>
+<p><font>Generate a 2-dimensional array of records from the current
+    cursor position, indexed from 0 to $number_of_rows - 1. If $number_of_rows
+  is undefined, till EOF.</font></p>
+<p><font><b>GetRows<a name="getrows"></a>([$number_of_rows])</b></font></p>
+<font>Generate a 2-dimensional array of records from the current
+cursor position. Synonym for GetArray() for compatibility with Microsoft ADO. </font>
+<p><font> <b>GetMenu<a name="getmenu"></a>($name, [$default_str=''],
+  [$blank1stItem=true], [$multiple_select=false], [$size=0], [$moreAttr=''])</b></font></p>
+<p><font>Generate a HTML menu (&lt;select&gt;&lt;option&gt;&lt;option&gt;&lt;/select&gt;).
+    The first column of the recordset (fields[0]) will hold the string to display
+    in the option tags. If the recordset has more than 1 column, the second column
+    (fields[1]) is the value to send back to the web server.. The menu will be
+given the name $<i>name</i>. </font></p>
+<p><font> If $<i>default_str</i> is defined, then if $<i>default_str</i> ==
+    fields[0], that field is selected. If $<i>blank1stItem</i> is true, the first
+    option is empty. You can also set the first option strings by setting $blank1stItem
+  = "$value:$text".</font></p>
+<p><font>$<i>Default_str</i> can be array for a multiple select
+listbox.</font></p>
+<p><font>To get a listbox, set the $<i>size</i> to a non-zero
+    value (or pass $default_str as an array). If $<i>multiple_select</i> is true
+    then a listbox will be generated with $<i>size</i> items (or if $size==0,
+    then 5 items) visible, and we will return an array to a server. Lastly use
+  $<i>moreAttr </i> to add additional attributes such as javascript or styles. </font></p>
+<p><font>Menu Example 1: <code>GetMenu('menu1','A',true)</code> will
+    generate a menu:
+    <select name="menu1"><option> </option><option value="1" selected="selected">A </option><option value="2">B </option><option value="3">C </option></select>
+for the data (A,1), (B,2), (C,3). Also see <a href="#ex5">example 5</a>.</font></p>
+<p><font>Menu Example 2: For the same data, <code>GetMenu('menu1',array('A','B'),false)</code> will
+    generate a menu with both A and B selected: <br>
+    <select name="menu1" multiple="multiple" size="3"><option value="1" selected="selected">A </option><option value="2" selected="selected">B </option><option value="3">C </option></select>
+</font></p>
+<p><font> <b>GetMenu2<a name="getmenu2"></a>($name, [$default_str=''],
+  [$blank1stItem=true], [$multiple_select=false], [$size=0], [$moreAttr=''])</b></font></p>
+<p><font>This is nearly identical to GetMenu, except that the
+  $<i>default_str</i> is matched to fields[1] (the option values).</font></p>
+<p><font>Menu Example 3: Given the data in menu example 2, <code>GetMenu2('menu1',array('1','2'),false)</code> will
+    generate a menu with both A and B selected in menu example 2, but this time
+    the selection is based on the 2nd column, which holds the values to return
+to the Web server. </font></p>
+<p><font><b>UserDate<a name="userdate"></a>($str, [$fmt])</b></font></p>
+<p><font>Converts the date string $<i>str</i> to another format.
+    The date format is Y-m-d, or Unix timestamp format. The default $<i>fmt</i> is
+Y-m-d.</font></p>
+<p><font><b>UserTimeStamp<a name="usertimestamp"></a>($str, [$fmt])</b></font></p>
+<p><font>Converts the timestamp string $<b>str</b> to another
+    format. The timestamp format is Y-m-d H:i:s, as in '2002-02-28 23:00:12',
+    or Unix timestamp format. UserTimeStamp calls UnixTimeStamp to parse $<i>str</i>,
+and $<i>fmt</i> defaults to Y-m-d H:i:s if not defined. </font></p>
+<p><font><b>UnixDate<a name="unixdate"></a>($str)</b></font></p>
+<p><font>Parses the date string $<b>str</b> and returns it in
+    unix mktime format (eg. a number indicating the seconds after January 1st,
+    1970). Expects the date to be in Y-m-d H:i:s format, except for Sybase and
+    Microsoft SQL Server, where M d Y is also accepted (the 3 letter month strings
+  are controlled by a global array, which might need localisation).</font></p>
+<p><font>This function is available in both ADORecordSet and
+ADOConnection since 1.91.</font></p>
+<p><font><b>UnixTimeStamp<a name="unixtimestamp"></a>($str)</b></font></p>
+<p><font>Parses the timestamp string $<b>str</b> and returns
+    it in unix mktime format (eg. a number indicating the seconds after January
+    1st, 1970). Expects the date to be in "Y-m-d, H:i:s" (1970-12-24, 00:00:00)
+    or "Y-m-d H:i:s" (1970-12-24 00:00:00) or "YmdHis" (19701225000000) format,
+    except for Sybase and Microsoft SQL Server, where "M d Y h:i:sA" (Dec 25
+    1970 00:00:00AM) is also accepted (the 3 letter month strings are controlled
+by a global array, which might need localisation).</font></p>
+<font> 
+</font><p><font>This function is available in both ADORecordSet
+    and ADOConnection since 1.91. </font></p>
+<p><font><b>OffsetDate<a name="offsetdate"></a>($dayFraction,
+  $basedate=false)</b></font></p>
+<p><font>Returns a string with the native SQL functions to calculate
+    future and past dates based on $basedate in a portable fashion. If $basedate
+    is not defined, then the current date (at 12 midnight) is used. Returns the
+  SQL string that performs the calculation when passed to Execute(). </font></p>
+<p><font>For example, in Oracle, to find the date and time that
+  is 2.5 days from today, you can use:</font></p>
+<pre><font># get date one week from now<br>$fld = $conn-&gt;OffsetDate(7); // returns "(trunc(sysdate)+7")</font></pre>
+<pre><font># get date and time that is 60 hours from current date and time<br>$fld = $conn-&gt;OffsetDate(2.5, $conn-&gt;sysTimeStamp);	// returns "(sysdate+2.5)"<br><br>$conn-&gt;Execute("UPDATE TABLE SET dodate=$fld WHERE ID=$id");</font></pre>
+<p><font> This function is available for mysql, mssql, oracle, oci8 and postgresql drivers 
+  since 2.13. It might work with other drivers provided they allow performing
+  numeric day arithmetic on dates.</font></p>
+<font> </font>
+<p><font><b>SQLDate<a name="sqldate"></a>($dateFormat, $basedate=false)</b></font></p>
+<font>Returns a string which contains the native SQL functions
+to format a date or date column $basedate. This is used in SELECT statements.
+For INSERT/UPDATE statements, use <a href="#dbdate">DBDate</a>. It uses a case-sensitive
+$dateFormat, which supports: </font>
+<pre><font> 
+  Y: 4-digit Year
+  Q: Quarter (1-4)
+  M: Month (Jan-Dec)
+  m: Month (01-12)
+  d: Day (01-31)
+  H: Hour (00-23)
+  h: Hour (1-12)
+  i: Minute (00-59)
+  s: Second (00-60)
+  A: AM/PM indicator
+  w: day of week (0-6 or 1-7 depending on DB)
+  l: day of week (as string - lowercase L)
+  </font></pre>
+<p><font>All other characters are treated as strings. You can
+    also use \ to escape characters. Available on selected databases, including
+mysql, postgresql, mssql, oci8 and DB2. </font></p>
+<p><font>This is useful in writing portable sql statements that
+    GROUP BY on dates. For example to display total cost of goods sold broken
+by quarter (dates are stored in a field called postdate): </font></p>
+<pre><font> $sqlfn = $db-&gt;SQLDate('Y-\QQ','postdate'); # get sql that formats postdate to output 2002-Q1<br> $sql = "SELECT $sqlfn,SUM(cogs) FROM table GROUP BY $sqlfn ORDER BY 1 desc";<br> </font></pre>
+<p><font><b>MoveNext<a name="movenext"></a>( )</b></font></p>
+<p><font>Move the internal cursor to the next row. The <i>$this-&gt;fields</i> array
+    is automatically updated. Returns false if unable to do so (normally because
+EOF has been reached), otherwise true. </font></p>
+<p><font> If EOF is reached, then the $this-&gt;fields array
+    is set to false (this was only implemented consistently in ADOdb 3.30). For
+    the pre-3.30 behaviour of $this-&gt;fields (at EOF), set the global variable
+  $ADODB_COMPAT_FETCH = true.</font></p>
+<p><font>Example:</font></p>
+<pre><font>$rs = $db-&gt;Execute($sql);<br>if ($rs) <br>	while (!$rs-&gt;EOF) {<br> 		ProcessArray($rs-&gt;fields);	<br>		$rs-&gt;MoveNext();<br>	} </font></pre>
+<p><font><b>Move<a name="move"></a>($to)</b></font></p>
+<p><font>Moves the internal cursor to a specific row $<b>to</b>.
+    Rows are zero-based eg. 0 is the first row. The <b>fields</b> array is automatically
+    updated. For databases that do not support scrolling internally, ADOdb will
+    simulate forward scrolling. Some databases do not support backward scrolling.
+    If the $<b>to</b> position is after the EOF, $<b>to</b> will move to the
+    end of the RecordSet for most databases. Some obscure databases using odbc
+  might not behave this way.</font></p>
+<p><font>Note: This function uses <i>absolute positioning</i>,
+unlike Microsoft's ADO.</font></p>
+<p><font>Returns true or false. If false, the internal cursor
+    is not moved in most implementations, so AbsolutePosition( ) will return
+  the last cursor position before the Move( ). </font></p>
+<p><font><b>MoveFirst<a name="movefirst"></a>()</b></font></p>
+<p><font>Internally calls Move(0). Note that some databases do
+not support this function.</font></p>
+<p><font><b>MoveLast<a name="movelast"></a>()</b></font></p>
+<p><font>Internally calls Move(RecordCount()-1). Note that some
+  databases do not support this function.</font></p>
+<p><font><b>GetRowAssoc</b><a name="getrowassoc"></a>($toUpper=true)</font></p>
+<p><font>Returns an associative array containing the current
+    row. The keys to the array are the column names. The column names are upper-cased
+  for easy access. To get the next row, you will still need to call MoveNext(). </font></p>
+<p><font>For example:<br>
+Array ( [ID] =&gt; 1 [FIRSTNAME] =&gt; Caroline [LASTNAME] =&gt; Miranda [CREATED]
+=&gt; 2001-07-05 ) </font></p>
+<p><font>Note: do not use GetRowAssoc() with $ADODB_FETCH_MODE
+    = ADODB_FETCH_ASSOC. Because they have the same functionality, they will
+  interfere with each other.</font></p>
+<font> 
+</font><p><font><b>AbsolutePage<a name="absolutepage"></a>($page=-1) </b></font></p>
+<p><font>Returns the current page. Requires PageExecute()/CachePageExecute() to be called. 
   See <a href="#ex8">Example 8</a>.</font></p>
-<font color="#000000"><font color="#000000"> 
+<font>
 <p><b>AtFirstPage<a name="atfirstpage">($status='')</a></b></p>
-<p>Returns true if at first page (1-based). Requires PageExecute()/CachePageExecute() 
+<p>Returns true if at first page (1-based). Requires PageExecute()/CachePageExecute()
   to be called. See <a href="#ex8">Example 8</a>.</p>
 <p><b>AtLastPage<a name="atlastpage">($status='')</a></b></p>
-<p>Returns true if at last page (1-based). Requires PageExecute()/CachePageExecute() 
+<p>Returns true if at last page (1-based). Requires PageExecute()/CachePageExecute()
   to be called. See <a href="#ex8">Example 8</a>.</p>
 <p><b>Fields</b><a name="fields"></a>(<b>$colname</b>)</p>
-<p>Returns the value of the 
-  associated column $<b>colname</b> for the current row. The column name is case-insensitive.</p>
+<p>Returns the value of the associated column $<b>colname</b> for the current
+  row. The column name is case-insensitive.</p>
 <p>This is a convenience function. For higher performance, use <a href="#adodb_fetch_mode">$ADODB_FETCH_MODE</a>. </p>
-<p><b>FetchRow</b><a name="fetchrow"></a>()</p>
-</font> 
-</font><p><font color="#000000"><font color="#000000">Returns array containing current row, or false if EOF. 
-  FetchRow( ) internally moves to the next record after returning the current 
-  row. </font></font></p>
-<p><font color="#000000"><font color="#000000">Warning: Do not mix using FetchRow() with MoveNext().</font></font></p>
-<p><font color="#000000"><font color="#000000">Usage:</font></font></p>
-<pre><font color="#000000"><font color="#000000">$rs = $db-&gt;Execute($sql);<br>if ($rs)<br>	while ($arr = $rs-&gt;FetchRow()) {<br>	   &nbsp;&nbsp;# process $arr	<br></font><font color="#000000">	}</font></font></pre>
-<p><font color="#000000"><font color="#000000"><b>FetchInto</b><a name="fetchinto"></a>(<b>&amp;$array</b>)</font></font></p>
-<p><font color="#000000"><font color="#000000"> Sets $array to the current row. Returns PEAR_Error object 
-  if EOF, 1 if ok (DB_OK constant). If PEAR is undefined, false is returned when 
-  EOF. </font><font color="#000000">FetchInto( ) internally moves to the next 
-  record after returning the current row. </font></font></p>
-<p><font color="#000000"><font color="#000000"> FetchRow() is easier to use. See above.</font></font></p>
-<font color="#000000"><font color="#000000"> 
-</font></font><p><font color="#000000"><font color="#000000"><b>FetchField<a name="fetchfield"></a>($column_number)</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Returns an object containing the <b>name</b>, <b>type</b> and <b>max_length</b> 
-  of the associated field. If the max_length cannot be determined reliably, it 
-  will be set to -1. The column numbers are zero-based. See <a href="#ex2">example 
-  2.</a></font></font></p>
-<p><font color="#000000"><font color="#000000"><b>FieldCount<a name="fieldcount"></a>( )</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Returns the number of fields (columns) in the record set.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>RecordCount<a name="recordcount"></a>( )</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Returns the number of rows in the record set. If the number of records returned 
-  cannot be determined from the database driver API, we will buffer all rows and 
-  return a count of the rows after all the records have been retrieved. This buffering 
-  can be disabled (for performance reasons) by setting the global variable $ADODB_COUNTRECS 
-  = false. When disabled, RecordCount( ) will return -1 for certain databases. 
-  See the supported databases list above for more details. </font></font></p>
-<p><font color="#000000"><font color="#000000"> RowCount is a synonym for RecordCount.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>PO_RecordCount<a name="po_recordcount"></a>($table, $where)</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Returns the number of rows in the record set. If the database does not support 
-  this, it will perform a SELECT COUNT(*) on the table $table, with the given 
-  $where condition to return an estimate of the recordset size.</font></font></p>
-<p><font color="#000000"><font color="#000000">$numrows = $rs-&gt;PO_RecordCount("articles_table", "group=$group");</font></font></p>
-<font color="#000000"><font color="#000000"><b> NextRecordSet<a name="nextrecordset" id="nextrecordset"></a>()</b> 
-</font></font><p><font color="#000000"><font color="#000000">For databases that allow multiple recordsets to be returned in one query, this 
-  function allows you to switch to the next recordset. Currently only supported 
-  by mssql driver.</font></font></p>
-<pre><font color="#000000"><font color="#000000">$rs = $db-&gt;Execute('execute return_multiple_rs');<br>$arr1 = $rs-&gt;GetArray();<br>$rs-&gt;NextRecordSet();<br>$arr2 = $rs-&gt;GetArray();</font></font></pre>
-<p><font color="#000000"><font color="#000000"><b>FetchObject<a name="fetchobject"></a>($toupper=true)</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Returns the current row as an object. If you set $toupper to true, then the 
-  object fields are set to upper-case. Note: The newer FetchNextObject() is the 
-  recommended way of accessing rows as objects. See below.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>FetchNextObject<a name="fetchnextobject"></a>($toupper=true)</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Gets the current row as an object and moves to the next row automatically. 
-  Returns false if at end-of-file. If you set $toupper to true, then the object 
-  fields are set to upper-case.</font></font></p>
-<pre><font color="#000000"><font color="#000000">$rs = $db-&gt;Execute('select firstname,lastname from table');<br>if ($rs) {<br>	while ($o = $rs-&gt;FetchNextObject()) {<br>		print "$o-&gt;FIRSTNAME, $o-&gt;LASTNAME&lt;BR&gt;";<br>	}<br>}<br></font></font></pre>
-<p><font color="#000000"><font color="#000000">There is some trade-off in speed in using FetchNextObject(). If performance 
-  is important, you should access rows with the <code>fields[]</code> array. <b>FetchObj<a name="fetchobj" id="fetchobj"></a>()</b> 
-</font></font></p><p><font color="#000000"><font color="#000000">Returns the current record as an object. Fields are not upper-cased, unlike 
-  FetchObject. </font> 
-</font></p><p><font color="#000000"><font color="#000000"><b>FetchNextObj<a name="fetchnextobj" id="fetchnextobj"></a>()</b> 
-  </font></font></p>
-<p><font color="#000000"><font color="#000000">Returns the current record as an object and moves to 
-  the next record. If EOF, false is returned. Fields are not upper-cased, unlike 
-  FetctNextObject. </font></font></p>
-<font color="#000000"><font color="#000000"> 
+<p><b>FetchRow</b><a name="fetchrow"></a>()</p> 
+</font><p><font>Returns array containing current row, or false
+    if EOF. FetchRow( ) internally moves to the next record after returning the
+    current row. </font></p>
+<p><font>Warning: Do not mix using FetchRow() with MoveNext().</font></p>
+<p><font>Usage:</font></p>
+<pre><font>$rs = $db-&gt;Execute($sql);<br>if ($rs)<br>	while ($arr = $rs-&gt;FetchRow()) {<br>	   &nbsp;&nbsp;# process $arr	<br>	}</font></pre>
+<p><font><b>FetchInto</b><a name="fetchinto"></a>(<b>&amp;$array</b>)</font></p>
+<p><font> Sets $array to the current row. Returns PEAR_Error
+    object if EOF, 1 if ok (DB_OK constant). If PEAR is undefined, false is returned
+    when EOF. FetchInto( ) internally moves to the next record after returning
+  the current row. </font></p>
+<p><font> FetchRow() is easier to use. See above.</font></p>
+<font> </font>
+<p><font><b>FetchField<a name="fetchfield"></a>($column_number)</b></font></p>
+<p><font>Returns an object containing the <b>name</b>, <b>type</b> and <b>max_length</b> of
+    the associated field. If the max_length cannot be determined reliably, it
+    will be set to -1. The column numbers are zero-based. See <a href="#ex2">example
+  2.</a></font></p>
+<p><font><b>FieldCount<a name="fieldcount"></a>( )</b></font></p>
+<p><font>Returns the number of fields (columns) in the record
+set.</font></p>
+<p><font><b>RecordCount<a name="recordcount"></a>( )</b></font></p>
+<p><font>Returns the number of rows in the record set. If the
+    number of records returned cannot be determined from the database driver
+    API, we will buffer all rows and return a count of the rows after all the
+    records have been retrieved. This buffering can be disabled (for performance
+    reasons) by setting the global variable $ADODB_COUNTRECS = false. When disabled,
+    RecordCount( ) will return -1 for certain databases. See the supported databases
+  list above for more details. </font></p>
+<p><font> RowCount is a synonym for RecordCount.</font></p>
+<p><font><b>PO_RecordCount<a name="po_recordcount"></a>($table,
+$where)</b></font></p>
+<p><font>Returns the number of rows in the record set. If the
+    database does not support this, it will perform a SELECT COUNT(*) on the
+    table $table, with the given $where condition to return an estimate of the
+  recordset size.</font></p>
+<p><font>$numrows = $rs-&gt;PO_RecordCount("articles_table", "group=$group");</font></p>
+<font><b> NextRecordSet<a name="nextrecordset" id="nextrecordset"></a>()</b> </font>
+<p><font>For databases that allow multiple recordsets to be returned
+    in one query, this function allows you to switch to the next recordset. Currently
+  only supported by mssql driver.</font></p>
+<pre><font>$rs = $db-&gt;Execute('execute return_multiple_rs');<br>$arr1 = $rs-&gt;GetArray();<br>$rs-&gt;NextRecordSet();<br>$arr2 = $rs-&gt;GetArray();</font></pre>
+<p><font><b>FetchObject<a name="fetchobject"></a>($toupper=true)</b></font></p>
+<p><font>Returns the current row as an object. If you set $toupper
+    to true, then the object fields are set to upper-case. Note: The newer FetchNextObject()
+  is the recommended way of accessing rows as objects. See below.</font></p>
+<p><font><b>FetchNextObject<a name="fetchnextobject"></a>($toupper=true)</b></font></p>
+<p><font>Gets the current row as an object and moves to the next
+    row automatically. Returns false if at end-of-file. If you set $toupper to
+  true, then the object fields are set to upper-case.</font></p>
+<pre><font>$rs = $db-&gt;Execute('select firstname,lastname from table');<br>if ($rs) {<br>	while ($o = $rs-&gt;FetchNextObject()) {<br>		print "$o-&gt;FIRSTNAME, $o-&gt;LASTNAME&lt;BR&gt;";<br>	}<br>}<br></font></pre>
+<p><font>There is some trade-off in speed in using FetchNextObject().
+If performance is important, you should access rows with the <code>fields[]</code> array. <b>FetchObj<a name="fetchobj" id="fetchobj"></a>()</b> </font></p>
+<p><font>Returns the current record as an object. Fields are
+    not upper-cased, unlike FetchObject.  
+</font></p>
+<p><font><b>FetchNextObj<a name="fetchnextobj" id="fetchnextobj"></a>()</b> </font></p>
+<p><font>Returns the current record as an object and moves to
+    the next record. If EOF, false is returned. Fields are not upper-cased, unlike
+  FetctNextObject. </font></p>
+<font>
 <p><b>CurrentRow<a name="currentrow"></a>( )</b></p>
 <p>Returns the current row of the record set. 0 is the first row.</p>
 <p><b>AbsolutePosition<a name="abspos"></a>( )</b></p>
-<p>Synonym for <b>CurrentRow</b> for compatibility with ADO. Returns the current 
+<p>Synonym for <b>CurrentRow</b> for compatibility with ADO. Returns the current
   row of the record set. 0 is the first row.</p>
 <p><b>MetaType<a name="metatype"></a>($nativeDBType[,$field_max_length],[$fieldobj])</b></p>
-<p>Determine what <i>generic</i> meta type a database field type is given its 
-  native type $<b>nativeDBType</b> as a string and the length of the field $<b>field_max_length</b>. 
-  Note that field_max_length can be -1 if it is not known. The field object returned 
-  by FetchField() can be passed in $<b>fieldobj</b> or as the 1st parameter <b>$nativeDBType</b>. 
-  This is useful for databases such as <i>mysql</i> which has additional properties 
+<p>Determine what <i>generic</i> meta type a database field type is given its
+  native type $<b>nativeDBType</b> as a string and the length of the field $<b>field_max_length</b>.
+  Note that field_max_length can be -1 if it is not known. The field object returned
+  by FetchField() can be passed in $<b>fieldobj</b> or as the 1st parameter <b>$nativeDBType</b>.
+  This is useful for databases such as <i>mysql</i> which has additional properties
   in the field object such as <i>primary_key</i>. </p>
-<p>Uses the field <b>blobSize</b> and compares it with $<b>field_max_length</b> 
-  to determine whether the character field is actually a blob.</p>
-For example, $db-&gt;MetaType('char') will return 'C'. 
+<p>Uses the field <b>blobSize</b> and compares it with $<b>field_max_length</b> to
+  determine whether the character field is actually a blob.</p>
+For example, $db-&gt;MetaType('char') will return 'C'.
 <p>Returns:</p>
 <ul>
-  <li><b>C</b>: Character fields that should be shown in a &lt;input type="text"&gt; 
-    tag. </li>
-  <li><b>X</b>: Clob (character large objects), or large text fields that should 
+  <li><b>C</b>: Character fields that should be shown in a &lt;input type="text"&gt; tag. </li>
+  <li><b>X</b>: Clob (character large objects), or large text fields that should
     be shown in a &lt;textarea&gt;</li>
   <li><b>D</b>: Date field</li>
   <li><b>T</b>: Timestamp field</li>
   <li><b>L</b>: Logical field (boolean or bit-field)</li>
-  <li><b>N</b>: Numeric field. Includes decimal, numeric, floating point, and 
+  <li><b>N</b>: Numeric field. Includes decimal, numeric, floating point, and
     real. </li>
   <li><b>I</b>:&nbsp; Integer field. </li>
   <li><b>R</b>: Counter or Autoincrement field. Must be numeric.</li>
-  <li><b>B</b>: Blob, or binary large objects.<font color="#000000"> </font></li>
-</ul>
-</font> 
-</font><p><font color="#000000"><font color="#000000"> Since ADOdb 3.0, MetaType accepts $fieldobj as the first 
-  parameter, instead of $nativeDBType. </font></font></p>
-<font color="#000000"><font color="#000000"> 
-
-</font></font><p><font color="#000000"><font color="#000000"><b>Close( )<a name="rsclose"></a></b></font></font></p>
-<p><font color="#000000"><font color="#000000">Closes the recordset, cleaning all memory and resources associated with the recordset. 
-</font></font></p><p>
-<font color="#000000"><font color="#000000">If memory management is not an issue, you do not need to call this function as recordsets
-are closed for you by PHP at the end of the script. 
-SQL statements such as INSERT/UPDATE/DELETE do not really return a recordset, so you do not have to call Close()
-for such SQL statements.</font></font></p>
+  <li><b>B</b>: Blob, or binary large objects. </li>
+</ul> 
+</font><p><font> Since ADOdb 3.0, MetaType accepts $fieldobj
+    as the first parameter, instead of $nativeDBType. </font></p>
+<font> </font>
+<p><font><b>Close( )<a name="rsclose"></a></b></font></p>
+<p><font>Closes the recordset, cleaning all memory and resources
+associated with the recordset. </font></p>
+<p>
+<font>If memory management is not an issue, you do not need to
+call this function as recordsets are closed for you by PHP at the end of the
+script. SQL statements such as INSERT/UPDATE/DELETE do not really return a recordset,
+so you do not have to call Close() for such SQL statements.</font></p>
 <hr>
-<h3><font color="#000000"><font color="#000000">function rs2html<a name="rs2html"></a>($adorecordset,[$tableheader_attributes], 
-  [$col_titles])</font></font></h3>
-<p><font color="#000000"><font color="#000000">This is a standalone function (rs2html = recordset to html) that is similar 
-  to PHP's <i>odbc_result_all</i> function, it prints a ADORecordSet, $<b>adorecordset</b> 
-  as a HTML table. $<b>tableheader_attributes</b> allow you to control the table 
-  <i>cellpadding</i>, <i>cellspacing</i> and <i>border</i> attributes. Lastly 
-  you can replace the database column names with your own column titles with the 
-  array $<b>col_titles</b>. This is designed more as a quick debugging mechanism, 
-  not a production table recordset viewer.</font></font></p>
-<p><font color="#000000"><font color="#000000">You will need to include the file <i>tohtml.inc.php</i>.</font></font></p>
-<p><font color="#000000"><font color="#000000">Example of rs2html:<b><font color="#336600"><a name="exrs2html"></a></font></b></font></font></p>
-<pre><font color="#000000"><font color="#000000"><b><font color="#336600">&lt;?<br>include('tohtml.inc.php')</font></b>; # load code common to ADOdb <br><b>include</b>('adodb.inc.php'); # load code common to ADOdb <br>$<font color="#663300">conn</font> = &amp;ADONewConnection('mysql');   # create a connection <br>$<font color="#663300">conn</font>-&gt;PConnect('localhost','userid','','agora');# connect to MySQL, agora db<br>$<font color="#663300">sql</font> = 'select CustomerName, CustomerID from customers'; <br>$<font color="#663300">rs</font>   = $<font color="#663300">conn</font>-&gt;Execute($sql); <br><font color="#336600"><b>rs2html</b></font><b>($<font color="#663300">rs</font>,'<i>border=2 cellpadding=3</i>',array('<i>Customer Name','Customer ID</i>'));<br>?&gt;</b></font></font></pre>
+<h3><font>function rs2html<a name="rs2html"></a>($adorecordset,[$tableheader_attributes],
+  [$col_titles])</font></h3>
+<p><font>This is a standalone function (rs2html = recordset to
+    html) that is similar to PHP's <i>odbc_result_all</i> function, it prints
+    a ADORecordSet, $<b>adorecordset</b> as a HTML table. $<b>tableheader_attributes</b> allow
+    you to control the table <i>cellpadding</i>, <i>cellspacing</i> and <i>border</i> attributes.
+    Lastly you can replace the database column names with your own column titles
+    with the array $<b>col_titles</b>. This is designed more as a quick debugging
+  mechanism, not a production table recordset viewer.</font></p>
+<p><font>You will need to include the file <i>tohtml.inc.php</i>.</font></p>
+<p><font>Example of rs2html:<b><font color="#336600"><a name="exrs2html"></a></font></b></font></p>
+<pre><font><b><font color="#336600">&lt;?<br>include('tohtml.inc.php')</font></b>; # load code common to ADOdb <br><b>include</b>('adodb.inc.php'); # load code common to ADOdb <br>$<font color="#663300">conn</font> = &amp;ADONewConnection('mysql');   # create a connection <br>$<font color="#663300">conn</font>-&gt;PConnect('localhost','userid','','agora');# connect to MySQL, agora db<br>$<font color="#663300">sql</font> = 'select CustomerName, CustomerID from customers'; <br>$<font color="#663300">rs</font>   = $<font color="#663300">conn</font>-&gt;Execute($sql); <br><font color="#336600"><b>rs2html</b></font><b>($<font color="#663300">rs</font>,'<i>border=2 cellpadding=3</i>',array('<i>Customer Name','Customer ID</i>'));<br>?&gt;</b></font></pre>
 <hr>
-<h3><font color="#000000"><font color="#000000">Differences between this ADOdb library and Microsoft ADO<a name="adodiff"></a></font></font></h3>
+<h3><font>Differences between this ADOdb library and Microsoft
+ADO<a name="adodiff"></a></font></h3>
 <ol>
-<font color="#000000"><font color="#000000">  <li>ADOdb only supports recordsets created by a connection object. Recordsets 
-    cannot be created independently.</li>
-  <li>ADO properties are implemented as functions in ADOdb. This makes it easier 
-    to implement any enhanced ADO functionality in the future.</li>
-  <li>ADOdb's <font face="Courier New, Courier, mono">ADORecordSet-&gt;Move()</font> 
-    uses absolute positioning, not relative. Bookmarks are not supported.</li>
-  <li><font face="Courier New, Courier, mono">ADORecordSet-&gt;AbsolutePosition() 
-    </font>cannot be used to move the record cursor.</li>
-  <li>ADO Parameter objects are not supported. Instead we have the ADOConnection::<a href="#parameter">Parameter</a>( 
-    ) function, which provides a simpler interface for calling preparing parameters 
-    and calling stored procedures.</li>
-  <li>Recordset properties for paging records are available, but implemented as 
-    in <a href="#ex8">Example 8</a>.</li>
-</font></font></ol>
+<font>
+<li>ADOdb only supports recordsets created by a connection object. Recordsets
+  cannot be created independently.</li>
+<li>ADO properties are implemented as functions in ADOdb. This makes it easier
+  to implement any enhanced ADO functionality in the future.</li>
+<li>ADOdb's <font face="Courier New, Courier, mono">ADORecordSet-&gt;Move()</font> uses
+  absolute positioning, not relative. Bookmarks are not supported.</li>
+<li><font face="Courier New, Courier, mono">ADORecordSet-&gt;AbsolutePosition() </font>cannot
+  be used to move the record cursor.</li>
+<li>ADO Parameter objects are not supported. Instead we have the ADOConnection::<a href="#parameter">Parameter</a>(
+  ) function, which provides a simpler interface for calling preparing parameters
+  and calling stored procedures.</li>
+<li>Recordset properties for paging records are available, but implemented as
+  in <a href="#ex8">Example 8</a>.</li>
+</font></ol>
 <hr>
-<h1><font color="#000000"><font color="#000000">Database Driver Guide<a name="driverguide"></a></font></font></h1>
-<p><font color="#000000"><font color="#000000">This describes how to create a class to connect to a new database. To ensure 
-  there is no duplication of work, kindly email me at jlim#natsoft.com.my if you 
-  decide to create such a class.</font></font></p>
-<p><font color="#000000"><font color="#000000">First decide on a name in lower case to call the database type. Let's say we 
-  call it xbase. </font></font></p>
-<p><font color="#000000"><font color="#000000">Then we need to create two classes ADODB_xbase and ADORecordSet_xbase in the 
-  file adodb-xbase.inc.php.</font></font></p>
-<p><font color="#000000"><font color="#000000">The simplest form of database driver is an adaptation of an existing ODBC driver. 
-  Then we just need to create the class <i>ADODB_xbase extends ADODB_odbc</i> 
-  to support the new <b>date</b> and <b>timestamp</b> formats, the <b>concatenation</b> 
-  operator used, <b>true</b> and <b>false</b>. For the<i> ADORecordSet_xbase extends 
-  ADORecordSet_odbc </i>we need to change the <b>MetaType</b> function. See<b> 
-  adodb-vfp.inc.php</b> as an example.</font></font></p>
-<p><font color="#000000"><font color="#000000">More complicated is a totally new database driver that connects to a new PHP 
-  extension. Then you will need to implement several functions. Fortunately, you 
-  do not have to modify most of the complex code. You only need to override a 
-  few stub functions. See <b>adodb-mysql.inc.php</b> for example.</font></font></p>
-<p><font color="#000000"><font color="#000000">The default date format of ADOdb internally is YYYY-MM-DD (Ansi-92). All dates 
-  should be converted to that format when passing to an ADOdb date function. See 
-  Oracle for an example how we use ALTER SESSION to change the default date format 
-  in _pconnect _connect.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>ADOConnection Functions to Override</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Defining a constructor for your ADOConnection derived function is optional. 
-  There is no need to call the base class constructor.</font></font></p>
-<p><font color="#000000"><font color="#000000">_<b>connect</b>: Low level implementation of Connect. Returns true or false. 
-  Should set the _<b>connectionID</b>.</font></font></p>
-<p><font color="#000000"><font color="#000000">_<b>pconnect:</b> Low level implemention of PConnect. Returns true or false. 
-  Should set the _<b>connectionID</b>.</font></font></p>
-<p><font color="#000000"><font color="#000000">_<b>query</b>: Execute a query. Returns the queryID, or false.</font></font></p>
-<p><font color="#000000"><font color="#000000">_<b>close: </b>Close the connection -- PHP should clean up all recordsets. 
-</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>ErrorMsg</b>: Stores the error message in the private variable _errorMsg. 
-</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>ADOConnection Fields to Set</b></font></font></p>
-<p><font color="#000000"><font color="#000000">_<b>bindInputArray</b>: Set to true if binding of parameters for SQL inserts 
-  and updates is allowed using ?, eg. as with ODBC.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>fmtDate</b></font></font></p>
-<p><font color="#000000"><font color="#000000"><b>fmtTimeStamp</b></font></font></p>
-<p><font color="#000000"><font color="#000000"><b>true</b></font></font></p>
-<p><font color="#000000"><font color="#000000"><b>false</b></font></font></p>
-<p><font color="#000000"><font color="#000000"><b>concat_operator</b></font></font></p>
-<p><font color="#000000"><font color="#000000"><b>replaceQuote</b></font></font></p>
-<p><font color="#000000"><font color="#000000"><b>hasLimit</b> support SELECT * FROM TABLE LIMIT 10 of MySQL.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>hasTop</b> support Microsoft style SELECT TOP 10 * FROM TABLE.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>ADORecordSet Functions to Override</b></font></font></p>
-<p><font color="#000000"><font color="#000000">You will need to define a constructor for your ADORecordSet derived class that 
-  calls the parent class constructor.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>FetchField: </b> as documented above in ADORecordSet</font></font></p>
-<p><font color="#000000"><font color="#000000">_<b>initrs</b>: low level initialization of the recordset: setup the _<b>numOfRows</b> 
-  and _<b>numOfFields</b> fields -- called by the constructor.</font></font></p>
-<p><font color="#000000"><font color="#000000">_<b>seek</b>: seek to a particular row. Do not load the data into the fields 
-  array. This is done by _fetch. Returns true or false. Note that some implementations 
-  such as Interbase do not support seek. Set canSeek to false.</font></font></p>
-<p><font color="#000000"><font color="#000000">_<b>fetch</b>: fetch a row using the database extension function and then move 
-  to the next row. Sets the <b>fields</b> array. If the parameter $ignore_fields 
-  is true then there is no need to populate the <b>fields</b> array, just move 
-  to the next row. then Returns true or false.</font></font></p>
-<p><font color="#000000"><font color="#000000">_<b>close</b>: close the recordset</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>Fields</b>: If the array row returned by the PHP extension is not an associative 
-  one, you will have to override this. See adodb-odbc.inc.php for an example. 
-  For databases such as MySQL and MSSQL where an associative array is returned, 
-  there is no need to override this function.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>ADOConnection Fields to Set</b></font></font></p>
-<p><font color="#000000"><font color="#000000">canSeek: Set to true if the _seek function works.</font></font></p>
-<h2><font color="#000000"><font color="#000000">ToDo:</font></font></h2>
-<p><font color="#000000"><font color="#000000">See the <a href="http://php.weblogs.com/adodb-todo-roadmap">RoadMap</a> article.</font></font></p>
-<p><font color="#000000"><font color="#000000">Also see the ADOdb <a href="http://php.weblogs.com/adodb_csv">proxy</a> article 
-  for bridging Windows and Unix databases using http remote procedure calls. For 
-  your education, visit <a href="http://palslib.com/">palslib.com</a> for database info, 
-  and read this article on <a href="http://phplens.com/lens/php-book/optimizing-debugging-php.php">Optimizing 
-  PHP</a>. </font></font></p>
+<h1><font>Database Driver Guide<a name="driverguide"></a></font></h1>
+<p><font>This describes how to create a class to connect to a
+    new database. To ensure there is no duplication of work, kindly email me
+  at jlim#natsoft.com.my if you decide to create such a class.</font></p>
+<p><font>First decide on a name in lower case to call the database
+  type. Let's say we call it xbase. </font></p>
+<p><font>Then we need to create two classes ADODB_xbase and ADORecordSet_xbase
+  in the file adodb-xbase.inc.php.</font></p>
+<p><font>The simplest form of database driver is an adaptation
+    of an existing ODBC driver. Then we just need to create the class <i>ADODB_xbase
+    extends ADODB_odbc</i> to support the new <b>date</b> and <b>timestamp</b> formats,
+    the <b>concatenation</b> operator used, <b>true</b> and <b>false</b>. For
+    the<i> ADORecordSet_xbase extends ADORecordSet_odbc </i>we need to change
+  the <b>MetaType</b> function. See<b> adodb-vfp.inc.php</b> as an example.</font></p>
+<p><font>More complicated is a totally new database driver that
+    connects to a new PHP extension. Then you will need to implement several
+    functions. Fortunately, you do not have to modify most of the complex code.
+    You only need to override a few stub functions. See <b>adodb-mysql.inc.php</b> for
+  example.</font></p>
+<p><font>The default date format of ADOdb internally is YYYY-MM-DD
+    (Ansi-92). All dates should be converted to that format when passing to an
+    ADOdb date function. See Oracle for an example how we use ALTER SESSION to
+  change the default date format in _pconnect _connect.</font></p>
+<p><font><b>ADOConnection Functions to Override</b></font></p>
+<p><font>Defining a constructor for your ADOConnection derived
+  function is optional. There is no need to call the base class constructor.</font></p>
+<p><font>_<b>connect</b>: Low level implementation of Connect.
+  Returns true or false. Should set the _<b>connectionID</b>.</font></p>
+<p><font>_<b>pconnect:</b> Low level implemention of PConnect.
+  Returns true or false. Should set the _<b>connectionID</b>.</font></p>
+<p><font>_<b>query</b>: Execute a query. Returns the queryID,
+or false.</font></p>
+<p><font>_<b>close: </b>Close the connection -- PHP should clean
+up all recordsets. </font></p>
+<p><font><b>ErrorMsg</b>: Stores the error message in the private
+variable _errorMsg. </font></p>
+<p><font><b>ADOConnection Fields to Set</b></font></p>
+<p><font>_<b>bindInputArray</b>: Set to true if binding of parameters
+  for SQL inserts and updates is allowed using ?, eg. as with ODBC.</font></p>
+<p><font><b>fmtDate</b></font></p>
+<p><font><b>fmtTimeStamp</b></font></p>
+<p><font><b>true</b></font></p>
+<p><font><b>false</b></font></p>
+<p><font><b>concat_operator</b></font></p>
+<p><font><b>replaceQuote</b></font></p>
+<p><font><b>hasLimit</b> support SELECT * FROM TABLE LIMIT 10
+of MySQL.</font></p>
+<p><font><b>hasTop</b> support Microsoft style SELECT TOP 10
+* FROM TABLE.</font></p>
+<p><font><b>ADORecordSet Functions to Override</b></font></p>
+<p><font>You will need to define a constructor for your ADORecordSet
+  derived class that calls the parent class constructor.</font></p>
+<p><font><b>FetchField: </b> as documented above in ADORecordSet</font></p>
+<p><font>_<b>initrs</b>: low level initialization of the recordset:
+    setup the _<b>numOfRows</b> and _<b>numOfFields</b> fields -- called by the
+  constructor.</font></p>
+<p><font>_<b>seek</b>: seek to a particular row. Do not load
+    the data into the fields array. This is done by _fetch. Returns true or false.
+    Note that some implementations such as Interbase do not support seek. Set
+  canSeek to false.</font></p>
+<p><font>_<b>fetch</b>: fetch a row using the database extension
+    function and then move to the next row. Sets the <b>fields</b> array. If
+    the parameter $ignore_fields is true then there is no need to populate the <b>fields</b> array,
+  just move to the next row. then Returns true or false.</font></p>
+<p><font>_<b>close</b>: close the recordset</font></p>
+<p><font><b>Fields</b>: If the array row returned by the PHP
+    extension is not an associative one, you will have to override this. See
+    adodb-odbc.inc.php for an example. For databases such as MySQL and MSSQL
+    where an associative array is returned, there is no need to override this
+  function.</font></p>
+<p><font><b>ADOConnection Fields to Set</b></font></p>
+<p><font>canSeek: Set to true if the _seek function works.</font></p>
+<h2><font>ToDo:</font></h2>
+<p><font>See the <a href="http://php.weblogs.com/adodb-todo-roadmap">RoadMap</a> article.</font></p>
+<p><font>Also see the ADOdb <a href="http://php.weblogs.com/adodb_csv">proxy</a> article
+    for bridging Windows and Unix databases using http remote procedure calls.
+    For your education, visit <a href="http://palslib.com/">palslib.com</a> for
+    database info, and read this article on <a href="http://phplens.com/lens/php-book/optimizing-debugging-php.php">Optimizing
+  PHP</a>. </font></p>
 
-<h2><font color="#000000">Change Log<a name="Changes"></a><a name="changes"></a><a name="changelog"></a></font></h2>
-<p><a name="4.54"></a><b>4.54 5 Nov 2004</b>
-<p>
-Now you can set $db->charSet = ?? before doing a Connect() in oci8.
-<p>
+<h2><font>Change Log<a name="Changes"></a><a name="changes"></a><a name="changelog"></a></font></h2>
+<p><a name="4.62"></a><b>4.62  2 Apr 2005</b>
+<p>Added 'w' (dow as 0-6 or 1-7) and 'l' (dow as string) for SQLDate for oci8, postgres and mysql.
+<p>Rolled back MetaType() changes for mysqli done in prev version.
+<p>Datadict change by chris, cblin#tennaxia.com data mappings from:
+<pre>
+oci8:  X->varchar(4000) XL->CLOB
+mssql: X->XL->TEXT
+mysql: X->XL->LONGTEXT
+fbird: X->XL->varchar(4000)
+</pre>
+<p>to:
+<pre>
+oci8:  X->varchar(4000) XL->CLOB
+mssql: X->VARCHAR(4000) XL->TEXT
+mysql: X->TEXT          XL->LONGTEXT
+fbird: X->VARCHAR(4000) XL->VARCHAR(32000)
+</pre>
+<p>Added $connection->disableBlobs to postgresql to improve performance when no bytea is used (2-5% improvement).
+<p>Removed all HTTP_* vars.
+<p>Added $rs->tableName to be set before calling AutoExecute().
+<p>Alex Rootoff rootoff#pisem.net contributed ukrainian language file.
+<p>Added new mysql_option() support using $conn->optionFlags array.
+<p>Added support for ldap_set_option() using the $LDAP_CONNECT_OPTIONS global variable. Contributed by Josh Eldridge.
+<p>Added LDAP_* constant definitions to ldap.
+<p>Added support for boolean bind variables. We use $conn->false and $conn->true to hold values to set false/true to.
+<p>We now do not close the session connection in adodb-session.inc.php as other objects could be using this connection.
+<p>We now strip off \0 at end of Ixora SQL strings in $perf->tohtml() for oci8.
+<p><a name="4.61"></a><b>4.61 23 Feb 2005</b>
+<p>MySQLi added support for mysqli_connect_errno() and mysqli_connect_error().
+<p>Massive improvements to alpha PDO driver.
+<p>Quote string bind parameters logged by performance monitor for easy type checking. Thx Jason Judge.
+<p>Added support for $role when connecting with Interbase/firebird.
+<p>Added support for enum recognition in MetaColumns() mysql and mysqli. Thx Amedeo Petrella.
+<p>The sybase_ase driver contributed by Interakt Online. Thx Cristian Marin cristic#interaktonline.com.
+<p>Removed not_null, has_default, and default_value from ADOFieldObject.
+<p>Sessions code, fixed quoting of keys when handling LOBs in session write() function.
+<p>Sessions code, added adodb_session_regenerate_id(), to reduce risk of session hijacking by changing session cookie dynamically. Thx Joe Li.
+<p>Perf monitor, polling for CPU did not work for PHP 4.3.10 and 5.0.0-5.0.3 due to PHP bugs, so we special case these versions.
+<p>Postgresql, UpdateBlob() added code to handle type==CLOB.
+<p><a name="4.60"></a><b>4.60 24 Jan 2005</b>
+<p>Implemented PEAR DB's autoExecute(). Simplified design because I don't like using constants when
+strings work fine.
+<p>_rs2serialize will now update $rs->sql and $rs->oldProvider.
+<p>Added autoExecute().
+<p>Added support for postgres8 driver. Currently just remapped to postgres7 driver.
+<p>Changed oci8 _query(), so that OCIBindByName() sets the length to -1 if element size is > 4000. This provides better support
+for LONGs.
+<p>Added SetDateLocale() support for netherlands (Nl).
+<p>Spelling error in pivot code ($iff should be $iif).
+</p><p>mysql insert_id() did not work with mysql 3.x. Fixed.
+</p><p>"\r\n" not converted to spaces correctly in exporting data. Fixed.
+</p><p>_nconnect() in mysqli did not return value correctly. Fixed.
+</p><p>Arne Eckmann contributed danish language file.
+</p><p>Added clone() support to FetchObject() for PHP5.<br>
+</p>
+<p>Removed SQL_CUR_USE_ODBC from odbc_mssql.<br>
+</p>
+<p><a name="4.55"></a><b>4.55 5 Jan 2005</b>
+</p><p>Found bug in Execute() with bind params for db's that do not support binding natively.
+</p><p>DropSequence() now correctly uses default parameter.
+</p><p>Now Execute() ignores locale for floats, so 1.23 is NEVER converted to 1,23.
+</p><p>SetFetchMode() not properly saved in adodb-perf, suspicious sql and expensive sql. Fixed.
+</p><p>Added INET to postgresql metatypes. Thx motzel.
+</p><p>Allow oracle hints to work when counting with _adodb_getcount in adodb-lib.inc.php. Thx Chris Wrye.
+</p><p>Changed mysql insert_id() to use SELECT LAST_INSERT_ID().
+</p><p>If alter col in datadict does not modify col type/size of actual
+col, then it is removed from alter col code. By Mark Newham. Not
+perfect as MetaType() !== ActualType().
+</p><p>Added handling of view fields in metacolumns() for postgresql. Thx Renato De Giovanni.
+</p><p>Added to informix MetaPrimaryKeys and MetaColumns fixes for null bit. Thx to Cecilio Albero.
+</p><p>Removed obsolete connection_timeout() from perf code.
+</p><p>Added support for arrayClass in adodb-csv.inc.php.
+</p><p>RSFilter now accepts methods of the form $array($obj, 'methodname'). Thx to blake#near-time.com.
+</p><p>Changed CacheFlush to $cmd = 'rm -rf '.$ADODB_CACHE_DIR.'/[0-9a-f][0-9a-f]/'; 
+</p><p>For better cursor concurrency, added code to free ref cursors in
+oci8 when $rs-&gt;Close() is called. Note that CLose() is called
+internally by the Get* functions too.
+</p><p>Added IIF support for access when pivoting.  Thx Volodia Krupach.
+</p><p>Added mssql datadict support for timestamp. Thx Alexios.
+</p><p>Informix pager fix. By Mario Ramirez.
+</p><p>ADODB_TABLE_REGEX now includes ':'. By Mario Ramirez.
+</p><p>Mark Newnham contributed MetaIndexes for oci8 and db2.
+</p><p><a name="4.54"></a><b>4.54 5 Nov 2004</b>
+</p><p>
+Now you can set $db-&gt;charSet = ?? before doing a Connect() in oci8.
+</p><p>
 Added adodbFetchMode to sqlite.
-<p>
+</p><p>
 Perf code, added a string typecast to substr in adodb_log_sql().
-<p>
+</p><p>
 Postgres: Changed BlobDecode() to use po_loread, added new $maxblobsize parameter, and now it returns the blob instead
 of sending it to stdout - make sure to mention that as a compat warning.
-Also added $db->IsOID($oid) function; uses a heuristic, not guaranteed to work 100%.
-<p>
+Also added $db-&gt;IsOID($oid) function; uses a heuristic, not guaranteed to work 100%.
+</p><p>
 Contributed arabic language file by "El-Shamaa, Khaled" k.el-shamaa#cgiar.org
-<p>
+</p><p>
 PHP5 exceptions did not handle @ protocol properly. Fixed.
-<p>
+</p><p>
 Added ifnull handling for postgresql (using coalesce).
-<p>
+</p><p>
 Added  metatables() support for Postgresql 8.0 (no longer uses pg_% dictionary tables).
-<p>
+</p><p>
 Improved Sybase ErrorMsg() function. By Gaetano Giunta.
-<p>
+</p><p>
 Improved oci8 SelectLimit() to use Prepare(). By Cristiano Duarte.
-<P>
+</p><p>
 Type-cast $row parameter in ifx_fetch_row() to int. Thx stefan bodgan.
-<p>Ralf becker contributed improvements in postgresql, sapdb, mysql data dictionary handling:<br>
+</p><p>Ralf becker contributed improvements in postgresql, sapdb, mysql data dictionary handling:<br>
 - MySql and Postgres MetaType was reporting every int column which was 
 part of a primary key and unique as serial<br>
 - Postgres was not reporting the scale of decimal types<br>
 - MaxDB was padding the defaults of none-string types with spaces<br>
 - MySql now correctly converts enum columns to varchar
-<p>
+</p><p>
 Ralf also changed Postgresql datadict:<br>
 - you cant add NOT NULL columns in postgres in one go, they need to be 
 added as NULL and then altered to NOT NULL<br>
@@ -2701,418 +2936,299 @@
 - a re-created sequence was not set to the correct value, if the name 
 was the old name (no implicit sequence), now always the new name of the 
 implicit sequence is used<br>
-<p>Sergio Strampelli added extra $intoken check to Lens_ParseArgs() in datadict code.
-<p><a name="4.53"></a><b>4.53 28 Sept 2004</b>
-</p><p><font color="#000000">FetchMode cached in recordset is sometimes mapped to native db fetchMode. Normally this does not matter,
+</p><p>Sergio Strampelli added extra $intoken check to Lens_ParseArgs() in datadict code.
+</p><p><a name="4.53"></a><b>4.53 28 Sept 2004</b>
+</p><p>FetchMode cached in recordset is sometimes mapped to native db fetchMode. Normally this does not matter,
 but when using cached recordsets, we need to switch back to using adodb fetchmode.  So we cache this
 in $rs-&gt;adodbFetchMode if it differs from the db's fetchMode.
-</font></p><p><font color="#000000">For informix we now set canSeek = false driver because stefan bodgan tells me that seeking doesn't work. 
-</font></p><p><font color="#000000">SetDateLocale() never worked till now ;-) Thx david#tomato.it
-</font></p><p><font color="#000000">Set $_bindInputArray = true in sapdb driver. Required for clob support.
-</font></p><p><font color="#000000">Fixed some PEAR::DB emulation issues with isError() and isWarning. Thx to Gert-Rainer Bitterlich.
-</font></p><p><font color="#000000">Empty() used in getupdatesql without strlen() check. Fixed.</font></p>
-<p><font color="#000000">Added unsigned detection to mysql and mysqli drivers. Thx to dan cech.
-</font></p><p><font color="#000000">Added hungarian language file. Thx to Hal&aacute;szv&aacute;ri G&aacute;bor.
-</font></p><p><font color="#000000">Improved fieldname-type formatting of datadict SQL generated (adding $widespacing parameter to _GenField).
-</font></p><p><font color="#000000">Datadict oci8 DROP CONSTRAINTS misspelt. Fixed. Thx Mark Newnham.
-</font></p><p><font color="#000000">Changed odbtp to dynamically change databaseType based on connection, eg. from 'odbtp' to 'odbtp_mssql' when connecting
+</p><p>For informix we now set canSeek = false driver because stefan bodgan tells me that seeking doesn't work. 
+</p><p>SetDateLocale() never worked till now ;-) Thx david#tomato.it
+</p><p>Set $_bindInputArray = true in sapdb driver. Required for clob support.
+</p><p>Fixed some PEAR::DB emulation issues with isError() and isWarning. Thx to Gert-Rainer Bitterlich.
+</p><p>Empty() used in getupdatesql without strlen() check. Fixed.</p>
+<p>Added unsigned detection to mysql and mysqli drivers. Thx to dan cech.
+</p><p>Added hungarian language file. Thx to Hal&aacute;szv&aacute;ri G&aacute;bor.
+</p><p>Improved fieldname-type formatting of datadict SQL generated (adding $widespacing parameter to _GenField).
+</p><p>Datadict oci8 DROP CONSTRAINTS misspelt. Fixed. Thx Mark Newnham.
+</p><p>Changed odbtp to dynamically change databaseType based on connection, eg. from 'odbtp' to 'odbtp_mssql' when connecting
 to mssql database.
-</font></p><p><font color="#000000">In datadict, MySQL I4 was wrongly mapped to MEDIUMINT, which is actually I3. Fixed.
-</font></p><p><font color="#000000">Fixed mysqli MetaType() recognition. Mysqli returns numeric types unlike mysql extension. Thx Francesco Riosa.
-</font></p><p><font color="#000000">VFP odbc driver curmode set wrongly, causing problems with memo fields. Fixed.
-</font></p><p><font color="#000000">Odbc driver did not recognize odbc version 2 driver date types properly. Fixed. Thx Bostjan.
-</font></p><p><font color="#000000">ChangeTableSQL() fixes to datadict-db2.inc.php by Mark Newnham.
-</font></p><p><font color="#000000">Perf monitoring with odbc improved. Now we try in perf code to manually set the sysTimeStamp using date() if sysTimeStamp
+</p><p>In datadict, MySQL I4 was wrongly mapped to MEDIUMINT, which is actually I3. Fixed.
+</p><p>Fixed mysqli MetaType() recognition. Mysqli returns numeric types unlike mysql extension. Thx Francesco Riosa.
+</p><p>VFP odbc driver curmode set wrongly, causing problems with memo fields. Fixed.
+</p><p>Odbc driver did not recognize odbc version 2 driver date types properly. Fixed. Thx Bostjan.
+</p><p>ChangeTableSQL() fixes to datadict-db2.inc.php by Mark Newnham.
+</p><p>Perf monitoring with odbc improved. Now we try in perf code to manually set the sysTimeStamp using date() if sysTimeStamp
 is empty.
-</font></p><p><font color="#000000">All ADO errors are thrown as exceptions in PHP5. 
+</p><p>All ADO errors are thrown as exceptions in PHP5. 
 So we added exception handling to ado in PHP5 by creating new adodb-ado5.inc.php driver.
-</font></p><p><font color="#000000">Added IsConnected(). Returns true if connection object connected. By Luca.Gioppo.
-</font></p><p><font color="#000000">"Ralf Becker"
+</p><p>Added IsConnected(). Returns true if connection object connected. By Luca.Gioppo.
+</p><p>"Ralf Becker"
 RalfBecker#digitalROCK.de contributed new sapdb data-dictionary driver
 and a large patch that implements field and table renaming for oracle,
 mssql, postgresql, mysql and sapdb. See the new RenameTableSQL() and
 RenameColumnSQL() functions.
-</font></p><p><font color="#000000">We now check ExecuteCursor to see if PrepareSP was initially called.
-</font></p><p><font color="#000000">Changed oci8 datadict to use MODIFY for $dd-&gt;alterCol. Thx Mark Newnham.
-</font></p><p><font color="#000000"><a name="4.52"></a><b>4.52  10 Aug 2004</b>
-</font></p><p><font color="#000000">Bug found in Replace() when performance logging enabled, introduced in ADOdb 4.50. Fixed.
-</font></p><p><font color="#000000">Replace() checks update stmt. If update stmt fails, we now return immediately. Thx to alex.
-</font></p><p><font color="#000000">Added support for $ADODB_FORCE_TYPE in GetUpdateSQL/GetInsertSQL. Thx to niko.
-</font></p><p><font color="#000000">Added ADODB_ASSOC_CASE support to postgres/postgres7 driver.
-</font></p><p><font color="#000000">Support for DECLARE stmt in oci8. Thx Lochbrunner.
-</font></p><p><font color="#000000"><a name="4.51"></a><b>4.51  29 July  2004</b>
-</font></p><p><font color="#000000">Added adodb-xmlschema 1.0.2. Thx dan and richard.
-</font></p><p><font color="#000000">Added new adorecordset_ext_* classes. If ADOdb extension installed for mysql, mysqlt and oci8 
+</p><p>We now check ExecuteCursor to see if PrepareSP was initially called.
+</p><p>Changed oci8 datadict to use MODIFY for $dd-&gt;alterCol. Thx Mark Newnham.
+</p><p><a name="4.52"></a><b>4.52  10 Aug 2004</b>
+</p><p>Bug found in Replace() when performance logging enabled, introduced in ADOdb 4.50. Fixed.
+</p><p>Replace() checks update stmt. If update stmt fails, we now return immediately. Thx to alex.
+</p><p>Added support for $ADODB_FORCE_TYPE in GetUpdateSQL/GetInsertSQL. Thx to niko.
+</p><p>Added ADODB_ASSOC_CASE support to postgres/postgres7 driver.
+</p><p>Support for DECLARE stmt in oci8. Thx Lochbrunner.
+</p><p><a name="4.51"></a><b>4.51  29 July  2004</b>
+</p><p>Added adodb-xmlschema 1.0.2. Thx dan and richard.
+</p><p>Added new adorecordset_ext_* classes. If ADOdb extension installed for mysql, mysqlt and oci8 
 (but not oci8po),  we use the superfast ADOdb extension code for movenext.
-</font></p><p><font color="#000000">Added schema support to mssql and odbc_mssql MetaPrimaryKeys().
-</font></p><p><font color="#000000">Patched MSSQL driver to support PHP NULL and Boolean values 
+</p><p>Added schema support to mssql and odbc_mssql MetaPrimaryKeys().
+</p><p>Patched MSSQL driver to support PHP NULL and Boolean values 
 while binding the input array parameters in the _query() function. By Stephen Farmer.
-</font></p><p><font color="#000000">Added support for clob's for mssql,  UpdateBlob(). Thx to gfran#directa.com.br
-</font></p><p><font color="#000000">Added normalize support for postgresql (true=lowercase table name, or false=case-sensitive table names) 
+</p><p>Added support for clob's for mssql,  UpdateBlob(). Thx to gfran#directa.com.br
+</p><p>Added normalize support for postgresql (true=lowercase table name, or false=case-sensitive table names) 
 to MetaColumns($table, $normalize=true).
-</font></p><p><font color="#000000">PHP5 variant dates in ADO not working. Fixed in adodb-ado.inc.php.
-</font></p><p><font color="#000000">Constant ADODB_FORCE_NULLS was not working properly for many releases (for GetUpdateSQL). Fixed. 
+</p><p>PHP5 variant dates in ADO not working. Fixed in adodb-ado.inc.php.
+</p><p>Constant ADODB_FORCE_NULLS was not working properly for many releases (for GetUpdateSQL). Fixed. 
 Also GetUpdateSQL strips off ORDER BY now - thx Elieser Le&atilde;o.
-</font></p><p><font color="#000000">Perf Monitor for oci8 now dynamically highlights optimizer_* params if too high/low.
-</font></p><p><font color="#000000">Added dsn support to NewADOConnection/ADONewConnection.
-</font></p><p><font color="#000000">Fixed out of page bounds bug in _adodb_pageexecute_all_rows() Thx to "Sergio Strampelli" sergio#rir.it
-</font></p><p><font color="#000000">Speedup of movenext for mysql and oci8 drivers.
-</font></p><p><font color="#000000">Moved debugging code _adodb_debug_execute() to adodb-lib.inc.php.
-</font></p><p><font color="#000000">Fixed postgresql bytea detection bug. See http://phplens.com/lens/lensforum/msgs.php?id=9849.
-</font></p><p><font color="#000000">Fixed ibase datetimestamp typo in PHP5. Thx stefan.
-</font></p><p><font color="#000000">Removed whitespace at end of odbtp drivers.
-</font></p><p><font color="#000000">Added db2 metaprimarykeys fix.
-</font></p><p><font color="#000000">Optimizations to MoveNext() for mysql and oci8. Misc speedups to Get* functions.
-</font></p><p><font color="#000000"><a name="4.50"></a><b>4.50  6 July  2004</b>
-</font></p><p><font color="#000000">Bumped it to 4.50 to avoid confusion with PHP 4.3.x series.
-</font></p><p><font color="#000000">Added db2 metatables and metacolumns extensions.
-</font></p><p><font color="#000000">Added alpha PDO driver. Very buggy, only works with odbc.
-</font></p><p><font color="#000000">Tested mysqli. Set poorAffectedRows = true. Cleaned up movenext() and _fetch().
-</font></p><p><font color="#000000">PageExecute does not work properly with php5 (return val not a variable). Reported Dmytro Sychevsky sych#php.com.ua.  Fixed.
-</font></p><p><font color="#000000">MetaTables() for mysql, $showschema parameter was not backward compatible with older versions of adodb. Fixed.
-</font></p><p><font color="#000000">Changed mysql GetOne() to work with mysql 3.23 when using with non-select stmts (e.g. SHOW TABLES).
-</font></p><p><font color="#000000">Changed TRIG_ prefix to a variable in datadict-oci8.inc.php. Thx to Luca.Gioppo#csi.it.
-</font></p><p><font color="#000000">New to adodb-time code. We allow you to define your own daylights savings function, 
+</p><p>Perf Monitor for oci8 now dynamically highlights optimizer_* params if too high/low.
+</p><p>Added dsn support to NewADOConnection/ADONewConnection.
+</p><p>Fixed out of page bounds bug in _adodb_pageexecute_all_rows() Thx to "Sergio Strampelli" sergio#rir.it
+</p><p>Speedup of movenext for mysql and oci8 drivers.
+</p><p>Moved debugging code _adodb_debug_execute() to adodb-lib.inc.php.
+</p><p>Fixed postgresql bytea detection bug. See http://phplens.com/lens/lensforum/msgs.php?id=9849.
+</p><p>Fixed ibase datetimestamp typo in PHP5. Thx stefan.
+</p><p>Removed whitespace at end of odbtp drivers.
+</p><p>Added db2 metaprimarykeys fix.
+</p><p>Optimizations to MoveNext() for mysql and oci8. Misc speedups to Get* functions.
+</p><p><a name="4.50"></a><b>4.50  6 July  2004</b>
+</p><p>Bumped it to 4.50 to avoid confusion with PHP 4.3.x series.
+</p><p>Added db2 metatables and metacolumns extensions.
+</p><p>Added alpha PDO driver. Very buggy, only works with odbc.
+</p><p>Tested mysqli. Set poorAffectedRows = true. Cleaned up movenext() and _fetch().
+</p><p>PageExecute does not work properly with php5 (return val not a variable). Reported Dmytro Sychevsky sych#php.com.ua.  Fixed.
+</p><p>MetaTables() for mysql, $showschema parameter was not backward compatible with older versions of adodb. Fixed.
+</p><p>Changed mysql GetOne() to work with mysql 3.23 when using with non-select stmts (e.g. SHOW TABLES).
+</p><p>Changed TRIG_ prefix to a variable in datadict-oci8.inc.php. Thx to Luca.Gioppo#csi.it.
+</p><p>New to adodb-time code. We allow you to define your own daylights savings function, 
 adodb_daylight_sv for pre-1970 dates. If the function is defined 
 (somewhere in an include), then you can correct 
 for daylights savings. See http://phplens.com/phpeverywhere/node/view/16#daylightsavings
 for more info.
-</font></p><p><font color="#000000">New sqlitepo driver. This is because assoc mode does not work like other drivers in sqlite.
+</p><p>New sqlitepo driver. This is because assoc mode does not work like other drivers in sqlite.
    Namely, when selecting (joining) multiple tables, in assoc mode the table
    	  names are included in the assoc keys in the "sqlite" driver.
 	  In "sqlitepo" driver, the table names are stripped from the returned column names. 
 	  When this results in a conflict,  the first field get preference.
 	Contributed by Herman Kuiper  herman#ozuzo.net  
-</font></p><p><font color="#000000">Added $forcenull parameter to GetInsertSQL/GetUpdateSQL. Idea by Marco Aurelio Silva.
-</font></p><p><font color="#000000">More XHTML changes for GetMenu. By Jeremy Evans.
-</font></p><p><font color="#000000">Fixes some ibase date issues. Thx to stefan bogdan.
-</font></p><p><font color="#000000">Improvements to mysqli driver to support $ADODB_COUNTRECS.
-</font></p><p><font color="#000000">Fixed adodb-csvlib.inc.php problem when reading stream from socket. We need to poll stream continiously.
-</font></p><p><font color="#000000"><a name="4.23"></a><b>4.23  16 June   2004</b>
-</font></p><p>
-<font color="#000000">New interbase/firebird fixes thx to Lester Caine.
+</p><p>Added $forcenull parameter to GetInsertSQL/GetUpdateSQL. Idea by Marco Aurelio Silva.
+</p><p>More XHTML changes for GetMenu. By Jeremy Evans.
+</p><p>Fixes some ibase date issues. Thx to stefan bogdan.
+</p><p>Improvements to mysqli driver to support $ADODB_COUNTRECS.
+</p><p>Fixed adodb-csvlib.inc.php problem when reading stream from socket. We need to poll stream continiously.
+</p><p><a name="4.23"></a><b>4.23  16 June   2004</b>
+</p><p>
+New interbase/firebird fixes thx to Lester Caine.
 Driver fixes a problem with getting field names in the result array, and 
 corrects a couple of data conversions. Also we default to dialect3 for firebird.
 Also ibase sysDate property was wrong. Changed to cast as timestamp.
-</font></p><p>
-<font color="#000000">The datadict driver is set up to give quoted tables and fields as this 
+</p><p>
+The datadict driver is set up to give quoted tables and fields as this 
 was the only way round reserved words being used as field names in 
 TikiWiki. TikiPro is tidying that up, and I hope to be able to produce a 
 build of THAT which uses what I consider proper UPPERCASE field and 
 table names. The conversion of TikiWiki to ADOdb helped in that, but 
 until the database is completely tidied up in TikiPro ...
-</font></p><p><font color="#000000">Modified _gencachename() to include fetchmode in name hash.
+</p><p>Modified _gencachename() to include fetchmode in name hash.
 This means you should clear your cache directory after installing this release as the 
 cache name algorithm has changed.
-</font></p><p><font color="#000000">Now Cache* functions work in safe
+</p><p>Now Cache* functions work in safe
 mode, because we do not create sub-directories in the $ADODB_CACHE_DIR
 in safe mode. In non-safe mode we still create sub-directories. Done by
 modifying _gencachename().
-</font></p><p><font color="#000000">Added $gmt parameter (true/false)
+</p><p>Added $gmt parameter (true/false)
 to UserDate and UserTimeStamp in connection class, to force conversion
 of input (in local time) to be converted to UTC/GMT.
-</font></p><p><font color="#000000">Mssql datadict did not support INT types properly (no size param allowed). 
+</p><p>Mssql datadict did not support INT types properly (no size param allowed). 
 Added _GetSize() to datadict-mssql.inc.php.
-</font></p><p><font color="#000000">For borland_ibase, BeginTrans(), changed:<br>
-</font></p><pre><font color="#000000">   $this-&gt;_transactionID = $this-&gt;_connectionID;</font></pre>
-<font color="#000000">to<br>
-</font><pre><font color="#000000">   $this-&gt;_transactionID = ibase_trans($this-&gt;ibasetrans, $this-&gt;_connectionID);</font></pre>
-<font color="#000000">		
-</font><p><font color="#000000">Fixed typo in mysqi_field_seek(). Thx to Sh4dow (sh4dow#php.pl).
-</font></p><p><font color="#000000">LogSQL did not work with Firebird/Interbase. Fixed.
-</font></p><p><font color="#000000">Postgres: made errorno() handling more consistent. Thx to Michael Jahn, Michael.Jahn#mailbox.tu-dresden.de.
-</font></p><p><font color="#000000">Added informix patch to better support metatables, metacolumns by "Cecilio Albero" c-albero#eos-i.com
-</font></p><p><font color="#000000">Cyril Malevanov contributed patch to oci8 to support passing of LOB parameters:
-</font></p><pre><font color="#000000">	$text = 'test test test';<br>	$sql = "declare rs clob; begin :rs := lobinout(:sa0); end;";<br>	$stmt = $conn -&gt; PrepareSP($sql);<br>	$conn -&gt; InParameter($stmt,$text,'sa0', -1, OCI_B_CLOB);<br>	$rs = '';<br>	$conn -&gt; OutParameter($stmt,$rs,'rs', -1, OCI_B_CLOB);<br>	$conn -&gt; Execute($stmt);<br>	echo "return = ".$rs."&lt;br&gt;";<br></font></pre>
-<font color="#000000">As he says, the LOBs limitations are:
-</font><pre><font color="#000000"> - use OCINewDescriptor before binding<br> - if Param is IN, uses save() before each execute. This is done automatically for you.<br> - if Param is OUT, uses load() after each execute. This is done automatically for you.<br> - when we bind $var as LOB, we create new descriptor and return it as a<br>   Bind Result, so if we want to use OUT parameters, we have to store<br>   somewhere &amp;$var to load() data from LOB to it.<br> - IN OUT params are not working now (should not be a big problem to fix it)<br> - now mass binding not working too (I've wrote about it before)<br></font></pre>
-<p><font color="#000000">Simplified Connect() and PConnect() error handling.
-</font></p><p><font color="#000000">When extension not loaded, Connect() and PConnect() will return null. On connect error, the fns will return false.
-</font></p><p><font color="#000000">CacheGetArray() added to code.
-</font></p><p><font color="#000000">Added Init() to adorecordset_empty().
-</font></p><p><font color="#000000">Changed postgres64 driver, MetaColumns() to not strip off quotes in default value if :: detected (type-casting of default).
-</font></p><p><font color="#000000">Added test: if (!defined('ADODB_DIR')) die(). Useful to prevent hackers from detecting file paths.
-</font></p><p><font color="#000000">Changed metaTablesSQL to ignore Postgres 7.4 information schemas (sql_*).
-</font></p><p><font color="#000000">New polish language file by  Grzegorz Pacan
-</font></p><p><font color="#000000">Added support for UNION in _adodb_getcount().
-</font></p><p><font color="#000000">Added security check for ADODB_DIR to limit path disclosure issues. Requested by postnuke team.
-</font></p><p><font color="#000000">Added better error message support to oracle driver. Thx to Gaetano Giunta.
-</font></p><p><font color="#000000">Added showSchema support to mysql.
-</font></p><p><font color="#000000">Bind in oci8 did not handle $name=false properly. Fixed.
-</font></p><p><font color="#000000">If extension not loaded, Connect(), PConnect(), NConnect() will return null.
-</font></p><p><font color="#000000"><b>4.22  15 Apr   2004</b>
-</font></p><p><font color="#000000">Moved docs to own adodb/docs folder.
-</font></p><p><font color="#000000">Fixed session bug when quoting compressed/encrypted data in Replace().
-</font></p><p><font color="#000000">Netezza Driver and LDAP drivers contributed by Josh Eldridge.
-</font></p><p><font color="#000000">GetMenu now uses rtrim() on values instead of trim().
-</font></p><p><font color="#000000">Changed MetaColumnNames to return an associative array, keys being the field names in uppercase.
-</font></p><p><font color="#000000">Suggested fix to adodb-ado.inc.php affected_rows to support PHP5 variants. Thx to Alexios Fakos.
-</font></p><p><font color="#000000">Contributed bulgarian language file by Valentin Sheiretsky valio#valio.eu.org.
-</font></p><p><font color="#000000">Contributed romanian language file by stefan bogdan.
-</font></p><p><font color="#000000">GetInsertSQL now checks for table name (string) in $rs, and will create a recordset for that
+</p><p>For borland_ibase, BeginTrans(), changed:<br>
+</p><pre>   $this-&gt;_transactionID = $this-&gt;_connectionID;</pre>
+to<br>
+<pre>   $this-&gt;_transactionID = ibase_trans($this-&gt;ibasetrans, $this-&gt;_connectionID);</pre>
+		
+<p>Fixed typo in mysqi_field_seek(). Thx to Sh4dow (sh4dow#php.pl).
+</p><p>LogSQL did not work with Firebird/Interbase. Fixed.
+</p><p>Postgres: made errorno() handling more consistent. Thx to Michael Jahn, Michael.Jahn#mailbox.tu-dresden.de.
+</p><p>Added informix patch to better support metatables, metacolumns by "Cecilio Albero" c-albero#eos-i.com
+</p><p>Cyril Malevanov contributed patch to oci8 to support passing of LOB parameters:
+</p><pre>	$text = 'test test test';<br>	$sql = "declare rs clob; begin :rs := lobinout(:sa0); end;";<br>	$stmt = $conn -&gt; PrepareSP($sql);<br>	$conn -&gt; InParameter($stmt,$text,'sa0', -1, OCI_B_CLOB);<br>	$rs = '';<br>	$conn -&gt; OutParameter($stmt,$rs,'rs', -1, OCI_B_CLOB);<br>	$conn -&gt; Execute($stmt);<br>	echo "return = ".$rs."&lt;br&gt;";<br></pre>
+As he says, the LOBs limitations are:
+<pre> - use OCINewDescriptor before binding<br> - if Param is IN, uses save() before each execute. This is done automatically for you.<br> - if Param is OUT, uses load() after each execute. This is done automatically for you.<br> - when we bind $var as LOB, we create new descriptor and return it as a<br>   Bind Result, so if we want to use OUT parameters, we have to store<br>   somewhere &amp;$var to load() data from LOB to it.<br> - IN OUT params are not working now (should not be a big problem to fix it)<br> - now mass binding not working too (I've wrote about it before)<br></pre>
+<p>Simplified Connect() and PConnect() error handling.
+</p><p>When extension not loaded, Connect() and PConnect() will return null. On connect error, the fns will return false.
+</p><p>CacheGetArray() added to code.
+</p><p>Added Init() to adorecordset_empty().
+</p><p>Changed postgres64 driver, MetaColumns() to not strip off quotes in default value if :: detected (type-casting of default).
+</p><p>Added test: if (!defined('ADODB_DIR')) die(). Useful to prevent hackers from detecting file paths.
+</p><p>Changed metaTablesSQL to ignore Postgres 7.4 information schemas (sql_*).
+</p><p>New polish language file by  Grzegorz Pacan
+</p><p>Added support for UNION in _adodb_getcount().
+</p><p>Added security check for ADODB_DIR to limit path disclosure issues. Requested by postnuke team.
+</p><p>Added better error message support to oracle driver. Thx to Gaetano Giunta.
+</p><p>Added showSchema support to mysql.
+</p><p>Bind in oci8 did not handle $name=false properly. Fixed.
+</p><p>If extension not loaded, Connect(), PConnect(), NConnect() will return null.
+</p><p><b>4.22  15 Apr   2004</b>
+</p><p>Moved docs to own adodb/docs folder.
+</p><p>Fixed session bug when quoting compressed/encrypted data in Replace().
+</p><p>Netezza Driver and LDAP drivers contributed by Josh Eldridge.
+</p><p>GetMenu now uses rtrim() on values instead of trim().
+</p><p>Changed MetaColumnNames to return an associative array, keys being the field names in uppercase.
+</p><p>Suggested fix to adodb-ado.inc.php affected_rows to support PHP5 variants. Thx to Alexios Fakos.
+</p><p>Contributed bulgarian language file by Valentin Sheiretsky valio#valio.eu.org.
+</p><p>Contributed romanian language file by stefan bogdan.
+</p><p>GetInsertSQL now checks for table name (string) in $rs, and will create a recordset for that
 table automatically. Contributed by Walt Boring. Also added OCI_B_BLOB in bind on Walt's request - hope
 it doesn't break anything :-)
-</font></p><p><font color="#000000">Some minor postgres speedups in _initrs().
-</font></p><p><font color="#000000"> ChangeTableSQL checks now if MetaColumns returns empty. Thx Jason Judge.
-</font></p><p><font color="#000000">Added ADOConnection::Time(), returns current database time in unix timestamp format, or false.
-</font></p><p><font color="#000000"><b>4.21 20 Mar 2004</b>
-</font></p><p><font color="#000000">We no longer in SelectLimit for VFP driver add SELECT TOP X unless an ORDER BY exists.
-</font></p><p><font color="#000000">Pim Koeman contributed dutch language file adodb-nl.inc.php.
-</font></p><p><font color="#000000">Rick Hickerson added CLOB support to db2 datadict.
-</font></p><p><font color="#000000">Added odbtp driver. Thx to "stefan bogdan" sbogdan#rsb.ro.
-</font></p><p><font color="#000000">Changed PrepareSP() 2nd parameter, $cursor, to default to true (formerly false). Fixes oci8 backward
+</p><p>Some minor postgres speedups in _initrs().
+</p><p> ChangeTableSQL checks now if MetaColumns returns empty. Thx Jason Judge.
+</p><p>Added ADOConnection::Time(), returns current database time in unix timestamp format, or false.
+</p><p><b>4.21 20 Mar 2004</b>
+</p><p>We no longer in SelectLimit for VFP driver add SELECT TOP X unless an ORDER BY exists.
+</p><p>Pim Koeman contributed dutch language file adodb-nl.inc.php.
+</p><p>Rick Hickerson added CLOB support to db2 datadict.
+</p><p>Added odbtp driver. Thx to "stefan bogdan" sbogdan#rsb.ro.
+</p><p>Changed PrepareSP() 2nd parameter, $cursor, to default to true (formerly false). Fixes oci8 backward
 compat problems with OUT params.
-</font></p><p><font color="#000000">Fixed month calculation error in adodb-time.inc.php. 2102-June-01 appeared as 2102-May-32.
-</font></p><p><font color="#000000">Updated PHP5 RC1 iterator support. API changed, hasMore() renamed to valid().
-</font></p><p><font color="#000000">Changed internal format of serialized cache recordsets. As we store a version number, this should be
+</p><p>Fixed month calculation error in adodb-time.inc.php. 2102-June-01 appeared as 2102-May-32.
+</p><p>Updated PHP5 RC1 iterator support. API changed, hasMore() renamed to valid().
+</p><p>Changed internal format of serialized cache recordsets. As we store a version number, this should be
 backward compatible.
-</font></p><p><font color="#000000">Error handling when driver file not found was flawed in ADOLoadCode(). Fixed.
-</font></p><p><font color="#000000"><b>4.20 27 Feb 2004</b>
-</font></p><p><font color="#000000">Updated to AXMLS 1.01.
-</font></p><p><font color="#000000">MetaForeignKeys for postgres7 modified by Edward Jaramilla, works on pg 7.4.
-</font></p><p><font color="#000000">Now numbers accepts function calls or sequences for GetInsertSQL/GetUpdateSQL numeric fields.
-</font></p><p><font color="#000000">Changed quotes of 'delete from $perf_table' to "". Thx Kehui (webmaster#kehui.net)
-</font></p><p><font color="#000000">Added ServerInfo() for ifx, and putenv trim fix. Thx Fernando Ortiz.
-</font></p><p><font color="#000000">Added addq(), which is analogous to addslashes().
-</font></p><p><font color="#000000">Tested with php5b4. Fix some php5 compat problems with exceptions and sybase.
-</font></p><p><font color="#000000">Carl-Christian Salvesen added patch to mssql _query to support binds greater than 4000 chars.
-</font></p><p><font color="#000000">Mike suggested patch to PHP5 exception handler. $errno must be numeric.
-</font></p><p><font color="#000000">Added double quotes (") to ADODB_TABLE_REGEX.
-</font></p><p><font color="#000000">For oci8, Prepare(...,$cursor),
+</p><p>Error handling when driver file not found was flawed in ADOLoadCode(). Fixed.
+</p><p><b>4.20 27 Feb 2004</b>
+</p><p>Updated to AXMLS 1.01.
+</p><p>MetaForeignKeys for postgres7 modified by Edward Jaramilla, works on pg 7.4.
+</p><p>Now numbers accepts function calls or sequences for GetInsertSQL/GetUpdateSQL numeric fields.
+</p><p>Changed quotes of 'delete from $perf_table' to "". Thx Kehui (webmaster#kehui.net)
+</p><p>Added ServerInfo() for ifx, and putenv trim fix. Thx Fernando Ortiz.
+</p><p>Added addq(), which is analogous to addslashes().
+</p><p>Tested with php5b4. Fix some php5 compat problems with exceptions and sybase.
+</p><p>Carl-Christian Salvesen added patch to mssql _query to support binds greater than 4000 chars.
+</p><p>Mike suggested patch to PHP5 exception handler. $errno must be numeric.
+</p><p>Added double quotes (") to ADODB_TABLE_REGEX.
+</p><p>For oci8, Prepare(...,$cursor),
 $cursor's meaning was accidentally inverted in 4.11. This causes
 problems with ExecuteCursor() too, which calls Prepare() internally.
 Thx to William Lovaton.
-</font></p><p><font color="#000000">Now dateHasTime property in connection object renamed to datetime for consistency. This could break bc.
-</font></p><p><font color="#000000">Csongor Halmai reports that db2 SelectLimit with input array is not working. Fixed..
-</font></p><p><font color="#000000"><b>4.11 27 Jan 2004</b>
-</font></p><p><font color="#000000">Csongor Halmai reports db2 binding not working. Reverted back to emulated binding.
-</font></p><p><font color="#000000">Dan Cech modifies datadict code. Adds support for DropIndex. Minor cleanups.
-</font></p><p><font color="#000000">Table misspelt in perf-oci8.inc.php. Changed v$conn_cache_advice to v$db_cache_advice. Reported by Steve W.
-</font></p><p><font color="#000000">UserTimeStamp and DBTimeStamp did not handle YYYYMMDDHHMMSS format properly. Reported by Mike Muir. Fixed.
-</font></p><p><font color="#000000">Changed oci8 Prepare(). Does not auto-allocate OCINewCursor automatically, unless 2nd param is set to true.
+</p><p>Now dateHasTime property in connection object renamed to datetime for consistency. This could break bc.
+</p><p>Csongor Halmai reports that db2 SelectLimit with input array is not working. Fixed..
+</p><p><b>4.11 27 Jan 2004</b>
+</p><p>Csongor Halmai reports db2 binding not working. Reverted back to emulated binding.
+</p><p>Dan Cech modifies datadict code. Adds support for DropIndex. Minor cleanups.
+</p><p>Table misspelt in perf-oci8.inc.php. Changed v$conn_cache_advice to v$db_cache_advice. Reported by Steve W.
+</p><p>UserTimeStamp and DBTimeStamp did not handle YYYYMMDDHHMMSS format properly. Reported by Mike Muir. Fixed.
+</p><p>Changed oci8 Prepare(). Does not auto-allocate OCINewCursor automatically, unless 2nd param is set to true.
 This will break backward compat, if Prepare/Execute is used instead of ExecuteCursor. Reported by Chris Jones.
-</font></p><p><font color="#000000">Added InParameter() and OutParameter(). Wrapper functions to Parameter(), but nicer because they
+</p><p>Added InParameter() and OutParameter(). Wrapper functions to Parameter(), but nicer because they
 are self-documenting.
-</font></p><p><font color="#000000">Added 'R' handling in ActualType() to datadict-mysql.inc.php
-</font></p><p><font color="#000000">Added ADOConnection::SerializableRS($rs). Returns a recordset that can be serialized in a session.
-</font></p><p><font color="#000000">Added "Run SQL" to performance UI().
-</font></p><p><font color="#000000">Misc spelling corrections in adodb-mysqli.inc.php, adodb-oci8.inc.php and datadict-oci8.inc.php, from Heinz Hombergs.
-</font></p><p><font color="#000000">MetaIndexes() for ibase contributed by Heinz Hombergs.
-</font></p><p><font color="#000000"><b>4.10 12 Jan 2004</b>
-</font></p><p><font color="#000000">Dan Cech contributed extensive changes to data dictionary to support name quoting (with `), and drop table/index.
-</font></p><p><font color="#000000">Informix added cursorType property. Default remains IFX_SCROLL, but you can change to 0 (non-scrollable cursor) for performance.
-</font></p><p><font color="#000000">Added ADODB_View_PrimaryKeys() for returning view primary keys to MetaPrimaryKeys().
-</font></p><p><font color="#000000">Simplified chinese file, adodb-cn.inc.php from cysoft.
-</font></p><p><font color="#000000">Added check for ctype_alnum in adodb-datadict.inc.php. Thx to Jason Judge.
-</font></p><p><font color="#000000">Added connection parameter to ibase Prepare(). Fix by Daniel Hassan.
-</font></p><p><font color="#000000">Added nameQuote for quoting identifiers and names to connection obj. Requested by Jason Judge. Also the
+</p><p>Added 'R' handling in ActualType() to datadict-mysql.inc.php
+</p><p>Added ADOConnection::SerializableRS($rs). Returns a recordset that can be serialized in a session.
+</p><p>Added "Run SQL" to performance UI().
+</p><p>Misc spelling corrections in adodb-mysqli.inc.php, adodb-oci8.inc.php and datadict-oci8.inc.php, from Heinz Hombergs.
+</p><p>MetaIndexes() for ibase contributed by Heinz Hombergs.
+</p><p><b>4.10 12 Jan 2004</b>
+</p><p>Dan Cech contributed extensive changes to data dictionary to support name quoting (with `), and drop table/index.
+</p><p>Informix added cursorType property. Default remains IFX_SCROLL, but you can change to 0 (non-scrollable cursor) for performance.
+</p><p>Added ADODB_View_PrimaryKeys() for returning view primary keys to MetaPrimaryKeys().
+</p><p>Simplified chinese file, adodb-cn.inc.php from cysoft.
+</p><p>Added check for ctype_alnum in adodb-datadict.inc.php. Thx to Jason Judge.
+</p><p>Added connection parameter to ibase Prepare(). Fix by Daniel Hassan.
+</p><p>Added nameQuote for quoting identifiers and names to connection obj. Requested by Jason Judge. Also the
 data dictionary parser now detects `field name` and generates column names with spaces correctly.
-</font></p><p><font color="#000000">BOOL type not recognised correctly as L. Fixed.
-</font></p><p><font color="#000000">Fixed paths in ADODB_DIR for session files, and back-ported it to 4.05 (15 Dec 2003)
-</font></p><p><font color="#000000">Added Schema to postgresql MetaTables. Thx to col#gear.hu
-</font></p><p><font color="#000000">Empty postgresql recordsets that had blob fields did not set EOF properly. Fixed.
-</font></p><p><font color="#000000">CacheSelectLimit internal parameters to SelectLimit were wrong. Thx to Nio.
-</font></p><p><font color="#000000">Modified adodb_pr() and adodb_backtrace() to support command-line usage (eg. no html).
-</font></p><p><font color="#000000">Fixed some fr and it lang errors. Thx to Gaetano G.
-</font></p><p><font color="#000000">Added contrib directory, with adodb rs to xmlrpc convertor by Gaetano G.
-</font></p><p><font color="#000000">Fixed array recordset bugs when _skiprow1 is true. Thx to Gaetano G.
-</font></p><p><font color="#000000">Fixed pivot table code when count is false.
-</font></p><p>
+</p><p>BOOL type not recognised correctly as L. Fixed.
+</p><p>Fixed paths in ADODB_DIR for session files, and back-ported it to 4.05 (15 Dec 2003)
+</p><p>Added Schema to postgresql MetaTables. Thx to col#gear.hu
+</p><p>Empty postgresql recordsets that had blob fields did not set EOF properly. Fixed.
+</p><p>CacheSelectLimit internal parameters to SelectLimit were wrong. Thx to Nio.
+</p><p>Modified adodb_pr() and adodb_backtrace() to support command-line usage (eg. no html).
+</p><p>Fixed some fr and it lang errors. Thx to Gaetano G.
+</p><p>Added contrib directory, with adodb rs to xmlrpc convertor by Gaetano G.
+</p><p>Fixed array recordset bugs when _skiprow1 is true. Thx to Gaetano G.
+</p><p>Fixed pivot table code when count is false.
+</p><p>
 
-</p><p><font color="#000000"><b>4.05 13 Dec 2003 </b>
-</font></p><p><font color="#000000">Added MetaIndexes - thx to Dan Cech.
-</font></p><p><font color="#000000">Rewritten session code by Ross Smith. Moved code to adodb/session directory.
-</font></p><p><font color="#000000">Added function exists check on connecting to most drivers, so we don't crash with the unknown function error.
-</font></p><p><font color="#000000">Smart Transactions failed with GenID() when it no seq table has been created because the sql
+</p><p><b>4.05 13 Dec 2003 </b>
+</p><p>Added MetaIndexes to data-dict code - thx to Dan Cech.
+</p><p>Rewritten session code by Ross Smith. Moved code to adodb/session directory.
+</p><p>Added function exists check on connecting to most drivers, so we don't crash with the unknown function error.
+</p><p>Smart Transactions failed with GenID() when it no seq table has been created because the sql
 	statement fails. Fix by Mark Newnham.
-</font></p><p><font color="#000000">Added $db-&gt;length, which holds name of function that returns strlen.
-</font></p><p><font color="#000000">Fixed error handling for bad driver in ADONewConnection - passed too few params to error-handler.
-</font></p><p><font color="#000000">Datadict did not handle types like 16.0 properly in _GetSize. Fixed.
-</font></p><p><font color="#000000">Oci8 driver SelectLimit() bug &amp;= instead of =&amp; used. Thx to Swen Th&uuml;mmler.
-</font></p><p><font color="#000000">Jesse Mullan suggested not flushing outp when output buffering enabled. Due to Apache 2.0 bug. Added.
-</font></p><p><font color="#000000">MetaTables/MetaColumns return ref bug with PHP5 fixed in adodb-datadict.inc.php.
-</font></p><p><font color="#000000">New mysqli driver contributed by Arjen de Rijke. Based on adodb 3.40 driver.
+</p><p>Added $db-&gt;length, which holds name of function that returns strlen.
+</p><p>Fixed error handling for bad driver in ADONewConnection - passed too few params to error-handler.
+</p><p>Datadict did not handle types like 16.0 properly in _GetSize. Fixed.
+</p><p>Oci8 driver SelectLimit() bug &amp;= instead of =&amp; used. Thx to Swen Th&uuml;mmler.
+</p><p>Jesse Mullan suggested not flushing outp when output buffering enabled. Due to Apache 2.0 bug. Added.
+</p><p>MetaTables/MetaColumns return ref bug with PHP5 fixed in adodb-datadict.inc.php.
+</p><p>New mysqli driver contributed by Arjen de Rijke. Based on adodb 3.40 driver.
 Then jlim added BeginTrans, CommitTrans, RollbackTrans, IfNull, SQLDate. Also fixed return ref bug.
-</font></p><p><font color="#000000">$ADODB_FLUSH added, if true then force flush in debugging outp. Default is false.  In earlier
+</p><p>$ADODB_FLUSH added, if true then force flush in debugging outp. Default is false.  In earlier
 versions, outp defaulted to flush, which is not compat with apache 2.0.
-</font></p><p><font color="#000000">Mysql driver's GenID() function did not work when when sql logging is on. Fixed.
-</font></p><p><font color="#000000">$ADODB_SESSION_TBL not declared as global var. Not available if adodb-session.inc.php included in function. Fixed.
-</font></p><p><font color="#000000">The input array not passed to Execute() in _adodb_getcount(). Fixed.
-</font></p><p><font color="#000000"><b>4.04 13 Nov 2003 </b>
-</font></p><p><font color="#000000">Switched back to foreach - faster than list-each.
-</font></p><p><font color="#000000">Fixed bug in ado driver - wiping out $this-&gt;fields with date fields.
-</font></p><p><font color="#000000">Performance Monitor, View SQL, Explain Plan did not work if strlen($SQL)&gt;max($_GET length). Fixed.
-</font></p><p><font color="#000000">Performance monitor, oci8 driver added memory sort ratio.
-</font></p><p><font color="#000000">Added random property, returns SQL to generate a floating point number between 0 and 1;
-</font></p><p><font color="#000000"><b>4.03 6 Nov 2003 </b>
-</font></p><p><font color="#000000">The path to adodb-php4.inc.php and adodb-iterators.inc.php was not setup properly.
-</font></p><p><font color="#000000">Patched SQLDate in interbase to support hours/mins/secs. Thx to ari kuorikoski.
-</font></p><p><font color="#000000">Force autorollback for pgsql persistent connections - 
+</p><p>Mysql driver's GenID() function did not work when when sql logging is on. Fixed.
+</p><p>$ADODB_SESSION_TBL not declared as global var. Not available if adodb-session.inc.php included in function. Fixed.
+</p><p>The input array not passed to Execute() in _adodb_getcount(). Fixed.
+</p><p><b>4.04 13 Nov 2003 </b>
+</p><p>Switched back to foreach - faster than list-each.
+</p><p>Fixed bug in ado driver - wiping out $this-&gt;fields with date fields.
+</p><p>Performance Monitor, View SQL, Explain Plan did not work if strlen($SQL)&gt;max($_GET length). Fixed.
+</p><p>Performance monitor, oci8 driver added memory sort ratio.
+</p><p>Added random property, returns SQL to generate a floating point number between 0 and 1;
+</p><p><b>4.03 6 Nov 2003 </b>
+</p><p>The path to adodb-php4.inc.php and adodb-iterators.inc.php was not setup properly.
+</p><p>Patched SQLDate in interbase to support hours/mins/secs. Thx to ari kuorikoski.
+</p><p>Force autorollback for pgsql persistent connections - 
 apparently pgsql did not autorollback properly before 4.3.4. See http://bugs.php.net/bug.php?id=25404
-</font></p><p><font color="#000000"><b>4.02 5 Nov 2003 </b>
-</font></p><p><font color="#000000">Some errors in adodb_error_pg() fixed. Thx to Styve.
-</font></p><p><font color="#000000">Spurious Insert_ID() error was generated by LogSQL(). Fixed.
-</font></p><p><font color="#000000">Insert_ID was interfering with Affected_Rows() and Replace()  when LogSQL() enabled. Fixed.
-</font></p><p><font color="#000000">More foreach loops optimized with list/each.
-</font></p><p><font color="#000000">Null dates not handled properly in ADO driver (it becomes 31 Dec 1969!).
-</font></p><p><font color="#000000">Heinz Hombergs contributed patches for mysql MetaColumns - adding scale, made
+</p><p><b>4.02 5 Nov 2003 </b>
+</p><p>Some errors in adodb_error_pg() fixed. Thx to Styve.
+</p><p>Spurious Insert_ID() error was generated by LogSQL(). Fixed.
+</p><p>Insert_ID was interfering with Affected_Rows() and Replace()  when LogSQL() enabled. Fixed.
+</p><p>More foreach loops optimized with list/each.
+</p><p>Null dates not handled properly in ADO driver (it becomes 31 Dec 1969!).
+</p><p>Heinz Hombergs contributed patches for mysql MetaColumns - adding scale, made
 interbase MetaColumns work with firebird/interbase, and added lang/adodb-de.inc.php.
-</font></p><p><font color="#000000">Added INFORMIXSERVER environment variable.
-</font></p><p><font color="#000000">Added $ADODB_ANSI_PADDING_OFF for interbase/firebird.
-</font></p><p><font color="#000000">PHP 5 beta 2 compat check. Foreach (Iterator) support. Exceptions support.
-</font></p><p><font color="#000000"><b>4.01 23 Oct 2003 </b>
-</font></p><p><font color="#000000">Fixed bug in rs2html(), tohtml.inc.php, that generated blank table cells.
-</font></p><p><font color="#000000">Fixed insert_id() incorrectly generated when logsql() enabled.
-</font></p><p><font color="#000000">Modified PostgreSQL _fixblobs to use list/each instead of foreach.
-</font></p><p><font color="#000000">Informix ErrorNo() implemented correctly.
-</font></p><p><font color="#000000">Modified several places to use list/each, including GetRowAssoc().
-</font></p><p><font color="#000000">Added UserTimeStamp() to connection class.
-</font></p><p><font color="#000000">Added $ADODB_ANSI_PADDING_OFF for oci8po.
-</font></p><p><font color="#000000"><b>4.00 20 Oct 2003 </b>
-</font></p><p><font color="#000000">Upgraded adodb-xmlschema to 1 Oct 2003 snapshot.
-</font></p><p><font color="#000000">Fix to rs2html warning message. Thx to Filo.
-</font></p><p><font color="#000000">Fix for odbc_mssql/mssql SQLDate(), hours was wrong.
-</font></p><p><font color="#000000">Added MetaColumns and MetaPrimaryKeys for sybase. Thx to Chris Phillipson.
-</font></p><p><font color="#000000">Added autoquoting to datadict for MySQL and PostgreSQL. Suggestion by Karsten Dambekalns  
-</font></p><p><font color="#000000"><b>3.94 11 Oct 2003 </b>
-</font></p><p><font color="#000000">Create trigger in datadict-oci8.inc.php did not work, because all cr/lf's must be removed. 
-</font></p><p><font color="#000000">ErrorMsg()/ErrorNo() did not work for many databases when logging enabled. Fixed.
-</font></p><p><font color="#000000">Removed global variable $ADODB_LOGSQL as it does not work properly with multiple connections.
-</font></p><p><font color="#000000">Added SQLDate support for sybase. Thx to Chris Phillipson
-</font></p><p><font color="#000000">Postgresql checking of pgsql resultset resource was incorrect. Fix by Bharat Mediratta bharat#menalto.com.
+</p><p>Added INFORMIXSERVER environment variable.
+</p><p>Added $ADODB_ANSI_PADDING_OFF for interbase/firebird.
+</p><p>PHP 5 beta 2 compat check. Foreach (Iterator) support. Exceptions support.
+</p><p><b>4.01 23 Oct 2003 </b>
+</p><p>Fixed bug in rs2html(), tohtml.inc.php, that generated blank table cells.
+</p><p>Fixed insert_id() incorrectly generated when logsql() enabled.
+</p><p>Modified PostgreSQL _fixblobs to use list/each instead of foreach.
+</p><p>Informix ErrorNo() implemented correctly.
+</p><p>Modified several places to use list/each, including GetRowAssoc().
+</p><p>Added UserTimeStamp() to connection class.
+</p><p>Added $ADODB_ANSI_PADDING_OFF for oci8po.
+</p><p><b>4.00 20 Oct 2003 </b>
+</p><p>Upgraded adodb-xmlschema to 1 Oct 2003 snapshot.
+</p><p>Fix to rs2html warning message. Thx to Filo.
+</p><p>Fix for odbc_mssql/mssql SQLDate(), hours was wrong.
+</p><p>Added MetaColumns and MetaPrimaryKeys for sybase. Thx to Chris Phillipson.
+</p><p>Added autoquoting to datadict for MySQL and PostgreSQL. Suggestion by Karsten Dambekalns  
+</p><p><b>3.94 11 Oct 2003 </b>
+</p><p>Create trigger in datadict-oci8.inc.php did not work, because all cr/lf's must be removed. 
+</p><p>ErrorMsg()/ErrorNo() did not work for many databases when logging enabled. Fixed.
+</p><p>Removed global variable $ADODB_LOGSQL as it does not work properly with multiple connections.
+</p><p>Added SQLDate support for sybase. Thx to Chris Phillipson
+</p><p>Postgresql checking of pgsql resultset resource was incorrect. Fix by Bharat Mediratta bharat#menalto.com.
 Same patch applied to  _insertid and _affectedrows for adodb-postgres64.inc.php.
-</font></p><p><font color="#000000">Added support for NConnect for postgresql.
-</font></p><p><font color="#000000">Added Sybase data dict support. Thx to Chris Phillipson  
-</font></p><p><font color="#000000">Extensive improvements in $perf-&gt;UI(), eg. Explain now opens in new window, we show scripts
+</p><p>Added support for NConnect for postgresql.
+</p><p>Added Sybase data dict support. Thx to Chris Phillipson  
+</p><p>Extensive improvements in $perf-&gt;UI(), eg. Explain now opens in new window, we show scripts
 which call sql, etc.
-</font></p><p><font color="#000000">Perf Monitor UI works with magic quotes enabled.
-</font></p><p><font color="#000000">rsPrefix was declared twice. Removed.
-</font></p><p><font color="#000000">Oci8 stored procedure support, eg. "begin func(); end;" was incorrect in _query. Fixed.
-</font></p><p><font color="#000000">Tiraboschi Massimiliano contributed italian language file.
-</font></p><p><font color="#000000">Fernando Ortiz, fortiz#lacorona.com.mx, contributed informix performance monitor.
-</font></p><p><font color="#000000">Added _varchar (varchar arrays) support for postgresql. Reported by PREVOT St&eacute;phane.
-</font></p><p><font color="#000000"><b>3.92 22 Sept 2003</b> 
-</font></p><p><font color="#000000">Added GetAssoc and CacheGetAssoc to connection object.
-</font></p><p><font color="#000000">Removed TextMax and CharMax functions from adodb.inc.php. 
-</font></p><p><font color="#000000">HasFailedTrans() returned false when trans failed. Fixed. 
-</font></p><p><font color="#000000">Moved perf driver classes into adodb/perf/*.php. 
-</font></p><p><font color="#000000">Misc improvements to performance monitoring, including UI(). 
-</font></p><p><font color="#000000">RETVAL in mssql Parameter(), we do not append @ now. 
-</font></p><p><font color="#000000">Added Param($name) to connection class, returns '?' or ":$name", for defining 
-  bind parameters portably. 
-</font></p><p><font color="#000000">LogSQL traps affected_rows() and saves its value properly now. Also fixed oci8 
-  _stmt and _affectedrows() bugs. 
-</font></p><p><font color="#000000">Session code timestamp check for oci8 works now. Formerly default NLS_DATE_FORMAT 
-  stripped off time portion. Thx to Tony Blair (tonanbarbarian#hotmail.com). Also 
-  added new $conn-&gt;datetime field to oci8, controls whether MetaType() returns 
-  'D' ($this-&gt;datetime==false) or 'T' ($this-&gt;datetime == true) for DATE type. 
-</font></p><p><font color="#000000">Fixed bugs in adodb-cryptsession.inc.php and adodb-session-clob.inc.php. 
-</font></p><p><font color="#000000">Fixed misc bugs in adodb_key_exists, GetInsertSQL() and GetUpdateSQL(). 
-</font></p><p><font color="#000000">Tuned include_once handling to reduce file-system checking overhead. 
-</font></p><p><font color="#000000"><b>3.91 9 Sept 2003</b> 
-</font></p><p><font color="#000000">Only released to InterAkt 
-</font></p><p><font color="#000000">Added LogSQL() for sql logging and $ADODB_NEWCONNECTION to override factory 
-  for driver instantiation. 
-</font></p><p><font color="#000000">Added IfNull($field,$ifNull) function, thx to johnwilk#juno.com 
-</font></p><p><font color="#000000">Added portable substr support. 
-</font></p><p><font color="#000000">Now rs2html() has new parameter, $echo. Set to false to return $html instead 
-  of echoing it. 
-</font></p><p><font color="#000000"><b>3.90 5 Sept 2003</b> 
-</font></p><p><font color="#000000">First beta of performance monitoring released. 
-</font></p><p><font color="#000000">MySQL supports MetaTable() masking. 
-</font></p><p><font color="#000000">Fixed key_exists() bug in adodb-lib.inc.php 
-</font></p><p><font color="#000000">Added sp_executesql Prepare() support to mssql. 
-</font></p><p><font color="#000000">Added bind support to db2. 
-</font></p><p><font color="#000000">Added swedish language file - Christian Tiberg" christian#commsoft.nu 
-</font></p><p><font color="#000000">Bug in drop index for mssql data dict fixed. Thx to Gert-Rainer Bitterlich. 
-</font></p><p><font color="#000000">Left join setting for oci8 was wrong. Thx to johnwilk#juno.com 
-</font></p><p><font color="#000000"><b>3.80 27 Aug 2003</b> 
-</font></p><p><font color="#000000">Patch for PHP 4.3.3 cached recordset csv2rs() fread loop incompatibility. 
-</font></p><p><font color="#000000">Added matching mask for MetaTables. Only for oci8, mssql and postgres currently. 
-</font></p><p><font color="#000000">Rewrite of "oracle" driver connection code, merging with "oci8", by Gaetano. 
-</font></p><p><font color="#000000">Added better debugging for Smart Transactions. 
-</font></p><p><font color="#000000">Postgres DBTimeStamp() was wrongly using TO_DATE. Changed to TO_TIMESTAMP. 
-</font></p><p><font color="#000000">ADODB_FETCH_CASE check pushed to ADONewConnection to allow people to define 
-  it after including adodb.inc.php. 
-</font></p><p><font color="#000000">Added portugese (brazilian) to languages. Thx to "Levi Fukumori". 
-</font></p><p><font color="#000000">Removed arg3 parameter from Execute/SelectLimit/Cache* functions. 
-</font></p><p><font color="#000000">Execute() now accepts 2-d array as $inputarray. Also changed docs of fnExecute() 
-  to note change in sql query counting with 2-d arrays. 
-</font></p><p><font color="#000000">Added MONEY to MetaType in PostgreSQL. 
-</font></p><p><font color="#000000">Added more debugging output to CacheFlush(). 
-</font></p><p><font color="#000000"><b>3.72 9 Aug 2003</b> 
-</font></p><p><font color="#000000">Added qmagic($str), which is a qstr($str) that auto-checks for magic quotes 
-  and does the right thing... 
-</font></p><p><font color="#000000">Fixed CacheFlush() bug - Thx to martin#gmx.de 
-</font></p><p><font color="#000000">Walt Boring contributed MetaForeignKeys for postgres7. 
-</font></p><p><font color="#000000">_fetch() called _BlobDecode() wrongly in interbase. Fixed. 
-</font></p><p><font color="#000000">adodb_time bug fixed with dates after 2038 fixed by Jason Pell. http://phplens.com/lens/lensforum/msgs.php?id=6980 
-</font></p><p><font color="#000000"><b>3.71 4 Aug 2003</b> 
-</font></p><p><font color="#000000">The oci8 driver, MetaPrimaryKeys() did not check the owner correctly when $owner 
-  == false. 
-</font></p><p><font color="#000000">Russian language file contributed by "Cyrill Malevanov" cyrill#malevanov.spb.ru. 
-</font></p><p><font color="#000000">Spanish language file contributed by "Horacio Degiorgi" horaciod#codigophp.com. 
-</font></p><p><font color="#000000">Error handling in oci8 bugfix - if there was an error in Execute(), then when 
-  calling ErrorNo() and/or ErrorMsg(), the 1st call would return the error, but 
-  the 2nd call would return no error. 
-</font></p><p><font color="#000000">Error handling in odbc bugfix. ODBC would always return the last error, even 
-  if it happened 5 queries ago. Now we reset the errormsg to '' and errorno to 
-  0 everytime before CacheExecute() and Execute(). 
-</font></p><p><font color="#000000"><b>3.70 29 July 2003</b> 
-</font></p><p><font color="#000000">Added new SQLite driver. Tested on PHP 4.3 and PHP 5. 
-</font></p><p><font color="#000000">Added limited "sapdb" driver support - mainly date support. 
-</font></p><p><font color="#000000">The oci8 driver did not identify NUMBER with no defined precision correctly. 
-</font></p><p><font color="#000000">Added ADODB_FORCE_NULLS, if set, then PHP nulls are converted to SQL nulls 
-  in GetInsertSQL/GetUpdateSQL. 
-</font></p><p><font color="#000000">DBDate() and DBTimeStamp() format for postgresql had problems. Fixed. 
-</font></p><p><font color="#000000">Added tableoptions to ChangeTableSQL(). Thx to Mike Benoit. 
-</font></p><p><font color="#000000">Added charset support to postgresql. Thx to Julian Tarkhanov. 
-</font></p><p><font color="#000000">Changed OS check for MS-Windows to prevent confusion with darWIN (MacOS) 
-</font></p><p><font color="#000000">Timestamp format for db2 was wrong. Changed to yyyy-mm-dd-hh.mm.ss.nnnnnn. 
-</font></p><p><font color="#000000">adodb-cryptsession.php includes wrong. Fixed. 
-</font></p><p><font color="#000000">Added MetaForeignKeys(). Supported by mssql, odbc_mssql and oci8. 
-</font></p><p><font color="#000000">Fixed some oci8 MetaColumns/MetaPrimaryKeys bugs. Thx to Walt Boring. 
-</font></p><p><font color="#000000">adodb_getcount() did not init qryRecs to 0. Missing "WHERE" clause checking 
-  in GetUpdateSQL fixed. Thx to Sebastiaan van Stijn. 
-</font></p><p><font color="#000000">Added support for only 'VIEWS' and "TABLES" in MetaTables. From Walt Boring. 
-</font></p><p><font color="#000000">Upgraded to adodb-xmlschema.inc.php 0.0.2. 
-</font></p><p><font color="#000000">NConnect for mysql now returns value. Thx to Dennis Verspuij. 
-</font></p><p><font color="#000000">ADODB_FETCH_BOTH support added to interbase/firebird. 
-</font></p><p><font color="#000000">Czech language file contributed by Kamil Jakubovic jake#host.sk. 
-</font></p><p><font color="#000000">PostgreSQL BlobDecode did not use _connectionID properly. Thx to Juraj Chlebec. 
-</font></p><p><font color="#000000">Added some new initialization stuff for Informix. Thx to "Andrea Pinnisi" pinnisi#sysnet.it 
-</font></p><p><font color="#000000">ADODB_ASSOC_CASE constant wrong in sybase _fetch(). Fixed. 
-</font></p><p><font color="#000000"><b>3.60 16 June 2003</b> 
-</font></p><p><font color="#000000">We now SET CONCAT_NULL_YIELDS_NULL OFF for odbc_mssql driver to be compat with 
-  mssql driver. 
-</font></p><p><font color="#000000">The property $emptyDate missing from connection class. Also changed 1903 to 
-  constant (TIMESTAMP_FIRST_YEAR=100). Thx to Sebastiaan van Stijn. 
-</font></p><p><font color="#000000">ADOdb speedup optimization - we now return all arrays by reference. 
-</font></p><p><font color="#000000">Now DBDate() and DBTimeStamp() now accepts the string 'null' as a parameter. 
-  Suggested by vincent. 
-</font></p><p><font color="#000000">Added GetArray() to connection class. 
-</font></p><p><font color="#000000">Added not_null check in informix metacolumns(). 
-</font></p><p><font color="#000000">Connection parameters for postgresql did not work correctly when port was defined. 
-</font></p><p><font color="#000000">DB2 is now a tested driver, making adodb 100% compatible. Extensive changes 
-  to odbc driver for DB2, including implementing serverinfo() and SQLDate(), switching 
-  to SQL_CUR_USE_ODBC as the cursor mode, and lastAffectedRows and SelectLimit() 
-  fixes. 
-</font></p><p><font color="#000000">The odbc driver's FetchField() field names did not obey ADODB_ASSOC_CASE. Fixed. 
-</font></p><p><font color="#000000">Some bugs in adodb_backtrace() fixed. 
-</font></p><p><font color="#000000">Added "INT IDENTITY" type to adorecordset::MetaType() to support odbc_mssql 
-  properly. 
-</font></p><p><font color="#000000">MetaColumns() for oci8, mssql, odbc revised to support scale. Also minor revisions 
-  to odbc MetaColumns() for vfp and db2 compat. 
-</font></p><p><font color="#000000">Added unsigned support to mysql datadict class. Thx to iamsure. 
-</font></p><p><font color="#000000">Infinite loop in mssql MoveNext() fixed when ADODB_FETCH_ASSOC used. Thx to 
-  Josh R, Night_Wulfe#hotmail.com. 
-</font></p><p><font color="#000000">ChangeTableSQL contributed by Florian Buzin. 
-</font></p><p><font color="#000000">The odbc_mssql driver now sets CONCAT_NULL_YIELDS_NULL OFF for compat with 
-  mssql driver. 
-</font></p><hr>
-<p><font color="#000000"><strong>0.10 Sept 9 2000</strong> First release 
-</font></p><h3><font color="#000000"><strong>Old changelog history moved to <a href="old-changelog.htm">old-changelog.htm</a>. 
-  </strong></font></h3>
-<p><font color="#000000">&nbsp;</font></p>
-<p><font color="#000000"> </font> 
+</p><p>Perf Monitor UI works with magic quotes enabled.
+</p><p>rsPrefix was declared twice. Removed.
+</p><p>Oci8 stored procedure support, eg. "begin func(); end;" was incorrect in _query. Fixed.
+</p><p>Tiraboschi Massimiliano contributed italian language file.
+</p><p>Fernando Ortiz, fortiz#lacorona.com.mx, contributed informix performance monitor.
+</p><p>Added _varchar (varchar arrays) support for postgresql. Reported by PREVOT St&eacute;phane.<hr>
+<p><strong>0.10 Sept 9 2000</strong> First release 
+</p><h3><strong>Old change log history moved to <a href="old-changelog.htm">old-changelog.htm</a>. 
+  </strong></h3>
+<p>&nbsp;</p>
+<p>  
 </p></body></html>
\ No newline at end of file

Modified: plog/trunk/class/database/adodb/docs/docs-datadict.htm
===================================================================
--- plog/trunk/class/database/adodb/docs/docs-datadict.htm	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/docs/docs-datadict.htm	2005-05-31 10:28:30 UTC (rev 2128)
@@ -20,22 +20,13 @@
 </head>
 <body style="background-color: rgb(255, 255, 255);">
 <h2>ADOdb Data Dictionary Library for PHP</h2>
-<p>V4.54 5 Nov 2004 (c) 2000-2004 John Lim (<a
+<p>V4.62 2 Apr 2005 (c) 2000-2005 John Lim (<a
  href="mailto:jlim#natsoft.com.my">jlim#natsoft.com.my</a>).<br>
 AXMLS (c) 2004 ars Cognita, Inc</p>
 <p><font size="1">This software is dual licensed using BSD-Style and
 LGPL. This means you can use it in compiled proprietary and commercial
 products.</font></p>
-<table border="1">
-  <tbody>
-    <tr>
-      <td height="38"><font color="red">Kindly note that the ADOdb home page has
-moved to <a href="http://adodb.sourceforge.net/">http://adodb.sourceforge.net/</a>
-because of the persistent unreliability of http://php.weblogs.com. <b>Please
-change your links</b>!</font></td>
-    </tr>
-  </tbody>
-</table>
+
 <p>Useful ADOdb links: <a href="http://adodb.sourceforge.net/#download">Download</a>
 &nbsp; <a href="http://adodb.sourceforge.net/#docs">Other Docs</a>
 </p>
@@ -83,7 +74,7 @@
 field type can be a portable type codes or the actual type for that
 database.</p>
 <p>Legal portable type codes include:</p>
-<pre>  C:  varchar<br>  X:  Largest varchar size <br>  XL: For Oracle, returns CLOB, otherwise same as 'X' above<br><br>  C2: Multibyte varchar<br>  X2: Multibyte varchar (largest size)<br><br>  B:  BLOB (binary large object)<br><br>  D:  Date (some databases do not support this, and we return a datetime type)<br>  T:  Datetime or Timestamp<br>  L:  Integer field suitable for storing booleans (0 or 1)<br>  I:  Integer (mapped to I4)<br>  I1: 1-byte integer<br>  I2: 2-byte integer<br>  I4: 4-byte integer<br>  I8: 8-byte integer<br>  F:  Floating point number<br>  N:  Numeric or decimal number<br></pre>
+<pre>  C:  Varchar, capped to 255 characters.<br>  X:  Larger varchar, capped to 4000 characters (to be compatible with Oracle). <br>  XL: For Oracle, returns CLOB, otherwise the largest varchar size.<br><br>  C2: Multibyte varchar<br>  X2: Multibyte varchar (largest size)<br><br>  B:  BLOB (binary large object)<br><br>  D:  Date (some databases do not support this, and we return a datetime type)<br>  T:  Datetime or Timestamp<br>  L:  Integer field suitable for storing booleans (0 or 1)<br>  I:  Integer (mapped to I4)<br>  I1: 1-byte integer<br>  I2: 2-byte integer<br>  I4: 4-byte integer<br>  I8: 8-byte integer<br>  F:  Floating point number<br>  N:  Numeric or decimal number<br></pre>
 <p>The $colsize field represents the size of the field. If a decimal
 number is used, then it is assumed that the number following the dot is
 the precision, so 6.2 means a number of size 6 digits and 2 decimal

Modified: plog/trunk/class/database/adodb/docs/docs-oracle.htm
===================================================================
--- plog/trunk/class/database/adodb/docs/docs-oracle.htm	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/docs/docs-oracle.htm	2005-05-31 10:28:30 UTC (rev 2128)
@@ -14,6 +14,7 @@
   font-size: 12px;
   border: 1px solid #ddd;
 }
+.style1 {color: #660000}
 </style>
 <title>ADOdb with PHP and Oracle</title>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
@@ -264,7 +265,22 @@
 $db->UpdateClob('aTable', 'aclob', $clobValue, 'id=aSequence.currVal');
 </pre>
 <p>Note that LogError( ) is a user-defined function, and not part of ADOdb.
-<p>&nbsp;
+<p>Inserting LOBs is more complicated. Since ADOdb 4.55, we allow you to do this
+  (assuming that the <em>photo</em> field is a BLOB, and we want to store $blob_data into
+  this field, and the primary key is the <em>id</em> field):
+<pre>
+	$sql = <span class="style1">"INSERT INTO photos ( ID, photo) ".
+			"VALUES ( :id, empty_blob() )".
+			" RETURNING photo INTO :xx"</span>;
+
+ 		$stmt = $db->PrepareSP($sql);
+		$db->InParameter($stmt, $<strong>id</strong>, <span class="style1">'id'</span>);
+		$blob = $db->InParameter($stmt, $<strong>blob_data</strong>, <span class="style1">'xx'</span>,-1, OCI_B_BLOB);
+		$db->StartTrans();
+		$ok = $db->Execute($stmt);
+		$db->CompleteTrans();
+</pre> 
+<p>
 <h3>5. REF CURSORs</h3>
 <p>Oracle recordsets can be passed around as variables called REF Cursors. For example, in PL/SQL, we could define a function <i>open_tab</i> that returns a REF CURSOR in the first parameter:</p>
 <pre>
@@ -357,7 +373,7 @@
 $db-&gt;Execute($sql);
 </pre>
 <p>If you are not concerned about date portability and do not use ADOdb's portability layer, you can use your preferred date format instead.
-<p>&nbsp;
+<p>
 <h3>8. Database Portability Layer</h3>
 <p>ADOdb provides the following functions for portably generating SQL functions 
   as strings to be merged into your SQL statements:</p>

Modified: plog/trunk/class/database/adodb/docs/docs-perf.htm
===================================================================
--- plog/trunk/class/database/adodb/docs/docs-perf.htm	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/docs/docs-perf.htm	2005-05-31 10:28:30 UTC (rev 2128)
@@ -18,20 +18,10 @@
 </head>
 <body>
 <h3>The ADOdb Performance Monitoring Library</h3>
-<p>V4.54 5 Nov 2004 (c) 2000-2004 John Lim (jlim#natsoft.com.my)</p>
+<p>V4.62 2 Apr 2005 (c) 2000-2005 John Lim (jlim#natsoft.com.my)</p>
 <p><font size="1">This software is dual licensed using BSD-Style and
 LGPL. This means you can use it in compiled proprietary and commercial
 products.</font></p>
-<table border="1">
-  <tbody>
-    <tr>
-      <td><font color="red">Kindly note that the ADOdb home page has
-moved to <a href="http://adodb.sourceforge.net/">http://adodb.sourceforge.net/</a>
-because of the persistent unreliability of http://php.weblogs.com. <b>Please
-change your links</b>!</font></td>
-    </tr>
-  </tbody>
-</table>
 <p>Useful ADOdb links: <a href="http://adodb.sourceforge.net/#download">Download</a>
 &nbsp; <a href="http://adodb.sourceforge.net/#docs">Other Docs</a>
 </p>

Modified: plog/trunk/class/database/adodb/docs/docs-session.htm
===================================================================
--- plog/trunk/class/database/adodb/docs/docs-session.htm	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/docs/docs-session.htm	2005-05-31 10:28:30 UTC (rev 2128)
@@ -21,24 +21,11 @@
 <body style="background-color: rgb(255, 255, 255);">
 <h3>ADODB Session Management Manual</h3>
 <p>
-V4.54 5 Nov 2004 (c) 2000-2004 John Lim (jlim#natsoft.com.my)
+V4.62 2 Apr 2005 (c) 2000-2005 John Lim (jlim#natsoft.com.my)
 </p>
 <p> <font size="1">This software is dual licensed using BSD-Style and
 LGPL. This means you can use it in compiled proprietary and commercial
 products. </font>
-<table border="1">
-  <tbody>
-    <tr>
-      <td><font color="red">Kindly note that the ADOdb home page has
-moved to <a href="http://adodb.sourceforge.net/">http://adodb.sourceforge.net/</a>
-because of the persistent unreliability of http://php.weblogs.com. <b>Please
-change your links</b>!</font></td>
-    </tr>
-    <tr>
-    </tr>
-  </tbody>
-</table>
-<p></p>
 <p>Useful ADOdb links: <a href="http://adodb.sourceforge.net/#download">Download</a>
 &nbsp; <a href="http://adodb.sourceforge.net/#docs">Other Docs</a>
 </p>
@@ -61,9 +48,12 @@
   <li>Need to do special processing of each session</li>
   <li>Require notification when a session expires</li>
 </ul>
-<p>Then the ADOdb session handler provides you with the above
+<p>The ADOdb session handler provides you with the above
 additional capabilities by storing the session information as records
 in a database table that can be shared across multiple servers. </p>
+<p>These records will be garbage collected based on the php.ini [session] timeout settings. 
+You can register a notification function to notify you when the record has expired and 
+is about to be freed by the garbage collector.</p>
 <p><b>Important Upgrade Notice:</b> Since ADOdb 4.05, the session files
 have been moved to its own folder, adodb/session. This is a rewrite
 of the session code by Ross Smith. The old session code is in
@@ -149,22 +139,35 @@
  </pre><p>
      When the session is created, $<b>ADODB_SESS_CONN</b> holds the connection object.<br>    <br>  3. Recommended is PHP 4.0.6 or later. There are documented session bugs in earlier versions of PHP.
 <h3>Notifications</h3>
-<p>If you want to receive notification when a session expires, then tag
-the session record with a <a href="#sessiontab">EXPIREREF</a> tag (see
-the definition of the sessions table above). Before any session record
-is deleted, ADOdb will call a notification function, passing in the
-EXPIREREF.
-</p>
-<p>When a session is first created, we check a global variable
-$ADODB_SESSION_EXPIRE_NOTIFY. This is an array with 2 elements, the
+<p>You can receive notification when your session is cleaned up by the session garbage collector or
+when you call session_destroy().
+<p>PHP's session extension will automatically run a special garbage collection function based on
+your php.ini session.cookie_lifetime and session.gc_probability settings. This will in turn call
+adodb's garbage collection function, which can be setup to do notification.
+<p>
+<pre>
+	PHP Session --> ADOdb Session  --> Find all recs  --> Send          --> Delete queued
+	GC Function     GC Function        to be deleted      notification      records
+	executed at     called by                             for all recs
+	random time     Session Extension                     queued for deletion
+</pre>
+<p>When a session is created, we need to store a value in the session record (in the EXPIREREF field), typically 
+the userid of the session. Later when the session has expired,  just before the record is deleted,
+we reload the EXPIREREF field and call the notification function with the value of EXPIREREF, which 
+is the userid of the person being logged off.
+<p>ADOdb use a global variable $ADODB_SESSION_EXPIRE_NOTIFY that you must predefine before session
+start to store the notification configuratioin. 
+$ADODB_SESSION_EXPIRE_NOTIFY is an array with 2 elements, the
 first being the name of the session variable you would like to store in
 the EXPIREREF field, and the 2nd is the notification function's name. </p>
-<p> Suppose we want to be notified when a user's session has expired,
-based on the userid. The user id in the global session variable
-$USERID. The function name is 'NotifyFn'. So we define: </p>
+<p>For example, suppose we want to be notified when a user's session has expired,
+based on the userid. When the user logs in, we store the id in the global session variable
+$USERID. The function name is 'NotifyFn'. 
+<p>
+So we define (before session_start() is called): </p>
 <pre> <font color="#004040"><br>        $ADODB_SESSION_EXPIRE_NOTIFY = array('USERID','NotifyFn');<br>    </font></pre>
-And when the NotifyFn is called (when the session expires), we pass the
-$USERID as the first parameter, eg. NotifyFn($userid, $sesskey). The
+And when the NotifyFn is called (when the session expires), the
+$USERID is passed in as the first parameter, eg. NotifyFn($userid, $sesskey). The
 session key (which is the primary key of the record in the sessions
 table) is the 2nd parameter.
 <p> Here is an example of a Notification function that deletes some
@@ -202,6 +205,28 @@
 <p>These are stackable. E.g.
 <p><pre>ADODB_Session::filter(new ADODB_Compress_Bzip2());<br>ADODB_Session::filter(new ADODB_Encrypt_MD5());<br></pre>
 will compress and then encrypt the record in the database.
+<h3>adodb_session_regenerate_id()</h3>
+<p>Dynamically change the current session id with a newly generated one and update database. Currently only
+works with cookies. Useful to improve security by reducing the risk of session-hijacking.
+See this article on <a href=http://shiflett.org/articles/security-corner-feb2004>Session Fixation</a> for more info 
+on the theory behind this feature. Usage:
+<pre>
+	$ADODB_SESSION_DRIVER='mysql';
+	$ADODB_SESSION_CONNECT='localhost';
+	$ADODB_SESSION_USER ='root';
+	$ADODB_SESSION_PWD ='abc';
+	$ADODB_SESSION_DB ='phplens';
+	
+	include('path/to/adodb/session/adodb-session.php');
+	
+	session_start();
+	# Every 10 page loads, reset cookie for safety.
+	# This is extremely simplistic example, better 
+	# to regenerate only when the user logs in or changes
+	# user privilege levels.
+	if ((rand()%10) == 0) adodb_session_regenerate_id(); </pre>
+<p>This function calls session_regenerate_id() internally or simulates it if the function does not exist.
+<h2>More Info</h2>
 <p>Also see the <a href="docs-adodb.htm">core ADOdb documentation</a>.
 </p>
 </body>

Modified: plog/trunk/class/database/adodb/docs/old-changelog.htm
===================================================================
--- plog/trunk/class/database/adodb/docs/old-changelog.htm	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/docs/old-changelog.htm	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,4 +1,126 @@
+<html><title>Old Changelog: ADOdb</title><body>
 <h3>Old Changelog</h3>
+
+</p><p><b>3.92 22 Sept 2003</b> 
+</p><p>Added GetAssoc and CacheGetAssoc to connection object.
+</p><p>Removed TextMax and CharMax functions from adodb.inc.php. 
+</p><p>HasFailedTrans() returned false when trans failed. Fixed. 
+</p><p>Moved perf driver classes into adodb/perf/*.php. 
+</p><p>Misc improvements to performance monitoring, including UI(). 
+</p><p>RETVAL in mssql Parameter(), we do not append @ now. 
+</p><p>Added Param($name) to connection class, returns '?' or ":$name", for defining 
+  bind parameters portably. 
+</p><p>LogSQL traps affected_rows() and saves its value properly now. Also fixed oci8 
+  _stmt and _affectedrows() bugs. 
+</p><p>Session code timestamp check for oci8 works now. Formerly default NLS_DATE_FORMAT 
+  stripped off time portion. Thx to Tony Blair (tonanbarbarian#hotmail.com). Also 
+  added new $conn-&gt;datetime field to oci8, controls whether MetaType() returns 
+  'D' ($this-&gt;datetime==false) or 'T' ($this-&gt;datetime == true) for DATE type. 
+</p><p>Fixed bugs in adodb-cryptsession.inc.php and adodb-session-clob.inc.php. 
+</p><p>Fixed misc bugs in adodb_key_exists, GetInsertSQL() and GetUpdateSQL(). 
+</p><p>Tuned include_once handling to reduce file-system checking overhead. 
+</p><p><b>3.91 9 Sept 2003</b> 
+</p><p>Only released to InterAkt 
+</p><p>Added LogSQL() for sql logging and $ADODB_NEWCONNECTION to override factory 
+  for driver instantiation. 
+</p><p>Added IfNull($field,$ifNull) function, thx to johnwilk#juno.com 
+</p><p>Added portable substr support. 
+</p><p>Now rs2html() has new parameter, $echo. Set to false to return $html instead 
+  of echoing it. 
+</p><p><b>3.90 5 Sept 2003</b> 
+</p><p>First beta of performance monitoring released. 
+</p><p>MySQL supports MetaTable() masking. 
+</p><p>Fixed key_exists() bug in adodb-lib.inc.php 
+</p><p>Added sp_executesql Prepare() support to mssql. 
+</p><p>Added bind support to db2. 
+</p><p>Added swedish language file - Christian Tiberg" christian#commsoft.nu 
+</p><p>Bug in drop index for mssql data dict fixed. Thx to Gert-Rainer Bitterlich. 
+</p><p>Left join setting for oci8 was wrong. Thx to johnwilk#juno.com 
+</p><p><b>3.80 27 Aug 2003</b> 
+</p><p>Patch for PHP 4.3.3 cached recordset csv2rs() fread loop incompatibility. 
+</p><p>Added matching mask for MetaTables. Only for oci8, mssql and postgres currently. 
+</p><p>Rewrite of "oracle" driver connection code, merging with "oci8", by Gaetano. 
+</p><p>Added better debugging for Smart Transactions. 
+</p><p>Postgres DBTimeStamp() was wrongly using TO_DATE. Changed to TO_TIMESTAMP. 
+</p><p>ADODB_FETCH_CASE check pushed to ADONewConnection to allow people to define 
+  it after including adodb.inc.php. 
+</p><p>Added portugese (brazilian) to languages. Thx to "Levi Fukumori". 
+</p><p>Removed arg3 parameter from Execute/SelectLimit/Cache* functions. 
+</p><p>Execute() now accepts 2-d array as $inputarray. Also changed docs of fnExecute() 
+  to note change in sql query counting with 2-d arrays. 
+</p><p>Added MONEY to MetaType in PostgreSQL. 
+</p><p>Added more debugging output to CacheFlush(). 
+</p><p><b>3.72 9 Aug 2003</b> 
+</p><p>Added qmagic($str), which is a qstr($str) that auto-checks for magic quotes 
+  and does the right thing... 
+</p><p>Fixed CacheFlush() bug - Thx to martin#gmx.de 
+</p><p>Walt Boring contributed MetaForeignKeys for postgres7. 
+</p><p>_fetch() called _BlobDecode() wrongly in interbase. Fixed. 
+</p><p>adodb_time bug fixed with dates after 2038 fixed by Jason Pell. http://phplens.com/lens/lensforum/msgs.php?id=6980 
+</p><p><b>3.71 4 Aug 2003</b> 
+</p><p>The oci8 driver, MetaPrimaryKeys() did not check the owner correctly when $owner 
+  == false. 
+</p><p>Russian language file contributed by "Cyrill Malevanov" cyrill#malevanov.spb.ru. 
+</p><p>Spanish language file contributed by "Horacio Degiorgi" horaciod#codigophp.com. 
+</p><p>Error handling in oci8 bugfix - if there was an error in Execute(), then when 
+  calling ErrorNo() and/or ErrorMsg(), the 1st call would return the error, but 
+  the 2nd call would return no error. 
+</p><p>Error handling in odbc bugfix. ODBC would always return the last error, even 
+  if it happened 5 queries ago. Now we reset the errormsg to '' and errorno to 
+  0 everytime before CacheExecute() and Execute(). 
+</p><p><b>3.70 29 July 2003</b> 
+</p><p>Added new SQLite driver. Tested on PHP 4.3 and PHP 5. 
+</p><p>Added limited "sapdb" driver support - mainly date support. 
+</p><p>The oci8 driver did not identify NUMBER with no defined precision correctly. 
+</p><p>Added ADODB_FORCE_NULLS, if set, then PHP nulls are converted to SQL nulls 
+  in GetInsertSQL/GetUpdateSQL. 
+</p><p>DBDate() and DBTimeStamp() format for postgresql had problems. Fixed. 
+</p><p>Added tableoptions to ChangeTableSQL(). Thx to Mike Benoit. 
+</p><p>Added charset support to postgresql. Thx to Julian Tarkhanov. 
+</p><p>Changed OS check for MS-Windows to prevent confusion with darWIN (MacOS) 
+</p><p>Timestamp format for db2 was wrong. Changed to yyyy-mm-dd-hh.mm.ss.nnnnnn. 
+</p><p>adodb-cryptsession.php includes wrong. Fixed. 
+</p><p>Added MetaForeignKeys(). Supported by mssql, odbc_mssql and oci8. 
+</p><p>Fixed some oci8 MetaColumns/MetaPrimaryKeys bugs. Thx to Walt Boring. 
+</p><p>adodb_getcount() did not init qryRecs to 0. Missing "WHERE" clause checking 
+  in GetUpdateSQL fixed. Thx to Sebastiaan van Stijn. 
+</p><p>Added support for only 'VIEWS' and "TABLES" in MetaTables. From Walt Boring. 
+</p><p>Upgraded to adodb-xmlschema.inc.php 0.0.2. 
+</p><p>NConnect for mysql now returns value. Thx to Dennis Verspuij. 
+</p><p>ADODB_FETCH_BOTH support added to interbase/firebird. 
+</p><p>Czech language file contributed by Kamil Jakubovic jake#host.sk. 
+</p><p>PostgreSQL BlobDecode did not use _connectionID properly. Thx to Juraj Chlebec. 
+</p><p>Added some new initialization stuff for Informix. Thx to "Andrea Pinnisi" pinnisi#sysnet.it 
+</p><p>ADODB_ASSOC_CASE constant wrong in sybase _fetch(). Fixed. 
+</p><p><b>3.60 16 June 2003</b> 
+</p><p>We now SET CONCAT_NULL_YIELDS_NULL OFF for odbc_mssql driver to be compat with 
+  mssql driver. 
+</p><p>The property $emptyDate missing from connection class. Also changed 1903 to 
+  constant (TIMESTAMP_FIRST_YEAR=100). Thx to Sebastiaan van Stijn. 
+</p><p>ADOdb speedup optimization - we now return all arrays by reference. 
+</p><p>Now DBDate() and DBTimeStamp() now accepts the string 'null' as a parameter. 
+  Suggested by vincent. 
+</p><p>Added GetArray() to connection class. 
+</p><p>Added not_null check in informix metacolumns(). 
+</p><p>Connection parameters for postgresql did not work correctly when port was defined. 
+</p><p>DB2 is now a tested driver, making adodb 100% compatible. Extensive changes 
+  to odbc driver for DB2, including implementing serverinfo() and SQLDate(), switching 
+  to SQL_CUR_USE_ODBC as the cursor mode, and lastAffectedRows and SelectLimit() 
+  fixes. 
+</p><p>The odbc driver's FetchField() field names did not obey ADODB_ASSOC_CASE. Fixed. 
+</p><p>Some bugs in adodb_backtrace() fixed. 
+</p><p>Added "INT IDENTITY" type to adorecordset::MetaType() to support odbc_mssql 
+  properly. 
+</p><p>MetaColumns() for oci8, mssql, odbc revised to support scale. Also minor revisions 
+  to odbc MetaColumns() for vfp and db2 compat. 
+</p><p>Added unsigned support to mysql datadict class. Thx to iamsure. 
+</p><p>Infinite loop in mssql MoveNext() fixed when ADODB_FETCH_ASSOC used. Thx to 
+  Josh R, Night_Wulfe#hotmail.com. 
+</p><p>ChangeTableSQL contributed by Florian Buzin. 
+</p><p>The odbc_mssql driver now sets CONCAT_NULL_YIELDS_NULL OFF for compat with 
+  mssql driver. 
+</p>
+
 <p><b>3.50 19 May 2003</b></p>
 <p>Fixed mssql compat with FreeTDS. FreeTDS does not implement mssql_fetch_assoc(). 
 <p>Merged back connection and recordset code into adodb.inc.php. 
@@ -697,4 +819,4 @@
 </p>
 <p><b>0.10 Sept 9 2000</b></p>
 <p>First release</p>
-<p>
\ No newline at end of file
+</body></html>
\ No newline at end of file

Modified: plog/trunk/class/database/adodb/drivers/adodb-access.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-access.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-access.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 

Modified: plog/trunk/class/database/adodb/drivers/adodb-ado.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-ado.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-ado.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: plog/trunk/class/database/adodb/drivers/adodb-ado5.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-ado5.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-ado5.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
@@ -8,7 +8,7 @@
   
   Latest version is available at http://adodb.sourceforge.net
   
-	Microsoft ADO data driver. Requires ADO. Works only on MS Windows.
+	Microsoft ADO data driver. Requires ADO. Works only on MS Windows. PHP5 compat version.
 */
 
 // security - hide paths

Modified: plog/trunk/class/database/adodb/drivers/adodb-ado_access.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-ado_access.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-ado_access.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
 Released under both BSD license and Lesser GPL library license. 
 Whenever there is any discrepancy between the two licenses, 
 the BSD license will take precedence. See License.txt. 

Modified: plog/trunk/class/database/adodb/drivers/adodb-ado_mssql.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-ado_mssql.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-ado_mssql.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: plog/trunk/class/database/adodb/drivers/adodb-borland_ibase.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-borland_ibase.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-borland_ibase.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: plog/trunk/class/database/adodb/drivers/adodb-csv.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-csv.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-csv.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: plog/trunk/class/database/adodb/drivers/adodb-db2.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-db2.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-db2.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
@@ -177,8 +177,46 @@
 		}
 		return $arr2;
 	}
+
+	function &MetaIndexes ($table, $primary = FALSE, $owner=false)
+	{
+        // save old fetch mode
+        global $ADODB_FETCH_MODE;
+        $save = $ADODB_FETCH_MODE;
+        $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
+        if ($this->fetchMode !== FALSE) {
+               $savem = $this->SetFetchMode(FALSE);
+        }
+		$false = false;
+		// get index details
+		$table = strtoupper($table);
+		$SQL="SELECT NAME, UNIQUERULE, COLNAMES FROM SYSIBM.SYSINDEXES WHERE TBNAME='$table'";
+        if ($primary) 
+			$SQL.= " AND UNIQUERULE='P'";
+		$rs = $this->Execute($SQL);
+        if (!is_object($rs)) {
+			if (isset($savem)) 
+				$this->SetFetchMode($savem);
+			$ADODB_FETCH_MODE = $save;
+            return $false;
+        }
+		$indexes = array ();
+        // parse index data into array
+        while ($row = $rs->FetchRow()) {
+			$indexes[$row[0]] = array(
+			   'unique' => ($row[1] == 'U' || $row[1] == 'P'),
+			   'columns' => array()
+			);
+			$cols = ltrim($row[2],'+');
+			$indexes[$row[0]]['columns'] = explode('+', $cols);
+        }
+		if (isset($savem)) { 
+            $this->SetFetchMode($savem);
+			$ADODB_FETCH_MODE = $save;
+		}
+        return $indexes;
+	}
 	
-	
 	// Format date column in sql string given an input format that understands Y M D
 	function SQLDate($fmt, $col=false)
 	{	

Modified: plog/trunk/class/database/adodb/drivers/adodb-fbsql.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-fbsql.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-fbsql.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /*
- @version V4.54 5 Nov 2004 (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+ @version V4.62 2 Apr 2005 (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
  Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
@@ -170,9 +170,10 @@
 		}
 		switch ($mode) {
 		case ADODB_FETCH_NUM: $this->fetchMode = FBSQL_NUM; break;
+		case ADODB_FETCH_ASSOC: $this->fetchMode = FBSQL_ASSOC; break;
+		case ADODB_FETCH_BOTH: 
 		default:
-		case ADODB_FETCH_BOTH: $this->fetchMode = FBSQL_BOTH; break;
-		case ADODB_FETCH_ASSOC: $this->fetchMode = FBSQL_ASSOC; break;
+		$this->fetchMode = FBSQL_BOTH; break;
 		}
 		return $this->ADORecordSet($queryID);
 	}

Modified: plog/trunk/class/database/adodb/drivers/adodb-firebird.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-firebird.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-firebird.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: plog/trunk/class/database/adodb/drivers/adodb-ibase.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-ibase.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-ibase.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.  
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.  
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -52,6 +52,7 @@
 	var $hasAffectedRows = false;
 	var $poorAffectedRows = true;
 	var $blobEncodeType = 'C';
+	var $role = false;
 	
 	function ADODB_ibase() 
 	{
@@ -65,7 +66,11 @@
 		if (!function_exists('ibase_pconnect')) return null;
 		if ($argDatabasename) $argHostname .= ':'.$argDatabasename;
 		$fn = ($persist) ? 'ibase_pconnect':'ibase_connect';
-		$this->_connectionID = $fn($argHostname,$argUsername,$argPassword,
+		if ($this->role)
+			$this->_connectionID = $fn($argHostname,$argUsername,$argPassword,
+					$this->charSet,$this->buffers,$this->dialect,$this->role);
+		else	
+			$this->_connectionID = $fn($argHostname,$argUsername,$argPassword,
 					$this->charSet,$this->buffers,$this->dialect);
 		
 		if ($this->dialect != 1) { // http://www.ibphoenix.com/ibp_60_del_id_ds.html

Modified: plog/trunk/class/database/adodb/drivers/adodb-informix.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-informix.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-informix.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version V4.54 5 Nov 2004 (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+* @version V4.62 2 Apr 2005 (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
 * Released under both BSD license and Lesser GPL library license.
 * Whenever there is any discrepancy between the two licenses,
 * the BSD license will take precedence.

Modified: plog/trunk/class/database/adodb/drivers/adodb-informix72.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-informix72.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-informix72.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim. All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim. All rights reserved.
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
   the BSD license will take precedence.
@@ -28,7 +28,7 @@
 	var $hasInsertID = true;
 	var $hasAffectedRows = true;
     var $substr = 'substr';
-	var $metaTablesSQL="select tabname from systables where tabtype!=' ' and owner!='informix'"; //Don't get informix tables and pseudo-tables
+	var $metaTablesSQL="select tabname,tabtype from systables where tabtype in ('T','V') and owner!='informix'"; //Don't get informix tables and pseudo-tables
 
 
 	var $metaColumnsSQL = 
@@ -141,7 +141,7 @@
 
 	function ErrorNo()
 	{
-		preg_match("/.*SQLCODE=([^\]]*)/",ifx_error(),$parse); //!EOS
+		preg_match("/.*SQLCODE=([^\]]*)/",ifx_error(),$parse);
 		if (is_array($parse) && isset($parse[1])) return (int)$parse[1]; 
 		return 0;
 	}
@@ -165,9 +165,20 @@
 			while (!$rs->EOF) { //print_r($rs->fields);
 				$fld = new ADOFieldObject();
 				$fld->name = $rs->fields[0];
+/*  //!eos.
+						$rs->fields[1] is not the correct adodb type
+						$rs->fields[2] is not correct max_length, because can include not-null bit
+
 				$fld->type = $rs->fields[1];
 				$fld->primary_key=$rspkey->fields && array_search($rs->fields[4],$rspkey->fields); //Added to set primary key flag
-				$fld->max_length = $rs->fields[2];
+				$fld->max_length = $rs->fields[2];*/
+				$pr=ifx_props($rs->fields[1],$rs->fields[2]); //!eos
+				$fld->type = $pr[0] ;//!eos
+				$fld->primary_key=$rspkey->fields && array_search($rs->fields[4],$rspkey->fields);
+				$fld->max_length = $pr[1]; //!eos
+				$fld->precision = $pr[2] ;//!eos
+				$fld->not_null = $pr[3]=="N"; //!eos
+
 				if (trim($rs->fields[3]) != "AAAAAA 0") {
 	                    		$fld->has_default = 1;
 	                    		$fld->default_value = $rs->fields[3];
@@ -180,6 +191,7 @@
 			}
 
 			$rs->Close();
+			$rspKey->Close(); //!eos
 			return $retarr;	
 		}
 
@@ -191,6 +203,38 @@
 		return ADOConnection::MetaColumns($table,false);
    }
 
+	 function MetaForeignKeys($table, $owner=false, $upper=false) //!Eos
+	{
+		$sql = "
+			select tr.tabname,updrule,delrule,
+			i.part1 o1,i2.part1 d1,i.part2 o2,i2.part2 d2,i.part3 o3,i2.part3 d3,i.part4 o4,i2.part4 d4,
+			i.part5 o5,i2.part5 d5,i.part6 o6,i2.part6 d6,i.part7 o7,i2.part7 d7,i.part8 o8,i2.part8 d8
+			from systables t,sysconstraints s,sysindexes i,
+			sysreferences r,systables tr,sysconstraints s2,sysindexes i2
+			where t.tabname='$table'
+			and s.tabid=t.tabid and s.constrtype='R' and r.constrid=s.constrid
+			and i.idxname=s.idxname and tr.tabid=r.ptabid
+			and s2.constrid=r.primary and i2.idxname=s2.idxname";
+
+		$rs = $this->Execute($sql);
+		if (!$rs || $rs->EOF)  return false;
+		$arr =& $rs->GetArray();
+		$a = array();
+		foreach($arr as $v) {
+			$coldest=$this->metaColumnNames($v["tabname"]);
+			$colorig=$this->metaColumnNames($table);
+			$colnames=array();
+			for($i=1;$i<=8 && $v["o$i"] ;$i++) {
+				$colnames[]=$coldest[$v["d$i"]-1]."=".$colorig[$v["o$i"]-1];
+			}
+			if($upper)
+				$a[strtoupper($v["tabname"])] =  $colnames;
+			else
+				$a[$v["tabname"]] =  $colnames;
+		}
+		return $a;
+	 }
+
    function UpdateBlob($table, $column, $val, $where, $blobtype = 'BLOB')
    {
    		$type = ($blobtype == 'TEXT') ? 1 : 0;
@@ -401,4 +445,29 @@
 	}
 
 }
+/** !Eos
+* Auxiliar function to Parse coltype,collength. Used by Metacolumns
+* return: array ($mtype,$length,$precision,$nullable) (similar to ifx_fieldpropierties)
+*/
+function ifx_props($coltype,$collength){
+	$itype=fmod($coltype+1,256);
+	$nullable=floor(($coltype+1) /256) ?"N":"Y";
+	$mtype=substr(" CIIFFNNDN TBXCC     ",$itype,1);
+	switch ($itype){
+		case 2:
+			$length=4;
+		case 6:
+		case 9:
+		case 14:
+			$length=floor($collength/256);
+			$precision=fmod($collength,256);
+			break;
+		default:
+			$precision=0;
+			$length=$collength;
+	}
+	return array($mtype,$length,$precision,$nullable);
+}
+
+
 ?>
\ No newline at end of file

Modified: plog/trunk/class/database/adodb/drivers/adodb-ldap.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-ldap.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-ldap.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,11 +1,15 @@
 <?php
 /*
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim#natsoft.com.my). All rights reserved.
    Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
   Set tabs to 8.
   
+  Revision 1: (02/25/2005) Updated codebase to include the _inject_bind_options function. This allows
+  users to access the options in the ldap_set_option function appropriately. Most importantly
+  LDAP Version 3 is now supported. See the examples for more information. Also fixed some minor
+  bugs that surfaced when PHP error levels were set high.
   
   Joshua Eldridge (joshuae74#hotmail.com)
 */ 
@@ -13,6 +17,12 @@
 // security - hide paths
 if (!defined('ADODB_DIR')) die();
 
+if (!defined('LDAP_ASSOC')) {
+	 define('LDAP_ASSOC',ADODB_FETCH_ASSOC);
+	 define('LDAP_NUM',ADODB_FETCH_NUM);
+	 define('LDAP_BOTH',ADODB_FETCH_BOTH);
+}
+
 class ADODB_ldap extends ADOConnection {
     var $databaseType = 'ldap';
 	var $dataProvider = 'ldap';
@@ -24,7 +34,10 @@
     # Used during searches
     var $filter;
     var $dn;
+	var $version;
 
+	# Options configuration information
+	var $LDAP_CONNECT_OPTIONS;
 
 	function ADODB_ldap() 
 	{		
@@ -36,6 +49,8 @@
 	function _connect( $host, $username, $password, $ldapbase )
 	{
 
+	global $LDAP_CONNECT_OPTIONS;
+
 	   if ( !function_exists( 'ldap_connect' ) ) return null;
 	   
 	   $conn_info = array( $host );
@@ -46,6 +61,11 @@
 
 	   $this->_connectionID = ldap_connect( $conn_info[0], $conn_info[1] ) 
 	       or die( 'Could not connect to ' . $this->_connectionID );
+
+	   if( count( $LDAP_CONNECT_OPTIONS ) > 0 ) {
+			$this->_inject_bind_options( $LDAP_CONNECT_OPTIONS );
+		}
+
 	   if ($username && $password) {
 	       $bind = ldap_bind( $this->_connectionID, $username, $password ) 
 	           or die( 'Could not bind to ' . $this->_connectionID . ' with $username & $password');
@@ -53,9 +73,68 @@
 	       $bind = ldap_bind( $this->_connectionID ) 
 	           or die( 'Could not bind anonymously to ' . $this->_connectionID );
 	   }
+	   $this->database = $ldapbase;
 	   return $this->_connectionID;
     }
     
+/*
+	Valid Domain Values for LDAP Options:
+
+	LDAP_OPT_DEREF (integer)
+	LDAP_OPT_SIZELIMIT (integer)
+	LDAP_OPT_TIMELIMIT (integer)
+	LDAP_OPT_PROTOCOL_VERSION (integer)
+	LDAP_OPT_ERROR_NUMBER (integer)
+	LDAP_OPT_REFERRALS (boolean)
+	LDAP_OPT_RESTART (boolean)
+	LDAP_OPT_HOST_NAME (string)
+	LDAP_OPT_ERROR_STRING (string)
+	LDAP_OPT_MATCHED_DN (string)
+	LDAP_OPT_SERVER_CONTROLS (array)
+	LDAP_OPT_CLIENT_CONTROLS (array)
+
+	Make sure to set this BEFORE calling Connect()
+
+	Example:
+
+	$LDAP_CONNECT_OPTIONS = Array(
+		Array (
+			"OPTION_NAME"=>LDAP_OPT_DEREF,
+			"OPTION_VALUE"=>2
+		),
+		Array (
+			"OPTION_NAME"=>LDAP_OPT_SIZELIMIT,
+			"OPTION_VALUE"=>100
+		),
+		Array (
+			"OPTION_NAME"=>LDAP_OPT_TIMELIMIT,
+			"OPTION_VALUE"=>30
+		),
+		Array (
+			"OPTION_NAME"=>LDAP_OPT_PROTOCOL_VERSION,
+			"OPTION_VALUE"=>3
+		),
+		Array (
+			"OPTION_NAME"=>LDAP_OPT_ERROR_NUMBER,
+			"OPTION_VALUE"=>13
+		),
+		Array (
+			"OPTION_NAME"=>LDAP_OPT_REFERRALS,
+			"OPTION_VALUE"=>FALSE
+		),
+		Array (
+			"OPTION_NAME"=>LDAP_OPT_RESTART,
+			"OPTION_VALUE"=>FALSE
+		)
+	);
+*/
+
+	function _inject_bind_options( $options ) {
+		foreach( $options as $option ) {
+			ldap_set_option( $this->_connectionID, $option["OPTION_NAME"], $option["OPTION_VALUE"] )
+				or die( "Unable to set server option: " . $option["OPTION_NAME"] );
+		}
+	}
 	
 	/* returns _queryID or false */
 	function _query($sql,$inputarr)
@@ -72,9 +151,14 @@
 		$this->_connectionID = false;
 	}
     
+	function SelectDB($db) {
+		$this->database = $db;
+		return true;
+	} // SelectDB
+
     function ServerInfo()
     {
-        if( is_array( $this->version ) ) return $this->version;
+        if( !empty( $this->version ) ) return $this->version;
         $version = array();
         /*
         Determines how aliases are handled during search. 
@@ -160,8 +244,8 @@
         }
         /* The host name (or list of hosts) for the primary LDAP server. */
         ldap_get_option( $this->_connectionID, LDAP_OPT_HOST_NAME, $version['LDAP_OPT_HOST_NAME'] ); 
-        ldap_get_option( $this->_connectionID, OPT_ERROR_NUMBER, $version['OPT_ERROR_NUMBER'] ); 
-        ldap_get_option( $this->_connectionID, OPT_ERROR_STRING, $version['OPT_ERROR_STRING'] ); 
+        ldap_get_option( $this->_connectionID, LDAP_OPT_ERROR_NUMBER, $version['LDAP_OPT_ERROR_NUMBER'] ); 
+        ldap_get_option( $this->_connectionID, LDAP_OPT_ERROR_STRING, $version['LDAP_OPT_ERROR_STRING'] ); 
         ldap_get_option( $this->_connectionID, LDAP_OPT_MATCHED_DN, $version['LDAP_OPT_MATCHED_DN'] ); 
         
         return $this->version = $version;
@@ -193,9 +277,9 @@
 		case ADODB_FETCH_ASSOC: 
 		  $this->fetchMode = LDAP_ASSOC; 
 		break;
-		default:
 		case ADODB_FETCH_DEFAULT:
 		case ADODB_FETCH_BOTH: 
+		default:
 		  $this->fetchMode = LDAP_BOTH; 
 		break;
 		}
@@ -292,11 +376,12 @@
             break;
             
             case LDAP_NUM:
-            $this->fields = $this->GetRowNums();
+			$this->fields = array_merge($this->GetRowNums(),$this->GetRowAssoc());
             break;
             
             case LDAP_BOTH:
             default:
+			$this->fields = $this->GetRowNums();
             break;
         }
         return ( is_array( $this->fields ) );        

Modified: plog/trunk/class/database/adodb/drivers/adodb-mssql.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-mssql.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-mssql.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
@@ -535,6 +535,30 @@
 		return array($sql,$stmt);
 	}
 	
+	// returns concatenated string
+    // MSSQL requires integers to be cast as strings
+    // automatically cast every datatype to VARCHAR(255)
+    // @author David Rogers (introspectshun)
+    function Concat()
+    {
+            $s = "";
+            $arr = func_get_args();
+
+            // Split single record on commas, if possible
+            if (sizeof($arr) == 1) {
+                foreach ($arr as $arg) {
+                    $args = explode(',', $arg);
+                }
+                $arr = $args;
+            }
+
+            array_walk($arr, create_function('&$v', '$v = "CAST(" . $v . " AS VARCHAR(255))";'));
+            $s = implode('+',$arr);
+            if (sizeof($arr) > 0) return "$s";
+            
+			return '';
+    }
+	
 	/* 
 	Usage:
 		$stmt = $db->PrepareSP('SP_RUNSOMETHING'); -- takes 2 params, @myid and @group

Modified: plog/trunk/class/database/adodb/drivers/adodb-mssqlpo.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-mssqlpo.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-mssqlpo.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version V4.54 5 Nov 2004 (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+* @version V4.62 2 Apr 2005 (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
 * Released under both BSD license and Lesser GPL library license.
 * Whenever there is any discrepancy between the two licenses,
 * the BSD license will take precedence.

Modified: plog/trunk/class/database/adodb/drivers/adodb-mysql.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-mysql.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-mysql.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -149,7 +149,8 @@
 	
 	function _insertid()
 	{
-		return mysql_insert_id($this->_connectionID);
+		return ADOConnection::GetOne('SELECT LAST_INSERT_ID()');
+		//return mysql_insert_id($this->_connectionID);
 	}
 	
 	function GetOne($sql,$inputarr=false)
@@ -303,7 +304,13 @@
 				$s .= '%p';
 				break;
 				
-
+			case 'w':
+				$s .= '%w';
+				break;
+				
+			case 'l':
+				$s .= '%W';
+				break;
 			}
 		}
 		$s.="')";
@@ -341,17 +348,7 @@
 			$this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword,
 												$this->forceNewConnect);
 		else
-			$this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword);
-			
-        /** hack to adodb **/
-		if ($this->_isSupportUtf8() && $argDatabasename) {
-			$dbEncoding = $this->_getDbDefaultEncoding($argDatabasename);
-			if ($dbEncoding) {
-				mysql_query("SET NAMES $dbEncoding", $this->_connectionID);
-			}
-		}
-		/** end of hack **/
-			
+			$this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword);
 	
 		if ($this->_connectionID === false) return false;
 		if ($argDatabasename) return $this->SelectDB($argDatabasename);
@@ -366,17 +363,7 @@
 		else
 			$this->_connectionID = mysql_pconnect($argHostname,$argUsername,$argPassword);
 		if ($this->_connectionID === false) return false;
-		if ($this->autoRollback) $this->RollbackTrans();
-		
-        /** hack to adodb **/
-		if ($this->_isSupportUtf8() && $argDatabasename) {
-			$dbEncoding = $this->_getDbDefaultEncoding($argDatabasename);
-			if ($dbEncoding) {
-				mysql_query("SET NAMES $dbEncoding", $this->_connectionID);
-			}
-		}		
-		/** end of hack **/		
-		
+		if ($this->autoRollback) $this->RollbackTrans();
 		if ($argDatabasename) return $this->SelectDB($argDatabasename);
 		return true;	
 	}
@@ -385,51 +372,10 @@
 	{
 		$this->forceNewConnect = true;
 		return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename);
-	}
-    
-    /** start of adodb hack **/
-	function _isSupportUtf8() {
-	
-		// check mysql version first. Version lower than 4.1 doesn't support utf8
-		$serverVersion = mysql_get_server_info($this->_connectionID);
-		$version = explode('.', $serverVersion);
-		if ($version[0] < 4) return false;
-		if ( ($version[0] == 4) && ($version[1] == 0) ) return false;
-		
-		// check if utf8 support was compiled in
-		$result = mysql_query("SHOW CHARACTER SET like 'utf8'", $this->_connectionID);
-		if (mysql_num_rows($result) > 0) {
-			return true;
-		}
-		return false;
-	}
-	
-	function _getDbDefaultEncoding($argDatabasename)
-	{
-		
-		if (!$argDatabasename) {
-			return false;
-		}
-		
-		// We use a SHOW CREATE DATABASE command to show the original
-		// SQL character set when DB was created.
-		$result = mysql_query("SHOW CREATE DATABASE $argDatabasename", $this->_connectionID);
-		if (mysql_num_rows($result) < 0 ) {
-			// The specified db name is wrong!
-			return false;
-		}
-		$dbInfo = mysql_fetch_row($result);
-		$pattern = '/40100 DEFAULT CHARACTER SET (\w+) /';
-		if ( (preg_match($pattern, $dbInfo[1], $match) > 0) ) {
-			return $match[1];
-		}
-		return false;
-    }
-    /** end of hack **/
+	}
 	
  	function &MetaColumns($table) 
 	{
-	
 		global $ADODB_FETCH_MODE;
 		$save = $ADODB_FETCH_MODE;
 		$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
@@ -457,6 +403,10 @@
 			} elseif (preg_match("/^(.+)\((\d+)/", $type, $query_array)) {
 				$fld->type = $query_array[1];
 				$fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
+			} elseif (preg_match("/^(enum)\((.*)\)$/i", $type, $query_array)) {
+				$fld->type = $query_array[1];
+				$fld->max_length = max(array_map("strlen",explode(",",$query_array[2]))) - 2; // PHP >= 4.0.6
+				$fld->max_length = ($fld->max_length == 0 ? 1 : $fld->max_length);
 			} else {
 				$fld->type = $type;
 				$fld->max_length = -1;
@@ -586,9 +536,10 @@
 		{
 		case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
 		case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
-		default:
 		case ADODB_FETCH_DEFAULT:
-		case ADODB_FETCH_BOTH:$this->fetchMode = MYSQL_BOTH; break;
+		case ADODB_FETCH_BOTH:
+		default:
+			$this->fetchMode = MYSQL_BOTH; break;
 		}
 		$this->adodbFetchMode = $mode;
 		$this->ADORecordSet($queryID);	
@@ -741,9 +692,10 @@
 		{
 		case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
 		case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
-		default:
 		case ADODB_FETCH_DEFAULT:
-		case ADODB_FETCH_BOTH:$this->fetchMode = MYSQL_BOTH; break;
+		case ADODB_FETCH_BOTH:
+		default:
+		$this->fetchMode = MYSQL_BOTH; break;
 		}
 		$this->adodbFetchMode = $mode;
 		$this->ADORecordSet($queryID);

Modified: plog/trunk/class/database/adodb/drivers/adodb-mysqli.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-mysqli.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-mysqli.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -18,6 +18,8 @@
 
 if (! defined("_ADODB_MYSQLI_LAYER")) {
  define("_ADODB_MYSQLI_LAYER", 1 );
+ 
+ if (!defined('MYSQLI_READ_DEFAULT_GROUP')) define('MYSQLI_READ_DEFAULT_GROUP',1);
 
  // disable adodb extension - currently incompatible.
  global $ADODB_EXTENSION; $ADODB_EXTENSION = false;
@@ -36,7 +38,7 @@
 	var $isoDates = true; // accepts dates in ISO format
 	var $sysDate = 'CURDATE()';
 	var $sysTimeStamp = 'NOW()';
-	var $hasTransactions = false;
+	var $hasTransactions = true;
 	var $forceNewConnect = false;
 	var $poorAffectedRows = true;
 	var $clientFlags = 0;
@@ -45,11 +47,12 @@
 	var $socket = false;
 	var $_bindInputArray = false;
 	var $nameQuote = '`';		/// string to use to quote identifiers and names
+	var $optionFlags = array(array(MYSQLI_READ_DEFAULT_GROUP,0));
 	
 	function ADODB_mysqli() 
 	{			
-	  if(!extension_loaded("mysqli"))
-	      trigger_error("You must have the mysqli extension installed.", E_USER_ERROR);
+	 // if(!extension_loaded("mysqli"))
+	      ;//trigger_error("You must have the mysqli extension installed.", E_USER_ERROR);
 	    
 	}
 	
@@ -62,6 +65,9 @@
 			  $argPassword = NULL, 
 			  $argDatabasename = NULL, $persist=false)
 	  {
+	  	 if(!extension_loaded("mysqli")) {
+			return null;
+		 }
 	    $this->_connectionID = @mysqli_init();
 	    
 	    if (is_null($this->_connectionID)) {
@@ -70,9 +76,15 @@
 				ADOConnection::outp("mysqli_init() failed : "  . $this->ErrorMsg());
 	      return false;
 	    }
-	    // Set connection options
-	    // Not implemented now
-	    // mysqli_options($this->_connection,,);
+		/*
+		I suggest a simple fix which would enable adodb and mysqli driver to
+		read connection options from the standard mysql configuration file
+		/etc/my.cnf - "Bastien Duclaux" <bduclaux#yahoo.com>
+		*/
+		foreach($this->optionFlags as $arr) {	
+			mysqli_options($this->_connectionID,$arr[0],$arr[1]);
+		}
+		
  	    if (mysqli_real_connect($this->_connectionID,
  				    $argHostname,
  				    $argUsername,
@@ -107,7 +119,7 @@
 	function _nconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
 	  {
 	    $this->forceNewConnect = true;
-	    $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename);
+	    return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename);
 	  }
 	
 	function IfNull( $field, $ifNull ) 
@@ -386,6 +398,22 @@
 		return "from_unixtime(unix_timestamp($date)+($dayFraction)*24*3600)";
 	}
 	
+	function &MetaTables($ttype=false,$showSchema=false,$mask=false) 
+	{	
+		$save = $this->metaTablesSQL;
+		if ($showSchema && is_string($showSchema)) {
+			$this->metaTablesSQL .= " from $showSchema";
+		}
+		
+		if ($mask) {
+			$mask = $this->qstr($mask);
+			$this->metaTablesSQL .= " like $mask";
+		}
+		$ret =& ADOConnection::MetaTables($ttype,$showSchema);
+		
+		$this->metaTablesSQL = $save;
+		return $ret;
+	}
 	
  	function &MetaColumns($table) 
 	{
@@ -418,6 +446,10 @@
 			} elseif (preg_match("/^(.+)\((\d+)/", $type, $query_array)) {
 				$fld->type = $query_array[1];
 				$fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
+			} elseif (preg_match("/^(enum)\((.*)\)$/i", $type, $query_array)) {
+				$fld->type = $query_array[1];
+				$fld->max_length = max(array_map("strlen",explode(",",$query_array[2]))) - 2; // PHP >= 4.0.6
+				$fld->max_length = ($fld->max_length == 0 ? 1 : $fld->max_length);
 			} else {
 				$fld->type = $type;
 				$fld->max_length = -1;
@@ -529,7 +561,7 @@
 	function ErrorMsg() 
 	  {
 	    if (empty($this->_connectionID)) 
-	      $this->_errorMsg = @mysqli_error();
+	      $this->_errorMsg = @mysqli_connect_error();
 	    else 
 	      $this->_errorMsg = @mysqli_error($this->_connectionID);
 	    return $this->_errorMsg;
@@ -539,7 +571,7 @@
 	function ErrorNo() 
 	  {
 	    if (empty($this->_connectionID))  
-	      return @mysqli_errno();
+	      return @mysqli_connect_errno();
 	    else 
 	      return @mysqli_errno($this->_connectionID);
 	  }
@@ -726,13 +758,13 @@
 		
 		 $len = -1; // mysql max_length is not accurate
 		 switch (strtoupper($t)) {
-		/* case 'STRING': 
+		 case 'STRING': 
 		 case 'CHAR':
 		 case 'VARCHAR': 
 		 case 'TINYBLOB': 
 		 case 'TINYTEXT': 
 		 case 'ENUM': 
-		 case 'SET': */
+		 case 'SET': 
 		
 		case MYSQLI_TYPE_TINY_BLOB :
 		case MYSQLI_TYPE_CHAR :
@@ -742,34 +774,34 @@
 		case 253 :
 		   if ($len <= $this->blobSize) return 'C';
 		   
-		/*case 'TEXT':
+		case 'TEXT':
 		case 'LONGTEXT': 
-		case 'MEDIUMTEXT':*/
+		case 'MEDIUMTEXT':
 		   return 'X';
 		
 		
 		   // php_mysql extension always returns 'blob' even if 'text'
 		   // so we have to check whether binary...
-		/*case 'IMAGE':
+		case 'IMAGE':
 		case 'LONGBLOB': 
 		case 'BLOB':
-		case 'MEDIUMBLOB':*/
+		case 'MEDIUMBLOB':
 		
 		case MYSQLI_TYPE_BLOB :
 		case MYSQLI_TYPE_LONG_BLOB :
 		case MYSQLI_TYPE_MEDIUM_BLOB :
 		
 		   return !empty($fieldobj->binary) ? 'B' : 'X';
-		/*case 'YEAR':
-		case 'DATE': */
+		case 'YEAR':
+		case 'DATE': 
 		case MYSQLI_TYPE_DATE :
 		case MYSQLI_TYPE_YEAR :
 		
 		   return 'D';
 		
-		/*case 'TIME':
+		case 'TIME':
 		case 'DATETIME':
-		case 'TIMESTAMP':*/
+		case 'TIMESTAMP':
 		
 		case MYSQLI_TYPE_DATETIME :
 		case MYSQLI_TYPE_NEWDATE :
@@ -778,13 +810,13 @@
 		
 			return 'T';
 		
-		/*case 'INT': 
+		case 'INT': 
 		case 'INTEGER':
 		case 'BIGINT':
 		case 'TINYINT':
 		case 'MEDIUMINT':
 		case 'SMALLINT': 
-		*/
+		
 		case MYSQLI_TYPE_INT24 :
 		case MYSQLI_TYPE_LONG :
 		case MYSQLI_TYPE_LONGLONG :
@@ -795,7 +827,7 @@
 		   
 		   return 'I';
 		
-		/*
+		
 		   // Added floating-point types
 		   // Maybe not necessery.
 		 case 'FLOAT':
@@ -803,9 +835,9 @@
 		   //		case 'DOUBLE PRECISION':
 		 case 'DECIMAL':
 		 case 'DEC':
-		 case 'FIXED':*/
+		 case 'FIXED':
 		 default:
-		 	if (!is_numeric($t)) echo "<p>--- Error in type matching $t -----</p>"; 
+		 	//if (!is_numeric($t)) echo "<p>--- Error in type matching $t -----</p>"; 
 		 	return 'N';
 		}
 	} // function

Modified: plog/trunk/class/database/adodb/drivers/adodb-mysqlt.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-mysqlt.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-mysqlt.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -74,11 +74,13 @@
 		{
 		case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
 		case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
-		default:
+		
 		case ADODB_FETCH_DEFAULT:
-		case ADODB_FETCH_BOTH:$this->fetchMode = MYSQL_BOTH; break;
+		case ADODB_FETCH_BOTH:
+		default: $this->fetchMode = MYSQL_BOTH; break;
 		}
 	
+		$this->adodbFetchMode = $mode;
 		$this->ADORecordSet($queryID);	
 	}
 	
@@ -108,9 +110,11 @@
 		{
 		case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
 		case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
-		default:
+		
 		case ADODB_FETCH_DEFAULT:
-		case ADODB_FETCH_BOTH:$this->fetchMode = MYSQL_BOTH; break;
+		case ADODB_FETCH_BOTH:
+		default: 
+			$this->fetchMode = MYSQL_BOTH; break;
 		}
 	
 		$this->ADORecordSet($queryID);	

Modified: plog/trunk/class/database/adodb/drivers/adodb-netezza.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-netezza.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-netezza.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /*
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim#natsoft.com.my). All rights reserved.
  
   First cut at the Netezza Driver by Josh Eldridge joshuae74#hotmail.com
  Based on the previous postgres drivers.
@@ -149,10 +149,12 @@
 		{
 		case ADODB_FETCH_NUM: $this->fetchMode = PGSQL_NUM; break;
 		case ADODB_FETCH_ASSOC:$this->fetchMode = PGSQL_ASSOC; break;
-		default:
+		
 		case ADODB_FETCH_DEFAULT:
-		case ADODB_FETCH_BOTH:$this->fetchMode = PGSQL_BOTH; break;
+		case ADODB_FETCH_BOTH:
+		default: $this->fetchMode = PGSQL_BOTH; break;
 		}
+		$this->adodbFetchMode = $mode;
 		$this->ADORecordSet($queryID);
 	}
 	

Modified: plog/trunk/class/database/adodb/drivers/adodb-oci8.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-oci8.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-oci8.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 /*
 
-  version V4.54 5 Nov 2004 (c) 2000-2004 John Lim. All rights reserved.
+  version V4.62 2 Apr 2005 (c) 2000-2005 John Lim. All rights reserved.
 
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
@@ -99,6 +99,7 @@
 	{
 	global $ADODB_FETCH_MODE;
 	
+		$false = false;
 		$save = $ADODB_FETCH_MODE;
 		$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
 		if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
@@ -108,7 +109,6 @@
 		if (isset($savem)) $this->SetFetchMode($savem);
 		$ADODB_FETCH_MODE = $save;
 		if (!$rs) {
-			$false = false;
 			return $false;
 		}
 		$retarr = array();
@@ -131,7 +131,7 @@
 			$rs->MoveNext();
 		}
 		$rs->Close();
-		return $retarr;
+		return (empty($retarr)) ? $false : $retarr;
 	}
 	
 	function Time()
@@ -305,6 +305,73 @@
 		return $ret;
 	}
 	
+	// Mark Newnham 
+	function &MetaIndexes ($table, $primary = FALSE, $owner=false)
+	{
+        // save old fetch mode
+        global $ADODB_FETCH_MODE;
+
+        $save = $ADODB_FETCH_MODE;
+        $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
+
+        if ($this->fetchMode !== FALSE) {
+               $savem = $this->SetFetchMode(FALSE);
+        }
+
+		// get index details
+		$table = strtoupper($table);
+
+		// get Primary index
+		$primary_key = '';
+
+		$false = false;
+		$rs = $this->Execute(sprintf("SELECT * FROM ALL_CONSTRAINTS WHERE UPPER(TABLE_NAME)='%s' AND CONSTRAINT_TYPE='P'",$table));
+		if ($row = $rs->FetchRow())
+		   $primary_key = $row[1]; //constraint_name
+
+		if ($primary==TRUE && $primary_key=='') {
+			 if (isset($savem)) 
+                $this->SetFetchMode($savem);
+			$ADODB_FETCH_MODE = $save;
+			return $false; //There is no primary key
+		}
+
+        $rs = $this->Execute(sprintf("SELECT ALL_INDEXES.INDEX_NAME, ALL_INDEXES.UNIQUENESS, ALL_IND_COLUMNS.COLUMN_POSITION, ALL_IND_COLUMNS.COLUMN_NAME FROM ALL_INDEXES,ALL_IND_COLUMNS WHERE UPPER(ALL_INDEXES.TABLE_NAME)='%s' AND ALL_IND_COLUMNS.INDEX_NAME=ALL_INDEXES.INDEX_NAME",$table));
+
+		
+        if (!is_object($rs)) {
+			if (isset($savem)) 
+				$this->SetFetchMode($savem);
+			$ADODB_FETCH_MODE = $save;
+            return $false;
+        }
+
+		$indexes = array ();
+        // parse index data into array
+
+        while ($row = $rs->FetchRow()) {
+			if ($primary && $row[0] != $primary_key) continue;
+            if (!isset($indexes[$row[0]])) {
+				$indexes[$row[0]] = array(
+				   'unique' => ($row[1] == 'UNIQUE'),
+				   'columns' => array()
+				);
+            }
+            $indexes[$row[0]]['columns'][$row[2] - 1] = $row[3];
+        }
+
+        // sort columns by order in the index
+        foreach ( array_keys ($indexes) as $index ) {
+            ksort ($indexes[$index]['columns']);
+        }
+
+		if (isset($savem)) { 
+            $this->SetFetchMode($savem);
+			$ADODB_FETCH_MODE = $save;
+		}
+        return $indexes;
+	}
+	
 	function BeginTrans()
 	{	
 		if ($this->transOff) return true;
@@ -426,6 +493,14 @@
 				$s .= 'AM';
 				break;
 				
+			case 'w':
+				$s .= 'D';
+				break;
+				
+			case 'l':
+				$s .= 'DAY';
+				break;
+				
 			default:
 			// handle escape characters...
 				if ($ch == '\\') {
@@ -655,8 +730,7 @@
 	}
 	
 	/*
-		Call an oracle stored procedure and return a cursor variable. 
-		Convert the cursor variable into a recordset. 
+		Call an oracle stored procedure and returns a cursor variable as a recordset. 
 		Concept by Robert Tuttle robert at ud.com
 		
 		Example:
@@ -673,16 +747,22 @@
 	{
 		if (is_array($sql)) $stmt = $sql;
 		else $stmt = ADODB_oci8::Prepare($sql,true); # true to allocate OCINewCursor
-			
+	
 		if (is_array($stmt) && sizeof($stmt) >= 5) {
+			$hasref = true;
 			$this->Parameter($stmt, $ignoreCur, $cursorName, false, -1, OCI_B_CURSOR);
 			if ($params) {
 				foreach($params as $k => $v) {
 					$this->Parameter($stmt,$params[$k], $k);
 				}
 			}
-		}
-		return $this->Execute($stmt);
+		} else
+			$hasref = false;
+			
+		$rs =& $this->Execute($stmt);
+		if ($rs->databaseType == 'array') OCIFreeCursor($stmt[4]);
+		else if ($hasref) $rs->_refcursor = $stmt[4];
+		return $rs;
 	}
 	
 	/*
@@ -733,25 +813,26 @@
 				ADOConnection::outp("<b>Bind</b>: name = $name");
 			}
             //we have to create a new Descriptor here
-			$numlob = count($this -> _refLOBs);
-        	$this -> _refLOBs[$numlob]['LOB'] = OCINewDescriptor($this->_connectionID, oci_lob_desc($type));
-			$this -> _refLOBs[$numlob]['TYPE'] = $isOutput;
+			$numlob = count($this->_refLOBs);
+        	$this->_refLOBs[$numlob]['LOB'] = OCINewDescriptor($this->_connectionID, oci_lob_desc($type));
+			$this->_refLOBs[$numlob]['TYPE'] = $isOutput;
 			
-			$tmp = &$this -> _refLOBs[$numlob]['LOB'];
+			$tmp = &$this->_refLOBs[$numlob]['LOB'];
 	        $rez = OCIBindByName($stmt[1], ":".$name, $tmp, -1, $type);
 			if ($this->debug) {
-				ADOConnection::outp("<b>Bind</b>: descriptor has been allocated, var binded");
+				ADOConnection::outp("<b>Bind</b>: descriptor has been allocated, var (".$name.") binded");
 			}
 			
 			// if type is input then write data to lob now
 			if ($isOutput == false) {
-				$var = $this -> BlobEncode($var);
-				$tmp -> WriteTemporary($var);
+				$var = $this->BlobEncode($var);
+				$tmp->WriteTemporary($var);
+				$this->_refLOBs[$numlob]['VAR'] = &$var;
 				if ($this->debug) {
 					ADOConnection::outp("<b>Bind</b>: LOB has been written to temp");
 				}
 			} else {
-				$this -> _refLOBs[$numlob]['VAR'] = &$var;
+				$this->_refLOBs[$numlob]['VAR'] = &$var;
 			}
 			$rez = $tmp;
 		} else {
@@ -829,7 +910,7 @@
 					$bindarr = array();
 					foreach($inputarr as $k => $v) {
 						$bindarr[$k] = $v;
-						OCIBindByName($stmt,":$k",$bindarr[$k],4000);
+						OCIBindByName($stmt,":$k",$bindarr[$k],is_string($v) && strlen($v)>4000 ? -1 : 4000);
 					}
 					$this->_bind[$bindpos] = &$bindarr;
 				}
@@ -878,9 +959,14 @@
 						}
 						//$_GLOBALS[$this -> _refLOBs[$key]['VAR']] = $tmp;
 						$this -> _refLOBs[$key]['VAR'] = $tmp;
-					}
-					$this -> _refLOBs[$key]['LOB'] -> free();
-					unset($this -> _refLOBs[$key]);
+					} else {
+                        $this->_refLOBs[$key]['LOB']->save($this->_refLOBs[$key]['VAR']);
+						$this -> _refLOBs[$key]['LOB']->free();
+						unset($this -> _refLOBs[$key]);
+                        if ($this->debug) {
+							ADOConnection::outp("<b>IN LOB</b>: LOB has been saved. <br>");
+						}
+                    }					
 				}
 			}
 		
@@ -919,10 +1005,10 @@
 		if (!$this->_connectionID) return;
 		
 		if (!$this->autoCommit) OCIRollback($this->_connectionID);
-		if (count($this -> _refLOBs) > 0) {
-			foreach ($this -> _refLOBs as $key => $value) {
-				$this -> _refLOBs[$key] -> free();
-				unset($this -> _refLOBs[$key]);
+		if (count($this->_refLOBs) > 0) {
+			foreach ($this ->_refLOBs as $key => $value) {
+				$this->_refLOBs[$key]['LOB']->free();
+				unset($this->_refLOBs[$key]);
 			}
 		}
 		OCILogoff($this->_connectionID);
@@ -1057,6 +1143,7 @@
 	var $databaseType = 'oci8';
 	var $bind=false;
 	var $_fieldobjs;
+	
 	//var $_arr = false;
 		
 	function ADORecordset_oci8($queryID,$mode=false)
@@ -1067,11 +1154,12 @@
 		}
 		switch ($mode)
 		{
-		default:
-		case ADODB_FETCH_NUM: $this->fetchMode = OCI_NUM+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
 		case ADODB_FETCH_ASSOC:$this->fetchMode = OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
 		case ADODB_FETCH_DEFAULT:
 		case ADODB_FETCH_BOTH:$this->fetchMode = OCI_NUM+OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
+		case ADODB_FETCH_NUM: 
+		default:
+		$this->fetchMode = OCI_NUM+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
 		}
 		
 		$this->adodbFetchMode = $mode;
@@ -1233,6 +1321,10 @@
 	function _close() 
 	{
 		if ($this->connection->_stmt === $this->_queryID) $this->connection->_stmt = false;
+		if (!empty($this->_refcursor)) {
+			OCIFreeCursor($this->_refcursor);
+			$this->_refcursor = false;
+		}
 		@OCIFreeStatement($this->_queryID);
  		$this->_queryID = false;
 		
@@ -1292,11 +1384,11 @@
 		}
 		switch ($mode)
 		{
-		default:
-		case ADODB_FETCH_NUM: $this->fetchMode = OCI_NUM+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
 		case ADODB_FETCH_ASSOC:$this->fetchMode = OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
 		case ADODB_FETCH_DEFAULT:
 		case ADODB_FETCH_BOTH:$this->fetchMode = OCI_NUM+OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
+		case ADODB_FETCH_NUM: 
+		default: $this->fetchMode = OCI_NUM+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
 		}
 		$this->adodbFetchMode = $mode;
 		$this->_queryID = $queryID;

Modified: plog/trunk/class/database/adodb/drivers/adodb-oci805.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-oci805.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-oci805.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.54 5 Nov 2004 (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+ * @version V4.62 2 Apr 2005 (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
  * Whenever there is any discrepancy between the two licenses, 
  * the BSD license will take precedence. 

Modified: plog/trunk/class/database/adodb/drivers/adodb-oci8po.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-oci8po.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-oci8po.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim. All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim. All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: plog/trunk/class/database/adodb/drivers/adodb-odbc.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-odbc.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-odbc.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: plog/trunk/class/database/adodb/drivers/adodb-odbc_mssql.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-odbc_mssql.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-odbc_mssql.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
@@ -43,7 +43,7 @@
 	function ADODB_odbc_mssql()
 	{
 		$this->ADODB_odbc();
-		$this->curmode = SQL_CUR_USE_ODBC;	
+		//$this->curmode = SQL_CUR_USE_ODBC;	
 	}
 
 	// crashes php...

Modified: plog/trunk/class/database/adodb/drivers/adodb-odbc_oracle.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-odbc_oracle.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-odbc_oracle.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: plog/trunk/class/database/adodb/drivers/adodb-odbtp.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-odbtp.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-odbtp.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /*
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
   the BSD license will take precedence. See License.txt.

Modified: plog/trunk/class/database/adodb/drivers/adodb-odbtp_unicode.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-odbtp_unicode.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-odbtp_unicode.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /*
-	V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+	V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
   the BSD license will take precedence. See License.txt.

Modified: plog/trunk/class/database/adodb/drivers/adodb-oracle.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-oracle.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-oracle.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: plog/trunk/class/database/adodb/drivers/adodb-pdo.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-pdo.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-pdo.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
@@ -9,14 +9,290 @@
   Latest version is available at http://adodb.sourceforge.net
   
   Requires ODBC. Works on Windows and Unix.
+
+	Problems: 
+		Where is float/decimal type in pdo_param_type
+		LOB handling for CLOB/BLOB differs significantly
 */
 // security - hide paths
 if (!defined('ADODB_DIR')) die();
+
+
+/*
+enum pdo_param_type {
+PDO_PARAM_NULL, 0
+
+/* int as in long (the php native int type).
+ * If you mark a column as an int, PDO expects get_col to return
+ * a pointer to a long 
+PDO_PARAM_INT, 1
+
+/* get_col ptr should point to start of the string buffer 
+PDO_PARAM_STR, 2
+
+/* get_col: when len is 0 ptr should point to a php_stream *,
+ * otherwise it should behave like a string. Indicate a NULL field
+ * value by setting the ptr to NULL 
+PDO_PARAM_LOB, 3
+
+/* get_col: will expect the ptr to point to a new PDOStatement object handle,
+ * but this isn't wired up yet 
+PDO_PARAM_STMT, 4 /* hierarchical result set 
+
+/* get_col ptr should point to a zend_bool 
+PDO_PARAM_BOOL, 5
+
+
+/* magic flag to denote a parameter as being input/output 
+PDO_PARAM_INPUT_OUTPUT = 0x80000000
+};
+*/
+	
+function adodb_pdo_type($t)
+{
+	switch($t) {
+	case 2: return 'VARCHAR';
+	case 3: return 'BLOB';
+	default: return 'NUMERIC';
+	}
+}
 	 
 /*--------------------------------------------------------------------------------------
 --------------------------------------------------------------------------------------*/
 
 
+class ADODB_pdo_pgsql extends ADODB_pdo {
+var $metaDatabasesSQL = "select datname from pg_database where datname not in ('template0','template1') order by 1";
+    var $metaTablesSQL = "select tablename,'T' from pg_tables where tablename not like 'pg\_%'
+	and tablename not in ('sql_features', 'sql_implementation_info', 'sql_languages',
+	 'sql_packages', 'sql_sizing', 'sql_sizing_profiles') 
+	union 
+        select viewname,'V' from pg_views where viewname not like 'pg\_%'";
+	//"select tablename from pg_tables where tablename not like 'pg_%' order by 1";
+	var $isoDates = true; // accepts dates in ISO format
+	var $sysDate = "CURRENT_DATE";
+	var $sysTimeStamp = "CURRENT_TIMESTAMP";
+	var $blobEncodeType = 'C';
+	var $metaColumnsSQL = "SELECT a.attname,t.typname,a.attlen,a.atttypmod,a.attnotnull,a.atthasdef,a.attnum 
+		FROM pg_class c, pg_attribute a,pg_type t 
+		WHERE relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s')) and a.attname not like '....%%'
+AND a.attnum > 0 AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum";
+
+	// used when schema defined
+	var $metaColumnsSQL1 = "SELECT a.attname, t.typname, a.attlen, a.atttypmod, a.attnotnull, a.atthasdef, a.attnum 
+FROM pg_class c, pg_attribute a, pg_type t, pg_namespace n 
+WHERE relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s'))
+ and c.relnamespace=n.oid and n.nspname='%s' 
+	and a.attname not like '....%%' AND a.attnum > 0 
+	AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum";
+	
+	// get primary key etc -- from Freek Dijkstra
+	var $metaKeySQL = "SELECT ic.relname AS index_name, a.attname AS column_name,i.indisunique AS unique_key, i.indisprimary AS primary_key 
+	FROM pg_class bc, pg_class ic, pg_index i, pg_attribute a WHERE bc.oid = i.indrelid AND ic.oid = i.indexrelid AND (i.indkey[0] = a.attnum OR i.indkey[1] = a.attnum OR i.indkey[2] = a.attnum OR i.indkey[3] = a.attnum OR i.indkey[4] = a.attnum OR i.indkey[5] = a.attnum OR i.indkey[6] = a.attnum OR i.indkey[7] = a.attnum) AND a.attrelid = bc.oid AND bc.relname = '%s'";
+	
+	var $hasAffectedRows = true;
+	var $hasLimit = false;	// set to true for pgsql 7 only. support pgsql/mysql SELECT * FROM TABLE LIMIT 10
+	// below suggested by Freek Dijkstra 
+	var $true = 't';		// string that represents TRUE for a database
+	var $false = 'f';		// string that represents FALSE for a database
+	var $fmtDate = "'Y-m-d'";	// used by DBDate() as the default date format used by the database
+	var $fmtTimeStamp = "'Y-m-d G:i:s'"; // used by DBTimeStamp as the default timestamp fmt.
+	var $hasMoveFirst = true;
+	var $hasGenID = true;
+	var $_genIDSQL = "SELECT NEXTVAL('%s')";
+	var $_genSeqSQL = "CREATE SEQUENCE %s START %s";
+	var $_dropSeqSQL = "DROP SEQUENCE %s";
+	var $metaDefaultsSQL = "SELECT d.adnum as num, d.adsrc as def from pg_attrdef d, pg_class c where d.adrelid=c.oid and c.relname='%s' order by d.adnum";
+	var $random = 'random()';		/// random function
+	var $concat_operator='||';
+	 
+	function ServerInfo()
+	{
+		$arr['description'] = ADOConnection::GetOne("select version()");
+		$arr['version'] = ADOConnection::_findvers($arr['description']);
+		return $arr;
+	}
+	
+	function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0) 
+	{
+		 $offsetStr = ($offset >= 0) ? " OFFSET $offset" : '';
+		 $limitStr  = ($nrows >= 0)  ? " LIMIT $nrows" : '';
+		 if ($secs2cache)
+		  	$rs =& $this->CacheExecute($secs2cache,$sql."$limitStr$offsetStr",$inputarr);
+		 else
+		  	$rs =& $this->Execute($sql."$limitStr$offsetStr",$inputarr);
+		
+		return $rs;
+	}
+	
+	function &MetaTables($ttype=false,$showSchema=false,$mask=false) 
+	{
+		$info = $this->ServerInfo();
+		if ($info['version'] >= 7.3) {
+	    	$this->metaTablesSQL = "select tablename,'T' from pg_tables where tablename not like 'pg\_%'
+			  and schemaname  not in ( 'pg_catalog','information_schema')
+	union 
+        select viewname,'V' from pg_views where viewname not like 'pg\_%'  and schemaname  not in ( 'pg_catalog','information_schema') ";
+		}
+		if ($mask) {
+			$save = $this->metaTablesSQL;
+			$mask = $this->qstr(strtolower($mask));
+			if ($info['version']>=7.3)
+				$this->metaTablesSQL = "
+select tablename,'T' from pg_tables where tablename like $mask and schemaname not in ( 'pg_catalog','information_schema')  
+ union 
+select viewname,'V' from pg_views where viewname like $mask and schemaname  not in ( 'pg_catalog','information_schema')  ";
+			else
+				$this->metaTablesSQL = "
+select tablename,'T' from pg_tables where tablename like $mask 
+ union 
+select viewname,'V' from pg_views where viewname like $mask";
+		}
+		$ret =& ADOConnection::MetaTables($ttype,$showSchema);
+		
+		if ($mask) {
+			$this->metaTablesSQL = $save;
+		}
+		return $ret;
+	}
+	
+function &MetaColumns($table,$normalize=true) 
+	{
+	global $ADODB_FETCH_MODE;
+	
+		$schema = false;
+		$this->_findschema($table,$schema);
+		
+		if ($normalize) $table = strtolower($table);
+
+		$save = $ADODB_FETCH_MODE;
+		$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
+		if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
+		
+		if ($schema) $rs =& $this->Execute(sprintf($this->metaColumnsSQL1,$table,$table,$schema));
+		else $rs =& $this->Execute(sprintf($this->metaColumnsSQL,$table,$table));
+		if (isset($savem)) $this->SetFetchMode($savem);
+		$ADODB_FETCH_MODE = $save;
+		
+		if ($rs === false) {
+			$false = false;
+			return $false;
+		}
+		if (!empty($this->metaKeySQL)) {
+			// If we want the primary keys, we have to issue a separate query
+			// Of course, a modified version of the metaColumnsSQL query using a 
+			// LEFT JOIN would have been much more elegant, but postgres does 
+			// not support OUTER JOINS. So here is the clumsy way.
+			
+			$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
+			
+			$rskey = $this->Execute(sprintf($this->metaKeySQL,($table)));
+			// fetch all result in once for performance.
+			$keys =& $rskey->GetArray();
+			if (isset($savem)) $this->SetFetchMode($savem);
+			$ADODB_FETCH_MODE = $save;
+			
+			$rskey->Close();
+			unset($rskey);
+		}
+
+		$rsdefa = array();
+		if (!empty($this->metaDefaultsSQL)) {
+			$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
+			$sql = sprintf($this->metaDefaultsSQL, ($table));
+			$rsdef = $this->Execute($sql);
+			if (isset($savem)) $this->SetFetchMode($savem);
+			$ADODB_FETCH_MODE = $save;
+			
+			if ($rsdef) {
+				while (!$rsdef->EOF) {
+					$num = $rsdef->fields['num'];
+					$s = $rsdef->fields['def'];
+					if (strpos($s,'::')===false && substr($s, 0, 1) == "'") { /* quoted strings hack... for now... fixme */
+						$s = substr($s, 1);
+						$s = substr($s, 0, strlen($s) - 1);
+					}
+
+					$rsdefa[$num] = $s;
+					$rsdef->MoveNext();
+				}
+			} else {
+				ADOConnection::outp( "==> SQL => " . $sql);
+			}
+			unset($rsdef);
+		}
+	
+		$retarr = array();
+		while (!$rs->EOF) { 	
+			$fld = new ADOFieldObject();
+			$fld->name = $rs->fields[0];
+			$fld->type = $rs->fields[1];
+			$fld->max_length = $rs->fields[2];
+			if ($fld->max_length <= 0) $fld->max_length = $rs->fields[3]-4;
+			if ($fld->max_length <= 0) $fld->max_length = -1;
+			if ($fld->type == 'numeric') {
+				$fld->scale = $fld->max_length & 0xFFFF;
+				$fld->max_length >>= 16;
+			}
+			// dannym
+			// 5 hasdefault; 6 num-of-column
+			$fld->has_default = ($rs->fields[5] == 't');
+			if ($fld->has_default) {
+				$fld->default_value = $rsdefa[$rs->fields[6]];
+			}
+
+			//Freek
+			if ($rs->fields[4] == $this->true) {
+				$fld->not_null = true;
+			}
+			
+			// Freek
+			if (is_array($keys)) {
+				foreach($keys as $key) {
+					if ($fld->name == $key['column_name'] AND $key['primary_key'] == $this->true) 
+						$fld->primary_key = true;
+					if ($fld->name == $key['column_name'] AND $key['unique_key'] == $this->true) 
+						$fld->unique = true; // What name is more compatible?
+				}
+			}
+			
+			if ($ADODB_FETCH_MODE == ADODB_FETCH_NUM) $retarr[] = $fld;	
+			else $retarr[($normalize) ? strtoupper($fld->name) : $fld->name] = $fld;
+			
+			$rs->MoveNext();
+		}
+		$rs->Close();
+		return empty($retarr) ? false : $retarr;	
+		
+	}
+
+}
+
+class ADODB_pdo_base extends ADODB_pdo {
+
+	function ServerInfo()
+	{
+		return ADOConnection::ServerInfo();
+	}
+	
+	function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
+	{
+		$ret = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
+		return $ret;
+	}
+	
+	function MetaTables()
+	{
+		return false;
+	}
+	
+	function MetaColumns()
+	{
+		return false;
+	}
+}
+
+
 class ADODB_pdo extends ADOConnection {
 	var $databaseType = "pdo";	
 	var $dataProvider = "pdo";
@@ -30,16 +306,36 @@
 	var $_haserrorfunctions = true;
 	var $_lastAffectedRows = 0;
 	
+	var $dsnType = '';
 	var $stmt = false;
 	
-	function ADODB_pdo() 
+	function ADODB_pdo()
 	{
 	}
 	
-
+	function _UpdatePDO()
+	{
+		$d = &$this->_driver;
+		$this->fmtDate = $d->fmtDate;
+		$this->fmtTimeStamp = $d->fmtTimeStamp;
+		$this->replaceQuote = $d->replaceQuote;
+		$this->sysDate = $d->sysDate;
+		$this->sysTimeStamp = $d->sysTimeStamp;
+		$this->random = $d->random;
+		$this->concat_operator = $d->concat_operator;
+	}
+	
+	function Time()
+	{
+		return false;
+	}
+	
 	// returns true or false
 	function _connect($argDSN, $argUsername, $argPassword, $argDatabasename, $persist=false)
 	{
+		$at = strpos($argDSN,':');
+		$this->dsnType = substr($argDSN,0,$at);
+
 		$this->_connectionID = new PDO($argDSN, $argUsername, $argPassword);
 		if ($this->_connectionID) {
 			switch(ADODB_ASSOC_CASE){
@@ -52,10 +348,18 @@
 			//$this->_connectionID->setAttribute(PDO_ATTR_ERRMODE,PDO_ERRMODE_SILENT );
 			$this->_connectionID->setAttribute(PDO_ATTR_CASE,$m);
 			
+			$class = 'ADODB_pdo_'.$this->dsnType;
 			//$this->_connectionID->setAttribute(PDO_ATTR_AUTOCOMMIT,true);
+			if (class_exists($class))
+				$this->_driver = new $class();
+			else
+				$this->_driver = new ADODB_pdo_base();
 			
+			$this->_driver->_connectionID = $this->_connectionID;
+			$this->_UpdatePDO();
 			return true;
 		}
+		$this->_driver = new ADODB_pdo_base();
 		return false;
 	}
 	
@@ -65,13 +369,41 @@
 		return $this->_connect($argDSN, $argUsername, $argPassword, $argDatabasename, true);
 	}
 	
+	/*------------------------------------------------------------------------------*/
+	
+	
+	function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0) 
+	{	
+		$save = $this->_driver->fetchMode;
+		$this->_driver->fetchMode = $this->fetchMode;
+		$ret = $this->_driver->SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
+		$this->_driver->fetchMode = $save;
+		return $ret;
+	}
+	
+	
+	function ServerInfo()
+	{
+		return $this->_driver->ServerInfo();
+	}
+	
+	function MetaTables($ttype=false,$showSchema=false,$mask=false)
+	{
+		return $this->_driver->MetaTables($ttype,$showSchema,$mask);
+	}
+	
+	function MetaColumns($table,$normalize=true)
+	{
+		return $this->_driver->MetaColumns($table,$normalize);
+	}
+	
 	function ErrorMsg()
 	{
 		if ($this->_stmt) $arr = $this->_stmt->errorInfo();
 		else $arr = $this->_connectionID->errorInfo();
 		
 		if ($arr) {
-			if ($arr[0]) return $arr[2];
+			if ((integer)$arr[0]) return $arr[2];
 			else return '';
 		} else return '-1';
 	}
@@ -85,9 +417,14 @@
 	
 	function ErrorNo()
 	{
-		
-		if ($this->_stmt) return $this->_stmt->errorCode();
-		else return $this->_connectionID->errorInfo();
+		if ($this->_stmt) $err = $this->_stmt->errorCode();
+		else {
+			$arr = $this->_connectionID->errorInfo();
+			if (isset($arr[0])) $err = $arr[0];
+			else $err = -1;
+		}
+		if ($err == '00000') return 0; // allows empty check
+		return $err;
 	}
 
 	function BeginTrans()
@@ -102,6 +439,7 @@
 	
 	function CommitTrans($ok=true) 
 	{ 
+		if (!$this->hasTransactions) return false;
 		if ($this->transOff) return true; 
 		if (!$ok) return $this->RollbackTrans();
 		if ($this->transCnt) $this->transCnt -= 1;
@@ -114,6 +452,7 @@
 	
 	function RollbackTrans()
 	{
+		if (!$this->hasTransactions) return false;
 		if ($this->transOff) return true; 
 		if ($this->transCnt) $this->transCnt -= 1;
 		$this->_autocommit = true;
@@ -145,14 +484,17 @@
 		if (is_array($sql)) {
 			$stmt = $sql[1];
 		} else {
-			$stmt = $this->_connectionID->prepare($sql);		
+			$stmt = $this->_connectionID->prepare($sql);
 		}
 		if ($stmt) {
-			if ($inputarr) $stmt->execute($inputarr);
-			else $stmt->execute();
+			if ($inputarr) $ok = $stmt->execute($inputarr);
+			else $ok = $stmt->execute();
 		}
-		$this->_stmt = $stmt;
-		return $stmt;
+		if ($ok) {
+			$this->_stmt = $stmt;
+			return $stmt;
+		} 
+		return false;
 	}
 
 	// returns true or false
@@ -211,12 +553,17 @@
 		if ($this->_stmt) $arr = $this->_stmt->errorInfo();
 		else $arr = $this->_connectionID->errorInfo();
 		print_r($arr);
-		if ($arr) {
-			if ($arr[0]) return $arr[2];
+		if (is_array($arr)) {
+			if ((integer) $arr[0] && isset($arr[2])) return $arr[2];
 			else return '';
 		} else return '-1';
 	}
 	
+	function NumCols()
+	{
+		return ($this->_stmt) ? $this->_stmt->columnCount() : 0;
+	}
+	
 	function ErrorNo()
 	{
 		if ($this->_stmt) return $this->_stmt->errorCode();
@@ -240,11 +587,13 @@
 			global $ADODB_FETCH_MODE;
 			$mode = $ADODB_FETCH_MODE;
 		}
+		$this->adodbFetchMode = $mode;
 		switch($mode) {
-		default:
-		case ADODB_FETCH_BOTH: $mode = PDO_FETCH_BOTH; break;
 		case ADODB_FETCH_NUM: $mode = PDO_FETCH_NUM; break;
 		case ADODB_FETCH_ASSOC:  $mode = PDO_FETCH_ASSOC; break;
+		
+		case ADODB_FETCH_BOTH: 
+		default: $mode = PDO_FETCH_BOTH; break;
 		}
 		$this->fetchMode = $mode;
 		
@@ -252,21 +601,6 @@
 		$this->ADORecordSet($id);
 	}
 
-
-	// returns the field object
-	function &FetchField($fieldOffset = -1) 
-	{
-		
-		$off=$fieldOffset+1; // offsets begin at 1
-		
-		$o= new ADOFieldObject();
-		$o->name = @odbc_field_name($this->_queryID,$off);
-		$o->type = @odbc_field_type($this->_queryID,$off);
-		$o->max_length = @odbc_field_len($this->_queryID,$off);
-		if (ADODB_ASSOC_CASE == 0) $o->name = strtolower($o->name);
-		else if (ADODB_ASSOC_CASE == 1) $o->name = strtoupper($o->name);
-		return $o;
-	}
 	
 	function Init()
 	{
@@ -282,21 +616,40 @@
 			if ($this->EOF = ($this->_fetch() === false)) {
 				$this->_numOfRows = 0; // _numOfRows could be -1
 			}
-			$this->_numOfFields = sizeof($this->fields);
 		} else {
 			$this->EOF = true;
 		}
 	}
 	
-		
 	function _initrs()
 	{
 	global $ADODB_COUNTRECS;
 	
 		$this->_numOfRows = ($ADODB_COUNTRECS) ? @$this->_queryID->rowCount() : -1;
 		if (!$this->_numOfRows) $this->_numOfRows = -1;
-		$this->_numOfFields =0;
-	}	
+		$this->_numOfFields = $this->_queryID->columnCount();
+	}
+
+	// returns the field object
+	function &FetchField($fieldOffset = -1) 
+	{
+		$off=$fieldOffset+1; // offsets begin at 1
+		
+		$o= new ADOFieldObject();
+		$arr = $this->_queryID->getColumnMeta($fieldOffset);
+		if (!$arr) return false;
+
+		//adodb_pr($arr);
+		$o->name = $arr['name'];
+		if (isset($arr['native_type'])) $o->type = $arr['native_type'];
+		else $o->type = adodb_pdo_type($arr['pdo_type']);
+		$o->max_length = $arr['len'];
+		$o->precision = $arr['precision'];
+		
+		if (ADODB_ASSOC_CASE == 0) $o->name = strtolower($o->name);
+		else if (ADODB_ASSOC_CASE == 1) $o->name = strtoupper($o->name);
+		return $o;
+	}
 	
 	function _seek($row)
 	{
@@ -305,6 +658,8 @@
 	
 	function _fetch()
 	{
+		if (!$this->_queryID) return false;
+		
 		$this->fields = $this->_queryID->fetch($this->fetchMode);
 		return !empty($this->fields);
 	}
@@ -313,6 +668,20 @@
 	{
 		$this->_queryID = false;
 	}
+	
+	function Fields($colname)
+	{
+		if ($this->adodbFetchMode != ADODB_FETCH_NUM) return @$this->fields[$colname];
+		
+		if (!$this->bind) {
+			$this->bind = array();
+			for ($i=0; $i < $this->_numOfFields; $i++) {
+				$o = $this->FetchField($i);
+				$this->bind[strtoupper($o->name)] = $i;
+			}
+		}
+		 return $this->fields[$this->bind[strtoupper($colname)]];
+	}
 
 }
 

Modified: plog/trunk/class/database/adodb/drivers/adodb-postgres.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-postgres.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-postgres.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /*
- V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+ V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: plog/trunk/class/database/adodb/drivers/adodb-postgres64.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-postgres64.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-postgres64.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /*
- V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+ V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -73,12 +73,13 @@
 	var $blobEncodeType = 'C';
 	var $metaColumnsSQL = "SELECT a.attname,t.typname,a.attlen,a.atttypmod,a.attnotnull,a.atthasdef,a.attnum 
 		FROM pg_class c, pg_attribute a,pg_type t 
-		WHERE relkind = 'r' AND (c.relname='%s' or c.relname = lower('%s')) and a.attname not like '....%%'
+		WHERE relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s')) and a.attname not like '....%%'
 AND a.attnum > 0 AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum";
 
+	// used when schema defined
 	var $metaColumnsSQL1 = "SELECT a.attname, t.typname, a.attlen, a.atttypmod, a.attnotnull, a.atthasdef, a.attnum 
 FROM pg_class c, pg_attribute a, pg_type t, pg_namespace n 
-WHERE relkind = 'r' AND (c.relname='%s' or c.relname = lower('%s'))
+WHERE relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s'))
  and c.relnamespace=n.oid and n.nspname='%s' 
 	and a.attname not like '....%%' AND a.attnum > 0 
 	AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum";
@@ -101,10 +102,11 @@
 	var $_dropSeqSQL = "DROP SEQUENCE %s";
 	var $metaDefaultsSQL = "SELECT d.adnum as num, d.adsrc as def from pg_attrdef d, pg_class c where d.adrelid=c.oid and c.relname='%s' order by d.adnum";
 	var $random = 'random()';		/// random function
-	var $autoRollback = true; // apparently pgsql does not autorollback properly before 4.3.4
+	var $autoRollback = true; // apparently pgsql does not autorollback properly before php 4.3.4
 							// http://bugs.php.net/bug.php?id=25404
 							
 	var $_bindInputArray = false; // requires postgresql 7.3+ and ability to modify database
+	var $disableBlobs = false; // set to true to disable blob checking, resulting in 2-5% improvement in performance.
 	
 	// The last (fmtTimeStamp is not entirely correct: 
 	// PostgreSQL also has support for time zones, 
@@ -303,6 +305,14 @@
 				$s .= 'AM';
 				break;
 				
+			case 'w':
+				$s .= 'D';
+				break;
+			
+			case 'l':
+				$s .= 'DAY';
+				break;
+				
 			default:
 			// handle escape characters...
 				if ($ch == '\\') {
@@ -404,8 +414,13 @@
 		// note that there is a pg_escape_bytea function only for php 4.2.0 or later
 	}
 	
+	// assumes bytea for blob, and varchar for clob
 	function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB')
 	{
+	
+		if ($blobtype == 'CLOB') {
+    		return $this->Execute("UPDATE $table SET $column=" . $this->qstr($val) . " WHERE $where");
+		}
 		// do not use bind params which uses qstr(), as blobencode() already quotes data
 		return $this->Execute("UPDATE $table SET $column='".$this->BlobEncode($val)."'::bytea WHERE $where");
 	}
@@ -525,7 +540,7 @@
 			$rs->MoveNext();
 		}
 		$rs->Close();
-		return $retarr;	
+		return empty($retarr) ? false : $retarr;	
 		
 	}
 
@@ -814,9 +829,10 @@
 		{
 		case ADODB_FETCH_NUM: $this->fetchMode = PGSQL_NUM; break;
 		case ADODB_FETCH_ASSOC:$this->fetchMode = PGSQL_ASSOC; break;
-		default:
+		
 		case ADODB_FETCH_DEFAULT:
-		case ADODB_FETCH_BOTH:$this->fetchMode = PGSQL_BOTH; break;
+		case ADODB_FETCH_BOTH:
+		default: $this->fetchMode = PGSQL_BOTH; break;
 		}
 		$this->adodbFetchMode = $mode;
 		$this->ADORecordSet($queryID);
@@ -837,6 +853,8 @@
 		$this->_numOfFields = @pg_numfields($qid);
 		
 		// cache types for blob decode check
+		// apparently pg_fieldtype actually performs an sql query on the database to get the type.
+		if (empty($this->connection->noBlobs))
 		for ($i=0, $max = $this->_numOfFields; $i < $max; $i++) {  
 			if (pg_fieldtype($qid,$i) == 'bytea') {
 				$this->_blobArr[$i] = pg_fieldname($qid,$i);
@@ -921,7 +939,7 @@
 
 		$this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode);
 		
-	if ($this->fields && isset($this->_blobArr)) $this->_fixblobs();
+		if ($this->fields && isset($this->_blobArr)) $this->_fixblobs();
 			
 		return (is_array($this->fields));
 	}
@@ -947,6 +965,7 @@
 				case 'NAME':
 		   		case 'BPCHAR':
 				case '_VARCHAR':
+				case 'INET':
 					if ($len <= $this->blobSize) return 'C';
 				
 				case 'TEXT':
@@ -991,4 +1010,4 @@
 	}
 
 }
-?>
+?>
\ No newline at end of file

Modified: plog/trunk/class/database/adodb/drivers/adodb-postgres7.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-postgres7.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-postgres7.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /*
- V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+ V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim#natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -90,41 +90,6 @@
 }
 
 
-
-    function xMetaForeignKeys($table, $owner=false, $upper=false)
-	{
-
-        $sql = '
-SELECT t.tgargs as args
-   FROM pg_trigger t,
-        pg_class c,
-        pg_class c2,
-        pg_proc f
-   WHERE t.tgenabled
-   AND t.tgrelid=c.oid
-   AND t.tgconstrrelid=c2.oid
-   AND t.tgfoid=f.oid
-   AND f.proname ~ \'^RI_FKey_check_ins\'
-   AND t.tgargs like \'$1\\\000'.strtolower($table).'%\'
-   ORDER BY t.tgrelid';
-
-        $rs = $this->Execute($sql);
-		if ($rs && !$rs->EOF) {
-			$arr =& $rs->GetArray();
-			$a = array();
-			foreach($arr as $v) {
-                $data = explode(chr(0), $v['args']);
-                if ($upper) {
-                    $a[] = array(strtoupper($data[2]) => strtoupper($data[4].'='.$data[5]));
-                } else {
-                    $a[] = array($data[2] => $data[4].'='.$data[5]);
-                }
-                
-			}
-			return $a;
-		}
-		else return false;
-    }
 	
  	 // this is a set of functions for managing client encoding - very important if the encodings
 	// of your database and your output target (i.e. HTML) don't match

Copied: plog/trunk/class/database/adodb/drivers/adodb-postgres8.inc.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-postgres8.inc.php)

Modified: plog/trunk/class/database/adodb/drivers/adodb-proxy.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-proxy.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-proxy.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Modified: plog/trunk/class/database/adodb/drivers/adodb-sapdb.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-sapdb.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-sapdb.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Modified: plog/trunk/class/database/adodb/drivers/adodb-sqlanywhere.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-sqlanywhere.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-sqlanywhere.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /* 
-version V4.54 5 Nov 2004 (c) 2000-2004  John Lim (jlim at natsoft.com.my).  All rights
+version V4.62 2 Apr 2005 (c) 2000-2005  John Lim (jlim at natsoft.com.my).  All rights
 reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 

Modified: plog/trunk/class/database/adodb/drivers/adodb-sqlite.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-sqlite.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-sqlite.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.
@@ -234,7 +234,52 @@
 		return @sqlite_close($this->_connectionID);
 	}
 
+	function &MetaIndexes ($table, $primary = FALSE, $owner=false)
+	{
+		$false = false;
+		// save old fetch mode
+        global $ADODB_FETCH_MODE;
+        $save = $ADODB_FETCH_MODE;
+        $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
+        if ($this->fetchMode !== FALSE) {
+               $savem = $this->SetFetchMode(FALSE);
+        }
+		$SQL=sprintf("SELECT name,sql FROM sqlite_master WHERE type='index' AND tbl_name='%s'", strtolower($table));
+        $rs = $this->Execute($SQL);
+        if (!is_object($rs)) {
+			if (isset($savem)) 
+				$this->SetFetchMode($savem);
+			$ADODB_FETCH_MODE = $save;
+            return $false;
+        }
 
+		$indexes = array ();
+		while ($row = $rs->FetchRow()) {
+			if ($primary && preg_match("/primary/i",$row[1]) == 0) continue;
+            if (!isset($indexes[$row[0]])) {
+
+			$indexes[$row[0]] = array(
+				   'unique' => preg_match("/unique/i",$row[1]),
+				   'columns' => array());
+			}
+			/**
+			  * There must be a more elegant way of doing this,
+			  * the index elements appear in the SQL statement
+			  * in cols[1] between parentheses
+			  * e.g CREATE UNIQUE INDEX ware_0 ON warehouse (org,warehouse)
+			  */
+			$cols = explode("(",$row[1]);
+			$cols = explode(")",$cols[1]);
+			array_pop($cols);
+			$indexes[$row[0]]['columns'] = $cols;
+		}
+		if (isset($savem)) { 
+            $this->SetFetchMode($savem);
+			$ADODB_FETCH_MODE = $save;
+		}
+        return $indexes;
+	}
+
 }
 
 /*--------------------------------------------------------------------------------------

Copied: plog/trunk/class/database/adodb/drivers/adodb-sqlite.inc.php.bak (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sqlite.inc.php.bak)

Modified: plog/trunk/class/database/adodb/drivers/adodb-sqlitepo.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-sqlitepo.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-sqlitepo.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
   the BSD license will take precedence.

Modified: plog/trunk/class/database/adodb/drivers/adodb-sybase.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-sybase.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-sybase.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim. All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim. All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 
@@ -288,7 +288,7 @@
 		}
 		if (!$mode) $this->fetchMode = ADODB_FETCH_ASSOC;
 		else $this->fetchMode = $mode;
-		return $this->ADORecordSet($id,$mode);
+		$this->ADORecordSet($id,$mode);
 	}
 	
 	/*	Returns: an object containing field information. 

Copied: plog/trunk/class/database/adodb/drivers/adodb-sybase_ase.inc.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sybase_ase.inc.php)

Modified: plog/trunk/class/database/adodb/drivers/adodb-vfp.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-vfp.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/drivers/adodb-vfp.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. 

Copied: plog/trunk/class/database/adodb/lang/adodb-da.inc.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/lang/adodb-da.inc.php)

Modified: plog/trunk/class/database/adodb/lang/adodb-es.inc.php
===================================================================
--- plog/trunk/class/database/adodb/lang/adodb-es.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/lang/adodb-es.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,34 +1,33 @@
-<?php
-// contributed by "Horacio Degiorgi" <horaciod at codigophp.com>
-$ADODB_LANG_ARRAY = array (
-			'LANG'                      => 'es',
-            DB_ERROR                    => 'error desconocido',
-            DB_ERROR_ALREADY_EXISTS     => 'ya existe',
-            DB_ERROR_CANNOT_CREATE      => 'imposible crear',
-            DB_ERROR_CANNOT_DELETE      => 'imposible borrar',
-            DB_ERROR_CANNOT_DROP        => 'imposible hacer drop',
-            DB_ERROR_CONSTRAINT         => 'violacion de constraint',
-            DB_ERROR_DIVZERO            => 'division por cero',
-            DB_ERROR_INVALID            => 'invalido',
-            DB_ERROR_INVALID_DATE       => 'fecha u hora invalida',
-            DB_ERROR_INVALID_NUMBER     => 'numero invalido',
-            DB_ERROR_MISMATCH           => 'error',
-            DB_ERROR_NODBSELECTED       => 'no hay base de datos seleccionada',
-            DB_ERROR_NOSUCHFIELD        => 'campo invalido',
-            DB_ERROR_NOSUCHTABLE        => 'tabla no existe',
-            DB_ERROR_NOT_CAPABLE        => 'capacidad invalida para esta DB',
-            DB_ERROR_NOT_FOUND          => 'no encontrado',
-            DB_ERROR_NOT_LOCKED         => 'no bloqueado',
-            DB_ERROR_SYNTAX             => 'error de sintaxis',
-            DB_ERROR_UNSUPPORTED        => 'no soportado',
-            DB_ERROR_VALUE_COUNT_ON_ROW => 'la cantidad de columnas no corresponden a la cantidad de valores',
-            DB_ERROR_INVALID_DSN
-        => 'DSN invalido',
-            DB_ERROR_CONNECT_FAILED     => 'fallo la conexion',
-            0	                       => 'sin error', // DB_OK
-            DB_ERROR_NEED_MORE_DATA     => 'insuficientes datos',
-            DB_ERROR_EXTENSION_NOT_FOUND=> 'extension no encontrada',
-            DB_ERROR_NOSUCHDB           => 'base de datos no encontrada',
-            DB_ERROR_ACCESS_VIOLATION   => 'permisos insuficientes'
-);
+<?php
+// contributed by "Horacio Degiorgi" <horaciod at codigophp.com>
+$ADODB_LANG_ARRAY = array (
+			'LANG'                      => 'es',
+            DB_ERROR                    => 'error desconocido',
+            DB_ERROR_ALREADY_EXISTS     => 'ya existe',
+            DB_ERROR_CANNOT_CREATE      => 'imposible crear',
+            DB_ERROR_CANNOT_DELETE      => 'imposible borrar',
+            DB_ERROR_CANNOT_DROP        => 'imposible hacer drop',
+            DB_ERROR_CONSTRAINT         => 'violacion de constraint',
+            DB_ERROR_DIVZERO            => 'division por cero',
+            DB_ERROR_INVALID            => 'invalido',
+            DB_ERROR_INVALID_DATE       => 'fecha u hora invalida',
+            DB_ERROR_INVALID_NUMBER     => 'numero invalido',
+            DB_ERROR_MISMATCH           => 'error',
+            DB_ERROR_NODBSELECTED       => 'no hay base de datos seleccionada',
+            DB_ERROR_NOSUCHFIELD        => 'campo invalido',
+            DB_ERROR_NOSUCHTABLE        => 'tabla no existe',
+            DB_ERROR_NOT_CAPABLE        => 'capacidad invalida para esta DB',
+            DB_ERROR_NOT_FOUND          => 'no encontrado',
+            DB_ERROR_NOT_LOCKED         => 'no bloqueado',
+            DB_ERROR_SYNTAX             => 'error de sintaxis',
+            DB_ERROR_UNSUPPORTED        => 'no soportado',
+            DB_ERROR_VALUE_COUNT_ON_ROW => 'la cantidad de columnas no corresponden a la cantidad de valores',
+            DB_ERROR_INVALID_DSN        => 'DSN invalido',
+            DB_ERROR_CONNECT_FAILED     => 'fallo la conexion',
+            0	                       => 'sin error', // DB_OK
+            DB_ERROR_NEED_MORE_DATA     => 'insuficientes datos',
+            DB_ERROR_EXTENSION_NOT_FOUND=> 'extension no encontrada',
+            DB_ERROR_NOSUCHDB           => 'base de datos no encontrada',
+            DB_ERROR_ACCESS_VIOLATION   => 'permisos insuficientes'
+);
 ?>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/lang/adodb-esperanto.inc.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/lang/adodb-esperanto.inc.php)

Copied: plog/trunk/class/database/adodb/lang/adodb-uk1251.inc.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/lang/adodb-uk1251.inc.php)

Copied: plog/trunk/class/database/adodb/pear (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/pear)

Copied: plog/trunk/class/database/adodb/pear/Auth (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/pear/Auth)

Copied: plog/trunk/class/database/adodb/pear/Auth/Container (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/pear/Auth/Container)

Deleted: plog/trunk/class/database/adodb/pear/Auth/Container/ADOdb.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/pear/Auth/Container/ADOdb.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/pear/Auth/Container/ADOdb.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,412 +0,0 @@
-<?php
-//
-// +----------------------------------------------------------------------+
-// | PHP Version 4                                                        |
-// +----------------------------------------------------------------------+
-// |                                                                      |
-// +----------------------------------------------------------------------+
-// | This source file is subject to version 2.02 of the PHP license,      |
-// | that is bundled with this package in the file LICENSE, and is        |
-// | available at through the world-wide-web at                           |
-// | http://www.php.net/license/2_02.txt.                                 |
-// | If you did not receive a copy of the PHP license and are unable to   |
-// | obtain it through the world-wide-web, please send a note to          |
-// | license at php.net so we can mail you a copy immediately.               |
-// +----------------------------------------------------------------------+
-// | Authors: Martin Jansen <mj at php.net>
-// |	Richard Tango-Lowy <richtl at arscognita.com>                                  |
-// +----------------------------------------------------------------------+
-//
-// $Id: ADOdb.php,v 1.2 2004/11/11 07:19:11 jlim Exp $
-//
-
-require_once 'Auth/Container.php';
-require_once 'adodb.inc.php';
-require_once 'adodb-pear.inc.php';
-require_once 'adodb-errorpear.inc.php';
-
-/**
- * Storage driver for fetching login data from a database using ADOdb-PHP.
- *
- * This storage driver can use all databases which are supported
- * by the ADBdb DB abstraction layer to fetch login data.
- * See http://php.weblogs.com/adodb for information on ADOdb.
- * NOTE: The ADOdb directory MUST be in your PHP include_path!
- *
- * @author   Richard Tango-Lowy <richtl at arscognita.com>
- * @package  Auth
- * @version  $Revision: 1.2 $
- */
-class Auth_Container_ADOdb extends Auth_Container
-{
-
-    /**
-     * Additional options for the storage container
-     * @var array
-     */
-    var $options = array();
-
-    /**
-     * DB object
-     * @var object
-     */
-    var $db = null;
-    var $dsn = '';
-	
-    /**
-     * User that is currently selected from the DB.
-     * @var string
-     */
-    var $activeUser = '';
-
-    // {{{ Constructor
-
-    /**
-     * Constructor of the container class
-     *
-     * Initate connection to the database via PEAR::ADOdb
-     *
-     * @param  string Connection data or DB object
-     * @return object Returns an error object if something went wrong
-     */
-    function Auth_Container_ADOdb($dsn)
-    {
-        $this->_setDefaults();
-		
-        if (is_array($dsn)) {
-            $this->_parseOptions($dsn);
-
-            if (empty($this->options['dsn'])) {
-                PEAR::raiseError('No connection parameters specified!');
-            }
-        } else {
-        	// Extract db_type from dsn string.
-            $this->options['dsn'] = $dsn;
-        }
-    }
-
-    // }}}
-    // {{{ _connect()
-
-    /**
-     * Connect to database by using the given DSN string
-     *
-     * @access private
-     * @param  string DSN string
-     * @return mixed  Object on error, otherwise bool
-     */
-     function _connect($dsn)
-    {
-        if (is_string($dsn) || is_array($dsn)) {
-        	if(!$this->db) {
-	        	$this->db = &ADONewConnection($dsn);
-	    		if( $err = ADODB_Pear_error() ) {
-	   	    		return PEAR::raiseError($err);
-	    		}
-        	}
-        	
-        } else {
-            return PEAR::raiseError('The given dsn was not valid in file ' . __FILE__ . ' at line ' . __LINE__,
-                                    41,
-                                    PEAR_ERROR_RETURN,
-                                    null,
-                                    null
-                                    );
-        }
-        
-        if(!$this->db) {
-        	return PEAR::raiseError(ADODB_Pear_error());
-        } else {
-        	return true;
-        }
-    }
-
-    // }}}
-    // {{{ _prepare()
-
-    /**
-     * Prepare database connection
-     *
-     * This function checks if we have already opened a connection to
-     * the database. If that's not the case, a new connection is opened.
-     *
-     * @access private
-     * @return mixed True or a DB error object.
-     */
-    function _prepare()
-    {
-    	if(!$this->db) {
-    		$res = $this->_connect($this->options['dsn']);  		
-    	}
-        return true;
-    }
-
-    // }}}
-    // {{{ query()
-
-    /**
-     * Prepare query to the database
-     *
-     * This function checks if we have already opened a connection to
-     * the database. If that's not the case, a new connection is opened.
-     * After that the query is passed to the database.
-     *
-     * @access public
-     * @param  string Query string
-     * @return mixed  a DB_result object or DB_OK on success, a DB
-     *                or PEAR error on failure
-     */
-    function query($query)
-    {
-        $err = $this->_prepare();
-        if ($err !== true) {
-            return $err;
-        }
-        return $this->db->query($query);
-    }
-
-    // }}}
-    // {{{ _setDefaults()
-
-    /**
-     * Set some default options
-     *
-     * @access private
-     * @return void
-     */
-    function _setDefaults()
-    {
-    	$this->options['db_type']	= 'mysql';
-        $this->options['table']       = 'auth';
-        $this->options['usernamecol'] = 'username';
-        $this->options['passwordcol'] = 'password';
-        $this->options['dsn']         = '';
-        $this->options['db_fields']   = '';
-        $this->options['cryptType']   = 'md5';
-    }
-
-    // }}}
-    // {{{ _parseOptions()
-
-    /**
-     * Parse options passed to the container class
-     *
-     * @access private
-     * @param  array
-     */
-    function _parseOptions($array)
-    {
-        foreach ($array as $key => $value) {
-            if (isset($this->options[$key])) {
-                $this->options[$key] = $value;
-            }
-        }
-
-        /* Include additional fields if they exist */
-        if(!empty($this->options['db_fields'])){
-            if(is_array($this->options['db_fields'])){
-                $this->options['db_fields'] = join($this->options['db_fields'], ', ');
-            }
-            $this->options['db_fields'] = ', '.$this->options['db_fields'];
-        }
-    }
-
-    // }}}
-    // {{{ fetchData()
-
-    /**
-     * Get user information from database
-     *
-     * This function uses the given username to fetch
-     * the corresponding login data from the database
-     * table. If an account that matches the passed username
-     * and password is found, the function returns true.
-     * Otherwise it returns false.
-     *
-     * @param   string Username
-     * @param   string Password
-     * @return  mixed  Error object or boolean
-     */
-    function fetchData($username, $password)
-    {
-        // Prepare for a database query
-        $err = $this->_prepare();
-        if ($err !== true) {
-            return PEAR::raiseError($err->getMessage(), $err->getCode());
-        }
-
-        // Find if db_fields contains a *, i so assume all col are selected
-        if(strstr($this->options['db_fields'], '*')){
-            $sql_from = "*";
-        }
-        else{
-            $sql_from = $this->options['usernamecol'] . ", ".$this->options['passwordcol'].$this->options['db_fields'];
-        }
-        
-        $query = "SELECT ".$sql_from.
-                " FROM ".$this->options['table'].
-                " WHERE ".$this->options['usernamecol']." = " . $this->db->Quote($username);
-        
-        $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
-        $rset = $this->db->Execute( $query );
-        $res = $rset->fetchRow();
-
-        if (DB::isError($res)) {
-            return PEAR::raiseError($res->getMessage(), $res->getCode());
-        }
-        if (!is_array($res)) {
-            $this->activeUser = '';
-            return false;
-        }
-        if ($this->verifyPassword(trim($password, "\r\n"),
-                                  trim($res[$this->options['passwordcol']], "\r\n"),
-                                  $this->options['cryptType'])) {
-            // Store additional field values in the session
-            foreach ($res as $key => $value) {
-                if ($key == $this->options['passwordcol'] ||
-                    $key == $this->options['usernamecol']) {
-                    continue;
-                }
-                // Use reference to the auth object if exists
-                // This is because the auth session variable can change so a static call to setAuthData does not make sence
-                if(is_object($this->_auth_obj)){
-                    $this->_auth_obj->setAuthData($key, $value);
-                } else {
-                    Auth::setAuthData($key, $value);
-                }
-            }
-
-            return true;
-        }
-
-        $this->activeUser = $res[$this->options['usernamecol']];
-        return false;
-    }
-
-    // }}}
-    // {{{ listUsers()
-
-    function listUsers()
-    {
-        $err = $this->_prepare();
-        if ($err !== true) {
-            return PEAR::raiseError($err->getMessage(), $err->getCode());
-        }
-
-        $retVal = array();
-
-        // Find if db_fileds contains a *, i so assume all col are selected
-        if(strstr($this->options['db_fields'], '*')){
-            $sql_from = "*";
-        }
-        else{
-            $sql_from = $this->options['usernamecol'] . ", ".$this->options['passwordcol'].$this->options['db_fields'];
-        }
-
-        $query = sprintf("SELECT %s FROM %s",
-                         $sql_from,
-                         $this->options['table']
-                         );
-        $res = $this->db->getAll($query, null, DB_FETCHMODE_ASSOC);
-
-        if (DB::isError($res)) {
-            return PEAR::raiseError($res->getMessage(), $res->getCode());
-        } else {
-            foreach ($res as $user) {
-                $user['username'] = $user[$this->options['usernamecol']];
-                $retVal[] = $user;
-            }
-        }
-        return $retVal;
-    }
-
-    // }}}
-    // {{{ addUser()
-
-    /**
-     * Add user to the storage container
-     *
-     * @access public
-     * @param  string Username
-     * @param  string Password
-     * @param  mixed  Additional information that are stored in the DB
-     *
-     * @return mixed True on success, otherwise error object
-     */
-    function addUser($username, $password, $additional = "")
-    {
-        if (function_exists($this->options['cryptType'])) {
-            $cryptFunction = $this->options['cryptType'];
-        } else {
-            $cryptFunction = 'md5';
-        }
-
-        $additional_key   = '';
-        $additional_value = '';
-
-        if (is_array($additional)) {
-            foreach ($additional as $key => $value) {
-                $additional_key .= ', ' . $key;
-                $additional_value .= ", '" . $value . "'";
-            }
-        }
-
-        $query = sprintf("INSERT INTO %s (%s, %s%s) VALUES ('%s', '%s'%s)",
-                         $this->options['table'],
-                         $this->options['usernamecol'],
-                         $this->options['passwordcol'],
-                         $additional_key,
-                         $username,
-                         $cryptFunction($password),
-                         $additional_value
-                         );
-
-        $res = $this->query($query);
-
-        if (DB::isError($res)) {
-           return PEAR::raiseError($res->getMessage(), $res->getCode());
-        } else {
-          return true;
-        }
-    }
-
-    // }}}
-    // {{{ removeUser()
-
-    /**
-     * Remove user from the storage container
-     *
-     * @access public
-     * @param  string Username
-     *
-     * @return mixed True on success, otherwise error object
-     */
-    function removeUser($username)
-    {
-        $query = sprintf("DELETE FROM %s WHERE %s = '%s'",
-                         $this->options['table'],
-                         $this->options['usernamecol'],
-                         $username
-                         );
-
-        $res = $this->query($query);
-
-        if (DB::isError($res)) {
-           return PEAR::raiseError($res->getMessage(), $res->getCode());
-        } else {
-          return true;
-        }
-    }
-
-    // }}}
-}
-
-function showDbg( $string ) {
-	print "<P>$string</P>";
-}
-function dump( $var, $str, $vardump = false ) {
-	print "<H4>$str</H4><pre>";
-	( !$vardump ) ? ( print_r( $var )) : ( var_dump( $var ));
-	print "</pre>";
-}
-?>

Copied: plog/trunk/class/database/adodb/pear/Auth/Container/ADOdb.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/pear/Auth/Container/ADOdb.php)

Deleted: plog/trunk/class/database/adodb/pear/readme.Auth.txt
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/pear/readme.Auth.txt	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/pear/readme.Auth.txt	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,20 +0,0 @@
-From: Rich Tango-Lowy (richtl#arscognita.com)
-Date: Sat, May 29, 2004 11:20 am
-
-OK, I hacked out an ADOdb container for PEAR-Auth. The error handling's 
-a bit of a mess, but all the methods work.
-
-Copy ADOdb.php to your pear/Auth/Container/ directory.
-
-Use the ADOdb container exactly as you would the DB
-container, but specify 'ADOdb' instead of 'DB':
-
-$dsn = "mysql://myuser:mypass@localhost/authdb";
-$a = new Auth("ADOdb", $dsn, "loginFunction");
-
-
--------------------
-
-John Lim adds:
-
-See http://pear.php.net/manual/en/package.authentication.php

Copied: plog/trunk/class/database/adodb/pear/readme.Auth.txt (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/pear/readme.Auth.txt)

Modified: plog/trunk/class/database/adodb/perf/perf-db2.inc.php
===================================================================
--- plog/trunk/class/database/adodb/perf/perf-db2.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/perf/perf-db2.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 

Modified: plog/trunk/class/database/adodb/perf/perf-informix.inc.php
===================================================================
--- plog/trunk/class/database/adodb/perf/perf-informix.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/perf/perf-informix.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 

Modified: plog/trunk/class/database/adodb/perf/perf-mssql.inc.php
===================================================================
--- plog/trunk/class/database/adodb/perf/perf-mssql.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/perf/perf-mssql.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 

Modified: plog/trunk/class/database/adodb/perf/perf-mysql.inc.php
===================================================================
--- plog/trunk/class/database/adodb/perf/perf-mysql.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/perf/perf-mysql.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
@@ -227,7 +227,6 @@
 	*/
 	function GetInnoDBHitRatio()
 	{
-	global $HTTP_SESSION_VARS;
 	
 		$rs = $this->conn->Execute('show innodb status');
 		if (!$rs || $rs->EOF) return 0;
@@ -237,10 +236,10 @@
 		$stat = substr($stat,$at,200);
 		if (preg_match('!Buffer pool hit rate\s*([0-9]*) / ([0-9]*)!',$stat,$arr)) {
 			$val = 100*$arr[1]/$arr[2];
-			$HTTP_SESSION_VARS['INNODB_HIT_PCT'] = $val;
+			$_SESSION['INNODB_HIT_PCT'] = $val;
 			return $val;
 		} else {
-			if (isset($HTTP_SESSION_VARS['INNODB_HIT_PCT'])) return $HTTP_SESSION_VARS['INNODB_HIT_PCT'];
+			if (isset($_SESSION['INNODB_HIT_PCT'])) return $_SESSION['INNODB_HIT_PCT'];
 			return 0;
 		}
 		return 0;

Modified: plog/trunk/class/database/adodb/perf/perf-oci8.inc.php
===================================================================
--- plog/trunk/class/database/adodb/perf/perf-oci8.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/perf/perf-oci8.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 
@@ -345,7 +345,7 @@
 				$check = $rs->fields[0].'::'.$rs->fields[1];			
 			} else
 				$sql .= $rs->fields[2];
-			
+			if (substr($sql,strlen($sql)-1) == "\0") $sql = substr($sql,0,strlen($sql)-1);
 			$rs->MoveNext();
 		}
 		$rs->Close();
@@ -402,13 +402,13 @@
 order by
   1 desc, s.address, p.piece";
 
-  		global $ADODB_CACHE_MODE,$HTTP_GET_VARS;
-  		if (isset($HTTP_GET_VARS['expsixora']) && isset($HTTP_GET_VARS['sql'])) {
-				$partial = empty($HTTP_GET_VARS['part']);
-				echo "<a name=explain></a>".$this->Explain($HTTP_GET_VARS['sql'],$partial)."\n";
+  		global $ADODB_CACHE_MODE;
+  		if (isset($_GET['expsixora']) && isset($_GET['sql'])) {
+				$partial = empty($_GET['part']);
+				echo "<a name=explain></a>".$this->Explain($_GET['sql'],$partial)."\n";
 		}
 
-		if (isset($HTTP_GET_VARS['sql'])) return $this->_SuspiciousSQL();
+		if (isset($_GET['sql'])) return $this->_SuspiciousSQL();
 		
 		$save = $ADODB_CACHE_MODE;
 		$ADODB_CACHE_MODE = ADODB_FETCH_NUM;
@@ -467,13 +467,13 @@
 order by
   1 desc, s.address, p.piece
 ";
-		global $ADODB_CACHE_MODE,$HTTP_GET_VARS;
-  		if (isset($HTTP_GET_VARS['expeixora']) && isset($HTTP_GET_VARS['sql'])) {
-			$partial = empty($HTTP_GET_VARS['part']);	
-			echo "<a name=explain></a>".$this->Explain($HTTP_GET_VARS['sql'],$partial)."\n";
+		global $ADODB_CACHE_MODE;
+  		if (isset($_GET['expeixora']) && isset($_GET['sql'])) {
+			$partial = empty($_GET['part']);	
+			echo "<a name=explain></a>".$this->Explain($_GET['sql'],$partial)."\n";
 		}
 		
-		if (isset($HTTP_GET_VARS['sql'])) {
+		if (isset($_GET['sql'])) {
 			 $var =& $this->_ExpensiveSQL();
 			 return $var;
 		}

Modified: plog/trunk/class/database/adodb/perf/perf-postgres.inc.php
===================================================================
--- plog/trunk/class/database/adodb/perf/perf-postgres.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/perf/perf-postgres.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence. See License.txt. 

Modified: plog/trunk/class/database/adodb/pivottable.inc.php
===================================================================
--- plog/trunk/class/database/adodb/pivottable.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/pivottable.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.50 6 July 2004 (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+ * @version V4.50 6 July 2004 (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
  * Whenever there is any discrepancy between the two licenses, 
  * the BSD license will take precedence. 
@@ -37,6 +37,8 @@
 	if ($aggfield) $hidecnt = true;
 	else $hidecnt = false;
 	
+	$iif = strpos($db->databaseType,'access') !== false; 
+		// note - vfp still doesn' work even with IIF enabled || $db->databaseType == 'vfp';
 	
 	//$hidecnt = false;
 	
@@ -47,20 +49,39 @@
 	$sel = "$rowfields, ";
 	if (is_array($colfield)) {
 		foreach ($colfield as $k => $v) {
-			if (!$hidecnt) $sel .= "\n\t$aggfn(CASE WHEN $v THEN 1 ELSE 0 END) AS \"$k\", ";
-			if ($aggfield)
-				$sel .= "\n\t$aggfn(CASE WHEN $v THEN $aggfield ELSE 0 END) AS \"$sumlabel$k\", ";
+			$k = trim($k);
+			if (!$hidecnt) {
+				$sel .= $iif ? 
+					"\n\t$aggfn(IIF($v,1,0)) AS \"$k\", "
+					:
+					"\n\t$aggfn(CASE WHEN $v THEN 1 ELSE 0 END) AS \"$k\", ";
+			}
+			if ($aggfield) {
+				$sel .= $iif ?
+					"\n\t$aggfn(IIF($v,$aggfield,0)) AS \"$sumlabel$k\", "
+					:
+					"\n\t$aggfn(CASE WHEN $v THEN $aggfield ELSE 0 END) AS \"$sumlabel$k\", ";
+			}
 		} 
 	} else {
 		foreach ($colarr as $v) {
 			if (!is_numeric($v)) $vq = $db->qstr($v);
 			else $vq = $v;
+			$v = trim($v);
 			if (strlen($v) == 0	) $v = 'null';
-			if (!$hidecnt) $sel .= "\n\t$aggfn(CASE WHEN $colfield=$vq THEN 1 ELSE 0 END) AS \"$v\", ";
+			if (!$hidecnt) {
+				$sel .= $iif ?
+					"\n\t$aggfn(IIF($colfield=$vq,1,0)) AS \"$v\", "
+					:
+					"\n\t$aggfn(CASE WHEN $colfield=$vq THEN 1 ELSE 0 END) AS \"$v\", ";
+			}
 			if ($aggfield) {
 				if ($hidecnt) $label = $v;
 				else $label = "{$v}_$aggfield";
-				$sel .= "\n\t$aggfn(CASE WHEN $colfield=$vq THEN $aggfield ELSE 0 END) AS \"$label\", ";
+				$sel .= $iif ?
+					"\n\t$aggfn(IIF($colfield=$vq,$aggfield,0)) AS \"$label\", "
+					:
+					"\n\t$aggfn(CASE WHEN $colfield=$vq THEN $aggfield ELSE 0 END) AS \"$label\", ";
 			}
 		}
 	}
@@ -123,7 +144,7 @@
 #
 # Query the main "product" table
 # Set the rows to CompanyName and QuantityPerUnit
-# and the columns to the UnitsInStock for different ranges
+# and the columns to the UnitsInStock for diiferent ranges
 # and define the joins to link to lookup tables 
 # "categories" and "suppliers"
 #

Modified: plog/trunk/class/database/adodb/rsfilter.inc.php
===================================================================
--- plog/trunk/class/database/adodb/rsfilter.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/rsfilter.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.50 6 July 2004 (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+ * @version V4.62 2 Apr 2005 (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
  * Whenever there is any discrepancy between the two licenses, 
  * the BSD license will take precedence. 
@@ -42,7 +42,14 @@
 	}
 	$rows = $rs->RecordCount();
 	for ($i=0; $i < $rows; $i++) {
-		$fn($rs->_array[$i],$rs);
+		if (is_array ($fn)) {
+        	$obj = $fn[0];
+        	$method = $fn[1];
+        	$obj->$method ($rs->_array[$i],$rs);
+      } else {
+			$fn($rs->_array[$i],$rs);
+      }
+	  
 	}
 	if (!$rs->EOF) {
 		$rs->_currentRow = 0;

Copied: plog/trunk/class/database/adodb/server.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/server.php)

Modified: plog/trunk/class/database/adodb/session/adodb-compress-bzip2.php
===================================================================
--- plog/trunk/class/database/adodb/session/adodb-compress-bzip2.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/session/adodb-compress-bzip2.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.01 23 Oct 2003  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,

Modified: plog/trunk/class/database/adodb/session/adodb-compress-gzip.php
===================================================================
--- plog/trunk/class/database/adodb/session/adodb-compress-gzip.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/session/adodb-compress-gzip.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -2,7 +2,7 @@
 
 
 /*
-V4.01 23 Oct 2003  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,

Modified: plog/trunk/class/database/adodb/session/adodb-cryptsession.php
===================================================================
--- plog/trunk/class/database/adodb/session/adodb-cryptsession.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/session/adodb-cryptsession.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -2,7 +2,7 @@
 
 
 /*
-V4.01 23 Oct 2003  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,

Modified: plog/trunk/class/database/adodb/session/adodb-encrypt-mcrypt.php
===================================================================
--- plog/trunk/class/database/adodb/session/adodb-encrypt-mcrypt.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/session/adodb-encrypt-mcrypt.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -2,7 +2,7 @@
 
 
 /*
-V4.01 23 Oct 2003  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,

Modified: plog/trunk/class/database/adodb/session/adodb-encrypt-md5.php
===================================================================
--- plog/trunk/class/database/adodb/session/adodb-encrypt-md5.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/session/adodb-encrypt-md5.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.01 23 Oct 2003  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,

Modified: plog/trunk/class/database/adodb/session/adodb-encrypt-secret.php
===================================================================
--- plog/trunk/class/database/adodb/session/adodb-encrypt-secret.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/session/adodb-encrypt-secret.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.01 23 Oct 2003  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,

Modified: plog/trunk/class/database/adodb/session/adodb-session-clob.php
===================================================================
--- plog/trunk/class/database/adodb/session/adodb-session-clob.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/session/adodb-session-clob.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -2,7 +2,7 @@
 
 
 /*
-V4.01 23 Oct 2003  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,

Modified: plog/trunk/class/database/adodb/session/adodb-session.php
===================================================================
--- plog/trunk/class/database/adodb/session/adodb-session.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/session/adodb-session.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -2,7 +2,7 @@
 
 
 /*
-V4.01 23 Oct 2003  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
@@ -33,6 +33,58 @@
 
 define('ADODB_SESSION', dirname(__FILE__));
 
+
+/* 
+	Unserialize session data manually. See http://phplens.com/lens/lensforum/msgs.php?id=9821 
+	
+	From Kerr Schere, to unserialize session data stored via ADOdb. 
+	1. Pull the session data from the db and loop through it. 
+	2. Inside the loop, you will need to urldecode the data column. 
+	3. After urldecode, run the serialized string through this function:
+
+*/
+function adodb_unserialize( $serialized_string ) 
+{
+	$variables = array( );
+	$a = preg_split( "/(\w+)\|/", $serialized_string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
+	for( $i = 0; $i < count( $a ); $i = $i+2 ) {
+		$variables[$a[$i]] = unserialize( $a[$i+1] );
+	}
+	return( $variables );
+}
+
+/*
+	Thanks Joe Li. See http://phplens.com/lens/lensforum/msgs.php?id=11487&x=1
+	Since adodb 4.61.
+*/
+function adodb_session_regenerate_id() 
+{
+	$conn =& ADODB_Session::_conn();
+	if (!$conn) return false;
+
+	$old_id = session_id();
+	if (function_exists('session_regenerate_id')) {
+		session_regenerate_id();
+	} else {
+		session_id(md5(uniqid(rand(), true)));
+		$ck = session_get_cookie_params();
+		setcookie(session_name(), session_id(), false, $ck['path'], $ck['domain'], $ck['secure']);
+		//@session_start();
+	}
+	$new_id = session_id();
+	$ok =& $conn->Execute('UPDATE '. ADODB_Session::table(). ' SET sesskey='. $conn->qstr($new_id). ' WHERE sesskey='.$conn->qstr($old_id));
+	
+	/* it is possible that the update statement fails due to a collision */
+	if (!$ok) {
+		session_id($old_id);
+		if (empty($ck)) $ck = session_get_cookie_params();
+		setcookie(session_name(), session_id(), false, $ck['path'], $ck['domain'], $ck['secure']);
+		return false;
+	}
+	
+	return true;
+}
+
 /*!
 	\static
 */
@@ -473,12 +525,10 @@
 		Close the connection
 	*/
 	function close() {
+/*
 		$conn =& ADODB_Session::_conn();
-
-		if ($conn) {
-			$conn->Close();
-		}
-
+		if ($conn) $conn->Close();
+*/
 		return true;
 	}
 
@@ -542,16 +592,16 @@
 		$filter			= ADODB_Session::filter();
 		$lifetime		= ADODB_Session::lifetime();
 		$table			= ADODB_Session::table();
-
+	
 		if (!$conn) {
 			return false;
 		}
-
+		$qkey = $conn->qstr($key);
+	
 		assert('$table');
 
 		$expiry = time() + $lifetime;
 
-		$qkey = $conn->quote($key);
 		$binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' : '';
 
 		// crc32 optimization since adodb 2.1
@@ -560,8 +610,8 @@
 			if ($debug) {
 				echo '<p>Session: Only updating date - crc32 not changed</p>';
 			}
-			$sql = "UPDATE $table SET expiry = $expiry WHERE $binary sesskey = $qkey AND expiry >= " . time();
-			$rs =& $conn->Execute($sql);
+			$sql = "UPDATE $table SET expiry = ".$conn->Param('0')." WHERE $binary sesskey = ".$conn->Param('1')." AND expiry >= ".$conn->Param('2');
+			$rs =& $conn->Execute($sql,array($expiry,$key,time()));
 			ADODB_Session::_dumprs($rs);
 			if ($rs) {
 				$rs->Close();
@@ -604,7 +654,7 @@
 					$lob_value = 'null';
 					break;
 			}
-
+			
 			// do we insert or update? => as for sesskey
 			$rs =& $conn->Execute("SELECT COUNT(*) AS cnt FROM $table WHERE $binary sesskey = $qkey");
 			ADODB_Session::_dumprs($rs);
@@ -788,10 +838,9 @@
 				$t = time();
 
 				if (abs($dbt - $t) >= $sync_seconds) {
-					global $HTTP_SERVER_VARS;
 					$msg = __FILE__ .
-						": Server time for webserver {$HTTP_SERVER_VARS['HTTP_HOST']} not in synch with database: " .
-						" database=$dbt ($dbts), webserver=$t (diff=". (abs($dbt - $t) / 3600) . ' hours)';
+						": Server time for webserver {$_SERVER['HTTP_HOST']} not in synch with database: " .
+						" database=$dbt ($dbts), webserver=$t (diff=". (abs($dbt - $t) / 60) . ' minutes)';
 					error_log($msg);
 					if ($debug) {
 						ADOConnection::outp("<p>$msg</p>");
@@ -802,7 +851,6 @@
 
 		return true;
 	}
-
 }
 
 ADODB_Session::_init();

Copied: plog/trunk/class/database/adodb/tests (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests)

Deleted: plog/trunk/class/database/adodb/tests/benchmark.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/benchmark.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/benchmark.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,84 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-	<title>ADODB Benchmarks</title>
-</head> 
-
-<body>
-<?php 
-/*
-V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
-  Released under both BSD license and Lesser GPL library license. 
-  Whenever there is any discrepancy between the two licenses, 
-  the BSD license will take precedence.
-  
-  Benchmark code to test the speed to the ADODB library with different databases.
-  This is a simplistic benchmark to be used as the basis for further testing.
-  It should not be used as proof of the superiority of one database over the other.
-*/ 
- 
-$testmssql = true;
-//$testvfp = true;
-$testoracle = true;
-$testado = true; 
-$testibase = true;
-$testaccess = true;
-$testmysql = true;
-$testsqlite = true;;
-
-set_time_limit(240); // increase timeout
-
-include("../tohtml.inc.php");
-include("../adodb.inc.php");
-
-function testdb(&$db,$createtab="create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)")
-{
-GLOBAL $ADODB_version,$ADODB_FETCH_MODE;
-
-	adodb_backtrace();
-	
-	$max = 100;
-	$sql = 'select * from ADOXYZ';
-	$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-	
-	//print "<h3>ADODB Version: $ADODB_version Host: <i>$db->host</i> &nbsp; Database: <i>$db->database</i></h3>";
-	
-	// perform query once to cache results so we are only testing throughput 
-	$rs = $db->Execute($sql);
-	if (!$rs){
-		print "Error in recordset<p>";
-		return;
-	}	
-	$arr = $rs->GetArray();
-	//$db->debug = true;
-	global $ADODB_COUNTRECS;
-	$ADODB_COUNTRECS = false;
-	$start = microtime();
-	for ($i=0; $i < $max; $i++) {
-		$rs =& $db->Execute($sql);	
-		$arr =& $rs->GetArray();
-	   //		 print $arr[0][1];
-	}
-	$end =  microtime();
-	$start = explode(' ',$start);
-	$end = explode(' ',$end);
-	
-	//print_r($start);
-	//print_r($end);
-	
-	  //  print_r($arr);
-	$total = $end[0]+trim($end[1]) - $start[0]-trim($start[1]);
-	printf ("<p>seconds = %8.2f for %d iterations each with %d records</p>",$total,$max, sizeof($arr));
-	flush();
-
-
-		//$db->Close();
-}
-include("testdatabases.inc.php");
-
-?>
-
-
-</body>
-</html>

Copied: plog/trunk/class/database/adodb/tests/benchmark.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/benchmark.php)

Deleted: plog/trunk/class/database/adodb/tests/client.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/client.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/client.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,194 +0,0 @@
-<html>
-<body bgcolor=white>
-<?php
-/** 
- * V4.50 6 July 2004  (c) 2001-2002 John Lim (jlim at natsoft.com.my). All rights reserved.
- * Released under both BSD license and Lesser GPL library license. 
-  Whenever there is any discrepancy between the two licenses, 
-  the BSD license will take precedence. 
- * 
- * set tabs to 8
- */
- 
- // documentation on usage is at http://php.weblogs.com/adodb_csv
- 
-include('../adodb.inc.php');
-include('../tohtml.inc.php');
-
- function &send2server($url,$sql)
- {
-	$url .= '?sql='.urlencode($sql);
-	print "<p>$url</p>";
-	$rs = csv2rs($url,$err);
-	if ($err) print $err;
-	return $rs;
- }
- 
- function print_pre($s)
- {
- 	print "<pre>";print_r($s);print "</pre>";
- }
-
-
-$serverURL = 'http://localhost/php/phplens/adodb/server.php';
-$testhttp = false;
-
-$sql1 = "insertz into products (productname) values ('testprod 1')";
-$sql2 = "insert into products (productname) values ('testprod 1')";
-$sql3 = "insert into products (productname) values ('testprod 2')";
-$sql4 = "delete from products where productid>80";
-$sql5 = 'select * from products';
-	
-if ($testhttp) {
-	print "<a href=#c>Client Driver Tests</a><p>";
-	print "<h3>Test Error</h3>";
-	$rs = send2server($serverURL,$sql1);
-	print_pre($rs);
-	print "<hr>";
-	
-	print "<h3>Test Insert</h3>";
-	
-	$rs = send2server($serverURL,$sql2);
-	print_pre($rs);
-	print "<hr>";
-	
-	print "<h3>Test Insert2</h3>";
-	
-	$rs = send2server($serverURL,$sql3);
-	print_pre($rs);
-	print "<hr>";
-	
-	print "<h3>Test Delete</h3>";
-	
-	$rs = send2server($serverURL,$sql4);
-	print_pre($rs);
-	print "<hr>";
-	
-	
-	print "<h3>Test Select</h3>";
-	$rs = send2server($serverURL,$sql5);
-	if ($rs) rs2html($rs);
-	
-	print "<hr>";
-}
-
-
-print "<a name=c><h1>CLIENT Driver Tests</h1>";
-$conn = ADONewConnection('csv');
-$conn->Connect($serverURL);
-$conn->debug = true;
-
-print "<h3>Bad SQL</h3>";
-
-$rs = $conn->Execute($sql1);
-
-print "<h3>Insert SQL 1</h3>";
-$rs = $conn->Execute($sql2);
-
-print "<h3>Insert SQL 2</h3>";
-$rs = $conn->Execute($sql3);
-
-print "<h3>Select SQL</h3>";
-$rs = $conn->Execute($sql5);
-if ($rs) rs2html($rs);
-
-print "<h3>Delete SQL</h3>";
-$rs = $conn->Execute($sql4);
-
-print "<h3>Select SQL</h3>";
-$rs = $conn->Execute($sql5);
-if ($rs) rs2html($rs);
-
-
-/* EXPECTED RESULTS FOR HTTP TEST:
-
-Test Insert
-http://localhost/php/adodb/server.php?sql=insert+into+products+%28productname%29+values+%28%27testprod%27%29
-
-adorecordset Object
-(
-	[dataProvider] => native
-	[fields] => 
-	[blobSize] => 64
-	[canSeek] => 
-	[EOF] => 1
-	[emptyTimeStamp] =>  
-	[emptyDate] =>  
-	[debug] => 
-	[timeToLive] => 0
-	[bind] => 
-	[_numOfRows] => -1
-	[_numOfFields] => 0
-	[_queryID] => 1
-	[_currentRow] => -1
-	[_closed] => 
-	[_inited] => 
-	[sql] => insert into products (productname) values ('testprod')
-	[affectedrows] => 1
-	[insertid] => 81
-)
-
-
---------------------------------------------------------------------------------
-
-Test Insert2
-http://localhost/php/adodb/server.php?sql=insert+into+products+%28productname%29+values+%28%27testprod%27%29
-
-adorecordset Object
-(
-	[dataProvider] => native
-	[fields] => 
-	[blobSize] => 64
-	[canSeek] => 
-	[EOF] => 1
-	[emptyTimeStamp] =>  
-	[emptyDate] =>  
-	[debug] => 
-	[timeToLive] => 0
-	[bind] => 
-	[_numOfRows] => -1
-	[_numOfFields] => 0
-	[_queryID] => 1
-	[_currentRow] => -1
-	[_closed] => 
-	[_inited] => 
-	[sql] => insert into products (productname) values ('testprod')
-	[affectedrows] => 1
-	[insertid] => 82
-)
-
-
---------------------------------------------------------------------------------
-
-Test Delete
-http://localhost/php/adodb/server.php?sql=delete+from+products+where+productid%3E80
-
-adorecordset Object
-(
-	[dataProvider] => native
-	[fields] => 
-	[blobSize] => 64
-	[canSeek] => 
-	[EOF] => 1
-	[emptyTimeStamp] =>  
-	[emptyDate] =>  
-	[debug] => 
-	[timeToLive] => 0
-	[bind] => 
-	[_numOfRows] => -1
-	[_numOfFields] => 0
-	[_queryID] => 1
-	[_currentRow] => -1
-	[_closed] => 
-	[_inited] => 
-	[sql] => delete from products where productid>80
-	[affectedrows] => 2
-	[insertid] => 0
-)
-
-[more stuff deleted]
- .
- . 
- .
-*/
-?>

Copied: plog/trunk/class/database/adodb/tests/client.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/client.php)

Deleted: plog/trunk/class/database/adodb/tests/pdo.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/pdo.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/pdo.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,82 +0,0 @@
-<?php
-error_reporting(E_ALL);
-include('../adodb.inc.php');
-
-try {
-	echo "New Connection\n";
-	$DB = NewADOConnection('pdo');
-	echo "Connect\n";
-	
-	$u = ''; $p = '';
-	/*
-	$connstr = 'odbc:nwind';
-	
-	$connstr = 'oci:';
-	$u = 'scott';
-	$p = 'natsoft';
-	
-	
-	$connstr ="sqlite:d:\inetpub\adodb\sqlite.db";
-	*/
-	
-	$connstr = "mysql:dbname=northwind";
-	$u = 'root';
-	
-	$connstr = "pgsql:dbname=test";
-	$u = 'tester';
-	$p = 'test';
-	
-	$DB->Connect($connstr,$u,$p) || die("CONNECT FAILED");
-	
-	
-	echo "$connstr: Execute\n";
-	
-	//$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
-	$rs = $DB->Execute("select * from ADOXYZ where id<3");
-	echo "*** e=".$DB->ErrorNo() . " ".($DB->ErrorMsg())."\n";
-	
-	
-	//print_r(get_class_methods($DB->_stmt));
-	
-	if (!$rs) die("NO RS");
-	
-	echo "Meta\n";
-	for ($i=0; $i < $rs->NumCols(); $i++) {
-		var_dump($rs->FetchField($i));
-		echo "<br>";
-	}
-	
-	echo "FETCH\n";
-	$cnt = 0;
-	while (!$rs->EOF) {
-		adodb_pr($rs->fields); 
-		$rs->MoveNext();
-		if ($cnt++ > 1000) break;
-	}
-	
-	echo "<br>--------------------------------------------------------<br>\n\n\n";
-	
-	$stmt = $DB->PrepareStmt("select * from ADOXYZ");
-	
-	$rs = $stmt->Execute();
-	$cols = $stmt->NumCols(); // execute required
-	
-	echo "COLS = $cols";
-	for($i=1;$i<=$cols;$i++) {
-		$v = $stmt->_stmt->getColumnMeta($i);
-		var_dump($v);
-	}
-	
-	echo "e=".$stmt->ErrorNo() . " ".($stmt->ErrorMsg())."\n";
-	while ($arr = $rs->FetchRow()) {
-		adodb_pr($arr);
-	}
-	die("DONE\n");
-
-} catch (exception $e) {
-	echo "<pre>";
-	echo $e;
-	echo "</pre>";
-}
-
-?>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/tests/pdo.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/pdo.php)

Deleted: plog/trunk/class/database/adodb/tests/test-datadict.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/test-datadict.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/test-datadict.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,248 +0,0 @@
-<?php
-/*
-
-  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
-  Released under both BSD license and Lesser GPL library license. 
-  Whenever there is any discrepancy between the two licenses, 
-  the BSD license will take precedence.
-	
-  Set tabs to 4 for best viewing.
-
-*/
-
-error_reporting(E_ALL);
-include_once('../adodb.inc.php');
-
-foreach(array('sapdb','sybase','mysqlt','access','oci8','postgres','odbc_mssql','odbc','db2','firebird','informix') as $dbType) {
-	echo "<h3>$dbType</h3><p>";
-	$db = NewADOConnection($dbType);
-	$dict = NewDataDictionary($db);
-
-	if (!$dict) continue;
-	$dict->debug = 1;
-	
-	$opts = array('REPLACE','mysql' => 'TYPE=INNODB', 'oci8' => 'TABLESPACE USERS');
-	
-/*	$flds = array(
-		array('id',	'I',								
-							'AUTO','KEY'),
-							
-		array('name' => 'firstname', 'type' => 'varchar','size' => 30,
-							'DEFAULT'=>'Joan'),
-							
-		array('lastname','varchar',28,
-							'DEFAULT'=>'Chen','key'),
-							
-		array('averylonglongfieldname','X',1024,
-							'NOTNULL','default' => 'test'),
-							
-		array('price','N','7.2',
-							'NOTNULL','default' => '0.00'),
-							
-		array('MYDATE', 'D', 
-							'DEFDATE'),
-		array('TS','T',
-							'DEFTIMESTAMP')
-	);*/
-	
-	$flds = "
-ID            I           AUTO KEY,
-FIRSTNAME     VARCHAR(30) DEFAULT 'Joan',
-LASTNAME      VARCHAR(28) DEFAULT 'Chen' key,
-averylonglongfieldname X(1024) DEFAULT 'test',
-price         N(7.2)  DEFAULT '0.00',
-MYDATE        D      DEFDATE,
-BIGFELLOW     X      NOTNULL,
-TS            T      DEFTIMESTAMP";
-
-
-	$sqla = $dict->CreateDatabase('KUTU',array('postgres'=>"LOCATION='/u01/postdata'"));
-	$dict->SetSchema('KUTU');
-	
-	$sqli = ($dict->CreateTableSQL('testtable',$flds, $opts));
-	$sqla =& array_merge($sqla,$sqli);
-	
-	$sqli = $dict->CreateIndexSQL('idx','testtable','firstname,lastname',array('BITMAP','FULLTEXT','CLUSTERED','HASH'));
-	$sqla =& array_merge($sqla,$sqli);
-	$sqli = $dict->CreateIndexSQL('idx2','testtable','price,lastname');//,array('BITMAP','FULLTEXT','CLUSTERED'));
-	$sqla =& array_merge($sqla,$sqli);
-	
-	$addflds = array(array('height', 'F'),array('weight','F'));
-	$sqli = $dict->AddColumnSQL('testtable',$addflds);
-	$sqla =& array_merge($sqla,$sqli);
-	$addflds = array(array('height', 'F','NOTNULL'),array('weight','F','NOTNULL'));
-	$sqli = $dict->AlterColumnSQL('testtable',$addflds);
-	$sqla =& array_merge($sqla,$sqli);
-	
-	
-	printsqla($dbType,$sqla);
-	
-	if (file_exists('d:\inetpub\wwwroot\php\phplens\adodb\adodb.inc.php'))
-	if ($dbType == 'mysqlt') {
-		$db->Connect('localhost', "root", "", "test");
-		$dict->SetSchema('');
-		$sqla2 = $dict->ChangeTableSQL('adoxyz',$flds);
-		if ($sqla2) printsqla($dbType,$sqla2);
-	}
-	if ($dbType == 'postgres') {
-		if (@$db->Connect('localhost', "tester", "test", "test"));
-		$dict->SetSchema('');
-		$sqla2 = $dict->ChangeTableSQL('adoxyz',$flds);
-		if ($sqla2) printsqla($dbType,$sqla2);
-	}
-	
-	if ($dbType == 'odbc_mssql') {
-		$dsn = $dsn = "PROVIDER=MSDASQL;Driver={SQL Server};Server=localhost;Database=northwind;";
-		if (@$db->Connect($dsn, "sa", "natsoft", "test"));
-		$dict->SetSchema('');
-		$sqla2 = $dict->ChangeTableSQL('adoxyz',$flds);
-		if ($sqla2) printsqla($dbType,$sqla2);
-	}
-	
-	
-	
-	adodb_pr($dict->databaseType);
-	printsqla($dbType, $dict->DropColumnSQL('table',array('`col`','col2')));
-	printsqla($dbType, $dict->ChangeTableSQL('adoxyz','LASTNAME varchar(32)'));
-	
-}
-
-function printsqla($dbType,$sqla)
-{
-	print "<pre>";
-	//print_r($dict->MetaTables());
-	foreach($sqla as $s) {
-		$s = htmlspecialchars($s);
-		print "$s;\n";
-		if ($dbType == 'oci8') print "/\n";
-	}
-	print "</pre><hr>";
-}
-
-/***
-
-Generated SQL:
-
-mysql
-
-CREATE DATABASE KUTU;
-DROP TABLE KUTU.testtable;
-CREATE TABLE KUTU.testtable (
-id               INTEGER NOT NULL AUTO_INCREMENT,
-firstname        VARCHAR(30) DEFAULT 'Joan',
-lastname         VARCHAR(28) NOT NULL DEFAULT 'Chen',
-averylonglongfieldname LONGTEXT NOT NULL,
-price            NUMERIC(7,2) NOT NULL DEFAULT 0.00,
-MYDATE           DATE DEFAULT CURDATE(),
-                 PRIMARY KEY (id, lastname)
-)TYPE=ISAM;
-CREATE FULLTEXT INDEX idx ON KUTU.testtable (firstname,lastname);
-CREATE INDEX idx2 ON KUTU.testtable (price,lastname);
-ALTER TABLE KUTU.testtable  ADD height           DOUBLE;
-ALTER TABLE KUTU.testtable  ADD weight           DOUBLE;
-ALTER TABLE KUTU.testtable  MODIFY COLUMN height           DOUBLE NOT NULL;
-ALTER TABLE KUTU.testtable  MODIFY COLUMN weight           DOUBLE NOT NULL;
-
-
---------------------------------------------------------------------------------
-
-oci8
-
-CREATE USER KUTU IDENTIFIED BY tiger;
-/
-GRANT CREATE SESSION, CREATE TABLE,UNLIMITED TABLESPACE,CREATE SEQUENCE TO KUTU;
-/
-DROP TABLE KUTU.testtable CASCADE CONSTRAINTS;
-/
-CREATE TABLE KUTU.testtable (
-id               NUMBER(16) NOT NULL,
-firstname        VARCHAR(30) DEFAULT 'Joan',
-lastname         VARCHAR(28) DEFAULT 'Chen' NOT NULL,
-averylonglongfieldname CLOB NOT NULL,
-price            NUMBER(7,2) DEFAULT 0.00 NOT NULL,
-MYDATE           DATE DEFAULT TRUNC(SYSDATE),
-                 PRIMARY KEY (id, lastname)
-)TABLESPACE USERS;
-/
-DROP SEQUENCE KUTU.SEQ_testtable;
-/
-CREATE SEQUENCE KUTU.SEQ_testtable;
-/
-CREATE OR REPLACE TRIGGER KUTU.TRIG_SEQ_testtable BEFORE insert ON KUTU.testtable 
-		FOR EACH ROW
-		BEGIN
-		  select KUTU.SEQ_testtable.nextval into :new.id from dual;
-		END;
-/
-CREATE BITMAP INDEX idx ON KUTU.testtable (firstname,lastname);
-/
-CREATE INDEX idx2 ON KUTU.testtable (price,lastname);
-/
-ALTER TABLE testtable ADD (
- height           NUMBER,
- weight           NUMBER);
-/
-ALTER TABLE testtable MODIFY(
- height           NUMBER NOT NULL,
- weight           NUMBER NOT NULL);
-/
-
-
---------------------------------------------------------------------------------
-
-postgres
-AlterColumnSQL not supported for PostgreSQL
-
-
-CREATE DATABASE KUTU LOCATION='/u01/postdata';
-DROP TABLE KUTU.testtable;
-CREATE TABLE KUTU.testtable (
-id               SERIAL,
-firstname        VARCHAR(30) DEFAULT 'Joan',
-lastname         VARCHAR(28) DEFAULT 'Chen' NOT NULL,
-averylonglongfieldname TEXT NOT NULL,
-price            NUMERIC(7,2) DEFAULT 0.00 NOT NULL,
-MYDATE           DATE DEFAULT CURRENT_DATE,
-                 PRIMARY KEY (id, lastname)
-);
-CREATE INDEX idx ON KUTU.testtable USING HASH (firstname,lastname);
-CREATE INDEX idx2 ON KUTU.testtable (price,lastname);
-ALTER TABLE KUTU.testtable  ADD height           FLOAT8;
-ALTER TABLE KUTU.testtable  ADD weight           FLOAT8;
-
-
---------------------------------------------------------------------------------
-
-odbc_mssql
-
-CREATE DATABASE KUTU;
-DROP TABLE KUTU.testtable;
-CREATE TABLE KUTU.testtable (
-id               INT IDENTITY(1,1) NOT NULL,
-firstname        VARCHAR(30) DEFAULT 'Joan',
-lastname         VARCHAR(28) DEFAULT 'Chen' NOT NULL,
-averylonglongfieldname TEXT NOT NULL,
-price            NUMERIC(7,2) DEFAULT 0.00 NOT NULL,
-MYDATE           DATETIME DEFAULT GetDate(),
-                 PRIMARY KEY (id, lastname)
-);
-CREATE CLUSTERED INDEX idx ON KUTU.testtable (firstname,lastname);
-CREATE INDEX idx2 ON KUTU.testtable (price,lastname);
-ALTER TABLE KUTU.testtable  ADD
- height           REAL,
- weight           REAL;
-ALTER TABLE KUTU.testtable  ALTER COLUMN height           REAL NOT NULL;
-ALTER TABLE KUTU.testtable  ALTER COLUMN weight           REAL NOT NULL;
-
-
---------------------------------------------------------------------------------
-*/
-
-
-echo "<h1>Test XML Schema</h1>";
-$ff = file('xmlschema.xml');
-echo "<pre>";
-foreach($ff as $xml) echo htmlspecialchars($xml);
-echo "</pre>";
-include_once('test-xmlschema.php');
-?>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/tests/test-datadict.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/test-datadict.php)

Deleted: plog/trunk/class/database/adodb/tests/test-perf.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/test-perf.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/test-perf.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,50 +0,0 @@
-<?php
-
-include_once('../adodb-perf.inc.php');
-
-error_reporting(E_ALL);
-session_start();
-
-if (isset($_GET)) {
-	foreach($_GET as $k => $v) {
-		if (strncmp($k,'test',4) == 0) $_SESSION['_db'] = $k;
-	}
-} 
-
-if (isset($_SESSION['_db'])) {
-	$_db = $_SESSION['_db'];
-	$_GET[$_db] = 1;
-	$$_db = 1;
-}
-
-echo "<h1>Performance Monitoring</h1>";
-include_once('testdatabases.inc.php');
-
-
-function testdb($db) 
-{
-	if (!$db) return;
-	echo "<font size=1>";print_r($db->ServerInfo()); echo " user=".$db->user."</font>";
-	
-	$perf = NewPerfMonitor($db); 
-	
-	# unit tests
-	if (0) {
-		//$DB->debug=1;
-		echo "Data Cache Size=".$perf->DBParameter('data cache size').'<p>';
-		echo $perf->HealthCheck();
-		echo($perf->SuspiciousSQL());
-		echo($perf->ExpensiveSQL());
-		echo($perf->InvalidSQL());
-		echo $perf->Tables();
-	
-		echo "<pre>";
-		echo $perf->HealthCheckCLI();
-		$perf->Poll(3);
-		die();
-	}
-	
-	if ($perf) $perf->UI(3);
-}
- 
-?>

Copied: plog/trunk/class/database/adodb/tests/test-perf.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/test-perf.php)

Deleted: plog/trunk/class/database/adodb/tests/test-pgblob.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/test-pgblob.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/test-pgblob.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,88 +0,0 @@
-<?php
-
-function getmicrotime()
-{
-	$t = microtime();
-	$t = explode(' ',$t);
-	return (float)$t[1]+ (float)$t[0];
-}
-
-function doloop()
-{
-global $db,$MAX;
-	
-	$sql = "select id,firstname,lastname from adoxyz where 
-		firstname not like ? and lastname not like ? and id=?";
-	$offset = 0;
-	/*$sql = "select * from juris9.employee join juris9.emp_perf_plan on epp_empkey = emp_id 
-		where emp_name not like ? and emp_name not like ? and emp_id=28000+?";
-	$offset = 28000;*/
-	for ($i=1; $i <= $MAX; $i++) {
-		$db->Param(false);
-		$x = (rand() % 10) + 1;
-		$db->debug= ($i==1);
-		$id = $db->GetOne($sql,
-			array('Z%','Z%',$x));
-		if($id != $offset+$x) {
-			print "<p>Error at $x";
-			break;
-		}
-	}
-}
-
-include_once('../adodb.inc.php');
-$db = NewADOConnection('postgres7');
-$db->PConnect('localhost','tester','test','test') || die("failed connection");
-
-$enc = "GIF89a%01%00%01%00%80%FF%00%C0%C0%C0%00%00%00%21%F9%04%01%00%00%00%00%2C%00%00%00%00%01%00%01%00%00%01%012%00%3Bt_clear.gif%0D";
-$val = rawurldecode($enc);
-
-$MAX = 1000;
-
-adodb_pr($db->ServerInfo());
-
-echo "<h4>Testing PREPARE/EXECUTE PLAN</h4>";
-
-
-$db->_bindInputArray = true; // requires postgresql 7.3+ and ability to modify database
-$t = getmicrotime();
-doloop();
-echo '<p>',$MAX,' times, with plan=',getmicrotime() - $t,'</p>';
-
-
-$db->_bindInputArray = false;
-$t = getmicrotime();
-doloop();
-echo '<p>',$MAX,' times, no plan=',getmicrotime() - $t,'</p>';
-
-
-
-echo "<h4>Testing UPDATEBLOB</h4>";
-$db->debug=1;
-
-### TEST BEGINS
-
-$db->Execute("insert into photos (id,name) values(9999,'dot.gif')");
-$db->UpdateBlob('photos','photo',$val,'id=9999');
-$v = $db->GetOne('select photo from photos where id=9999');
-
-
-### CLEANUP
-
-$db->Execute("delete from photos where id=9999");
-
-### VALIDATION
-
-if ($v !== $val) echo "<b>*** ERROR: Inserted value does not match downloaded val<b>";
-else echo "<b>*** OK: Passed</b>";
-
-echo "<pre>";
-echo "INSERTED: ", $enc;
-echo "<hr>";
-echo"RETURNED: ", rawurlencode($v);
-echo "<hr><p>";
-echo "INSERTED: ", $val;
-echo "<hr>";
-echo "RETURNED: ", $v;
-
-?>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/tests/test-pgblob.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/test-pgblob.php)

Deleted: plog/trunk/class/database/adodb/tests/test-php5.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/test-php5.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/test-php5.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,78 +0,0 @@
-<?php
-/*
-  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
-  Released under both BSD license and Lesser GPL library license. 
-  Whenever there is any discrepancy between the two licenses, 
-  the BSD license will take precedence.
-  Set tabs to 8.
- */
-
-
-error_reporting(E_ALL);
-
-$path = dirname(__FILE__);
-
-include("$path/../adodb-exceptions.inc.php");
-include("$path/../adodb.inc.php");	
-
-echo "<h3>PHP ".PHP_VERSION."</h3>\n";
-try {
-
-$dbt = 'mysql';
-
-try {
-switch($dbt) {
-case 'oci8po':
-	$db = NewADOConnection("oci8po");
-	
-	$db->Connect('','scott','natsoft');
-	break;
-default:
-case 'mysql':
-	$db = NewADOConnection("mysql");
-	$db->Connect('localhost','roots','','northwind');
-	break;
-	
-case 'mysqli':
-	$db = NewADOConnection("mysqli://root:@localhost/northwind");
-	//$db->Connect('localhost','root','','test');
-	break;
-}
-} catch (exception $e){
-	echo "Connect Failed";
-	adodb_pr($e);
-	die();
-}
-
-$db->debug=1;
-
-$cnt = $db->GetOne("select count(*) from adoxyz where ?<id and id<?",array(10,20));
-$stmt = $db->Prepare("select * from adoxyz where ?<id and id<?");
-if (!$stmt) echo $db->ErrorMsg(),"\n";
-$rs = $db->Execute($stmt,array(10,20));
-
-echo  "<hr> Foreach Iterator Test (rand=".rand().")<hr>";
-$i = 0;
-foreach($rs as $v) {
-	$i += 1;
-	echo "rec $i: "; $s1 = adodb_pr($v,true); $s2 = adodb_pr($rs->fields,true);
-	if ($s1 != $s2 && !empty($v)) {adodb_pr($s1); adodb_pr($s2);}
-	else echo "passed<br>";
-	flush();
-}
-
-
-if ($i != $cnt) die("actual cnt is $i, cnt should be $cnt\n");
-else echo "Count $i is correct<br>";
-
-$rs = $db->Execute("select bad from badder");
-
-} catch (exception $e) {
-	adodb_pr($e);
-	echo "<h3>adodb_backtrace:</h3>\n";
-	$e = adodb_backtrace($e->gettrace());
-}
-
-$rs = $db->Execute("select distinct id, firstname,lastname from adoxyz order by id");
-echo "Result=\n",$rs;
-?>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/tests/test-php5.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/test-php5.php)

Deleted: plog/trunk/class/database/adodb/tests/test-xmlschema.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/test-xmlschema.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/test-xmlschema.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,54 +0,0 @@
-<?PHP
-
-// V4.50 6 July 2004
-
-error_reporting(E_ALL);
-include_once( "../adodb.inc.php" );
-include_once( "../adodb-xmlschema.inc.php" );
-
-// To build the schema, start by creating a normal ADOdb connection:
-$db = ADONewConnection( 'mysql' );
-$db->Connect( 'localhost', 'root', '', 'schematest' );
-
-// To create a schema object and build the query array.
-$schema = new adoSchema( $db );
-
-// To upgrade an existing schema object, use the following 
-// To upgrade an existing database to the provided schema,
-// uncomment the following line:
-#$schema->upgradeSchema();
-
-print "<b>SQL to build xmlschema.xml</b>:\n<pre>";
-// Build the SQL array
-$sql = $schema->ParseSchema( "xmlschema.xml" );
-
-print_r( $sql );
-print "</pre>\n";
-
-// Execute the SQL on the database
-//$result = $schema->ExecuteSchema( $sql );
-
-// Finally, clean up after the XML parser
-// (PHP won't do this for you!)
-//$schema->Destroy();
-
-
-
-print "<b>SQL to build xmlschema-mssql.xml</b>:\n<pre>";
-
-$db2 = ADONewConnection('mssql');
-$db2->Connect('','adodb','natsoft','northwind') || die("Fail 2");
-
-$db2->Execute("drop table simple_table");
-
-$schema = new adoSchema( $db2 );
-$sql = $schema->ParseSchema( "xmlschema-mssql.xml" );
-
-print_r( $sql );
-print "</pre>\n";
-
-$db2->debug=1;
-
-foreach ($sql as $s)
-$db2->Execute($s);
-?>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/tests/test-xmlschema.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/test-xmlschema.php)

Deleted: plog/trunk/class/database/adodb/tests/test.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/test.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/test.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,1650 +0,0 @@
-<?php
-/* 
-V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
-  Released under both BSD license and Lesser GPL library license. 
-  Whenever there is any discrepancy between the two licenses, 
-  the BSD license will take precedence. 
-  Set tabs to 4 for best viewing.
-	
-  Latest version is available at http://adodb.sourceforge.net
-*/
-
-error_reporting(E_ALL);
-
-$ADODB_FLUSH = true;
-
-define('ADODB_ASSOC_CASE',0);
-
-if (PHP_VERSION < 5) include_once('../adodb-pear.inc.php');
-//--------------------------------------------------------------------------------------
-//define('ADODB_ASSOC_CASE',1);
-//
-function Err($msg)
-{
-	print "<b>$msg</b><br>";
-	flush();
-}
-
-function CheckWS($conn)
-{
-global $ADODB_EXTENSION;
-
-	include_once('../session/adodb-session.php');
-	if (defined('CHECKWSFAIL')){ echo " TESTING $conn ";flush();}
-	$saved = $ADODB_EXTENSION;
-	$db = ADONewConnection($conn);
-	$ADODB_EXTENSION = $saved;
-	if (headers_sent()) {
-		print "<p><b>White space detected in adodb-$conn.inc.php or include file...</b></p>";
-		//die();
-	}
-}
-
-function do_strtolower(&$arr)
-{
-	foreach($arr as $k => $v) {
-		if (is_object($v)) $arr[$k] = adodb_pr($v,true);
-		else $arr[$k] = strtolower($v);
-	}
-}
-
-
-function CountExecs($db, $sql, $inputarray)
-{
-global $EXECS;  $EXECS++;
-}
-
-function CountCachedExecs($db, $secs2cache, $sql, $inputarray)
-{
-global $CACHED; $CACHED++;
-}
-
-// the table creation code is specific to the database, so we allow the user 
-// to define their own table creation stuff
-
-function testdb(&$db,$createtab="create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)")
-{
-GLOBAL $ADODB_vers,$ADODB_CACHE_DIR,$ADODB_FETCH_MODE,$ADODB_COUNTRECS;
-
-?>	<form method=GET>
-	</p>
-	<table width=100% ><tr><td bgcolor=beige>&nbsp;</td></tr></table>
-	</p>
-<?php  
-	$create =false;
-	/*$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-	
-	$rs = $db->Execute('select lastname,firstname,lastname,id from adoxyz');
-	$arr = $rs->GetAssoc();
-	echo "<pre>";print_r($arr);
-	die();*/
-	
-	GLOBAL $EXECS, $CACHED;
-	
-	$EXECS = 0;
-	$CACHED = 0;
-	//$db->Execute("drop table adodb_logsql");
-	if ((rand()%3) == 0) @$db->Execute("delete from adodb_logsql");
-	$db->debug=1;
-	
-	$db->fnExecute = 'CountExecs';
-	$db->fnCacheExecute = 'CountCachedExecs';
-	
-	if (empty($_GET['nolog'])) {
-		echo "<h3>SQL Logging enabled</h3>";
-		$db->LogSQL();/*
-		$sql =
-"SELECT t1.sid, t1.sid, t1.title, t1.hometext, t1.notes, t1.aid, t1.informant, 
-t2.url, t2.email, t1.catid, t3.title, t1.topic, t4.topicname, t4.topicimage, 
-t4.topictext, t1.score, t1.ratings, t1.counter, t1.comments, t1.acomm 
-FROM `nuke_stories` `t1`, `nuke_authors` `t2`, `nuke_stories_cat` `t3`, `nuke_topics` `t4` 
-	WHERE ((t2.aid=t1.aid) AND (t3.catid=t1.catid) AND (t4.topicid=t1.topic) 
-	AND ((t1.alanguage='german') OR (t1.alanguage='')) AND (t1.ihome='0')) 
-	ORDER BY t1.time DESC";
-		$db->SelectLimit($sql);
-		echo $db->ErrorMsg();*/
-	}
-	$ADODB_CACHE_DIR = dirname(TempNam('/tmp','testadodb'));
-	$db->debug = false;
-	//print $db->UnixTimeStamp('2003-7-22 23:00:00');
-	
-	$phpv = phpversion();
-	if (defined('ADODB_EXTENSION')) $ext = ' &nbsp; Extension '.ADODB_EXTENSION.' installed';
-	else $ext = '';
-	print "<h3>ADODB Version: $ADODB_vers Host: <i>$db->host</i> &nbsp; Database: <i>$db->database</i> &nbsp; PHP: $phpv $ext</h3>";
-	flush();
-
-	
-	$arr = $db->ServerInfo();
-	print_r($arr);
-	echo "<br>";
-	$e = error_reporting(E_ALL-E_WARNING);
-	flush();
-	
-	$tt  = $db->Time(); 
-	if ($tt == 0) echo '<br><b>$db->Time failed</b>';
-	else echo "<br>db->Time: ".date('d-m-Y H:i:s',$tt);
-	echo '<br>';
-	
-	echo "Date=",$db->UserDate('2002-04-07'),'<br>';
-	print "<i>date1</i> (1969-02-20) = ".$db->DBDate('1969-2-20');
-	print "<br><i>date1</i> (1999-02-20) = ".$db->DBDate('1999-2-20');
-	print "<br><i>date1.1</i> 1999 = ".$db->DBDate("'1999'");
-	print "<br><i>date2</i> (1970-1-2) = ".$db->DBDate(24*3600)."<p>";
-	print "<i>ts1</i> (1999-02-20 13:40:50) = ".$db->DBTimeStamp('1999-2-20 1:40:50 pm');
-	print "<br><i>ts1.1</i> (1999-02-20 13:40:00) = ".$db->DBTimeStamp('1999-2-20 13:40');
-	print "<br><i>ts2</i> (1999-02-20) = ".$db->DBTimeStamp('1999-2-20');
-	print "<br><i>ts3</i> (1970-1-2 +/- timezone) = ".$db->DBTimeStamp(24*3600);
-	print "<br> Fractional TS (1999-2-20 13:40:50.91): ".$db->DBTimeStamp($db->UnixTimeStamp('1999-2-20 13:40:50.91+1'));
-	 $dd = $db->UnixDate('1999-02-20');
-	print "<br>unixdate</i> 1999-02-20 = ".date('Y-m-d',$dd)."<p>";
-	print "<br><i>ts4</i> =".($db->UnixTimeStamp("19700101000101")+8*3600);
-	print "<br><i>ts5</i> =".$db->DBTimeStamp($db->UnixTimeStamp("20040110092123"));
-	print "<br><i>ts6</i> =".$db->UserTimeStamp("20040110092123");
-	print "<br><i>ts7</i> =".$db->DBTimeStamp("20040110092123");
-	flush();
-	// mssql too slow in failing bad connection
-	if (false && $db->databaseType != 'mssql') {
-		print "<p>Testing bad connection. Ignore following error msgs:<br>";
-		$db2 = ADONewConnection();
-		$rez = $db2->Connect("bad connection");
-		$err = $db2->ErrorMsg();
-		print "<i>Error='$err'</i></p>";
-		if ($rez) print "<b>Cannot check if connection failed.</b> The Connect() function returned true.</p>";
-	}
-	error_reporting($e);
-	flush();
-
-	//$ADODB_COUNTRECS=false;
-	$rs=$db->Execute('select * from adoxyz order by id');
-	if($rs === false) $create = true;
-	else $rs->Close();
-	
-	//if ($db->databaseType !='vfp') $db->Execute("drop table ADOXYZ");
-	
-	if ($create) {
-		if (false && $db->databaseType == 'ibase') {
-			print "<b>Please create the following table for testing:</b></p>$createtab</p>";
-			return;
-		} else {
-			$db->debug = 1;
-			$e = error_reporting(E_ALL-E_WARNING);
-			$db->Execute($createtab);
-			error_reporting($e);
-		}
-	}
-	$rs = &$db->Execute("delete from ADOXYZ"); // some ODBC drivers will fail the drop so we delete
-	if ($rs) {
-		if(! $rs->EOF) print "<b>Error: </b>RecordSet returned by Execute('delete...') should show EOF</p>";
-		$rs->Close();
-	} else print "err=".$db->ErrorMsg();
-
-	print "<p>Test select on empty table, FetchField when EOF, and GetInsertSQL</p>";
-	$rs = &$db->Execute("select id,firstname from ADOXYZ where id=9999");
-	if ($rs && !$rs->EOF) print "<b>Error: </b>RecordSet returned by Execute(select...') on empty table should show EOF</p>";
-	if ($rs->EOF && (($ox = $rs->FetchField(0)) && !empty($ox->name))) {
-		$record['id'] = 99;
-		$record['firstname'] = 'John';
-		$sql =  $db->GetInsertSQL($rs, $record);
-		if (strtoupper($sql) != strtoupper("INSERT INTO ADOXYZ ( id, firstname ) VALUES ( 99, 'John' )")) Err("GetInsertSQL does not work on empty table: $sql");
-	} else {
-		Err("FetchField does not work on empty recordset, meaning GetInsertSQL will fail...");
-	}
-	if ($rs) $rs->Close();
-	flush();
-	//$db->debug=true;	
-	print "<p>Testing Commit: ";
-	$time = $db->DBDate(time());
-	if (!$db->BeginTrans()) {
-		print '<b>Transactions not supported</b></p>';
-		if ($db->hasTransactions) Err("hasTransactions should be false");
-	} else { /* COMMIT */
-		if (!$db->hasTransactions) Err("hasTransactions should be true");
-		if ($db->transCnt != 1) Err("Invalid transCnt = $db->transCnt (should be 1)");
-		$rs = $db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values (99,'Should Not','Exist (Commit)',$time)");
-		if ($rs && $db->CommitTrans()) {
-			$rs->Close();
-			$rs = &$db->Execute("select * from ADOXYZ where id=99");
-			if ($rs === false || $rs->EOF) {
-				print '<b>Data not saved</b></p>';
-				$rs = &$db->Execute("select * from ADOXYZ where id=99");
-				print_r($rs);
-				die();
-			} else print 'OK</p>';
-			if ($rs) $rs->Close();
-		} else {
-			if (!$rs) {
-				print "<b>Insert failed</b></p>";
-				$db->RollbackTrans();
-			} else print "<b>Commit failed</b></p>";
-		}
-		if ($db->transCnt != 0) Err("Invalid transCnt = $db->transCnt (should be 0)");
-		
-		/* ROLLBACK */	
-		if (!$db->BeginTrans()) print "<p><b>Error in BeginTrans</b>()</p>";
-		print "<p>Testing Rollback: ";
-		$db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values (100,'Should Not','Exist (Rollback)',$time)");
-		if ($db->RollbackTrans()) {
-			$rs = $db->Execute("select * from ADOXYZ where id=100");
-			if ($rs && !$rs->EOF) print '<b>Fail: Data should rollback</b></p>';
-			else print 'OK</p>';
-			if ($rs) $rs->Close();
-		} else
-			print "<b>Commit failed</b></p>";
-			
-		$rs = &$db->Execute('delete from ADOXYZ where id>50');
-		if ($rs) $rs->Close();
-		
-		if ($db->transCnt != 0) Err("Invalid transCnt = $db->transCnt (should be 0)");
-	}
-	
-	if (1) {
-		print "<p>Testing MetaDatabases()</p>";
-		print_r( $db->MetaDatabases());
-
-		print "<p>Testing MetaTables() and MetaColumns()</p>";
-		$a = $db->MetaTables();
-		if ($a===false) print "<b>MetaTables not supported</b></p>";
-		else {
-			print "Array of tables and views: "; 
-			foreach($a as $v) print " ($v) ";
-			print '</p>';
-		}
-		
-		$a = $db->MetaTables('VIEW');
-		if ($a===false) print "<b>MetaTables not supported (views)</b></p>";
-		else {
-			print "Array of views: "; 
-			foreach($a as $v) print " ($v) ";
-			print '</p>';
-		}
-		
-		$a = $db->MetaTables(false,false,'aDo%');
-		if ($a===false) print "<b>MetaTables not supported (mask)</b></p>";
-		else {
-			print "Array of ado%: "; 
-			foreach($a as $v) print " ($v) ";
-			print '</p>';
-		}
-		
-		$a = $db->MetaTables('TABLE');
-		if ($a===false) print "<b>MetaTables not supported</b></p>";
-		else {
-			print "Array of tables: "; 
-			foreach($a as $v) print " ($v) ";
-			print '</p>';
-		}
-		
-		$db->debug=0;
-		$rez = $db->MetaColumns("NOSUCHTABLEHERE");
-		if ($rez !== false) {
-			Err("MetaColumns error handling failed");
-			var_dump($rez);
-		}
-		$db->debug=1;
-		$a = $db->MetaColumns('ADOXYZ');
-		if ($a===false) print "<b>MetaColumns not supported</b></p>";
-		else {
-			print "<p>Columns of ADOXYZ: <font size=1><br>";
-			foreach($a as $v) {print_r($v); echo "<br>";}
-			echo "</font>";
-		}
-		
-		print "<p>Testing MetaIndexes</p>";
-		
-		$a = $db->MetaIndexes(('ADOXYZ'),true);
-		if ($a===false) print "<b>MetaIndexes not supported</b></p>";
-		else {
-			print "<p>Indexes of ADOXYZ: <font size=1><br>";
-			adodb_pr($a);
-			echo "</font>";
-		}
-		print "<p>Testing MetaPrimaryKeys</p>";
-		$a = $db->MetaPrimaryKeys('ADOXYZ');
-		var_dump($a);
-	}
-	$rs = &$db->Execute('delete from ADOXYZ');
-	if ($rs) $rs->Close();
-	
-	$db->debug = false;
-	
-	
-	switch ($db->databaseType) {
-	case 'vfp':
-		
-		if (0) {
-			// memo test
-			$rs = $db->Execute("select data from memo");
-			rs2html($rs);
-		}
-		break;
-
-	case 'postgres7':
-	case 'postgres64':
-	case 'postgres':
-	case 'ibase':
-		print "<p>Encode=".$db->BlobEncode("abc\0d\"'
-ef")."</p>";//'
-
-		print "<p>Testing Foreign Keys</p>";
-		$arr = $db->MetaForeignKeys('adoxyz',false,true);
-		print_r($arr);
-		if (!$arr) Err("Bad MetaForeignKeys");
-		break;
-	
-	case 'odbc_mssql':
-	case 'mssqlpo':
-		print "<p>Testing Foreign Keys</p>";
-		$arr = $db->MetaForeignKeys('Orders',false,true);
-		print_r($arr);
-		if (!$arr) Err("Bad MetaForeignKeys");
-		if ($db->databaseType == 'odbc_mssql') break;
-	
-	case 'mssql': 
-	
-		
-/*
-ASSUME Northwind available...
-
-CREATE PROCEDURE SalesByCategory
-	@CategoryName nvarchar(15), @OrdYear nvarchar(4) = '1998'
-AS
-IF @OrdYear != '1996' AND @OrdYear != '1997' AND @OrdYear != '1998' 
-BEGIN
-	SELECT @OrdYear = '1998'
-END
-
-SELECT ProductName,
-	TotalPurchase=ROUND(SUM(CONVERT(decimal(14,2), OD.Quantity * (1-OD.Discount) * OD.UnitPrice)), 0)
-FROM [Order Details] OD, Orders O, Products P, Categories C
-WHERE OD.OrderID = O.OrderID 
-	AND OD.ProductID = P.ProductID 
-	AND P.CategoryID = C.CategoryID
-	AND C.CategoryName = @CategoryName
-	AND SUBSTRING(CONVERT(nvarchar(22), O.OrderDate, 111), 1, 4) = @OrdYear
-GROUP BY ProductName
-ORDER BY ProductName
-GO
-
-
-CREATE PROCEDURE ADODBTestSP
- at a nvarchar(25)
-AS
-SELECT GETDATE() AS T, @a AS A
-GO
-*/
-		print "<h4>Testing Stored Procedures for mssql</h4>";
-		$saved = $db->debug;
-		$db->debug=true;
-		
-		$cmd = $db->PrepareSP('ADODBTestSP');
-		$ss = "You should see me in the output.";
-		$db->InParameter($cmd,$ss,'a');
-		$rs = $db->Execute($cmd);
-		echo $rs->fields['T']." --- ".$rs->fields['A']."---<br>";
-
-		$cat = 'Dairy Products';
-		$yr = '1998';
-		
-		$stmt = $db->PrepareSP('SalesByCategory');
-		$db->InParameter($stmt,$cat,'CategoryName');
-		$db->InParameter($stmt,$yr,'OrdYear');
-		$rs = $db->Execute($stmt);
-		rs2html($rs);
-		
-		$cat = 'Grains/Cereals';
-		$yr = 1998;
-		
-		$stmt = $db->PrepareSP('SalesByCategory');
-		$db->InParameter($stmt,$cat,'CategoryName');
-		$db->InParameter($stmt,$yr,'OrdYear');
-		$rs = $db->Execute($stmt);
-		rs2html($rs);
-		
-		/*
-		Test out params - works in PHP 4.2.3 and 4.3.3 and 4.3.8 but not 4.3.0:
-		
-			CREATE PROCEDURE at_date_interval 
-				@days INTEGER, 
-				@start VARCHAR(20) OUT, 
-				@end VARCHAR(20) OUT 	
-			AS 
-			BEGIN 
-				set @start = CONVERT(VARCHAR(20), getdate(), 101) 
-				set @end =CONVERT(VARCHAR(20), dateadd(day, @days, getdate()), 101 ) 
-			END
-			GO
-		*/
-		$db->debug=1;
-		$stmt = $db->PrepareSP('at_date_interval');
-		$days = 10;
-		$begin_date = '';
-		$end_date = '';
-		$db->InParameter($stmt,$days,'days', 4, SQLINT4); 
-		$db->OutParameter($stmt,$begin_date,'start', 20, SQLVARCHAR ); 
-		$db->OutParameter($stmt,$end_date,'end', 20, SQLVARCHAR ); 
-		$db->Execute($stmt);
-		if (empty($begin_date) or empty($end_date) or $begin_date == $end_date) {
-			Err("MSSQL SP Test for OUT Failed");
-			print "begin=$begin_date end=$end_date<p>";
-		} else print "(Today +10days) = (begin=$begin_date end=$end_date)<p>";
-	
-		$db->debug = $saved;
-		break;
-	case 'oci8': 
-	case 'oci8po':
-		
-		# cleanup
-		$db->Execute("delete from photos where id=99 or id=1");
-		$db->Execute("insert into photos (id) values(1)");
-		$db->Execute("update photos set photo=null,descclob=null where id=1");
-		
-		$saved = $db->debug;
-		$db->debug=true;
-		
-		
-
-		/*
-		CREATE TABLE PHOTOS
-		(
-		  ID           NUMBER(16),
-		  PHOTO        BLOB,
-		  DESCRIPTION  VARCHAR2(4000 BYTE),
-		  DESCCLOB     CLOB
-		);
-		
-		INSERT INTO PHOTOS (ID) VALUES(1);
-		*/
-		$s = '';
-		for ($i = 0; $i <= 500; $i++) {
-			$s .= '1234567890';
-		}
-		
-		$sql = "INSERT INTO photos ( ID, photo) ".
-			"VALUES ( :id, empty_blob() )".
-			" RETURNING photo INTO :xx";
-
-		
-		$blob_data = $s;
-		$id = 99;
-		
- 		$stmt = $db->PrepareSP($sql);
-		$db->InParameter($stmt, $id, 'id');
-		$blob = $db->InParameter($stmt, $s, 'xx',-1, OCI_B_BLOB);
-		$db->StartTrans();
-		$result = $db->Execute($stmt);
-		$db->CompleteTrans();
-		
-		$s2= $db->GetOne("select photo from photos where id=99");
-		echo "<br>---$s2";
-		if ($s !== $s2) Err("insert blob does not match");
-
-		print "<h4>Testing Blob: size=".strlen($s)."</h4>";
-		$ok = $db->Updateblob('photos','photo',$s,'id=1');
-		if (!$ok) Err("Blob failed 1");
-		else {
-			$s2= $db->GetOne("select photo from photos where id=1");
-			if ($s !== $s2) Err("updateblob does not match");
-		}
-		
-		print "<h4>Testing Clob: size=".strlen($s)."</h4>";
-		$ok = $db->UpdateClob('photos','descclob',$s,'id=1');
-		if (!$ok) Err("Clob failed 1");
-		else {
-			$s2= $db->GetOne("select descclob from photos where id=1");
-			if ($s !== $s2) Err("updateclob does not match");
-		}
-		
-		
-		$s = '';
-		$s2 = '';
-		print "<h4>Testing Foreign Keys</h4>";
-		$arr = $db->MetaForeignKeys('emp');
-		print_r($arr);
-		if (!$arr) Err("Bad MetaForeignKeys");
-/*
--- TEST PACKAGE
--- "Set scan off" turns off substitution variables. 
-Set scan off; 
-
-CREATE OR REPLACE PACKAGE Adodb AS
-TYPE TabType IS REF CURSOR RETURN TAB%ROWTYPE;
-PROCEDURE open_tab (tabcursor IN OUT TabType,tablenames IN VARCHAR);
-PROCEDURE open_tab2 (tabcursor IN OUT TabType,tablenames IN OUT VARCHAR) ;
-PROCEDURE data_out(input IN VARCHAR, output OUT VARCHAR);
-PROCEDURE data_in(input IN VARCHAR);
-PROCEDURE myproc (p1 IN NUMBER, p2 OUT NUMBER);
-END Adodb;
-/
-
-
-CREATE OR REPLACE PACKAGE BODY Adodb AS
-PROCEDURE open_tab (tabcursor IN OUT TabType,tablenames IN VARCHAR) IS
-	BEGIN
-		OPEN tabcursor FOR SELECT * FROM TAB WHERE tname LIKE tablenames;
-	END open_tab;
-
-	PROCEDURE open_tab2 (tabcursor IN OUT TabType,tablenames IN OUT VARCHAR) IS
-	BEGIN
-		OPEN tabcursor FOR SELECT * FROM TAB WHERE tname LIKE tablenames;
-		tablenames := 'TEST';
-	END open_tab2;
-
-PROCEDURE data_out(input IN VARCHAR, output OUT VARCHAR) IS
-	BEGIN
-		output := 'Cinta Hati '||input;
-	END;
-	
-PROCEDURE data_in(input IN VARCHAR) IS
-	ignore varchar(1000);
-	BEGIN
-		ignore := input;
-	END;
-
-PROCEDURE myproc (p1 IN NUMBER, p2 OUT NUMBER) AS
-BEGIN
-p2 := p1;
-END;
-END Adodb;
-/
-
-*/
-
-		print "<h4>Testing Cursor Variables</h4>";
-		$rs = $db->ExecuteCursor("BEGIN adodb.open_tab(:zz,'A%'); END;",'zz');
-	
-		if ($rs && !$rs->EOF) {
-			$v = $db->GetOne("SELECT count(*) FROM tab where tname like 'A%'");
-			if ($v == $rs->RecordCount()) print "Test 1 RowCount: OK<p>";
-			else Err("Test 1 RowCount ".$rs->RecordCount().", actual = $v");
-		} else {
-			print "<b>Error in using Cursor Variables 1</b><p>";
-		}
-		$rs->Close();
-		
-		print "<h4>Testing Stored Procedures for oci8</h4>";
-		
-		$stmt = $db->PrepareSP("BEGIN adodb.data_out(:a1, :a2); END;");
-		$a1 = 'Malaysia';
-		//$a2 = ''; # a2 doesn't even need to be defined!
-		$db->InParameter($stmt,$a1,'a1');
-		$db->OutParameter($stmt,$a2,'a2');
-		$rs = $db->Execute($stmt);
-		if ($rs) {
-			if ($a2 !== 'Cinta Hati Malaysia') print "<b>Stored Procedure Error: a2 = $a2</b><p>";
-			else echo  "OK: a2=$a2<p>";
-		} else {
-			print "<b>Error in using Stored Procedure IN/Out Variables</b><p>";
-		}
-		
-		$tname = 'A%';
-		
-		$stmt = $db->PrepareSP('select * from tab where tname like :tablename');
-		$db->Parameter($stmt,$tname,'tablename');
-		$rs = $db->Execute($stmt);
-		rs2html($rs);
-		
-		$stmt = $db->PrepareSP("begin adodb.data_in(:a1); end;");
-		$db->InParameter($stmt,$a1,'a1');
-		$db->Execute($stmt);
-		
-		$db->debug = $saved;
-		break;
-	
-	default:
-		break;
-	}
-	$arr = array(
-		array(1,'Caroline','Miranda'),
-		array(2,'John','Lim'),
-		array(3,'Wai Hun','See')
-	);
-	$db->debug=1;
-	print "<p>Testing Bulk Insert of 3 rows</p>";
-
-	$sql = "insert into ADOXYZ (id,firstname,lastname) values (".$db->Param('0').",".$db->Param('1').",".$db->Param('2').")";
-	$db->StartTrans();
-	$db->Execute($sql,$arr);
-	$db->CompleteTrans();
-	$rs = $db->Execute('select * from ADOXYZ order by id');
-	if ($rs->RecordCount() != 3) Err("Bad bulk insert");
-	
-	rs2html($rs);
-	
-	$db->Execute('delete from ADOXYZ');
-		
-	print "<p>Inserting 50 rows</p>";
-
-	for ($i = 0; $i < 5; $i++) {	
-
-	$time = $db->DBDate(time());
-	if (empty($_GET['hide'])) $db->debug = true;
-	switch($db->databaseType){
-	case 'mssqlpo':
-	case 'mssql':
-		$sqlt = "CREATE TABLE mytable (
-  row1 INT  IDENTITY(1,1) NOT NULL,
-  row2 varchar(16),
-  PRIMARY KEY  (row1))";
-  		//$db->debug=1;
-  		if (!$db->Execute("delete from mytable")) 
-			$db->Execute($sqlt);
-			
-		$ok = $db->Execute("insert into mytable (row2) values ('test')");
-		$ins_id=$db->Insert_ID();
-		echo "Insert ID=";var_dump($ins_id);
-		if ($ins_id == 0) Err("Bad Insert_ID()");
-		$ins_id2 = $db->GetOne("select row1 from mytable");
-		if ($ins_id != $ins_id2) Err("Bad Insert_ID() 2");
-		
-		$arr = array(0=>'Caroline',1=>'Miranda');
-		$sql = "insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+0,?,?,$time)";
-		break;
-	case 'mysqli':
-	case 'mysqlt':
-	case 'mysql':
-		$sqlt = "CREATE TABLE `mytable` (
-  `row1` int(11) NOT NULL auto_increment,
-  `row2` varchar(16) NOT NULL default '',
-  PRIMARY KEY  (`row1`),
-  KEY `myindex` (`row1`,`row2`)
-) ";
-		if (!$db->Execute("delete from mytable")) 
-			$db->Execute($sqlt);
-			
-		$ok = $db->Execute("insert into mytable (row2) values ('test')");
-		$ins_id=$db->Insert_ID();
-		echo "Insert ID=";var_dump($ins_id);
-		if ($ins_id == 0) Err("Bad Insert_ID()");
-		$ins_id2 = $db->GetOne("select row1 from mytable");
-		if ($ins_id != $ins_id2) Err("Bad Insert_ID() 2");
-		
-	default:
-		$arr = array(0=>'Caroline',1=>'Miranda');
-		$sql = "insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+0,?,?,$time)";
-		break;
-	
-	case 'oci8':
-	case 'oci805':
-		$arr = array('first'=>'Caroline','last'=>'Miranda');
-		$amt = rand() % 100;
-		$sql = "insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+0,:first,:last,$time)";		
-		break;
-	}
-	if ($i & 1) {
-		$sql = $db->Prepare($sql);
-	}
-	$rs = $db->Execute($sql,$arr);
-		
-	if ($rs === false) Err( 'Error inserting with parameters');
-	else $rs->Close();
-	$db->debug = false;
-	$db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+1,'John','Lim',$time)");
-	/*$ins_id=$db->Insert_ID();
-	echo "Insert ID=";var_dump($ins_id);*/
-	if ($db->databaseType == 'mysql') if ($ins_id == 0) Err('Bad Insert_ID');
-	$db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+2,'Mary','Lamb',$time )");
-	$db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+3,'George','Washington',$time )");
-	$db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+4,'Mr. Alan','Tam',$time )");
-	$db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+5,'Alan',".$db->quote("Turing'ton").",$time )");
-	$db->Execute("insert into ADOXYZ (id,firstname,lastname,created)values ($i*10+6,'Serena','Williams',$time )");
-	$db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+7,'Yat Sun','Sun',$time )");
-	$db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+8,'Wai Hun','See',$time )");
-	$db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+9,'Steven','Oey',$time )");
-	} // for
-	if (1) {
-	$db->debug=1;
-	$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
-	$cnt = $db->GetOne("select count(*) from ADOXYZ");
-	$rs = $db->Execute('update ADOXYZ set id=id+1');	
-	if (!is_object($rs)) {
-		print_r($rs);
-		err("Update should return object");
-	} 
-	if (!$rs) err("Update generated error");
-	
-	$nrows = $db->Affected_Rows();   
-	if ($nrows === false) print "<p><b>Affected_Rows() not supported</b></p>";
-	else if ($nrows != $cnt)  print "<p><b>Affected_Rows() Error: $nrows returned (should be 50) </b></p>";
-	else print "<p>Affected_Rows() passed</p>";
-	}
-	
-	/*if ($db->dataProvider == 'oci8') */ $array = array('zid'=>1,'zdate'=>date('Y-m-d',time()));
-	/*else $array=array(1,date('Y-m-d',time()));*/
-	
-	$id = $db->GetOne("select id from ADOXYZ 
-		where id=".$db->Param('zid')." and created>=".$db->Param('ZDATE')."",
-		$array);
-	if ($id != 1) Err("Bad bind; id=$id");
-	else echo "<br>Bind date/integer passed";
-	
-	$db->debug = false;
-	$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
- //////////////////////////////////////////////////////////////////////////////////////////
-	
-	$rs = $db->Execute("select * from ADOXYZ where firstname = 'not known'");
-	if (!$rs ||  !$rs->EOF) print "<p><b>Error on empty recordset</b></p>";
-	else if ($rs->RecordCount() != 0) {
-		print "<p><b>Error on RecordCount. Should be 0. Was ".$rs->RecordCount()."</b></p>"; 
-		print_r($rs->fields);
-	}
-	if ($db->databaseType !== 'odbc') {
-		$rs = &$db->Execute("select id,firstname,lastname,created,".$db->random." from ADOXYZ order by id");
-		if ($rs) {
-			if ($rs->RecordCount() != 50) {
-				print "<p><b>RecordCount returns ".$rs->RecordCount()."</b></p>";
-				$poc = $rs->PO_RecordCount('ADOXYZ');
-				if ($poc == 50) print "<p> &nbsp; &nbsp; PO_RecordCount passed</p>";
-				else print "<p><b>PO_RecordCount returns wrong value: $poc</b></p>";
-			} else print "<p>RecordCount() passed</p>";
-			if (isset($rs->fields['firstname'])) print '<p>The fields columns can be indexed by column name.</p>';
-			else {
-				Err( '<p>The fields columns <i>cannot</i> be indexed by column name.</p>');
-				print_r($rs->fields);
-			}
-			if (empty($_GET['hide'])) rs2html($rs);
-		}
-		else print "<p><b>Error in Execute of SELECT with random</b></p>";
-	}
-	$val = $db->GetOne("select count(*) from ADOXYZ");
-	 if ($val == 50) print "<p>GetOne returns ok</p>";
-	 else print "<p><b>Fail: GetOne returns $val</b></p>";
-
-	$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-	$val = $db->GetRow("select count(*) from ADOXYZ");
-	 if ($val[0] == 50 and sizeof($val) == 1) print "<p>GetRow returns ok</p>";
-	 else {
-	 	print_r($val);
-	 	print "<p><b>Fail: GetRow returns {$val[0]}</b></p>";
-	}
-
-	print "<p>FetchObject/FetchNextObject Test</p>";
-	$rs = $db->Execute('select * from ADOXYZ');
-	if ($rs) {
-		if (empty($rs->connection)) print "<b>Connection object missing from recordset</b></br>";
-		
-		while ($o = $rs->FetchNextObject()) { // calls FetchObject internally
-			if (!is_string($o->FIRSTNAME) || !is_string($o->LASTNAME)) {
-				print_r($o);
-				print "<p><b>Firstname is not string</b></p>";
-				break;
-			}
-		}
-	} else {
-		print "<p><b>Failed rs</b></p>";
-		die("<p>ADOXYZ table cannot be read - die()");
-	}
-	$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
-	print "<p>FetchObject/FetchNextObject Test 2</p>";
-	$db->debug=99;
-	$rs = $db->Execute('select * from ADOXYZ');
-	if (empty($rs->connection)) print "<b>Connection object missing from recordset</b></br>";
-	print_r($rs->fields);
-	while ($o = $rs->FetchNextObject()) { // calls FetchObject internally
-		if (!is_string($o->FIRSTNAME) || !is_string($o->LASTNAME)) {
-			print_r($o);
-			print "<p><b>Firstname is not string</b></p>";
-			break;
-		}
-	}
-	$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-	
-	$savefetch = $ADODB_FETCH_MODE;
-	$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
-	
-	print "<p>CacheSelectLimit  Test</p>";
-	$db->debug=1;
-	$rs = $db->CacheSelectLimit('  select  id, firstname from  ADOXYZ order by id',2);
-	
-	if ($rs && !$rs->EOF) {
-		if (isset($rs->fields[0])) {
-			Err("ASSOC has numeric fields");
-			print_r($rs->fields);
-		}
-		if ($rs->fields['id'] != 1)  {Err("Error"); print_r($rs->fields);};
-		if (trim($rs->fields['firstname']) != 'Caroline')  {print Err("Error 2"); print_r($rs->fields);};
-		
-		$rs->MoveNext();
-		if ($rs->fields['id'] != 2)  {Err("Error 3"); print_r($rs->fields);};
-		$rs->MoveNext();
-		if (!$rs->EOF) {
-			Err("Error EOF");
-			print_r($rs);
-		}
-	}
-	
-	print "<p>FETCH_MODE = ASSOC: Should get 1, Caroline</p>";
-	$rs = &$db->SelectLimit('select id,firstname from ADOXYZ order by id',2);
-	if ($rs && !$rs->EOF) {
-		if (ADODB_ASSOC_CASE == 2) {
-			$id = 'ID';
-			$fname = 'FIRSTNAME';
-		}else {
-			$id = 'id';
-			$fname = 'firstname';
-		}
-		if ($rs->fields[$id] != 1)  {Err("Error 1"); print_r($rs->fields);};
-		if (trim($rs->fields[$fname]) != 'Caroline')  {Err("Error 2"); print_r($rs->fields);};
-		$rs->MoveNext();
-		if ($rs->fields[$id] != 2)  {Err("Error 3"); print_r($rs->fields);};
-		$rs->MoveNext();
-		if (!$rs->EOF) Err("Error EOF");
-		else if (is_array($rs->fields) || $rs->fields) {
-			Err("Error: ## fields should be set to false on EOF");
-			print_r($rs->fields);
-		}
-	}
-	
-	$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-	print "<p>FETCH_MODE = NUM: Should get 1, Caroline</p>";
-	$rs = &$db->SelectLimit('select id,firstname from ADOXYZ order by id',1);
-	if ($rs && !$rs->EOF) {
-		if (isset($rs->fields['id'])) Err("FETCH_NUM has ASSOC fields");
-		if ($rs->fields[0] != 1)  {Err("Error 1"); print_r($rs->fields);};
-		if (trim($rs->fields[1]) != 'Caroline')  {Err("Error 2");print_r($rs->fields);};
-		$rs->MoveNext();
-		if (!$rs->EOF) Err("Error EOF");
-
-	}
-	$ADODB_FETCH_MODE = $savefetch;
-	
-	$db->debug = false;
-	print "<p>GetRowAssoc Upper: Should get 1, Caroline</p>";
-	$rs = &$db->SelectLimit('select id,firstname from ADOXYZ order by id',1);
-	if ($rs && !$rs->EOF) {
-		$arr = &$rs->GetRowAssoc();
-		if ($arr['ID'] != 1) {Err("Error 1");print_r($arr);};
-		if (trim($arr['FIRSTNAME']) != 'Caroline') {Err("Error 2"); print_r($arr);};
-		$rs->MoveNext();
-		if (!$rs->EOF) Err("Error EOF");
-
-	}
-	print "<p>GetRowAssoc Lower: Should get 1, Caroline</p>";
-	$rs = &$db->SelectLimit('select id,firstname from ADOXYZ order by id',1);
-	if ($rs && !$rs->EOF) {
-		$arr = &$rs->GetRowAssoc(false);
-		if ($arr['id'] != 1) {Err("Error 1"); print_r($arr);};
-		if (trim($arr['firstname']) != 'Caroline') {Err("Error 2"); print_r($arr);};
-
-	}
-	
-	print "<p>GetCol Test</p>";
-	$col = $db->GetCol('select distinct firstname from adoxyz order by 1');
-	if (!is_array($col)) Err("Col size is wrong");
-	if (trim($col[0]) != 'Alan' or trim($col[9]) != 'Yat Sun') Err("Col elements wrong");
-
-	$db->debug = true;
-	
-		
-	echo "<p>Date Update Test</p>";
-	$zdate = date('Y-m-d',time()+3600*24);
-	$zdate = $db->DBDate($zdate);
-	$db->Execute("update ADOXYZ set created=$zdate where id=1");
-	$row = $db->GetRow("select created,firstname from ADOXYZ where id=1");
-	print_r($row); echo "<br>";
-	
-	
-	
-	print "<p>SelectLimit Distinct Test 1: Should see Caroline, John and Mary</p>";
-	$rs = &$db->SelectLimit('select distinct * from ADOXYZ order by id',3);
-	
-	
-	if ($rs && !$rs->EOF) {
-		if (trim($rs->fields[1]) != 'Caroline') Err("Error 1 (exp Caroline), ".$rs->fields[1]);
-		$rs->MoveNext();
-		
-		if (trim($rs->fields[1]) != 'John') Err("Error 2 (exp John), ".$rs->fields[1]);
-		$rs->MoveNext();
-		if (trim($rs->fields[1]) != 'Mary') Err("Error 3 (exp Mary),".$rs->fields[1]);
-		$rs->MoveNext();
-		if (! $rs->EOF) Err("Error EOF");
-		//rs2html($rs);
-	} else Err("Failed SelectLimit Test 1");
-	
-	print "<p>SelectLimit Test 2: Should see Mary, George and Mr. Alan</p>";
-	$rs = &$db->SelectLimit('select * from ADOXYZ order by id',3,2);
-	if ($rs && !$rs->EOF) {
-		if (trim($rs->fields[1]) != 'Mary') Err("Error 1 - No Mary, instead: ".$rs->fields[1]);
-		$rs->MoveNext();
-		if (trim($rs->fields[1]) != 'George')Err("Error 2 - No George, instead: ".$rs->fields[1]);
-		$rs->MoveNext();
-		if (trim($rs->fields[1]) != 'Mr. Alan') Err("Error 3 - No Mr. Alan, instead: ".$rs->fields[1]);
-		$rs->MoveNext();
-		if (! $rs->EOF) Err("Error EOF");
-	//	rs2html($rs);
-	}
-	 else Err("Failed SelectLimit Test 2 ". ($rs ? 'EOF':'no RS'));
-	
-	print "<p>SelectLimit Test 3: Should see Wai Hun and Steven</p>";
-	$db->debug=1;
-	global $A; $A=1;
-	$rs = &$db->SelectLimit('select * from ADOXYZ order by id',-1,48);
-	$A=0;
-	if ($rs && !$rs->EOF) {
-		if (empty($rs->connection)) print "<b>Connection object missing from recordset</b></br>";
-		if (trim($rs->fields[1]) != 'Wai Hun') Err("Error 1 ".$rs->fields[1]);
-		$rs->MoveNext();
-		if (trim($rs->fields[1]) != 'Steven') Err("Error 2 ".$rs->fields[1]);
-		$rs->MoveNext();
-		if (! $rs->EOF) {
-			Err("Error EOF");
-		}
-		//rs2html($rs);
-	}
-	 else Err("Failed SelectLimit Test 3");
-		$db->debug = false;
-	
-	
-	$rs = &$db->Execute("select * from ADOXYZ order by id");
-	print "<p>Testing Move()</p>";	
-	if (!$rs)Err( "Failed Move SELECT");
-	else {
-		if (!$rs->Move(2)) {
-			if (!$rs->canSeek) print "<p>$db->databaseType: <b>Move(), MoveFirst() nor MoveLast() not supported.</b></p>";
-			else print '<p><b>RecordSet->canSeek property should be set to false</b></p>';
-		} else {
-			$rs->MoveFirst();
-			if (trim($rs->Fields("firstname")) != 'Caroline') {
-				print "<p><b>$db->databaseType: MoveFirst failed -- probably cannot scroll backwards</b></p>";
-			}
-			else print "MoveFirst() OK<BR>";
-						
-						// Move(3) tests error handling -- MoveFirst should not move cursor
-			$rs->Move(3);
-			if (trim($rs->Fields("firstname")) != 'George') {
-				print '<p>'.$rs->Fields("id")."<b>$db->databaseType: Move(3) failed</b></p>";
-			} else print "Move(3) OK<BR>";
-						
-			$rs->Move(7);
-			if (trim($rs->Fields("firstname")) != 'Yat Sun') {
-				print '<p>'.$rs->Fields("id")."<b>$db->databaseType: Move(7) failed</b></p>";
-				print_r($rs);
-			} else print "Move(7) OK<BR>";
-			if ($rs->EOF) Err("Move(7) is EOF already");
-			$rs->MoveLast();
-			if (trim($rs->Fields("firstname")) != 'Steven'){
-				 print '<p>'.$rs->Fields("id")."<b>$db->databaseType: MoveLast() failed</b></p>";
-				 print_r($rs);
-			}else print "MoveLast() OK<BR>";
-			$rs->MoveNext();
-			if (!$rs->EOF) err("Bad MoveNext");
-			if ($rs->canSeek) {
-				$rs->Move(3);
-				if (trim($rs->Fields("firstname")) != 'George') {
-					print '<p>'.$rs->Fields("id")."<b>$db->databaseType: Move(3) after MoveLast failed</b></p>";
-					
-				} else print "Move(3) after MoveLast() OK<BR>";
-			}
-			
-			print "<p>Empty Move Test";
-			$rs = $db->Execute("select * from ADOXYZ where id > 0 and id < 0");
-			$rs->MoveFirst();
-			if (!$rs->EOF || $rs->fields) Err("Error in empty move first");
-		}
-	}
-	
-	$rs = $db->Execute('select * from ADOXYZ where id = 2');
-	if ($rs->EOF || !is_array($rs->fields)) Err("Error in select");
-	$rs->MoveNext();
-	if (!$rs->EOF) Err("Error in EOF (xx) ");
- //	$db->debug=true;
-	print "<p>Testing ADODB_FETCH_ASSOC and concat: concat firstname and lastname</p>";
-
-	$save = $ADODB_FETCH_MODE;
-	$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
-	if ($db->dataProvider == 'postgres') {
-		$sql = "select ".$db->Concat('cast(firstname as varchar)',$db->qstr(' '),'lastname')." as fullname,id,".$db->sysTimeStamp." as d from ADOXYZ";
-		$rs = &$db->Execute($sql);
-	} else {
-		$sql = "select distinct ".$db->Concat('firstname',$db->qstr(' '),'lastname')." as fullname,id,".$db->sysTimeStamp." as d from ADOXYZ";
-		$rs = &$db->Execute($sql);
-	}
-	if ($rs) {
-		if (empty($_GET['hide'])) rs2html($rs);
-	} else {
-		Err( "Failed Concat:".$sql);
-	}
-	$ADODB_FETCH_MODE = $save;
-	print "<hr>Testing GetArray() ";
-	//$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
-	
-	$rs = &$db->Execute("select * from ADOXYZ order by id");
-	if ($rs) {
-		$arr = &$rs->GetArray(10);
-		if (sizeof($arr) != 10 || trim($arr[1][1]) != 'John' || trim($arr[1][2]) != 'Lim') print $arr[1][1].' '.$arr[1][2]."<b> &nbsp; ERROR</b><br>";
-		else print " OK<BR>";
-	}
-	
-	$arr = $db->GetArray("select x from ADOXYZ");
-	$e = $db->ErrorMsg(); $e2 = $db->ErrorNo();
-	echo "Testing error handling, should see illegal column 'x' error=<i>$e ($e2) </i><br>";
-	if (!$e || !$e2) Err("Error handling did not work");
-	print "Testing FetchNextObject for 1 object ";
-	$rs = &$db->Execute("select distinct lastname,firstname from ADOXYZ where firstname='Caroline'");
-	$fcnt = 0;
-	if ($rs)
-	while ($o = $rs->FetchNextObject()) {
-		$fcnt += 1;	
-	}
-	if ($fcnt == 1) print " OK<BR>";
-	else print "<b>FAILED</b><BR>";
-	
-	$stmt = $db->Prepare("select * from ADOXYZ where id < 3");
-	$rs = $db->Execute($stmt);
-	if (!$rs) Err("Prepare failed");
-	else {
-		$arr = $rs->GetArray();
-		if (!$arr) Err("Prepare failed 2");
-		if (sizeof($arr) != 2) Err("Prepare failed 3");
-	}
-	print "Testing GetAssoc() ";
-	$savecrecs = $ADODB_COUNTRECS;
-	$ADODB_COUNTRECS = false;
-	//$arr = $db->GetArray("select  lastname,firstname from ADOXYZ");
-	//print_r($arr);
-	print "<hr>";
-	$rs =& $db->Execute("select distinct lastname,firstname,created from ADOXYZ");
-	
-	if ($rs) {
-		$arr = $rs->GetAssoc();
-		//print_r($arr);
-		if (empty($arr['See']) || trim(reset($arr['See'])) != 'Wai Hun') print $arr['See']." &nbsp; <b>ERROR</b><br>";
-		else print " OK 1";
-	}
-	
-	$arr = &$db->GetAssoc("select distinct lastname,firstname from ADOXYZ");
-	if ($arr) {
-		//print_r($arr);
-		if (empty($arr['See']) || trim($arr['See']) != 'Wai Hun') print $arr['See']." &nbsp; <b>ERROR</b><br>";
-		else print " OK 2<BR>";
-	}
-	// Comment this out to test countrecs = false
-	$ADODB_COUNTRECS = $savecrecs;
-	
-	for ($loop=0; $loop < 1; $loop++) {
-	print "Testing GetMenu() and CacheExecute<BR>";
-	$db->debug = true;
-	$rs = &$db->CacheExecute(4,"select distinct firstname,lastname from ADOXYZ");
-	
-	if ($rs) print 'With blanks, Steven selected:'. $rs->GetMenu('menu','Steven').'<BR>'; 
-	else print " Fail<BR>";
-	$rs = &$db->CacheExecute(4,"select distinct firstname,lastname from ADOXYZ");
-	
-	if ($rs) print ' No blanks, Steven selected: '. $rs->GetMenu('menu','Steven',false).'<BR>';
-	else print " Fail<BR>";
-	
-	$rs = &$db->CacheExecute(4,"select distinct firstname,lastname from ADOXYZ");
-	if ($rs) print ' Multiple, Alan selected: '. $rs->GetMenu('menu','Alan',false,true).'<BR>';
-	else print " Fail<BR>";
-	print '</p><hr>';
-	
-	$rs = &$db->CacheExecute(4,"select distinct firstname,lastname from ADOXYZ");
-	if ($rs) {
-		print ' Multiple, Alan and George selected: '. $rs->GetMenu('menu',array('Alan','George'),false,true);
-		if (empty($rs->connection)) print "<b>Connection object missing from recordset</b></br>";
-	} else print " Fail<BR>";
-	print '</p><hr>';
-	
-	print "Testing GetMenu2() <BR>";
-	$rs = &$db->CacheExecute(4,"select distinct firstname,lastname from ADOXYZ");
-	if ($rs) print 'With blanks, Steven selected:'. $rs->GetMenu2('menu',('Oey')).'<BR>'; 
-	else print " Fail<BR>";
-	$rs = &$db->CacheExecute(6,"select distinct firstname,lastname from ADOXYZ");
-	if ($rs) print ' No blanks, Steven selected: '. $rs->GetMenu2('menu',('Oey'),false).'<BR>';
-	else print " Fail<BR>";
-	}
-	echo "<h3>CacheEXecute</h3>";
-
-	$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-	$rs = &$db->CacheExecute(6,"select distinct firstname,lastname from ADOXYZ");
-	print_r($rs->fields); echo $rs->fetchMode;echo "<br>";
-	echo $rs->Fields('firstname');
-	
-	$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
-	$rs = &$db->CacheExecute(6,"select distinct firstname,lastname from ADOXYZ");
-	print_r($rs->fields);echo "<br>";
-	echo $rs->Fields('firstname');
-	$db->debug = false;
-	
-	$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-	// phplens
-	
-	$sql = 'select * from ADOXYZ where 0=1';
-	echo "<p>**Testing '$sql' (phplens compat 1)</p>";
-	$rs = &$db->Execute($sql);
-	if (!$rs) err( "<b>No recordset returned for '$sql'</b>");
-	if (!$rs->FieldCount()) err( "<b>No fields returned for $sql</b>");
-	if (!$rs->FetchField(1)) err( "<b>FetchField failed for $sql</b>");
-	
-	$sql = 'select * from ADOXYZ order by 1';
-	echo "<p>**Testing '$sql' (phplens compat 2)</p>";
-	$rs = &$db->Execute($sql);
-	if (!$rs) err( "<b>No recordset returned for '$sql'<br>".$db->ErrorMsg()."</b>");
-	
-	
-	$sql = 'select * from ADOXYZ order by 1,1';
-	echo "<p>**Testing '$sql' (phplens compat 3)</p>";
-	$rs = &$db->Execute($sql);
-	if (!$rs) err( "<b>No recordset returned for '$sql'<br>".$db->ErrorMsg()."</b>");
-	
-	
-	// Move
-	$rs1 = &$db->Execute("select id from ADOXYZ where id <= 2 order by 1");
-	$rs2 = &$db->Execute("select id from ADOXYZ where id = 3 or id = 4 order by 1");
-
-	if ($rs1) $rs1->MoveLast();
-	if ($rs2) $rs2->MoveLast();
-	
-	if (empty($rs1) || empty($rs2) || $rs1->fields[0] != 2 || $rs2->fields[0] != 4) {
-		$a = $rs1->fields[0];
-		$b = $rs2->fields[0];
-		print "<p><b>Error in multiple recordset test rs1=$a rs2=$b (should be rs1=2 rs2=4)</b></p>";
-	} else
-		print "<p>Testing multiple recordsets OK</p>";
-		
-	
-	echo "<p> GenID test: ";
-	for ($i=1; $i <= 10; $i++) 
-		echo  "($i: ",$val = $db->GenID($db->databaseType.'abcseq6' ,5), ") ";
-	if ($val == 0) Err("GenID not supported");
-	
-	if ($val) {
-		$db->DropSequence('abc_seq2');
-		$db->CreateSequence('abc_seq2');
-		$val = $db->GenID('abc_seq2');
-		$db->DropSequence('abc_seq2');
-		$db->CreateSequence('abc_seq2');
-		$val = $db->GenID('abc_seq2');
-		if ($val != 1) Err("Drop and Create Sequence not supported ($val)");
-	}
-	echo "<p>";
-	
-	if (substr($db->dataProvider,0,3) != 'notused') { // used to crash ado
-		$sql = "select firstnames from adoxyz";
-		print "<p>Testing execution of illegal statement: <i>$sql</i></p>";
-		if ($db->Execute($sql) === false) {
-			print "<p>This returns the following ErrorMsg(): <i>".$db->ErrorMsg()."</i> and ErrorNo(): ".$db->ErrorNo().'</p>';
-		} else 
-			print "<p><b>Error in error handling -- Execute() should return false</b></p>";
-	} else 
-		print "<p><b>ADO skipped error handling of bad select statement</b></p>";
-	
-	print "<p>ASSOC TEST 2<br>";
-	$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
-	$rs = $db->query('select * from adoxyz order by id');
-	if ($ee = $db->ErrorMsg()) {
-		Err("Error message=$ee");
-	}
-	if ($ee = $db->ErrorNo()) {
-		Err("Error No = $ee");
-	}
-	print_r($rs->fields);
-	for($i=0;$i<$rs->FieldCount();$i++) 
-	{ 
-		$fld=$rs->FetchField($i); 
-		print "<br> Field name is ".$fld->name; 
-		print " ".$rs->Fields($fld->name); 
-	} 
-
-		
-	print "<p>BOTH TEST 2<br>";
-	if ($db->dataProvider == 'ado') {
-		print "<b>ADODB_FETCH_BOTH not supported</b> for dataProvider=".$db->dataProvider."<br>";
-	} else {
-		$ADODB_FETCH_MODE = ADODB_FETCH_BOTH;
-		$rs = $db->query('select * from adoxyz order by id');
-		for($i=0;$i<$rs->FieldCount();$i++) 
-		{ 
-			$fld=$rs->FetchField($i); 
-			print "<br> Field name is ".$fld->name; 
-			print " ".$rs->Fields($fld->name); 
-		} 
-	}
-	
-	print "<p>NUM TEST 2<br>";
-	$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-	$rs = $db->query('select * from adoxyz order by id');
-	for($i=0;$i<$rs->FieldCount();$i++) 
-	{ 
-		$fld=$rs->FetchField($i); 
-		print "<br> Field name is ".$fld->name; 
-		print " ".$rs->Fields($fld->name); 
-	} 
-	
-	print "<p>ASSOC Test of SelectLimit<br>";
-	$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
-	$rs = $db->selectlimit('select * from adoxyz order by id',3,4);
-	$cnt = 0;
-	while ($rs && !$rs->EOF) {
-		$cnt += 1;
-		if (!isset($rs->fields['firstname'])) {
-			print "<br><b>ASSOC returned numeric field</b></p>";
-			break;
-		}
-		$rs->MoveNext();
-	}
-	if ($cnt != 3) print "<br><b>Count should be 3, instead it was $cnt</b></p>";
-	
-	
-	$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-	if ($db->sysDate) {
-		$saved = $db->debug;
-		$db->debug = 1;
-		$rs = $db->Execute("select {$db->sysDate} from adoxyz where id=1");
-		if (ADORecordSet::UnixDate(date('Y-m-d')) != $rs->UnixDate($rs->fields[0])) {
-			print "<p><b>Invalid date {$rs->fields[0]}</b></p>";
-		} else
-			print "<p>Passed \$sysDate test ({$rs->fields[0]})</p>";
-		
-		print_r($rs->FetchField(0));
-		print time();
-		$db->debug=$saved;
-	} else {
-		print "<p><b>\$db->sysDate not defined</b></p>";
-	}
-
-	print "<p>Test CSV</p>";
-	include_once('../toexport.inc.php');
-	//$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
-	$rs = $db->SelectLimit('select id,firstname,lastname,created,\'He, he\' he,\'"\' q  from adoxyz',10);	
-	
-	print "<pre>";
-	print rs2csv($rs);
-	print "</pre>";
-	
-	$rs = $db->SelectLimit('select id,firstname,lastname,created,\'The	"young man", he said\' from adoxyz',10);	
-	
-	if (PHP_VERSION < 5) {
-		print "<pre>";
-		rs2tabout($rs);
-		print "</pre>";
-	}
-	//print " CacheFlush ";
-	//$db->CacheFlush();
-	$date = $db->SQLDate('d-m-M-Y-\QQ h:i:s A');
-	$sql = "SELECT $date from ADOXYZ";
-	print "<p>Test SQLDate: ".htmlspecialchars($sql)."</p>";
-	$rs = $db->SelectLimit($sql,1);
-	$d = date('d-m-M-Y-').'Q'.(ceil(date('m')/3.0)).date(' h:i:s A');
-	if (!$rs) Err("SQLDate query returned no recordset");
-	else if ($d != $rs->fields[0]) Err("SQLDate 1 failed expected: <br>act:$d <br>sql:".$rs->fields[0]);
-	
-	$date = $db->SQLDate('d-m-M-Y-\QQ h:i:s A',$db->DBDate("1974-02-25"));
-	$sql = "SELECT $date from ADOXYZ";
-	print "<p>Test SQLDate: ".htmlspecialchars($sql)."</p>";
-	$rs = $db->SelectLimit($sql,1);
-	$ts = ADOConnection::UnixDate('1974-02-25');
-	$d = date('d-m-M-Y-',$ts).'Q'.(ceil(date('m',$ts)/3.0)).date(' h:i:s A',$ts);
-	if (!$rs) {
-		Err("SQLDate query returned no recordset");
-		echo $db->ErrorMsg(),'<br>';
-	} else if ($d != $rs->fields[0]) Err("SQLDate 2 failed expected: <br>act:$d <br>sql:".$rs->fields[0]);
-	
-	
-	print "<p>Test Filter</p>";
-	$db->debug = 1;
-	
-	$rs = $db->SelectLimit('select * from ADOXYZ where id < 3 order by id');
-	
-	$rs = RSFilter($rs,'do_strtolower');
-	if (trim($rs->fields[1]) != 'caroline'  && trim($rs->fields[2]) != 'miranda') {
-		err('**** RSFilter failed');
-		print_r($rs->fields);
-	}
-	
-	rs2html($rs);
-		
-	$db->debug=1;
-	
-	
-	print "<p>Test Replace</p>";
-	
-	$ret = $db->Replace('adoxyz', 
-		array('id'=>1,'firstname'=>'Caroline','lastname'=>'Miranda'),
-		array('id'),
-		$autoq = true);
-	if (!$ret) echo "<p>Error in replacing existing record</p>";
-	else {
-		$saved = $db->debug;
-		$db->debug = 0;
-		$savec = $ADODB_COUNTRECS;
-		$ADODB_COUNTRECS = true;
-		$rs = $db->Execute('select * FROM ADOXYZ where id=1');
-		$db->debug = $saved;
-		if ($rs->RecordCount() != 1) {
-			$cnt = $rs->RecordCount();
-			rs2html($rs);
-			print "<b>Error - Replace failed, count=$cnt</b><p>";
-		}
-		$ADODB_COUNTRECS = $savec;
-	}
-	$ret = $db->Replace('adoxyz', 
-		array('id'=>1000,'firstname'=>'Harun','lastname'=>'Al-Rashid'),
-		array('id','firstname'),
-		$autoq = true);
-	if ($ret != 2) print "<b>Replace failed: </b>";
-	print "test A return value=$ret (2 expected) <p>";
-	
-	$ret = $db->Replace('adoxyz', 
-		array('id'=>1000,'firstname'=>'Sherazade','lastname'=>'Al-Rashid'),
-		'id',
-		$autoq = true);
-	if ($ret != 1) 
-		if ($db->dataProvider == 'ibase' && $ret == 2);
-		else print "<b>Replace failed: </b>";
-	print "test B return value=$ret (1 or if ibase then 2 expected) <p>";
-	
-	print "<h3>rs2rs Test</h3>";
-	
-	$rs = $db->Execute('select * from adoxyz where id>= 1 order by id');
-	$rs = $db->_rs2rs($rs);
-	$rs->valueX = 'X';
-	$rs->MoveNext();
-	$rs = $db->_rs2rs($rs);
-	if (!isset($rs->valueX)) err("rs2rs does not preserve array recordsets");
-	if (reset($rs->fields) != 1) err("rs2rs does not move to first row: id=".reset($rs->fields));
-
-	/////////////////////////////////////////////////////////////
-	include_once('../pivottable.inc.php');
-	print "<h3>Pivot Test</h3>";
-	$db->debug=true;
- 	$sql = PivotTableSQL(
- 		$db,  			# adodb connection
- 		'adoxyz',  		# tables
-		'firstname',	# row fields
-		'lastname',		# column fields 
-		false,			# join
-		'ID', 			# sum
-		'Sum ',			# label for sum
-		'sum',			# aggregate function
-		true
-	);
-	$rs = $db->Execute($sql);
-	if ($rs) rs2html($rs);
-	else Err("Pivot sql error");
-	
-	$db->debug=false;
-	include_once "PEAR.php";
-	
-	// PEAR TESTS BELOW
-	$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
-	$pear = true;
-	$rs = $db->query('select * from adoxyz where id>0 and id<10 order by id');
-	
-	$i = 0;
-	if ($rs && !$rs->EOF) {
-		while ($arr = $rs->fetchRow()) {
-			$i++;
-			//print "$i ";
-			if ($arr[0] != $i) {
-				print_r($arr);
-				print "<p><b>PEAR DB emulation error 1.</b></p>";
-				$pear = false;
-				break;
-			}
-		}
-		$rs->Close();
-	}
-	
-	
-	if ($i != $db->GetOne('select count(*) from adoxyz where id>0 and id<10')) {
-		print "<p><b>PEAR DB emulation error 1.1 EOF ($i)</b></p>";
-		$pear = false;
-	}
-	
-	$rs = $db->limitQuery('select * from adoxyz where id>0 order by id',$i=3,$top=3);
-	$i2 = $i;
-	if ($rs && !$rs->EOF) {
-
-		while (!is_object($rs->fetchInto($arr))) {
-			$i2++;
-			
-	//			print_r($arr);
-	//		print "$i ";print_r($arr);
-			if ($arr[0] != $i2) {
-				print "<p><b>PEAR DB emulation error 2.</b></p>";
-				$pear = false;
-				break;
-			}
-		}
-		$rs->Close();
-	}
-	if ($i2 != $i+$top) {
-		print "<p><b>PEAR DB emulation error 2.1 EOF (correct=$i+$top, actual=$i2)</b></p>";
-		$pear = false;
-	}
-	
-	if ($pear) print "<p>PEAR DB emulation passed.</p>";
-	
-	$rs = $db->SelectLimit("select ".$db->sysDate." from adoxyz",1);
-	$date = $rs->fields[0];
-	if (!$date) Err("Bad sysDate");
-	else {
-		$ds = $db->UserDate($date,"d m Y");
-		if ($ds != date("d m Y")) Err("Bad UserDate: ".$ds.' expected='.date("d m Y"));
-		else echo "Passed UserDate: $ds<p>";
-	}
-	$db->debug=1;
-	if ($db->dataProvider == 'oci8') 
-		$rs = $db->SelectLimit("select to_char(".$db->sysTimeStamp.",'YYYY-MM-DD HH24:MI:SS') from adoxyz",1);
-	else 
-		$rs = $db->SelectLimit("select ".$db->sysTimeStamp." from adoxyz",1);
-	$date = $rs->fields[0];
-	if (!$date) Err("Bad sysTimeStamp");
-	else {
-		$ds = $db->UserTimeStamp($date,"H \\h\\r\\s-d m Y");
-		if ($ds != date("H \\h\\r\\s-d m Y")) Err("Bad UserTimeStamp: ".$ds.", correct is ".date("H \\h\\r\\s-d m Y"));
-		else echo "Passed UserTimeStamp: $ds<p>";
-		
-		$date = 100;
-		$ds = $db->UserTimeStamp($date,"H \\h\\r\\s-d m Y");
-		$ds2 = date("H \\h\\r\\s-d m Y",$date);
-		if ($ds != $ds2) Err("Bad UserTimeStamp 2: $ds: $ds2");
-		else echo "Passed UserTimeStamp 2: $ds<p>";
-	}
-	if ($db->hasTransactions) {
-		//$db->debug=1;
-		echo "<p>Testing StartTrans CompleteTrans</p>";
-		$db->raiseErrorFn = false;
-		$db->StartTrans();
-		$rs = $db->Execute('select * from notable');
-			$db->StartTrans();
-				$db->BeginTrans();
-			$db->Execute("update ADOXYZ set firstname='Carolx' where id=1");
-				$db->CommitTrans();
-			$db->CompleteTrans();
-		$rez = $db->CompleteTrans();
-		if ($rez !== false) {
-			if (is_null($rez)) Err("Error: _transOK not modified");
-			else Err("Error: CompleteTrans (1) should have failed");
-		} else {
-			$name = $db->GetOne("Select firstname from ADOXYZ where id=1");
-			if ($name == "Carolx") Err("Error: CompleteTrans (2) should have failed");
-			else echo "<p> -- Passed StartTrans test1 - rolling back</p>";
-		}
-		
-		$db->StartTrans();
-			$db->BeginTrans();
-		$db->Execute("update ADOXYZ set firstname='Carolx' where id=1");
-			$db->RollbackTrans();
-		$rez = $db->CompleteTrans();
-		if ($rez !== true) Err("Error: CompleteTrans (1) should have succeeded");
-		else {
-			$name = $db->GetOne("Select firstname from ADOXYZ where id=1");
-			if (trim($name) != "Carolx") Err("Error: CompleteTrans (2) should have succeeded, returned name=$name");
-			else echo "<p> -- Passed StartTrans test2 - commiting</p>";
-		}
-	}
-	
-	$saved = $db->debug;
-	$db->debug=1;
-	$cnt = _adodb_getcount($db, 'select * from ADOXYZ where firstname in (select firstname from ADOXYZ)');
-	echo "<b>Count=</b> $cnt";
-	$db->debug=$saved;
-	
-	global $TESTERRS;
-	$debugerr = true;
-	
-	global $ADODB_LANG;$ADODB_LANG = 'fr';
-	$db->debug = false;
-	$TESTERRS = 0;
-	$db->raiseErrorFn = 'adodb_test_err';
-	global $ERRNO; // from adodb_test_err
-	$db->Execute('select * from nowhere');
-	$metae = $db->MetaError($ERRNO);
-	if ($metae !== DB_ERROR_NOSUCHTABLE) print "<p><b>MetaError=".$metae." wrong</b>, should be ".DB_ERROR_NOSUCHTABLE."</p>";
-	else print "<p>MetaError ok (".DB_ERROR_NOSUCHTABLE."): ".$db->MetaErrorMsg($metae)."</p>";
-	if ($TESTERRS != 1) print "<b>raiseErrorFn select nowhere failed</b><br>";
-	$rs = $db->Execute('select * from adoxyz');
-	if ($debugerr) print " Move";
-	$rs->Move(100);
-	$rs->_queryID = false;
-	if ($debugerr) print " MoveNext";
-	$rs->MoveNext();
-	if ($debugerr) print " $rs=false";
-	$rs = false;
-
-	print "<p>SetFetchMode() tests</p>";
-	$db->SetFetchMode(ADODB_FETCH_ASSOC);
-	$rs = $db->SelectLimit('select firstname from adoxyz',1);
-	if (!isset($rs->fields['firstname'])) Err("BAD FETCH ASSOC");
-	
-	$ADODB_FETCH_MODE = ADODB_FETCH_NUM;	
-	$rs = $db->SelectLimit('select firstname from adoxyz',1);
-	//var_dump($rs->fields);
-	if (!isset($rs->fields['firstname'])) Err("BAD FETCH ASSOC");
-	
-	$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;	
-	$db->SetFetchMode(ADODB_FETCH_NUM);
-	$rs = $db->SelectLimit('select firstname from adoxyz',1);
-	if (!isset($rs->fields[0])) Err("BAD FETCH NUM");
-	
-	print "<p>Test MetaTables again with SetFetchMode()</p>";
-	$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
-	$db->SetFetchMode(ADODB_FETCH_ASSOC);
-	print_r($db->MetaTables());
-	print "<p>";
-	////////////////////////////////////////////////////////////////////
-	
-	if ($db->dataProvider == 'odbtp') $db->databaseType = 'odbtp';
-	$conn = NewADOConnection($db->databaseType);
-	$conn->raiseErrorFn = 'adodb_test_err';
-	@$conn->PConnect('abc');
-	if ($TESTERRS == 2) print "raiseErrorFn tests passed<br>";
-	else print "<b>raiseErrorFn tests failed ($TESTERRS)</b><br>";
-	
-	
-	////////////////////////////////////////////////////////////////////
-	
-	global $nocountrecs;
-	
-	if (isset($nocountrecs) && $ADODB_COUNTRECS) err("Error: \$ADODB_COUNTRECS is set");
-	if (empty($nocountrecs) && $ADODB_COUNTRECS==false) err("Error: \$ADODB_COUNTRECS is not set");
-
-	
-?>
-	</p>
-	<table width=100% ><tr><td bgcolor=beige>&nbsp;</td></tr></table>
-	</p></form>
-<?php
-
-	if ($rs1) $rs1->Close();
-	if ($rs2) $rs2->Close();
-	if ($rs) $rs->Close();
-	$db->Close();
-	
-	if ($db->transCnt != 0) Err("Error in transCnt=$db->transCnt (should be 0)");
-	
-	
-	printf("<p>Total queries=%d; total cached=%d</p>",$EXECS+$CACHED, $CACHED);
-}
-
-function adodb_test_err($dbms, $fn, $errno, $errmsg, $p1=false, $p2=false)
-{
-global $TESTERRS,$ERRNO;
-
-	$ERRNO = $errno;
-	$TESTERRS += 1;
-	print "<i>** $dbms ($fn): errno=$errno &nbsp; errmsg=$errmsg ($p1,$p2)</i><br>";
-}
-
-//--------------------------------------------------------------------------------------
-
-
- at set_time_limit(240); // increase timeout
-
-include("../tohtml.inc.php");
-include("../adodb.inc.php");
-include("../rsfilter.inc.php");
-
-/* White Space Check */
-
-if (isset($_SERVER['argv'][1])) {
-	//print_r($_SERVER['argv']);
-	$_GET[$_SERVER['argv'][1]] = 1;
-}
-
-if (@$_SERVER['COMPUTERNAME'] == 'TIGRESS') {
-	CheckWS('mysqlt');
-	CheckWS('postgres');
-	CheckWS('oci8po');
-	
-	CheckWS('firebird');
-	CheckWS('sybase');
-	if (!ini_get('safe_mode')) CheckWS('informix');
-
-	CheckWS('ado_mssql');
-	CheckWS('ado_access');
-	CheckWS('mssql');
-	
-	CheckWS('vfp');
-	CheckWS('sqlanywhere');
-	CheckWS('db2');
-	CheckWS('access');
-	CheckWS('odbc_mssql');
-	CheckWS('firebird15');
-	//
-	CheckWS('oracle');
-	CheckWS('proxy');
-	CheckWS('fbsql');
-	print "White Space Check complete<p>";
-}
-if (sizeof($_GET) == 0) $testmysql = true;
-
-
-foreach($_GET as $k=>$v)  {
-	//global $$k;
-	$$k = $v;
-}	
-if (strpos(PHP_VERSION,'5') === 0) {
-	//$testaccess=1;
-	//$testmssql = 1;
-	//$testsqlite=1;
-}
-?>
-<html>
-<title>ADODB Testing</title>
-<body bgcolor=white>
-<H1>ADODB Test</H1>
-
-This script tests the following databases: Interbase, Oracle, Visual FoxPro, Microsoft Access (ODBC and ADO), MySQL, MSSQL (ODBC, native, ADO). 
-There is also support for Sybase, PostgreSQL.</p>
-For the latest version of ADODB, visit <a href=http://adodb.sourceforge.net/>adodb.sourceforge.net</a>.</p>
-
-Test <a href=test4.php>GetInsertSQL/GetUpdateSQL</a> &nbsp; 
-	<a href=testsessions.php>Sessions</a> &nbsp;
-	<a href=testpaging.php>Paging</a> &nbsp;
-	<a href=test-perf.php>Perf Monitor</a><p>
-<?php
-include('./testdatabases.inc.php');
-
-echo "<br>vers=",ADOConnection::Version();
-
-
-include_once('../adodb-time.inc.php');
-if (isset($_GET['time'])) adodb_date_test();
-
-?>
-<p><i>ADODB Database Library  (c) 2000-2005 John Lim. All rights reserved. Released under BSD and LGPL, PHP <?php echo PHP_VERSION ?>.</i></p>
-</body>
-</html>

Copied: plog/trunk/class/database/adodb/tests/test.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/test.php)

Deleted: plog/trunk/class/database/adodb/tests/test2.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/test2.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/test2.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,26 +0,0 @@
-<?php
-
-// BASIC ADO test
-
-	include_once('../adodb.inc.php');
-
-	$db = &ADONewConnection("ado_access");
-	$db->debug=1;
-	$access = 'd:\inetpub\wwwroot\php\NWIND.MDB';
-	$myDSN =  'PROVIDER=Microsoft.Jet.OLEDB.4.0;'
-		. 'DATA SOURCE=' . $access . ';';
-		
-	echo "<p>PHP ",PHP_VERSION,"</p>";
-	
-	$db->Connect($myDSN) || die('fail');
-	
-	print_r($db->ServerInfo());
-	
-	try {
-	$rs = $db->Execute("select $db->sysTimeStamp,* from adoxyz where id>02xx");
-	print_r($rs->fields);
-	} catch(exception $e) {
-	print_r($e);
-	echo "<p> Date m/d/Y =",$db->UserDate($rs->fields[4],'m/d/Y');
-	}
-?>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/tests/test2.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/test2.php)

Deleted: plog/trunk/class/database/adodb/tests/test3.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/test3.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/test3.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,44 +0,0 @@
-<?php
-/*
-  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
-  Released under both BSD license and Lesser GPL library license. 
-  Whenever there is any discrepancy between the two licenses, 
-  the BSD license will take precedence.
-  Set tabs to 8.
- */
-
-
-error_reporting(E_ALL);
-
-$path = dirname(__FILE__);
-
-include("$path/../adodb-exceptions.inc.php");
-include("$path/../adodb.inc.php");	
-
-try {
-$db = NewADOConnection("oci8");
-$db->Connect('','scott','natsoft');
-$db->debug=1;
-
-$cnt = $db->GetOne("select count(*) from adoxyz");
-$rs = $db->Execute("select * from adoxyz order by id");
-
-$i = 0;
-foreach($rs as $k => $v) {
-	$i += 1;
-	echo $k; adodb_pr($v);
-	flush();
-}
-
-if ($i != $cnt) die("actual cnt is $i, cnt should be $cnt\n");
-
-
-
-$rs = $db->Execute("select bad from badder");
-
-} catch (exception $e) {
-	adodb_pr($e);
-	$e = adodb_backtrace($e->trace);
-}
-
-?>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/tests/test3.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/test3.php)

Deleted: plog/trunk/class/database/adodb/tests/test4.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/test4.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/test4.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,134 +0,0 @@
-<?php
-
-/** 
- * @version V4.50 6 July 2004 (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
- * Released under both BSD license and Lesser GPL library license. 
- * Whenever there is any discrepancy between the two licenses, 
- * the BSD license will take precedence. 
- *
- * Set tabs to 4 for best viewing.
- * 
- * Latest version is available at http://php.weblogs.com
- *
- * Test GetUpdateSQL and GetInsertSQL.
- */
- 
-error_reporting(E_ALL);
-function testsql()
-{
-
-
-include('../adodb.inc.php');
-include('../tohtml.inc.php');
-
-global $ADODB_FORCE_TYPE;
-
-
-//==========================
-// This code tests an insert
-
-$sql = "
-SELECT * 
-FROM ADOXYZ WHERE id = -1"; 
-// Select an empty record from the database 
-
-
-#$conn = &ADONewConnection("mssql");  // create a connection
-#$conn->PConnect("", "sa", "natsoft", "northwind"); // connect to MySQL, testdb
-
-$conn = &ADONewConnection("mysql");  // create a connection
-$conn->PConnect("localhost", "root", "", "test"); // connect to MySQL, testdb
-
-//$conn =& ADONewConnection('oci8');
-//$conn->Connect('','scott','natsoft');
-//$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
-
-$conn->debug=1;
-$conn->Execute("delete from adoxyz where lastname like 'Smi%'");
-
-$rs = $conn->Execute($sql); // Execute the query and get the empty recordset
-$record = array(); // Initialize an array to hold the record data to insert
-
-if (strpos($conn->databaseType,'mssql')!==false) $record['id'] = 751;
-$record["firstname"] = 'Jann';
-$record["lastname"] = "Smitts";
-$record["created"] = time();
-
-$insertSQL = $conn->GetInsertSQL($rs, $record);
-$conn->Execute($insertSQL); // Insert the record into the database
-
-if (strpos($conn->databaseType,'mssql')!==false) $record['id'] = 752;
-// Set the values for the fields in the record
-$record["firstname"] = 'null';
-$record["lastname"] = "Smith\$@//";
-$record["created"] = time();
-
-if (isset($_GET['f'])) $ADODB_FORCE_TYPE = $_GET['f'];
-
-//$record["id"] = -1;
-
-// Pass the empty recordset and the array containing the data to insert
-// into the GetInsertSQL function. The function will process the data and return
-// a fully formatted insert sql statement.
-$insertSQL = $conn->GetInsertSQL($rs, $record);
-$conn->Execute($insertSQL); // Insert the record into the database
-
-
-
-$insertSQL2 = $conn->GetInsertSQL($table='ADOXYZ', $record);
-if ($insertSQL != $insertSQL2) echo "<p><b>Walt's new stuff failed</b>: $insertSQL2</p>";
-//==========================
-// This code tests an update
-
-$sql = "
-SELECT * 
-FROM ADOXYZ WHERE lastname=".$conn->Param('var'). " ORDER BY 1"; 
-// Select a record to update 
-
-$varr = array('var'=>$record['lastname'].'');
-$rs = $conn->Execute($sql,$varr); // Execute the query and get the existing record to update
-if (!$rs || $rs->EOF) print "<p><b>No record found!</b></p>";
-
-$record = array(); // Initialize an array to hold the record data to update
-
-
-// Set the values for the fields in the record
-$record["firstName"] = "Caroline".rand();
-//$record["lasTname"] = ""; // Update Caroline's lastname from Miranda to Smith
-$record["creAted"] = '2002-12-'.(rand()%30+1);
-$record['num'] = '';
-// Pass the single record recordset and the array containing the data to update
-// into the GetUpdateSQL function. The function will process the data and return
-// a fully formatted update sql statement.
-// If the data has not changed, no recordset is returned
-
-$updateSQL = $conn->GetUpdateSQL($rs, $record);
-$conn->Execute($updateSQL,$varr); // Update the record in the database
-if ($conn->Affected_Rows() != 1)print "<p><b>Error1 </b>: Rows Affected=".$conn->Affected_Rows().", should be 1</p>";
-
-$record["firstName"] = "Caroline".rand();
-$record["lasTname"] = "Smithy Jones"; // Update Caroline's lastname from Miranda to Smith
-$record["creAted"] = '2002-12-'.(rand()%30+1);
-$record['num'] = 331;
-$updateSQL = $conn->GetUpdateSQL($rs, $record);
-$conn->Execute($updateSQL,$varr); // Update the record in the database
-if ($conn->Affected_Rows() != 1)print "<p><b>Error 2</b>: Rows Affected=".$conn->Affected_Rows().", should be 1</p>";
-
-$rs = $conn->Execute("select * from ADOXYZ where lastname like 'Sm%'");
-//adodb_pr($rs);
-rs2html($rs);
-
-$record["firstName"] = "Carol-new-".rand();
-$record["lasTname"] = "Smithy"; // Update Caroline's lastname from Miranda to Smith
-$record["creAted"] = '2002-12-'.(rand()%30+1);
-$record['num'] = 331;
-
-$conn->AutoExecute('ADOXYZ',$record,'UPDATE', "lastname like 'Sm%'");
-$rs = $conn->Execute("select * from ADOXYZ where lastname like 'Sm%'");
-//adodb_pr($rs);
-rs2html($rs);
-}
-
-
-testsql();
-?>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/tests/test4.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/test4.php)

Deleted: plog/trunk/class/database/adodb/tests/test5.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/test5.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/test5.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,47 +0,0 @@
-<?php
-/* 
-V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
-  Released under both BSD license and Lesser GPL library license. 
-  Whenever there is any discrepancy between the two licenses, 
-  the BSD license will take precedence. 
-  Set tabs to 4 for best viewing.
-	
-  Latest version is available at http://adodb.sourceforge.net
-*/
-
-
-// Select an empty record from the database 
-
-include('../adodb.inc.php');
-include('../tohtml.inc.php');
-
-include('../adodb-errorpear.inc.php');
-
-if (0) {
-	$conn = &ADONewConnection('mysql');
-	$conn->debug=1;
-	$conn->PConnect("localhost","root","","xphplens");
-	print $conn->databaseType.':'.$conn->GenID().'<br>';
-}
-
-if (0) {
-	$conn = &ADONewConnection("oci8");  // create a connection
-	$conn->debug=1;
-	$conn->PConnect("falcon", "scott", "tiger", "juris8.ecosystem.natsoft.com.my"); // connect to MySQL, testdb
-	print $conn->databaseType.':'.$conn->GenID();
-}
-
-if (0) {
-	$conn = &ADONewConnection("ibase");  // create a connection
-	$conn->debug=1;
-	$conn->Connect("localhost:c:\\Interbase\\Examples\\Database\\employee.gdb", "sysdba", "masterkey", ""); // connect to MySQL, testdb
-	print $conn->databaseType.':'.$conn->GenID().'<br>';
-}
-
-if (0) {
-	$conn = &ADONewConnection('postgres');
-	$conn->debug=1;
-	@$conn->PConnect("susetikus","tester","test","test");
-	print $conn->databaseType.':'.$conn->GenID().'<br>';
-}
-?>

Copied: plog/trunk/class/database/adodb/tests/test5.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/test5.php)

Deleted: plog/trunk/class/database/adodb/tests/test_rs_array.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/test_rs_array.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/test_rs_array.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,47 +0,0 @@
-<?php
-
-include_once('../adodb.inc.php');
-$rs = new ADORecordSet_array();
-
-$array = array(
-array ('Name', 'Age'),
-array ('John', '12'),
-array ('Jill', '8'),
-array ('Bill', '49')
-);
-
-$typearr = array('C','I');
-
-
-$rs->InitArray($array,$typearr);
-
-while (!$rs->EOF) {
-	print_r($rs->fields);echo "<br>";
-	$rs->MoveNext();
-}
-
-echo "<hr> 1 Seek<br>";
-$rs->Move(1);
-while (!$rs->EOF) {
-	print_r($rs->fields);echo "<br>";
-	$rs->MoveNext();
-}
-
-echo "<hr> 2 Seek<br>";
-$rs->Move(2);
-while (!$rs->EOF) {
-	print_r($rs->fields);echo "<br>";
-	$rs->MoveNext();
-}
-
-echo "<hr> 3 Seek<br>";
-$rs->Move(3);
-while (!$rs->EOF) {
-	print_r($rs->fields);echo "<br>";
-	$rs->MoveNext();
-}
-
-
-
-die();
-?>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/tests/test_rs_array.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/test_rs_array.php)

Deleted: plog/trunk/class/database/adodb/tests/testcache.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/testcache.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/testcache.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,29 +0,0 @@
-<html>
-<body>
-<?php
-/* 
-V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
-  Released under both BSD license and Lesser GPL library license. 
-  Whenever there is any discrepancy between the two licenses, 
-  the BSD license will take precedence. 
-  Set tabs to 4 for best viewing.
-	
-  Latest version is available at http://adodb.sourceforge.net
-*/
-
-$ADODB_CACHE_DIR = dirname(tempnam('/tmp',''));
-include("../adodb.inc.php");
-
-if (isset($access)) {
-	$db=ADONewConnection('access');
-	$db->PConnect('nwind');
-} else {
-	$db = ADONewConnection('mysql');
-	$db->PConnect('mangrove','root','','xphplens');
-}
-if (isset($cache)) $rs = $db->CacheExecute(120,'select * from products');
-else $rs = $db->Execute('select * from products');
-
-$arr = $rs->GetArray();
-print sizeof($arr);
-?>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/tests/testcache.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/testcache.php)

Deleted: plog/trunk/class/database/adodb/tests/testdatabases.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/testdatabases.inc.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/testdatabases.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,400 +0,0 @@
-<?php
-  
-/*
-V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
-  Released under both BSD license and Lesser GPL library license. 
-  Whenever there is any discrepancy between the two licenses, 
-  the BSD license will take precedence.
-*/ 
- 
- /* this file is used by the ADODB test program: test.php */
- ?>
-
-<table><tr valign=top><td>
-<form method=get>
-<input type=checkbox name="testaccess" value=1 <?php echo !empty($testaccess) ? 'checked' : '' ?>> <b>Access</b><br>
-<input type=checkbox name="testibase" value=1 <?php echo !empty($testibase) ? 'checked' : '' ?>> <b>Interbase</b><br>
-<input type=checkbox name="testmssql" value=1 <?php echo !empty($testmssql) ? 'checked' : '' ?>> <b>MSSQL</b><br>
- <input type=checkbox name="testmysql" value=1 <?php echo !empty($testmysql) ? 'checked' : '' ?>> <b>MySQL</b><br>
-<input type=checkbox name="testmysqlodbc" value=1 <?php echo !empty($testmysqlodbc) ? 'checked' : '' ?>> <b>MySQL ODBC</b><br>
-<input type=checkbox name="testmysqli" value=1 <?php echo !empty($testmysqli) ? 'checked' : '' ?>> <b>MySQLi</b>
-<br>
-<td><input type=checkbox name="testsqlite" value=1 <?php echo !empty($testsqlite) ? 'checked' : '' ?>> <b>SQLite</b><br>
-<input type=checkbox name="testproxy" value=1 <?php echo !empty($testproxy) ? 'checked' : '' ?>> <b>MySQL Proxy</b><br>
-<input type=checkbox name="testoracle" value=1 <?php echo !empty($testoracle) ? 'checked' : '' ?>> <b>Oracle (oci8)</b> <br>
-<input type=checkbox name="testpostgres" value=1 <?php echo !empty($testpostgres) ? 'checked' : '' ?>> <b>PostgreSQL</b><br>
-<input type=checkbox name="testpgodbc" value=1 <?php echo !empty($testpgodbc) ? 'checked' : '' ?>> <b>PostgreSQL ODBC</b><br>
-<td>
-<input type=checkbox name="testpdopgsql" value=1 <?php echo !empty($testpdopgsql) ? 'checked' : '' ?>> <b>PgSQL PDO</b><br>
-<input type=checkbox name="testpdomysql" value=1 <?php echo !empty($testpdomysql) ? 'checked' : '' ?>> <b>MySQL PDO</b><br>
-<input type=checkbox name="testpdosqlite" value=1 <?php echo !empty($testpdosqlite) ? 'checked' : '' ?>> <b>SQLite PDO</b><br>
-<input type=checkbox name="testpdoaccess" value=1 <?php echo !empty($testpdoaccess) ? 'checked' : '' ?>> <b>Access PDO</b><br>
-
-<td><input type=checkbox name="testdb2" value=1 <?php echo !empty($testdb2) ? 'checked' : '' ?>> DB2<br>
-<input type=checkbox name="testvfp" value=1 <?php echo !empty($testvfp) ? 'checked' : '' ?>> VFP+ODBTP<br>
-<input type=checkbox name="testado" value=1 <?php echo !empty($testado) ? 'checked' : '' ?>> ADO (for mssql and access)<br>
-<input type=checkbox name="nocountrecs" value=1 <?php echo !empty($nocountrecs) ? 'checked' : '' ?>> $ADODB_COUNTRECS=false<br>
-<input type=checkbox name="nolog" value=1 <?php echo !empty($nolog) ? 'checked' : '' ?>> No SQL Logging<br>
-<input type=checkbox name="time" value=1 <?php echo !empty($_GET['time']) ? 'checked' : '' ?>> ADOdb time test
-</table>
-<input type=submit>
-</form>
-
-<?php
-
-if ($ADODB_FETCH_MODE != ADODB_FETCH_DEFAULT) print "<h3>FETCH MODE IS NOT ADODB_FETCH_DEFAULT</h3>";
-
-if (isset($nocountrecs)) $ADODB_COUNTRECS = false;
-
-// cannot test databases below, but we include them anyway to check
-// if they parse ok...
-
-if (!strpos(PHP_VERSION,'5') === 0) {
-	ADOLoadCode("sybase");
-	//ADOLoadCode("postgres");
-	//ADOLoadCode("postgres7");
-	ADOLoadCode("firebird");
-	ADOLoadCode("borland_ibase");
-	ADOLoadCode("informix");
-	ADOLoadCode("sqlanywhere");
-//	ADOLoadCode('mysqli');
-}
-
-
-flush();
-if (!empty($testpostgres)) {
-	//ADOLoadCode("postgres");
-
-	$db = &ADONewConnection('postgres');
-	print "<h1>Connecting $db->databaseType...</h1>";
-	if ($db->Connect("localhost","tester","test","test")) {
-		testdb($db,"create table ADOXYZ (id integer, firstname char(24), lastname varchar,created date)");
-	}else
-		print "ERROR: PostgreSQL requires a database called test on server, user tester, password test.<BR>".$db->ErrorMsg();
-}
-
-if (!empty($testpgodbc)) { 
-	
-	$db = &ADONewConnection('odbc');
-	$db->hasTransactions = false;
-	print "<h1>Connecting $db->databaseType...</h1>";
-	
-	if ($db->PConnect('Postgresql')) {
-		$db->hasTransactions = true;
-		testdb($db,
-		"create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) type=innodb");
-	} else print "ERROR: PostgreSQL requires a database called test on server, user tester, password test.<BR>".$db->ErrorMsg();
-}
-
-if (!empty($testibase)) {
-	//$_GET['nolog'] = true;
-	$db = &ADONewConnection('firebird');
-	print "<h1>Connecting $db->databaseType...</h1>";
-	if ($db->PConnect("localhost:d:\\firebird\\151\\examples\\EMPLOYEE.fdb", "sysdba", "masterkey", ""))
-		testdb($db,"create table ADOXYZ (id integer, firstname char(24), lastname char(24),price numeric(12,2),created date)");
-	 else print "ERROR: Interbase test requires a database called employee.gdb".'<BR>'.$db->ErrorMsg();
-	
-}
-
-
-if (!empty($testsqlite)) {
-	$path =urlencode('d:\inetpub\adodb\sqlite.db');
-	$dsn = "sqlite://$path/";
-	$db = ADONewConnection($dsn);
-	echo $dsn;
-	
-//	$db = &ADONewConnection('sqlite');
-	print "<h1>Connecting $db->databaseType...</h1>";
-	
-	if (1)
-	//if ($db->PConnect("d:\\inetpub\\adodb\\sqlite.db", "", "", ""))
-		testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
-	else print "ERROR: SQLite";
-	
-}
-
-if (!empty($testpdopgsql)) {
-	$connstr = "pgsql:dbname=test";
-	$u = 'tester';$p='test';
-	$db = &ADONewConnection('pdo');
-	$db->hasTransactions = false;
-	print "<h1>Connecting $db->databaseType...</h1>";
-	$db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
-	testdb($db,
-		"create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-}
-
-if (!empty($testpdomysql)) {
-	$connstr = "mysql:dbname=northwind";
-	$u = 'root';$p='';
-	$db = &ADONewConnection('pdo');
-	$db->hasTransactions = false;
-	print "<h1>Connecting $db->databaseType...</h1>";
-	$db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
-	testdb($db,
-		"create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-}
-
-if (!empty($testpdosqlite)) {
-	$connstr = "sqlite:d:/inetpub/adodb/sqlite-pdo.db3";
-	$u = '';$p='';
-	$db = &ADONewConnection('pdo');
-	$db->hasTransactions = false;
-	print "<h1>Connecting $db->databaseType...</h1>";
-	$db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
-	testdb($db,
-		"create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-}
-
-if (!empty($testpdoaccess)) {
-	$connstr = 'odbc:nwind';
-	$u = '';$p='';
-	$db = &ADONewConnection('pdo');
-	$db->hasTransactions = false;
-	print "<h1>Connecting $db->databaseType...</h1>";
-	$db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
-	testdb($db,
-		"create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-}
-
-// REQUIRES ODBC DSN CALLED nwind
-if (!empty($testaccess)) {
-	$db = &ADONewConnection('access');
-	print "<h1>Connecting $db->databaseType...</h1>";
-	$access = 'd:\inetpub\wwwroot\php\NWIND.MDB';
-	$dsn = "nwind";
-	$dsn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=$access;Uid=Admin;Pwd=;";
-	
-	//$dsn =  'Provider=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=' . $access . ';';
-	if ($db->PConnect($dsn, "", "", ""))
-		testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
-	else print "ERROR: Access test requires a Windows ODBC DSN=nwind, Access driver";
-	
-}
-
-if (!empty($testaccess) && !empty($testado)) { // ADO ACCESS
-
-	$db = &ADONewConnection("ado_access");
-	print "<h1>Connecting $db->databaseType...</h1>";
-	
-	$access = 'd:\inetpub\wwwroot\php\NWIND.MDB';
-	$myDSN =  'PROVIDER=Microsoft.Jet.OLEDB.4.0;'
-		. 'DATA SOURCE=' . $access . ';';
-		//. 'USER ID=;PASSWORD=;';
-	$_GET['nolog'] = 1;
-	if ($db->PConnect($myDSN, "", "", "")) {
-		print "ADO version=".$db->_connectionID->version."<br>";
-		testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
-	} else print "ERROR: Access test requires a Access database $access".'<BR>'.$db->ErrorMsg();
-	
-}
-
-if (!empty($testvfp)) { // ODBC
-	$db = &ADONewConnection('vfp');
-	print "<h1>Connecting $db->databaseType...</h1>";flush();
-
-	if ( $db->PConnect("vfp-adoxyz")) {
-		testdb($db,"create table d:\\inetpub\\adodb\\ADOXYZ (id int, firstname char(24), lastname char(24),created date)");
-	 } else print "ERROR: Visual FoxPro test requires a Windows ODBC DSN=vfp-adoxyz, VFP driver";
-	
-	echo "<hr>";
-	$db = &ADONewConnection('odbtp');
-	
-	if ( $db->PConnect('localhost','DRIVER={Microsoft Visual FoxPro Driver};SOURCETYPE=DBF;SOURCEDB=d:\inetpub\adodb;EXCLUSIVE=NO;')) {
-	print "<h1>Connecting $db->databaseType...</h1>";flush();
-	testdb($db,"create table d:\\inetpub\\adodb\\ADOXYZ (id int, firstname char(24), lastname char(24),created date)");
-	 } else print "ERROR: Visual FoxPro odbtp requires a Windows ODBC DSN=vfp-adoxyz, VFP driver";
-	
-}
-
-
-// REQUIRES MySQL server at localhost with database 'test'
-if (!empty($testmysql)) { // MYSQL
-
-
-	if (PHP_VERSION >= 5 || $_SERVER['HTTP_HOST'] == 'localhost') $server = 'localhost';
-	else $server = "mangrove";
-	$user = 'root'; $password = ''; $database = 'northwind';
-	$db = &ADONewConnection("mysqlt://$user:$password@$server/$database?persist");
-	print "<h1>Connecting $db->databaseType...</h1>";
-	
-	if (true || $db->PConnect($server, "root", "", "northwind")) {
-		//$db->Execute("DROP TABLE ADOXYZ") || die('fail drop');
-		//$db->debug=1;$db->Execute('drop table ADOXYZ');
-		testdb($db,
-		"create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) Type=InnoDB");
-	} else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".'<BR>'.$db->ErrorMsg();
-}
-
-// REQUIRES MySQL server at localhost with database 'test'
-if (!empty($testmysqli)) { // MYSQL
-
-	$db = &ADONewConnection('mysqli');
-	print "<h1>Connecting $db->databaseType...</h1>";
-	if (PHP_VERSION >= 5 || $_SERVER['HTTP_HOST'] == 'localhost') $server = 'localhost';
-	else $server = "mangrove";
-	if ($db->PConnect($server, "root", "", "northwind")) {
-		//$db->debug=1;$db->Execute('drop table ADOXYZ');
-		testdb($db,
-		"create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
-	} else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".'<BR>'.$db->ErrorMsg();
-}
-
-
-// REQUIRES MySQL server at localhost with database 'test'
-if (!empty($testmysqlodbc)) { // MYSQL
-	
-	$db = &ADONewConnection('odbc');
-	$db->hasTransactions = false;
-	print "<h1>Connecting $db->databaseType...</h1>";
-	if ($_SERVER['HTTP_HOST'] == 'localhost') $server = 'localhost';
-	else $server = "mangrove";
-	if ($db->PConnect('mysql', "root", ""))
-		testdb($db,
-		"create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) type=innodb");
-	else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".'<BR>'.$db->ErrorMsg();
-}
-
-if (!empty($testproxy)){
-	$db = &ADONewConnection('proxy');
-	print "<h1>Connecting $db->databaseType...</h1>";
-	if ($_SERVER['HTTP_HOST'] == 'localhost') $server = 'localhost';
-
-	if ($db->PConnect('http://localhost/php/phplens/adodb/server.php'))
-		testdb($db,
-		"create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) type=innodb");
-	else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".'<BR>'.$db->ErrorMsg();
-
-}
-
-ADOLoadCode('oci805');
-ADOLoadCode("oci8po");
-if (!empty($testoracle)) {
-	$dsn = "oci8po://scott:natsoft@sherkhan?persist";
-	$db = ADONewConnection($dsn);
-	print "<h1>Connecting $db->databaseType...</h1>";
-	if (true || $db->Connect('', "scott", "natsoft",''))
-		testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
-	else print "ERROR: Oracle test requires an Oracle server setup with scott/natsoft".'<BR>'.$db->ErrorMsg();
-
-}
-ADOLoadCode("oracle"); // no longer supported
-if (false && !empty($testoracle)) { 
-	
-	$db = ADONewConnection();
-	print "<h1>Connecting $db->databaseType...</h1>";
-	if ($db->PConnect("", "scott", "tiger", "natsoft.domain"))
-		testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
-	else print "ERROR: Oracle test requires an Oracle server setup with scott/tiger".'<BR>'.$db->ErrorMsg();
-
-}
-
-ADOLoadCode("db2"); // no longer supported
-if (!empty($testdb2)) { 
-	$db = ADONewConnection();
-	print "<h1>Connecting $db->databaseType...</h1>";
-	
-	$dsn = "db2_sample";
-	$dsn = "driver={IBM db2 odbc DRIVER};Database=sample;hostname=localhost;port=50000;protocol=TCPIP; uid=root; pwd=natsoft";
-	if ($db->Connect($dsn)) {
-	//	testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
-	} else print "ERROR: DB2 test requires an server setup with odbc data source db2_sample".'<BR>'.$db->ErrorMsg();
-
-echo "<hr>";
-flush();
-	$dsn = "driver={IBM db2 odbc DRIVER};Database=sample;hostname=localhost;port=50000;protocol=TCPIP; uid=root; pwd=natsoft";
-	
-	$db = ADONewConnection('odbtp');
-	if ($db->Connect('127.0.0.1',$dsn)) {
-		
-		$db->debug=1;
-		 $arr = $db->GetArray( "||SQLProcedures" ); adodb_pr($arr);
-	     $arr = $db->GetArray( "||SQLProcedureColumns|||GET_ROUTINE_SAR" );adodb_pr($arr);
-	
-		testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
-	} else echo ("ERROR Connection");
-	echo $db->ErrorMsg();
-}
-
-
-$server = 'sherkhan';
-
-ADOLoadCode('odbc_mssql');
-if (!empty($testmssql)) { // MS SQL Server via ODBC
-	$db = ADONewConnection();
-	
-	print "<h1>Connecting $db->databaseType...</h1>";
-	
-	$dsn = "PROVIDER=MSDASQL;Driver={SQL Server};Server=$server;Database=northwind;";
-	
-	if ($db->PConnect($dsn, "adodb", "natsoft", ""))  {
-		testdb($db,"create table ADOXYZ (id int, firstname char(24) null, lastname char(24) null,created datetime null)");
-	}
-	else print "ERROR: MSSQL test 1 requires a MS SQL 7 server setup with DSN setup";
-
-}
-
-ADOLoadCode("ado_mssql");
-if (!empty($testmssql) && !empty($testado) ) { // ADO ACCESS MSSQL -- thru ODBC -- DSN-less
-	
-	$db = &ADONewConnection("ado_mssql");
-	//$db->debug=1;
-	print "<h1>Connecting DSN-less $db->databaseType...</h1>";
-	
-	$myDSN="PROVIDER=MSDASQL;DRIVER={SQL Server};"
-		. "SERVER=$server;DATABASE=NorthWind;UID=adodb;PWD=natsoft;Trusted_Connection=No";
-
-		
-	if ($db->PConnect($myDSN, "", "", ""))
-		testdb($db,"create table ADOXYZ (id int, firstname char(24) null, lastname char(24) null,created datetime null)");
-	else print "ERROR: MSSQL test 2 requires MS SQL 7";
-	
-}
-
-
-ADOLoadCode("mssqlpo");
-if (!empty($testmssql)) { // MS SQL Server -- the extension is buggy -- probably better to use ODBC
-	$db = ADONewConnection("mssqlpo");
-	//$db->debug=1;
-	print "<h1>Connecting $db->databaseType...</h1>";
-	
-	$ok = $db->Connect('','adodb','natsoft','northwind');
-
-	if ($ok or $db->PConnect("mangrove", "sa", "natsoft", "ai")) {
-		AutoDetect_MSSQL_Date_Order($db);
-	//	$db->Execute('drop table adoxyz');
-		testdb($db,"create table ADOXYZ (id int, firstname char(24) null, lastname char(24) null,created datetime null)");
-	} else print "ERROR: MSSQL test 2 requires a MS SQL 7 on a server='192.168.0.1', userid='adodb', password='natsoft', database='ai'".'<BR>'.$db->ErrorMsg();
-	
-}
-
-if (!empty($testmssql) && !empty($testado)) { // ADO ACCESS MSSQL with OLEDB provider
-
-	$db = &ADONewConnection("ado_mssql");
-	print "<h1>Connecting DSN-less OLEDB Provider $db->databaseType...</h1>";
-	//$db->debug=1;
-	$myDSN="SERVER=localhost;DATABASE=northwind;Trusted_Connection=yes";
-	if ($db->PConnect($myDSN, "adodb", "natsoft", 'SQLOLEDB')) {
-		testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
-	} else print "ERROR: MSSQL test 2 requires a MS SQL 7 on a server='mangrove', userid='sa', password='', database='ai'";
-
-}
-
-
-if (extension_loaded('odbtp') && !empty($testmssql)) { // MS SQL Server via ODBC
-	$db = ADONewConnection('odbtp');
-	
-	$dsn = "PROVIDER=MSDASQL;Driver={SQL Server};Server=$server;Database=northwind;uid=adodb;pwd=natsoft";
-	
-	if ($db->PConnect('localhost',$dsn, "", ""))  {
-		print "<h1>Connecting $db->databaseType...</h1>";				
-		testdb($db,"create table ADOXYZ (id int, firstname char(24) null, lastname char(24) null,created datetime null)");
-	}
-	else print "ERROR: MSSQL test 1 requires a MS SQL 7 server setup with DSN setup";
-
-}
-
-
-print "<h3>Tests Completed</h3>";
-
-?>

Copied: plog/trunk/class/database/adodb/tests/testdatabases.inc.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/testdatabases.inc.php)

Deleted: plog/trunk/class/database/adodb/tests/testgenid.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/testgenid.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/testgenid.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,36 +0,0 @@
-<?php
-/*
-	V4.50 6 July 2004 
-	
-	Run multiple copies of this php script at the same time
-	to test unique generation of id's in multiuser mode
-*/
-include_once('../adodb.inc.php');
-$testaccess = true;
-include_once('testdatabases.inc.php');
-
-function testdb(&$db,$createtab="create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)")
-{
-	$table = 'adodbseq';
-	
-	$db->Execute("drop table $table");
-	//$db->debug=true;
-	
-	$ctr = 5000;
-	$lastnum = 0;
-	
-	while (--$ctr >= 0) {
-		$num = $db->GenID($table);
-		if ($num === false) {	
-			print "GenID returned false";
-			break;
-		}
-		if ($lastnum + 1 == $num) print " $num ";
-		else {
-			print " <font color=red>$num</font> ";
-			flush();
-		}
-		$lastnum = $num;
-	}
-}
-?>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/tests/testgenid.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/testgenid.php)

Deleted: plog/trunk/class/database/adodb/tests/testmssql.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/testmssql.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/testmssql.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,76 +0,0 @@
-<?php
-
-/** 
- * @version V4.50 6 July 2004 (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
- * Released under both BSD license and Lesser GPL library license. 
- * Whenever there is any discrepancy between the two licenses, 
- * the BSD license will take precedence. 
- *
- * Set tabs to 4 for best viewing.
- * 
- * Latest version is available at http://php.weblogs.com
- *
- * Test GetUpdateSQL and GetInsertSQL.
- */
- 
-error_reporting(E_ALL);
-
-
-include('../adodb.inc.php');
-include('../tohtml.inc.php');
-
-//==========================
-// This code tests an insert
-
-
-
-$conn = &ADONewConnection("mssql");  // create a connection
-$conn->Connect('127.0.0.1','adodb','natsoft','northwind') or die('Fail');
-
-$conn->debug =1;
-$query = 'select * from products';
-$conn->SetFetchMode(ADODB_FETCH_ASSOC);
-$rs = $conn->Execute($query);
-echo "<pre>";
-while( !$rs->EOF ) {
-	$output[] = $rs->fields;
-	var_dump($rs->fields);
-	$rs->MoveNext();
-	print "<p>";
-}
-die();
-
-
-$p = $conn->Prepare('insert into products (productname,unitprice,dcreated) values (?,?,?)');
-echo "<pre>";
-print_r($p);
-
-$conn->debug=1;
-$conn->Execute($p,array('John'.rand(),33.3,$conn->DBDate(time())));
-
-$p = $conn->Prepare('select * from products where productname like ?');
-$arr = $conn->getarray($p,array('V%'));
-print_r($arr);
-die();
-
-//$conn = &ADONewConnection("mssql");
-//$conn->Connect('mangrove','sa','natsoft','ai');
-
-//$conn->Connect('mangrove','sa','natsoft','ai');
-$conn->debug=1;
-$conn->Execute('delete from blobtest');
-
-$conn->Execute('insert into blobtest (id) values(1)');
-$conn->UpdateBlobFile('blobtest','b1','../cute_icons_for_site/adodb.gif','id=1');
-$rs = $conn->Execute('select b1 from blobtest where id=1');
-
-$output = "c:\\temp\\test_out-".date('H-i-s').".gif"; 
-print "Saving file <b>$output</b>, size=".strlen($rs->fields[0])."<p>";
-$fd = fopen($output, "wb"); 
-fwrite($fd, $rs->fields[0]); 
-fclose($fd); 
-
-print " <a href=file://$output>View Image</a>";
-//$rs = $conn->Execute('SELECT id,SUBSTRING(b1, 1, 10) FROM blobtest');
-//rs2html($rs);
-?>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/tests/testmssql.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/testmssql.php)

Deleted: plog/trunk/class/database/adodb/tests/testoci8.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/testoci8.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/testoci8.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,83 +0,0 @@
-<html>
-<body>
-<?php
-/* 
-V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
-  Released under both BSD license and Lesser GPL library license. 
-  Whenever there is any discrepancy between the two licenses, 
-  the BSD license will take precedence. 
-  Set tabs to 4 for best viewing.
-	
-  Latest version is available at http://adodb.sourceforge.net
-*/
-error_reporting(63);
-include("../adodb.inc.php");
-include("../tohtml.inc.php");
-
-if (0) {
-	$db = ADONewConnection('oci8po');
-	
-	$db->PConnect('','scott','natsoft');
-	if (!empty($testblob)) {
-		$varHoldingBlob = 'ABC DEF GEF John TEST';
-		$num = time()%10240;
-		// create table atable (id integer, ablob blob);
-		$db->Execute('insert into ATABLE (id,ablob) values('.$num.',empty_blob())');
-		$db->UpdateBlob('ATABLE', 'ablob', $varHoldingBlob, 'id='.$num, 'BLOB');
-		
-		$rs = &$db->Execute('select * from atable');
-		
-		if (!$rs) die("Empty RS");
-		if ($rs->EOF) die("EOF RS");
-		rs2html($rs);
-	}
-	$stmt = $db->Prepare('select * from adoxyz where id=?');
-	for ($i = 1; $i <= 10; $i++) {
-	$rs = &$db->Execute(
-		$stmt,
-		array($i));
-			
-		if (!$rs) die("Empty RS");
-		if ($rs->EOF) die("EOF RS");
-		rs2html($rs);
-	}
-}
-if (1) {
-	$db = ADONewConnection('oci8');
-	$db->PConnect('','scott','natsoft');
-	$db->debug = true;
-	$db->Execute("delete from emp where ename='John'");
-	print $db->Affected_Rows().'<BR>';
-	$stmt = &$db->Prepare('insert into emp (empno, ename) values (:empno, :ename)');
-	$rs = $db->Execute($stmt,array('empno'=>4321,'ename'=>'John'));
-	// prepare not quite ready for prime time
-	//$rs = $db->Execute($stmt,array('empno'=>3775,'ename'=>'John'));
-	if (!$rs) die("Empty RS");
-	
-	$db->setfetchmode(ADODB_FETCH_NUM);
-	
-	$vv = 'A%';
-	$stmt = $db->PrepareSP("BEGIN adodb.open_tab2(:rs,:tt); END;",true);
-	$db->OutParameter($stmt, $cur, 'rs', -1, OCI_B_CURSOR);
-	$db->OutParameter($stmt, $vv, 'tt');
-	$rs = $db->Execute($stmt);
-	while (!$rs->EOF) {
-		adodb_pr($rs->fields);
-		$rs->MoveNext();
-	}
-	echo " val = $vv";
-
-}
-
-if (0) {
-	$db = ADONewConnection('odbc_oracle');
-	if (!$db->PConnect('local_oracle','scott','tiger')) die('fail connect');
-	$db->debug = true;
-	$rs = &$db->Execute(
-		'select * from adoxyz where firstname=? and trim(lastname)=?',
-		array('first'=>'Caroline','last'=>'Miranda'));
-	if (!$rs) die("Empty RS");
-	if ($rs->EOF) die("EOF RS");
-	rs2html($rs);
-}
-?>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/tests/testoci8.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/testoci8.php)

Deleted: plog/trunk/class/database/adodb/tests/testoci8cursor.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/testoci8cursor.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/testoci8cursor.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,111 +0,0 @@
-<?php
-/* 
-V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
-  Released under both BSD license and Lesser GPL library license. 
-  Whenever there is any discrepancy between the two licenses, 
-  the BSD license will take precedence. 
-  Set tabs to 4 for best viewing.
-	
-  Latest version is available at http://adodb.sourceforge.net
-*/
-
-/*
-	Test for Oracle Variable Cursors, which are treated as ADOdb recordsets.
-	
-	We have 2 examples. The first shows us using the Parameter statement. 
-	The second shows us using the new ExecuteCursor($sql, $cursorName)
-	function.
-	
-------------------------------------------------------------------
--- TEST PACKAGE YOU NEED TO INSTALL ON ORACLE - run from sql*plus
-------------------------------------------------------------------
-
-
--- TEST PACKAGE
-CREATE OR REPLACE PACKAGE adodb AS
-TYPE TabType IS REF CURSOR RETURN tab%ROWTYPE;
-PROCEDURE open_tab (tabcursor IN OUT TabType,tablenames in varchar);
-PROCEDURE data_out(input IN varchar, output OUT varchar); 
-
-procedure myproc (p1 in number, p2 out number);
-END adodb;
-/
-
-CREATE OR REPLACE PACKAGE BODY adodb AS
-PROCEDURE open_tab (tabcursor IN OUT TabType,tablenames in varchar) IS
-	BEGIN
-		OPEN tabcursor FOR SELECT * FROM tab where tname like tablenames;
-	END open_tab;
-	
-PROCEDURE data_out(input IN varchar, output OUT varchar) IS
-	BEGIN
-		output := 'Cinta Hati '||input;
-	END;
-	
-procedure myproc (p1 in number, p2 out number) as
-begin
-p2 := p1;
-end;
-END adodb;
-/
-
-------------------------------------------------------------------
--- END PACKAGE
-------------------------------------------------------------------
-
-*/
-
-include('../adodb.inc.php');
-include('../tohtml.inc.php');
-
-	error_reporting(E_ALL);
-	$db = ADONewConnection('oci8');
-	$db->PConnect('','scott','natsoft');
-	$db->debug = 99;
-
-
-/*
-*/
-
-	define('MYNUM',5);
-	
-
-	$rs = $db->ExecuteCursor("BEGIN adodb.open_tab(:RS,'A%'); END;");
-	
-	if ($rs && !$rs->EOF) {
-		print "Test 1 RowCount: ".$rs->RecordCount()."<p>";
-	} else {
-		print "<b>Error in using Cursor Variables 1</b><p>";
-	}
-	
-	print "<h4>Testing Stored Procedures for oci8</h4>";
-	
-	$stid = $db->PrepareSP('BEGIN adodb.myproc('.MYNUM.', :myov); END;');
-	$db->OutParameter($stid, $myov, 'myov');
-	$db->Execute($stid);
-	if ($myov != MYNUM) print "<p><b>Error with myproc</b></p>";
-	
-	
-	$stmt = $db->PrepareSP("BEGIN adodb.data_out(:a1, :a2); END;",true);
-	$a1 = 'Malaysia';
-	//$a2 = ''; # a2 doesn't even need to be defined!
-	$db->InParameter($stmt,$a1,'a1');
-	$db->OutParameter($stmt,$a2,'a2');
-	$rs = $db->Execute($stmt);
-	if ($rs) {
-		if ($a2 !== 'Cinta Hati Malaysia') print "<b>Stored Procedure Error: a2 = $a2</b><p>";
-		else echo  "OK: a2=$a2<p>";
-	} else {
-		print "<b>Error in using Stored Procedure IN/Out Variables</b><p>";
-	}
-	
-	
-	$tname = 'A%';
-	
-	$stmt = $db->PrepareSP('select * from tab where tname like :tablename');
-	$db->Parameter($stmt,$tname,'tablename');
-	$rs = $db->Execute($stmt);
-	rs2html($rs);
-		
-		
-?>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/tests/testoci8cursor.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/testoci8cursor.php)

Deleted: plog/trunk/class/database/adodb/tests/testpaging.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/testpaging.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/testpaging.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,83 +0,0 @@
-<?php
-/* 
-V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
-  Released under both BSD license and Lesser GPL library license. 
-  Whenever there is any discrepancy between the two licenses, 
-  the BSD license will take precedence. 
-  Set tabs to 4 for best viewing.
-	
-  Latest version is available at http://adodb.sourceforge.net
-*/
-
-error_reporting(E_ALL);
-
-
-include_once('../adodb.inc.php');
-include_once('../adodb-pager.inc.php');
-
-$driver = 'oci8';
-$sql = 'select  ID, firstname as "First Name", lastname as "Last Name" from adoxyz  order  by  id';
-//$sql = 'select count(*),firstname from adoxyz group by firstname order by 2 ';
-$sql = 'select distinct firstname, lastname from adoxyz  order  by  firstname';
-
-if ($driver == 'postgres') {
-	$db = NewADOConnection('postgres');
-	$db->PConnect('localhost','tester','test','test');
-}
-
-if ($driver == 'access') {
-	$db = NewADOConnection('access');
-	$db->PConnect("nwind", "", "", "");
-}
-
-if ($driver == 'ibase') {
-	$db = NewADOConnection('ibase');
-	$db->PConnect("localhost:e:\\firebird\\examples\\employee.gdb", "sysdba", "masterkey", "");
-	$sql = 'select distinct firstname, lastname  from adoxyz  order  by  firstname';
-
-}
-if ($driver == 'mssql') {
-	$db = NewADOConnection('mssql');
-	$db->Connect('JAGUAR\vsdotnet','adodb','natsoft','northwind');
-}
-if ($driver == 'oci8') {
-	$db = NewADOConnection('oci8');
-	$db->Connect('','scott','natsoft');
-}
-
-if ($driver == 'access') {
-	$db = NewADOConnection('access');
-	$db->Connect('nwind');
-}
-
-if (empty($driver) or $driver == 'mysql') {
-	$db = NewADOConnection('mysql');
-	$db->Connect('localhost','root','','xphplens');
-}
-
-//$db->pageExecuteCountRows = false;
-
-$db->debug = true;
-
-if (0) {
-$rs = &$db->Execute($sql);
-include_once('../toexport.inc.php');
-print "<pre>";
-print rs2csv($rs); # return a string
-
-print '<hr>';
-$rs->MoveFirst(); # note, some databases do not support MoveFirst
-print rs2tab($rs); # return a string
-
-print '<hr>';
-$rs->MoveFirst();
-rs2tabout($rs); # send to stdout directly
-print "</pre>";
-}
-
-$pager = new ADODB_Pager($db,$sql);
-$pager->showPageLinks = true;
-$pager->linksPerPage = 3;
-$pager->cache = 60;
-$pager->Render($rows=7);
-?>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/tests/testpaging.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/testpaging.php)

Deleted: plog/trunk/class/database/adodb/tests/testpear.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/testpear.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/testpear.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,34 +0,0 @@
-<?php
-/* 
-V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
-  Released under both BSD license and Lesser GPL library license. 
-  Whenever there is any discrepancy between the two licenses, 
-  the BSD license will take precedence. 
-  Set tabs to 4 for best viewing.
-	
-  Latest version is available at http://adodb.sourceforge.net
-*/
-
-error_reporting(E_ALL);
-
-include_once('../adodb-pear.inc.php');
-$username = 'root';
-$password = '';
-$hostname = 'localhost';
-$databasename = 'xphplens';
-$driver = 'mysql';
-
-$dsn = "$driver://$username:$password@$hostname/$databasename";
-
-$db = DB::Connect($dsn);
-$db->setFetchMode(ADODB_FETCH_ASSOC);
-$rs = $db->Query('select firstname,lastname from adoxyz');
-$cnt = 0;
-while ($arr = $rs->FetchRow()) {
-	print_r($arr);
-	print "<br>";
-	$cnt += 1;
-}
-
-if ($cnt != 50) print "<b>Error in \$cnt = $cnt</b>";
-?>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/tests/testpear.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/testpear.php)

Deleted: plog/trunk/class/database/adodb/tests/testsessions.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/testsessions.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/testsessions.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,81 +0,0 @@
-<?php
-
-/* 
-V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
-  Released under both BSD license and Lesser GPL library license. 
-  Whenever there is any discrepancy between the two licenses, 
-  the BSD license will take precedence. 
-  Set tabs to 4 for best viewing.
-	
-  Latest version is available at http://adodb.sourceforge.net
-*/
-
-function NotifyExpire($ref,$key)
-{
-	print "<p><b>Notify Expiring=$ref, sessionkey=$key</b></p>";
-}
-
-//-------------------------------------------------------------------
-	
-	
-#### CONNECTION
-if (0) {
-	$ADODB_SESSION_DRIVER='oci8';
-	$ADODB_SESSION_CONNECT='';
-	$ADODB_SESSION_USER ='scott';
-	$ADODB_SESSION_PWD ='natsoft';
-	$ADODB_SESSION_DB ='';
-} else {
-	$ADODB_SESSION_DRIVER='mysql';
-	$ADODB_SESSION_CONNECT='localhost';
-	$ADODB_SESSION_USER ='root';
-	$ADODB_SESSION_PWD ='';
-	$ADODB_SESSION_DB ='xphplens_2';
-}
-	
-### TURN DEBUGGING ON
-	$ADODB_SESS_DEBUG = 99;
-
-	
-#### SETUP NOTIFICATION
-	$USER = 'JLIM'.rand();
-	$ADODB_SESSION_EXPIRE_NOTIFY = array('USER','NotifyExpire');
-
-	
-#### INIT
-	ob_start();
-	error_reporting(E_ALL);
-	include('../session/adodb-cryptsession.php');
-	session_start();
-
-	adodb_session_regenerate_id();
-	
-### SETUP SESSION VARIABLES 
-	$_SESSION['MONKEY'] = array('1','abc',44.41);
-	if (!isset($_GET['nochange'])) @$_SESSION['AVAR'] += 1;
-
-	
-### START DISPLAY
-	print "<h3>PHP ".PHP_VERSION."</h3>";
-	print "<p><b>\$_SESSION['AVAR']={$_SESSION['AVAR']}</b></p>";
-	
-	print "<hr> <b>Cookies</b>: ";
-	print_r($_COOKIE);
-	
-### RANDOMLY PERFORM Garbage Collection
-### In real-production environment, this is done for you
-### by php's session extension, which calls adodb_sess_gc()
-### automatically for you. See php.ini's
-### session.cookie_lifetime and session.gc_probability
-
-	if (rand() % 5 == 0) {
-	
-		print "<hr><p><b>Garbage Collection</b></p>";
-		adodb_sess_gc(10);
-		
-		if (rand() % 2 == 0) {
-			print "<p>Random session destroy</p>";
-			session_destroy();
-		}
-	}
-?>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/tests/testsessions.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/testsessions.php)

Deleted: plog/trunk/class/database/adodb/tests/time.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/time.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/time.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,17 +0,0 @@
-<?php
-
-include_once('../adodb-time.inc.php');
-//adodb_date_test();
-?>
-<?php 
-//require("adodb-time.inc.php"); 
-
-$datestring = "1963-12-04"; // string normally from mySQL 
-$stringArray = explode("-", $datestring);
-$date = adodb_mktime(0,0,0,$stringArray[1],$stringArray[2],$stringArray[0]); 
-
-$convertedDate = date("d-M-Y", $date); // converted string to UK style date
-
-echo( "Birthday: $convertedDate" ); //why is string returned as one day (3 not 4) less for this example??
-
-?>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/tests/time.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/time.php)

Deleted: plog/trunk/class/database/adodb/tests/tmssql.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/tmssql.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/tmssql.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,65 +0,0 @@
-<?php
-error_reporting(E_ALL);
-ini_set('mssql.datetimeconvert',0); 
-
-function tmssql()
-{
-	print "<h3>mssql</h3>";
-	$db = mssql_connect('JAGUAR\vsdotnet','adodb','natsoft') or die('No Connection');
-	mssql_select_db('northwind',$db);
-	
-	$rs = mssql_query('select getdate() as date',$db);
-	$o = mssql_fetch_row($rs);
-	print_r($o);
-	mssql_free_result($rs);
-	
-	print "<p>Delete</p>"; flush();
-	$rs2 = mssql_query('delete from adoxyz',$db);
-	$p = mssql_num_rows($rs2);
-	mssql_free_result($rs2);
-
-}
-
-function tpear()
-{
-include_once('DB.php');
-
-	print "<h3>PEAR</h3>";
-	$username = 'adodb';
-	$password = 'natsoft';
-	$hostname = 'JAGUAR\vsdotnet';
-	$databasename = 'northwind';
-	
-	$dsn = "mssql://$username:$password@$hostname/$databasename";
-	$conn = &DB::connect($dsn);
-	print "date=".$conn->GetOne('select getdate()')."<br>";
-	@$conn->query('create table tester (id integer)');
-	print "<p>Delete</p>"; flush();
-	$rs = $conn->query('delete from tester');
-	print "date=".$conn->GetOne('select getdate()')."<br>";
-}
-
-function tadodb()
-{
-include_once('../adodb.inc.php');
-
-	print "<h3>ADOdb</h3>";
-	$conn = NewADOConnection('mssql');
-	$conn->Connect('JAGUAR\vsdotnet','adodb','natsoft','northwind');
-//	$conn->debug=1;
-	print "date=".$conn->GetOne('select getdate()')."<br>";
-	$conn->Execute('create table tester (id integer)');
-	print "<p>Delete</p>"; flush();
-	$rs = $conn->Execute('delete from tester');
-	print "date=".$conn->GetOne('select getdate()')."<br>";
-}
-?>
-<a href=tmssql.php?do=tmssql>mssql</a>
-<a href=tmssql.php?do=tpear>pear</a>
-<a href=tmssql.php?do=tadodb>adodb</a>
-<?php
-if (!empty($_GET['do'])) {
-	$do = $_GET['do'];
-	$do();
-}
-?>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/tests/tmssql.php (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/tmssql.php)

Deleted: plog/trunk/class/database/adodb/tests/xmlschema.xml
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/xmlschema.xml	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/tests/xmlschema.xml	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,33 +0,0 @@
-<?xml version="1.0"?>
-<schema version="0.2">
-  <table name="mytable">
-    <field name="row1" type="I">
-      <descr>An integer row that's a primary key and autoincrements</descr>
-      <KEY/>
-      <AUTOINCREMENT/>
-    </field>
-    <field name="row2" type="C" size="16">
-      <descr>A 16 character varchar row that can't be null</descr>
-      <NOTNULL/>
-    </field>
-    <index name="myindex">
-      <col>row1</col>
-      <col>row2</col>
-    </index>
-  </table>
-  <sql>
-    <descr>SQL to be executed only on specific platforms</descr>
-    <query platform="postgres|postgres7">
-      insert into mytable ( row1, row2 ) values ( 12, 'postgres stuff' )
-    </query>
-    <query platform="mysql">
-      insert into mytable ( row1, row2 ) values ( 12, 'mysql stuff' )
-    </query>
-	<query platform="mssql">
-      insert into mytable ( row1, row2 ) values ( 12, 'Microsoft stuff' )
-    </query>
-  </sql>
-  <table name="obsoletetable">
-    <DROP/>
-  </table>
-</schema>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/tests/xmlschema.xml (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/tests/xmlschema.xml)

Modified: plog/trunk/class/database/adodb/toexport.inc.php
===================================================================
--- plog/trunk/class/database/adodb/toexport.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/toexport.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 
 /** 
- * @version V4.54 5 Nov 2004 (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+ * @version V4.62 2 Apr 2005 (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
  * Released under both BSD license and Lesser GPL library license. 
  * Whenever there is any discrepancy between the two licenses, 
  * the BSD license will take precedence. 
@@ -77,7 +77,7 @@
 			
 			$v = $o->name;
 			if ($escquote) $v = str_replace($quote,$escquotequote,$v);
-			$v = strip_tags(str_replace("\n",$replaceNewLine,str_replace($sep,$sepreplace,$v)));
+			$v = strip_tags(str_replace("\n", $replaceNewLine, str_replace("\r\n",$replaceNewLine,str_replace($sep,$sepreplace,$v))));
 			$elements[] = $v;
 			
 		}
@@ -98,7 +98,7 @@
 				if (!is_object($v)) $v = trim($v);
 				else $v = 'Object';
 				if ($escquote) $v = str_replace($quote,$escquotequote,$v);
-				$v = strip_tags(str_replace("\n",$replaceNewLine,str_replace($sep,$sepreplace,$v)));
+				$v = strip_tags(str_replace("\n", $replaceNewLine, str_replace("\r\n",$replaceNewLine,str_replace($sep,$sepreplace,$v))));
 				
 				if (strpos($v,$sep) !== false || strpos($v,$quote) !== false) $elements[] = "$quote$v$quote";
 				else $elements[] = $v;
@@ -106,7 +106,7 @@
 		} else { // ASSOCIATIVE ARRAY
 			foreach($rs->fields as $v) {
 				if ($escquote) $v = str_replace($quote,$escquotequote,trim($v));
-				$v = strip_tags(str_replace("\n",$replaceNewLine,str_replace($sep,$sepreplace,$v)));
+				$v = strip_tags(str_replace("\n", $replaceNewLine, str_replace("\r\n",$replaceNewLine,str_replace($sep,$sepreplace,$v))));
 				
 				if (strpos($v,$sep) !== false || strpos($v,$quote) !== false) $elements[] = "$quote$v$quote";
 				else $elements[] = $v;

Modified: plog/trunk/class/database/adodb/tohtml.inc.php
===================================================================
--- plog/trunk/class/database/adodb/tohtml.inc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/database/adodb/tohtml.inc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php 
 /*
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
   the BSD license will take precedence.

Copied: plog/trunk/class/database/adodb/xsl (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/xsl)

Deleted: plog/trunk/class/database/adodb/xsl/convert-0.1-0.2.xsl
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/xsl/convert-0.1-0.2.xsl	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/xsl/convert-0.1-0.2.xsl	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,205 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
->
-	<xsl:output method="xml" indent="yes" omit-xml-declaration="no" encoding="UTF-8"/>
-	
-	<!-- Schema -->
-	<xsl:template match="/">
-		<xsl:comment>
-ADODB XMLSchema
-http://adodb-xmlschema.sourceforge.net
-</xsl:comment>
-		
-		<xsl:element name="schema">
-			<xsl:attribute name="version">0.2</xsl:attribute>
-			
-			<xsl:apply-templates select="schema/table|schema/sql"/>
-		</xsl:element>
-	</xsl:template>
-	
-	<!-- Table -->
-	<xsl:template match="table">
-		<xsl:variable name="table_name" select="@name"/>
-		
-		<xsl:element name="table">
-			<xsl:attribute name="name"><xsl:value-of select="$table_name"/></xsl:attribute>
-			
-			<xsl:if test="string-length(@platform) > 0">
-				<xsl:attribute name="platform"><xsl:value-of select="@platform"/></xsl:attribute>
-			</xsl:if>
-			
-			<xsl:if test="string-length(@version) > 0">
-				<xsl:attribute name="version"><xsl:value-of select="@version"/></xsl:attribute>
-			</xsl:if>
-			
-			<xsl:apply-templates select="descr[1]"/>
-			
-			<xsl:choose>
-				<xsl:when test="count(DROP) > 0">
-					<xsl:element name="DROP"/>
-				</xsl:when>
-				<xsl:otherwise>
-					<xsl:apply-templates select="field"/>
-				</xsl:otherwise>
-			</xsl:choose>
-			
-			<xsl:apply-templates select="constraint"/>
-			
-			<xsl:apply-templates select="../index[@table=$table_name]"/>
-		</xsl:element>
-	</xsl:template>
-	
-	<!-- Field -->
-	<xsl:template match="field">
-		<xsl:element name="field">
-			<xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
-			<xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute>
-			
-			<xsl:if test="string-length(@size) > 0">
-				<xsl:attribute name="size"><xsl:value-of select="@size"/></xsl:attribute>
-			</xsl:if>
-			
-			<xsl:choose>
-				<xsl:when test="count(PRIMARY) > 0">
-					<xsl:element name="PRIMARY"/>
-				</xsl:when>
-				<xsl:when test="count(KEY) > 0">
-					<xsl:element name="KEY"/>
-				</xsl:when>
-				<xsl:when test="count(NOTNULL) > 0">
-					<xsl:element name="NOTNULL"/>
-				</xsl:when>
-			</xsl:choose>
-			
-			<xsl:choose>
-				<xsl:when test="count(AUTO) > 0">
-					<xsl:element name="AUTO"/>
-				</xsl:when>
-				<xsl:when test="count(AUTOINCREMENT) > 0">
-					<xsl:element name="AUTOINCREMENT"/>
-				</xsl:when>
-			</xsl:choose>
-			
-			<xsl:choose>
-				<xsl:when test="count(DEFAULT) > 0">
-					<xsl:element name="DEFAULT">
-						<xsl:attribute name="value">
-							<xsl:value-of select="DEFAULT[1]/@value"/>
-						</xsl:attribute>
-					</xsl:element>
-				</xsl:when>
-				<xsl:when test="count(DEFDATE) > 0">
-					<xsl:element name="DEFDATE">
-						<xsl:attribute name="value">
-							<xsl:value-of select="DEFDATE[1]/@value"/>
-						</xsl:attribute>
-					</xsl:element>
-				</xsl:when>
-				<xsl:when test="count(DEFTIMESTAMP) > 0">
-					<xsl:element name="DEFDTIMESTAMP">
-						<xsl:attribute name="value">
-							<xsl:value-of select="DEFTIMESTAMP[1]/@value"/>
-						</xsl:attribute>
-					</xsl:element>
-				</xsl:when>
-			</xsl:choose>
-			
-			<xsl:if test="count(NOQUOTE) > 0">
-				<xsl:element name="NOQUOTE"/>
-			</xsl:if>
-			
-			<xsl:apply-templates select="constraint"/>
-		</xsl:element>
-	</xsl:template>
-	
-	<!-- Constraint -->
-	<xsl:template match="constraint">
-		<xsl:element name="constraint">
-			<xsl:value-of select="normalize-space(text())"/>
-		</xsl:element>
-	</xsl:template>
-	
-	<!-- Index -->
-	<xsl:template match="index">
-		<xsl:element name="index">
-			<xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
-			
-			<xsl:apply-templates select="descr[1]"/>
-			
-			<xsl:if test="count(CLUSTERED) > 0">
-				<xsl:element name="CLUSTERED"/>
-			</xsl:if>
-			
-			<xsl:if test="count(BITMAP) > 0">
-				<xsl:element name="BITMAP"/>
-			</xsl:if>
-			
-			<xsl:if test="count(UNIQUE) > 0">
-				<xsl:element name="UNIQUE"/>
-			</xsl:if>
-			
-			<xsl:if test="count(FULLTEXT) > 0">
-				<xsl:element name="FULLTEXT"/>
-			</xsl:if>
-			
-			<xsl:if test="count(HASH) > 0">
-				<xsl:element name="HASH"/>
-			</xsl:if>
-			
-			<xsl:choose>
-				<xsl:when test="count(DROP) > 0">
-					<xsl:element name="DROP"/>
-				</xsl:when>
-				<xsl:otherwise>
-					<xsl:apply-templates select="col"/>
-				</xsl:otherwise>
-			</xsl:choose>
-		</xsl:element>
-	</xsl:template>
-	
-	<!-- Index Column -->
-	<xsl:template match="col">
-		<xsl:element name="col">
-			<xsl:value-of select="normalize-space(text())"/>
-		</xsl:element>
-	</xsl:template>
-	
-	<!-- SQL QuerySet -->
-	<xsl:template match="sql">
-		<xsl:element name="sql">
-			<xsl:if test="string-length(@platform) > 0">
-				<xsl:attribute name="platform"><xsl:value-of select="@platform"/></xsl:attribute>
-			</xsl:if>
-			
-			<xsl:if test="string-length(@key) > 0">
-				<xsl:attribute name="key"><xsl:value-of select="@key"/></xsl:attribute>
-			</xsl:if>
-			
-			<xsl:if test="string-length(@prefixmethod) > 0">
-				<xsl:attribute name="prefixmethod"><xsl:value-of select="@prefixmethod"/></xsl:attribute>
-			</xsl:if>
-			
-			<xsl:apply-templates select="descr[1]"/>
-			<xsl:apply-templates select="query"/>
-		</xsl:element>
-	</xsl:template>
-	
-	<!-- Query -->
-	<xsl:template match="query">
-		<xsl:element name="query">
-			<xsl:if test="string-length(@platform) > 0">
-				<xsl:attribute name="platform"><xsl:value-of select="@platform"/></xsl:attribute>
-			</xsl:if>
-			
-			<xsl:value-of select="normalize-space(text())"/>
-		</xsl:element>
-	</xsl:template>
-	
-	<!-- Description -->
-	<xsl:template match="descr">
-		<xsl:element name="descr">
-			<xsl:value-of select="normalize-space(text())"/>
-		</xsl:element>
-	</xsl:template>
-</xsl:stylesheet>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/xsl/convert-0.1-0.2.xsl (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/xsl/convert-0.1-0.2.xsl)

Deleted: plog/trunk/class/database/adodb/xsl/convert-0.2-0.1.xsl
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/xsl/convert-0.2-0.1.xsl	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/xsl/convert-0.2-0.1.xsl	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,207 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
->
-	<xsl:output method="xml" indent="yes" omit-xml-declaration="no" encoding="UTF-8"/>
-	
-	<!-- Schema -->
-	<xsl:template match="/">
-		<xsl:comment>
-ADODB XMLSchema
-http://adodb-xmlschema.sourceforge.net
-</xsl:comment>
-		
-		<xsl:element name="schema">
-			<xsl:attribute name="version">0.1</xsl:attribute>
-			
-			<xsl:apply-templates select="schema/table|schema/sql"/>
-		</xsl:element>
-	</xsl:template>
-	
-	<!-- Table -->
-	<xsl:template match="table">
-		<xsl:variable name="table_name" select="@name"/>
-		
-		<xsl:element name="table">
-			<xsl:attribute name="name"><xsl:value-of select="$table_name"/></xsl:attribute>
-			
-			<xsl:if test="string-length(@platform) > 0">
-				<xsl:attribute name="platform"><xsl:value-of select="@platform"/></xsl:attribute>
-			</xsl:if>
-			
-			<xsl:if test="string-length(@version) > 0">
-				<xsl:attribute name="version"><xsl:value-of select="@version"/></xsl:attribute>
-			</xsl:if>
-			
-			<xsl:apply-templates select="descr[1]"/>
-			
-			<xsl:choose>
-				<xsl:when test="count(DROP) > 0">
-					<xsl:element name="DROP"/>
-				</xsl:when>
-				<xsl:otherwise>
-					<xsl:apply-templates select="field"/>
-				</xsl:otherwise>
-			</xsl:choose>
-			
-			<xsl:apply-templates select="constraint"/>
-			
-		</xsl:element>
-		
-		<xsl:apply-templates select="index"/>
-	</xsl:template>
-	
-	<!-- Field -->
-	<xsl:template match="field">
-		<xsl:element name="field">
-			<xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
-			<xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute>
-			
-			<xsl:if test="string-length(@size) > 0">
-				<xsl:attribute name="size"><xsl:value-of select="@size"/></xsl:attribute>
-			</xsl:if>
-			
-			<xsl:choose>
-				<xsl:when test="count(PRIMARY) > 0">
-					<xsl:element name="PRIMARY"/>
-				</xsl:when>
-				<xsl:when test="count(KEY) > 0">
-					<xsl:element name="KEY"/>
-				</xsl:when>
-				<xsl:when test="count(NOTNULL) > 0">
-					<xsl:element name="NOTNULL"/>
-				</xsl:when>
-			</xsl:choose>
-			
-			<xsl:choose>
-				<xsl:when test="count(AUTO) > 0">
-					<xsl:element name="AUTO"/>
-				</xsl:when>
-				<xsl:when test="count(AUTOINCREMENT) > 0">
-					<xsl:element name="AUTOINCREMENT"/>
-				</xsl:when>
-			</xsl:choose>
-			
-			<xsl:choose>
-				<xsl:when test="count(DEFAULT) > 0">
-					<xsl:element name="DEFAULT">
-						<xsl:attribute name="value">
-							<xsl:value-of select="DEFAULT[1]/@value"/>
-						</xsl:attribute>
-					</xsl:element>
-				</xsl:when>
-				<xsl:when test="count(DEFDATE) > 0">
-					<xsl:element name="DEFDATE">
-						<xsl:attribute name="value">
-							<xsl:value-of select="DEFDATE[1]/@value"/>
-						</xsl:attribute>
-					</xsl:element>
-				</xsl:when>
-				<xsl:when test="count(DEFTIMESTAMP) > 0">
-					<xsl:element name="DEFDTIMESTAMP">
-						<xsl:attribute name="value">
-							<xsl:value-of select="DEFTIMESTAMP[1]/@value"/>
-						</xsl:attribute>
-					</xsl:element>
-				</xsl:when>
-			</xsl:choose>
-			
-			<xsl:if test="count(NOQUOTE) > 0">
-				<xsl:element name="NOQUOTE"/>
-			</xsl:if>
-			
-			<xsl:apply-templates select="constraint"/>
-		</xsl:element>
-	</xsl:template>
-	
-	<!-- Constraint -->
-	<xsl:template match="constraint">
-		<xsl:element name="constraint">
-			<xsl:value-of select="normalize-space(text())"/>
-		</xsl:element>
-	</xsl:template>
-	
-	<!-- Index -->
-	<xsl:template match="index">
-		<xsl:element name="index">
-			<xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
-			<xsl:attribute name="table"><xsl:value-of select="../@name"/></xsl:attribute>
-			
-			<xsl:apply-templates select="descr[1]"/>
-			
-			<xsl:if test="count(CLUSTERED) > 0">
-				<xsl:element name="CLUSTERED"/>
-			</xsl:if>
-			
-			<xsl:if test="count(BITMAP) > 0">
-				<xsl:element name="BITMAP"/>
-			</xsl:if>
-			
-			<xsl:if test="count(UNIQUE) > 0">
-				<xsl:element name="UNIQUE"/>
-			</xsl:if>
-			
-			<xsl:if test="count(FULLTEXT) > 0">
-				<xsl:element name="FULLTEXT"/>
-			</xsl:if>
-			
-			<xsl:if test="count(HASH) > 0">
-				<xsl:element name="HASH"/>
-			</xsl:if>
-			
-			<xsl:choose>
-				<xsl:when test="count(DROP) > 0">
-					<xsl:element name="DROP"/>
-				</xsl:when>
-				<xsl:otherwise>
-					<xsl:apply-templates select="col"/>
-				</xsl:otherwise>
-			</xsl:choose>
-		</xsl:element>
-	</xsl:template>
-	
-	<!-- Index Column -->
-	<xsl:template match="col">
-		<xsl:element name="col">
-			<xsl:value-of select="normalize-space(text())"/>
-		</xsl:element>
-	</xsl:template>
-	
-	<!-- SQL QuerySet -->
-	<xsl:template match="sql">
-		<xsl:element name="sql">
-			<xsl:if test="string-length(@platform) > 0">
-				<xsl:attribute name="platform"><xsl:value-of select="@platform"/></xsl:attribute>
-			</xsl:if>
-			
-			<xsl:if test="string-length(@key) > 0">
-				<xsl:attribute name="key"><xsl:value-of select="@key"/></xsl:attribute>
-			</xsl:if>
-			
-			<xsl:if test="string-length(@prefixmethod) > 0">
-				<xsl:attribute name="prefixmethod"><xsl:value-of select="@prefixmethod"/></xsl:attribute>
-			</xsl:if>
-			
-			<xsl:apply-templates select="descr[1]"/>
-			<xsl:apply-templates select="query"/>
-		</xsl:element>
-	</xsl:template>
-	
-	<!-- Query -->
-	<xsl:template match="query">
-		<xsl:element name="query">
-			<xsl:if test="string-length(@platform) > 0">
-				<xsl:attribute name="platform"><xsl:value-of select="@platform"/></xsl:attribute>
-			</xsl:if>
-			
-			<xsl:value-of select="normalize-space(text())"/>
-		</xsl:element>
-	</xsl:template>
-	
-	<!-- Description -->
-	<xsl:template match="descr">
-		<xsl:element name="descr">
-			<xsl:value-of select="normalize-space(text())"/>
-		</xsl:element>
-	</xsl:template>
-</xsl:stylesheet>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/xsl/convert-0.2-0.1.xsl (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/xsl/convert-0.2-0.1.xsl)

Deleted: plog/trunk/class/database/adodb/xsl/remove-0.2.xsl
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/xsl/remove-0.2.xsl	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/class/database/adodb/xsl/remove-0.2.xsl	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0"
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
->
-	<xsl:output method="xml" indent="yes" omit-xml-declaration="no" encoding="UTF-8"/>
-	
-	<!-- Schema -->
-	<xsl:template match="/">
-		<xsl:comment>
-ADODB XMLSchema
-http://adodb-xmlschema.sourceforge.net
-</xsl:comment>
-		
-		<xsl:comment>
-Uninstallation Schema
-</xsl:comment>
-		
-		<xsl:element name="schema">
-			<xsl:attribute name="version">0.2</xsl:attribute>
-			
-			<xsl:apply-templates select="schema/table">
-				<xsl:sort select="position()" data-type="number" order="descending"/>
-			</xsl:apply-templates>
-		</xsl:element>
-	</xsl:template>
-	
-	<!-- Table -->
-	<xsl:template match="table">
-		<xsl:if test="count(DROP) = 0">
-			<xsl:element name="table">
-				<xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
-				
-				<xsl:if test="string-length(@platform) > 0">
-					<xsl:attribute name="platform"><xsl:value-of select="@platform"/></xsl:attribute>
-				</xsl:if>
-				
-				<xsl:if test="string-length(@version) > 0">
-					<xsl:attribute name="version"><xsl:value-of select="@version"/></xsl:attribute>
-				</xsl:if>
-				
-				<xsl:apply-templates select="descr[1]"/>
-				
-				<xsl:element name="DROP"/>
-			</xsl:element>
-		</xsl:if>
-	</xsl:template>
-	
-	<!-- Description -->
-	<xsl:template match="descr">
-		<xsl:element name="descr">
-			<xsl:value-of select="normalize-space(text())"/>
-		</xsl:element>
-	</xsl:template>
-</xsl:stylesheet>
\ No newline at end of file

Copied: plog/trunk/class/database/adodb/xsl/remove-0.2.xsl (from rev 2126, plog/branches/plog-1.0.1/class/database/adodb/xsl/remove-0.2.xsl)

Modified: plog/trunk/class/file/file.class.php
===================================================================
--- plog/trunk/class/file/file.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/file/file.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -3,8 +3,9 @@
     /**
      * \defgroup File
 	 *
-	 * The File module provides some classes to deal with files. The File class is the most
-	 * useful once, since provides OOP wrappers around some PHP functions that work with files.
+	 * The File module provides some classes to deal with files. The File class
+	 * is the most useful once, since provides OOP wrappers around some PHP
+	 * functions that work with files.
      */
 
 
@@ -28,7 +29,8 @@
 		 var $_mode;
 		 
 		 /**
-		  * Creates an object of this type, but the file is not automaticaly opened
+		  * Creates an object of this type, but the file is not automaticaly 
+		  * opened
 		  *
 		  * @param fileName The name of the file
 		  */
@@ -69,7 +71,8 @@
 		 
 		 /**
 		  * Reads the whole file and put it into an array, where every position
-		  * of the array is a line of the file (new-line characters not included)
+		  * of the array is a line of the file (new-line characters not
+		  * included)
 		  *
 		  * @return An array where every position is a line from the file.
 		  */
@@ -88,8 +91,8 @@
 		 /**
 		  * Reads bytes from the currently opened file
 		  *
-		  * @param size Amount of bytes we'd like to read from the file. It is set
-		  * to 4096 by default.
+		  * @param size Amount of bytes we'd like to read from the file. It is 
+		  * set to 4096 by default.
 		  * @return Returns the read contents
 		  */
 		 function read( $size = 4096 )
@@ -156,9 +159,9 @@
 		  * Returns true wether the file is a directory. See
 		  * http://fi.php.net/manual/en/function.is-dir.php for more details.
 		  *
-		  * @param file The filename we're trying to check. If omitted, the current file
-		  * will be used (note that this function can be used as static as long as the
-		  * file parameter is provided)
+		  * @param file The filename we're trying to check. If omitted, the
+		  * current file will be used (note that this function can be used as
+		  * static as long as the file parameter is provided)
 		  * @return Returns true if the file is a directory.
 		  */
 		 function isDir( $file = null )
@@ -171,11 +174,12 @@
 		 
 		 /**
 		  * Returns true if the file is writable by the current user.
-		  * See http://fi.php.net/manual/en/function.is-writable.php for more details.
+		  * See http://fi.php.net/manual/en/function.is-writable.php for more 
+		  * details.
 		  *
-		  * @param file The filename we're trying to check. If omitted, the current file
-		  * will be used (note that this function can be used as static as long as the
-		  * file parameter is provided)
+		  * @param file The filename we're trying to check. If omitted, the
+		  * current file will be used (note that this function can be used as
+		  * static as long as the file parameter is provided)
 		  * @return Returns true if the file is writable, or false otherwise.
 		  */
 		 function isWritable( $file = null )
@@ -187,10 +191,11 @@
 		 }
 		 
 		 /**
-		  * returns true if the file is readable. Can be used as static if a filename is provided
+		  * returns true if the file is readable. Can be used as static if a
+		  * filename is provided
 		  *
-		  * @param if provided, this method can be used as an static method and it will check for
-		  * the readability status of the file
+		  * @param if provided, this method can be used as an static method and
+		  * it will check for the readability status of the file
 		  * @return true if readable or false otherwise
 		  */
 		 function isReadable( $file = null )
@@ -204,8 +209,8 @@
 		 }
 		 
 		 /**
-		  * removes a file. Can be used as static if a filename is provided. Otherwise it will
-		  * remove the file that was given in the constructor
+		  * removes a file. Can be used as static if a filename is provided. 
+		  * Otherwise it will remove the file that was given in the constructor
 		  *
 		  * @param optionally, name of the file to delete
 		  * @return True if successful or false otherwise
@@ -214,6 +219,9 @@
 		 {
 			 if( $file == null )
 				 $file = $this->_fileName;
+
+            if( !File::isReadable( $file ))
+                return false;
 			 
 			 if( File::isDir( $file ))
 				 $result = rmdir( $file );
@@ -227,10 +235,15 @@
 		  * removes a directory, optinally in a recursive fashion
 		  *
 		  * @param dirName
-		  * @param recursive
+		  * @param recursive Whether to recurse through all subdirectories that
+		  * are within the given one and remove them.
+		  * @param onlyFiles If the recursive mode is enabled, setting this to 'true' will
+		  * force the method to only remove files but not folders. The directory will not be
+		  * removed but all the files included it in (and all subdirectories) will be.
 		  * @return True if successful or false otherwise
+		  * @static
 		  */
-		 function deleteDir( $dirName, $recursive = false )
+		 function deleteDir( $dirName, $recursive = false, $onlyFiles = false )
 		 {
 			// if the directory can't be read, then quit with an error
 			if( !File::isReadable( $dirName ) || !File::exists( $dirName )) {
@@ -243,38 +256,42 @@
 				return File::delete( $dirName );
 			}
 				
-			// Glob::myGlob is easier to use than Glob::glob, specially when we're
-			// relying on the native version... This improved version will automatically
-			// ignore things like "." and ".." for us, making it much easier!
+			// Glob::myGlob is easier to use than Glob::glob, specially when 
+			// we're relying on the native version... This improved version 
+			// will automatically ignore things like "." and ".." for us, 
+			// making it much easier!
 			$files = Glob::myGlob( $dirName, "*" );
 			foreach( $files as $file ) {
 				if( File::isDir( $file )) {
 					// perform a recursive call if we were allowed to do so
 					if( $recursive ) 
-						File::deleteDir( $file, $recursive );
+						File::deleteDir( $file, $recursive, $onlyFiles );
 				}
 				
 				// File::delete can remove empty folders as well as files
 				if( File::isReadable( $file ))
-					File::delete( $file );
-			}
+					File::delete( $file );			}
 			
-			// finally, remove the top-level folder
-			File::delete( $dirName );
+			// finally, remove the top-level folder but only in case we
+			// are supposed to!
+			if( !$onlyFiles )
+    			File::delete( $dirName );
 			
 			return true;
 		 }
 		 
 		 /**
-       	  * Creates a new folder. If the folder name is /a/b/c and neither /a or /a/b exist, this
-		  * method will take care of creating the whole folder structure automatically.
+       	  * Creates a new folder. If the folder name is /a/b/c and neither 
+       	  * /a or /a/b exist, this method will take care of creating the 
+       	  * whole folder structure automatically.
 		  *
 		  * @static
 		  * @param dirName The name of the new folder
 		  * @param mode Attributes that will be given to the folder
 		  * @return Returns true if no problem or false otherwise.
 		  */
-		 function createDir( $dirName, $mode = FILE_DEFAULT_DIRECTORY_CREATION_MODE )
+		 function createDir( $dirName, 
+		                     $mode = FILE_DEFAULT_DIRECTORY_CREATION_MODE )
 		 {
              if(File::exists($dirName)) return true;
 
@@ -312,8 +329,9 @@
 		 /**
 		  * Returns the size of the file.
 		  *
-		  * @param string fileName An optional parameter specifying the name of the file. If omitted,
-		  * we will use the file that we have currently opened. Please note that this function can
+		  * @param string fileName An optional parameter specifying the name 
+		  * of the file. If omitted, we will use the file that we have 
+		  * currently opened. Please note that this function can
 		  * be used as static if a file name is specified.
 		  * @return An integer specifying the size of the file.
 		  */
@@ -329,31 +347,49 @@
 				 return $size;
 		 }
 		 
-		 /**
-			 * renames a file
-		  *
-		  * http://www.php.net/manual/en/function.rename.php
-		  *
-		  * This function can be used as static if inFile and outFile are both not
-		  * empty. if outFile is empty, then the internal file of the current object
-		  * will be used as the input file and the first parameter of this method
-		  * will become the destination file name.
-		  *
-		  * @param inFile Original file
-		  * @param outFile Destination file.
-		  * @return Returns true if file was renamed ok or false otherwise.
-		  */
-		 function rename( $inFile, $outFile = null )
-		 {
-			 // check how many parameters we have
-			 if( $outFile == null ) {
-				 $outFile = $inFile;
-				 $inFile  = $this->_fileName;
-			 }
-			 
-			 // and rename everything
-			 return rename( $inFile, $outFile );
-		 }
+         /**
+          * renames a file
+          *
+          * http://www.php.net/manual/en/function.rename.php
+          *
+          * This function can be used as static if inFile and outFile are both 
+          * not empty. if outFile is empty, then the internal file of the
+          * current object will be used as the input file and the first 
+          * parameter of this method will become the destination file name.
+          *
+          * @param inFile Original file
+          * @param outFile Destination file.
+          * @return Returns true if file was renamed ok or false otherwise.
+          */
+          function rename( $inFile, $outFile = null )
+          {
+              // check how many parameters we have
+              if( $outFile == null ) {
+                  $outFile = $inFile;
+                  $inFile  = $this->_fileName;
+              }
+            
+              // In order to work around the bug in php versions older
+              // than 4.3.3, where rename will not work across different
+              // partitions, this will be a copy and delete of the original file
+            
+              // copy the file to the new location
+              if (!copy($inFile, $outFile)) {
+                  // The copy failed, return false
+                  return FALSE;
+              }
+            
+              // Now delete the old file
+              // NOTICE, we are not checking the error here.  It is possible 
+              // the the original file will remain and the copy will exist.
+              //
+              // One way to potentially fix this is to look at the result of
+              // unlink, and then delete the copy if unlink returned FALSE, 
+              // but this call to unlink could just as easily fail
+              unlink( $inFile );
+            
+              return TRUE;
+          }
 		 
 		 /**
 		  * copies a file from one place to another.
@@ -373,7 +409,8 @@
 		  * changes the permissions of a file, via PHP's chmod() function
 		  *
 		  * @param inFile The name of the file whose mode we'd like to change
-		  * @param mode The new mode, or if none provided, it will default to 0644
+		  * @param mode The new mode, or if none provided, it will default 
+		  * to 0644
 		  * @return true if successful or false otherwise 
 		  * @static
 		  */
@@ -385,8 +422,10 @@
 		 /**
 		  * returns true if the file exists.
 		  *
-		  * Can be used as an static method if a file name is provided as a parameter
-		  * @param fileName optinally, name of the file whose existance we'd like to check
+		  * Can be used as an static method if a file name is provided as a
+		  *  parameter
+		  * @param fileName optinally, name of the file whose existance we'd
+		  * like to check
 		  * @return true if successful or false otherwise
 		  */
 		 function exists( $fileName = null ) 

Modified: plog/trunk/class/file/fileuploads.class.php
===================================================================
--- plog/trunk/class/file/fileuploads.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/file/fileuploads.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -53,7 +53,8 @@
 			//use basename of tmp_name istead of filename
 			//because there is locale problem with filename
 			//$fileName = $upload->getFileName();
-			if( move_uploaded_file( $upload->getTmpName(), $destinationFolder.basename($upload->getTmpName()))){//$fileName)) {
+			if( $this->my_move_uploaded_file( $upload->getTmpName(), 
+			                                   $destinationFolder.basename($upload->getTmpName()))){//$fileName)) {
                	$upload->setFolder( $destinationFolder );
 				$error = 0;
             }
@@ -91,7 +92,7 @@
         	foreach( $this->_files as $file ) {
                 $upload = new FileUpload( $file );
                 $fileName = $upload->getFileName();
-                if( move_uploaded_file( $upload->getTmpName(), $destinationFolder.$fileName)) {
+                if( $this->my_move_uploaded_file( $upload->getTmpName(), $destinationFolder.$fileName)) {
                 	$upload->setFolder( $destinationFolder );
                     $upload->setError( 0 );
                 }
@@ -101,7 +102,25 @@
                 array_push( $uploads, $upload );
             }
 
-            return $uploads;
-        }
+            return $uploads;
+        }
+        
+        /**
+         * Implements the a move_uploaded_file that handles multiple partitions.
+         *
+         * @return a boolean that indicates if the file was successfully moved.  This will 
+         * return false if the file is not an uploaded file.
+         */
+         function my_move_uploaded_file( $filename, $destination )
+         {
+            // first check to make sure that this file is an uploaded file
+            if ( !is_uploaded_file($filename) )
+            {
+                // This file was not an uploaded file, return false
+                return FALSE;
+            }
+            
+            return File::rename( $filename, $destination );
+         }
     }
 ?>

Modified: plog/trunk/class/gallery/dao/galleryalbums.class.php
===================================================================
--- plog/trunk/class/gallery/dao/galleryalbums.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/gallery/dao/galleryalbums.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -52,7 +52,10 @@
          */
         function getUserAlbums( $ownerId, $onlyShownAlbums = false, $page = DEFAULT_PAGING_ENABLED, $itemsPerPage = DEFAULT_ITEMS_PER_PAGE )
         {
-        	$query = "SELECT * FROM ".$this->getPrefix()."gallery_albums WHERE owner_id = $ownerId";
+        	$query = "SELECT id, owner_id, description,
+        	                 name, flags, parent_id,
+        	                 date, properties, show_album
+        	          FROM ".$this->getPrefix()."gallery_albums WHERE owner_id = $ownerId";
             if( $onlyShownAlbums )
             	$query .=" AND show_album = 1";
 
@@ -84,7 +87,11 @@
             }
 
             // otherwise, continue the normal process...
-        	$query = "SELECT * FROM ".$this->getPrefix()."gallery_albums WHERE id = $id";
+        	$query = "SELECT id, owner_id, description,
+        	                 name, flags, parent_id,
+        	                 date, properties, show_album 
+        	          FROM ".$this->getPrefix()."gallery_albums 
+        	          WHERE id = $id";
             if( $ownerId != -1 )
             	$query .= " AND owner_id = $ownerId";
             if( $onlyShownAlbums )
@@ -113,7 +120,11 @@
 		function getAlbumByName( $id, $ownerId = -1, $fetchResources = true, $onlyShownAlbums = false )
 		{
             // otherwise, continue the normal process...
-        	$query = "SELECT * FROM ".$this->getPrefix()."gallery_albums WHERE mangled_name = '".Db::qstr($id)."'";
+        	$query = "SELECT id, owner_id, description,
+        	                 name, flags, parent_id,
+        	                 date, properties, show_album 
+        	          FROM ".$this->getPrefix()."gallery_albums 
+        	          WHERE mangled_name = '".Db::qstr($id)."'";
             if( $ownerId != -1 )
             	$query .= " AND owner_id = $ownerId";
             if( $onlyShownAlbums )
@@ -157,7 +168,10 @@
          */
         function getChildAlbums( $albumId, $ownerId, $onlyShownAlbums = false )
         {		
-        	$query = "SELECT * FROM ".$this->getPrefix()."gallery_albums
+        	$query = "SELECT id, owner_id, description,
+        	                 name, flags, parent_id,
+        	                 date, properties, show_album 
+        	          FROM ".$this->getPrefix()."gallery_albums
                       WHERE parent_id = $albumId AND
 					  owner_id = $ownerId";
             if( $onlyShownAlbums )
@@ -203,8 +217,8 @@
                       $album->getOwnerId().", '".Db::qstr($album->getDescription())."', '".
 					  Db::qstr($album->getName())."', 0, ".$album->getParentId().", '".
                       serialize($album->getProperties())."', 1,'".
-                      $tf->normalizeText($album->getName())."','".
-                      $tf->normalizeText($album->getDescription())."', '".
+                      Db::qstr($tf->normalizeText($album->getName()))."','".
+                      Db::qstr($tf->normalizeText($album->getDescription()))."', '".
 					  $tf->urlize($album->getName())."');";
 					  
             $result = $this->Execute( $query );
@@ -252,8 +266,8 @@
                       parent_id = ".$album->getParentId().",
                       properties = '".serialize($album->getProperties())."',
                       show_album = ".$album->getShowAlbum().",
-                      normalized_name = '".$tf->normalizeText($album->getName())."',
-                      normalized_description = '".$tf->normalizeText($album->getDescription())."',
+                      normalized_name = '".Db::qstr($tf->normalizeText($album->getName()))."',
+                      normalized_description = '".Db::qstr($tf->normalizeText($album->getDescription()))."',
 					  mangled_name = '".$tf->urlize($album->getName())."'
                       WHERE id = ".$album->getId().";";
 
@@ -354,7 +368,10 @@
 		function getUserAlbumsGroupedByParentId( $userId, $albumId = 0 )
 		{
 			$prefix = $this->getPrefix();
-			$query = "SELECT * FROM {$prefix}gallery_albums 
+			$query = "SELECT id, owner_id, description,
+        	                 name, flags, parent_id,
+        	                 date, properties, show_album 
+        	          FROM {$prefix}gallery_albums 
 			          WHERE owner_id = '".Db::qstr($userId)."'
 					  ORDER BY name ASC";
 

Modified: plog/trunk/class/gallery/dao/galleryresources.class.php
===================================================================
--- plog/trunk/class/gallery/dao/galleryresources.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/gallery/dao/galleryresources.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -92,7 +92,10 @@
          */
         function getResource( $resourceId, $ownerId = -1, $albumId = -1 )
         {
-        	$query = "SELECT * FROM ".$this->getPrefix()."gallery_resources
+        	$query = "SELECT id, owner_id, album_id, description,
+        	          date, flags, resource_type, file_path, file_name,
+        	          metadata, thumbnail_format
+        	          FROM ".$this->getPrefix()."gallery_resources
                       WHERE id = $resourceId";
             if( $ownerId > 0 )
             	$query .= " AND owner_id = $ownerId";
@@ -126,9 +129,13 @@
 			$prefix = $this->getPrefix();
 			$albumId = $resource->getAlbumId();
 			$date = $resource->getDate();
-			$query = "SELECT * from {$prefix}gallery_resources 
-			          WHERE album_id = '$albumId' AND date > '$date' 
-					  ORDER BY date ASC LIMIT 1";
+			$id = $resource->getId();
+			$query = "SELECT id, owner_id, album_id, description,
+        	                 date, flags, resource_type, file_path, file_name,
+        	                 metadata, thumbnail_format 
+        	          FROM {$prefix}gallery_resources 
+			          WHERE album_id = '$albumId' AND date >= '$date' AND id > $id
+					  ORDER BY date ASC,id ASC LIMIT 1";
 
 			$result = $this->Execute( $query );
 			
@@ -156,9 +163,13 @@
 			$prefix = $this->getPrefix();
 			$albumId = $resource->getAlbumId();
 			$date = $resource->getDate();
-			$query = "SELECT * from {$prefix}gallery_resources 
-			          WHERE album_id = '$albumId' AND date < '$date' 
-					  ORDER BY date DESC LIMIT 1";
+			$id = $resource->getId();
+			$query = "SELECT id, owner_id, album_id, description,
+        	                 date, flags, resource_type, file_path, file_name,
+        	                 metadata, thumbnail_format 
+        	          FROM {$prefix}gallery_resources 
+			          WHERE album_id = '$albumId' AND date <= '$date' AND id < $id
+					  ORDER BY date DESC,id DESC LIMIT 1";
 
 			$result = $this->Execute( $query );
 			
@@ -186,7 +197,10 @@
          */
         function getUserResources( $ownerId, $albumId = GALLERY_NO_ALBUM, $resourceType = GALLEY_RESOURCE_ANY, $page = DEFAULT_PAGING_ENABLED, $itemsPerPage = DEFAULT_ITEMS_PER_PAGE )
         {
-        	$query = "SELECT * FROM ".$this->getPrefix()."gallery_resources
+        	$query = "SELECT id, owner_id, album_id, description,
+        	                 date, flags, resource_type, file_path, file_name,
+        	                 metadata, thumbnail_format 
+        	          FROM ".$this->getPrefix()."gallery_resources
                       WHERE owner_id = '".Db::qstr($ownerId)."'";
             if( $albumId > GALLERY_NO_ALBUM )
             	$query .= " AND album_id = '".Db::qstr($albumId)."'";
@@ -312,7 +326,7 @@
 						  file_path, file_name, metadata, thumbnail_format, normalized_description) VALUES (
 						  $ownerId, $albumId, '".Db::qstr($description)."', $flags, $resourceType,
 						  '$filePath', '$fileName', '$serMetadata', '$thumbnailFormat',
-				  '$normalizedDescription');";	
+				  '".Db::qstr($normalizedDescription)."');";	
 						  
 			$result = $this->Execute( $query );
 
@@ -512,7 +526,7 @@
         {
             // check if quotas are enabled, and if this file would make us go
             // over the quota
-            if( GalleryResourceQuotas::isBlogOverResourceQuota( $ownerId, File::getSize( $filePath ))) {
+            if( GalleryResourceQuotas::isBlogOverResourceQuota( $ownerId, File::getSize( $fullFilePath ))) {
                 return GALLERY_ERROR_QUOTA_EXCEEDED;
             }
             
@@ -540,7 +554,8 @@
             // and finally move the file to the right place in disk
             // move the file to disk
             $storage = new GalleryResourceStorage();
-            $resFile = $storage->storeFile( $resourceId, $ownerId, $fullFilePath );
+            $resFile = $storage->storeFile( $resourceId, $ownerId, $fullFilePath,
+                                            RESOURCE_STORAGE_STORE_MOVE );
             
             // if the file cannot be read, we will also remove the record from the
             // database so that we don't screw up
@@ -574,7 +589,10 @@
          */
         function getResourceFile( $ownerId, $fileName, $albumId = -1 )
         {
-        	$query = "SELECT * FROM ".$this->getPrefix()."gallery_resources
+        	$query = "SELECT id, owner_id, album_id, description,
+        	          date, flags, resource_type, file_path, file_name,
+        	          metadata, thumbnail_format 
+        	          FROM ".$this->getPrefix()."gallery_resources
                       WHERE owner_id = $ownerId AND
                       file_name = '$fileName'";
 					  
@@ -613,7 +631,7 @@
                       metadata = '".Db::qstr(serialize($resource->getMetadata()))."',
 					  thumbnail_format ='".$resource->getThumbnailFormat()."',
                       date = '".$resource->getDate()."',
-                      normalized_description = '".$tf->normalizeText( $resource->getDescription())."'
+                      normalized_description = '".Db::qstr($tf->normalizeText( $resource->getDescription()))."'
                       WHERE id = ".$resource->getId();
 
             $result = $this->Execute( $query );

Modified: plog/trunk/class/gallery/resizers/galleryimagemagickresizer.class.php
===================================================================
--- plog/trunk/class/gallery/resizers/galleryimagemagickresizer.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/gallery/resizers/galleryimagemagickresizer.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -31,17 +31,15 @@
         function generate( $outFile, $width, $height )
         {
         	// get the path to the convert tool
-        	$config =& Config::getConfig();
-        	$convertPath = $config->getValue( "path_to_convert", DEFAULT_PATH_TO_CONVERT );
-
-            // run the command
-        	$command = $convertPath." -geometry ".$width."x".$height." ".$this->_image." ".$outFile;
-        	$cmdOuput = system($command, $retval);
-
-            // check if there was an error creating the thubmnail
-            if( !$retval )
+            $config =& Config::getConfig();
+            $convertPath = $config->getValue( "path_to_convert", DEFAULT_PATH_TO_CONVERT );
+                // run the command
+            $command = $convertPath." -geometry ".$width."x".$height." ".$this->_image." ".$outFile;
+            $cmdOuput = system($command, $retval);
+            
+                // check if there was an error creating the thubmnail
+            if($cmdOutput === FALSE || $retval )
             	return false;
-
             return $outFile;
         }
     }

Modified: plog/trunk/class/locale/locale.class.php
===================================================================
--- plog/trunk/class/locale/locale.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/locale/locale.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -91,8 +91,6 @@
 		{
 			$this->Object();
 
-            $config =& Config::getConfig();
-
             $this->_defaultFolder = $this->getLocaleFolder();
 
 			$this->_code = $code;
@@ -228,8 +226,8 @@
             	$string = $id;
             }
 				
-			if( $this->getDirection() == "rtl" )
-				$string = "<span dir=\"rtl\">$string</span>";
+			/*if( $this->getDirection() == "rtl" )
+				$string = "<span dir=\"rtl\">$string</span>";*/
 
 			return $string;
 		}
@@ -304,9 +302,10 @@
          */
 		function getLanguageId()
 		{
-            $CountryId = substr( $this->_code, 3, 5 ); 
-            if ( strcmp( $CountryId, "TW" ) == 0 || strcmp( $CountryId, "CN") ==0 ) { 
-                return substr( $this->_code, 0, 5 ); 
+            $countryId = substr( $this->_code, 3, 5 ); 
+            if ( strcmp( $countryId, "TW" ) == 0 || strcmp( $countryId, "CN") ==0 ) { 
+                $langId = substr( $this->_code, 0, 2 ); 
+                return $langId."-".$countryId;
             } 
             else { 
                 return substr( $this->_code, 0, 2 ); 
@@ -489,7 +488,7 @@
 				$format = $this->_dateFormat;
 
             // now we can continue normally
-            $values["%a"] = function_exists('html_entity_decode') ? htmlentities(substr(html_entity_decode($weekday), 0, 2 )) : substr($weekday, 0, 2 );
+            $values["%a"] = function_exists('html_entity_decode') ? htmlentities(substr(html_entity_decode($weekday), 0, 3 )) : substr($weekday, 0, 2 );
 			$values["%A"] = $weekday;
 			$values["%b"] = function_exists('html_entity_decode') ? htmlentities(substr(html_entity_decode($monthStr), 0, 3 )) : substr($monthStr, 0, 3);
 			$values["%B"] = $monthStr;
@@ -523,13 +522,17 @@
 		 */
 		function mergeLocale( $locale )
 		{
-			// load the file if it hadn't been loaded yet		
-			if( !is_array($this->_messages))
-				$this->_loadLocaleFile();		
+            if(isset($locale)){
+                // load the file if it hadn't been loaded yet		
+			    if( !is_array($this->_messages))
+				    $this->_loadLocaleFile();		
 		
-			$this->_messages = array_merge( $this->_messages, $locale->getStrings());
-			
-			return true;
+			    $this->_messages = array_merge( $this->_messages, $locale->getStrings());
+                return true;
+			}
+            else{
+                return false;
+            }
 		}
 	}
 ?>

Modified: plog/trunk/class/locale/localefinder.class.php
===================================================================
--- plog/trunk/class/locale/localefinder.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/locale/localefinder.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -31,8 +31,9 @@
 		 */
 		function getKeyForFile( $fileName )
 		{
-			$regexp = "/.*locale_([a-z]{2}_[A-Z]{2})/";
-			$result = preg_match( $regexp, $fileName, $matches );
+		      // this regexp allows for more permissive locale names so that people can 
+		      // at least have things like locale_xx_YY_utf-8.php
+			$result = preg_match( REGEXP_VALID_LOCALE, $fileName, $matches );
 			
 			// in case there is some crap in the locale/ folder, then ignore
 			// it (that is, if the file name does not match our regexp!
@@ -53,7 +54,7 @@
 		function find()
 		{
 			// first find the new ones
-			parent::find( Locales::getAvailableLocales(), "locale_??_??.php" );
+			parent::find( Locales::getAvailableLocales(), "locale_*.php" );
 			
 			// and then return them, if any
 			return( $this->getNew());

Modified: plog/trunk/class/locale/locales.class.php
===================================================================
--- plog/trunk/class/locale/locales.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/locale/locales.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -4,8 +4,11 @@
 	include_once( PLOG_CLASS_PATH."class/config/config.class.php" );
 	include_once( PLOG_CLASS_PATH."class/locale/locale.class.php" );
 	include_once( PLOG_CLASS_PATH."class/locale/pluginlocale.class.php" );
+	include_once( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );
 
     define("DEFAULT_LOCALE", "en_UK");
+    
+    define( "REGEXP_VALID_LOCALE", "/.*locale_([a-z]{2}_[A-Z]{2}_?([a-zA-Z0-9\-]*)+)\.php$/" );
 
 	/**
 	 * \ingroup Locale
@@ -51,7 +54,7 @@
         {
         	// array to keep track of the locales that we have already loaded, so that
             // we don't have to fetch them from disk
-        	static $loadedLocales;
+        	static $loadedLocales;        	
 
             // if there is no locale parameter, we use the default one
         	if( $localeCode == null ) {
@@ -64,24 +67,26 @@
             if( isset($loadedLocales[$localeCode] )) {
             	$locale = $loadedLocales[$localeCode];
             }
-            else {
+            else { 
             	$locale = new Locale( $localeCode );
-
-			// check if we have any plugin locales loaded for this language
-			global $_plugins_loadedLocales;
-			if( is_array( $_plugins_loadedLocales["$localeCode"] )) {
-				foreach( $_plugins_loadedLocales["$localeCode"] as $pluginLocale ) {
-					$locale->mergeLocale( $pluginLocale );
-				}
-			}
-			elseif( is_array( $_plugins_loadedLocales["en_UK"] )) {
-				// if not, we can always use english as the default... hoping that the plugin will
-				// provide a translation!
-				foreach( $_plugins_loadedLocales["en_UK"] as $pluginLocale ) {
-					$locale->mergeLocale( $pluginLocale );
-				}
-			}
-
+                $pm =& PluginManager::getPluginManager();                
+                foreach( $pm->_pluginList as $pluginId ) {
+                    if( $pm->pluginHasLocale( $pluginId, $localeCode )) {
+                        // if the plugin provides the locale that we need, continue
+                        $pluginLocale = Locales::getPluginLocale( $pluginId, $localeCode );                        
+                    }
+                    else {
+                        // if not, try to load en_UK by default
+                        if( $pm->pluginHasLocale( $pluginId, "en_UK" )) {
+                            $pluginLocale = Locales::getPluginLocale( $pluginId, "en_UK" );
+                        }
+                        // if not en_UK locale available, forget about it...
+                    }
+                    
+                    // merge the plugin locale with the big locale
+                    $locale->mergeLocale( $pluginLocale );                    
+                }
+                
                 $loadedLocales[$localeCode] = $locale;
             }
 			
@@ -97,7 +102,7 @@
 		 */
 		function getPluginLocale( $pluginId, $localeCode = null )
 		{
-        	global $_plugins_loadedLocales;
+        	global $_plugins_loadedLocales;        	
 
         	if( $localeCode == null ) {
             	$config =& Config::getConfig();
@@ -109,12 +114,12 @@
 
             // check if we have already loaded that locale or else, load it from
             // disk and keep it for later, just in case anybody asks again
-            if( isset($_plugins_loadedLocales[$localeCode][$pluginLocaleKey] )) {
-            	$locale = $_plugins_loadedLocales[$localeCode][$pluginLocaleKey];
+            if( isset($_plugins_loadedLocales[$pluginLocaleKey][$localeCode] )) {
+            	$locale = $_plugins_loadedLocales[$pluginLocaleKey][$localeCode];
             }
             else {
             	$locale = new PluginLocale( $pluginId, $localeCode );
-                $_plugins_loadedLocales[$localeCode][$pluginLocaleKey] = $locale;
+                $_plugins_loadedLocales[$pluginLocaleKey][$localeCode] = $locale;
             }
 
             return $locale;
@@ -174,8 +179,7 @@
 		 */
 		function isValidLocaleFileName( $fileName )
 		{
-			$regexp = "/locale_([a-z]{2}_[A-Z]{2})\.php/";
-			return( preg_match( $regexp, $fileName ));
+			return( preg_match( REGEXP_VALID_LOCALE, $fileName ));
 		}
 
         /**

Modified: plog/trunk/class/logger/config/loggerconfigloader.class.php
===================================================================
--- plog/trunk/class/logger/config/loggerconfigloader.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/logger/config/loggerconfigloader.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,6 @@
 <?php
 
-	define( "LOGGER_DEFAULT_CONFIG_FILE_PATH", "config/logging.properties.php" );
+	define( "LOGGER_DEFAULT_CONFIG_FILE_PATH", PLOG_CLASS_PATH."config/logging.properties.php" );
 	
 	include_once( PLOG_CLASS_PATH."class/file/file.class.php" );
 

Modified: plog/trunk/class/mail/emailmessage.class.php
===================================================================
--- plog/trunk/class/mail/emailmessage.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/mail/emailmessage.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -21,6 +21,7 @@
         var $_mimeType;
         var $_from;
         var $_fromName;
+        var $_charset;
         
 
     	/**
@@ -33,6 +34,8 @@
             $this->_toAddrs = Array();
             $this->_ccAddrs = Array();
             $this->_bccAddrs = Array();
+            // use iso-8859-1 as the default character set
+            $this->_charset = "iso-8859-1";
 
             $this->_mimeType = "text/plain";
         }
@@ -195,6 +198,27 @@
         function getFromName()
         {
         	return $this->_fromName;
-        }        
+        }
+        
+        /**
+         * Sets the character set of the message
+         *
+         * @param charset The new character set
+         */
+        function setCharset( $charset )
+        {
+            $this->_charset = $charset;
+        }
+        
+        /**
+         * Retrieves the character set that was set for this message. Returns
+         * by default 'iso-8859-1' if no other has been set
+         *
+         *Ê@return the character set
+         */
+        function getCharset()
+        {
+            return( $this->_charset );
+        }
     }
 ?>

Modified: plog/trunk/class/mail/emailservice.class.php
===================================================================
--- plog/trunk/class/mail/emailservice.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/mail/emailservice.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -94,6 +94,7 @@
             $mail = new PHPMailer();
 
             // set a few fields
+            $mail->ContentType  = $message->getMimeType();
             $mail->From     = $message->getFrom();
             $mail->FromName = $message->getFromName();
             $mail->Subject  = $message->getSubject();
@@ -105,6 +106,9 @@
             	$mail->AddCC( $cc );
             foreach( $message->getBcc() as $bcc )
             	$mail->AddBCC( $bcc );
+            	
+            // set the character set of the message
+            $mail->CharSet = $message->getCharset();
 
             //
             // phpmailer supports

Modified: plog/trunk/class/net/customrequestgenerator.class.php
===================================================================
--- plog/trunk/class/net/customrequestgenerator.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/net/customrequestgenerator.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -3,6 +3,8 @@
 	include_once( PLOG_CLASS_PATH."class/net/baserequestgenerator.class.php" );
 	include_once( PLOG_CLASS_PATH."class/config/config.class.php" );
 	include_once( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
+	include_once( PLOG_CLASS_PATH."class/database/db.class.php" );
+	include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
 
     /**
      * \ingroup Net
@@ -456,10 +458,22 @@
 		function _fillResourceParameters( $resource ) 
 		{
 			$album = $resource->getAlbum();
-			$ownerInfo = $this->_blogInfo->getOwnerInfo();			
+            $blogId = $this->_blogInfo->getId();
+            $ownerId = $resource->getOwnerId();
+            
+            if ( $blogId != $ownerId ) {
+            	$blogId = $ownerId;
+            	$blogs =& new Blogs();
+				$blogInfo = $blogs->getBlogInfo($blogId);
+				$blogShortName = $blogInfo->getBlog();
+				$ownerInfo = $blogInfo->getOwnerInfo();
+			} else {
+				$blogShortName = $this->_blogInfo->getBlog();
+				$ownerInfo = $this->_blogInfo->getOwnerInfo();
+			}
 		
-			$params = Array( "{blogid}" => $this->_blogInfo->getId(),
-			                 "{blogname}" => Textfilter::urlize($this->_blogInfo->getBlog()),
+			$params = Array( "{blogid}" => $blogId,
+			                 "{blogname}" => Textfilter::urlize($blogShortName),
 							 "{blogowner}" => $ownerInfo->getUsername(),							 
 							 "{resourceid}" => $resource->getId(),
 							 "{resourcename}" => rawurlencode($resource->getFileName()),

Modified: plog/trunk/class/net/customurlhandler.class.php
===================================================================
--- plog/trunk/class/net/customurlhandler.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/net/customurlhandler.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -4,6 +4,7 @@
 	include_once( PLOG_CLASS_PATH."class/object/object.class.php" );
 	include_once( PLOG_CLASS_PATH."class/config/config.class.php" );
 	include_once( PLOG_CLASS_PATH."class/net/linkformatmatcher.class.php" );
+    include_once( PLOG_CLASS_PATH."class/net/url.class.php" );	
 
 	/**
 	 * \ingroup Net
@@ -31,21 +32,32 @@
 		{
 			$this->Object();
 			
+			// we need to figure out the full server path so that we can generate proper
+			// regexps for the url parsing. This should get rid of issues like
+			// http://bugs.plogworld.net/view.php?id=369
+			// The base url will be one or another depending
+            $config =& Config::getConfig();
+            if( $config->getValue( "subdomains_enabled" ))
+                $url = new Url( $config->getValue( "subdomains_base_url" ));
+            else
+                $url = new Url( $config->getValue( "base_url" ));
+            $path = $url->getPath();
+			
 			// intialize the array we're going to use
 			$config =& Config::getConfig();
             $this->_indexName = $config->getValue("script_name");
-			$this->_formats = Array( "permalink_format" => $config->getValue( "permalink_format" ),
-									 "category_link_format" => $config->getValue( "category_link_format" ),
-									 "blog_link_format" => $config->getValue( "blog_link_format" ),
-									 "archive_link_format" => $config->getValue( "archive_link_format" ),
-									 "user_posts_link_format" => $config->getValue( "user_posts_link_format" ),
-									 "post_trackbacks_link_format" => $config->getValue( "post_trackbacks_link_format" ),
-									 "template_link_format" => $config->getValue( "template_link_format" ),
-									 "album_link_format" => $config->getValue( "album_link_format" ),
-									 "resource_link_format" => $config->getValue( "resource_link_format" ),
-									 "resource_download_link_format" => $config->getValue( "resource_download_link_format" ),
-									 "resource_preview_link_format" => $config->getValue( "resource_preview_link_format" ),
-									 "resource_medium_size_preview_link_format" => $config->getValue( "resource_medium_size_preview_link_format" ));
+			$this->_formats = Array( "permalink_format" => $path.$config->getValue( "permalink_format" ),
+									 "category_link_format" => $path.$config->getValue( "category_link_format" ),
+									 "blog_link_format" => $path.$config->getValue( "blog_link_format" ),
+									 "archive_link_format" => $path.$config->getValue( "archive_link_format" ),
+									 "user_posts_link_format" => $path.$config->getValue( "user_posts_link_format" ),
+									 "post_trackbacks_link_format" => $path.$config->getValue( "post_trackbacks_link_format" ),
+									 "template_link_format" => $path.$config->getValue( "template_link_format" ),
+									 "album_link_format" => $path.$config->getValue( "album_link_format" ),
+									 "resource_link_format" => $path.$config->getValue( "resource_link_format" ),
+									 "resource_download_link_format" => $path.$config->getValue( "resource_download_link_format" ),
+									 "resource_preview_link_format" => $path.$config->getValue( "resource_preview_link_format" ),
+									 "resource_medium_size_preview_link_format" => $path.$config->getValue( "resource_medium_size_preview_link_format" ));
 			
 			// if the url did not match any of the current settings, then let's try to parse it as an old
 			// "search engine friendly" url
@@ -67,7 +79,14 @@
 		{
 			// decode the string, since it seems that php will not do it for us in this case...
 			$requestUri = urldecode( $requestUri);
-
+			
+	        // we should remove anything that comes after a '?' parameter, since we don't want to take
+	        // HTTP GET parameters into account                        
+            if(( $pos = strpos( $requestUri, '?' ))) {
+	            // if so, remove everything including the question mark
+	            $requestUri = substr( $requestUri, 0, $pos );
+            }
+                  
 			// guess which format we're using...
 			$m = new LinkFormatMatcher( $requestUri, $this->_formats );
 			$this->_format = $m->identify();

Modified: plog/trunk/class/net/http/session/sessionmanager.class.php
===================================================================
--- plog/trunk/class/net/http/session/sessionmanager.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/net/http/session/sessionmanager.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -4,7 +4,10 @@
     include_once( PLOG_CLASS_PATH."class/net/http/httpvars.class.php" );
 	include_once( PLOG_CLASS_PATH."class/net/http/session/sessioninfo.class.php" );
 	include_once( PLOG_CLASS_PATH."class/config/config.class.php" );
+	include_once( PLOG_CLASS_PATH."class/net/url.class.php" );
 	
+	$__sessionManagerInitialized = false;
+	
 	/**
 	 * \ingroup Net_HTTP
 	 *
@@ -29,11 +32,12 @@
 			SessionManager::setSessionSavePath();
 		
 			// this needs to be done before the session is started
-			SessionManager::setSessionCookiePath();
-			SessionManager::setSessionCookieDomain();
+            $sessionPath   = SessionManager::setSessionCookiePath();
+            $sessionDomain = SessionManager::setSessionCookieDomain();
 		
 			//session_cache_limiter( "public" );
-			session_name( "plog_session" );
+			session_name( "plogsession" );
+            session_set_cookie_params(0, $sessionPath, $sessionDomain);
 			session_start();
 
 			//
@@ -43,7 +47,11 @@
 			if( !array_key_exists("SessionInfo", $session) || $session["SessionInfo"] == "" ) {
 				$session["SessionInfo"] = new SessionInfo();
 				HttpVars::setSession( $session );
-			}		
+			}
+			
+			// inform the other methods that the session manager has already been intialized
+			global $__sessionManagerInitialized;
+			$__sessionManagerInitialized = true;
 		}
 		
 		/**
@@ -63,7 +71,7 @@
 			if( $path == "" || $path == "\\" ) 
 				$path = "/";
 		
-			ini_set( "session.cookie_path", $path );
+			return $path;
 		}
 		
 		/**
@@ -82,7 +90,7 @@
 			// 'localhost' or internal domains for obvious security reasons...
 			// See comments in http://fi.php.net/manual/en/function.session-set-cookie-params.php
 			if( count(explode('.', $domain)) > 1 ) {
-				ini_set( "session.cookie_domain", $domain );
+				return $domain;
 			}
 		}
 		
@@ -131,5 +139,59 @@
 			
 			return true;
 		}
+		
+		/**
+		 * return the value of a parameter from the session
+		 *
+		 * @param key The name of the parameter
+		 * @return The value assigned to this key
+		 */
+		function getSessionValue( $key )
+		{
+		    // switch that informs whether the session manager has already been initialized or not
+		    global $__sessionManagerInitialized;
+		    
+		    // check if the session manager has already been initialized
+		    if( !$__sessionManagerInitialized ) {
+		        throw( new Exception( "SessionManager::init() must be called before SessionManager::getSessionValue()" ));
+		        die();
+		    }
+		    
+		    // get the session and SessionInfo object
+		    $session = HttpVars::getSession();
+		    $sessionInfo = $session["SessionInfo"];
+		    
+		    // and now return the value
+		    return( $sessionInfo->getValue( $key ));
+		}
+		
+		/**
+		 * sets a value in the session
+		 *
+		 * @param key the key assigned to this vlaue
+		 * @param value The value assigned
+		 * @return always true
+		 */
+		function setSessionValue( $key, $value )
+		{
+		    // switch that informs whether the session manager has already been initialized or not
+		    global $__sessionManagerInitialized;
+
+		    // check if the session manager has already been initialized
+		    if( !$__sessionManagerInitialized ) {
+		        throw( new Exception( "SessionManager::init() must be called before SessionManager::getSessionValue()" ));
+		        die();
+		    }
+		    
+		    // get the session and SessionInfo object
+		    $session = HttpVars::getSession();
+		    $sessionInfo = $session["SessionInfo"];
+		    // set the value and save it to the session
+		    $sessionInfo->setValue( $key, $value );
+		    $session["SessionInfo"] = $sessionInfo;
+		    HttpVars::setSession( $session );
+		    
+		    return true;
+		}
 	}
 ?>

Modified: plog/trunk/class/net/linkparser.class.php
===================================================================
--- plog/trunk/class/net/linkparser.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/net/linkparser.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -57,7 +57,7 @@
         function parseLink( $url )
         {
             $uri = $url;
-                
+            
             global $urlRewriteTags;
             $rewritecode = array_keys( $urlRewriteTags );
             $rewritereplace = array_values( $urlRewriteTags );
@@ -66,6 +66,7 @@
             $matchre = str_replace( "/", "/", $this->_linkFormat );
             $matchre = str_replace( "$", "\$", $matchre );
             $matchre = str_replace( $rewritecode, $rewritereplace, $matchre );
+            $matchre = "^".$matchre;
         
             // Extract the key values from the uri:
             $count = preg_match("#$matchre#",$uri,$values);

Modified: plog/trunk/class/net/modrewriterequestgenerator.class.php
===================================================================
--- plog/trunk/class/net/modrewriterequestgenerator.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/net/modrewriterequestgenerator.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -2,6 +2,8 @@
 
 	include_once( PLOG_CLASS_PATH."class/net/baserequestgenerator.class.php" );
 	include_once( PLOG_CLASS_PATH."class/data/stringutils.class.php" );
+	include_once( PLOG_CLASS_PATH."class/database/db.class.php" );
+	include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
 
     /**
      * \ingroup Net
@@ -350,7 +352,19 @@
          */
         function resourceLink( $resource )
         {
-            $resourceLink = $this->getBaseUrl().'/'.$this->_blogInfo->getId().'_'.StringUtils::text2url( $this->_blogInfo->getBlog() ).'/resources/'.rawurlencode($resource->getFileName()).'.html';
+            $blogId = $this->_blogInfo->getId();
+            $ownerId = $resource->getOwnerId();
+            
+            if ( $blogId != $ownerId ) {
+            	$blogId = $ownerId;
+            	$blogs =& new Blogs();
+				$blogInfo = $blogs->getBlogInfo($blogId);
+				$blogShortName = $blogInfo->getBlog();
+			} else {
+				$blogShortName = $this->_blogInfo->getBlog();
+			}
+            
+            $resourceLink = $this->getBaseUrl().'/'.$blogId.'_'.StringUtils::text2url( $blogShortName ).'/resources/'.rawurlencode($resource->getFileName()).'.html';
 
             return $resourceLink;
         }
@@ -362,7 +376,9 @@
          */
         function resourcePreviewLink( $resource )
         {
-            $this->addParameter( "blogId", $this->_blogInfo->getId());
+            $blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());
+            
+            $this->addParameter( "blogId", $blogId);
             $this->addParameter( "resource", rawurlencode($resource->getFileName()));
             $this->addParameter( "mode", "preview" );
 
@@ -378,7 +394,9 @@
          */
         function resourceMediumSizePreviewLink( $resource )
         {
-            $this->addParameter( "blogId", $this->_blogInfo->getId());
+			$blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());
+
+            $this->addParameter( "blogId", $blogId);
             $this->addParameter( "resource", rawurlencode($resource->getFileName()));
             $this->addParameter( "mode", "medium" );
 
@@ -394,8 +412,20 @@
          */
         function resourceDownloadLink( $resource )
         {
-            $resourceLink =  $this->getBaseUrl().'/'.$this->_blogInfo->getId().'_'.StringUtils::text2url( $this->_blogInfo->getBlog() ).'/get/'.rawurlencode($resource->getFileName());
+            $blogId = $this->_blogInfo->getId();
+            $ownerId = $resource->getOwnerId();
+            
+            if ( $blogId != $ownerId ) {
+            	$blogId = $ownerId;
+            	$blogs =& new Blogs();
+				$blogInfo = $blogs->getBlogInfo($blogId);
+				$blogShortName = $blogInfo->getBlog();
+			} else {
+				$blogShortName = $this->_blogInfo->getBlog();
+			}
 
+            $resourceLink =  $this->getBaseUrl().'/'.$blogId.'_'.StringUtils::text2url( $blogShortName ).'/get/'.rawurlencode($resource->getFileName());
+
             return $resourceLink;
         }
 

Modified: plog/trunk/class/net/prettyrequestgenerator.class.php
===================================================================
--- plog/trunk/class/net/prettyrequestgenerator.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/net/prettyrequestgenerator.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -134,14 +134,13 @@
          * Returns a link to only the articles of the user
          *
          * @param user The user whose posts we would like to see
-         * @param category Optionally, we can specify an ArticleCategory object
          * @return A string containing the right url to only the posts of the user.
          * @see UserInfo
          * @see ArticleCategory
          */
-        function postUserLink( $user, $category = null )
+        function postUserLink( $user )
         {
-            $userLink = $this->getBaseUrl()."/user/".$user->getId();
+            $userLink = $this->getBaseUrl()."/user/".$this->_blogInfo->getId()."/".$user->getId();
 
             return $userLink;
         }
@@ -153,27 +152,33 @@
          */
         function blogLink( $blogInfo = null )
         {
-			$config =& Config::getConfig();
-			$disableApacheErrorHandler = $config->getValue( "disable_apache_error_handler" );
-			if( $disableApacheErrorHandler )
-				$path = "/blog/";
-			else
-				$path = "/";
+          $config =& Config::getConfig();          
+          // if subdomains are enabled, there is no need to do much more here... 
+          if( $config->getValue( "subdomains_enabled" )) {
+            $link = $this->getBaseUrl();
+          }
+          else {
+                // if not, we need some additional logic
+    			$disableApacheErrorHandler = $config->getValue( "disable_apache_error_handler" );
+    			if( $disableApacheErrorHandler )
+    				$path = "/blog/";
+    			else
+    				$path = "/";
 				
 		
-            if( $blogInfo == null ) {
-                if( $config->getValue( "pretty_urls_force_use_username" )) {
-                    $users = new Users();
-                    $userInfo = $users->getUserInfoFromId( $this->_blogInfo->getOwner());
-                    $link = $this->getBaseUrl().$path.$userInfo->getUsername();
+                if( $blogInfo == null ) {
+                    if( $config->getValue( "pretty_urls_force_use_username" )) {
+                        $userInfo = $this->_blogInfo->getOwnerInfo();
+                        $link = $this->getBaseUrl().$path.$userInfo->getUsername();
+                    }
+                    else {
+                	   $link = $this->getBaseUrl().$path.$this->_blogInfo->getId();
+                    }
                 }
                 else {
-            	   $link = $this->getBaseUrl().$path.$this->_blogInfo->getId();
+                	$link = $this->getBaseUrl().$path.$blogInfo->getId();
                 }
             }
-            else {
-            	$link = $this->getBaseUrl().$path.$blogInfo->getId();
-            }
 
             return $link;
         }
@@ -329,7 +334,9 @@
          */
         function resourceLink( $resource )
         {
-        	return $resourceLink = $this->getBaseUrl()."/resource/".$this->_blogInfo->getId()."/".$resource->getId();
+        	$blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());
+        	
+        	return $resourceLink = $this->getBaseUrl()."/resource/".$blogId."/".$resource->getId();
         }
 
         /**
@@ -339,7 +346,9 @@
          */
         function resourcePreviewLink( $resource )
         {
-        	return $resourceLink = $this->getBaseUrl()."/resserver.php?blogId=".$this->_blogInfo->getId()."&amp;resource=".rawurlencode($resource->getFileName())."&amp;mode=preview";
+			$blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());
+        	
+        	return $resourceLink = $this->getBaseUrl()."/resserver.php?blogId=".$blogId."&amp;resource=".rawurlencode($resource->getFileName())."&amp;mode=preview";
         }
 		
         /**
@@ -349,7 +358,9 @@
          */
         function resourceMediumSizePreviewLink( $resource )
         {
-        	return $resourceLink = $this->getBaseUrl()."/resserver.php?blogId=".$this->_blogInfo->getId()."&amp;resource=".rawurlencode($resource->getFileName())."&amp;mode=medium";
+			$blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());
+
+        	return $resourceLink = $this->getBaseUrl()."/resserver.php?blogId=".$blogId."&amp;resource=".rawurlencode($resource->getFileName())."&amp;mode=medium";
         }		
 
         /**
@@ -359,7 +370,9 @@
          */
         function resourceDownloadLink( $resource )
         {
-        	return $resourceLink = $this->getBaseUrl()."/get/".$this->_blogInfo->getId()."/".rawurlencode($resource->getFileName());
+        	$blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());
+        	
+        	return $resourceLink = $this->getBaseUrl()."/get/".$blogId."/".rawurlencode($resource->getFileName());
         }
 
 
@@ -374,4 +387,4 @@
             die();
         }
     }
-?>
+?>
\ No newline at end of file

Modified: plog/trunk/class/net/prettyrequestparser.class.php
===================================================================
--- plog/trunk/class/net/prettyrequestparser.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/net/prettyrequestparser.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -11,7 +11,12 @@
 
     	function PrettyRequestParser( $function, $path_info )
         {
-        	$this->_path_info = $path_info;
+            $len = strlen($path_info);
+            if($len && $path_info[$len-1] == '/')
+               $this->_path_info = substr($path_info, 0, -1);
+            else
+               $this->_path_info = $path_info;
+
             $this->_function  = $function;
         }
 
@@ -67,15 +72,16 @@
                     }
                     $result["op"] = "RssAction";
                     break;
-                case "linktracker":
-                	$result["blogId"] = $params[count($params)-1];
-                    $result["op"] = "LinkTracker";
-                    break;
                 case "archives":
                 	$date = $params[count($params)-1];
                     $result["op"] = "Default";
                     $result["Date"] = $date;
                     break;
+                case "user":
+                	$userId = $params[count($params)-1];
+                    $result["userId"] = $userId;
+                    $result["op"] = "Default";
+                    break;                    
                 case "category":
                 	$categoryId = $params[count($params)-1];
                     $result["postCategoryId"] = $categoryId;

Modified: plog/trunk/class/net/rawrequestgenerator.class.php
===================================================================
--- plog/trunk/class/net/rawrequestgenerator.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/net/rawrequestgenerator.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -390,8 +390,10 @@
          */
         function resourceLink( $resource )
         {
+            $blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());
+            
             $this->addParameter( "op", "ViewResource" );
-            $this->addParameter( "blogId", $this->_blogInfo->getId());
+            $this->addParameter( "blogId", $blogId);
             $this->addParameter( "resource", $resource->getFileName());
 
             $resourceLink = $this->getIndexUrl().$this->getRequest();
@@ -406,7 +408,9 @@
          */
         function resourcePreviewLink( $resource )
         {
-            $this->addParameter( "blogId", $this->_blogInfo->getId());
+            $blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());
+            
+            $this->addParameter( "blogId", $blogId);
             $this->addParameter( "resource", $resource->getFileName());
             $this->addParameter( "mode", "preview" );
 
@@ -422,7 +426,9 @@
          */
         function resourceMediumSizePreviewLink( $resource )
         {
-            $this->addParameter( "blogId", $this->_blogInfo->getId());
+            $blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());
+            
+            $this->addParameter( "blogId", $blogId);
             $this->addParameter( "resource", $resource->getFileName());
             $this->addParameter( "mode", "medium" );
 
@@ -438,10 +444,12 @@
          */
         function resourceDownloadLink( $resource )
         {
-            $this->addParameter( "blogId", $this->_blogInfo->getId());
+            $blogId = ($resource->getOwnerId() ? $resource->getOwnerId() : $this->_blogInfo->getId());
+            
+            $this->addParameter( "blogId", $blogId);
             $this->addParameter( "resource", $resource->getFileName());
 
-            $resourceLink = $this->getResourceServerUrl().$this->getRequest();
+            $resourceLink = $this->getResourceServerUrl().$this->getRequest( false );
 
             return $resourceLink;
         }
@@ -451,7 +459,7 @@
          *
          * @return A String object representing the request
          */
-        function getRequest()
+        function getRequest( $removeBlogIdIfNecessary = true )
         {
         	$request = "";
 
@@ -460,7 +468,7 @@
 			else
 				$amp = "&";
 				
-			if( !$this->getIncludeBlogId())
+			if( !$this->getIncludeBlogId() && $removeBlogIdIfNecessary )
 				$this->removeParameter( "blogId" );
 
         	foreach( $this->_params as $name => $value )

Modified: plog/trunk/class/object/exception.class.php
===================================================================
--- plog/trunk/class/object/exception.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/object/exception.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -48,8 +48,10 @@
 					if( ($trace["function"] != "_internalerrorhandler") && ($trace["file"] != __FILE__ )) {
 						print( $trace["file"] );
 						print( "(".$trace["line"]."): " );
-						if( $trace["class"] != "" )
-							print( $trace["class"]."." );
+						if( isset( $trace["class"] )) {
+    						if( $trace["class"] != "" )
+    	   						print( $trace["class"]."." );
+    	                }
 						print( $trace["function"] );
 						print( "<br/>" );
 					}

Modified: plog/trunk/class/plugin/pluginbase.class.php
===================================================================
--- plog/trunk/class/plugin/pluginbase.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/plugin/pluginbase.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -324,17 +324,31 @@
 		}
 		
 		/**
-		 * returns the list of supported locales by this plugin, or an empty array if the plugin
-		 * does not define any array.
+		 * returns true whether the plugin has the given locale
 		 *
-		 * @return Array
+		 * @param localeCode the locale that we'd like to check
+		 * @return whether the plugin provides the requested locale
 		 */
-		function getSupportedLocales()
+		function hasLocale( $localeCode )
 		{
-			if( !is_array( $this->locales ))
-				return Array();
-			else
-				return $this->locales;
+		  $path = "plugins/".$this->getId()."/locale/locale_".$localeCode.".php";
+		  
+		  return( File::isReadable( $path ));
 		}
+		
+		/**
+		 * this method must be implemented by plugins that wish to "listen" for events
+		 * It will throw an Exception by default, since it means that the plugin registered for
+		 * an event but no implementation of the process() method is provided
+		 *
+		 * @param eventType The event identifier.
+		 * @param params An array with the parameters thrown by the event. The parameters are 
+		 * dependant on the event.
+		 */
+        function process( $eventType, $params )
+        {
+            throw( new Exception( "Plugin ".$this->id." registered for event $eventType but did not provide its own process() method!" ));
+            die();
+        }
     }
 ?>

Modified: plog/trunk/class/plugin/pluginmanager.class.php
===================================================================
--- plog/trunk/class/plugin/pluginmanager.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/plugin/pluginmanager.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -78,6 +78,11 @@
 			if( $this->_pluginList == "" )
 				$this->_pluginList = Array();
         }
+        
+        function getPluginList()
+        {
+            return( $this->_pluginList );
+        }
 
         /**
          * Sets the blog info
@@ -162,11 +167,8 @@
 						$className = "Plugin".$plugin;
 						include_once( $pluginFullPath );
 						$classInstance = new $className();
-						$name = $classInstance->getId();
-						$supportedLocales = $classInstance->getSupportedLocales();
-                   		foreach( $supportedLocales as $locale ) {
-							$this->_loadPluginLocale( $classInstance->getId(), $locale );
-						}
+						$name = $classInstance->getId();						
+
 						$classInstance->setPluginFolder( PLOG_CLASS_PATH.$pluginFile."/" );
 						
 						// tell the resource loader that it should try to load actions from this folder
@@ -339,5 +341,18 @@
 
             return $events;
         }
+        
+        /**
+         * returns true if the plugin provides the requested locale
+         *
+         * @param pluginId The plugin identifier that we're like to check
+         * @param localeCode the locale code
+         * @return True if the plugin has this locale or false otherwise
+         * @static
+         */
+        function pluginHasLocale( $pluginId, $localeCode ) 
+        {
+            return( File::isReadable( "plugins/$pluginId/locale/locale_{$localeCode}.php" ));
+        }
     }
 ?>

Modified: plog/trunk/class/security/bayesianfilter.class.php
===================================================================
--- plog/trunk/class/security/bayesianfilter.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/security/bayesianfilter.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -105,8 +105,8 @@
                 // still be added but marked as spam and so on... sometimes breaking a few
                 // rules makes things easier :)
                 if( $config->getValue( "bayesian_filter_spam_comments_action" ) == BAYESIAN_FILTER_KEEP_COMMENT_ACTION ) {
-					$clientIp = Client::getIp();
                 	$comments = new ArticleComments();
+                	$clientIp = Client::getIp();
 					$comment = new UserComment( $articleId, $parentId, $commentTopic, $commentText,
 					                               null, $userName, $userEmail, $userUrl, $clientIp,
 												   0, COMMENT_STATUS_SPAM );

Modified: plog/trunk/class/summary/action/activeaccountaction.class.php
===================================================================
--- plog/trunk/class/summary/action/activeaccountaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/summary/action/activeaccountaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,27 +1,24 @@
 <?php
 
-include_once(PLOG_CLASS_PATH.'class/action/action.class.php');
+include_once(PLOG_CLASS_PATH.'class/summary/action/summaryaction.class.php');
 include_once(PLOG_CLASS_PATH.'class/data/validator/stringvalidator.class.php');
 include_once(PLOG_CLASS_PATH.'class/dao/users.class.php');
 include_once(PLOG_CLASS_PATH.'class/dao/blogs.class.php');
 include_once(PLOG_CLASS_PATH.'class/summary/view/summarymessageview.class.php');
-
 include_once(PLOG_CLASS_PATH.'class/logger/LogUtil.php');
 
-class ActiveAccountAction extends Action {
+class ActiveAccountAction extends SummaryAction 
+{
 
     var $username;
     var $activeCode;
 
-    var $_locale;
+    function ActiveAccountAction($actionInfo,$httpRequest)
+    {
+        $this->SummaryAction($actionInfo,$httpRequest);
 
-    function ActiveAccountAction($actionInfo,$httpRequest){
-        $this->Action($actionInfo,$httpRequest);
-
         $this->registerFieldValidator("username",new StringValidator());
         $this->registerFieldValidator("activeCode",new StringValidator());
-
-        $this->_locale = & Locales::getLocale();
     }
 
     function perform(){

Modified: plog/trunk/class/summary/action/bloglistaction.class.php
===================================================================
--- plog/trunk/class/summary/action/bloglistaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/summary/action/bloglistaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -22,7 +22,14 @@
          */
         function perform()
         {
-			$this->_view = new SummaryBlogListView();
+            // this is a bit hackish but it works...
+            $page = View::getCurrentPageFromRequest();
+            
+            // create the view
+			$this->_view = new SummaryBlogListView( Array( "summary" => "BlogList", 
+			                                        "page" => $this->_page, 
+			                                        "locale" => $this->_locale->getLocaleCode()));
+			
 			if( $this->_view->isCached()) {
 				// nothing to do, the view is cached
 				return true;

Modified: plog/trunk/class/summary/action/blogprofileaction.class.php
===================================================================
--- plog/trunk/class/summary/action/blogprofileaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/summary/action/blogprofileaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -36,7 +36,9 @@
         {
 			$this->_blogId = $this->_request->getValue( "blogId" );	        
 	        
-			$this->_view = new SummaryCachedView( "blogprofile", Array( "summary" => "BlogProfile", "blogId" => $this->_blogId ));
+			$this->_view = new SummaryCachedView( "blogprofile", Array( "summary" => "BlogProfile", 
+			                                                            "blogId" => $this->_blogId,
+			                                                            "locale" => $this->_locale->getLocaleCode()));
 			if( $this->_view->isCached()) {
 				// nothing to do, the view is cached
 				return true;
@@ -67,8 +69,9 @@
 												 
 			
 			$this->_view->setValue( "blog", $blogInfo );
-			$this->_view->setValue( "locale", $this->_locale );
 			$this->_view->setValue( "blogposts", $posts );
+			
+			$this->setCommonData();			
 		
             return true;
         }

Modified: plog/trunk/class/summary/action/dofinishregister.class.php
===================================================================
--- plog/trunk/class/summary/action/dofinishregister.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/summary/action/dofinishregister.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -11,7 +11,7 @@
      * @package summary
      * @subpackage action
      */
-    class doFinishRegister extends registerAction 
+    class doFinishRegister extends RegisterAction 
 	{
         var $need_confirm;
 

Modified: plog/trunk/class/summary/action/doreadagreement.class.php
===================================================================
--- plog/trunk/class/summary/action/doreadagreement.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/summary/action/doreadagreement.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,22 +1,20 @@
 <?php
 
-	include_once( PLOG_CLASS_PATH."class/summary/action/summaryaction.class.php" );
+	include_once( PLOG_CLASS_PATH."class/summary/action/registeraction.class.php" );
 	include_once( PLOG_CLASS_PATH."class/config/config.class.php" );
 
 	/**
 	 * shows a form so that users can register
 	 */
-    class doReadAgreement extends SummaryAction 
+    class doReadAgreement extends RegisterAction 
 	{
         function perform()
         {
+    		if( $this->_config->getValue( "summary_show_agreement" ))
+    		    $this->_view = new SummaryView( "registerstep0" );
+	    	else
+		    	$this->_view = new SummaryView( "registerstep1" );
 
-		$config =& Config::getConfig();
-		if( $config->getValue( "summary_show_agreement" ))
-            		$this->_view = new SummaryView( "registerstep0" );
-		else
-			$this->_view = new SummaryView( "registerstep1" );
-
             $this->setCommonData();
         }
     }	 

Modified: plog/trunk/class/summary/action/dousercreation.class.php
===================================================================
--- plog/trunk/class/summary/action/dousercreation.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/summary/action/dousercreation.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -51,8 +51,7 @@
 
             // check if this email account has registered and quit if so, but only if the configuration
 		// says that we should only allow one blog per email account
-		$config =& Config::getConfig();
-		if( $config->getValue( "force_one_blog_per_email_account" )) {
+		if( $this->_config->getValue( "force_one_blog_per_email_account" )) {
             if( $users->emailExists($this->userEmail)) {
 				$this->_view = new SummaryView( "registerstep1" );
 				//$this->_form->hasRun( true );

Modified: plog/trunk/class/summary/action/registeraction.class.php
===================================================================
--- plog/trunk/class/summary/action/registeraction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/summary/action/registeraction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,8 +1,7 @@
 <?php
 
-include_once( PLOG_CLASS_PATH."class/action/action.class.php" );
+include_once( PLOG_CLASS_PATH."class/summary/action/summaryaction.class.php" );
 include_once( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
-include_once( PLOG_CLASS_PATH."class/summary/view/summaryview.class.php" );
 include_once( PLOG_CLASS_PATH."class/summary/view/summarycachedview.class.php" );
 
 /**
@@ -10,7 +9,7 @@
  * @package summary
  * @subpackage action
  */
-class RegisterAction extends Action
+class RegisterAction extends SummaryAction
 {
     //{{{ member variables
     var $userName;
@@ -25,17 +24,15 @@
     //{{{function RegisterAction( $actionInfo, $request )
     function RegisterAction( $actionInfo, $request )
     {
-        $this->Action( $actionInfo, $request );
-        $this->_config   = &Config::getConfig();
-        $this->_locale   = &Locales::getLocale( $this->_config->getValue("default_locale" ));			
+        $this->SummaryAction( $actionInfo, $request );
 		
-			$tf = new Textfilter();
-            $this->blogName = $tf->filterAllHTML( $this->_request->getValue( "blogName" ));
-            $this->blogLocale = $this->_request->getValue( "blogLocale" );
-            $this->userName = $tf->filterAllHTML($this->_request->getValue( "userName" ));
-            $this->userPassword = $tf->filterAllHTML($this->_request->getValue( "userPassword" ));
-            $this->userEmail = $tf->filterAllHTML($this->_request->getValue( "userEmail" ));
-			$this->userFullName = $tf->filterAllHTML($this->_request->getValue( "userFullName" ));
+		$tf = new Textfilter();
+        $this->blogName = $tf->filterAllHTML( $this->_request->getValue( "blogName" ));
+        $this->blogLocale = $this->_request->getValue( "blogLocale" );
+        $this->userName = $tf->filterAllHTML($this->_request->getValue( "userName" ));
+        $this->userPassword = $tf->filterAllHTML($this->_request->getValue( "userPassword" ));
+        $this->userEmail = $tf->filterAllHTML($this->_request->getValue( "userEmail" ));
+		$this->userFullName = $tf->filterAllHTML($this->_request->getValue( "userFullName" ));
 		
     }
     //}}}

Modified: plog/trunk/class/summary/action/summaryaction.class.php
===================================================================
--- plog/trunk/class/summary/action/summaryaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/summary/action/summaryaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,20 +1,144 @@
-<?php
-
-	include_once( PLOG_CLASS_PATH."class/action/action.class.php" );
-	include_once( PLOG_CLASS_PATH."class/summary/view/summaryview.class.php" );
-	include_once( PLOG_CLASS_PATH."class/summary/view/summarycachedview.class.php" );	
-
-	/**
-	 * Base action that all summary actions should extend
-	 */
-	class SummaryAction extends Action
-	{
-		function SummaryAction( $actionInfo, $request )
-		{
-			$this->Action( $actionInfo, $request );
-			$this->_config   = Config::getConfig();
-            $this->_locale   = Locales::getLocale( $this->_config->getValue("default_locale" ));			
-		}
-	}
-	
+<?php
+	include_once( PLOG_CLASS_PATH."class/action/action.class.php" );
+	include_once( PLOG_CLASS_PATH."class/summary/view/summaryview.class.php" );
+	include_once( PLOG_CLASS_PATH."class/summary/view/summarycachedview.class.php" );	
+	include_once( PLOG_CLASS_PATH."class/net/http/httpvars.class.php" );
+
+	define('HTTP_ACCEPT_LANGUAGE_DETECTION', 0);
+
+	/**
+	 * Base action that all summary actions should extend
+	 */
+	class SummaryAction extends Action
+	{
+		
+		function SummaryAction( $actionInfo, $request )
+		{
+			$this->Action( $actionInfo, $request );
+			$this->_config   =& Config::getConfig();
+			$this->_locale   =& $this->_loadLocale();
+		}
+		
+		/**
+		 * Loads the current locale. It works so that it tries to fetch the parameter "lang" from the
+		 * request. If it's not available, then it will try to look for it in the session. If it is not
+		 * there either, it will try to guess the most prefered language according to what the User Agent 
+		 * included in the HTTP_ACCEPT_LANGUAGE string sent with the request. If none matches available 
+		 * languages we have to use the value of "default_locale" and display the default language.
+		 *
+		 * @private
+		 * @return Returns a reference to a Locale object
+		 */
+		function &_loadLocale()
+		{
+		    $requestLocale =& $this->_request->getValue( "lang" );
+		    $localeCode = "";
+			$serverVars =& HttpVars::getServer();
+
+		    // check if there's something in the request... 
+		    // if not, check the session or at least try to 
+			// guess the apropriate languege from the http_accept_lnaguage string
+		    if( $requestLocale ) {
+		        // check if it's a valid one
+		        if( Locales::isValidLocale( $requestLocale )) {
+		            $localeCode = $requestLocale;
+		        }
+		    }
+		    else {
+				$sessionLocale =& SessionManager::getSessionValue( "summaryLang" );
+			    if( $sessionLocale ) {		            
+		            $localeCode = $sessionLocale;
+		        }
+				elseif ( $this->_config->getValue( "use_http_accept_language_detection", HTTP_ACCEPT_LANGUAGE_DETECTION) == 1 )
+				{
+					$localeCode =& $this->_matchHttpAcceptLanguages( $serverVars['HTTP_ACCEPT_LANGUAGE'] );
+				}
+		    }
+		    
+			
+			
+		    // check if the locale code is correct
+			// and as a valid resort, use the default one if the locale ist not valid or 'false'
+		    if( $localeCode === false || !Locales::isValidLocale( $localeCode ) ) {
+		        $localeCode = $this->_config->getValue( "default_locale" );
+		    }
+		    
+		    // now put whatever locale value back to the session
+		    SessionManager::setSessionValue( "summaryLang", $localeCode );
+		    
+		    // load the correct locale
+		    $locale =& Locales::getLocale( $localeCode );		    
+		    
+		    return( $locale );
+		}
+		
+		/**
+		 * Common things that should be performed by all SummaryAction classes
+		 */
+		function setCommonData( $copyFormValues = false )
+		{
+		    parent::setCommonData( $copyFormValues );
+		    
+		    $this->_view->setValue( "locale", $this->_locale );
+		}
+		
+		/**
+		 * Tries to match the prefered language out of the http_accept_language string 
+		 * with one of the available languages.
+		 *
+		 * @private
+		 * @param httpAcceptLanguage the value of $_SERVER['HTTP_ACCEPT_LANGUAGE']
+		 * @return Returns returns prefered language or false if no language matched.
+		 */
+        function _matchHttpAcceptLanguages(&$httpAcceptLanguage)
+        {
+			$acceptedLanguages = explode( ',', $httpAcceptLanguage );
+			$availableLanguages =& Locales::getAvailableLocales();
+			$primaryLanguageMatch = '';
+
+			// we iterate through the array of languages sent by the UA and test every single 
+			// one against the array of available languages
+			foreach($acceptedLanguages as $acceptedLang)
+			{   
+				// clean the string and strip it down to the language value (remove stuff like ";q=0.3")
+				$acceptedLang = substr( $acceptedLang, 0, strcspn($acceptedLang, ';') );
+
+				if (strlen($acceptedLang) > 2)
+				{
+					// cut to primary language
+					$primaryAcceptedLang = substr($acceptedLang, 0, 2);
+				}
+				else
+				{
+					$primaryAcceptedLang = $acceptedLang;
+				}
+				
+				// this is where we start to iterate through available languages
+				foreach($availableLanguages as $availableLang)
+				{ 	
+					if( stristr($availableLang, $acceptedLang) !== false )
+					{
+						// we have a exact language match
+						return $availableLang;
+					}
+					elseif ( stristr($availableLang, $primaryAcceptedLang) !== false && $primaryLanguageMatch == '')
+					{
+						// we found the first primary language match!
+						$primaryLanguageMatch = $availableLang;
+					}
+				}
+			} // foreach
+
+			if ($primaryLanguageMatch != '')
+			{
+				return $primaryLanguageMatch;
+			}
+			else
+			{
+				return false;
+			}
+		}
+
+	}
+	
 ?>
\ No newline at end of file

Modified: plog/trunk/class/summary/action/summarycustompageaction.class.php
===================================================================
--- plog/trunk/class/summary/action/summarycustompageaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/summary/action/summarycustompageaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -29,7 +29,7 @@
 			}
 			else {
 				// let's cache the page... After all, we're not expecting much dynamic context in here!
-				$this->_view = new SummaryCachedView( $this->_page, Array( "page" => $this->_page ));
+				$this->_view = new SummaryCachedView( $this->_page, Array( "page" => $this->_page, "locale" => $this->_locale->getLocaleCode()));
 				$this->setCommonData();
 			}
 			

Modified: plog/trunk/class/summary/action/summarydefaultaction.class.php
===================================================================
--- plog/trunk/class/summary/action/summarydefaultaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/summary/action/summarydefaultaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -28,7 +28,7 @@
          */
         function perform()
         {
-			$this->_view = new SummaryCachedView( "index", Array( "summary" => "default" ));
+			$this->_view = new SummaryCachedView( "index", Array( "summary" => "default", "locale" => $this->_locale->getLocaleCode()));
 			if( $this->_view->isCached()) {
 				// if the view is already cached... move along! nothing to see here
 				return true;
@@ -57,7 +57,6 @@
 			$this->_view->setValue( "commentedPosts", $commentedPosts );
 			$this->_view->setValue( "readestBlogs", $readestBlogs );
 			$this->_view->setValue( "blogs", $siteBlogs );
-            $this->_view->setValue( "locale", $this->_locale );
 		
 			//
 			// :KLUDGE:
@@ -66,6 +65,8 @@
 			$randomBlog = array_pop($siteBlogs);
 			$url = $randomBlog->getBlogRequestGenerator();
 			$this->_view->setValue( "url", $url );
+			
+			$this->setCommonData();
 
             return true;
         }

Modified: plog/trunk/class/summary/action/summaryrssaction.class.php
===================================================================
--- plog/trunk/class/summary/action/summaryrssaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/summary/action/summaryrssaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -76,8 +76,9 @@
             }
 
 			$this->_view->setValue( "posts", $posts );
-            $this->_view->setValue( "locale", $this->_locale );
 			$this->_view->setValue( "summary", true );
+			
+			$this->setCommonData();			
 
             return true;
         }

Modified: plog/trunk/class/summary/action/summarysearchaction.class.php
===================================================================
--- plog/trunk/class/summary/action/summarysearchaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/summary/action/summarysearchaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -48,6 +48,8 @@
 			$this->_view = new SummaryView( "searchresults" );
 			$this->_view->setValue( "searchresults", $results );
 			
+			$this->setCommonData();			
+			
 			return true;
         }
      }

Modified: plog/trunk/class/summary/action/summarysendresetemail.class.php
===================================================================
--- plog/trunk/class/summary/action/summarysendresetemail.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/summary/action/summarysendresetemail.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -65,6 +65,8 @@
 			SummaryTools::sendResetEmail( $userInfo, $resetUrl );
 			
 			$this->_view = new SummaryMessageView( $this->_locale->tr( "password_reset_message_sent_ok" ));
+			
+			$this->setCommonData();			
 	
 			return true;
 		}

Modified: plog/trunk/class/summary/action/userlistaction.class.php
===================================================================
--- plog/trunk/class/summary/action/userlistaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/summary/action/userlistaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -24,7 +24,10 @@
          */
         function perform()
         {
-			$this->_view = new SummaryUserListView();
+            $page = View::getCurrentPageFromRequest();
+			$this->_view = new SummaryUserListView( Array( "summary" => "UserList", 
+			                                               "page" => $page,
+			                                               "locale" => $this->_locale->getLocaleCode()));
 			if( $this->_view->isCached()) {
 				// nothing to do, the view is cached
 				return true;

Modified: plog/trunk/class/summary/action/userprofileaction.class.php
===================================================================
--- plog/trunk/class/summary/action/userprofileaction.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/summary/action/userprofileaction.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -19,7 +19,7 @@
             
             // data validaiton
             $this->registerFieldValidator( "userId", new IntegerValidator());
-            $this->setValidationErrorView( new SummaryCachedView( "userlist", Array( "summary" => "UserList", "page" => 1 )));
+            $this->setValidationErrorView( new SummaryCachedView( "userlist", Array( "summary" => "UserList", "page" => 1, "locale" => $this->_locale->getLocaleCode())));
         }
 		
         /**
@@ -29,7 +29,7 @@
         {
 			$this->_userId = $this->_request->getValue( "userId" );	        
 	        
-			$this->_view = new SummaryCachedView( "userprofile", Array( "summary" => "userProfile", "userId" => $this->_userId ));
+			$this->_view = new SummaryCachedView( "userprofile", Array( "summary" => "userProfile", "userId" => $this->_userId, "locale" => $this->_locale->getLocaleCode()));
 			if( $this->_view->isCached()) {
 				// nothing to do, the view is cached
 				return true;
@@ -40,13 +40,14 @@
 			$userInfo = $users->getUserInfoFromId( $this->_userId, true );
 			
 			if( !$userInfo ) {
-				$this->_view = new SummaryCachedView( "userlist", Array( "summary" => "UserList", "page" => 1 ));
+				$this->_view = new SummaryCachedView( "userlist", Array( "summary" => "UserList", "page" => 1, "locale" => $this->_locale->getLocaleCode()));
 				$this->setCommonData();
 				return false;			
 			}
 			
 			$this->_view->setValue( "user", $userInfo );
-			$this->_view->setValue( "locale", $this->_locale );
+
+			$this->setCommonData();
 		
             return true;
         }

Modified: plog/trunk/class/summary/dao/summarystats.class.php
===================================================================
--- plog/trunk/class/summary/dao/summarystats.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/summary/dao/summarystats.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -12,9 +12,14 @@
 	define( "SUMMARY_DEFAULT_ITEMS_PER_PAGE", 15 );
 
     /**
-     * implements some general methods that return some statistical
-     * data that is used in the summary.php script, and that is not
-     * very useful for anybody else
+     * This class implements a few methods that can be used to obtain the list of most recent blogs, posts, commets,
+     * most commented articles, etc. It is mainly used by the summary.php script but it can also be used by users
+     * wishing to integrate the summary page in their sites.
+     *
+     * @see BlogInfo
+     * @see Article
+     *
+     * \ingroup DAO	
      */
     class SummaryStats extends Model
     {
@@ -29,19 +34,25 @@
          * Returns the most commented articles so far
          *
          * @param maxPosts The maximum number of posts to return
-		 * @param date
 		 * @param ignoreTopic ignore posts based on a certain topic
 		 * @param ignoreText ignore post based on a certain text
          * @return An array of Article objects with the most commented articles
          */
-        function getMostCommentedArticles( $maxPosts = 0, $ignoreTopic = "", $ignoreText = "" ,$date = 0)
+        function getMostCommentedArticles( $maxPosts = 0, $ignoreTopic = "", $ignoreText = "" )
         {
 			$prefix = $this->getPrefix();
 			$query = " SELECT COUNT(*) as total_comments, a.* 
-					   FROM {$prefix}articles_comments AS c, {$prefix}articles AS a, {$prefix}articles_text t
-       				   WHERE c.article_id = a.id AND t.article_id = a.id AND 
-					         a.status = ".POST_STATUS_PUBLISHED." AND
-							 c.status = ".COMMENT_STATUS_NONSPAM;
+					   FROM {$prefix}articles_comments AS c, 
+					        {$prefix}articles AS a, 
+					        {$prefix}articles_text t,
+					        {$prefix}blogs b
+       				   WHERE c.article_id = a.id 
+       				         AND t.article_id = a.id 
+       				         AND a.status = ".POST_STATUS_PUBLISHED." 
+       				         AND c.status = ".COMMENT_STATUS_NONSPAM."
+       				         AND b.id = a.blog_id
+       				         AND b.status = ".BLOG_STATUS_ACTIVE."
+       				         AND a.date <= NOW()";
 
 			// ignore certain topics and/or certain texts
 			/*if( $ignoreTopic != "" )
@@ -80,8 +91,9 @@
          * @return an array of Article objects with information about the posts
          * TODO: perfalmence tuning
          */
-        function getMostReadArticles( $maxPosts = 0, $ignoreTopic = "", $ignoreText = "", $date = 0 )
+        function getMostReadArticles( $maxPosts = 0, $ignoreTopic = "", $ignoreText = "" )
         {
+            $prefix = $this->getPrefix();
 					$query = " SELECT 
                                    a.id as id, 
                                    a.properties as properties, 
@@ -92,22 +104,19 @@
                                    a.num_reads as num_reads,
                                    a.slug as slug,
                                    t.article_id as article_id,
-                                   t.text as text,
-                                   t.topic as topic,
-                                   t.normalized_text as normalized_text,
-                                   t.normalized_topic as normalized_topic,
-                                   t.mangled_topic as mangled_topic
-                               FROM ".$this->getPrefix()."articles a, ".$this->getPrefix()."articles_text t 
+                                   t.text as text
+                               FROM {$prefix}articles a, {$prefix}articles_text t, {$prefix}blogs b
                                WHERE a.id = t.article_id 
-                                   AND status = ".POST_STATUS_PUBLISHED."
-							       AND TO_DAYS(NOW()) - TO_DAYS(date) < 7  ";
+                                   AND a.status = ".POST_STATUS_PUBLISHED."
+							       AND TO_DAYS(NOW()) - TO_DAYS(date) < 7
+							       AND a.blog_id = b.id AND b.status = ".BLOG_STATUS_ACTIVE;
 
 			// ignore certain topics and/or certain texts
 			if( $ignoreTopic != "" )
 				$query .= " AND t.topic NOT LIKE '".Db::qstr( $ignoreTopic )."' ";
 
-			if( $ignoreText != "" )
-				$query .= " AND t.text NOT LIKE '".Db::qstr( $ignoreText )."' ";
+			/*if( $ignoreText != "" )
+				$query .= " AND t.text NOT LIKE '".Db::qstr( $ignoreText )."' ";*/
 
 			$query .= " ORDER BY a.num_reads DESC ";
 
@@ -164,11 +173,10 @@
          * returns an array with the most active blogs
          *
          * @param maxBlogs How many blogs to return
-         * @param date
          * @return An array of BlogInfo objects
          * @see BlogInfo
          */
-         function getMostActiveBlogs($maxBlogs = 0, $date = 0)
+         function getMostActiveBlogs( $maxBlogs = 0 )
          {
 			$prefix = $this->getPrefix();
             $query = "SELECT COUNT(*) as t, SUM((num_reads / (TO_DAYS(NOW()) - TO_DAYS(a.date) + 1)) ) as rank, b.*
@@ -245,16 +253,25 @@
          */
         function getRecentArticles( $maxPosts, $ignoreTopic = "", $ignoreText = "" )
         {
-            $t      = new Timestamp();
-            $date   = $t->getTimestamp();
 			$prefix = $this->getPrefix();
 
 			$query = "SELECT a.id as id, a.id,t.topic,t.text,a.date,
                              a.user_id,a.blog_id, a.status, a.properties,
                              a.num_reads, a.slug
-					  FROM {$prefix}articles a, {$prefix}articles_categories c, {$prefix}article_categories_link l,{$prefix}articles_text t
-					  WHERE t.article_id = a.id AND TO_DAYS(NOW()) - TO_DAYS(a.date) < 7 AND l.article_id = a.id AND l.category_id = c.id AND
-					        c.in_main_page = 1 AND a.status = ".POST_STATUS_PUBLISHED;
+					  FROM {$prefix}articles a, 
+					       {$prefix}articles_categories c, 
+					       {$prefix}article_categories_link l,
+					       {$prefix}articles_text t,
+					       {$prefix}blogs b
+					  WHERE t.article_id = a.id 
+					        AND TO_DAYS(NOW()) - TO_DAYS(a.date) < 7 
+					        AND l.article_id = a.id 
+					        AND l.category_id = c.id 
+					        AND c.in_main_page = 1 
+					        AND a.blog_id = b.id
+					        AND b.status = ".BLOG_STATUS_ACTIVE."
+					        AND a.status = ".POST_STATUS_PUBLISHED."
+					        AND a.date < NOW()";
 
 
 			// in case we'd like to ignore certain posts based on a topic (like the registration message!)
@@ -265,7 +282,7 @@
 			/*if( $ignoreText != "" ) {
 				$query .= " AND t.text NOT LIKE '".Db::qstr( $ignoreText )."' ";
 			}*/
-			$query .= " GROUP BY a.id HAVING COUNT(a.blog_id) = 1 ORDER BY a.date DESC LIMIT 0, $maxPosts";
+			$query .= " GROUP BY a.id ORDER BY a.date DESC LIMIT 0, $maxPosts";
 
             $result = $this->_db->Execute( $query );
 
@@ -313,18 +330,19 @@
             $posts = Array();
             $count = 0;
             $ids   = array();
-
+            $articles = new Articles();
+            
             while( $row = $result->FetchRow()) {
 
                 if (empty($maxPosts))
                 {
-                    array_push( $posts, $this->_fillArticleInformation($row));
+                    array_push( $posts, $articles->_fillArticleInformation($row));
                     $count++;
                 }
                 else if($count <= $maxPosts && empty($ids[$row["blog_id"]]))
                 {
                     $ids[$row["blog_id"]] = true;
-                    array_push( $posts, $this->_fillArticleInformation($row));
+                    array_push( $posts, $articles->_fillArticleInformation($row));
                     $count++;
                 }
             }

Modified: plog/trunk/class/summary/view/doblogregistrationview.class.php
===================================================================
--- plog/trunk/class/summary/view/doblogregistrationview.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/summary/view/doblogregistrationview.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -19,6 +19,10 @@
 			// get the list of languages available, so that users can choose
 			$locales = Locales::getLocales();
 			$this->setValue( "locales", $locales );
+            
+            $config =& Config::getConfig();
+            // assign default Local to template
+            $this->setValue( "defaultLocale", $config->getValue("default_locale" ) );
 			
 			// and render the rest of the contents of the view
 			parent::render();

Modified: plog/trunk/class/summary/view/summarybloglistview.class.php
===================================================================
--- plog/trunk/class/summary/view/summarybloglistview.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/summary/view/summarybloglistview.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -14,12 +14,12 @@
 		var $_numBlogs;
 		var $_numBlogsPerPage;
 	
-		function SummaryBlogListView()
+		function SummaryBlogListView( $data = Array())
 		{
 			// get the page
 			$this->_page = $this->getCurrentPageFromRequest();
 			
-			$this->SummaryCachedView( "blogslist",  Array( "summary" => "BlogList", "page" => $this->_page ) );
+			$this->SummaryCachedView( "blogslist", $data );
 			
 			// items per page
             //$this->_numUsers = $this->_config->getValue( "summary_page_show_max" );
@@ -35,11 +35,6 @@
 				return true;
 			}
 
-			// set the view character set based on the default locale
-            $config =& Config::getConfig();
-            $locale =& Locales::getLocale( $config->getValue( "default_locale" ));			
-			$this->setCharset( $locale->getCharset());			
-			
 			// get the data itself
 			$blogs = new Blogs();
             $siteBlogs = $blogs->getAllBlogs( BLOG_STATUS_ACTIVE, "", $this->_page, $this->_numBlogsPerPage );

Modified: plog/trunk/class/summary/view/summarycachedview.class.php
===================================================================
--- plog/trunk/class/summary/view/summarycachedview.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/summary/view/summarycachedview.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -61,12 +61,25 @@
 			return $isCached;
 		}
 		
+		/**
+		 * @private
+		 */
+		function _getLocale()
+		{
+		    // load the Locale object from the view context or initialize it now
+		    if( $this->_params->keyExists( "locale" )) {
+		        $this->_locale = $this->_params->getValue( "locale" );
+		    }
+		    else {	        
+		        $config =& Config::getConfig();
+		        $this->_locale =& Locales::getLocale( $config->getValue("default_locale" ));		        
+		    }
+		}
+		
 		function sendUncachedOutput()
 		{
-		    $config =& Config::getConfig();
-			$this->_locale =& Locales::getLocale( $config->getValue("default_locale" ));
 			$this->_params->setValue( "version", new Version());
-			$this->_params->setValue( "locale", $this->_locale );
+			$this->_params->setValue( "locale", $this->_locale);
 			$this->_template->assign( $this->_params->getAsArray());
 			print $this->_template->fetch( $this->_viewId );		
 		}
@@ -75,13 +88,13 @@
         function render()
         {
 			// set the view character set based on the default locale
-            $config =& Config::getConfig();
-            $locale =& Locales::getLocale( $config->getValue( "default_locale" ));			
-			$this->setCharset( $locale->getCharset());
+			$this->_getLocale();
+			$this->setCharset( $this->_locale->getCharset());
 			
 			$sendOutput = true;
 			
 			// check if support for conditional HTTP requests is enabled
+			$config =& Config::getConfig();
 			if( $config->getValue( "template_http_cache_enabled" )) {
 				// some debug information
 				$timestamp = $this->_template->getCreationTimestamp();

Modified: plog/trunk/class/summary/view/summaryuserlistview.class.php
===================================================================
--- plog/trunk/class/summary/view/summaryuserlistview.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/summary/view/summaryuserlistview.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -14,13 +14,13 @@
 		var $_numUsers;
 		var $_numUsersPerPage;
 	
-		function SummaryUserListView()
+		function SummaryUserListView( $data = Array())
 		{
 			// get the page id
 			$this->_page = $this->getCurrentPageFromRequest();		
 			
 			// and initialize the cached view
-			$this->SummaryCachedView( "userlist",  Array( "summary" => "UserList", "page" => $this->_page ));
+			$this->SummaryCachedView( "userlist", $data );
 			
 			// items per page
             $config =& Config::getConfig();

Modified: plog/trunk/class/summary/view/summaryview.class.php
===================================================================
--- plog/trunk/class/summary/view/summaryview.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/summary/view/summaryview.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -13,23 +13,36 @@
         function SummaryView( $templateName )
         {
             $this->View();
-            $this->_templateName = $templateName;
+            $this->_templateName = $templateName;            
         }
+        
+        /**
+         * @private
+         */
+        function _getLocale()
+        {
+            // load the Locale object from the view context or initialize it now            
+            if( $this->_params->keyExists( "locale" )) {
+                $this->_locale = $this->_params->getValue( "locale" );
+            }
+            else {	        
+                $config =& Config::getConfig();
+                $this->_locale =& Locales::getLocale( $config->getValue("default_locale" ));		        
+            }
+        }        
 
         function render()
         {
-			// set the view character set based on the default locale
-            $config =& Config::getConfig();
-            $locale =& Locales::getLocale( $config->getValue( "default_locale" ));			
-			$this->setCharset( $locale->getCharset());
+			// load the locale
+			$this->_getLocale();
+			// set the view character set based on the locale			
+			$this->setCharset( $this->_locale->getCharset());
 
 			parent::render();
 		
             $templateService = new TemplateService();
             $template = $templateService->customTemplate( $this->_templateName, "summary" );
 
-            $config =& Config::getConfig();
-            $this->_locale =& Locales::getLocale( $config->getValue("default_locale" ));
             $this->_params->setValue( "version", new Version());
             $this->_params->setValue( "locale", $this->_locale );
             $template->assign( $this->_params->getAsArray());

Modified: plog/trunk/class/template/cachecontrol.class.php
===================================================================
--- plog/trunk/class/template/cachecontrol.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/template/cachecontrol.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -54,7 +54,8 @@
 			$tmpFolder = $config->getValue( "temp_folder" );
 			$summaryTmpFolder = $tmpFolder."/summary";
 			
-			File::deleteDir( $summaryTmpFolder );
+			// delete the contents of the folder, but not its structure or subfolders
+			File::deleteDir( $summaryTmpFolder, true, true );
 			
 			return true;		
 		}
@@ -89,7 +90,8 @@
 			$blogTmpFolder = $tmpFolder."/".$blogId;
             //$t->cache_dir    = $blogTmpFolder;
             //$t->compile_dir  = $blogTmpFolder;
-			File::deleteDir( $blogTmpFolder, true );
+			// recursively delete the contents of the folder, but not its structure or subfolders            
+			File::deleteDir( $blogTmpFolder, true, true );
 			
 			//$t->clear_cache( null );
 			

Modified: plog/trunk/class/template/templatesets/templatesets.class.php
===================================================================
--- plog/trunk/class/template/templatesets/templatesets.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/template/templatesets/templatesets.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -152,7 +152,6 @@
 				$templateSet = new TemplateSet( $templateName, TEMPLATE_SET_BLOG_SPECIFIC, $blogId );
 			else {
 				$templateSet = null;
-				$this->log->error( "template $templateName for blog $blogId does not exist as either global or blog-specific!" );
 			}
 
 			return $templateSet;

Modified: plog/trunk/class/template/templateutils.class.php
===================================================================
--- plog/trunk/class/template/templateutils.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/template/templateutils.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -54,12 +54,14 @@
         {
         	$textFilter = new TextFilter();
             $result = $textFilter->cutText( $post->getText(), $maxWords );
+            $config =& Config::getConfig();
             if( $result != $post->getText()) {
             	$rg =& RequestGenerator::getRequestGenerator();
                 $rg->addParameter( "op", "ViewArticle" );
                 $rg->addParameter( "articleId", $post->getId());
                 $rg->addParameter( "blogId", $this->_blogInfo->getId());
-                $showMoreLink = " <a href=\"index.php".$rg->getRequest()."\">".$linkText."</a>";
+            	$indexPage = $config->getValue( "script_name", "index.php" );                
+                $showMoreLink = " <a href=\"$indexPage".$rg->getRequest()."\">".$linkText."</a>";
                 $result .= $showMoreLink;
             }
 

Modified: plog/trunk/class/view/admin/admineditpostview.class.php
===================================================================
--- plog/trunk/class/view/admin/admineditpostview.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/view/admin/admineditpostview.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -3,9 +3,9 @@
 	include_once( PLOG_CLASS_PATH."class/view/admin/adminnewpostview.class.php" );
 	include_once( PLOG_CLASS_PATH."class/dao/articlenotifications.class.php" );
 	
-    /**
-     * \ingroup View
-     * @private
+    /**
+     * \ingroup View
+     * @private
      *	
 	 * shows the view that will allow to edit an article
 	 */
@@ -50,8 +50,8 @@
 	            
 	            // set information about the post itself into the view
 	            $this->setValue( "postTopic", $this->_article->getTopic());
-	            $this->setValue( "postText", $this->_article->getIntroText());
-	            $this->setValue( "postExtendedText", $this->_article->getExtendedText());
+	            $this->setValue( "postText", preg_replace('/&/', '&amp;', $this->_article->getIntroText()));
+	            $this->setValue( "postExtendedText", preg_replace('/&/','&amp;',$this->_article->getExtendedText()));
 	            $this->setValue( "postSlug", $this->_article->getPostSlug());
 	            $this->setValue( "postId", $this->_article->getId());
 	            if( $this->_article->getCommentsEnabled())

Modified: plog/trunk/class/view/admin/adminpostslistview.class.php
===================================================================
--- plog/trunk/class/view/admin/adminpostslistview.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/view/admin/adminpostslistview.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -58,6 +58,9 @@
             $t = new Timestamp();
             $curyear = (int)$t->getYear();
             $curmonth = (int)$t->getMonth();
+            
+            $archiveDateFormat = $this->_locale->tr( "archive_date_format" );
+            if( $archiveDateFormat == "archive_date_format" ) $archiveDateFormat = "%B %Y";
 
             foreach( $archiveStats as $yearName => $year) {
             	foreach( $year as $monthName => $month ) {
@@ -74,7 +77,7 @@
             	       // there goes the dirty hack :P
             	       if( $yearName == $curyear && $monthName < $curmonth ) {
             	            $t = new Timestamp();
-                            $name = $this->_locale->formatDate( $t, "%B %Y" );
+                            $name = $this->_locale->formatDate( $t, $archiveDateFormat );
                             $monthStr = Array( "name" => $name, 
                                        "date" => $this->_locale->formatDate($t, "%Y%m"));
                             array_push( $result, $monthStr );
@@ -87,7 +90,7 @@
                 	$t = new Timestamp( "" );
                     $t->setYear( $yearName );
                     $t->setMonth( $monthName );
-                    $name = $this->_locale->formatDate( $t, "%B %Y" );
+                    $name = $this->_locale->formatDate( $t, $archiveDateFormat );
                     $monthStr = Array( "name" => $name, 
                                        "date" => $this->_locale->formatDate($t, "%Y%m"));
                     array_push( $result, $monthStr );                    

Modified: plog/trunk/class/view/blogview.class.php
===================================================================
--- plog/trunk/class/view/blogview.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/view/blogview.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -12,6 +12,11 @@
     include_once( PLOG_CLASS_PATH.'class/dao/mylinkscategories.class.php' ); 
     include_once( PLOG_CLASS_PATH.'class/plugin/pluginmanager.class.php' );
     include_once( PLOG_CLASS_PATH.'class/xml/rssparser/rssparser.class.php' );    
+    
+    /**
+     * default date format used for the archive links
+     */
+    define( "ARCHIVE_DEFAULT_DATE_FORMAT", '%B %Y' );
 
     /**
      * \ingroup View
@@ -88,6 +93,13 @@
             $links = Array();
             $locale = $this->_blogInfo->getLocale();
             $urls = $this->_blogInfo->getBlogRequestGenerator();
+            
+            // format of dates used in the archive, but it defaults to '%B %Y' if none specified
+            $archiveDateFormat = $locale->tr( 'archive_date_format' );      
+            // need to check whether we got the same thing back, since that's the way Locale::tr() works instead of
+            // returning an empty string      
+            if( $archiveDateFormat == "archive_date_format" ) $archiveDateFormat = ARCHIVE_DEFAULT_DATE_FORMAT;
+            
             foreach( $archiveStats as $yearName => $year) {
             	foreach( $year as $monthName => $month ) {
                 	// we can use the Timestamp class to help us with this...
@@ -95,7 +107,7 @@
                     $t->setYear( $yearName );
                     $t->setMonth( $monthName );
                     $archiveUrl = $urls->getArchiveLink( $t->getYear().$t->getMonth());
-                    $linkName = $locale->formatDate( $t, '%B %Y' );
+                    $linkName = $locale->formatDate( $t, $archiveDateFormat );
                 	$link = new ArchiveLink( $linkName, '', $archiveUrl, $this->_blogInfo->getId(), 0, $month, 0);
                     $links[] = $link;
                 }

Modified: plog/trunk/class/view/view.class.php
===================================================================
--- plog/trunk/class/view/view.class.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/view/view.class.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -277,6 +277,7 @@
 		 * gets the current page from the HTTP request
 		 *
 		 * @return the page number from the request
+		 * @static
 		 */
 		function getCurrentPageFromRequest()
 		{

Modified: plog/trunk/class/xml/tree/Node.php
===================================================================
--- plog/trunk/class/xml/tree/Node.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/xml/tree/Node.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -223,7 +223,7 @@
 			$pos = count($this->children);
 
         if (($pos < -count($this->children)) || ($pos > count($this->children))) {
-            _debug("Invalid insert position.");
+            //_debug("Invalid insert position.");
 			return false;
         }
 
@@ -248,7 +248,7 @@
             }
             $this->children[$pos] = $child->root;
         } else {
-            _debug("Bad node (must be a XML_Tree or an XML_Tree_Node)");
+            //_debug("Bad node (must be a XML_Tree or an XML_Tree_Node)");
 			return false;
         }
         } else { // child offered is a string
@@ -519,7 +519,7 @@
         }
 
         // No node with that name found
-        _debug("Bad path to node: [".implode('/', $path)."]");
+        //_debug("Bad path to node: [".implode('/', $path)."]");
 		
 		return false;
     }

Modified: plog/trunk/class/xml/tree/Tree.php
===================================================================
--- plog/trunk/class/xml/tree/Tree.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/class/xml/tree/Tree.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -461,19 +461,19 @@
     function &getNodeAt($path)
     {
 	    if (is_null($this->root)){
-			_debug("XML_Tree hasn't got a root node");
+			//_debug("XML_Tree hasn't got a root node");
             return false;
         }
         if (is_string($path))
             $path = explode("/", $path);
         if (sizeof($path) == 0) {
-			_debug("Path '$path' to node is empty");		
+			//_debug("Path '$path' to node is empty");		
 			return false;
         }
         $path1 = $path;
         $rootName = array_shift($path1);
         if ($this->root->name != $rootName) {
-            _debug("Path '$path' does not match the document root");
+            //_debug("Path '$path' does not match the document root");
 			return false;
         }
         $x =& $this->root->getNodeAt($path1);
@@ -482,7 +482,7 @@
             return $x;
         }
         // No node with that name found
-        _debug("Bad path '$path' to node 2: [".implode('/', $path)."]");
+        //_debug("Bad path '$path' to node 2: [".implode('/', $path)."]");
 		return false;
     }
 

Modified: plog/trunk/config/config.properties.php
===================================================================
--- plog/trunk/config/config.properties.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/config/config.properties.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,10 +1,10 @@
-<?php
-#
-# database settings
-#
-$config["db_host"] = "";
-$config["db_username"] = "";
-$config["db_password"] = "";
-$config["db_database"] = "";
-$config["db_prefix"] = "";
-?>
+<?php
+#
+# database settings
+#
+
+$config["db_host"] = "";
+$config["db_username"] = "";
+$config["db_password"] = "";
+$config["db_database"] = "";
+$config["db_prefix"] = "";
\ No newline at end of file

Modified: plog/trunk/index.php
===================================================================
--- plog/trunk/index.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/index.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -2,12 +2,15 @@
 
 //xdebug_start_profiling();
 
+    // please enable the line below if you are having memory problems
+    //ini_set('memory_limit', "16M");
+
     if (!defined( "PLOG_CLASS_PATH" )) {
         define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
     }
 
     include_once( PLOG_CLASS_PATH."class/controller/blogcontroller.class.php" );
-	include_once( PLOG_CLASS_PATH."class/net/http/session/sessionmanager.class.php" );
+    include_once( PLOG_CLASS_PATH."class/net/http/session/sessionmanager.class.php" );
     include_once( PLOG_CLASS_PATH."class/dao/userinfo.class.php" );
     include_once( PLOG_CLASS_PATH."class/dao/bloginfo.class.php" );
     include_once( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );
@@ -25,10 +28,10 @@
                Please remove it first to continue.");
         die();
     }
-	
-	// initialize the session
-	SessionManager::init();
 
+    // initialize the session
+    SessionManager::init();
+
     $controller = new BlogController();
 
     // load the plugins, this needs to be done *before* we call the

Modified: plog/trunk/js/calendar/datetimepicker.js
===================================================================
--- plog/trunk/js/calendar/datetimepicker.js	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/js/calendar/datetimepicker.js	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,605 +1,639 @@
-//Javascript name: My Date Time Picker
-//Date created: 16-Nov-2003 23:19
-//Scripter: TengYong Ng
-//Website: http://www.rainforestnet.com
-//Copyright (c) 2003 TengYong Ng
-//FileName: DateTimePicker.js
-//Version: 1.6
-//Contact: contact at rainforestnet.com
-// Note: Permission given to use this script in ANY kind of applications if
+//Javascript name: My Date Time Picker
+//Date created: 16-Nov-2003 23:19
+//Scripter: TengYong Ng
+//Website: http://www.rainforestnet.com
+//Copyright (c) 2003 TengYong Ng
+//FileName: DateTimePicker.js
+//Version: 1.8.2
+//Contact: contact at rainforestnet.com
+// Note: Permission given to use and modify this script in ANY kind of applications if
 //       header lines are left unchanged.
-
-//Global variables
-var winCal;
-var dtToday=new Date();
-var Cal;
-var docCal;
-var MonthName=["January", "February", "March", "April", "May", "June","July",
-	"August", "September", "October", "November", "December"];
-var WeekDayName=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
-var exDateTime;//Existing Date and Time
-
-//Configurable parameters
-var cnTop="200";//top coordinate of calendar window.
-var cnLeft="500";//left coordinate of calendar window
-var WindowTitle ="DateTime Picker";//Date Time Picker title.
-var WeekChar=2;//number of character for week day. if 2 then Mo,Tu,We. if 3 then Mon,Tue,Wed.
-var CellWidth=20;//Width of day cell.
-var DateSeparator="/";//Date Separator, you can change it to "/" if you want.
-var TimeMode=24;//default TimeMode value. 12 or 24
-
-var ShowLongMonth=true;//Show long month name in Calendar header. example: "January".
-var ShowMonthYear=false;//Show Month and Year in Calendar header.
-var MonthYearColor="#cc0033";//Font Color of Month and Year in Calendar header.
-var WeekHeadColor="#0099CC";//Background Color in Week header.
-var SundayColor="#6699FF";//Background color of Sunday.
-var SaturdayColor="#CCCCFF";//Background color of Saturday.
-var WeekDayColor="white";//Background color of weekdays.
-var FontColor="blue";//color of font in Calendar day cell.
-var TodayColor="#FFFF33";//Background color of today.
-var SelDateColor="#FFFF99";//Backgrond color of selected date in textbox.
-var YrSelColor="#cc0033";//color of font of Year selector.
-var MthSelColor="#cc0033";//color of font of Month selector if "MonthSelector" is "arrow".
-var MonthSelector="dropdown";//Month selector can be "arrow" or "dropdown", case insensitive. [arrow|dropdown]
-var ThemeBg="";//Background image of Calendar window.
-var PrecedeZero=true;//Preceding zero of Date or Month. [true|false]
-var StartDay = 1; // 0 = sunday, 1=monday
-var imgDir = 'js/calendar/'; // folder where images are stored
-var ShowSeconds = false; // wether to show the seconds in the time or not
-var CalendarBgColor = "#F6F2E6";
-//end Configurable parameters
-//end Global variable
-
-function NewCal(pCtrl,pFormat,pShowTime,pTimeMode,pScroller)
-{
-	Cal=new Calendar(dtToday);
-	if ((pShowTime!=null) && (pShowTime))
-	{
-		Cal.ShowTime=true;
-		if ((pTimeMode!=null) &&((pTimeMode=='12')||(pTimeMode=='24')))
-		{
-			TimeMode=pTimeMode;
-		}		
-	}
-	if (pCtrl!=null)
-		Cal.Ctrl=pCtrl;
-	if (pFormat!=null)
-		Cal.Format=pFormat.toUpperCase();
-	if (pScroller!=null)
-	{
-		if (pScroller.toUpperCase()=="ARROW")
-		{
-			Cal.Scroller="ARROW";
-		}
-    }		
-	
-	exDateTime=document.getElementById(pCtrl).value;
-	if (exDateTime!="")//Parse Date String
-	{
-		var Sp1;//Index of Date Separator 1
-		var Sp2;//Index of Date Separator 2 
-		var tSp1;//Index of Time Separator 1
-		var tSp1;//Index of Time Separator 2
-		var strMonth;
-		var strDate;
-		var strYear;
-		var intMonth;
-		var YearPattern;
-		var strHour;
-		var strMinute;
-		var strSecond;
-		var winHeight;
-		//parse month
-		Sp1=exDateTime.indexOf(DateSeparator,0)
-		Sp2=exDateTime.indexOf(DateSeparator,(parseInt(Sp1)+1));
-		
-		if ((Cal.Format.toUpperCase()=="DDMMYYYY") || (Cal.Format.toUpperCase()=="DDMMMYYYY"))
-		{
-			strMonth=exDateTime.substring(Sp1+1,Sp2);
-			strDate=exDateTime.substring(0,Sp1);
-			strYear=exDateTime.substring(Sp2+1,Sp2+5);
-		}
-		else if ((Cal.Format.toUpperCase()=="MMDDYYYY") || (Cal.Format.toUpperCase()=="MMMDDYYYY"))
-		{
-			strMonth=exDateTime.substring(0,Sp1);
-			strDate=exDateTime.substring(Sp1+1,Sp2);
-			strYear=exDateTime.substring(Sp2+1,Sp2+5);
-
-		}
-		else if ((Cal.Format.toUpperCase()=="YYYYMMDD") || (Cal.Format.toUpperCase()=="YYYYMMMDD"))
-		{
-			strMonth=exDateTime.substring(Sp1+1,Sp2);
-			strDate=exDateTime.substring(Sp2+1,Sp2+3);
-			strYear=exDateTime.substring(0,Sp1);
-		}
-
-		if (isNaN(strMonth))
-			intMonth=Cal.GetMonthIndex(strMonth);
-		else
-			intMonth=parseInt(strMonth,10)-1;	
-		if ((parseInt(intMonth,10)>=0) && (parseInt(intMonth,10)<12))
-			Cal.Month=intMonth;
-		//end parse month
-		//parse Date
-		if ((parseInt(strDate,10)<=Cal.GetMonDays()) && (parseInt(strDate,10)>=1))
-			Cal.Date=strDate;
-		//end parse Date
-		//parse year
-		YearPattern=/^\d{4}$/;
-		if (YearPattern.test(strYear))
-			Cal.Year=parseInt(strYear,10);
-		//end parse year
-		//parse time
-		if (Cal.ShowTime==true)
-		{
-			tSp1=exDateTime.indexOf(":",0)
-			tSp2=exDateTime.indexOf(":",(parseInt(tSp1)+1));
-			strHour=exDateTime.substring(tSp1,(tSp1)-2);
-			Cal.SetHour(strHour);
-			strMinute=exDateTime.substring(tSp1+1,tSp2);
-			Cal.SetMinute(strMinute);
-            if( ShowSeconds ) {
-			  strSecond=exDateTime.substring(tSp2+1,tSp2+3);
-            }
-            else {
-              strSecond = '00';
-            }
-			Cal.SetSecond(strSecond);
-		}
-	}
-	var Agent=navigator.userAgent.toUpperCase();
-	if (Agent.indexOf("FIREBIRD")==-1)//for Mozilla Firebird
-		winHeight=200;
-	else
-		winHeight=200;
-	winCal=window.open("","DateTimePicker","toolbar=0,status=0,menubar=0,fullscreen=no,width=200,height="+winHeight+",resizable=0,top="+cnTop+",left="+cnLeft);
-	docCal=winCal.document;
-	RenderCal();
-}
-
-function RenderCal()
-{
-	var vCalHeader;
-	var vCalData;
-	var vCalTime;
-	var i;
-	var j;
-	var SelectStr;
-	var vDayCount=0;
-	var vFirstDay;
-
-	docCal.open();
-	docCal.writeln("<html><head><title>"+WindowTitle+"</title>");
-	docCal.writeln("<script>var winMain=window.opener;</script>");//winMain is window that open calendar window.
-	docCal.writeln("</head><body bgcolor=\""+CalendarBgColor+"\" background='"+ThemeBg+"' link="+FontColor+" vlink="+FontColor+"><form name='Calendar'>");
-
-	vCalHeader="<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" width=\"100%\" align=\"center\" valign=\"top\">\n";
-	//Table for Month & Year Selector
-	vCalHeader+="<tr>\n<td colspan='7'><table border=0 width='100%' cellpadding=0 cellspacing=0><tr>\n";
-
-	//******************Month selector in dropdown list************************
-	if (Cal.Scroller=="DROPDOWN")
-	{
-		vCalHeader+="<td align='left'><select name=\"MonthSelector\" onChange=\"javascript:winMain.Cal.SwitchMth(this.selectedIndex);winMain.RenderCal();\">\n";
-		for (i=0;i<12;i++)
-		{
-			if (i==Cal.Month)
-				SelectStr="Selected";
-			else
-				SelectStr="";	
-			vCalHeader+="<option "+SelectStr+" value >"+MonthName[i]+"\n";
-		}
-		vCalHeader+="</select></td>";
-		//Year selector
-		vCalHeader+="\n<td align='right'><a href=\"javascript:winMain.Cal.DecYear();winMain.RenderCal()\"><b><font color=\""+YrSelColor+"\"><img border=\"0\" src=\""+imgDir+"left1.gif\" alt=\"&lt;\"/></font></b></a><font face=\"Verdana\" color=\""+YrSelColor+"\" size=2><b> "+Cal.Year+" </b></font><a href=\"javascript:winMain.Cal.IncYear();winMain.RenderCal()\"><b><font color=\""+YrSelColor+"\"><img border=\"0\" src=\""+imgDir+"right1.gif\" alt=\"&gt;\"/></font></b></a></td></tr></table></td>\n";
-		vCalHeader+="</tr>";
-	}
-	//******************End Month selector in dropdown list*********************
-	//******************Month selector in arrow*********************************
-	else if (Cal.Scroller=="ARROW")
-	{
-		vCalHeader+="<td align='center'><a href='javascript:winMain.Cal.DecYear();winMain.RenderCal();'>- </a></td>";//Year scroller (decrease 1 year)
-		vCalHeader+="<td align='center'><a href='javascript:winMain.Cal.DecMonth();winMain.RenderCal();'>&lt;</a></td>";//Month scroller (decrease 1 month)
-		vCalHeader+="<td align='center' width='70%'><font face='Verdana' size='2' color='"+YrSelColor+"'><b>"+Cal.GetMonthName(ShowLongMonth)+" "+Cal.Year+"</b></font></td>"//Month and Year
-		vCalHeader+="<td align='center'><a href='javascript:winMain.Cal.IncMonth();winMain.RenderCal();'>&gt;</a></td>";//Month scroller (increase 1 month)
-		vCalHeader+="<td align='center'><a href='javascript:winMain.Cal.IncYear();winMain.RenderCal();'>+</a></td>";//Year scroller (increase 1 year)
-		vCalHeader+="</tr></table></td></tr>"
-	}
-    //******************End Month selector in arrow******************************
-	//Calendar header shows Month and Year
-	if ((ShowMonthYear)&&(Cal.Scroller=="DROPDOWN"))
-		vCalHeader+="<tr><td colspan='7'><font face='Verdana' size='2' align='center' color='"+MonthYearColor+"'><b>"+Cal.GetMonthName(ShowLongMonth)+" "+Cal.Year+"</b></font></td></tr>\n";
-	//Week day header
-	vCalHeader+="<tr bgcolor="+WeekHeadColor+">";
-    if(StartDay==0) {
-	  for (i=0;i<7;i++)
-	  {
-		  vCalHeader+="<td align='center'><font face='Verdana'   size='2'>"+WeekDayName[i].substr(0,WeekChar)+"</font></td>";
-	  }
-    }
-    else
-    {
-      // print monday as the first day, but then we have to print sunday manually instead
-      // of inside the loop
-	  for (i=1;i<7;i++)
-	  {
-		  vCalHeader+="<td align='center'><font face='Verdana'   size='2'>"+WeekDayName[i].substr(0,WeekChar)+"</font></td>";
-	  }
-	  vCalHeader+="<td align='center'><font face='Verdana'   size='2'>"+WeekDayName[0].substr(0,WeekChar)+"</font></td>";
-    }
-	vCalHeader+="</tr>";
-	docCal.write(vCalHeader);
-	
-	//Calendar detail
-	CalDate=new Date(Cal.Year,Cal.Month);
-	CalDate.setDate(1);
-	vFirstDay=CalDate.getDay();
-	vCalData="<tr>";
-
-    // i will be '0' if StartDay is Sunday ('0') or
-    // '1' if it's Monday ('1')
-	for (i=StartDay;i<vFirstDay;i++)
-	{
-	 vCalData=vCalData+GenCell();
-	 vDayCount=vDayCount+1;
-	}
-
-	for (j=1;j<=Cal.GetMonDays();j++)
-	{
-		var strCell;
-		vDayCount=vDayCount+1;
-		if ((j==dtToday.getDate())&&(Cal.Month==dtToday.getMonth())&&(Cal.Year==dtToday.getFullYear()))
-			strCell=GenCell(j,true,TodayColor);//Highlight today's date
-		else
-		{
-			if (j==Cal.Date)
-			{
-				strCell=GenCell(j,true,SelDateColor);
-			}
-			else
-			{
-              if( StartDay == 0 ) {
-				if (vDayCount%7==0)
-					strCell=GenCell(j,false,SaturdayColor);
-				else if ((vDayCount+6)%7==0)
-					strCell=GenCell(j,false,SundayColor);
-				else
-					strCell=GenCell(j,null,WeekDayColor);
-              }
-              if( StartDay == 1 ) {
-				if (vDayCount%7==0)
-					strCell=GenCell(j,false,SundayColor);
-				else if ((vDayCount+1)%7==0)
-					strCell=GenCell(j,false,SaturdayColor);
-				else
-					strCell=GenCell(j,null,WeekDayColor);
-              }
-			}
-		}
-		vCalData=vCalData+strCell;
-
-		if((vDayCount%7==0)&&(j<Cal.GetMonDays()))
-		{
-			vCalData=vCalData+"</tr>\n<tr>";
-		}
-	}
-	docCal.writeln(vCalData);	
-	//Time picker
-	if (Cal.ShowTime)
-	{
-		var showHour;
-		showHour=Cal.getShowHour();
-		vCalTime="<tr>\n<td colspan='7' align='center'>";
-		vCalTime+="<input type='text' name='hour' maxlength=2 size=1 style=\"WIDTH: 22px\" value="+showHour+" onchange=\"javascript:winMain.Cal.SetHour(this.value)\">";
-		vCalTime+=" : ";
-		vCalTime+="<input type='text' name='minute' maxlength=2 size=1 style=\"WIDTH: 22px\" value="+Cal.Minutes+" onchange=\"javascript:winMain.Cal.SetMinute(this.value)\">";
-        if( ShowSeconds ) {
-		  vCalTime+=" : ";
-		  vCalTime+="<input type='text' name='second' maxlength=2 size=1 style=\"WIDTH: 22px\" value="+Cal.Seconds+" onchange=\"javascript:winMain.Cal.SetSecond(this.value)\">";
-        }
-		if (TimeMode==12)
-		{
-			var SelectAm =(parseInt(Cal.Hours,10)<12)? "Selected":"";
-			var SelectPm =(parseInt(Cal.Hours,10)>=12)? "Selected":"";
-
-			vCalTime+="<select name=\"ampm\" onchange=\"javascript:winMain.Cal.SetAmPm(this.options[this.selectedIndex].value);\">";
-			vCalTime+="<option "+SelectAm+" value=\"AM\">AM</option>";
-			vCalTime+="<option "+SelectPm+" value=\"PM\">PM<option>";
-			vCalTime+="</select>";
-		}	
-		vCalTime+="\n</td>\n</tr>";
-		docCal.write(vCalTime);
-	}	
-	//end time picker
-	docCal.writeln("\n</table>");
-	docCal.writeln("</form></body></html>");
-	docCal.close();
-}
-
-function GenCell(pValue,pHighLight,pColor)//Generate table cell with value
-{
-	var PValue;
-	var PCellStr;
-	var vColor;
-	var vHLstr1;//HighLight string
-	var vHlstr2;
-	var vTimeStr;
-	
-	if (pValue==null)
-		PValue="";
-	else
-		PValue=pValue;
-	
-	if (pColor!=null)
-		vColor="bgcolor=\""+pColor+"\"";
-	else
-		vColor="";	
-	if ((pHighLight!=null)&&(pHighLight))
-		{vHLstr1="color='red'><b>";vHLstr2="</b>";}
-	else
-		{vHLstr1=">";vHLstr2="";}	
-	
-	if (Cal.ShowTime)
-	{
-    	if( ShowSeconds ) {
-		  vTimeStr="winMain.document.getElementById('"+Cal.Ctrl+"').value+=' '+"+"winMain.Cal.getShowHour()"+"+':'+"+"winMain.Cal.Minutes"+"+':'+"+"winMain.Cal.Seconds";
-        }
-        else {
-		  vTimeStr="winMain.document.getElementById('"+Cal.Ctrl+"').value+=' '+"+"winMain.Cal.getShowHour()"+"+':'+"+"winMain.Cal.Minutes";
-        }
-		if (TimeMode==12)
-			vTimeStr+="+' '+winMain.Cal.AMorPM";
-	}	
-	else
-		vTimeStr="";		
-	PCellStr="<td "+vColor+" width="+CellWidth+" align='center'><font face='verdana' size='2'"+vHLstr1+"<a href=\"javascript:winMain.document.getElementById('"+Cal.Ctrl+"').value='"+Cal.FormatDate(PValue)+"';"+vTimeStr+";window.close();\">"+PValue+"</a>"+vHLstr2+"</font></td>";
-	return PCellStr;
-}
-
-function Calendar(pDate,pCtrl)
-{
-	//Properties
-	this.Date=pDate.getDate();//selected date
-	this.Month=pDate.getMonth();//selected month number
-	this.Year=pDate.getFullYear();//selected year in 4 digits
-	this.Hours=pDate.getHours();
-	
-	if (pDate.getMinutes()<10)
-		this.Minutes="0"+pDate.getMinutes();
-	else
-		this.Minutes=pDate.getMinutes();
-	
-	if (pDate.getSeconds()<10)
-		this.Seconds="0"+pDate.getSeconds();
-	else		
-		this.Seconds=pDate.getSeconds();
-		
-	this.MyWindow=winCal;
-	this.Ctrl=pCtrl;
-	this.Format="ddMMyyyy";
-	this.Separator=DateSeparator;
-	this.ShowTime=false;
-	this.Scroller="DROPDOWN";
-	if (pDate.getHours()<12)
-		this.AMorPM="AM";
-	else
-		this.AMorPM="PM";	
-}
-
-function GetMonthIndex(shortMonthName)
-{
-	for (i=0;i<12;i++)
-	{
-		if (MonthName[i].substring(0,3).toUpperCase()==shortMonthName.toUpperCase())
-		{	return i;}
-	}
-}
-Calendar.prototype.GetMonthIndex=GetMonthIndex;
-
-function IncYear()
-{	Cal.Year++;}
-Calendar.prototype.IncYear=IncYear;
-
-function DecYear()
-{	Cal.Year--;}
-Calendar.prototype.DecYear=DecYear;
-
-function IncMonth()
-{	
-	Cal.Month++;
-	if (Cal.Month>=12)
-	{
-		Cal.Month=0;
-		Cal.IncYear();
-	}
-}
-Calendar.prototype.IncMonth=IncMonth;
-
-function DecMonth()
-{	
-	Cal.Month--;
-	if (Cal.Month<0)
-	{
-		Cal.Month=11;
-		Cal.DecYear();
-	}
-}
-Calendar.prototype.DecMonth=DecMonth;
-	
-function SwitchMth(intMth)
-{	Cal.Month=intMth;}
-Calendar.prototype.SwitchMth=SwitchMth;
-
-function SetHour(intHour)
-{	
-	var MaxHour;
-	var MinHour;
-	if (TimeMode==24)
-	{	MaxHour=23;MinHour=0}
-	else if (TimeMode==12)
-	{	MaxHour=12;MinHour=1}
-	else
-		alert("TimeMode can only be 12 or 24");		
-	var HourExp=new RegExp("^\\d\\d$");
-	if (HourExp.test(intHour) && (parseInt(intHour,10)<=MaxHour) && (parseInt(intHour,10)>=MinHour))
-	{	
-		if ((TimeMode==12) && (Cal.AMorPM=="PM"))
-		{
-			if (parseInt(intHour,10)==12)
-				Cal.Hours=12;
-			else	
-				Cal.Hours=parseInt(intHour,10)+12;
-		}	
-		else if ((TimeMode==12) && (Cal.AMorPM=="AM"))
-		{
-			if (intHour==12)
-				intHour-=12;
-			Cal.Hours=parseInt(intHour,10);
-		}
-		else if (TimeMode==24)
-			Cal.Hours=parseInt(intHour,10);	
-	}
-}
-Calendar.prototype.SetHour=SetHour;
-
-function SetMinute(intMin)
-{
-	var MinExp=new RegExp("^\\d\\d$");
-	if (MinExp.test(intMin) && (intMin<60))
-		Cal.Minutes=intMin;
-}
-Calendar.prototype.SetMinute=SetMinute;
-
-function SetSecond(intSec)
-{	
-	var SecExp=new RegExp("^\\d\\d$");
-	if (SecExp.test(intSec) && (intSec<60))
-		Cal.Seconds=intSec;
-}
-Calendar.prototype.SetSecond=SetSecond;
-
-function SetAmPm(pvalue)
-{
-	this.AMorPM=pvalue;
-	if (pvalue=="PM")
-	{
-		this.Hours=(parseInt(this.Hours,10))+12;
-		if (this.Hours==24)
-			this.Hours=12;
-	}
-	else if (pvalue=="AM")
-		this.Hours-=12;	
-}
-Calendar.prototype.SetAmPm=SetAmPm;
-
-function getShowHour()
-{
-	var finalHour;
-    if (TimeMode==12)
-    {
-    	if (parseInt(this.Hours,10)==0)
-		{
-			this.AMorPM="AM";
-			finalHour=parseInt(this.Hours,10)+12;	
-		}
-		else if (parseInt(this.Hours,10)==12)
-		{
-			this.AMorPM="PM";
-			finalHour=12;
-		}		
-		else if (this.Hours>12)
-		{
-			this.AMorPM="PM";
-			if ((this.Hours-12)<10)
-				finalHour="0"+((parseInt(this.Hours,10))-12);
-			else
-				finalHour=parseInt(this.Hours,10)-12;	
-		}
-		else
-		{
-			this.AMorPM="AM";
-			if (this.Hours<10)
-				finalHour="0"+parseInt(this.Hours,10);
-			else
-				finalHour=this.Hours;	
-		}
-	}
-	else if (TimeMode==24)
-	{
-		if (this.Hours<10)
-			finalHour="0"+parseInt(this.Hours,10);
-		else	
-			finalHour=this.Hours;
-	}	
-	return finalHour;	
-}				
-Calendar.prototype.getShowHour=getShowHour;		
-
-function GetMonthName(IsLong)
-{
-	var Month=MonthName[this.Month];
-	if (IsLong)
-		return Month;
-	else
-		return Month.substr(0,3);
-}
-Calendar.prototype.GetMonthName=GetMonthName;
-
-function GetMonDays()//Get number of days in a month
-{
-	var DaysInMonth=[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
-	if (this.IsLeapYear())
-	{
-		DaysInMonth[1]=29;
-	}	
-	return DaysInMonth[this.Month];	
-}
-Calendar.prototype.GetMonDays=GetMonDays;
-
-function IsLeapYear()
-{
-	if ((this.Year%4)==0)
-	{
-		if ((this.Year%100==0) && (this.Year%400)!=0)
-		{
-			return false;
-		}
-		else
-		{
-			return true;
-		}
-	}
-	else
-	{
-		return false;
-	}
-}
-Calendar.prototype.IsLeapYear=IsLeapYear;
-
-function FormatDate(pDate)
-{
-	var MonthDigit=this.Month+1;
-	if (PrecedeZero==true)
-	{
-		if (pDate<10)
-			pDate="0"+pDate;
-		if (MonthDigit<10)
-			MonthDigit="0"+MonthDigit;
-	}
-
-	if (this.Format.toUpperCase()=="DDMMYYYY")
-		return (pDate+DateSeparator+MonthDigit+DateSeparator+this.Year);
-	else if (this.Format.toUpperCase()=="DDMMMYYYY")
-		return (pDate+DateSeparator+this.GetMonthName(false)+DateSeparator+this.Year);
-	else if (this.Format.toUpperCase()=="MMDDYYYY")
-		return (MonthDigit+DateSeparator+pDate+DateSeparator+this.Year);
-	else if (this.Format.toUpperCase()=="MMMDDYYYY")
-		return (this.GetMonthName(false)+DateSeparator+pDate+DateSeparator+this.Year);
-	else if (this.Format.toUpperCase()=="YYYYMMDD")
-		return (this.Year+DateSeparator+MonthDigit+DateSeparator+pDate);
-	else if (this.Format.toUpperCase()=="YYYYMMMDD")
-		return (this.Year+DateSeparator+this.GetMonthName(false)+DateSeparator+pDate);	
-	else					
-		return (pDate+DateSeparator+(this.Month+1)+DateSeparator+this.Year);
-}
-Calendar.prototype.FormatDate=FormatDate;	
+
+//Global variables
+var winCal;
+var dtToday=new Date();
+var Cal;
+var MonthName=["January", "February", "March", "April", "May", "June","July", 
+	"August", "September", "October", "November", "December"];
+var WeekDayName1=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
+var WeekDayName2=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];
+var exDateTime;//Existing Date and Time
+var selDate;//selected date. version 1.7
+
+
+//Configurable parameters
+var cnTop="200";//top coordinate of calendar window.
+var cnLeft="500";//left coordinate of calendar window
+var WindowTitle ="DateTime Picker";//Date Time Picker title.
+var WeekChar=2;//number of character for week day. if 2 then Mo,Tu,We. if 3 then Mon,Tue,Wed.
+var CellWidth=20;//Width of day cell.
+var DateSeparator="/";//Date Separator, you can change it to "/" if you want.
+var TimeMode=24;//default TimeMode value. 12 or 24
+
+var ShowLongMonth=true;//Show long month name in Calendar header. example: "January".
+var ShowMonthYear=true;//Show Month and Year in Calendar header.
+var MonthYearColor="#cc0033";//Font Color of Month and Year in Calendar header.
+var WeekHeadColor="#0099CC";//Background Color in Week header.
+var SundayColor="#6699FF";//Background color of Sunday.
+var SaturdayColor="#CCCCFF";//Background color of Saturday.
+var WeekDayColor="white";//Background color of weekdays.
+var FontColor="blue";//color of font in Calendar day cell.
+var TodayColor="#FFFF33";//Background color of today.
+var SelDateColor="FFFF99";//Backgrond color of selected date in textbox.
+var YrSelColor="#cc0033";//color of font of Year selector.
+var MthSelColor="#cc0033";//color of font of Month selector if "MonthSelector" is "arrow".
+var ThemeBg="";//Background image of Calendar window.
+var PrecedeZero=true;//Preceding zero [true|false]
+var MondayFirstDay=true;//true:Use Monday as first day; false:Sunday as first day. [true|false]  //added in version 1.7
+var imgDir = 'js/calendar/'; // folder where images are stored
+//end Configurable parameters
+//end Global variable
+
+function NewCal(pCtrl,pFormat,pShowTime,pTimeMode,pScroller,pHideSeconds)
+{
+	Cal=new Calendar(dtToday);
+	if ((pShowTime!=null) && (pShowTime))
+	{
+		Cal.ShowTime=true;
+		if ((pTimeMode!=null) &&((pTimeMode=='12')||(pTimeMode=='24')))
+		{
+			TimeMode=pTimeMode;
+		}
+		if ((pHideSeconds!=null)&&(pHideSeconds))
+		{
+			Cal.ShowSeconds=false;
+		}		
+	}	
+	if (pCtrl!=null)
+		Cal.Ctrl=pCtrl;
+	if (pFormat!=null)
+		Cal.Format=pFormat.toUpperCase();
+	if (pScroller!=null)
+	{
+		if (pScroller.toUpperCase()=="ARROW")
+			Cal.Scroller="ARROW";
+		else
+			Cal.Scroller="DROPDOWN";
+    }		
+	
+	exDateTime=document.getElementById(pCtrl).value;
+	if (exDateTime!="")//Parse existing Date String
+	{
+		var Sp1;//Index of Date Separator 1
+		var Sp2;//Index of Date Separator 2 
+		var tSp1;//Index of Time Separator 1
+		var tSp1;//Index of Time Separator 2
+		var strMonth;
+		var strDate;
+		var strYear;
+		var intMonth;
+		var YearPattern;
+		var strHour;
+		var strMinute;
+		var strSecond;
+		var winHeight;
+		//parse month
+		Sp1=exDateTime.indexOf(DateSeparator,0)
+		Sp2=exDateTime.indexOf(DateSeparator,(parseInt(Sp1)+1));
+		
+		var offset=parseInt(Cal.Format.toUpperCase().lastIndexOf("M"))-parseInt(Cal.Format.toUpperCase().indexOf("M"))-1;
+		if ((Cal.Format.toUpperCase()=="DDMMYYYY") || (Cal.Format.toUpperCase()=="DDMMMYYYY"))
+		{
+			if (DateSeparator=="")
+			{
+				strMonth=exDateTime.substring(2,4+offset);
+				strDate=exDateTime.substring(0,2);
+				strYear=exDateTime.substring(4+offset,8+offset);
+			}
+			else
+			{
+				strMonth=exDateTime.substring(Sp1+1,Sp2);
+				strDate=exDateTime.substring(0,Sp1);
+				strYear=exDateTime.substring(Sp2+1,Sp2+5);
+			}
+		}
+		else if ((Cal.Format.toUpperCase()=="MMDDYYYY") || (Cal.Format.toUpperCase()=="MMMDDYYYY"))
+		{
+			if (DateSeparator=="")
+			{
+				strMonth=exDateTime.substring(0,2+offset);
+				strDate=exDateTime.substring(2+offset,4+offset);
+				strYear=exDateTime.substring(4+offset,8+offset);
+			}
+			else
+			{
+				strMonth=exDateTime.substring(0,Sp1);
+				strDate=exDateTime.substring(Sp1+1,Sp2);
+				strYear=exDateTime.substring(Sp2+1,Sp2+5);
+			}
+
+		}
+		else if ((Cal.Format.toUpperCase()=="YYYYMMDD") || (Cal.Format.toUpperCase()=="YYYYMMMDD"))
+		{
+			if (DateSeparator=="")
+			{
+				strMonth=exDateTime.substring(4,6+offset);
+				strDate=exDateTime.substring(6+offset,8+offset);
+				strYear=exDateTime.substring(0,4);
+			}
+			else
+			{
+				strMonth=exDateTime.substring(Sp1+1,Sp2);
+				strDate=exDateTime.substring(Sp2+1,Sp2+3);
+				strYear=exDateTime.substring(0,Sp1);
+			}
+		}
+
+		if (isNaN(strMonth))
+			intMonth=Cal.GetMonthIndex(strMonth);
+		else
+			intMonth=parseInt(strMonth,10)-1;	
+		if ((parseInt(intMonth,10)>=0) && (parseInt(intMonth,10)<12))
+			Cal.Month=intMonth;
+		//end parse month
+		//parse Date
+		if ((parseInt(strDate,10)<=Cal.GetMonDays()) && (parseInt(strDate,10)>=1))
+			Cal.Date=strDate;
+		//end parse Date
+		//parse year
+		YearPattern=/^\d{4}$/;
+		if (YearPattern.test(strYear))
+			Cal.Year=parseInt(strYear,10);
+		//end parse year
+		//parse time
+		if (Cal.ShowTime==true)
+		{
+			//parse AM or PM
+			if (TimeMode==12)
+			{
+				strAMPM=exDateTime.substring(exDateTime.length-2,exDateTime.length)
+				Cal.AMorPM=strAMPM;
+			}
+			tSp1=exDateTime.indexOf(":",0)
+			tSp2=exDateTime.indexOf(":",(parseInt(tSp1)+1));
+			if (tSp1>0)
+			{
+				strHour=exDateTime.substring(tSp1,(tSp1)-2);
+				Cal.SetHour(strHour);
+				strMinute=exDateTime.substring(tSp1+1,tSp1+3);
+				Cal.SetMinute(strMinute);
+				strSecond=exDateTime.substring(tSp2+1,tSp2+3);
+				Cal.SetSecond(strSecond);
+			}
+			//window.status=strHour+":"+strMinute+":"+strSecond;
+		}	
+	}
+	selDate=new Date(Cal.Year,Cal.Month,Cal.Date);//version 1.7
+	winCal=window.open("","DateTimePicker","toolbar=0,status=0,menubar=0,fullscreen=no,width=200,height=245,resizable=0,top="+cnTop+",left="+cnLeft);
+	RenderCal();
+	winCal.focus();
+}
+
+function RenderCal()
+{
+	var vCalHeader;
+	var vCalData;
+	var vCalTime;
+	var i;
+	var j;
+	var SelectStr;
+	var vDayCount=0;
+	var vFirstDay;
+
+	winCal.document.open();
+	winCal.document.writeln("<html><head><title>"+WindowTitle+"</title>");
+	winCal.document.writeln("<script>var winMain=window.opener;</script>");//winMain is window that open calendar window.
+	winCal.document.writeln("</head><body background='"+ThemeBg+"' link="+FontColor+" vlink="+FontColor+"><form name='Calendar'>");
+
+	vCalHeader="<table border=0 cellpadding=1 cellspacing=1 width='100%' align=\"center\" valign=\"top\">\n";
+	//Table for Month & Year Selector
+	vCalHeader+="<tr>\n<td colspan='7'><table border=0 width='100%' cellpadding=0 cellspacing=0><tr>\n";
+
+	//******************Month selector in dropdown list************************
+	if (Cal.Scroller=="DROPDOWN")
+	{
+		vCalHeader+="<td align='left'><select name=\"MonthSelector\" onChange=\"javascript:winMain.Cal.SwitchMth(this.selectedIndex);winMain.RenderCal();\">\n";
+		for (i=0;i<12;i++)
+		{
+			if (i==Cal.Month)
+				SelectStr="Selected";
+			else
+				SelectStr="";	
+			vCalHeader+="<option "+SelectStr+" value >"+MonthName[i]+"\n";
+		}
+		vCalHeader+="</select></td>";
+		//Year selector
+		vCalHeader+="\n<td align='right'><a href=\"javascript:winMain.Cal.DecYear();winMain.RenderCal()\"><b><font color=\""+YrSelColor+"\"><img border=\"0\" src=\""+imgDir+"left1.gif\" alt=\"&lt;\"/></font></b></a><font face=\"Verdana\" color=\""+YrSelColor+"\" size=2><b> "+Cal.Year+" </b></font><a href=\"javascript:winMain.Cal.IncYear();winMain.RenderCal()\"><b><font color=\""+YrSelColor+"\"><img border=\"0\" src=\""+imgDir+"right1.gif\" alt=\"&gt;\"/></font></b></a></td></tr></table></td>\n";	
+		vCalHeader+="</tr>";
+	}
+	//******************End Month selector in dropdown list*********************
+	//******************Month selector in arrow*********************************
+	else if (Cal.Scroller=="ARROW")
+	{
+		vCalHeader+="<td align='center'><a href='javascript:winMain.Cal.DecYear();winMain.RenderCal();'>- </a></td>";//Year scroller (decrease 1 year)
+		vCalHeader+="<td align='center'><a href='javascript:winMain.Cal.DecMonth();winMain.RenderCal();'>&lt;</a></td>";//Month scroller (decrease 1 month)
+		vCalHeader+="<td align='center' width='70%'><font face='Verdana' size='2' color='"+YrSelColor+"'><b>"+Cal.GetMonthName(ShowLongMonth)+" "+Cal.Year+"</b></font></td>"//Month and Year
+		vCalHeader+="<td align='center'><a href='javascript:winMain.Cal.IncMonth();winMain.RenderCal();'>&gt;</a></td>";//Month scroller (increase 1 month)
+		vCalHeader+="<td align='center'><a href='javascript:winMain.Cal.IncYear();winMain.RenderCal();'>+</a></td>";//Year scroller (increase 1 year)
+		vCalHeader+="</tr></table></td></tr>"
+	}
+    //******************End Month selector in arrow******************************
+	//Calendar header shows Month and Year
+	if ((ShowMonthYear)&&(Cal.Scroller=="DROPDOWN"))
+		vCalHeader+="<tr><td colspan='7'><font face='Verdana' size='2' align='center' color='"+MonthYearColor+"'><b>"+Cal.GetMonthName(ShowLongMonth)+" "+Cal.Year+"</b></font></td></tr>\n";
+	//Week day header
+	vCalHeader+="<tr bgcolor="+WeekHeadColor+">";
+	var WeekDayName=new Array();//Added version 1.7
+	if (MondayFirstDay==true)
+		WeekDayName=WeekDayName2;
+	else
+		WeekDayName=WeekDayName1;
+	for (i=0;i<7;i++)
+	{
+		vCalHeader+="<td align='center'><font face='Verdana' size='2'>"+WeekDayName[i].substr(0,WeekChar)+"</font></td>";
+	}
+	
+	vCalHeader+="</tr>";	
+	winCal.document.write(vCalHeader);
+	//Calendar detail
+	CalDate=new Date(Cal.Year,Cal.Month);
+	CalDate.setDate(1);
+	vFirstDay=CalDate.getDay();
+	//Added version 1.7
+	if (MondayFirstDay==true)
+	{
+		vFirstDay-=1;
+		if (vFirstDay==-1)
+			vFirstDay=6;
+	}
+	//Added version 1.7
+	vCalData="<tr>";
+	for (i=0;i<vFirstDay;i++)
+	{
+		vCalData=vCalData+GenCell();
+		vDayCount=vDayCount+1;
+	}
+	//Added version 1.7
+	for (j=1;j<=Cal.GetMonDays();j++)
+	{
+		var strCell;
+		vDayCount=vDayCount+1;
+		if ((j==dtToday.getDate())&&(Cal.Month==dtToday.getMonth())&&(Cal.Year==dtToday.getFullYear()))
+			strCell=GenCell(j,true,TodayColor);//Highlight today's date
+		else
+		{
+			if ((j==selDate.getDate())&&(Cal.Month==selDate.getMonth())&&(Cal.Year==selDate.getFullYear()))//modified version 1.7
+			{
+				strCell=GenCell(j,true,SelDateColor);
+			}
+			else
+			{	
+				if (MondayFirstDay==true)
+				{
+					if (vDayCount%7==0)
+						strCell=GenCell(j,false,SundayColor);
+					else if ((vDayCount+1)%7==0)
+						strCell=GenCell(j,false,SaturdayColor);
+					else
+						strCell=GenCell(j,null,WeekDayColor);					
+				} 
+				else
+				{
+					if (vDayCount%7==0)
+						strCell=GenCell(j,false,SaturdayColor);
+					else if ((vDayCount+6)%7==0)
+						strCell=GenCell(j,false,SundayColor);
+					else
+						strCell=GenCell(j,null,WeekDayColor);
+				}
+			}		
+		}						
+		vCalData=vCalData+strCell;
+
+		if((vDayCount%7==0)&&(j<Cal.GetMonDays()))
+		{
+			vCalData=vCalData+"</tr>\n<tr>";
+		}
+	}
+	winCal.document.writeln(vCalData);	
+	//Time picker
+	if (Cal.ShowTime)
+	{
+		var showHour;
+		showHour=Cal.getShowHour();	
+		vCalTime="<tr>\n<td colspan='7' align='center'>";
+		vCalTime+="<input type='text' name='hour' maxlength=2 size=1 style=\"WIDTH: 22px\" value="+showHour+" onchange=\"javascript:winMain.Cal.SetHour(this.value)\">";
+		vCalTime+=" : ";
+		vCalTime+="<input type='text' name='minute' maxlength=2 size=1 style=\"WIDTH: 22px\" value="+Cal.Minutes+" onchange=\"javascript:winMain.Cal.SetMinute(this.value)\">";
+		if (Cal.ShowSeconds)
+		{
+			vCalTime+=" : ";
+			vCalTime+="<input type='text' name='second' maxlength=2 size=1 style=\"WIDTH: 22px\" value="+Cal.Seconds+" onchange=\"javascript:winMain.Cal.SetSecond(this.value)\">";
+		}
+		if (TimeMode==12)
+		{
+			var SelectAm =(Cal.AMorPM=="AM")? "Selected":"";
+			var SelectPm =(Cal.AMorPM=="PM")? "Selected":"";
+
+			vCalTime+="<select name=\"ampm\" onchange=\"javascript:winMain.Cal.SetAmPm(this.options[this.selectedIndex].value);\">";
+			vCalTime+="<option "+SelectAm+" value=\"AM\">AM</option>";
+			vCalTime+="<option "+SelectPm+" value=\"PM\">PM<option>";
+			vCalTime+="</select>";
+		}	
+		vCalTime+="\n</td>\n</tr>";
+		winCal.document.write(vCalTime);
+	}	
+	//end time picker
+	winCal.document.writeln("\n</table>");
+	winCal.document.writeln("</form></body></html>");
+	winCal.document.close();
+}
+
+function GenCell(pValue,pHighLight,pColor)//Generate table cell with value
+{
+	var PValue;
+	var PCellStr;
+	var vColor;
+	var vHLstr1;//HighLight string
+	var vHlstr2;
+	var vTimeStr;
+	
+	if (pValue==null)
+		PValue="";
+	else
+		PValue=pValue;
+	
+	if (pColor!=null)
+		vColor="bgcolor=\""+pColor+"\"";
+	else
+		vColor="";	
+	if ((pHighLight!=null)&&(pHighLight))
+		{vHLstr1="color='red'><b>";vHLstr2="</b>";}
+	else
+		{vHLstr1=">";vHLstr2="";}	
+	
+	if (Cal.ShowTime)
+	{
+		vTimeStr="winMain.document.getElementById('"+Cal.Ctrl+"').value+=' '+"+"winMain.Cal.getShowHour()"+"+':'+"+"winMain.Cal.Minutes";
+		if (Cal.ShowSeconds)
+			vTimeStr+="+':'+"+"winMain.Cal.Seconds";
+		if (TimeMode==12)
+			vTimeStr+="+' '+winMain.Cal.AMorPM";
+	}	
+	else
+		vTimeStr="";		
+	PCellStr="<td "+vColor+" width="+CellWidth+" align='center'><font face='verdana' size='2'"+vHLstr1+"<a href=\"javascript:winMain.document.getElementById('"+Cal.Ctrl+"').value='"+Cal.FormatDate(PValue)+"';"+vTimeStr+";window.close();\">"+PValue+"</a>"+vHLstr2+"</font></td>";
+	return PCellStr;
+}
+
+function Calendar(pDate,pCtrl)
+{
+	//Properties
+	this.Date=pDate.getDate();//selected date
+	this.Month=pDate.getMonth();//selected month number
+	this.Year=pDate.getFullYear();//selected year in 4 digits
+	this.Hours=pDate.getHours();	
+	
+	if (pDate.getMinutes()<10)
+		this.Minutes="0"+pDate.getMinutes();
+	else
+		this.Minutes=pDate.getMinutes();
+	
+	if (pDate.getSeconds()<10)
+		this.Seconds="0"+pDate.getSeconds();
+	else		
+		this.Seconds=pDate.getSeconds();
+		
+	this.MyWindow=winCal;
+	this.Ctrl=pCtrl;
+	this.Format="ddMMyyyy";
+	this.Separator=DateSeparator;
+	this.ShowTime=false;
+	this.Scroller="DROPDOWN";
+	if (pDate.getHours()<12)
+		this.AMorPM="AM";
+	else
+		this.AMorPM="PM";
+	this.ShowSeconds=true;		
+}
+
+function GetMonthIndex(shortMonthName)
+{
+	for (i=0;i<12;i++)
+	{
+		if (MonthName[i].substring(0,3).toUpperCase()==shortMonthName.toUpperCase())
+		{	return i;}
+	}
+}
+Calendar.prototype.GetMonthIndex=GetMonthIndex;
+
+function IncYear()
+{	Cal.Year++;}
+Calendar.prototype.IncYear=IncYear;
+
+function DecYear()
+{	Cal.Year--;}
+Calendar.prototype.DecYear=DecYear;
+
+function IncMonth()
+{	
+	Cal.Month++;
+	if (Cal.Month>=12)
+	{
+		Cal.Month=0;
+		Cal.IncYear();
+	}
+}
+Calendar.prototype.IncMonth=IncMonth;
+
+function DecMonth()
+{	
+	Cal.Month--;
+	if (Cal.Month<0)
+	{
+		Cal.Month=11;
+		Cal.DecYear();
+	}
+}
+Calendar.prototype.DecMonth=DecMonth;
+	
+function SwitchMth(intMth)
+{	Cal.Month=intMth;}
+Calendar.prototype.SwitchMth=SwitchMth;
+
+function SetHour(intHour)
+{	
+	var MaxHour;
+	var MinHour;
+	if (TimeMode==24)
+	{	MaxHour=23;MinHour=0}
+	else if (TimeMode==12)
+	{	MaxHour=12;MinHour=1}
+	else
+		alert("TimeMode can only be 12 or 24");		
+	var HourExp=new RegExp("^\\d\\d");
+	var SingleDigit=new RegExp("^\\d");
+	if (SingleDigit.test(intHour))
+		intHour="0"+intHour;
+	if (HourExp.test(intHour) && (parseInt(intHour,10)<=MaxHour) && (parseInt(intHour,10)>=MinHour))
+	{	
+		if ((TimeMode==12) && (Cal.AMorPM=="PM"))
+		{
+			if (parseInt(intHour,10)==12)
+				Cal.Hours=12;
+			else	
+				Cal.Hours=parseInt(intHour,10)+12;
+		}	
+		else if ((TimeMode==12) && (Cal.AMorPM=="AM"))
+		{
+			if (intHour==12)
+				intHour-=12;
+			Cal.Hours=parseInt(intHour,10);
+		}
+		else if (TimeMode==24)
+			Cal.Hours=parseInt(intHour,10);	
+	}
+}
+Calendar.prototype.SetHour=SetHour;
+
+function SetMinute(intMin)
+{
+	var MinExp=new RegExp("^\\d\\d$");
+	if (MinExp.test(intMin) && (intMin<60))
+		Cal.Minutes=intMin;
+}
+Calendar.prototype.SetMinute=SetMinute;
+
+function SetSecond(intSec)
+{	
+	var SecExp=new RegExp("^\\d\\d$");
+	if (SecExp.test(intSec) && (intSec<60))
+		Cal.Seconds=intSec;
+}
+Calendar.prototype.SetSecond=SetSecond;
+
+function SetAmPm(pvalue)
+{
+	this.AMorPM=pvalue;
+	if (pvalue=="PM")
+	{
+		this.Hours=(parseInt(this.Hours,10))+12;
+		if (this.Hours==24)
+			this.Hours=12;
+	}	
+	else if (pvalue=="AM")
+		this.Hours-=12;	
+}
+Calendar.prototype.SetAmPm=SetAmPm;
+
+function getShowHour()
+{
+	var finalHour;
+    if (TimeMode==12)
+    {
+    	if (parseInt(this.Hours,10)==0)
+		{
+			this.AMorPM="AM";
+			finalHour=parseInt(this.Hours,10)+12;	
+		}
+		else if (parseInt(this.Hours,10)==12)
+		{
+			this.AMorPM="PM";
+			finalHour=12;
+		}		
+		else if (this.Hours>12)
+		{
+			this.AMorPM="PM";
+			if ((this.Hours-12)<10)
+				finalHour="0"+((parseInt(this.Hours,10))-12);
+			else
+				finalHour=parseInt(this.Hours,10)-12;	
+		}
+		else
+		{
+			this.AMorPM="AM";
+			if (this.Hours<10)
+				finalHour="0"+parseInt(this.Hours,10);
+			else
+				finalHour=this.Hours;	
+		}
+	}
+	else if (TimeMode==24)
+	{
+		if (this.Hours<10)
+			finalHour="0"+parseInt(this.Hours,10);
+		else	
+			finalHour=this.Hours;
+	}	
+	return finalHour;	
+}				
+Calendar.prototype.getShowHour=getShowHour;		
+
+function GetMonthName(IsLong)
+{
+	var Month=MonthName[this.Month];
+	if (IsLong)
+		return Month;
+	else
+		return Month.substr(0,3);
+}
+Calendar.prototype.GetMonthName=GetMonthName;
+
+function GetMonDays()//Get number of days in a month
+{
+	var DaysInMonth=[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
+	if (this.IsLeapYear())
+	{
+		DaysInMonth[1]=29;
+	}	
+	return DaysInMonth[this.Month];	
+}
+Calendar.prototype.GetMonDays=GetMonDays;
+
+function IsLeapYear()
+{
+	if ((this.Year%4)==0)
+	{
+		if ((this.Year%100==0) && (this.Year%400)!=0)
+		{
+			return false;
+		}
+		else
+		{
+			return true;
+		}
+	}
+	else
+	{
+		return false;
+	}
+}
+Calendar.prototype.IsLeapYear=IsLeapYear;
+
+function FormatDate(pDate)
+{
+	var MonthDigit=this.Month+1;
+	if (PrecedeZero==true)
+	{
+		if (pDate<10)
+			pDate="0"+pDate;
+		if (MonthDigit<10)
+			MonthDigit="0"+MonthDigit;
+	}
+
+	if (this.Format.toUpperCase()=="DDMMYYYY")
+		return (pDate+DateSeparator+MonthDigit+DateSeparator+this.Year);
+	else if (this.Format.toUpperCase()=="DDMMMYYYY")
+		return (pDate+DateSeparator+this.GetMonthName(false)+DateSeparator+this.Year);
+	else if (this.Format.toUpperCase()=="MMDDYYYY")
+		return (MonthDigit+DateSeparator+pDate+DateSeparator+this.Year);
+	else if (this.Format.toUpperCase()=="MMMDDYYYY")
+		return (this.GetMonthName(false)+DateSeparator+pDate+DateSeparator+this.Year);
+	else if (this.Format.toUpperCase()=="YYYYMMDD")
+		return (this.Year+DateSeparator+MonthDigit+DateSeparator+pDate);
+	else if (this.Format.toUpperCase()=="YYYYMMMDD")
+		return (this.Year+DateSeparator+this.GetMonthName(false)+DateSeparator+pDate);	
+	else					
+		return (pDate+DateSeparator+(this.Month+1)+DateSeparator+this.Year);
+}
+Calendar.prototype.FormatDate=FormatDate;	
\ No newline at end of file

Modified: plog/trunk/js/htmlarea/htmlarea-plog-resourcelist.js
===================================================================
--- plog/trunk/js/htmlarea/htmlarea-plog-resourcelist.js	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/js/htmlarea/htmlarea-plog-resourcelist.js	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,136 +1,141 @@
-function _generateBaseLink( dest, blogId, type, resourceName, resourceDesc, preview )
-{
-    if( type == 2 ) {
-	    if( preview == 1 ) {
-	        htmlCode = plogBaseUrl+'/resserver.php?blogId='+blogId+'&resource='+encodeURIComponent(resourceName)+'&mode=preview';
+function _generateBaseLink( dest, blogId, type, resourceName, resourceDesc, preview )
+{
+    if( type == 2 ) {
+	    if( preview == 1 ) {
+	        htmlCode = plogBaseUrl+'/resserver.php?blogId='+blogId+'&resource='+encodeURIComponent(resourceName)+'&mode=preview';
 	    }
 		else if( preview == 2) {
 			htmlCode = plogBaseUrl+'/resserver.php?blogId='+blogId+'&resource='+encodeURIComponent(resourceName)+'&mode=medium';
-		}
-	    else {
-	        htmlCode = plogBaseUrl+'/resserver.php?blogId='+blogId+'&resource='+encodeURIComponent(resourceName);
-	    }
-    }
-    else {
-	    // if not an image, there is not much we can do
-	    htmlCode = '<a title="'+resourceDesc+'" href="'+plogBaseUrl+'/resserver.php?blogId='+blogId+'&amp;resource='+encodeURIComponent(resourceName)+'">test</a>';
-    }
-  
-    return htmlCode;
-}
-
-function _generateResourceLink( dest, blogId, type, resourceName, resourceDesc, preview )
-{
-    var htmlCode = '';
-    if( type == 1 ) {
-	    // if the resource is an image, check the second parameter to see wether we'd like
-	    // to show the preview with a link to the real size image or the real image
-	    // inlined with the text
-	    if( preview == 1 ) {
-		    htmlCode = '<a href="'+plogBaseUrl+'/resserver.php?blogId='+blogId+'&amp;resource='+encodeURIComponent(resourceName)+'">';
-		    htmlCode += '<img style="margin: 5px;" border="0" alt="'+resourceDesc+'" src="'+plogBaseUrl+'/resserver.php?blogId='+blogId+'&amp;resource='+encodeURIComponent(resourceName)+'&amp;mode=preview" />';
-		    htmlCode += '</a>';
+		}
+	    else {
+	        htmlCode = plogBaseUrl+'/resserver.php?blogId='+blogId+'&resource='+encodeURIComponent(resourceName);
 	    }
+    }
+    else {
+	    // if not an image, there is not much we can do
+	    htmlCode = '<a title="'+resourceDesc+'" href="'+plogBaseUrl+'/resserver.php?blogId='+blogId+'&amp;resource='+encodeURIComponent(resourceName)+'">'+resourceName+'</a>';
+    }
+  
+    return htmlCode;
+}
+
+function _generateResourceLink( dest, blogId, type, resourceName, resourceDesc, preview, mimeType, resId )
+{
+    var htmlCode = '';
+    if( type == 1 ) {
+	    // if the resource is an image, check the second parameter to see wether we'd like
+	    // to show the preview with a link to the real size image or the real image
+	    // inlined with the text
+	    if( preview == 1 ) {
+		    htmlCode = '<a id="res_' + resId+ '" href="'+plogBaseUrl+'/resserver.php?blogId='+blogId+'&amp;resource='+encodeURIComponent(resourceName)+'" type="'+mimeType+'">';
+		    htmlCode += '<img style="margin: 5px;" border="0" alt="'+resourceDesc+'" src="'+plogBaseUrl+'/resserver.php?blogId='+blogId+'&amp;resource='+encodeURIComponent(resourceName)+'&amp;mode=preview" />';
+		    htmlCode += '</a>';
+	    }
 		else if ( preview == 2 ) {
-		    htmlCode = '<a href="'+plogBaseUrl+'/resserver.php?blogId='+blogId+'&amp;resource='+encodeURIComponent(resourceName)+'">';
-		    htmlCode += '<img style="margin: 5px;" border="0" alt="'+resourceDesc+'" src="'+plogBaseUrl+'/resserver.php?blogId='+blogId+'&amp;resource='+encodeURIComponent(resourceName)+'&amp;mode=medium" />';
-		    htmlCode += '</a>';
-		}
-	    else {
-		    htmlCode = '<img style="margin: 5px;" alt="'+resourceDesc+'" src="'+plogBaseUrl+'/resserver.php?blogId='+blogId+'&amp;resource='+encodeURIComponent(resourceName)+'" />';
-	    }
-    }
-    else {
-	    // if not an image, there is not much we can do
-	    htmlCode = '<a title="'+resourceDesc+'" href="'+plogBaseUrl+'/resserver.php?blogId='+blogId+'&amp;resource='+encodeURIComponent(resourceName)+'">test</a>';
-    }
-  
-    return htmlCode;
-
-}
-
-function addResourceLink( dest, reqFormat, blogId, type, resourceName, resourceDesc, preview ) 
-{
-    // generate the link
-    var htmlCode = _generateResourceLink( dest, reqFormat, blogId, type, resourceName, resourceDesc, preview );
-  
-    // and now send the value to the text area where we are typing the post
-    if( dest == 1 ) {
-	    //parent.opener.document.newPost.postText.value += htmlCode;
-	    addText( parent.opener.document.newPost.postText, htmlCode );
-    }
-    else {
-	    //parent.opener.document.newPost.postExtendedText.value += htmlCode;
-	    addText( parent.opener.document.newPost.postExtendedText, htmlCode );
-    }	
-
-    // finally close this window since we don't need it anymore
-    //window.close();
-}
-
-function _generateAlbumLink( dest, blogId, albumId, albumName, albumDesc ) 
-{
-    var htmlCode = '';
-
-    htmlCode = '<a title="'+albumDesc+'" href="'+plogBaseUrl+'/index.php?op=ViewAlbum&amp;blogId='+blogId+'&amp;albumId='+albumId+'">'+albumName+'</a>';
-	
-    return htmlCode;      
-}
-
-/**
- * generates and adds a link to an album to the textarea
- *
- * @param dest
- * @param blogId
- * @param albumId
- * @param albumName
- * @param albumDesc
- */
-function addAlbumLink( dest, blogId, albumId, albumName, albumDesc ) 
-{
-    albumLink = _generateAlbumLink( dest, blogId, albumId, albumName, albumDesc );
-
-    // and now send the value to the text area where we are typing the post
-    if( dest == 1 ) {
-        addText( parent.opener.document.newPost.postText, albumLink );
-    }	
-    else {
-		addText( parent.opener.document.newPost.postExtendedText, albumLink );
-    }
-}
-
-// ------
-//
-// htmlarea-related code
-//
-// -------
-//
-
-function resourceListWindowInit(htmlarea) {
-    // if we use this method, the dialog will be resized to its full size and I don't like that...
-    if( htmlarea ) {
-	    __dlg_init();
-	    window.resizeTo(450,600);
-    }
-}
-
-function addHtmlareaLink(dest, blogId, type, resourceName, resourceDesc, preview) {
-    //var param = _generateResourceLink( dest, blogId, type, resourceName, resourceDesc, preview );
-    param = new Object();
-    param["htmlCode"] = _generateResourceLink( dest, blogId, type, resourceName, resourceDesc, preview );
-    __dlg_close(param);
-    return false;
-};
-
-function addHtmlareaAlbumLink( dest, blogId, albumId, albumName, albumDesc ) 
-{
-    param = new Object();
-    param["htmlCode"] = _generateAlbumLink( dest, blogId, albumId, albumName, albumDesc );
-    __dlg_close(param)
-    return false;
-}
-
-function onCancel() {
-    __dlg_close(null);
-    return false;
-};
+		    htmlCode = '<a id="res_' + resId+ '" href="'+plogBaseUrl+'/resserver.php?blogId='+blogId+'&amp;resource='+encodeURIComponent(resourceName)+'" type="'+mimeType+'">';
+		    htmlCode += '<img style="margin: 5px;" border="0" alt="'+resourceDesc+'" src="'+plogBaseUrl+'/resserver.php?blogId='+blogId+'&amp;resource='+encodeURIComponent(resourceName)+'&amp;mode=medium" />';
+		    htmlCode += '</a>';
+		}
+	    else {
+		    htmlCode = '<img style="margin: 5px;" alt="'+resourceDesc+'" src="'+plogBaseUrl+'/resserver.php?blogId='+blogId+'&amp;resource='+encodeURIComponent(resourceName)+'" />';
+	    }
+    }
+    else {
+	    // if not an image, there is not much we can do
+	    htmlCode = '<a id="res_'+resId+'" title="'+resourceDesc+'" href="'+plogBaseUrl+'/resserver.php?blogId='+blogId+'&amp;resource='+encodeURIComponent(resourceName)+'" type="'+mimeType+'">'+resourceName+'</a>';
+    }
+  
+    return htmlCode;
+
+}
+
+function addResourceLink( dest, reqFormat, blogId, type, resourceName, resourceDesc, preview, mimeType, resId ) 
+{
+    // generate the link
+    var htmlCode = _generateResourceLink( dest, reqFormat, blogId, type, resourceName, resourceDesc, preview, mimeType, resId );
+  
+    // and now send the value to the text area where we are typing the post
+    if( dest == 1 ) {
+	    //parent.opener.document.newPost.postText.value += htmlCode;
+	    addText( parent.opener.document.newPost.postText, htmlCode );
+    }
+    else {
+	    //parent.opener.document.newPost.postExtendedText.value += htmlCode;
+	    addText( parent.opener.document.newPost.postExtendedText, htmlCode );
+    }	
+
+    // finally close this window since we don't need it anymore
+    //window.close();
+}
+
+function _generateAlbumLink( dest, blogId, albumId, albumName, albumDesc ) 
+{
+    var htmlCode = '';
+    
+    // if no other global variable called 'indexPage' is defined, use the
+    // default one
+    if( indexPage == '' )
+        indexPage = 'index.php';
+
+    htmlCode = '<a title="'+albumDesc+'" href="'+plogBaseUrl+'/index.php?op=ViewAlbum&amp;blogId='+blogId+'&amp;albumId='+albumId+'">'+albumName+'</a>';
+	
+    return htmlCode;      
+}
+
+/**
+ * generates and adds a link to an album to the textarea
+ *
+ * @param dest
+ * @param blogId
+ * @param albumId
+ * @param albumName
+ * @param albumDesc
+ */
+function addAlbumLink( dest, blogId, albumId, albumName, albumDesc ) 
+{
+    albumLink = _generateAlbumLink( dest, blogId, albumId, albumName, albumDesc );
+
+    // and now send the value to the text area where we are typing the post
+    if( dest == 1 ) {
+        addText( parent.opener.document.newPost.postText, albumLink );
+    }	
+    else {
+		addText( parent.opener.document.newPost.postExtendedText, albumLink );
+    }
+}
+
+// ------
+//
+// htmlarea-related code
+//
+// -------
+//
+
+function resourceListWindowInit(htmlarea) {
+    // if we use this method, the dialog will be resized to its full size and I don't like that...
+    if( htmlarea ) {
+	    __dlg_init();
+	    window.resizeTo(450,600);
+    }
+}
+
+function addHtmlareaLink(dest, blogId, type, resourceName, resourceDesc, preview, mimeType, resId ) {
+    //var param = _generateResourceLink( dest, blogId, type, resourceName, resourceDesc, preview );
+    param = new Object();
+    param["htmlCode"] = _generateResourceLink( dest, blogId, type, resourceName, resourceDesc, preview, mimeType, resId );
+    __dlg_close(param);
+    return false;
+};
+
+function addHtmlareaAlbumLink( dest, blogId, albumId, albumName, albumDesc ) 
+{
+    param = new Object();
+    param["htmlCode"] = _generateAlbumLink( dest, blogId, albumId, albumName, albumDesc );
+    __dlg_close(param)
+    return false;
+}
+
+function onCancel() {
+    __dlg_close(null);
+    return false;
+};

Modified: plog/trunk/js/png.htc
===================================================================
--- plog/trunk/js/png.htc	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/js/png.htc	2005-05-31 10:28:30 UTC (rev 2128)
@@ -25,6 +25,8 @@
 var realSrc;
 var blankSrc = "imgs/transparent.1x1.gif";
 
+window.alert("hello!");
+
 if (supported) fixImage();
 
 function propertyChanged() {

Modified: plog/trunk/locale/locale_ca_ES.php
===================================================================
--- plog/trunk/locale/locale_ca_ES.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/locale/locale_ca_ES.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -141,7 +141,7 @@
 
 // login page
 $messages['login'] = 'Connecta';
-$messages['welcome_message'] = 'Benvingut a LaMevaWeb.info';
+$messages['welcome_message'] = 'Benvingut a pLog';
 $messages["error_incorrect_username_or_password"] = "El nom d'usuari o la paraula clau són incorrectes.";
 $messages["error_dont_belong_to_any_blog"] = "L'usuari és vàlid però no pertany a cap bloc.";
 $messages["logout_message"] = "El procés de sortida ha acabat correctament.";
@@ -178,11 +178,11 @@
 $messages['manageCustomFields'] = 'Gestiona camps personalitzats';
 $messages['blogCustomFields'] = 'Camps personalitzats';
 $messages['newCustomField'] = 'Nou camp personalitzat';
-$messages['resourceCenter'] = 'Centre de recursos';
+$messages['resourceCenter'] = 'Fitxers';
 $messages['resources'] = 'Recursos';
 $messages['newResourceAlbum'] = 'Nou àlbum';
 $messages['newResource'] = 'Nou recurs';
-$messages['controlCenter'] = 'Centre de control';
+$messages['controlCenter'] = 'Arranjaments';
 $messages['manageSettings'] = 'Preferències';
 $messages['blogSettings'] = 'Preferències de bloc';
 $messages['userSettings'] = "Preferències d'usuari";

Modified: plog/trunk/locale/locale_de_DE.php
===================================================================
--- plog/trunk/locale/locale_de_DE.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/locale/locale_de_DE.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -42,10 +42,11 @@
 $messages['October'] = $messages['months'][9];
 $messages['November'] = $messages['months'][10];
 $messages['December'] = $messages['months'][11];
-$messages['message'] = 'Message';
-$messages['error'] = 'Error';
-$messages['date'] = 'Date';
 
+$messages['message'] = 'Nachricht';
+$messages['error'] = 'Fehler';
+$messages['date'] = 'Datum';
+
 // miscellaneous texts
 $messages['of'] = 'von';
 $messages['recently'] = 'Aktuell';
@@ -233,7 +234,7 @@
 $messages['error_adding_post'] = 'Beim Speichern des Artikels trat ein Fehler auf.';
 $messages['post_added_not_published'] = 'Der Artikel wurde erfolgreich hinzugef&uuml;gt aber nicht ver&ouml;ffentlicht.';
 $messages['post_added_ok'] = 'Der Artikel wurde erfolgreich hinzugef&uuml;gt.';
-$messages['send_notifications_ok'] = 'Sie werden bei jedem neuem Kommentar oder Trackback benachrichtigt.';
+$messages['send_notifications_ok'] = 'Sie werden bei jedem neuen Kommentar oder Trackback benachrichtigt.';
 
 // send trackbacks
 $messages['error_sending_trackbacks'] = 'Beim Senden der folgenden Trackbacks ist ein Fehler aufgetreten: ';
@@ -673,8 +674,8 @@
 $messages['global_template_package_help'] = 'Benutzen Sie dieses Formular, um ein Template hochzuladen, dass f&uuml;r alle Blogs dieser Site verf&uuml;gbar sein soll. Wenn Sie mit diesem Formular kein Template-Set hochladen k&ouml;nnen, laden Sie es manuell in das Verzeichniss <b>%s</b>, dem Verzeichniss f&uuml;r all Ihre Template-Sets. Anschlie&szlig;end klicken Sie auf <b>Templates scannen</b>. pLog scannt daraufhin das Verzeichniss und f&uuml;gt automatisch alle neu erkannten Templates der Auswahl zu.';
 
 // global settings
-$messages['site_config_saved_ok'] = 'Die Site-Einstellungen wurden erfolgreich gespeichert.';
-$messages['error_saving_site_config'] = 'Beim Speichern der Site-Einstellungen ist ein Fehler aufgetreten.';
+$messages['site_config_saved_ok'] = 'Die Einstellungen wurden erfolgreich gespeichert.';
+$messages['error_saving_site_config'] = 'Beim Speichern der Einstellungen ist ein Fehler aufgetreten.';
 /// general settings
 $messages['help_comments_enabled'] = 'Kommentare f&uuml;r neue Blogs als Standard erlauben [Standard = Ja]';
 $messages['help_beautify_comments_text'] = 'In Kommentaren automatisch Abs&auml;tze formatieren und URLs verlinken [Standard = Ja]';
@@ -837,8 +838,8 @@
 $messages['read_service_agreement'] = 'Bitte lesen die Nutzungsbedingungen und klicken auf "akzeptieren, wenn Sie einverstanden sind.';
 $messages['register_step1_title'] = 'Benutzerkonto anlegen [1/4]';
 $messages['register_step1_help'] = 'Sie m&uuml;ssen zuerst ein neues Benutzerkonto anlegen, wenn Sie ein Blog einrichten m&ouml;chten. Der Benutzer wird der Besitzer dieses Blogs und hat Zugang zu allen Funktionen';
-$messages['register_next'] = 'Next';
-$messages['register_back'] = 'Back';
+$messages['register_next'] = 'Weiter';
+$messages['register_back'] = 'Zur&uuml;ck';
 $messages['register_step2_title'] = 'Blog einrichten [2/4]';
 $messages['register_blog_name_help'] = 'Name des neuen Blogs';
 $messages['register_step3_title'] = 'Template ausw&auml;hlen [3/4]';
@@ -853,13 +854,13 @@
 $messages['register_need_confirmation'] = 'Eine E-Mail Best&auml;tigung wurde an Ihre E-Mail Adresse geschickt. Klicken Sie auf dendarin enthaltenen Link, sobald Sie die Nachricht erhalten haben, um direkt zu starten!';
 $messages['register_step5_help'] = 'Gl&uuml;ckwunsch, das neue Benutzerkonto und das neue Blog wurden erfolgreich angelegt!';
 $messages['register_blog_link'] = 'Wenn Sie direkt einen Blick auf Ihr neues Blog werfen m&ouml;chten, gehen Sie zu: <a href="%2$s">%1$s</a>';
-$messages['register_blog_admin_link'] = 'Wenn Sie direkt einen Artikel verfassen m&ouml;chten, gehen Sie direkt zum <a href="admin.php">Administrations-Interface</a>';
+$messages['register_blog_admin_link'] = 'Wenn Sie direkt einen Artikel verfassen m&ouml;chten, gehen Sie direkt zur <a href="admin.php">Administrationsbereich</a>';
 $messages['register_error'] = 'W&auml;hrend des Prozesses ist ein Fehler aufgetreten.';
 $messages['error_registration_disabled'] = 'Die Registrierung neuer Blogs ist f&uuml;r diese Site gesperrt worden.';
 // registration article topic and text
 $messages['register_default_article_topic'] = 'Herzlichen Gl&uuml;ckwunsch!';
 $messages['register_default_article_text'] = 'Wenn Sie diesen Artikel lesen k&ouml;nnen, war die Registrierung erfolgreich und Sie k&ouml;nnen direkt mit dem Bloggen beginnen.';
-$messages['register_default_category'] = 'General';
+$messages['register_default_category'] = 'Allgemein';
 // confirmation email
 $messages['register_confirmation_email_text'] = 'Bitte klicken Sie auf den untenstehenden Link, um Ihr Blog zu aktivieren:
 
@@ -875,7 +876,7 @@
 $messages['reset_password_help'] = 'Benutzen Sie dieses Formular, um das Kennwort Ihres Benutzerkontos zur&uuml;ckzusetzen, falls Sie sich daran nicht erinnern k&ouml;nnen. Bitte geben Sie den Benutzernamen und die E-Mail Adresse ein, die zum Registrieren verwendet wurde.';
 $messages['error_resetting_password'] = 'Beim Zur&uuml;cksetzen des Kennworts ist ein Fehler aufgetreten. Bitte &uuml;berpr&uuml;fen Sie Ihre Eingaben und versuchen Sie es erneut.';
 $messages['reset_password_error_incorrect_email_address'] = 'Die E-Mail Adresse ist ung&uuml;ltig, oder nicht die Adresse, mit der dieser Benutzer registriert wurde.';
-$messages['password_reset_message_sent_ok'] = 'Eine Nachricht mit einen Reset-Link wurde an die angegebene E-Mail Adresse gesendet. Bitte klicken Sie auf diesen Link, um Ihr Kennwort zur&uuml;ckzusetzen.';
+$messages['password_reset_message_sent_ok'] = 'Eine Nachricht mit einem Link wurde an die angegebene E-Mail Adresse gesendet. Bitte klicken Sie auf diesen Link, um Ihr Kennwort zur&uuml;ckzusetzen.';
 $messages['error_incorrect_request'] = 'Die URL-Parameter sind ung&uuml;ltig.';
 $messages['change_password'] = 'neues Kennwort erstellen';
 $messages['change_password_help'] = 'Bitte geben Sie das neue Kennwort ein und best&auml;tigen Sie es.';
@@ -884,10 +885,10 @@
 $messages['password_updated_ok'] = 'Ihr Kennwort wurde erfolgreich aktualisiert.';
 
 // Suggested by BCSE, some useful messages that not available in official locale
-$messages['upgrade_information'] = 'This page looks plain and unstyled because you\'re using a non-standard compliant browser. To see it in its best form, please <a href="http://www.webstandards.org/upgrade/" title="The Web Standards Project\'s Browser Upgrade initiative">upgrade</a> to a browser that supports web standards. It\'s free and painless.';
+$messages['upgrade_information'] = 'Diese Seite wird unsch&ouml;n dargestellt, da Sie einen Browser benutzen, der aktelle Web-Standards nicht unterstützt. Um diese Seite richtig darzustellen, empfehlen wir Ihnen den Browser zu <a href="http://www.webstandards.org/upgrade/" title="The Web Standards Project\'s Browser Upgrade initiative">aktualisieren</a>. Dies ist kostenlos und wird Sie nicht viel Zeit kosten.';
 $messages['jump_to_navigation'] = 'Zur Navigation wechseln.';
 $messages['comment_email_never_display'] = 'Zeilenumbr&uuml;che und Abs&auml;tze werden automatisch hinzugef&uuml;gt. Die E-Mail Adresse wird nicht angezeigt.';
-$messages['comment_html_allowed'] = '<acronym title="Hypertext Markup Language">HTML</acronym> allowed: &lt;<acronym title="Hyperlink">a</acronym> href=&quot;&quot; title=&quot;&quot; rel=&quot;&quot;&gt; &lt;<acronym title="Acronym Description">acronym</acronym> title=&quot;&quot;&gt; &lt;<acronym title="Quote">blockquote</acronym> cite=&quot;&quot;&gt; &lt;<acronym title="Strike">del</acronym>&gt; &lt;<acronym title="Italic">em</acronym>&gt; &lt;<acronym title="Underline">ins</acronym>&gt; &lt;<acronym title="Bold">strong</acronym>&gt;';
+$messages['comment_html_allowed'] = '<acronym title="Hypertext Markup Language">HTML</acronym> erlaubt: &lt;<acronym title="Hyperlink">a</acronym> href=&quot;&quot; title=&quot;&quot; rel=&quot;&quot;&gt; &lt;<acronym title="Acronym Description">acronym</acronym> title=&quot;&quot;&gt; &lt;<acronym title="Quote">blockquote</acronym> cite=&quot;&quot;&gt; &lt;<acronym title="Strike">del</acronym>&gt; &lt;<acronym title="Italic">em</acronym>&gt; &lt;<acronym title="Underline">ins</acronym>&gt; &lt;<acronym title="Bold">strong</acronym>&gt;';
 $messages['trackback_uri'] = 'Der <acronym title="Uniform Resource Identifier">URI</acronym> um diesem Artikel einen Trackback hinzuzuf&uuml;gen lautet: ';
 $messages['previous_post'] = 'zur&uuml;ck';
 $messages['next_post'] = 'vor';

Modified: plog/trunk/locale/locale_en_UK.php
===================================================================
--- plog/trunk/locale/locale_en_UK.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/locale/locale_en_UK.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -714,14 +714,14 @@
 $messages['help_force_one_blog_per_email_account'] = 'Restrict to only one blog per email account [Default = No]';
 $messages['help_summary_show_agreement'] = 'Show and an agreement text and make users accept it before proceeding to the registration process [Default = Yes]';
 $messages['help_need_email_confirm_registration'] = 'Force users to confirm their registration by clicking a link embedded in an email sent to their account [Default = Yes]';
-$messages['help_summary_disable_registration'] = 'Whether users are allowed to register new blogs in this site [Default = Yes]';
+$messages['help_summary_disable_registration'] = 'Disable users registration of new blogs in this site [Default = No]';
 // templates
 $messages['help_template_folder'] = 'Folder where templates are stored [Default = ./templates]';
 $messages['help_default_template'] = 'Default template for new blogs [Default = standard]';
 $messages['help_users_can_add_templates'] = 'Allow users to upload their own custom templates [Default = Yes]';
-$messages['help_template_compile_check'] = 'If disabled, Smarty will check every time if template files have changed and if so, use the new version. Set this to disabled for higher performance [Default = Yes]';
+$messages['help_template_compile_check'] = 'If enabled, Smarty will check every time if template files have changed and if so, use the new version. Set this to disabled for higher performance [Default = Yes]';
 $messages['help_template_cache_enabled'] = 'Enable the template cache. If enabled, the cached version of a page will be used whenever possible. No data will need to be fetched from the database and templates will not need to be recompiled [Default = Yes]';
-$messages['help_template_cache_lifetime'] = 'Lifetime in seconds of the cache. Set to -1 to force the cache to never expire. If set to 0, the cache will be disabled but it is recommended to set template_cache_enabled to "No" in order to disable the cache [Default = 0]';
+$messages['help_template_cache_lifetime'] = 'Lifetime in seconds of the cache. Set to -1 to force the cache to never expire. If set to 0, the cache will be disabled but it is recommended to set template_cache_enabled to "No" in order to disable the cache [Default = -1]';
 $messages['help_template_http_cache_enabled'] = 'Enable support for HTTP conditional requests. If enabled, pLog will take the "If-Modified-Since" HTTP header into account and send only content if strictly needed. Enable this to save bandwidth [Default = No]';
 $messages['help_allow_php_code_in_templates'] = 'Allows to embed native PHP code in Smarty templates inside {php}...{/php} blocks [Default = No]';
 // urls

Modified: plog/trunk/locale/locale_es_ES.php
===================================================================
--- plog/trunk/locale/locale_es_ES.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/locale/locale_es_ES.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -185,7 +185,7 @@
 $messages['templateSettings'] = 'Plantillas';
 $messages['urlSettings'] = 'Direcciones';
 $messages['emailSettings'] = 'Email';
-$messages['uploadSettings'] = 'Transferencias de Ficheros';
+$messages['uploadSettings'] = 'Transferencias';
 $messages['helpersSettings'] = 'Herramientas';
 $messages['interfacesSettings'] = 'Interfícies';
 $messages['securitySettings'] = 'Seguridad';

Copied: plog/trunk/locale/locale_fi_FI.php (from rev 2126, plog/branches/plog-1.0.1/locale/locale_fi_FI.php)


Property changes on: plog/trunk/locale/locale_fi_FI.php
___________________________________________________________________
Name: svn:executable
   + *

Copied: plog/trunk/locale/locale_ja_JP.php (from rev 2126, plog/branches/plog-1.0.1/locale/locale_ja_JP.php)

Modified: plog/trunk/locale/locale_zh_CN.php
===================================================================
--- plog/trunk/locale/locale_zh_CN.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/locale/locale_zh_CN.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 // set this to the encoding that should be used to display the pages correctly,translated by JianxinLiu,Tianjin University
-$messages['encoding'] = 'UTF-8';
-$messages['locale_description'] = 'Plog简体中文locale文件';
+$messages['encoding'] = 'utf-8';
+$messages['locale_description'] = 'Simplified Chinese translation (UTF-8)';
 // locale format, see Locale::formatDate for more information
 $messages['date_format'] = '%d/%m/%Y %H:%M';
 
@@ -521,6 +521,7 @@
 $messages['error_invalid_number'] = '数目不正确';
 $messages['error_incorrect_time_offset'] = '时差无效';
 $messages['blog_settings_updated_ok'] = '博客设置修改成功';
+$messages['hours'] = '小时';
 
 // user settings
 $messages['username_help'] = '用户名称,不可修改';
@@ -765,7 +766,7 @@
 $messages['help_rdf_enabled'] = '启动Atom或RSS聚合';
 $messages['help_default_rss_profile'] = '默认的RSS或Atom方式';
 // security
-$messages['security_pipeline_enabled'] = '是否启用安全以及所有相关插件。注意,这也会印象到其它的新插件。';
+$messages['help_security_pipeline_enabled'] = '是否启用安全以及所有相关插件。注意,这也会印象到其它的新插件。';
 $messages['help_ip_address_filter_enabled'] = '是否启用ip地址过滤';
 $messages['help_content_filter_enabled'] = '启用或禁用规则过滤,启动该项目时,需要打开安全功能。';
 $messages['help_maximum_comment_size'] = '评论的最大字节数';
@@ -795,6 +796,7 @@
 $messages['help_resources_quota'] = '博客的全局资源配额';
 $messages['help_resource_server_http_cache_enabled'] = '启用对"If-Modified-Since" 标题和HTTP条件请求的支持.启用增强带宽存储。';
 $messages['help_resource_server_http_cache_lifetime'] = '客户端使用资源缓存的时间';
+$messages['same_as_image'] = '与原始图像相同';
 // search
 $messages['help_search_engine_enabled'] = '启动或禁止搜索引擎';
 $messages['help_search_in_custom_fields'] = '搜索自定义区块';
@@ -832,6 +834,7 @@
 
 // registration
 $messages['register_step0_title'] = '接受服务协议';
+$messages['agreement'] = '许可条款';
 $messages['decline'] = '拒绝';
 $messages['accept'] = '同意';
 $messages['read_service_agreement'] = '请阅读服务协议,如果您同意的话,点击同意';

Modified: plog/trunk/locale/locale_zh_TW.php
===================================================================
--- plog/trunk/locale/locale_zh_TW.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/locale/locale_zh_TW.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,7 +1,7 @@
 <?php
 // set this to the encoding that should be used to display the pages correctly
 $messages['encoding'] = 'utf-8';
-$messages['locale_description'] = 'Traditional Chinese translation';
+$messages['locale_description'] = 'Traditional Chinese translation (UTF-8)';
 // locale format, see Locale::formatDate for more information
 $messages['date_format'] = '%d/%m/%Y %H:%M';
 
@@ -714,7 +714,7 @@
 $messages['help_force_one_blog_per_email_account'] = '一個電子郵件是否只能註冊一個網誌';
 $messages['help_summary_show_agreement'] = '在使用者進行註冊動作之前,是否顯示並確認使用者同意服務條款。';
 $messages['help_need_email_confirm_registration'] = '是否啟用電子郵件的確認連結來啟用帳號。';
-$messages['help_summary_disable_registration'] = '使用者是否允許在這個網站註冊新網誌。';
+$messages['help_summary_disable_registration'] = '是否關閉使用者註冊新網誌的功能。';
 // templates
 $messages['help_template_folder'] = '模版檔案的所在目錄路徑。';
 $messages['help_default_template'] = '在新建網誌站台時,預設使用的模版。';

Copied: plog/trunk/locale/unsupport (from rev 2126, plog/branches/plog-1.0.1/locale/unsupport)

Deleted: plog/trunk/locale/unsupport/locale_zh_CN_gb2312.php
===================================================================
--- plog/branches/plog-1.0.1/locale/unsupport/locale_zh_CN_gb2312.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/locale/unsupport/locale_zh_CN_gb2312.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,903 +0,0 @@
-<?php
-// set this to the encoding that should be used to display the pages correctly,translated by JianxinLiu,Tianjin University
-$messages['encoding'] = 'gb2312';
-$messages['locale_description'] = 'Simplified Chinese translation (GB2312)';
-// locale format, see Locale::formatDate for more information
-$messages['date_format'] = '%d/%m/%Y %H:%M';
-
-// days of the week
-$messages['days'] = Array( 'ÐÇÆÚÈÕ', 'ÐÇÆÚÒ»', 'ÐÇÆÚ¶þ', 'ÐÇÆÚÈý', 'ÐÇÆÚËÄ', 'ÐÇÆÚÎå', 'ÐÇÆÚÁù' );
-// -- compatibility, do not touch -- //
-$messages['Monday'] = $messages['days'][1];
-$messages['Tuesday'] = $messages['days'][2];
-$messages['Wednesday'] = $messages['days'][3];
-$messages['Thursday'] = $messages['days'][4];
-$messages['Friday'] = $messages['days'][5];
-$messages['Saturday'] = $messages['days'][6];
-$messages['Sunday'] = $messages['days'][0];
-
-// abbreviations
-$messages['daysshort'] = Array( 'ÈÕ', 'Ò»', '¶þ', 'Èý', 'ËÄ', 'Îå', 'Áù' );
-// -- compatibility, do not touch -- //
-$messages['Mo'] = $messages['daysshort'][1];
-$messages['Tu'] = $messages['daysshort'][2];
-$messages['We'] = $messages['daysshort'][3];
-$messages['Th'] = $messages['daysshort'][4];
-$messages['Fr'] = $messages['daysshort'][5];
-$messages['Sa'] = $messages['daysshort'][6];
-$messages['Su'] = $messages['daysshort'][0];
-
-// months of the year
-$messages['months'] = Array( 'Ò»ÔÂ', '¶þÔÂ', 'ÈýÔÂ', 'ËÄÔÂ', 'ÎåÔÂ', 'ÁùÔÂ', 'ÆßÔÂ', '°ËÔÂ', '¾ÅÔÂ', 'Ê®ÔÂ', 'ʮһÔÂ', 'Ê®¶þÔÂ');
-// -- compatibility, do not touch -- //
-$messages['January'] = $messages['months'][0];
-$messages['February'] = $messages['months'][1];
-$messages['March'] = $messages['months'][2];
-$messages['April'] = $messages['months'][3];
-$messages['May'] = $messages['months'][4];
-$messages['June'] = $messages['months'][5];
-$messages['July'] = $messages['months'][6];
-$messages['August'] = $messages['months'][7];
-$messages['September'] = $messages['months'][8];
-$messages['October'] = $messages['months'][9];
-$messages['November'] = $messages['months'][10];
-$messages['December'] = $messages['months'][11];
-$messages['message'] = 'ϵͳÐÅÏ¢';
-$messages['error'] = '´íÎóÐÅÏ¢';
-$messages['date'] = 'ÈÕÆÚ';
-
-// miscellaneous texts
-$messages['of'] = 'of';
-$messages['recently'] = '×îз¢±í';
-$messages['comments'] = '×îлظ´';
-$messages['comment on this'] = 'ÆÀÂÛ';
-$messages['my_links'] = 'ÎÒµÄÁ´½Ó';
-$messages['archives'] = 'ÎÄÕ¹鵵';
-$messages['search'] = 'ËÑË÷';
-$messages['calendar'] = '²©¿ÍÈÕÀú';
-$messages['search_s'] = 'ËÑË÷';
-$messages['search_this_blog'] = 'Õ¾ÄÚËÑË÷';
-$messages['about_myself'] = '×ÔÎÒ½éÉÜ';
-$messages['permalink_title'] = '¹éµµÎÄÕµÄ×ÔÎÒ¾²Ì¬Á´½ÓµØÖ·';
-$messages['permalink'] = '¾²Ì¬Á´½ÓÍøÖ·';
-$messages['posted_by'] = '×÷Õß';
-$messages['reply'] = '»Ø¸´';
-
-// add comment form
-$messages['add_comment'] = '·¢±íÆÀÂÛ';
-$messages['comment_topic'] = '±êÌâ';
-$messages['comment_text'] = 'ÔÚ´ËÌí¼ÓÆÀÂÛ';
-$messages['comment_username'] = '³Æºô';
-$messages['comment_email'] = 'ÓÊÏäµØÖ·£¨¿ÉÑ¡£©';
-$messages['comment_url'] = '¸öÈËÖ÷Ò³£¨¿ÉÑ¡£©';
-$messages['comment_send'] = '·¢±í';
-$messages['comment_added'] = 'ÄúµÄÆÀÂÛÒѾ­·¢±í';
-$messages['comment_add_error'] = '·¢±íÆÀÂÛʱ³ö´í';
-$messages['article_does_not_exist'] = '¸ÃÎÄÕ²»´æÔÚ';
-$messages['no_posts_found'] = 'ÕÒ²»µ½ÎÄÕÂ';
-$messages['user_has_no_posts_yet'] = '¸Ã×÷ÕßÉÐδ·¢±íÈκÎÎÄÕÂ';
-$messages['back'] = '·µ»ØÉÏÒ»Ò³';
-$messages['post'] = '·¢±í';
-$messages['trackbacks_for_article'] = 'ÒýÓñ¾ÎĵÄÎÄÕ£º';
-$messages['trackback_excerpt'] = 'ÕªÒª';
-$messages['trackback_weblog'] = '²©¿Í';
-$messages['search_results'] = 'ËÑË÷½á¹û';
-$messages['search_matching_results'] = 'ÒÔÏÂÎÄÕ·ûºÏËÑË÷ÐèÇó: ';
-$messages['search_no_matching_posts'] = 'ûÓÐÎÄÕ·ûºÏËÑË÷ÒªÇó';
-$messages['read_more'] = '²é¿´È«ÎÄ';
-$messages['syndicate'] = 'ÐÂΞۺÏ';
-$messages['main'] = 'Ê×Ò³';
-$messages['about'] = '¹ØÓÚ';
-$messages['download'] = 'ÏÂÔØ';
-
-////// error messages /////
-$messages['error_fetching_article'] = 'ÕÒ²»µ½ÄúËùÖ¸¶¨µÄÎÄÕÂ';
-$messages['error_fetching_articles'] = 'ÕÒ²»µ½ÄúËùÖ¸¶¨µÄÎÄÕÂ';
-$messages['error_trackback_no_trackback'] = 'ÉÐδÓÐÈËÏò±¾ÎÄ·¢ËÍÒýÓÃͨ¸æ';
-$messages['error_incorrect_article_id'] = 'ÎÄÕ±êʶºÅ´íÎó';
-$messages['error_incorrect_blog_id'] = '²©¿Í±êʶºÅ´íÎó';
-$messages['error_comment_without_text'] = 'ÇëÄúÌîдÆÀÂÛÕýÎÄ';
-$messages['error_comment_without_name'] = 'ÇëÄúÌîд³Æºô';
-$messages['error_adding_comment'] = 'Ìí¼ÓÆÀÂÛʱ³ö´í';
-$messages['error_incorrect_parameter'] = '²ÎÊý²»ÕýÈ·';
-$messages['error_parameter_missing'] = '²ÎÊý²»È«';
-$messages['error_comments_not_enabled'] = '¸Ã²©¿Í¹Ø±ÕÁËÆÀÂÛ¹¦ÄÜ';
-$messages['error_incorrect_search_terms'] = '¸ÃËÑË÷Ìõ¼þÎÞЧ';
-$messages['error_no_search_results'] = 'ËÑË÷Ìõ¼þ²»Æ¥Åä';
-$messages['error_no_albums_defined'] = '¸Ã²©¿ÍÖÐÎÞ¿ÉÓÃÎļþ¼Ð';
-
-/////////////////                                          //////////////////
-///////////////// STRINGS FOR THE ADMINISTRATION INTERFACE //////////////////
-/////////////////                                          //////////////////
-
-// login page
-$messages['login'] = '怫';
-$messages['welcome_message'] = '»¶Ó­½øÈëPlog';
-$messages['error_incorrect_username_or_password'] = '¶Ô²»Æð£¬ÄúµÄÓû§Ãû»òÕßÃÜÂë²»ÕýÈ·¡£';
-$messages['error_dont_belong_to_any_blog'] = '¶Ô²»Æð£¬ÄúÉÐδ¼ÓÈëÈκβ©¿Í¡£';
-$messages['logout_message'] = 'ÄúÒѾ­³É¹¦Í˳ö¡£';
-$messages['logout_message_2'] = 'µã»÷ <a href="%1$s">ÕâÀï</a> ½øÈë %2$s</a>.';
-$messages['error_access_forbidden'] = '·ÃÎÊÊÜÏÞ¡£ÄúÐèÒªÊ×Ïȵõ½ÈÏÖ¤»òͨ¹ý¡£';
-$messages['username'] = '̞';
-$messages['password'] = 'ÃÜÂë';
-
-// dashboard
-$messages['dashboard'] = '¿ØÖÆÃæ°å';
-$messages['recent_articles'] = '×îÐÂÎÄÕÂ';
-$messages['recent_comments'] = '×îÐÂÆÀÂÛ';
-$messages['recent_trackbacks'] = '×îÐÂÒýÓÃ';
-$messages['blog_statistics'] = '²©¿Íͳ¼Æ';
-$messages['total_posts'] = '×ÜÎÄÕÂÊý';
-$messages['total_comments'] = '×ÜÆÀÂÛÊý';
-$messages['total_trackbacks'] = '×ÜÒýÓÃÊý';
-$messages['total_viewed'] = '×Üä¯ÀÀÊý';
-$messages['in'] = 'Ä¿±êÎÄÕÂ';
-
-// menu options
-$messages['newPost'] = '·¢±íÎÄÕÂ';
-$messages['Manage'] = '¹ÜÀíÃæ°å';
-$messages['managePosts'] = 'ÎÄÕ¹ÜÀí';
-$messages['editPosts'] = 'ÎÄÕÂÁбí';
-$messages['editArticleCategories'] = '±à¼­ÎÄÕ·ÖÀà';
-$messages['newArticleCategory'] = 'н¨ÎÄÕ·ÖÀà';
-$messages['manageLinks'] = 'Á´½Ó¹ÜÀí';
-$messages['editLinks'] = 'Á´½ÓÁбí';
-$messages['newLink'] = 'н¨Á´½Ó';
-$messages['editLink'] = '±à¼­Á´½Ó';
-$messages['editLinkCategories'] = 'Á´½Ó·ÖÀà';
-$messages['newLinkCategory'] = 'н¨Á´½Ó·ÖÀà';
-$messages['editLinkCategory'] = '±à¼­Á´½Ó·ÖÀà';
-$messages['manageCustomFields'] = '¹ÜÀí×Ô¶¨ÒåÇø¿é';
-$messages['blogCustomFields'] = '×Ô¶¨ÒåÇø¿é';
-$messages['newCustomField'] = 'н¨×Ô¶¨ÒåÇø¿é';
-$messages['resourceCenter'] = '×ÊÔ´ÖÐÐÄ';
-$messages['resources'] = '×ÊÔ´Áбí';
-$messages['newResourceAlbum'] = 'н¨×ÊÔ´Îļþ¼Ð';
-$messages['newResource'] = 'н¨×ÊÔ´';
-$messages['controlCenter'] = '¿ØÖÆÖÐÐÄ';
-$messages['manageSettings'] = 'ÉèÖÃ';
-$messages['blogSettings'] = '²©¿ÍÉèÖÃ';
-$messages['userSettings'] = 'Óû§ÉèÖÃ';
-$messages['pluginCenter'] = '²å¼þÖÐÐÄ';
-$messages['Stats'] = 'ͳ¼Æ×ÊÁÏ';
-$messages['manageBlogUsers'] = 'Óû§¹ÜÀí';
-$messages['newBlogUser'] = 'Ìí¼ÓÐÂÓû§';
-$messages['showBlogUsers'] = 'Óû§Áбí';
-$messages['manageBlogTemplates'] = 'Ä£°å¹ÜÀí';
-$messages['newBlogTemplate'] = 'н¨Ä£°å';
-$messages['blogTemplates'] = 'Ä£°åÁбí';
-$messages['adminSettings'] = '¹ÜÀíÉèÖÃ';
-$messages['Users'] = 'Óû§¹ÜÀí';
-$messages['createUser'] = '´´½¨Óû§';
-$messages['editSiteUsers'] = 'Óû§Áбí';
-$messages['Blogs'] = '²©¿Í¹ÜÀí';
-$messages['createBlog'] = '´´½¨²©¿Í';
-$messages['editSiteBlogs'] = '²©¿ÍÁбí';
-$messages['Locales'] = 'ÓïÑÔ°ü¹ÜÀí';
-$messages['newLocale'] = 'Ìí¼ÓÓïÑÔ°ü';
-$messages['siteLocales'] = 'ÓïÑÔ°üÁбí';
-$messages['Templates'] = 'Ä£°å¹ÜÀí';
-$messages['newTemplate'] = '´´½¨Ä£°å';
-$messages['siteTemplates'] = 'Ä£°åÁбí';
-$messages['GlobalSettings'] = 'È«¾ÖÉèÖÃ';
-$messages['editSiteSettings'] = '³£¹æÉèÖÃ';
-$messages['summarySettings'] = '»ã×ÜÉèÖÃ';
-$messages['templateSettings'] = 'Ä£°åÉèÖÃ';
-$messages['urlSettings'] = 'URLÉèÖÃ';
-$messages['emailSettings'] = 'ÓʼþÉèÖÃ';
-$messages['uploadSettings'] = 'ÉÏ´«ÉèÖÃ';
-$messages['helpersSettings'] = '°ïÖúÉèÖÃ';
-$messages['interfacesSettings'] = '½Ó¿ÚÉèÖÃ';
-$messages['securitySettings'] = '°²È«ÉèÖÃ';
-$messages['bayesianSettings'] = '¹ýÂËÉèÖÃ';
-$messages['resourcesSettings'] = '×ÊÔ´ÖÐÐÄÉèÖÃ';
-$messages['searchSettings'] = 'ËÑË÷ÉèÖÃ';
-$messages['cleanUpSection'] = 'ÇåÀíÀ¬»ø';
-$messages['cleanUp'] = 'ÇåÀíÀ¬»ø';
-$messages['editResourceAlbum'] = '±à¼­×ÊÔ´¼Ð';
-$messages['resourceInfo'] = '±à¼­×ÊÔ´';
-$messages['editBlog'] = '±à¼­²©¿Í';
-$messages['Logout'] = '×¢Ïú';
-
-// new post
-$messages['topic'] = '±êÌâ';
-$messages['topic_help'] = 'ÔÚÕâÀïÊäÈëÎÄÕ±êÌâ';
-$messages['text'] = 'ÎÄÕÂÄÚÈÝ';
-$messages['text_help'] = 'ÕªÒªÄÚÈÝ£º£¨¸Ã²¿·ÖÄÚÈݽ«ÔÚÄúµÄÊ×Ò³ÏÔʾ£©';
-$messages['extended_text'] = 'À©Õ¹ÄÚÈÝ';
-$messages['extended_text_help'] = 'À©Õ¹ÄÚÈÝ£º£¨¸Ã²¿·Ö¿ÉÒÔͨ¹ýºǫ́ÉèÖþö¶¨ÊÇ·ñÏÔʾÔÚÊ×Ò³Öлò½ö½ö³öÏÖÔÚÎÄÕÂÄÚÈÝÖУ¬ÔÚ²©¿ÍÉèÖÃÖлáÕÒµ½¸ü¶àÐÅÏ¢¡£';
-$messages['post_slug'] = 'ÎÄÕ´ú³É';
-$messages['post_slug_help'] = 'ÎÄÕ´ú³É¿ÉÒÔΪÎÄÕ±êÌâÉú³É¾²Ì¬µØÖ·¡£';
-$messages['date'] = 'ÈÕÆÚ';
-$messages['post_date_help'] = '·¢±íÎÄÕµÄÈÕÆÚ';
-$messages['status'] = 'ÎÄÕÂ״̬';
-$messages['post_status_help'] = 'Ñ¡ÔñÎÄÕÂ״̬';
-$messages['post_status_published'] = '¹«¿ª';
-$messages['post_status_draft'] = '²Ý¸å';
-$messages['post_status_deleted'] = 'ÒÑɾ³ý';
-$messages['categories'] = 'ÎÄÕ·ÖÀà';
-$messages['post_categories_help'] = 'Ñ¡ÔñÒ»¸ö»ò¶à¸ö·ÖÀà';
-$messages['post_comments_enabled_help'] = 'ÔÊÐí»Ø¸´';
-$messages['send_notification_help'] = '·¢ËÍлظ´Í¨Öª';
-$messages['send_trackback_pings_help'] = '·¢ËÍÒýÓÃͨ¸æ';
-$messages['send_xmlrpc_pings_help'] = '·¢ËÍXMLRPC pings';
-$messages['save_draft_and_continue'] = '±£´æ²Ý¸å';
-$messages['preview'] = 'ÎÄÕÂÔ¤ÀÀ';
-$messages['add_post'] = '·¢±í¸ÃÎÄÕÂ';
-$messages['error_saving_draft'] = '±£´æ²Ý¸å¹ý³ÌÖгö´í';
-$messages['draft_saved_ok'] = '±£´æ²Ý¸å³É¹¦';
-$messages['error_sending_request'] = '·¢ËÍÇëÇóʱ³ö´í';
-$messages['error_no_category_selected'] = 'ÇëÄúÖÁÉÙÑ¡ÔñÒ»¸öÎÄÕ·ÖÀà';
-$messages['error_missing_post_topic'] = 'ÇëÄúÊäÈëÎÄÕ±êÌâ';
-$messages['error_missing_post_text'] = 'ÇëÄúÊäÈëÎÄÕÂÄÚÈÝ';
-$messages['error_adding_post'] = 'Ìí¼ÓÎÄÕÂʱ·¢Éú´íÎó';
-$messages['post_added_not_published'] = 'Ìí¼ÓÎÄÕ³ɹ¦µ«Î´·¢²¼';
-$messages['post_added_ok'] = 'Ìí¼ÓÎÄÕ³ɹ¦';
-$messages['send_notifications_ok'] = 'ÓÐÐÂÆÀÂÛ»òÒýÓÃʱ½«ÏòÄú·¢ËÍͨ¸æ¡£';
-
-// send trackbacks
-$messages['error_sending_trackbacks'] = '·¢ËÍÒÔÏÂÒýÓÃ֪ͨʱ·¢Éú´íÎó';
-$messages['send_trackbacks_help'] = 'ÇëÑ¡ÔñÄúËùÒª·¢ËÍÒýÓÃͨ¸æµÄÍøÖ·¡£(ÇëÈ·¶¨¸ÃÍøÕ¾Õ¾Ö§³ÖÒýÓÃͨ¸æ¹¦ÄÜ)';
-$messages['send_trackbacks'] = '·¢ËÍÒýÓÃ֪ͨ';
-$messages['ping_selected'] = 'ÏòÑ¡¶¨µÄÍøÖ··¢ËÍÒýÓÃ֪ͨ';
-$messages['trackbacks_sent_ok'] = 'ÒýÓÃ֪ͨÒѳɹ¦·¢Ë͵½Ñ¡¶¨µÄÍøÖ·';
-
-// posts page
-$messages['show_by'] = 'ÏÔʾ';
-$messages['category'] = 'ÎÄÕ·ÖÀà';
-$messages['author'] = '×÷Õß';
-$messages['post_status_all'] = 'È«²¿×´Ì¬';
-$messages['author_all'] = 'È«²¿×÷Õß';
-$messages['search_terms'] = 'ËÑË÷Ìõ¼þ';
-$messages['show'] = 'ÏÔʾ';
-$messages['delete'] = 'ɾ³ý';
-$messages['actions'] = '¼¤»î';
-$messages['all'] = 'È«²¿';
-$messages['category_all'] = 'È«²¿·ÖÀà';
-$messages['error_incorrect_article_id'] = '²»ÕýÈ·µÄÎÄÕ±êʶ';
-$messages['error_deleting_article'] = 'ɾ³ýÎÄÕ "%s" ʱ·¢Éú´íÎó';
-$messages['article_deleted_ok'] = 'ÎÄÕ "%s" ɾ³ý³É¹¦';
-$messages['articles_deleted_ok'] = 'ÎÄÕ %s ɾ³ý³É¹¦';
-$messages['error_deleting_article2'] = 'ɾ³ýÎÄÕ "%s" ʱ·¢Éú´íÎó';
-
-// edit post page
-$messages['update'] = 'ÐÞ¸Ä';
-$messages['editPost'] = '±à¼­ÎÄÕÂ';
-$messages['error_fetching_post'] = '¶ÁÈ¡ÎÄÕÂʱ³ö´í';
-$messages['post_updated_ok'] = 'ÎÄÕ "%s" ¸üгɹ¦';
-$messages['error_updating_post'] = '¸üÐÂÎÄÕÂʱ³ö´í';
-$messages['notification_added'] = 'ÓÐÐÂÆÀÂÛ»òÒýÓÃʱÄú½«ÊÕµ½Í¨¸æ¡£';
-$messages['notification_removed'] = 'ÓÐÐÂÆÀÂÛ»òÒýÓÃʱ²»·¢ËÍͨ¸æ¡£';
-
-// post comments
-$messages['url'] = 'URL';
-$messages['comment_status_all'] = 'È«²¿';
-$messages['comment_status_spam'] = 'À¬»øÆÀÂÛ';
-$messages['comment_status_nonspam'] = 'ÎÞÀ¬»øÆÀÂÛ';
-$messages['error_fetching_comments'] = '¶ÁÈ¡ÎÄÕÂÆÀÂÛʱ³ö´í';
-$messages['error_deleting_comments'] = 'ɾ³ýÎÄÕÂÆÀÂÛʱ³ö´í»òÎÞδѡÔñÈκÎÆÀÂÛ';
-$messages['comment_deleted_ok'] = 'ÆÀÂÛ "%s" ɾ³ý³É¹¦';
-$messages['comments_deleted_ok'] = 'ÆÀÂÛ %s ɾ³ý³É¹¦';
-$messages['error_deleting_comment'] = 'ɾ³ýÆÀÂÛ "%s" ʱ³ö´í';
-$messages['error_deleting_comment2'] = 'ɾ³ýÆÀÂÛ %s ʱ³ö´í';
-$messages['editComments'] = '±à¼­ÆÀÂÛ';
-$messages['mark_as_spam'] = '±ê¼ÇΪÀ¬»øÆÀÂÛ';
-$messages['mark_as_no_spam'] = '±ê¼ÇΪ·ÇÀ¬»øÆÀÂÛ';
-$messages['error_incorrect_comment_id'] = 'ÆÀÂÛ±êʶ´íÎó';
-$messages['error_marking_comment_as_spam'] = '±ê¼ÇÀ¬»øÆÀÂÛʱ³ö´í';
-$messages['comment_marked_as_spam_ok'] = '¸ÃÆÀÂÛÒѳɹ¦±ê¼ÇΪÀ¬»øÆÀÂÛ';
-$messages['error_marking_comment_as_nonspam'] = 'È¥³ýÀ¬»øÆÀÂÛ±ê¼Çʱ³ö´í';
-$messages['comment_marked_as_nonspam_ok'] = '³É¹¦È¥³ýÀ¬»øÆÀÂÛ±ê¼Ç';
-
-// post trackbacks
-$messages['blog'] = '²©¿ÍÕ¾µã';
-$messages['excerpt'] = 'ÒýÓÃÄÚÈÝ';
-$messages['error_fetching_trackbacks'] = '¶ÁÈ¡ÒýÓÃʱ³ö´í';
-$messages['error_deleting_trackbacks'] = 'ɾ³ýÒýÓÃʱ³ö´í»òδѡÔñÈκÎÒýÓÃ';
-$messages['error_deleting_trackback'] = 'ɾ³ýÒýÓà "%s" ʱ³ö´í';
-$messages['error_deleting_trackback2'] = 'ɾ³ýÒýÓà "%s" ʱ³ö´í';
-$messages['trackback_deleted_ok'] = 'ÒýÓà "%s" ɾ³ý³É¹¦';
-$messages['trackbacks_deleted_ok'] = 'ÒýÓà %s ɾ³ý³É¹¦';
-$messages['editTrackbacks'] = 'ÒýÓÃ';
-
-// post statistics
-$messages['referrer'] = 'ÄæÏòÁ´½Ó';
-$messages['hits'] = 'µã»÷Êý';
-$messages['error_no_items_selected'] = 'δѡÔñɾ³ýÈκÎÑ¡Ïî';
-$messages['error_deleting_referrer'] = 'ɾ³ýÄæÏòÁ´½Ó "%s" ʱ³ö´í';
-$messages['error_deleting_referrer2'] = 'ɾ³ýÄæÏòÁ´½Ó "%s" ʱ³ö´í';
-$messages['referrer_deleted_ok'] = 'ÄæÏòÁ´½Ó "%s" ɾ³ý³É¹¦';
-$messages['referrers_deleted_ok'] = 'ÄæÏòÁ´½Ó "%s" ɾ³ý³É¹¦';
-
-// categories
-$messages['posts'] = 'ÎÄÕÂÊý';
-$messages['show_in_main_page'] = 'ÊÇ·ñÔÚÊ×Ò³ÏÔʾ';
-$messages['error_incorrect_category_id'] = '·ÖÀà±êʶ´íÎó»òδѡÔñÏîÄ¿';
-$messages['error_category_has_articles'] = '·ÖÀà "%s" Òѱ»ÎÄÕÂʹÓã¬ÇëÏȱ༭ÕâЩÎÄÕÂÔÙɾ³ý¸Ã·ÖÀà¡£';
-$messages['category_deleted_ok'] = '·ÖÀà "%s" ³É¹¦É¾³ý';
-$messages['categories_deleted_ok'] = '·ÖÀà "%s" ³É¹¦É¾³ý';
-$messages['error_deleting_category'] = 'ɾ³ý·ÖÀà"%s"ʱ³ö´í';
-$messages['error_deleting_category2'] = 'ɾ³ý·ÖÀà"%s"ʱ³ö´í';
-$messages['yes'] = 'ÊÇ';
-$messages['no'] = '·ñ';
-
-// new category
-$messages['name'] = '·ÖÀàÃû³Æ';
-$messages['category_name_help'] = '·ÖÀàÃû³Æ½«ÏÔʾÔÚÊ×Ò³';
-$messages['description'] = 'ÃèÊö';
-$messages['category_description_help'] = '¸Ã·ÖÀàµÄÏêϸÃèÊö';
-$messages['show_in_main_page_help'] = '¸Ã·ÖÀàÊÇ·ñÔÚÊ×Ò³ÏÔʾ';
-$messages['error_empty_name'] = 'Äã±ØÐëÊäÈë·ÖÀàÃû³Æ';
-$messages['error_empty_description'] = 'Äã±ØÐëÊäÈë·ÖÀàÃèÊö';
-$messages['error_adding_article_category'] = 'Ìí¼ÓзÖÀàʱ³ö´í£¬Çë¼ì²éÊäÈëÖØÊÔ';
-$messages['category_added_ok'] = '·ÖÀà "%s" ³É¹¦Ìí¼Óµ½ÏµÍ³ÖÐ';
-$messages['add'] = 'Ìí¼Ó';
-$messages['reset'] = 'ÖØÖÃ';
-
-// update category
-$messages['error_updating_article_category'] = 'Ð޸ķÖÀàʱ³ö´í';
-$messages['error_fetching_category'] = '¶ÁÈ¡·ÖÀàʱ³ö´í';
-$messages['article_category_updated_ok'] = '·ÖÀà"%s"Ð޸ijɹ¦';
-
-// links
-$messages['feed'] = 'Feed';
-$messages['error_no_links_selected'] = 'Á´½Ó±êʶ´íÎó»òδѡÔñÏîÄ¿';
-$messages['error_incorrect_link_id'] = 'Á´½Ó±êʶ´íÎó';
-$messages['error_removing_link'] = 'ɾ³ýÁ´½Ó"%s"ʱ³ö´í';
-$messages['error_removing_link2'] = 'ɾ³ýÁ´½Ó"%s"ʱ³ö´í';
-$messages['link_deleted_ok'] = 'Á´½Ó "%s" ɾ³ý³É¹¦';
-$messages['links_deleted_ok'] = 'Á´½Ó %s ɾ³ý³É¹¦';
-
-// new link
-$messages['link_name_help'] = 'Á´½ÓÃû³Æ';
-$messages['link_url_help'] = 'Á´½ÓµØÖ·';
-$messages['link_description_help'] = 'Á´½ÓÃèÊö';
-$messages['link_feed_help'] = 'Á´½ÓFeedµØÖ·';
-$messages['link_category_help'] = 'Ñ¡ÔñÒ»¸öÓÐЧµÄÁ´½Ó·ÖÀà';
-$messages['error_adding_link'] = 'Ìí¼ÓÁ´½Óʱ³ö´í£¬Çë¼ì²éÊý¾Ý²¢ÖØÊÔ';
-$messages['error_invalid_url'] = 'µØÖ·´í';
-$messages['link_added_ok'] = 'Á´½Ó "%s" Ìí¼Ó³É¹¦';
-
-// update link
-$messages['error_updating_link'] = 'ÐÞ¸ÄÁ´½Óʱ³ö´í£¬Çë¼ì²éÊý¾Ý²¢ÖØÊÔ¡£';
-$messages['error_fetching_link'] = '¶ÁÈ¡Á´½Óʱ³ö´í';
-$messages['link_updated_ok'] = 'Á´½Ó "%s" Ð޸ijɹ¦';
-
-// link categories
-$messages['links'] = 'ÍøÕ¾Á´½Ó';
-$messages['error_invalid_link_category_id'] = '¸ÃÁ´½Ó·ÖÀà±êʶ³ö´í»òδѡÔñÏîÄ¿';
-$messages['error_links_in_link_category'] = 'ÓÐÁ´½ÓʹÓÃÁ´½Ó·ÖÀà "%s" £¬ÇëÊ×ÏÈÐÞ¸ÄÁ´½ÓÔÙÖØÊÔ';
-$messages['error_removing_link_category'] = 'ɾ³ýÁ´½Ó·ÖÀà "%s"ʱ³ö´í';
-$messages['link_category_deleted_ok'] = 'Á´½Ó "%s" ɾ³ý³É¹¦';
-$messages['link_categories_deleted_ok'] = 'Á´½Ó "%s" ɾ³ý³É¹¦';
-$messages['error_removing_link_category2'] = 'ɾ³ýÁ´½Ó·ÖÀà "%s"ʱ³ö´í';
-
-// new link category
-$messages['link_category_name_help'] = 'ÐÂÁ´½Ó·ÖÀàÃû³Æ';
-$messages['error_adding_link_category'] = 'Ìí¼ÓÐÂÁ´½Óʱ³ö´í';
-$messages['link_category_added_ok'] = 'Á´½Ó·ÖÀà "%s" Ìí¼Ó³É¹¦';
-
-// edit link category
-$messages['error_updating_link_category'] = 'ÐÞ¸ÄÁ´½Ó·ÖÀàʱ³ö´í£¬Çë¼ì²éÊý¾Ý²¢ÖØÊÔ';
-$messages['link_category_updated_ok'] = 'Á´½Ó·ÖÀà "%s" Ð޸ijɹ¦';
-$messages['error_fetching_link_category'] = '¶ÁÈ¡Á´½Ó·ÖÀàʱ³ö´í';
-
-// custom fields
-$messages['type'] = 'ÀàÐÍ';
-$messages['hidden'] = 'ÊÇ·ñÒþ²Ø';
-$messages['fields_deleted_ok'] = '×Ô¶¨ÒåÇø¿é %s ɾ³ý³É¹¦';
-$messages['field_deleted_ok'] = '×Ô¶¨ÒåÇø¿é "%s" ɾ³ý³É¹¦';
-$messages['error_deleting_field'] = 'ɾ³ý×Ô¶¨ÒåÇø¿é "%s" ʱ³ö´í';
-$messages['error_deleting_field2'] = 'ɾ³ý×Ô¶¨ÒåÇø¿é "%s" ʱ³ö´í';
-$messages['error_incorrect_field_id'] = '×Ô¶¨ÒåÇø¿é±êʶÎÞЧ';
-
-// new custom field
-$messages['field_name_help'] = 'ÔÚÎÄÕÂÖн«×÷Ϊ¸ÃÇø¿éµÄ±êʶ';
-$messages['field_description_help'] = '¸ÃÇø¿éµÄ¸ÅÒªÃèÊö½«ÔÚÌí¼Ó»òÐÞ¸ÄÎÄÕÂʱÏÔʾ';
-$messages['field_type_help'] = 'Ñ¡ÔñÓÐЧÇø¿éµÄÀàÐÍ';
-$messages['field_hidden_help'] = 'Èç¹ûÒ»¸öÇø¿éÒþ²Ø£¬ÄÇôËüÔÚÌí¼Ó»ò±à¼­ÎÄÕÂʱ²»»áÏÔʾ³öÀ´¡£Õâ¸ö¹¦ÄÜÖ÷ÒªÓ¦ÓÃÔÚ²å¼þÖС£';
-$messages['error_adding_custom_field'] = 'Ìí¼Ó×Ô¶¨ÒåÇø¿éʱ³ö´í£¬Çë¼ì²éÊý¾Ý²¢ÖØÊÔ';
-$messages['custom_field_added_ok'] = '×Ô¶¨ÒåÇø¿é "%s" Ìí¼Ó³É¹¦';
-$messages['text_field'] = 'Îı¾ÇøÓò';
-$messages['text_area'] = 'Îı¾¿ò';
-$messages['checkbox'] = '¶àÑ¡¿ò';
-$messages['date_field'] = 'ÈÕÆÚÑ¡Ôñ';
-
-// edit custom field
-$messages['error_fetching_custom_field'] = '¶ÁÈ¡×Ô¶¨ÒåÇø¿éʱ³ö´í';
-$messages['error_updating_custom_field'] = 'ÐÞ¸Ä×Ô¶¨ÒåÇø¿éʱ³ö´í£¬Çë¼ì²éÊý¾Ý²¢ÖØÊÔ';
-$messages['custom_field_updated_ok'] = '×Ô¶¨ÒåÇø¿é "%s" Ð޸ijɹ¦';
-
-// resources
-$messages['root_album'] = '¸ùÎļþ¼Ð';
-$messages['num_resources'] = '×ÊÔ´ÊýÁ¿';
-$messages['total_size'] = '×ÜʹÓÿռä';
-$messages['album'] = 'Îļþ¼Ð';
-$messages['error_incorrect_album_id'] = '×ÊÔ´±êʶ³ö´í';
-$messages['error_base_storage_folder_missing_or_unreadable'] = 'plogÖв»ÄÜ´´½¨±ØÒªµÄ´æ·Å×ÊÔ´µÄÎļþ¼Ð¡£Õâ¿ÉÄÜÓɶàÖÖÔ­ÒòÔì³É£¬±ÈÈçÄãµÄphpʹÓð²È«Ä£Ê½°²×°ÔËÐлòÕßÄãµÄÓû§Ã»ÓÐ×㹻ȨÏÞ¡£ÄãÈÔÈ»¿ÉÒÔÊÖ¶¯½øÐвÙ×÷£¬´´½¨Îļþ¼Ð: <br/><br/>%s<br/><br/>Èç¹ûÕâЩÎļþ¼ÐÒѾ­´æÔÚ£¬ÇëÈ·¶¨ËýÃÇ¿Éͨ¹ýÓû§ÔËÐÐweb·þÎñÆ÷½øÐжÁд¡£';
-$messages['items_deleted_ok'] = 'ÏîÄ¿%sɾ³ý³É¹¦';
-$messages['error_album_has_children'] = 'Îļþ¼Ð "%s" ÓÐ×ÓÎļþ¼Ð. ÇëÏȱ༭¸ÃÎļþ¼ÐÔÙÖØÊÔ¡£';
-$messages['item_deleted_ok'] = 'ÏîÄ¿%sɾ³ý³É¹¦';
-$messages['error_deleting_album'] = 'ɾ³ýÎļþ¼Ð "%s" ʱ³ö´í';
-$messages['error_deleting_album2'] = 'ɾ³ýÎļþ¼Ð "%s" ʱ³ö´í';
-$messages['error_deleting_resource'] = 'ɾ³ýÎļþ"%s"ʱ³ö´í';
-$messages['error_deleting_resource2'] = 'ɾ³ýÎļþ"%s"ʱ³ö´í';
-$messages['error_no_resources_selected'] = 'ûÓÐÑ¡Ôñɾ³ýµÄÏîÄ¿';
-$messages['resource_deleted_ok'] = '×ÊÔ´"%s"±»³É¹¦É¾³ý';
-$messages['album_deleted_ok'] = 'Îļþ¼Ð"%s"±»³É¹¦É¾³ý';
-$messages['add_resource'] = 'Ìí¼Ó×ÊÔ´';
-$messages['add_resource_preview'] = 'Ìí¼ÓÔ¤ÀÀ';
-$messages['add_resource_medium'] = 'Ìí¼ÓÖÐÐÍÔ¤ÀÀ';
-$messages['add_album'] = 'Ìí¼ÓÎļþ¼Ð';
-
-// new album
-$messages['album_name_help'] = '¸ÃÎļþ¼ÐµÄÃû³Æ';
-$messages['parent'] = 'Éϼ¶Îļþ¼Ð';
-$messages['no_parent'] = 'ÎÞÉϼ¶Îļþ¼Ð';
-$messages['parent_album_help'] = 'ʹÓÃÕâ¸öÑ¡ÏîʹµÃÎļþ¼ÐÏ°üº¬Îļþ¼ÐÒÔ±ã¸üºÃµÄ¹ÜÀíÎļþ';
-$messages['album_description_help'] = 'Îļþ¼ÐÄÚÈݵÄÏêϸÃèÊö';
-$messages['error_adding_album'] = 'Ìí¼ÓÐÂÎļþ¼Ð³ö´í£¬Çë¼ì²éÊý¾Ý²¢ÖØÊÔ¡£';
-$messages['album_added_ok'] = 'Îļþ¼Ð "%s" ³É¹¦Ìí¼Ó';
-
-// edit album
-$messages['error_incorrect_album_id'] = 'Îļþ¼Ð±íʾ´íÎó';
-$messages['error_fetching_album'] = '¶ÁÈ¡Îļþ¼Ðʱ³ö´í';
-$messages['error_updating_album'] = 'ÐÞ¸ÄÎļþ¼Ðʱ³ö´í£¬Çë¼ì²éÊý¾ÝÖØÊÔ';
-$messages['album_updated_ok'] = 'Îļþ¼Ð "%s" Ð޸ijɹ¦';
-$messages['show_album_help'] = 'Èç¹û½ûÓã¬Îļþ¼Ð½«²»ÏÔʾÔÚ²©¿ÍµÄ¿ÉÓÃÎļþ¼ÐÁбíÖÐ';
-
-// new resource
-$messages['file'] = 'Îļþ';
-$messages['resource_file_help'] = 'Ìí¼ÓÎļþµ½µ±Ç°²©¿ÍÖС£Ê¹Óá°Ìí¼Ó¶à¸öÎļþ¡±Á´½ÓͬʱÉÏ´«¶à¸öÎļþ';
-$messages['add_field'] = 'Ìí¼Ó¶à¸öÎļþ';
-$messages['resource_description_help'] = '¸ÃÎļþµÄÏêϸÃèÊö';
-$messages['resource_album_help'] = 'Ñ¡Ôñ¸ÃÎļþÒªÌí¼Óµ½ÄĸöÎļþ¼Ð';
-$messages['error_no_resource_uploaded'] = 'δѡÔñÈκδýÉÏ´«Îļþ';
-$messages['resource_added_ok'] = 'Îļþ "%s" Ìí¼Ó³É¹¦';
-$messages['error_resource_forbidden_extension'] = '¸ÃÎļþÀàÐͱ»½ûÓ㬲»¿ÉÌí¼Ó';
-$messages['error_resource_too_big'] = 'ÎļþÌ«´ó£¬²»¿ÉÌí¼Ó';
-$messages['error_uploads_disabled'] = '½ûÖ¹ÉÏ´«Îļþ';
-$messages['error_quota_exceeded'] = 'ÎļþÅä¶î³¬ÈÝ£¬²»¿ÉÌí¼ÓÎļþ';
-$messages['error_adding_resource'] = 'Ìí¼Ó×ÊÔ´Îļþʱ³ö´í';
-
-// edit resource
-$messages['editResource'] = '±à¼­×ÊÔ´';
-$messages['resource_information_help'] = 'ÒÔÏÂÊÇһЩ¹ØÓÚ×ÊÔ´ÎļþµÄÐÅÏ¢¡£';
-$messages['information'] = 'ÎļþÐÅÏ¢';
-$messages['size'] = 'Îļþ´óС';
-$messages['format'] = 'Îļþ¸ñʽ';
-$messages['dimensions'] = 'Â˾µ';
-$messages['bits_per_sample'] = 'ÎļþÑù±¾Î»Êý';
-$messages['sample_rate'] = 'Ñù±¾ÂÊ';
-$messages['number_of_channels'] = 'ͨµÀÊý';
-$messages['legnth'] = '³¤¶È';
-$messages['thumbnail_format'] = 'ËõÂÔͼ¸ñʽ';
-$messages['regenerate_preview'] = 'ÖØÐÂÉú³ÉÔ¤ÀÀ';
-$messages['error_fetching_resource'] = '¶ÁÈ¡Îļþʱ³ö´í';
-$messages['error_updating_resource'] = 'ÐÞ¸ÄÎļþʱ³ö´í';
-$messages['resource_updated_ok'] = 'Îļþ "%s" Ð޸ijɹ¦';
-
-// blog settings
-$messages['blog_link'] = '²©¿ÍµØÖ·';
-$messages['blog_link_help'] = '¸Ã²©¿ÍÍøÕ¾µÄÓÀ¾ÃµØÖ·';
-$messages['blog_name_help'] = '²©¿ÍÃû³Æ';
-$messages['blog_description_help'] = '¸Ã²©¿ÍµÄÏêϸÃèÊö';
-$messages['language'] = 'ÓïÑÔ';
-$messages['blog_language_help'] = 'Ñ¡Ôñ²©¿Íǰ̨ºÍ¹ÜÀíµÄÓïÑÔ';
-$messages['max_main_page_items'] = 'Ê×Ò³ÎÄÕÂÊýÁ¿';
-$messages['max_main_page_items_help'] = 'ÏÔʾÔڸò©¿ÍÊ×Ò³µÄ×î´óÎÄÕÂÊýÁ¿';
-$messages['max_recent_items'] = '½üÆÚÎÄÕÂÊýÁ¿';
-$messages['max_recent_items_help'] = 'ÏÔʾÔÚÊ×Ò³ÖеÄ×îз¢±íµÄ×î´óÎļþÊýÁ¿';
-$messages['template'] = 'Ä£°å';
-$messages['choose'] = 'Ñ¡Ôñ';
-$messages['blog_template_help'] = 'Ñ¡Ôñ¸Ã²©¿ÍÓ¦ÓõÄÄ£°å£¬ Õâ¸öÁбí°üÀ¨ÁËËùÓеÄΪ¸Ã²©¿Í°²×°µÄÄ£°å';
-$messages['use_read_more'] = 'ÔÚÎÄÕÂÖÐʹÓÃÀ©Õ¹ÄÚÈÝ';
-$messages['use_read_more_help'] = 'Èç¹ûÆôÓøÃÑ¡ÏÔÚÊ×Ò³Ö»ÏÔʾÎÄÕÂÄÚÈÝ£¬¶ø²»ÏÔʾÀ©Õ¹ÄÚÈÝ¡£Èç¹ûÐèÒªÏÔʾÀ©Õ¹ÄÚÈݵĻ°£¬Ã¿¸öÎÄÕÂĩβ»á³öÏÖÒ»¸ö¡°²é¿´È«ÎÄ¡±µÄÁ´½Ó';
-$messages['enable_wysiwyg'] = 'ʹÓÃËù¼û¼´ËùµÃ±à¼­Æ÷±à¼­ÎÄÕÂ';
-$messages['enable_wysiwyg_help'] = 'ÆôÓÃËù¼û¼´ËùµÃ±à¼­Æ÷±à¼­ÎÄÕµÄhtml´úÂë.¸Ã±à¼­Æ÷Ö»ÄÜʹÓÃÔÚIE5.5ÒÔÉÏ»òMozilla 1.3ÒÔÉÏä¯ÀÀÆ÷ÖÐ';
-$messages['enable_comments'] = 'ĬÈÏÔÊÐíÆÀÂÛÎÄÕÂ';
-$messages['enable_comments_help'] = 'ĬÈÏ¿ª·Å¶ÔËùÓÐÎÄÕµÄÆÀÂÛÁôÑÔȨÏÞ.';
-$messages['show_future_posts'] = 'ÏÔʾ½«À´µÄÎÄÕÂ';
-$messages['show_future_posts_help'] = 'ÒÔ½«À´ÈÕÆÚ·¢±íµÄÎÄÕÂÊÇ·ñ¶ÔÆäËüÓû§¿É¼û';
-$messages['comments_order'] = 'ÆÀÂÛÁôÑÔÅÅÐò·½Ê½';
-$messages['comments_order_help'] = 'ÔÚÊ×Ò³ÖÐÆÀÂÛµÄÅÅÐò·½Ê½';
-$messages['oldest_first'] = '¾ÉµÄÔÚÇ°';
-$messages['newest_first'] = 'еÄÔÚÇ°';
-$messages['categories_order'] = 'ÎÄÕ·ÖÀàÅÅÐò·½Ê½';
-$messages['categories_order_help'] = 'ÔÚÊ×Ò³ÖÐÎÄÕ·ÖÀàµÄÅÅÐò·½Ê½';
-$messages['most_recent_updated_first'] = '×î½ü¸üÐÂ×î¶àµÄÔÚÇ°';
-$messages['alphabetical_order'] = '°´×ÖĸÕýÐòÅÅÁÐ';
-$messages['reverse_alphabetical_order'] = '°´×Öĸµ¹ÐòÅÅÁÐ';
-$messages['most_articles_first'] = 'ÎÄÕÂ×î¶àµÄÔÚÇ°';
-$messages['link_categories_order'] = 'Á´½Ó·ÖÀàÅÅÐò·½Ê½';
-$messages['link_categories_order_help'] = 'ÔÚÊ×Ò³ÖÐÁ´½Ó·ÖÀàµÄÅÅÐò·½Ê½';
-$messages['most_links_first'] = 'Á´½Ó×î¶àµÄÔÚÇ°';
-$messages['most_links_last'] = 'Á´½Ó×î¶àµÄÔÚºó';
-$messages['time_offset'] = 'ʱ²î';
-$messages['time_offset_help'] = 'ÄúµÄ²©¿Í·þÎñÆ÷ÓëÄúËùÔڵصÄʱ²î ';
-$messages['close'] = '¹Ø±Õ';
-$messages['select'] = 'Ñ¡Ôñ';
-$messages['error_updating_settings'] = '¸üв©¿ÍÉèÖÃʱ³ö´í£¬Çë¼ì²éÊý¾Ý²¢ÖØÊÔ¡£';
-$messages['error_invalid_number'] = 'ÊýÄ¿²»ÕýÈ·';
-$messages['error_incorrect_time_offset'] = 'ʱ²îÎÞЧ';
-$messages['blog_settings_updated_ok'] = '²©¿ÍÉèÖÃÐ޸ijɹ¦';
-$messages['hours'] = 'Сʱ';
-
-// user settings
-$messages['username_help'] = 'Óû§Ãû³Æ£¬²»¿ÉÐÞ¸Ä';
-$messages['full_name'] = 'È«Ãû';
-$messages['full_name_help'] = 'Óû§µÄÈ«Ãû';
-$messages['password_help'] = 'ÐÞ¸ÄÃÜÂ룬Áô¿ÕÔòÃÜÂë±£³Ö²»±ä¡£';
-$messages['confirm_password'] = 'È·ÈÏÃÜÂë';
-$messages['email'] = 'µç×ÓÓʼþ';
-$messages['email_help'] = '½ÓÊÕ֪ͨµÄµç×ÓÓʼþµØÖ·';
-$messages['bio'] = '×ÔÎÒ½éÉÜ';
-$messages['bio_help'] = '×ÔÎÒµÄÏêϸ½éÉÜ';
-$messages['picture'] = 'ÐÎÏóͼƬ';
-$messages['user_picture_help'] = '´ÓÉÏ´«µÄͼƬÖÐÑ¡ÔñÒ»¸ö×÷ΪÄãµÄ¸öÈËͼƬ';
-$messages['error_invalid_password'] = 'ÃÜÂë²»ÕýÈ·£¬ÇëÈ·ÈÏÆ䳤¶ÈÊÇ·ñ¹ý¶Ì';
-$messages['error_passwords_dont_match'] = '¶Ô²»Æð£¬ÃÜÂ벻ƥÅä';
-$messages['error_incorrect_email_address'] = 'µç×ÓÓʼþµØÖ·²»ÕýÈ·';
-$messages['error_updating_user_settings'] = '¸üÐÂÓû§ÉèÖÃʱ³ö´í£¬Çë¼ì²éÊý¾Ý²¢ÖØÊÔ';
-$messages['user_settings_updated_ok'] = 'Óû§ÉèÖÃÐ޸ijɹ¦';
-$messages['resource'] = '×ÊÔ´';
-
-// plugin centre
-$messages['identifier'] = '±êʶºÅ';
-$messages['error_plugins_disabled'] = '¶Ô²»Æ𣬲å¼þ±»½ûÓá£';
-
-// blog users
-$messages['revoke_permissions'] = 'È¡ÏûʹÓÃȨÏÞ';
-$messages['error_no_users_selected'] = 'λѡÔñÈκÎÓû§';
-$messages['user_removed_from_blog_ok'] = 'Óû§ "%s" µÄ¸Ã²©¿ÍȨÏÞÈ¡Ïû³É¹¦';
-$messages['users_removed_from_blog_ok'] = 'Óû§ "%s" µÄ¸Ã²©¿ÍȨÏÞÈ¡Ïû³É¹¦';
-$messages['error_removing_user_from_blog'] = 'È¡ÏûÓû§ "%s" µÄ¸Ã²©¿ÍȨÏÞʱ³ö´í';
-$messages['error_removing_user_from_blog2'] = 'È¡ÏûÓû§ "%s" µÄ¸Ã²©¿ÍȨÏÞʱ³ö´í';
-
-// new blog user
-$messages['new_blog_username_help'] = '´ýÔö¼ÓµÄ¶Ô¸Ã²©¿Í¹ÜÀíºÍ×ÊÔ´ÖÐÐÄȨÏÞµÄÓû§µÄÓû§Ãû';
-$messages['send_notification'] = '·¢ËÍͨ¸æ';
-$messages['send_user_notification_help'] = 'Ïò¸ÃÓû§·¢ËÍÒ»·âͨ¸æÓʼþ';
-$messages['notification_text'] = 'ͨ¸æÕýÎÄ';
-$messages['notification_text_help'] = 'ÏòÓû§·¢Ë͵Äͨ¸æµÄÕýÎÄ';
-$messages['error_adding_user'] = 'Ìí¼Ó¸ÃÓû§È¨ÏÞʱ³ö´í£¬Çë¼ì²éÊý¾Ý²¢ÖØÊÔ¡£';
-$messages['error_empty_text'] = 'Äú±ØÐëÊäÈëͨ¸æÕýÎÄ';
-$messages['error_adding_user'] = 'Ìí¼ÓÓû§Ê±³ö´í£¬Çë¼ì²éÊý¾Ý²¢ÖØÊÔ¡£';
-$messages['error_invalid_user'] = 'Óû§ "%s" ÎÞЧ»ò²»´æÔÚ';
-$messages['user_added_to_blog_ok'] = 'Ìí¼ÓÓû§ "%s" µÄ¸Ã²©¿ÍȨÏ޳ɹ¦';
-
-// blog templates
-$messages['error_no_templates_selected'] = 'δѡÔñÈκÎÄ£°å';
-$messages['error_template_is_current'] = 'Ä£°å "%s" ÕýÔÚʹÓ㬲»ÄÜɾ³ý¡£';
-$messages['error_removing_template'] = 'ɾ³ýÄ£°å "%s" ʱ³ö´í';
-$messages['template_removed_ok'] = 'Ä£°å "%s" ɾ³ý³É¹¦';
-$messages['templates_removed_ok'] = 'Ä£°å %s ɾ³ý³É¹¦';
-
-// new blog template
-$messages['template_installed_ok'] = 'Ä£°å "%s" Ìí¼Ó³É¹¦';
-$messages['error_installing_template'] = '°²×°Ä£°å "%s" ʱ³ö´í';
-$messages['error_missing_base_files'] = 'Ä£°åÎļþ²¿·Ö¶ªÊ§';
-$messages['error_add_template_disabled'] = '¸ÃÕ¾µã´Ë¹¦Äܱ»½ûÓ㬲»ÄÜÌí¼ÓÐÂÄ£°å';
-$messages['error_must_upload_file'] = 'δÉÏ´«Ä£°åÎļþ';
-$messages['error_uploads_disabled'] = '¸ÃÕ¾µã½ûÖ¹ÉÏ´«';
-$messages['error_no_new_templates_found'] = 'δÕÒµ½ÐÂÄ£°å';
-$messages['error_template_not_inside_folder'] = 'Ä£°åÎļþËùÔÚÎļþ¼ÐµÄÃû³Æ±ØÐëÓëÄ£°åÉèÖÃÖеÄÃû³ÆÏàͬ¡£';
-$messages['error_missing_base_files'] = '²¿·Ö»ù±¾Ä£°åÎļþ¶ªÊ§';
-$messages['error_unpacking'] = '½âѹËõÎļþʱ³ö´í';
-$messages['error_forbidden_extensions'] = 'Ä£°åÖÐÓÐÎļþ±»½ûÖ¹·ÃÎÊ';
-$messages['error_creating_working_folder'] = '´´½¨ÁÙʱÎļþ¼Ð½âѹËõÎļþʱ³ö´í';
-$messages['error_checking_template'] = 'Ä£°å·¢Éú´íÎó (code = %s)';
-$messages['template_package'] = 'Ä£°å°²×°°ü';
-$messages['blog_template_package_help']  = 'Äú¿ÉÒÔÓÃ´Ë±íµ¥£¬ÉÏ´«Ò»¸öеÄÄ£°å°²×°°ü£¬¸ÃÄ£°åÖ»ÓÐÄúµÄ²©¿Í²ÅÄܹ»Ê¹Óá£Èç¹ûÄúÎÞ·¨ÓÃä¯ÀÀÆ÷ÉÏ´«£¬ÇëÊÖ¶¯ÉÏ´«Ä£°å²¢½«Ëü·ÅÖÃÓÚÄúµÄ²©¿ÍÄ£°åÎļþ¼Ð<b>%s</b>ÏÂ,È»ºó°´Ï "<b>ɨÃèÄ£°å</b>" °´Å¥¡£ pLog »áɨÃè¸ÃÎļþ¼Ð²¢×Ô¶¯Ìí¼ÓËùÕÒµ½µÄÐÂÄ£°å¡£';
-$messages['scan_templates'] = 'ɨÃèÄ£°å';
-
-// site users
-$messages['user_status_active'] = '¼¤»î';
-$messages['user_status_disabled'] = '½ûÓÃ';
-$messages['user_status_all'] = 'Óû§×´Ì¬';
-$messages['user_status_unconfirmed'] = 'δȷÈÏ';
-$messages['error_invalid_user2'] = '±êʶΪ "%s" µÄÓû§²»´æÔÚ¡£';
-$messages['error_deleting_user'] = '½ûÓÃÓû§ "%s" ʱ³ö´í';
-$messages['user_deleted_ok'] = 'Óû§ "%s" ½ûÓóɹ¦';
-$messages['users_deleted_ok'] = 'Óû§ %s ½ûÓóɹ¦';
-
-// create user
-$messages['user_added_ok'] = 'Óû§ "%s" Ìí¼Ó³É¹¦';
-$messages['error_incorrect_username'] = '¸ÃÓû§Ãû²»ÕýÈ·»òÒѾ­´æÔÚ';
-$messages['user_status_help'] = '¸ÃÓû§µ±Ç°×´Ì¬';
-$messages['user_blog_help'] = '¸ÃÓû§×î³õ±»·ÖÅäȨÏ޵IJ©¿Í';
-$messages['none'] = 'ÎÞ';
-
-// edit user
-$messages['error_invalid_user'] = 'Óû§±êʶ²»ÕýÈ·»ò¸ÃÓû§²»´æÔÚ';
-$messages['error_updating_user'] = '¸üÐÂÓû§ÉèÖÃʱ³ö´í£¬Çë¼ì²éÊý¾Ý²¢ÖØÊÔ';
-$messages['blogs'] = '²©¿ÍÁбí';
-$messages['user_blogs_helps'] = '¸ÃÓû§µ±Ç°ÓµÓеĻòÓÐȨÏ޵IJ©¿Í';
-$messages['site_admin'] = '¹ÜÀíԱȨÏÞ';
-$messages['site_admin_help'] = '¸ÃÓû§ÊÇ·ñ¾ßÓйÜÀíԱȨÏÞ';
-$messages['user_updated_ok'] = 'Óû§ "%s" Ð޸ijɹ¦';
-
-// site blogs
-$messages['blog_status_all'] = '²©¿Í״̬';
-$messages['blog_status_active'] = '¼¤»î';
-$messages['blog_status_disabled'] = '½ûÓÃ';
-$messages['blog_status_unconfirmed'] = 'δȷÈÏ';
-$messages['owner'] = '¹ÜÀíÔ±';
-$messages['quota'] = 'Åä¶î';
-$messages['bytes'] = '×Ö½ÚÊý';
-$messages['error_no_blogs_selected'] = 'Äú±ØÐëÑ¡ÔñÄúÏëÒª½ûÓõIJ©¿ÍÍøÕ¾¡£';
-$messages['error_blog_is_default_blog'] = '"%s"ÊÇϵͳĬÈϲ©¿Í£¬ÎÞ·¨½ûÓá£';
-$messages['blog_deleted_ok'] = '²©¿Í "%s" ½ûÓóɹ¦';
-$messages['blogs_deleted_ok'] = '²©¿Í "%s" ½ûÓóɹ¦';
-$messages['error_deleting_blog'] = '½ûÓò©¿Í"%s"ʱ³ö´í';
-$messages['error_deleting_blog2'] = '½ûÓò©¿Í"%s"ʱ³ö´í';
-
-// create blog
-$messages['error_adding_blog'] = 'Ìí¼Ó²©¿Íʱ³ö´í£¬Çë¼ì²éÊý¾Ý²¢ÖØÊÔ¡£';
-$messages['blog_added_ok'] = '²©¿Í "%s" Ìí¼Ó³É¹¦';
-
-// edit blog
-$messages['blog_status_help'] = '²©¿Í״̬';
-$messages['blog_owner_help'] = '¸Ã²©¿ÍµÄ¹ÜÀíÔ±';
-$messages['users'] = 'Óû§Áбí';
-$messages['blog_quota_help'] = 'ÉèÖÃ×ÊÔ´ÖÐÐĵÄÅä¶î£¬ÉèÖÃΪ0ÔòÎÞÏÞÖÆ£¬ÉèÖÃΪ¿ÕÔòʹÓÃÈ«¾ÖÅä¶î';
-$messages['blog_users_help'] = 'ÓµÓиò©¿ÍȨÏÞµÄÓû§ÁÐ±í£¬´Ó×ó²àÑ¡ÔñÒ»¸öµ½ÓÒ²à¿É¸øÓè¸ÃÓû§¸Ã²©¿ÍµÄȨÏÞ';
-$messages['edit_blog_settings_updated_ok'] = '²©¿Í "%s" Ð޸ijɹ¦';
-$messages['error_updating_blog_settings'] = 'Ð޸IJ©¿Í "%s" ʱ³ö´í';
-$messages['error_incorrect_blog_owner'] = 'ÒªÉ趨Ϊ²©¿Í¹ÜÀíÔ±µÄÓû§´íÎó»ò²»´æÔÚ¡£';
-$messages['error_fetching_blog'] = '¶ÁÈ¡²©¿ÍÉèÖÃʱ³ö´í';
-$messages['error_updating_blog_settings2'] = '¸üв©¿ÍÉèÖÃʱ³ö´í£¬Çë¼ì²éÊý¾Ý²¢ÖØÊÔ¡£';
-$messages['add_or_remove'] = 'Ìí¼Ó»òɾ³ýÓû§';
-
-// site locales
-$messages['locale'] = 'ÓïÑÔ°ü¹ÜÀí';
-$messages['locale_encoding'] = '±àÂë';
-$messages['locale_deleted_ok'] = 'ÓïÑÔ°ü "%s" ɾ³ý³É¹¦';
-$messages['error_no_locales_selected'] = 'δѡÔñҪɾ³ýµÄÓïÑÔ°ü';
-$messages['error_deleting_only_locale'] = 'ÓïÑÔ°üֻʣÏÂÒ»¸ö£¬²»Äܱ»É¾³ý';
-$messages['locales_deleted_ok']= 'ÓïÑÔ°ü%sɾ³ý³É¹¦';
-$messages['error_deleting_locale'] = 'ɾ³ýÓïÑÔ°ü "%s" ʱ³ö´í';
-$messages['error_locale_is_default'] = 'ÓïÑÔ°ü "%s" ÊÇв©¿ÍµÄĬÈÏÓïÑÔ°ü£¬²»Äܱ»É¾³ý';
-
-// add locale
-$messages['error_invalid_locale_file'] = 'ÓïÑÔ°üÎļþÎÞЧ';
-$messages['error_no_new_locales_found'] = 'δÕÒµ½ÐÂÓïÑÔ°üÎļþ';
-$messages['locale_added_ok'] = 'ÓïÑÔ°ü "%s" Ìí¼Ó³É¹¦';
-$messages['error_saving_locale'] = '´æ´¢ÐÂÓïÑÔ°üʱ·¢Éú´íÎó¡£Çë¼ì²éÊÇ·ñÓÐÓïÑÔ°üÎļþ¼ÐµÄдÈëȨÏÞ¡£';
-$messages['scan_locales'] = 'ɨÃèÓïÑÔ°ü';
-$messages['add_locale_help'] = 'Äú¿ÉÒÔÓÃ´Ë±íµ¥ÉÏ´«Ò»¸öеÄÓïÑÔ°ü¡£Èç¹ûÄúÎÞ·¨ÓÃä¯ÀÀÆ÷ÉÏ´«£¬ÇëÊÖ¶¯ÉÏ´«ÓïÑÔ°ü²¢½«Ëü·ÅÖÃÓÚ <b>./locales/</b>ÏÂ,È»ºó°´Ï "<b>ɨÃèÓïÑÔ°ü</b>" °´Å¥¡£ pLog »áɨÃè¸ÃÎļþ¼Ð²¢×Ô¶¯Ìí¼ÓÐÂÕÒµ½µÄÓïÑÔ°ü¡£ ';
-
-// site templates
-$messages['error_template_is_default'] = 'Ä£°å "%s" ÊÇв©¿ÍĬÈÏÄ£°å£¬²»Äܱ»É¾³ý¡£';
-
-// add template
-$messages['global_template_package_help'] = 'Äú¿ÉÒÔÓÃ´Ë±íµ¥£¬ÉÏ´«Ò»¸öеÄÄ£°å°²×°°ü£¬¸ÃÄ£°å½«Ìṩ¸ø²©¿ÍÕ¾µãµÄËùÓв©¿ÍʹÓá£Èç¹ûÄúÎÞ·¨ÓÃä¯ÀÀÆ÷ÉÏ´«£¬ÇëÊÖ¶¯ÉÏ´«Ä£°å²¢½«Ëü·ÅÖÃÓÚÄúµÄ²©¿ÍÄ£°åÎļþ¼Ð<b>%s</b>ÏÂ,È»ºó°´Ï "<b>ɨÃèÄ£°å</b>" °´Å¥¡£ pLog »áɨÃè¸ÃÎļþ¼Ð²¢×Ô¶¯Ìí¼ÓËùÕÒµ½µÄÐÂÄ£°å¡£';
-
-// global settings
-$messages['site_config_saved_ok'] = 'Õ¾µãÉèÖñ£´æ³É¹¦';
-$messages['error_saving_site_config'] = '±£´æÕ¾µãÉèÖÃʱ³ö´í';
-/// general settings
-$messages['help_comments_enabled'] = 'ĬÈÏÆôÓûò½ûÓÃв©¿ÍµÄÆÀÂÛ¹¦ÄÜ';
-$messages['help_beautify_comments_text'] = 'Æô¶¯¸ÃÏÔÊÐíÆÀÂÛÖÐÌí¼ÓͼƬºÍÁ´½Ó';
-$messages['help_temp_folder'] = 'pLogϵͳִÐÐijЩ²Ù×÷ʱҪÓõ½µÄÁÙʱÎļþ¼Ð·¾¶¡£';
-$messages['help_base_url'] = '²©¿ÍÕ¾µãµÄ»ù±¾Á´½ÓµØÖ·';
-$messages['help_subdomains_enabled'] = 'ÆôÓûò½ûÓöþ¼¶ÓòÃû.ÓûÁ˽â¸ü¶à¹ØÓÚ¶þ¼¶ÓòÃûµÄÐÅÏ¢Çë²éÔÄ°ïÖúÎĵµ¡£';
-$messages['help_subdomains_base_url'] = 'µ±ÆôÓöþ¼¶ÓòÃûºó£¬¸Ã»ù±¾µØÖ·½«´úÌæÔ­ÓеĵØÖ·£¬Ê¹ÓÃ{blogname}ºÍ{username}±êÇ©À´»ñµÃ²©¿ÍÃûºÍ²©¿Í¹ÜÀíÔ±µÄÓû§Ãû';
-$messages['help_include_blog_id_in_url'] = '¸ÃÏîÄ¿Ï൱ÖØÒª£¬Ò»°ã»ò¶þ¼¶ÓòÃûÐÎʽÆôÓÃʱ£¬Ëü½«Ç¿Öƽ«ÄÚ²¿Ò»°ãÁ´½Ó²»°üº¬"blogId"²ÎÊý¡£³ý·ÇÄã·Ç³£Çå³þ£¬·ñÔò²»ÒªÐ޸ĸÃÏîÉèÖá£';
-$messages['help_script_name'] = 'Èç¹ûÄãÐèÒªÖØÃüÃûindex.phpÇëÐ޸ĸÃÏî';
-$messages['help_show_posts_max'] = 'Ê×ҳĬÈÏ¿ÉÏÔʾµÄ×î´óÎÄÕÂÊýÄ¿';
-$messages['help_recent_posts_max'] = 'ÔÚÊ×Ò³¡°×îз¢±í¡±ÁбíÖÐĬÈÏÏÔʾµÄÎÄÕÂÊýÁ¿.';
-$messages['help_save_drafts_via_xmlhttprequest_enabled'] = 'ÔÊÐí´¢´æjavascriptºÍxmlhttpÇëÇó²Ý¸å';
-$messages['help_locale_folder'] = '´æ´¢ÓïÑÔ°üÎļþµÄÎļþ¼Ð';
-$messages['help_default_locale'] = 'н¨²©¿ÍµÄĬÈÏÓïÑÔÉèÖÃ';
-$messages['help_default_blog_id'] = 'index.phpĬÈÏÏÔʾµÄ²©¿ÍblogID';
-$messages['help_default_time_offset'] = 'н¨²©¿ÍµÄĬÈÏʱ²î';
-$messages['help_html_allowed_tags_in_comments'] = 'ÆÀÂÛÖÐÔÊÐíʹÓõÄHTML±êÇ©';
-$messages['help_referer_tracker_enabled'] = 'Èç¹ûÍøÕ¾½ÓÊÕµ½µÄREQUESTÇëÇóÖк¬ÓÐREFERERÐÅÏ¢£¬ÊÇ·ñ½«»ù±¾µÄREFERERÐÅÏ¢´æÈëÊý¾Ý¿â';
-$messages['help_show_more_enabled'] = 'ÊÇ·ñÆôÓᰲ鿴ȫÎÄ¡±Á´½Ó¹¦ÄÜ';
-$messages['help_update_article_reads'] = 'ÄúÊÇ·ñÏëÆôÓÃÕ¾µãÄÚ½¨µÄ¼ÆÊýÆ÷£¬¿ÉÒÔͳ¼ÆÿƪÎÄÕµĵã»÷Êý¡£';
-$messages['help_update_cached_article_reads'] = 'ÊÇ·ñµ±ÎÄÕ¶Áȡʱ£¬¸üÐÂÎÄÕ»º´æ';
-$messages['help_xmlrpc_ping_enabled'] = 'µ±·¢±íÐÂÎÄÕÂʱ£¬ÊÇ·ñÒªÏòÒÔÏÂÕ¾µã·¢ËÍXMLRPCͨ¸æ¡£';
-$messages['help_send_xmlrpc_pings_enabled_by_default'] = 'ÊÇ·ñÎÄÕÂÔÚ·¢±í»òÐÞ¸ÄʱĬÈÏ·¢ËÍÒýÓÃͨ¸æ';
-$messages['help_xmlrpc_ping_hosts'] = '½ÓÊÜXMLRPCͨ¸æµÄÍøÕ¾ÁÐ±í£¬Ã¿¸öÍøÖ·µ¥¶ÀÒ»ÐУ¬ÊýÄ¿²»ÏÞ¡£';
-$messages['help_trackback_server_enabled'] = 'ÊÇ·ñ½ÓÊÜÆäËüÍøÕ¾·¢³öµÄÒýÓÃͨ¸æ£¨TrackBack£©¡£';
-$messages['help_htmlarea_enabled'] = 'ÊÇ·ñÆôÓÃËù¼û¼´ËùµÃ£¨WYSIWYG£©ÎÄÕ±༭Æ÷¡£';
-$messages['help_plugin_manager_enabled'] = 'ÊÇ·ñÆôÓòå¼þ¹¦ÄÜ';
-$messages['help_minimum_password_length'] = 'ÃÜÂë×îС³¤¶È';
-$messages['help_xhtml_converter_enabled'] = 'ÊÇ·ñ½«HTML´úÂëת»»³ÉXHTML´úÂë';
-$messages['help_xhtml_converter_aggressive_mode_enabled'] = 'ÊÇ·ñÈÃplogÉú³ÉXHTML´úÂ룬µ«Õ⽫¸ü¿ÉÄܳö´í';
-$messages['help_session_save_path'] = 'ʹÓÃPHPµÄsession_save_path()º¯Êý£¬À´¸ü¸ÄpLog´æ·ÅsessionµÄÎļþ¼Ð¡£ÇëÈ·ÈϸÃÎļþ¼Ð±»HTTP·þÎñ³ÌÐò£¨ÈçAPACHE£©ÓµÓÐдȨÏÞ¡£Èç¹ûÄúҪʹÓÃPHPÔ¤ÉèµÄsession´æ·Å·¾¶£¬É趨Ϊ¿Õ°×¼´¿É¡£';
-// summary settings
-$messages['help_summary_page_show_max'] = 'ÔÚ»ã×Ü£¨SUMMARY£©Ò³ÃæÖÐÒªÏÔʾ¶àÉÙÏîÄ¿¡£';
-$messages['help_summary_blogs_per_page'] = '»ã×ܵIJ©¿ÍÁбíÖÐÿҳÏÔʾµÄ²©¿ÍÊý';
-$messages['help_forbidden_usernames'] = '½ûÖ¹×¢²áµÄÓû§ÃûÁбí';
-$messages['help_force_one_blog_per_email_account'] = 'ÿ¸öµç×ÓÓʼþµØÖ·Ö»ÏÞÖÆ×¢²áÒ»¸ö²©¿Í';
-$messages['help_summary_show_agreement'] = 'ÊÇ·ñÔÚ×¢²áÖÐÏÔʾЭ¶¨Îı¾ÈÃÓû§È·ÈÏ';
-$messages['help_need_email_confirm_registration'] = 'ÐèÒªÓû§Ê¹Óõç×ÓÓʼþ½øÐÐÈÏÖ¤';
-$messages['help_summary_disable_registration'] = 'ÊÇ·ñ¹Ø±Õв©¿Í×¢²á';
-// templates
-$messages['help_template_folder'] = '´æ´¢Ä£°åµÄÎļþ¼Ð';
-$messages['help_default_template'] = 'н¨²©¿ÍµÄĬÈÏÄ£°å';
-$messages['help_users_can_add_templates'] = 'ÔÊÐíÓû§¼ÓÈë×Ô¼ºµÄÄ£°å';
-$messages['help_template_compile_check'] = 'Èç¹û½ûÓøÃÏģ°åÎļþ±ä¸üʱSmarty½«¼ì²éËùÓеÄÇëÇ󣬿ÉÒÔÌá¸ß¸ü¶àÐÔÄÜ¡£';
-$messages['help_template_cache_enabled'] = 'ÆôÓÃÄ£°å»º´æ';
-$messages['help_template_cache_lifetime'] = '»º´æ±£Áôʱ¼ä£¬ÉèÖÃΪ-1ÔòÓÀ¾Ã´æÁô£¬ÉèÖÃΪ0Ôò½ûÓûº´æ¡£';
-$messages['help_template_http_cache_enabled'] = 'ÆôÓÃHTTPÌõ¼þÇëÇóµÄ»º´æÖ§³Ö¡£Èç¹ûÆôÓÿÉÒÔ½ÚÊ¡´ø¿í¡£';
-$messages['help_allow_php_code_in_templates'] = 'ÔÊÐíÔÚSmartyÄ£°åµÄ{php}...{/php}¿éÖÐǶÈëPHP´úÂë';
-// urls
-$messages['help_request_format_mode'] = 'Ñ¡ÔñÓÐЧÁ´½ÓµÄ¸ñʽ.Èç¹ûʹÓÃ×Ô¶¨ÒåÁ´½Ó£¬ÇëÈ·ÈÏÒÔÏÂÉèÖÃ';
-$messages['plain'] = '¼òµ¥¸ñʽ';
-$messages['search_engine_friendly'] = 'ÊÊÒËËÑË÷ÒýÇæ';
-$messages['custom_url_format'] = '×Ô¶¨ÒåÁ´½Ó';
-$messages['help_permalink_format'] = 'ʹÓÃ×Ô¶¨ÒåÁ´½ÓʱµÄ¾²Ì¬µØÖ·¸ñʽ';
-$messages['help_category_link_format'] = 'ʹÓÃ×Ô¶¨ÒåÁ´½ÓʱµÄÎÄÕ·ÖÀàµÄÁ´½Ó¸ñʽ';
-$messages['help_blog_link_format'] = 'ʹÓÃ×Ô¶¨ÒåÁ´½Óʱ²©¿ÍÁ´½ÓµÄ¸ñʽ';
-$messages['help_archive_link_format'] = 'ʹÓÃ×Ô¶¨ÒåÁ´½ÓʱÎļþ¹éµµµÄÁ´½Ó¸ñʽ';
-$messages['help_user_posts_link_format'] = 'ʹÓÃ×Ô¶¨ÒåÁ´½Óʱ²©¿ÍÎÄÕµÄÁ´½Ó¸ñʽ';
-$messages['help_post_trackbacks_link_format'] = 'ʹÓÃ×Ô¶¨ÒåÁ´½ÓʱÒýÓÃÁ´½ÓµÄÁ´½Ó¸ñʽ';
-$messages['help_template_link_format'] = 'ʹÓÃ×Ô¶¨ÒåÁ´½Óʱ×Ô¶¨Ò徲̬ģ°åÒ³ÃæµÄÁ´½Ó¸ñʽ';
-$messages['help_album_link_format'] = 'ʹÓÃ×Ô¶¨ÒåÁ´½Óʱ×ÊÔ´ÖÐÐĵÄÁ´½Ó¸ñʽ';
-$messages['help_resource_link_format'] = 'ʹÓÃ×Ô¶¨ÒåÁ´½Óʱ×ÊÔ´Ò³ÃæµÄÁ´½Ó¸ñʽ';
-$messages['help_resource_preview_link_format'] = 'ʹÓÃ×Ô¶¨ÒåÁ´½Óʱ×ÊÔ´Ô¤ÀÀµÄÁ´½Ó¸ñʽ';
-$messages['help_resource_medium_size_preview_link_format'] = 'ʹÓÃ×Ô¶¨ÒåÁ´½ÓʱÖÐÐÍ×ÊÔ´Ô¤ÀÀµÄÁ´½Ó¸ñʽ';
-$messages['help_resource_download_link_format'] = 'ʹÓÃ×Ô¶¨ÒåÁ´½ÓʱÎļþµÄÁ´½Ó¸ñʽ';
-// email
-$messages['help_check_email_address_validity'] = 'ÔÚÓû§ÉêÇë×¢²áв©¿ÍÕ¾µãʱ£¬ÊÇ·ñÒªÈÏÖ¤ËûËùÌîдµÄµç×ÓÓʼþµØÖ·';
-$messages['help_email_service_enabled'] = 'ÆôÓûò½ûÓ÷¢Ë͵ç×ÓÓʼþ¹¦ÄÜ';
-$messages['help_post_notification_source_address'] = 'ϵͳ֪ͨÓʼþÖеļļþÈ˵ĵç×ÓÓʼþµØÖ·¡£';
-$messages['help_email_service_type'] = 'Ñ¡Ôñ·¢Ë͵ç×ÓÓʼþµÄ·½Ê½';
-$messages['help_smtp_host'] = 'Èç¹ûÑ¡ÓÃSMTP·¢Ë͵ç×ÓÓʼþ£¬ÇëÊäÈëÄúÒªÓÃÀ´·¢ËÍÓʼþµÄÖ÷»ú¡£';
-$messages['help_smtp_port'] = 'ÉèÖÃSMTP·þÎñÆ÷µÄ¶Ë¿Ú';
-$messages['help_smtp_use_authentication'] = 'ÆôÓûò½ûÓÃSMTP·þÎñÆ÷ÈÏÖ¤';
-$messages['help_smtp_username'] = 'Èç¹ûSMTP·þÎñÆ÷ÐèÒªÈÏÖ¤£¬ÇëÌîдÓû§Õ˺š£';
-$messages['help_smtp_password'] = 'Èç¹ûSMTP·þÎñÆ÷ÐèÒªÈÏÖ¤£¬ÇëÌîдÓû§ÃÜÂë¡£';
-// helpers
-$messages['help_path_to_tar'] = 'tarÃüÁîËùÔÚÎļþ¼Ð';
-$messages['help_path_to_gzip'] = 'gzipÃüÁîËùÔÚÎļþ¼Ð';
-$messages['help_path_to_bz2'] = 'bzip2ÃüÁîËùÔÚÎļþ¼Ð';
-$messages['help_path_to_unzip'] = 'unzipÃüÁîËùÔÚÎļþ¼Ð';
-$messages['help_unzip_use_native_version'] = 'ʹÓÃ×Ô´øµÄphp°ü½âѹËõ.zipÎļþ¡£';
-// uploads
-$messages['help_uploads_enabled'] = 'ÆôÓûò½ûÓÃÉÏ´«Îļþ¹¦ÄÜ¡£Õâ¸ö¹¦ÄÜ»áÓ°Ïìµ½Óû§ÄÜ·ñÉÏ´«ÐµÄÄ£°å»òÓïÑÔ°üÒÔ¼°¼°ÄÜ·ñÏòÏÖ´æÄ£°åÖÐÌí¼ÓÎļþ¡£';
-$messages['help_maximum_file_upload_size'] = 'ÔÊÐíÓû§ÉÏ´«ÎļþµÄ×î´ó×Ö½ÚÊý¡£¸ÃÏîÉèÖò»Äܳ¬¹ýphpÖеÄÉèÖÃ';
-$messages['help_upload_forbidden_files'] = '½ûÖ¹Óû§ÉÏ´«µÄÎļþÀàÐÍ¡£Äã¿ÉÒÔÖ¸¶¨ÈÎÒâÊýÁ¿µÄÎļþÀàÐÍ£¬Á½¸öÀàÐÍÖ®¼äÓÿոñ·ÖÀë¡£';
-// interfaces
-$messages['help_xmlrpc_api_enabled'] = 'ÆôÓà XMLRPC ·¢±íÎÄÕÂ';
-$messages['help_rdf_enabled'] = 'Æô¶¯Atom»òRSS¾ÛºÏ';
-$messages['help_default_rss_profile'] = 'ĬÈϵÄRSS»òAtom·½Ê½';
-// security
-$messages['help_security_pipeline_enabled'] = 'ÊÇ·ñÆôÓð²È«ÒÔ¼°ËùÓÐÏà¹Ø²å¼þ¡£×¢Ò⣬ÕâÒ²»áÓ¡Ïóµ½ÆäËüµÄвå¼þ¡£';
-$messages['help_ip_address_filter_enabled'] = 'ÊÇ·ñÆôÓÃipµØÖ·¹ýÂË';
-$messages['help_content_filter_enabled'] = 'ÆôÓûò½ûÓùæÔò¹ýÂË£¬Æô¶¯¸ÃÏîĿʱ£¬ÐèÒª´ò¿ª°²È«¹¦ÄÜ¡£';
-$messages['help_maximum_comment_size'] = 'ÆÀÂÛµÄ×î´ó×Ö½ÚÊý';
-// bayesian filter
-$messages['help_bayesian_filter_enabled'] = 'ÆôÓûò½ûÓùýÂË';
-$messages['help_bayesian_filter_spam_probability_treshold'] = 'ÅжÏΪÀ¬»øÆÀÂÛµÄ×î´ó¼«ÏÞ';
-$messages['help_bayesian_filter_nonspam_probability_treshold'] = 'ÅжÏΪÀ¬»øÆÀÂÛµÄ×îС¼«ÏÞ';
-$messages['help_bayesian_filter_min_length_token'] = 'ÖØÒª±ê¼ÇµÄ×îС³¤¶È';
-$messages['help_bayesian_filter_max_length_token'] = 'ÖØÒª±ê¼ÇµÄ×î´ó³¤¶È';
-$messages['help_bayesian_filter_number_significant_tokens'] = 'ÖØÒª±ê¼ÇµÄÊýÁ¿';
-$messages['help_bayesian_filter_spam_comments_action'] = '¶ÔÓÚ±ê¼ÇΪÀ¬»øµÄÆÀÂÛÈçºÎ´¦Àí';
-$messages['keep_spam_comments'] = '±£ÁôÊý¾Ý¿âÖбê¼ÇΪÀ¬»øµÄÆÀÂÛ';
-$messages['throw_away_spam_comments'] = 'Ö±½Óɾ³ýÀ¬»øÆÀÂÛ';
-// resources
-$messages['help_resources_enabled'] = 'ÆôÓûò½ûÓÃ×ÊÔ´ÖÐÐÄ';
-$messages['help_resources_folder'] = '´æ´¢×ÊÔ´ÎļþµÄÎļþ¼Ð';
-$messages['help_thumbnail_method'] = 'Éú³ÉËõÂÔͼµÄ·½·¨£¬Èç¹ûʹÓÃPHP£¬Ö§³ÖGD·½Ê½';
-$messages['help_path_to_convert'] = 'convertÃüÁîËùÔÚÎļþ¼Ð';
-$messages['help_thumbnail_format'] = 'ËõÂÔͼ´æ´¢¸ñʽ';
-$messages['help_thumbnail_height'] = 'СÐÍËõÂÔͼĬÈϸ߶È';
-$messages['help_thumbnail_width'] = 'СÐÍËõÂÔͼĬÈÏ¿í¶È';
-$messages['help_medium_size_thumbnail_height'] = 'ÖÐÐÍËõÂÔͼµÄĬÈϸ߶È';
-$messages['help_medium_size_thumbnail_width'] = 'ÖÐÐÍËõÂÔͼµÄĬÈÏ¿í¶È';
-$messages['help_thumbnails_keep_aspect_ratio'] = 'Éú³ÉËõÂÔͼʱ±£ÁôÔ­Óеij¤¿í±ÈÀý';
-$messages['help_thumbnail_generator_force_use_gd1'] = 'Ç¿ÆÈʹÓà GD1-only ¹¦ÄÜ';
-$messages['help_thumbnail_generator_user_smoothing_algorithm'] = 'ƽ»¬ËõÂÔͼ.¸Ã¹¦ÄÜÖ»ÄÜÔÚʹÓÃGD¹¦ÄÜʱʹÓá£';
-$messages['help_resources_quota'] = '²©¿ÍµÄÈ«¾Ö×ÊÔ´Åä¶î';
-$messages['help_resource_server_http_cache_enabled'] = 'ÆôÓöÔ"If-Modified-Since" ±êÌâºÍHTTPÌõ¼þÇëÇóµÄÖ§³Ö.ÆôÓÃÔöÇ¿´ø¿í´æ´¢¡£';
-$messages['help_resource_server_http_cache_lifetime'] = '¿Í»§¶ËʹÓÃ×ÊÔ´»º´æµÄʱ¼ä';
-$messages['same_as_image'] = 'ÓëԭʼͼÏñÏàͬ';
-// search
-$messages['help_search_engine_enabled'] = 'Æô¶¯»ò½ûÖ¹ËÑË÷ÒýÇæ';
-$messages['help_search_in_custom_fields'] = 'ËÑË÷×Ô¶¨ÒåÇø¿é';
-$messages['help_search_in_comments'] = 'ËÑË÷ÆÀÂÛ';
-
-// cleanup
-$messages['purge'] = 'Çå³ý';
-$messages['cleanup_spam'] = 'Çå³ýÀ¬»ø»Ø¸´';
-$messages['cleanup_spam_help'] = 'Çå³ýËùÓб»Ê¹ÓÃÕß±êʾΪÀ¬»øµÄ»Ø¸´¡£Ò»µ©É¾³ýÎÞ·¨»Ö¸´¡£';
-$messages['spam_comments_purged_ok'] = 'À¬»ø»Ø¸´Çå³ý³É¹¦';
-$messages['cleanup_posts'] = 'Çå³ýÎÄÕÂ';
-$messages['cleanup_posts_help'] = 'Çå³ýËùÓб»Ê¹ÓÃÕß±êʾΪɾ³ýµÄÎÄÕ¡£ Ò»µ©É¾³ýÎÞ·¨»Ö¸´¡£';
-$messages['posts_purged_ok'] = 'ÎÄÕÂÇå³ý³É¹¦';
-
-/// summary ///
-// front page
-$messages['summary'] = '»ã×Ü';
-$messages['register'] = '×¢²á';
-$messages['summary_welcome'] = '»¶Ó­';
-$messages['summary_most_active_blogs'] = '×î»îÔ¾µÄ²©¿Í';
-$messages['summary_most_commented_articles'] = 'ÆÀÂÛ×î¶àµÄÎÄÕÂ';
-$messages['summary_most_read_articles'] = 'ÔĶÁ×î¶àµÄÎÄÕÂ';
-$messages['password_forgotten'] = 'Íü¼ÇÃÜÂ룿';
-$messages['summary_newest_blogs'] = '×îпªÍ¨µÄ²©¿Í';
-$messages['summary_latest_posts'] = '×î½ü·¢±íµÄÎÄÕÂ';
-$messages['summary_search_blogs'] = 'ËÑË÷²©¿Í';
-
-// blog list
-$messages['updated'] = '¸üÐÂ';
-$messages['total_reads'] = 'ä¯ÀÀ×Ü´ÎÊý';
-
-// blog profile
-$messages['blog'] = '²©¿Í';
-$messages['latest_posts'] = '×î½ü·¢±íµÄÎÄÕÂ';
-
-// registration
-$messages['register_step0_title'] = '½ÓÊÜ·þÎñЭÒé';
-$messages['agreement'] = 'Ðí¿ÉÌõ¿î';
-$messages['decline'] = '¾Ü¾ø';
-$messages['accept'] = 'ͬÒâ';
-$messages['read_service_agreement'] = 'ÇëÔĶÁ·þÎñЭÒ飬Èç¹ûÄúͬÒâµÄ»°£¬µã»÷ͬÒâ';
-$messages['register_step1_title'] = '´´½¨Óû§ [1/4]';
-$messages['register_step1_help'] = 'Ê×ÏÈÄúÐèÒª´´½¨Ò»¸öÐÂÓû§À´»ñµÃ²©¿Í¡£';
-$messages['register_next'] = 'ÏÂÒ»²½';
-$messages['register_back'] = 'ÉÏÒ»²½';
-$messages['register_step2_title'] = '´´½¨²©¿Í [2/4]';
-$messages['register_blog_name_help'] = '²©¿ÍÃû³Æ';
-$messages['register_step3_title'] = 'Ñ¡ÔñÄ£°å [3/4]';
-$messages['step1'] = 'µÚÒ»²½';
-$messages['step2'] = 'µÚ¶þ²½';
-$messages['step3'] = 'µÚÈý²½';
-$messages['register_step3_help'] = 'ÇëÑ¡ÔñÄúµÄ²©¿ÍµÄĬÈÏÄ£°å¡£';
-$messages['error_must_choose_template'] = 'ÇëÑ¡ÔñÒ»¸öÄ£°å';
-$messages['select_template'] = 'Ñ¡ÔñÄ£°å';
-$messages['register_step5_title'] = '×£ºØÄú£¡ [4/4]';
-$messages['finish'] = 'Íê³É';
-$messages['register_need_confirmation'] = 'º¬ÓÐÈ·ÈÏÐÅÏ¢µÄµç×ÓÓʼþÒѾ­·¢Ë͸øÄú£¬ÇëÄúµã»÷ÆäÖеÄÁ´½ÓÒÔ¼¤»îÄúµÄ²©¿Í¡£';
-$messages['register_step5_help'] = '×£ºØÄú£¬ÄúµÄÓû§ÒÔ¼°²©¿ÍÒѾ­¿ªÍ¨£¡';
-$messages['register_blog_link'] = 'Èç¹ûÄúÏë·ÃÎÊÄúµÄ²©¿Í£¬ÏÖÔھͽøÈë°É£¡ <a href="%2$s">%1$s</a>';
-$messages['register_blog_admin_link'] = 'Èç¹ûÄúÏëÂíÉÏ·¢±íÎÄÕ£¬Çëµã»÷ <a href="admin.php">¹ÜÀí½çÃæ</a>½øÈëºǫ́½øÐвÙ×÷¡£';
-$messages['register_error'] = '½ø³ÌÖгö´í';
-$messages['error_registration_disabled'] = '¶Ô²»Æ𣬱¾Õ¾ÒÑÔÝÍ£ÐÂÓû§×¢²á£¬ÇëÉÔºòÔÙÊÔ»òÁªÏµ¹ÜÀíÔ±';
-// registration article topic and text
-$messages['register_default_article_topic'] = '×£ºØÄú';
-$messages['register_default_article_text'] = 'Èç¹ûÄúÔĶÁµ½ÕâƪÎÄÕ£¬Õâ¾ÍÒâζ×ÅÄú×¢²áµÄ²©¿ÍÒѾ­ÉêÇë³É¹¦¡£';
-$messages['register_default_category'] = 'Ò»°ã·ÖÀà';
-// confirmation email
-$messages['register_confirmation_email_text'] = 'Çëµã»÷ÏÂÃæµÄÁ´½ÓÀ´¼¤»îÄúµÄ²©¿Í:
-
-%s
-
-ÏÖÔھͽøÈ벩¿ÍÊÀ½ç°É£¡×£ÄúÌìÌì¿ìÀÖ£¡';
-$messages['error_invalid_activation_code'] = '¶Ô²»Æð£¬ÈÏÖ¤ÂëÎÞЧ';
-$messages['blog_activated_ok'] = '×£ºØÄú£¬Äú×¢²áµÄÐÂÓû§ºÍ²©¿ÍÒѾ­³É¹¦¿ªÍ¨£¡';
-// forgot your password?
-$messages['reset_password'] = 'ÖØÖÃÃÜÂë';
-$messages['reset_password_username_help'] = '´ýÖØÖÃÃÜÂëµÄÓû§Ãû';
-$messages['reset_password_email_help'] = 'ÒÑÓÐÈËʹÓøõç×ÓÓÊÏä×¢²á';
-$messages['reset_password_help'] = 'ÖØÖÃÃÜÂ룬ÇëÊäÈëÍü¼ÇÃÜÂëµÄÓû§ÃûÒÔ¼°×¢²áʱµÄµç×ÓÓʼþµØÖ·';
-$messages['error_resetting_password'] = 'ÖØÖÃÃÜÂëʱ³ö´í£¬Çë¼ì²éÊý¾Ý²¢ÖØÊÔ¡£';
-$messages['reset_password_error_incorrect_email_address'] = 'µç×ÓÓÊÏäµØÖ·²»ÕýÈ·»òÆäËûÓû§Ê¹ÓôËÓʼþ×¢²á';
-$messages['password_reset_message_sent_ok'] = 'ÀûÓÃ×¢²áµç×ÓÓʼþÖØÖÃÃÜÂë';
-$messages['error_incorrect_request'] = 'Á´½ÓÖеIJÎÊý²»ÕýÈ·';
-$messages['change_password'] = 'ÉèÖÃÐÂÃÜÂë';
-$messages['change_password_help'] = 'ÇëÊäÈ벢ȷÈÏÐÂÃÜÂë';
-$messages['new_password'] = 'ÐÂÃÜÂë';
-$messages['new_password_help'] = 'ÊäÈëÐÂÃÜÂë';
-$messages['password_updated_ok'] = 'ÄúµÄÃÜÂëÐ޸ijɹ¦';
-
-// Suggested by BCSE, some useful messages that not available in official locale
-$messages['upgrade_information'] = 'ÄúËùʹÓõÄä¯ÀÀÆ÷²»·ûºÏÍøÒ³Éè¼Æ±ê×¼£¬Òò´Ë±¾ÍøÒ³½«ÒÔ´¿ÎÄ×ÖģʽÏÔʾ¡£ÈçÓûÒÔ×î¼ÑµÄÅŰ淽ʽä¯ÀÀ±¾Õ¾£¬Ç뿼ÂÇ<a href="http://www.webstandards.org/upgrade/" title="The Web Standards Project\'s Browser Upgrade initiative">Éý¼¶</a>ÄúµÄä¯ÀÀÆ÷¡£';
-$messages['jump_to_navigation'] = 'Òƶ¯µ½µ¼º½Ìõ¡£';
-$messages['comment_email_never_display'] = 'ϵͳ»á×Ô¶¯ÎªÄúÉ趨·ÖÐУ¬ÇÒ²»»áÏÔʾÄúÁôϵÄÓʼþµØÖ·¡£';
-$messages['comment_html_allowed'] = '¿ÉʹÓÃµÄ <acronym title="Hypertext Markup Language">HTML</acronym> ±êÇ©ÈçÏ£º&lt;<acronym title="ÓÃ;£º³¬¼¶Á´½Ó">a</acronym> href=&quot;&quot; title=&quot;&quot; rel=&quot;&quot;&gt; &lt;<acronym title="ÓÃ;£ºÊ××ÖϳÁ">acronym</acronym> title=&quot;&quot;&gt; &lt;<acronym title="ÓÃ;£ºÒýÓÃÎÄ×Ö">blockquote</acronym> cite=&quot;&quot;&gt; &lt;<acronym title="ÓÃ;£ºÉ¾³ýÏß">del</acronym>&gt; &lt;<acronym title="ÓÃ;£ºÐ±Ìå">em</acronym>&gt; &lt;<acronym title="ÓÃ;£ºµ×Ïß">ins</acronym>&gt; &lt;<acronym title="ÓÃ;£º´ÖÌå">strong</acronym>&gt;';
-$messages['trackback_uri'] = 'ÕâƪÎÄÕµÄÒýÓÃÁ´½ÓµØÖ·£º';
-$messages['previous_post'] = 'ÉÏһƪ';
-$messages['next_post'] = 'ÏÂһƪ';
-$messages['comment_default_title'] = '(ÎÞ±êÌâ)';
-$messages['guestbook'] = 'ÁôÑÔ°å';
-$messages['trackbacks'] = 'ÒýÓÃ';
-$messages['menu'] = 'ÐÂΞۺÏ';
-$messages['albums'] = '×ÊÔ´ÖÐÐÄ';
-$messages['admin'] = '¹ÜÀí¿ØÖÆ̨';
-?>
\ No newline at end of file

Copied: plog/trunk/locale/unsupport/locale_zh_CN_gb2312.php (from rev 2126, plog/branches/plog-1.0.1/locale/unsupport/locale_zh_CN_gb2312.php)

Deleted: plog/trunk/locale/unsupport/locale_zh_TW_big5.php
===================================================================
--- plog/branches/plog-1.0.1/locale/unsupport/locale_zh_TW_big5.php	2005-05-31 07:42:16 UTC (rev 2126)
+++ plog/trunk/locale/unsupport/locale_zh_TW_big5.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,903 +0,0 @@
-<?php
-// set this to the encoding that should be used to display the pages correctly
-$messages['encoding'] = 'big5';
-$messages['locale_description'] = 'Traditional Chinese translation (BIG5)';
-// locale format, see Locale::formatDate for more information
-$messages['date_format'] = '%d/%m/%Y %H:%M';
-
-// days of the week
-$messages['days'] = Array( '¬P´Á¤é', '¬P´Á¤@', '¬P´Á¤G', '¬P´Á¤T', '¬P´Á¥|', '¬P´Á¤­', '¬P´Á¤»' );
-// -- compatibility, do not touch -- //
-$messages['Monday'] = $messages['days'][1];
-$messages['Tuesday'] = $messages['days'][2];
-$messages['Wednesday'] = $messages['days'][3];
-$messages['Thursday'] = $messages['days'][4];
-$messages['Friday'] = $messages['days'][5];
-$messages['Saturday'] = $messages['days'][6];
-$messages['Sunday'] = $messages['days'][0];
-
-// abbreviations
-$messages['daysshort'] = Array( '¤é', '¤@', '¤G', '¤T', '¥|', '¤­', '¤»' );
-// -- compatibility, do not touch -- //
-$messages['Mo'] = $messages['daysshort'][1];
-$messages['Tu'] = $messages['daysshort'][2];
-$messages['We'] = $messages['daysshort'][3];
-$messages['Th'] = $messages['daysshort'][4];
-$messages['Fr'] = $messages['daysshort'][5];
-$messages['Sa'] = $messages['daysshort'][6];
-$messages['Su'] = $messages['daysshort'][0];
-
-// months of the year
-$messages['months'] = Array( '¤¸¤ë', '¤G¤ë', '¤T¤ë', '¥|¤ë', '¤­¤ë', '¤»¤ë', '¤C¤ë', '¤K¤ë', '¤E¤ë', '¤Q¤ë', '¤Q¤@¤ë', '¤Q¤G¤ë');
-// -- compatibility, do not touch -- //
-$messages['January'] = $messages['months'][0];
-$messages['February'] = $messages['months'][1];
-$messages['March'] = $messages['months'][2];
-$messages['April'] = $messages['months'][3];
-$messages['May'] = $messages['months'][4];
-$messages['June'] = $messages['months'][5];
-$messages['July'] = $messages['months'][6];
-$messages['August'] = $messages['months'][7];
-$messages['September'] = $messages['months'][8];
-$messages['October'] = $messages['months'][9];
-$messages['November'] = $messages['months'][10];
-$messages['December'] = $messages['months'][11];
-$messages['message'] = '°T®§';
-$messages['error'] = '¿ù»~';
-$messages['date'] = '¤é´Á';
-
-// miscellaneous texts
-$messages['of'] = 'of';
-$messages['recently'] = 'ªñ´Á¤å³¹';
-$messages['comments'] = '°jÅT';
-$messages['comment on this'] = '°jÅT';
-$messages['my_links'] = '§Úªº³sµ²';
-$messages['archives'] = '¤å³¹·J¾ã';
-$messages['search'] = '¯¸¤º·j´M';
-$messages['calendar'] = '¤é¾ä';
-$messages['search_s'] = '·j´M';
-$messages['search_this_blog'] = '·j´Mºô»x¤º®e:';
-$messages['about_myself'] = '¦Û§Ú¤¶²Ð';
-$messages['permalink_title'] = '¤å³¹·J¾ãÀRºA³sµ²ºô§}';
-$messages['permalink'] = 'ÀRºA³sµ²ºô§}';
-$messages['posted_by'] = '§@ªÌ';
-$messages['reply'] = '¦^ÂÐ';
-
-// add comment form
-$messages['add_comment'] = 'µoªí°jÅT';
-$messages['comment_topic'] = '¼ÐÃD';
-$messages['comment_text'] = '¤º®e';
-$messages['comment_username'] = '¼ÊºÙ';
-$messages['comment_email'] = '¹q¤l¶l¥ó';
-$messages['comment_url'] = '­Ó¤Hºô­¶';
-$messages['comment_send'] = 'µoªí';
-$messages['comment_added'] = '±zªº°jÅT¤w¸g¶¶§Qµoªí¡I';
-$messages['comment_add_error'] = 'µoªí°jÅT®Éµo¥Í¿ù»~';
-$messages['article_does_not_exist'] = '¥»¤å³¹¤£¦s¦b';
-$messages['no_posts_found'] = '§ä¤£¨ì¤å³¹';
-$messages['user_has_no_posts_yet'] = '¸Ó¨Ï¥ÎªÌÁÙ¨S¦³µoªí¹L¥ô¦ó¤å³¹';
-$messages['back'] = '¦^¨ì¤W¤@­¶';
-$messages['post'] = '¤å³¹';
-$messages['trackbacks_for_article'] = '¤Þ¥Î¥»¤åªº¤å³¹¼ÐÃD¡G';
-$messages['trackback_excerpt'] = 'ºK­n';
-$messages['trackback_weblog'] = 'ºô»x';
-$messages['search_results'] = '·j´Mµ²ªG';
-$messages['search_matching_results'] = '¥H¤U¤å³¹²Å¦X±zªº·j´MÃöÁä¦r: ';
-$messages['search_no_matching_posts'] = '§ä¤£¨ì²Å¦Xªº¤å³¹';
-$messages['read_more'] = '(¾\Ū¥þ¤å)';
-$messages['syndicate'] = '·s»D¥æ´«';
-$messages['main'] = '¥D­¶­±';
-$messages['about'] = 'Ãö©ó';
-$messages['download'] = '¤U¸ü';
-
-////// error messages /////
-$messages['error_fetching_article'] = '§ä¤£¨ì±z©Ò«ü©wªº¤å³¹¡C';
-$messages['error_fetching_articles'] = '§ä¤£¨ì±z©Ò«ü©wªº¤å³¹¡C';
-$messages['error_trackback_no_trackback'] = '©|¥¼¦³¤H¦V¥»¤åµo°e¤Þ¥Î³q§i';
-$messages['error_incorrect_article_id'] = '¤å³¹ID¤£¥¿½T¡C';
-$messages['error_incorrect_blog_id'] = 'ºô»x¯¸¥xID¤£¥¿½T¡C';
-$messages['error_comment_without_text'] = 'µL°jÅT¯d¨¥¤º®e¡C';
-$messages['error_comment_without_name'] = '±z¥²¶·­n¶ñ¼g©m¦W©Î¼ÊºÙ¡C';
-$messages['error_adding_comment'] = '¦b±N¯d¨¥·s¼W¦Ü¸ê®Æ®w®Éµo¥Í°ÝÃD¡C';
-$messages['error_incorrect_parameter'] = '°Ñ¼Æ¤£¥¿½T¡C';
-$messages['error_parameter_missing'] = '±z¤Ö¶Ç»¼¤F¤@¶µ°Ñ¼Æ¡C';
-$messages['error_comments_not_enabled'] = '³o­Óºô»x¯¸¥xÃö³¬¤F°jÅT¥\¯à';
-$messages['error_incorrect_search_terms'] = '·j´MÃöÁä¦r¤£¥¿½T';
-$messages['error_no_search_results'] = '§ä¤£¨ì»PÃöÁä¦r¬Û²Åªº¶µ¥Ø¡C';
-$messages['error_no_albums_defined'] = '³o­Óºô»x¯¸¥x¨S¦³¥ô¦ó¸ê¸ê®Æ§¨¡C';
-
-/////////////////                                          //////////////////
-///////////////// STRINGS FOR THE ADMINISTRATION INTERFACE //////////////////
-/////////////////                                          //////////////////
-
-// login page
-$messages['login'] = 'µn¤J';
-$messages['welcome_message'] = 'Åwªï¨Ó¨ì pLog';
-$messages['error_incorrect_username_or_password'] = '«Ü©êºp¡A±z¿é¤Jªº±b¸¹©Î±K½X¿ù»~¡C';
-$messages['error_dont_belong_to_any_blog'] = '«Ü©êºp¡A±z¨S¦³¨Ï¥Î¨t²Î¤¤¥ô¦ó¤@­Óºô»x¯¸¥xªºÅv­­¡C';
-$messages['logout_message'] = '±z¤w¸g¶¶§Qµn¥X¨t²Î¡C';
-$messages['logout_message_2'] = '½Ð«ö <a href="%1$s">³o¸Ì</a> ³sµ²¨ì %2$s</a>.';
-$messages['error_access_forbidden'] = '±z¥Ø«e¨S¦³Åv­­¶i¤JºÞ²z¤¶­±¡C½Ð¨ì³o¸Ìµn¤J¡C';
-$messages['username'] = '¨Ï¥ÎªÌ¦WºÙ';
-$messages['password'] = '¨Ï¥ÎªÌ±K½X';
-
-// dashboard
-$messages['dashboard'] = 'ºÞ²z­±ª©';
-$messages['recent_articles'] = '³Ìªñµoªí¤å³¹';
-$messages['recent_comments'] = '³Ìªñµoªí°jÅT';
-$messages['recent_trackbacks'] = '³Ìªñ¤Þ¥Î¦Cªí';
-$messages['blog_statistics'] = 'ºô»x²Î­p';
-$messages['total_posts'] = '¤å³¹Á`¼Æ';
-$messages['total_comments'] = '°jÅTÁ`¼Æ';
-$messages['total_trackbacks'] = '¤Þ¥ÎÁ`¼Æ';
-$messages['total_viewed'] = '¤å³¹¾\ŪÁ`¼Æ';
-$messages['in'] = '©ó';
-
-// menu options
-$messages['newPost'] = 'µoªí·s¤å³¹';
-$messages['Manage'] = '¤º®eºÞ²z';
-$messages['managePosts'] = '¤å³¹ºÞ²z';
-$messages['editPosts'] = '¤å³¹¦Cªí';
-$messages['editArticleCategories'] = '½s¿è¤å³¹¤ÀÃþ';
-$messages['newArticleCategory'] = '·s¼W¤å³¹¤ÀÃþ';
-$messages['manageLinks'] = 'ºô¯¸³sµ²ºÞ²z';
-$messages['editLinks'] = 'ºô¯¸³sµ²¦Cªí';
-$messages['newLink'] = '·s¼Wºô¯¸³sµ²';
-$messages['editLink'] = '½s¿èºô¯¸³sµ²';
-$messages['editLinkCategories'] = '½s¿èºô¯¸³sµ²¤ÀÃþ';
-$messages['newLinkCategory'] = '·s¼W³sµ²¤ÀÃþ';
-$messages['editLinkCategory'] = '½s¿èºô¯¸³sµ²¤ÀÃþ';
-$messages['manageCustomFields'] = 'ºÞ²z¦Û­qÄæ¦ì';
-$messages['blogCustomFields'] = '¦Û­qÄæ¦ì¦Cªí';
-$messages['newCustomField'] = '·s¼W¦Û­qÄæ¦ì';
-$messages['resourceCenter'] = 'Àɮפ¤¤ß';
-$messages['resources'] = 'ÀɮצCªí';
-$messages['newResourceAlbum'] = '·s¼W¸ê®Æ§¨';
-$messages['newResource'] = '·s¼WÀÉ®×';
-$messages['controlCenter'] = '­Ó¤Hºô»x³]©w';
-$messages['manageSettings'] = '°ò¥»³]©w';
-$messages['blogSettings'] = 'ºô»x³]©w';
-$messages['userSettings'] = '¨Ï¥ÎªÌ³]©w';
-$messages['pluginCenter'] = '¥~±¾¤¤¤ß';
-$messages['Stats'] = '²Î­p¸ê®Æ';
-$messages['manageBlogUsers'] = 'ºÞ²zºô»x¨Ï¥ÎªÌ';
-$messages['newBlogUser'] = '·s¼Wºô»x¨Ï¥ÎªÌ';
-$messages['showBlogUsers'] = 'ºô»x¨Ï¥ÎªÌ¦Cªí';
-$messages['manageBlogTemplates'] = 'ºÞ²zºô»x¼Òª©';
-$messages['newBlogTemplate'] = '·s¼Wºô»x¼Òª©';
-$messages['blogTemplates'] = 'ºô»x¼Òª©¦Cªí';
-$messages['adminSettings'] = '¥þ³¡¯¸¥xºÞ±±';
-$messages['Users'] = '¨Ï¥ÎªÌ';
-$messages['createUser'] = '·s¼W¨Ï¥ÎªÌ';
-$messages['editSiteUsers'] = 'ºÞ²z¨Ï¥ÎªÌ';
-$messages['Blogs'] = 'ºÞ²zºô»x';
-$messages['createBlog'] = '«Ø¥ßºô»x';
-$messages['editSiteBlogs'] = 'ºô»x¯¸¥xºÞ²z';
-$messages['Locales'] = '»y¨tºÞ²z';
-$messages['newLocale'] = '·s¼W»y¨t';
-$messages['siteLocales'] = '»y¨tÀɮצCªí';
-$messages['Templates'] = '¼Òª©ºÞ²z';
-$messages['newTemplate'] = '·s¼W¼Òª©';
-$messages['siteTemplates'] = '¼Òª©ºÞ²z';
-$messages['GlobalSettings'] = '¥þ°ì³]©w';
-$messages['editSiteSettings'] = '¥þ°ì³]©w';
-$messages['summarySettings'] = ' ºK­n³]©w';
-$messages['templateSettings'] = '¼Òª©³]©w';
-$messages['urlSettings'] = 'ºô§}³]©w';
-$messages['emailSettings'] = '¹q¤l¶l¥ó³]©w';
-$messages['uploadSettings'] = '¤W¶Ç³]©w';
-$messages['helpersSettings'] = '»¡©ú¤u¨ã³]©w';
-$messages['interfacesSettings'] = '¥~³¡¤¶­±³]©w';
-$messages['securitySettings'] = '¨t²Î¦w¥þ³]©w';
-$messages['bayesianSettings'] = '¨©¤ó¹LÂo³]©w';
-$messages['resourcesSettings'] = 'Àɮפ¤¤ß³]©w';
-$messages['searchSettings'] = '·j´M³]©w';
-$messages['cleanUpSection'] = '²M²z©U§£±M°Ï';
-$messages['cleanUp'] = '²M²z©U§£';
-$messages['editResourceAlbum'] = '½s¿èÀɮ׸ê®Æ§¨';
-$messages['resourceInfo'] = 'Àɮ׸ê°T';
-$messages['editBlog'] = 'ºô»xºÞ²z';
-$messages['Logout'] = 'µn¥X';
-
-// new post
-$messages['topic'] = '¼ÐÃD';
-$messages['topic_help'] = '¤å³¹¼ÐÃD';
-$messages['text'] = '¤º¤å';
-$messages['text_help'] = '³o³¡¥÷ªº¤º®e·|¦bºô»x­º­¶¥X²{¡C';
-$messages['extended_text'] = '©µ¦ù¤º¤å';
-$messages['extended_text_help'] = '±z¦b¦¹¿é¤Jªº¤å¦r¥u·|¦b³æ½g·J¾ãª¬ºA¤UÅã¥Ü¡A°£«D±z¦b¡u³]©w¡v­¶­±¤¤­×§ï¤F³]©w¡C';
-$messages['post_slug'] = 'µu¼ÐÃD ';
-$messages['post_slug_help'] = 'µu¼ÐÃD±N·|¥Î¨Ó«Ø¥ß²¼äªºÀRºA³sµ²ºô§}';
-$messages['date'] = '¤é´Á';
-$messages['post_date_help'] = '¤å³¹µoªí¤é´Á';
-$messages['status'] = 'ª¬ºA';
-$messages['post_status_help'] = '¿ï¨ú¤@­Óª¬ºA';
-$messages['post_status_published'] = '©w½Z';
-$messages['post_status_draft'] = '¯ó½Z';
-$messages['post_status_deleted'] = '¤w§R°£';
-$messages['categories'] = '¤å³¹¤ÀÃþ';
-$messages['post_categories_help'] = '¿ï¨ú¤@­Ó©Î¤@­Ó¥H¤Wªº¤ÀÃþ';
-$messages['post_comments_enabled_help'] = '±Ò¥Î°jÅT¯d¨¥¥\¯à';
-$messages['send_notification_help'] = '¦pªG¦³¤H¹ï¥»¤åµoªí°jÅT¡A«K¦V§Úµo°e¹q¤l¶l¥ó³qª¾';
-$messages['send_trackback_pings_help'] = 'µo°e¤Þ¥Î³q§i';
-$messages['send_xmlrpc_pings_help'] = '°e¥X XMLRPC ³q§i';
-$messages['save_draft_and_continue'] = 'Àx¦s¯ó½Z';
-$messages['preview'] = '¹wÄý';
-$messages['add_post'] = 'µoªí!';
-$messages['error_saving_draft'] = 'Àx¦s¯ó½Zµo¥Í¿ù»~¡I';
-$messages['draft_saved_ok'] = '¯ó½Z¤w¶¶§QÀx¦s';
-$messages['error_sending_request'] = '¶Ç°e­n¨D®Éµo¥Í¿ù»~';
-$messages['error_no_category_selected'] = '§A¨S¦³¿ï¾Ü¥ô¦ó¤ÀÃþ';
-$messages['error_missing_post_topic'] = '½Ð¿é¤J¤å³¹¼ÐÃD¡I';
-$messages['error_missing_post_text'] = '½Ð¿é¤J¤å³¹¤º¤å¡I';
-$messages['error_adding_post'] = 'µoªí¤å³¹µo¥Í¿ù»~¡I';
-$messages['post_added_not_published'] = '¤å³¹¤w¶¶§Q·s¼W¡A¦ý©|¥¼¥¿¦¡µoªí¡C';
-$messages['post_added_ok'] = '¤å³¹¤w¶¶§Q·s¼W';
-$messages['send_notifications_ok'] = '·í¦³·sªº°jÅT©Î¬O¤Þ¥Î®É¡A«K¦V§Úµo°e¹q¤l¶l¥ó³qª¾';
-
-// send trackbacks
-$messages['error_sending_trackbacks'] = 'µo°e¤U¦C¤Þ¥Î³qª¾®É²£¥Í¿ù»~¡C';
-$messages['send_trackbacks_help'] = '½Ð¤Ä¿ï±z©Ò­nµo°e¤Þ¥Î³q§iªººô§}¡C(½Ð½T©w¸Óºô¯¸¤ä´©¤Þ¥Î³q§iªº¥\¯à)';
-$messages['send_trackbacks'] = 'µo°e¤Þ¥Î³qª¾';
-$messages['ping_selected'] = '¦V¤Ä¿ïªººô§}µo°e¤Þ¥Î³qª¾';
-$messages['trackbacks_sent_ok'] = '¤Þ¥Î³qª¾¤w¸g¦¨¥\µo°e¨ì¤Ä¿ïªººô§}¡C';
-
-// posts page
-$messages['show_by'] = '§ó·s¦Cªí';
-$messages['category'] = '¤ÀÃþ';
-$messages['author'] = '§@ªÌ';
-$messages['post_status_all'] = '¥þ³¡';
-$messages['author_all'] = '¥þ³¡§@ªÌ';
-$messages['search_terms'] = '·j´MÃöÁä¦r';
-$messages['show'] = '§ó·s';
-$messages['delete'] = '§R°£';
-$messages['actions'] = '°Ê§@';
-$messages['all'] = '¥þ³¡';
-$messages['category_all'] = '¥þ³¡¤ÀÃþ';
-$messages['error_incorrect_article_id'] = '¤å³¹ID¤£¥¿½T¡C';
-$messages['error_deleting_article'] = '¦b§R°£¤å³¹"%s"®É¡Aµo¥Í¿ù»~¡C';
-$messages['article_deleted_ok'] = '¤å³¹¡u%s¡v ¤w¶¶§Q§R°£¡C';
-$messages['articles_deleted_ok'] = '¤å³¹¡u%s¡v ¤w¶¶§Q§R°£¡C';
-$messages['error_deleting_article2'] = '§R°£¤å³¹®Éµo¥Í¿ù»~ (id = %s) ';
-
-// edit post page
-$messages['update'] = '§ó·s';
-$messages['editPost'] = '½s¿è¤å³¹';
-$messages['error_fetching_post'] = 'Ū¨ú¤å³¹¸ê®Æ®Éµo¥Í¿ù»~';
-$messages['post_updated_ok'] = '¤å³¹[%s]¤w¦¨¥\§ó·s¡C';
-$messages['error_updating_post'] = '§ó·s¤å³¹®Éµo¥Í¿ù»~';
-$messages['notification_added'] = '·í¦³·sªº°jÅT©Î¬O¤Þ¥Î®É¡A«K¦V§Úµo°e¹q¤l¶l¥ó³qª¾';
-$messages['notification_removed'] = '·í¦³·sªº°jÅT©Î¬O¤Þ¥Î®É¡A¤£­n¦V§Úµo°e¹q¤l¶l¥ó³qª¾';
-
-// post comments
-$messages['url'] = 'ºô§}';
-$messages['comment_status_all'] = '¥þ³¡°jÅT';
-$messages['comment_status_spam'] = '©U§£°jÅT';
-$messages['comment_status_nonspam'] = '¥¿±`°jÅT';
-$messages['error_fetching_comments'] = 'Ū¨ú¤å³¹°jÅT¸ê®Æ®É¡Aµo¥Í¿ù»~¡C';
-$messages['error_deleting_comments'] = '¦b§R°£°jÅT®Éµo¥Í¿ù»~©Î±z¨S¦³¤Ä¿ï¥ô¦ó­n§R°£ªº°jÅT¡C';
-$messages['comment_deleted_ok'] = '¡u%s¡v³o½g¤å³¹ªº°jÅT¤w¶¶§Q§R°£¡C';
-$messages['comments_deleted_ok'] = '¡u%s¡v³o½g¤å³¹ªº°jÅT¤w¶¶§Q§R°£¡C';
-$messages['error_deleting_comment'] = '¦b§R°£°jÅT¡u%s¡v®Éµo¥Í¿ù»~¡C';
-$messages['error_deleting_comment2'] = '§R°£°jÅT®Éµo¥Í¿ù»~ (id = %s)';
-$messages['editComments'] = '½s¿è°jÅT';
-$messages['mark_as_spam'] = '¼Ð¥Ü¬°©U§£°jÅT';
-$messages['mark_as_no_spam'] = '¼Ð¥Ü¬°¥¿±`°jÅT';
-$messages['error_incorrect_comment_id'] = '¯d¨¥°jÅTID¤£¥¿½T¡C';
-$messages['error_marking_comment_as_spam'] = '¦b±N¥»½g°jÅT¯d¨¥¼Ð¥Ü¬°©U§£¯d¨¥®Éµo¥Í¿ù»~¡C';
-$messages['comment_marked_as_spam_ok'] = '±z¤w¸g¶¶§Q±N¥»½g°jÅT¯d¨¥¼Ð¥Ü¬°©U§£¯d¨¥¡C';
-$messages['error_marking_comment_as_nonspam'] = '¦b±N¥»½g°jÅT¯d¨¥¼Ð¥Ü¬°¥¿±`¯d¨¥®Éµo¥Í¿ù»~¡C';
-$messages['comment_marked_as_nonspam_ok'] = '±z¤w¸g¶¶§Q±N¥»½g°jÅT¯d¨¥¼Ð¥Ü¬°¥¿±`¯d¨¥¡C';
-
-// post trackbacks
-$messages['blog'] = 'ºô»x';
-$messages['excerpt'] = 'ºK­n';
-$messages['error_fetching_trackbacks'] = 'Ū¨ú¤Þ¥Î¸ê®Æ®É¡Aµo¥Í¿ù»~¡C';
-$messages['error_deleting_trackbacks'] = '¦b§R°£¤Þ¥Î®Éµo¥Í¿ù»~©Î¬O§A¨S¦³¤Ä¿ï¥ô¦ó­n§R°£ªº¤Þ¥Î¡C';
-$messages['error_deleting_trackback'] = '¦b§R°£¤Þ¥Î¡u%s¡v®Éµo¥Í¿ù»~';
-$messages['error_deleting_trackback2'] = '§R°£¤Þ¥Î®Éµo¥Í¿ù»~ (id = %s)';
-$messages['trackback_deleted_ok'] = '¡u%s¡v³o½g¤Þ¥Î¤w¶¶§Q§R°£¡C';
-$messages['trackbacks_deleted_ok'] = '¡u%s¡v³o½g¤Þ¥Î¤w¶¶§Q§R°£¡C';
-$messages['editTrackbacks'] = '½s¿è¤Þ¥Î';
-
-// post statistics
-$messages['referrer'] = '°f¦V³sµ²';
-$messages['hits'] = 'ÂIÀ»¼Æ';
-$messages['error_no_items_selected'] = '§A¨S¦³¤Ä¿ï¥ô¦ó­n§R°£ªº¶µ¥Ø';
-$messages['error_deleting_referrer'] = '¦b§R°£°f¦V³sµ²¡u%s¡v®Éµo¥Í¿ù»~';
-$messages['error_deleting_referrer2'] = '§R°£°f¦V³sµ²®Éµo¥Í¿ù»~ (id = %s)';
-$messages['referrer_deleted_ok'] = '¡u%s¡v³o½g°f¦V³sµ²¤w¶¶§Q§R°£¡C';
-$messages['referrers_deleted_ok'] = '¡u%s¡v³o½g°f¦V³sµ²¤w¶¶§Q§R°£¡C';
-
-// categories
-$messages['posts'] = '¤å³¹¦Cªí';
-$messages['show_in_main_page'] = '¦b­º­¶Åã¥Ü';
-$messages['error_incorrect_category_id'] = '¤å³¹¤ÀÃþID¿ù»~©Î¨S¦³¿ï¨ú¥ô¦ó¶µ¥Ø';
-$messages['error_category_has_articles'] = 'µLªk§R°£¡u%s¡v³o­Ó¤ÀÃþ¡A¦]¬°¸Ó¤ÀÃþ¤UÁÙ¦³¤å³¹¡C½Ð¥ý­×§ï¤å³¹¤ÀÃþ«á¡A¦A­«¸Õ¤@¦¸¡C';
-$messages['category_deleted_ok'] = '¡u%s¡v³o­Ó¤ÀÃþ¤w¶¶§Q§R°£¡C';
-$messages['categories_deleted_ok'] = '¡u%s¡v³o­Ó¤ÀÃþ¤w¶¶§Q§R°£¡C';
-$messages['error_deleting_category'] = '¦b§R°£¤ÀÃþ¡u%s¡v®Éµo¥Í¿ù»~';
-$messages['error_deleting_category2'] = '§R°£¤ÀÃþ®Éµo¥Í¿ù»~ (id = %s)';
-$messages['yes'] = '¬O';
-$messages['no'] = '§_';
-
-// new category
-$messages['name'] = '¦WºÙ';
-$messages['category_name_help'] = '½Ð¿é¤J¤ÀÃþ¦WºÙ';
-$messages['description'] = '¤ÀÃþ´y­z';
-$messages['category_description_help'] = '½Ð¿é¤J¸Ô²Óªº¤ÀÃþ´y­z';
-$messages['show_in_main_page_help'] = '¿ï¨ú³o­Ó¿ï¶µ¡A«h¦b³o­Ó¤ÀÃþ¤Uªº¤å³¹·|¦b­º­¶Åã¥Ü¡C§_«h¥u¦³·íÂsÄý³o­Ó¤ÀÃþ®É¤~·|¬Ý¨ì¤å³¹¡C';
-$messages['error_empty_name'] = '§A¥²¶·¿é¤J¤ÀÃþ¦WºÙ';
-$messages['error_empty_description'] = '§A¥²¶·¿é¤J¤ÀÃþ´y­z';
-$messages['error_adding_article_category'] = '¦b·s¼W¤ÀÃþ®Éµo¥Í¿ù»~¡C½ÐÀˬd¿é¤Jªº¸ê®Æ¡A¦A­«¸Õ¤@¦¸¡C';
-$messages['category_added_ok'] = '¤ÀÃþ¦WºÙ ¡u%s¡v¤w¸g¶¶§Q·s¼W';
-$messages['add'] = '·s¼W';
-$messages['reset'] = '­«·s³]¸m';
-
-// update category
-$messages['error_updating_article_category'] = '§ó·s¤å³¹¤ÀÃþ®Éµo¥Í¿ù»~¡C';
-$messages['error_fetching_category'] = 'Ū¨ú¤ÀÃþ¸ê®Æ®Éµo¥Í¿ù»~¡C';
-$messages['article_category_updated_ok'] = '¤ÀÃþ ¡u%s¡v ¤w¶¶§Q§ó·s¡C';
-
-// links
-$messages['feed'] = 'Feed';
-$messages['error_no_links_selected'] = 'ºô¯¸³sµ²ID¿ù»~©Î±z¨S¦³¿ï¾Ü¥ô¦óºô¯¸³sµ²¡AµLªk§R°£¡C';
-$messages['error_incorrect_link_id'] = 'ºô¯¸³sµ²ID¤£¥¿½T';
-$messages['error_removing_link'] = '¦b§R°£ºô¯¸³sµ²¡u%s¡v®Éµo¥Í¿ù»~¡C';
-$messages['error_removing_link2'] = '¦b§R°£ºô¯¸³sµ²®Éµo¥Í¿ù»~¡Aid = %d';
-$messages['link_deleted_ok'] = 'ºô¯¸³sµ²¡u%s¡v¤w¶¶§Q§R°£¡C';
-$messages['links_deleted_ok'] = 'ºô¯¸³sµ²¡u%s¡v¤w¶¶§Q§R°£¡C';
-
-// new link
-$messages['link_name_help'] = '½Ð¿é¤J³sµ²¦WºÙ¡C';
-$messages['link_url_help'] = '³sµ²ºô§}';
-$messages['link_description_help'] = '²µu´y­z';
-$messages['link_feed_help'] = '§A¤]¥i¥H´£¨Ñ¥ô¦óªº RSS ©Î Atom feeds ªº³sµ²¡C';
-$messages['link_category_help'] = '¿ï¨ú¤@­Óºô¯¸³sµ²¤ÀÃþ';
-$messages['error_adding_link'] = '·s¼Wºô¯¸³sµ²®Éµo¥Í¿ù»~¡C½ÐÀˬd¿é¤Jªº¸ê®Æ¡A¦A­«¸Õ¤@¦¸¡C';
-$messages['error_invalid_url'] = 'ºô§}¤£¥¿½T';
-$messages['link_added_ok'] = 'ºô¯¸³sµ²¡u%s¡v¤w¶¶§Q·s¼W';
-
-// update link
-$messages['error_updating_link'] = '§ó·sºô¯¸³sµ²®Éµo¥Í¿ù»~¡C½ÐÀˬd¿é¤Jªº¸ê®Æ¡A¦A­«¸Õ¤@¦¸¡C';
-$messages['error_fetching_link'] = 'Ū¨úºô¯¸³sµ²¸ê®Æ®Éµo¥Í¿ù»~¡C';
-$messages['link_updated_ok'] = 'ºô¯¸³sµ²¡u%s¡v¤w¶¶§Q§ó·s';
-
-// link categories
-$messages['links'] = 'ºô¯¸³sµ²';
-$messages['error_invalid_link_category_id'] = 'ºô¯¸³sµ²¤ÀÃþID¤£¥¿½T©Î¨S¦³¿ï¾Ü³sµ²¤ÀÃþ¡AµLªk§R°£¡C';
-$messages['error_links_in_link_category'] = 'µLªk§R°£¡u%s¡v³o­Óºô¯¸³sµ²¤ÀÃþ¡A¦]¬°¸Ó¤ÀÃþ¤UÁÙ¦³³sµ²¡C½Ð¥ý­×§ïºô¯¸³sµ²«á¡A¦A­«¸Õ¤@¦¸¡C';
-$messages['error_removing_link_category'] = '¦b§R°£ºô¯¸³sµ²¤ÀÃþ¡u%s¡v®Éµo¥Í¿ù»~¡C';
-$messages['link_category_deleted_ok'] = 'ºô¯¸³sµ²¤ÀÃþ¡u%s¡v¤w¶¶§Q§R°£¡C';
-$messages['link_categories_deleted_ok'] = 'ºô¯¸³sµ²¤ÀÃþ¡u%s¡v¤w¶¶§Q§R°£¡C';
-$messages['error_removing_link_category2'] = '§R°£ºô¯¸³sµ²¤ÀÃþ®Éµo¥Í¿ù»~ (id = %s)';
-
-// new link category
-$messages['link_category_name_help'] = 'ºô¯¸³sµ²¤ÀÃþ¦WºÙ';
-$messages['error_adding_link_category'] = '·s¼Wºô¯¸³sµ²¤ÀÃþ®Éµo¥Í¿ù»~¡C';
-$messages['link_category_added_ok'] = 'ºô¯¸³sµ²¤ÀÃþ¡u%s¡v¤w¶¶§Q·s¼W';
-
-// edit link category
-$messages['error_updating_link_category'] = '§ó·sºô¯¸³sµ²¤ÀÃþ®Éµo¥Í¿ù»~¡C½ÐÀˬd¿é¤J¸ê®Æ«á¡A¦A¸Õ¤@¦¸¡C';
-$messages['link_category_updated_ok'] = 'ºô¯¸³sµ²¤ÀÃþ¡u%s¡v¤w¶¶§Q§ó·s';
-$messages['error_fetching_link_category'] = 'Ū¨úºô¯¸³sµ²¤ÀÃþ¸ê®Æ®Éµo¥Í¿ù»~¡C';
-
-// custom fields
-$messages['type'] = 'Ãþ«¬';
-$messages['hidden'] = 'ÁôÂÃ';
-$messages['fields_deleted_ok'] = '¡u%s¡v ¦Û­qÄæ¦ì¤w¶¶§Q§R°£';
-$messages['field_deleted_ok'] = '¡u%s¡v ¦Û­qÄæ¦ì¤w¶¶§Q§R°£';
-$messages['error_deleting_field'] = '¦b§R°£¦Û­qÄæ¦ì¡u%s¡v®Éµo¥Í¿ù»~¡C';
-$messages['error_deleting_field2'] = '§R°£¦Û­qÄæ¦ì®Éµo¥Í¿ù»~ (id = %s)';
-$messages['error_incorrect_field_id'] = '¦Û­qÄæ¦ìID¤£¥¿½T';
-
-// new custom field
-$messages['field_name_help'] = '¦bµoªí¤å³¹®É¡A¥Î¨ÓÅã¥Ü¦Û­qÄæ¦ìªº¦WºÙ';
-$messages['field_description_help'] = '¦Û­qÄæ¦ìªºÂ²µu´y­z';
-$messages['field_type_help'] = '¿ï¾Ü¤@­Ó¦X¾AªºÄæ¦ìÃþ«¬';
-$messages['field_hidden_help'] = '¦pªG¤Ä¿ïÁôÂáA¨º»ò¦b·s¼W©Î­×§ï¤å³¹®É«K¤£·|¥X²{¸Ó¦Û­qÄæ¦ì¡C³o­Ó¥\¯à¥D­n´£¨Ñµ¹¥~±¾µ{¦¡±M¥Î¡C';
-$messages['error_adding_custom_field'] = '·s¼W¦Û­qÄæ¦ì®Éµo¥Í¿ù»~¡C½ÐÀˬd¿é¤J¸ê®Æ«á¡A¦A¸Õ¤@¦¸¡C';
-$messages['custom_field_added_ok'] = '¦Û­qÄæ¦ì¡u%s¡v¤w¶¶§Q§ó·s';
-$messages['text_field'] = '¤å¦rÄæ¦ì(Text field)';
-$messages['text_area'] = '¤å¦r°Ï¶ô(Text box)';
-$messages['checkbox'] = '®Ö¨ú¤è¶ô(Checkbox)';
-$messages['date_field'] = '¤é´Á¿ï¾Ü(Date chooser)';
-
-// edit custom field
-$messages['error_fetching_custom_field'] = 'Ū¨ú¦Û­qÄæ¦ì¸ê®Æ®Éµo¥Í¿ù»~¡C';
-$messages['error_updating_custom_field'] = '§ó·s¦Û­qÄæ¦ì®Éµo¥Í¿ù»~¡C½ÐÀˬd¿é¤J¸ê®Æ«á¡A¦A¸Õ¤@¦¸¡C';
-$messages['custom_field_updated_ok'] = '¦Û­qÄæ¦ì¡u%s¡v¤w¶¶§Q§ó·s';
-
-// resources
-$messages['root_album'] = '¥D¸ê®Æ§¨';
-$messages['num_resources'] = 'ÀÉ®×¼Æ';
-$messages['total_size'] = 'Àɮפj¤p';
-$messages['album'] = '¸ê®Æ§¨';
-$messages['error_incorrect_album_id'] = '¸ê®Æ§¨ID¤£¥¿½T';
-$messages['error_base_storage_folder_missing_or_unreadable'] = 'pLogµLªk«Ø¥ßÀɮצsÀÉ©Ò¥²»Ýªº¸ê®Æ§¨¡C ­ì¦]¥i¯à¬O¦]¬°PHP¥H¦w¥þ¼Ò¦¡¦b°õ¦æ©Î¬O§A¨S¦³¨¬°÷ªºÅv­­¤W¶ÇÀɮסC §A¥i¥H¸ÕµÛ¤â°Ê«Ø¥ß¤U¦C¸ê®Æ§¨: <br/><br/>%s<br/><br/>¦pªG³o¨Ç¸ê®Æ§¨¤w¸g¦s¦b¡A½Ð½T©w§A¥i¥H¨Ï¥ÎÂsÄý¾¹¨Ó¶i¦æŪ¼g¡C';
-$messages['items_deleted_ok'] = '¡u%s¡v¤w¶¶§Q§R°£';
-$messages['error_album_has_children'] = '¡u%s¡v¸ê®Æ§¨¸Ì­±ÁÙ¦³ÀɮשΤl¸ê®Æ§¨¡C½Ð±NÀɮשθê®Æ§¨²¾°£«á¦b­«¸Õ¤@¦¸¡C';
-$messages['item_deleted_ok'] = '¡u%s¡v¤w¶¶§Q§R°£';
-$messages['error_deleting_album'] = '¦b§R°£¸ê®Æ§¨¡u%s¡v®Éµo¥Í¿ù»~¡C';
-$messages['error_deleting_album2'] = '§R°£¸ê®Æ§¨®Éµo¥Í¿ù»~ (id = %s)';
-$messages['error_deleting_resource'] = '¦b§R°£Àɮסu%s¡v®Éµo¥Í¿ù»~¡C';
-$messages['error_deleting_resource2'] = '§R°£Àɮ׮ɵo¥Í¿ù»~ (id = %s)';
-$messages['error_no_resources_selected'] = '¨S¦³¿ï¾Ü­n§R°£ªº¶µ¥Ø¡C';
-$messages['resource_deleted_ok'] = 'ÀɮסG¡u%s¡v ¤w¶¶§Q§R°£';
-$messages['album_deleted_ok'] = '¸ê®Æ§¨¡G¡u%s¡v ¤w¶¶§Q§R°£';
-$messages['add_resource'] = '·s¼WÀÉ®× (­ì¹Ï)';
-$messages['add_resource_preview'] = '·s¼WÀÉ®×¹wÄý (¤p¹Ï)';
-$messages['add_resource_medium'] = '·s¼WÀÉ®×¹wÄý (¤¤¹Ï)';
-$messages['add_album'] = '·s¼W¸ê®Æ§¨';
-
-// new album
-$messages['album_name_help'] = '¸ê®Æ§¨Â²µu¦WºÙ';
-$messages['parent'] = '¤W¼h¥Ø¿ý';
-$messages['no_parent'] = '³»ºÝ¥Ø¿ý';
-$messages['parent_album_help'] = '¨Ï¥Î³o­Ó¿ï¶µ¨Ó¦w±Æ¤l¸ê®Æ§¨¡A¦P®ÉÅý§AªºÀɮשñ¸m§ó¦³²Õ´¡C';
-$messages['album_description_help'] = '¹ï¸ê®Æ§¨¤º®e°µ¸Ô²Óªº´y­z»¡©ú¡C';
-$messages['error_adding_album'] = '·s¼W¸ê®Æ§¨®Éµo¥Í¿ù»~¡C½ÐÀˬd¿é¤J¸ê®Æ«á¡A¦A¸Õ¤@¦¸¡C';
-$messages['album_added_ok'] = '¸ê®Æ§¨¡G¡u%s¡v ¤w¶¶§Q·s¼W¡C';
-
-// edit album
-$messages['error_incorrect_album_id'] = '¸ê®Æ§¨ID¤£¥¿½T¡C';
-$messages['error_fetching_album'] = 'Ū¨ú¸ê®Æ§¨¸ê®Æ®Éµo¥Í¿ù»~¡C';
-$messages['error_updating_album'] = '§ó·s¸ê®Æ§¨®Éµo¥Í¿ù»~¡C½ÐÀˬd¿é¤J¸ê®Æ«á¡A¦A¸Õ¤@¦¸¡C';
-$messages['album_updated_ok'] = '¸ê®Æ§¨¡u%s¡v¤w¶¶§Q§ó·s';
-$messages['show_album_help'] = '¨ú®ø¤Ä¿ï¡A³o­Ó¸ê®Æ§¨±N¤£·|¥X²{¦bºô»x¸ê®Æ§¨¦Cªí¤¤¡C';
-
-// new resource
-$messages['file'] = 'ÀÉ®×';
-$messages['resource_file_help'] = '¤U­±ªºÀÉ®×±N·|·s¼W¨ìºô»xªºÀɮפ¤¤ß¡C¦pªG§A­n¦P®É¤W¶Ç¦h­ÓÀɮסA½Ð¨Ï¥Î¤U¤è¡u·s¼W¤W¶ÇÄæ¦ì¡vªº³sµ²¨Ó·s¼WÄæ¦ì¡C';
-$messages['add_field'] = '·s¼W¤W¶ÇÄæ¦ì';
-$messages['resource_description_help'] = 'Ãö©ó³o­ÓÀɮפº®eªº¸Ô²Ó´y­z¡C';
-$messages['resource_album_help'] = '¿ï¾Ü§A·Q±NÀɮפW¶Ç¨ì¨º­Ó¸ê®Æ§¨¡C';
-$messages['error_no_resource_uploaded'] = '§A¨Ã¥¼¿ï¾Ü¥ô¦ó­n¤W¶ÇªºÀɮסC';
-$messages['resource_added_ok'] = 'ÀɮסG¡u%s¡v¤w¶¶§Q·s¼W¡C';
-$messages['error_resource_forbidden_extension'] = 'µLªk·s¼WÀɮסA¦]¬°¥Î¤F¨t²Î¤£¤¹³\ªº°ÆÀɦW¡C';
-$messages['error_resource_too_big'] = 'µLªk·s¼WÀɮסA¦]¬°ÀɮפӤj¤F¡C';
-$messages['error_uploads_disabled'] = 'µLªk·s¼WÀɮסA¦]¬°¦øªA¾¹ºÞ²z­ûÃö³¬¤F³o¶µ¥\¯à¡C';
-$messages['error_quota_exceeded'] = 'µLªk·s¼WÀɮסA¦]¬°¤w¸g¶W¹L®e³\ªºÀÉ®×®e¶q­­«×¡C';
-$messages['error_adding_resource'] = '¦b·s¼WÀɮ׮ɵo¥Í¿ù»~¡C';
-
-// edit resource
-$messages['editResource'] = '½s¿èÀÉ®×';
-$messages['resource_information_help'] = '¤U­±¬O¤@¨Ç»P³o­ÓÀɮצ³Ãöªº¸ê°T';
-$messages['information'] = 'Àɮ׸ê°T';
-$messages['size'] = 'Àɮפj¤p';
-$messages['format'] = 'Àɮ׮榡';
-$messages['dimensions'] = 'ºû«×';
-$messages['bits_per_sample'] = '¼Ë¥»¦ì¤¸²v';
-$messages['sample_rate'] = '¨ú¼Ë¤ñ¨Ò';
-$messages['number_of_channels'] = 'ÀW¹D¼Æ¥Ø';
-$messages['legnth'] = 'ªø«×';
-$messages['thumbnail_format'] = 'ÁY¹Ï®æ¦¡';
-$messages['regenerate_preview'] = '­«·s²£¥Í¹wÄýÁY¹Ï';
-$messages['error_fetching_resource'] = 'Ū¨úÀɮ׸ê°T®Éµo¥Í¿ù»~¡C';
-$messages['error_updating_resource'] = '§ó·sÀɮ׮ɵo¥Í¿ù»~¡C';
-$messages['resource_updated_ok'] = 'ÀɮסG¡u%s¡v¤w¶¶§Q§ó·s¡C';
-
-// blog settings
-$messages['blog_link'] = 'ºô»x¯¸¥xºô§}';
-$messages['blog_link_help'] = '¤£¯à­×§ï';
-$messages['blog_name_help'] = '¯¸¥x¦WºÙ';
-$messages['blog_description_help'] = '¯¸¥x¬ÛÃö»¡©ú';
-$messages['language'] = '»y¨t';
-$messages['blog_language_help'] = '¨t²Î¤å¦r¥H¤Î¤é´Á©Ò¨Ï¥Îªº»y¨¥';
-$messages['max_main_page_items'] = '­º­¶¤å³¹¼Æ¥Ø';
-$messages['max_main_page_items_help'] = '±z­n¦b­º­¶Åã¥Ü´X½g¤å³¹¡H';
-$messages['max_recent_items'] = 'ªñ´Á¤å³¹¼Æ¥Ø';
-$messages['max_recent_items_help'] = '±z­n¦b¡uªñ´Á¤å³¹¦Cªí¡vÅã¥Ü´X½g¤å³¹¡H';
-$messages['template'] = '¼Òª©';
-$messages['choose'] = '¹wÄý¿ï¨ú...';
-$messages['blog_template_help'] = '½Ð¿ï¾Ü±zªººô»x¯¸¥x©Ò­n¨Ï¥Îªº¥~Æ[¼Ë¦¡¼Òª©';
-$messages['use_read_more'] = '¦b¤å³¹¨Ï¥Î¡u¾\Ū¥þ¤å...¡v³sµ²';
-$messages['use_read_more_help'] = '¦pªG³]©w¬°¡u¬O¡v¡A¨º»ò±z¦b­º­¶ªº¤å³¹´N·|¦Û°Ê²£¥Í¡u¾\Ū¥þ¤å¡v³sµ²¡A³o­Ó³sµ²·|³s¨ì³æ½g¤å³¹ªºÀRºA©T©wºô§}¡A¦AÅã¥Ü¥þ¤åªº¡u©µ¦ù¤º¤å³¡¤À¡v¡C';
-$messages['enable_wysiwyg'] = '±Ò¥Î©Ò¨£§Y©Ò±o¡]WYSIWYG¡^¤å³¹½s¿è¡C';
-$messages['enable_wysiwyg_help'] = '¦pªG±z·Q­n¥ß¨è¬Ý¨ì±zªº½s¿èµ²ªG¡A½Ð³]©w¬°¡u¬O¡v¡C³o­Ó¥\¯à¥u¦³¦b¨Ï¥ÎªÌ¨Ï¥ÎInternet Explorer 5.5©ÎMozilla 1.3b¥H¤Wªºª©¥»¤~¦³®ÄªG¡C';
-$messages['enable_comments'] = '¶}©ñ©Ò¦³¤å³¹ªº°jÅT¯d¨¥Åv­­';
-$messages['enable_comments_help'] = '¦pªG³]©w¬°¡u¬O¡v¡A¨º»ò±z«K¥i¥HÅý¨ä¥L¨Ï¥ÎªÌ°w¹ï±zªº¤å³¹µoªí°jÅT¯d¨¥¡C³o­Ó³]©w·|®M¥Î¨ì±zªº¥þ³¡¤å³¹¤W¡C';
-$messages['show_future_posts'] = '¦b¤é¾äÅã¥Ü¥¼¨Ó¤å³¹¡C';
-$messages['show_future_posts_help'] = '¦pªG³]©w¬°¡u¬O¡v¡A¨º»òµoªí¤é´Á³]©w¦b¥¼¨Óªº¤å³¹±N·|¥X²{¦b¤é¾ä¤W¡C';
-$messages['comments_order'] = '°jÅT¯d¨¥±Æ§Ç¤è¦¡';
-$messages['comments_order_help'] = '¦pªG±z³]©w¦¨¡uªº¦b«e¡v¡A¨º»ò¯d¨¥´N·|±q¨ì·s±Æ§Ç¡A¦pªG³]©w¦¨¡u·sªº¦b«e¡v¡A«h¤Ï¤§¡A¯d¨¥±q·s¨ì±ƧǥX²{¡C';
-$messages['oldest_first'] = 'ªº¦b«e';
-$messages['newest_first'] = '·sªº¦b«e';
-$messages['categories_order'] = '¤ÀÃþ±Æ¦C¶¶§Ç';
-$messages['categories_order_help'] = '­º­¶¤ÀÃþ±Æ¦C¤è¦¡¡C';
-$messages['most_recent_updated_first'] = '³Ìªñ§ó·s¦b«e';
-$messages['alphabetical_order'] = '¨Ì­^¤å¦r¥À¶¶§Ç±Æ¦C';
-$messages['reverse_alphabetical_order'] = '¨Ì­^¤å¦r¥À¶¶§Ç¤Ï¦V±Æ¦C';
-$messages['most_articles_first'] = '³Ì¦h¤å³¹¦b«e';
-$messages['link_categories_order'] = 'ºô¯¸³sµ²¤ÀÃþ±Æ¦C¶¶§Ç';
-$messages['link_categories_order_help'] = '­º­¶ºô¯¸³sµ²¤ÀÃþ±Æ¦C¤è¦¡¡C';
-$messages['most_links_first'] = '³Ì¦h³sµ²¦b«e';
-$messages['most_links_last'] = '³Ì¦h³sµ²¦b«á';
-$messages['time_offset'] = 'ºô»x¦øªA¾¹»P±z©Ò¦b¦aªº®É¶¡®t';
-$messages['time_offset_help'] = '±z¥i¥H¥Î³o­Ó³]©w¡A½Õ¾ã±z©Òµoªíªº¤å³¹ªº®É¶¡¡C³o­Ó¥\¯à¦b¦øªA¾¹¥D¾÷»P±z¤À§O¦b¤£¦P®É°Ï®É¬Û·í¦³¥Î¡C¦pªG±z±N®É¶¡®t³]©w¬°¡u+3 ¤p®É¡v¡A¨º»ò¨t²Î´N·|±N¤å³¹ªºµoªí®É¶¡½Õ¾ã¦¨±z©Ò³]©wªº®É¶¡¡C';
-$messages['close'] = 'Ãö³¬';
-$messages['select'] = '¿ï¾Ü';
-$messages['error_updating_settings'] = '§ó·sºô»x³]©w®Éµo¥Í¿ù»~¡A½ÐÀˬd¿é¤J¸ê®Æ«á¦b­«¸Õ¤@¦¸¡C';
-$messages['error_invalid_number'] = '¼Æ¥Ø®æ¦¡¤£¥¿½T¡C';
-$messages['error_incorrect_time_offset'] = 'ºô»x¦øªA¾¹»P±z©Ò¦b¦aªº®É¶¡®t¤£¥¿½T';
-$messages['blog_settings_updated_ok'] = 'ºô»x³]©w§ó·s¤w¶¶§Q§¹¦¨¡C';
-$messages['hours'] = '¤p®É';
-
-// user settings
-$messages['username_help'] = '¤½¶}ªº¨Ï¥ÎªÌ¦WºÙ¡AµLªk§ó§ï¡C';
-$messages['full_name'] = '¥þ¦W';
-$messages['full_name_help'] = '§¹¾ãªº¨Ï¥ÎªÌ¦WºÙ';
-$messages['password_help'] = '¦pªG§A·Q§ó§ï±K½X½Ð¿é¤J·s±K½X¤Î½T»{±K½X¡F¦pªG±z¤£·Q­×§ï±K½X¡A¯d¥Õ«K¥i¡C';
-$messages['confirm_password'] = '½T»{±K½X';
-$messages['email'] = '¹q¤l¶l¥ó';
-$messages['email_help'] = '¦pªG±z·Q­n¨Ï¥Î¹q¤l¶l¥ó³qª¾«H¥\¯à¡A½Ð¶ñ¼g¥¿½Tªº«H½c¡C';
-$messages['bio'] = '¦Û§Ú¤¶²Ð';
-$messages['bio_help'] = '±z¥i¥H¦b¦¹¶ñ¼g¤@¨Ç±zªº¦Û§Ú¤¶²Ð¡A©Î¬O¤£¶ñ¤]¥i¥H¡C';
-$messages['picture'] = '­Ó¤H¹Ï¹³';
-$messages['user_picture_help'] = '½Ð±q¤W¶Ç¨ìºô»x¤¤ªº¹Ï¤ù¿ï¨ú¤@±i°µ¬°§Aªº­Ó¤H¤jÀY¶K¡C';
-$messages['error_invalid_password'] = '±K½X¤Óµu©Î±K½X¿ù»~¡C';
-$messages['error_passwords_dont_match'] = '«Ü©êºp¡A±z¿é¤Jªº¨â¦¸±K½X¤£¬Û²Å¡C';
-$messages['error_incorrect_email_address'] = '¹q¤l¶l¥ó«H½c®æ¦¡¿ù»~¡C';
-$messages['error_updating_user_settings'] = '§ó·s­Ó¤H¸ê®Æ®Éµo¥Í¿ù»~¡C½ÐÀˬd¿é¤Jªº¸ê®Æ«á¦b­«¸Õ¤@¦¸¡C';
-$messages['user_settings_updated_ok'] = '¨Ï¥ÎªÌ³]©w¤w¶¶§Q§ó·s¡C';
-$messages['resource'] = 'ÀÉ®×';
-
-// plugin centre
-$messages['identifier'] = '¥N¸¹';
-$messages['error_plugins_disabled'] = '«Ü©êºp¡A¥~±¾¥Ø«e°±¥Î¤¤¡C';
-
-// blog users
-$messages['revoke_permissions'] = '¨ú®ø¨Ï¥ÎÅv­­¡C';
-$messages['error_no_users_selected'] = '§A¨S¦³¿ï¨ú¥ô¦ó¨Ï¥ÎªÌ¡C';
-$messages['user_removed_from_blog_ok'] = '¨Ï¥ÎªÌ¡u%s¡v¤w¸g¶¶§Q±q¥»¯¸§@ªÌ¦æ¦C¤¤§R°£¡C';
-$messages['users_removed_from_blog_ok'] = '¨Ï¥ÎªÌ¡u%s¡v¤w¸g¶¶§Q±q¥»¯¸§@ªÌ¦æ¦C¤¤§R°£¡C';
-$messages['error_removing_user_from_blog'] = '¦b±N¨Ï¥ÎªÌ¡u%s¡v±q¥»ºô»x¯¸¥x§@ªÌ¦æ¦C¤¤²¾°£®Éµo¥Í¿ù»~¡C';
-$messages['error_removing_user_from_blog2'] = '¦b±N¨Ï¥ÎªÌ±q¥»ºô»x¯¸¥x§@ªÌ¦æ¦C¤¤²¾°£®Éµo¥Í¿ù»~¡C(id:%s)';
-
-// new blog user
-$messages['new_blog_username_help'] = '±z¥i¥H¥Î¥H¤Uªí³æ¡A±N¨ä¥L¨Ï¥ÎªÌ¥[¤J±zªººô»x§@ªÌ¦æ¦C¤¤¡C·s¼W¥[ªº¨Ï¥ÎªÌ¥u¯à¦s¨úºÞ²z¤¤¤ß¤ÎÀɮפ¤¤ß¡C';
-$messages['send_notification'] = 'µo°e³qª¾';
-$messages['send_user_notification_help'] = '¥Î¹q¤l¶l¥ó³qª¾³o¦W¨Ï¥ÎªÌ¡C';
-$messages['notification_text'] = '³qª¾¤º®e';
-$messages['notification_text_help'] = '½Ð¿é¤J±z­n³qª¾³o¦ì¨Ï¥ÎªÌªº«H¥ó¤º®e';
-$messages['error_adding_user'] = '¦b¥[¤J¨Ï¥ÎªÌ®Éµo¥Í°ÝÃD¡A½ÐÀˬd¿é¤Jªº¸ê®Æ¦b­«¸Õ¤@¦¸¡C';
-$messages['error_empty_text'] = '³qª¾¤º®e¤£¥i¥H¬OªÅ¥Õ¡C';
-$messages['error_adding_user'] = '¦b¥[¤J¨Ï¥ÎªÌ®Éµo¥Í°ÝÃD¡A½ÐÀˬd¿é¤Jªº¸ê®Æ¦b­«¸Õ¤@¦¸¡C';
-$messages['error_invalid_user'] = '¨Ï¥ÎªÌ¡u%s¡v±b¸¹¤£¥¿½T©Î¸Ó¨Ï¥ÎªÌ¤£¦s¦b¡C';
-$messages['user_added_to_blog_ok'] = '¨Ï¥ÎªÌ¡u%s¡v¤w¸g¶¶§Q¥[¤J§@ªÌ¦æ¦C¡C';
-
-// blog templates
-$messages['error_no_templates_selected'] = '±z¨S¦³¿ï¾Ü¥ô¦ó¼Òª©¡C';
-$messages['error_template_is_current'] = '¡u%s¡v¼Òª©µLªk§R°£¡A¸Ó¼Òª©¥¿¦b¨Ï¥Î¤¤¡C';
-$messages['error_removing_template'] = '§R°£¼Òª© ¡u%s¡v®Éµo¥Í¿ù»~¡C';
-$messages['template_removed_ok'] = ' ¼Òª© ¡u%s¡v¤w¶¶§Q§R°£¡C';
-$messages['templates_removed_ok'] = '¼Òª© ¡u%s¡v¤w¶¶§Q§R°£¡C';
-
-// new blog template
-$messages['template_installed_ok'] = '·sªº¼Òª©³]¸m¡u %s¡v¤w¸g¶¶§Q¦w¸Ë§¹¦¨¡C';
-$messages['error_installing_template'] = '¦b¦w¸Ë¼Òª©³]¸m¡u %s¡v®Éµo¥Í¿ù»~¡C';
-$messages['error_missing_base_files'] = '¦b³o­Ó¼Òª©³]¸m¤¤¦³¨Ç°ò¥»Àɮפ£¨£¤F¡C';
-$messages['error_add_template_disabled'] = '¥»¯¸¤£¤¹³\¨Ï¥ÎªÌ·s¼W¼Òª©ÀɮסC';
-$messages['error_must_upload_file'] = '±z¥²¶·¤W¶ÇÀɮסC';
-$messages['error_uploads_disabled'] = '¥»¯¸¤wÃö³¬ÀɮפW¶Ç¥\¯à¡C';
-$messages['error_no_new_templates_found'] = '§ä¤£¨ì·sªº¼Òª©³]¸m¡C';
-$messages['error_template_not_inside_folder'] = '¼Òª©ÀÉ®×¥²¶·©ñ¦b»P¼Òª©¦P¦Wªº¥Ø¿ý·í¤¤¡C';
-$messages['error_missing_base_files'] = '¦b³o­Ó¼Òª©³]¸m¤¤¦³¨Ç°ò¥»Àɮפ£¨£¤F¡C';
-$messages['error_unpacking'] = '¦b¸ÑÀ£ÁY®Éµo¥Í¿ù»~¡C';
-$messages['error_forbidden_extensions'] = '¦b³o­Ó¼Òª©³]¸m¤¤¦³¨ÇÀɮ׸T¤î¦s¨ú¡C';
-$messages['error_creating_working_folder'] = '¦bÀˬd¼Òª©³]¸m®Éµo¥Í¿ù»~¡C';
-$messages['error_checking_template'] = '¼Òª©³]¸mµo¥Í¿ù»~ (code = %s)';
-$messages['template_package'] = '¼Òª©¦w¸Ë¥]';
-$messages['blog_template_package_help']  = '±z¥i¥H¥Î³o­Óªí³æ¡A¤W¶Ç¤@­Ó·sªº¼Òª©¦w¸Ë¥]¡A¸Ó¼Òª©±N¥u¦³§Aªººô»x¯à°÷¨Ï¥Î¡C¦pªG±z¨S¦³¿ìªk¥ÎÂsÄý¾¹¤W¶Ç¡A½Ð¤â°Ê¤W¶Ç¸Ó¼Òª©¨Ã±N¥¦©ñ¸m©ó§Aªººô»x¼ÒªO¸ê®Æ§¨<b>%s</b>¤U,µM«á«ö¤U "<b>±½ºË¼Òª©</b>" «ö¯Ã¡C pLog ·|±½ºË¸Ó¸ê®Æ§¨¨Ã¦Û°Ê·s¼W©Ò§ä¨ìªº·s¼Òª©¡C';
-$messages['scan_templates'] = '±½ºË¼Òª©';
-
-// site users
-$messages['user_status_active'] = '±Ò¥Î';
-$messages['user_status_disabled'] = '°±¥Î';
-$messages['user_status_all'] = '©Ò¦³ª¬ºA';
-$messages['user_status_unconfirmed'] = '©|¥¼½T»{';
-$messages['error_invalid_user2'] = '¨Ï¥ÎªÌ¥N¸¹¡u%s¡v¤£¦s¦b¡C';
-$messages['error_deleting_user'] = '¦b°±¥Î¨Ï¥ÎªÌ±b¸¹¡u%s¡v®Éµo¥Í¿ù»~¡C';
-$messages['user_deleted_ok'] = '¨Ï¥ÎªÌ±b¸¹¡u%s¡v¤w¶¶§Q°±¥Î¡C';
-$messages['users_deleted_ok'] = '¨Ï¥ÎªÌ±b¸¹¡u%s¡v¤w¶¶§Q°±¥Î¡C';
-
-// create user
-$messages['user_added_ok'] = '·s¨Ï¥ÎªÌ±b¸¹¡u%s¡v¤w¶¶§Q·s¼W¡C';
-$messages['error_incorrect_username'] = '¨Ï¥ÎªÌ¦WºÙ¤£¥¿½T©Î¤w¸g¦³¤Hµù¥U¬Û¦Pªº¦WºÙ¤F¡C';
-$messages['user_status_help'] = '¨Ï¥ÎªÌ±b¸¹¥Ø«eª¬ºA';
-$messages['user_blog_help'] = '¨Ï¥ÎªÌ¹w³]ªººô»x';
-$messages['none'] = 'µL';
-
-// edit user
-$messages['error_invalid_user'] = '¨Ï¥ÎªÌID¤£¥¿½T©Î¨Ï¥ÎªÌ¤£¦s¦b¡C';
-$messages['error_updating_user'] = '§ó·s¨Ï¥ÎªÌ³]©w®Éµo¥Í¿ù»~¡C½ÐÀˬd¿é¤J¸ê®Æ«á¦A­«¸Õ¤@¦¸¡C';
-$messages['blogs'] = 'ºô»x';
-$messages['user_blogs_helps'] = '¨Ï¥ÎªÌ¾Ö¦³©Î¥i¥H¦s¨úªººô»x¡C';
-$messages['site_admin'] = '¥þ¯¸¨t²ÎºÞ²z';
-$messages['site_admin_help'] = '¦pªG¨Ï¥ÎªÌ¾Ö¦³¥þ¯¸¨t²ÎºÞ²zÅv­­¡A¥L´N¥i¥H¬Ý¨£[¯¸¥x³]©w]°Ï°ì¡A¥i¥H¶i¦æ¥þ¯¸ªººÞ²z¤u§@¡C';
-$messages['user_updated_ok'] = '¨Ï¥ÎªÌ±b¸¹¡u%s¡v¤w¶¶§Q§ó·s¡C';
-
-// site blogs
-$messages['blog_status_all'] = '©Ò¦³ª¬ºA';
-$messages['blog_status_active'] = '±Ò¥Î';
-$messages['blog_status_disabled'] = '°±¥Î';
-$messages['blog_status_unconfirmed'] = '©|¥¼½T»{';
-$messages['owner'] = 'ºÞ²z­û';
-$messages['quota'] = 'ÀÉ®×­­«×';
-$messages['bytes'] = 'bytes';
-$messages['error_no_blogs_selected'] = '±z¥²¶·­n¿ï¾Ü±z©Ò·Q­n§R°£ªººô»x¯¸¥x¡C';
-$messages['error_blog_is_default_blog'] = '¡u%s¡v¬O¨t²Î¹w³]ºô»x¯¸¥x¡AµLªk§R°£¡C';
-$messages['blog_deleted_ok'] = '¡u%s¡vºô»x¯¸¥x¤w¶¶§Q§R°£¡C';
-$messages['blogs_deleted_ok'] = '¡u%s¡vºô»x¯¸¥x¤w¶¶§Q§R°£¡C';
-$messages['error_deleting_blog'] = '¦b§R°£¡u%s¡v³o­Óºô»x¯¸¥x®Éµo¥Í¿ù»~¡C';
-$messages['error_deleting_blog2'] = '¦b§R°£ºô»x¯¸¥x®Éµo¥Í¿ù»~¡C(ID:%s)';
-
-// create blog
-$messages['error_adding_blog'] = '¦b·s¼Wºô»x®Éµo¥Í¿ù»~¡C½ÐÀˬd¿é¤Jªº¸ê®Æ¦b­«¸Õ¤@¦¸¡C';
-$messages['blog_added_ok'] = '·sªººô»x¯¸¥x¡u%s¡v¤w¦¨¥\¥[¤J¸ê®Æ®w¤¤¡C';
-
-// edit blog
-$messages['blog_status_help'] = 'ºô»xª¬ºA';
-$messages['blog_owner_help'] = 'ºô»x¯¸¥xºÞ²zªÌ¡A±N¾Ö¦³§¹¾ãªºÅv­­¨Ó­×§ïºô»x³]©w¡C';
-$messages['users'] = '¨Ï¥ÎªÌ';
-$messages['blog_quota_help'] = 'ÀÉ®×®e¶q­­«×(³æ¦ì¡Gbytes)¡C³]¬°0©ÎªÅ¥Õ±N¨Ï¥Î¨t²Îªº¥þ°ìÀÉ®×­­«×°µ¬°¹w³]­È¡C';
-$messages['blog_users_help'] = '¥i¥H¦s¨ú³o­Óºô»xªº¨Ï¥ÎªÌ¡C½Ð±q¥ªÃä¿ï¨ú¨Ï¥ÎªÌ±N¥L²¾¨ì¥kÃä´£¨Ñ¸Ó¨Ï¥ÎªÌ¦s¨úºô»xªºÅv­­¡C';
-$messages['edit_blog_settings_updated_ok'] = 'ºô»x ¡u%s¡v¤w¶¶§Q§ó·s¡C';
-$messages['error_updating_blog_settings'] = '§ó·sºô»x¯¸¥x ¡u%s¡v®Éµo¥Í¿ù»~¡C';
-$messages['error_incorrect_blog_owner'] = '­n³]©w¬°ºô»x¯¸¥xºÞ²z­ûªº¨Ï¥ÎªÌ±b¸¹¤£¦s¦b¡C';
-$messages['error_fetching_blog'] = 'Ū¨úºô»x¸ê®Æ®Éµo¥Í¿ù»~¡C';
-$messages['error_updating_blog_settings2'] = '§ó·sºô»x®Éµo¥Í¿ù»~¡C½ÐÀˬd¿é¤J¸ê®Æ¦b­«¸Õ¤@¦¸¡C';
-$messages['add_or_remove'] = '·s¼W©Î²¾°£¨Ï¥ÎªÌ';
-
-// site locales
-$messages['locale'] = '»y¨t';
-$messages['locale_encoding'] = '½s½X¤è¦¡';
-$messages['locale_deleted_ok'] = '¡u%s¡v»y¨t¤w¶¶§Q§R°£¡C';
-$messages['error_no_locales_selected'] = '±z¨S¦³¿ï¾Ü­n§R°£ªº»y¨t¡C';
-$messages['error_deleting_only_locale'] = '±z¤£¥i¥H§R°£³o­Ó»y¨tÀɮסA¦]¬°³o¬O¨t²Î¤¤¥Ø«e°ß¤@ªº»y¨tÀɮסC';
-$messages['locales_deleted_ok']= '¡u%s¡v»y¨t¤w¶¶§Q§R°£¡C';
-$messages['error_deleting_locale'] = '¦b§R°£¡u%s¡v»y¨t®Éµo¥Í¿ù»~¡C';
-$messages['error_locale_is_default'] = '±z¤£¥i¥H§R°£¡u%s¡v»y¨t¡A¦]¬°³o¬O¨t²Î¥Ø«eªº¹w³]»y¨t¡C';
-
-// add locale
-$messages['error_invalid_locale_file'] = '³o­ÓÀɮר䣬O¥¿½Tªº»y¨tÀɮסC';
-$messages['error_no_new_locales_found'] = '§ä¤£¨ì·sªº»y¨tÀɮסC';
-$messages['locale_added_ok'] = '»y¨t¡u%s¡v¤w¸g¶¶§Q·s¼W';
-$messages['error_saving_locale'] = '¦b±N·sªº»y¨tÀÉ®×Àx¦s¦Ü»y¨tÀɮץؿý®Éµo¥Í¿ù»~¡C½ÐÀˬdÀɮץؿýªº¼g¤JÅv­­¬O§_¥¿½T¡C';
-$messages['scan_locales'] = '±½ºË»y¨tÀÉ';
-$messages['add_locale_help'] = '±z¥i¥H¥Î³o­Óªí³æ¡A¤W¶Ç¤@­Ó·sªº»y¨tÀÉ¡C¦pªG±z¨S¦³¿ìªk¥ÎÂsÄý¾¹¤W¶Ç¡A½Ð¤â°Ê¤W¶Ç¸ÓÀɮרñN¥¦©ñ¸m©ó <b>./locales/</b>¤U,µM«á«ö¤U "<b>±½ºË»y¨tÀÉ</b>" «ö¯Ã¡C pLog ·|±½ºË¸Ó¸ê®Æ§¨¨Ã¦Û°Ê·s¼W©Ò§ä¨ìªº»y¨tÀÉ¡C ';
-
-// site templates
-$messages['error_template_is_default'] = '±z¤£¥i¥H§R°£¡u%s¡v¼Òª©¡A¦]¬°³o¬O·sºô»x¥Ø«eªº¹w³]¼Òª©¡C';
-
-// add template
-$messages['global_template_package_help'] = '±z¥i¥H¥Î³o­Óªí³æ¡A¤W¶Ç¤@­Ó·sªº¼Òª©¦w¸Ë¥]¡A¸Ó¼Òª©±N´£¨Ñµ¹ºô¯¸¤W©Ò¦³ºô»x¨Ï¥Î¡C¦pªG±z¨S¦³¿ìªk¥ÎÂsÄý¾¹¤W¶Ç¡A½Ð¤â°Ê¤W¶Ç¸Ó¼Òª©¨Ã±N¥¦©ñ¸m©ó§Aªººô»x¼ÒªO¸ê®Æ§¨<b>%s</b>¤U,µM«á«ö¤U "<b>±½ºË¼Òª©</b>" «ö¯Ã¡C pLog ·|±½ºË¸Ó¸ê®Æ§¨¨Ã¦Û°Ê·s¼W©Ò§ä¨ìªº·s¼Òª©¡C';
-
-// global settings
-$messages['site_config_saved_ok'] = '¯¸¥x³]©w¤w¶¶§QÀx¦s¡C';
-$messages['error_saving_site_config'] = '¦bÀx¦s¯¸¥x³]¸m®Éµo¥Í°ÝÃD¡C';
-/// general settings
-$messages['help_comments_enabled'] = '±Ò¥Î©Î°±¥Î¥þ¯¸ªº°jÅT¯d¨¥¥\¯à¡C';
-$messages['help_beautify_comments_text'] = '¦b¨Ï¥ÎªÌµoªí°jÅT¯d¨¥®É¡A¨Ï¥Î¥L©Ò¿é¤Jªº¤å¦r®æ¦¡¡C';
-$messages['help_temp_folder'] = 'pLog¨t²Î¥Î¨ÓÀx¦s¼È¦sÀɮץΪº¥Ø¿ý¡C';
-$messages['help_base_url'] = '³o­Óºô»x¦w¸Ëªººô§}¡A³o­Ó¶µ¥Ø°È¥²­n¥¿½T¡A½Ð¤p¤ß¿é¤J¡C';
-$messages['help_subdomains_enabled'] = '±Ò¥Î©Î°±¥Î¦¸ºô°ì³]©w¡C';
-$messages['help_subdomains_base_url'] = '·í¦¸ºô°ì³]©w±Ò¥Î®É¡A³o­Óºô§}±N¥Î¨Ó´À¥N¨t²Îºô§}¡C¨Ï¥Î {blogname}¨Ó¨ú±oºô»x¦WºÙ¤Î{username}¨ú±oºô»x¨Ï¥ÎªÌ¦WºÙ¡A¥Î¨Ó²£¥Í³sµ²¨ìºô»xªººô§}¡C';
-$messages['help_include_blog_id_in_url'] = '·í[¦¸ºô°ì]¥\¯à±Ò¥Î¤Î[¤@¯ëºô§}]¥\¯à±Ò¥Î®É¤~¦³·N¸q¡C±j­¢²£¥Íªººô§}¤£­n¥]§t"blogId"³o­Ó°Ñ¼Æ¡C½Ð¤£­nÅܧó³]©w­È¡A°£«D§Aª¾¹D§A¦b°µ¤°»ò¡C';
-$messages['help_script_name'] = '¦pªG§A±Nindex.php§ó§ï¬°¨ä¥¦¦WºÙªº¸Ü¡A½Ð¦b¤U¤è¿é¤J§ó§ï«áªºÀɮצWºÙ¡C';
-$messages['help_show_posts_max'] = '¦b­º­¶Åã¥Ü¤å³¹¼Æªº¹w³]­È¡C';
-$messages['help_recent_posts_max'] = '¦b­º­¶¡uªñ´Á¤å³¹¡v¦Cªí¤¤Åã¥Ü¤å³¹¼Æªº¹w³]­È¡C';
-$messages['help_save_drafts_via_xmlhttprequest_enabled'] = '·íXmlHttpRequest¥\¯à³Q±Ò¥Î®É¡A±N¥i¥H¨Ï¥ÎJavascript¨ÓÀx¦s¤å³¹¯ó½Z¡C';
-$messages['help_locale_folder'] = '»y¨tÀɮשҦb¥Ø¿ý¡C';
-$messages['help_default_locale'] = '¦b«Ø¥ß·sºô»x¯¸¥x®É¹w³]¨Ï¥Îªº»y¨t¡C';
-$messages['help_default_blog_id'] = '¹w³]ºô»xID';
-$messages['help_default_time_offset'] = '¹w³]ªººô¯¸¦øªA¾¹®É¶¡®t¡C';
-$messages['help_html_allowed_tags_in_comments'] = '¦bµoªí°jÅTµû½×®É¥i¥H¨Ï¥ÎªºHTML»yªk¼ÐÅÒ¡C';
-$messages['help_referer_tracker_enabled'] = '¬O§_¨Ï¥Î¤å³¹°f¦V³sµ²¥\¯à¡C(°±¥Î¦¹¥\¯à¥i¥H´£°ª¨t²Î®Ä¯à¡C)';
-$messages['help_show_more_enabled'] = '±Ò¥Î©Î°±¥Î¡u¾\Ū¥þ¤å¡v³sµ²¥\¯à¡C';
-$messages['help_update_article_reads'] = '¬O§_¨Ï¥Î¤º«ØªºÂI¾\²v²Î­p¤u¨ã­pºâ¨C½g¤å³¹ªºÂI¾\¦¸¼Æ¡C(°±¥Î¦¹¥\¯à¥i¥H´£°ª¨t²Î®Ä¯à¡C)';
-$messages['help_update_cached_article_reads'] = '¦b§Ö¨ú¥\¯à¶}±Òªº±¡§Î¤U¡A¬O§_¨Ï¥Î¤º«ØªºÂI¾\²v²Î­p¤u¨ã­pºâ¨C½g¤å³¹ªºÂI¾\¦¸¼Æ¡C';
-$messages['help_xmlrpc_ping_enabled'] = '¦b¨t²Î¤¤¦³¤Hµoªí·s¤å³¹®É¡A¬O§_°e¥X XMLRPC ³q§i¡C';
-$messages['help_send_xmlrpc_pings_enabled_by_default'] = '¹w³]±Ò¥Î¸Ó¥\¯à¡C·í¦³·s¤å³¹µoªí©Î§ó·s®É¡A¬O§_°e¥X XMLRPC ³q§i¡C¡C';
-$messages['help_xmlrpc_ping_hosts'] = 'XMLRPC ³q§i¦Cªí¡A¦pªG±z­n¦V¦h³Bµo°e³q§i¡A½Ð¦b¤å¦r®Ø¤U­±¥[¤J³q§iµo°eºô§}¡A¨C­Óºô§}¤@¦æ¡C';
-$messages['help_trackback_server_enabled'] = '¬O§_±µ¨ü±q¯¸¥~¶Ç¨Óªº¤Þ¥Î³q§i¡]TrackBack¡^¡C';
-$messages['help_htmlarea_enabled'] = '±Ò¥Î©Î°±¥Î§Yµø§Y©Ò±o¡]WYSIWYG¡^¤å³¹½s¿è¡C';
-$messages['help_plugin_manager_enabled'] = '±Ò¥Î©Î°±¥Î¥~±¾µ{¦¡¡C';
-$messages['help_minimum_password_length'] = '±K½X³Ìµu»Ý­n¦h¤Ö¦r¤¸¡C';
-$messages['help_xhtml_converter_enabled'] = '¦pªG±Ò¥Î¦¹¥\¯à¡ApLog·|¸ÕµÛ±N©Ò¦³ªºHTMLÂà´«¬°¾A·íªºXHTML¡C';
-$messages['help_xhtml_converter_aggressive_mode_enabled'] = '¦pªG±Ò¥Î¦¹¥\¯à¡ApLOG·|¸ÕµÛ±NHTML¶i¤@¨BÂà´«¬°XHTML¡A¦ý³o¼Ë¥i¯à·|¾É­P§ó¦hªº¿ù»~¡C';
-$messages['help_session_save_path'] = '¦¹³]©w±N¨Ï¥ÎPHPªºsession_save_path()¨ç¼Æ¡A¨Ó§ó§ïpLog¦s©ñsessionªº¸ê®Æ§¨¡C½Ð½T©w¸Ó¸ê®Æ§¨¥i¥H³z¹Lºô¯¸¦øªA¾¹¶i¦æ¼g¤J°Ê§@¡C¦pªG§A­n¨Ï¥ÎPHP¹w³]ªºsession¦s©ñ¸ô®|¡A½Ð±N¦¹³]©wªÅ¥Õ¡C';
-// summary settings
-$messages['help_summary_page_show_max'] = '¦bºK­n­¶­±¤¤­nÅã¥Ü¦h¤Ö¶µ¥Ø¡C¦¹¿ï¶µ±±¨î¦bºK­n­¶­±¤¤¦C¥Xªº©Ò¦³¶µ¥Ø¡C(¥]¬A³Ì·s¤å³¹¼Æ¥Ø¡B³Ì¬¡ÅDºô»xµ¥)';
-$messages['help_summary_blogs_per_page'] = '¦b[ºô»x¦Cªí]¤¤¨C¤@­¶­nÅã¥Ü¦h¤Öºô»x¡C';
-$messages['help_forbidden_usernames'] = '¦C¥X©Ò¦³¤£¤¹³\µù¥Uªº¨Ï¥ÎªÌ¦WºÙ¡C';
-$messages['help_force_one_blog_per_email_account'] = '¤@­Ó¹q¤l¶l¥ó¬O§_¥u¯àµù¥U¤@­Óºô»x';
-$messages['help_summary_show_agreement'] = '¦b¨Ï¥ÎªÌ¶i¦æµù¥U°Ê§@¤§«e¡A¬O§_Åã¥Ü¨Ã½T»{¨Ï¥ÎªÌ¦P·NªA°È±ø´Ú¡C';
-$messages['help_need_email_confirm_registration'] = '¬O§_±Ò¥Î¹q¤l¶l¥óªº½T»{³sµ²¨Ó±Ò¥Î±b¸¹¡C';
-$messages['help_summary_disable_registration'] = '¬O§_Ãö³¬¨Ï¥ÎªÌµù¥U·sºô»xªº¥\¯à¡C';
-// templates
-$messages['help_template_folder'] = '¼Òª©Àɮתº©Ò¦b¥Ø¿ý¸ô®|¡C';
-$messages['help_default_template'] = '¦b·s«Øºô»x¯¸¥x®É¡A¹w³]¨Ï¥Îªº¼Òª©¡C';
-$messages['help_users_can_add_templates'] = '¨Ï¥ÎªÌ¬O§_¥i¥H¦b¼Òª©³]¸m·í¤¤¡A¥[¤JÄÝ©ó¦Û¤v±MÄݻݨDªºÀɮסC';
-$messages['help_template_compile_check'] = '°±¥Î¦¹¥\¯à®É¡ASmarty¥u¦³¦b¼Òª©¦³§ó§ï®É¤~·|­«·s²£¥Í­¶­±¡C°±¥Î¦¹¥\¯à¥i¥H´£°ª¨t²Î®Ä¯à¡C';
-$messages['help_template_cache_enabled'] = '±Ò¥Î¼Òª©§Ö¨ú¥\¯à¡C±Ò¥Î¦¹¥\¯à¡A§Ö¨úªºª©¥»±N·|«ùÄò³Q¨Ï¥Î¡A¦Ó¤£»Ý­n¹ï¸ê®Æ®w¶i¦æ¸ê®Æ¦s¨úªº°Ê§@¡C';
-$messages['help_template_cache_lifetime'] = '§Ö¨ú¦s¬¡®É¶¡(³æ¦ì¡G¬í).³]¬°-1§Ö¨ú±N¥Ã¤£¹L´Á¡A©Î³]¬°0¨ÓÃö³¬§Ö¨ú¥\¯à¡C';
-$messages['help_template_http_cache_enabled'] = '¬O§_±Ò¥Î¹ïHTTP³sµ²­n¨Dªº§Ö¨ú¤ä´©¡C±Ò¥Î¦¹¥\¯àpLog¥u·|¶Ç°e¥²­nªº¤º®e¡A¥i¥H¸`¬Ùºô¸ôÀW¼e¡C';
-$messages['help_allow_php_code_in_templates'] = '¤¹³\¦bSmarty ¼Òª©¤¤ªº{php}...{/php}°Ï¶ô¸m¤J­ì¥ÍPHPµ{¦¡½X(native PHP code)';
-// urls
-$messages['help_request_format_mode'] = '¦pªG±z³]©w¬°¡u¤@¯ëºô§}¡v¡A¨º»ò¨t²Î©Ò§e²{ªººô§}¡A´N·|¨Ï¥Î±N°Ñ¼Æ¥Hget¤è¦¡¶Ç¤Jªº¤@¯ë¤è¦¡¡C¦pªG±z¿ï¥Î¡uÅý·j´M¤ÞÀº©ö©ó·j´MªºÂ²¼äºô§}¡v¡A¨º»ò´N·|Åýºô§}Åܱo²¼ä¡A·j´M¤ÞÀº¤]®e©ö¨ú±o±zºô¯¸¤Wªº¤º®e¡A¤£¹L±zªºApache¦øªA¾¹¥²¶·­n¯à°÷±µ¨ü.htaccessÀɮפ¤ªºÂмg³]©w¡C¦pªG¨Ï¥Î¦Û­qºô§}¡A½Ð½Õ¾ã¤U¤èªº³]©w¡C';
-$messages['plain'] = '¤@¯ëºô§}';
-$messages['search_engine_friendly'] = 'Åý·j´M¤ÞÀº©ö©ó·j´MªºÂ²¼äºô§}';
-$messages['custom_url_format'] = '¦Û­qºô§}';
-$messages['help_permalink_format'] = '·í¨Ï¥Î¦Û­qºô§}®É¡AÀRºA³sµ²ºô§}®æ¦¡¡C';
-$messages['help_category_link_format'] = '·í¨Ï¥Î¦Û­qºô§}®É¡Aºô¯¸³sµ²¤ÀÃþºô§}®æ¦¡¡C';
-$messages['help_blog_link_format'] = '·í¨Ï¥Î¦Û­qºô§}®É¡Aºô»x³sµ²ºô§}®æ¦¡¡C';
-$messages['help_archive_link_format'] = '·í¨Ï¥Î¦Û­qºô§}®É¡A¤å³¹·J¾ã³sµ²ºô§}®æ¦¡¡C';
-$messages['help_user_posts_link_format'] = '·í¨Ï¥Î¦Û­qºô§}®É¡A¯S©w¨Ï¥ÎªÌµoªíªº¤å³¹³sµ²ºô§}®æ¦¡¡C';
-$messages['help_post_trackbacks_link_format'] = '·í¨Ï¥Î¦Û­qºô§}®É¡A¤Þ¥Î³sµ²ºô§}®æ¦¡¡C';
-$messages['help_template_link_format'] = '·í¨Ï¥Î¦Û­qºô§}®É¡A¦Û­qÀRºA¼Òª©³sµ²ºô§}®æ¦¡¡C';
-$messages['help_album_link_format'] = '·í¨Ï¥Î¦Û­qºô§}®É¡A¸ê®Æ§¨³sµ²ºô§}®æ¦¡¡C';
-$messages['help_resource_link_format'] = '·í¨Ï¥Î¦Û­qºô§}®É¡AÀɮ׳sµ²ºô§}®æ¦¡¡C';
-$messages['help_resource_preview_link_format'] = '·í¨Ï¥Î¦Û­qºô§}®É¡AÀÉ®×¹wÄý³sµ²ºô§}®æ¦¡¡C';
-$messages['help_resource_medium_size_preview_link_format'] = '·í¨Ï¥Î¦Û­qºô§}®É¡A¤¤«¬ÀÉ®×¹wÄý³sµ²ºô§}®æ¦¡¡C';
-$messages['help_resource_download_link_format'] = '·í¨Ï¥Î¦Û­qºô§}®É¡AÀɮפU¸ü³sµ²ºô§}®æ¦¡¡C';
-// email
-$messages['help_check_email_address_validity'] = '¦b¨Ï¥ÎªÌµù¥U¥Ó½Ð·sªººô»x¯¸¥x®É¡A¬O§_­n»{ÃÒ¥L©Ò¶ñ¼gªº¹q¤l¶l¥ó«H½c¬O§_¥¿½T¡C';
-$messages['help_email_service_enabled'] = '¨Ï¥Î©Î°±¥Î¥Î¨Ó±H°e³qª¾«H¨çªº¹q¤l¶l¥óªA°È¡C';
-$messages['help_post_notification_source_address'] = '¨t²Î³qª¾«H¨çªº±H¥ó¤H¹q¤l¶l¥ó«H½c¡C';
-$messages['help_email_service_type'] = '¥Î¨Ó±H°e¹q¤l¶l¥óªº¤è¦¡¡A½Ð¦b¦UºØ¤èªk¿ï¾Ü¨ä¤¤¤§¤@¡C';
-$messages['help_smtp_host'] = '¦pªG±z¿ï¥ÎSMTP±H°e¹q¤l¶l¥ó¡A½Ð¿é¤J±z­n¥Î¨Óµo°e¶l¥óªº¥D¾÷¡C';
-$messages['help_smtp_port'] = '«e¶µ³]©wªºSMTP¥D¾÷³s±µ°ð¡]port¡^';
-$messages['help_smtp_use_authentication'] = 'SMTP¥D¾÷¬O§_»Ý­n±ÂÅv»{ÃÒ¡C¦pªG»Ý­nªº¸Ü¡A½ÐÄ~Äò¶ñ¼g¤U­±¨â¶µ³]©w¡C';
-$messages['help_smtp_username'] = '¦pªGSMTP¥D¾÷»Ý­n±ÂÅv»{ÃÒ¡A½Ð¶ñ¼g¨Ï¥ÎªÌ±b¸¹¡C';
-$messages['help_smtp_password'] = '¦pªGSMTP¥D¾÷»Ý­n±ÂÅv»{ÃÒ¡A½Ð¶ñ¼g¨Ï¥ÎªÌ±K½X¡C';
-// helpers
-$messages['help_path_to_tar'] = '¡utar¡v«ü¥O©Ò¦b¥Ø¿ý¡C(¥Î¨Ó¸ÑÀ£ÁY¨Ï¥Î .tar.gz ©Î .tar.gz2®æ¦¡À£ÁYªº¼Òª©¥])';
-$messages['help_path_to_gzip'] = '¡ugzip¡v«ü¥O©Ò¦b¥Ø¿ý¡C(¥Î¨Ó¸ÑÀ£ÁY¨Ï¥Î .tar.gz ®æ¦¡À£ÁYªº¼Òª©¥])';
-$messages['help_path_to_bz2'] = '¡ubzip2¡v«ü¥O©Ò¦b¥Ø¿ý¡C(¥Î¨Ó¸ÑÀ£ÁY¨Ï¥Î .tar.gz2®æ¦¡À£ÁYªº¼Òª©¥])';
-$messages['help_path_to_unzip'] = '¡uunzip¡v«ü¥O©Ò¦b¥Ø¿ý¡C(¥Î¨Ó¸ÑÀ£ÁY¨Ï¥Î .zip®æ¦¡À£ÁYªº¼Òª©¥])';
-$messages['help_unzip_use_native_version'] = '¨Ï¥ÎPHP¤º«Øªºª©¥»¨Ó¸ÑÀ£ÁY .zip ªºÀÉ®×';
-// uploads
-$messages['help_uploads_enabled'] = '±Ò¥Î©Î°±¥Î¤W¶ÇÀÉ®×¥\¯à¡C³o­Ó¥\¯à·|¼vÅT¨ì¨Ï¥ÎªÌ¯à§_¤W¶Ç·sªº¼Òª©¦w¸Ë¥]¡A¥H¤Î¦b¼Òª©¤¤²K¥[·sªºÀɮסC';
-$messages['help_maximum_file_upload_size'] = '¨Ï¥ÎªÌ¤W¶ÇÀɮפj¤pªº¤W­­¡C';
-$messages['help_upload_forbidden_files'] = '¸T¤î¨Ï¥ÎªÌ¤W¶ÇªºÀÉ®×Ãþ«¬¡C¦pªG¦³¦h­Ó¤£¦PªºÀÉ®×Ãþ«¬¡A½Ð¦b¤£¦PªºÃþ«¬¶¡¥ÎªÅ¥Õ°Ï¹j¡C¤]¥i¨Ï¥Î\'*\' and \'?\'ªº¤è¦¡¡C';
-// interfaces
-$messages['help_xmlrpc_api_enabled'] = '±Ò¥Î©Î°±¥ÎXMLRPC¤¶­±¡CXMLRPC¤¶­±ªº¥Î³~¬O¥i¥HÅý±z¨Ï¥Î®à­±ºô»x¼g§@¤u¨ã¥Xª©ºô»x¤å³¹¡C';
-$messages['help_rdf_enabled'] = '±Ò¥Î©Î°±¥Î²£¥ÍRSS·s»D¥æ´«ÀÉ®×¥\¯à¡C';
-$messages['help_default_rss_profile'] = '¹w³]ªºRSS/RDF·s»D¥æ´«®æ¦¡';
-// security
-$messages['help_security_pipeline_enabled'] = '±Ò¥Î¨t²Î¦w¥þ¥\¯à¡C¦pªG±zÃö³¬¤F³o­Ó¿ï¶µ¡A¨º»ò©Ò¦³ªº¨t²Î¦w¥þ¥\¯à³£·|°±¥Î¡A¦pªG±z·Q­nÃö³¬¤@¨Ç¨t²Î¦w¥þ¥\¯à¡A«Øij±z±N³o­Ó³]©w³]¬°¶}±Ò¡AµM«á¦b¥H¤Uªº¿ï¶µ¤¤¡A³v¤@°±¥Î§Ú­Ì¤£»Ý­nªº¨t²Î¦w¥þ¥\¯à¶µ¥Ø¡C';
-$messages['help_ip_address_filter_enabled'] = '±Ò¥ÎIP¦ì¸m¹LÂo¡C±z¥i¥H¥Î³o­Ó¥\¯àªý¾×¬Y¨Ç¥D¾÷ÂsÄý¥»¯¸¡C';
-$messages['help_content_filter_enabled'] = '¨Ï¥Î¥H¥¿³Wªí¥Ü¦¡¬°°ò¦ªºÂ²³æ¤º®e¹LÂo¾÷¨î¡A¥Î²³æªºÃöÁä¦r¹LÂo¤£·í¤º®e¡C¤£¹L«Øij±z¡A±Ä¥Î¨©¤ó¹LÂo·|¬O¤ñ¸û¦nªº¤è®×¡C';
-$messages['help_maximum_comment_size'] = '°jÅT¯d¨¥ªº¤º¤å¦r¤¸¼Æ¤W­­¡C';
-// bayesian filter
-$messages['help_bayesian_filter_enabled'] = '±Ò¥Î©Î°±¥Î¨©¤ó¹LÂo¾÷¨î¡C';
-$messages['help_bayesian_filter_spam_probability_treshold'] = '³Q»{©w¬°¬O©U§£°jÅT¯d¨¥ªº¼Æ­È¤U­­¡C³]©w½d³ò¦b0.01¨ì0.99¤§¶¡¡C';
-$messages['help_bayesian_filter_nonspam_probability_treshold'] = '³]©w°jÅT¯d¨¥¬O¥¿±`¯d¨¥ªº¼Æ­È¤W­­¡C¥ô¦ó²Å¦X¦b«e¤@³]©w»P¥»³]©w¤§¶¡¼Æ­Èªº¯d¨¥°jÅT¡A³£·|³Q»{©w¬O¥¿±`¦Ó«D©U§£¯d¨¥¡C';
-$messages['help_bayesian_filter_min_length_token'] = '¦b¦h¤Ö¦r¤¸¼Æ¥H¤W¤~·|±Ò°Ê¨©¤ó¹LÂo¾÷¨î¡C';
-$messages['help_bayesian_filter_max_length_token'] = '¨©¤ó¹LÂo¾÷¨î¥i¥H³B²zªº³Ì¦h¦r¤¸¼Æ¤W­­¡C';
-$messages['help_bayesian_filter_number_significant_tokens'] = '¦b°T®§¤¤¥²¶·­n¦³¦h¤ÖÅãµÛ¦³·N¸qªº¤å¦r¡C';
-$messages['help_bayesian_filter_spam_comments_action'] = '³B²z©U§£¯d¨¥ªº¤èªk¡C±z¥i¥Hª½±µ²M²z³o¨Ç©U§£¯d¨¥¡]¤£·|¦s¶i¸ê®Æ®w¤¤¡^¡A©Î¬O«O¦s³o¨Ç©U§£¯d¨¥¡A¦ý¬O¥[¤W©U§£¯d¨¥¼Ð¥Ü¼Ð¥Ü¡C«Øij·í±zªº¹LÂo¾÷¨î¦bÁÙ¨S¦³§´µ½«Ø¥ßªý¾×³W«h®É¡A¥ý¥Î«áªÌ¡C';
-$messages['keep_spam_comments'] = '«O¦s©U§£°jÅT';
-$messages['throw_away_spam_comments'] = '²M²z©U§£°jÅT';
-// resources
-$messages['help_resources_enabled'] = '±Ò¥Î©ÎÃö³¬Àɮפ¤¤ß¥\¯à¡C';
-$messages['help_resources_folder'] = '¥Î¨Ó¦s©ñÀɮפ¤¤ßªº¥Ø¿ý¡C³o­Ó¥Ø¿ý¤£¤@©w­n¦bºô­¶¥Ø¿ý¤U¡C¦pªG±z¤£§Æ±æ§O¤Hª½±µÂsÄý±zªºÀɮץؿý¡A±z¥i¥H§â³o­Ó¥Ø¿ý³]©w¨ì¨ä¥L¦a¤è¡C';
-$messages['help_thumbnail_method'] = '±z¥Î¨Ó²£¥ÍÁY¹Ïªº«áºÝ¨t²Î¡C¦pªG¨Ï¥ÎPHP¡AGDªº¤ä´©¬O¥²¶·ªº¡C';
-$messages['help_path_to_convert'] = '¥Î¨Ó²£¥ÍÁY¹Ïªº¨t²Î¤u¨ã¸ô®|¡C¦pªG±z­n¨Ï¥ÎImageMagick¡A¨º»ò±z¥²¶·±µµÛ¶ñ¼gImageMagickªº¤u¨ãµ{¦¡¸ô®|¡C';
-$messages['help_thumbnail_format'] = '¦b²£¥Í¹wÄýÁY¹Ï®É©Ò¨Ï¥Îªº¹w³]®æ¦¡¡C¦pªG±z¿ï¾Ü¡u»P­ì©l¼v¹³¬Û¦P¡v¡A¨º»ò¹wÄýÁY¹Ï´N·|Àx¦s¦¨»P­ì©l¼v¹³¬Û¦Pªº®æ¦¡¡C';
-$messages['help_thumbnail_height'] = 'ÁY¹Ï¹w³]°ª«×¡C';
-$messages['help_thumbnail_width'] = 'ÁY¹Ï¹w³]¼e«×¡C';
-$messages['help_medium_size_thumbnail_height'] = '¤¤«¬ÁY¹Ï¹w³]°ª«×';
-$messages['help_medium_size_thumbnail_width'] = '¤¤«¬ÁY¹Ï¹w³]¼e«×';
-$messages['help_thumbnails_keep_aspect_ratio'] = 'ÁY¹Ï¬O§_«O«ù­ì©l¤ñ¨Ò¡C';
-$messages['help_thumbnail_generator_force_use_gd1'] = '¬O§_±j­¢pLog¨Ï¥ÎGD1¨ç¼Æ¨Ó²£¥ÍÁY¹Ï';
-$messages['help_thumbnail_generator_user_smoothing_algorithm'] = '¬O§_¨Ï¥Îºtºâªk¨Ó¨ÏÁY¹Ïµe­±§ó¥­¶¶¡C¥u¦³·íÁY¹Ï²£¥Í¤u¨ã¬OGD®É¤~¾A¥Î¡C';
-$messages['help_resources_quota'] = '¥þ°ìÀÉ®×®e¶q­­ÃB';
-$messages['help_resource_server_http_cache_enabled'] = '·íHTTP½Ð¨DÀÉÀY¬°"If-Modified-Since"±Ò¥Î§Ö¨ú¤ä´©¡C±Ò¥Î¦¹¥\¯à¨Ó¸`¬Ùºô¸ôÀW¼e¡C';
-$messages['help_resource_server_http_cache_lifetime'] = '«È¤áºÝ¥i¥H¨Ï¥Î§Ö¨úÀɮתº®É¶¡(³æ¦ì¡G¤d¤À¤§¤@¬í)';
-$messages['same_as_image'] = '»P­ì©l¼v¹³¬Û¦P';
-// search
-$messages['help_search_engine_enabled'] = '±Ò¥Î©Î°±¥Î·j´M¤ÞÀº';
-$messages['help_search_in_custom_fields'] = '·j´M¥]§t¦Û­qÄæ¦ì';
-$messages['help_search_in_comments'] = '·j´M¥]§t°jÅT';
-
-// cleanup
-$messages['purge'] = '²M°£';
-$messages['cleanup_spam'] = '²M°£©U§£°jÅT';
-$messages['cleanup_spam_help'] = '³o·|²M°£©Ò¦³³Q¨Ï¥ÎªÌ¼Ð¥Ü¬°©U§£ªº°jÅT¡C³Q²M°£ªº©U§£°jÅT±NµLªk¦^´_¡C';
-$messages['spam_comments_purged_ok'] = '©U§£°jÅT¤w¶¶§Q²M°£';
-$messages['cleanup_posts'] = '²M°£¤å³¹';
-$messages['cleanup_posts_help'] = '³o·|²M°£©Ò¦³³Q¨Ï¥ÎªÌ¼Ð¥Ü¬°§R°£ªº¤å³¹¡C ³Q²M°£ªº¤å³¹±NµLªk¦^´_¡C';
-$messages['posts_purged_ok'] = '¤å³¹¤w¶¶§Q²M°£';
-
-/// summary ///
-// front page
-$messages['summary'] = 'ºK­n';
-$messages['register'] = 'µù¥U';
-$messages['summary_welcome'] = 'Åwªï!';
-$messages['summary_most_active_blogs'] = '³Ì¬¡ÅDºô»x';
-$messages['summary_most_commented_articles'] = '³Ì¦h°jÅT¤å³¹';
-$messages['summary_most_read_articles'] = '³Ì¦h¤H¾\Ū¤å³¹';
-$messages['password_forgotten'] = '§Ñ°O±K½X?';
-$messages['summary_newest_blogs'] = '³Ì·s«Ø¥ßªººô»x';
-$messages['summary_latest_posts'] = '³Ì·sµoªíªº¤å³¹';
-$messages['summary_search_blogs'] = '·j´Mºô»x';
-
-// blog list
-$messages['updated'] = '§ó·s';
-$messages['total_reads'] = 'ÂsÄýÁ`¦¸¼Æ';
-
-// blog profile
-$messages['blog'] = 'ºô»x';
-$messages['latest_posts'] = '³Ì·sµoªíªº¤å³¹';
-
-// registration
-$messages['register_step0_title'] = 'ªA°È±ø´Ú';
-$messages['agreement'] = '¦P·N±ø´Ú';
-$messages['decline'] = '¤£±µ¨ü';
-$messages['accept'] = '±µ¨ü';
-$messages['read_service_agreement'] = '½Ð¸Ô²Ó¾\ŪªA°È±ø´Ú¡A¦pªG§A¦P·N¥H¤W±ø´Ú½Ð«ö¤U±µ¨üÁä¡C';
-$messages['register_step1_title'] = '«Ø¥ß¨Ï¥ÎªÌ [1/4]';
-$messages['register_step1_help'] = '­º¥ý§A¥²¶·¥ý«Ø¥ß¤@­Ó¨Ï¥ÎªÌ±b¸¹¨Ó¨ú±o¤@­Óºô»x¡A³o­Ó¨Ï¥ÎªÌ¾Ö¦³¸Óºô»x¡A¦P®É¥i¥H¶i¦æ©Ò¦³ºô»x³]©w¥\¯à¡C';
-$messages['register_next'] = '¤U¤@¨B';
-$messages['register_back'] = '¤W¤@¨B';
-$messages['register_step2_title'] = '«Ø¥ßºô»x [2/4]';
-$messages['register_blog_name_help'] = 'À°§Aªººô»x¨ú­Ó¦WºÙ';
-$messages['register_step3_title'] = '¿ï¾Ü¤@­Ó¼Òª©[3/4]';
-$messages['step1'] = '¨BÆJ 1';
-$messages['step2'] = '¨BÆJ 2';
-$messages['step3'] = '¨BÆJ 3';
-$messages['register_step3_help'] = '½Ð¿ï¾Ü¤@­Ó¼Òª©°µ¬°ºô»xªº¹w³]¼Òª©¡C¥u­n§A¤£³ßÅw¡A§A¥i¥HÀH®É§â¥¦´«±¼¡C';
-$messages['error_must_choose_template'] = '½Ð¿ï¾Ü¤@­Ó¼Òª©';
-$messages['select_template'] = '¿ï¨ú¼Òª©';
-$messages['register_step5_title'] = '®¥³ß§A! [4/4]';
-$messages['finish'] = 'µù¥U§¹¦¨';
-$messages['register_need_confirmation'] = '¤@«Ê¥]§tµù¥U[½T»{°T®§³sµ²]ªº¹q¤l¶l¥ó¤w¸g±H¨ì§Aªº¹q¤l«H½c¤¤¡C½ÐºÉ§ÖÂI¿ï¸Ó³sµ²¨Ó¶}©l§Aªºblogging¥Í¬¡¡I';
-$messages['register_step5_help'] = '®¥³ß§A¡A·sªº¨Ï¥ÎªÌ±b¸¹¤Îºô»x¤w¸g¶¶§Q«Ø¥ß¡I';
-$messages['register_blog_link'] = '¦pªG§A­n¬Ý¤@¬Ý§Aªº·sºô»x¡A§A²{¦b¥i¥H¨ì<a href="%2$s">%1$s</a>³o¸Ì¬Ý¤@¬Ý¡C';
-$messages['register_blog_admin_link'] = '¦pªG§A·Q­n¥ß¨è¶}©lµoªí¤å³¹¡A½ÐÂI¿ï³sµ²¨ì <a href="admin.php">ºÞ²z¤¶­±</a>';
-$messages['register_error'] = '¹Lµ{¤¤¦³¿ù»~µo¥Í¡I';
-$messages['error_registration_disabled'] = '«Ü©êºp¡Aºô¯¸ºÞ²zªÌ°±¥Îµù¥U·sºô»xªº¥\¯à¡C';
-// registration article topic and text
-$messages['register_default_article_topic'] = '®¥³ß¡I';
-$messages['register_default_article_text'] = '¦pªG§A¥i¥H¬Ý¨ì³o½g¤å³¹¡Aªí¥Üµù¥U¹Lµ{¤w¸g¶¶§Q§¹¦¨¡C²{¦b§A¥i¥H¶}©lblogging¤F¡I';
-$messages['register_default_category'] = '¤@¯ë';
-// confirmation email
-$messages['register_confirmation_email_text'] = '½ÐÂI¿ï¤U­±ªº³sµ²¨Ó±Ò¥Î§Aªººô»x¡G:
-
-%s
-
-¯¬§A¦³­Ó¬ü¦nªº¤@¤Ñ¡I';
-$messages['error_invalid_activation_code'] = '«Ü©êºp¡A½T»{½X¤£¥¿½T¡I';
-$messages['blog_activated_ok'] = '®¥³ß¡A§Aªº¨Ï¥ÎªÌ±b¸¹©Mºô»x¤w¸g¶¶§Q±Ò¥Î¤F¡I';
-// forgot your password?
-$messages['reset_password'] = '­«³]±K½X';
-$messages['reset_password_username_help'] = '§A­n­«³]¨º­Ó¨Ï¥ÎªÌªº±K½X¡H';
-$messages['reset_password_email_help'] = '¨Ï¥ÎªÌ¥Î¨Óµù¥Uªº¹q¤l¶l¥ó¦ì§}';
-$messages['reset_password_help'] = '¨Ï¥Î¤U¤èªºªí³æ¨Ó­«³]±K½X¡C½Ð¿é¤J¨Ï¥ÎªÌ¦WºÙ¤Îµù¥U®É¨Ï¥Îªº¹q¤l¶l¥ó¦ì§}¡C';
-$messages['error_resetting_password'] = '­«³]±K½X®Éµo¥Í¿ù»~¡C½ÐÀˬd¿é¤Jªº¸ê®Æ¦A­«¸Õ¤@¦¸¡C';
-$messages['reset_password_error_incorrect_email_address'] = '¹q¤l¶l¥ó¦ì§}¿ù»~©ÎµÛ³o¤£¬O§Aµù¥U®É¨Ï¥Îªº¹q¤l¶l¥ó¡C';
-$messages['password_reset_message_sent_ok'] = '¤@«Ê¦³µÛ­«³]±K½X³sµ²ªº¹q¤l¶l¥ó¤w¸g°e¨ì§Aªº¹q¤l¶l¥ó«H½c¡A½ÐÂI¿ï¸Ó³sµ²¨Ó­«³]±K½X¡C';
-$messages['error_incorrect_request'] = 'ºô§}¤¤ªº°Ñ¼Æ¤£¥¿½T¡C';
-$messages['change_password'] = '­«³]±K½X';
-$messages['change_password_help'] = '½Ð¿é¤J·s±K½X¤Î½T»{±K½X';
-$messages['new_password'] = '·s±K½X';
-$messages['new_password_help'] = '¦b³o¸Ì¿é¤J·s±K½X';
-$messages['password_updated_ok'] = '§Aªº±K½X¤w¸g¶¶§Q§ó·s';
-
-// Suggested by BCSE, some useful messages that not available in official locale
-$messages['upgrade_information'] = '±z©Ò¨Ï¥ÎªºÂsÄý¾¹¥¼²Å¦Xºô­¶³]­p¼Ð·Ç¡A¦]¦¹¥»ºô­¶±N¥H¯Â¤å¦r¼Ò¦¡Åã¥Ü¡C¦p±ý¥H³Ì¨Îªº±Æª©¤è¦¡ÂsÄý¥»¯¸¡A½Ð¦Ò¼{<a href="http://www.webstandards.org/upgrade/" title="The Web Standards Project\'s Browser Upgrade initiative">¤É¯Å</a>±zªºÂsÄý¾¹¡C';
-$messages['jump_to_navigation'] = '²¾°Ê¨ì¾ÉÄý¦C¡C';
-$messages['comment_email_never_display'] = '¨t²Î·|¦Û°Ê¬°§A³]©w¤À¦æ¡A¥B¤£·|Åã¥Ü§A¯d¤Uªº¶l¥ó¦a§}¡C';
-$messages['comment_html_allowed'] = '¥i¨Ï¥Î¤§ <acronym title="Hypertext Markup Language">HTML</acronym> ¼ÐÅÒ¦p¤U¡G&lt;<acronym title="¥Î³~¡G¶W³sµ²">a</acronym> href=&quot;&quot; title=&quot;&quot; rel=&quot;&quot;&gt; &lt;<acronym title="¥Î³~¡GÀY¦r»y¼Ðµù">acronym</acronym> title=&quot;&quot;&gt; &lt;<acronym title="¥Î³~¡G¤Þ¥Î¤å¦r">blockquote</acronym> cite=&quot;&quot;&gt; &lt;<acronym title="¥Î³~¡G§R°£½u">del</acronym>&gt; &lt;<acronym title="¥Î³~¡G±×Åé">em</acronym>&gt; &lt;<acronym title="¥Î³~¡G©³½u">ins</acronym>&gt; &lt;<acronym title="¥Î³~¡G²ÊÅé">strong</acronym>&gt;';
-$messages['trackback_uri'] = '³o½g¤å³¹ªº¤Þ¥Î³sµ²ºô§}¡G';
-$messages['previous_post'] = '¤W¤@½g';
-$messages['next_post'] = '¤U¤@½g';
-$messages['comment_default_title'] = '(µL¼ÐÃD)';
-$messages['guestbook'] = '¯d¨¥ªO';
-$messages['trackbacks'] = '¤Þ¥Î';
-$messages['menu'] = '¥D¿ï³æ';
-$messages['albums'] = '¸ê®Æ§¨';
-$messages['admin'] = 'ºÞ²z¤¶­±';
-?>
\ No newline at end of file

Copied: plog/trunk/locale/unsupport/locale_zh_TW_big5.php (from rev 2126, plog/branches/plog-1.0.1/locale/unsupport/locale_zh_TW_big5.php)

Copied: plog/trunk/release/logging.properties.php.dist (from rev 2126, plog/branches/plog-1.0.1/release/logging.properties.php.dist)


Property changes on: plog/trunk/release/logging.properties.php.dist
___________________________________________________________________
Name: svn:executable
   + *

Modified: plog/trunk/resserver.php
===================================================================
--- plog/trunk/resserver.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/resserver.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -9,6 +9,8 @@
     if (!defined( "PLOG_CLASS_PATH" )) {
         define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
     }
+    
+    include_once( PLOG_CLASS_PATH."class/config/config.class.php" );
 
 	// the functionality of the old ressever.php file have been moved
 	// to the action ResourceServerAction and ResourceServerView for better
@@ -17,5 +19,8 @@
 	// generated internally that point to resources so please DO NOT REMOVE IT!
 	$_REQUEST["op"] = "ResourceServer";
 	
-	include_once( PLOG_CLASS_PATH."index.php" );
+	$config =& Config::getConfig();
+	$indexPage = $config->getValue( "script_name", "index.php" );
+	
+	include_once( PLOG_CLASS_PATH.$indexPage );
 ?>
\ No newline at end of file

Copied: plog/trunk/styles/admin-ff.css (from rev 2126, plog/branches/plog-1.0.1/styles/admin-ff.css)

Modified: plog/trunk/styles/admin.css
===================================================================
--- plog/trunk/styles/admin.css	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/styles/admin.css	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,862 +1,886 @@
-/* -------------------------------------------------------------- */
-/* Common stuff and basic page layout                             */
-/* -------------------------------------------------------------- */
-html, body
-{
-    margin           : 0px;
-    padding          : 0px;
-    text-align       : center;
-    font             : 12px verdana, tahoma, arial, sans-serif;
-    background       : #EEEEEE url("../imgs/bg_main.jpg") repeat-y center;
-}
-
-#container
-{
-    width            : 786px;
-    text-align       : left;
-    margin-left      : auto;
-    margin-right     : auto;
-}
-
-#header
-{
-    height           : 60px;
-    width            : 100%;
-    background       : #FFFFFF url("../imgs/top_admin.jpg") no-repeat right;
-    padding          : 0px;
-    margin           : 0px;
-}
-
-#header span
-{
-    display          : none;
-}
-
-#header h1
-{
-    margin           : 0;
-}
-
-#content
-{
-    position         : relative;
-    width            : 100%;
-    display          : block;
-    margin           : 0;
-    padding          : 0;
-}
-
-#dashboard
-{
-    padding-left     : 1em;
-    padding-right    : 1em;
-}
-
-.clr
-{
-    clear            : both;
-}
-
-/*-- Accessibility Tweaks --*/
-#skipNav
-{
-    position         : absolute;
-    left             : -9999px;
-    font-size        : small;
-}
-
-#skipNav a:focus
-{
-    display          : block;
-    position         : absolute;
-    top              : 20px;
-    left             : 10020px;
-    font-size        : large;
-    background       : #fff;
-    border           : solid 2px #1B6BD8;
-    padding          : 10px;
-    width            : 15em;
-    z-index          : 1;
-}
-
-#skipNav a:hover
-{
-    color            : #029EDE;
-}
-
-#skipNav a:active
-{
-    display          : block;
-    position         : absolute;
-    top              : 20px;
-    left             : 10020px;
-    font-size        : large;
-    background       : #fff;
-    border           : solid 2px #1B6BD8;
-    padding          : 10px;
-    width            : 15em;
-    z-index          : 1;
-}
-
-.hide
-{
-    display          : none;
-}
-
-/* -------------------------------------------------------------- */
-/* Navigation/menu bar                                            */
-/* -------------------------------------------------------------- */
-
-#menubar
-{
-    margin-bottom    : 10px;
-    background       : #FFFFFF url("../imgs/bg_menu.jpg") repeat-x;
-    height           : 20px;
-    /*border-bottom    : 1px solid #B4B4B4;*/
-}
-
-#menu
-{
-    padding-top      : 1px;
-    padding-bottom   : 1px;
-}
-
-#menu ul
-{
-    padding         : .2em 0;
-    margin          : 0;
-    list-style-type : none;
-    color           : #FFF;
-    width           : 100%;
-    text-align      : center;
-}
-
-#menu li
-{
-
-    position         : relative;
-    padding          : 0;
-    border-left      : 0px solid #B4B4B4;
-    display          : inline;
-    font-weight      : bold;
-    font-family      : verdana, tahoma, sans-serif;
-    font-size        : 0.83em;
-    letter-spacing   : 0.20em;
-    text-transform   : uppercase;
-}
-
-#menu a, #menu a:link, #menu a:visited
-{
-    padding          : .2em 1em;
-    color            : #0E3862;
-    text-decoration  : none;
-}
-
-#menu a:hover
-{
-    background       : #818181;
-    color            : #FFFFFF;
-}
-
-#menu li.selected
-{
-    display          : block;
-    width            : auto;
-    padding          : 2px 7px;
-    background       : #FFFFFF;
-    color            : #000000;
-    border-bottom    : 1px solid #FFFFFF;
-}
-
-#menu br
-{
-    clear: both;
-}
-
-/* -------------------------------------------------------------- */
-/* Section title and navigation history bar                       */
-/* -------------------------------------------------------------- */
-
-#nav_bar
-{
-    margin-left      : auto;
-    margin-right     : auto;
-    width            : 100%;
-    margin-bottom    : 15px;
-    border-bottom    : 1px dotted #DEDEDE;
-}
-
-#section_title
-{
-    float            : left;
-    width            : 39%;
-}
-
-#section_title h2
-{
-    color            : #588BCA;
-    font-weight      : bold;
-    font-family      : trebuchet ms, tahoma, sans-serif;
-    font-size        : 1.5em;
-    letter-spacing   : 0.08em;
-    margin           : 0;
-    padding-left     : 4px;
-}
-
-#navigation
-{
-    float            : right;
-    width            : 60%;
-    text-align       : right;
-    padding-top      : 7px;
-    font-family      : verdana, tahoma, sans-serif;
-    font-size        : 0.85em;
-    letter-spacing   : 0.09em;
-    padding-right    : 2px;
-}
-
-#navigation a
-{
-    color            : #000000;
-    text-decoration  : none;
-}
-
-#navigation a:hover
-{
-    color            : #5583BE;
-    text-decoration  : none;
-}
-
-/* -------------------------------------------------------------- */
-/* Admin Tabbed Ul's                                              */
-/* -------------------------------------------------------------- */
-
-#tablist
-{
-    padding          : 3px 0;
-    margin-left      : 0;
-    font             : 11px trebuchet ms, verdana, tahoma, arial, sans-serif;
-    border-bottom    : 1px solid #DEDEDE;
-}
-
-#tablist li
-{
-    list-style       : none;
-    margin           : 0;
-    display          : inline;
-}
-
-#tablist li a
-{
-    padding          : 3px 0.5em;
-    margin-left      : 3px;
-    border           : 1px solid #DEDEDE;
-    background       : #F4F4FF;
-    text-decoration  : none;
-}
-
-#tablist li a:link
-{
-    color            : #448;
-}
-
-#tablist li a:visited
-{
-    color            : #667;
-}
-
-#tablist li a:hover
-{
-    color            : #000;
-    background       : #F2F0FE;
-    border-color     : #DEDEDE;
-}
-
-#tablist li a#tab_current
-{
-    background       : white;
-    border-bottom    : 1px solid white;
-}
-
-.menuTop_level1 ul, li
-{
-    list-decoration: none;
-}
-
-.menuTop_level1 ul
-{
-  list-style-type: disc;
-  list-style-image: url(../imgs/bullet.gif);
-}
-
-
-/* -------------------------------------------------------------- */
-/* Form controls (input, ...)                                     */
-/* -------------------------------------------------------------- */
-
-form
-{
-    margin           : 0px;
-}
-
-fieldset
-{
-    border           : 1px solid #DEDEDE;
-    color            : #000000;
-    font-family      : verdana, tahoma, sans-serif;
-    font-size        : 0.90em;
-    padding-bottom   : 0px;
-    margin           : 0px;
-}
-
-textarea, input, select
-{
-    background       : #FFFFFF;
-    border           : 1px solid #b2b2b2;
-    color            : #000000;
-    font-family      : verdana, tahoma, sans-serif;
-    font-size        : 0.95em;
-}
-
-input:focus, textarea:focus, label:focus
-{
-    border           : 1px solid #5583BE;
-}
-
-.checkbox, .radio
-{
-    border           : 0px;
-}
-
-.submit
-{
-    /*margin-left      : 4px;*/
-}
-
-.list_action_button a img
-{
-    border           : 0px;
-    padding          : 0px;
-}
-
-.list_action_button a:hover img
-{
-    filter            : alpha(opacity=60);
-    -moz-opacity      : 0.6;
-}
-
-.field
-{
-    top              : 0;
-    left             : 0;
-    margin           : 0 1em 1em 0;
-}
-
-.field .field
-{
-    margin           : 1em 0 0 0;
-}
-
-.field label
-{
-    font-size        : 100%;
-    font-weight      : bold;
-}
-
-.field_checkbox
-{
-    top              : 0;
-    left             : 0;
-}
-
-.field_checkbox label
-{
-    font-size        : 100%;
-}
-
-.formHelp
-{
-    font-size        : 90%;
-    color            : #76797c;
-    margin           : 0 0 0.2em 0;
-}
-
-.formHelp a
-{
-    text-decoration  : underline;
-}
-
-.formHelp:hover
-{
-    color            : Black;
-    cursor           : default;
-}
-
-fieldset
-{
-    border           : 1px solid #8cacbb;
-    margin           : 1em 0em 1em 0em;
-    padding          : 0em 1em 1em 1em;
-    line-height      : 1.5em;
-    width            : auto;
-}
-
-.inputField
-{
-    width: 85%;
-    margin-left: auto;
-    margin-right: auto;
-    background-color: #FCFCFF;
-    border: 1px solid #DEDEDE;
-}
-
-.buttons
-{
-    width: 88%;
-    margin-left: auto;
-    margin-right: auto;
-    text-align: right;
-}
-
-.inputField input
-{
-    width:100%;
-}
-
-.inputField legend
-{
-    font-weight: bold;
-}
-
-.inputField .dateTime
-{
-   width: 80%;
-}
-
-.inputField .checkbox, .inputField .button, .inputField .radio
-{
-   width: auto;
-}
-
-.inputField .file
-{
-   width: auto;
-}
-
-.pager
-{
-    float:left;
-}
-
-/* -------------------------------------------------------------- */
-/* Data lists parameters & search bar                             */
-/* -------------------------------------------------------------- */
-
-#list_nav_bar
-{
-    margin-left      : auto;
-    margin-right     : auto;
-    width            : 98%;
-    background-color : #F3F1FF;
-    padding-bottom   : 4px;
-    padding-left     : 4px;
-    padding-right    : 4px;
-    margin-bottom    : 10px;
-    border           : 0px solid #DEDEDE;
-}
-
-#list_nav_bar fieldset
-{
-    border           : 1px solid #DEDEDE;
-    color            : #000000;
-    font-family      : verdana, tahoma, sans-serif;
-    font-size        : 0.90em;
-    padding          : 0px;
-    margin           : 0px;
-    height           : 60px;
-}
-
-#list_nav_select
-{
-    float            : left;
-    width            : 100%;
-    text-align       : center;
-}
-
-#list_nav_search
-{
-    float            : left;
-    width            : 30%;
-    text-align       : center;
-}
-
-.list_nav_option
-{
-    float            : left;
-    text-align       : left;
-    padding          : 0px 4px 4px 4px;
-    margin-left      : 5px;
-}
-
-#list_nav_bar legend
-{
-    font-family      : trebuchet ms, tahoma, sans-serif;
-    font-size        : 1.1em;
-    font-weight      : bold;
-    letter-spacing   : 0.08em;
-}
-
-#list_nav_select label
-{
-}
-
-/* -------------------------------------------------------------- */
-/* Data lists table format                                        */
-/* -------------------------------------------------------------- */
-
-.info
-{
-    margin-left      : auto;
-    margin-right     : auto;
-    margin-bottom    : 10px;
-    width            : 775px;
-    border-collapse  : collapse;
-    border-bottom    : 4px solid #DEDEDE;
-    border-spacing   : 0px;
-}
-
-.info th
-{
-    font-family      : trebuchet ms, tahoma, sans-serif;
-    font-size        : 1.1em;
-    font-weight      : bold;
-    letter-spacing   : 0.08em;
-    vertical-align   : bottom;
-    border-bottom    : 1px solid #DEDEDE;
-    padding          : 4px;
-    text-align       : left;
-}
-
-.info th a
-{
-    color           : #000000;
-    text-decoration : none;
-}
-
-.info th a:hover
-{
-    color           : #5583BE;
-    text-decoration : none;
-}
-
-.even
-{
-    background       : #F7F7F7;
-}
-
-.tableHover
-{
-   background: #EFEFEF;
-}
-
-.info td
-{
-    color            : #888888;
-    border-bottom    : 1px solid #DEDEDE;
-    vertical-align   : middle;
-    padding          : 4px;
-    /*border:1px solid black;*/
-}
-
-.info td a
-{
-    color           : #888888;
-    text-decoration : none;
-}
-
-.info td a img {
-    border: 0px;
-}
-
-.info td a:hover
-{
-    color           : #5583BE;
-    text-decoration : none;
-}
-
-/* -------------------------------------------------------------- */
-/* Specific column format                                         */
-/* -------------------------------------------------------------- */
-
-.col_highlighted
-{
-    font-weight      : bold;
-}
-
-/* -------------------------------------------------------------- */
-/* Data lists bottom actions bar                                  */
-/* -------------------------------------------------------------- */
-
-#list_action_bar
-{
-    margin-left      : auto;
-    margin-right     : auto;
-    width            : 768px;
-    padding          : 4px;
-    text-align       : right;
-    /*background-color : #F3F1FF;*/
-    margin-bottom    : 10px;
-    /*border           : 1px dashed #DEDEDE;*/
-}
-
-
-/* -------------------------------------------------------------- */
-/* Positive or negative feedback messages                         */
-/* -------------------------------------------------------------- */
-
-#list #FormError
-{
-    padding-left: 10px;
-}
-
-#FormError
-{
-    align: left;
-    padding-top: 0px;
-}
-
-#list #FormInfo
-{
-    padding-left: 10px;
-}
-
-#FormInfo
-{
-    align: left;
-    padding-top: 0px;
-}
-
-.InfoIcon
-{
-    float:left;
-    clear:left;
-    margin-top:3px;
-}
-
-.InfoText
-{
-    color:green;
-    padding-left:20px;
-    padding-top:3px;
-}
-
-.ErrorText
-{
-    color:red;
-    padding-left:20px;
-    padding-top:3px;
-}
-
-/**
- * login screen
- */
-.loginBox
-{
-  width: 300px;
-  margin-top: 25px;
-  margin-left: auto;
-  margin-right: auto;
-}
-
-h4, fieldset h4
-{
-    font-family      : trebuchet ms, tahoma, sans-serif;
-    font-size        : 1.1em;
-    font-weight      : bold;
-    letter-spacing   : 0.08em;
-    vertical-align   : bottom;
-    border-bottom    : 1px solid #DEDEDE;
-    padding          : 0px;
-    text-align       : left;
-    text-transform   : capitalize;
-}
-
-.sectionTitle
-{
-    font-size: 1.3em;
-}
-
-.welcomeMessage {
-  margin-bottom: 10px;
-}
-
-.pager
-{
-float:left;
-}
-
-/**
- * styles for the 'manage' page and similar.
- */
-#content .menuTop
-{
-    list-style-type : none;
-    padding-left: 45px;
-    padding-right: 45px;
-    margin: 0px;
-}
-
-#content .menuTop ul
-{
- padding: 0px;
- margin: 0px;
-}
-
-#content .menuTop .Level_1
-{
-    font-family      : trebuchet ms, tahoma, sans-serif;
-    font-size        : 1.0em;
-    font-weight      : bold;
-    letter-spacing   : 0.08em;
-    border-bottom    : 1px solid #DEDEDE;
-    padding-top      : 10px;
-    text-align       : left;
-}
-
-#content .menuTop .Level_0
-{
-    padding-left: 10px;
-    font-weight      : normal;
-}
-
-#content .menuTop .Level_0 a
-{
-    color           : #888888;
-    text-decoration : none;
-}
-
-#content .menuTop .Level_0 a:hover
-{
-    color           : #5583BE;
-    text-decoration : none;
-}
-
-/* -------------------------------------------------------------- */
-/* Dashboard                                                      */
-/* -------------------------------------------------------------- */
-
-#dashboard h2
-{
-    color            : #588BCA;
-    font-weight      : bold;
-    font-family      : verdana, arial, tahoma, sans-serif;
-    font-size        : 1.4em;
-    letter-spacing   : 0.08em;
-    margin           : 0;
-    padding-left     : 4px;
-}
-
-#dashboard h2 a
-{
-    color            : #32609B;
-    font-weight      : bold;
-    font-family      : verdana, arial, tahoma, sans-serif;
-    margin           : 0;
-    padding-left     : 4px;
-    text-decoration  : none;
-}
-
-#dashboard h2 a:hover
-{
-    text-decoration  : underline;
-}
-
-#dashboard h3
-{
-    color            : #588BCA;
-    font-weight      : bold;
-    font-family      : verdana, arial, tahoma, sans-serif;
-    font-size        : 1.1em;
-    margin           : 0;
-    margin-top       : 12px;
-    margin-bottom    : 4px;
-    padding-left     : 12px;
-}
-
-#dashboard table
-{
-    margin-left     : 12px;
-    width           : 100%;
-}
-
-#dashboard th
-{
-}
-
-#dashboard td
-{
-}
-
-#dashboard a
-{
-    color            : #8A8A8A;
-    text-decoration  : none;
-}
-
-#dashboard
-{
-    color            : #8A8A8A;
-}
-
-#dashboard .dashboard_blog
-{
-    border           : 1px solid #DEDEDE;
-    padding          : 4px;
-    background-color : #FCFCFF;
-    margin-top       : 10px;
-}
-
-#dashboard .dashboard_blog_layout
-{
-    margin           : 0;
-    width            : 100%;
-    background-color : #FFFFFF;
-}
-
-#dashboard .dashboard_blog_layout tr
-{
-}
-
-#dashboard .dashboard_blog_layout td
-{
-}
-
-#dashboard .dashboard_data_table
-{
-    width           : 98%;
-}
-
-#dashboard .dashboard_data_table th
-{
-    border-bottom   : 2px solid #DEDEDE;
-    height          : 20px;
-    text-align      : left;
-}
-
-#dashboard .dashboard_data_table td
-{
-    border-bottom    : 1px solid #DEDEDE;
-    height           : 20px;
-}
-
-#dashboard .dashboard_data_table_statistics
-{
-    width           : 98%;
-}
-
-#dashboard .dashboard_data_table_statistics th, td
-{
-    border-bottom    : 1px solid #DEDEDE;
-    height           : 20px;
-    text-align       : left;
-}
+/* -------------------------------------------------------------- */
+/* Common stuff and basic page layout                             */
+/* -------------------------------------------------------------- */
+html, body
+{
+    margin           : 0px;
+    padding          : 0px;
+    text-align       : center;
+    font             : 12px verdana, tahoma, arial, sans-serif;
+    background       : #EEEEEE url("../imgs/bg_main.jpg") repeat-y center;
+}
+
+#container
+{
+    width            : 786px;
+    text-align       : left;
+    margin-left      : auto;
+    margin-right     : auto;
+}
+
+#header
+{
+    height           : 60px;
+    width            : 100%;
+    background       : #FFFFFF url("../imgs/top_admin.jpg") no-repeat right;
+    padding          : 0px;
+    margin           : 0px;
+}
+
+#header #blogLink
+{
+    float: left;
    width : 783px;
    height: 52px;
+    margin-top: 5px;
}
+
+#header span
+{
+    display          : none;
+}
+
+#header h1
+{
+    margin           : 0;
+}
+
+#content
+{
+    position         : relative;
+    width            : 100%;
+    display          : block;
+    margin           : 0;
+    padding          : 0;
+}
+
+#dashboard
+{
+    padding-left     : 1em;
+    padding-right    : 1em;
+}
+
+.clr
+{
+    clear            : both;
+}
+
+/*-- Accessibility Tweaks --*/
+#skipNav
+{
+    position         : absolute;
+    left             : -9999px;
+    font-size        : small;
+}
+
+#skipNav a:focus
+{
+    display          : block;
+    position         : absolute;
+    top              : 20px;
+    left             : 10020px;
+    font-size        : large;
+    background       : #fff;
+    border           : solid 2px #1B6BD8;
+    padding          : 10px;
+    width            : 15em;
+    z-index          : 1;
+}
+
+#skipNav a:hover
+{
+    color            : #029EDE;
+}
+
+#skipNav a:active
+{
+    display          : block;
+    position         : absolute;
+    top              : 20px;
+    left             : 10020px;
+    font-size        : large;
+    background       : #fff;
+    border           : solid 2px #1B6BD8;
+    padding          : 10px;
+    width            : 15em;
+    z-index          : 1;
+}
+
+.hide
+{
+    display          : none;
+}
+
+/* -------------------------------------------------------------- */
+/* Navigation/menu bar                                            */
+/* -------------------------------------------------------------- */
+
+#menubar
+{
+    margin-bottom    : 10px;
+    background       : #FFFFFF url("../imgs/bg_menu.jpg") repeat-x;
+    height           : 20px;
+    /*border-bottom    : 1px solid #B4B4B4;*/
+}
+
+#menu
+{
+    padding-top      : 1px;
+    padding-bottom   : 1px;
+}
+
+#menu ul
+{
+    padding         : .2em 0;
+    margin          : 0;
+    list-style-type : none;
+    color           : #FFF;
+    width           : 100%;
+    text-align      : center;
+}
+
+#menu li
+{
+
+    position         : relative;
+    padding          : 0;
+    border-left      : 0px solid #B4B4B4;
+    display          : inline;
+    font-weight      : bold;
+    font-family      : verdana, tahoma, sans-serif;
+    font-size        : 0.83em;
+    letter-spacing   : 0.20em;
+    text-transform   : uppercase;
+}
+
+#menu a, #menu a:link, #menu a:visited
+{
+    padding          : .2em 1em;
+    color            : #0E3862;
+    text-decoration  : none;
+}
+
+#menu a:hover
+{
+    background       : #818181;
+    color            : #FFFFFF;
+}
+
+#menu li.selected
+{
+    display          : block;
+    width            : auto;
+    padding          : 2px 7px;
+    background       : #FFFFFF;
+    color            : #000000;
+    border-bottom    : 1px solid #FFFFFF;
+}
+
+#menu br
+{
+    clear: both;
+}
+
+/* -------------------------------------------------------------- */
+/* Section title and navigation history bar                       */
+/* -------------------------------------------------------------- */
+
+#nav_bar
+{
+    margin-left      : auto;
+    margin-right     : auto;
+    width            : 100%;
+    margin-bottom    : 15px;
+    border-bottom    : 1px dotted #DEDEDE;
+}
+
+#section_title
+{
+    float            : left;
+    width            : 39%;
+}
+
+#section_title h2
+{
+    color            : #588BCA;
+    font-weight      : bold;
+    font-family      : trebuchet ms, tahoma, sans-serif;
+    font-size        : 1.5em;
+    letter-spacing   : 0.08em;
+    margin           : 0;
+    padding-left     : 4px;
+}
+
+#navigation
+{
+    float            : right;
+    width            : 60%;
+    text-align       : right;
+    padding-top      : 7px;
+    font-family      : verdana, tahoma, sans-serif;
+    font-size        : 0.85em;
+    letter-spacing   : 0.09em;
+    padding-right    : 2px;
+}
+
+#navigation a
+{
+    color            : #000000;
+    text-decoration  : none;
+}
+
+#navigation a:hover
+{
+    color            : #5583BE;
+    text-decoration  : none;
+}
+
+/* -------------------------------------------------------------- */
+/* Admin Tabbed Ul's                                              */
+/* -------------------------------------------------------------- */
+
+#tablist
+{
+    padding          : 3px 0;
+    margin-left      : 0;
+    font             : 11px trebuchet ms, verdana, tahoma, arial, sans-serif;
+    border-bottom    : 1px solid #DEDEDE;
+}
+
+#tablist li
+{
+    list-style       : none;
+    margin           : 0;
+    display          : inline;
+}
+
+#tablist li a
+{
+    padding          : 3px 0.5em;
+    margin-left      : 3px;
+    border           : 1px solid #DEDEDE;
+    background       : #F0F0F0;
+    text-decoration  : none;
+}
+
+#tablist li a:link
+{
+    color            : #448;
+}
+
+#tablist li a:visited
+{
+    color            : #667;
+}
+
+#tablist li a:hover
+{
+    color            : #000;
+    background       : #FFFFFF;
+    border-color     : #DEDEDE;
+}
+
+#tablist li a#tab_current
+{
+    background       : white;
+    border-bottom    : 1px solid white;
+}
+
+.menuTop_level1 ul, li
+{
+    list-decoration: none;
+}
+
+.menuTop_level1 ul
+{
+  list-style-type: disc;
+  list-style-image: url(../imgs/bullet.gif);
+}
+
+
+/* -------------------------------------------------------------- */
+/* Form controls (input, ...)                                     */
+/* -------------------------------------------------------------- */
+
+form
+{
+    margin           : 0px;
+}
+
+fieldset
+{
+    border           : 1px solid #DEDEDE;
+    color            : #000000;
+    font-family      : verdana, tahoma, sans-serif;
+    font-size        : 0.90em;
+    padding-bottom   : 0px;
+    margin           : 0px;
+}
+
+textarea, input, select
+{
+    background       : #FFFFFF;
+    border           : 1px solid #b2b2b2;
+    color            : #000000;
+    font-family      : verdana, tahoma, sans-serif;
+    font-size        : 0.95em;
+}
+
+input:focus, textarea:focus, label:focus
+{
+    border           : 1px solid #5583BE;
+}
+
+.checkbox, .radio
+{
+    border           : 0px;
+}
+
+.submit
+{
+    /*margin-left      : 4px;*/
+}
+
+.list_action_button a img
+{
+    border           : 0px;
+    padding          : 0px;
+}
+
+.list_action_button a:hover img
+{
+    filter            : alpha(opacity=60);
+    -moz-opacity      : 0.6;
+}
+
+.field
+{
+    top              : 0;
+    left             : 0;
+    margin           : 0 1em 1em 0;
+}
+
+.field .field
+{
+    margin           : 1em 0 0 0;
+}
+
+.field label
+{
+    font-size        : 100%;
+    font-weight      : bold;
+}
+
+.field_checkbox
+{
+    top              : 0;
+    left             : 0;
+}
+
+.field_checkbox label
+{
+    font-size        : 100%;
+}
+
+.formHelp
+{
+    font-size        : 90%;
+    color            : #76797c;
+    margin           : 0 0 0.2em 0;
+}
+
+.formHelp a
+{
+    text-decoration  : underline;
+}
+
+.formHelp:hover
+{
+    color            : Black;
+    cursor           : default;
+}
+
+fieldset
+{
+    border           : 1px solid #8cacbb;
+    margin           : 1em 0em 1em 0em;
+    padding          : 0em 1em 1em 1em;
+    line-height      : 1.5em;
+    width            : auto;
+}
+
+.inputField
+{
+    width: 85%;
+    margin-left: auto;
+    margin-right: auto;
+    background-color: #FCFCFF;
+    border: 1px solid #DEDEDE;
+}
+
+.buttons
+{
+    width: 88%;
+    margin-left: auto;
+    margin-right: auto;
+    text-align: right;
+}
+
+.inputField input
+{
+    width:100%;
+}
+
+.inputField legend
+{
+    font-weight: bold;
+}
+
+.inputField .dateTime
+{
+   width: 80%;
+}
+
+.inputField .checkbox, .inputField .button, .inputField .radio
+{
+   width: auto;
+}
+
+.inputField .file
+{
+   width: auto;
+}
+
+.pager
+{
+    float:left;
+}
+
+/* -------------------------------------------------------------- */
+/* Data lists parameters & search bar                             */
+/* -------------------------------------------------------------- */
+
+#list_nav_bar
+{
+    margin-left      : auto;
+    margin-right     : auto;
+    width            : 98%;
+    background-color : #F3F1FF;
+    padding-bottom   : 4px;
+    padding-left     : 4px;
+    padding-right    : 4px;
+    margin-bottom    : 10px;
+    border           : 0px solid #DEDEDE;
+}
+
+#list_nav_bar fieldset
+{
+    border           : 1px solid #DEDEDE;
+    color            : #000000;
+    font-family      : verdana, tahoma, sans-serif;
+    font-size        : 0.90em;
+    padding          : 0px;
+    margin           : 0px;
+    height           : 60px;
+}
+
+#list_nav_select
+{
+    float            : left;
+    width            : 100%;
+    text-align       : center;
+}
+
+#list_nav_search
+{
+    float            : left;
+    width            : 30%;
+    text-align       : center;
+}
+
+.list_nav_option
+{
+    float            : left;
+    text-align       : left;
+    padding          : 0px 4px 4px 4px;
+    margin-left      : 5px;
+}
+
+#list_nav_bar legend
+{
+    font-family      : trebuchet ms, tahoma, sans-serif;
+    font-size        : 1.1em;
+    font-weight      : bold;
+    letter-spacing   : 0.08em;
+}
+
+#list_nav_select label
+{
+}
+
+/* -------------------------------------------------------------- */
+/* Data lists table format                                        */
+/* -------------------------------------------------------------- */
+
+.info
+{
+    margin-left      : auto;
+    margin-right     : auto;
+    margin-bottom    : 10px;
+    width            : 775px;
+    border-collapse  : collapse;
+    border-bottom    : 4px solid #DEDEDE;
+    border-spacing   : 0px;
+}
+
+.info th
+{
+    font-family      : trebuchet ms, tahoma, sans-serif;
+    font-size        : 1.1em;
+    font-weight      : bold;
+    letter-spacing   : 0.08em;
+    vertical-align   : bottom;
+    border-bottom    : 1px solid #DEDEDE;
+    padding          : 4px;
+    text-align       : left;
+}
+
+.info th a
+{
+    color           : #000000;
+    text-decoration : none;
+}
+
+.info th a:hover
+{
+    color           : #5583BE;
+    text-decoration : none;
+}
+
+.even
+{
+    background       : #F7F7F7;
+}
+
+.tableHover
+{
+   background: #EFEFEF;
+}
+
+.info td
+{
+    color            : #888888;
+    border-bottom    : 1px solid #DEDEDE;
+    vertical-align   : middle;
+    padding          : 4px;
+    /*border:1px solid black;*/
+}
+
+.info td a
+{
+    color           : #888888;
+    text-decoration : none;
+}
+
+.info td a img {
+    border: 0px;
+}
+
+.info td a:hover
+{
+    color           : #5583BE;
+    text-decoration : none;
+}
+
+/* -------------------------------------------------------------- */
+/* Specific column format                                         */
+/* -------------------------------------------------------------- */
+
+.col_highlighted
+{
+    font-weight      : bold;
+}
+
+/* -------------------------------------------------------------- */
+/* Data lists bottom actions bar                                  */
+/* -------------------------------------------------------------- */
+
+#list_action_bar
+{
+    margin-left      : auto;
+    margin-right     : auto;
+    width            : 768px;
+    padding          : 4px;
+    text-align       : right;
+    /*background-color : #F3F1FF;*/
+    margin-bottom    : 10px;
+    /*border           : 1px dashed #DEDEDE;*/
+}
+
+
+/* -------------------------------------------------------------- */
+/* Positive or negative feedback messages                         */
+/* -------------------------------------------------------------- */
+
+#list #FormError
+{
+    padding-left: 10px;
+}
+
+#FormError
+{
+    align: left;
+    padding-top: 0px;
+}
+
+#list #FormInfo
+{
+    padding-left: 10px;
+}
+
+#FormInfo
+{
+    align: left;
+    padding-top: 0px;
+}
+
+.InfoIcon
+{
+    float:left;
+    clear:left;
+    margin-top:3px;
+}
+
+.InfoText
+{
+    color:green;
+    padding-left:20px;
+    padding-top:3px;
+}
+
+.ErrorText
+{
+    color:red;
+    padding-left:20px;
+    padding-top:3px;
+}
+
+/**
+ * login screen
+ */
+.loginBox
+{
+  width: 300px;
+  margin-top: 25px;
+  margin-left: auto;
+  margin-right: auto;
+}
+
+h4, fieldset h4
+{
+    font-family      : trebuchet ms, tahoma, sans-serif;
+    font-size        : 1.1em;
+    font-weight      : bold;
+    letter-spacing   : 0.08em;
+    vertical-align   : bottom;
+    border-bottom    : 1px solid #DEDEDE;
+    padding          : 0px;
+    text-align       : left;
+    text-transform   : capitalize;
+}
+
+.sectionTitle
+{
+    font-size: 1.3em;
+}
+
+.welcomeMessage {
+  margin-bottom: 10px;
+}
+
+.pager
+{
+float:left;
+}
+
+/**
+ * styles for the 'manage' page and similar.
+ */
+#content .menuTop
+{
+    list-style-type : none;
+    padding-left: 45px;
+    padding-right: 45px;
+    margin: 0px;
+}
+
+#content .menuTop ul
+{
+ padding: 0px;
+ margin: 0px;
+}
+
+#content .menuTop .Level_1
+{
+    font-family      : trebuchet ms, tahoma, sans-serif;
+    font-size        : 1.0em;
+    font-weight      : bold;
+    letter-spacing   : 0.08em;
+    border-bottom    : 1px solid #DEDEDE;
+    padding-top      : 10px;
+    text-align       : left;
+}
+
+#content .menuTop .Level_0
+{
+    padding-left: 10px;
+    font-weight      : normal;
+}
+
+#content .menuTop .Level_0 a
+{
+    color           : #888888;
+    text-decoration : none;
+}
+
+#content .menuTop .Level_0 a:hover
+{
+    color           : #5583BE;
+    text-decoration : none;
+}
+
+/* -------------------------------------------------------------- */
+/* Dashboard                                                      */
+/* -------------------------------------------------------------- */
+
+#dashboard h2
+{
+    color            : #588BCA;
+    font-weight      : bold;
+    font-family      : verdana, arial, tahoma, sans-serif;
+    font-size        : 1.4em;
+    letter-spacing   : 0.08em;
+    margin           : 0;
+    padding-left     : 4px;
+}
+
+#dashboard h2 a
+{
+    color            : #32609B;
+    font-weight      : bold;
+    font-family      : verdana, arial, tahoma, sans-serif;
+    margin           : 0;
+    padding-left     : 4px;
+    text-decoration  : none;
+}
+
+#dashboard h2 a:hover
+{
+    text-decoration  : underline;
+}
+
+#dashboard h3
+{
+    color            : #588BCA;
+    font-weight      : bold;
+    font-family      : verdana, arial, tahoma, sans-serif;
+    font-size        : 1.1em;
+    margin           : 0;
+    margin-top       : 12px;
+    margin-bottom    : 4px;
+    padding-left     : 12px;
+}
+
+#dashboard table
+{
+    margin-left     : 12px;
+    width           : 100%;
+}
+
+#dashboard th
+{
+}
+
+#dashboard td
+{
+}
+
+#dashboard a
+{
+    color            : #8A8A8A;
+    text-decoration  : none;
+}
+
+#dashboard
+{
+    color            : #8A8A8A;
+}
+
+#dashboard .dashboard_blog
+{
+    border           : 1px solid #DEDEDE;
+    padding          : 4px;
+    background-color : #FCFCFF;
+    margin-top       : 10px;
+}
+
+#dashboard .dashboard_blog_layout
+{
+    margin           : 0;
+    width            : 100%;
+    background-color : #FFFFFF;
+}
+
+#dashboard .dashboard_blog_layout tr
+{
+}
+
+#dashboard .dashboard_blog_layout td
+{
+}
+
+#dashboard .dashboard_data_table
+{
+    width           : 98%;
+}
+
+#dashboard .dashboard_data_table th
+{
+    border-bottom   : 2px solid #DEDEDE;
+    height          : 20px;
+    text-align      : left;
+}
+
+#dashboard .dashboard_data_table td
+{
+    border-bottom    : 1px solid #DEDEDE;
+    height           : 20px;
+}
+
+#dashboard .dashboard_data_table_statistics
+{
+    width           : 98%;
+}
+
+#dashboard .dashboard_data_table_statistics th, td
+{
+    border-bottom    : 1px solid #DEDEDE;
+    height           : 20px;
+    text-align       : left;
+}
+
+.dashboard_logout_link a
+{
+	float: right;	
+	padding-right: 5px;
+	padding-top: 3px;
+	text-transform: capitalize;
+    color            : #32609B;
+    font-weight      : bold;
+    font-family      : verdana, arial, tahoma, sans-serif;
+    margin           : 0;
+    padding-left     : 4px;
+    text-decoration  : none;	
+}
+
+.dashboard_logout_link a:hover
+{
+	text-decoration: underline;	
+}

Modified: plog/trunk/styles/png.css
===================================================================
--- plog/trunk/styles/png.css	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/styles/png.css	2005-05-31 10:28:30 UTC (rev 2128)
@@ -2,5 +2,5 @@
 {
     vertical-align  : middle;
     border          : 0px;
-    behavior        : url("js/png.htc");
+    behavior        : url("../js/png.htc");
 }
\ No newline at end of file

Modified: plog/trunk/styles/rss.css
===================================================================
--- plog/trunk/styles/rss.css	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/styles/rss.css	2005-05-31 10:28:30 UTC (rev 2128)
@@ -33,7 +33,7 @@
 	padding: 0px;
 	font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
 	color: #000000;
-	background: #FFFFFF url(/SiteImages/Lines2.gif) repeat-y left top fixed;
+	background: #FFFFFF;
 }
 link, language, rights, description{
 	display: none;

Modified: plog/trunk/styles/summary-ie.css
===================================================================
--- plog/trunk/styles/summary-ie.css	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/styles/summary-ie.css	2005-05-31 10:28:30 UTC (rev 2128)
@@ -12,6 +12,10 @@
   margin-top: 0px;
 }
 
+#onecolumn {
+  padding-right: 0px;
+}
+
 .buttons {
   padding-top: 7px;
 }
\ No newline at end of file

Modified: plog/trunk/styles/summary.css
===================================================================
--- plog/trunk/styles/summary.css	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/styles/summary.css	2005-05-31 10:28:30 UTC (rev 2128)
@@ -281,7 +281,7 @@
     border-bottom    : 1px solid white;
 }
 
-.menuTop_level1 ul, li
+/*.menuTop_level1 ul, li
 {
     list-decoration: none;
 }
@@ -291,8 +291,8 @@
   list-style-type: disc;
   list-style-image: url(../imgs/bullet.gif);
 }
+*/
 
-
 /* -------------------------------------------------------------- */
 /* Form controls (input, ...)                                     */
 /* -------------------------------------------------------------- */
@@ -345,7 +345,7 @@
 .list_action_button a:hover img
 {
     filter            : alpha(opacity=60);
-    -moz-opacity      : 0.6;
+    opacity           : 0.6;
 }
 
 .field
@@ -617,9 +617,8 @@
 {
     padding-left: 10px;
 }
-
-#FormError
-{
+/*
+#FormError{
     align: left;
     padding-top: 0px;
 }
@@ -634,7 +633,7 @@
     align: left;
     padding-top: 0px;
 }
-
+*/
 .InfoIcon
 {
     float:left;
@@ -784,4 +783,9 @@
 #FormError
 {
  padding-bottom: 11px;
-} 
\ No newline at end of file
+}
+
+div.templateScreen {
+  float: left;
+  margin: 5px 15px 15px 0px;
+}
\ No newline at end of file

Modified: plog/trunk/summary.php
===================================================================
--- plog/trunk/summary.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/summary.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -8,12 +8,13 @@
      * Script that shows a summary page with the 'n' most recent additions
      * of all blogs in one page. Therefore, it is called a "Summary" :)
      */
-
+     
     include_once( PLOG_CLASS_PATH."class/controller/controller.class.php" );
     include_once( PLOG_CLASS_PATH."class/net/http/httpvars.class.php" );
     include_once( PLOG_CLASS_PATH."class/misc/version.class.php" );
     include_once( PLOG_CLASS_PATH."class/data/validator/usernamevalidator.class.php" );
 	include_once( PLOG_CLASS_PATH."class/net/http/subdomains.class.php" );
+	include_once( PLOG_CLASS_PATH."class/net/http/session/sessionmanager.class.php" );	
 
 	define( "SUMMARY_DEFAULT_BLOGS_PER_PAGE", 25 );
 	
@@ -21,7 +22,8 @@
 	// redirect to index.php because it is not coming to us!
 	$config =& Config::getConfig();
 	if( $config->getValue( "subdomains_enabled") && Subdomains::isSubdomainUrl()) {
-		include_once( PLOG_CLASS_PATH."index.php" );
+    	$indexPage = $config->getValue( "script_name", "index.php" );
+		include_once( PLOG_CLASS_PATH.$indexPage );
 		die();
 	}
 	
@@ -37,6 +39,9 @@
 			$this->setActionFolderPath( PLOG_CLASS_PATH."class/summary/action/" );
 		}
 	}
+	
+	// start the session handling stuff
+	SessionManager::init();	
 
     //// map to associate actions with classes ////
     $_actionMap["Default"]       = "SummaryDefaultAction";

Modified: plog/trunk/templates/admin/dashboard.template
===================================================================
--- plog/trunk/templates/admin/dashboard.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/admin/dashboard.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,25 +1,27 @@
 {include file="$admintemplatepath/simpleheader.template"}
+
     <div id="nav_bar">
         <div id="section_title">
             <h2>{$locale->tr("dashboard")}</h2>
         </div>
+        <div class="dashboard_logout_link">
+          <a href="?op=blogSelect&amp;blogId={$userblogs[0]->getId()}&amp;action=Logout">{$locale->tr("logout")}</a>
+        </div>
         <br style="clear:both;" />
     </div>
-
+    </div>
     <div id="dashboard">
     {foreach from=$userblogs item=blog}
         <div class="dashboard_blog">
-        <h2><a href="?op=blogSelect&amp;blogId={$blog->getId()}">{$blog->getBlog()}</a></h2>
-
+        <h2>{$locale->tr("login")}&raquo; <a href="?op=blogSelect&amp;blogId={$blog->getId()}">{$blog->getBlog()}</a></h2>
         <table class="dashboard_blog_layout">
             <tr>
                 <td style="width: 70%; border: 0px solid black;">
                     <h3>{$locale->tr("recent_articles")}</h3>
                     <table class="dashboard_data_table">
                         <tr>
-                            <th>
-                                {$locale->tr("topic")}
-                            </th>
+                            <th>{$locale->tr("topic")}</th>
+                            <th style="width:60px;">{$locale->tr("actions")}</th>
                         </tr>
                         {assign var=blogId value=$blog->getId()}
                         {assign var=url value=$blog->getBlogRequestGenerator()}
@@ -29,6 +31,12 @@
                             <td>
                                 <a target="_blank" href="{$url->postPermalink($post)}">{$post->getTopic()}</a><br/>
                             </td>
+                            <td>
+                                <div class="list_action_button">
+                                <a href="?op=blogSelect&amp;blogId={$blog->getId()}&amp;action=editPost&amp;postId={$post->getId()}"><img src="imgs/admin/icon_edit-16.png" alt="{$locale->tr("edit")}" /></a>
+                                <a href="?op=blogSelect&amp;blogId={$blog->getId()}&amp;action=deletePost&amp;postIds[]={$post->getId()}"><img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" /></a>
+                                </div>
+                            </td>
                         </tr>
                         {/foreach}
                     </table>
@@ -36,18 +44,11 @@
                     <h3>{$locale->tr("recent_comments")}</h3>
                     <table class="dashboard_data_table">
                         <tr>
-                            <th>
-                                {$locale->tr("topic")}
-                            </th>
-                            <th>
-                                {$locale->tr("posted_by")}
-                            </th>
-                            <th>
-                                {$locale->tr("in")}
-                            </th>
-                            <th>
-                                {$locale->tr("date")}
-                            </th>
+                            <th>{$locale->tr("topic")}</th>
+                            <th>{$locale->tr("posted_by")}</th>
+                            <th>{$locale->tr("in")}</th>
+                            <th>{$locale->tr("date")}</th>
+                            <th style="width:60px;">{$locale->tr("actions")}</th>
                         </tr>
                         {** loop to print out the list of recent comments **}
                         {foreach from=$recentcomments[$blogId] item=comment}
@@ -74,6 +75,24 @@
                                 {assign var=commentDate value=$comment->getDateObject()}
                                 {$locale->formatDate($commentDate)}<br/>
                             </td>
+                            <td>
+                                <div class="list_action_button">
+                                <a href="?op=blogSelect&amp;blogId={$blog->getId()}&amp;action=deleteComment&amp;commentIds[]={$comment->getId()}&amp;articleId={$article->getId()}"><img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" /></a>
+                                {if $comment->getStatus() == 0}
+                                    <a href="?op=blogSelect&amp;blogId={$blog->getId()}&amp;action=markComment&amp;mode=1&amp;articleId={$comment->getArticleId()}&amp;commentId={$comment->getId()}">
+                                     <img src="imgs/admin/icon_spam-16.png" alt="{$locale->tr("mark_as_spam")}" />
+                                    </a>
+                                {elseif $comment->getStatus() == 1}
+                                    <a href="?op=blogSelect&amp;blogId={$blog->getId()}&amp;action=markComment&amp;mode=0&amp;articleId={$comment->getArticleId()}&amp;commentId={$comment->getId()}">
+                                     <img src="imgs/admin/icon_nospam-16.png" alt="{$locale->tr("mark_as_no_spam")}" />
+                                    </a>
+                                {/if}
+                                {if $comment->getUserUrl()}
+                                  <a href="{$comment->getUserUrl()}">
+                                   <img src="imgs/admin/icon_url-16.png" alt="{$locale->tr("url")}" />
+                                {/if}
+                                </div>
+                            </td>
                         </tr>
                         {/foreach}
                     </table>
@@ -81,15 +100,10 @@
                     <h3>{$locale->tr("recent_trackbacks")}</h3>
                     <table class="dashboard_data_table">
                         <tr>
-                            <th>
-                                {$locale->tr("topic")}
-                            </th>
-                            <th>
-                                {$locale->tr("in")}
-                            </th>
-                            <th>
-                                {$locale->tr("date")}
-                            </th>
+                            <th>{$locale->tr("topic")}</th>
+                            <th>{$locale->tr("in")}</th>
+                            <th>{$locale->tr("date")}</th>
+                            <th style="width:60px;">{$locale->tr("actions")}</th>
                         </tr>
                         {** loop to print out the list of recent trackbacks **}
                         {foreach from=$recenttrackbacks[$blogId] item=trackback}
@@ -111,6 +125,11 @@
                                 {assign var=trackbackDate value=$trackback->getDateObject()}
                                 {$locale->formatDate($trackbackDate)}<br/>
                             </td>
+                            <td>
+                                <div class="list_action_button">
+                                 <a href="?op=blogSelect&amp;blogId={$blog->getId()}&amp;action=deleteTrackback&amp;articleId={$article->getId()}&amp;trackbackIds[]={$trackback->getId()}"><img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete_trackback")}" /></a>
+                                </div>
+                            </td>
                         </tr>
                     {/foreach}
                     </table>

Modified: plog/trunk/templates/admin/editpost.template
===================================================================
--- plog/trunk/templates/admin/editpost.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/admin/editpost.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -3,6 +3,9 @@
 <script type="text/javascript" src="js/calendar/datetimepicker.js"></script>
 <script type="text/javascript" src="js/ui/plogui.js"></script>
 {assign var=htmlarea value=$blogsettings->getValue("htmlarea_enabled")}
+  <script type="text/javascript">
+     var indexPage = "{$config->getValue("script_name")}";
+  </script>
  {if $htmlarea}
   <link rel="stylesheet" href="js/htmlarea/htmlarea.css" type="text/css"/>
   <script type="text/javascript" src="js/htmlarea/htmlarea.js"/></script>
@@ -14,7 +17,7 @@
  {/if} 
 
  <script type="text/javascript">
-  var htmlAreaEnabled = '{$htmlarea}'; 
+  var htmlAreaEnabled = '{$htmlarea}';
   {include file="$admintemplatepath/calendarstuff.template"}
  </script>
   <form name="newPost" id="editPost" action="admin.php" method="post">

Modified: plog/trunk/templates/admin/globalsettings_general.template
===================================================================
--- plog/trunk/templates/admin/globalsettings_general.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/admin/globalsettings_general.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -90,7 +90,7 @@
    <div class="field">
     <label for="config[default_blog_id]">default_blog_id</label>
     <div class="formHelp">{$locale->tr("help_default_blog_id")}</div>
-	<input type="text" class="text" value="{$default_blog_id}" />
+	<input type="text" class="text" name="config[default_blog_id]" value="{$default_blog_id}" />
    </div>
    <!-- default_time_offset -->
    <div class="field">

Modified: plog/trunk/templates/admin/header.template
===================================================================
--- plog/trunk/templates/admin/header.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/admin/header.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -22,6 +22,8 @@
 
     <div id="header" >
         <h1><span>pLog Admin</span></h1>
+        <!-- link to the blog, opens in new window -->
+        <a href="{$url->blogLink()}" id="blogLink" target="_blank" title="{$blog->getBlog()}"></a>
     </div>
 
     <hr class="hide" />

Modified: plog/trunk/templates/admin/menus.xml
===================================================================
--- plog/trunk/templates/admin/menus.xml	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/admin/menus.xml	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,5 +1,4 @@
 <menu url="?op=Dashboard" localeId="dashboard"> 
-	<newPostTop url="?op=newPost" localeId="newPost" />
 	<Manage url="?op=Manage">
 	    <managePosts ignoreBreadCrumbs="1">
 	       <newPost url="?op=newPost" />		
@@ -8,21 +7,23 @@
 	       <newArticleCategory url="?op=newArticleCategory" />
  		</managePosts>
  		<manageLinks ignoreBreadCrumbs="1">
+			 <newLink url="?op=newLink" /> 		
  		     <editLinks url="?op=editLinks" /> 
-			 <newLink url="?op=newLink" />
+			 <newLinkCategory url="?op=newLinkCategory" /> 		     
 			 <editLinkCategories url="?op=editLinkCategories" />
-			 <newLinkCategory url="?op=newLinkCategory" />
         </manageLinks>
 		<manageCustomFields ignoreBreadCrumbs="1">
+  		  <newCustomField url="?op=newCustomField" blogOwner="1" />		
 		  <blogCustomFields url="?op=blogCustomFields" blogOwner="1"/>		
-  		  <newCustomField url="?op=newCustomField" blogOwner="1" />
 		</manageCustomFields>
 	</Manage>
-	<resourceCenter url="?op=resources">
-		<resources url="?op=resources" />	
-		<newResourceAlbum url="?op=newResourceAlbum" />
-		<newResource url="?op=newResource" />
-	</resourceCenter>
+	<ResourcesGroup url="?op=resourcesGroup" localeId="resourceCenter">
+	  <resourceCenter ignoreBreadCrumbs="1">
+	  	<newResource url="?op=newResource" />	
+	  	<newResourceAlbum url="?op=newResourceAlbum" />
+	  	<resources url="?op=resources" />
+	  </resourceCenter> 
+	</ResourcesGroup>  
 	<controlCenter url="?op=controlCenter" blogOwner="0">
 	    <manageSettings ignoreBreadCrumbs="1"> 
   		  <blogSettings url="?op=blogSettings" blogOwner="1" />	

Modified: plog/trunk/templates/admin/navigation.template
===================================================================
--- plog/trunk/templates/admin/navigation.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/admin/navigation.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -7,6 +7,6 @@
             </div>
             <br style="clear:both;" />
         </div>
-        {if $templatename != "main" && $templatename != "controlcenter" && $templatename != "adminsettings" && $templatename != "resourcecenter" && $templatename != "error" && $templatename != "message" }
+        {if $templatename != "main" && $templatename != "controlcenter" && $templatename != "adminsettings" && $templatename != "resourcesgroup" && $templatename != "error" && $templatename != "message" }
           {include file="$admintemplatepath/menutabs.template"}
         {/if}
\ No newline at end of file

Modified: plog/trunk/templates/admin/newpost.template
===================================================================
--- plog/trunk/templates/admin/newpost.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/admin/newpost.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -3,6 +3,9 @@
 {assign var=htmlarea value=$blogsettings->getValue("htmlarea_enabled")}
  <script type="text/javascript" src="js/ui/plogui.js"></script>
  <script type="text/javascript" src="js/calendar/datetimepicker.js"></script>
+  <script type="text/javascript">
+     var indexPage = "{$config->getValue("script_name")}";
+  </script>  
  {if $htmlarea}
   <link rel="stylesheet" href="js/htmlarea/htmlarea.css" type="text/css"/>    
   <script type="text/javascript" src="js/htmlarea/htmlarea.js"/></script>

Modified: plog/trunk/templates/admin/resourcelist.template
===================================================================
--- plog/trunk/templates/admin/resourcelist.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/admin/resourcelist.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -9,6 +9,7 @@
   <script type="text/javascript" src="js/ui/common.js"></script>
   <script type="text/javascript">
    var plogBaseUrl = '{$baseurl}';
+   var indexPage = '{$config->getValue("script_name")}';
   </script>
   <style>{literal}
    html,body {
@@ -123,17 +124,17 @@
   </td>
   <td>
   {if $htmlarea}
-  <a href="javascript:addHtmlareaLink({$destination},{$blog->getId()},{$resource->getResourceType()},'{$resource->getFileName()|escape:"javascript"}','{$resource->getDescription()|escape:"javascript"}',false);">{$locale->tr("add_resource")}</a><br/> 
+  <a href="javascript:addHtmlareaLink({$destination},{$blog->getId()},{$resource->getResourceType()},'{$resource->getFileName()|escape:"javascript"}','{$resource->getDescription()|escape:"javascript"}',false,'{$resource->getMimeType()}','{$resource->getId()}');">{$locale->tr("add_resource")}</a><br/> 
   {else}
- <a href="javascript:addResourceLink({$destination},{$blog->getId()},{$resource->getResourceType()},'{$resource->getFileName()|escape:"javascript"}','{$resource->getDescription()|escape:"javascript"}',false);">{$locale->tr("add_resource")}</a><br/> 
+ <a href="javascript:addResourceLink({$destination},{$blog->getId()},{$resource->getResourceType()},'{$resource->getFileName()|escape:"javascript"}','{$resource->getDescription()|escape:"javascript"}',false,'{$resource->getMimeType()}','{$resource->getId()}');">{$locale->tr("add_resource")}</a><br/> 
   {/if}
   {if $resource->hasPreview()}
    {if $htmlarea}
-    <a href="javascript:addHtmlareaLink({$destination},{$blog->getId()},{$resource->getResourceType()},'{$resource->getFileName()|escape:"javascript"}','{$resource->getDescription()|escape:"javascript"}',1);">{$locale->tr("add_resource_preview")}</a><br/>
-    <a href="javascript:addHtmlareaLink({$destination},{$blog->getId()},{$resource->getResourceType()},'{$resource->getFileName()|escape:"javascript"}','{$resource->getDescription()|escape:"javascript"}',2);">{$locale->tr("add_resource_medium")}</a><br/>
+    <a href="javascript:addHtmlareaLink({$destination},{$blog->getId()},{$resource->getResourceType()},'{$resource->getFileName()|escape:"javascript"}','{$resource->getDescription()|escape:"javascript"}',1,'{$resource->getMimeType()}','{$resource->getId()}');">{$locale->tr("add_resource_preview")}</a><br/>
+    <a href="javascript:addHtmlareaLink({$destination},{$blog->getId()},{$resource->getResourceType()},'{$resource->getFileName()|escape:"javascript"}','{$resource->getDescription()|escape:"javascript"}',2,'{$resource->getMimeType()}','{$resource->getId()}');">{$locale->tr("add_resource_medium")}</a><br/>
    {else}
-   <a href="javascript:addResourceLink({$destination},{$blog->getId()},{$resource->getResourceType()},'{$resource->getFileName()|escape:"javascript"}','{$resource->getDescription()|escape:"javascript"}',1);">{$locale->tr("add_resource_preview")}</a><br/>
-   <a href="javascript:addResourceLink({$destination},{$blog->getId()},{$resource->getResourceType()},'{$resource->getFileName()|escape:"javascript"}','{$resource->getDescription()|escape:"javascript"}',2);">{$locale->tr("add_resource_medium")}</a><br/>
+   <a href="javascript:addResourceLink({$destination},{$blog->getId()},{$resource->getResourceType()},'{$resource->getFileName()|escape:"javascript"}','{$resource->getDescription()|escape:"javascript"}',1,'{$resource->getMimeType()}','{$resource->getId()}');">{$locale->tr("add_resource_preview")}</a><br/>
+   <a href="javascript:addResourceLink({$destination},{$blog->getId()},{$resource->getResourceType()},'{$resource->getFileName()|escape:"javascript"}','{$resource->getDescription()|escape:"javascript"}',2,'{$resource->getMimeType()}','{$resource->getId()}');">{$locale->tr("add_resource_medium")}</a><br/>
    {/if}
   {/if}
  </td>

Copied: plog/trunk/templates/admin/resourcesgroup.template (from rev 2126, plog/branches/plog-1.0.1/templates/admin/resourcesgroup.template)

Modified: plog/trunk/templates/admin/simpleerror.template
===================================================================
--- plog/trunk/templates/admin/simpleerror.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/admin/simpleerror.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,8 +1,17 @@
 {include file="$blogtemplate/simpleheader.template"}
-<div id="container">
- <h1>{$locale->tr("error")}</h1>
- <p>
-  {$message}
- </p>
-</div>
+        <div id="nav_bar">
+            <div id="section_title">
+                <h2>{$locale->tr("error")}</h2>
+            </div>
+            <br style="clear:both;" />
+        </div>
+   <div id="FormError">
+   <img src="imgs/admin/icon_warning-16.png" alt="Error" class="InfoIcon" />  
+   <p class="ErrorText">
+   {$message}
+   <br/><br/>
+   <a href="javascript:history.back();">{$locale->tr("back")}</a>
+   </p>
+   </div>
+{include file="$blogtemplate/footernavigation.template"}
 {include file="$blogtemplate/footer.template"}

Modified: plog/trunk/templates/blueish/commentform.template
===================================================================
--- plog/trunk/templates/blueish/commentform.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/blueish/commentform.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,5 +1,5 @@
  <div class="comments-body">
-  <form name="comments_form" action="{$url->getIndexUrl()}" method="post">
+  <form action="{$url->getIndexUrl()}" method="post" id="NewComment" name="NewComment">
    <div style="width:180px; padding-right:15px; margin-right:15px; float:left; text-align:left; border-right:1px dotted #bbb;">
 	<label for="subject">{$locale->tr("comment_topic")}:</label><br />
 	<input tabindex="1" id="subject" name="commentTopic" value="{$topic}" /><br /><br />
@@ -24,6 +24,7 @@
         width="16" height="16" align="middle"  alt="Link" />
   </div>  
   <textarea tabindex="5" id="text" name="commentText" rows="10" cols="50"></textarea><br /><br />
+
   <input style="font-weight: bold;" type="submit" name="post" value="&nbsp;{$locale->tr("comment_send")}&nbsp;" /><br /><br />
   <input type="hidden" name="op" value="AddComment"/>
   <input type="hidden" name="articleId" value="{$post->getId()}"/>

Modified: plog/trunk/templates/blueish/posttrackbacks.template
===================================================================
--- plog/trunk/templates/blueish/posttrackbacks.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/blueish/posttrackbacks.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -8,7 +8,7 @@
      <b>{$locale->tr("trackback_excerpt")}:</b> {$trackback->getExcerpt()}<br/>
      <b>{$locale->tr("trackback_weblog")}:</b> {$trackback->getBlogName()}<br/>
      {assign var="trackbackDate" value=$trackback->getDateObject()}
-     <b>{$locale->tr("date")}:</b> Date would be here<br/><br/>
+     <b>{$locale->tr("date")}:</b> {$locale->formatDate($trackbackDate,"%d %B, %Y %H:%M")}<br/>
     {/foreach}
   </div>
  </div>

Modified: plog/trunk/templates/grey/commentform.template
===================================================================
--- plog/trunk/templates/grey/commentform.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/grey/commentform.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,4 +1,4 @@
-  <form action="{$url->getIndexUrl()}" method="post">
+  <form action="{$url->getIndexUrl()}" method="post" id="NewComment" name="NewComment">
   <p>
    {$locale->pr("comment_topic")}<br/><input type="text" name="commentTopic" value="{$topic}"/><br/>
    {$locale->pr("comment_text")} <br/><textarea rows="10" cols="37" name="commentText"></textarea><br/>

Deleted: plog/trunk/templates/grey/demosites.template
===================================================================
--- plog/trunk/templates/grey/demosites.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/grey/demosites.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,16 +0,0 @@
-{include file="$blogtemplate/header.template"}
-  <p>
-   The following sites are running pLog. Have a look at them if you want to see how 
-   pLog feels like:
-  </p>
-  <ul>
-  <li><a href="http://www.renalias.net">Oscar's (one of the developers) own personal page</a> (Kind of slow
-  sometimes)</li>
-  <li><a href="http://www.francesc.net">Francesc's (another developer) own personal page</a> (Faster than
-  Oscar's :))</li>
-  <li><a href="http://www.lamevaweb.info">Free blogging service for the users of the #tarrega channel in the
-  Spanish IRC network.</a>.</li>
-  <li><a href="http://ireport.sourceforge.net">iReport project</a></li>
-  <li><a href="http://darren.someblog.com">Darren's blog</a><br/></li>
-  </ul>
-{include file="$blogtemplate/footer.template"}

Modified: plog/trunk/templates/grey/footer.template
===================================================================
--- plog/trunk/templates/grey/footer.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/grey/footer.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -4,14 +4,15 @@
   <div class="Sidetitle">
    <h4>{$locale->tr("search")}</h4>
   </div>
-  <p> 
-   <form name="search_form" method="post" action="{$url->getIndexUrl()}">
-    <input type="text" name="searchTerms" value="" size="14" /><br/>
-    <input type="hidden" name="op" value="Search" />
-    <input type="hidden" name="blogId" value="{$blog->getId()}"/>   
-    <input type="submit" name="Search" value="{$locale->tr("search")|capitalize}" />
+   <form method="post" action="{$url->getIndexUrl()}">
+    <p>
+      <input type="text" name="searchTerms" value="" size="14" /><br/>
+      <input type="hidden" name="op" value="Search" />
+      <input type="hidden" name="blogId" value="{$blog->getId()}"/>   
+      <input type="submit" name="Search" 
+            value="{$locale->tr("search")|capitalize}" />
+    </p>
    </form>
-  </p>
   
   <div class="Sidetitle">
    <h4>{$locale->tr("archives")}</h4>

Modified: plog/trunk/templates/grey/grey.css
===================================================================
--- plog/trunk/templates/grey/grey.css	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/grey/grey.css	2005-05-31 10:28:30 UTC (rev 2128)
@@ -119,7 +119,6 @@
 
 #Resource-Desc a:link, 
 #Resource-Desc a,
-#Resource-Desc a:href
 #Resource-Desc a:hover {
  text-decoration: none;
  border: 0px;

Modified: plog/trunk/templates/grey/postandcomments.template
===================================================================
--- plog/trunk/templates/grey/postandcomments.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/grey/postandcomments.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -30,4 +30,5 @@
  <h3>{$locale->tr("add_comment")}</h3>
  {include file="$blogtemplate/commentform.template"}
  {/if}
+ {$nestedcomments->getCommentsGroupedByParentId($post)}
 {include file="$blogtemplate/footer.template"}

Modified: plog/trunk/templates/rss/atom.template
===================================================================
--- plog/trunk/templates/rss/atom.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/rss/atom.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -5,7 +5,7 @@
 {assign var="newestDate" value=$posts[0]->getDateObject()} 
 <modified>{$locale->formatDate($newestDate, "%Y-%m-%dT%H:%M:%SZ")}</modified> 
 <tagline>{$blog->getAbout()|escape}</tagline> 
-<generator url="http://www.plogworld.net/" version="0.3.1">pLog</generator> 
+<generator url="http://www.plogworld.net/" version="1.0.1">pLog</generator> 
 {assign var="blogOwner" value=$posts[0]->getUserInfo()} 
 <copyright>Copyright (c) {$blogOwner->getUsername()|escape}</copyright> 
  {foreach from=$posts item=post} 

Modified: plog/trunk/templates/rss/rss090.template
===================================================================
--- plog/trunk/templates/rss/rss090.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/rss/rss090.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,6 +1,10 @@
 <?xml version="1.0" encoding="{$locale->getCharset()}"?>
 <?xml-stylesheet href="{$url->getUrl("/styles/rss.css")}" type="text/css"?>
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://my.netscape.com/rdf/simple/0.9/">
+<rdf:RDF 
+  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
+  xmlns="http://my.netscape.com/rdf/simple/0.9/"
+>
+{$locale->setLocale("en_UK")}
  <channel>
   <title>{$blog->getBlog()|escape}</title>
   <link>{$url->blogLink()}</link>
@@ -11,6 +15,9 @@
    <title>{$post->getTopic()|escape}</title>
    <description>{$post->getText()|escape}</description>
    <link>{$url->postPermalink($post)}</link>
+   {assign var="postDate" value=$post->getDateObject()}
+   <pubDate>{$postDate->getUnixDate()|date_format:"%a, %d %b %Y %H:%M:%S"} +0000</pubDate>   
   </item>
   {/foreach}
 </rdf:RDF>
+

Modified: plog/trunk/templates/rss/rss10.template
===================================================================
--- plog/trunk/templates/rss/rss10.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/rss/rss10.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,25 +1,39 @@
 <?xml version="1.0" encoding="{$locale->getCharset()}"?>
 <?xml-stylesheet href="{$url->getUrl("/styles/rss.css")}" type="text/css"?>
 <rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
+  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+  xmlns:dc="http://purl.org/dc/elements/1.1/"
+  xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
+  xmlns:admin="http://webns.net/mvcb/"
+  xmlns="http://purl.org/rss/1.0/"
 >
  <channel rdf:about="{$url->rssLink("rss10")}">
   <title>{$blog->getBlog()|escape}</title>
   <link>{$url->blogLink()}</link>
   <description>{$blog->getAbout()|escape}</description>
+  {assign var="blogOwner" value=$posts[0]->getUserInfo()}
+  <dc:creator>{$blogOwner->getUsername()}</dc:creator>
+  <dc:date>{$smarty.now|date_format:"%Y-%m-%dT%H:%M:%S"}Z</dc:date>
+  <admin:generatorAgent rdf:resource="http://www.plogworld.net" />
+  <items>
+   <rdf:seq>
+   {foreach from=$posts item=post}
+    <rdf:li rdf:resource="{$url->postPermalink($post)}" />
+   {/foreach}
+   </rdf:seq>
+  </items> 
  </channel>
-  {foreach from=$posts item=post}
-  <item rdf:about="{$url->postPermalink($post)}">
-   <title>{$post->getTopic()|escape}</title>
-   <dc:title>{$post->getTopic()|escape}</dc:title>
-   <description>{$post->getText()|escape}</description>
-   <link>{$url->postPermalink($post)}</link>
-   {assign var="postDate" value=$post->getDateObject()}
-   <dc:date>{$locale->formatDate($postDate, "%Y-%m-%d %H:%M:%S")}</dc:date>
-   {assign var="postOwner" value=$post->getUserInfo()}
-   <dc:creator>{$postOwner->getUsername()|escape}</dc:creator>
-  </item>
-  {/foreach}
-</rdf:RDF>
\ No newline at end of file
+ {foreach from=$posts item=post}
+ <item rdf:about="{$url->postPermalink($post)}">
+  <title>{$post->getTopic()|escape}</title>
+  <link>{$url->postPermalink($post)}</link>
+  <dc:description>{$post->getText()|escape}</dc:description>
+  {assign var="postCategory" value=$post->getCategory()}
+  <dc:subject>{$postCategory->getName()}</dc:subject>
+  {assign var="postDate" value=$post->getDateObject()}
+  <dc:date>{$locale->formatDate($postDate, "%Y-%m-%dT%H:%M:%S")}Z</dc:date>
+  {assign var="postOwner" value=$post->getUserInfo()}
+  <dc:creator>{$postOwner->getUsername()}</dc:creator>
+ </item>
+ {/foreach}
+</rdf:RDF>

Modified: plog/trunk/templates/rss/rss20.template
===================================================================
--- plog/trunk/templates/rss/rss20.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/rss/rss20.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,25 +1,43 @@
-<?xml version="1.0" encoding="{$locale->getCharset()}"?>
-<?xml-stylesheet href="{$url->getUrl("/styles/rss.css")}" type="text/css"?>
-<rss version="2.0">
- <channel>
-  <title>{$blog->getBlog()|escape}</title>
-  <link>{$url->blogLink()}</link>
-  <description>{$blog->getAbout()|escape}</description>
-  <generator>pLog 0.3</generator>
-  {foreach from=$posts item=post}
-  <item>
-   <title>{$post->getTopic()|escape}</title>
-   <description>{$post->getText()|escape}</description>
-   <link>{$url->postPermalink($post)}</link>
-   <comments>{$url->postPermalink($post)}</comments>
-   <guid>{$url->postPermalink($post)}</guid>
-   {assign var="postOwner" value=$post->getUserInfo()}
-   <author>{$postOwner->getUsername()|escape}</author>
-   {foreach from=$post->getCategories() item=category}   
-    <category>{$category->getName()|escape}</category>
-   {/foreach} 
-   <source url="{$url->rssLink("rss20")}">{$blog->getBlog()|escape}</source>
-  </item>
-  {/foreach}
- </channel>
-</rss>
+<?xml version="1.0" encoding="{$locale->getCharset()}"?>
+<?xml-stylesheet href="{$url->getUrl("/styles/rss.css")}" type="text/css"?>
+<rss version="2.0" 
+	xmlns:content="http://purl.org/rss/1.0/modules/content/"
+	xmlns:dc="http://purl.org/dc/elements/1.1/"
+>
+{$locale->setLocale("en_UK")}
+ <channel>
+  <title>{$blog->getBlog()|escape}</title>
+  <link>{$url->blogLink()}</link>
+  <description>{$blog->getAbout()|escape}</description>
+  <pubDate>{$locale->formatDate($now, "%a, %d %b %Y %H:%M:%S")}</pubDate>
+  <generator>http://www.plogworld.net</generator>
+  {foreach from=$posts item=post}
+  <item>
+   <title>{$post->getTopic()|escape}</title>
+   <description>
+    {$post->getText()|escape}
+   </description>
+   <link>{$url->postPermalink($post)}</link>
+   <comments>{$url->postPermalink($post)}</comments>
+   <guid>{$url->postPermalink($post)}</guid>
+   {assign var="postOwner" value=$post->getUserInfo()}
+   <dc:creator>{$postOwner->getUsername()|escape}</dc:creator>
+   {foreach from=$post->getCategories() item=category}   
+    <category>{$category->getName()|escape}</category>
+   {/foreach}
+   {assign var="postDate" value=$post->getDateObject()}
+   <pubDate>{$locale->formatDate($postDate, "%a, %d %b %Y %H:%M:%S")}</pubDate>
+   <source url="{$url->rssLink("rss20")}">{$blog->getBlog()|escape}</source>
+   {foreach from=$post->getArticleResources() item=resource}
+    {** please uncomment the line below if you'd like to server everything but images, instead of
+        only audio and video **}
+    {** if !$resource->isImage() **}
+    {if $resource->isSound() || $resource->isVideo()}
+     <enclosure type="{$resource->getMimeType()}" length="{$resource->getFileSize()}" url="{$url->resourceDownloadLink($resource)}" />
+    {/if}
+   {/foreach}
+  </item>
+  {/foreach}
+ </channel>
+</rss>
+

Modified: plog/trunk/templates/standard-with-plugins/commentform.template
===================================================================
--- plog/trunk/templates/standard-with-plugins/commentform.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/standard-with-plugins/commentform.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -10,7 +10,7 @@
    	 {if !empty($smileys)}
    	  {if $smileys->isEnabled()}
        <script type="text/javascript" src="{$url->getBaseUrl()}/plugins/smileys/js/smileys/smileys.js"></script>
-       <br/><label for="simleysBar"></label>{$smileys->generateSmileysBar()}
+       <br/><label>&nbsp;</label>{$smileys->generateSmileysBar()}
       {/if}
      {/if}
     </div> 

Modified: plog/trunk/templates/standard-with-plugins/delicious.template
===================================================================
--- plog/trunk/templates/standard-with-plugins/delicious.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/standard-with-plugins/delicious.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -4,8 +4,8 @@
   {assign var=tagId value=$smarty.request.tag}
   {assign var=deliciousTags value=$delicious->getTagList()}
   {foreach item=deliciousTag from=$deliciousTags}
-   {math equation="ceil(x/y)+1" assign=fontsize x=$deliciousTag.count y=5}
-   <font size={$fontsize}><a href="{$deliciousTag.deliciousUrl}" style="border-bottom: 0px;" title="{$deliciousTag.count} Posts">{$deliciousTag.id}</a></font>&nbsp;&nbsp;&nbsp;&nbsp;
+   {math equation="10+ceil(x/y)*3" assign=fontsize x=$deliciousTag.count y=5}
+   <span style="font-size:{$fontsize}px"><a href="{$deliciousTag.deliciousUrl}" style="border-bottom: 0px;" title="{$deliciousTag.count} Posts">{$deliciousTag.id}</a></span>&nbsp;&nbsp;&nbsp;&nbsp;
   {/foreach}
  {else}
   {$locale->tr("error_delicious_not_enabled")}

Modified: plog/trunk/templates/summary/blogprofile.template
===================================================================
--- plog/trunk/templates/summary/blogprofile.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/summary/blogprofile.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -16,8 +16,9 @@
         <div class="peu">
 		 <p>
             {$locale->tr("users")}
-			<a href="?op=UserProfile&amp;userId={$owner->getId()}">{$owner->getUsername()|strip_tags}</a>,
 			{assign var=blogUsers value=$blog->getUsersInfo()}
+			<a
+            href="?op=UserProfile&amp;userId={$owner->getId()}">{$owner->getUsername()|strip_tags}</a>{if $blogUsers},{/if}
 			{foreach from=$blogUsers item=blogUser name=blogUsersLoop}
 			 <a href="?op=UserProfile&amp;userId={$owner->getId()}">{$blogUser->getUsername()}</a>{if !$smarty.foreach.blogUsersLoop.last}, {/if}			 
 			{/foreach}			

Modified: plog/trunk/templates/summary/blogslist.template
===================================================================
--- plog/trunk/templates/summary/blogslist.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/summary/blogslist.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -17,8 +17,9 @@
         </p>
         <div class="bloginfo">
             {$locale->tr("users")} 
-			<a href="?op=UserProfile&amp;userId={$owner->getId()}">{$owner->getUsername()|strip_tags}</a>,
 			{assign var=blogUsers value=$blog->getUsersInfo()}
+			<a
+		 href="?op=UserProfile&amp;userId={$owner->getId()}">{$owner->getUsername()|strip_tags}</a>{if $blogUsers},{/if}
 			{foreach from=$blogUsers item=blogUser name=blogUsersLoop}
 			 <a href="?op=UserProfile&amp;userId={$owner->getId()}">{$blogUser->getUsername()}</a>{if !$smarty.foreach.blogUsersLoop.last}, {/if}
 			{/foreach}
@@ -28,5 +29,4 @@
 	  {include file="summary/pager.template" style=links}
 	</div>  
 </div>
-</div>
-{include file="summary/footer.template"}
\ No newline at end of file
+{include file="summary/footer.template"}

Modified: plog/trunk/templates/summary/footer.template
===================================================================
--- plog/trunk/templates/summary/footer.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/summary/footer.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,3 +1,4 @@
-</div>
-</body>
-</html>
\ No newline at end of file
+      </div>
+    </div>
+  </body>
+</html>

Modified: plog/trunk/templates/summary/index.template
===================================================================
--- plog/trunk/templates/summary/index.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/summary/index.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -40,7 +40,7 @@
 </div>
 
 <div id="column-right">
-    <form id="loginForm" method="post">
+    <form id="searchForm" method="post" action=".">
     <fieldset class="inputField">
         <h4>{$locale->tr("summary_search_blogs")}</h4>
         <div class="field">
@@ -60,29 +60,46 @@
     </ul>
 
     <h4>{$locale->tr("summary_most_commented_articles")}
-    <a href="{$url->getRssUrl()}?summary=1&amp;type=mostcommented"><img src="{$url->getUrl("/imgs/rss_logo_small.gif")}" alt="RSS" /></a>	
+    {if $commentedPosts} 
+      <a href="{$url->getRssUrl()}?summary=1&amp;type=mostcommented">
+        <img src="{$url->getUrl("/imgs/rss_logo_small.gif")}" 
+         alt="RSS" /></a>
+    {/if}    
+
 	</h4>
-    <ul class="itemList">
-    {foreach from=$commentedPosts item=post}
+    {foreach name=commented from=$commentedPosts item=post}
+       {if $smarty.foreach.commented.first}
+         <ul class="itemList">
+       {/if}
 	    {assign var="blog" value=$post->getBlogInfo()}
 	    {assign var="url" value=$blog->getBlogRequestGenerator()}	
         <li class="item">		
             <a href="{$url->postPermalink($post)}">{$post->getTopic()|strip_tags}</a> ({$post->getTotalComments()})<br />
         </li>
+       {if $smarty.foreach.commented.last}
+         </ul>
+       {/if}
     {/foreach}
-    </ul>
 
     <h4>{$locale->tr("summary_most_read_articles")}
-    <a href="{$url->getRssUrl()}?summary=1&amp;type=mostread"><img src="{$url->getUrl("/imgs/rss_logo_small.gif")}" alt="RSS" /></a>		
-	</h4>
-    <ul class="itemList">
-    {foreach from=$readestBlogs item=post}
+      {if $readestBlogs}
+        <a href="{$url->getRssUrl()}?summary=1&amp;type=mostread">
+          <img src="{$url->getUrl("/imgs/rss_logo_small.gif")}" 
+          alt="RSS" /></a>		
+      {/if}
+     </h4>
+    {foreach name=readest from=$readestBlogs item=post}
+       {if $smarty.foreach.readest.first}
+         <ul class="itemList">
+       {/if}
 	    {assign var="blog" value=$post->getBlogInfo()}
 	    {assign var="url" value=$blog->getBlogRequestGenerator()}		
         <li class="item">
             <a href="{$url->postPermalink($post)}">{$post->getTopic()|strip_tags}</a> ({$post->getNumReads()})<br />
         </li>
+       {if $smarty.foreach.readest.last}
+         </ul>
+       {/if}
     {/foreach}
-    </ul>
 </div>
 {include file="summary/footer.template"}

Modified: plog/trunk/templates/summary/recent.template
===================================================================
--- plog/trunk/templates/summary/recent.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/summary/recent.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,5 +1,9 @@
 <h4>{$locale->tr("summary_latest_posts")}
-<a href="{$url->getRssUrl()}?summary=1"><img src="{$url->getUrl("/imgs/rss_logo_small.gif")}" alt="RSS" /></a>
+  {if $posts}
+    <a href="{$url->getRssUrl()}?summary=1">
+      <img src="{$url->getUrl("/imgs/rss_logo_small.gif")}" 
+        alt="RSS" /></a>
+  {/if}
 </h4>
 {foreach from=$posts item=post}
  {include file="summary/post.template"}

Modified: plog/trunk/templates/summary/registerstep2.template
===================================================================
--- plog/trunk/templates/summary/registerstep2.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/summary/registerstep2.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -16,7 +16,7 @@
      <div class="formHelp">{$locale->tr("blog_language_help")}</div>
      <select name="blogLocale" id="blogLocale">
       {foreach from=$locales item=localeObject}
-        <option value="{$localeObject->getLocaleCode()}" {if $blogLocale == $localeObject->getLocaleCode()}selected="selected"{/if}>{$localeObject->getDescription()}</option>
+        <option value="{$localeObject->getLocaleCode()}" {if $defaultLocale == $localeObject->getLocaleCode()}selected="selected"{/if}>{$localeObject->getDescription()}</option>
       {/foreach}
      </select>
    </div>

Modified: plog/trunk/templates/summary/registerstep3.template
===================================================================
--- plog/trunk/templates/summary/registerstep3.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/summary/registerstep3.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,4 +1,13 @@
 {include file="summary/header.template" section=$locale->tr("register_step3_title")}
+
+{literal}
+<script language="JavaScript" type="text/JavaScript">
+function openWindow(URL,windowtitle,params) { 
+  window.open(URL,windowtitle,params);
+}
+</script>
+{/literal}
+
  <form name="templateChooser" method="post">
   <fieldset class="inputField">
    <legend>{$locale->tr("step3")}</legend>
@@ -8,10 +17,12 @@
     {include file="summary/validate.template" field=templateId message=$locale->tr("error_must_choose_template")}	
     {foreach from=$templates item=template}
      {assign var=templateName value=$template->getName()}
-     <img src="{$template->getScreenshotUrl()}" alt="{$templateName}" height="300" width="400" /><br/>
+     <div class="templateScreen">
+     <a href="javascript:openWindow('{$template->getScreenshotUrl()}','Screenshot','scrollbars=yes,resizable=yes,width=400,height=300');"><img src="{$template->getScreenshotUrl()}" alt="{$templateName}" height="150" width="200" /></a><br/>
      <input type="radio" class="checkbox" value="{$template->getName()}" name="templateId" id="templateId" />
      <label for="templateId"><strong>{$templateName}</strong></label>
      <br/><br/>
+     </div>
     {/foreach}
    </div>
   </fieldset>  

Modified: plog/trunk/templates/summary/resetpassword.template
===================================================================
--- plog/trunk/templates/summary/resetpassword.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/summary/resetpassword.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -26,5 +26,6 @@
     <input type="submit" name="resetPasswordButton" value="{$locale->tr("register_next")} &raquo;" />
     <input type="hidden" name="op" value="sendResetEmail" />
    </div>
+   </form>
 </div>
 {include file="summary/footer.template"}
\ No newline at end of file

Modified: plog/trunk/templates/summary/userlist.template
===================================================================
--- plog/trunk/templates/summary/userlist.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/summary/userlist.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -7,8 +7,7 @@
 		 {assign var=userBlogs value=$user->getBlogs()}
 		 {foreach from=$userBlogs item=userBlog name=userBlogsLoop}
 		  {assign var=urlGen value=$userBlog->getBlogRequestGenerator()}
-		  <a href="{$urlGen->blogLink()}">{$userBlog->getBlog()}</a>
-		  {if !$smarty.foreach.userBlogLoops.last}, {/if}
+		  <a href="{$urlGen->blogLink()}">{$userBlog->getBlog()}</a>{if !$smarty.foreach.userBlogsLoop.last}, {/if}
 		 {/foreach}
 		</p>
     {/foreach}
@@ -16,5 +15,4 @@
 <div class="pager">
 	{include file="summary/pager.template" style=links}
 </div>
-</div>
 {include file="summary/footer.template"}

Modified: plog/trunk/templates/summary/userprofile.template
===================================================================
--- plog/trunk/templates/summary/userprofile.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/summary/userprofile.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -19,8 +19,7 @@
 		 {assign var=userBlogs value=$user->getBlogs()}
 		 {foreach from=$userBlogs item=userBlog name=userBlogsLoop}
 		  {assign var=urlGen value=$userBlog->getBlogRequestGenerator()}
-		  <a href="{$urlGen->blogLink()}">{$userBlog->getBlog()}</a>
-		  {if !$smarty.foreach.userBlogLoops.last}, {/if}
+		  <a href="{$urlGen->blogLink()}">{$userBlog->getBlog()}</a>{if !$smarty.foreach.userBlogsLoop.last}, {/if}
 		 {/foreach}
 		</p>
 		<p>

Modified: plog/trunk/templates/wizard/update1.template
===================================================================
--- plog/trunk/templates/wizard/update1.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/wizard/update1.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -15,7 +15,7 @@
   that they are correct and press "Next" to move to the next step. If they are not correct,
   please make the necessary changes in your configuration file before continuing.<br/><br/>
   The following step will consist of making the changes to the database structure, required by
-  some of the new features in 1.0.</p>  
+  some of the new features in 1.0.1.</p>  
   </div>
 {/if}
     <div class="field">
@@ -49,4 +49,4 @@
     <input type="submit" name="Next" value="Next &raquo;"/>
    </div>
  </form>
-{include file="wizard/footer.template"}
\ No newline at end of file
+{include file="wizard/footer.template"}

Modified: plog/trunk/templates/wizard/update4.template
===================================================================
--- plog/trunk/templates/wizard/update4.template	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/templates/wizard/update4.template	2005-05-31 10:28:30 UTC (rev 2128)
@@ -12,7 +12,7 @@
     <img src="imgs/admin/icon_info-16.png" alt="Info" class="wizardInfoIcon" />
     <p class="wizardInfoText">
   Installation is complete. Congratulations, Your 0.3-based installation has been updated
-  to version 1.0.
+  to version 1.0.1.
     </p> 
    </div>
 {/if}


Property changes on: plog/trunk/tmp
___________________________________________________________________
Name: svn:ignore
   + *.template
*.php
*.log


Modified: plog/trunk/tools/retest.php
===================================================================
--- plog/trunk/tools/retest.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/tools/retest.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -5,9 +5,12 @@
     //
     
     // initialization
-    $text = $_POST["text"];
-    $regexp = $_POST["regexp"];
-    $type = $_POST["type"];
+    if( isset( $_POST["text"] )) $text = $_POST["text"];
+    else $text = "";
+    if( isset( $_POST["regexp"])) $regexp = $_POST["regexp"];
+    else $regexp = "";
+    if( isset( $_POST["type"] )) $type = $_POST["type"];
+    else $type = "";
     $resultsAvailable = false;
     $successful = false;
     
@@ -16,7 +19,10 @@
         if( $type == "preg_match" ) {
             // use only preg_match as the method
             $result = preg_match( $regexp, $text, $matches );
-            $matchStrings = Array( $matches[1] );
+            if( isset( $matches[1] ))
+                $matchStrings = Array( $matches[1] );
+            else
+                $matchStrings = Array();
         }
         else {
             $result = preg_match_all( $regexp, $text, $matches );

Modified: plog/trunk/trackback.php
===================================================================
--- plog/trunk/trackback.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/trackback.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,20 +1,21 @@
-<?php
-
-    if (!defined( "PLOG_CLASS_PATH" )) {
-        define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
-    }
-	
-	include_once( PLOG_CLASS_PATH."class/net/http/httpvars.class.php" );
-
-    //
-	// set appender for the "trackback" logger to "file" in
-	// config/logging.properties.php if you'd like this code to log some debug
-	// messages to tmp/trackback.log.
-    //
-	
-	$request = HttpVars::getRequest();
-	$request["op"] = "AddTrackback";
-	HttpVars::setRequest( $request );
-	
-	include_once( PLOG_CLASS_PATH."index.php" );
+<?php
+
+    if (!defined( "PLOG_CLASS_PATH" )) {
+        define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
+    }
+	
+	include_once( PLOG_CLASS_PATH."class/net/http/httpvars.class.php" );
+
+    //
+	// set appender for the "trackback" logger to "file" in
+	// config/logging.properties.php if you'd like this code to log some debug
+	// messages to tmp/trackback.log.
+    //
+	
+	$request = HttpVars::getRequest();
+	$request["op"] = "AddTrackback";
+	HttpVars::setRequest( $request );
+	
+	include_once( PLOG_CLASS_PATH."index.php" );
+
 ?>
\ No newline at end of file

Modified: plog/trunk/wizard.php
===================================================================
--- plog/trunk/wizard.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/wizard.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -1,1818 +1,1821 @@
-<?php
-
-    if (!defined( "PLOG_CLASS_PATH" )) {
-        define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
-    }
-
-    set_time_limit (5 * 3600);
-
-    //
-    // enable this for debugging purposes
-    //
-    define( "DB_WIZARD_DEBUG", false );
-
-    //
-    // in case you're having problems with time outs while upgrading (probably too
-    // many records) lower this figure
-    //
-    define( "WIZARD_MAX_RECORDS_PER_STEP", 50 );
-
-    //
-    // threshold that defines up to how many records we should not divide the
-    // transformations in more than one step
-    //
-    define( "WIZARD_MAX_RECORDS_THRESHOLD", 100 );
-
-    // many hosts don't have this enabled and we, for the time being, need it...
-    ini_set("arg_seperator.output", "&amp;");
-
-    include_once( PLOG_CLASS_PATH."class/controller/controller.class.php" );
-    include_once( PLOG_CLASS_PATH."class/template/templateservice.class.php" );
-    include_once( PLOG_CLASS_PATH."class/action/action.class.php" );
-    include_once( PLOG_CLASS_PATH."class/template/template.class.php" );
-    include_once( PLOG_CLASS_PATH."class/view/view.class.php" );
-    include_once( PLOG_CLASS_PATH."class/database/adodb/adodb.inc.php" );
-    include_once( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
-    include_once( PLOG_CLASS_PATH."class/data/validator/emailvalidator.class.php" );
-    include_once( PLOG_CLASS_PATH."class/data/validator/passwordvalidator.class.php" );
-    include_once( PLOG_CLASS_PATH."class/dao/users.class.php" );
-    include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
-    include_once( PLOG_CLASS_PATH."class/dao/articlecategories.class.php" );
-    include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
-    include_once( PLOG_CLASS_PATH."class/net/http/httpvars.class.php" );
-    include_once( PLOG_CLASS_PATH."class/dao/userpermissions.class.php" );
-    include_once( PLOG_CLASS_PATH."class/misc/version.class.php" );
-    include_once( PLOG_CLASS_PATH."class/file/file.class.php" );
-    include_once( PLOG_CLASS_PATH."class/file/finder/filefinder.class.php" );
-    include_once( PLOG_CLASS_PATH."class/gallery/resizers/gddetector.class.php" );
-    include_once( PLOG_CLASS_PATH."class/config/configfilestorage.class.php" );
-    include_once( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
-    include_once( PLOG_CLASS_PATH."class/locale/locales.class.php" );
-    include_once( PLOG_CLASS_PATH."class/locale/localefinder.class.php" );
-
-    define( "TEMP_FOLDER", "./tmp" );
-
-    // sql querys used to create the tables
-
-    // maps used to map requests with actions
-    $_actionMap["Default"] = "WizardIntro";
-    $_actionMap["Intro"] = "WizardIntro";
-    $_actionMap["Step1"] = "WizardStepOne";
-    $_actionMap["Step2"] = "WizardStepTwo";
-    $_actionMap["Step3"] = "WizardStepThree";
-    $_actionMap["Step4"] = "WizardStepFour";
-    $_actionMap["Step5"] = "WizardStepFive";
-    $_actionMap["Update1"] = "UpdateStepOne";
-    $_actionMap["Update2"] = "UpdateStepTwo";
-    $_actionMap["Update3"] = "UpdateStepThree";
-    $_actionMap["Update4"] = "UpdateStepFour";
-
-
-
-    $Tables[0]["desc"] = "Articles";
-    $Tables[0]["code"] = "CREATE TABLE {dbprefix}articles (
-  id int(10) unsigned NOT NULL auto_increment,
-  category_id int(10) unsigned NOT NULL default '0',
-  date timestamp(14) NOT NULL,
-  modification_date timestamp(14) NOT NULL,
-  user_id int(10) unsigned NOT NULL default '0',
-  blog_id int(10) unsigned NOT NULL default '0',
-  status INTEGER(5) NOT NULL default 1,
-  num_reads int(10) default '0',
-  properties TEXT NOT NULL default '',
-  slug varchar(255) NOT NULL,
-  PRIMARY KEY (id),
-  KEY num_reads (num_reads),
-  KEY category_id (category_id),
-  KEY blog_id (blog_id),
-  KEY user_id (user_id),
-  KEY slug (slug),
-  KEY blog_id_slug (blog_id,slug),
-  KEY blog_id_slug_category_id (blog_id,slug,category_id)
-) TYPE=MyISAM;";
-
-    $Tables[1]["desc"] = "Article categories";
-    $Tables[1]["code"] = "CREATE TABLE {dbprefix}articles_categories (
-  id int(10) unsigned NOT NULL auto_increment,
-  name varchar(255) NOT NULL default '',
-  url varchar(255) NOT NULL default '',
-  blog_id int(10) unsigned NOT NULL default '0',
-  last_modification timestamp(14) NOT NULL,
-  in_main_page TINYINT(1) NOT NULL DEFAULT '1',
-  parent_id INTEGER(10) NOT NULL DEFAULT '0',
-  description TEXT NOT NULL DEFAULT '',
-  properties text NOT NULL default '',
-  mangled_name varchar(255) NOT NULL default '',
-  PRIMARY KEY  (id),
-  KEY parent_id (parent_id),
-  KEY blog_id (blog_id),
-  KEY mangled_name (mangled_name)
-) TYPE=MyISAM;";
-
-    $Tables[2]["desc"] = "Comments";
-    $Tables[2]["code"] = "CREATE TABLE {dbprefix}articles_comments (
-  id int(10) unsigned NOT NULL auto_increment,
-  article_id int(10) unsigned NOT NULL default '0',
-  topic text NOT NULL,
-  text text,
-  date timestamp(14) NOT NULL,
-  user_email varchar(255) default '',
-  user_url varchar(255) default '',
-  user_name varchar(255) NOT NULL default 'Anonymous',
-  parent_id int(10) unsigned default '0',
-  client_ip varchar(15) default '0.0.0.0',
-  send_notification tinyint(1) default '0',
-  status tinyint(2) default '1',
-  spam_rate float default '0',
-  properties TEXT NOT NULL DEFAULT '',
-  normalized_text TEXT NOT NULL DEFAULT '',
-  normalized_topic TEXT NOT NULL DEFAULT '',
-  type int(3) NOT NULL DEFAULT '0',
-  PRIMARY KEY  (id),
-  KEY parent_id (parent_id),
-  KEY article_id (article_id),
-  FULLTEXT KEY normalized_fields (normalized_text,normalized_topic),
-  FULLTEXT KEY normalized_text (normalized_text),
-  FULLTEXT KEY normalized_topic (normalized_topic)
-) TYPE=MyISAM;";
-
-    $Tables[3]["desc"] = "Notifications";
-    $Tables[3]["code"] = "CREATE TABLE {dbprefix}articles_notifications (
-  id int(10) NOT NULL auto_increment,
-  blog_id int(10) NOT NULL default '0',
-  user_id int(10) NOT NULL default '0',
-  article_id int(10) NOT NULL default '0',
-  PRIMARY KEY  (id),
-  KEY article_id (article_id),
-  KEY user_id (user_id),
-  KEY blog_id (blog_id)
-) TYPE=MyISAM;";
-
-    $Tables[4]["desc"] = "Blogs";
-    $Tables[4]["code"] = "CREATE TABLE {dbprefix}blogs (
-  id int(10) unsigned NOT NULL auto_increment,
-  blog varchar(50) NOT NULL default '',
-  owner_id int(10) unsigned NOT NULL default '0',
-  about text,
-  settings text NOT NULL,
-  mangled_blog varchar(50) NOT NULL default '',
-  status int(4) NOT NULL default '1',
-  show_in_summary int(4) not null default '1',
-  PRIMARY KEY  (id),
-  KEY owner_id (owner_id),
-  KEY mangled_blog (mangled_blog)
-) TYPE=MyISAM;";
-
-    $Tables[5]["desc"] = "MyLinks";
-    $Tables[5]["code"] = "CREATE TABLE {dbprefix}mylinks (
-  id int(10) unsigned NOT NULL auto_increment,
-  category_id int(10) unsigned NOT NULL default '0',
-  url varchar(255) NOT NULL default '',
-  name varchar(100) default '',
-  description text NOT NULL,
-  blog_id int(10) unsigned NOT NULL default '0',
-  rss_feed varchar(255) not null default '',
-  date timestamp(14) not null,
-  properties TEXT NOT NULL DEFAULT '',
-  PRIMARY KEY  (id),
-  KEY blog_id (blog_id),
-  KEY category_id (category_id)
-) TYPE=MyISAM;";
-
-    $Tables[6]["desc"] = "MyLinks Categories";
-    $Tables[6]["code"] = "CREATE TABLE {dbprefix}mylinks_categories (
-  id int(10) NOT NULL auto_increment,
-  name varchar(100) NOT NULL default '',
-  blog_id int(10) NOT NULL default '0',
-  last_modification timestamp(14) NOT NULL,
-  properties TEXT NOT NULL DEFAULT '',
-  PRIMARY KEY  (id),
-  KEY blog_id (blog_id)
-) TYPE=MyISAM;";
-
-    $Tables[7]["desc"] = "MyRecent";
-    $Tables[7]["code"] = "CREATE TABLE {dbprefix}myrecent (
-  id int(10) unsigned NOT NULL auto_increment,
-  category_id int(10) unsigned NOT NULL default '0',
-  name varchar(255) NOT NULL default '',
-  text text NOT NULL,
-  user_id int(10) unsigned NOT NULL default '0',
-  blog_id int(10) unsigned NOT NULL default '0',
-  PRIMARY KEY  (id)
-) TYPE=MyISAM;";
-
-    $Tables[8]["desc"] = "MyRecent categories";
-    $Tables[8]["code"] = "CREATE TABLE {dbprefix}myrecent_categories (
-  id int(10) unsigned NOT NULL auto_increment,
-  name varchar(255) NOT NULL default '',
-  blog_id int(10) unsigned NOT NULL default '0',
-  last_modification timestamp(14) NOT NULL,
-  PRIMARY KEY  (id)
-) TYPE=MyISAM;";
-
-    $Tables[9]["desc"] = "Permissions";
-    $Tables[9]["code"] = "CREATE TABLE {dbprefix}permissions (
-  id int(10) unsigned NOT NULL auto_increment,
-  permission varchar(25) NOT NULL default '',
-  description varchar(100) NOT NULL default '',
-  PRIMARY KEY  (id)
-) TYPE=MyISAM;";
-
-    $Tables[10]["desc"] = "Referrers";
-    $Tables[10]["code"] = "CREATE TABLE {dbprefix}referers (
-  id int(10) NOT NULL auto_increment,
-  url text NOT NULL,
-  article_id int(10) NOT NULL default '0',
-  blog_id int(10) NOT NULL default '0',
-  hits int(10) default '1',
-  last_date timestamp(14),
-  PRIMARY KEY  (id),
-  KEY article_id (article_id),
-  KEY blog_id (blog_id),
-  KEY blog_id_article_id (blog_id, article_id)
-) TYPE=MyISAM;";
-
-    $Tables[11]["desc"] = "Trackbacks";
-    $Tables[11]["code"] = "CREATE TABLE {dbprefix}trackbacks (
-  id int(10) NOT NULL auto_increment,
-  url text NOT NULL,
-  title varchar(255) default '',
-  article_id int(10) NOT NULL default '0',
-  excerpt varchar(255) default '',
-  blog_name varchar(255) default '',
-  date timestamp(14) NOT NULL,
-  properties TEXT NOT NULL DEFAULT '',
-  PRIMARY KEY  (id),
-  KEY article_id (article_id)
-) TYPE=MyISAM;";
-
-    $Tables[12]["desc"] = "Users";
-    $Tables[12]["code"] = "CREATE TABLE {dbprefix}users (
-  id int(10) unsigned NOT NULL auto_increment,
-  user varchar(15) NOT NULL default '',
-  password varchar(32) NOT NULL default '',
-  email varchar(255) NOT NULL default '',
-  full_name varchar(255) NOT NULL default '',
-  about text,
-  properties TEXT NOT NULL default '',
-  status integer(4) NOT NULL DEFAULT 1,
-  resource_picture_id integer(10) NOT NULL DEFAULT 0,
-  PRIMARY KEY  (id),
-  UNIQUE KEY user (user)
-) TYPE=MyISAM;";
-
-    $Tables[13]["desc"] = "Permissions";
-    $Tables[13]["code"] = "CREATE TABLE {dbprefix}users_permissions (
-  id int(10) unsigned NOT NULL auto_increment,
-  user_id int(10) unsigned NOT NULL default '0',
-  blog_id int(10) unsigned NOT NULL default '0',
-  permission_id int(10) unsigned NOT NULL default '0',
-  PRIMARY KEY  (id),
-  KEY user_id (user_id),
-  KEY blog_id (blog_id),
-  KEY user_id_permission_id (user_id,permission_id)
-) TYPE=MyISAM;";
-
-
-   $Tables[14]["desc"] = "Configuration";
-   $Tables[14]["code"] = "CREATE TABLE {dbprefix}config (
-   id int(10) NOT NULL auto_increment,
-   config_key varchar(255) NOT NULL default '',
-   config_value text NOT NULL,
-   value_type int(3) default '0',
-   PRIMARY KEY  (id,config_key)
-   ) TYPE=MyISAM;";
-
-   $Tables[15]["desc"] = "Filtered Content";
-   $Tables[15]["code"] = "CREATE TABLE {dbprefix}filtered_content (
-   id int(10) NOT NULL auto_increment,
-   reg_exp text,
-   blog_id int(10) NOT NULL default '0',
-   reason text,
-   date timestamp(14) NOT NULL,
-   PRIMARY KEY  (id),
-   KEY blog_id (blog_id)
-   ) TYPE=MyISAM;";
-
-   $Tables[16]["desc"] = "Blocked content";
-   $Tables[16]["code"] = "CREATE TABLE {dbprefix}host_blocking_rules (
-   id int(10) NOT NULL auto_increment,
-   reason text,
-   date timestamp(14) NOT NULL,
-   blog_id int(10) NOT NULL default '0',
-   block_type int(1) default '1',
-   list_type int(1) default '1',
-   mask int(2) default '0',
-   host varchar(15) default '0.0.0.0',
-   PRIMARY KEY  (id),
-   KEY blog_id (blog_id)
-   ) TYPE=MyISAM;";
-
-   $Tables[17]["desc"] = "Gallery Resources";
-   $Tables[17]["code"] = "CREATE TABLE {dbprefix}gallery_resources (
-   id int(10) NOT NULL auto_increment,
-   owner_id int(10) NOT NULL default '0',
-   album_id int(10) NOT NULL default '0',
-   description text,
-   date timestamp(14) NOT NULL,
-   flags int(10) default '0',
-   resource_type int(3) default NULL,
-   file_path varchar(255) default '',
-   file_name varchar(255) default '',
-   metadata text,
-   thumbnail_format varchar(4) not null default 'same',
-   normalized_description text NOT NULL default '',
-   properties TEXT NOT NULL DEFAULT '',
-   PRIMARY KEY  (id),
-   KEY album_id (album_id),
-   KEY owner_id (owner_id),
-   KEY file_name (file_name),
-   KEY album_id_owner_id (album_id, owner_id),
-   KEY resource_type (resource_type),
-   FULLTEXT KEY normalized_description (normalized_description)
-   ) TYPE=MyISAM;";
-
-   $Tables[18]["desc"] = "Gallery Albums";
-   $Tables[18]["code"] = "CREATE TABLE {dbprefix}gallery_albums (
-   id int(10) NOT NULL auto_increment,
-   owner_id int(10) NOT NULL default '0',
-   description text NOT NULL,
-   name varchar(255) NOT NULL default '',
-   flags int(10) NOT NULL default '0',
-   parent_id int(10) NOT NULL default '0',
-   date timestamp(14) NOT NULL,
-   properties text NOT NULL DEFAULT '',
-   show_album TINYINT(1) DEFAULT 1,
-   normalized_description text NOT NULL default '',
-   normalized_name varchar(255) NOT NULL default '',
-   mangled_name varchar(255) NOT NULL default '',
-   PRIMARY KEY  (id),
-   KEY parent_id (parent_id),
-   KEY owner_id (owner_id),
-   KEY mangled_name (mangled_name),
-   KEY owner_id_mangled_name (owner_id, mangled_name),
-   FULLTEXT KEY normalized_name (normalized_name),
-   FULLTEXT KEY normalized_description (normalized_description),
-   FULLTEXT KEY normalized_fields (normalized_name, normalized_description)
-   ) TYPE=MyISAM;";
-
-   $Tables[19]["desc"] = "Bayesian Filter data table";
-   $Tables[19]["code"] = "CREATE TABLE {dbprefix}bayesian_filter_info (
-   id int(10) unsigned NOT NULL auto_increment,
-   blog_id int(10) unsigned default NULL,
-   total_spam int(10) unsigned default NULL,
-   total_nonspam int(10) unsigned default NULL,
-   PRIMARY KEY  (id),
-   KEY blog_id (blog_id)
-   ) TYPE=MyISAM;";
-
-   $Tables[20]["desc"] = "Bayesian Filter Information";
-   $Tables[20]["code"] = "CREATE TABLE {dbprefix}bayesian_tokens (
-   id int(10) unsigned NOT NULL auto_increment,
-   blog_id int(10) unsigned default NULL,
-   token char(100) default NULL,
-   spam_occurrences int(10) unsigned default NULL,
-   nonspam_occurrences int(10) unsigned default NULL,
-   prob float default NULL,
-   PRIMARY KEY  (id),
-   KEY blog_id (blog_id),
-   KEY token (token)
-   ) TYPE=MyISAM;";
-
-   $Tables[21]["desc"] = "Map of categories to articles";
-   $Tables[21]["code"] = "CREATE TABLE {dbprefix}article_categories_link(
-   article_id int(10) NOT NULL,
-   category_id int(10) NOT NULL,
-   PRIMARY KEY (article_id, category_id)
-   ) TYPE=MyISAM;";
-
-   $Tables[22]["desc"] = "Definition of custom fields";
-   $Tables[22]["code"] = "CREATE TABLE {dbprefix}custom_fields_definition (
-   id int(10) NOT NULL auto_increment,
-   field_name varchar(255) NOT NULL default '',
-   field_description text NOT NULL,
-   field_type int(2) NOT NULL default '1',
-   blog_id int(10) NOT NULL default '0',
-   date TIMESTAMP(14),
-   searchable TINYINT(1) default 1,
-   hidden TINYINT(1) default 1,
-   PRIMARY KEY  (id,field_name),
-   KEY blog_id (blog_id)
-   ) TYPE=MyISAM;";
-
-   $Tables[23]["desc"] = "Custom fields that have been assigned to articles";
-   $Tables[23]["code"] = "CREATE TABLE {dbprefix}custom_fields_values (
-   id int(10) NOT NULL auto_increment,
-   field_id int(10) NOT NULL default '0',
-   field_value text NOT NULL,
-   normalized_value text NOT NULL,
-   blog_id int(10) default NULL,
-   article_id int(10) default NULL,
-   PRIMARY KEY  (id),
-   FULLTEXT KEY normalized_value (normalized_value),
-   KEY blog_id (blog_id),
-   KEY article_id (article_id),
-   KEY field_id (field_id),
-   KEY blog_id_article_id (blog_id, article_id)
-   ) TYPE=MyISAM;";
-
-   $Tables[24]["desc"] = "Text of the articles";
-   $Tables[24]["code"] = "CREATE TABLE {dbprefix}articles_text (
-   id int(10) NOT NULL auto_increment,
-   article_id int(10) NOT NULL DEFAULT 0,
-   text TEXT NOT NULL DEFAULT '',
-   topic TEXT NOT NULL DEFAULT '',
-   normalized_text TEXT NOT NULL DEFAULT '',
-   normalized_topic TEXT NOT NULL DEFAULT '',
-   mangled_topic text NOT NULL,
-   PRIMARY KEY (id),
-   KEY article_id (article_id),
-   FULLTEXT KEY normalized_text (normalized_text),
-   FULLTEXT KEY normalized_topic (normalized_topic),
-   FULLTEXT KEY normalized_fields (normalized_text, normalized_topic)
-   ) TYPE=MyISAM;";
-
-
-
-   // ---
-   // changes needed to update from 0.3 to 1.0
-   $Changes["Articles"] = Array( "ALTER TABLE {dbprefix}articles CHANGE status old_status ENUM('published', 'draft', 'deleted' )",
-                                 "ALTER TABLE {dbprefix}articles ADD COLUMN status INTEGER(5) NOT NULL DEFAULT 1",
-                                 "ALTER TABLE {dbprefix}articles ADD COLUMN slug VARCHAR(255) NOT NULL DEFAULT ''",
-                                 "ALTER TABLE {dbprefix}articles ADD KEY num_reads(num_reads)",
-                                 "ALTER TABLE {dbprefix}articles ADD KEY category_id(category_id)",
-                                 "ALTER TABLE {dbprefix}articles ADD KEY blog_id(blog_id)",
-                                 "ALTER TABLE {dbprefix}articles ADD KEY slug(slug)",
-                                 "ALTER TABLE {dbprefix}articles ADD KEY user_id(user_id)",
-                                 "ALTER TABLE {dbprefix}articles ADD KEY blog_id_slug(blog_id,slug)",
-                                 "ALTER TABLE {dbprefix}articles ADD KEY blog_id_slug_category_id(blog_id,slug,category_id)");
-
-    $Changes["Article Categories"] = Array( "ALTER TABLE {dbprefix}articles_categories ADD COLUMN parent_id INTEGER(10) NOT NULL DEFAULT 0",
-                                            "ALTER TABLE {dbprefix}articles_categories ADD COLUMN mangled_name VARCHAR(255) NOT NULL DEFAULT ''",
-                                            "ALTER TABLE {dbprefix}articles_categories ADD COLUMN properties TEXT NOT NULL DEFAULT ''",
-                                            "ALTER TABLE {dbprefix}articles_categories ADD COLUMN description TEXT NOT NULL DEFAULT ''",
-                                            "ALTER TABLE {dbprefix}articles_categories ADD KEY parent_id(parent_id)",
-                                            "ALTER TABLE {dbprefix}articles_categories ADD KEY blog_id(blog_id)",
-                                            "ALTER TABLE {dbprefix}articles_categories ADD KEY mangled_name(mangled_name)");
-
-
-    $Changes["User Comments"] = Array( "ALTER TABLE {dbprefix}articles_comments ADD COLUMN normalized_text TEXT NOT NULL DEFAULT ''",
-                                       "ALTER TABLE {dbprefix}articles_comments ADD COLUMN normalized_topic TEXT NOT NULL DEFAULT ''",
-                                       "ALTER TABLE {dbprefix}articles_comments ADD FULLTEXT normalized_text(normalized_text)",
-                                       "ALTER TABLE {dbprefix}articles_comments ADD FULLTEXT normalized_topic(normalized_topic)",
-                                       "ALTER TABLE {dbprefix}articles_comments ADD FULLTEXT normalized_text_topic(normalized_topic,normalized_text)",
-                                       "ALTER TABLE {dbprefix}articles_comments ADD KEY parent_id(parent_id)",
-                                       "ALTER TABLE {dbprefix}articles_comments ADD KEY article_id(article_id)");
-
-    $Changes["Notifications"] = Array( "ALTER TABLE {dbprefix}articles_notifications ADD KEY article_id(article_id)",
-                                       "ALTER TABLE {dbprefix}articles_notifications ADD KEY user_id(user_id)",
-                                       "ALTER TABLE {dbprefix}articles_notifications ADD KEY blog_id(blog_id)");
-
-    $Changes["Blogs"] = Array( "ALTER TABLE {dbprefix}blogs ADD COLUMN mangled_blog VARCHAR(50) NOT NULL DEFAULT ''",
-                               "ALTER TABLE {dbprefix}blogs ADD COLUMN properties TEXT NOT NULL DEFAULT ''",
-                               "ALTER TABLE {dbprefix}blogs ADD COLUMN status INTEGER(4) NOT NULL DEFAULT '1'",
-                               "ALTER TABLE {dbprefix}blogs ADD COLUMN show_in_summary INTEGER(4) NOT NULL DEFAULT '1'",
-                               "ALTER TABLE {dbprefix}blogs ADD KEY owner_id(owner_id)",
-                               "ALTER TABLE {dbprefix}blogs ADD KEY mangled_blog(mangled_blog)");
-
-    $Changes["Referrers"] = Array( "ALTER TABLE {dbprefix}referers ADD KEY article_id(article_id)",
-                                   "ALTER TABLE {dbprefix}referers ADD KEY blog_id(blog_id)",
-                                   "ALTER TABLE {dbprefix}referers ADD   KEY blog_id_article_id (blog_id, article_id)");
-
-    $Changes["Trackbacks"] = Array( "ALTER TABLE {dbprefix}trackbacks ADD KEY article_id(article_id)" );
-
-    $Changes["Filtered Content"] = Array( "ALTER TABLE {dbprefix}filtered_content ADD KEY blog_id(blog_id)" );
-
-    $Changes["Blocked hosts"] = Array( "ALTER TABLE {dbprefix}host_blocking_rules ADD KEY blog_id(blog_id)" );
-
-    $Changes["Gallery Albums"] = Array( "ALTER TABLE {dbprefix}gallery_albums ADD COLUMN normalized_name VARCHAR(255) NOT NULL DEFAULT ''",
-                                        "ALTER TABLE {dbprefix}gallery_albums ADD COLUMN normalized_description TEXT NOT NULL DEFAULT ''",
-                                        "ALTER TABLE {dbprefix}gallery_albums ADD COLUMN mangled_name VARCHAR(255) NOT NULL DEFAULT ''",
-                                        "ALTER TABLE {dbprefix}gallery_albums ADD FULLTEXT normalized_name(normalized_name)",
-                                        "ALTER TABLE {dbprefix}gallery_albums ADD FULLTEXT normalized_description(normalized_description)",
-                                        "ALTER TABLE {dbprefix}gallery_albums ADD FULLTEXT normalized_name_description(normalized_name, normalized_description)",
-                                        "ALTER TABLE {dbprefix}gallery_albums ADD KEY parent_id(parent_id)",
-                                        "ALTER TABLE {dbprefix}gallery_albums ADD KEY owner_id(owner_id)",
-                                        "ALTER TABLE {dbprefix}gallery_albums ADD KEY mangled_name(mangled_name)",
-                                        "ALTER TABLE {dbprefix}gallery_albums ADD KEY owner_id_mangled_name(owner_id,mangled_name)");
-
-    $Changes["Gallery Resources"] = Array( "ALTER TABLE {dbprefix}gallery_resources ADD COLUMN normalized_description TEXT NOT NULL DEFAULT ''",
-                                           "ALTER TABLE {dbprefix}gallery_resources ADD FULLTEXT normalized_description(normalized_description)",
-                                           "ALTER TABLE {dbprefix}gallery_resources ADD KEY album_id(album_id)",
-                                           "ALTER TABLE {dbprefix}gallery_resources ADD KEY owner_id(owner_id)",
-                                           "ALTER TABLE {dbprefix}gallery_resources ADD KEY file_name(file_name)",
-                                           "ALTER TABLE {dbprefix}gallery_resources ADD KEY album_id_owner_id(album_id,owner_id)",
-                                           "ALTER TABLE {dbprefix}gallery_resources ADD KEY resource_type(resource_type)");
-
-
-    $Changes["Links"] = Array( "ALTER TABLE {dbprefix}mylinks ADD COLUMN properties TEXT NOT NULL DEFAULT ''",
-                               "ALTER TABLE {dbprefix}mylinks ADD COLUMN date TIMESTAMP(14)",
-                               "ALTER TABLE {dbprefix}mylinks ADD COLUMN rss_feed VARCHAR(255) NOT NULL DEFAULT ''",
-                               "ALTER TABLE {dbprefix}mylinks ADD KEY blog_id(blog_id)",
-                               "ALTER TABLE {dbprefix}mylinks ADD KEY category_id(category_id)");
-
-    $Changes["Links Categories"] = Array( "ALTER TABLE {dbprefix}mylinks_categories ADD COLUMN properties TEXT NOT NULL DEFAULT ''",
-                                          "ALTER TABLE {dbprefix}mylinks_categories ADD KEY blog_id(blog_id)");
-
-    $Changes["Users"] = Array( "ALTER TABLE {dbprefix}users ADD COLUMN full_name VARCHAR(255) NOT NULL DEFAULT ''",
-                                "ALTER TABLE {dbprefix}users ADD COLUMN properties TEXT NOT NULL DEFAULT ''",
-                                "ALTER TABLE {dbprefix}users ADD COLUMN resource_picture_id INTEGER(10) NOT NULL DEFAULT 0",
-                                "ALTER TABLE {dbprefix}users ADD COLUMN status INTEGER(4) NOT NULL DEFAULT 1" );
-
-    $Changes["Bayesian Filter data table"] = Array( "ALTER TABLE {dbprefix}bayesian_filter_info ADD KEY blog_id(blog_id)" );
-
-    $Changes["Permissions"] = Array( "ALTER TABLE {dbprefix}users_permissions ADD KEY user_id(user_id)",
-                                     "ALTER TABLE {dbprefix}users_permissions ADD KEY blog_id(blog_id)",
-                                     "ALTER TABLE {dbprefix}users_permissions ADD KEY user_id_permission_id(user_id,permission_id)");
-
-   // ---
-
-   // ---
-   // end of changes needed in 1.0
-   // ---
-
-$Inserts[0] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('comments_enabled','1',1);";
-$Inserts[1] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('rdf_enabled','1',1);";
-$Inserts[2] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('temp_folder','./tmp',3);";
-$Inserts[3] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('base_url','{plog_base_url}',3);";
-$Inserts[4] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('show_posts_max','15',1);";
-$Inserts[5] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('recent_posts_max','10',1);";
-$Inserts[6] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_template','standard',3);";
-$Inserts[7] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('template_folder','./templates',3);";
-$Inserts[8] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_blog_id','1',1);";
-$Inserts[9] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_locale','en_UK',3);";
-$Inserts[10] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('html_allowed_tags_in_comments','<a><i><br><br/><b>',3);";
-$Inserts[11] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('referer_tracker_enabled','1',1);";
-$Inserts[12] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('rss_parser_enabled','1',1);";
-$Inserts[13] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('show_more_enabled','1',1);";
-$Inserts[14] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('show_more_threshold','150',1);";
-$Inserts[15] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('update_article_reads','1',1);";
-$Inserts[16] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('email_service_enabled','1',1);";
-$Inserts[17] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('post_notification_source_address','noreply at your.host.com',3);";
-$Inserts[18] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('request_format_mode','1',1);";
-$Inserts[19] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xmlrpc_ping_hosts','a:2:{i:0;s:27:\"http://rpc.weblogs.com/RPC2\";i:1;s:0:\"\";}',5);";
-$Inserts[20] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('trackback_server_enabled','1',1);";
-$Inserts[21] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('htmlarea_enabled','1',1);";
-$Inserts[22] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('plugin_manager_enabled','1',1);";
-$Inserts[23] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('check_email_address_validity','0',1);";
-$Inserts[24] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('summary_page_show_max','15',1);";
-$Inserts[25] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('minimum_password_length','4',1);";
-$Inserts[26] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('templates','a:3:{i:0;s:7:\"blueish\";i:1;s:4:\"grey\";i:2;s:8:\"standard\";}',5);";
-$Inserts[27] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('locales','a:0:{}',5)";
-$Inserts[28] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('email_service_type','php',3);";
-$Inserts[29] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_host','your.smtp.host.com',3);";
-$Inserts[30] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_port','25',1);";
-$Inserts[31] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_use_authentication','0',1);";
-$Inserts[32] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_username','',3);";
-$Inserts[33] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_password','',3);";
-$Inserts[34] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('locale_folder','./locale',3);";
-$Inserts[35] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xmlrpc_ping_enabled','0',1);";
-$Inserts[36] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_tar','{path_to_tar}',3);";
-$Inserts[37] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_gzip','{path_to_gzip}',3);";
-$Inserts[38] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_bz2','{path_to_bz2}',3);";
-$Inserts[39] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_unzip','{path_to_unzip}',3);";
-$Inserts[40] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('users_can_add_templates',1,1);";
-$Inserts[41] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('maximum_file_upload_size', 2000000, 1);";
-$Inserts[42] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('upload_forbidden_files', '*.php *.php3 *.php4 *.phtml *.htm *.html *.exe *.com *.bat .htaccess *.sh', 3);";
-$Inserts[43] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('comments_order', 1, 1);";
-$Inserts[44] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('security_pipeline_enabled', 1, 1);";
-$Inserts[45] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('maximum_comment_size', 0, 1 );";
-$Inserts[46] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('resources_enabled', 1, 1 );";
-$Inserts[47] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnail_method', 'gd', 3);";
-$Inserts[48] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_convert', '{path_to_convert}', 3);";
-$Inserts[49] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnail_height', 120, 1);";
-$Inserts[50] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnail_width', 120, 1);";
-$Inserts[51] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnails_keep_aspect_ratio', 1, 1);";
-$Inserts[52] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xmlrpc_api_enabled', 1, 1);";
-$Inserts[53] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('uploads_enabled', 1, 1);";
-$Inserts[54] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_rss_profile', 'rss090', 3);";
-$Inserts[55] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_enabled', 1, 2);";
-$Inserts[56] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_spam_probability_treshold', '0.9', 6);";
-$Inserts[57] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_nonspam_probability_treshold', '0.2', 6);";
-$Inserts[58] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_min_length_token', '3', 1);";
-$Inserts[59] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_max_length_token', '100', 1);";
-$Inserts[60] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_number_significant_tokens', 15, 1);";
-$Inserts[61] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_spam_comments_action', 0, 1 );";
-$Inserts[62] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('ip_address_filter_enabled', 1, 1 );";
-$Inserts[63] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('content_filter_enabled', 0, 1 );";
-$Inserts[64] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('thumbnail_format','same',3);";
-$Inserts[65] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resources_folder','./gallery/',3);";
-$Inserts[66] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('beautify_comments_text', '1', 1);";
-$Inserts[67] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('disable_apache_error_handler', '0', 1);";
-$Inserts[68] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('show_future_posts_in_calendar', '0', 1);";
-$Inserts[69] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('xhtml_converter_enabled', '1', 1);";
-$Inserts[70] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('xhtml_converter_aggresive_mode_enabled', '0', 1);";
-$Inserts[71] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('search_engine_enabled', '1', 1);";
-$Inserts[72] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('search_in_custom_fields', '1', 1);";
-$Inserts[73] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('search_in_comments', '1', 1);";
-$Inserts[74] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resources_quota', '0', 1);";
-$Inserts[75] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('category_link_format', '/blog/{blogname}/{catname}$', 3);";
-$Inserts[76] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('blog_link_format', '/blog/{blogname}$', 3);";
-$Inserts[77] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('archive_link_format', '/blog/{blogname}/archives/{year}/?{month}/?{day}', 3);";
-$Inserts[78] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('user_posts_link_format', '/blog/{blogname}/user/{username}$', 3);";
-$Inserts[79] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('post_trackbacks_link_format', '/blog/{blogname}/post/trackbacks/{postname}$', 3);";
-$Inserts[80] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_link_format', '/blog/{blogname}/page/{templatename}$', 3);";
-$Inserts[81] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('album_link_format', '/blog/{blogname}/album/{albumname}$', 3);";
-$Inserts[82] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resource_link_format', '/blog/{blogname}/resource/{albumname}/{resourcename}$', 3);";
-$Inserts[83] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resource_preview_link_format', '/blog/{blogname}/resource/{albumname}/preview/{resourcename}$', 3);";
-$Inserts[84] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resource_download_link_format', '/blog/{blogname}/resource/{albumname}/download/{resourcename}$', 3);";
-$Inserts[85] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('permalink_format', '/blog/{blogname}/{catname}/{year}/{month}/{day}/{postname}$', 3);";
-$Inserts[86] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('script_name', 'index.php', 3);";
-$Inserts[87] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('thumbnail_generator_use_smoothing_algorithm', '0', 1);";
-$Inserts[88] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resource_server_use_http_caching', '1', 1);";
-$Inserts[89] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('medium_size_thumbnail_width', '640', 1);";
-$Inserts[90] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('medium_size_thumbnail_height', '480', 1);";
-$Inserts[91] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resource_medium_size_preview_link_format', '/blog/{blogname}/resource/{albumname}/preview-med/{resourcename}$', 3);";
-$Inserts[92] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('subdomains_enabled', '0', 1);";
-$Inserts[93] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('include_blog_id_in_url', '1', 1);";
-$Inserts[94] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('send_xmlrpc_pings_enabled_by_default', '1', 1);";
-$Inserts[95] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('forbidden_usernames', 'admin www blog ftp wiki forums', 3);";
-$Inserts[96] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('force_registration_confirmation', '0', 1);";
-$Inserts[97] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('summary_blogs_per_page', '25', 3);";
-$Inserts[98] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('subdomains_base_url', '', 3);";
-$Inserts[99] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('autosave_new_drafts_time_millis', '300000', 3);";
-$Inserts[100] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('save_drafts_via_xmlhttprequest_enabled', '1', 1);";
-$Inserts[101] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('need_email_confirm_registration', '1', 1);";
-$Inserts[102] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('force_one_blog_per_email_account', '0', 1);";
-$Inserts[103] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('summary_show_agreement', '1', 1);";
-$Inserts[104] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('default_time_offset', '0', 3);";
-$Inserts[105] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_cache_enabled', '1', 1);";
-$Inserts[106] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_http_cache_enabled', '0', 1);";
-$Inserts[107] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_http_cache_enabled', '0', 1);";
-$Inserts[108] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_compile_check', '1', 1);";
-$Inserts[109] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('update_cached_article_reads', '1', 1);";
-$Inserts[110] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('allow_php_code_in_templates', '0', 1);";
-$Inserts[111] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('thumbnail_generator_use_smoothing_algorithm', '1', 1);";
-
-
-    /**
-     * Open a connection to the database
-     */
-     function connectDb( $ignoreError = false , $selectDatabase = true )
-     {
-        $config = new ConfigFileStorage();
-        // open a connection to the database
-        $db = NewADOConnection( 'mysql' );
-        if ( $selectDatabase ) {
-            $res = $db->Connect($config->getValue( "db_host" ), $config->getValue( "db_username" ), $config->getValue( "db_password" ), $config->getValue( "db_database" ));
-        } else {
-            $res = $db->Connect($config->getValue( "db_host" ), $config->getValue( "db_username" ), $config->getValue( "db_password" ));
-        }
-
-        if( DB_WIZARD_DEBUG )
-            $db->debug = true;
-
-        // return error
-        if( $ignoreError )
-            return $db;
-
-        if( !$res )
-            return false;
-
-        return $db;
-    }
-
-    /**
-     * Returns the database prefix
-     */
-    function getDbPrefix()
-    {
-        $config = new ConfigFileStorage();
-        return $config->getValue( "db_prefix" );
-    }
-
-    /**
-     * some useful little functions
-     */
-    class WizardTools extends Object
-    {
-       /**
-        * returns true if plog has already been installed before or
-        * false otherwise
-        */
-       function isNewInstallation()
-       {
-           $configFile = new ConfigFileStorage();
-           // if plog hasn't been installed, this file will have empty settings
-           if( $configFile->getValue( "db_host") == "" && $configFile->getValue( "db_username") == "" &&
-               $configFile->getValue( "db_database") == "" && $configFile->getValue( "db_prefix" ) == "" &&
-               $configFile->getValue( "db_password" ) == "" )
-               $isNew = true;
-           else
-               $isNew = false;
-
-           return( $isNew );
-       }
-    }
-
-    /**
-     * Renders a template file.
-     */
-    class WizardView extends View
-    {
-
-        var $_templateName;
-
-        function WizardView( $templateName )
-        {
-            $this->View();
-            $this->_templateName = $templateName;
-        }
-
-        function render()
-        {
-            // build the file name
-            $templateFileName = "wizard/".$this->_templateName.".template";
-
-            //$t = new Template( $templateFileName, "" );
-            $t = new Smarty();
-            $v = new Version();
-            $this->_params->setValue( "version", $v->getVersion());
-            $this->_params->setValue( "projectPage", $v->getProjectPage());
-            $this->_params->setValue( "safeMode", ini_get("safe_mode"));
-            $t->assign( $this->_params->getAsArray());
-            $t->template_dir    = "./templates";
-            $t->compile_dir     = TEMP_FOLDER;
-            $t->cache_dir       = TEMP_FOLDER;
-            $t->use_sub_dirs    = false;
-            $t->caching = false;
-
-            print $t->fetch( $templateFileName );
-        }
-    }
-
-    /**
-     * Gets the information about the database from the user.
-     */
-    class WizardIntro extends Action
-    {
-        function WizardIntro( $actionInfo, $request )
-        {
-            $this->Action( $actionInfo, $request );
-        }
-
-        function perform()
-        {
-            // we can detect whether plog is already installed or not and direct users to the right
-            // place
-            if( WizardTools::isNewInstallation())
-                $this->_view = new WizardView( "intro" );
-            else {
-                Controller::setForwardAction( "Update1" );
-                return false;
-            }
-
-            $this->setCommonData();
-            return true;
-        }
-    }
-
-    /**
-     *
-     * Saves data to the configuration file
-     *
-     */
-    class WizardStepOne extends Action
-    {
-
-        var $_dbServer;
-        var $_dbUser;
-        var $_dbPassword;
-        var $_dbName;
-        var $_dbPrefix;
-
-        function WizardStepOne( $actionInfo, $request )
-        {
-            $this->Action( $actionInfo, $request );
-
-            // data validation
-            $this->registerFieldValidator( "dbServer", new StringValidator());
-            $this->registerFieldValidator( "dbUser", new StringValidator());
-            $this->registerFieldValidator( "dbPassword",  new StringValidator(), true );
-            $this->registerFieldValidator( "dbName", new StringValidator());
-            $this->registerFieldValidator( "dbPrefix", new StringValidator(), true );
-            $errorView = new WizardView( "intro" );
-            $errorView->setErrorMessage( "Some data was incorrect or missing." );
-            $this->setValidationErrorView( $errorView );
-        }
-
-        function perform()
-        {
-            // fetch the data needed from the request
-            $this->_dbServer   = $this->_request->getValue( "dbServer" );
-            $this->_dbUser     = $this->_request->getValue( "dbUser" );
-            $this->_dbPassword = $this->_request->getValue( "dbPassword" );
-            $this->_dbName     = $this->_request->getValue( "dbName" );
-            $this->_skipThis   = $this->_request->getValue( "skipDbInfo" );
-            $this->_dbPrefix   = $this->_request->getValue( "dbPrefix", DEFAULT_DB_PREFIX );
-
-            // we should now save the data to the configuration file, just before
-            // we read it
-            $configFile = new ConfigFileStorage();
-
-            // we expect everything to be fine
-            $errors = false;
-
-            // before doing anything, we should check of the configuration file is
-            // writable by this script, or else, throw an error and bail out gracefully
-            $configFileName = $configFile->getConfigFileName();
-            if( !File::exists( $configFileName )) {
-                if (! File::touch( $configFileName ) ) {
-                    $this->_view = new WizardView( "intro" );
-                    $message = "Could not create the pLog configuration file $configFileName. Please make sure
-                                that the file can be created by the user running the webserver. It is needed to
-                                store the database configuration settings.";
-                    $this->_view->setErrorMessage( $message );
-                    $this->setCommonData( true );
-                    return false;
-                } else {
-                    ConfigFileStorage::createConfigFile( $configFileName );
-                }
-            }
-            if( File::exists( $configFileName ) && !File::isWritable( $configFileName )) {
-                $this->_view = new WizardView( "intro" );
-                $message = "Please make sure that the file $configFileName can be written by this script during
-                            the installation process. It is needed to store the database configuration settings. Once the
-                            installation is complete, please revert the permissions to no writing possible.";
-                $this->_view->setErrorMessage( $message );
-                $this->setCommonData( true );
-                return false;
-            }
-
-            // continue if everything went fine
-            if( !$configFile->saveValue( "db_username", $this->_dbUser ) ||
-                !$configFile->saveValue( "db_password", $this->_dbPassword ) ||
-                !$configFile->saveValue( "db_host", $this->_dbServer ) ||
-                !$configFile->saveValue( "db_database", $this->_dbName ) ||
-                !$configFile->saveValue( "db_prefix", $this->_dbPrefix )) {
-                $errors = true;
-            }
-
-            if( $errors ) {
-                $message = "Could not save values to the configuration file. Please make sure it is available and
-                            that has write permissions for the user under your web server is running.";
-                $this->_view = new WizardView( "intro" );
-                $this->_view->setErrorMessage( $message );
-
-                return( false );
-            }
-            else {
-                $this->_view = new WizardView( "step1" );
-
-                // now we better read the information from the config file to make sure that
-                // it has been correctly saved
-                $this->setCommonData( true );
-
-                return true;
-            }
-        }
-    }
-
-    /**
-     *
-     * Second step where we connect to the database and create the tables.
-     *
-     */
-    class WizardStepTwo extends Action
-    {
-
-        var $_db;
-        var $_database;
-        var $_createDatabase;
-
-        function setDbConfigValues( &$view )
-        {
-            $configFile = new ConfigFileStorage();
-            $configFile->reload();
-            $view->setValue( "dbUser", $configFile->getValue( "db_username" ));
-            $view->setValue( "dbPassword", $configFile->getValue( "db_password" ));
-            $view->setValue( "dbServer", $configFile->getValue( "db_host" ));
-            $view->setValue( "dbName", $configFile->getValue( "db_database" ));
-            $view->setValue( "dbPrefix", $configFile->getValue( "db_prefix" ));
-            return true;
-        }
-
-        function perform()
-        {
-            global $Tables;
-            global $Inserts;
-
-            $createDb = $this->_request->getValue( "createDatabase" );
-
-            // only check for errors in case the database table should already exist!
-            if( !$createDb ) {
-                $connectionEsablished = false;
-
-                // Lets check the 'everything is fine' case first..
-                $this->_db = connectDb();
-                if( $this->_db ) {
-                     $connectionEsablished = true;
-                } else {
-                     $connectionEsablished = false;
-                     $message = "There was an error selecting the database. Please verify the database was already created or check the 'Create database' checkbox.";
-                }
-
-                // We were unable to connect to the db and select the right db.. lets try
-                // just to connect.. maybe the database needs to be created (even though the
-                // user did not check the appropriate box).
-                if ( !$connectionEsablished ) {
-                    $this->_db = connectDb( true, false );
-                    if( !$this->_db ) {
-                         $message = "There was an error connecting to the database. Please check your settings.";
-                    }
-                }
-
-                if ( !$connectionEsablished ) {
-                    $this->_view = new WizardView( "step1" );
-                    $this->setDbConfigValues( $this->_view );
-                    $this->_view->setErrorMessage( $message );
-                    $this->setCommonData( true );
-                    return false;
-                }
-            }
-
-            $config = new ConfigFileStorage();
-            $this->_database = $config->getValue( "db_database" );
-            $this->_dbPrefix = $config->getValue( "db_prefix" );
-
-            // create the database
-            if( $createDb ) {
-                $this->_db = connectDb( false, false );
-                if( !$this->_db->Execute( "CREATE DATABASE ".$this->_database )) {
-                    $message = "Error creating the database: ".$this->_db->ErrorMsg();
-                    $this->_view = new WizardView( "step1" );
-                    $this->setDbConfigValues( $this->_view );
-                    $this->_view->setErrorMessage( $message );
-                    $this->setCommonData( true );
-                    return false;
-                } else {
-                    $message = "Database created successfully.<br/>";
-                }
-            }
-
-            // reconnect using the new database.
-            $config = new ConfigFileStorage();
-            $this->_db->Connect($config->getValue( "db_host" ), $config->getValue( "db_username" ), $config->getValue( "db_password" ), $config->getValue( "db_database" ));
-
-            // create the tables
-            $errors = false;
-            foreach( $Tables as $table ) {
-                $query = str_replace( "{dbprefix}", $this->_dbPrefix, $table["code"] );
-                if( $this->_db->Execute( $query ))
-                    $message .= "Table <strong>".$table["desc"]."</strong> created successfully.<br/>";
-                else {
-                    $message .= "Error creating table: ".$this->_db->ErrorMsg()."<br/>";
-                    $errors = true;
-                }
-            }
-
-            if( $errors ) {
-                $message = "There was an error creating the tables in the database. Please make sure that the user chosen to connect to the database has enough permissions to create tables.<br/><br/>$message";
-                $this->_view = new WizardView( "step1" );
-                $this->_view->setErrorMessage( $message );
-                $this->setDbConfigValues( $this->_view );
-                $this->setCommonData();
-                return false;
-            }
-
-            // try to guess the url where plog is running
-             // try to guess the url where plog is running
-             $httpProtocol = (array_key_exists("HTTPS", $_SERVER) && $_SERVER["HTTPS"] == "on") ? "https://" : "http://";
-             $httpHost = $_SERVER["HTTP_HOST"];
-             $requestUrl = $_SERVER["REQUEST_URI"];
-             $requestUrl = str_replace( "/wizard.php", "", $requestUrl );
-             $plogUrl = $httpProtocol.$httpHost.$requestUrl;
-
-            // Find some of the tools we are going to need (last one is for os x, with fink installed)
-            // TBD: support for Windows specific directories
-            $folders = Array( "/bin/", "/usr/bin/", "/usr/local/bin/", "/sw/bin/" );
-            $finder = new FileFinder();
-            $pathToUnzip = $finder->findBinary( "unzip", $folders );
-            $pathToTar = $finder->findBinary( "tar", $folders);
-            $pathToGzip = $finder->findBinary( "gzip", $folders);
-            $pathToBzip2 = $finder->findBinary( "bzip2", $folders);
-            $pathToConvert = $finder->findBinary( "convert", $folders);
-
-            // and execute some insert's
-            foreach( $Inserts as $insert ) {
-                $query = str_replace( "{dbprefix}", $this->_dbPrefix, $insert );
-                $query = str_replace( "{plog_base_url}", $plogUrl, $query );
-                // replace also the placeholders for the paths to the tools
-                $query = str_replace( "{path_to_tar}", $pathToTar, $query );
-                $query = str_replace( "{path_to_unzip}", $pathToUnzip, $query );
-                $query = str_replace( "{path_to_bz2}", $pathToBzip2, $query );
-                $query = str_replace( "{path_to_gzip}", $pathToGzip, $query );
-                $query = str_replace( "{path_to_convert}", $pathToConvert, $query );
-                $query = str_replace( "{path_to_convert}", $pathToConvert, $query );
-                if( !$this->_db->Execute( $query )) {
-                    $message .= "Error executing code: ".$this->_db->ErrorMsg()."<br/>";
-                    $errors = true;
-                }
-            }
-
-            //
-            // show some information regarding the helper tools we're going to need
-            // and wether they were found or not
-            //
-            $message .= "<br/><b>-- Helper tools --</b><br/>";
-            if( $pathToTar == "" )
-                $message .= "The helper tool 'tar' was not found<br/>";
-            else
-                $message .= "The helper tool 'tar' was found in $pathToTar<br/>";
-            if( $pathToGzip == "" )
-                $message .= "The helper tool 'gzip' was not found<br/>";
-            else
-                $message .= "The helper tool 'gzip' was found in $pathToGzip<br/>";
-            if( $pathToUnzip == "" )
-                $message .= "The helper tool 'unzip' was not found<br/>";
-            else
-                $message .= "The helper tool 'unzip' was found in $pathToUnzip<br/>";
-            if( $pathToBzip2 == "" )
-                $message .= "The helper tool 'bzip2' was not found<br/>";
-            else
-                $message .= "The helper tool 'bzip2' was found in $pathToTar<br/>";
-            if( $pathToConvert == "" )
-                $message .= "The helper tool 'convert' (from the ImageMagick package) was not found<br/>";
-            else
-                $message .= "The helper tool 'convert' (from the ImageMagick package) was found in $pathToConvert<br/>";
-
-            if( $errors ) {
-                $this->_view = new WizardView( "step1" );
-                $this->setDbConfigValues( $this->_view );
-                $message = "There was an error initializing some of the tables. Please make sure that the user chosen to connect to the database has enough permissions to add records to the database.<br/><br/>$message";
-                $this->_view->setErrorMessage( $message );
-                $this->setCommonData();
-            }
-            else {
-                $this->_view = new WizardView( "step2" );
-                $this->_view->setValue( "message", $message );
-            }
-
-            // Scan for locales
-            $locales = new Locales();
-            // find all the new locales that we have not yet stored
-            $f = new LocaleFinder();
-            $newLocaleCodes = $f->find();
-
-            foreach( $newLocaleCodes as $newLocaleCode ) {
-                $res = $locales->addLocale( $newLocaleCode );
-            }
-
-            return true;
-        }
-    }
-
-    /**
-     *
-     * this action only shows some feedback
-     *
-     */
-    class WizardStepThree extends Action
-    {
-        function perform()
-        {
-            $this->_view = new WizardView( "step3" );
-            $this->setCommonData();
-        }
-    }
-
-    /**
-     *
-     * Create the first user in the database
-     *
-     */
-    class WizardStepFour extends Action
-    {
-
-        var $_userName;
-        var $_userPassword;
-        var $_confirmPassword;
-        var $_userEmail;
-        var $_userFullName;
-
-        function WizardStepFour( $actionInfo, $request )
-        {
-            $this->Action( $actionInfo, $request );
-
-            $this->registerFieldValidator( "userName", new StringValidator());
-            $this->registerFieldValidator( "userPassword", new PasswordValidator());
-            $this->registerFieldValidator( "userPasswordCheck", new PasswordValidator());
-            $this->registerFieldValidator( "userEmail", new EmailValidator());
-            $this->registerField( "userFullName" );
-            $view = new WizardView( "step3" );
-            $view->setErrorMessage( "Some data is missing or incorrect" );
-            $this->setValidationErrorView( $view );
-        }
-
-        // creates the user
-        function perform()
-        {
-            $this->_userName = $this->_request->getValue( "userName" );
-            $this->_userPassword = $this->_request->getValue( "userPassword" );
-            $this->_confirmPassword = $this->_request->getValue( "userPasswordCheck" );
-            $this->_userEmail = $this->_request->getValue( "userEmail" );
-            $this->_userFullName = $this->_request->getValue( "userFullName" );
-
-            $db = connectDb();
-
-            if( !$db ) {
-                $this->_view = new WizardView( "step3" );
-                $this->_view->setErrorMessage( "There was an error connecting to the database. Please check your settings." );
-                $this->setCommonData();
-                return false;
-            }
-
-            if( $this->_confirmPassword != $this->_userPassword ) {
-                $this->_view = new WizardView( "step3" );
-                $this->_form->setFieldValidationStatus( "userPasswordCheck", false );
-                $this->setCommonData( true );
-                return false;
-            }
-
-            $dbPrefix = Db::getPrefix();
-
-            $users = new Users();
-            $user = new UserInfo( $this->_userName,
-                                  $this->_userPassword,
-                                  $this->_userEmail,
-                                  "",
-                                  $this->_userFullName);
-            $userId = $users->addUser( $user );
-            if( !$userId ) {
-                $this->_view = new WizardView( "step3" );
-                $message = "There was an error adding the user. Make sure that the user does not already exist in the database (".$users->DbError().")";
-                $this->_view->setErrorMessage( $message );
-                $this->setCommonData();
-                return false;
-            }
-
-            // we also have to execute the code to give administrator privileges to this user
-            $query = "INSERT INTO {$dbPrefix}users_permissions(user_id,blog_id,permission_id) VALUES( $userId, 0, 1 );";
-            $db->Execute( $query );
-
-            $this->_view = new Wizardview( "step4" );
-            $this->_view->setValue( "ownerid", $userId );
-            $this->_view->setValue( "siteLocales", Locales::getLocales());
-            $this->_view->setValue( "defaultLocale", Locales::getDefaultLocale());
-            $ts = new TemplateSets();
-            $this->_view->setValue( "siteTemplates", $ts->getGlobalTemplateSets());
-            $this->setCommonData();
-            return true;
-        }
-
-    }
-
-    class WizardStepFive extends Action
-    {
-
-        var $_blogName;
-        var $_ownerId;
-        var $_blogProperties;
-
-        function WizardStepFive( $actionInfo, $request )
-        {
-              $this->Action( $actionInfo, $request );
-
-              $this->registerFieldValidator( "blogName", new StringValidator());
-              $this->registerFieldValidator( "ownerid", new IntegerValidator());
-              $this->registerFieldValidator( "blogTemplate", new StringValidator());
-              $this->registerFieldValidator( "blogLocale", new StringValidator());
-              $view = new WizardView( "step4" );
-              $view->setErrorMessage( "Some data is missing or incorrect" );
-              $view->setValue( "siteLocales", Locales::getLocales());
-              $ts = new TemplateSets();
-              $view->setValue( "siteTemplates", $ts->getGlobalTemplateSets());
-              $this->setValidationErrorView( $view );
-        }
-
-        function perform()
-        {
-            // retrieve the values from the view
-            $this->_blogName = $this->_request->getValue( "blogName" );
-            $this->_ownerId  = $this->_request->getValue( "ownerid" );
-            $this->_blogProperties = $this->_request->getValue( "properties" );
-            $this->_blogTemplate = $this->_request->getValue( "blogTemplate" );
-            $this->_blogLocale = $this->_request->getValue( "blogLocale" );
-
-            // configure the blog
-            $blogs = new Blogs();
-            $blog = new BlogInfo( $this->_blogName, $this->_ownerId, "", "" );
-            $blog->setProperties( $this->_blogProperties );
-            $blog->setStatus( BLOG_STATUS_ACTIVE );
-            $blogSettings = $blog->getSettings();
-            $blogSettings->setValue( "locale", $this->_blogLocale );
-            $blogSettings->setValue( "template", $this->_blogTemplate );
-            $blog->setSettings( $blogSettings );
-
-            // and now save it to the database
-            $newblogId = $blogs->addBlog( $blog );
-            if( !$newblogId ) {
-                $this->_view = new WizardView( "step4" );
-                $this->_view->setValue( "siteLocales", Locales::getLocales());
-                $ts = new TemplateSets();
-                $this->_view->setValue( "siteTemplates", $ts->getGlobalTemplateSets());
-                $this->_view->setErrorMessage( "There was an error creating the new blog" );
-                $this->setCommonData( true );
-                return false;
-            }
-
-            // if the blog was created, we can add some basic information
-            // add a category
-            $articleCategories = new ArticleCategories();
-            $articleCategory = new ArticleCategory( "General", "", $newblogId, true );
-            $catId = $articleCategories->addArticleCategory( $articleCategory );
-
-            // load the right locale
-            $locale =& Locales::getLocale( $this->_blogLocale );
-            // and load the right text
-            $articleTopic = $locale->tr( "register_default_article_topic" );
-            $articleText  = $locale->tr( "register_default_article_text" );
-            $article = new Article( $articleTopic, $articleText, Array( $catId ), $this->_ownerId, $newblogId, POST_STATUS_PUBLISHED, 0, Array(), "welcome" );
-            $t = new Timestamp();
-            $article->setDateObject( $t );
-            $articles = new Articles();
-            $articles->addArticle( $article );
-
-            // save a few things in the default configuration
-            $config =& Config::getConfig();
-            // default blog id
-            $config->saveValue( "default_blog_id", (int)$newblogId );
-            // default locale
-            $config->saveValue( "default_locale", $this->_blogLocale );
-            // and finally, the default template
-            $config->saveValue( "default_template", $this->_blogTemplate );
-
-            //
-            // detect wether we have GD available and set the blog to use it
-            //
-            if( GdDetector::detectGd()) {
-                $config->saveValue( "thumbnail_method", "gd" );
-                $message = "GD has been detected and set as the backend for dealing with images.";
-            }
-            else {
-                $pathToConvert = $config->getValue( "path_to_convert" );
-                if( $pathToConvert ) {
-                    $config->saveValue( "thumbnail_method", "imagemagick" );
-                    $message = "ImageMagick has been detected and set as the backend for dealing with images.";
-                }
-                else {
-                    // nothing was found, so we'll have to do away with the 'null' resizer...
-                    $config->saveValue( "thumbnail_method", "null" );
-                    $message = "Neither GD nor ImageMagick have been detected in this host so it will not be possible to generate thumbnails from images.";
-                }
-            }
-
-            $this->_view = new WizardView( "step5" );
-            $this->_view->setValue( "message", $message );
-            return true;
-        }
-    }
-
-    //
-    // The following classes take care of updating the database to the last release
-    //
-    // Things that need to be done when going from 0.3.x to 1.0:
-    //
-    // - add the new tables:
-    //     plog_article_categories_link
-    //     plog_custom_fields_definition
-    //     plog_custom_fields_values
-    //
-    // - make modifications to some of the old tables:
-    //     plog_articles
-    //          normalized_text: TEXT
-    //          normalized_topic: TEXT
-    //          mangled_topic: TEXT
-    //          category_id: DROP
-    //          FULLTEXT(normalized_text)
-    //          FULLTEXT(normalized_topic)
-    //          FULLTEXT(normalized_text, normalized_topic)
-    //     plog_articles_categories
-    //          parent_id: INTEGER
-    //          mangled_name: TEXT
-    //          properties: TEXT
-    //     plog_articles_comments
-    //          normalized_text: TEXT
-    //          normalized_topic: TEXT
-    //          FULLTEXT(normalized_text)
-    //          FULLTEXT(normalized_topic)
-    //          FULLTEXT(normalized_text, normalized_topic)
-    //     plog_blogs
-    //          mangled_blog: TEXT
-    //          properties: TEXT
-    //     plog_gallery_albums
-    //          normalized_name: VARCHAR
-    //          normalized_description: TEXT
-    //          mangled_name: VARCHAR
-    //          FULLTEXT(normalized_name)
-    //          FULLTEXT(normalized_description)
-    //          FULLTEXT(normalized_name, normalized_description)
-    //     plog_gallery_resources
-    //          normalized_description: TEXT
-    //          FULLTEXT(normalized_description)
-    //     plog_mylinks
-    //          properties: TEXT
-    //     plog_mylinks_categories
-    //          properties: TEXT
-    //     plog_users
-    //          properties: TEXT
-    //          full_name: VARCHAR
-    //
-    // - for all the articles in the db, fill in the normalized_text, normalized_topic and mangled_topic
-    //   fields using the TextFilter class
-    //
-    // - for all articles in the db, change the status from a string ('published', 'draft', 'deleted') to
-    // an integer (POST_STATUS_{PUBLISHED|DELETED|DRAFT}
-    //
-    // - for all articles and categories, arrange the plog_article_categories_link table so that everything works
-    //   as before
-    //
-    // - for all article categories, fill in the mangled_name field
-    //
-    // - for all comments, fill in the normalized_text and normalized_topic fields
-    //
-    // - for all blogs, fill in the mangled_blog field
-    //
-    // - for all albums, fill in the normalized_name, normalized_description and mangled_name fields
-    //
-    // - for all resources, fill in the normalized_description field
-
-
-    class UpdateStepOne extends Action
-    {
-
-        function perform()
-        {
-            $this->_view = new WizardView( "update1" );
-            WizardStepTwo::setDbConfigValues( $this->_view );
-            $this->setCommonData();
-        }
-    }
-
-    class UpdateStepTwo extends Action
-    {
-
-        var $_db;
-        var $_dbPrefix;
-
-        function validate()
-        {
-            $configFile = new ConfigFileStorage();
-            $this->_dbPrefix = $configFile->getValue( "db_prefix" );
-
-            return true;
-        }
-
-        function perform()
-        {
-            // we need to create the new tables here
-            $newTables = Array( 21, 22, 23, 24 );
-
-            global $Tables;
-            global $Changes;
-            global $Inserts;
-
-            // connect to the db
-            $this->_db = connectDb();
-
-            // store error messages in this var
-            $message = "";
-
-            if( !$this->_db ) {
-                $this->_view = new WizardView( "update1" );
-                WizardStepTwo::setDbConfigValues( $this->_view );
-                $this->_view->setErrorMessage( "There was an error connecting to the database. Please check your settings." );
-                return false;
-            }
-
-            // ---
-            // create the new tables in 1.0
-            // ---
-            // loop only through the new tables
-            foreach( $newTables as $tableId ) {
-                // get info about the table we'd like to use
-                $table = $Tables[$tableId];
-                // and run the query
-                $query = str_replace( "{dbprefix}", $this->_dbPrefix, $table["code"] );
-                if( $this->_db->Execute( $query ))
-                    $message .= "New table <strong>".$table["desc"]."</strong> created successfully.<br/>";
-                else {
-                    $message .= "Error creating table: ".$this->_db->ErrorMsg()."<br/>";
-                    $errors = true;
-                }
-            }
-            if( !$errors ) {
-                $message .= "** New tables created successfully **<br/><br/>";
-            }
-
-            // ---
-            // make changes to the tables that need changes
-            // ---
-            foreach( $Changes as $tableId => $changeTable) {
-                foreach( $changeTable as $changeCode ) {
-                    // and run the query
-                    $query = str_replace( "{dbprefix}", $this->_dbPrefix, $changeCode );
-                    if( !$this->_db->Execute( $query )) {
-                        $errors = true;
-                    }
-                }
-
-                if( !$errors )
-                    $message .= "Changes to table <strong>$tableId</strong> executed successfully.<br/>";
-                else {
-                    $message .= "Error modifying table $tableId: ".$this->_db->ErrorMsg()."<br/>";
-                }
-            }
-
-            if( !$errors ) {
-                $message .= "** Modifications to old tables carried out successfully **<br/><br/>";
-            }
-
-            // ---
-            // add the new configuration settings that were added for 1.0
-            // ---
-            $newSettings = range( 71, 111 );
-            foreach( $newSettings as $settingId ) {
-                $setting = $Inserts[$settingId];
-                $query = str_replace( "{dbprefix}", $this->_dbPrefix, $setting );
-                if( !$this->_db->Execute( $query )) {
-                    $message .= "There was an error executing: ".$this->_db->ErrorMsg()."<br/>";
-                    $errors = true;
-                }
-            }
-
-            //
-            // there's nothing left to do so we can quit now!!
-            //
-            if( !$errors ) {
-                $this->_view = new WizardView( "update2" );
-                $this->_view->setValue( "message", $message );
-            }
-            else {
-                $this->_view = new WizardView( "update1" );
-                WizardStepTwo::setDbConfigValues( $this->_view );
-                $this->_view->setErrorMessage( $message );
-            }
-
-            return true;
-        }
-    }
-
-    /**
-     * this is the first step of the transformations to some of the fields in the tables.
-     * Precisely, it is in this step where we regenerate the indexes for the search engine... However, it
-     * could take it a while...
-     */
-    class UpdateStepThree extends Action
-    {
-        function UpdateStepThree( $actionInfo, $httpRequest )
-        {
-            $this->Action( $actionInfo, $httpRequest );
-
-            // load the current step, if any
-            $this->_curStep = $this->_request->getValue( "curStep" );
-            $this->_numPosts = $this->_request->getValue( "numPosts" );
-
-            //print("cur step = ".$this->_curStep." - num posts = ".$this->_numPosts."<br/>");
-        }
-
-        function getStatusId( $statusStr )
-        {
-            if( $statusStr == 'published' ) return POST_STATUS_PUBLISHED;
-            if( $statusStr == 'draft' ) return POST_STATUS_DRAFT;
-            if( $statusStr == 'deleted' ) return POST_STATUS_DELETED;
-
-            return false;
-        }
-
-       function perform()
-       {
-            // get a connection to the db
-            $db = connectDb();
-            $dbPrefix = getDbPrefix();
-            $db->debug=false;
-
-            // no errors here
-            $errors = false;
-
-            // see how many records we have
-            $queryCount = "SELECT COUNT(*) AS total FROM {$dbPrefix}articles";
-            $result = $db->Execute( $queryCount );
-            $row = $result->FetchRow();
-            $numRecords = $row["total"];
-            $this->_totalPosts = $numRecords;
-            // check whether we should use multiple steps
-            $multipleSteps = ( $numRecords > WIZARD_MAX_RECORDS_THRESHOLD );
-            if( $multipleSteps ) {
-                // how many steps do we need?
-                $numSteps = ceil( $numRecords / WIZARD_MAX_RECORDS_PER_STEP );
-                $this->_numSteps = $numSteps;
-                //print("using different steps! numSteps = $numSteps<br/>");
-            }
-
-            // run the query and loop through the results
-            $query = "SELECT * FROM {$dbPrefix}articles";
-            if( $multipleSteps ) {
-                // generate the LIMIT condition for this page
-                $query .= " LIMIT ".$this->_curStep*WIZARD_MAX_RECORDS_PER_STEP.", ".WIZARD_MAX_RECORDS_PER_STEP;
-            }
-
-            //print("query = $query<br/>");
-
-            $result = $db->Execute( $query );
-
-            $tf = new TextFilter();
-
-            $numPosts = $result->RowCount();
-
-            while( $row = $result->FetchRow()) {
-                // for each one of the articles, fill in the mangled_topic, normalized_text and normalized_value
-                $normalizedTopic = Db::qstr($tf->normalizeText( $row["topic"] ));
-                $postTopic       = Db::qstr($row["topic"]);
-                $normalizedText  = Db::qstr($tf->normalizeText( $row["text"] ));
-                $postText        = Db::qstr($row["text"]);
-                $mangledTopic    = Db::qstr($tf->urlize( $row["topic"] ));
-                $status          = $this->getStatusId( $row["old_status"] );
-                $artId           = $row["id"];
-                $catId           = $row["category_id"];
-
-                $query = "UPDATE {$dbPrefix}articles SET slug = '$mangledTopic', date = date, status = $status
-                          WHERE id = $artId";
-
-                $query2= "INSERT INTO {$dbPrefix}article_categories_link(article_id, category_id)
-                          VALUES ( $artId, $catId )";
-
-                $query3= "INSERT INTO {$dbPrefix}articles_text (article_id,text,topic,normalized_text,normalized_topic,mangled_topic)
-                          VALUES('$artId','$postText','$postTopic','$normalizedTopic','$normalizedText','$mangledTopic')";
-
-
-                // execute the two queries
-                $res  = $db->Execute( $query );
-                $res2 = $db->Execute( $query2 );
-                $res3 = $db->Execute( $query3 );
-
-                /*if( !$res || !$res2 || !$res3 )
-                    $errors = true;*/
-            }
-
-            // check whether we've already done the last step or not
-            $lastStepDone = ( $this->_curStep >= $this->_numSteps );
-
-            // if error
-            if( $errors ) {
-                $this->_view = new WizardView( "update2" );
-                $this->_view->setErrorMessage( "There was an error updating the articles table." );
-                $this->setCommonData();
-                return false;
-            }
-
-            //$query1 = "ALTER TABLE {$dbPrefix}articles DROP COLUMN old_status, DROP COLUMN category_id";
-            //$db->Execute( $query1 );
-
-            // if everyhting's fine, say so...
-            if( !$multipleSteps || $lastStepDone ) {
-                $this->_view = new WizardView( "update3" );
-                $this->_view->setValue( "totalPosts", $this->_totalPosts );
-            }
-            else {
-                // if we're using multiple steps, show the same page
-                $this->_view = new WizardView( "update2" );
-                $this->_view->setValue( "numPosts", $numPosts );
-                $this->_view->setValue( "curStep", $this->_curStep+1 );
-                $this->_view->setValue( "totalPosts", $this->_totalPosts );
-                $this->_view->setValue( "numSteps", $this->_numSteps );
-                $this->_view->setValue( "multipleSteps", true );
-            }
-
-            return true;
-        }
-
-    }
-
-    // ---
-    // this action will do the same as before but for the rest of the tables that need some data to
-    // be normalized/mangled
-    // ---
-    class UpdateStepFour extends Action
-    {
-
-        var $dbPrefix;
-        var $db;
-        var $t;
-
-        function validate()
-        {
-            $this->db = connectDb();
-            $this->dbPrefix = getDbPrefix();
-            $this->t = new TextFilter();
-
-            return true;
-        }
-
-        //
-        // process the article categories
-        //
-        function updateArticleCategories()
-        {
-            $dbPrefix = $this->dbPrefix;
-            $query = "SELECT * FROM {$dbPrefix}articles_categories";
-            $result = $this->db->Execute( $query );
-
-            while( $row = $result->FetchRow()) {
-                $catId = $row["id"];
-                $mangledName = $this->t->urlize( $row["name"] );
-                $query = "UPDATE {$dbPrefix}articles_categories
-                          SET mangled_name = '$mangledName', last_modification = last_modification
-                          WHERE id = $catId";
-
-                $res = $this->db->Execute( $query );
-
-                // this is not very nice to see but it works... :)
-                if( !$res ) {
-                    $this->message .= "There was an error updating the article categories table.<br/>";
-                    return false;
-                }
-            }
-
-            $this->message .= "Article Categories table updated successfully!<br/>";
-
-            return true;
-        }
-
-        //
-        // process the comments
-        //
-        function updateArticleComments()
-        {
-            $dbPrefix = $this->dbPrefix;
-            $query = "SELECT * FROM {$dbPrefix}articles_comments";
-            $result = $this->db->Execute( $query );
-
-            while( $row = $result->FetchRow()) {
-                $commentId = $row["id"];
-                $normText = Db::qstr($this->t->normalizeText( $row["text"] ));
-                $normTopic = Db::qstr($this->t->normalizeText( $row["topic"] ));
-                $query = "UPDATE {$dbPrefix}articles_comments
-                          SET normalized_text = '$normText', normalized_topic = '$normTopic', date = date
-                          WHERE id = $commentId";
-
-                $res = $this->db->Execute( $query );
-
-                if( !$res ) {
-                    $this->message .= "There was an error updating the comments table.<br/>";
-                    return false;
-                }
-            }
-
-            $this->message .= "Comments table updated successfully!<br/>";
-
-            return true;
-        }
-
-        //
-        // process the blogs
-        //
-        function updateBlogs()
-        {
-            $dbPrefix = $this->dbPrefix;
-            $query = "SELECT * FROM {$dbPrefix}blogs";
-            $result = $this->db->Execute( $query );
-
-            while( $row = $result->FetchRow()) {
-                $blogId = $row["id"];
-                $mangledBlog = $this->t->urlize( $row["blog"] );
-                $query = "UPDATE {$dbPrefix}blogs
-                          SET mangled_blog = '$mangledBlog' WHERE id = $blogId";
-
-                $res = $this->db->Execute( $query );
-
-                if( !$res ) {
-                    $this->message .= "There wasn an error updaing the blogs table.<br/>";
-                    return false;
-                }
-            }
-
-            $this->message .= "Blogs table updated successfully!<br/>";
-
-            return true;
-        }
-
-        //
-        // process the albums
-        //
-        function updateAlbums()
-        {
-            $dbPrefix = $this->dbPrefix;
-            $query = "SELECT * FROM {$dbPrefix}gallery_albums";
-            $result = $this->db->Execute( $query );
-
-            while( $row = $result->FetchRow()) {
-                $albumId = $row["id"];
-                $mangledName = Db::qstr($this->t->urlize( $row["name"] ));
-                $normName = Db::qstr($this->t->normalizeText( $row["name"] ));
-                $normDescription = Db::qstr($this->t->normalizeText( $row["description"] ));
-                $query = "UPDATE {$dbPrefix}gallery_albums
-                          SET mangled_name = '$mangledName', normalized_name = '$normName',
-                          normalized_description = '$normDescription', date = date
-                          WHERE id = $albumId";
-
-                $res = $this->db->Execute( $query );
-
-                if( !$res ) {
-                    $this->message .= "There was an error updating the albums table.<br/>";
-                    return false;
-                }
-            }
-
-            $this->message .= "Resource Albums table updated successfully!<br/>";
-
-            return true;
-        }
-
-        //
-        // and finally, the resources...
-        //
-        function updateResources()
-        {
-            $dbPrefix = $this->dbPrefix;
-            $query = "SELECT * FROM {$dbPrefix}gallery_resources";
-            $result = $this->db->Execute( $query );
-
-            while( $row = $result->FetchRow()) {
-                $resId = $row["id"];
-                //$normName = $this->t->normalizeText( $row["name"] );
-                $normDescription = Db::qstr($this->t->normalizeText( $row["description"] ));
-                $query = "UPDATE {$dbPrefix}gallery_resources
-                          SET normalized_description = '$normDescription', date = date
-                          WHERE id = $resId";
-
-                $res = $this->db->Execute( $query );
-                if( !$res ) {
-                    $this->message .= "There was an error updating the resources table.<br/>";
-                    return false;
-                }
-            }
-
-            $this->message .= "Resources table updated successfully!<br/>";
-
-            return true;
-
-        }
-
-        //
-        // process the articles' text
-        //
-        function updateArticleText()
-        {
-            $dbPrefix = $this->dbPrefix;
-            // drop unneeded columns from articles table
-            $alter_query[] = "ALTER TABLE ".$dbPrefix."articles DROP COLUMN text";
-            $alter_query[] = "ALTER TABLE ".$dbPrefix."articles DROP COLUMN topic";
-
-            foreach ($alter_query as $value) {
-                $this->db->Execute($value);
-            }
-
-
-            $this->message .= "articles_text table updated successfully!<br/>";
-
-            return true;
-        }
-
-        function perform()
-        {
-            $updaters = Array( "updateArticleCategories", "updateArticleComments",
-                               "updateBlogs", "updateAlbums", "updateResources", "updateArticleText" );
-
-            // loop through each one of the methods to take care of updating one of the tables
-            foreach( $updaters as $method ) {
-                $result = $this->$method();
-
-                if( !$result ) {
-                    $this->_view = new WizardView( "update3" );
-                    $this->_view->setErrorMessage( $this->message );
-                    return false;
-                }
-            }
-
-            // everything went fine so we can show the final page!
-            $this->_view = new WizardView( "update4" );
-            $this->_view->setValue( "message", $this->message );
-
-            return true;
-        }
-
-    }
-
-    // check if the "./tmp" folder is writable by us, otherwise
-    // throw an error before the user gets countless errors
-    // from Smarty
-    if( !File::isWritable( TEMP_FOLDER ) || !File::isDir( TEMP_FOLDER )) {
-        print("<span style=\"color:red; font-size: 14px;\">Error</span><br/><br/>This wizard needs the ".TEMP_FOLDER." folder to be writable by the web server user.<br/><br/>Please correct that and try again.");
-        die();
-    }
-
-    //// main part ////
-    $controller = new Controller( $_actionMap, "nextStep" );
-    $controller->process( HttpVars::getRequest());
-?>
+<?php
+
+    if (!defined( "PLOG_CLASS_PATH" )) {
+        define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
+    }
+
+    set_time_limit (5 * 3600);
+
+    //
+    // enable this for debugging purposes
+    //
+    define( "DB_WIZARD_DEBUG", false );
+
+    //
+    // in case you're having problems with time outs while upgrading (probably too
+    // many records) lower this figure
+    //
+    define( "WIZARD_MAX_RECORDS_PER_STEP", 50 );
+
+    //
+    // threshold that defines up to how many records we should not divide the
+    // transformations in more than one step
+    //
+    define( "WIZARD_MAX_RECORDS_THRESHOLD", 100 );
+
+    // many hosts don't have this enabled and we, for the time being, need it...
+    ini_set("arg_seperator.output", "&amp;");
+
+    include_once( PLOG_CLASS_PATH."class/controller/controller.class.php" );
+    include_once( PLOG_CLASS_PATH."class/template/templateservice.class.php" );
+    include_once( PLOG_CLASS_PATH."class/action/action.class.php" );
+    include_once( PLOG_CLASS_PATH."class/template/template.class.php" );
+    include_once( PLOG_CLASS_PATH."class/view/view.class.php" );
+    include_once( PLOG_CLASS_PATH."class/database/adodb/adodb.inc.php" );
+    include_once( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
+    include_once( PLOG_CLASS_PATH."class/data/validator/emailvalidator.class.php" );
+    include_once( PLOG_CLASS_PATH."class/data/validator/passwordvalidator.class.php" );
+    include_once( PLOG_CLASS_PATH."class/dao/users.class.php" );
+    include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
+    include_once( PLOG_CLASS_PATH."class/dao/articlecategories.class.php" );
+    include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
+    include_once( PLOG_CLASS_PATH."class/net/http/httpvars.class.php" );
+    include_once( PLOG_CLASS_PATH."class/dao/userpermissions.class.php" );
+    include_once( PLOG_CLASS_PATH."class/misc/version.class.php" );
+    include_once( PLOG_CLASS_PATH."class/file/file.class.php" );
+    include_once( PLOG_CLASS_PATH."class/file/finder/filefinder.class.php" );
+    include_once( PLOG_CLASS_PATH."class/gallery/resizers/gddetector.class.php" );
+    include_once( PLOG_CLASS_PATH."class/config/configfilestorage.class.php" );
+    include_once( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
+    include_once( PLOG_CLASS_PATH."class/locale/locales.class.php" );
+    include_once( PLOG_CLASS_PATH."class/locale/localefinder.class.php" );
+
+    define( "TEMP_FOLDER", "./tmp" );
+
+    // sql querys used to create the tables
+
+    // maps used to map requests with actions
+    $_actionMap["Default"] = "WizardIntro";
+    $_actionMap["Intro"] = "WizardIntro";
+    $_actionMap["Step1"] = "WizardStepOne";
+    $_actionMap["Step2"] = "WizardStepTwo";
+    $_actionMap["Step3"] = "WizardStepThree";
+    $_actionMap["Step4"] = "WizardStepFour";
+    $_actionMap["Step5"] = "WizardStepFive";
+    $_actionMap["Update1"] = "UpdateStepOne";
+    $_actionMap["Update2"] = "UpdateStepTwo";
+    $_actionMap["Update3"] = "UpdateStepThree";
+    $_actionMap["Update4"] = "UpdateStepFour";
+
+
+
+    $Tables[0]["desc"] = "Articles";
+    $Tables[0]["code"] = "CREATE TABLE {dbprefix}articles (
+  id int(10) unsigned NOT NULL auto_increment,
+  category_id int(10) unsigned NOT NULL default '0',
+  date timestamp(14) NOT NULL,
+  modification_date timestamp(14) NOT NULL,
+  user_id int(10) unsigned NOT NULL default '0',
+  blog_id int(10) unsigned NOT NULL default '0',
+  status INTEGER(5) NOT NULL default 1,
+  num_reads int(10) default '0',
+  properties TEXT NOT NULL default '',
+  slug varchar(255) NOT NULL,
+  PRIMARY KEY (id),
+  KEY num_reads (num_reads),
+  KEY category_id (category_id),
+  KEY blog_id (blog_id),
+  KEY user_id (user_id),
+  KEY slug (slug),
+  KEY blog_id_slug (blog_id,slug),
+  KEY blog_id_slug_category_id (blog_id,slug,category_id)
+) TYPE=MyISAM;";
+
+    $Tables[1]["desc"] = "Article categories";
+    $Tables[1]["code"] = "CREATE TABLE {dbprefix}articles_categories (
+  id int(10) unsigned NOT NULL auto_increment,
+  name varchar(255) NOT NULL default '',
+  url varchar(255) NOT NULL default '',
+  blog_id int(10) unsigned NOT NULL default '0',
+  last_modification timestamp(14) NOT NULL,
+  in_main_page TINYINT(1) NOT NULL DEFAULT '1',
+  parent_id INTEGER(10) NOT NULL DEFAULT '0',
+  description TEXT NOT NULL DEFAULT '',
+  properties text NOT NULL default '',
+  mangled_name varchar(255) NOT NULL default '',
+  PRIMARY KEY  (id),
+  KEY parent_id (parent_id),
+  KEY blog_id (blog_id),
+  KEY mangled_name (mangled_name)
+) TYPE=MyISAM;";
+
+    $Tables[2]["desc"] = "Comments";
+    $Tables[2]["code"] = "CREATE TABLE {dbprefix}articles_comments (
+  id int(10) unsigned NOT NULL auto_increment,
+  article_id int(10) unsigned NOT NULL default '0',
+  topic text NOT NULL,
+  text text,
+  date timestamp(14) NOT NULL,
+  user_email varchar(255) default '',
+  user_url varchar(255) default '',
+  user_name varchar(255) NOT NULL default 'Anonymous',
+  parent_id int(10) unsigned default '0',
+  client_ip varchar(15) default '0.0.0.0',
+  send_notification tinyint(1) default '0',
+  status tinyint(2) default '1',
+  spam_rate float default '0',
+  properties TEXT NOT NULL DEFAULT '',
+  normalized_text TEXT NOT NULL DEFAULT '',
+  normalized_topic TEXT NOT NULL DEFAULT '',
+  type int(3) NOT NULL DEFAULT '0',  
+  PRIMARY KEY  (id),
+  KEY parent_id (parent_id),
+  KEY article_id (article_id),
+  FULLTEXT KEY normalized_fields (normalized_text,normalized_topic),
+  FULLTEXT KEY normalized_text (normalized_text),
+  FULLTEXT KEY normalized_topic (normalized_topic)
+) TYPE=MyISAM;";
+
+    $Tables[3]["desc"] = "Notifications";
+    $Tables[3]["code"] = "CREATE TABLE {dbprefix}articles_notifications (
+  id int(10) NOT NULL auto_increment,
+  blog_id int(10) NOT NULL default '0',
+  user_id int(10) NOT NULL default '0',
+  article_id int(10) NOT NULL default '0',
+  PRIMARY KEY  (id),
+  KEY article_id (article_id),
+  KEY user_id (user_id),
+  KEY blog_id (blog_id)
+) TYPE=MyISAM;";
+
+    $Tables[4]["desc"] = "Blogs";
+    $Tables[4]["code"] = "CREATE TABLE {dbprefix}blogs (
+  id int(10) unsigned NOT NULL auto_increment,
+  blog varchar(50) NOT NULL default '',
+  owner_id int(10) unsigned NOT NULL default '0',
+  about text,
+  settings text NOT NULL,
+  mangled_blog varchar(50) NOT NULL default '',
+  status int(4) NOT NULL default '1',
+  show_in_summary int(4) not null default '1',
+  PRIMARY KEY  (id),
+  KEY owner_id (owner_id),
+  KEY mangled_blog (mangled_blog)
+) TYPE=MyISAM;";
+
+    $Tables[5]["desc"] = "MyLinks";
+    $Tables[5]["code"] = "CREATE TABLE {dbprefix}mylinks (
+  id int(10) unsigned NOT NULL auto_increment,
+  category_id int(10) unsigned NOT NULL default '0',
+  url varchar(255) NOT NULL default '',
+  name varchar(100) default '',
+  description text NOT NULL,
+  blog_id int(10) unsigned NOT NULL default '0',
+  rss_feed varchar(255) not null default '',
+  date timestamp(14) not null,
+  properties TEXT NOT NULL DEFAULT '',
+  PRIMARY KEY  (id),
+  KEY blog_id (blog_id),
+  KEY category_id (category_id)
+) TYPE=MyISAM;";
+
+    $Tables[6]["desc"] = "MyLinks Categories";
+    $Tables[6]["code"] = "CREATE TABLE {dbprefix}mylinks_categories (
+  id int(10) NOT NULL auto_increment,
+  name varchar(100) NOT NULL default '',
+  blog_id int(10) NOT NULL default '0',
+  last_modification timestamp(14) NOT NULL,
+  properties TEXT NOT NULL DEFAULT '',
+  PRIMARY KEY  (id),
+  KEY blog_id (blog_id)
+) TYPE=MyISAM;";
+
+    $Tables[7]["desc"] = "MyRecent";
+    $Tables[7]["code"] = "CREATE TABLE {dbprefix}myrecent (
+  id int(10) unsigned NOT NULL auto_increment,
+  category_id int(10) unsigned NOT NULL default '0',
+  name varchar(255) NOT NULL default '',
+  text text NOT NULL,
+  user_id int(10) unsigned NOT NULL default '0',
+  blog_id int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY  (id)
+) TYPE=MyISAM;";
+
+    $Tables[8]["desc"] = "MyRecent categories";
+    $Tables[8]["code"] = "CREATE TABLE {dbprefix}myrecent_categories (
+  id int(10) unsigned NOT NULL auto_increment,
+  name varchar(255) NOT NULL default '',
+  blog_id int(10) unsigned NOT NULL default '0',
+  last_modification timestamp(14) NOT NULL,
+  PRIMARY KEY  (id)
+) TYPE=MyISAM;";
+
+    $Tables[9]["desc"] = "Permissions";
+    $Tables[9]["code"] = "CREATE TABLE {dbprefix}permissions (
+  id int(10) unsigned NOT NULL auto_increment,
+  permission varchar(25) NOT NULL default '',
+  description varchar(100) NOT NULL default '',
+  PRIMARY KEY  (id)
+) TYPE=MyISAM;";
+
+    $Tables[10]["desc"] = "Referrers";
+    $Tables[10]["code"] = "CREATE TABLE {dbprefix}referers (
+  id int(10) NOT NULL auto_increment,
+  url text NOT NULL,
+  article_id int(10) NOT NULL default '0',
+  blog_id int(10) NOT NULL default '0',
+  hits int(10) default '1',
+  last_date timestamp(14),
+  PRIMARY KEY  (id),
+  KEY article_id (article_id),
+  KEY blog_id (blog_id),
+  KEY blog_id_article_id (blog_id, article_id)
+) TYPE=MyISAM;";
+
+    $Tables[11]["desc"] = "Trackbacks";
+    $Tables[11]["code"] = "CREATE TABLE {dbprefix}trackbacks (
+  id int(10) NOT NULL auto_increment,
+  url text NOT NULL,
+  title varchar(255) default '',
+  article_id int(10) NOT NULL default '0',
+  excerpt varchar(255) default '',
+  blog_name varchar(255) default '',
+  date timestamp(14) NOT NULL,
+  properties TEXT NOT NULL DEFAULT '',
+  PRIMARY KEY  (id),
+  KEY article_id (article_id)
+) TYPE=MyISAM;";
+
+    $Tables[12]["desc"] = "Users";
+    $Tables[12]["code"] = "CREATE TABLE {dbprefix}users (
+  id int(10) unsigned NOT NULL auto_increment,
+  user varchar(15) NOT NULL default '',
+  password varchar(32) NOT NULL default '',
+  email varchar(255) NOT NULL default '',
+  full_name varchar(255) NOT NULL default '',
+  about text,
+  properties TEXT NOT NULL default '',
+  status integer(4) NOT NULL DEFAULT 1,
+  resource_picture_id integer(10) NOT NULL DEFAULT 0,
+  PRIMARY KEY  (id),
+  UNIQUE KEY user (user)
+) TYPE=MyISAM;";
+
+    $Tables[13]["desc"] = "Permissions";
+    $Tables[13]["code"] = "CREATE TABLE {dbprefix}users_permissions (
+  id int(10) unsigned NOT NULL auto_increment,
+  user_id int(10) unsigned NOT NULL default '0',
+  blog_id int(10) unsigned NOT NULL default '0',
+  permission_id int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY  (id),
+  KEY user_id (user_id),
+  KEY blog_id (blog_id),
+  KEY user_id_permission_id (user_id,permission_id)
+) TYPE=MyISAM;";
+
+
+   $Tables[14]["desc"] = "Configuration";
+   $Tables[14]["code"] = "CREATE TABLE {dbprefix}config (
+   id int(10) NOT NULL auto_increment,
+   config_key varchar(255) NOT NULL default '',
+   config_value text NOT NULL,
+   value_type int(3) default '0',
+   PRIMARY KEY  (id,config_key)
+   ) TYPE=MyISAM;";
+
+   $Tables[15]["desc"] = "Filtered Content";
+   $Tables[15]["code"] = "CREATE TABLE {dbprefix}filtered_content (
+   id int(10) NOT NULL auto_increment,
+   reg_exp text,
+   blog_id int(10) NOT NULL default '0',
+   reason text,
+   date timestamp(14) NOT NULL,
+   PRIMARY KEY  (id),
+   KEY blog_id (blog_id)
+   ) TYPE=MyISAM;";
+
+   $Tables[16]["desc"] = "Blocked content";
+   $Tables[16]["code"] = "CREATE TABLE {dbprefix}host_blocking_rules (
+   id int(10) NOT NULL auto_increment,
+   reason text,
+   date timestamp(14) NOT NULL,
+   blog_id int(10) NOT NULL default '0',
+   block_type int(1) default '1',
+   list_type int(1) default '1',
+   mask int(2) default '0',
+   host varchar(15) default '0.0.0.0',
+   PRIMARY KEY  (id),
+   KEY blog_id (blog_id)
+   ) TYPE=MyISAM;";
+
+   $Tables[17]["desc"] = "Gallery Resources";
+   $Tables[17]["code"] = "CREATE TABLE {dbprefix}gallery_resources (
+   id int(10) NOT NULL auto_increment,
+   owner_id int(10) NOT NULL default '0',
+   album_id int(10) NOT NULL default '0',
+   description text,
+   date timestamp(14) NOT NULL,
+   flags int(10) default '0',
+   resource_type int(3) default NULL,
+   file_path varchar(255) default '',
+   file_name varchar(255) default '',
+   metadata text,
+   thumbnail_format varchar(4) not null default 'same',
+   normalized_description text NOT NULL default '',
+   properties TEXT NOT NULL DEFAULT '',
+   PRIMARY KEY  (id),
+   KEY album_id (album_id),
+   KEY owner_id (owner_id),
+   KEY file_name (file_name),
+   KEY album_id_owner_id (album_id, owner_id),
+   KEY resource_type (resource_type),
+   FULLTEXT KEY normalized_description (normalized_description)
+   ) TYPE=MyISAM;";
+
+   $Tables[18]["desc"] = "Gallery Albums";
+   $Tables[18]["code"] = "CREATE TABLE {dbprefix}gallery_albums (
+   id int(10) NOT NULL auto_increment,
+   owner_id int(10) NOT NULL default '0',
+   description text NOT NULL,
+   name varchar(255) NOT NULL default '',
+   flags int(10) NOT NULL default '0',
+   parent_id int(10) NOT NULL default '0',
+   date timestamp(14) NOT NULL,
+   properties text NOT NULL DEFAULT '',
+   show_album TINYINT(1) DEFAULT 1,
+   normalized_description text NOT NULL default '',
+   normalized_name varchar(255) NOT NULL default '',
+   mangled_name varchar(255) NOT NULL default '',
+   PRIMARY KEY  (id),
+   KEY parent_id (parent_id),
+   KEY owner_id (owner_id),
+   KEY mangled_name (mangled_name),
+   KEY owner_id_mangled_name (owner_id, mangled_name),
+   FULLTEXT KEY normalized_name (normalized_name),
+   FULLTEXT KEY normalized_description (normalized_description),
+   FULLTEXT KEY normalized_fields (normalized_name, normalized_description)
+   ) TYPE=MyISAM;";
+
+   $Tables[19]["desc"] = "Bayesian Filter data table";
+   $Tables[19]["code"] = "CREATE TABLE {dbprefix}bayesian_filter_info (
+   id int(10) unsigned NOT NULL auto_increment,
+   blog_id int(10) unsigned default NULL,
+   total_spam int(10) unsigned default NULL,
+   total_nonspam int(10) unsigned default NULL,
+   PRIMARY KEY  (id),
+   KEY blog_id (blog_id)
+   ) TYPE=MyISAM;";
+
+   $Tables[20]["desc"] = "Bayesian Filter Information";
+   $Tables[20]["code"] = "CREATE TABLE {dbprefix}bayesian_tokens (
+   id int(10) unsigned NOT NULL auto_increment,
+   blog_id int(10) unsigned default NULL,
+   token char(100) default NULL,
+   spam_occurrences int(10) unsigned default NULL,
+   nonspam_occurrences int(10) unsigned default NULL,
+   prob float default NULL,
+   PRIMARY KEY  (id),
+   KEY blog_id (blog_id),
+   KEY token (token)
+   ) TYPE=MyISAM;";
+
+   $Tables[21]["desc"] = "Map of categories to articles";
+   $Tables[21]["code"] = "CREATE TABLE {dbprefix}article_categories_link(
+   article_id int(10) NOT NULL,
+   category_id int(10) NOT NULL,
+   PRIMARY KEY (article_id, category_id)
+   ) TYPE=MyISAM;";
+
+   $Tables[22]["desc"] = "Definition of custom fields";
+   $Tables[22]["code"] = "CREATE TABLE {dbprefix}custom_fields_definition (
+   id int(10) NOT NULL auto_increment,
+   field_name varchar(255) NOT NULL default '',
+   field_description text NOT NULL,
+   field_type int(2) NOT NULL default '1',
+   blog_id int(10) NOT NULL default '0',
+   date TIMESTAMP(14),
+   searchable TINYINT(1) default 1,
+   hidden TINYINT(1) default 1,
+   PRIMARY KEY  (id,field_name),
+   KEY blog_id (blog_id)
+   ) TYPE=MyISAM;";
+
+   $Tables[23]["desc"] = "Custom fields that have been assigned to articles";
+   $Tables[23]["code"] = "CREATE TABLE {dbprefix}custom_fields_values (
+   id int(10) NOT NULL auto_increment,
+   field_id int(10) NOT NULL default '0',
+   field_value text NOT NULL,
+   normalized_value text NOT NULL,
+   blog_id int(10) default NULL,
+   article_id int(10) default NULL,
+   PRIMARY KEY  (id),
+   FULLTEXT KEY normalized_value (normalized_value),
+   KEY blog_id (blog_id),
+   KEY article_id (article_id),
+   KEY field_id (field_id),
+   KEY blog_id_article_id (blog_id, article_id)
+   ) TYPE=MyISAM;";
+
+   $Tables[24]["desc"] = "Text of the articles";
+   $Tables[24]["code"] = "CREATE TABLE {dbprefix}articles_text (
+   id int(10) NOT NULL auto_increment,
+   article_id int(10) NOT NULL DEFAULT 0,
+   text TEXT NOT NULL DEFAULT '',
+   topic TEXT NOT NULL DEFAULT '',
+   normalized_text TEXT NOT NULL DEFAULT '',
+   normalized_topic TEXT NOT NULL DEFAULT '',
+   mangled_topic text NOT NULL,
+   PRIMARY KEY (id),
+   KEY article_id (article_id),
+   FULLTEXT KEY normalized_text (normalized_text),
+   FULLTEXT KEY normalized_topic (normalized_topic),
+   FULLTEXT KEY normalized_fields (normalized_text, normalized_topic)
+   ) TYPE=MyISAM;";
+
+
+
+   // ---
+   // changes needed to update from 0.3 to 1.0
+   $Changes["Articles"] = Array( "ALTER TABLE {dbprefix}articles CHANGE status old_status ENUM('published', 'draft', 'deleted' )",
+                                 "ALTER TABLE {dbprefix}articles ADD COLUMN status INTEGER(5) NOT NULL DEFAULT 1",
+                                 "ALTER TABLE {dbprefix}articles ADD COLUMN slug VARCHAR(255) NOT NULL DEFAULT ''",
+                                 "ALTER TABLE {dbprefix}articles ADD KEY num_reads(num_reads)",
+                                 "ALTER TABLE {dbprefix}articles ADD KEY category_id(category_id)",
+                                 "ALTER TABLE {dbprefix}articles ADD KEY blog_id(blog_id)",
+                                 "ALTER TABLE {dbprefix}articles ADD KEY slug(slug)",
+                                 "ALTER TABLE {dbprefix}articles ADD KEY user_id(user_id)",
+                                 "ALTER TABLE {dbprefix}articles ADD KEY blog_id_slug(blog_id,slug)",
+                                 "ALTER TABLE {dbprefix}articles ADD KEY blog_id_slug_category_id(blog_id,slug,category_id)");
+
+    $Changes["Article Categories"] = Array( "ALTER TABLE {dbprefix}articles_categories ADD COLUMN parent_id INTEGER(10) NOT NULL DEFAULT 0",
+                                            "ALTER TABLE {dbprefix}articles_categories ADD COLUMN mangled_name VARCHAR(255) NOT NULL DEFAULT ''",
+                                            "ALTER TABLE {dbprefix}articles_categories ADD COLUMN properties TEXT NOT NULL DEFAULT ''",
+                                            "ALTER TABLE {dbprefix}articles_categories ADD COLUMN description TEXT NOT NULL DEFAULT ''",
+                                            "ALTER TABLE {dbprefix}articles_categories ADD KEY parent_id(parent_id)",
+                                            "ALTER TABLE {dbprefix}articles_categories ADD KEY blog_id(blog_id)",
+                                            "ALTER TABLE {dbprefix}articles_categories ADD KEY mangled_name(mangled_name)");
+
+
+    $Changes["User Comments"] = Array( "ALTER TABLE {dbprefix}articles_comments ADD COLUMN normalized_text TEXT NOT NULL DEFAULT ''",
+                                       "ALTER TABLE {dbprefix}articles_comments ADD COLUMN normalized_topic TEXT NOT NULL DEFAULT ''",
+                                       "ALTER TABLE {dbprefix}articles_comments ADD FULLTEXT normalized_text(normalized_text)",
+                                       "ALTER TABLE {dbprefix}articles_comments ADD FULLTEXT normalized_topic(normalized_topic)",
+                                       "ALTER TABLE {dbprefix}articles_comments ADD FULLTEXT normalized_text_topic(normalized_topic,normalized_text)",
+                                       "ALTER TABLE {dbprefix}articles_comments ADD KEY parent_id(parent_id)",
+                                       "ALTER TABLE {dbprefix}articles_comments ADD KEY article_id(article_id)");
+
+    $Changes["Notifications"] = Array( "ALTER TABLE {dbprefix}articles_notifications ADD KEY article_id(article_id)",
+                                       "ALTER TABLE {dbprefix}articles_notifications ADD KEY user_id(user_id)",
+                                       "ALTER TABLE {dbprefix}articles_notifications ADD KEY blog_id(blog_id)");
+
+    $Changes["Blogs"] = Array( "ALTER TABLE {dbprefix}blogs ADD COLUMN mangled_blog VARCHAR(50) NOT NULL DEFAULT ''",
+                               "ALTER TABLE {dbprefix}blogs ADD COLUMN properties TEXT NOT NULL DEFAULT ''",
+                               "ALTER TABLE {dbprefix}blogs ADD COLUMN status INTEGER(4) NOT NULL DEFAULT '1'",
+                               "ALTER TABLE {dbprefix}blogs ADD COLUMN show_in_summary INTEGER(4) NOT NULL DEFAULT '1'",
+                               "ALTER TABLE {dbprefix}blogs ADD KEY owner_id(owner_id)",
+                               "ALTER TABLE {dbprefix}blogs ADD KEY mangled_blog(mangled_blog)");
+
+    $Changes["Referrers"] = Array( "ALTER TABLE {dbprefix}referers ADD KEY article_id(article_id)",
+                                   "ALTER TABLE {dbprefix}referers ADD KEY blog_id(blog_id)",
+                                   "ALTER TABLE {dbprefix}referers ADD   KEY blog_id_article_id (blog_id, article_id)");
+
+    $Changes["Trackbacks"] = Array( "ALTER TABLE {dbprefix}trackbacks ADD KEY article_id(article_id)" );
+
+    $Changes["Filtered Content"] = Array( "ALTER TABLE {dbprefix}filtered_content ADD KEY blog_id(blog_id)" );
+
+    $Changes["Blocked hosts"] = Array( "ALTER TABLE {dbprefix}host_blocking_rules ADD KEY blog_id(blog_id)" );
+
+    $Changes["Gallery Albums"] = Array( "ALTER TABLE {dbprefix}gallery_albums ADD COLUMN normalized_name VARCHAR(255) NOT NULL DEFAULT ''",
+                                        "ALTER TABLE {dbprefix}gallery_albums ADD COLUMN normalized_description TEXT NOT NULL DEFAULT ''",
+                                        "ALTER TABLE {dbprefix}gallery_albums ADD COLUMN mangled_name VARCHAR(255) NOT NULL DEFAULT ''",
+                                        "ALTER TABLE {dbprefix}gallery_albums ADD FULLTEXT normalized_name(normalized_name)",
+                                        "ALTER TABLE {dbprefix}gallery_albums ADD FULLTEXT normalized_description(normalized_description)",
+                                        "ALTER TABLE {dbprefix}gallery_albums ADD FULLTEXT normalized_name_description(normalized_name, normalized_description)",
+                                        "ALTER TABLE {dbprefix}gallery_albums ADD KEY parent_id(parent_id)",
+                                        "ALTER TABLE {dbprefix}gallery_albums ADD KEY owner_id(owner_id)",
+                                        "ALTER TABLE {dbprefix}gallery_albums ADD KEY mangled_name(mangled_name)",
+                                        "ALTER TABLE {dbprefix}gallery_albums ADD KEY owner_id_mangled_name(owner_id,mangled_name)");
+
+    $Changes["Gallery Resources"] = Array( "ALTER TABLE {dbprefix}gallery_resources ADD COLUMN normalized_description TEXT NOT NULL DEFAULT ''",
+                                           "ALTER TABLE {dbprefix}gallery_resources ADD FULLTEXT normalized_description(normalized_description)",
+                                           "ALTER TABLE {dbprefix}gallery_resources ADD KEY album_id(album_id)",
+                                           "ALTER TABLE {dbprefix}gallery_resources ADD KEY owner_id(owner_id)",
+                                           "ALTER TABLE {dbprefix}gallery_resources ADD KEY file_name(file_name)",
+                                           "ALTER TABLE {dbprefix}gallery_resources ADD KEY album_id_owner_id(album_id,owner_id)",
+                                           "ALTER TABLE {dbprefix}gallery_resources ADD KEY resource_type(resource_type)");
+
+
+    $Changes["Links"] = Array( "ALTER TABLE {dbprefix}mylinks ADD COLUMN properties TEXT NOT NULL DEFAULT ''",
+                               "ALTER TABLE {dbprefix}mylinks ADD COLUMN date TIMESTAMP(14)",
+                               "ALTER TABLE {dbprefix}mylinks ADD COLUMN rss_feed VARCHAR(255) NOT NULL DEFAULT ''",
+                               "ALTER TABLE {dbprefix}mylinks ADD KEY blog_id(blog_id)",
+                               "ALTER TABLE {dbprefix}mylinks ADD KEY category_id(category_id)");
+
+    $Changes["Links Categories"] = Array( "ALTER TABLE {dbprefix}mylinks_categories ADD COLUMN properties TEXT NOT NULL DEFAULT ''",
+                                          "ALTER TABLE {dbprefix}mylinks_categories ADD KEY blog_id(blog_id)");
+
+    $Changes["Users"] = Array( "ALTER TABLE {dbprefix}users ADD COLUMN full_name VARCHAR(255) NOT NULL DEFAULT ''",
+                                "ALTER TABLE {dbprefix}users ADD COLUMN properties TEXT NOT NULL DEFAULT ''",
+                                "ALTER TABLE {dbprefix}users ADD COLUMN resource_picture_id INTEGER(10) NOT NULL DEFAULT 0",
+                                "ALTER TABLE {dbprefix}users ADD COLUMN status INTEGER(4) NOT NULL DEFAULT 1" );
+
+    $Changes["Bayesian Filter data table"] = Array( "ALTER TABLE {dbprefix}bayesian_filter_info ADD KEY blog_id(blog_id)" );
+
+    $Changes["Permissions"] = Array( "ALTER TABLE {dbprefix}users_permissions ADD KEY user_id(user_id)",
+                                     "ALTER TABLE {dbprefix}users_permissions ADD KEY blog_id(blog_id)",
+                                     "ALTER TABLE {dbprefix}users_permissions ADD KEY user_id_permission_id(user_id,permission_id)");
+
+   // ---
+
+   // ---
+   // end of changes needed in 1.0
+   // ---
+
+$Inserts[0] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('comments_enabled','1',1);";
+$Inserts[1] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('rdf_enabled','1',1);";
+$Inserts[2] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('temp_folder','./tmp',3);";
+$Inserts[3] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('base_url','{plog_base_url}',3);";
+$Inserts[4] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('show_posts_max','15',1);";
+$Inserts[5] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('recent_posts_max','10',1);";
+$Inserts[6] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_template','standard',3);";
+$Inserts[7] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('template_folder','./templates',3);";
+$Inserts[8] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_blog_id','1',1);";
+$Inserts[9] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_locale','en_UK',3);";
+$Inserts[10] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('html_allowed_tags_in_comments','<a><i><br><br/><b>',3);";
+$Inserts[11] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('referer_tracker_enabled','1',1);";
+$Inserts[12] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('rss_parser_enabled','1',1);";
+$Inserts[13] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('show_more_enabled','1',1);";
+$Inserts[14] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('show_more_threshold','150',1);";
+$Inserts[15] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('update_article_reads','1',1);";
+$Inserts[16] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('email_service_enabled','1',1);";
+$Inserts[17] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('post_notification_source_address','noreply at your.host.com',3);";
+$Inserts[18] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('request_format_mode','1',1);";
+$Inserts[19] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xmlrpc_ping_hosts','a:2:{i:0;s:27:\"http://rpc.weblogs.com/RPC2\";i:1;s:0:\"\";}',5);";
+$Inserts[20] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('trackback_server_enabled','1',1);";
+$Inserts[21] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('htmlarea_enabled','1',1);";
+$Inserts[22] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('plugin_manager_enabled','1',1);";
+$Inserts[23] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('check_email_address_validity','0',1);";
+$Inserts[24] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('summary_page_show_max','15',1);";
+$Inserts[25] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('minimum_password_length','4',1);";
+$Inserts[26] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('templates','a:3:{i:0;s:7:\"blueish\";i:1;s:4:\"grey\";i:2;s:8:\"standard\";}',5);";
+$Inserts[27] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('locales','a:0:{}',5)";
+$Inserts[28] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('email_service_type','php',3);";
+$Inserts[29] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_host','your.smtp.host.com',3);";
+$Inserts[30] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_port','25',1);";
+$Inserts[31] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_use_authentication','0',1);";
+$Inserts[32] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_username','',3);";
+$Inserts[33] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_password','',3);";
+$Inserts[34] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('locale_folder','./locale',3);";
+$Inserts[35] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xmlrpc_ping_enabled','0',1);";
+$Inserts[36] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_tar','{path_to_tar}',3);";
+$Inserts[37] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_gzip','{path_to_gzip}',3);";
+$Inserts[38] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_bz2','{path_to_bz2}',3);";
+$Inserts[39] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_unzip','{path_to_unzip}',3);";
+$Inserts[40] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('users_can_add_templates',1,1);";
+$Inserts[41] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('maximum_file_upload_size', 2000000, 1);";
+$Inserts[42] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('upload_forbidden_files', '*.php *.php3 *.php4 *.phtml *.htm *.html *.exe *.com *.bat .htaccess *.sh', 3);";
+$Inserts[43] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('comments_order', 1, 1);";
+$Inserts[44] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('security_pipeline_enabled', 1, 1);";
+$Inserts[45] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('maximum_comment_size', 0, 1 );";
+$Inserts[46] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('resources_enabled', 1, 1 );";
+$Inserts[47] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnail_method', 'gd', 3);";
+$Inserts[48] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_convert', '{path_to_convert}', 3);";
+$Inserts[49] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnail_height', 120, 1);";
+$Inserts[50] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnail_width', 120, 1);";
+$Inserts[51] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnails_keep_aspect_ratio', 1, 1);";
+$Inserts[52] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xmlrpc_api_enabled', 1, 1);";
+$Inserts[53] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('uploads_enabled', 1, 1);";
+$Inserts[54] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_rss_profile', 'rss090', 3);";
+$Inserts[55] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_enabled', 1, 2);";
+$Inserts[56] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_spam_probability_treshold', '0.9', 6);";
+$Inserts[57] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_nonspam_probability_treshold', '0.2', 6);";
+$Inserts[58] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_min_length_token', '3', 1);";
+$Inserts[59] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_max_length_token', '100', 1);";
+$Inserts[60] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_number_significant_tokens', 15, 1);";
+$Inserts[61] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_spam_comments_action', 0, 1 );";
+$Inserts[62] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('ip_address_filter_enabled', 1, 1 );";
+$Inserts[63] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('content_filter_enabled', 1, 1 );";
+$Inserts[64] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('thumbnail_format','same',3);";
+$Inserts[65] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resources_folder','./gallery/',3);";
+$Inserts[66] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('beautify_comments_text', '1', 1);";
+$Inserts[67] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('disable_apache_error_handler', '0', 1);";
+$Inserts[68] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('show_future_posts_in_calendar', '0', 1);";
+$Inserts[69] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('xhtml_converter_enabled', '1', 1);";
+$Inserts[70] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('xhtml_converter_aggresive_mode_enabled', '0', 1);";
+$Inserts[71] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('search_engine_enabled', '1', 1);";
+$Inserts[72] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('search_in_custom_fields', '1', 1);";
+$Inserts[73] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('search_in_comments', '1', 1);";
+$Inserts[74] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resources_quota', '0', 1);";
+$Inserts[75] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('category_link_format', '/blog/{blogname}/{catname}$', 3);";
+$Inserts[76] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('blog_link_format', '/blog/{blogname}$', 3);";
+$Inserts[77] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('archive_link_format', '/blog/{blogname}/archives/{year}/?{month}/?{day}', 3);";
+$Inserts[78] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('user_posts_link_format', '/blog/{blogname}/user/{username}$', 3);";
+$Inserts[79] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('post_trackbacks_link_format', '/blog/{blogname}/post/trackbacks/{postname}$', 3);";
+$Inserts[80] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_link_format', '/blog/{blogname}/page/{templatename}$', 3);";
+$Inserts[81] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('album_link_format', '/blog/{blogname}/album/{albumname}$', 3);";
+$Inserts[82] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resource_link_format', '/blog/{blogname}/resource/{albumname}/{resourcename}$', 3);";
+$Inserts[83] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resource_preview_link_format', '/blog/{blogname}/resource/{albumname}/preview/{resourcename}$', 3);";
+$Inserts[84] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resource_download_link_format', '/blog/{blogname}/resource/{albumname}/download/{resourcename}$', 3);";
+$Inserts[85] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('permalink_format', '/blog/{blogname}/{catname}/{year}/{month}/{day}/{postname}$', 3);";
+$Inserts[86] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('script_name', 'index.php', 3);";
+$Inserts[87] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('thumbnail_generator_use_smoothing_algorithm', '0', 1);";
+$Inserts[88] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resource_server_use_http_caching', '1', 1);";
+$Inserts[89] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('medium_size_thumbnail_width', '640', 1);";
+$Inserts[90] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('medium_size_thumbnail_height', '480', 1);";
+$Inserts[91] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resource_medium_size_preview_link_format', '/blog/{blogname}/resource/{albumname}/preview-med/{resourcename}$', 3);";
+$Inserts[92] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('subdomains_enabled', '0', 1);";
+$Inserts[93] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('include_blog_id_in_url', '1', 1);";
+$Inserts[94] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('send_xmlrpc_pings_enabled_by_default', '1', 1);";
+$Inserts[95] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('forbidden_usernames', 'admin www blog ftp wiki forums', 3);";
+$Inserts[96] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('force_registration_confirmation', '0', 1);";
+$Inserts[97] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('summary_blogs_per_page', '25', 3);";
+$Inserts[98] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('subdomains_base_url', '', 3);";
+$Inserts[99] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('autosave_new_drafts_time_millis', '300000', 3);";
+$Inserts[100] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('save_drafts_via_xmlhttprequest_enabled', '1', 1);";
+$Inserts[101] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('need_email_confirm_registration', '1', 1);";
+$Inserts[102] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('force_one_blog_per_email_account', '0', 1);";
+$Inserts[103] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('summary_show_agreement', '1', 1);";
+$Inserts[104] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('default_time_offset', '0', 3);";
+$Inserts[105] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_cache_enabled', '1', 1);";
+$Inserts[106] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_http_cache_enabled', '0', 1);";
+$Inserts[107] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_http_cache_enabled', '0', 1);";
+$Inserts[108] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_compile_check', '1', 1);";
+$Inserts[109] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('update_cached_article_reads', '1', 1);";
+$Inserts[110] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('allow_php_code_in_templates', '0', 1);";
+$Inserts[111] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('thumbnail_generator_use_smoothing_algorithm', '1', 1);";
+$Inserts[112] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_cache_lifetime', '-1', 3);";
+$Inserts[113] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('use_http_accept_language_detection', '0', 1);";
+
+    /**
+     * Open a connection to the database
+     */
+     function connectDb( $ignoreError = false , $selectDatabase = true )
+     {
+        $config = new ConfigFileStorage();
+        // open a connection to the database
+        $db = NewADOConnection( 'mysql' );
+        if ( $selectDatabase ) {
+            $res = $db->Connect($config->getValue( "db_host" ), $config->getValue( "db_username" ), $config->getValue( "db_password" ), $config->getValue( "db_database" ));
+        } else {
+            $res = $db->Connect($config->getValue( "db_host" ), $config->getValue( "db_username" ), $config->getValue( "db_password" ));
+        }
+
+        if( DB_WIZARD_DEBUG )
+            $db->debug = true;
+
+        // return error
+        if( $ignoreError )
+            return $db;
+
+        if( !$res )
+            return false;
+
+        return $db;
+    }
+
+    /**
+     * Returns the database prefix
+     */
+    function getDbPrefix()
+    {
+        $config = new ConfigFileStorage();
+        return $config->getValue( "db_prefix" );
+    }
+
+    /**
+     * some useful little functions
+     */
+    class WizardTools extends Object
+    {
+       /**
+        * returns true if plog has already been installed before or
+        * false otherwise
+        */
+       function isNewInstallation()
+       {
+           $configFile = new ConfigFileStorage();
+           // if plog hasn't been installed, this file will have empty settings
+           if( $configFile->getValue( "db_host") == "" && $configFile->getValue( "db_username") == "" &&
+               $configFile->getValue( "db_database") == "" && $configFile->getValue( "db_prefix" ) == "" &&
+               $configFile->getValue( "db_password" ) == "" )
+               $isNew = true;
+           else
+               $isNew = false;
+
+           return( $isNew );
+       }
+    }
+
+    /**
+     * Renders a template file.
+     */
+    class WizardView extends View
+    {
+
+        var $_templateName;
+
+        function WizardView( $templateName )
+        {
+            $this->View();
+            $this->_templateName = $templateName;
+        }
+
+        function render()
+        {
+            // build the file name
+            $templateFileName = "wizard/".$this->_templateName.".template";
+
+            //$t = new Template( $templateFileName, "" );
+            $t = new Smarty();
+            $v = new Version();
+            $this->_params->setValue( "version", $v->getVersion());
+            $this->_params->setValue( "projectPage", $v->getProjectPage());
+            $this->_params->setValue( "safeMode", ini_get("safe_mode"));
+            $t->assign( $this->_params->getAsArray());
+            $t->template_dir    = "./templates";
+            $t->compile_dir     = TEMP_FOLDER;
+            $t->cache_dir       = TEMP_FOLDER;
+            $t->use_sub_dirs    = false;
+            $t->caching = false;
+
+            print $t->fetch( $templateFileName );
+        }
+    }
+
+    /**
+     * Gets the information about the database from the user.
+     */
+    class WizardIntro extends Action
+    {
+        function WizardIntro( $actionInfo, $request )
+        {
+            $this->Action( $actionInfo, $request );
+        }
+
+        function perform()
+        {
+            // we can detect whether plog is already installed or not and direct users to the right
+            // place
+            if( WizardTools::isNewInstallation())
+                $this->_view = new WizardView( "intro" );
+            else {
+                Controller::setForwardAction( "Update1" );
+                return false;
+            }
+
+            $this->setCommonData();
+            return true;
+        }
+    }
+
+    /**
+     *
+     * Saves data to the configuration file
+     *
+     */
+    class WizardStepOne extends Action
+    {
+
+        var $_dbServer;
+        var $_dbUser;
+        var $_dbPassword;
+        var $_dbName;
+        var $_dbPrefix;
+
+        function WizardStepOne( $actionInfo, $request )
+        {
+            $this->Action( $actionInfo, $request );
+
+            // data validation
+            $this->registerFieldValidator( "dbServer", new StringValidator());
+            $this->registerFieldValidator( "dbUser", new StringValidator());
+            $this->registerFieldValidator( "dbPassword",  new StringValidator(), true );
+            $this->registerFieldValidator( "dbName", new StringValidator());
+            $this->registerFieldValidator( "dbPrefix", new StringValidator(), true );
+            $errorView = new WizardView( "intro" );
+            $errorView->setErrorMessage( "Some data was incorrect or missing." );
+            $this->setValidationErrorView( $errorView );
+        }
+
+        function perform()
+        {
+            // fetch the data needed from the request
+            $this->_dbServer   = $this->_request->getValue( "dbServer" );
+            $this->_dbUser     = $this->_request->getValue( "dbUser" );
+            $this->_dbPassword = $this->_request->getValue( "dbPassword" );
+            $this->_dbName     = $this->_request->getValue( "dbName" );
+            $this->_skipThis   = $this->_request->getValue( "skipDbInfo" );
+            $this->_dbPrefix   = $this->_request->getValue( "dbPrefix", DEFAULT_DB_PREFIX );
+
+            // we should now save the data to the configuration file, just before
+            // we read it
+            $configFile = new ConfigFileStorage();
+
+            // we expect everything to be fine
+            $errors = false;
+
+            // before doing anything, we should check of the configuration file is
+            // writable by this script, or else, throw an error and bail out gracefully
+            $configFileName = $configFile->getConfigFileName();
+            if( !File::exists( $configFileName )) {
+                if (! File::touch( $configFileName ) ) {
+                    $this->_view = new WizardView( "intro" );
+                    $message = "Could not create the pLog configuration file $configFileName. Please make sure
+                                that the file can be created by the user running the webserver. It is needed to
+                                store the database configuration settings.";
+                    $this->_view->setErrorMessage( $message );
+                    $this->setCommonData( true );
+                    return false;
+                } else {
+                    ConfigFileStorage::createConfigFile( $configFileName );
+                }
+            }
+            if( File::exists( $configFileName ) && !File::isWritable( $configFileName )) {
+                $this->_view = new WizardView( "intro" );
+                $message = "Please make sure that the file $configFileName can be written by this script during
+                            the installation process. It is needed to store the database configuration settings. Once the
+                            installation is complete, please revert the permissions to no writing possible.";
+                $this->_view->setErrorMessage( $message );
+                $this->setCommonData( true );
+                return false;
+            }
+
+            // continue if everything went fine
+            if( !$configFile->saveValue( "db_username", $this->_dbUser ) ||
+                !$configFile->saveValue( "db_password", $this->_dbPassword ) ||
+                !$configFile->saveValue( "db_host", $this->_dbServer ) ||
+                !$configFile->saveValue( "db_database", $this->_dbName ) ||
+                !$configFile->saveValue( "db_prefix", $this->_dbPrefix )) {
+                $errors = true;
+            }
+
+            if( $errors ) {
+                $message = "Could not save values to the configuration file. Please make sure it is available and
+                            that has write permissions for the user under your web server is running.";
+                $this->_view = new WizardView( "intro" );
+                $this->_view->setErrorMessage( $message );
+
+                return( false );
+            }
+            else {
+                $this->_view = new WizardView( "step1" );
+
+                // now we better read the information from the config file to make sure that
+                // it has been correctly saved
+                $this->setCommonData( true );
+
+                return true;
+            }
+        }
+    }
+
+    /**
+     *
+     * Second step where we connect to the database and create the tables.
+     *
+     */
+    class WizardStepTwo extends Action
+    {
+
+        var $_db;
+        var $_database;
+        var $_createDatabase;
+
+        function setDbConfigValues( &$view )
+        {
+            $configFile = new ConfigFileStorage();
+            $configFile->reload();
+            $view->setValue( "dbUser", $configFile->getValue( "db_username" ));
+            $view->setValue( "dbPassword", $configFile->getValue( "db_password" ));
+            $view->setValue( "dbServer", $configFile->getValue( "db_host" ));
+            $view->setValue( "dbName", $configFile->getValue( "db_database" ));
+            $view->setValue( "dbPrefix", $configFile->getValue( "db_prefix" ));
+            return true;
+        }
+
+        function perform()
+        {
+            global $Tables;
+            global $Inserts;
+
+            $createDb = $this->_request->getValue( "createDatabase" );
+
+            // only check for errors in case the database table should already exist!
+            if( !$createDb ) {
+                $connectionEsablished = false;
+
+                // Lets check the 'everything is fine' case first..
+                $this->_db = connectDb();
+                if( $this->_db ) {
+                     $connectionEsablished = true;
+                } else {
+                     $connectionEsablished = false;
+                     $message = "There was an error selecting the database. Please verify the database was already created or check the 'Create database' checkbox.";
+                }
+
+                // We were unable to connect to the db and select the right db.. lets try
+                // just to connect.. maybe the database needs to be created (even though the
+                // user did not check the appropriate box).
+                if ( !$connectionEsablished ) {
+                    $this->_db = connectDb( true, false );
+                    if( !$this->_db ) {
+                         $message = "There was an error connecting to the database. Please check your settings.";
+                    }
+                }
+
+                if ( !$connectionEsablished ) {
+                    $this->_view = new WizardView( "step1" );
+                    $this->setDbConfigValues( $this->_view );
+                    $this->_view->setErrorMessage( $message );
+                    $this->setCommonData( true );
+                    return false;
+                }
+            }
+
+            $config = new ConfigFileStorage();
+            $this->_database = $config->getValue( "db_database" );
+            $this->_dbPrefix = $config->getValue( "db_prefix" );
+
+            // create the database
+            if( $createDb ) {
+                $this->_db = connectDb( false, false );
+                if( !$this->_db->Execute( "CREATE DATABASE ".$this->_database )) {
+                    $message = "Error creating the database: ".$this->_db->ErrorMsg();
+                    $this->_view = new WizardView( "step1" );
+                    $this->setDbConfigValues( $this->_view );
+                    $this->_view->setErrorMessage( $message );
+                    $this->setCommonData( true );
+                    return false;
+                } else {
+                    $message = "Database created successfully.<br/>";
+                }
+            }
+
+            // reconnect using the new database.
+            $config = new ConfigFileStorage();
+            $this->_db->Connect($config->getValue( "db_host" ), $config->getValue( "db_username" ), $config->getValue( "db_password" ), $config->getValue( "db_database" ));
+
+            // create the tables
+            $errors = false;
+            foreach( $Tables as $table ) {
+                $query = str_replace( "{dbprefix}", $this->_dbPrefix, $table["code"] );
+                if( $this->_db->Execute( $query ))
+                    $message .= "Table <strong>".$table["desc"]."</strong> created successfully.<br/>";
+                else {
+                    $message .= "Error creating table: ".$this->_db->ErrorMsg()."<br/>";
+                    $errors = true;
+                }
+            }
+
+            if( $errors ) {
+                $message = "There was an error creating the tables in the database. Please make sure that the user chosen to connect to the database has enough permissions to create tables.<br/><br/>$message";
+                $this->_view = new WizardView( "step1" );
+                $this->_view->setErrorMessage( $message );
+                $this->setDbConfigValues( $this->_view );
+                $this->setCommonData();
+                return false;
+            }
+
+            // try to guess the url where plog is running
+             // try to guess the url where plog is running
+             $httpProtocol = (array_key_exists("HTTPS", $_SERVER) && $_SERVER["HTTPS"] == "on") ? "https://" : "http://";
+             $httpHost = $_SERVER["HTTP_HOST"];
+             $requestUrl = $_SERVER["REQUEST_URI"];
+             $requestUrl = str_replace( "/wizard.php", "", $requestUrl );
+             $plogUrl = $httpProtocol.$httpHost.$requestUrl;
+
+            // Find some of the tools we are going to need (last one is for os x, with fink installed)
+            // TBD: support for Windows specific directories
+            $folders = Array( "/bin/", "/usr/bin/", "/usr/local/bin/", "/sw/bin/" );
+            $finder = new FileFinder();
+            $pathToUnzip = $finder->findBinary( "unzip", $folders );
+            $pathToTar = $finder->findBinary( "tar", $folders);
+            $pathToGzip = $finder->findBinary( "gzip", $folders);
+            $pathToBzip2 = $finder->findBinary( "bzip2", $folders);
+            $pathToConvert = $finder->findBinary( "convert", $folders);
+
+            // and execute some insert's
+            foreach( $Inserts as $insert ) {
+                $query = str_replace( "{dbprefix}", $this->_dbPrefix, $insert );
+                $query = str_replace( "{plog_base_url}", $plogUrl, $query );
+                // replace also the placeholders for the paths to the tools
+                $query = str_replace( "{path_to_tar}", $pathToTar, $query );
+                $query = str_replace( "{path_to_unzip}", $pathToUnzip, $query );
+                $query = str_replace( "{path_to_bz2}", $pathToBzip2, $query );
+                $query = str_replace( "{path_to_gzip}", $pathToGzip, $query );
+                $query = str_replace( "{path_to_convert}", $pathToConvert, $query );
+                $query = str_replace( "{path_to_convert}", $pathToConvert, $query );
+                if( !$this->_db->Execute( $query )) {
+                    $message .= "Error executing code: ".$this->_db->ErrorMsg()."<br/>";
+                    $errors = true;
+                }
+            }
+
+            //
+            // show some information regarding the helper tools we're going to need
+            // and wether they were found or not
+            //
+            $message .= "<br/><b>-- Helper tools --</b><br/>";
+            if( $pathToTar == "" )
+                $message .= "The helper tool 'tar' was not found<br/>";
+            else
+                $message .= "The helper tool 'tar' was found in $pathToTar<br/>";
+            if( $pathToGzip == "" )
+                $message .= "The helper tool 'gzip' was not found<br/>";
+            else
+                $message .= "The helper tool 'gzip' was found in $pathToGzip<br/>";
+            if( $pathToUnzip == "" )
+                $message .= "The helper tool 'unzip' was not found<br/>";
+            else
+                $message .= "The helper tool 'unzip' was found in $pathToUnzip<br/>";
+            if( $pathToBzip2 == "" )
+                $message .= "The helper tool 'bzip2' was not found<br/>";
+            else
+                $message .= "The helper tool 'bzip2' was found in $pathToTar<br/>";
+            if( $pathToConvert == "" )
+                $message .= "The helper tool 'convert' (from the ImageMagick package) was not found<br/>";
+            else
+                $message .= "The helper tool 'convert' (from the ImageMagick package) was found in $pathToConvert<br/>";
+
+            if( $errors ) {
+                $this->_view = new WizardView( "step1" );
+                $this->setDbConfigValues( $this->_view );
+                $message = "There was an error initializing some of the tables. Please make sure that the user chosen to connect to the database has enough permissions to add records to the database.<br/><br/>$message";
+                $this->_view->setErrorMessage( $message );
+                $this->setCommonData();
+            }
+            else {
+                $this->_view = new WizardView( "step2" );
+                $this->_view->setValue( "message", $message );
+            }
+
+            // Scan for locales
+            $locales = new Locales();
+            // find all the new locales that we have not yet stored
+            $f = new LocaleFinder();
+            $newLocaleCodes = $f->find();
+
+            foreach( $newLocaleCodes as $newLocaleCode ) {
+                $res = $locales->addLocale( $newLocaleCode );
+            }
+
+            return true;
+        }
+    }
+
+    /**
+     *
+     * this action only shows some feedback
+     *
+     */
+    class WizardStepThree extends Action
+    {
+        function perform()
+        {
+            $this->_view = new WizardView( "step3" );
+            $this->setCommonData();
+        }
+    }
+
+    /**
+     *
+     * Create the first user in the database
+     *
+     */
+    class WizardStepFour extends Action
+    {
+
+        var $_userName;
+        var $_userPassword;
+        var $_confirmPassword;
+        var $_userEmail;
+        var $_userFullName;
+
+        function WizardStepFour( $actionInfo, $request )
+        {
+            $this->Action( $actionInfo, $request );
+
+            $this->registerFieldValidator( "userName", new StringValidator());
+            $this->registerFieldValidator( "userPassword", new PasswordValidator());
+            $this->registerFieldValidator( "userPasswordCheck", new PasswordValidator());
+            $this->registerFieldValidator( "userEmail", new EmailValidator());
+            $this->registerField( "userFullName" );
+            $view = new WizardView( "step3" );
+            $view->setErrorMessage( "Some data is missing or incorrect" );
+            $this->setValidationErrorView( $view );
+        }
+
+        // creates the user
+        function perform()
+        {
+            $this->_userName = $this->_request->getValue( "userName" );
+            $this->_userPassword = $this->_request->getValue( "userPassword" );
+            $this->_confirmPassword = $this->_request->getValue( "userPasswordCheck" );
+            $this->_userEmail = $this->_request->getValue( "userEmail" );
+            $this->_userFullName = $this->_request->getValue( "userFullName" );
+
+            $db = connectDb();
+
+            if( !$db ) {
+                $this->_view = new WizardView( "step3" );
+                $this->_view->setErrorMessage( "There was an error connecting to the database. Please check your settings." );
+                $this->setCommonData();
+                return false;
+            }
+
+            if( $this->_confirmPassword != $this->_userPassword ) {
+                $this->_view = new WizardView( "step3" );
+                $this->_form->setFieldValidationStatus( "userPasswordCheck", false );
+                $this->setCommonData( true );
+                return false;
+            }
+
+            $dbPrefix = Db::getPrefix();
+
+            $users = new Users();
+            $user = new UserInfo( $this->_userName,
+                                  $this->_userPassword,
+                                  $this->_userEmail,
+                                  "",
+                                  $this->_userFullName);
+            $userId = $users->addUser( $user );
+            if( !$userId ) {
+                $this->_view = new WizardView( "step3" );
+                $message = "There was an error adding the user. Make sure that the user does not already exist in the database (".$users->DbError().")";
+                $this->_view->setErrorMessage( $message );
+                $this->setCommonData();
+                return false;
+            }
+
+            // we also have to execute the code to give administrator privileges to this user
+            $query = "INSERT INTO {$dbPrefix}users_permissions(user_id,blog_id,permission_id) VALUES( $userId, 0, 1 );";
+            $db->Execute( $query );
+
+            $this->_view = new Wizardview( "step4" );
+            $this->_view->setValue( "ownerid", $userId );
+            $this->_view->setValue( "siteLocales", Locales::getLocales());
+            $this->_view->setValue( "defaultLocale", Locales::getDefaultLocale());
+            $ts = new TemplateSets();
+            $this->_view->setValue( "siteTemplates", $ts->getGlobalTemplateSets());
+            $this->setCommonData();
+            return true;
+        }
+
+    }
+
+    class WizardStepFive extends Action
+    {
+
+        var $_blogName;
+        var $_ownerId;
+        var $_blogProperties;
+
+        function WizardStepFive( $actionInfo, $request )
+        {
+              $this->Action( $actionInfo, $request );
+
+              $this->registerFieldValidator( "blogName", new StringValidator());
+              $this->registerFieldValidator( "ownerid", new IntegerValidator());
+              $this->registerFieldValidator( "blogTemplate", new StringValidator());
+              $this->registerFieldValidator( "blogLocale", new StringValidator());
+              $view = new WizardView( "step4" );
+              $view->setErrorMessage( "Some data is missing or incorrect" );
+              $view->setValue( "siteLocales", Locales::getLocales());
+              $ts = new TemplateSets();
+              $view->setValue( "siteTemplates", $ts->getGlobalTemplateSets());
+              $this->setValidationErrorView( $view );
+        }
+
+        function perform()
+        {
+            // retrieve the values from the view
+            $this->_blogName = $this->_request->getValue( "blogName" );
+            $this->_ownerId  = $this->_request->getValue( "ownerid" );
+            $this->_blogProperties = $this->_request->getValue( "properties" );
+            $this->_blogTemplate = $this->_request->getValue( "blogTemplate" );
+            $this->_blogLocale = $this->_request->getValue( "blogLocale" );
+
+            // configure the blog
+            $blogs = new Blogs();
+            $blog = new BlogInfo( $this->_blogName, $this->_ownerId, "", "" );
+            $blog->setProperties( $this->_blogProperties );
+            $blog->setStatus( BLOG_STATUS_ACTIVE );
+            $blogSettings = $blog->getSettings();
+            $blogSettings->setValue( "locale", $this->_blogLocale );
+            $blogSettings->setValue( "template", $this->_blogTemplate );
+            $blog->setSettings( $blogSettings );
+
+            // and now save it to the database
+            $newblogId = $blogs->addBlog( $blog );
+            if( !$newblogId ) {
+                $this->_view = new WizardView( "step4" );
+                $this->_view->setValue( "siteLocales", Locales::getLocales());
+                $ts = new TemplateSets();
+                $this->_view->setValue( "siteTemplates", $ts->getGlobalTemplateSets());
+                $this->_view->setErrorMessage( "There was an error creating the new blog" );
+                $this->setCommonData( true );
+                return false;
+            }
+
+            // if the blog was created, we can add some basic information
+            // add a category
+            $articleCategories = new ArticleCategories();
+            $articleCategory = new ArticleCategory( "General", "", $newblogId, true );
+            $catId = $articleCategories->addArticleCategory( $articleCategory );
+
+            // load the right locale
+            $locale =& Locales::getLocale( $this->_blogLocale );
+            // and load the right text
+            $articleTopic = $locale->tr( "register_default_article_topic" );
+            $articleText  = $locale->tr( "register_default_article_text" );
+            $article = new Article( $articleTopic, $articleText, Array( $catId ), $this->_ownerId, $newblogId, POST_STATUS_PUBLISHED, 0, Array(), "welcome" );
+            $t = new Timestamp();
+            $article->setDateObject( $t );
+            $articles = new Articles();
+            $articles->addArticle( $article );
+
+            // save a few things in the default configuration
+            $config =& Config::getConfig();
+            // default blog id
+            $config->saveValue( "default_blog_id", (int)$newblogId );
+            // default locale
+            $config->saveValue( "default_locale", $this->_blogLocale );
+            // and finally, the default template
+            $config->saveValue( "default_template", $this->_blogTemplate );
+
+            //
+            // detect wether we have GD available and set the blog to use it
+            //
+            if( GdDetector::detectGd()) {
+                $config->saveValue( "thumbnail_method", "gd" );
+                $message = "GD has been detected and set as the backend for dealing with images.";
+            }
+            else {
+                $pathToConvert = $config->getValue( "path_to_convert" );
+                if( $pathToConvert ) {
+                    $config->saveValue( "thumbnail_method", "imagemagick" );
+                    $message = "ImageMagick has been detected and set as the backend for dealing with images.";
+                }
+                else {
+                    // nothing was found, so we'll have to do away with the 'null' resizer...
+                    $config->saveValue( "thumbnail_method", "null" );
+                    $message = "Neither GD nor ImageMagick have been detected in this host so it will not be possible to generate thumbnails from images.";
+                }
+            }
+
+            $this->_view = new WizardView( "step5" );
+            $this->_view->setValue( "message", $message );
+            return true;
+        }
+    }
+
+    //
+    // The following classes take care of updating the database to the last release
+    //
+    // Things that need to be done when going from 0.3.x to 1.0:
+    //
+    // - add the new tables:
+    //     plog_article_categories_link
+    //     plog_custom_fields_definition
+    //     plog_custom_fields_values
+    //
+    // - make modifications to some of the old tables:
+    //     plog_articles
+    //          normalized_text: TEXT
+    //          normalized_topic: TEXT
+    //          mangled_topic: TEXT
+    //          category_id: DROP
+    //          FULLTEXT(normalized_text)
+    //          FULLTEXT(normalized_topic)
+    //          FULLTEXT(normalized_text, normalized_topic)
+    //     plog_articles_categories
+    //          parent_id: INTEGER
+    //          mangled_name: TEXT
+    //          properties: TEXT
+    //     plog_articles_comments
+    //          normalized_text: TEXT
+    //          normalized_topic: TEXT
+    //          FULLTEXT(normalized_text)
+    //          FULLTEXT(normalized_topic)
+    //          FULLTEXT(normalized_text, normalized_topic)
+    //     plog_blogs
+    //          mangled_blog: TEXT
+    //          properties: TEXT
+    //     plog_gallery_albums
+    //          normalized_name: VARCHAR
+    //          normalized_description: TEXT
+    //          mangled_name: VARCHAR
+    //          FULLTEXT(normalized_name)
+    //          FULLTEXT(normalized_description)
+    //          FULLTEXT(normalized_name, normalized_description)
+    //     plog_gallery_resources
+    //          normalized_description: TEXT
+    //          FULLTEXT(normalized_description)
+    //     plog_mylinks
+    //          properties: TEXT
+    //     plog_mylinks_categories
+    //          properties: TEXT
+    //     plog_users
+    //          properties: TEXT
+    //          full_name: VARCHAR
+    //
+    // - for all the articles in the db, fill in the normalized_text, normalized_topic and mangled_topic
+    //   fields using the TextFilter class
+    //
+    // - for all articles in the db, change the status from a string ('published', 'draft', 'deleted') to
+    // an integer (POST_STATUS_{PUBLISHED|DELETED|DRAFT}
+    //
+    // - for all articles and categories, arrange the plog_article_categories_link table so that everything works
+    //   as before
+    //
+    // - for all article categories, fill in the mangled_name field
+    //
+    // - for all comments, fill in the normalized_text and normalized_topic fields
+    //
+    // - for all blogs, fill in the mangled_blog field
+    //
+    // - for all albums, fill in the normalized_name, normalized_description and mangled_name fields
+    //
+    // - for all resources, fill in the normalized_description field
+
+
+    class UpdateStepOne extends Action
+    {
+
+        function perform()
+        {
+            $this->_view = new WizardView( "update1" );
+            WizardStepTwo::setDbConfigValues( $this->_view );
+            $this->setCommonData();
+        }
+    }
+
+    class UpdateStepTwo extends Action
+    {
+
+        var $_db;
+        var $_dbPrefix;
+
+        function validate()
+        {
+            $configFile = new ConfigFileStorage();
+            $this->_dbPrefix = $configFile->getValue( "db_prefix" );
+
+            return true;
+        }
+
+        function perform()
+        {
+            // we need to create the new tables here
+            $newTables = Array( 21, 22, 23, 24 );
+
+            global $Tables;
+            global $Changes;
+            global $Inserts;
+
+            // connect to the db
+            $this->_db = connectDb();
+
+            // store error messages in this var
+            $message = "";
+
+            if( !$this->_db ) {
+                $this->_view = new WizardView( "update1" );
+                WizardStepTwo::setDbConfigValues( $this->_view );
+                $this->_view->setErrorMessage( "There was an error connecting to the database. Please check your settings." );
+                return false;
+            }
+
+            // ---
+            // create the new tables in 1.0
+            // ---
+            // loop only through the new tables
+            foreach( $newTables as $tableId ) {
+                // get info about the table we'd like to use
+                $table = $Tables[$tableId];
+                // and run the query
+                $query = str_replace( "{dbprefix}", $this->_dbPrefix, $table["code"] );
+                if( $this->_db->Execute( $query ))
+                    $message .= "New table <strong>".$table["desc"]."</strong> created successfully.<br/>";
+                else {
+                    $message .= "Error creating table: ".$this->_db->ErrorMsg()."<br/>";
+                    $errors = true;
+                }
+            }
+            if( !$errors ) {
+                $message .= "** New tables created successfully **<br/><br/>";
+            }
+
+            // ---
+            // make changes to the tables that need changes
+            // ---
+            foreach( $Changes as $tableId => $changeTable) {
+                $errorMessage = "";            
+                foreach( $changeTable as $changeCode ) {
+                    // and run the query
+                    $query = str_replace( "{dbprefix}", $this->_dbPrefix, $changeCode );
+                    if( !$this->_db->Execute( $query )) {
+                        $errors = true;                    
+                        $errorMessage .= $this->_db->ErrorMsg()."<br/>";
+                    }
+                }
+
+                if( !$errors )
+                    $message .= "Changes to table <strong>$tableId</strong> executed successfully.<br/>";
+                else {
+                    $message .= "Error modifying table $tableId: ".$errorMessage;
+                }
+            }
+
+            if( !$errors ) {
+                $message .= "** Modifications to old tables carried out successfully **<br/><br/>";
+            }
+
+            // ---
+            // add the new configuration settings that were added for 1.0
+            // ---
+            $newSettings = range( 71, 112 );
+            foreach( $newSettings as $settingId ) {
+                $setting = $Inserts[$settingId];
+                $query = str_replace( "{dbprefix}", $this->_dbPrefix, $setting );
+                if( !$this->_db->Execute( $query )) {
+                    $message .= "There was an error executing: ".$this->_db->ErrorMsg()."<br/>";
+                    $errors = true;
+                }
+            }
+
+            //
+            // there's nothing left to do so we can quit now!!
+            //
+            if( !$errors ) {
+                $this->_view = new WizardView( "update2" );
+                $this->_view->setValue( "message", $message );
+            }
+            else {
+                $this->_view = new WizardView( "update1" );
+                WizardStepTwo::setDbConfigValues( $this->_view );
+                $this->_view->setErrorMessage( $message );
+            }
+
+            return true;
+        }
+    }
+
+    /**
+     * this is the first step of the transformations to some of the fields in the tables.
+     * Precisely, it is in this step where we regenerate the indexes for the search engine... However, it
+     * could take it a while...
+     */
+    class UpdateStepThree extends Action
+    {
+        function UpdateStepThree( $actionInfo, $httpRequest )
+        {
+            $this->Action( $actionInfo, $httpRequest );
+
+            // load the current step, if any
+            $this->_curStep = $this->_request->getValue( "curStep" );
+            $this->_numPosts = $this->_request->getValue( "numPosts" );
+
+            //print("cur step = ".$this->_curStep." - num posts = ".$this->_numPosts."<br/>");
+        }
+
+        function getStatusId( $statusStr )
+        {
+            if( $statusStr == 'published' ) return POST_STATUS_PUBLISHED;
+            if( $statusStr == 'draft' ) return POST_STATUS_DRAFT;
+            if( $statusStr == 'deleted' ) return POST_STATUS_DELETED;
+
+            return false;
+        }
+
+       function perform()
+       {
+            // get a connection to the db
+            $db = connectDb();
+            $dbPrefix = getDbPrefix();
+            $db->debug=false;
+
+            // no errors here
+            $errors = false;
+
+            // see how many records we have
+            $queryCount = "SELECT COUNT(*) AS total FROM {$dbPrefix}articles";
+            $result = $db->Execute( $queryCount );
+            $row = $result->FetchRow();
+            $numRecords = $row["total"];
+            $this->_totalPosts = $numRecords;
+            // check whether we should use multiple steps
+            $multipleSteps = ( $numRecords > WIZARD_MAX_RECORDS_THRESHOLD );
+            if( $multipleSteps ) {
+                // how many steps do we need?
+                $numSteps = ceil( $numRecords / WIZARD_MAX_RECORDS_PER_STEP );
+                $this->_numSteps = $numSteps;
+                //print("using different steps! numSteps = $numSteps<br/>");
+            }
+
+            // run the query and loop through the results
+            $query = "SELECT * FROM {$dbPrefix}articles";
+            if( $multipleSteps ) {
+                // generate the LIMIT condition for this page
+                $query .= " LIMIT ".$this->_curStep*WIZARD_MAX_RECORDS_PER_STEP.", ".WIZARD_MAX_RECORDS_PER_STEP;
+            }
+
+            //print("query = $query<br/>");
+
+            $result = $db->Execute( $query );
+
+            $tf = new TextFilter();
+
+            $numPosts = $result->RowCount();
+
+            while( $row = $result->FetchRow()) {
+                // for each one of the articles, fill in the mangled_topic, normalized_text and normalized_value
+                $normalizedTopic = Db::qstr($tf->normalizeText( $row["topic"] ));
+                $postTopic       = Db::qstr($row["topic"]);
+                $normalizedText  = Db::qstr($tf->normalizeText( $row["text"] ));
+                $postText        = Db::qstr($row["text"]);
+                $mangledTopic    = Db::qstr($tf->urlize( $row["topic"] ));
+                $status          = $this->getStatusId( $row["old_status"] );
+                $artId           = $row["id"];
+                $catId           = $row["category_id"];
+
+                $query = "UPDATE {$dbPrefix}articles SET slug = '$mangledTopic', date = date, status = $status
+                          WHERE id = $artId";
+
+                $query2= "INSERT INTO {$dbPrefix}article_categories_link(article_id, category_id)
+                          VALUES ( $artId, $catId )";
+
+                $query3= "INSERT INTO {$dbPrefix}articles_text (article_id,text,topic,normalized_text,normalized_topic,mangled_topic)
+                          VALUES('$artId','$postText','$postTopic','$normalizedTopic','$normalizedText','$mangledTopic')";
+
+
+                // execute the two queries
+                $res  = $db->Execute( $query );
+                $res2 = $db->Execute( $query2 );
+                $res3 = $db->Execute( $query3 );
+
+                /*if( !$res || !$res2 || !$res3 )
+                    $errors = true;*/
+            }
+
+            // check whether we've already done the last step or not
+            $lastStepDone = ( $this->_curStep >= $this->_numSteps );
+
+            // if error
+            if( $errors ) {
+                $this->_view = new WizardView( "update2" );
+                $this->_view->setErrorMessage( "There was an error updating the articles table." );
+                $this->setCommonData();
+                return false;
+            }
+
+            //$query1 = "ALTER TABLE {$dbPrefix}articles DROP COLUMN old_status, DROP COLUMN category_id";
+            //$db->Execute( $query1 );
+
+            // if everyhting's fine, say so...
+            if( !$multipleSteps || $lastStepDone ) {
+                $this->_view = new WizardView( "update3" );
+                $this->_view->setValue( "totalPosts", $this->_totalPosts );
+            }
+            else {
+                // if we're using multiple steps, show the same page
+                $this->_view = new WizardView( "update2" );
+                $this->_view->setValue( "numPosts", $numPosts );
+                $this->_view->setValue( "curStep", $this->_curStep+1 );
+                $this->_view->setValue( "totalPosts", $this->_totalPosts );
+                $this->_view->setValue( "numSteps", $this->_numSteps );
+                $this->_view->setValue( "multipleSteps", true );
+            }
+
+            return true;
+        }
+
+    }
+
+    // ---
+    // this action will do the same as before but for the rest of the tables that need some data to
+    // be normalized/mangled
+    // ---
+    class UpdateStepFour extends Action
+    {
+
+        var $dbPrefix;
+        var $db;
+        var $t;
+
+        function validate()
+        {
+            $this->db = connectDb();
+            $this->dbPrefix = getDbPrefix();
+            $this->t = new TextFilter();
+
+            return true;
+        }
+
+        //
+        // process the article categories
+        //
+        function updateArticleCategories()
+        {
+            $dbPrefix = $this->dbPrefix;
+            $query = "SELECT * FROM {$dbPrefix}articles_categories";
+            $result = $this->db->Execute( $query );
+
+            while( $row = $result->FetchRow()) {
+                $catId = $row["id"];
+                $mangledName = $this->t->urlize( $row["name"] );
+                $query = "UPDATE {$dbPrefix}articles_categories
+                          SET mangled_name = '$mangledName', last_modification = last_modification
+                          WHERE id = $catId";
+
+                $res = $this->db->Execute( $query );
+
+                // this is not very nice to see but it works... :)
+                if( !$res ) {
+                    $this->message .= "There was an error updating the article categories table.<br/>";
+                    return false;
+                }
+            }
+
+            $this->message .= "Article Categories table updated successfully!<br/>";
+
+            return true;
+        }
+
+        //
+        // process the comments
+        //
+        function updateArticleComments()
+        {
+            $dbPrefix = $this->dbPrefix;
+            $query = "SELECT * FROM {$dbPrefix}articles_comments";
+            $result = $this->db->Execute( $query );
+
+            while( $row = $result->FetchRow()) {
+                $commentId = $row["id"];
+                $normText = Db::qstr($this->t->normalizeText( $row["text"] ));
+                $normTopic = Db::qstr($this->t->normalizeText( $row["topic"] ));
+                $query = "UPDATE {$dbPrefix}articles_comments
+                          SET normalized_text = '$normText', normalized_topic = '$normTopic', date = date
+                          WHERE id = $commentId";
+
+                $res = $this->db->Execute( $query );
+
+                if( !$res ) {
+                    $this->message .= "There was an error updating the comments table.<br/>";
+                    return false;
+                }
+            }
+
+            $this->message .= "Comments table updated successfully!<br/>";
+
+            return true;
+        }
+
+        //
+        // process the blogs
+        //
+        function updateBlogs()
+        {
+            $dbPrefix = $this->dbPrefix;
+            $query = "SELECT * FROM {$dbPrefix}blogs";
+            $result = $this->db->Execute( $query );
+
+            while( $row = $result->FetchRow()) {
+                $blogId = $row["id"];
+                $mangledBlog = $this->t->urlize( $row["blog"] );
+                $query = "UPDATE {$dbPrefix}blogs
+                          SET mangled_blog = '$mangledBlog' WHERE id = $blogId";
+
+                $res = $this->db->Execute( $query );
+
+                if( !$res ) {
+                    $this->message .= "There wasn an error updaing the blogs table.<br/>";
+                    return false;
+                }
+            }
+
+            $this->message .= "Blogs table updated successfully!<br/>";
+
+            return true;
+        }
+
+        //
+        // process the albums
+        //
+        function updateAlbums()
+        {
+            $dbPrefix = $this->dbPrefix;
+            $query = "SELECT * FROM {$dbPrefix}gallery_albums";
+            $result = $this->db->Execute( $query );
+
+            while( $row = $result->FetchRow()) {
+                $albumId = $row["id"];
+                $mangledName = Db::qstr($this->t->urlize( $row["name"] ));
+                $normName = Db::qstr($this->t->normalizeText( $row["name"] ));
+                $normDescription = Db::qstr($this->t->normalizeText( $row["description"] ));
+                $query = "UPDATE {$dbPrefix}gallery_albums
+                          SET mangled_name = '$mangledName', normalized_name = '$normName',
+                          normalized_description = '$normDescription', date = date
+                          WHERE id = $albumId";
+
+                $res = $this->db->Execute( $query );
+
+                if( !$res ) {
+                    $this->message .= "There was an error updating the albums table.<br/>";
+                    return false;
+                }
+            }
+
+            $this->message .= "Resource Albums table updated successfully!<br/>";
+
+            return true;
+        }
+
+        //
+        // and finally, the resources...
+        //
+        function updateResources()
+        {
+            $dbPrefix = $this->dbPrefix;
+            $query = "SELECT * FROM {$dbPrefix}gallery_resources";
+            $result = $this->db->Execute( $query );
+
+            while( $row = $result->FetchRow()) {
+                $resId = $row["id"];
+                //$normName = $this->t->normalizeText( $row["name"] );
+                $normDescription = Db::qstr($this->t->normalizeText( $row["description"] ));
+                $query = "UPDATE {$dbPrefix}gallery_resources
+                          SET normalized_description = '$normDescription', date = date
+                          WHERE id = $resId";
+
+                $res = $this->db->Execute( $query );
+                if( !$res ) {
+                    $this->message .= "There was an error updating the resources table.<br/>";
+                    return false;
+                }
+            }
+
+            $this->message .= "Resources table updated successfully!<br/>";
+
+            return true;
+
+        }
+
+        //
+        // process the articles' text
+        //
+        function updateArticleText()
+        {
+            $dbPrefix = $this->dbPrefix;
+            // drop unneeded columns from articles table
+            $alter_query[] = "ALTER TABLE ".$dbPrefix."articles DROP COLUMN text";
+            $alter_query[] = "ALTER TABLE ".$dbPrefix."articles DROP COLUMN topic";
+
+            foreach ($alter_query as $value) {
+                $this->db->Execute($value);
+            }
+
+
+            $this->message .= "articles_text table updated successfully!<br/>";
+
+            return true;
+        }
+
+        function perform()
+        {
+            $updaters = Array( "updateArticleCategories", "updateArticleComments",
+                               "updateBlogs", "updateAlbums", "updateResources", "updateArticleText" );
+
+            // loop through each one of the methods to take care of updating one of the tables
+            foreach( $updaters as $method ) {
+                $result = $this->$method();
+
+                if( !$result ) {
+                    $this->_view = new WizardView( "update3" );
+                    $this->_view->setErrorMessage( $this->message );
+                    return false;
+                }
+            }
+
+            // everything went fine so we can show the final page!
+            $this->_view = new WizardView( "update4" );
+            $this->_view->setValue( "message", $this->message );
+
+            return true;
+        }
+
+    }
+
+    // check if the "./tmp" folder is writable by us, otherwise
+    // throw an error before the user gets countless errors
+    // from Smarty
+    if( !File::isWritable( TEMP_FOLDER ) || !File::isDir( TEMP_FOLDER )) {
+        print("<span style=\"color:red; font-size: 14px;\">Error</span><br/><br/>This wizard needs the ".TEMP_FOLDER." folder to be writable by the web server user.<br/><br/>Please correct that and try again.");
+        die();
+    }
+
+    //// main part ////
+    $controller = new Controller( $_actionMap, "nextStep" );
+    $controller->process( HttpVars::getRequest());
+?>

Modified: plog/trunk/xmlrpc.php
===================================================================
--- plog/trunk/xmlrpc.php	2005-05-31 10:21:08 UTC (rev 2127)
+++ plog/trunk/xmlrpc.php	2005-05-31 10:28:30 UTC (rev 2128)
@@ -650,9 +650,11 @@
         {
             $ret = array();
             $list = $articles->getBlogArticles(
-                $blogid,
-                -1,
-                $number
+                $blogid,  
+                -1,  // date
+                $number, // number of articles
+                0,  // category id
+                POST_STATUS_PUBLISHED  // only published articles
             );
 
             foreach($list as $item)




More information about the pLog-svn mailing list