[pLog-svn] r5958 - in plog/trunk/class: config dao dao/customfields dao/userdata data/validator database database/pdb/drivers gallery/dao misc net net/xmlrpc summary/dao summary/data test/tests/dao test/tests/data/validator

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sat Sep 29 04:03:41 EDT 2007


Author: oscar
Date: 2007-09-29 04:03:40 -0400 (Sat, 29 Sep 2007)
New Revision: 5958

Added:
   plog/trunk/class/database/ltdb.class.php
Modified:
   plog/trunk/class/config/configdbstorage.class.php
   plog/trunk/class/dao/articlecategories.class.php
   plog/trunk/class/dao/articles.class.php
   plog/trunk/class/dao/blogcategories.class.php
   plog/trunk/class/dao/blogs.class.php
   plog/trunk/class/dao/commentscommon.class.php
   plog/trunk/class/dao/customfields/customfieldsvalues.class.php
   plog/trunk/class/dao/friendgroups.class.php
   plog/trunk/class/dao/friends.class.php
   plog/trunk/class/dao/globalarticlecategories.class.php
   plog/trunk/class/dao/locations.class.php
   plog/trunk/class/dao/model.class.php
   plog/trunk/class/dao/mylinks.class.php
   plog/trunk/class/dao/privatemessages.class.php
   plog/trunk/class/dao/referers.class.php
   plog/trunk/class/dao/searchengine.class.php
   plog/trunk/class/dao/userdata/baseuserdataprovider.class.php
   plog/trunk/class/dao/userdata/joomlauserdataprovider.class.php
   plog/trunk/class/dao/userdata/lifetypeuserdataprovider.class.php
   plog/trunk/class/dao/userdata/phpbb2userdataprovider.class.php
   plog/trunk/class/dao/userdata/simplepostnukeuserdataprovider.class.php
   plog/trunk/class/dao/userdata/vbb3userdataprovider.class.php
   plog/trunk/class/dao/userdata/wbbuserdataprovider.class.php
   plog/trunk/class/dao/userpermissions.class.php
   plog/trunk/class/data/validator/filenamematchvalidator.class.php
   plog/trunk/class/database/db.class.php
   plog/trunk/class/database/pdb/drivers/pdbdriverbase.class.php
   plog/trunk/class/gallery/dao/galleryalbums.class.php
   plog/trunk/class/gallery/dao/galleryresourcequotas.class.php
   plog/trunk/class/gallery/dao/galleryresources.class.php
   plog/trunk/class/misc/info.class.php
   plog/trunk/class/net/modrewriterequestgenerator.class.php
   plog/trunk/class/net/xmlrpc/xmlrpcserver.class.php
   plog/trunk/class/summary/dao/summarystats.class.php
   plog/trunk/class/summary/data/summarytools.class.php
   plog/trunk/class/test/tests/dao/articlecategories_test.class.php
   plog/trunk/class/test/tests/data/validator/filenamematchvalidator_test.class.php
Log:
As requested in http://bugs.lifetype.net/view.php?id=1394, I've renamed our core Db class to LtDb so that it doesn't collide with PEAR's Db when used together. I can't wait to see namespaces in PHP.

I've left the original Db class for compatibility reasons mainly with plugins, but it is marked as deprecated and will be removed in future releases.


Modified: plog/trunk/class/config/configdbstorage.class.php
===================================================================
--- plog/trunk/class/config/configdbstorage.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/config/configdbstorage.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -77,12 +77,12 @@
 		{
             if ($this->_db == null) {
                 // source the neccessary class files
-                lt_include( PLOG_CLASS_PATH."class/database/db.class.php" );
+                lt_include( PLOG_CLASS_PATH."class/database/ltdb.class.php" );
 
                 // initialize the connection
-                $this->_db =& Db::getDb();
+                $this->_db =& LtDb::getDb();
                 // get the prefix
-                $this->_dbPrefix = Db::getPrefix();
+                $this->_dbPrefix = LtDb::getPrefix();
             }
         }
 
@@ -244,7 +244,7 @@
                     break;
                  case TYPE_STRING: // need to add quotes here
                  	$query = "UPDATE ".$this->_dbPrefix."config SET config_value =
-                             '".Db::qstr($value)."', value_type = $type WHERE config_key = '$key'";
+                             '".LtDb::qstr($value)."', value_type = $type WHERE config_key = '$key'";
                     break;
                  case TYPE_ARRAY:
                  case TYPE_OBJECT:	// need to serialize here
@@ -283,7 +283,7 @@
                     break;
                 case TYPE_STRING: // need to add quotes here
                      $query = "INSERT INTO ".$this->_dbPrefix."config (config_key,config_value,value_type)
-                              VALUES( '$key', '".Db::qstr($value)."', $type )";
+                              VALUES( '$key', '".LtDb::qstr($value)."', $type )";
                      break;
                 case TYPE_ARRAY:
                 case TYPE_OBJECT:	// need to serialize here

Modified: plog/trunk/class/dao/articlecategories.class.php
===================================================================
--- plog/trunk/class/dao/articlecategories.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/articlecategories.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -100,7 +100,7 @@
 		 */
 		function getSearchConditions( $searchTerms )
 		{
-			return( "name LIKE '%".Db::qstr($searchTerms)."%' OR description LIKE '%".Db::qstr($searchTerms)."%'" );
+			return( "name LIKE '%".LtDb::qstr($searchTerms)."%' OR description LIKE '%".LtDb::qstr($searchTerms)."%'" );
 		}
         
         /**
@@ -296,13 +296,13 @@
 			// set the counter fields
 			$category->setNumArticles( $this->getNumItems( 
 				$this->getPrefix()."article_categories_link", 
-				"category_id = '".Db::qstr($category->getId())."'",
+				"category_id = '".LtDb::qstr($category->getId())."'",
 				"category_id"
 			));
 			// number of published articles
 			$category->setNumPublishedArticles( $this->getNumItems (
 					$this->getPrefix()."article_categories_link acl, ".$this->getPrefix()."articles a",
-					"acl.category_id = '".Db::qstr($category->getId())."' and acl.article_id = a.id and a.status = ".POST_STATUS_PUBLISHED,
+					"acl.category_id = '".LtDb::qstr($category->getId())."' and acl.article_id = a.id and a.status = ".POST_STATUS_PUBLISHED,
 					"acl.category_id"
 			));
         	if( $result = $this->update( $category )) {
@@ -328,7 +328,7 @@
 
         	if( !$categoryLinks ) {
 				$query = "SELECT category_id FROM ".$this->getPrefix()."article_categories_link
-				          WHERE article_id = '".Db::qstr( $articleId )."'";
+				          WHERE article_id = '".LtDb::qstr( $articleId )."'";
 				if(( $result = $this->Execute( $query ))) {
 					$categoryLinks = Array();
 					while( $row = $result->FetchRow()) {

Modified: plog/trunk/class/dao/articles.class.php
===================================================================
--- plog/trunk/class/dao/articles.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/articles.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -302,7 +302,7 @@
 			lt_include( PLOG_CLASS_PATH."class/dao/searchengine.class.php" );
 			$searchTerms = SearchEngine::adaptSearchString( $searchTerms );
 			
-			$db =& Db::getDb();
+			$db =& LtDb::getDb();
 			if( $db->isFullTextSupported()) {
 				// fastpath when FULLTEXT is supported
 				$whereString = " MATCH(normalized_text, normalized_topic) AGAINST ('{$searchTerms}' IN BOOLEAN MODE)";
@@ -364,7 +364,7 @@
                 $query = "a.blog_id = a.blog_id";
             }
             else{
-                $query = "a.blog_id = ".Db::qstr($blogId);
+                $query = "a.blog_id = ".LtDb::qstr($blogId);
             }
             if( $date != -1 ) {
 				// consider the time difference
@@ -392,13 +392,13 @@
 
 			if( $locationId != -1 ) {
 				// location filter
-				$query .= " AND loc_id = ".Db::qstr( $locationId );
+				$query .= " AND loc_id = ".LtDb::qstr( $locationId );
 			}
 
             if( $status > 0 )
                 $query .= " AND a.status = '$postStatus'";
             if( $userId > 0 )
-                $query .= " AND a.user_id = ".Db::qstr($userId);
+                $query .= " AND a.user_id = ".LtDb::qstr($userId);
             if( $maxDate > 0 )
                 $query .= " AND a.date <= '$maxDate'";
 				
@@ -588,7 +588,7 @@
         	$prefix = $this->getPrefix();
 			$numPostsPerMonthQuery = "SELECT DISTINCT YEAR(date) AS year,MONTH(date) AS month
 			                          FROM {$prefix}articles
-			                          WHERE blog_id = '".Db::qstr($blogId)."'
+			                          WHERE blog_id = '".LtDb::qstr($blogId)."'
 			                          ORDER BY YEAR(date) DESC,MONTH(date) DESC;";
 
             $result = $this->Execute( $numPostsPerMonthQuery);
@@ -690,7 +690,7 @@
             foreach( $categories as $categoryId ) {
 	
 				$query = "INSERT INTO ".$this->getPrefix()."article_categories_link (article_id, category_id) VALUES (".
-				         "'".Db::qstr( $articleId )."', '".Db::qstr( $categoryId )."')";
+				         "'".LtDb::qstr( $articleId )."', '".LtDb::qstr( $categoryId )."')";
 
                 $this->Execute( $query );
 
@@ -717,7 +717,7 @@
             lt_include( PLOG_CLASS_PATH."class/dao/articlecategories.class.php" );
 
 			$articleId = $article->getId();
-			$query = "DELETE FROM ".$this->getPrefix()."article_categories_link WHERE article_id = '".Db::qstr( $article->getId())."'";
+			$query = "DELETE FROM ".$this->getPrefix()."article_categories_link WHERE article_id = '".LtDb::qstr( $article->getId())."'";
 
             if( ( $result = $this->Execute( $query ))) {
             	// updated the category counters
@@ -868,11 +868,11 @@
 
 			$filter = new Textfilter();
 			$query = "INSERT INTO ".$this->getPrefix()."articles_text (article_id, topic, text, normalized_text, normalized_topic, mangled_topic) ".
-			         " VALUES ('".Db::qstr($newArticle->getId())."',".
-			         "'".Db::qstr($newArticle->getTopic())."',".
-			         "'".Db::qstr($newArticle->getText(false))."',".
-			         "'".Db::qstr($filter->normalizeText( $newArticle->getText(false)))."',".
-			         "'".Db::qstr($filter->normalizeText( $newArticle->getTopic()))."',".
+			         " VALUES ('".LtDb::qstr($newArticle->getId())."',".
+			         "'".LtDb::qstr($newArticle->getTopic())."',".
+			         "'".LtDb::qstr($newArticle->getText(false))."',".
+			         "'".LtDb::qstr($filter->normalizeText( $newArticle->getText(false)))."',".
+			         "'".LtDb::qstr($filter->normalizeText( $newArticle->getTopic()))."',".
 			         "'')";
 
 			return( $this->Execute( $query ));
@@ -890,7 +890,7 @@
 
             if( !$text ) {
 				$query = "SELECT text, normalized_text, topic, normalized_topic FROM ".$this->getPrefix()."articles_text ".
-				         "WHERE article_id = '".Db::qstr( $articleId )."'";
+				         "WHERE article_id = '".LtDb::qstr( $articleId )."'";
                 $result = $this->Execute( $query );    
                 $text = $result->FetchRow();
                 $result->Close();
@@ -912,11 +912,11 @@
 			$filter = new Textfilter();
 
 			$query = "UPDATE ".$this->getPrefix()."articles_text SET ".
-			         "topic = '".Db::qstr($article->getTopic())."', ".
-			         "text = '".Db::qstr($article->getText(false))."', ".
-			         "normalized_text = '".Db::qstr($filter->normalizeText( $article->getText(false)))."', ".
-			         "normalized_topic = '".Db::qstr($filter->normalizeText( $article->getTopic()))."' ".
-			         "WHERE article_id = '".Db::qstr( $article->getId())."'";
+			         "topic = '".LtDb::qstr($article->getTopic())."', ".
+			         "text = '".LtDb::qstr($article->getText(false))."', ".
+			         "normalized_text = '".LtDb::qstr($filter->normalizeText( $article->getText(false)))."', ".
+			         "normalized_topic = '".LtDb::qstr($filter->normalizeText( $article->getTopic()))."' ".
+			         "WHERE article_id = '".LtDb::qstr( $article->getId())."'";
 
             $this->_cache->removeData( $article->getId(), CACHE_ARTICLETEXT );
 
@@ -1056,7 +1056,7 @@
 
             $query = "UPDATE ".$this->getPrefix()."articles SET ".
                      " num_reads = num_reads+1, date = date".
-			         " WHERE id = '".Db::qstr( $articleId )."'";
+			         " WHERE id = '".LtDb::qstr( $articleId )."'";
 
             $result = $this->Execute( $query );
 
@@ -1074,7 +1074,7 @@
             // we have to build up the query, which will be pretty long...
             $query = "UPDATE ".$this->getPrefix()."articles SET ".
                      " num_reads = num_reads+1, date = date".
-                     " WHERE slug = '".Db::qstr($articleName)."'";
+                     " WHERE slug = '".LtDb::qstr($articleName)."'";
 
             $result = $this->Execute( $query );
 
@@ -1163,7 +1163,7 @@
 		 */
 		function deleteArticleText( $articleId )
 		{
-			$query = "DELETE FROM ".$this->getPrefix()."articles_text WHERE article_id = '".Db::qstr( $articleId )."'";
+			$query = "DELETE FROM ".$this->getPrefix()."articles_text WHERE article_id = '".LtDb::qstr( $articleId )."'";
 			return( $this->Execute( $query ));
 		}
 
@@ -1174,7 +1174,7 @@
          */
         function deleteBlogPosts( $blogId )
         {	
-			$query = "SELECT id, user_id, blog_id FROM ".$this->getPrefix()."articles WHERE blog_id = '".Db::qstr( $blogId )."'";
+			$query = "SELECT id, user_id, blog_id FROM ".$this->getPrefix()."articles WHERE blog_id = '".LtDb::qstr( $blogId )."'";
 			$result = $this->Execute( $query );
 			
 			if( !$result )

Modified: plog/trunk/class/dao/blogcategories.class.php
===================================================================
--- plog/trunk/class/dao/blogcategories.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/blogcategories.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -122,9 +122,9 @@
 		 */
 		function getNumBlogsCategory( $categoryId, $status = BLOG_STATUS_ALL )
 		{
-			$cond = "b.blog_category_id = '".Db::qstr( $categoryId )."'";			
+			$cond = "b.blog_category_id = '".LtDb::qstr( $categoryId )."'";			
 			if( $status != BLOG_STATUS_ALL )
-				$cond .= " AND status = '".Db::qstr( $status )."'";
+				$cond .= " AND status = '".LtDb::qstr( $status )."'";
 			
 			return( $this->getNumItems( $this->getPrefix()."blogs", $cond ));
 			          
@@ -135,7 +135,7 @@
 		 */
 		function getSearchConditions( $searchTerms )
 		{
-			return( "name LIKE '%".Db::qstr( $searchTerms )."%' OR description LIKE '%".Db::qstr( $searchTerms )."%'" );
+			return( "name LIKE '%".LtDb::qstr( $searchTerms )."%' OR description LIKE '%".LtDb::qstr( $searchTerms )."%'" );
 		}
 		
 		/**

Modified: plog/trunk/class/dao/blogs.class.php
===================================================================
--- plog/trunk/class/dao/blogs.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/blogs.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -60,7 +60,7 @@
 		 */
 		function getSearchConditions( $searchTerms )
 		{
-			return( "blog LIKE '%".Db::qstr( $searchTerms )."%'" );
+			return( "blog LIKE '%".LtDb::qstr( $searchTerms )."%'" );
 		}
 
 		/**
@@ -211,11 +211,11 @@
         {
 			$statusCond = "";
             if( $status != BLOG_STATUS_ALL )
-                $statusCond = "status = '".Db::qstr($status)."'";
+                $statusCond = "status = '".LtDb::qstr($status)."'";
 			$where = $statusCond;
 			
 			if( $blogCategoryId != ALL_BLOG_CATEGORIES )
-				$where .= " AND blog_category_id = '".Db::qstr($blogCategoryId)."'";
+				$where .= " AND blog_category_id = '".LtDb::qstr($blogCategoryId)."'";
 
 			$searchCond = "";
 			if( $searchTerms != "" ){
@@ -286,11 +286,11 @@
 			$where = "";
 			$statusCond = "";
             if( $status != BLOG_STATUS_ALL )
-                $statusCond = "status = '".Db::qstr($status)."'";
+                $statusCond = "status = '".LtDb::qstr($status)."'";
 			$where .= $statusCond;			
 
 			if( $blogCategoryId != ALL_BLOG_CATEGORIES )
-				$where .= " AND blog_category_id = '".Db::qstr($blogCategoryId)."'";				
+				$where .= " AND blog_category_id = '".LtDb::qstr($blogCategoryId)."'";				
 										
 			if( $searchTerms != "" ) {				
 				$searchCond = $this->getSearchConditions( $searchTerms );

Modified: plog/trunk/class/dao/commentscommon.class.php
===================================================================
--- plog/trunk/class/dao/commentscommon.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/commentscommon.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -111,13 +111,13 @@
 								  $itemsPerPage = DEFAULT_ITEMS_PER_PAGE )
 		{
 			$query = "SELECT * FROM ".$this->getPrefix()."articles_comments ".
-			         "WHERE article_id = '".Db::qstr( $artid )."'";
+			         "WHERE article_id = '".LtDb::qstr( $artid )."'";
 			
 			if( $status != COMMENT_STATUS_ALL )
-				 $query .= "AND status = '".Db::qstr( $status )."'";
+				 $query .= "AND status = '".LtDb::qstr( $status )."'";
 			
 			if( $type != COMMENT_TYPE_ANY )
-				$query .= " AND type = '".Db::qstr( $type )."'";				
+				$query .= " AND type = '".LtDb::qstr( $type )."'";				
 			
 			if( $order == COMMENT_ORDER_NEWEST_FIRST )
 				$query .= " ORDER BY date DESC";
@@ -222,11 +222,11 @@
 				$prefix = $this->getPrefix();
 				$table = "{$prefix}articles_comments c";
 				// and the condition if any...
-				$cond = "c.blog_id = '".Db::qstr($blogId)."'";
+				$cond = "c.blog_id = '".LtDb::qstr($blogId)."'";
 				if( $status != COMMENT_STATUS_ALL )
-					$cond .= " AND c.status = '".Db::qstr($status)."'";
+					$cond .= " AND c.status = '".LtDb::qstr($status)."'";
 				if( $type != COMMENT_TYPE_ANY )
-					$cond .= " AND c.type = '".Db::qstr($type)."'";
+					$cond .= " AND c.type = '".LtDb::qstr($type)."'";
 				if( $searchTerms != "" )
 					$cond .= " AND ".$this->getSearchConditions( $searchTerms );
 					//print("type = ".$type." - cond = $cond");
@@ -251,8 +251,8 @@
 				$this->delete( "id", $commentid );
 				// update all the other posts
 				$query = "UPDATE ".$this->getPrefix()."articles_comments SET parent_id = 0 WHERE parent_id = '".
-						 Db::qstr($commentid)."' AND article_id = '".
-						 Db::qstr( $comment->getArticleId())."'";
+						 LtDb::qstr($commentid)."' AND article_id = '".
+						 LtDb::qstr( $comment->getArticleId())."'";
 				$result = $this->Execute( $query );
 				$this->_cache->removeData( $comment->getArticleId(), CACHE_ARTICLE_COMMENTS_BYARTICLE_NEWEST_TO_OLDEST );
 				$this->_cache->removeData( $comment->getArticleId(), CACHE_ARTICLE_COMMENTS_BYARTICLE_OLDEST_TO_NEWEST );
@@ -396,11 +396,11 @@
 			$prefix = $this->getPrefix();
 			$query = "SELECT c.*
 					  FROM {$prefix}articles_comments c
-					  WHERE c.blog_id = '".Db::qstr( $blogId )."'";
+					  WHERE c.blog_id = '".LtDb::qstr( $blogId )."'";
 			if( $status != COMMENT_STATUS_ALL )
 				$query .= " AND status = $status";
 			if( $type != COMMENT_TYPE_ANY )
-				$query .= " AND type = '".Db::qstr($type)."'";
+				$query .= " AND type = '".LtDb::qstr($type)."'";
 			if( $searchTerms != "" ) {
 				$query .= " AND ".$this->getSearchConditions( $searchTerms );
 			}
@@ -496,7 +496,7 @@
 			// Split the search term by space
 			$query_array = explode(' ',$query);
 		
-			$db =& Db::getDb();
+			$db =& LtDb::getDb();
 			if( $db->isFullTextSupported()) {
 				// fast path used when FULLTEXT searches are supported
 				$where_string = "(MATCH(c.normalized_text) AGAINST ('{$query}' IN BOOLEAN MODE))";
@@ -546,11 +546,11 @@
 				$blog = $art->getBlogInfo();
 				// update the counter to reflect the number of comments
 				$blog->setTotalComments( $this->getNumItems( $this->getPrefix()."articles_comments", 
-				                                             "blog_id = '".Db::qstr($blog->getId())."'".
+				                                             "blog_id = '".LtDb::qstr($blog->getId())."'".
 				                                             " AND type = ".COMMENT_TYPE_COMMENT ));
 				// and the one to reflect the number of trackbacks
 				$blog->setTotalTrackbacks( $this->getNumItems( $this->getPrefix()."articles_comments", 
-				                                             "blog_id = '".Db::qstr($blog->getId())."'".
+				                                             "blog_id = '".LtDb::qstr($blog->getId())."'".
 				                                             " AND type = ".COMMENT_TYPE_TRACKBACK ));				                                              
 				
 				$blogs = new Blogs();

Modified: plog/trunk/class/dao/customfields/customfieldsvalues.class.php
===================================================================
--- plog/trunk/class/dao/customfields/customfieldsvalues.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/customfields/customfieldsvalues.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -46,7 +46,7 @@
                              FROM {$prefix}custom_fields_values v 
                              RIGHT OUTER JOIN {$prefix}custom_fields_definition d 
                              ON v.field_id = d.id
-							 WHERE v.article_id = '".Db::qstr($articleId)."'";
+							 WHERE v.article_id = '".LtDb::qstr($articleId)."'";
                       
             $result = $this->Execute( $query );
             
@@ -151,7 +151,7 @@
 
             $query_array = explode(' ',$query);	
 			
-			$db =& Db::getDb();
+			$db =& LtDb::getDb();
 			if( $db->isFullTextSupported()) {			
 				// fast path used when FULLTEXT searches are supported
 				$where_string = "(MATCH(c.normalized_value) AGAINST ('{$query}' IN BOOLEAN MODE))";				

Modified: plog/trunk/class/dao/friendgroups.class.php
===================================================================
--- plog/trunk/class/dao/friendgroups.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/friendgroups.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -162,13 +162,13 @@
 		 */
 		function getNumFriendsGroup( $groupId, $userAuthorizationStatus = USER_AUTHORIZATION_ALL, $friendAuthorizationStatus = FRIEND_AUTHORIZATION_ALL )
 		{
-			$cond = "b.group_id = '".Db::qstr( $groupId )."'";
+			$cond = "b.group_id = '".LtDb::qstr( $groupId )."'";
 
 			if( $userAuthorizationStatus != USER_AUTHORIZATION_ALL )
-				$cond .= " AND user_authorization_status = '".Db::qstr( $userAuthorizationStatus )."'";
+				$cond .= " AND user_authorization_status = '".LtDb::qstr( $userAuthorizationStatus )."'";
 
 			if( $friendAuthorizationStatus != FRIEND_AUTHORIZATION_ALL )
-				$cond .= " AND friend_authorization_status = '".Db::qstr( $friendAuthorizationStatus )."'";
+				$cond .= " AND friend_authorization_status = '".LtDb::qstr( $friendAuthorizationStatus )."'";
 
 			return( $this->getNumItems( $this->getPrefix()."friends", $cond ));
 
@@ -179,7 +179,7 @@
 		 */
 		function getSearchConditions( $searchTerms )
 		{
-			return( "name LIKE '%".Db::qstr( $searchTerms )."%' OR description LIKE '%".Db::qstr( $searchTerms )."%'" );
+			return( "name LIKE '%".LtDb::qstr( $searchTerms )."%' OR description LIKE '%".LtDb::qstr( $searchTerms )."%'" );
 		}
 
 		/**

Modified: plog/trunk/class/dao/friends.class.php
===================================================================
--- plog/trunk/class/dao/friends.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/friends.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -35,11 +35,11 @@
 			$friends = Array();
 			$query = "SELECT id FROM ".$this->getPrefix()."friends WHERE user_id = '".$userId."' AND";
 			if( $groupId != 0 )
-				$query .= " group_id = '".Db::qstr($groupId)."' AND";
+				$query .= " group_id = '".LtDb::qstr($groupId)."' AND";
 			if( $userAuthorizationStatus != USER_AUTHORIZATION_ALL )
-				$query .= " user_authorization_status = '".Db::qstr($userAuthorizationStatus)."' AND";
+				$query .= " user_authorization_status = '".LtDb::qstr($userAuthorizationStatus)."' AND";
 			if( $friendAuthorizationStatus != FRIEND_AUTHORIZATION_ALL )
-				$query .= " friend_authorization_status = '".Db::qstr($friendAuthorizationStatus)."' AND";
+				$query .= " friend_authorization_status = '".LtDb::qstr($friendAuthorizationStatus)."' AND";
 			if( $searchTerms != "" )
 				$query .= " (".$this->getSearchConditions( $searchTerms ).")";
 
@@ -315,7 +315,7 @@
 		 */
 		function getSearchConditions( $searchTerms )
 		{
-			return( "(description LIKE'%".Db::qstr( $searchTerms )."%')" );
+			return( "(description LIKE'%".LtDb::qstr( $searchTerms )."%')" );
 		}
 
 		/**

Modified: plog/trunk/class/dao/globalarticlecategories.class.php
===================================================================
--- plog/trunk/class/dao/globalarticlecategories.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/globalarticlecategories.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -123,9 +123,9 @@
 		 */
 		function getNumArticlesGlobalCategory( $categoryId, $status = ARTICLE_STATUS_ALL )
 		{
-			$cond = "a.global_category_id = '".Db::qstr( $categoryId )."'";			
+			$cond = "a.global_category_id = '".LtDb::qstr( $categoryId )."'";			
 			if( $status != BLOG_STATUS_ALL )
-				$cond .= " AND status = '".Db::qstr( $status )."'";
+				$cond .= " AND status = '".LtDb::qstr( $status )."'";
 			
 			return( $this->getNumItems( $this->getPrefix()."articles", $cond ));
 			          
@@ -136,7 +136,7 @@
 		 */
 		function getSearchConditions( $searchTerms ) 
 		{
-			return( "name LIKE '%".Db::qstr( $searchTerms )."%' OR description LIKE '%".Db::qstr( $searchTerms )."%'" );
+			return( "name LIKE '%".LtDb::qstr( $searchTerms )."%' OR description LIKE '%".LtDb::qstr( $searchTerms )."%'" );
 		}
 		
 		/**

Modified: plog/trunk/class/dao/locations.class.php
===================================================================
--- plog/trunk/class/dao/locations.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/locations.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -63,9 +63,9 @@
 		{
 			$query = "SELECT id, latitude, longitude, description, blog_id ".
 			         "FROM ".$this->getPrefix()."locations ".
-			         "WHERE latitude = '".Db::qstr( $lat )."' AND longitude = '".Db::qstr( $long )."'";
+			         "WHERE latitude = '".LtDb::qstr( $lat )."' AND longitude = '".LtDb::qstr( $long )."'";
 			if( $blogId != -1 )
-				$query .= " AND blog_id = '".Db::qstr( $blogId )."'";
+				$query .= " AND blog_id = '".LtDb::qstr( $blogId )."'";
 				
 			$result = $this->Execute( $query );
 			
@@ -133,10 +133,10 @@
 			
 			$conds = "";
 			if( $albumId != -1 )
-				$conds .= "album_id = '".Db::qstr( $albumId )."'";
+				$conds .= "album_id = '".LtDb::qstr( $albumId )."'";
 			if( $type != -1 ) {
 				if( $conds != "" ) $conds .= " AND ";
-				$conds .= "resource_type = '".Db::qstr( $type )."'";
+				$conds .= "resource_type = '".LtDb::qstr( $type )."'";
 			}
 			
 			// build the final query using the conditions if any
@@ -164,9 +164,9 @@
 		function getResourceLocations( $blogId, $albumId = -1 )
 		{			
 			$query = "SELECT DISTINCT l.* FROM ".$this->getPrefix()."locations AS l, ".$this->getPrefix()."gallery_resources AS gr
-			          WHERE l.id = gr.loc_id AND l.blog_id = '".Db::qstr( $blogId )."' AND gr.owner_id = '".Db::qstr( $blogId )."'";
+			          WHERE l.id = gr.loc_id AND l.blog_id = '".LtDb::qstr( $blogId )."' AND gr.owner_id = '".LtDb::qstr( $blogId )."'";
 			if( $albumId != -1 )
-				$query .= " AND gr.album_id = '".Db::qstr( $albumId )."'";
+				$query .= " AND gr.album_id = '".LtDb::qstr( $albumId )."'";
 			
 			$result = $this->Execute( $query );
 			if( !$result )
@@ -189,7 +189,7 @@
 		function getArticleLocations( $blogId )
 		{			
 			$query = "SELECT DISTINCT l.* FROM ".$this->getPrefix()."locations AS l, ".$this->getPrefix()."articles AS a
-			          WHERE l.id = a.loc_id AND l.blog_id = '".Db::qstr( $blogId )."' AND a.blog_id = '".Db::qstr( $blogId )."'";
+			          WHERE l.id = a.loc_id AND l.blog_id = '".LtDb::qstr( $blogId )."' AND a.blog_id = '".LtDb::qstr( $blogId )."'";
 			
 			$result = $this->Execute( $query );
 			if( !$result )

Modified: plog/trunk/class/dao/model.class.php
===================================================================
--- plog/trunk/class/dao/model.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/model.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -183,7 +183,7 @@
         	$dbObject = $this->_cache->getData( $value, $cacheId );
 
         	if( !$dbObject ) {
-	        	$query = "SELECT * FROM ".$this->table." WHERE {$field} = '".Db::qstr( $value )."'";
+	        	$query = "SELECT * FROM ".$this->table." WHERE {$field} = '".LtDb::qstr( $value )."'";
 	        	
 	        	$result = $this->Execute( $query );
 	        	
@@ -268,7 +268,7 @@
 				// if $value is 'all' or null, then we are going to cache the whole thing so let's not
 				// include these as parameters. 
         		if( $value != "_all_" && $value != null ) {
-        			$where .= " WHERE {$key} = '".Db::qstr($value)."'";					
+        			$where .= " WHERE {$key} = '".LtDb::qstr($value)."'";					
 				}
 				if( $searchTerms != "" ) {
 					// get the table-dependent search string
@@ -360,7 +360,7 @@
                         else
                             $value = serialize( $value );
             		}
-	                $value = Db::qstr($value);
+	                $value = LtDb::qstr($value);
     	            $fieldsValuesString .= "'" . $value . "', ";
     	        }
             }
@@ -390,7 +390,7 @@
 		 */
         function update( &$dbObject )
         {
-        	lt_include( PLOG_CLASS_PATH."class/database/db.class.php" );
+        	lt_include( PLOG_CLASS_PATH."class/database/ltdb.class.php" );
         
             $fields = $dbObject->getFieldGetters();
             $sql    = "UPDATE ".$this->table." SET ";
@@ -403,11 +403,11 @@
             		$value = $value->getIsoDate();
             	elseif( is_object( $value )) $value = serialize( $value );
             	
-                $value = Db::qstr($value);
+                $value = LtDb::qstr($value);
                 $sql  .=  $field . "='" . $value . "', ";
             }
 
-            $sql = substr($sql, 0, -2) . " WHERE id = '".Db::qstr($dbObject->getId())."'";            
+            $sql = substr($sql, 0, -2) . " WHERE id = '".LtDb::qstr($dbObject->getId())."'";            
             
             $result = $this->Execute( $sql );            
             
@@ -440,9 +440,9 @@
         function getPrefix()
         {
             if ( $this->_prefix === null ) {
-                lt_include( PLOG_CLASS_PATH."class/database/db.class.php" );
+                lt_include( PLOG_CLASS_PATH."class/database/ltdb.class.php" );
 
-                $this->_prefix = Db::getPrefix();
+                $this->_prefix = LtDb::getPrefix();
             }
 
             return $this->_prefix;
@@ -485,9 +485,9 @@
         function _initializeDb()
         {
             if ( !$this->_dbInitialized ) {
-                lt_include( PLOG_CLASS_PATH."class/database/db.class.php" );
+                lt_include( PLOG_CLASS_PATH."class/database/ltdb.class.php" );
 
-                $this->_db =& Db::getDb();
+                $this->_db =& LtDb::getDb();
 
                 $this->_dbInitialized = true;
             }

Modified: plog/trunk/class/dao/mylinks.class.php
===================================================================
--- plog/trunk/class/dao/mylinks.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/mylinks.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -202,8 +202,8 @@
 		 */
 		function getSearchConditions( $searchTerms )
 		{
-			return( "(name LIKE '%".Db::qstr( $searchTerms )."%' OR description LIKE'%".Db::qstr( $searchTerms )."%'".
-			        " OR url LIKE '%".Db::qstr( $searchTerms )."%')" );
+			return( "(name LIKE '%".LtDb::qstr( $searchTerms )."%' OR description LIKE'%".LtDb::qstr( $searchTerms )."%'".
+			        " OR url LIKE '%".LtDb::qstr( $searchTerms )."%')" );
 		}
         
 		/**

Modified: plog/trunk/class/dao/privatemessages.class.php
===================================================================
--- plog/trunk/class/dao/privatemessages.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/privatemessages.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -289,7 +289,7 @@
 		 */
 		function getSearchConditions( $searchTerms )
 		{
-			return( "(normalized_subject LIKE '%".Db::qstr( $searchTerms )."%' OR normalized_message LIKE '%".Db::qstr( $searchTerms )."%')" );
+			return( "(normalized_subject LIKE '%".LtDb::qstr( $searchTerms )."%' OR normalized_message LIKE '%".LtDb::qstr( $searchTerms )."%')" );
 		}
 
 		/**

Modified: plog/trunk/class/dao/referers.class.php
===================================================================
--- plog/trunk/class/dao/referers.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/referers.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -48,8 +48,8 @@
 
             // we have to check if a referer with that information exists
             // in the database
-            $query = "UPDATE ".$this->getPrefix()."referers SET hits = hits + 1 WHERE url = '".Db::qstr($refererHeader).
-                     "' AND article_id = '".Db::qstr($articleId)."' AND blog_id = '".Db::qstr($blogId)."';";
+            $query = "UPDATE ".$this->getPrefix()."referers SET hits = hits + 1 WHERE url = '".LtDb::qstr($refererHeader).
+                     "' AND article_id = '".LtDb::qstr($articleId)."' AND blog_id = '".LtDb::qstr($blogId)."';";
             $result = $this->Execute( $query );
             if( !$result )
             	return false;
@@ -58,7 +58,7 @@
             if( $this->_db->Affected_Rows() == 0 ) {
             	// we have to insert the row manually
                 $query2 = "INSERT INTO ".$this->getPrefix()."referers (url,article_id,blog_id) 
-                           VALUES ('".Db::qstr($refererHeader)."','".Db::qstr($articleId)."','".Db::qstr($blogId)."');";
+                           VALUES ('".LtDb::qstr($refererHeader)."','".LtDb::qstr($articleId)."','".LtDb::qstr($blogId)."');";
                 $result2 = $this->Execute( $query2 );
             }
 
@@ -114,13 +114,13 @@
 			$conds = false;
 			$where = "";
 			if( $blogId > 0 ) {
-				$where .= " blog_id = '".Db::qstr($blogId)."'";
+				$where .= " blog_id = '".LtDb::qstr($blogId)."'";
 				$conds = true;
 			}
 			
 			if( $articleId > 0 ) {
 				if( $conds ) $where .= " AND ";
-				$where .= " article_id = '".Db::qstr($articleId)."'";
+				$where .= " article_id = '".LtDb::qstr($articleId)."'";
 				$conds = true;
 			}
 			
@@ -171,9 +171,9 @@
 		{
 			$prefix = $this->getPrefix();
 			$query = "SELECT * FROM {$prefix}referers
-			          WHERE id = '".Db::qstr($referrerId)."'";
+			          WHERE id = '".LtDb::qstr($referrerId)."'";
 			if( $blogId > 0 )
-				$query .= " AND blog_id = '".Db::qstr($blogId)."'";
+				$query .= " AND blog_id = '".LtDb::qstr($blogId)."'";
 				
 			$result = $this->Execute( $query );
 			
@@ -203,9 +203,9 @@
 		{
 			$prefix = $this->getPrefix();
 			$query = "DELETE FROM {$prefix}referers
-			          WHERE id = '".Db::qstr($referrerId)."'";
+			          WHERE id = '".LtDb::qstr($referrerId)."'";
 			if( $blogId > 0 )
-				$query .= " AND blog_id = '".Db::qstr($blogId)."'";
+				$query .= " AND blog_id = '".LtDb::qstr($blogId)."'";
 				
 			$result = $this->Execute( $query );
 			
@@ -223,9 +223,9 @@
 		{
 			$prefix = $this->getPrefix();
 			$table  = "{$prefix}referers";
-			$cond = "blog_id = '".Db::qstr($blogId)."'";
+			$cond = "blog_id = '".LtDb::qstr($blogId)."'";
 			if( $articleId > -1 )
-				$cond .= " AND article_id = '".Db::qstr($articleId)."'";
+				$cond .= " AND article_id = '".LtDb::qstr($articleId)."'";
 			
 			return( $this->getNumItems( $table, $cond ));
 		}

Modified: plog/trunk/class/dao/searchengine.class.php
===================================================================
--- plog/trunk/class/dao/searchengine.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/searchengine.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -38,7 +38,7 @@
 			lt_include( PLOG_CLASS_PATH."class/data/textfilter.class.php" );		
 			$tf = new Textfilter();
 			$resultTerms = $tf->filterCharacters( $searchTerms, Array( '"', ';', '.' ));
-            $resultTerms = Db::qstr($resultTerms);			
+            $resultTerms = LtDb::qstr($resultTerms);			
 			
             $resultTerms = trim($resultTerms);
             return $resultTerms;
@@ -57,7 +57,7 @@
          */ 
         function getAdaptSearchTerms ( $searchTerms )
         {
-            $resultTerms = Db::qstr($searchTerms);          
+            $resultTerms = LtDb::qstr($searchTerms);          
             $resultTerms = trim($resultTerms);
             $resultTerms = explode(' ',$resultTerms);
             return $resultTerms;
@@ -82,7 +82,7 @@
 			// calculate the conditions right away, they will be used by both sides of the union
 			$conds = "";
 			if( $blogId != -1 )
-				$conds .= " AND a.blog_id = ".Db::qstr( $blogId );
+				$conds .= " AND a.blog_id = ".LtDb::qstr( $blogId );
 			if( $status != -1 ) 
 				$conds .= " AND a.status = ".$status;
 			if( !$includeFuture )
@@ -92,16 +92,16 @@
 			$prefix = $this->getPrefix();
 			
 			// check if we can use fulltext indexes
-			$db =& Db::getDb();
+			$db =& LtDb::getDb();
 			if( $db->isFullTextSupported()) {
 				$query = "(SELECT a.* FROM {$prefix}articles a 
 						  INNER JOIN {$prefix}articles_text at ON a.id = at.article_id
-				          WHERE MATCH(at.normalized_text, at.normalized_topic) AGAINST ('".Db::qstr($searchTerms)."' IN BOOLEAN MODE) 
+				          WHERE MATCH(at.normalized_text, at.normalized_topic) AGAINST ('".LtDb::qstr($searchTerms)."' IN BOOLEAN MODE) 
 				          {$conds})
 					 	  UNION
 						  (SELECT a.* FROM {$prefix}articles a 
 						  INNER JOIN {$prefix}custom_fields_values cfv ON a.id = cfv.article_id
-						  WHERE MATCH(cfv.normalized_value) AGAINST ('".Db::qstr($searchTerms)."' IN BOOLEAN MODE) 
+						  WHERE MATCH(cfv.normalized_value) AGAINST ('".LtDb::qstr($searchTerms)."' IN BOOLEAN MODE) 
 						  {$conds})
 						  ORDER BY date DESC";
 			}
@@ -149,24 +149,24 @@
 			// calculate the additional conditions beforehad
 			$conds = "";
 			if( $blogId != -1 )
-				$conds .= " AND a.blog_id = ".Db::qstr( $blogId );					
+				$conds .= " AND a.blog_id = ".LtDb::qstr( $blogId );					
 			if( $status != -1 )
 				$conds .= " AND a.status = ".$status;							
 			if( !$includeFuture )
 				$conds .= " AND a.date < NOW()";
 			
 			// check if the db supports fulltext searches and if so act accordingly		
-			$db =& Db::getDb();
+			$db =& LtDb::getDb();
 			if( $db->isFullTextSupported()) {
 				// faster path via the fulltext indexes
 				$query = "(SELECT COUNT(a.id) AS total FROM {$prefix}articles a 
 						  INNER JOIN {$prefix}articles_text at ON a.id = at.article_id
-				          WHERE MATCH(at.normalized_text, at.normalized_topic) AGAINST ('".Db::qstr($searchTerms)."' IN BOOLEAN MODE) 
+				          WHERE MATCH(at.normalized_text, at.normalized_topic) AGAINST ('".LtDb::qstr($searchTerms)."' IN BOOLEAN MODE) 
 				          {$conds})
 					 	  UNION
 						  (SELECT COUNT(a.id) AS total FROM {$prefix}articles a 
 						  INNER JOIN {$prefix}custom_fields_values cfv ON a.id = cfv.article_id
-						  WHERE MATCH(cfv.normalized_value) AGAINST ('".Db::qstr($searchTerms)."' IN BOOLEAN MODE) 
+						  WHERE MATCH(cfv.normalized_value) AGAINST ('".LtDb::qstr($searchTerms)."' IN BOOLEAN MODE) 
 						  {$conds})";
 				// execute the query, and it should give us exactly two rows: one per each one of the queries of the union, so 
 				// the total amount of posts that match the search condition should be the sum of those two rows

Modified: plog/trunk/class/dao/userdata/baseuserdataprovider.class.php
===================================================================
--- plog/trunk/class/dao/userdata/baseuserdataprovider.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/userdata/baseuserdataprovider.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -102,7 +102,7 @@
             $prefix = $this->getPrefix();
             $owner = "SELECT * FROM {$prefix}blogs WHERE owner_id = ".$userid;			
 			if( $status != BLOG_STATUS_ALL ) 
-				$owner .= " AND status = '".Db::qstr( $status )."'";
+				$owner .= " AND status = '".LtDb::qstr( $status )."'";
            
 			$result = $this->Execute( $owner );
 
@@ -114,13 +114,13 @@
 
             // and now check to which other blogs he or she belongs
             $otherBlogs = "SELECT DISTINCT p.blog_id AS blog_id FROM {$prefix}users_permissions p, {$prefix}blogs b
-                           WHERE p.user_id = '".Db::qstr($userid)."' AND b.id = p.blog_id";
+                           WHERE p.user_id = '".LtDb::qstr($userid)."' AND b.id = p.blog_id";
             if( !empty($usersBlogs)) {
 	         	$blogIds = implode( ",", $ids );
 	         	$otherBlogs .= " AND p.blog_id NOT IN (".$blogIds.")";
             }
             if( $status != BLOG_STATUS_ALL )
-            	$otherBlogs .= " AND b.status = '".Db::qstr( $status )."'";
+            	$otherBlogs .= " AND b.status = '".LtDb::qstr( $status )."'";
             	
             $result = $this->Execute( $otherBlogs );
             // now we know to which he or she belongs, so we only have
@@ -226,7 +226,7 @@
             }
 
             // now get the other users who have permission for that blog.
-            $query2 = "SELECT DISTINCT user_id FROM {$prefix}users_permissions WHERE blog_id = '".Db::qstr( $blogId )."'";
+            $query2 = "SELECT DISTINCT user_id FROM {$prefix}users_permissions WHERE blog_id = '".LtDb::qstr( $blogId )."'";
             $result2 = $this->Execute( $query2 );
             if( !$result2 ) // if error, return what we have so far...
                 return $users;

Modified: plog/trunk/class/dao/userdata/joomlauserdataprovider.class.php
===================================================================
--- plog/trunk/class/dao/userdata/joomlauserdataprovider.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/userdata/joomlauserdataprovider.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -1,7 +1,7 @@
 <?php
 
     lt_include( PLOG_CLASS_PATH."class/dao/userdata/baseuserdataprovider.class.php" );
-    lt_include( PLOG_CLASS_PATH."class/database/db.class.php" );
+    lt_include( PLOG_CLASS_PATH."class/database/ltdb.class.php" );
     
     define( "JOOMLA_USER_IS_BLOCKED", 1);
     define( "JOOMLA_USER_IS_ACTIVE", 0);
@@ -126,7 +126,7 @@
         function getUserInfoFromUsername( $username )
         {
         	//Query Joomla table
-	        $query = "SELECT * FROM ".$this->_joomladbprefix."users WHERE username = '".Db::qstr( $username )."'";	       	       
+	        $query = "SELECT * FROM ".$this->_joomladbprefix."users WHERE username = '".LtDb::qstr( $username )."'";	       	       
 	                  
 	        $result = $this->_dbc->Execute( $query );
 	        
@@ -157,7 +157,7 @@
         {
 	        lt_include( PLOG_CLASS_PATH."class/dao/userpermissions.class.php" );
 	        
-	        $query = "SELECT * FROM ".$this->_joomladbprefix."users WHERE id = '".Db::qstr( $userid )."'";
+	        $query = "SELECT * FROM ".$this->_joomladbprefix."users WHERE id = '".LtDb::qstr( $userid )."'";
 
 			//print("user__id = $userid");
 	                  
@@ -312,11 +312,11 @@
 	        /* These should be accessible only from Joomla! */
 	        /*
 	        $query = "UPDATE ".$this->_joomladbprefix."users ".
-		        "SET username = '".Db::qstr($userInfo->getUserName()).
-		        "', password = '".Db::qstr(md5($userInfo->getPassword())).
-		        "', email = '".Db::qstr($userInfo->getEmail()).
-		        "', block = '".Db::qstr(($userInfo->getStatus()>USER_STATUS_ACTIVE)? JOOMLA_USER_IS_BLOCKED : JOOMLA_USER_IS_ACTIVE) .
-		        "'  WHERE id = ".Db::qstr($userInfo->getId());
+		        "SET username = '".LtDb::qstr($userInfo->getUserName()).
+		        "', password = '".LtDb::qstr(md5($userInfo->getPassword())).
+		        "', email = '".LtDb::qstr($userInfo->getEmail()).
+		        "', block = '".LtDb::qstr(($userInfo->getStatus()>USER_STATUS_ACTIVE)? JOOMLA_USER_IS_BLOCKED : JOOMLA_USER_IS_ACTIVE) .
+		        "'  WHERE id = ".LtDb::qstr($userInfo->getId());
 	                              
             $result = $this->_dbc->Execute( $query );            
             
@@ -360,21 +360,21 @@
 	    	if( $this->getpLogJoomlaUserData( $user->getId())) {
 		    	// we need to run an UPDATE query...
 		    	$query = "UPDATE ".$this->getPrefix().$this->_joomlaauxtable.
-		    	         " SET about = '".Db::qstr( $user->getAboutMyself()).
-		    	         "', properties = '".Db::qstr( serialize($user->getProperties())).
-		    	         "', resource_picture_id = '".Db::qstr( $user->getPictureId()).
-		    	         "', blog_site_admin = ".(Db::qstr( $user->isSiteAdmin() ? "1" : "0")).
-		    	         "  WHERE joomla_id = ".Db::qstr( $user->getId());    
+		    	         " SET about = '".LtDb::qstr( $user->getAboutMyself()).
+		    	         "', properties = '".LtDb::qstr( serialize($user->getProperties())).
+		    	         "', resource_picture_id = '".LtDb::qstr( $user->getPictureId()).
+		    	         "', blog_site_admin = ".(LtDb::qstr( $user->isSiteAdmin() ? "1" : "0")).
+		    	         "  WHERE joomla_id = ".LtDb::qstr( $user->getId());    
 	    	}
 	    	else {
 		    	// we need to run an INSERT query...	
 		    	$query = "INSERT INTO ".$this->getPrefix().$this->_joomlaauxtable."(joomla_id, about, properties, blog_site_admin, resource_picture_id) ".
 		    			  " VALUES (".
-		    			  Db::qstr($user->getId()).",'".
-		    			  Db::qstr($user->getAboutMyself())."','".
-		    	          Db::qstr(serialize($user->getProperties()))."',".
-		    	          Db::qstr( $user->isSiteAdmin() ? "1" : "0").",'".
-		    	          Db::qstr($user->getPictureId())."')";
+		    			  LtDb::qstr($user->getId()).",'".
+		    			  LtDb::qstr($user->getAboutMyself())."','".
+		    	          LtDb::qstr(serialize($user->getProperties()))."',".
+		    	          LtDb::qstr( $user->isSiteAdmin() ? "1" : "0").",'".
+		    	          LtDb::qstr($user->getPictureId())."')";
 	    	}
 	    	
 	    	$result = $this->Execute( $query );
@@ -392,7 +392,7 @@
         function getpLogJoomlaUserData( $userId )
         {
             
-	        $query = "SELECT * FROM ".$this->getPrefix().$this->_joomlaauxtable." WHERE joomla_id = '".Db::qstr($userId)."'";
+	        $query = "SELECT * FROM ".$this->getPrefix().$this->_joomlaauxtable." WHERE joomla_id = '".LtDb::qstr($userId)."'";
 	        $result = $this->Execute( $query );
 	        
 	        if( !$result )
@@ -452,7 +452,7 @@
          */
         function emailExists($email)        
         {
-	        $query = "SELECT * FROM ".$this->_joomladbprefix."users WHERE email = '".Db::qstr($email)."'";
+	        $query = "SELECT * FROM ".$this->_joomladbprefix."users WHERE email = '".LtDb::qstr($email)."'";
 	        
 	        $result = $this->_dbc->Execute( $query );
 	        

Modified: plog/trunk/class/dao/userdata/lifetypeuserdataprovider.class.php
===================================================================
--- plog/trunk/class/dao/userdata/lifetypeuserdataprovider.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/userdata/lifetypeuserdataprovider.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -3,7 +3,7 @@
     lt_include( PLOG_CLASS_PATH."class/dao/userdata/baseuserdataprovider.class.php" );
     lt_include( PLOG_CLASS_PATH."class/dao/userinfo.class.php" );
     lt_include( PLOG_CLASS_PATH."class/dao/userstatus.class.php" );
-    lt_include( PLOG_CLASS_PATH."class/database/db.class.php" );
+    lt_include( PLOG_CLASS_PATH."class/database/ltdb.class.php" );
     
     /**
      * Model representing the users in our application. Provides the methods such as
@@ -108,7 +108,7 @@
 	    	$where = "";
 	    	
 	    	if( $status != USER_STATUS_ALL )
-	    		$where = "status = '".Db::qstr($status)."'";
+	    		$where = "status = '".LtDb::qstr($status)."'";
 
 	    	if( $searchTerms != "" ) {
 				if( $where != "" )
@@ -148,9 +148,9 @@
         function buildSearchCondition( $searchTerms )
         {
             $searchTerms = trim( $searchTerms );
-            $searchCond = "(username LIKE '%".Db::qstr($searchTerms)."%' 
-                           OR full_name LIKE '%".Db::qstr($searchTerms)."%' OR 
-                           email LIKE '%".Db::qstr($searchTerms)."%')";
+            $searchCond = "(username LIKE '%".LtDb::qstr($searchTerms)."%' 
+                           OR full_name LIKE '%".LtDb::qstr($searchTerms)."%' OR 
+                           email LIKE '%".LtDb::qstr($searchTerms)."%')";
             
             return( $searchCond );
         }
@@ -235,7 +235,7 @@
 			    
 			$where = "";
 	    	if( $status != USER_STATUS_ALL )
-	    		$where = "status = '".Db::qstr($status)."'";
+	    		$where = "status = '".LtDb::qstr($status)."'";
 
 	    	if( $searchTerms != "" ) {
 				if( $where != "" )
@@ -254,7 +254,7 @@
 		{
             $query = "SELECT email 
                       FROM ".$this->getPrefix()."users 
-                      WHERE email = '".Db::qstr($email)."'";
+                      WHERE email = '".LtDb::qstr($email)."'";
 
             $result = $this->Execute($query);
 

Modified: plog/trunk/class/dao/userdata/phpbb2userdataprovider.class.php
===================================================================
--- plog/trunk/class/dao/userdata/phpbb2userdataprovider.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/userdata/phpbb2userdataprovider.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -1,7 +1,7 @@
 <?php
 
     lt_include( PLOG_CLASS_PATH."class/dao/userdata/baseuserdataprovider.class.php" );
-    lt_include( PLOG_CLASS_PATH."class/database/db.class.php" );
+    lt_include( PLOG_CLASS_PATH."class/database/ltdb.class.php" );
     
     /**
      * Model representing the users in our application. Provides the methods such as
@@ -42,7 +42,7 @@
          */
         function authenticateUser( $user, $pass )
         {	
-	        $query = "SELECT * FROM ".$this->_phpbbprefix."users WHERE username = '".Db::qstr( $user )."'
+	        $query = "SELECT * FROM ".$this->_phpbbprefix."users WHERE username = '".LtDb::qstr( $user )."'
 	                  AND user_password = '".md5( $pass )."' AND user_active > 0";
 	                  
 	        $result = $this->_dbc->Execute( $query );
@@ -68,7 +68,7 @@
          */
         function getUserInfo( $user, $pass )
         {
-	        $query = "SELECT * FROM ".$this->_phpbbprefix."users WHERE username = '".Db::qstr( $user )."'
+	        $query = "SELECT * FROM ".$this->_phpbbprefix."users WHERE username = '".LtDb::qstr( $user )."'
 	                  AND user_password = '".md5( $pass )."'";
 	                  
 	        $result = $this->_dbc->Execute( $query );
@@ -90,7 +90,7 @@
          */
         function getUserInfoFromUsername( $username )
         {
-	        $query = "SELECT * FROM ".$this->_phpbbprefix."users WHERE username = '".Db::qstr( $username )."'";	       	       
+	        $query = "SELECT * FROM ".$this->_phpbbprefix."users WHERE username = '".LtDb::qstr( $username )."'";	       	       
 	                  
 	        $result = $this->_dbc->Execute( $query );
 	        
@@ -118,7 +118,7 @@
         {
 	        lt_include( PLOG_CLASS_PATH."class/dao/userpermissions.class.php" );
 	        
-	        $query = "SELECT * FROM ".$this->_phpbbprefix."users WHERE user_id = '".Db::qstr( $userid )."'";
+	        $query = "SELECT * FROM ".$this->_phpbbprefix."users WHERE user_id = '".LtDb::qstr( $userid )."'";
 
 	        $result = $this->_dbc->Execute( $query );
 	        
@@ -246,10 +246,10 @@
         function updateUser( $userInfo )
         {
 	        $query = "UPDATE ".$this->_phpbbprefix."users SET
-	                  username = '".Db::qstr($userInfo->getUserName())."',
-	                  user_email = '".Db::qstr($userInfo->getEmail())."',
-	                  user_active = '".Db::qstr($userInfo->getPassword())."'
-	                  WHERE user_id = '".Db::qstr($userInfo->getId())."'";
+	                  username = '".LtDb::qstr($userInfo->getUserName())."',
+	                  user_email = '".LtDb::qstr($userInfo->getEmail())."',
+	                  user_active = '".LtDb::qstr($userInfo->getPassword())."'
+	                  WHERE user_id = '".LtDb::qstr($userInfo->getId())."'";
 	                              
             $result = $this->_dbc->Execute( $query );            
             
@@ -294,8 +294,8 @@
 	        $id = $this->getLastPhpBBUserId();
 	        	
 	        $query = "INSERT INTO ".$this->_phpbbprefix."users (user_id,username,user_password,user_email,user_active)
-	                  VALUES ($id, '".Db::qstr($user->getUserName())."','".md5($user->getPassword())."','".
-                      Db::qstr($user->getEmail())."','1');";                      
+	                  VALUES ($id, '".LtDb::qstr($user->getUserName())."','".md5($user->getPassword())."','".
+                      LtDb::qstr($user->getEmail())."','1');";                      
                       
             $result = $this->_dbc->Execute( $query );            
 
@@ -324,23 +324,23 @@
 	    	if( $this->getpLogPHPBBUserData( $user->getId())) {
 		    	// we need to run an UPDATE query...
 		    	$query = "UPDATE ".$this->getPrefix()."phpbb2_users
-		    	          SET full_name = '".Db::qstr( $user->getFullName())."', 
-		    	              about = '".Db::qstr( $user->getAboutMyself())."',
-		    	              properties = '".Db::qstr( serialize($user->getProperties()))."',
-		    	              resource_picture_id = '".Db::qstr( $user->getPictureId())."',
-		    	              status = '".Db::qstr( $user->getStatus())."'
-		    	          WHERE phpbb_id = '".Db::qstr( $user->getId())."'";    
+		    	          SET full_name = '".LtDb::qstr( $user->getFullName())."', 
+		    	              about = '".LtDb::qstr( $user->getAboutMyself())."',
+		    	              properties = '".LtDb::qstr( serialize($user->getProperties()))."',
+		    	              resource_picture_id = '".LtDb::qstr( $user->getPictureId())."',
+		    	              status = '".LtDb::qstr( $user->getStatus())."'
+		    	          WHERE phpbb_id = '".LtDb::qstr( $user->getId())."'";    
 	    	}
 	    	else {
 		    	// we need to run an INSERT query...
 		    	$query = "INSERT INTO ".$this->getPrefix()."phpbb2_users
 		    	          (full_name, about, properties, resource_picture_id,phpbb_id,status)
-		    	          VALUES ('".Db::qstr( $user->getFullName())."', '".
-		    	          Db::qstr($user->getAboutMyself())."','".
-		    	          Db::qstr(serialize($user->getProperties()))."','".
-		    	          Db::qstr($user->getPictureId())."','".
-		    	          Db::qstr($user->getId())."','".
-		    	          Db::qstr($user->getStatus())."');";
+		    	          VALUES ('".LtDb::qstr( $user->getFullName())."', '".
+		    	          LtDb::qstr($user->getAboutMyself())."','".
+		    	          LtDb::qstr(serialize($user->getProperties()))."','".
+		    	          LtDb::qstr($user->getPictureId())."','".
+		    	          LtDb::qstr($user->getId())."','".
+		    	          LtDb::qstr($user->getStatus())."');";
 	    	}
 	    	
 	    	$result = $this->Execute( $query );
@@ -357,7 +357,7 @@
          */
         function getpLogPHPBBUserData( $userId )
         {
-	        $query = "SELECT * FROM ".$this->getPrefix()."phpbb2_users WHERE phpbb_id = '".Db::qstr($userId)."'";
+	        $query = "SELECT * FROM ".$this->getPrefix()."phpbb2_users WHERE phpbb_id = '".LtDb::qstr($userId)."'";
 	        
 	        $result = $this->Execute( $query );
 	
@@ -418,7 +418,7 @@
          */
         function emailExists($email)        
         {
-	        $query = "SELECT * FROM ".$this->_phpbbprefix."users WHERE user_email = '".Db::qstr($email)."'";
+	        $query = "SELECT * FROM ".$this->_phpbbprefix."users WHERE user_email = '".LtDb::qstr($email)."'";
 	        
 	        $result = $this->_dbc->Execute( $query );
 	        

Modified: plog/trunk/class/dao/userdata/simplepostnukeuserdataprovider.class.php
===================================================================
--- plog/trunk/class/dao/userdata/simplepostnukeuserdataprovider.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/userdata/simplepostnukeuserdataprovider.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -1,7 +1,7 @@
 <?php
 
     lt_include( PLOG_CLASS_PATH."class/dao/userdata/baseuserdataprovider.class.php" );
-    lt_include( PLOG_CLASS_PATH."class/database/db.class.php" );
+    lt_include( PLOG_CLASS_PATH."class/database/ltdb.class.php" );
     lt_include( PLOG_CLASS_PATH."class/dao/userinfo.class.php" );
     lt_include( PLOG_CLASS_PATH."class/dao/userstatus.class.php" );
     
@@ -59,7 +59,7 @@
 	        
             // Check if the user is available in the PostNuke database...
             else {
-	        	$query = "SELECT * FROM ".$this->_postnukedbprefix."users WHERE pn_uname = '".Db::qstr( $username )."' AND pn_pass = '".md5( $pass )."'";
+	        	$query = "SELECT * FROM ".$this->_postnukedbprefix."users WHERE pn_uname = '".LtDb::qstr( $username )."' AND pn_pass = '".md5( $pass )."'";
                 $result = $this->_dbc->Execute( $query );
                 
                 if( (!$result) || ($result == false) ) {          
@@ -113,7 +113,7 @@
         */
         function getUserInfoFromPostNukeUser( $username )
         {
-            $query = "SELECT * FROM ".$this->_postnukedbprefix."users WHERE pn_uname = '".Db::qstr( $username )."'";
+            $query = "SELECT * FROM ".$this->_postnukedbprefix."users WHERE pn_uname = '".LtDb::qstr( $username )."'";
 	                  
 	        $result = $this->_dbc->Execute( $query );
 	        
@@ -219,7 +219,7 @@
 	    	$where = "";
 	    	
 	    	if( $status != USER_STATUS_ALL )
-	    		$where = "status = '".Db::qstr($status)."'";
+	    		$where = "status = '".LtDb::qstr($status)."'";
 
 	    	if( $searchTerms != "" ) {
 				if( $where != "" )
@@ -255,9 +255,9 @@
         function buildSearchCondition( $searchTerms )
         {
             $searchTerms = trim( $searchTerms );
-            $searchCond = "(user LIKE '%".Db::qstr($searchTerms)."%' 
-                           OR full_name LIKE '%".Db::qstr($searchTerms)."%' OR 
-                           email LIKE '%".Db::qstr($searchTerms)."%')";
+            $searchCond = "(user LIKE '%".LtDb::qstr($searchTerms)."%' 
+                           OR full_name LIKE '%".LtDb::qstr($searchTerms)."%' OR 
+                           email LIKE '%".LtDb::qstr($searchTerms)."%')";
             
             return( $searchCond );
         }
@@ -329,7 +329,7 @@
             // get the information about the owner, if requested so
             if( $includeOwner ) {
                 $query = "SELECT {$prefix}users.* FROM {$prefix}users, {$prefix}blogs 
-                          WHERE {$prefix}users.id = {$prefix}blogs.owner_id AND {$prefix}blogs.id = '".Db::qstr($blogId)."';";
+                          WHERE {$prefix}users.id = {$prefix}blogs.owner_id AND {$prefix}blogs.id = '".LtDb::qstr($blogId)."';";
                 $result = $this->Execute( $query );
 
                 if( !$result )
@@ -343,7 +343,7 @@
             // now get the other users who have permission for that blog.
             $query2 = "SELECT {$prefix}users.* FROM {$prefix}users, {$prefix}users_permissions 
                        WHERE {$prefix}users.id = {$prefix}users_permissions.user_id 
-                       AND {$prefix}users_permissions.blog_id = '".Db::qstr($blogId)."';";
+                       AND {$prefix}users_permissions.blog_id = '".LtDb::qstr($blogId)."';";
             $result2 = $this->Execute( $query2 );
             if( !$result2 ) // if error, return what we have so far...
                 return $users;
@@ -384,7 +384,7 @@
             $table = $this->getPrefix()."users";
 			    
 	    	if( $status != USER_STATUS_ALL )
-	    		$where = "status = '".Db::qstr($status)."'";
+	    		$where = "status = '".LtDb::qstr($status)."'";
 
 			$where = "";
 	    	if( $searchTerms != "" ) {
@@ -404,7 +404,7 @@
 		{
             $query = "SELECT email 
                       FROM ".$this->getPrefix()."users 
-                      WHERE email = '".Db::qstr($email)."'";
+                      WHERE email = '".LtDb::qstr($email)."'";
 
             $result = $this->Execute($query);
 

Modified: plog/trunk/class/dao/userdata/vbb3userdataprovider.class.php
===================================================================
--- plog/trunk/class/dao/userdata/vbb3userdataprovider.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/userdata/vbb3userdataprovider.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -20,7 +20,7 @@
 
 
     lt_include( PLOG_CLASS_PATH."class/dao/userdata/baseuserdataprovider.class.php" );
-    lt_include( PLOG_CLASS_PATH."class/database/db.class.php" );
+    lt_include( PLOG_CLASS_PATH."class/database/ltdb.class.php" );
     
     /**
      * Model representing the users in our application. Provides the methods such as
@@ -118,7 +118,7 @@
          */
         function authenticateUser( $user, $pass )
         {        	
-        	$query = "SELECT * FROM ".$this->_vbb3prefix."user WHERE username = '".Db::qstr( $user )."'";	                  
+        	$query = "SELECT * FROM ".$this->_vbb3prefix."user WHERE username = '".LtDb::qstr( $user )."'";	                  
 	                  
 	        $result = $this->_dbc->Execute( $query );        
 	        
@@ -148,7 +148,7 @@
          */
         function getUserInfo( $user, $pass )
         {
-	        $query = "SELECT * FROM ".$this->_vbb3prefix."user WHERE username = '".Db::qstr( $user )."'";
+	        $query = "SELECT * FROM ".$this->_vbb3prefix."user WHERE username = '".LtDb::qstr( $user )."'";
 	                  
 	                  
 	        $result = $this->_dbc->Execute( $query );
@@ -173,7 +173,7 @@
          */
         function getUserInfoFromUsername( $username )
         {        	
-	        $query = "SELECT * FROM ".$this->_vbb3prefix."user WHERE username = '".Db::qstr( $username )."'";	       	       
+	        $query = "SELECT * FROM ".$this->_vbb3prefix."user WHERE username = '".LtDb::qstr( $username )."'";	       	       
 	                  
 	        $result = $this->_dbc->Execute( $query );
 	        
@@ -202,7 +202,7 @@
 	        lt_include( PLOG_CLASS_PATH."class/dao/userpermissions.class.php" );	        
 	        
 	        
-	        $query = "SELECT * FROM ".$this->_vbb3prefix."user WHERE userid = '".Db::qstr( $userid )."'";
+	        $query = "SELECT * FROM ".$this->_vbb3prefix."user WHERE userid = '".LtDb::qstr( $userid )."'";
 
           //print("user__id = $userid");
 	                  
@@ -364,10 +364,10 @@
         	return $this->updatepLogPHPBB2UserData( $userInfo ); //nerver change data in vbb table , just return the updatepLogPHPBB2UserData' return value
         	
 	        $query = "UPDATE ".$this->_vbb3prefix."user SET
-	                  username = '".Db::qstr($userInfo->getUserName())."',
-	                  email = '".Db::qstr($userInfo->getEmail())."',
-	                  //user_active = '".Db::qstr($userInfo->getPassword())."'
-	                  WHERE userid = '".Db::qstr($userInfo->getId())."'";//todo
+	                  username = '".LtDb::qstr($userInfo->getUserName())."',
+	                  email = '".LtDb::qstr($userInfo->getEmail())."',
+	                  //user_active = '".LtDb::qstr($userInfo->getPassword())."'
+	                  WHERE userid = '".LtDb::qstr($userInfo->getId())."'";//todo
 	                              
             $result = $this->_dbc->Execute( $query );            
             
@@ -412,8 +412,8 @@
 	        $id = $this->getLastPhpBBUserId();
 	        	
 	        $query = "INSERT INTO ".$this->_vbb3prefix."user (userid,username,password,useremail)
-	                  VALUES ($id, '".Db::qstr($user->getUserName())."','".md5($user->getPassword())."','".
-                      Db::qstr($user->getEmail())."');";                      
+	                  VALUES ($id, '".LtDb::qstr($user->getUserName())."','".md5($user->getPassword())."','".
+                      LtDb::qstr($user->getEmail())."');";                      
                       
             $result = $this->_dbc->Execute( $query );            
 
@@ -442,23 +442,23 @@
 	    	if( $this->getpLogPHPBBUserData( $user->getId())) {
 		    	// we need to run an UPDATE query...
 		    	$query = "UPDATE ".$this->getPrefix()."phpbb2_users
-		    	          SET full_name = '".Db::qstr( $user->getFullName())."', 
-		    	              about = '".Db::qstr( $user->getAboutMyself())."',
-		    	              properties = '".Db::qstr( serialize($user->getProperties()))."',
-		    	              resource_picture_id = '".Db::qstr( $user->getPictureId())."',
-		    	              status = '".Db::qstr( $user->getStatus())."'
-		    	          WHERE phpbb_id = '".Db::qstr( $user->getId())."'";    
+		    	          SET full_name = '".LtDb::qstr( $user->getFullName())."', 
+		    	              about = '".LtDb::qstr( $user->getAboutMyself())."',
+		    	              properties = '".LtDb::qstr( serialize($user->getProperties()))."',
+		    	              resource_picture_id = '".LtDb::qstr( $user->getPictureId())."',
+		    	              status = '".LtDb::qstr( $user->getStatus())."'
+		    	          WHERE phpbb_id = '".LtDb::qstr( $user->getId())."'";    
 	    	}
 	    	else {
 		    	// we need to run an INSERT query...	
 		    	$query = "INSERT INTO ".$this->getPrefix()."phpbb2_users
 		    	          (full_name, about, properties, resource_picture_id,phpbb_id,status)
-		    	          VALUES ('".Db::qstr( $user->getFullName())."', '".
-		    	          Db::qstr($user->getAboutMyself())."','".
-		    	          Db::qstr(serialize($user->getProperties()))."','".
-		    	          Db::qstr($user->getPictureId())."','".
-		    	          Db::qstr($user->getId())."','".
-		    	          Db::qstr($user->getStatus())."');";
+		    	          VALUES ('".LtDb::qstr( $user->getFullName())."', '".
+		    	          LtDb::qstr($user->getAboutMyself())."','".
+		    	          LtDb::qstr(serialize($user->getProperties()))."','".
+		    	          LtDb::qstr($user->getPictureId())."','".
+		    	          LtDb::qstr($user->getId())."','".
+		    	          LtDb::qstr($user->getStatus())."');";
 	    	}
 	    	
 	    	$result = $this->Execute( $query );
@@ -475,7 +475,7 @@
          */
         function getpLogPHPBBUserData( $userId )
         {
-	        $query = "SELECT * FROM ".$this->getPrefix()."phpbb2_users WHERE phpbb_id = '".Db::qstr($userId)."'";
+	        $query = "SELECT * FROM ".$this->getPrefix()."phpbb2_users WHERE phpbb_id = '".LtDb::qstr($userId)."'";
 	        
 	        $result = $this->Execute( $query );
 	        
@@ -560,7 +560,7 @@
          */
         function emailExists($email)        
         {
-	        $query = "SELECT * FROM ".$this->_vbb3prefix."user WHERE email = '".Db::qstr($email)."'";
+	        $query = "SELECT * FROM ".$this->_vbb3prefix."user WHERE email = '".LtDb::qstr($email)."'";
 	        
 	        $result = $this->_dbc->Execute( $query );
 	        
@@ -605,7 +605,7 @@
             // get the information about the owner, if requested so
             if( $includeOwner ) {
                 $query = "SELECT {$prefix}blogs.owner_id as userid FROM {$prefix}blogs 
-                          WHERE {$prefix}blogs.id = '".Db::qstr($blogId)."';";
+                          WHERE {$prefix}blogs.id = '".LtDb::qstr($blogId)."';";
                 $result = $this->Execute( $query );
 
                 if( !$result )
@@ -619,7 +619,7 @@
 
             // now get the other users who have permission for that blog.
             $query2 = "SELECT {$prefix}users_permissions.user_id as userid FROM {$prefix}users_permissions 
-                       WHERE {$prefix}users_permissions.blog_id = '".Db::qstr($blogId)."';";
+                       WHERE {$prefix}users_permissions.blog_id = '".LtDb::qstr($blogId)."';";
             $result2 = $this->Execute( $query2 );
             
             if( $result2 )

Modified: plog/trunk/class/dao/userdata/wbbuserdataprovider.class.php
===================================================================
--- plog/trunk/class/dao/userdata/wbbuserdataprovider.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/userdata/wbbuserdataprovider.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -1,7 +1,7 @@
 <?php
 
     lt_include( PLOG_CLASS_PATH."class/dao/userdata/baseuserdataprovider.class.php" );
-    lt_include( PLOG_CLASS_PATH."class/database/db.class.php" );
+    lt_include( PLOG_CLASS_PATH."class/database/ltdb.class.php" );
     
     /**
      * Model representing the users in our application. Provides the methods such as
@@ -45,7 +45,7 @@
          */
         function authenticateUser( $user, $pass )
         {
-	        $query = "SELECT * FROM ".$this->_wbbprefix."users WHERE username = '".Db::qstr( $user )."'
+	        $query = "SELECT * FROM ".$this->_wbbprefix."users WHERE username = '".LtDb::qstr( $user )."'
 	                  AND password = '".md5( $pass )."' AND activation > 0";
 	                  
 	        $result = $this->_dbc->Execute( $query );
@@ -71,7 +71,7 @@
          */
         function getUserInfo( $user, $pass )
         {
-	        $query = "SELECT * FROM ".$this->_wbbprefix."users WHERE username = '".Db::qstr( $user )."'
+	        $query = "SELECT * FROM ".$this->_wbbprefix."users WHERE username = '".LtDb::qstr( $user )."'
 	                  AND password = '".md5( $pass )."'";
 	                  
 	        $result = $this->_dbc->Execute( $query );
@@ -93,7 +93,7 @@
          */
         function getUserInfoFromUsername( $username )
         {
-	        $query = "SELECT * FROM ".$this->_wbbprefix."users WHERE username = '".Db::qstr( $username )."'";	       	       
+	        $query = "SELECT * FROM ".$this->_wbbprefix."users WHERE username = '".LtDb::qstr( $username )."'";	       	       
 	                  
 	        $result = $this->_dbc->Execute( $query );
 	        
@@ -121,7 +121,7 @@
         {
 	        lt_include( PLOG_CLASS_PATH."class/dao/userpermissions.class.php" );
 	        
-	        $query = "SELECT * FROM ".$this->_wbbprefix."users WHERE userid = '".Db::qstr( $userid )."'";
+	        $query = "SELECT * FROM ".$this->_wbbprefix."users WHERE userid = '".LtDb::qstr( $userid )."'";
 
 //print("user__id = $userid");
 	                  
@@ -254,11 +254,11 @@
         function updateUser( $userInfo )
         {
 	        $query = "UPDATE ".$this->_wbbprefix."users SET
-	                  username = '".Db::qstr($userInfo->getUserName())."',
-	                  email = '".Db::qstr($userInfo->getEmail())."',
-	                  password = '".md5(Db::qstr($userInfo->getPassword()))."',
-	                  sha1_password = '".sha1(Db::qstr($userInfo->getPassword()))."'
-	                  WHERE userid = '".Db::qstr($userInfo->getId())."'";
+	                  username = '".LtDb::qstr($userInfo->getUserName())."',
+	                  email = '".LtDb::qstr($userInfo->getEmail())."',
+	                  password = '".md5(LtDb::qstr($userInfo->getPassword()))."',
+	                  sha1_password = '".sha1(LtDb::qstr($userInfo->getPassword()))."'
+	                  WHERE userid = '".LtDb::qstr($userInfo->getId())."'";
 	                              
             $result = $this->_dbc->Execute( $query );            
             
@@ -303,7 +303,7 @@
 	        $id = $this->getLastWBBUserId();
 	        	
 	        $query = "INSERT INTO ".$this->_wbbprefix."users (userid,username,password,sha1_password,email,groupcombinationid,rankid,regdate,lastvisit,lastactivity,usertext,signature,icq,aim,yim,msn,homepage,birthday,gender,showemail,admincanemail,usercanemail,invisible,usecookies,styleid,activation,daysprune,timezoneoffset,startweek,dateformat,timeformat,emailnotify,notificationperpm,receivepm,emailonpm,pmpopup,umaxposts,showsignatures,showavatars,showimages,threadview,langid,rankgroupid,useronlinegroupid,allowsigsmilies,allowsightml,allowsigbbcode,allowsigimages,usewysiwyg,reg_ipaddress) ".
-			"VALUES ($id,'".Db::qstr($user->getUserName())."','".md5($user->getPassword())."', '".sha1($user->getPassword())."', '".Db::qstr($user->getEmail())."','4','4','".time()."','".time()."','".time()."','','','','','','','','0000-00-00','0','1','1','1','0','1','0','1','0','1','0','','','0','1','1','0','1','0','1','1','1','0','0','4','4','1','0','1','1','0', '".addslashes($_SERVER['REMOTE_ADDR'])."');";                      
+			"VALUES ($id,'".LtDb::qstr($user->getUserName())."','".md5($user->getPassword())."', '".sha1($user->getPassword())."', '".LtDb::qstr($user->getEmail())."','4','4','".time()."','".time()."','".time()."','','','','','','','','0000-00-00','0','1','1','1','0','1','0','1','0','1','0','','','0','1','1','0','1','0','1','1','1','0','0','4','4','1','0','1','1','0', '".addslashes($_SERVER['REMOTE_ADDR'])."');";                      
 
             $result = $this->_dbc->Execute( $query );            
 
@@ -342,23 +342,23 @@
 	    	if( $this->getpLogWBBUserData( $user->getId())) {
 		    	// we need to run an UPDATE query...
 		    	$query = "UPDATE ".$this->getPrefix()."phpbb2_users
-		    	          SET full_name = '".Db::qstr( $user->getFullName())."', 
-		    	              about = '".Db::qstr( $user->getAboutMyself())."',
-		    	              properties = '".Db::qstr( serialize($user->getProperties()))."',
-		    	              resource_picture_id = '".Db::qstr( $user->getPictureId())."',
-		    	              status = '".Db::qstr( $user->getStatus())."'
-		    	          WHERE phpbb_id = '".Db::qstr( $user->getId())."'";    
+		    	          SET full_name = '".LtDb::qstr( $user->getFullName())."', 
+		    	              about = '".LtDb::qstr( $user->getAboutMyself())."',
+		    	              properties = '".LtDb::qstr( serialize($user->getProperties()))."',
+		    	              resource_picture_id = '".LtDb::qstr( $user->getPictureId())."',
+		    	              status = '".LtDb::qstr( $user->getStatus())."'
+		    	          WHERE phpbb_id = '".LtDb::qstr( $user->getId())."'";    
 	    	}
 	    	else {
 		    	// we need to run an INSERT query...	
 		    	$query = "INSERT INTO ".$this->getPrefix()."phpbb2_users
 		    	          (full_name, about, properties, resource_picture_id,phpbb_id,status)
-		    	          VALUES ('".Db::qstr( $user->getFullName())."', '".
-		    	          Db::qstr($user->getAboutMyself())."','".
-		    	          Db::qstr(serialize($user->getProperties()))."','".
-		    	          Db::qstr($user->getPictureId())."','".
-		    	          Db::qstr($user->getId())."','".
-		    	          Db::qstr($user->getStatus())."');";
+		    	          VALUES ('".LtDb::qstr( $user->getFullName())."', '".
+		    	          LtDb::qstr($user->getAboutMyself())."','".
+		    	          LtDb::qstr(serialize($user->getProperties()))."','".
+		    	          LtDb::qstr($user->getPictureId())."','".
+		    	          LtDb::qstr($user->getId())."','".
+		    	          LtDb::qstr($user->getStatus())."');";
 	    	}
 	    	
 	    	$result = $this->Execute( $query );
@@ -375,7 +375,7 @@
          */
         function getpLogWBBUserData( $userId )
         {
-	        $query = "SELECT * FROM ".$this->getPrefix()."phpbb2_users WHERE phpbb_id = '".Db::qstr($userId)."'";
+	        $query = "SELECT * FROM ".$this->getPrefix()."phpbb2_users WHERE phpbb_id = '".LtDb::qstr($userId)."'";
 	        
 	        $result = $this->Execute( $query );
 	        
@@ -436,7 +436,7 @@
          */
         function emailExists($email)        
         {
-	        $query = "SELECT * FROM ".$this->_wbbprefix."users WHERE email = '".Db::qstr($email)."'";
+	        $query = "SELECT * FROM ".$this->_wbbprefix."users WHERE email = '".LtDb::qstr($email)."'";
 	        
 	        $result = $this->_dbc->Execute( $query );
 	        

Modified: plog/trunk/class/dao/userpermissions.class.php
===================================================================
--- plog/trunk/class/dao/userpermissions.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/dao/userpermissions.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -112,8 +112,8 @@
 				return( true );
 
 			// build the query to remove the row
-			$query = "DELETE FROM ".$this->getPrefix()."users_permissions WHERE user_id = '".Db::qstr( $userId )."'
-			          AND blog_id = '".Db::qstr( $blogId ) ."' AND permission_id = '".Db::qstr( $permissionId )."'";
+			$query = "DELETE FROM ".$this->getPrefix()."users_permissions WHERE user_id = '".LtDb::qstr( $userId )."'
+			          AND blog_id = '".LtDb::qstr( $blogId ) ."' AND permission_id = '".LtDb::qstr( $permissionId )."'";
 			// and execute it
 			$result = $this->Execute( $query );
 			if( $result ) {
@@ -133,8 +133,8 @@
 		function revokePermissions( $userId, $blogId ) 
 		{
 			// build the query to remove the row
-			$query = "DELETE FROM ".$this->getPrefix()."users_permissions WHERE user_id = '".Db::qstr( $userId )."'
-			          AND blog_id = '".Db::qstr( $blogId )."'";
+			$query = "DELETE FROM ".$this->getPrefix()."users_permissions WHERE user_id = '".LtDb::qstr( $userId )."'
+			          AND blog_id = '".LtDb::qstr( $blogId )."'";
 			
 			// and execute it
 			$result = $this->Execute( $query );
@@ -194,7 +194,7 @@
 		function getNumUsersWithPermission( $permId )
 		{
 			$query = "SELECT COUNT(DISTINCT user_id) AS total FROM ".$this->getPrefix()."users_permissions
-			          WHERE permission_id = ".Db::qstr( $permId );
+			          WHERE permission_id = ".LtDb::qstr( $permId );
 			
             // execute it
             $result = $this->Execute( $query );

Modified: plog/trunk/class/data/validator/filenamematchvalidator.class.php
===================================================================
--- plog/trunk/class/data/validator/filenamematchvalidator.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/data/validator/filenamematchvalidator.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -11,8 +11,13 @@
 	class FileNameMatchValidator extends Validator
 	{
 		private $_patterns;
+		private $_caseSensitive;
 		
-		function FileNameMatchValidator( $filePatterns = Array())
+		/**
+		 * @param filePatterns Array containing the patterns that should be used for the matching
+		 * @param caseSensitive Determines whether matches should be case sensitive or not (defaults to false)
+		 */
+		function FileNameMatchValidator( $filePatterns = Array(), $caseSensitive = false )
 		{
 			$this->Validator();
 			
@@ -21,11 +26,17 @@
 			}
 			else
 				$this->_patterns = $filePatterns;
+				
+			$this->_caseSensitive = $caseSensitive;
 		}
 		
 		function validate( $file )
 		{
 			foreach( $this->_patterns as $pattern ) {
+				if( $this->_caseSensitive == false ) {
+					$pattern = strtolower( $pattern );
+					$file = strtolower( $file );
+				}
 				if( Glob::fnmatch( $pattern, $file ))
 					return( true );
 			}

Modified: plog/trunk/class/database/db.class.php
===================================================================
--- plog/trunk/class/database/db.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/database/db.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -1,177 +1,16 @@
 <?php
 
-	define( "DEFAULT_DATABASE_DRIVER", "mysql" );
+    lt_include( PLOG_CLASS_PATH."class/database/ltdb.class.php" );
 
-	/**
-	 * \defgroup Database
-	 *
-	 * <p>This module includes all database-related objects.</p>
-	 *
-	 * <p>The most important one is the Db object, which provides one centralized way to get
-	 * access to the current database connection. In fact, there is no reason for classes that require
-	 * database access to use the PDb framework directly, as the Db::getDb() singleton method will
-	 * transparently load the database information from the configuration file, connect to it and return
-	 * a working connection.</p>
-	 *
-	 * <p>In order to get a working database connection, this is all you need to do:</p>
-	 *
-	 * <pre>
-	 * $db =& Db::getDb();
-	 * </pre>
-	 *
-	 * <p>For those classes that extend the Model base class, the private attribute Model::_db is a database
-	 * connection so there is no need to initialize a new one.</p>
-	 */
-	
-    lt_include( PLOG_CLASS_PATH."class/config/configfilestorage.class.php" );
-    lt_include( PLOG_CLASS_PATH."class/database/pdb/pdb.class.php" );
-
     /**
 	 * \ingroup Database
 	 *
-     * Provides a singleton for accessing the db and interfaces with PDb. Please use the 
-     * getDb() singleton method to get access to the global database object instead of creating
- 	 * new objects every time.
+	 * @deprecated
+	 * This class is left here for compatibility reasons, since as of Lifetype 2.0, the original Db class
+	 * was renamed to LtDb in order not to clash with PEAR's Db class. Please modify your plugins and
+	 * custom code to refer to the new LtDb class.
      */
-	class Db  
+	class Db extends LtDb
 	{
-        var $_prefix;
-
-		/**
-		 * Constructor of the class
-		 */
-		function Db()
-		{
-        	
-		}
-
-		/**
-		 * Singleto method that should be used to get access to the global database connection. This method
-		 * will load the database information from the database configuration file (config/config.properties.php) and
-		 * will initialize a connection based on its information. If it is unable to start a new database connection, this
-		 * method wil stop all processing and display an error message.
-		 *
-		 * @return Returns a reference to a PDb driver, with a working connection to the database.
-		 * @see PDb::getDriver()
-		 */
-		function &getDb()
-		{
-			static $db;
-
-            if( !isset( $db )) {
-            	// we need to connect to the db
-                $fileConfig = new ConfigFileStorage();
-
-				$driver = $fileConfig->getValue( "db_driver", DEFAULT_DATABASE_DRIVER );				
-                $db = PDb::getDriver( $driver );
-
-                $username  = $fileConfig->getValue( "db_username" );
-                $password  = $fileConfig->getValue( "db_password" );
-                $host      = $fileConfig->getValue( "db_host" );
-                $dbname    = $fileConfig->getValue( "db_database" );
-                $dbcharset = $fileConfig->getValue( "db_character_set" );
-                $dbpersistent   = $fileConfig->getValue( "db_persistent" );
-                if($dbpersistent == true) {
-	            	if( !$db->PConnect( $host, $username, $password, $dbname, $dbcharset )) {
-	            	    $message = "Fatal error: could not connect to the database!".
-	            	               " Error: ".$db->ErrorMsg();
-	            		throw( new Exception( $message ));
-	            		die();
-	            	}
-            	}
-            	else {
-	            	if( !$db->Connect( $host, $username, $password, $dbname, $dbcharset )) {
-	            	    $message = "Fatal error: could not connect to the database!".
-	            	               " Error: ".$db->ErrorMsg();
-	            		throw( new Exception( $message ));
-	            		die();
-	            	}
-            	}
-
-				// pass the options to the driver, if any
-				$db->setDriverOpts( $fileConfig->getValue( "db_options" ));
-            }
-            
-            return $db;
-		}
-		
-		/**
-		 * Creates a new database instance based on the information provided
-		 *
-		 * @param host The database host where to connect
-		 * @param username The username used for the connection
-		 * @param password The password used for the connection
-		 * @param dbname The name of the database
-		 * @param returns a reference to a PDb driver or dies if there was an error connecting
-		 */
-		function &getNewDb( $host, $username, $password, $dbname ) 
-		{
-			static $dbs;
-			
-			if( !is_array( $dbs ))
-				$dbs = Array();
-				
-			$key = $username.$password.$host.$dbname;
-				
-			if( !isset( $dbs[$key] )) {
-                $dbs[$key] = PDb::getDriver('mysql');
-            	if( !$dbs[$key]->PConnect( $host, $username, $password, $dbname )) {
-            		throw( new Exception( "getNewDb: Fatal error: could not connect to the database!" ));
-                	die();
-            	}
-			}	
-			
-			$conn = $dbs[$key];	
-			
-			return( $conn );				
-		}
-
-		/**
-		 * returns the prefix as configured for this database connection
-		 *
-		 * @return A string containing the database prefix
-		 * @static
-		 */
-		function getPrefix()
-		{
-            static $prefix;
-
-            if ( isset($prefix) ) {
-                return $prefix;
-            } else {
-			    $fileConfig = new ConfigFileStorage();
-			    $prefix = $fileConfig->getValue( "db_prefix" );
-			    return( $prefix );	
-            }
-		}
-
-		/**
-		 * Prepares a string for an SQL query by escaping apostrophe
-		 * characters. If the PHP configuration setting 'magic_quotes_gpc'
-		 * is set to ON, it will first strip the added slashes. Apostrophe
-		 * characters are doubled, conforming with the ANSI SQL standard.
-		 * The SQL parser makes sure that the escape token is not entered
-		 * in the database so there is no need to modify the data when it
-		 * is read from the database.
-		 *
-		 * @param  string $string
-		 * @return string
-		 * @access public
-		 */
-		function qstr($string) {
-
- 			if (get_magic_quotes_gpc()) {
-				$string = stripslashes($string);
-				//$string = stripslashes($string);
-		                $string = str_replace('\\\\', '\\', $string);
-                		$string = str_replace("\\'", "'", $string);
-         		        $string = str_replace('\\"', '"', $string);
- 			}
- 
-			$string = str_replace("\\", "\\\\", $string);
- 			$string = str_replace("'", "''", $string);
-
-			return $string;
-		}
-    }
+	}
 ?>
\ No newline at end of file

Added: plog/trunk/class/database/ltdb.class.php
===================================================================
--- plog/trunk/class/database/ltdb.class.php	                        (rev 0)
+++ plog/trunk/class/database/ltdb.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -0,0 +1,177 @@
+<?php
+
+	define( "DEFAULT_DATABASE_DRIVER", "mysql" );
+
+	/**
+	 * \defgroup Database
+	 *
+	 * <p>This module includes all database-related objects.</p>
+	 *
+	 * <p>The most important one is the Db object, which provides one centralized way to get
+	 * access to the current database connection. In fact, there is no reason for classes that require
+	 * database access to use the PDb framework directly, as the LtDb::getDb() singleton method will
+	 * transparently load the database information from the configuration file, connect to it and return
+	 * a working connection.</p>
+	 *
+	 * <p>In order to get a working database connection, this is all you need to do:</p>
+	 *
+	 * <pre>
+	 * $db =& LtLtDb::getDb();
+	 * </pre>
+	 *
+	 * <p>For those classes that extend the Model base class, the private attribute Model::_db is a database
+	 * connection so there is no need to initialize a new one.</p>
+	 */
+	
+    lt_include( PLOG_CLASS_PATH."class/config/configfilestorage.class.php" );
+    lt_include( PLOG_CLASS_PATH."class/database/pdb/pdb.class.php" );
+
+    /**
+	 * \ingroup Database
+	 *
+     * Provides a singleton for accessing the db and interfaces with PDb. Please use the 
+     * getDb() singleton method to get access to the global database object instead of creating
+ 	 * new objects every time.
+     */
+	class LtDb  
+	{
+        var $_prefix;
+
+		/**
+		 * Constructor of the class
+		 */
+		function LtDb()
+		{
+        	
+		}
+
+		/**
+		 * Singleto method that should be used to get access to the global database connection. This method
+		 * will load the database information from the database configuration file (config/config.properties.php) and
+		 * will initialize a connection based on its information. If it is unable to start a new database connection, this
+		 * method wil stop all processing and display an error message.
+		 *
+		 * @return Returns a reference to a PDb driver, with a working connection to the database.
+		 * @see PDb::getDriver()
+		 */
+		function &getDb()
+		{
+			static $db;
+
+            if( !isset( $db )) {
+            	// we need to connect to the db
+                $fileConfig = new ConfigFileStorage();
+
+				$driver = $fileConfig->getValue( "db_driver", DEFAULT_DATABASE_DRIVER );				
+                $db = PDb::getDriver( $driver );
+
+                $username  = $fileConfig->getValue( "db_username" );
+                $password  = $fileConfig->getValue( "db_password" );
+                $host      = $fileConfig->getValue( "db_host" );
+                $dbname    = $fileConfig->getValue( "db_database" );
+                $dbcharset = $fileConfig->getValue( "db_character_set" );
+                $dbpersistent   = $fileConfig->getValue( "db_persistent" );
+                if($dbpersistent == true) {
+	            	if( !$db->PConnect( $host, $username, $password, $dbname, $dbcharset )) {
+	            	    $message = "Fatal error: could not connect to the database!".
+	            	               " Error: ".$db->ErrorMsg();
+	            		throw( new Exception( $message ));
+	            		die();
+	            	}
+            	}
+            	else {
+	            	if( !$db->Connect( $host, $username, $password, $dbname, $dbcharset )) {
+	            	    $message = "Fatal error: could not connect to the database!".
+	            	               " Error: ".$db->ErrorMsg();
+	            		throw( new Exception( $message ));
+	            		die();
+	            	}
+            	}
+
+				// pass the options to the driver, if any
+				$db->setDriverOpts( $fileConfig->getValue( "db_options" ));
+            }
+            
+            return $db;
+		}
+		
+		/**
+		 * Creates a new database instance based on the information provided
+		 *
+		 * @param host The database host where to connect
+		 * @param username The username used for the connection
+		 * @param password The password used for the connection
+		 * @param dbname The name of the database
+		 * @param returns a reference to a PDb driver or dies if there was an error connecting
+		 */
+		function &getNewDb( $host, $username, $password, $dbname ) 
+		{
+			static $dbs;
+			
+			if( !is_array( $dbs ))
+				$dbs = Array();
+				
+			$key = $username.$password.$host.$dbname;
+				
+			if( !isset( $dbs[$key] )) {
+                $dbs[$key] = PDb::getDriver('mysql');
+            	if( !$dbs[$key]->PConnect( $host, $username, $password, $dbname )) {
+            		throw( new Exception( "getNewDb: Fatal error: could not connect to the database!" ));
+                	die();
+            	}
+			}	
+			
+			$conn = $dbs[$key];	
+			
+			return( $conn );				
+		}
+
+		/**
+		 * returns the prefix as configured for this database connection
+		 *
+		 * @return A string containing the database prefix
+		 * @static
+		 */
+		function getPrefix()
+		{
+            static $prefix;
+
+            if ( isset($prefix) ) {
+                return $prefix;
+            } else {
+			    $fileConfig = new ConfigFileStorage();
+			    $prefix = $fileConfig->getValue( "db_prefix" );
+			    return( $prefix );	
+            }
+		}
+
+		/**
+		 * Prepares a string for an SQL query by escaping apostrophe
+		 * characters. If the PHP configuration setting 'magic_quotes_gpc'
+		 * is set to ON, it will first strip the added slashes. Apostrophe
+		 * characters are doubled, conforming with the ANSI SQL standard.
+		 * The SQL parser makes sure that the escape token is not entered
+		 * in the database so there is no need to modify the data when it
+		 * is read from the database.
+		 *
+		 * @param  string $string
+		 * @return string
+		 * @access public
+		 */
+		function qstr($string) {
+
+ 			if (get_magic_quotes_gpc()) {
+				$string = stripslashes($string);
+				//$string = stripslashes($string);
+		                $string = str_replace('\\\\', '\\', $string);
+                		$string = str_replace("\\'", "'", $string);
+         		        $string = str_replace('\\"', '"', $string);
+ 			}
+ 
+			$string = str_replace("\\", "\\\\", $string);
+ 			$string = str_replace("'", "''", $string);
+
+			return $string;
+		}
+    }
+?>
\ No newline at end of file

Modified: plog/trunk/class/database/pdb/drivers/pdbdriverbase.class.php
===================================================================
--- plog/trunk/class/database/pdb/drivers/pdbdriverbase.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/database/pdb/drivers/pdbdriverbase.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -201,13 +201,13 @@
 		}
         
         /**
-         * for compatibility with ADOdb. Use Db::qstr() instead
+         * for compatibility with ADOdb. Use LtDb::qstr() instead
          *
          * @private
          */
         function qstr( $string )         
         {
-            return( Db::qstr( $string ));
+            return( LtDb::qstr( $string ));
         }
         
         /**

Modified: plog/trunk/class/gallery/dao/galleryalbums.class.php
===================================================================
--- plog/trunk/class/gallery/dao/galleryalbums.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/gallery/dao/galleryalbums.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -408,12 +408,12 @@
 		 */
 		function getSearchConditions( $searchTerms )
 		{
-			$db =& Db::getDb();
+			$db =& LtDb::getDb();
 			if( $db->isFullTextSupported()) {			
-				$query = "MATCH(normalized_name,normalized_description) AGAINST ('".Db::qstr($searchTerms)."')";
+				$query = "MATCH(normalized_name,normalized_description) AGAINST ('".LtDb::qstr($searchTerms)."')";
 			}
 			else {
-				$query = "name LIKE '%".Db::qstr( $searchTerms )."%' OR normalized_description LIKE '%".Db::qstr( $searchTerms )."%'";
+				$query = "name LIKE '%".LtDb::qstr( $searchTerms )."%' OR normalized_description LIKE '%".LtDb::qstr( $searchTerms )."%'";
 			}
 			
 			return( $query );

Modified: plog/trunk/class/gallery/dao/galleryresourcequotas.class.php
===================================================================
--- plog/trunk/class/gallery/dao/galleryresourcequotas.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/gallery/dao/galleryresourcequotas.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -46,7 +46,7 @@
 		
 			// we can use one query to calculate this...
 			$query = "SELECT SUM(file_size) AS total_size FROM {$prefix}gallery_resources
-			          WHERE owner_id = '".Db::qstr( $userId )."'";
+			          WHERE owner_id = '".LtDb::qstr( $userId )."'";
 			$result = $model->Execute( $query );
 			
 			if( !$result ) 

Modified: plog/trunk/class/gallery/dao/galleryresources.class.php
===================================================================
--- plog/trunk/class/gallery/dao/galleryresources.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/gallery/dao/galleryresources.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -200,15 +200,15 @@
             $resources = Array();
             $query = "SELECT id FROM ".$this->getPrefix()."gallery_resources WHERE "; 
             if( $ownerId != -1 )
-                $query .= " owner_id = '".Db::qstr($ownerId)."' AND";
+                $query .= " owner_id = '".LtDb::qstr($ownerId)."' AND";
             if( $albumId != GALLERY_NO_ALBUM )
-                $query .= " album_id = '".Db::qstr($albumId)."' AND";
+                $query .= " album_id = '".LtDb::qstr($albumId)."' AND";
             if( $resourceType != GALLERY_RESOURCE_ANY )
-                $query .= " resource_type = '".Db::qstr($resourceType)."' AND";
+                $query .= " resource_type = '".LtDb::qstr($resourceType)."' AND";
             if( $searchTerms != "" )
                 $query .= " (".$this->getSearchConditions( $searchTerms ).") AND";
 			if( $locationId != -1 ) 
-				$query .= " loc_id = '".Db::qstr( $locationId )."' AND";
+				$query .= " loc_id = '".LtDb::qstr( $locationId )."' AND";
             
                 // just in case if for any reason the string ends with "AND"
             $query = trim( $query );
@@ -272,20 +272,20 @@
 			
 			$cond = "";
 			if( $ownerId != -1 )
-				$cond = "owner_id = '".Db::qstr( $ownerId )."'";
+				$cond = "owner_id = '".LtDb::qstr( $ownerId )."'";
 			else
 				$cond = "owner_id = owner_id ";
 			
             if( $albumId > GALLERY_NO_ALBUM )
-            	$cond .= "AND album_id = '".Db::qstr($albumId)."'";
+            	$cond .= "AND album_id = '".LtDb::qstr($albumId)."'";
 			if( $resourceType > GALLERY_RESOURCE_ANY )
-				$cond .= " AND resource_type = '".Db::qstr($resourceType)."'";
+				$cond .= " AND resource_type = '".LtDb::qstr($resourceType)."'";
 			if( $searchTerms != "" ) {
 				$searchParams = $this->getSearchConditions( $searchTerms );
 				$cond .= " AND (".$searchParams.")";
 			}
 			if( $locationId != -1 ) 
-				$cond .= " AND loc_id = '".Db::qstr( $locationId )."'";	
+				$cond .= " AND loc_id = '".LtDb::qstr( $locationId )."'";	
 
                 // return the number of items
 			return( $this->getNumItems( $table, $cond ));
@@ -312,7 +312,7 @@
 		{
 			// prepare the metadata to be stored in the db
 			$fileSize = $metadata["filesize"];
-			$serMetadata = Db::qstr( serialize($metadata));
+			$serMetadata = LtDb::qstr( serialize($metadata));
 			// get the correct thumbnail format
 			lt_include( PLOG_CLASS_PATH."class/config/config.class.php" );
 			$config =& Config::getConfig();
@@ -331,9 +331,9 @@
 						  owner_id, album_id, description, flags, resource_type,
 						  file_path, file_name, file_size, metadata, thumbnail_format, normalized_description, properties) 
 						  VALUES (
-						  $ownerId, $albumId, '".Db::qstr($description)."', $flags, $resourceType,
-						  '$filePath', '".Db::qstr($fileName)."', '$fileSize', '$serMetadata', '$thumbnailFormat',
-				  '".Db::qstr($normalizedDescription)."', '$properties');";
+						  $ownerId, $albumId, '".LtDb::qstr($description)."', $flags, $resourceType,
+						  '$filePath', '".LtDb::qstr($fileName)."', '$fileSize', '$serMetadata', '$thumbnailFormat',
+				  '".LtDb::qstr($normalizedDescription)."', '$properties');";
 						  
 			$result = $this->Execute( $query );
 
@@ -844,7 +844,7 @@
         function isDuplicatedFilename( $fileName )
         {
         	$query = "SELECT COUNT(id) AS total FROM ".$this->getPrefix()."gallery_resources
-                      WHERE file_name = '".Db::qstr($fileName)."'";
+                      WHERE file_name = '".LtDb::qstr($fileName)."'";
 
             $result = $this->Execute( $query );
 
@@ -863,15 +863,15 @@
 		 */
 		function getSearchConditions( $searchTerms )
 		{
-			$query = "file_name LIKE '%".Db::qstr( $searchTerms )."%'";
+			$query = "file_name LIKE '%".LtDb::qstr( $searchTerms )."%'";
 			
 			// search the text via the existing FULLTEXT index
-			$db =& Db::getDb();
+			$db =& LtDb::getDb();
 			if( $db->isFullTextSupported()) {			
-				$query .= " OR MATCH(normalized_description) AGAINST ('".Db::qstr($searchTerms)."')";	
+				$query .= " OR MATCH(normalized_description) AGAINST ('".LtDb::qstr($searchTerms)."')";	
 			}
 			else {
-				$query .= " OR normalized_description LIKE '%".Db::qstr( $searchTerms )."%'";
+				$query .= " OR normalized_description LIKE '%".LtDb::qstr( $searchTerms )."%'";
 			}
 			
 			return( $query );

Modified: plog/trunk/class/misc/info.class.php
===================================================================
--- plog/trunk/class/misc/info.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/misc/info.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -58,7 +58,7 @@
 		{
 			lt_include( PLOG_CLASS_PATH."class/logger/loggermanager.class.php" );
 			lt_include( PLOG_CLASS_PATH."class/cache/cachemanager.class.php" );
-			lt_include( PLOG_CLASS_PATH."class/database/db.class.php" );
+			lt_include( PLOG_CLASS_PATH."class/database/ltdb.class.php" );
 			lt_include( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
 		
 			global $__metrics_start_time;
@@ -80,7 +80,7 @@
 			$requestUri = $_SERVER["REQUEST_URI"];
 			
 			// get the number of sql queries
-			$db =& Db::getDb();
+			$db =& LtDb::getDb();
 			$numQueries = $db->getNumQueries();
 			if( $numQueries == "" ) $numQueries = 0;
 			

Modified: plog/trunk/class/net/modrewriterequestgenerator.class.php
===================================================================
--- plog/trunk/class/net/modrewriterequestgenerator.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/net/modrewriterequestgenerator.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -2,7 +2,7 @@
 
 	lt_include( PLOG_CLASS_PATH."class/net/baserequestgenerator.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/data/stringutils.class.php" );
-	lt_include( PLOG_CLASS_PATH."class/database/db.class.php" );
+	lt_include( PLOG_CLASS_PATH."class/database/ltdb.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
 
     /**

Modified: plog/trunk/class/net/xmlrpc/xmlrpcserver.class.php
===================================================================
--- plog/trunk/class/net/xmlrpc/xmlrpcserver.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/net/xmlrpc/xmlrpcserver.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -2,7 +2,7 @@
 
 	lt_include( PLOG_CLASS_PATH."class/net/xmlrpc/IXR_Library.lib.php" );
 	lt_include( PLOG_CLASS_PATH."class/config/config.class.php" );
-	lt_include( PLOG_CLASS_PATH."class/database/db.class.php" );
+	lt_include( PLOG_CLASS_PATH."class/database/ltdb.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/dao/users.class.php");
 	lt_include( PLOG_CLASS_PATH."class/dao/article.class.php");
 	lt_include( PLOG_CLASS_PATH."class/dao/articles.class.php");

Modified: plog/trunk/class/summary/dao/summarystats.class.php
===================================================================
--- plog/trunk/class/summary/dao/summarystats.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/summary/dao/summarystats.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -240,7 +240,7 @@
 							AND a.in_summary_page = '1'";
 
 			if($globaArticleCategoryId != ALL_GLOBAL_ARTICLE_CATEGORIES)
-				$query .= " AND a.global_category_id = '".Db::qstr($globaArticleCategoryId)."'";
+				$query .= " AND a.global_category_id = '".LtDb::qstr($globaArticleCategoryId)."'";
 				
 			$query .= " ORDER BY a.date DESC";
 
@@ -297,7 +297,7 @@
 							AND b.show_in_summary = '1'";
 
 			if($globaArticleCategoryId != ALL_GLOBAL_ARTICLE_CATEGORIES)
-				$query .= " AND a.global_category_id = '".Db::qstr($globaArticleCategoryId)."'";				
+				$query .= " AND a.global_category_id = '".LtDb::qstr($globaArticleCategoryId)."'";				
 
 			$query .= " ORDER BY a.date DESC";
 
@@ -334,7 +334,7 @@
 							AND a.in_summary_page = '1'";
 
 			if($globaArticleCategoryId != ALL_GLOBAL_ARTICLE_CATEGORIES)
-				$query .= " AND a.global_category_id = '".Db::qstr($globaArticleCategoryId)."'";				
+				$query .= " AND a.global_category_id = '".LtDb::qstr($globaArticleCategoryId)."'";				
 
             return( $this->getNumItems( "{$prefix}articles a, {$prefix}blogs b", $query, "a.id" ));
         }
@@ -380,7 +380,7 @@
 	{
 		lt_include( PLOG_CLASS_PATH."class/dao/articles.class.php" );
 		// query to load the data
-		$query = "SELECT * FROM ".$this->getPrefix()."articles WHERE user_id = ".Db::qstr( $userId )." AND status = ".POST_STATUS_PUBLISHED."
+		$query = "SELECT * FROM ".$this->getPrefix()."articles WHERE user_id = ".LtDb::qstr( $userId )." AND status = ".POST_STATUS_PUBLISHED."
 			  ORDER BY date DESC";
 		
 		// process it

Modified: plog/trunk/class/summary/data/summarytools.class.php
===================================================================
--- plog/trunk/class/summary/data/summarytools.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/summary/data/summarytools.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -53,16 +53,16 @@
 		function verifyRequest( $userNameHash, $requestHash )
 		{		
 			// make sure that the request is correct
-			lt_include( PLOG_CLASS_PATH."class/database/db.class.php" );
+			lt_include( PLOG_CLASS_PATH."class/database/ltdb.class.php" );
 			$users = new Users();
 
-			$db =& Db::getDb();
-			$prefix = Db::getPrefix();
+			$db =& LtDb::getDb();
+			$prefix = LtDb::getPrefix();
 			
 			$query = "SELECT id, user, password, email, about, full_name, properties, 
 					  site_admin, resource_picture_id, status
 					  FROM {$prefix}users 
-					  WHERE MD5(user) = '".Db::qstr($userNameHash)."'
+					  WHERE MD5(user) = '".LtDb::qstr($userNameHash)."'
 					  AND status = ".USER_STATUS_ACTIVE;
 										
 			$result = $db->Execute( $query );

Modified: plog/trunk/class/test/tests/dao/articlecategories_test.class.php
===================================================================
--- plog/trunk/class/test/tests/dao/articlecategories_test.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/test/tests/dao/articlecategories_test.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -32,8 +32,8 @@
 			$this->assertTrue( $updatedCat->getNumArticles( POST_STATUS_ALL ) == ($data["categories"][0]->getNumArticles() + 1 ), "Article category counters are not valid!" );
 			
 			// now let's mess up the database a little
-			$db =& Db::getDb();
-			$db->Execute( "UPDATE ".Db::getPrefix().
+			$db =& LtDb::getDb();
+			$db->Execute( "UPDATE ".LtDb::getPrefix().
 			              "articles_categories SET num_published_articles = 234234, num_articles = 2342 ".
 			              "WHERE id = ".$data["categories"][1]->getId());
 			// trigger a cache reset

Modified: plog/trunk/class/test/tests/data/validator/filenamematchvalidator_test.class.php
===================================================================
--- plog/trunk/class/test/tests/data/validator/filenamematchvalidator_test.class.php	2007-09-29 07:45:32 UTC (rev 5957)
+++ plog/trunk/class/test/tests/data/validator/filenamematchvalidator_test.class.php	2007-09-29 08:03:40 UTC (rev 5958)
@@ -20,15 +20,26 @@
 			$this->assertFalse( $v->validate( "whatever-goes-through.php" ));			
 		}
 		
-		function testValidate()
+		function testValidateCaseInsensitive()
 		{
-			$v = new FileNameMatchValidator( "*.template *.js *.css" );
+			$v = new FileNameMatchValidator( "*.template *.js *.css", false );
 			$this->assertFalse( $v->validate( "test.txt" ));
 			$this->assertFalse( $v->validate( "test.phpa" ));
-			$this->assertTrue( $v->validate( "test.js" ));
+			$this->assertTrue( $v->validate( "TEST.JS" ));
 			$this->assertTrue( $v->validate( "test.template" ));			
 			$this->assertTrue( $v->validate( "test.css" ));			
-			$this->assertTrue( $v->validate( "test.js" ));			
+			$this->assertTrue( $v->validate( "TesT.jS" ));
 		}
+		
+		function testValidateCaseSensitive()
+		{
+			$v = new FileNameMatchValidator( "*.template *.js *.css", true );
+			$this->assertFalse( $v->validate( "test.txt" ));
+			$this->assertFalse( $v->validate( "test.phpa" ));
+			$this->assertFalse( $v->validate( "TEST.JS" ));
+			$this->assertFalse( $v->validate( "test.Template" ));			
+			$this->assertTrue( $v->validate( "test.css" ));			
+			$this->assertTrue( $v->validate( "test.js" ));
+		}		
 	}
 ?>
\ No newline at end of file



More information about the pLog-svn mailing list