[pLog-svn] r2479 - in plog/trunk: . class/action class/action/admin class/dao class/data class/data/validator class/data/validator/rules class/database/adodb/drivers class/gallery/dao class/gallery/getid3 class/locale class/logger/logger class/net class/net/http class/net/http/session class/plugin class/summary/action class/summary/dao class/summary/view class/template class/view config imgs/admin js locale locale/unsupport styles templates/admin templates/blueish templates/grey templates/grey-sf templates/plogworld templates/rss templates/standard templates/standard-with-plugins templates/summary templates/summary/rss

jondaley at devel.plogworld.net jondaley at devel.plogworld.net
Mon Sep 19 01:34:40 GMT 2005


Author: jondaley
Date: 2005-09-19 01:34:39 +0000 (Mon, 19 Sep 2005)
New Revision: 2479

Added:
   plog/trunk/class/data/jalalicalendar.class.php
   plog/trunk/class/data/jalalicalendarstrings.properties.php
   plog/trunk/class/gallery/getid3/module.archive.gzip.php
   plog/trunk/class/gallery/getid3/module.archive.tar.php
   plog/trunk/class/gallery/getid3/module.audio.wavpack.php
   plog/trunk/class/gallery/getid3/module.graphic.tiff.php
   plog/trunk/imgs/admin/icon_archive-16.png
   plog/trunk/imgs/admin/icon_home-24.png
   plog/trunk/styles/admin-rtl.css
   plog/trunk/styles/summary-rtl.css
   plog/trunk/templates/summary/rss/blogs_atom.template
   plog/trunk/templates/summary/rss/blogs_rss090.template
   plog/trunk/templates/summary/rss/blogs_rss10.template
   plog/trunk/templates/summary/rss/blogs_rss20.template
Removed:
   plog/trunk/js/ie7/
Modified:
   plog/trunk/.htaccess
   plog/trunk/class/action/addcommentaction.class.php
   plog/trunk/class/action/admin/adminaction.class.php
   plog/trunk/class/action/admin/adminaddarticlecategoryaction.class.php
   plog/trunk/class/action/admin/adminaddblogaction.class.php
   plog/trunk/class/action/admin/adminaddbloguseraction.class.php
   plog/trunk/class/action/admin/adminaddcustomfieldaction.class.php
   plog/trunk/class/action/admin/adminaddlinkaction.class.php
   plog/trunk/class/action/admin/adminaddlinkcategoryaction.class.php
   plog/trunk/class/action/admin/adminaddpostaction.class.php
   plog/trunk/class/action/admin/adminaddresourceaction.class.php
   plog/trunk/class/action/admin/adminaddresourcealbumaction.class.php
   plog/trunk/class/action/admin/adminadduseraction.class.php
   plog/trunk/class/action/admin/adminloginaction.class.php
   plog/trunk/class/action/admin/adminpostmanagementcommonaction.class.php
   plog/trunk/class/action/admin/adminregeneratepreviewaction.class.php
   plog/trunk/class/action/admin/adminresourcesaction.class.php
   plog/trunk/class/action/admin/adminsendtrackbacksaction.class.php
   plog/trunk/class/action/admin/adminupdatearticlecategoryaction.class.php
   plog/trunk/class/action/admin/adminupdateblogsettingsaction.class.php
   plog/trunk/class/action/admin/adminupdatecustomfieldaction.class.php
   plog/trunk/class/action/admin/adminupdateeditblogaction.class.php
   plog/trunk/class/action/admin/adminupdatelinkaction.class.php
   plog/trunk/class/action/admin/adminupdatelinkcategoryaction.class.php
   plog/trunk/class/action/admin/adminupdatepostaction.class.php
   plog/trunk/class/action/admin/adminupdateresourceaction.class.php
   plog/trunk/class/action/admin/adminupdateresourcealbumaction.class.php
   plog/trunk/class/action/admin/adminupdateuserprofileaction.class.php
   plog/trunk/class/action/admin/adminupdateusersettingsaction.class.php
   plog/trunk/class/action/admin/adminuserprofileaction.class.php
   plog/trunk/class/action/admin/adminxmlsavedraftaction.class.php
   plog/trunk/class/action/commentaction.class.php
   plog/trunk/class/action/defaultaction.class.php
   plog/trunk/class/action/resourceserveraction.class.php
   plog/trunk/class/action/viewarticleaction.class.php
   plog/trunk/class/action/viewresourceaction.class.php
   plog/trunk/class/dao/model.class.php
   plog/trunk/class/dao/trackbackclient.class.php
   plog/trunk/class/data/kses.class.php
   plog/trunk/class/data/textfilter.class.php
   plog/trunk/class/data/validator/httpurlvalidator.class.php
   plog/trunk/class/data/validator/rules/urlformatrule.class.php
   plog/trunk/class/database/adodb/drivers/adodb-mysql.inc.php
   plog/trunk/class/gallery/dao/galleryresourcequotas.class.php
   plog/trunk/class/gallery/getid3/getid3.lib.php
   plog/trunk/class/gallery/getid3/getid3.php
   plog/trunk/class/gallery/getid3/module.archive.rar.php
   plog/trunk/class/gallery/getid3/module.archive.szip.php
   plog/trunk/class/gallery/getid3/module.archive.zip.php
   plog/trunk/class/gallery/getid3/module.audio-video.asf.php
   plog/trunk/class/gallery/getid3/module.audio-video.bink.php
   plog/trunk/class/gallery/getid3/module.audio-video.matroska.php
   plog/trunk/class/gallery/getid3/module.audio-video.mpeg.php
   plog/trunk/class/gallery/getid3/module.audio-video.nsv.php
   plog/trunk/class/gallery/getid3/module.audio-video.quicktime.php
   plog/trunk/class/gallery/getid3/module.audio-video.real.php
   plog/trunk/class/gallery/getid3/module.audio-video.riff.php
   plog/trunk/class/gallery/getid3/module.audio-video.swf.php
   plog/trunk/class/gallery/getid3/module.audio.aac.php
   plog/trunk/class/gallery/getid3/module.audio.ac3.php
   plog/trunk/class/gallery/getid3/module.audio.au.php
   plog/trunk/class/gallery/getid3/module.audio.avr.php
   plog/trunk/class/gallery/getid3/module.audio.bonk.php
   plog/trunk/class/gallery/getid3/module.audio.flac.php
   plog/trunk/class/gallery/getid3/module.audio.la.php
   plog/trunk/class/gallery/getid3/module.audio.lpac.php
   plog/trunk/class/gallery/getid3/module.audio.midi.php
   plog/trunk/class/gallery/getid3/module.audio.mod.php
   plog/trunk/class/gallery/getid3/module.audio.monkey.php
   plog/trunk/class/gallery/getid3/module.audio.mp3.php
   plog/trunk/class/gallery/getid3/module.audio.mpc.php
   plog/trunk/class/gallery/getid3/module.audio.ogg.php
   plog/trunk/class/gallery/getid3/module.audio.optimfrog.php
   plog/trunk/class/gallery/getid3/module.audio.rkau.php
   plog/trunk/class/gallery/getid3/module.audio.shorten.php
   plog/trunk/class/gallery/getid3/module.audio.tta.php
   plog/trunk/class/gallery/getid3/module.audio.voc.php
   plog/trunk/class/gallery/getid3/module.audio.vqf.php
   plog/trunk/class/gallery/getid3/module.graphic.bmp.php
   plog/trunk/class/gallery/getid3/module.graphic.gif.php
   plog/trunk/class/gallery/getid3/module.graphic.jpg.php
   plog/trunk/class/gallery/getid3/module.graphic.pcd.php
   plog/trunk/class/gallery/getid3/module.graphic.png.php
   plog/trunk/class/gallery/getid3/module.misc.exe.php
   plog/trunk/class/gallery/getid3/module.misc.iso.php
   plog/trunk/class/gallery/getid3/module.tag.apetag.php
   plog/trunk/class/gallery/getid3/module.tag.id3v1.php
   plog/trunk/class/gallery/getid3/module.tag.id3v2.php
   plog/trunk/class/gallery/getid3/module.tag.lyrics3.php
   plog/trunk/class/locale/locale.class.php
   plog/trunk/class/logger/logger/loggedmessage.class.php
   plog/trunk/class/net/customrequestgenerator.class.php
   plog/trunk/class/net/http/httpcache.class.php
   plog/trunk/class/net/http/session/sessionmanager.class.php
   plog/trunk/class/plugin/pluginbase.class.php
   plog/trunk/class/summary/action/summaryrssaction.class.php
   plog/trunk/class/summary/dao/summarystats.class.php
   plog/trunk/class/summary/view/summarycachedview.class.php
   plog/trunk/class/summary/view/summaryrssview.class.php
   plog/trunk/class/template/template.class.php
   plog/trunk/class/view/resourceserverview.class.php
   plog/trunk/class/view/smartyview.class.php
   plog/trunk/class/view/view.class.php
   plog/trunk/config/config.properties.php
   plog/trunk/locale/locale_ca_ES.php
   plog/trunk/locale/locale_de_DE.php
   plog/trunk/locale/locale_en_UK.php
   plog/trunk/locale/locale_es_ES.php
   plog/trunk/locale/locale_fi_FI.php
   plog/trunk/locale/locale_fr_FR.php
   plog/trunk/locale/locale_it_IT.php
   plog/trunk/locale/locale_nb_NO.php
   plog/trunk/locale/locale_pt_BR.php
   plog/trunk/locale/locale_zh_CN.php
   plog/trunk/locale/locale_zh_TW.php
   plog/trunk/locale/unsupport/locale_zh_CN_gb2312.php
   plog/trunk/locale/unsupport/locale_zh_TW_big5.php
   plog/trunk/templates/admin/createuser.template
   plog/trunk/templates/admin/editlinks.template
   plog/trunk/templates/admin/editpost.template
   plog/trunk/templates/admin/header.template
   plog/trunk/templates/admin/newlink.template
   plog/trunk/templates/admin/newpost.template
   plog/trunk/templates/admin/poststats.template
   plog/trunk/templates/admin/resourceinfo.template
   plog/trunk/templates/admin/sendtrackbacks.template
   plog/trunk/templates/admin/simpleheader.template
   plog/trunk/templates/admin/statistics.template
   plog/trunk/templates/admin/userprofile.template
   plog/trunk/templates/admin/usersettings.template
   plog/trunk/templates/blueish/post.template
   plog/trunk/templates/blueish/postandcomments.template
   plog/trunk/templates/grey-sf/post.template
   plog/trunk/templates/grey-sf/postandcomments.template
   plog/trunk/templates/grey/post.template
   plog/trunk/templates/grey/postandcomments.template
   plog/trunk/templates/plogworld/post.template
   plog/trunk/templates/plogworld/postandcomments.template
   plog/trunk/templates/rss/atom.template
   plog/trunk/templates/standard-with-plugins/post.template
   plog/trunk/templates/standard-with-plugins/postandcomments.template
   plog/trunk/templates/standard/post.template
   plog/trunk/templates/standard/postandcomments.template
   plog/trunk/templates/summary/header.template
   plog/trunk/templates/summary/index.template
   plog/trunk/templates/summary/rss/atom.template
   plog/trunk/templates/summary/rss/rss20.template
   plog/trunk/wizard.php
Log:
merging 1.0.2 changes, revs 2075 through 2357.  There are definitely some problems in the /class/dao/ folder, but I want to get everything committed before I go back to check - you really don't want to get this version.  (I only did half a merge so far because svn is having trouble with revision 2358.  I am hoping by committing the changes so far it will figure out what to do correctly

Modified: plog/trunk/.htaccess
===================================================================
--- plog/trunk/.htaccess	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/.htaccess	2005-09-19 01:34:39 UTC (rev 2479)
@@ -53,9 +53,9 @@
 RewriteRule ^([0-9]+)_[^/]+/(.+)$ index.php?op=Template&blogId=$1&show=$2 [NC]
 
 # A non-default blog (i.e. /plog/88_userfoo)
-RewriteRule ^([0-9]+)_[^/]+$ index.php?blogId=$1 [L,NC]
+RewriteRule ^([0-9]+)(_[^/]+)?$ index.php?blogId=$1 [L,NC]
 
-# Daly archive (i.e. /plog/1_userfoo/archive/20040101.html)
+# Daily archive (i.e. /plog/1_userfoo/archive/20040101.html)
 RewriteRule ^([0-9]+)_[^/]+/archive/([0-9]{8})\.html$ index.php?blogId=$1&Date=$2 [L,NC]
 
 </IfModule>
@@ -110,9 +110,9 @@
  ForceType application/x-httpd-php
 </Files>
 
-ErrorDocument 401 /plog-1.0.1/error.php
-ErrorDocument 403 /plog-1.0.1/error.php
-ErrorDocument 404 /plog-1.0.1/error.php
+ErrorDocument 401 /plog/error.php
+ErrorDocument 403 /plog/error.php
+ErrorDocument 404 /plog/error.php
 
 
 

Modified: plog/trunk/class/action/addcommentaction.class.php
===================================================================
--- plog/trunk/class/action/addcommentaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/addcommentaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -8,9 +8,13 @@
     include_once( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
     include_once( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
     include_once( PLOG_CLASS_PATH."class/data/validator/emailvalidator.class.php" );
+    include_once( PLOG_CLASS_PATH."class/data/validator/httpurlvalidator.class.php" );    
+    include_once( PLOG_CLASS_PATH."class/net/client.class.php" );
+    include_once( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
     include_once( PLOG_CLASS_PATH."class/view/errorview.class.php" );
     include_once( PLOG_CLASS_PATH."class/bayesian/bayesianfiltercore.class.php" );
 	include_once( PLOG_CLASS_PATH."class/template/cachecontrol.class.php" );
+	include_once( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
 
     /**
      * \ingroup Action
@@ -51,7 +55,9 @@
 			$this->registerFieldValidator( "userName", new StringValidator());
 			$this->_form->setFieldErrorMessage( "userName", $this->_locale->tr("error_comment_without_name" ));
 			$this->registerFieldValidator( "commentText", new StringValidator());
-			$this->_form->setFieldErrorMessage( "commentText", $this->_locale->tr("error_comment_without_text" ));
+			$this->_form->setFieldErrorMessage( "commentText", $this->_locale->tr("error_comment_without_text"));
+			$this->registerFieldValidator( "userUrl", new HttpUrlValidator(), true );
+			$this->_form->setFieldErrorMessage( "userUrl", $this->_locale->tr("Invalid URL" ));
 			$view = new ErrorView( $this->_blogInfo );
 			$view->setErrorMessage( "There has been an error validating the data!" );
 			$this->setValidationErrorView( $view );
@@ -69,16 +75,16 @@
             $this->_parentId  = $this->_request->getValue( "parentId" );
             if( $this->_parentId == null || $this->_parentId == "" )
                 $this->_parentId = 0;
-            $this->_userEmail = trim($this->_request->getValue( "userEmail" ));
-            $this->_userUrl   = trim($this->_request->getValue( "userUrl" ));
+            $this->_userEmail = Textfilter::filterAllHTML($this->_request->getValue( "userEmail" ));
+            $this->_userUrl   = Textfilter::filterAllHTML($this->_request->getValue( "userUrl" ));
             if( (strlen($this->_userUrl) != 0) &&
                   (substr($this->_userUrl, 0, 7 ) != "http://" )){
                 $this->_userUrl = "http://".$this->_userUrl;
             }
-            $this->_userName  = trim($this->_request->getValue( "userName" ));
+            $this->_userName  = Textfilter::filterAllHTML($this->_request->getValue( "userName" ));
             $this->_commentText = trim($this->_request->getValue( "commentText" ));
             $this->_commentTopic = trim($this->_request->getValue( "commentTopic" ));
-            // remove all straneous stuff from the text and topic
+            // remove all weird stuff from the text and topic
             $tf = new TextFilter();
             $this->_commentTopic = $tf->xhtmlize($tf->filterHTML( $this->_commentTopic ));
             // and also from the text

Modified: plog/trunk/class/action/admin/adminaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -8,6 +8,7 @@
 	include_once( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );
 	include_once( PLOG_CLASS_PATH."class/template/cachecontrol.class.php" );
 	include_once( PLOG_CLASS_PATH."class/view/admin/admindefaultview.class.php" );
+	include_once( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
 
     /**
      * \ingroup Action
@@ -33,6 +34,7 @@
         var $_config;
         var $_locale;
 		var $_pm;
+		var $_userBlogs;
 
         /**
          * Constructor.
@@ -75,6 +77,9 @@
 			
 			// fetch the site locale
             $this->_locale =& $this->getLocale();
+
+			$users =& new Users();
+            $this->_userBlogs = $users->getUsersBlogs( $this->_userInfo->getId(), BLOG_STATUS_ACTIVE );            
         }
 
         /**
@@ -140,6 +145,7 @@
 			$this->_pm->getPlugins();			
 			
         	$this->_view->setValue( "user", $this->_userInfo );
+        	$this->_view->setValue( "userBlogs", $this->_userBlogs);
 			$this->_view->setUserInfo( $this->_userInfo );
             $this->_view->setValue( "blog", $this->_blogInfo );
             if( $this->_blogInfo )

Modified: plog/trunk/class/action/admin/adminaddarticlecategoryaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddarticlecategoryaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminaddarticlecategoryaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -47,10 +47,10 @@
         function perform()
         {
 			// fetch the data, we already know it's valid and that we can trust it!
-        	$this->_categoryName     = $this->_request->getValue( "categoryName" );
+        	$this->_categoryName     = Textfilter::filterAllHTML($this->_request->getValue( "categoryName" ));
             $this->_categoryUrl      = $this->_request->getValue( "categoryUrl" );
             $this->_categoryInMainPage = Textfilter::checkboxToBoolean($this->_request->getValue( "categoryInMainPage" ));
-			$this->_categoryDescription = $this->_request->getValue( "categoryDescription" );
+			$this->_categoryDescription = Textfilter::filterAllHTML($this->_request->getValue( "categoryDescription" ));
 			$this->_properties = $this->_request->getValue( "properties" );		
 		
 			// create the object...

Modified: plog/trunk/class/action/admin/adminaddblogaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddblogaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminaddblogaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -35,7 +35,7 @@
         function perform()
         {
 	        // fetch the validated data
-        	$this->_blogName = $this->_request->getValue( "blogName" );
+        	$this->_blogName = Textfilter::filterAllHTML($this->_request->getValue( "blogName" ));
             $this->_ownerId  = $this->_request->getValue( "blogOwner" );
 			$this->_blogProperties = $this->_request->getValue( "properties" );	        
 			

Modified: plog/trunk/class/action/admin/adminaddbloguseraction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddbloguseraction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminaddbloguseraction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -59,7 +59,7 @@
         function perform()
         {
             $this->_notificationText = $this->_request->getValue( "newBlogUserText" );
-        	$this->_newUsername = $this->_request->getValue( "newBlogUserName" );				
+        	$this->_newUsername = Textfilter::filterAllHTML($this->_request->getValue( "newBlogUserName" ));
 		
         	// see if the user exists
             $users = new Users();

Modified: plog/trunk/class/action/admin/adminaddcustomfieldaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddcustomfieldaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminaddcustomfieldaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -43,8 +43,8 @@
         function perform()
         {
 			// fetch the data
-			$this->_fieldName = $this->_request->getValue( "fieldName" );
-			$this->_fieldDescription = $this->_request->getValue( "fieldDescription" ); 
+			$this->_fieldName = Textfilter::filterAllHTML($this->_request->getValue( "fieldName" ));
+			$this->_fieldDescription = Textfilter::filterAllHTML($this->_request->getValue( "fieldDescription" ));
 			$this->_fieldType = $this->_request->getValue( "fieldType" );
 			$this->_fieldSearchable = (int)($this->_request->getValue( "fieldSearchable" ) != "" );
 			$this->_fieldHidden = (int)($this->_request->getValue( "fieldHidden" ) != "" );

Modified: plog/trunk/class/action/admin/adminaddlinkaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddlinkaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminaddlinkaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -51,11 +51,11 @@
         function perform()
         {
 			// fetch the data
-            $this->_linkName = $this->_request->getValue( "linkName" );
-            $this->_linkUrl  = $this->_request->getValue( "linkUrl" );
+            $this->_linkName = Textfilter::filterAllHTML($this->_request->getValue( "linkName" ));
+            $this->_linkUrl  = Textfilter::filterAllHTML($this->_request->getValue( "linkUrl" ));
             $this->_linkCategoryId = $this->_request->getValue( "linkCategoryId" );
-            $this->_linkDescription = $this->_request->getValue( "linkDescription" );
-			$this->_linkRss = $this->_request->getValue( "linkRssFeed" );
+            $this->_linkDescription = Textfilter::filterAllHTML($this->_request->getValue( "linkDescription" ));
+			$this->_linkRss = Textfilter::filterAllHTML($this->_request->getValue( "linkRssFeed" ));
 			$this->_properties = Array();
 			
             // adds the new link to the database

Modified: plog/trunk/class/action/admin/adminaddlinkcategoryaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddlinkcategoryaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminaddlinkcategoryaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -38,7 +38,7 @@
         function perform()
         {
         	// add the new link category to the database
-			$this->_linkCategoryName = $this->_request->getValue( "linkCategoryName" );
+			$this->_linkCategoryName = Textfilter::filterAllHTML($this->_request->getValue( "linkCategoryName" ));
             $mylinksCategories = new MyLinksCategories();
             $mylinksCategory = new MyLinksCategory( $this->_linkCategoryName, 
 			                                        $this->_blogInfo->getId(), 

Modified: plog/trunk/class/action/admin/adminaddpostaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddpostaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminaddpostaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -44,6 +44,7 @@
         	$this->registerField( "commentsEnabled" );
         	$this->registerField( "customField" );
         	$this->registerField( "postDateTime" );
+        	$this->registerField( "trackbackUrls" );        	
         }
 
 		/**
@@ -154,16 +155,26 @@
                         include_once( PLOG_CLASS_PATH."class/data/stringutils.class.php" );
 
                     	// get the links from the text of the post
-        				$links = StringUtils::getLinks( stripslashes($article->getText()));
+        				$postLinks = StringUtils::getLinks( stripslashes($article->getText()));
 
+		                // get the real trackback links from trackbackUrls
+		                $trackbackLinks = Array();
+		                foreach(explode( "\r\n", $this->_trackbackUrls ) as $host ) {
+		                	trim($host);
+		                	if( $host != "" && $host != "\r\n" && $host != "\r" && $host != "\n" )
+		                    	array_push( $trackbackLinks, $host );
+		                }
+
         				// if no links, there is nothing to do
-        				if( count($links) == 0 ) {
+        				if( count($postLinks) == 0 && count($trackbackLinks) == 0 ) {
         					$this->_view = new AdminPostsListView( $this->_blogInfo );
+			                $this->_view->setErrorMessage( $this->_locale->tr("error_no_trackback_links_sent"));
         				}
         				else {
             				$this->_view = new AdminTemplatedView( $this->_blogInfo, "sendtrackbacks" );
             				$this->_view->setValue( "post", $article );
-            				$this->_view->setValue( "postlinks", $links );
+            				$this->_view->setValue( "postLinks", $postLinks );
+							$this->_view->setValue( "trackbackLinks", $trackbackLinks );            				
          				}
                     }
                     $this->_view->setSuccessMessage( $message );

Modified: plog/trunk/class/action/admin/adminaddresourceaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddresourceaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminaddresourceaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -55,7 +55,7 @@
         function perform()
         {
         	// fetch the information coming from the resource
-        	$this->_description = $this->_request->getValue( "resourceDescription" );
+        	$this->_description = Textfilter::filterAllHTML($this->_request->getValue( "resourceDescription" ));
             $this->_albumId     = $this->_request->getValue( "albumId" );
             $this->_resource    = $this->_request->getValue( "resourceFile" );
             $this->_destination = $this->_request->getValue( "destination" );

Modified: plog/trunk/class/action/admin/adminaddresourcealbumaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddresourcealbumaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminaddresourcealbumaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -43,8 +43,8 @@
         function perform()
         {
 			// fetch our data
-        	$this->_albumName = $this->_request->getValue( "albumName" );
-            $this->_albumDescription = $this->_request->getValue( "albumDescription" );
+        	$this->_albumName = Textfilter::filterAllHTML($this->_request->getValue( "albumName" ));
+            $this->_albumDescription = Textfilter::filterAllHTML($this->_request->getValue( "albumDescription" ));
             $this->_parentId = $this->_request->getValue( "parentId" );			
 			
 			// create the album

Modified: plog/trunk/class/action/admin/adminadduseraction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminadduseraction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminadduseraction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -33,7 +33,7 @@
         	
         	// for data validation purposes
         	$this->registerFieldValidator( "userName", new StringValidator());
-        	$this->registerFieldValidator( "userPassword", new PasswordValidator());
+        	$this->registerFieldValidator( "newUserPassword", new PasswordValidator());
         	$this->registerFieldValidator( "userEmail", new EmailValidator());
 			$this->registerFieldValidator( "userStatus", new IntegerValidator());
         	$this->registerField( "userFullName" );
@@ -45,10 +45,10 @@
         function perform()
         {
 	        // fetch the validated data
-        	$this->_userName = $this->_request->getValue( "userName" );
-            $this->_userPassword = $this->_request->getValue( "userPassword" );
-            $this->_userEmail = $this->_request->getValue( "userEmail" );
-            $this->_userFullName = $this->_request->getValue( "userFullName" );
+        	$this->_userName = Textfilter::filterAllHTML($this->_request->getValue( "userName" ));
+            $this->_userPassword = $this->_request->getValue( "newUserPassword" );
+            $this->_userEmail = Textfilter::filterAllHTML($this->_request->getValue( "userEmail" ));
+            $this->_userFullName = Textfilter::filterAllHTML($this->_request->getValue( "userFullName" ));
 			$this->_userStatus = $this->_request->getValue( "userStatus" );
 			$this->_userBlog = $this->_request->getValue( "userBlog" );
 	        

Modified: plog/trunk/class/action/admin/adminloginaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminloginaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminloginaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -52,9 +52,9 @@
         function perform()
         {
         	// get the parameters, which have already been validated
-            $this->_userName     = $this->_request->getValue( "userName" );
+            $this->_userName     = Textfilter::filterAllHTML($this->_request->getValue( "userName" ));
             $this->_userPassword = $this->_request->getValue( "userPassword" );
-            $this->_op           = $this->_request->getValue( "op" );
+            $this->_op           = Textfilter::filterAllHTML($this->_request->getValue( "op" ));
 
 		// create a plugin manager
 			$pm =& PluginManager::getPluginManager();	
@@ -92,7 +92,7 @@
             HttpVars::setSession( $session );
 
             // get the list of blogs to which the user belongs
-            $userBlogs = $users->getUsersBlogs( $userInfo->getId());
+            $userBlogs = $users->getUsersBlogs( $userInfo->getId(), BLOG_STATUS_ACTIVE );
 
             // but if he or she does not belong to any yet, we quit
             if( empty($userBlogs)) {

Modified: plog/trunk/class/action/admin/adminpostmanagementcommonaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminpostmanagementcommonaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminpostmanagementcommonaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -30,6 +30,7 @@
         var $_addPost;
         var $_commentsEnabled;
         var $_globalCategoryId;
+        var $_trackbackUrls;
         // stuff about the date
         var $_postYear;
         var $_postMonth;
@@ -122,9 +123,9 @@
 		{
         	$this->_postText     = trim(Textfilter::xhtmlize($this->_request->getValue( "postText" )));
             $this->_postExtendedText = trim(Textfilter::xhtmlize($this->_request->getValue( "postExtendedText" )));
-            $this->_postTopic    = $this->_request->getValue( "postTopic" );
+            $this->_postTopic    = trim(Textfilter::filterAllHTML($this->_request->getValue( "postTopic" )));
             $this->_postCategories = $this->_request->getValue( "postCategories" );
-			$this->_postSlug = $this->_request->getValue( "postSlug" );			
+			$this->_postSlug = trim(Textfilter::filterAllHTML($this->_request->getValue( "postSlug" )));
             $this->_postStatus   = $this->_request->getValue( "postStatus" );
             $this->_sendNotification = $this->_request->getValue( "sendNotification" );
             $this->_sendTrackbacks = $this->_request->getValue( "sendTrackbacks" );
@@ -132,6 +133,7 @@
             $this->_postId       = $this->_request->getValue( "postId" );
             $this->_commentsEnabled = $this->_request->getValue( "commentsEnabled" );
             $this->_globalArticleCategoryId = $this->_request->getValue( "globalArticleCategoryId" );
+            $this->_trackbackUrls = $this->_request->getValue( "trackbackUrls" );
 				
 			// fetch the custom fields
 			$this->_customFields = $this->_request->getValue( "customField" );	

Modified: plog/trunk/class/action/admin/adminregeneratepreviewaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminregeneratepreviewaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminregeneratepreviewaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -1,93 +1,112 @@
 <?php
 
-	include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
-	include_once( PLOG_CLASS_PATH."class/view/admin/adminresourceslistview.class.php" );
-	include_once( PLOG_CLASS_PATH."class/view/admin/admineditresourceview.class.php" );
-	include_once( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
-	include_once( PLOG_CLASS_PATH."class/gallery/resizers/galleryresizer.class.php" );
-	include_once( PLOG_CLASS_PATH."class/gallery/dao/galleryresources.class.php" );
-	include_once( PLOG_CLASS_PATH."class/gallery/dao/galleryresourcestorage.class.php" );
+include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
+include_once( PLOG_CLASS_PATH."class/view/admin/adminresourceslistview.class.php" );
+include_once( PLOG_CLASS_PATH."class/view/admin/admineditresourceview.class.php" );
+include_once( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
+include_once( PLOG_CLASS_PATH."class/gallery/resizers/galleryresizer.class.php" );
+include_once( PLOG_CLASS_PATH."class/gallery/dao/galleryresources.class.php" );
+include_once( PLOG_CLASS_PATH."class/gallery/dao/galleryresourcestorage.class.php" );
 
     /**
      * \ingroup Action
      * @private
-     */	
-	class AdminRegeneratePreviewAction extends AdminAction
-	{
-		
-		var $_resourceId;
-		
-		function AdminRegeneratePreviewAction( $actionInfo, $request )
-        {
-        	$this->AdminAction( $actionInfo, $request );
+     */ 
+class AdminRegeneratePreviewAction extends AdminAction
+{
+        
+    var $_resourceId;
+        
+    function AdminRegeneratePreviewAction( $actionInfo, $request ){
+        $this->AdminAction( $actionInfo, $request );
+            
+        $this->registerFieldValidator( "resourceId", new IntegerValidator());
+        $view = new AdminResourcesListView( $this->_blogInfo );
+        $view->setErrorMessage( $this->_locale->tr("error_loading_resource"));
+        $this->setValidationErrorView( $view );
+    }
+        
+	function perform(){
+            // first of all, fetch the resource
+        $this->_resourceId = $this->_request->getValue( "resourceId" );
+        $resources = new GalleryResources();
+        $resource = $resources->getResource( $this->_resourceId, $this->_blogInfo->getId());
+            
+            // check if it was loaded ok
+        if( !$resource ) {
+            $this->_view = new AdminResourcesListView( $this->_blogInfo );
+            $this->_view->setErrorMessage( $this->_locale->tr("error_loading_resource"));
+            $this->setCommonData();
+                
+            return false;
+        }
+            
+            // if so, continue... first by checking if the resource is an image or not
+            // because if not, then there is no point in generating a thumbnail of it!
+        if( !$resource->isImage()) {
+            $this->_view = new AdminResourcesListView( $this->_blogInfo );
+            $this->_view->setErrorMessage( $this->_locale->tr("error_resource_is_not_an_image" ));
+        }
+            
+            
+        $previewHeight = $this->_config->getValue( "thumbnail_height" );
+        $previewWidth  = $this->_config->getValue( "thumbnail_width" );
+        $previewKeepAspectRatio = $this->_config->getValue( "thumbnails_keep_aspect_ratio" );
 
-		$this->registerFieldValidator( "resourceId", new IntegerValidator());
-		$view = new AdminResourcesListView( $this->_blogInfo );
-		$view->setErrorMessage( $this->_locale->tr("error_loading_resource"));
-		$this->setValidationErrorView( $view );
+            // build the filename
+        $fileNameParts = explode( ".", $resource->getFileName());
+        $fileExt = strtolower($fileNameParts[count($fileNameParts)-1]);
+        $fileName = $resource->getOwnerId()."-".$resource->getId().".".$fileExt;
+
+            // and start the resizing process
+        $resourceStorage = new GalleryResourceStorage();
+        $resizer = new GalleryResizer( $resourceStorage->getResourcePath( $resource ));
+        $resourceStorage->checkPreviewsStorageFolder( $resource->getOwnerId());
+        $outFile = $resourceStorage->getPreviewsFolder( $resource->getOwnerId()).$fileName;
+            
+            // and finally, we can generate the preview!
+        $result = $resizer->generate( $outFile, $previewHeight, $previewWidth, $previewKeepAspectRatio );
+            
+        $previewFormat = $resizer->getThumbnailFormat();
+        $resource->setThumbnailFormat( $previewFormat );
+        $resources->updateResource( $resource );
+            
+        if( !$result ) {
+            $this->_view = new AdminResourcesListView( $this->_blogInfo );
+            $this->_view->setErrorMessage( $this->_locale->tr("error_generating_resource_preview" ));
         }
-		
-		function perform()
-		{
-			// first of all, fetch the resource
-			$this->_resourceId = $this->_request->getValue( "resourceId" );
-			$resources = new GalleryResources();
-			$resource = $resources->getResource( $this->_resourceId, $this->_blogInfo->getId());
-			
-			// check if it was loaded ok
-			if( !$resource ) {
-				$this->_view = new AdminResourcesListView( $this->_blogInfo );
-				$this->_view->setErrorMessage( $this->_locale->tr("error_loading_resource"));
-				$this->setCommonData();
-				
-				return false;
-			}
-			
-			// if so, continue... first by checking if the resource is an image or not
-			// because if not, then there is no point in generating a thumbnail of it!
-			if( !$resource->isImage()) {
-				$this->_view = new AdminResourcesListView( $this->_blogInfo );
-				$this->_view->setErrorMessage( $this->_locale->tr("error_resource_is_not_an_image" ));
-			}
-			
-			
-			$previewHeight = $this->_config->getValue( "thumbnail_height" );
-			$previewWidth  = $this->_config->getValue( "thumbnail_width" );
-			$previewKeepAspectRatio = $this->_config->getValue( "thumbnails_keep_aspect_ratio" );
+        else {
+            $previewHeight = $this->_config->getValue( "medium_size_thumbnail_height" );
+            $previewWidth  = $this->_config->getValue( "medium_size_thumbnail_width" );
+            
+                // and start the resizing process
+            $resourceStorage = new GalleryResourceStorage();
+            $resizer = new GalleryResizer( $resourceStorage->getResourcePath( $resource ));
+            $resourceStorage->checkMediumSizePreviewsStorageFolder( $resource->getOwnerId());
+            $outFile = $resourceStorage->getMediumSizePreviewsFolder( $resource->getOwnerId()).$fileName;
+            
+                // and finally, we can generate the preview!
+            $result = $resizer->generate( $outFile, $previewHeight, $previewWidth, $previewKeepAspectRatio );
+            
+            $previewFormat = $resizer->getThumbnailFormat();
+            $resource->setThumbnailFormat( $previewFormat );
+            $resources->updateResource( $resource );
 
-			// build the filename
-			$fileNameParts = explode( ".", $resource->getFileName());
-			$fileExt = strtolower($fileNameParts[count($fileNameParts)-1]);
-			$fileName = $resource->getOwnerId()."-".$resource->getId().".".$fileExt;
-
-	            // and start the resizing process
-			$resourceStorage = new GalleryResourceStorage();
-        	    $resizer = new GalleryResizer( $resourceStorage->getResourcePath( $resource ));
-	            $resourceStorage->checkPreviewsStorageFolder( $resource->getOwnerId());
-        	    $outFile = $resourceStorage->getPreviewsFolder( $resource->getOwnerId()).$fileName;
-			
-	            // and finally, we can generate the preview!
-	            $result = $resizer->generate( $outFile, $previewHeight, $previewWidth, $previewKeepAspectRatio );
-			
-			$previewFormat = $resizer->getThumbnailFormat();
-			$resource->setThumbnailFormat( $previewFormat );
-			$resources->updateResource( $resource );
-			
-			if( !$result ) {
-				$this->_view = new AdminResourcesListView( $this->_blogInfo );
-				$this->_view->setErrorMessage( $this->_locale->tr("error_generating_resource_preview" ));
-			}
-			else {
-				$this->_view = new AdminEditResourceView( $this->_blogInfo );
-				$this->_view->setSuccessMessage( $message = $this->_locale->tr("resource_preview_generated_ok" ));
-				$this->_view->setValue( "resourceDescription", $resource->getDescription());
-				$this->_view->setValue( "albumId", $resource->getAlbumId());
-				$this->_view->setValue( "resource", $resource );
-			}
-			
-			$this->setCommonData();
-			
-			return true;
-		}
-	}
+            if( !$result ) {
+                $this->_view = new AdminResourcesListView( $this->_blogInfo );
+                $this->_view->setErrorMessage( $this->_locale->tr("error_generating_resource_medium" ));
+            }
+            else {
+                $this->_view = new AdminEditResourceView( $this->_blogInfo );
+                $this->_view->setSuccessMessage( $message = $this->_locale->tr("resource_preview_generated_ok" ));
+                $this->_view->setValue( "resourceDescription", $resource->getDescription());
+                $this->_view->setValue( "albumId", $resource->getAlbumId());
+                $this->_view->setValue( "resource", $resource );
+            }
+        }
+        $this->setCommonData();
+            
+        return true;
+    }
+}
 ?>
\ No newline at end of file

Modified: plog/trunk/class/action/admin/adminresourcesaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminresourcesaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminresourcesaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -44,7 +44,8 @@
 		// check if the storage folder exists and it is readable
 		if( !GalleryResourceStorage::checkBaseStorageFolder() || 
                     !GalleryResourceStorage::checkUserStorageFolder( $this->_blogInfo->getId()) ||
-                    !GalleryResourceStorage::checkPreviewsStorageFolder( $this->_blogInfo->getId())) {
+                    !GalleryResourceStorage::checkPreviewsStorageFolder( $this->_blogInfo->getId()) ||
+                    !GalleryResourceStorage::checkMediumSizePreviewsStorageFolder( $this->_blogInfo->getId())) {
 			$message = $this->_locale->pr("error_base_storage_folder_missing_or_unreadable", $folders);
 		}
 

Modified: plog/trunk/class/action/admin/adminsendtrackbacksaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminsendtrackbacksaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminsendtrackbacksaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -16,7 +16,8 @@
     class AdminSendTrackbacksAction extends AdminAction 
 	{
 
-    	var $_postLink;
+    	var $_postLinks;
+    	var $_trackbackLinks;
         var $_postId;
         var $_locale;
 
@@ -27,58 +28,99 @@
         function AdminSendTrackbacksAction( $actionInfo, $request )
         {
         	$this->AdminAction( $actionInfo, $request );
-
-		$this->registerFieldValidator( "postId", new IntegerValidator());
-		$this->registerFieldValidator( "postLink", new ArrayValidator());
-		$view = new AdminPostsListView( $this->_blogInfo );
-		$view->setErrorMessage( $this->_locale->tr("error_no_trackback_links_sent"));
-		$this->setValidationErrorView( $view );
         }
 
-	/*
+		function validate()
+		{
+			// fetch the validated data
+			$this->_postLinks = $this->_request->getValue( "postLink" );
+			$this->_trackbackLinks = $this->_request->getValue( "trackbackLink" );
+			$this->_postId = $this->_request->getValue( "postId" );
+			
+			$intval = new IntegerValidator();
+			if( !$intval->validate( $this->_postId ) ) {
+                $this->_view = new AdminPostsListView( $this->_blogInfo );
+                $this->_view->setErrorMessage( $this->_locale->tr("error_incorrect_article_id"));
+                $this->setCommonData();
+
+                return false;				
+			}
+			
+			$arrryval = new ArrayValidator();
+			if( !$arrryval->validate( $this->_postLinks ) && !$arrryval->validate( $this->_trackbackLinks ) ) {
+                $this->_view = new AdminPostsListView( $this->_blogInfo );
+                $this->_view->setErrorMessage( $this->_locale->tr("error_no_trackback_links_sent"));
+                $this->setCommonData();
+
+                return false;
+            }   
+			
+			return true;
+		}        
+
+		/*
          * Carries out the specified action
          */
         function perform()
         {
-		// fetch the validated data
-		$this->_trackbacks = $this->_request->getValue( "postLink" );
-		$this->_postId = $this->_request->getValue( "postId" );
-
             // we need to have the post
             $articles = new Articles();
             $post     = $articles->getBlogArticle( $this->_postId, $this->_blogInfo->getId());
-            // and now start sending the trackback pings
-            $tbClient = new TrackbackClient();
-            $results = $tbClient->sendTrackbacks( $this->_trackbacks, $post, $this->_blogInfo);
+            
             // now check the results and give the user the possiblity to retry again with the
             // ones that had some problem.
             $errors = false;
 
-            $trackbackLinks = Array();
-            foreach( $results as $result ) {
-            	if( $result["status"] == TRACKBACK_FAILED) {
-                	// add them again to the list of hosts
-                    $errors = true;
-                    array_push( $trackbackLinks, $result["url"] );
-                }
-                else if( $result["status"] == TRACKBACK_SUCCESS ) {
-                	if( $message == "" ) $message = $this->_locale->tr("trackbacks_sent_ok")."<br/><br/>";
-                    $message .= "<a href=\"".$result["url"]."\">".$result["url"]."</a><br/>";
-                }
-                else if( $result["status"] == TRACKBACK_UNAVAILABLE ) {
-                    $message .= $this->_locale->tr("trackbacks_no_trackback")."<a href=\"".$result["url"]."\">".$result["url"]."</a><br/>";
-                }
-            }
+            // and now start sending the trackback pings
+            $tbClient = new TrackbackClient();
+            $postLinks = Array();
+            $trackbackLinks = Array();            
+			
+			if ( count($this->_postLinks) != 0 ) {
+	            $autoDiscoverResults = $tbClient->sendTrackbacks( $this->_postLinks, $post, $this->_blogInfo);
 
+	            foreach( $autoDiscoverResults as $result ) {
+	            	if( $autoDiscoverResults["status"] == TRACKBACK_FAILED) {
+	                	// add them again to the list of hosts
+	                    $errors = true;
+	                    array_push( $postLinks, $result["url"] );
+	                }
+	                else if( $result["status"] == TRACKBACK_SUCCESS ) {
+	                	if( $message == "" ) $message = $this->_locale->tr("trackbacks_sent_ok")."<br/><br/>";
+	                    $message .= "<a href=\"".$result["url"]."\">".$result["url"]."</a><br/>";
+	                }
+	                else if( $result["status"] == TRACKBACK_UNAVAILABLE ) {
+	                    $message .= $this->_locale->tr("trackbacks_no_trackback")."<a href=\"".$result["url"]."\">".$result["url"]."</a><br/>";
+	                }
+	            }
+	        }
+
+			if ( count($this->_trackbackLinks) != 0 ) {
+	            $directPingResults = $tbClient->sendDirectTrackbacks( $this->_trackbackLinks, $post, $this->_blogInfo);
+	
+	            foreach( $directPingResults as $result ) {
+	            	if( $result["status"] == TRACKBACK_FAILED) {
+	                	// add them again to the list of hosts
+	                    $errors = true;
+	                    array_push( $trackbackLinks, $result["url"] );
+	                }
+	                else if( $result["status"] == TRACKBACK_SUCCESS ) {
+	                	if( $message == "" ) $message = $this->_locale->tr("trackbacks_sent_ok")."<br/><br/>";
+	                    $message .= "<a href=\"".$result["url"]."\">".$result["url"]."</a><br/>";
+	                }
+	            }
+			}
+			
             // if there were errors, we let the user try again
             if( $errors ) {
             	if( $message != "" )
                 	$message .= "<br/>";
             	$message .= $this->_locale->tr("error_sending_trackbacks");
-         	$this->_view = new AdminTemplatedView( $this->_blogInfo, "sendtrackbacks" );
+         		$this->_view = new AdminTemplatedView( $this->_blogInfo, "sendtrackbacks" );
                 $this->_view->setErrorMessage( $message );
                 $this->_view->setValue( "post", $post);
-                $this->_view->setValue( "postlinks", $trackbackLinks );
+                $this->_view->setValue( "postLinks", $postLinks );
+                $this->_view->setValue( "trackbackLinks", $trackbackLinks );
                 $this->setCommonData();
             }
             else {

Modified: plog/trunk/class/action/admin/adminupdatearticlecategoryaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdatearticlecategoryaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminupdatearticlecategoryaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -49,9 +49,9 @@
         function perform()
         {
 			// get the data from the form
-        	$this->_categoryName = $this->_request->getValue( "categoryName" );
+        	$this->_categoryName = Textfilter::filterAllHTML($this->_request->getValue( "categoryName" ));
             $this->_categoryId   = $this->_request->getValue( "categoryId" );
-			$this->_categoryDescription = $this->_request->getValue( "categoryDescription" );
+			$this->_categoryDescription = Textfilter::filterAllHTML($this->_request->getValue( "categoryDescription" ));
             $this->_categoryInMainPage = $this->_request->getValue( "categoryInMainPage" );
 			$this->_properties = Array();		
 		

Modified: plog/trunk/class/action/admin/adminupdateblogsettingsaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdateblogsettingsaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminupdateblogsettingsaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -6,6 +6,7 @@
     include_once( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
 	include_once( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
 	include_once( PLOG_CLASS_PATH."class/view/admin/adminblogsettingsview.class.php" );
+	include_once( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
 	
 
     /**
@@ -71,15 +72,18 @@
            	$blogSettings->setValue( "show_future_posts_in_calendar",  Textfilter::checkboxToBoolean($this->_request->getValue( "blogShowFuturePosts" )));
            	$blogSettings->setValue( "new_drafts_autosave_enabled", Textfilter::checkboxToBoolean($this->_request->getValue( "blogEnableAutosaveDrafts" )));
             $blogSettings->setValue( "comments_order", $this->_request->getValue( "blogCommentsOrder" ));
-            $this->_blogInfo->setAbout( $this->_request->getValue( "blogAbout" ));
-            $this->_blogInfo->setBlog( $this->_request->getValue( "blogName" ));
+            $this->_blogInfo->setAbout( Textfilter::filterAllHTML($this->_request->getValue( "blogAbout" )));
+            $this->_blogInfo->setBlog( Textfilter::filterAllHTML($this->_request->getValue( "blogName" )));
             $this->_blogInfo->setSettings( $blogSettings );
 			$this->_blogInfo->setProperties( $this->_request->getValue( "properties" ));
 			$this->_blogInfo->setBlogCategoryId( $this->_request->getValue( "blogCategory" ));
+			$this->_blogInfo->setMangledBlog( Textfilter::urlize( $this->_blogInfo->getBlog()));
 
             // and now update the settings in the database
             $blogs = new Blogs();
-			$this->notifyEvent( EVENT_PRE_BLOG_UPDATE, Array( "blog" => &$this->_blogInfo ));
+                        
+            // and now we can proceed...
+			$this->notifyEvent( EVENT_PRE_BLOG_UPDATE, Array( "blog" => &$this->_blogInfo ));						
             $blogInfoManager = BlogInfoManager::getBlogInfoManager();
             if( !$blogInfoManager->updateBlogInfo( $this->_blogInfo )) {
             	$this->_view = new AdminBlogSettingsView( $this->_blogInfo );
@@ -90,8 +94,8 @@
             }
 
             // do it again, baby :)))
-            $this->_blogInfo->setAbout( stripslashes($this->_request->getValue( "blogAbout" )));
-            $this->_blogInfo->setBlog( stripslashes($this->_request->getValue( "blogName" )));
+            $this->_blogInfo->setAbout( Textfilter::filterAllHTML(stripslashes($this->_request->getValue( "blogAbout" ))));
+            $this->_blogInfo->setBlog( Textfilter::filterAllHTML(stripslashes($this->_request->getValue( "blogName" ))));
             $this->_blogInfo->setSettings( $blogSettings );
 			$this->_blogInfo->setProperties( $this->_blogProperties );			
             $this->_session->setValue( "blogInfo", $this->_blogInfo );

Modified: plog/trunk/class/action/admin/adminupdatecustomfieldaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdatecustomfieldaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminupdatecustomfieldaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -43,8 +43,8 @@
         {
 			// fetch the fields from the request
 			$this->_fieldId = $this->_request->getValue( "fieldId" );
-			$this->_fieldName = $this->_request->getValue( "fieldName" );
-			$this->_fieldDescription = $this->_request->getValue( "fieldDescription" ); 
+			$this->_fieldName = Textfilter::filterAllHTML($this->_request->getValue( "fieldName" ));
+			$this->_fieldDescription = Textfilter::filterAllHTML($this->_request->getValue( "fieldDescription" )); 
 			$this->_fieldType = $this->_request->getValue( "fieldType" );
 			$this->_fieldSearchable = $this->_request->getValue( "fieldSearchable" );
 			$this->_fieldHidden = $this->_request->getValue( "fieldHidden" );			

Modified: plog/trunk/class/action/admin/adminupdateeditblogaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdateeditblogaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminupdateeditblogaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -58,7 +58,7 @@
         function perform()
         {
             // fetch the values from the form which have already been validated
-            $this->_blogName = $this->_request->getValue( "blogName" );
+            $this->_blogName = Textfilter::filterAllHTML($this->_request->getValue( "blogName" ));
             $this->_blogLocale = $this->_request->getValue( "blogLocale" );
             $this->_blogTemplate = $this->_request->getValue( "blogTemplate" );
             $this->_blogOwner = $this->_request->getValue( "blogOwner" );
@@ -105,8 +105,9 @@
 			$blogInfo->setProperties( $this->_blogProperties );
             $blogInfo->setOwner( $this->_blogOwner );
 			$blogInfo->setStatus( $this->_blogStatus );
-
-            // and now update the settings in the database
+            $blogInfo->setMangledBlog( Textfilter::urlize( $blogInfo->getBlog()));
+       
+            
 			$this->notifyEvent( EVENT_PRE_BLOG_UPDATE, Array( "blog" => &$blogInfo ));
             if( !$blogs->updateBlog( $blogInfo )) {
             	$this->_view = new AdminSiteBlogsListView( $this->_blogInfo );

Modified: plog/trunk/class/action/admin/adminupdatelinkaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdatelinkaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminupdatelinkaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -52,12 +52,12 @@
         function perform()
         {
 			// data is fine, we have already validated it
-        	$this->_linkName = $this->_request->getValue( "linkName" );
-            $this->_linkDescription = $this->_request->getValue( "linkDescription" );
-            $this->_linkUrl  = $this->_request->getValue( "linkUrl" );
+        	$this->_linkName = Textfilter::filterAllHTML($this->_request->getValue( "linkName" ));
+            $this->_linkDescription = Textfilter::filterAllHTML($this->_request->getValue( "linkDescription" ));
+            $this->_linkUrl  = Textfilter::filterAllHTML($this->_request->getValue( "linkUrl" ));
             $this->_linkCategoryId = $this->_request->getValue( "linkCategoryId" );
             $this->_linkId = $this->_request->getValue( "linkId" );
-			$this->_linkFeed = $this->_request->getValue( "linkRssFeed" );			
+			$this->_linkFeed = Textfilter::filterAllHTML($this->_request->getValue( "linkRssFeed" ));
 		
         	// fetch the link we're trying to update
             $links = new MyLinks();

Modified: plog/trunk/class/action/admin/adminupdatelinkcategoryaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdatelinkcategoryaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminupdatelinkcategoryaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -42,7 +42,7 @@
         {
         	// fetch the category we're trying to update
 			$this->_categoryId = $this->_request->getValue( "linkCategoryId" );
-			$this->_categoryName = $this->_request->getValue( "linkCategoryName" );
+			$this->_categoryName = Textfilter::filterAllHTML($this->_request->getValue( "linkCategoryName" ));
             $categories = new MyLinksCategories();
             $category   = $categories->getMyLinksCategory( $this->_categoryId, $this->_blogInfo->getId());
             if( !$category ) {

Modified: plog/trunk/class/action/admin/adminupdatepostaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdatepostaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminupdatepostaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -52,7 +52,8 @@
         	$this->registerField( "postId" );
         	$this->registerField( "commentsEnabled" );
         	$this->registerField( "customField" );
-        	$this->registerField( "postDateTime" );        	
+        	$this->registerField( "postDateTime" );   
+        	$this->registerField( "trackbackUrls" );     	
         }
 
         /**
@@ -141,7 +142,16 @@
 			
 			// if the "send xmlrpc pings" checkbox was enabled, do something about it...
 			if( $post->getStatus() == POST_STATUS_PUBLISHED ) {
-				$links = StringUtils::getLinks( stripslashes($post->getText()));				
+				// get the links from the text of the post
+				$postLinks = StringUtils::getLinks( stripslashes($post->getText()));
+
+                // get the real trackback links from trackbackUrls
+                $trackbackLinks = Array();
+                foreach(explode( "\r\n", $this->_trackbackUrls ) as $host ) {
+                	trim($host);
+                	if( $host != "" && $host != "\r\n" && $host != "\r" && $host != "\n" )
+                    	array_push( $trackbackLinks, $host );
+                }
 				
 				if( $this->_sendPings ) {
 					$message .= "<br/><br/>".$this->sendXmlRpcPings();
@@ -149,14 +159,16 @@
 				// and now check what to do with the trackbacks
 				if( $this->_sendTrackbacks ) {					
 					// if no links, there is nothing to do
-					if( count($links) == 0 ) {
+					if( count($postLinks) == 0 && count($trackbackLinks) == 0 ) {
 						$this->_view = new AdminPostsListView( $this->_blogInfo );
+		                $this->_view->setErrorMessage( $this->_locale->tr("error_no_trackback_links_sent"));
 					}
 					else {
 						$this->_view = new AdminTemplatedView( $this->_blogInfo, "sendtrackbacks" );
 						// get the links from the text of the post
 						$this->_view->setValue( "post", $post );
-						$this->_view->setValue( "postlinks", $links );
+						$this->_view->setValue( "postLinks", $postLinks );
+						$this->_view->setValue( "trackbackLinks", $trackbackLinks );
 					}
 				}
 			}

Modified: plog/trunk/class/action/admin/adminupdateresourceaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdateresourceaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminupdateresourceaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -35,12 +35,13 @@
 			$view = new AdminEditResourceView( $this->_blogInfo );
 			$view->setErrorMessage( $this->_locale->tr("error_updating_resource" ));
 			$this->setValidationErrorView( $view );
+
+                
         }
 		
 		function validate()
 		{
 			if( !parent::validate()) {
-				print("here!!");
 				$resources = new GalleryResources();
 				$resource = $resources->getResource( $this->_request->getValue("resourceId"), $this->_blogInfo->getId());
 				if( !$resource ) {	
@@ -62,7 +63,7 @@
         function perform()
         {
         	// load the resource
-			$this->_resourceDescription = $this->_request->getValue( "resourceDescription" );
+			$this->_resourceDescription = Textfilter::filterAllHTML($this->_request->getValue( "resourceDescription" ));
 			$this->_albumId = $this->_request->getValue( "albumId" );
 			$this->_resourceId = $this->_request->getValue( "resourceId" );
         	$resources = new GalleryResources();
@@ -80,12 +81,17 @@
                 $this->_view->setErrorMessage( $this->_locale->tr("error_updating_resource"));
             }
             else {
-            	$this->_view = new AdminResourcesListView( $this->_blogInfo );
+                    // check which submit button was pressed
+                if($this->_request->getValue("regenerate" ) != ""){
+                    return Controller::setForwardAction( "regeneratePreview" );
+                }
+
+                $this->_view = new AdminResourcesListView( $this->_blogInfo );
                 $this->_view->setSuccessMessage( $this->_locale->pr("resource_updated_ok", $resource->getFileName()));
-				$this->notifyEvent( EVENT_POST_RESOURCE_UPDATE, Array( "resource" => &$resource ));				
-				
-				// clear the cache
-				CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
+                $this->notifyEvent( EVENT_POST_RESOURCE_UPDATE, Array( "resource" => &$resource ));				
+                
+                    // clear the cache
+                CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
             }
 
             $this->setCommonData();

Modified: plog/trunk/class/action/admin/adminupdateresourcealbumaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdateresourcealbumaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminupdateresourcealbumaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -48,8 +48,8 @@
         {
         	$this->_albumId = $this->_request->getValue( "albumId" );
         	$this->_parentId = $this->_request->getValue( "parentId" );
-            $this->_albumName = $this->_request->getValue( "albumName" );			
-            $this->_albumDescription = $this->_request->getValue( "albumDescription" );
+            $this->_albumName = Textfilter::filterAllHTML($this->_request->getValue( "albumName" ));			
+            $this->_albumDescription = Textfilter::filterAllHTML($this->_request->getValue( "albumDescription" ));
             $this->_showAlbum = $this->_request->getValue( "showAlbum" );
             if( $this->_showAlbum == "" )
             	$this->_showAlbum = 0;			

Modified: plog/trunk/class/action/admin/adminupdateuserprofileaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdateuserprofileaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminupdateuserprofileaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -38,7 +38,7 @@
 			$this->registerField( "properties" );
 			$this->registerField( "userIsSiteAdmin" );
 			$this->registerField( "userName" );
-			$this->registerFieldValidator( "userPassword", new PasswordValidator(), true );
+			$this->registerFieldValidator( "userProfilePassword", new PasswordValidator(), true );
 			$this->registerFieldValidator( "userStatus", new IntegerValidator());
 			$view = new AdminEditSiteUserView( $this->_blogInfo );
 			$view->setErrorMessage( $this->_locale->tr("error_updating_user"));
@@ -49,13 +49,12 @@
         {
 			// get the data
         	$this->_userId = $this->_request->getValue( "userId" );
-            $this->_userPassword = $this->_request->getValue( "userPassword" );
-            $this->_userEmail = $this->_request->getValue( "userEmail" );
-            $this->_userAbout = $this->_request->getValue( "userAbout" );
-            $this->_userFullName = $this->_request->getValue( "userFullName" );
+            $this->_userPassword = trim(Textfilter::filterAllHTML($this->_request->getValue( "userProfilePassword" )));
+            $this->_userEmail = Textfilter::filterAllHTML($this->_request->getValue( "userEmail" ));
+            $this->_userAbout = Textfilter::filterAllHTML($this->_request->getValue( "userAbout" ));
+            $this->_userFullName = Textfilter::filterAllHTML($this->_request->getValue( "userFullName" ));
             $this->_adminPrivs = $this->_request->getValue( "userIsSiteAdmin" );
 			$this->_userProperties = $this->_request->getValue( "properties" );
-            $this->_userPassword = trim($this->_request->getValue( "userPassword" ));
 			$this->_userStatus = $this->_request->getValue( "userStatus" );
 
         	// load the user settings

Modified: plog/trunk/class/action/admin/adminupdateusersettingsaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdateusersettingsaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminupdateusersettingsaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -27,12 +27,13 @@
         {
         	$this->AdminAction( $actionInfo, $request );
 			
+            $this->registerField( "confirmPassword" );
 			$this->registerField( "userFullName" );
 			$this->registerFieldValidator( "userEmail", new EmailValidator());
 			$this->registerFieldValidator( "userPictureId", new IntegerValidator());
 			$this->registerField( "userAbout" );
 			$this->registerField( "properties" );
-			$this->registerField( "userPassword" );
+			$this->registerField( "userSettingsPassword" );
 			$view = new AdminUserProfileView( $this->_blogInfo, $this->_userInfo );
 			$view->setErrorMessage( $this->_locale->tr("error_updating_user_settings"));
 			$this->setValidationErrorView( $view );
@@ -45,7 +46,7 @@
         function validate()
         {
             // if all correct, we can proceed
-            $this->_userPassword = trim($this->_request->getValue( "userPassword" ));
+            $this->_userPassword = trim($this->_request->getValue( "userSettingsPassword" ));
             $this->_userConfirmPassword = trim($this->_request->getValue( "confirmPassword" ));
 			
             $valid = parent::validate();			
@@ -54,7 +55,7 @@
             if( $this->_userPassword != "" ) {
             	$passwordVal = new PasswordValidator();
             	if( !$passwordVal->validate( $this->_userPassword )) {
-					$this->_form->setFieldValidationStatus( "userPassword", false );					
+					$this->_form->setFieldValidationStatus( "userSettingsPassword", false );					
                 	$this->setCommonData( true );
                 	return false;
             	}
@@ -74,11 +75,11 @@
         function perform()
         {
         	// update the user information
-            $this->_userInfo->setEmail( trim($this->_request->getValue( "userEmail" )));
+            $this->_userInfo->setEmail( Textfilter::filterAllHTML($this->_request->getValue( "userEmail" )));
             if( $this->_userPassword != "" )
             	$this->_userInfo->setPassword( $this->_userPassword );
-            $this->_userInfo->setAboutMyself( trim($this->_request->getValue( "userAbout" )));
-            $this->_userInfo->setFullName( trim($this->_request->getValue( "userFullName" )));
+            $this->_userInfo->setAboutMyself( Textfilter::filterAllHTML($this->_request->getValue( "userAbout" )));
+            $this->_userInfo->setFullName( Textfilter::filterAllHTML($this->_request->getValue( "userFullName" )));
 			$this->_userInfo->setPictureId( $this->_request->getValue( "userPictureId" ));
 			$this->_userInfo->setProperties( $this->_request->getValue( "properties" ));
 			$this->notifyEvent( EVENT_PRE_USER_UPDATE, Array( "user" => &$this->_userInfo ));			

Modified: plog/trunk/class/action/admin/adminuserprofileaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminuserprofileaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminuserprofileaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -51,4 +51,4 @@
             return true;
         }
     }
-?>
+?>
\ No newline at end of file

Modified: plog/trunk/class/action/admin/adminxmlsavedraftaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminxmlsavedraftaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/admin/adminxmlsavedraftaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -17,9 +17,9 @@
 		
 		function validate()
 		{
-        	$this->_postText     = rtrim(ltrim($this->_request->getValue( "postText" )));
-            $this->_postExtendedText = rtrim(ltrim($this->_request->getValue( "postExtendedText" )));
-            $this->_postTopic    = rtrim(ltrim($this->_request->getValue( "postTopic" )));
+        	$this->_postText     = $this->_request->getValue( "postText" );
+            $this->_postExtendedText = $this->_request->getValue( "postExtendedText" );
+            $this->_postTopic    = $this->_request->getValue( "postTopic" );
             
             // if there is no text, extended text or topic there is no point in saving anything
             if( $this->_postText == "" && $this->_postExtendedTExt == "" &&

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

Modified: plog/trunk/class/action/defaultaction.class.php
===================================================================
--- plog/trunk/class/action/defaultaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/defaultaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -118,7 +118,7 @@
             // if we got a user user id, then we should first look up this id
             // user in the database and see if it exists
             if( $this->_userId > 0) {
-                $user = $users->getUserInfoFromId( $this->_userName );
+                $user = $users->getUserInfoFromId( $this->_userId );
                 if( !$user ) {
                     $this->_view = new ErrorView( $this->_blogInfo );
                     $this->_view->setValue( 'message', 'error_incorrect_user_id' );
@@ -126,16 +126,15 @@
                     return false;
                 }
             } 
-
-            // if we got a user name instead of a user id, then we
-            // should first look up this user in the database and see if
-            // it exists
-            if( $this->_userName ) {
+            else if( $this->_userName ) {
+                    // if we got a user name instead of a user id, then we
+                    // should first look up this user in the database and see if
+                    // it exists
                 $user = $users->getUserInfoFromUsername( $this->_userName );
                 if( !$user ) {
                     require_once( PLOG_CLASS_PATH."class/view/errorview.class.php" );
                     $this->_view = new ErrorView( $this->_blogInfo );
-                    $this->_view->setValue( 'message', 'error_incorrect_user_id' );
+                    $this->_view->setValue( 'message', 'error_incorrect_user_username' );
                     $this->setCommonData();
                     return false;
                 }

Modified: plog/trunk/class/action/resourceserveraction.class.php
===================================================================
--- plog/trunk/class/action/resourceserveraction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/resourceserveraction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -5,7 +5,6 @@
 	include_once( PLOG_CLASS_PATH."class/view/resourceserverview.class.php" );
 	include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
 	include_once( PLOG_CLASS_PATH."class/config/config.class.php" );
-	include_once( PLOG_CLASS_PATH."class/net/http/httpcache.class.php" );
     include_once( PLOG_CLASS_PATH."class/gallery/dao/galleryresources.class.php" );	
     include_once( PLOG_CLASS_PATH."class/security/pipeline.class.php" );
     include_once( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );	

Modified: plog/trunk/class/action/viewarticleaction.class.php
===================================================================
--- plog/trunk/class/action/viewarticleaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/viewarticleaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -6,6 +6,7 @@
     include_once( PLOG_CLASS_PATH."class/dao/users.class.php" );
     include_once( PLOG_CLASS_PATH."class/dao/referers.class.php" );
     include_once( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
+	include_once( PLOG_CLASS_PATH.'class/data/timestamp.class.php' );
 
     /**
      * \ingroup Action
@@ -20,6 +21,7 @@
         var $_articleId;
 		var $_articleName;
 		var $_date;
+		var $_maxDate;
 		var $_userId;
 		var $_userName;
 		var $_categoryId;
@@ -45,6 +47,9 @@
 			$this->_date = $this->_request->getValue( "Date", -1 );
 			$this->_isCommentAdded = ($this->_request->getValue( "op" ) == "AddComment" );
 
+			// Caculate the correct article date period
+			$this->_getArticleCorrectedDatePeriod();
+
             return true;
         }
 		
@@ -98,6 +103,50 @@
 			return( true );
 		}
 
+		/**
+		 * @private
+		 * Caculate the correct article date period
+		 */		        
+        function _getArticleCorrectedDatePeriod()
+        {
+            $blogSettings = $this->_blogInfo->getSettings();
+            $serverTimeOffset = $blogSettings->getValue( "time_offset" );
+            
+            if( $serverTimeOffset == 0)
+            {
+            	$this->_maxDate = -1;
+            }
+            else
+            {
+	            if( strlen($this->_date) == 4 ) 
+	        	{
+	        		$year = $this->_date;
+	        		$this->_date = Timestamp::getDateWithOffset( $year."0101000000", -$serverTimeOffset );
+	        		$this->_maxDate = Timestamp::getDateWithOffset( $year."1231235959", -$serverTimeOffset );
+	        	} 
+	        	elseif ( strlen($this->_date) == 6 ) 
+	        	{
+	                $year = substr( $this->_date, 0, 4 );
+	                $month = substr( $this->_date, 4, 2 );
+	                $dayOfMonth = Date_Calc::daysInMonth( $month, $year );
+	        		$this->_date = Timestamp::getDateWithOffset( $year.$month."01000000", -$serverTimeOffset );
+	        		$this->_maxDate = Timestamp::getDateWithOffset( $year.$month.$dayOfMonth."235959", -$serverTimeOffset );
+	        	}
+	        	elseif ( strlen($this->_date) == 8 )
+	        	{
+	        		$year = substr( $this->_date, 0, 4 );
+	                $month = substr( $this->_date, 4, 2 );
+	                $day = substr( $this->_date, 6, 2 );
+	        		$this->_date = Timestamp::getDateWithOffset( $year.$month.$day."000000", -$serverTimeOffset );
+	        		$this->_maxDate = Timestamp::getDateWithOffset( $year.$month.$day."235959", -$serverTimeOffset );
+	        	}
+	        	else
+	        	{
+	        		$this->_maxDate = -1;
+	        	}
+            }
+        }
+
         function perform()
         {
 	        include_once( PLOG_CLASS_PATH."class/view/viewarticleview.class.php" );
@@ -158,14 +207,14 @@
             // the article identifier can be either its internal id number or its mangled topic
             include_once( PLOG_CLASS_PATH."class/dao/article.class.php" );
             if( $this->_articleId ) { 
-
                 $article  = $this->articles->getBlogArticle( $this->_articleId, 
                                                              $this->_blogInfo->getId(), 
                                                              false, 
                                                              $this->_date, 
                                                              $this->_categoryId, 
                                                              $this->_userId,
-                                                             POST_STATUS_PUBLISHED );
+                                                             POST_STATUS_PUBLISHED,
+                                                             $this->_maxDate);
             } else {
                 $article  = $this->articles->getBlogArticleByTitle( $this->_articleName, 
                                                                     $this->_blogInfo->getId(), 
@@ -173,7 +222,8 @@
                                                                     $this->_date, 
                                                                     $this->_categoryId, 
                                                                     $this->_userId,
-                                                                    POST_STATUS_PUBLISHED );
+                                                                    POST_STATUS_PUBLISHED,
+                                                                    $this->_maxDate);
             }
 
             // if the article id doesn't exist, cancel the whole thing...

Modified: plog/trunk/class/action/viewresourceaction.class.php
===================================================================
--- plog/trunk/class/action/viewresourceaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/action/viewresourceaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -75,7 +75,7 @@
 			if( $this->_albumName ) {
 			    include_once( PLOG_CLASS_PATH."class/gallery/dao/galleryalbums.class.php" );			
 				$galleryAlbums = new GalleryAlbums();				
-				$album = $galleryAlbums->getAlbumByName( $this->_albumName, $this->_blogInfo->getId(), false, true );
+				$album = $galleryAlbums->getAlbumByName( $this->_albumName, $this->_blogInfo->getId(), false, false );
 				if( !$album ) {
 					$this->_view = new ErrorView( $this->_blogInfo );
 					$this->_view->setValue( "message", "error_fetching_resource" );

Modified: plog/trunk/class/dao/model.class.php
===================================================================
--- plog/trunk/class/dao/model.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/dao/model.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -398,6 +398,8 @@
             $row = $result->FetchRow();
             $total = $row["total"];
             if( $total == "" ) $total = 0;
+			
+            $result->Close();			
 
             return $total;
         }

Modified: plog/trunk/class/dao/trackbackclient.class.php
===================================================================
--- plog/trunk/class/dao/trackbackclient.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/dao/trackbackclient.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -227,5 +227,43 @@
 
         	return $results;
     	}
+
+	    /**
+    	 * Send trackbacks directly.
+	     * The result of this function is another array of arrays, where for every position we will
+	     * have another array with two positions: <b>"url"</b> will be the original url and <b>"status"</b> will be a value
+	     * identifying what happened:<ul>
+	     * <li>TRACKBACK_SUCCESS: Trackback was successfully sent</li>
+         * <li>TRACKBACK_FAILED: There was some kind of problem sending the trackback</li>
+	     * </ul>
+	     *
+	     * @param trackbacks An array with the urls where we would like to try and send trackback pings.
+	     * @param article The Article object with the information we need to send the ping.
+	     * @param blogName The name of the blog that is sending the information.
+	     * @retun An array with the information explained above.
+	     */
+    	function sendDirectTrackbacks( $trackbacks, $article, $blogName )
+    	{
+
+	    	$results = Array();
+    		foreach( $trackbacks as $trackback )
+        	{
+       			// try and send a trackback
+                //print("sending to tblink: ".$tbLink."<br/>");
+           		$result = $this->sendTrackback( $trackback, $article, $blogName );
+           		if( !$result ) {
+               		// if it didn't work, mark it
+                   	array_push( $results, $this->_buildResult( $trackback, TRACKBACK_FAILED ));
+                    //print("Error: trackback failed<br/>");
+           		}
+               	else {
+               		// it actually worked, so we say so ;)
+               		array_push( $results, $this->_buildResult( $trackback, TRACKBACK_SUCCESS ));
+                    //print("It worked!<br/>");
+               	}
+        	}
+
+        	return $results;
+    	}
     }
 ?>

Copied: plog/trunk/class/data/jalalicalendar.class.php (from rev 2357, plog/branches/plog-1.0.2/class/data/jalalicalendar.class.php)

Copied: plog/trunk/class/data/jalalicalendarstrings.properties.php (from rev 2357, plog/branches/plog-1.0.2/class/data/jalalicalendarstrings.properties.php)

Modified: plog/trunk/class/data/kses.class.php
===================================================================
--- plog/trunk/class/data/kses.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/data/kses.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -81,7 +81,7 @@
   				$string = stripslashes($string);
 			}
 			$string = $this->_no_null($string);
-			$string = $this->_js_entities($string);
+			$string = $this->_js_entities($string);	
 			$string = $this->_normalize_entities($string);
 			$string = $this->_hook($string);
 			$string = $this->_split($string);
@@ -395,7 +395,7 @@
 
 				if (!is_array($current))
 				{
-					# there are no checks
+					# there are no checks			
 					$attr2 .= ' '.$arreach['whole'];
 				}
 				else
@@ -569,7 +569,7 @@
 					'whole' => $attrname,
 					'vless' => 'y'
 				);
-			}
+			}						
 
 			return $attrarr;
 		} # function _hair
@@ -590,7 +590,6 @@
 				$string2 = $string;
 				$string  = $this->_bad_protocol_once($string);
 			} # while
-
 			return $string;
 		} # function _bad_protocol
 
@@ -620,6 +619,12 @@
 			$string2 = preg_replace('/\s/', '', $string);
 			$string2 = $this->_no_null($string2);
 			$string2 = strtolower($string2);
+			
+			//
+			// bug http://bugs.plogworld.net/view.php?id=658
+			// somehow every other CSS attribute is allowed except "margin"... go figure!
+			//
+			$this->allowed_protocols[] = "margin";
 
 			$allowed = false;
 			foreach ($this->allowed_protocols as $one_protocol)

Modified: plog/trunk/class/data/textfilter.class.php
===================================================================
--- plog/trunk/class/data/textfilter.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/data/textfilter.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -9,7 +9,6 @@
 
 	
 	include_once( PLOG_CLASS_PATH."class/config/config.class.php" );
-	include_once( PLOG_CLASS_PATH."class/data/kses.class.php" );
 	include_once( PLOG_CLASS_PATH."class/data/stringutils.class.php" );
 
     /**
@@ -102,7 +101,7 @@
 			// y luego eliminamos el javascript
 			$filteredString = Textfilter::filterJavaScript( $tmp );
 
-			return $filteredString;
+			return( trim($filteredString));
         }
 
 		/**
@@ -412,6 +411,7 @@
 		      // use kses in the "xhtml converter" mode
 		      $config =& Config::getConfig();
 		      if( $config->getValue( "xhtml_converter_enabled" )) {
+               	include_once( PLOG_CLASS_PATH."class/data/kses.class.php" );		      
 		          $kses = new kses( true, $config->getValue( "xhtml_converter_aggresive_mode_enabled"));
 		          $result = $kses->Parse( $string );
 		          

Modified: plog/trunk/class/data/validator/httpurlvalidator.class.php
===================================================================
--- plog/trunk/class/data/validator/httpurlvalidator.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/data/validator/httpurlvalidator.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -15,10 +15,26 @@
     {
     	function HttpUrlValidator()
         {
+		    // trying to be RFC 1736 compatible, except where common
+			// usage goes against it, such as allowing unencoded 
+			// '~', '^', ' ', etc.
+
+			$prefix = "^([[:alnum:]\-\+\.]+)\://";
+			$ftp_login = "([[:alnum:]\.\-]+(\:[[:alnum:]\.&%\$\-]+)*@)*";
+			$ip_num = "(25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]?)";
+			$ip_address = "($ip_num\.($ip_num|0)\.($ip_num|0)\.$ip_num)";
+			$tld = "(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|([[:alpha:]]{2}))";
+			$port = "(\:[[:digit:]]+)*";
+			$path = "(/($|[[:alnum:] \.\,\?\'\"\\\+^&%\$#\=~_\-]+))*";
+
+			// allow underscores, even though we shouldn't
+			$domain_part = "([[:alnum:]_\-]+\.)+";
+			
         	$this->Validator();
-			
 			$this->addRule( new NonEmptyRule());
-        	//$this->addRule( new RegExpRule( "!^http(s)?:\/\/\w+\.\w+(\S+)?$!", false ));
+        	$this->addRule( new RegExpRule("(" . $prefix . $ftp_login . "(" . $ip_address . "|localhost|(" .
+										         $domain_part . $tld . "))" . $port . ")?" . $path . "$",
+										   false ));
         }
     }
-?>
\ No newline at end of file
+?>

Modified: plog/trunk/class/data/validator/rules/urlformatrule.class.php
===================================================================
--- plog/trunk/class/data/validator/rules/urlformatrule.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/data/validator/rules/urlformatrule.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -2,7 +2,7 @@
 
     include_once(PLOG_CLASS_PATH."class/data/validator/rules/rule.class.php");
     include_once(PLOG_CLASS_PATH."class/net/dns.class.php");
-		include_once(PLOG_CLASS_PATH."class/net/httpvars.class.php");
+    include_once(PLOG_CLASS_PATH."class/net/http/httpvars.class.php");
 
    /**
     * \ingroup Validator_Rules

Modified: plog/trunk/class/database/adodb/drivers/adodb-mysql.inc.php
===================================================================
--- plog/trunk/class/database/adodb/drivers/adodb-mysql.inc.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/database/adodb/drivers/adodb-mysql.inc.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -351,6 +351,14 @@
 			$this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword);
 	
 		if ($this->_connectionID === false) return false;
+
+        if ($this->_isSupportUtf8() && $argDatabasename) {
+            $dbEncoding = $this->_getDbDefaultEncoding($argDatabasename);
+            if ($dbEncoding) {
+                mysql_query("SET NAMES $dbEncoding", $this->_connectionID);
+            }
+        }
+                                                    
 		if ($argDatabasename) return $this->SelectDB($argDatabasename);
 		return true;	
 	}
@@ -364,6 +372,14 @@
 			$this->_connectionID = mysql_pconnect($argHostname,$argUsername,$argPassword);
 		if ($this->_connectionID === false) return false;
 		if ($this->autoRollback) $this->RollbackTrans();
+        
+        if ($this->_isSupportUtf8() && $argDatabasename) {
+            $dbEncoding = $this->_getDbDefaultEncoding($argDatabasename);
+            if ($dbEncoding) {
+                mysql_query("SET NAMES $dbEncoding", $this->_connectionID);
+            }
+        }
+                                     
 		if ($argDatabasename) return $this->SelectDB($argDatabasename);
 		return true;	
 	}
@@ -373,9 +389,43 @@
 		$this->forceNewConnect = true;
 		return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename);
 	}
-	
- 	function &MetaColumns($table) 
-	{
+
+    function _isSupportUtf8() {
+            // check mysql version first. Version lower than 4.1 doesn't support utf8
+        $serverVersion = mysql_get_server_info($this->_connectionID);
+        $version = explode('.', $serverVersion);
+        if ($version[0] < 4) return false;
+        if ( ($version[0] == 4) && ($version[1] == 0) ) return false;
+        
+            // check if utf8 support was compiled in
+        $result = mysql_query("SHOW CHARACTER SET like 'utf8'", $this->_connectionID);
+        if (mysql_num_rows($result) > 0) {
+            return true;
+        }
+        return false;
+    }
+    
+    function _getDbDefaultEncoding($argDatabasename){
+        if (!$argDatabasename) {
+            return false;
+        }
+        
+            // We use a SHOW CREATE DATABASE command to show the original
+            // SQL character set when DB was created.
+        $result = mysql_query("SHOW CREATE DATABASE $argDatabasename", $this->_connectionID);
+        if (mysql_num_rows($result) < 0 ) {
+                // The specified db name is wrong!
+            return false;
+        }
+        $dbInfo = mysql_fetch_row($result);
+        $pattern = '/40100 DEFAULT CHARACTER SET (\w+) /';
+        if ( (preg_match($pattern, $dbInfo[1], $match) > 0) ) {
+            return $match[1];
+        }
+        return false;
+    }
+    
+ 	function &MetaColumns($table){
 		global $ADODB_FETCH_MODE;
 		$save = $ADODB_FETCH_MODE;
 		$ADODB_FETCH_MODE = ADODB_FETCH_NUM;

Modified: plog/trunk/class/gallery/dao/galleryresourcequotas.class.php
===================================================================
--- plog/trunk/class/gallery/dao/galleryresourcequotas.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/dao/galleryresourcequotas.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -86,8 +86,8 @@
 				
 			// if not, calculate how many bytes we currently have
 			$currentBytes = GalleryResourceQuotas::getBlogResourceQuotaUsage( $blogId );
-			
-			if( ($currentByes + $fileSize) > $blogQuota )
+								
+			if( ($currentBytes + $fileSize) > $blogQuota )
 				return true;
 			else
 				return false;

Modified: plog/trunk/class/gallery/getid3/getid3.lib.php
===================================================================
--- plog/trunk/class/gallery/getid3/getid3.lib.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/getid3.lib.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -53,9 +53,8 @@
 define('GETID3_JPG_SOF15',   "\xCF");
 define('GETID3_JPG_EOI',     "\xD9"); // End Of Image (end of datastream)
 
-/**
- * \ingroup getid3
- */
+
+
 class getid3_lib
 {
 
@@ -95,7 +94,7 @@
 		} else {
 			$truncatednumber = 0;
 		}
-		if ($truncatednumber <= pow(2, 30)) {
+		if ($truncatednumber <= 1073741824) { // 2^30
 			$truncatednumber = (int) $truncatednumber;
 		}
 		return $truncatednumber;
@@ -109,7 +108,7 @@
 		// convert a float to type int, only if possible
 		if (getid3_lib::trunc($floatnum) == $floatnum) {
 			// it's not floating point
-			if ($floatnum <= pow(2, 30)) {
+			if ($floatnum <= 1073741824) { // 2^30
 				// it's within int range
 				$floatnum = (int) $floatnum;
 			}
@@ -457,7 +456,7 @@
 			$contentseconds -= 60;
 			$contentminutes++;
 		}
-		return number_format($contentminutes).':'.str_pad($contentseconds, 2, 0, STR_PAD_LEFT);
+		return intval($contentminutes).':'.str_pad($contentseconds, 2, 0, STR_PAD_LEFT);
 	}
 
 
@@ -503,7 +502,7 @@
 
 	function FixedPoint2_30($rawdata) {
 		$binarystring = getid3_lib::BigEndian2Bin($rawdata);
-		return getid3_lib::Bin2Dec(substr($binarystring, 0, 2)) + (float) (getid3_lib::Bin2Dec(substr($binarystring, 2, 30)) / pow(2, 30));
+		return getid3_lib::Bin2Dec(substr($binarystring, 0, 2)) + (float) (getid3_lib::Bin2Dec(substr($binarystring, 2, 30)) / 1073741824);
 	}
 
 
@@ -514,13 +513,13 @@
 		//   $foo = array('path'=>array('to'=>'array('my'=>array('file.txt'))));
 		// or
 		//   $foo['path']['to']['my'] = 'file.txt';
-		while ($ArrayPath{0} == $Separator) {
+		while ($ArrayPath && ($ArrayPath{0} == $Separator)) {
 			$ArrayPath = substr($ArrayPath, 1);
 		}
 		if (($pos = strpos($ArrayPath, $Separator)) !== false) {
 			$ReturnedArray[substr($ArrayPath, 0, $pos)] = getid3_lib::CreateDeepArray(substr($ArrayPath, $pos + 1), $Separator, $Value);
 		} else {
-			$ReturnedArray["$ArrayPath"] = $Value;
+			$ReturnedArray[$ArrayPath] = $Value;
 		}
 		return $ReturnedArray;
 	}
@@ -711,21 +710,342 @@
 	}
 
 
+	function iconv_fallback_int_utf8($charval) {
+		if ($charval < 128) {
+			// 0bbbbbbb
+			$newcharstring = chr($charval);
+		} elseif ($charval < 2048) {
+			// 110bbbbb 10bbbbbb
+			$newcharstring  = chr(($charval >> 6) | 0xC0);
+			$newcharstring .= chr(($charval & 0x3F) | 0x80);
+		} elseif ($charval < 65536) {
+			// 1110bbbb 10bbbbbb 10bbbbbb
+			$newcharstring  = chr(($charval >> 12) | 0xE0);
+			$newcharstring .= chr(($charval >>  6) | 0xC0);
+			$newcharstring .= chr(($charval & 0x3F) | 0x80);
+		} else {
+			// 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb
+			$newcharstring  = chr(($charval >> 18) | 0xF0);
+			$newcharstring .= chr(($charval >> 12) | 0xC0);
+			$newcharstring .= chr(($charval >>  6) | 0xC0);
+			$newcharstring .= chr(($charval & 0x3F) | 0x80);
+		}
+		return $newcharstring;
+	}
+
+	// ISO-8859-1 => UTF-8
+	function iconv_fallback_iso88591_utf8($string, $bom=false) {
+		if (function_exists('utf8_encode')) {
+			return utf8_encode($string);
+		}
+		// utf8_encode() unavailable, use getID3()'s iconv_fallback() conversions (possibly PHP is compiled without XML support)
+		$newcharstring = '';
+		if ($bom) {
+			$newcharstring .= "\xEF\xBB\xBF";
+		}
+		for ($i = 0; $i < strlen($string); $i++) {
+			$charval = ord($string{$i});
+			$newcharstring .= getid3_lib::iconv_fallback_int_utf8($charval);
+		}
+		return $newcharstring;
+	}
+
+	// ISO-8859-1 => UTF-16BE
+	function iconv_fallback_iso88591_utf16be($string, $bom=false) {
+		$newcharstring = '';
+		if ($bom) {
+			$newcharstring .= "\xFE\xFF";
+		}
+		for ($i = 0; $i < strlen($string); $i++) {
+			$newcharstring .= "\x00".$string{$i};
+		}
+		return $newcharstring;
+	}
+
+	// ISO-8859-1 => UTF-16LE
+	function iconv_fallback_iso88591_utf16le($string, $bom=false) {
+		$newcharstring = '';
+		if ($bom) {
+			$newcharstring .= "\xFF\xFE";
+		}
+		for ($i = 0; $i < strlen($string); $i++) {
+			$newcharstring .= $string{$i}."\x00";
+		}
+		return $newcharstring;
+	}
+
+	// ISO-8859-1 => UTF-16LE (BOM)
+	function iconv_fallback_iso88591_utf16($string) {
+		return getid3_lib::iconv_fallback_iso88591_utf16le($string, true);
+	}
+
+	// UTF-8 => ISO-8859-1
+	function iconv_fallback_utf8_iso88591($string) {
+		if (function_exists('utf8_decode')) {
+			return utf8_decode($string);
+		}
+		// utf8_decode() unavailable, use getID3()'s iconv_fallback() conversions (possibly PHP is compiled without XML support)
+		$newcharstring = '';
+		$offset = 0;
+		$stringlength = strlen($string);
+		while ($offset < $stringlength) {
+			if ((ord($string{$offset}) | 0x07) == 0xF7) {
+				// 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb
+				$charval = ((ord($string{($offset + 0)}) & 0x07) << 18) &
+				           ((ord($string{($offset + 1)}) & 0x3F) << 12) &
+				           ((ord($string{($offset + 2)}) & 0x3F) <<  6) &
+				            (ord($string{($offset + 3)}) & 0x3F);
+				$offset += 4;
+			} elseif ((ord($string{$offset}) | 0x0F) == 0xEF) {
+				// 1110bbbb 10bbbbbb 10bbbbbb
+				$charval = ((ord($string{($offset + 0)}) & 0x0F) << 12) &
+				           ((ord($string{($offset + 1)}) & 0x3F) <<  6) &
+				            (ord($string{($offset + 2)}) & 0x3F);
+				$offset += 3;
+			} elseif ((ord($string{$offset}) | 0x1F) == 0xDF) {
+				// 110bbbbb 10bbbbbb
+				$charval = ((ord($string{($offset + 0)}) & 0x1F) <<  6) &
+				            (ord($string{($offset + 1)}) & 0x3F);
+				$offset += 2;
+			} elseif ((ord($string{$offset}) | 0x7F) == 0x7F) {
+				// 0bbbbbbb
+				$charval = ord($string{$offset});
+				$offset += 1;
+			} else {
+				// error? throw some kind of warning here?
+				$charval = false;
+				$offset += 1;
+			}
+			if ($charval !== false) {
+				$newcharstring .= (($charval < 256) ? chr($charval) : '?');
+			}
+		}
+		return $newcharstring;
+	}
+
+	// UTF-8 => UTF-16BE
+	function iconv_fallback_utf8_utf16be($string, $bom=false) {
+		$newcharstring = '';
+		if ($bom) {
+			$newcharstring .= "\xFE\xFF";
+		}
+		$offset = 0;
+		$stringlength = strlen($string);
+		while ($offset < $stringlength) {
+			if ((ord($string{$offset}) | 0x07) == 0xF7) {
+				// 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb
+				$charval = ((ord($string{($offset + 0)}) & 0x07) << 18) &
+				           ((ord($string{($offset + 1)}) & 0x3F) << 12) &
+				           ((ord($string{($offset + 2)}) & 0x3F) <<  6) &
+				            (ord($string{($offset + 3)}) & 0x3F);
+				$offset += 4;
+			} elseif ((ord($string{$offset}) | 0x0F) == 0xEF) {
+				// 1110bbbb 10bbbbbb 10bbbbbb
+				$charval = ((ord($string{($offset + 0)}) & 0x0F) << 12) &
+				           ((ord($string{($offset + 1)}) & 0x3F) <<  6) &
+				            (ord($string{($offset + 2)}) & 0x3F);
+				$offset += 3;
+			} elseif ((ord($string{$offset}) | 0x1F) == 0xDF) {
+				// 110bbbbb 10bbbbbb
+				$charval = ((ord($string{($offset + 0)}) & 0x1F) <<  6) &
+				            (ord($string{($offset + 1)}) & 0x3F);
+				$offset += 2;
+			} elseif ((ord($string{$offset}) | 0x7F) == 0x7F) {
+				// 0bbbbbbb
+				$charval = ord($string{$offset});
+				$offset += 1;
+			} else {
+				// error? throw some kind of warning here?
+				$charval = false;
+				$offset += 1;
+			}
+			if ($charval !== false) {
+				$newcharstring .= (($charval < 65536) ? getid3_lib::BigEndian2String($charval, 2) : "\x00".'?');
+			}
+		}
+		return $newcharstring;
+	}
+
+	// UTF-8 => UTF-16LE
+	function iconv_fallback_utf8_utf16le($string, $bom=false) {
+		$newcharstring = '';
+		if ($bom) {
+			$newcharstring .= "\xFF\xFE";
+		}
+		$offset = 0;
+		$stringlength = strlen($string);
+		while ($offset < $stringlength) {
+			if ((ord($string{$offset}) | 0x07) == 0xF7) {
+				// 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb
+				$charval = ((ord($string{($offset + 0)}) & 0x07) << 18) &
+				           ((ord($string{($offset + 1)}) & 0x3F) << 12) &
+				           ((ord($string{($offset + 2)}) & 0x3F) <<  6) &
+				            (ord($string{($offset + 3)}) & 0x3F);
+				$offset += 4;
+			} elseif ((ord($string{$offset}) | 0x0F) == 0xEF) {
+				// 1110bbbb 10bbbbbb 10bbbbbb
+				$charval = ((ord($string{($offset + 0)}) & 0x0F) << 12) &
+				           ((ord($string{($offset + 1)}) & 0x3F) <<  6) &
+				            (ord($string{($offset + 2)}) & 0x3F);
+				$offset += 3;
+			} elseif ((ord($string{$offset}) | 0x1F) == 0xDF) {
+				// 110bbbbb 10bbbbbb
+				$charval = ((ord($string{($offset + 0)}) & 0x1F) <<  6) &
+				            (ord($string{($offset + 1)}) & 0x3F);
+				$offset += 2;
+			} elseif ((ord($string{$offset}) | 0x7F) == 0x7F) {
+				// 0bbbbbbb
+				$charval = ord($string{$offset});
+				$offset += 1;
+			} else {
+				// error? maybe throw some warning here?
+				$charval = false;
+				$offset += 1;
+			}
+			if ($charval !== false) {
+				$newcharstring .= (($charval < 65536) ? getid3_lib::LittleEndian2String($charval, 2) : '?'."\x00");
+			}
+		}
+		return $newcharstring;
+	}
+
+	// UTF-8 => UTF-16LE (BOM)
+	function iconv_fallback_utf8_utf16($string) {
+		return getid3_lib::iconv_fallback_utf8_utf16le($string, true);
+	}
+
+	// UTF-16BE => UTF-8
+	function iconv_fallback_utf16be_utf8($string) {
+		if (substr($string, 0, 2) == "\xFE\xFF") {
+			// strip BOM
+			$string = substr($string, 2);
+		}
+		$newcharstring = '';
+		for ($i = 0; $i < strlen($string); $i += 2) {
+			$charval = getid3_lib::BigEndian2Int(substr($string, $i, 2));
+			$newcharstring .= getid3_lib::iconv_fallback_int_utf8($charval);
+		}
+		return $newcharstring;
+	}
+
+	// UTF-16LE => UTF-8
+	function iconv_fallback_utf16le_utf8($string) {
+		if (substr($string, 0, 2) == "\xFF\xFE") {
+			// strip BOM
+			$string = substr($string, 2);
+		}
+		$newcharstring = '';
+		for ($i = 0; $i < strlen($string); $i += 2) {
+			$charval = getid3_lib::LittleEndian2Int(substr($string, $i, 2));
+			$newcharstring .= getid3_lib::iconv_fallback_int_utf8($charval);
+		}
+		return $newcharstring;
+	}
+
+	// UTF-16BE => ISO-8859-1
+	function iconv_fallback_utf16be_iso88591($string) {
+		if (substr($string, 0, 2) == "\xFE\xFF") {
+			// strip BOM
+			$string = substr($string, 2);
+		}
+		$newcharstring = '';
+		for ($i = 0; $i < strlen($string); $i += 2) {
+			$charval = getid3_lib::BigEndian2Int(substr($string, $i, 2));
+			$newcharstring .= (($charval < 256) ? chr($charval) : '?');
+		}
+		return $newcharstring;
+	}
+
+	// UTF-16LE => ISO-8859-1
+	function iconv_fallback_utf16le_iso88591($string) {
+		if (substr($string, 0, 2) == "\xFF\xFE") {
+			// strip BOM
+			$string = substr($string, 2);
+		}
+		$newcharstring = '';
+		for ($i = 0; $i < strlen($string); $i += 2) {
+			$charval = getid3_lib::LittleEndian2Int(substr($string, $i, 2));
+			$newcharstring .= (($charval < 256) ? chr($charval) : '?');
+		}
+		return $newcharstring;
+	}
+
+	// UTF-16 (BOM) => ISO-8859-1
+	function iconv_fallback_utf16_iso88591($string) {
+		$bom = substr($string, 0, 2);
+		if ($bom == "\xFE\xFF") {
+			return getid3_lib::iconv_fallback_utf16be_iso88591(substr($string, 2));
+		} elseif ($bom == "\xFF\xFE") {
+			return getid3_lib::iconv_fallback_utf16le_iso88591(substr($string, 2));
+		}
+		return $string;
+	}
+
+	// UTF-16 (BOM) => UTF-8
+	function iconv_fallback_utf16_utf8($string) {
+		$bom = substr($string, 0, 2);
+		if ($bom == "\xFE\xFF") {
+			return getid3_lib::iconv_fallback_utf16be_utf8(substr($string, 2));
+		} elseif ($bom == "\xFF\xFE") {
+			return getid3_lib::iconv_fallback_utf16le_utf8(substr($string, 2));
+		}
+		return $string;
+	}
+
 	function iconv_fallback($in_charset, $out_charset, $string) {
 
 		if ($in_charset == $out_charset) {
 			return $string;
 		}
 
-		if (!function_exists('iconv')) {
+		static $iconv_broken_or_unavailable = array();
+		if (is_null(@$iconv_broken_or_unavailable[$in_charset.'_'.$out_charset])) {
+			$GETID3_ICONV_TEST_STRING = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ';
 
-			if (($in_charset == 'ISO-8859-1') && ($out_charset == 'UTF-8')) {
-				return utf8_encode($string);
+			// Check iconv()
+			if (function_exists('iconv')) {
+				if (@iconv($in_charset, 'ISO-8859-1', @iconv('ISO-8859-1', $in_charset, $GETID3_ICONV_TEST_STRING)) == $GETID3_ICONV_TEST_STRING) {
+					if (@iconv($out_charset, 'ISO-8859-1', @iconv('ISO-8859-1', $out_charset, $GETID3_ICONV_TEST_STRING)) == $GETID3_ICONV_TEST_STRING) {
+						// everything works, use iconv()
+						$iconv_broken_or_unavailable[$in_charset.'_'.$out_charset] = false;
+					} else {
+						// iconv() available, but broken. Use getID3()'s iconv_fallback() conversions instead
+						// known issue in PHP v4.1.x
+						$iconv_broken_or_unavailable[$in_charset.'_'.$out_charset] = true;
+					}
+				} else {
+					// iconv() available, but broken. Use getID3()'s iconv_fallback() conversions instead
+					// known issue in PHP v4.1.x
+					$iconv_broken_or_unavailable[$in_charset.'_'.$out_charset] = true;
+				}
+			} else {
+				// iconv() unavailable, use getID3()'s iconv_fallback() conversions
+				$iconv_broken_or_unavailable[$in_charset.'_'.$out_charset] = true;
 			}
-			if (($in_charset == 'UTF-8') && ($out_charset == 'ISO-8859-1')) {
-				return utf8_decode($string);
+		}
+
+		if ($iconv_broken_or_unavailable[$in_charset.'_'.$out_charset]) {
+			static $ConversionFunctionList = array();
+			if (empty($ConversionFunctionList)) {
+				$ConversionFunctionList['ISO-8859-1']['UTF-8']    = 'iconv_fallback_iso88591_utf8';
+				$ConversionFunctionList['ISO-8859-1']['UTF-16']   = 'iconv_fallback_iso88591_utf16';
+				$ConversionFunctionList['ISO-8859-1']['UTF-16BE'] = 'iconv_fallback_iso88591_utf16be';
+				$ConversionFunctionList['ISO-8859-1']['UTF-16LE'] = 'iconv_fallback_iso88591_utf16le';
+				$ConversionFunctionList['UTF-8']['ISO-8859-1']    = 'iconv_fallback_utf8_iso88591';
+				$ConversionFunctionList['UTF-8']['UTF-16']        = 'iconv_fallback_utf8_utf16';
+				$ConversionFunctionList['UTF-8']['UTF-16BE']      = 'iconv_fallback_utf8_utf16be';
+				$ConversionFunctionList['UTF-8']['UTF-16LE']      = 'iconv_fallback_utf8_utf16le';
+				$ConversionFunctionList['UTF-16']['ISO-8859-1']   = 'iconv_fallback_utf16_iso88591';
+				$ConversionFunctionList['UTF-16']['UTF-8']        = 'iconv_fallback_utf16_utf8';
+				$ConversionFunctionList['UTF-16LE']['ISO-8859-1'] = 'iconv_fallback_utf16le_iso88591';
+				$ConversionFunctionList['UTF-16LE']['UTF-8']      = 'iconv_fallback_utf16le_utf8';
+				$ConversionFunctionList['UTF-16BE']['ISO-8859-1'] = 'iconv_fallback_utf16be_iso88591';
+				$ConversionFunctionList['UTF-16BE']['UTF-8']      = 'iconv_fallback_utf16be_utf8';
 			}
-
+			if (isset($ConversionFunctionList[strtoupper($in_charset)][strtoupper($out_charset)])) {
+				$ConversionFunction = $ConversionFunctionList[strtoupper($in_charset)][strtoupper($out_charset)];
+				return getid3_lib::$ConversionFunction($string);
+			}
 			die('PHP does not have iconv() support - cannot convert from '.$in_charset.' to '.$out_charset);
 		}
 
@@ -779,7 +1099,8 @@
 				break;
 
 			case 'UTF-8':
-				for ($i = 0; $i < strlen($string); $i++) {
+				$strlen = strlen($string);
+				for ($i = 0; $i < $strlen; $i++) {
 					$char_ord_val = ord($string{$i});
 					$charval = 0;
 					if ($char_ord_val < 0x80) {
@@ -876,11 +1197,11 @@
 		} else {
 			$signbit = '0';
 		}
-		$storedreplaygain = round($replaygain * 10);
+		$storedreplaygain = intval(round($replaygain * 10));
 		$gainstring  = str_pad(decbin($namecode), 3, '0', STR_PAD_LEFT);
 		$gainstring .= str_pad(decbin($originatorcode), 3, '0', STR_PAD_LEFT);
 		$gainstring .= $signbit;
-		$gainstring .= str_pad(decbin(round($replaygain * 10)), 9, '0', STR_PAD_LEFT);
+		$gainstring .= str_pad(decbin($storedreplaygain), 9, '0', STR_PAD_LEFT);
 
 		return $gainstring;
 	}
@@ -895,9 +1216,8 @@
 			$imgData = fread($fd, filesize($urlpic));
 			fclose($fd);
 			return getid3_lib::GetDataImageSize($imgData);
-		} else {
-			return array('', '', '');
 		}
+		return array('', '', '');
 	}
 
 
@@ -955,7 +1275,7 @@
 						// if the skip is more than what we've read in, read more
 						$buffer -= $skiplen;
 						if ($buffer < 512) { // if the buffer of data is too low, read more file.
-							// $imgData .= fread( $fd,$skiplen+1024 );
+							// $imgData .= fread($fd, $skiplen + 1024);
 							// $buffer += $skiplen + 1024;
 							return false; // End loop in case we find run out of data
 						}
@@ -973,7 +1293,7 @@
 		static $ImageTypesLookup = array();
 		if (empty($ImageTypesLookup)) {
 			$ImageTypesLookup[1]  = 'gif';
-			$ImageTypesLookup[2]  = 'jpg';
+			$ImageTypesLookup[2]  = 'jpeg';
 			$ImageTypesLookup[3]  = 'png';
 			$ImageTypesLookup[4]  = 'swf';
 			$ImageTypesLookup[5]  = 'psd';
@@ -1055,14 +1375,14 @@
 
 		// Discard $begin lines
 		for ($i = 0; $i < ($begin + 3); $i++) {
-			fgets($fp);
+			fgets($fp, 1024);
 		}
 
 		// Loop thru line
 		while (0 < $line_count--) {
 
 			// Read line
-			$line = ltrim(fgets($fp), "\t ");
+			$line = ltrim(fgets($fp, 1024), "\t ");
 
 			// METHOD A: only cache the matching key - less memory but slower on next lookup of not-previously-looked-up key
 			//$keycheck = substr($line, 0, $keylength);
@@ -1073,7 +1393,7 @@
 
 			// METHOD B: cache all keys in this lookup - more memory but faster on next lookup of not-previously-looked-up key
 			//$cache[$file][$name][substr($line, 0, $keylength)] = trim(substr($line, $keylength + 1));
-			list($ThisKey, $ThisValue) = explode("\t", $line, 2);
+			@list($ThisKey, $ThisValue) = explode("\t", $line, 2);
 			$cache[$file][$name][$ThisKey] = trim($ThisValue);
 		}
 

Modified: plog/trunk/class/gallery/getid3/getid3.php
===================================================================
--- plog/trunk/class/gallery/getid3/getid3.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/getid3.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -9,23 +9,21 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-
 // Defines
-define('GETID3_VERSION', '1.7.0');
+define('GETID3_VERSION', '1.7.4');
 define('GETID3_FREAD_BUFFER_SIZE', 16384); // read buffer size in bytes
 
 
-/**
- * \defgroup getid3
- *
- * Extracts information from supported files, such as metadata from images.
- */
+
 class getID3
 {
 	// public: Settings
 	var $encoding                 = 'ISO-8859-1';     // CASE SENSITIVE! - i.e. (must be supported by iconv())
 	                                                  // Examples:  ISO-8859-1  UTF-8  UTF-16  UTF-16BE
 
+	var $encoding_id3v1           = 'ISO-8859-1';     // Should always be 'ISO-8859-1', but some tags may be written
+	                                                  // in other encodings such as 'EUC-CN'
+
 	// public: Optional tag checks - disable for speed.
 	var $option_tag_id3v1         = true;             // Read and process ID3v1 tags
 	var $option_tag_id3v2         = true;             // Read and process ID3v2 tags
@@ -43,19 +41,42 @@
 	var $option_sha1_data         = false;            // Get SHA1 sum of data part - slow
 	var $option_max_2gb_check     = true;             // Check whether file is larger than 2 Gb and thus not supported by PHP
 
-	// public: Compatability settings
-	var $option_no_iconv          = false;            // Will allow getID3() to run in a limited manner with only
-	                                                  // ISO-8859-1 and UTF-8 text encoding if iconv() functions are unavailable
-
 	// private
 	var $filename;
 
 
-
 	// public: constructor
 	function getID3()
 	{
 
+		$this->startup_error   = '';
+		$this->startup_warning = '';
+
+		// Check for PHP version >= 4.1.0
+		if (phpversion() < '4.1.0') {
+		    $this->startup_error .= 'getID3() requires PHP v4.1.0 or higher - you are running v'.phpversion();
+		}
+
+		// Check memory
+		$memory_limit = ini_get('memory_limit');
+		if (eregi('([0-9]+)M', $memory_limit, $matches)) {
+			// could be stored as "16M" rather than 16777216 for example
+			$memory_limit = $matches[1] * 1048576;
+		}
+		if ($memory_limit <= 0) {
+			// memory limits probably disabled
+		} elseif ($memory_limit <= 3145728) {
+	    	$this->startup_error .= 'PHP has less than 3MB available memory and will very likely run out. Increase memory_limit in php.ini';
+		} elseif ($memory_limit <= 12582912) {
+	    	$this->startup_warning .= 'PHP has less than 12MB available memory and might run out if all modules are loaded. Increase memory_limit in php.ini';
+		}
+
+		// Check safe_mode off
+		if ((bool) ini_get('safe_mode')) {
+		    $this->warning('WARNING: Safe mode is on, shorten support disabled, md5data/sha1data for ogg vorbis disabled, ogg vorbos/flac tag writing disabled.');
+		}
+
+
 		// define a constant rather than looking up every time it is needed
 		if (!defined('GETID3_OS_ISWINDOWS')) {
 			if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
@@ -64,27 +85,7 @@
 				define('GETID3_OS_ISWINDOWS', false);
 			}
 		}
-		
-		/** 
-		 * little patch to make it not complain that iconv hasn't been compiled in...
-		 * I'd rather be left without access to asf and iso files than needing to 
-		 * recompile php :P
-		 */
-		if(!function_exists('iconv'))
-			$this->option_no_iconv = true;
 
-		// Check for required iconv()
-		if (!function_exists('iconv') && empty($this->option_no_iconv)) {
-
-			if (GETID3_OS_ISWINDOWS) {
-				echo 'PHP does not have iconv() support. Please enable php_iconv.dll in php.ini, and copy iconv.dll from c:/php/dlls to c:/windows/system32';
-			} else {
-				echo 'PHP is not compiled with iconv() support. Please recompile with the --with-iconv switch';
-			}
-			echo "\n".' Alternatively you can restrict $this->encoding to "UTF-8" and "ISO-8859-1" and set $this->option_no_iconv to true. getID3() will die on ISO and ASF modules, so use at your own risk!';
-			die();
-		}
-
 		// Get base path of getID3() - ONCE
 		if (!defined('GETID3_INCLUDEPATH')) {
 			define('GETID3_OS_DIRSLASH', (GETID3_OS_ISWINDOWS ? '\\' : '/'));
@@ -99,7 +100,7 @@
 
 		// Load support library
 		if (!include_once(GETID3_INCLUDEPATH.'getid3.lib.php')) {
-			die('getid3.lib.php is missing or corrupt.');
+			$this->startup_error .= 'getid3.lib.php is missing or corrupt';
 		}
 
 
@@ -109,13 +110,12 @@
 		// IMPORTANT: This path cannot have spaces in it. If neccesary, use the 8dot3 equivalent
 		//   ie for "C:/Program Files/Apache/" put "C:/PROGRA~1/APACHE/"
 		// IMPORTANT: This path must include the trailing slash
-		if (!defined('GETID3_HELPERAPPSDIR') && GETID3_OS_ISWINDOWS) {
+		if (GETID3_OS_ISWINDOWS && !defined('GETID3_HELPERAPPSDIR')) {
 
-			//$helperappsdir = GETID3_INCLUDEPATH.'..'.GETID3_OS_DIRSLASH.'helperapps'; // must not have any space in this path
-			$helperappsdir = "C:\PROGRA~1\APACHE~1\APACHE\HTDOCS\TRUNK\CLASS\GALLERY\HELPER~1";
+			$helperappsdir = GETID3_INCLUDEPATH.'..'.GETID3_OS_DIRSLASH.'helperapps'; // must not have any space in this path
 
 			if (!is_dir($helperappsdir)) {
-				die('"'.$helperappsdir.'" cannot be defined as GETID3_HELPERAPPSDIR because it does not exist');
+				$this->startup_error .= '"'.$helperappsdir.'" cannot be defined as GETID3_HELPERAPPSDIR because it does not exist';
 			} elseif (strpos(realpath($helperappsdir), ' ') !== false) {
 				$DirPieces = explode(GETID3_OS_DIRSLASH, realpath($helperappsdir));
 				foreach ($DirPieces as $key => $value) {
@@ -128,7 +128,7 @@
 					}
 					$DirPieces[$key] = strtoupper($value);
 				}
-				die('GETID3_HELPERAPPSDIR must not have any spaces in it - use 8dot3 naming convention if neccesary (on this server that would be something like "'.implode(GETID3_OS_DIRSLASH, $DirPieces).'" - NOTE: this may or may not be the actual 8.3 equivalent of "'.$helperappsdir.'", please double-check). You can run "dir /x" from the commandline to see the correct 8.3-style names. You need to edit the file "'.GETID3_INCLUDEPATH.'/getid3.php" around line '.(__LINE__ - 16));
+				$this->startup_error .= 'GETID3_HELPERAPPSDIR must not have any spaces in it - use 8dot3 naming convention if neccesary (on this server that would be something like "'.implode(GETID3_OS_DIRSLASH, $DirPieces).'" - NOTE: this may or may not be the actual 8.3 equivalent of "'.$helperappsdir.'", please double-check). You can run "dir /x" from the commandline to see the correct 8.3-style names. You need to edit the file "'.GETID3_INCLUDEPATH.'/getid3.php" around line '.(__LINE__ - 16);
 			}
 			define('GETID3_HELPERAPPSDIR', realpath($helperappsdir).GETID3_OS_DIRSLASH);
 		}
@@ -140,19 +140,37 @@
 	// public: analyze file - replaces GetAllFileInfo() and GetTagOnly()
 	function analyze($filename) {
 
+		if (!empty($this->startup_error)) {
+			return $this->error($this->startup_error);
+		}
+		if (!empty($this->startup_warning)) {
+			$this->warning($this->startup_warning);
+		}
+
+		// init result array and set parameters
+		$this->info = array();
+		$this->info['GETID3_VERSION'] = GETID3_VERSION;
+
+		// Check encoding/iconv support
+		if (!function_exists('iconv') && !in_array($this->encoding, array('ISO-8859-1', 'UTF-8', 'UTF-16LE', 'UTF-16BE', 'UTF-16'))) {
+			$errormessage = 'iconv() support is needed for encodings other than ISO-8859-1, UTF-8, UTF-16LE, UTF16-BE, UTF-16. ';
+			if (GETID3_OS_ISWINDOWS) {
+				$errormessage .= 'PHP does not have iconv() support. Please enable php_iconv.dll in php.ini, and copy iconv.dll from c:/php/dlls to c:/windows/system32';
+			} else {
+				$errormessage .= 'PHP is not compiled with iconv() support. Please recompile with the --with-iconv switch';
+			}
+	    	return $this->error($errormessage);
+		}
+
 		// Disable magic_quotes_runtime, if neccesary
 		$old_magic_quotes_runtime = get_magic_quotes_runtime(); // store current setting of magic_quotes_runtime
 		if ($old_magic_quotes_runtime) {
 			set_magic_quotes_runtime(0);                        // turn off magic_quotes_runtime
 			if (get_magic_quotes_runtime()) {
-				die('Could not disable magic_quotes_runtime - getID3() cannot work properly with this setting enabled');
+				return $this->error('Could not disable magic_quotes_runtime - getID3() cannot work properly with this setting enabled');
 			}
 		}
 
-		// init result array and set parameters
-		$this->info = array();
-		$this->info['GETID3_VERSION'] = GETID3_VERSION;
-
 		// remote files not supported
 		if (preg_match('/^(ht|f)tp:\/\//', $filename)) {
 			return $this->error('Remote files are not supported in this version of getID3() - please copy the file locally first');
@@ -226,11 +244,10 @@
 		}
 
 
-
 		// handle ID3v1 tag
 		if ($this->option_tag_id3v1) {
 			if (!@include_once(GETID3_INCLUDEPATH.'module.tag.id3v1.php')) {
-				die('module.tag.id3v1.php is missing - you may disable option_tag_id3v1.');
+				return $this->error('module.tag.id3v1.php is missing - you may disable option_tag_id3v1.');
 			}
 			$tag = new getid3_id3v1($fp, $this->info);
 		}
@@ -238,7 +255,7 @@
 		// handle APE tag
 		if ($this->option_tag_apetag) {
 			if (!@include_once(GETID3_INCLUDEPATH.'module.tag.apetag.php')) {
-				die('module.tag.apetag.php is missing - you may disable option_tag_apetag.');
+				return $this->error('module.tag.apetag.php is missing - you may disable option_tag_apetag.');
 			}
 			$tag = new getid3_apetag($fp, $this->info);
 		}
@@ -246,7 +263,7 @@
 		// handle lyrics3 tag
 		if ($this->option_tag_lyrics3) {
 			if (!@include_once(GETID3_INCLUDEPATH.'module.tag.lyrics3.php')) {
-				die('module.tag.lyrics3.php is missing - you may disable option_tag_lyrics3.');
+				return $this->error('module.tag.lyrics3.php is missing - you may disable option_tag_lyrics3.');
 			}
 			$tag = new getid3_lyrics3($fp, $this->info);
 		}
@@ -269,8 +286,7 @@
 			if ($determined_format['fail_id3'] === 'ERROR') {
 				fclose($fp);
 				return $this->error('ID3 tags not allowed on this file type.');
-			}
-			elseif ($determined_format['fail_id3'] === 'WARNING') {
+			} elseif ($determined_format['fail_id3'] === 'WARNING') {
 				$this->info['warning'][] = 'ID3 tags not allowed on this file type.';
 			}
 		}
@@ -280,8 +296,7 @@
 			if ($determined_format['fail_ape'] === 'ERROR') {
 				fclose($fp);
 				return $this->error('APE tags not allowed on this file type.');
-			}
-			elseif ($determined_format['fail_ape'] === 'WARNING') {
+			} elseif ($determined_format['fail_ape'] === 'WARNING') {
 				$this->info['warning'][] = 'APE tags not allowed on this file type.';
 			}
 		}
@@ -295,7 +310,12 @@
 			return $this->error('Format not supported, module, '.$determined_format['include'].', was removed.');
 		}
 
-		// require module
+		// module requires iconv support
+        if (!function_exists('iconv') && @$determined_format['iconv_req']) {
+		    return $this->error('iconv support is required for this module ('.$determined_format['include'].').');
+		}
+
+		// include module
 		include_once(GETID3_INCLUDEPATH.$determined_format['include']);
 
 		// instantiate module class
@@ -351,15 +371,22 @@
 
 
 	// private: error handling
-	function error($msg) {
+	function error($message) {
 
 		$this->CleanUp();
 
-		$this->info['error'][] = $msg;
+		$this->info['error'][] = $message;
 		return $this->info;
 	}
 
 
+	// private: warning handling
+	function warning($message) {
+		$this->info['warning'][] = $message;
+		return true;
+	}
+
+
 	// private: CleanUp
 	function CleanUp() {
 
@@ -375,16 +402,22 @@
 		}
 
 		// remove empty root keys
-		foreach ($this->info as $key => $value) {
-			if (empty($this->info[$key]) && ($this->info[$key] !== 0) && ($this->info[$key] !== '0')) {
-				unset($this->info[$key]);
+		if (!empty($this->info)) {
+			foreach ($this->info as $key => $value) {
+				if (empty($this->info[$key]) && ($this->info[$key] !== 0) && ($this->info[$key] !== '0')) {
+					unset($this->info[$key]);
+				}
 			}
 		}
 
 		// remove meaningless entries from unknown-format files
 		if (empty($this->info['fileformat'])) {
-			unset($this->info['avdataoffset']);
-			unset($this->info['avdataend']);
+			if (isset($this->info['avdataoffset'])) {
+				unset($this->info['avdataoffset']);
+			}
+			if (isset($this->info['avdataend'])) {
+				unset($this->info['avdataend']);
+			}
 		}
 	}
 
@@ -412,7 +445,7 @@
 							'module'    => 'aac',
 							'option'    => 'adif',
 							'mime_type' => 'application/octet-stream',
-							'fail_ape'  => 'WARNING'
+							'fail_ape'  => 'WARNING',
 						  ),
 
 
@@ -423,7 +456,7 @@
 							'module'    => 'aac',
 							'option'    => 'adts',
 							'mime_type' => 'application/octet-stream',
-							'fail_ape'  => 'WARNING'
+							'fail_ape'  => 'WARNING',
 						  ),
 
 
@@ -565,11 +598,13 @@
 							'group'     => 'audio',
 							'module'    => 'shorten',
 							'mime_type' => 'audio/xmms-shn',
+							'fail_id3'  => 'ERROR',
+							'fail_ape'  => 'ERROR',
 						  ),
 
-				// TTA  - audio       - TTA Lossless Audio Compressor (http://tta.iszf.irk.ru/)
+				// TTA  - audio       - TTA Lossless Audio Compressor (http://tta.corecodec.org)
 				'tta'  => array(
-							'pattern'   => '^TTA',  // could also be '^TTA'."\x01"
+							'pattern'   => '^TTA',  // could also be '^TTA(\x01|\x02|\x03|2|1)'
 							'group'     => 'audio',
 							'module'    => 'tta',
 							'mime_type' => 'application/octet-stream',
@@ -591,7 +626,15 @@
 							'mime_type' => 'application/octet-stream',
 						  ),
 
+				// WV  - audio        - WavPack (v4.0+)
+				'wv'   => array(
+							'pattern'   => '^wvpk',
+							'group'     => 'audio',
+							'module'    => 'wavpack',
+							'mime_type' => 'application/octet-stream',
+						  ),
 
+
 				// Audio-Video formats
 
 				// ASF  - audio/video - Advanced Streaming Format, Windows Media Video, Windows Media Audio
@@ -600,6 +643,7 @@
 							'group'     => 'audio-video',
 							'module'    => 'asf',
 							'mime_type' => 'video/x-ms-asf',
+							'iconv_req' => false,
 						  ),
 
 				// BINK  - audio/video - Bink / Smacker
@@ -641,7 +685,7 @@
 							'module'    => 'ogg',
 							'mime_type' => 'application/ogg',
 							'fail_id3'  => 'WARNING',
-							'fail_ape'  => 'WARNING'
+							'fail_ape'  => 'WARNING',
 						  ),
 
 				// QT   - audio/video - Quicktime
@@ -658,7 +702,7 @@
 							'group'     => 'audio-video',
 							'module'    => 'riff',
 							'mime_type' => 'audio/x-wave',
-							'fail_ape'  => 'WARNING'
+							'fail_ape'  => 'WARNING',
 						  ),
 
 				// Real - audio/video - RealAudio, RealVideo
@@ -687,7 +731,7 @@
 							'module'    => 'bmp',
 							'mime_type' => 'image/bmp',
 							'fail_id3'  => 'ERROR',
-							'fail_ape'  => 'ERROR'
+							'fail_ape'  => 'ERROR',
 						  ),
 
 				// GIF  - still image - Graphics Interchange Format
@@ -697,7 +741,7 @@
 							'module'    => 'gif',
 							'mime_type' => 'image/gif',
 							'fail_id3'  => 'ERROR',
-							'fail_ape'  => 'ERROR'
+							'fail_ape'  => 'ERROR',
 						  ),
 
 				// JPEG - still image - Joint Photographic Experts Group (JPEG)
@@ -705,9 +749,9 @@
 							'pattern'   => '^\xFF\xD8\xFF',
 							'group'     => 'graphic',
 							'module'    => 'jpg',
-							'mime_type' => 'image/jpg',
+							'mime_type' => 'image/jpeg',
 							'fail_id3'  => 'ERROR',
-							'fail_ape'  => 'ERROR'
+							'fail_ape'  => 'ERROR',
 						  ),
 
 				// PCD  - still image - Kodak Photo CD
@@ -717,7 +761,7 @@
 							'module'    => 'pcd',
 							'mime_type' => 'image/x-photo-cd',
 							'fail_id3'  => 'ERROR',
-							'fail_ape'  => 'ERROR'
+							'fail_ape'  => 'ERROR',
 						  ),
 
 
@@ -728,26 +772,23 @@
 							'module'    => 'png',
 							'mime_type' => 'image/png',
 							'fail_id3'  => 'ERROR',
-							'fail_ape'  => 'ERROR'
+							'fail_ape'  => 'ERROR',
 						  ),
 
 
-				// Data formats
-
-				// EXE  - data        - EXEcutable program (EXE, COM)
-
-				/*
-				'exe'  => array(
-							'pattern'   => '^MZ',
-							'group'     => 'misc',
-							'module'    => 'exe',
-							'mime_type' => 'application/octet-stream',
+				// TIFF  - still image - Tagged Information File Format (TIFF)
+				'tiff' => array(
+							'pattern'   => '^(II\x2A\x00|MM\x00\x2A)',
+							'group'     => 'graphic',
+							'module'    => 'tiff',
+							'mime_type' => 'image/tiff',
 							'fail_id3'  => 'ERROR',
-							'fail_ape'  => 'ERROR'
+							'fail_ape'  => 'ERROR',
 						  ),
-				*/
 
 
+				// Data formats
+
 				// ISO  - data        - International Standards Organization (ISO) CD-ROM Image
 				'iso'  => array(
 							'pattern'   => '^.{32769}CD001',
@@ -755,7 +796,8 @@
 							'module'    => 'iso',
 							'mime_type' => 'application/octet-stream',
 							'fail_id3'  => 'ERROR',
-							'fail_ape'  => 'ERROR'
+							'fail_ape'  => 'ERROR',
+							'iconv_req' => false,
 						  ),
 
 				// RAR  - data        - RAR compressed data
@@ -765,7 +807,7 @@
 							'module'    => 'rar',
 							'mime_type' => 'application/octet-stream',
 							'fail_id3'  => 'ERROR',
-							'fail_ape'  => 'ERROR'
+							'fail_ape'  => 'ERROR',
 						  ),
 
 				// SZIP - audio       - SZIP compressed data
@@ -775,9 +817,29 @@
 							'module'    => 'szip',
 							'mime_type' => 'application/octet-stream',
 							'fail_id3'  => 'ERROR',
-							'fail_ape'  => 'ERROR'
+							'fail_ape'  => 'ERROR',
 						  ),
 
+				// TAR  - data        - TAR compressed data
+				'tar'  => array(
+							'pattern'   => '^.{100}[0-9\x20]{7}\x00[0-9\x20]{7}\x00[0-9\x20]{7}\x00[0-9\x20\x00]{12}[0-9\x20\x00]{12}',
+							'group'     => 'archive',
+							'module'    => 'tar',
+							'mime_type' => 'application/x-tar',
+							'fail_id3'  => 'ERROR',
+							'fail_ape'  => 'ERROR',
+						  ),
+
+				// GZIP  - data        - GZIP compressed data
+				'gz'  => array(
+							'pattern'   => '^\x1F\x8B\x08',
+							'group'     => 'archive',
+							'module'    => 'gzip',
+							'mime_type' => 'application/x-gzip',
+							'fail_id3'  => 'ERROR',
+							'fail_ape'  => 'ERROR',
+						  ),
+
 				// ZIP  - data        - ZIP compressed data
 				'zip'  => array(
 							'pattern'   => '^PK\x03\x04',
@@ -785,7 +847,7 @@
 							'module'    => 'zip',
 							'mime_type' => 'application/zip',
 							'fail_id3'  => 'ERROR',
-							'fail_ape'  => 'ERROR'
+							'fail_ape'  => 'ERROR',
 						  )
 			);
 		}
@@ -812,13 +874,31 @@
 			}
 		}
 
-		// Too many mp3 encoders on the market put gabage in front of mpeg files
-		// use assume format on these if format detection failed
+
 		if (preg_match('/\.mp[123a]$/i', $filename)) {
+
+			// Too many mp3 encoders on the market put gabage in front of mpeg files
+			// use assume format on these if format detection failed
 			$GetFileFormatArray = $this->GetFileFormatArray();
 			$info = $GetFileFormatArray['mp3'];
 			$info['include'] = 'module.'.$info['group'].'.'.$info['module'].'.php';
 			return $info;
+
+		//} elseif (preg_match('/\.tar$/i', $filename)) {
+        //
+		//	// TAR files don't have any useful header to work from
+		//	// TAR  - data        - TAR compressed data
+		//	$info = array(
+		//		'pattern'   => '^.{512}',
+		//		'group'     => 'archive',
+		//		'module'    => 'tar',
+		//		'mime_type' => 'application/octet-stream',
+		//		'fail_id3'  => 'ERROR',
+		//		'fail_ape'  => 'ERROR',
+		//	);
+		//	$info['include'] = 'module.'.$info['group'].'.'.$info['module'].'.php';
+		//	return $info;
+
 		}
 
 		return false;
@@ -860,13 +940,14 @@
 				'nsv'       => array('nsv'           , 'ISO-8859-1'),
 				'ogg'       => array('vorbiscomment' , 'UTF-8'),
 				'png'       => array('png'           , 'UTF-8'),
+				'tiff'      => array('tiff'          , 'ISO-8859-1'),
 				'quicktime' => array('quicktime'     , 'ISO-8859-1'),
 				'real'      => array('real'          , 'ISO-8859-1'),
 				'vqf'       => array('vqf'           , 'ISO-8859-1'),
 				'zip'       => array('zip'           , 'ISO-8859-1'),
 				'riff'      => array('riff'          , 'ISO-8859-1'),
 				'lyrics3'   => array('lyrics3'       , 'ISO-8859-1'),
-				'id3v1'     => array('id3v1'         , 'ISO-8859-1'),
+				'id3v1'     => array('id3v1'         , $this->encoding_id3v1),
 				'id3v2'     => array('id3v2'         , 'UTF-8'), // not according to the specs (every frame can have a different encoding), but getID3() force-converts all encodings to UTF-8
 				'ape'       => array('ape'           , 'UTF-8')
 			);
@@ -901,7 +982,8 @@
 					foreach ($this->info['tags'][$tag_name] as $tag_key => $valuearray) {
 						foreach ($valuearray as $key => $value) {
 							if (is_string($value)) {
-								$this->info['tags_html'][$tag_name][$tag_key][$key] = getid3_lib::MultiByteCharString2HTML($value, $encoding);
+								//$this->info['tags_html'][$tag_name][$tag_key][$key] = getid3_lib::MultiByteCharString2HTML($value, $encoding);
+								$this->info['tags_html'][$tag_name][$tag_key][$key] = str_replace('&#0;', '', getid3_lib::MultiByteCharString2HTML($value, $encoding));
 							} else {
 								$this->info['tags_html'][$tag_name][$tag_key][$key] = $value;
 							}
@@ -924,7 +1006,7 @@
 				break;
 
 			default:
-				die('bad algorithm "'.$algorithm.'" in getHashdata()');
+				return $this->error('bad algorithm "'.$algorithm.'" in getHashdata()');
 				break;
 		}
 

Copied: plog/trunk/class/gallery/getid3/module.archive.gzip.php (from rev 2357, plog/branches/plog-1.0.2/class/gallery/getid3/module.archive.gzip.php)

Modified: plog/trunk/class/gallery/getid3/module.archive.rar.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.archive.rar.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.archive.rar.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_rar
 {
 

Modified: plog/trunk/class/gallery/getid3/module.archive.szip.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.archive.szip.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.archive.szip.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_szip
 {
 

Copied: plog/trunk/class/gallery/getid3/module.archive.tar.php (from rev 2357, plog/branches/plog-1.0.2/class/gallery/getid3/module.archive.tar.php)

Modified: plog/trunk/class/gallery/getid3/module.archive.zip.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.archive.zip.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.archive.zip.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,17 +13,15 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_zip
 {
 
 	function getid3_zip(&$fd, &$ThisFileInfo) {
 
-		$ThisFileInfo['fileformat'] = 'zip';
+		$ThisFileInfo['fileformat']      = 'zip';
 		$ThisFileInfo['zip']['encoding'] = 'ISO-8859-1';
-		$ThisFileInfo['zip']['files'] = array();
+		$ThisFileInfo['zip']['files']    = array();
 
 		$ThisFileInfo['zip']['compressed_size']   = 0;
 		$ThisFileInfo['zip']['uncompressed_size'] = 0;
@@ -43,7 +41,7 @@
 				$ThisFileInfo['zip']['end_central_directory'] = $this->ZIPparseEndOfCentralDirectory($fd);
 
 				fseek($fd, $ThisFileInfo['zip']['end_central_directory']['directory_offset'], SEEK_SET);
-				$ThisFileInfo['zip']['entries_count']     = 0;
+				$ThisFileInfo['zip']['entries_count'] = 0;
 				while ($centraldirectoryentry = $this->ZIPparseCentralDirectory($fd)) {
 					$ThisFileInfo['zip']['central_directory'][] = $centraldirectoryentry;
 					$ThisFileInfo['zip']['entries_count']++;
@@ -88,6 +86,9 @@
 				$ThisFileInfo['error'][] = 'Warning: Truncated file! - Total compressed file sizes ('.$ThisFileInfo['zip']['compressed_size'].' bytes) is greater than filesize minus Central Directory and End Of Central Directory structures ('.($ThisFileInfo['filesize'] - 46 - 22).' bytes)';
 			}
 			$ThisFileInfo['error'][] = 'Cannot find End Of Central Directory - returned list of files in [zip][entries] array may not be complete';
+			foreach ($ThisFileInfo['zip']['entries'] as $key => $valuearray) {
+				$ThisFileInfo['zip']['files'][$valuearray['filename']] = $valuearray['uncompressed_size'];
+			}
 			return true;
 
 		} else {
@@ -201,13 +202,14 @@
 			$ZIPlocalFileHeader .= fread($fd, $FilenameExtrafieldLength);
 
 			if ($LocalFileHeader['raw']['filename_length'] > 0) {
-				$LocalFileHeader['filename']                    = substr($ZIPlocalFileHeader, 30, $LocalFileHeader['raw']['filename_length']);
+				$LocalFileHeader['filename']                = substr($ZIPlocalFileHeader, 30, $LocalFileHeader['raw']['filename_length']);
 			}
 			if ($LocalFileHeader['raw']['extra_field_length'] > 0) {
 				$LocalFileHeader['raw']['extra_field_data'] = substr($ZIPlocalFileHeader, 30 + $LocalFileHeader['raw']['filename_length'], $LocalFileHeader['raw']['extra_field_length']);
 			}
 		}
 
+		$LocalFileHeader['data_offset'] = ftell($fd);
 		//$LocalFileHeader['compressed_data'] = fread($fd, $LocalFileHeader['raw']['compressed_size']);
 		fseek($fd, $LocalFileHeader['raw']['compressed_size'], SEEK_CUR);
 

Modified: plog/trunk/class/gallery/getid3/module.audio-video.asf.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio-video.asf.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio-video.asf.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -10,7 +10,6 @@
 // module.audio-video.asf.php                                  //
 // module for analyzing ASF, WMA and WMV files                 //
 // dependencies: module.audio-video.riff.php                   //
-//               module.tag.id3v1.php (optional)               //
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
@@ -23,9 +22,7 @@
 }
 
 
-/**
- * \ingroup getid3
- */
+
 class getid3_asf
 {
 
@@ -296,7 +293,7 @@
 						//return false;
 						break;
 					}
-					$thisfile_asf_codeclistobject['codec_entries_count']       = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));
+					$thisfile_asf_codeclistobject['codec_entries_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));
 					$offset += 4;
 					for ($CodecEntryCounter = 0; $CodecEntryCounter < $thisfile_asf_codeclistobject['codec_entries_count']; $CodecEntryCounter++) {
 						// shortcut
@@ -324,8 +321,12 @@
 
 						if ($thisfile_asf_codeclistobject_codecentries_current['type_raw'] == 2) {
 							// audio codec
-							$thisfile_audio['codec'] = $this->TrimConvert($thisfile_asf_codeclistobject_codecentries_current['name']);
+							if (strpos($thisfile_asf_codeclistobject_codecentries_current['description'], ',') === false) {
+								$ThisFileInfo['error'][] = '[asf][codec_list_object][codec_entries]['.$CodecEntryCounter.'][description] expected to contain comma-seperated list of parameters: "'.$thisfile_asf_codeclistobject_codecentries_current['description'].'"';
+								return false;
+							}
 							list($AudioCodecBitrate, $AudioCodecFrequency, $AudioCodecChannels) = explode(',', $this->TrimConvert($thisfile_asf_codeclistobject_codecentries_current['description']));
+							$thisfile_audio['codec'] = $this->TrimConvert($thisfile_asf_codeclistobject_codecentries_current['name']);
 
 							if (!isset($thisfile_audio['bitrate']) && strstr($AudioCodecBitrate, 'kbps')) {
 								$thisfile_audio['bitrate'] = (int) (trim(str_replace('kbps', '', $AudioCodecBitrate)) * 1000);
@@ -733,17 +734,7 @@
 
 							case 'wm/genre':
 							case 'genre':
-								$genre = $this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']);
-
-								// id3v1 module might not be loaded
-								$GETID3_ERRORARRAY = &$ThisFileInfo['warning'];
-								if (getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v1.php', __FILE__, false)) {
-									$CleanedGenre = getid3_id3v1::StandardiseID3v1GenreName($genre); // convert to standard GenreID and back to standard spelling/capitalization
-									if ($CleanedGenre != $genre) {
-										$genre = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', $CleanedGenre);
-									}
-								}
-								$thisfile_asf_comments['genre'] = array($genre);
+								$thisfile_asf_comments['genre'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));
 								break;
 
 							case 'wm/tracknumber':
@@ -773,13 +764,18 @@
 							case 'id3':
 								// id3v2 module might not be loaded
 								if (class_exists('getid3_id3v2')) {
-									if ($tempfilehandle = tmpfile()) {
-										$tempThisfileInfo = array('encoding'=>$ThisFileInfo['encoding']);
-										fwrite($tempfilehandle, $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']);
-										$id3 = new getid3_id3v2($tempfilehandle, $tempThisfileInfo);
-										fclose($tempfilehandle);
-										$ThisFileInfo['id3v2'] = $tempThisfileInfo['id3v2'];
-									}
+								    $tempfile         = tempnam('*', 'getID3');
+								    $tempfilehandle   = fopen($tempfile, "wb");
+									$tempThisfileInfo = array('encoding'=>$ThisFileInfo['encoding']);
+									fwrite($tempfilehandle, $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']);
+									fclose($tempfilehandle);
+									
+									$tempfilehandle = fopen($tempfile, "rb");
+									$id3 = new getid3_id3v2($tempfilehandle, $tempThisfileInfo);
+									fclose($tempfilehandle);
+									unlink($tempfile);
+									
+									$ThisFileInfo['id3v2'] = $tempThisfileInfo['id3v2'];
 								}
 								break;
 
@@ -1391,8 +1387,8 @@
 			$GUIDarray['GETID3_ASF_Stream_Prioritization_Object']        = 'D4FED15B-88D3-454F-81F0-ED5C45999E24';
 			$GUIDarray['GETID3_ASF_Payload_Ext_System_Content_Type']     = 'D590DC20-07BC-436C-9CF7-F3BBFBF1A4DC';
 			$GUIDarray['GETID3_ASF_Old_File_Properties_Object']          = 'D6E229D0-35DA-11D1-9034-00A0C90349BE';
-			$GUIDarray['GETID3_ASF_Old_GETID3_ASF_Header_Object']               = 'D6E229D1-35DA-11D1-9034-00A0C90349BE';
-			$GUIDarray['GETID3_ASF_Old_GETID3_ASF_Data_Object']                 = 'D6E229D2-35DA-11D1-9034-00A0C90349BE';
+			$GUIDarray['GETID3_ASF_Old_ASF_Header_Object']               = 'D6E229D1-35DA-11D1-9034-00A0C90349BE';
+			$GUIDarray['GETID3_ASF_Old_ASF_Data_Object']                 = 'D6E229D2-35DA-11D1-9034-00A0C90349BE';
 			$GUIDarray['GETID3_ASF_Index_Object']                        = 'D6E229D3-35DA-11D1-9034-00A0C90349BE';
 			$GUIDarray['GETID3_ASF_Old_Stream_Properties_Object']        = 'D6E229D4-35DA-11D1-9034-00A0C90349BE';
 			$GUIDarray['GETID3_ASF_Old_Content_Description_Object']      = 'D6E229D5-35DA-11D1-9034-00A0C90349BE';
@@ -1440,7 +1436,7 @@
 			$GUIDarray['GETID3_ASF_Mutex_Language']                      = 'D6E22A00-35DA-11D1-9034-00A0C90349BE';
 			$GUIDarray['GETID3_ASF_Mutex_Bitrate']                       = 'D6E22A01-35DA-11D1-9034-00A0C90349BE';
 			$GUIDarray['GETID3_ASF_Mutex_Unknown']                       = 'D6E22A02-35DA-11D1-9034-00A0C90349BE';
-			$GUIDarray['GETID3_ASF_Old_GETID3_ASF_Placeholder_Object']          = 'D6E22A0E-35DA-11D1-9034-00A0C90349BE';
+			$GUIDarray['GETID3_ASF_Old_ASF_Placeholder_Object']          = 'D6E22A0E-35DA-11D1-9034-00A0C90349BE';
 			$GUIDarray['GETID3_ASF_Old_Data_Unit_Extension_Object']      = 'D6E22A0F-35DA-11D1-9034-00A0C90349BE';
 			$GUIDarray['GETID3_ASF_Web_Stream_Format']                   = 'DA1E6B13-8359-4050-B398-388E965BF00C';
 			$GUIDarray['GETID3_ASF_Payload_Ext_System_File_Name']        = 'E165EC0E-19ED-45D7-B4A7-25CBD1E28E9B';
@@ -1537,7 +1533,7 @@
 		// UNIX timestamp is number of seconds since January 1, 1970
 		// 116444736000000000 = 10000000 * 60 * 60 * 24 * 365 * 369 + 89 leap days
 		if ($round) {
-			return round(($FILETIME - 116444736000000000) / 10000000);
+			return intval(round(($FILETIME - 116444736000000000) / 10000000));
 		}
 		return ($FILETIME - 116444736000000000) / 10000000;
 	}

Modified: plog/trunk/class/gallery/getid3/module.audio-video.bink.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio-video.bink.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio-video.bink.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_bink
 {
 

Modified: plog/trunk/class/gallery/getid3/module.audio-video.matroska.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio-video.matroska.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio-video.matroska.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_matroska
 {
 

Modified: plog/trunk/class/gallery/getid3/module.audio-video.mpeg.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio-video.mpeg.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio-video.mpeg.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -24,9 +24,7 @@
 define('GETID3_MPEG_VIDEO_GROUP_START',     "\x00\x00\x01\xB8");
 define('GETID3_MPEG_AUDIO_START',           "\x00\x00\x01\xC0");
 
-/**
- * \ingroup getid3
- */
+
 class getid3_mpeg
 {
 

Modified: plog/trunk/class/gallery/getid3/module.audio-video.nsv.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio-video.nsv.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio-video.nsv.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_nsv
 {
 
@@ -75,30 +73,30 @@
 
 		$ThisFileInfo['nsv']['NSVs']['offset']          = $fileoffset;
 
-		$ThisFileInfo['nsv']['NSVs']['video_codec']     =                  substr($NSVsheader, $offset, 4);
+		$ThisFileInfo['nsv']['NSVs']['video_codec']     =                              substr($NSVsheader, $offset, 4);
 		$offset += 4;
-		$ThisFileInfo['nsv']['NSVs']['audio_codec']     =                  substr($NSVsheader, $offset, 4);
+		$ThisFileInfo['nsv']['NSVs']['audio_codec']     =                              substr($NSVsheader, $offset, 4);
 		$offset += 4;
 		$ThisFileInfo['nsv']['NSVs']['resolution_x']    = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 2));
 		$offset += 2;
 		$ThisFileInfo['nsv']['NSVs']['resolution_y']    = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 2));
 		$offset += 2;
 
-		$ThisFileInfo['nsv']['NSVs']['framerate_index'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 2));
+		$ThisFileInfo['nsv']['NSVs']['framerate_index'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1));
 		$offset += 1;
-		$ThisFileInfo['nsv']['NSVs']['unknown1b']       = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1));
+		//$ThisFileInfo['nsv']['NSVs']['unknown1b']       = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1));
 		$offset += 1;
-		$ThisFileInfo['nsv']['NSVs']['unknown1c']       = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1));
+		//$ThisFileInfo['nsv']['NSVs']['unknown1c']       = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1));
 		$offset += 1;
-		$ThisFileInfo['nsv']['NSVs']['unknown1d']       = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1));
+		//$ThisFileInfo['nsv']['NSVs']['unknown1d']       = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1));
 		$offset += 1;
-		$ThisFileInfo['nsv']['NSVs']['unknown2a']       = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1));
+		//$ThisFileInfo['nsv']['NSVs']['unknown2a']       = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1));
 		$offset += 1;
-		$ThisFileInfo['nsv']['NSVs']['unknown2b']       = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1));
+		//$ThisFileInfo['nsv']['NSVs']['unknown2b']       = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1));
 		$offset += 1;
-		$ThisFileInfo['nsv']['NSVs']['unknown2c']       = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1));
+		//$ThisFileInfo['nsv']['NSVs']['unknown2c']       = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1));
 		$offset += 1;
-		$ThisFileInfo['nsv']['NSVs']['unknown2d']       = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1));
+		//$ThisFileInfo['nsv']['NSVs']['unknown2d']       = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1));
 		$offset += 1;
 
 		switch ($ThisFileInfo['nsv']['NSVs']['audio_codec']) {
@@ -116,14 +114,8 @@
 			case 'MP3 ':
 			case 'NONE':
 			default:
-				$ThisFileInfo['nsv']['NSVs']['unknown3a']    = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1));
-				$offset += 1;
-				$ThisFileInfo['nsv']['NSVs']['unknown3b']    = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1));
-				$offset += 1;
-				$ThisFileInfo['nsv']['NSVs']['unknown3c']    = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1));
-				$offset += 1;
-				$ThisFileInfo['nsv']['NSVs']['unknown3d']    = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1));
-				$offset += 1;
+				//$ThisFileInfo['nsv']['NSVs']['unknown3']     = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 4));
+				$offset += 4;
 				break;
 		}
 

Modified: plog/trunk/class/gallery/getid3/module.audio-video.quicktime.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio-video.quicktime.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio-video.quicktime.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -5,24 +5,23 @@
 //            or http://www.getid3.org                         //
 /////////////////////////////////////////////////////////////////
 // See readme.txt for more details                             //
+/////////////////////////////////////////////////////////////////
+//                                                             //
+// module.audio-video.quicktime.php                            //
+// module for analyzing Quicktime and MP3-in-MP4 files         //
+// dependencies: module.audio.mp3.php                          //
+//                                                            ///
+/////////////////////////////////////////////////////////////////
 
+getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.mp3.php', __FILE__, true);
 
-getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.mp3.php', __FILE__, true);
-/**
- * \ingroup getid3
- *
- *                                                             //
- * module.audio-video.quicktime.php                            //
- * module for analyzing Quicktime and MP3-in-MP4 files         //
- * dependencies: module.audio.mp3.php                          //
- *                                                            ///
-*/
 class getid3_quicktime
 {
 
 	function getid3_quicktime(&$fd, &$ThisFileInfo, $ReturnAtomData=true, $ParseAllPossibleAtoms=false) {
 
-		$ThisFileInfo['fileformat']          = 'quicktime';
+		$ThisFileInfo['fileformat'] = 'quicktime';
+		$ThisFileInfo['quicktime']['hinting'] = false;
 
 		fseek($fd, $ThisFileInfo['avdataoffset'], SEEK_SET);
 
@@ -35,9 +34,9 @@
 
 			$atomsize = getid3_lib::BigEndian2Int(substr($AtomHeader, 0, 4));
 			$atomname =               substr($AtomHeader, 4, 4);
-			$ThisFileInfo['quicktime']["$atomname"]['name']   = $atomname;
-			$ThisFileInfo['quicktime']["$atomname"]['size']   = $atomsize;
-			$ThisFileInfo['quicktime']["$atomname"]['offset'] = $offset;
+			$ThisFileInfo['quicktime'][$atomname]['name']   = $atomname;
+			$ThisFileInfo['quicktime'][$atomname]['size']   = $atomsize;
+			$ThisFileInfo['quicktime'][$atomname]['offset'] = $offset;
 
 			if (($offset + $atomsize) > $ThisFileInfo['avdataend']) {
 				$ThisFileInfo['error'][] = 'Atom at offset '.$offset.' claims to go beyond end-of-file (length: '.$atomsize.' bytes)';
@@ -53,11 +52,11 @@
 			switch ($atomname) {
 				case 'mdat': // Media DATa atom
 					// 'mdat' contains the actual data for the audio/video
-					if (($atomsize > 8) && (!isset($ThisFileInfo['avdataend_tmp']) || ($ThisFileInfo['quicktime']["$atomname"]['size'] > ($ThisFileInfo['avdataend_tmp'] - $ThisFileInfo['avdataoffset'])))) {
+					if (($atomsize > 8) && (!isset($ThisFileInfo['avdataend_tmp']) || ($ThisFileInfo['quicktime'][$atomname]['size'] > ($ThisFileInfo['avdataend_tmp'] - $ThisFileInfo['avdataoffset'])))) {
 
-						$ThisFileInfo['avdataoffset'] = $ThisFileInfo['quicktime']["$atomname"]['offset'] + 8;
+						$ThisFileInfo['avdataoffset'] = $ThisFileInfo['quicktime'][$atomname]['offset'] + 8;
 						$OldAVDataEnd                 = $ThisFileInfo['avdataend'];
-						$ThisFileInfo['avdataend']    = $ThisFileInfo['quicktime']["$atomname"]['offset'] + $ThisFileInfo['quicktime']["$atomname"]['size'];
+						$ThisFileInfo['avdataend']    = $ThisFileInfo['quicktime'][$atomname]['offset'] + $ThisFileInfo['quicktime'][$atomname]['size'];
 
 						if (getid3_mp3::MPEGaudioHeaderValid(getid3_mp3::MPEGaudioHeaderDecode(fread($fd, 4)))) {
 							getid3_mp3::getOnlyMPEGaudioInfo($fd, $ThisFileInfo, $ThisFileInfo['avdataoffset'], false);
@@ -85,7 +84,7 @@
 
 				default:
 					$atomHierarchy = array();
-					$ThisFileInfo['quicktime']["$atomname"] = $this->QuicktimeParseAtom($atomname, $atomsize, fread($fd, $atomsize), $ThisFileInfo, $offset, $atomHierarchy, $ParseAllPossibleAtoms);
+					$ThisFileInfo['quicktime'][$atomname] = $this->QuicktimeParseAtom($atomname, $atomsize, fread($fd, $atomsize), $ThisFileInfo, $offset, $atomHierarchy, $ParseAllPossibleAtoms);
 					break;
 			}
 
@@ -205,7 +204,7 @@
 
 
 			case 'play': // auto-PLAY atom
-				$atomstructure['autoplay']            = (bool) getid3_lib::BigEndian2Int(substr($atomdata,  0, 1));
+				$atomstructure['autoplay']             = (bool) getid3_lib::BigEndian2Int(substr($atomdata,  0, 1));
 
 				$ThisFileInfo['quicktime']['autoplay'] = $atomstructure['autoplay'];
 				break;
@@ -235,7 +234,7 @@
 			case 'cmvd': // Compressed MooV Data atom
 				// Code by ubergeekØubergeek*tv based on information from
 				// http://developer.apple.com/quicktime/icefloe/dispatch012.html
-				$atomstructure['unCompressedSize'] = getid3_lib::BigEndian2Int(substr($atomdata,  0, 4));
+				$atomstructure['unCompressedSize'] = getid3_lib::BigEndian2Int(substr($atomdata, 0, 4));
 
 				$CompressedFileData = substr($atomdata, 4);
 				if ($UncompressedHeader = @gzuncompress($CompressedFileData)) {
@@ -286,14 +285,14 @@
 
 			case 'rmcs': // Reference Movie Cpu Speed atom
 				$atomstructure['version']          = getid3_lib::BigEndian2Int(substr($atomdata,  0, 1));
-				$atomstructure['flags_raw']        = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x000
+				$atomstructure['flags_raw']        = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x0000
 				$atomstructure['cpu_speed_rating'] = getid3_lib::BigEndian2Int(substr($atomdata,  4, 2));
 				break;
 
 
 			case 'rmvc': // Reference Movie Version Check atom
 				$atomstructure['version']            = getid3_lib::BigEndian2Int(substr($atomdata,  0, 1));
-				$atomstructure['flags_raw']          = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x000
+				$atomstructure['flags_raw']          = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x0000
 				$atomstructure['gestalt_selector']   =                           substr($atomdata,  4, 4);
 				$atomstructure['gestalt_value_mask'] = getid3_lib::BigEndian2Int(substr($atomdata,  8, 4));
 				$atomstructure['gestalt_value']      = getid3_lib::BigEndian2Int(substr($atomdata, 12, 4));
@@ -303,7 +302,7 @@
 
 			case 'rmcd': // Reference Movie Component check atom
 				$atomstructure['version']                = getid3_lib::BigEndian2Int(substr($atomdata,  0, 1));
-				$atomstructure['flags_raw']              = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x000
+				$atomstructure['flags_raw']              = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x0000
 				$atomstructure['component_type']         =                           substr($atomdata,  4, 4);
 				$atomstructure['component_subtype']      =                           substr($atomdata,  8, 4);
 				$atomstructure['component_manufacturer'] =                           substr($atomdata, 12, 4);
@@ -315,7 +314,7 @@
 
 			case 'rmdr': // Reference Movie Data Rate atom
 				$atomstructure['version']       = getid3_lib::BigEndian2Int(substr($atomdata,  0, 1));
-				$atomstructure['flags_raw']     = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x000
+				$atomstructure['flags_raw']     = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x0000
 				$atomstructure['data_rate']     = getid3_lib::BigEndian2Int(substr($atomdata,  4, 4));
 
 				$atomstructure['data_rate_bps'] = $atomstructure['data_rate'] * 10;
@@ -324,7 +323,7 @@
 
 			case 'rmla': // Reference Movie Language Atom
 				$atomstructure['version']     = getid3_lib::BigEndian2Int(substr($atomdata,  0, 1));
-				$atomstructure['flags_raw']   = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x000
+				$atomstructure['flags_raw']   = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x0000
 				$atomstructure['language_id'] = getid3_lib::BigEndian2Int(substr($atomdata,  4, 2));
 
 				$atomstructure['language']    = $this->QuicktimeLanguageLookup($atomstructure['language_id']);
@@ -336,14 +335,38 @@
 
 			case 'rmla': // Reference Movie Language Atom
 				$atomstructure['version']   = getid3_lib::BigEndian2Int(substr($atomdata,  0, 1));
-				$atomstructure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x000
+				$atomstructure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x0000
 				$atomstructure['track_id']  = getid3_lib::BigEndian2Int(substr($atomdata,  4, 2));
 				break;
 
 
+			case 'ptv ': // Print To Video - defines a movie's full screen mode
+				// http://developer.apple.com/documentation/QuickTime/APIREF/SOURCESIV/at_ptv-_pg.htm
+				$atomstructure['display_size_raw']  = getid3_lib::BigEndian2Int(substr($atomdata, 0, 2));
+				$atomstructure['reserved_1']        = getid3_lib::BigEndian2Int(substr($atomdata, 2, 2)); // hardcoded: 0x0000
+				$atomstructure['reserved_2']        = getid3_lib::BigEndian2Int(substr($atomdata, 4, 2)); // hardcoded: 0x0000
+				$atomstructure['slide_show_flag']   = getid3_lib::BigEndian2Int(substr($atomdata, 6, 1));
+				$atomstructure['play_on_open_flag'] = getid3_lib::BigEndian2Int(substr($atomdata, 7, 1));
+
+				$atomstructure['flags']['play_on_open'] = (bool) $atomstructure['play_on_open_flag'];
+				$atomstructure['flags']['slide_show']   = (bool) $atomstructure['slide_show_flag'];
+
+				$ptv_lookup[0] = 'normal';
+				$ptv_lookup[1] = 'double';
+				$ptv_lookup[2] = 'half';
+				$ptv_lookup[3] = 'full';
+				$ptv_lookup[4] = 'current';
+				if (isset($ptv_lookup[$atomstructure['display_size_raw']])) {
+					$atomstructure['display_size'] = $ptv_lookup[$atomstructure['display_size_raw']];
+				} else {
+					$ThisFileInfo['warning'][] = 'unknown "ptv " display constant ('.$atomstructure['display_size_raw'].')';
+				}
+				break;
+
+
 			case 'stsd': // Sample Table Sample Description atom
 				$atomstructure['version']        = getid3_lib::BigEndian2Int(substr($atomdata,  0, 1));
-				$atomstructure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x000
+				$atomstructure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x0000
 				$atomstructure['number_entries'] = getid3_lib::BigEndian2Int(substr($atomdata,  4, 4));
 				$stsdEntriesDataOffset = 8;
 				for ($i = 0; $i < $atomstructure['number_entries']; $i++) {
@@ -392,10 +415,14 @@
 									$ThisFileInfo['audio']['sample_rate']              = $ThisFileInfo['quicktime']['audio']['sample_rate'];
 									$ThisFileInfo['audio']['channels']                 = $ThisFileInfo['quicktime']['audio']['channels'];
 									$ThisFileInfo['audio']['bits_per_sample']          = $ThisFileInfo['quicktime']['audio']['bit_depth'];
-									if ($ThisFileInfo['audio']['codec'] == 'raw PCM') {
-										$ThisFileInfo['audio']['lossless'] = true;
-									} else {
-										$ThisFileInfo['audio']['lossless'] = false;
+									switch ($atomstructure['sample_description_table'][$i]['data_format']) {
+										case 'raw ': // PCM
+										case 'alac': // Apple Lossless Audio Codec
+											$ThisFileInfo['audio']['lossless'] = true;
+											break;
+										default:
+											$ThisFileInfo['audio']['lossless'] = false;
+											break;
 									}
 									break;
 							}
@@ -483,7 +510,7 @@
 			case 'stts': // Sample Table Time-to-Sample atom
 				//if ($ParseAllPossibleAtoms) {
 					$atomstructure['version']        = getid3_lib::BigEndian2Int(substr($atomdata,  0, 1));
-					$atomstructure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x000
+					$atomstructure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x0000
 					$atomstructure['number_entries'] = getid3_lib::BigEndian2Int(substr($atomdata,  4, 4));
 					$sttsEntriesDataOffset = 8;
 					$FrameRateCalculatorArray = array();
@@ -526,7 +553,7 @@
 			case 'stss': // Sample Table Sync Sample (key frames) atom
 				if ($ParseAllPossibleAtoms) {
 					$atomstructure['version']        = getid3_lib::BigEndian2Int(substr($atomdata,  0, 1));
-					$atomstructure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x000
+					$atomstructure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x0000
 					$atomstructure['number_entries'] = getid3_lib::BigEndian2Int(substr($atomdata,  4, 4));
 					$stssEntriesDataOffset = 8;
 					for ($i = 0; $i < $atomstructure['number_entries']; $i++) {
@@ -540,7 +567,7 @@
 			case 'stsc': // Sample Table Sample-to-Chunk atom
 				if ($ParseAllPossibleAtoms) {
 					$atomstructure['version']        = getid3_lib::BigEndian2Int(substr($atomdata,  0, 1));
-					$atomstructure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x000
+					$atomstructure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x0000
 					$atomstructure['number_entries'] = getid3_lib::BigEndian2Int(substr($atomdata,  4, 4));
 					$stscEntriesDataOffset = 8;
 					for ($i = 0; $i < $atomstructure['number_entries']; $i++) {
@@ -558,7 +585,7 @@
 			case 'stsz': // Sample Table SiZe atom
 				if ($ParseAllPossibleAtoms) {
 					$atomstructure['version']        = getid3_lib::BigEndian2Int(substr($atomdata,  0, 1));
-					$atomstructure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x000
+					$atomstructure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x0000
 					$atomstructure['sample_size']    = getid3_lib::BigEndian2Int(substr($atomdata,  4, 4));
 					$atomstructure['number_entries'] = getid3_lib::BigEndian2Int(substr($atomdata,  8, 4));
 					$stszEntriesDataOffset = 12;
@@ -575,7 +602,7 @@
 			case 'stco': // Sample Table Chunk Offset atom
 				if ($ParseAllPossibleAtoms) {
 					$atomstructure['version']        = getid3_lib::BigEndian2Int(substr($atomdata,  0, 1));
-					$atomstructure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x000
+					$atomstructure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x0000
 					$atomstructure['number_entries'] = getid3_lib::BigEndian2Int(substr($atomdata,  4, 4));
 					$stcoEntriesDataOffset = 8;
 					for ($i = 0; $i < $atomstructure['number_entries']; $i++) {
@@ -588,7 +615,7 @@
 
 			case 'dref': // Data REFerence atom
 				$atomstructure['version']        = getid3_lib::BigEndian2Int(substr($atomdata,  0, 1));
-				$atomstructure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x000
+				$atomstructure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x0000
 				$atomstructure['number_entries'] = getid3_lib::BigEndian2Int(substr($atomdata,  4, 4));
 				$drefDataOffset = 8;
 				for ($i = 0; $i < $atomstructure['number_entries']; $i++) {
@@ -598,7 +625,7 @@
 					$drefDataOffset += 4;
 					$atomstructure['data_references'][$i]['version']                 = getid3_lib::BigEndian2Int(substr($atomdata,  $drefDataOffset, 1));
 					$drefDataOffset += 1;
-					$atomstructure['data_references'][$i]['flags_raw']               = getid3_lib::BigEndian2Int(substr($atomdata,  $drefDataOffset, 3)); // hardcoded: 0x000
+					$atomstructure['data_references'][$i]['flags_raw']               = getid3_lib::BigEndian2Int(substr($atomdata,  $drefDataOffset, 3)); // hardcoded: 0x0000
 					$drefDataOffset += 3;
 					$atomstructure['data_references'][$i]['data']                    =               substr($atomdata, $drefDataOffset, ($atomstructure['data_references'][$i]['size'] - 4 - 4 - 1 - 3));
 					$drefDataOffset += ($atomstructure['data_references'][$i]['size'] - 4 - 4 - 1 - 3);
@@ -610,7 +637,7 @@
 
 			case 'gmin': // base Media INformation atom
 				$atomstructure['version']                = getid3_lib::BigEndian2Int(substr($atomdata,  0, 1));
-				$atomstructure['flags_raw']              = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x000
+				$atomstructure['flags_raw']              = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x0000
 				$atomstructure['graphics_mode']          = getid3_lib::BigEndian2Int(substr($atomdata,  4, 2));
 				$atomstructure['opcolor_red']            = getid3_lib::BigEndian2Int(substr($atomdata,  6, 2));
 				$atomstructure['opcolor_green']          = getid3_lib::BigEndian2Int(substr($atomdata,  8, 2));
@@ -622,7 +649,7 @@
 
 			case 'smhd': // Sound Media information HeaDer atom
 				$atomstructure['version']                = getid3_lib::BigEndian2Int(substr($atomdata,  0, 1));
-				$atomstructure['flags_raw']              = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x000
+				$atomstructure['flags_raw']              = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x0000
 				$atomstructure['balance']                = getid3_lib::BigEndian2Int(substr($atomdata,  4, 2));
 				$atomstructure['reserved']               = getid3_lib::BigEndian2Int(substr($atomdata,  6, 2));
 				break;
@@ -642,7 +669,7 @@
 
 			case 'hdlr': // HanDLeR reference atom
 				$atomstructure['version']                = getid3_lib::BigEndian2Int(substr($atomdata,  0, 1));
-				$atomstructure['flags_raw']              = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x000
+				$atomstructure['flags_raw']              = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x0000
 				$atomstructure['component_type']         =                           substr($atomdata,  4, 4);
 				$atomstructure['component_subtype']      =                           substr($atomdata,  8, 4);
 				$atomstructure['component_manufacturer'] =                           substr($atomdata, 12, 4);
@@ -658,7 +685,7 @@
 
 			case 'mdhd': // MeDia HeaDer atom
 				$atomstructure['version']               = getid3_lib::BigEndian2Int(substr($atomdata,  0, 1));
-				$atomstructure['flags_raw']             = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x000
+				$atomstructure['flags_raw']             = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x0000
 				$atomstructure['creation_time']         = getid3_lib::BigEndian2Int(substr($atomdata,  4, 4));
 				$atomstructure['modify_time']           = getid3_lib::BigEndian2Int(substr($atomdata,  8, 4));
 				$atomstructure['time_scale']            = getid3_lib::BigEndian2Int(substr($atomdata, 12, 4));
@@ -721,19 +748,19 @@
 
 			case 'elst': // Edit LiST atom
 				$atomstructure['version']        = getid3_lib::BigEndian2Int(substr($atomdata,  0, 1));
-				$atomstructure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x000
+				$atomstructure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x0000
 				$atomstructure['number_entries'] = getid3_lib::BigEndian2Int(substr($atomdata,  4, 4));
 				for ($i = 0; $i < $atomstructure['number_entries']; $i++ ) {
-					$atomstructure['edit_list'][$i]['track_duration'] = getid3_lib::BigEndian2Int(substr($atomdata, 8 + ($i * 12) + 0, 4));
-					$atomstructure['edit_list'][$i]['media_time']     = getid3_lib::BigEndian2Int(substr($atomdata, 8 + ($i * 12) + 4, 4));
-					$atomstructure['edit_list'][$i]['media_rate']     = getid3_lib::BigEndian2Int(substr($atomdata, 8 + ($i * 12) + 8, 4));
+					$atomstructure['edit_list'][$i]['track_duration'] =   getid3_lib::BigEndian2Int(substr($atomdata, 8 + ($i * 12) + 0, 4));
+					$atomstructure['edit_list'][$i]['media_time']     =   getid3_lib::BigEndian2Int(substr($atomdata, 8 + ($i * 12) + 4, 4));
+					$atomstructure['edit_list'][$i]['media_rate']     = getid3_lib::FixedPoint16_16(substr($atomdata, 8 + ($i * 12) + 8, 4));
 				}
 				break;
 
 
 			case 'kmat': // compressed MATte atom
 				$atomstructure['version']        = getid3_lib::BigEndian2Int(substr($atomdata,  0, 1));
-				$atomstructure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x000
+				$atomstructure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atomdata,  1, 3)); // hardcoded: 0x0000
 				$atomstructure['matte_data_raw'] =               substr($atomdata,  4);
 				break;
 
@@ -763,12 +790,12 @@
 				$atomstructure['reserved']           =                             substr($atomdata, 26, 10);
 				$atomstructure['matrix_a']           = getid3_lib::FixedPoint16_16(substr($atomdata, 36, 4));
 				$atomstructure['matrix_b']           = getid3_lib::FixedPoint16_16(substr($atomdata, 40, 4));
-				$atomstructure['matrix_u']           = getid3_lib::FixedPoint16_16(substr($atomdata, 44, 4));
+				$atomstructure['matrix_u']           =  getid3_lib::FixedPoint2_30(substr($atomdata, 44, 4));
 				$atomstructure['matrix_c']           = getid3_lib::FixedPoint16_16(substr($atomdata, 48, 4));
-				$atomstructure['matrix_v']           = getid3_lib::FixedPoint16_16(substr($atomdata, 52, 4));
-				$atomstructure['matrix_d']           = getid3_lib::FixedPoint16_16(substr($atomdata, 56, 4));
-				$atomstructure['matrix_x']           =  getid3_lib::FixedPoint2_30(substr($atomdata, 60, 4));
-				$atomstructure['matrix_y']           =  getid3_lib::FixedPoint2_30(substr($atomdata, 64, 4));
+				$atomstructure['matrix_d']           = getid3_lib::FixedPoint16_16(substr($atomdata, 52, 4));
+				$atomstructure['matrix_v']           =  getid3_lib::FixedPoint2_30(substr($atomdata, 56, 4));
+				$atomstructure['matrix_x']           = getid3_lib::FixedPoint16_16(substr($atomdata, 60, 4));
+				$atomstructure['matrix_y']           = getid3_lib::FixedPoint16_16(substr($atomdata, 64, 4));
 				$atomstructure['matrix_w']           =  getid3_lib::FixedPoint2_30(substr($atomdata, 68, 4));
 				$atomstructure['preview_time']       =   getid3_lib::BigEndian2Int(substr($atomdata, 72, 4));
 				$atomstructure['preview_duration']   =   getid3_lib::BigEndian2Int(substr($atomdata, 76, 4));
@@ -782,10 +809,11 @@
 					$ThisFileInfo['error'][] = 'Corrupt Quicktime file: mvhd.time_scale == zero';
 					return false;
 				}
-				$atomstructure['creation_time_unix']     = getid3_lib::DateMac2Unix($atomstructure['creation_time']);
-				$atomstructure['modify_time_unix']       = getid3_lib::DateMac2Unix($atomstructure['modify_time']);
-				$ThisFileInfo['quicktime']['time_scale'] = $atomstructure['time_scale'];
-				$ThisFileInfo['playtime_seconds']        = $atomstructure['duration'] / $atomstructure['time_scale'];
+				$atomstructure['creation_time_unix']        = getid3_lib::DateMac2Unix($atomstructure['creation_time']);
+				$atomstructure['modify_time_unix']          = getid3_lib::DateMac2Unix($atomstructure['modify_time']);
+				$ThisFileInfo['quicktime']['time_scale']    = $atomstructure['time_scale'];
+				$ThisFileInfo['quicktime']['display_scale'] = $atomstructure['matrix_a'];
+				$ThisFileInfo['playtime_seconds']           = $atomstructure['duration'] / $atomstructure['time_scale'];
 				break;
 
 
@@ -822,8 +850,8 @@
 				$atomstructure['modify_time_unix']    = getid3_lib::DateMac2Unix($atomstructure['modify_time']);
 
 				if (!isset($ThisFileInfo['video']['resolution_x']) || !isset($ThisFileInfo['video']['resolution_y'])) {
-					$ThisFileInfo['video']['resolution_x']      = $atomstructure['width'];
-					$ThisFileInfo['video']['resolution_y']      = $atomstructure['height'];
+					$ThisFileInfo['video']['resolution_x'] = $atomstructure['width'];
+					$ThisFileInfo['video']['resolution_y'] = $atomstructure['height'];
 				}
 				$ThisFileInfo['video']['resolution_x'] = max($ThisFileInfo['video']['resolution_x'], $atomstructure['width']);
 				$ThisFileInfo['video']['resolution_y'] = max($ThisFileInfo['video']['resolution_y'], $atomstructure['height']);
@@ -843,6 +871,9 @@
 				$NextTagPosition = strpos($atomdata, '©');
 				while ($NextTagPosition < strlen($atomdata)) {
 					$metaItemSize = getid3_lib::BigEndian2Int(substr($atomdata, $NextTagPosition - 4, 4)) - 4;
+					if ($metaItemSize == -4) {
+					    break;
+					}
 					$metaItemRaw  = substr($atomdata, $NextTagPosition, $metaItemSize);
 					$metaItemKey  = substr($metaItemRaw, 0, 4);
 					$metaItemData = substr($metaItemRaw, 20);
@@ -897,6 +928,13 @@
 				$atomstructure['pano'] = getid3_lib::BigEndian2Int(substr($atomdata,  0, 4));
 				break;
 
+			case 'hint': // HINT track
+			case 'hinf': //
+			case 'hinv': //
+			case 'hnti': //
+				$ThisFileInfo['quicktime']['hinting'] = true;
+				break;
+
 			case 'imgt': // IMaGe Track reference (kQTVRImageTrackRefType) (seen on QTVR)
 				for ($i = 0; $i < ($atomstructure['size'] - 8); $i += 4) {
 					$atomstructure['imgt'][] = getid3_lib::BigEndian2Int(substr($atomdata, $i, 4));
@@ -906,6 +944,7 @@
 			case 'FXTC': // Something to do with Adobe After Effects (?)
 			case 'PrmA':
 			case 'code':
+			case 'FIEL': // this is NOT "fiel" (Field Ordering) as describe here: http://developer.apple.com/documentation/QuickTime/QTFF/QTFFChap3/chapter_4_section_2.html
 				// Observed-but-not-handled atom types are just listed here
 				// to prevent warnings being generated
 				$atomstructure['data'] = $atomdata;
@@ -1119,7 +1158,7 @@
 			$QuicktimeVideoCodecLookup['WRAW'] = 'Windows RAW';
 			$QuicktimeVideoCodecLookup['y420'] = 'YUV420';
 		}
-		return (isset($QuicktimeVideoCodecLookup["$codecid"]) ? $QuicktimeVideoCodecLookup["$codecid"] : '');
+		return (isset($QuicktimeVideoCodecLookup[$codecid]) ? $QuicktimeVideoCodecLookup[$codecid] : '');
 	}
 
 	function QuicktimeAudioCodecLookup($codecid) {
@@ -1128,6 +1167,7 @@
 			$QuicktimeAudioCodecLookup['.mp3']          = 'Fraunhofer MPEG Layer-III alias';
 			$QuicktimeAudioCodecLookup['aac ']          = 'ISO/IEC 14496-3 AAC';
 			$QuicktimeAudioCodecLookup['agsm']          = 'Apple GSM 10:1';
+			$QuicktimeAudioCodecLookup['alac']          = 'Apple Lossless Audio Codec';
 			$QuicktimeAudioCodecLookup['alaw']          = 'A-law 2:1';
 			$QuicktimeAudioCodecLookup['conv']          = 'Sample Format';
 			$QuicktimeAudioCodecLookup['dvca']          = 'DV';
@@ -1163,7 +1203,7 @@
 			$QuicktimeAudioCodecLookup['twos']          = 'signed/two\'s complement (Big Endian)';
 			$QuicktimeAudioCodecLookup['ulaw']          = 'mu-law 2:1';
 		}
-		return (isset($QuicktimeAudioCodecLookup["$codecid"]) ? $QuicktimeAudioCodecLookup["$codecid"] : '');
+		return (isset($QuicktimeAudioCodecLookup[$codecid]) ? $QuicktimeAudioCodecLookup[$codecid] : '');
 	}
 
 	function QuicktimeDCOMLookup($compressionid) {
@@ -1172,7 +1212,7 @@
 			$QuicktimeDCOMLookup['zlib'] = 'ZLib Deflate';
 			$QuicktimeDCOMLookup['adec'] = 'Apple Compression';
 		}
-		return (isset($QuicktimeDCOMLookup["$compressionid"]) ? $QuicktimeDCOMLookup["$compressionid"] : '');
+		return (isset($QuicktimeDCOMLookup[$compressionid]) ? $QuicktimeDCOMLookup[$compressionid] : '');
 	}
 
 	function QuicktimeColorNameLookup($colordepthid) {
@@ -1235,8 +1275,8 @@
 			$handyatomtranslatorarray['©url'] = 'url';
 			$handyatomtranslatorarray['©enc'] = 'encoder';
 		}
-		if (isset($handyatomtranslatorarray["$keyname"])) {
-			$ThisFileInfo['quicktime']['comments'][$handyatomtranslatorarray["$keyname"]][] = $data;
+		if (isset($handyatomtranslatorarray[$keyname])) {
+			$ThisFileInfo['quicktime']['comments'][$handyatomtranslatorarray[$keyname]][] = $data;
 		}
 
 		return true;

Modified: plog/trunk/class/gallery/getid3/module.audio-video.real.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio-video.real.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio-video.real.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -5,16 +5,16 @@
 //            or http://www.getid3.org                         //
 /////////////////////////////////////////////////////////////////
 // See readme.txt for more details                             //
+/////////////////////////////////////////////////////////////////
+//                                                             //
+// module.audio-video.real.php                                 //
+// module for analyzing Real Audio/Video files                 //
+// dependencies: module.audio-video.riff.php                   //
+//                                                            ///
+/////////////////////////////////////////////////////////////////
+
 getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true);
 
-/**
- * \ingroup getid3
- *                                                             //
- * module.audio-video.real.php                                 //
- * module for analyzing Real Audio/Video files                 //
- * dependencies: module.audio-video.riff.php                   //
- *                                                            ///
-*/
 class getid3_real
 {
 
@@ -35,7 +35,7 @@
 				if ($this->ParseOldRAheader(substr($ChunkData, 0, 128), $ThisFileInfo['real']['old_ra_header'])) {
 					$ThisFileInfo['audio']['dataformat']      = 'real';
 					$ThisFileInfo['audio']['lossless']        = false;
-					$ThisFileInfo['audio']['sample_rate'] = $ThisFileInfo['real']['old_ra_header']['sample_rate'];
+					$ThisFileInfo['audio']['sample_rate']     = $ThisFileInfo['real']['old_ra_header']['sample_rate'];
 					$ThisFileInfo['audio']['bits_per_sample'] = $ThisFileInfo['real']['old_ra_header']['bits_per_sample'];
 					$ThisFileInfo['audio']['channels']        = $ThisFileInfo['real']['old_ra_header']['channels'];
 
@@ -48,7 +48,7 @@
 							$ThisFileInfo['real']['comments'][$key][] = trim($valuearray[0]);
 						}
 					}
-					break;
+					return true;
 				}
 				$ThisFileInfo['error'][] = 'There was a problem parsing this RealAudio file. Please submit it for analysis to http://www.getid3.org/upload/ or info at getid3.org';
 				unset($ThisFileInfo['bitrate']);
@@ -189,16 +189,16 @@
 								$thisfile_real_chunks_currentchunk_videoinfo['width']             = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 12, 2));
 								$thisfile_real_chunks_currentchunk_videoinfo['height']            = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 14, 2));
 								$thisfile_real_chunks_currentchunk_videoinfo['bits_per_sample']   = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 16, 2));
-								$thisfile_real_chunks_currentchunk_videoinfo['unknown1']          = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 18, 2));
-								$thisfile_real_chunks_currentchunk_videoinfo['unknown2']          = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 20, 2));
+								//$thisfile_real_chunks_currentchunk_videoinfo['unknown1']          = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 18, 2));
+								//$thisfile_real_chunks_currentchunk_videoinfo['unknown2']          = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 20, 2));
 								$thisfile_real_chunks_currentchunk_videoinfo['frames_per_second'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 22, 2));
-								$thisfile_real_chunks_currentchunk_videoinfo['unknown3']          = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 24, 2));
-								$thisfile_real_chunks_currentchunk_videoinfo['unknown4']          = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 26, 2));
-								$thisfile_real_chunks_currentchunk_videoinfo['unknown5']          = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 28, 2));
-								$thisfile_real_chunks_currentchunk_videoinfo['unknown6']          = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 30, 2));
-								$thisfile_real_chunks_currentchunk_videoinfo['unknown7']          = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 32, 2));
-								$thisfile_real_chunks_currentchunk_videoinfo['unknown8']          = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 34, 2));
-								$thisfile_real_chunks_currentchunk_videoinfo['unknown9']          = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 36, 2));
+								//$thisfile_real_chunks_currentchunk_videoinfo['unknown3']          = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 24, 2));
+								//$thisfile_real_chunks_currentchunk_videoinfo['unknown4']          = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 26, 2));
+								//$thisfile_real_chunks_currentchunk_videoinfo['unknown5']          = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 28, 2));
+								//$thisfile_real_chunks_currentchunk_videoinfo['unknown6']          = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 30, 2));
+								//$thisfile_real_chunks_currentchunk_videoinfo['unknown7']          = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 32, 2));
+								//$thisfile_real_chunks_currentchunk_videoinfo['unknown8']          = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 34, 2));
+								//$thisfile_real_chunks_currentchunk_videoinfo['unknown9']          = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 36, 2));
 
 								$thisfile_real_chunks_currentchunk_videoinfo['codec'] = getid3_riff::RIFFfourccLookup($thisfile_real_chunks_currentchunk_videoinfo['fourcc2']);
 
@@ -230,10 +230,26 @@
 								$thisfile_real_chunks_currentchunk['logical_fileinfo'] = array();
 								$thisfile_real_chunks_currentchunk_logicalfileinfo     = &$thisfile_real_chunks_currentchunk['logical_fileinfo'];
 
-								$thisfile_real_chunks_currentchunk_logicalfileinfo['logical_fileinfo_length'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata,  0, 4));
-								$thisfile_real_chunks_currentchunk_logicalfileinfo['a']                       = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata,  4, 4));
-								$thisfile_real_chunks_currentchunk_logicalfileinfo['b']                       = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata,  8, 4));
-								$thisfile_real_chunks_currentchunk_logicalfileinfo['c']                       = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 12, 4));
+								$thisfile_real_chunks_currentchunk_logicalfileinfo_offset = 0;
+								$thisfile_real_chunks_currentchunk_logicalfileinfo['logical_fileinfo_length'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, 4));
+								$thisfile_real_chunks_currentchunk_logicalfileinfo_offset += 4;
+
+								//$thisfile_real_chunks_currentchunk_logicalfileinfo['unknown1']                = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, 4));
+								$thisfile_real_chunks_currentchunk_logicalfileinfo_offset += 4;
+
+								$thisfile_real_chunks_currentchunk_logicalfileinfo['num_tags']                = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, 4));
+								$thisfile_real_chunks_currentchunk_logicalfileinfo_offset += 4;
+
+								//$thisfile_real_chunks_currentchunk_logicalfileinfo['unknown2']                = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, 4));
+								$thisfile_real_chunks_currentchunk_logicalfileinfo_offset += 4;
+
+								//$thisfile_real_chunks_currentchunk_logicalfileinfo['d']                       = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, 1));
+
+								//$thisfile_real_chunks_currentchunk_logicalfileinfo['one_type'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata,     $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, 4));
+								//$thisfile_real_chunks_currentchunk_logicalfileinfo_thislength  = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 4 + $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, 2));
+								//$thisfile_real_chunks_currentchunk_logicalfileinfo['one']      =                           substr($thisfile_real_chunks_currentchunk_typespecificdata, 6 + $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, $thisfile_real_chunks_currentchunk_logicalfileinfo_thislength);
+								//$thisfile_real_chunks_currentchunk_logicalfileinfo_offset += (6 + $thisfile_real_chunks_currentchunk_logicalfileinfo_thislength);
+
 								break;
 
 						}
@@ -255,18 +271,25 @@
 								case 'video/x-pn-realvideo':
 								case 'video/x-pn-multirate-realvideo':
 									$ThisFileInfo['video']['bitrate']            = (isset($ThisFileInfo['video']['bitrate']) ? $ThisFileInfo['video']['bitrate'] : 0) + $thisfile_real_chunks_currentchunk['avg_bit_rate'];
-									$ThisFileInfo['video']['birate_mode']        = 'cbr';
+									$ThisFileInfo['video']['bitrate_mode']       = 'cbr';
 									$ThisFileInfo['video']['dataformat']         = 'real';
 									$ThisFileInfo['video']['lossless']           = false;
 									$ThisFileInfo['video']['pixel_aspect_ratio'] = (float) 1;
 									break;
+
+								case 'audio/x-ralf-mpeg4-generic':
+									$ThisFileInfo['audio']['bitrate']    = (isset($ThisFileInfo['audio']['bitrate']) ? $ThisFileInfo['audio']['bitrate'] : 0) + $thisfile_real_chunks_currentchunk['avg_bit_rate'];
+									$ThisFileInfo['audio']['codec']      = 'RealAudio Lossless';
+									$ThisFileInfo['audio']['dataformat'] = 'real';
+									$ThisFileInfo['audio']['lossless']   = true;
+									break;
 							}
 							$ThisFileInfo['bitrate'] = (isset($ThisFileInfo['video']['bitrate']) ? $ThisFileInfo['video']['bitrate'] : 0) + (isset($ThisFileInfo['audio']['bitrate']) ? $ThisFileInfo['audio']['bitrate'] : 0);
 						}
 					}
 					break;
 
-				case 'CONT': // Content Description Header
+				case 'CONT': // Content Description Header (text comments)
 					$thisfile_real_chunks_currentchunk['object_version'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2));
 					$offset += 2;
 					if ($thisfile_real_chunks_currentchunk['object_version'] == 0) {
@@ -367,9 +390,9 @@
 
 			$ParsedArray['header_size']      = getid3_lib::BigEndian2Int(substr($OldRAheaderData,  6, 2));
 			$ParsedArray['channels']         = getid3_lib::BigEndian2Int(substr($OldRAheaderData,  8, 2)); // always 1 (?)
-			$ParsedArray['unknown1']         = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 10, 2));
-			$ParsedArray['unknown2']         = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 12, 2));
-			$ParsedArray['unknown3']         = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 14, 2));
+			//$ParsedArray['unknown1']         = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 10, 2));
+			//$ParsedArray['unknown2']         = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 12, 2));
+			//$ParsedArray['unknown3']         = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 14, 2));
 			$ParsedArray['bytes_per_minute'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 16, 2));
 			$ParsedArray['audio_bytes']      = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 18, 4));
 			$ParsedArray['comments_raw']     =                           substr($OldRAheaderData, 22, $ParsedArray['header_size'] - 22 + 1); // not including null terminator
@@ -393,7 +416,7 @@
 
 		} elseif ($ParsedArray['version1'] <= 5) {
 
-			$ParsedArray['unknown1']         = getid3_lib::BigEndian2Int(substr($OldRAheaderData,  6, 2));
+			//$ParsedArray['unknown1']         = getid3_lib::BigEndian2Int(substr($OldRAheaderData,  6, 2));
 			$ParsedArray['fourcc1']          =                           substr($OldRAheaderData,  8, 4);
 			$ParsedArray['file_size']        = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 12, 4));
 			$ParsedArray['version2']         = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 16, 2));
@@ -402,25 +425,25 @@
 			$ParsedArray['coded_frame_size'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 24, 4));
 			$ParsedArray['audio_bytes']      = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 28, 4));
 			$ParsedArray['bytes_per_minute'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 32, 4));
-			$ParsedArray['unknown5']         = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 36, 4));
+			//$ParsedArray['unknown5']         = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 36, 4));
 			$ParsedArray['sub_packet_h']     = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 40, 2));
 			$ParsedArray['frame_size']       = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 42, 2));
 			$ParsedArray['sub_packet_size']  = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 44, 2));
-			$ParsedArray['unknown6']         = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 46, 2));
+			//$ParsedArray['unknown6']         = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 46, 2));
 
 			switch ($ParsedArray['version1']) {
 
 				case 4:
 					$ParsedArray['sample_rate']      = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 48, 2));
-					$ParsedArray['unknown8']         = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 50, 2));
+					//$ParsedArray['unknown8']         = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 50, 2));
 					$ParsedArray['bits_per_sample']  = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 52, 2));
 					$ParsedArray['channels']         = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 54, 2));
 					$ParsedArray['length_fourcc2']   = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 56, 1));
 					$ParsedArray['fourcc2']          =                           substr($OldRAheaderData, 57, 4);
 					$ParsedArray['length_fourcc3']   = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 61, 1));
 					$ParsedArray['fourcc3']          =                           substr($OldRAheaderData, 62, 4);
-					$ParsedArray['unknown9']         = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 66, 1));
-					$ParsedArray['unknown10']        = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 67, 2));
+					//$ParsedArray['unknown9']         = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 66, 1));
+					//$ParsedArray['unknown10']        = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 67, 2));
 					$ParsedArray['comments_raw']     =                           substr($OldRAheaderData, 69, $ParsedArray['header_size'] - 69 + 16);
 
 					$commentoffset = 0;
@@ -490,8 +513,9 @@
 			$RealAudioCodecFourCClookup['cook'][0] = 'RealAudio G2';
 			$RealAudioCodecFourCClookup['atrc'][0] = 'RealAudio 8';
 		}
-		if (isset($RealAudioCodecFourCClookup[$fourcc][round($bitrate)])) {
-			return $RealAudioCodecFourCClookup[$fourcc][round($bitrate)];
+		$roundbitrate = intval(round($bitrate));
+		if (isset($RealAudioCodecFourCClookup[$fourcc][$roundbitrate])) {
+			return $RealAudioCodecFourCClookup[$fourcc][$roundbitrate];
 		} elseif (isset($RealAudioCodecFourCClookup[$fourcc][0])) {
 			return $RealAudioCodecFourCClookup[$fourcc][0];
 		}

Modified: plog/trunk/class/gallery/getid3/module.audio-video.riff.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio-video.riff.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio-video.riff.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -10,7 +10,7 @@
 // module.audio-video.riff.php                                 //
 // module for analyzing RIFF files                             //
 // multiple formats supported by this module:                  //
-//    Wave, AVI, AIFF/AIFC, (MP3,AC3)/RIFF, Wavpack, 8SVX      //
+//    Wave, AVI, AIFF/AIFC, (MP3,AC3)/RIFF, Wavpack v3, 8SVX   //
 // dependencies: module.audio.mp3.php                          //
 //               module.audio.ac3.php (optional)               //
 //                                                            ///
@@ -18,9 +18,6 @@
 
 getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.mp3.php', __FILE__, true);
 
-/**
- * \ingroup getid3
- */
 class getid3_riff
 {
 
@@ -114,8 +111,8 @@
 
 					$ThisFileInfo['playtime_seconds'] = (float) ((($thisfile_avdataend - $thisfile_avdataoffset) * 8) / $thisfile_audio['bitrate']);
 
+					$thisfile_audio['lossless'] = false;
 					if (isset($thisfile_riff_WAVE['data'][0]['offset']) && isset($thisfile_riff_raw['fmt ']['wFormatTag'])) {
-						$thisfile_audio['lossless'] = false;
 						switch ($thisfile_riff_raw['fmt ']['wFormatTag']) {
 
 							case 0x0001:  // PCM
@@ -273,7 +270,7 @@
 				}
 
 				if (!empty($ThisFileInfo['wavpack'])) {
-					$thisfile_audio_dataformat   = 'wavpack';
+					$thisfile_audio_dataformat = 'wavpack';
 					$thisfile_audio['bitrate_mode'] = 'vbr';
 					$thisfile_audio['encoder']      = 'WavPack v'.$ThisFileInfo['wavpack']['version'];
 
@@ -337,7 +334,7 @@
 							$thisfile_riff_litewave_raw['m_bFactExists']      = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE['fmt '][0]['data'], 38, 2));
 							$thisfile_riff_litewave_raw['m_dwRiffChunkSize']  = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE['fmt '][0]['data'], 40, 4));
 
-							//$thisfile_riff_litewave['quality_factor'] = (int) round((2000 - $thisfile_riff_litewave_raw['m_dwScale']) / 20);
+							//$thisfile_riff_litewave['quality_factor'] = intval(round((2000 - $thisfile_riff_litewave_raw['m_dwScale']) / 20));
 							$thisfile_riff_litewave['quality_factor'] = $thisfile_riff_litewave_raw['m_wQuality'];
 
 							$thisfile_riff_litewave['flags']['raw_source']    = ($thisfile_riff_litewave_raw['compression_flags'] & 0x01) ? false : true;
@@ -402,7 +399,7 @@
 				break;
 
 			case 'AVI ':
-				$thisfile_video['bitrate_mode'] = 'cbr';
+				$thisfile_video['bitrate_mode'] = 'vbr'; // maybe not, but probably
 				$thisfile_video['dataformat']   = 'avi';
 				$ThisFileInfo['mime_type']      = 'video/avi';
 
@@ -465,7 +462,7 @@
 						$thisfile_video['total_frames']              = $thisfile_riff_video_current['total_frames'];
 					}
 
-					$thisfile_riff_video_current['frame_rate']   = round(1000000 / $thisfile_riff_raw_avih['dwMicroSecPerFrame'], 3);
+					$thisfile_riff_video_current['frame_rate'] = round(1000000 / $thisfile_riff_raw_avih['dwMicroSecPerFrame'], 3);
 					$thisfile_video['frame_rate'] = $thisfile_riff_video_current['frame_rate'];
 				}
 				if (isset($thisfile_riff['AVI ']['hdrl']['strl']['strh'][0]['data'])) {
@@ -477,6 +474,10 @@
 
 								if (isset($thisfile_riff['AVI ']['hdrl']['strl']['strf'][$i]['data'])) {
 									$strfData = $thisfile_riff['AVI ']['hdrl']['strl']['strf'][$i]['data'];
+
+									// shortcut
+									$thisfile_riff_raw_strf_strhfccType_streamindex = &$thisfile_riff_raw['strf'][$strhfccType][$streamindex];
+
 									switch ($strhfccType) {
 										case 'auds':
 											$thisfile_audio['bitrate_mode'] = 'cbr';
@@ -500,7 +501,6 @@
 
 											// shortcut
 											$thisfile_riff_raw['strf'][$strhfccType][$streamindex] = $thisfile_riff_audio[$streamindex]['raw'];
-											$thisfile_riff_raw_strf_strhfccType_streamindex        = &$thisfile_riff_raw['strf'][$strhfccType][$streamindex];
 
 											unset($thisfile_riff_audio[$streamindex]['raw']);
 											$thisfile_audio = getid3_lib::array_merge_noclobber($thisfile_audio, $thisfile_riff_audio[$streamindex]);
@@ -545,15 +545,14 @@
 											$thisfile_audio_streams_currentstream['dataformat']   = $thisfile_audio_dataformat;
 											$thisfile_audio_streams_currentstream['lossless']     = $thisfile_audio['lossless'];
 											$thisfile_audio_streams_currentstream['bitrate_mode'] = $thisfile_audio['bitrate_mode'];
-
 											break;
 
 
 										case 'iavs':
 										case 'vids':
 											// shortcut
-											$thisfile_riff_raw['strh'][$i]  = array();
-											$thisfile_riff_raw_strh_current = &$thisfile_riff_raw['strh'][$i];
+											$thisfile_riff_raw['strh'][$i]                  = array();
+											$thisfile_riff_raw_strh_current                 = &$thisfile_riff_raw['strh'][$i];
 
 											$thisfile_riff_raw_strh_current['fccType']               =                  substr($strhData,  0, 4);  // same as $strhfccType;
 											$thisfile_riff_raw_strh_current['fccHandler']            =                  substr($strhData,  4, 4);
@@ -901,56 +900,7 @@
 			$thisfile_riff['comments']['title'][] = trim(substr($thisfile_riff_WAVE['DISP'][count($thisfile_riff_WAVE['DISP']) - 1]['data'], 4));
 		}
 		if (isset($thisfile_riff_WAVE['INFO']) && is_array($thisfile_riff_WAVE['INFO'])) {
-			$RIFFinfoKeyLookup = array(
-				'IARL'=>'archivallocation',
-				'IART'=>'artist',
-				'ICDS'=>'costumedesigner',
-				'ICMS'=>'commissionedby',
-				'ICMT'=>'comment',
-				'ICNT'=>'country',
-				'ICOP'=>'copyright',
-				'ICRD'=>'creationdate',
-				'IDIM'=>'dimensions',
-				'IDIT'=>'digitizationdate',
-				'IDPI'=>'resolution',
-				'IDST'=>'distributor',
-				'IEDT'=>'editor',
-				'IENG'=>'engineers',
-				'IFRM'=>'accountofparts',
-				'IGNR'=>'genre',
-				'IKEY'=>'keywords',
-				'ILGT'=>'lightness',
-				'ILNG'=>'language',
-				'IMED'=>'orignalmedium',
-				'IMUS'=>'composer',
-				'INAM'=>'title',
-				'IPDS'=>'productiondesigner',
-				'IPLT'=>'palette', 
-				'IPRD'=>'product',
-				'IPRO'=>'producer',
-				'IPRT'=>'part',
-				'IRTD'=>'rating',
-				'ISBJ'=>'subject',
-				'ISFT'=>'software',
-				'ISGN'=>'secondarygenre',
-				'ISHP'=>'sharpness',
-				'ISRC'=>'sourcesupplier',
-				'ISRF'=>'digitizationsource',
-				'ISTD'=>'productionstudio',
-				'ISTR'=>'starring',
-				'ITCH'=>'encoded_by',
-				'IWEB'=>'url',
-				'IWRI'=>'writer'
-			);
-			foreach ($RIFFinfoKeyLookup as $key => $value) {
-				if (isset($thisfile_riff_WAVE['INFO'][$key])) {
-					foreach ($thisfile_riff_WAVE['INFO'][$key] as $commentid => $commentdata) {
-						if (trim($commentdata['data']) != '') {
-							$thisfile_riff['comments'][$value][] = trim($commentdata['data']);
-						}
-					}
-				}
-			}
+			$this->RIFFcommentsParse($thisfile_riff_WAVE['INFO'], $thisfile_riff['comments']);
 		}
 
 		if (empty($thisfile_audio['encoder']) && !empty($ThisFileInfo['mpeg']['audio']['LAME']['short_version'])) {
@@ -1055,6 +1005,60 @@
 	}
 
 
+	function RIFFcommentsParse(&$RIFFinfoArray, &$CommentsTargetArray) {
+		$RIFFinfoKeyLookup = array(
+			'IARL'=>'archivallocation',
+			'IART'=>'artist',
+			'ICDS'=>'costumedesigner',
+			'ICMS'=>'commissionedby',
+			'ICMT'=>'comment',
+			'ICNT'=>'country',
+			'ICOP'=>'copyright',
+			'ICRD'=>'creationdate',
+			'IDIM'=>'dimensions',
+			'IDIT'=>'digitizationdate',
+			'IDPI'=>'resolution',
+			'IDST'=>'distributor',
+			'IEDT'=>'editor',
+			'IENG'=>'engineers',
+			'IFRM'=>'accountofparts',
+			'IGNR'=>'genre',
+			'IKEY'=>'keywords',
+			'ILGT'=>'lightness',
+			'ILNG'=>'language',
+			'IMED'=>'orignalmedium',
+			'IMUS'=>'composer',
+			'INAM'=>'title',
+			'IPDS'=>'productiondesigner',
+			'IPLT'=>'palette',
+			'IPRD'=>'product',
+			'IPRO'=>'producer',
+			'IPRT'=>'part',
+			'IRTD'=>'rating',
+			'ISBJ'=>'subject',
+			'ISFT'=>'software',
+			'ISGN'=>'secondarygenre',
+			'ISHP'=>'sharpness',
+			'ISRC'=>'sourcesupplier',
+			'ISRF'=>'digitizationsource',
+			'ISTD'=>'productionstudio',
+			'ISTR'=>'starring',
+			'ITCH'=>'encoded_by',
+			'IWEB'=>'url',
+			'IWRI'=>'writer'
+		);
+		foreach ($RIFFinfoKeyLookup as $key => $value) {
+			if (isset($RIFFinfoArray[$key])) {
+				foreach ($RIFFinfoArray[$key] as $commentid => $commentdata) {
+					if (trim($commentdata['data']) != '') {
+						@$CommentsTargetArray[$value][] = trim($commentdata['data']);
+					}
+				}
+			}
+		}
+		return true;
+	}
+
 	function ParseRIFF(&$fd, $startoffset, $maxoffset, &$ThisFileInfo) {
 
 		$maxoffset = min($maxoffset, $ThisFileInfo['avdataend']);
@@ -1065,14 +1069,22 @@
 
 		while (ftell($fd) < $maxoffset) {
 			$chunkname = fread($fd, 4);
+			if (strlen($chunkname) < 4) {
+				$ThisFileInfo['error'][] = 'Expecting chunk name at offset '.(ftell($fd) - 4).' but found nothing. Aborting RIFF parsing.';
+				break;
+			}
+
 			$chunksize = getid3_riff::EitherEndian2Int($ThisFileInfo, fread($fd, 4));
+			if ($chunksize == 0) {
+				$ThisFileInfo['error'][] = 'Chunk size at offset '.(ftell($fd) - 4).' is zero. Aborting RIFF parsing.';
+				break;
+			}
 			if (($chunksize % 2) != 0) {
 				// all structures are packed on word boundaries
 				$chunksize++;
 			}
 
 			switch ($chunkname) {
-
 				case 'LIST':
 					$listname = fread($fd, 4);
 					switch ($listname) {
@@ -1149,7 +1161,11 @@
 							if (!isset($RIFFchunk[$listname])) {
 								$RIFFchunk[$listname] = array();
 							}
-							$RIFFchunk[$listname] = array_merge_recursive($RIFFchunk[$listname], getid3_riff::ParseRIFF($fd, ftell($fd), ftell($fd) + $chunksize - 4, $ThisFileInfo));
+							$LISTchunkParent    = $listname;
+							$LISTchunkMaxOffset = ftell($fd) - 4 + $chunksize;
+							if ($parsedChunk = getid3_riff::ParseRIFF($fd, ftell($fd), ftell($fd) + $chunksize - 4, $ThisFileInfo)) {
+								$RIFFchunk[$listname] = array_merge_recursive($RIFFchunk[$listname], $parsedChunk);
+							}
 							break;
 					}
 					break;
@@ -1166,7 +1182,7 @@
 							$ThisFileInfo['avdataoffset'] = ftell($fd);
 							$ThisFileInfo['avdataend']    = $ThisFileInfo['avdataoffset'] + $chunksize;
 
-							$RIFFdataChunkContentsTest = fread($fd, 32);
+							$RIFFdataChunkContentsTest = fread($fd, 36);
 
 							if ((strlen($RIFFdataChunkContentsTest) > 0) && preg_match('/^\xFF[\xE2-\xE7\xF2-\xF7\xFA-\xFF][\x00-\xEB]/s', substr($RIFFdataChunkContentsTest, 0, 4))) {
 
@@ -1204,6 +1220,7 @@
 								$GETID3_ERRORARRAY = &$ThisFileInfo['warning'];
 								if (getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.ac3.php', __FILE__, false)) {
 
+									// ok to use tmpfile here - only 56 bytes
 									if ($fd_temp = tmpfile()) {
 
 										for ($i = 0; $i < 28; $i += 2) {
@@ -1239,7 +1256,7 @@
 								// This is WavPack data
 								$ThisFileInfo['wavpack']['offset'] = $RIFFchunk[$chunkname][$thisindex]['offset'];
 								$ThisFileInfo['wavpack']['size']   = getid3_lib::LittleEndian2Int(substr($RIFFdataChunkContentsTest, 4, 4));
-								getid3_riff::RIFFparseWavPackHeader(substr($RIFFdataChunkContentsTest, 8, 22), $ThisFileInfo);
+								getid3_riff::RIFFparseWavPackHeader(substr($RIFFdataChunkContentsTest, 8, 28), $ThisFileInfo);
 
 							} else {
 
@@ -1260,8 +1277,20 @@
 							break;
 
 						default:
-							// read data in if smaller than 2kB
-							if ($chunksize < 2048) {
+							if (!empty($LISTchunkParent) && (($RIFFchunk[$chunkname][$thisindex]['offset'] + $RIFFchunk[$chunkname][$thisindex]['size']) <= $LISTchunkMaxOffset)) {
+								$RIFFchunk[$LISTchunkParent][$chunkname][$thisindex]['offset'] = $RIFFchunk[$chunkname][$thisindex]['offset'];
+								$RIFFchunk[$LISTchunkParent][$chunkname][$thisindex]['size']   = $RIFFchunk[$chunkname][$thisindex]['size'];
+								unset($RIFFchunk[$chunkname][$thisindex]['offset']);
+								unset($RIFFchunk[$chunkname][$thisindex]['size']);
+								if (isset($RIFFchunk[$chunkname][$thisindex]) && empty($RIFFchunk[$chunkname][$thisindex])) {
+									unset($RIFFchunk[$chunkname][$thisindex]);
+								}
+								if (isset($RIFFchunk[$chunkname]) && empty($RIFFchunk[$chunkname])) {
+									unset($RIFFchunk[$chunkname]);
+								}
+								$RIFFchunk[$LISTchunkParent][$chunkname][$thisindex]['data'] = fread($fd, $chunksize);
+							} elseif ($chunksize < 2048) {
+								// only read data in if smaller than 2kB
 								$RIFFchunk[$chunkname][$thisindex]['data'] = fread($fd, $chunksize);
 							} else {
 								fseek($fd, $chunksize, SEEK_CUR);
@@ -1280,29 +1309,28 @@
 
 	function ParseRIFFdata(&$RIFFdata, &$ThisFileInfo) {
 		if ($RIFFdata) {
-			if ($fp_temp = tmpfile()) {
 
-				$RIFFdataLength = strlen($RIFFdata);
-				$NewLengthString = getid3_lib::LittleEndian2String($RIFFdataLength, 4);
-				for ($i = 0; $i < 4; $i++) {
-					$RIFFdata{$i + 4} = $NewLengthString{$i};
-				}
-				fwrite($fp_temp, $RIFFdata);
-				$dummy = array('filesize'=>$RIFFdataLength, 'filenamepath'=>$ThisFileInfo['filenamepath'], 'tags'=>$ThisFileInfo['tags'], 'avdataoffset'=>0, 'avdataend'=>$RIFFdataLength, 'warning'=>$ThisFileInfo['warning'], 'error'=>$ThisFileInfo['error'], 'comments'=>$ThisFileInfo['comments'], 'audio'=>(isset($ThisFileInfo['audio']) ? $ThisFileInfo['audio'] : array()), 'video'=>(isset($ThisFileInfo['video']) ? $ThisFileInfo['video'] : array()));
-				$riff = new getid3_riff($fp_temp, $dummy);
-				$ThisFileInfo['riff']     = $dummy['riff'];
-				$ThisFileInfo['warning']  = $dummy['warning'];
-				$ThisFileInfo['error']    = $dummy['error'];
-				$ThisFileInfo['tags']     = $dummy['tags'];
-				$ThisFileInfo['comments'] = $dummy['comments'];
-				fclose($fp_temp);
-				return true;
+		    $tempfile = tempnam('*', 'getID3');
+            $fp_temp  = fopen($tempfile, "wb");
+			$RIFFdataLength = strlen($RIFFdata);
+			$NewLengthString = getid3_lib::LittleEndian2String($RIFFdataLength, 4);
+			for ($i = 0; $i < 4; $i++) {
+				$RIFFdata{$i + 4} = $NewLengthString{$i};
+			}
+			fwrite($fp_temp, $RIFFdata);
+			fclose($fp_temp);
 
-			} else {
-
-				$ThisFileInfo['error'][] = 'Error calling tmpfile() to parse OptimFROG RIFF header';
-
-			}
+			$fp_temp  = fopen($tempfile, "rb");
+			$dummy = array('filesize'=>$RIFFdataLength, 'filenamepath'=>$ThisFileInfo['filenamepath'], 'tags'=>$ThisFileInfo['tags'], 'avdataoffset'=>0, 'avdataend'=>$RIFFdataLength, 'warning'=>$ThisFileInfo['warning'], 'error'=>$ThisFileInfo['error'], 'comments'=>$ThisFileInfo['comments'], 'audio'=>(isset($ThisFileInfo['audio']) ? $ThisFileInfo['audio'] : array()), 'video'=>(isset($ThisFileInfo['video']) ? $ThisFileInfo['video'] : array()));
+			$riff = new getid3_riff($fp_temp, $dummy);
+			$ThisFileInfo['riff']     = $dummy['riff'];
+			$ThisFileInfo['warning']  = $dummy['warning'];
+			$ThisFileInfo['error']    = $dummy['error'];
+			$ThisFileInfo['tags']     = $dummy['tags'];
+			$ThisFileInfo['comments'] = $dummy['comments'];
+			fclose($fp_temp);
+			unlink($tempfile);
+			return true;
 		}
 		return false;
 	}
@@ -1360,7 +1388,7 @@
 			$thisfile_wavpack['crc2']          = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 16, 4));
 			$thisfile_wavpack['extension']     =                              substr($WavPackChunkData, 20, 4);
 			$thisfile_wavpack['extra_bc']      = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 24, 1));
-			for ($i = 0; $i < 3; $i++) {
+			for ($i = 0; $i <= 2; $i++) {
 				$thisfile_wavpack['extras'][]  = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 25 + $i, 1));
 			}
 
@@ -1600,7 +1628,7 @@
 			AYUV	4:4:4 YUV (AYUV)
 			AZPR	Quicktime Apple Video (AZPR)
 			BGR 	Raw RGB32
-			BLZ0	FFmpeg MPEG-4
+			BLZ0	Blizzard DivX MPEG-4
 			BTVC	Conexant Composite Video
 			BINK	RAD Game Tools Bink Video
 			BT20	Conexant Prosumer Video

Modified: plog/trunk/class/gallery/getid3/module.audio-video.swf.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio-video.swf.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio-video.swf.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_swf
 {
 
@@ -27,9 +25,10 @@
 
 		fseek($fd, $ThisFileInfo['avdataoffset'], SEEK_SET);
 
+//echo 'reading '.($ThisFileInfo['avdataend'] - $ThisFileInfo['avdataoffset']).' bytes<br>';
 		$SWFfileData = fread($fd, $ThisFileInfo['avdataend'] - $ThisFileInfo['avdataoffset']); // 8 + 2 + 2 + max(9) bytes NOT including Frame_Size RECT data
 
-		$ThisFileInfo['swf']['header']['signature']   = substr($SWFfileData, 0, 3);
+		$ThisFileInfo['swf']['header']['signature']  = substr($SWFfileData, 0, 3);
 		switch ($ThisFileInfo['swf']['header']['signature']) {
 			case 'FWS':
 				$ThisFileInfo['swf']['header']['compressed'] = false;
@@ -46,17 +45,28 @@
 				return false;
 				break;
 		}
-		$ThisFileInfo['swf']['header']['version']      = getid3_lib::LittleEndian2Int(substr($SWFfileData, 3, 1));
-		$ThisFileInfo['swf']['header']['length']       = getid3_lib::LittleEndian2Int(substr($SWFfileData, 4, 4));
+		$ThisFileInfo['swf']['header']['version'] = getid3_lib::LittleEndian2Int(substr($SWFfileData, 3, 1));
+		$ThisFileInfo['swf']['header']['length']  = getid3_lib::LittleEndian2Int(substr($SWFfileData, 4, 4));
 
+//echo '1<br>';
 		if ($ThisFileInfo['swf']['header']['compressed']) {
 
-			if ($UncompressedFileData = @gzuncompress(substr($SWFfileData, 8))) {
+//echo '2<br>';
+//			$foo = substr($SWFfileData, 8, 4096);
+//			echo '['.strlen($foo).']<br>';
+//			$fee = gzuncompress($foo);
+//			echo '('.strlen($fee).')<br>';
+//return false;
+//echo '<br>time: '.time().'<br>';
+//return false;
+			if ($UncompressedFileData = gzuncompress(substr($SWFfileData, 8))) {
 
+//echo '3<br>';
 				$SWFfileData = substr($SWFfileData, 0, 8).$UncompressedFileData;
 
 			} else {
 
+//echo '4<br>';
 				$ThisFileInfo['error'][] = 'Error decompressing compressed SWF data';
 				return false;
 
@@ -85,8 +95,8 @@
 		$ThisFileInfo['swf']['header']['frame_count'] = getid3_lib::LittleEndian2Int(substr($SWFfileData, 10 + $FrameSizeDataLength, 2));
 
 		$ThisFileInfo['video']['frame_rate']         = $ThisFileInfo['swf']['header']['frame_rate'];
-		$ThisFileInfo['video']['resolution_x']       = round($ThisFileInfo['swf']['header']['frame_width']  / 20);
-		$ThisFileInfo['video']['resolution_y']       = round($ThisFileInfo['swf']['header']['frame_height'] / 20);
+		$ThisFileInfo['video']['resolution_x']       = intval(round($ThisFileInfo['swf']['header']['frame_width']  / 20));
+		$ThisFileInfo['video']['resolution_y']       = intval(round($ThisFileInfo['swf']['header']['frame_height'] / 20));
 		$ThisFileInfo['video']['pixel_aspect_ratio'] = (float) 1;
 
 		if (($ThisFileInfo['swf']['header']['frame_count'] > 0) && ($ThisFileInfo['swf']['header']['frame_rate'] > 0)) {

Modified: plog/trunk/class/gallery/getid3/module.audio.aac.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio.aac.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio.aac.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_aac
 {
 

Modified: plog/trunk/class/gallery/getid3/module.audio.ac3.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio.ac3.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio.ac3.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_ac3
 {
 

Modified: plog/trunk/class/gallery/getid3/module.audio.au.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio.au.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio.au.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_au
 {
 

Modified: plog/trunk/class/gallery/getid3/module.audio.avr.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio.avr.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio.avr.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_avr
 {
 

Modified: plog/trunk/class/gallery/getid3/module.audio.bonk.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio.bonk.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio.bonk.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_bonk
 {
 	function getid3_bonk(&$fd, &$ThisFileInfo) {
@@ -125,7 +123,6 @@
 				$thisfile_bonk_BONK['downsampling_ratio'] =        getid3_lib::LittleEndian2Int(substr($BonkData, 19, 1));
 				$thisfile_bonk_BONK['samples_per_packet'] =        getid3_lib::LittleEndian2Int(substr($BonkData, 20, 2));
 
-
 				$ThisFileInfo['avdataoffset'] = $thisfile_bonk_BONK['offset'] + 5 + 17;
 				$ThisFileInfo['avdataend']    = $thisfile_bonk_BONK['offset'] + $thisfile_bonk_BONK['size'];
 

Modified: plog/trunk/class/gallery/getid3/module.audio.flac.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio.flac.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio.flac.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -15,9 +15,7 @@
 
 
 getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.ogg.php', __FILE__, true);
-/**
- * \ingroup getid3
- */
+
 class getid3_flac
 {
 
@@ -33,7 +31,7 @@
 		$ThisFileInfo['fileformat']            = 'flac';
 		$ThisFileInfo['audio']['dataformat']   = 'flac';
 		$ThisFileInfo['audio']['bitrate_mode'] = 'vbr';
-		$ThisFileInfo['audio']['lossless']     = false;
+		$ThisFileInfo['audio']['lossless']     = true;
 
 		return getid3_flac::FLACparseMETAdata($fd, $ThisFileInfo);
 	}
@@ -49,18 +47,26 @@
 			$METAdataBlockLength          = getid3_lib::BigEndian2Int(substr($METAdataBlockHeader, 1, 3));
 			$METAdataBlockTypeText        = getid3_flac::FLACmetaBlockTypeLookup($METAdataBlockType);
 
-			$ThisFileInfo['flac']["$METAdataBlockTypeText"]['raw']['offset']          = $METAdataBlockOffset;
-			$ThisFileInfo['flac']["$METAdataBlockTypeText"]['raw']['last_meta_block'] = $METAdataLastBlockFlag;
-			$ThisFileInfo['flac']["$METAdataBlockTypeText"]['raw']['block_type']      = $METAdataBlockType;
-			$ThisFileInfo['flac']["$METAdataBlockTypeText"]['raw']['block_type_text'] = $METAdataBlockTypeText;
-			$ThisFileInfo['flac']["$METAdataBlockTypeText"]['raw']['block_length']    = $METAdataBlockLength;
-			$ThisFileInfo['flac']["$METAdataBlockTypeText"]['raw']['block_data']      = fread($fd, $METAdataBlockLength);
+			if ($METAdataBlockLength <= 0) {
+				$ThisFileInfo['error'][] = 'corrupt or invalid METADATA_BLOCK_HEADER.BLOCK_TYPE ('.$METAdataBlockType.') at offset '.$METAdataBlockOffset;
+				break;
+			}
+
+			$ThisFileInfo['flac'][$METAdataBlockTypeText]['raw'] = array();
+			$ThisFileInfo_flac_METAdataBlockTypeText_raw = &$ThisFileInfo['flac'][$METAdataBlockTypeText]['raw'];
+
+			$ThisFileInfo_flac_METAdataBlockTypeText_raw['offset']          = $METAdataBlockOffset;
+			$ThisFileInfo_flac_METAdataBlockTypeText_raw['last_meta_block'] = $METAdataLastBlockFlag;
+			$ThisFileInfo_flac_METAdataBlockTypeText_raw['block_type']      = $METAdataBlockType;
+			$ThisFileInfo_flac_METAdataBlockTypeText_raw['block_type_text'] = $METAdataBlockTypeText;
+			$ThisFileInfo_flac_METAdataBlockTypeText_raw['block_length']    = $METAdataBlockLength;
+			$ThisFileInfo_flac_METAdataBlockTypeText_raw['block_data']      = fread($fd, $METAdataBlockLength);
 			$ThisFileInfo['avdataoffset'] = ftell($fd);
 
 			switch ($METAdataBlockTypeText) {
 
 				case 'STREAMINFO':
-					if (!getid3_flac::FLACparseSTREAMINFO($ThisFileInfo['flac']["$METAdataBlockTypeText"]['raw']['block_data'], $ThisFileInfo)) {
+					if (!getid3_flac::FLACparseSTREAMINFO($ThisFileInfo_flac_METAdataBlockTypeText_raw['block_data'], $ThisFileInfo)) {
 						return false;
 					}
 					break;
@@ -70,13 +76,13 @@
 					break;
 
 				case 'APPLICATION':
-					if (!getid3_flac::FLACparseAPPLICATION($ThisFileInfo['flac']["$METAdataBlockTypeText"]['raw']['block_data'], $ThisFileInfo)) {
+					if (!getid3_flac::FLACparseAPPLICATION($ThisFileInfo_flac_METAdataBlockTypeText_raw['block_data'], $ThisFileInfo)) {
 						return false;
 					}
 					break;
 
 				case 'SEEKTABLE':
-					if (!getid3_flac::FLACparseSEEKTABLE($ThisFileInfo['flac']["$METAdataBlockTypeText"]['raw']['block_data'], $ThisFileInfo)) {
+					if (!getid3_flac::FLACparseSEEKTABLE($ThisFileInfo_flac_METAdataBlockTypeText_raw['block_data'], $ThisFileInfo)) {
 						return false;
 					}
 					break;
@@ -89,7 +95,7 @@
 					break;
 
 				case 'CUESHEET':
-					if (!getid3_flac::FLACparseCUESHEET($ThisFileInfo['flac']["$METAdataBlockTypeText"]['raw']['block_data'], $ThisFileInfo)) {
+					if (!getid3_flac::FLACparseCUESHEET($ThisFileInfo_flac_METAdataBlockTypeText_raw['block_data'], $ThisFileInfo)) {
 						return false;
 					}
 					break;
@@ -124,7 +130,7 @@
 				$ThisFileInfo['md5_data_source'] = '';
 				$md5 = $ThisFileInfo['flac']['STREAMINFO']['audio_signature'];
 				for ($i = 0; $i < strlen($md5); $i++) {
-					$ThisFileInfo['md5_data_source'] .= str_pad(dechex(ord($md5[$i])), 2, '00', STR_PAD_LEFT);
+					$ThisFileInfo['md5_data_source'] .= str_pad(dechex(ord($md5{$i})), 2, '00', STR_PAD_LEFT);
 				}
 				if (!preg_match('/^[0-9a-f]{32}$/', $ThisFileInfo['md5_data_source'])) {
 					unset($ThisFileInfo['md5_data_source']);
@@ -287,7 +293,7 @@
 			for ($index = 0; $index < $ThisFileInfo['flac']['CUESHEET']['tracks'][$TrackNumber]['index_points']; $index++) {
 				$IndexSampleOffset = getid3_lib::BigEndian2Int(substr($METAdataBlockData, $offset, 8));
 				$offset += 8;
-				$IndexNumber       = getid3_lib::BigEndian2Int(substr($METAdataBlockData, $offset, 8));
+				$IndexNumber       = getid3_lib::BigEndian2Int(substr($METAdataBlockData, $offset, 1));
 				$offset += 1;
 
 				$offset += 3; // reserved

Modified: plog/trunk/class/gallery/getid3/module.audio.la.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio.la.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio.la.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -15,9 +15,6 @@
 
 getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true);
 
-/**
- * \ingroup getid3
- */
 class getid3_la
 {
 

Modified: plog/trunk/class/gallery/getid3/module.audio.lpac.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio.lpac.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio.lpac.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -15,9 +15,6 @@
 
 getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true);
 
-/**
- * \ingroup getid3
- */
 class getid3_lpac
 {
 

Modified: plog/trunk/class/gallery/getid3/module.audio.midi.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio.midi.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio.midi.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_midi
 {
 
@@ -74,10 +72,10 @@
 		}
 
 		if ($scanwholefile) { // this can take quite a long time, so have the option to bypass it if speed is very important
-			$thisfile_midi['totalticks'] = 0;
-			$ThisFileInfo['playtime_seconds']   = 0;
-			$CurrentMicroSecondsPerBeat = 500000; // 120 beats per minute;  60,000,000 microseconds per minute -> 500,000 microseconds per beat
-			$CurrentBeatsPerMinute      = 120;    // 120 beats per minute;  60,000,000 microseconds per minute -> 500,000 microseconds per beat
+			$thisfile_midi['totalticks']      = 0;
+			$ThisFileInfo['playtime_seconds'] = 0;
+			$CurrentMicroSecondsPerBeat       = 500000; // 120 beats per minute;  60,000,000 microseconds per minute -> 500,000 microseconds per beat
+			$CurrentBeatsPerMinute            = 120;    // 120 beats per minute;  60,000,000 microseconds per minute -> 500,000 microseconds per beat
 
 			foreach ($trackdataarray as $tracknumber => $trackdata) {
 
@@ -92,7 +90,7 @@
 						$eventid = count($MIDIevents[$tracknumber]);
 					}
 					$deltatime = 0;
-					for ($i=0;$i<4;$i++) {
+					for ($i = 0; $i < 4; $i++) {
 						$deltatimebyte = ord(substr($trackdata, $eventsoffset++, 1));
 						$deltatime = ($deltatime << 7) + ($deltatimebyte & 0x7F);
 						if ($deltatimebyte & 0x80) {
@@ -115,27 +113,27 @@
 					}
 					$MIDIevents[$tracknumber][$eventid]['eventid']   = $LastIssuedMIDIcommand;
 					$MIDIevents[$tracknumber][$eventid]['channel']   = $LastIssuedMIDIchannel;
-					if ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x8) { // Note off (key is released)
+					if ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x08) { // Note off (key is released)
 
 						$notenumber = ord(substr($trackdata, $eventsoffset++, 1));
 						$velocity   = ord(substr($trackdata, $eventsoffset++, 1));
 
-					} elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x9) { // Note on (key is pressed)
+					} elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x09) { // Note on (key is pressed)
 
 						$notenumber = ord(substr($trackdata, $eventsoffset++, 1));
 						$velocity   = ord(substr($trackdata, $eventsoffset++, 1));
 
-					} elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0xA) { // Key after-touch
+					} elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x0A) { // Key after-touch
 
 						$notenumber = ord(substr($trackdata, $eventsoffset++, 1));
 						$velocity   = ord(substr($trackdata, $eventsoffset++, 1));
 
-					} elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0xB) { // Control Change
+					} elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x0B) { // Control Change
 
 						$controllernum = ord(substr($trackdata, $eventsoffset++, 1));
 						$newvalue      = ord(substr($trackdata, $eventsoffset++, 1));
 
-					} elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0xC) { // Program (patch) change
+					} elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x0C) { // Program (patch) change
 
 						$newprogramnum = ord(substr($trackdata, $eventsoffset++, 1));
 
@@ -146,17 +144,17 @@
 							$thisfile_midi_raw['track'][$tracknumber]['instrument'] = $this->GeneralMIDIinstrumentLookup($newprogramnum);
 						}
 
-					} elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0xD) { // Channel after-touch
+					} elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x0D) { // Channel after-touch
 
 						$channelnumber = ord(substr($trackdata, $eventsoffset++, 1));
 
-					} elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0xE) { // Pitch wheel change (2000H is normal or no change)
+					} elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x0E) { // Pitch wheel change (2000H is normal or no change)
 
 						$changeLSB = ord(substr($trackdata, $eventsoffset++, 1));
 						$changeMSB = ord(substr($trackdata, $eventsoffset++, 1));
 						$pitchwheelchange = (($changeMSB & 0x7F) << 7) & ($changeLSB & 0x7F);
 
-					} elseif (($MIDIevents[$tracknumber][$eventid]['eventid'] == 0xF) && ($MIDIevents[$tracknumber][$eventid]['channel'] == 0xF)) {
+					} elseif (($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x0F) && ($MIDIevents[$tracknumber][$eventid]['channel'] == 0x0F)) {
 
 						$METAeventCommand = ord(substr($trackdata, $eventsoffset++, 1));
 						$METAeventLength  = ord(substr($trackdata, $eventsoffset++, 1));
@@ -190,13 +188,13 @@
 								//$thisfile_midi_raw['events'][$tracknumber][$eventid]['instrument'] = $text_instrument;
 								break;
 
-							case 0x05: // Text: lyric
-								$text_lyric  = substr($METAeventData, 0, $METAeventLength);
-								//$thisfile_midi_raw['events'][$tracknumber][$eventid]['lyric'] = $text_lyric;
-								if (!isset($thisfile_midi['lyric'])) {
-									$thisfile_midi['lyric'] = '';
+							case 0x05: // Text: lyrics
+								$text_lyrics  = substr($METAeventData, 0, $METAeventLength);
+								//$thisfile_midi_raw['events'][$tracknumber][$eventid]['lyrics'] = $text_lyrics;
+								if (!isset($thisfile_midi['lyrics'])) {
+									$thisfile_midi['lyrics'] = '';
 								}
-								$thisfile_midi['lyric'] .= $text_lyric."\n";
+								$thisfile_midi['lyrics'] .= $text_lyrics."\n";
 								break;
 
 							case 0x06: // Text: marker
@@ -220,7 +218,7 @@
 									return false;
 								}
 								$thisfile_midi_raw['events'][$tracknumber][$CumulativeDeltaTime]['us_qnote'] = $CurrentMicroSecondsPerBeat;
-								$CurrentBeatsPerMinute      = (1000000 / $CurrentMicroSecondsPerBeat) * 60;
+								$CurrentBeatsPerMinute = (1000000 / $CurrentMicroSecondsPerBeat) * 60;
 								$MicroSecondsPerQuarterNoteAfter[$CumulativeDeltaTime] = $CurrentMicroSecondsPerBeat;
 								$TicksAtCurrentBPM = 0;
 								break;
@@ -265,16 +263,23 @@
 
 					} else {
 
-						$ThisFileInfo['warning'][] = 'Unhandled MIDI Event ID: '.$MIDIevents[$tracknumber][$eventid]['eventid'];
+						$ThisFileInfo['warning'][] = 'Unhandled MIDI Event ID: '.$MIDIevents[$tracknumber][$eventid]['eventid'].' + Channel ID: '.$MIDIevents[$tracknumber][$eventid]['channel'];
 
 					}
 				}
-				if ($tracknumber > 0) {
+				if (($tracknumber > 0) || (count($trackdataarray) == 1)) {
 					$thisfile_midi['totalticks'] = max($thisfile_midi['totalticks'], $CumulativeDeltaTime);
 				}
 			}
-			$previoustickoffset = 0;
+			$previoustickoffset = null;
+
+			ksort($MicroSecondsPerQuarterNoteAfter);
 			foreach ($MicroSecondsPerQuarterNoteAfter as $tickoffset => $microsecondsperbeat) {
+				if (is_null($previoustickoffset)) {
+					$prevmicrosecondsperbeat = $microsecondsperbeat;
+					$previoustickoffset = $tickoffset;
+					continue;
+				}
 				if ($thisfile_midi['totalticks'] > $tickoffset) {
 
 					if ($thisfile_midi_raw['ticksperqnote'] == 0) {
@@ -282,7 +287,9 @@
 						return false;
 					}
 
-					$ThisFileInfo['playtime_seconds'] += (($tickoffset - $previoustickoffset) / $thisfile_midi_raw['ticksperqnote']) * ($microsecondsperbeat / 1000000);
+					$ThisFileInfo['playtime_seconds'] += (($tickoffset - $previoustickoffset) / $thisfile_midi_raw['ticksperqnote']) * ($prevmicrosecondsperbeat / 1000000);
+
+					$prevmicrosecondsperbeat = $microsecondsperbeat;
 					$previoustickoffset = $tickoffset;
 				}
 			}
@@ -298,6 +305,14 @@
 			}
 		}
 
+		if ($ThisFileInfo['playtime_seconds'] > 0) {
+			$ThisFileInfo['bitrate'] = (($ThisFileInfo['avdataend'] - $ThisFileInfo['avdataoffset']) * 8) / $ThisFileInfo['playtime_seconds'];
+		}
+
+		if (!empty($thisfile_midi['lyrics'])) {
+			$thisfile_midi['comments']['lyrics'][] = $thisfile_midi['lyrics'];
+		}
+
 		return true;
 	}
 

Modified: plog/trunk/class/gallery/getid3/module.audio.mod.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio.mod.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio.mod.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_mod
 {
 

Modified: plog/trunk/class/gallery/getid3/module.audio.monkey.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio.monkey.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio.monkey.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_monkey
 {
 
@@ -33,7 +31,7 @@
 		$thisfile_monkeysaudio_raw            = &$thisfile_monkeysaudio['raw'];
 
 		fseek($fd, $ThisFileInfo['avdataoffset'], SEEK_SET);
-		$MACheaderData = fread($fd, 40);
+		$MACheaderData = fread($fd, 74);
 
 		$thisfile_monkeysaudio_raw['magic'] = substr($MACheaderData, 0, 4);
 		if ($thisfile_monkeysaudio_raw['magic'] != 'MAC ') {
@@ -41,18 +39,59 @@
 			unset($ThisFileInfo['fileformat']);
 			return false;
 		}
-		$thisfile_monkeysaudio_raw['nVersion']             = getid3_lib::LittleEndian2Int(substr($MACheaderData, 4, 2));
-		$thisfile_monkeysaudio_raw['nCompressionLevel']    = getid3_lib::LittleEndian2Int(substr($MACheaderData, 6, 2));
-		$thisfile_monkeysaudio_raw['nFormatFlags']         = getid3_lib::LittleEndian2Int(substr($MACheaderData, 8, 2));
-		$thisfile_monkeysaudio_raw['nChannels']            = getid3_lib::LittleEndian2Int(substr($MACheaderData, 10, 2));
-		$thisfile_monkeysaudio_raw['nSampleRate']          = getid3_lib::LittleEndian2Int(substr($MACheaderData, 12, 4));
-		$thisfile_monkeysaudio_raw['nWAVHeaderBytes']      = getid3_lib::LittleEndian2Int(substr($MACheaderData, 16, 4));
-		$thisfile_monkeysaudio_raw['nWAVTerminatingBytes'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 20, 4));
-		$thisfile_monkeysaudio_raw['nTotalFrames']         = getid3_lib::LittleEndian2Int(substr($MACheaderData, 24, 4));
-		$thisfile_monkeysaudio_raw['nFinalFrameSamples']   = getid3_lib::LittleEndian2Int(substr($MACheaderData, 28, 4));
-		$thisfile_monkeysaudio_raw['nPeakLevel']           = getid3_lib::LittleEndian2Int(substr($MACheaderData, 32, 4));
-		$thisfile_monkeysaudio_raw['nSeekElements']        = getid3_lib::LittleEndian2Int(substr($MACheaderData, 38, 2));
+		$thisfile_monkeysaudio_raw['nVersion']             = getid3_lib::LittleEndian2Int(substr($MACheaderData, 4, 2)); // appears to be uint32 in 3.98+
 
+		if ($thisfile_monkeysaudio_raw['nVersion'] < 3980) {
+			$thisfile_monkeysaudio_raw['nCompressionLevel']    = getid3_lib::LittleEndian2Int(substr($MACheaderData, 6, 2));
+			$thisfile_monkeysaudio_raw['nFormatFlags']         = getid3_lib::LittleEndian2Int(substr($MACheaderData, 8, 2));
+			$thisfile_monkeysaudio_raw['nChannels']            = getid3_lib::LittleEndian2Int(substr($MACheaderData, 10, 2));
+			$thisfile_monkeysaudio_raw['nSampleRate']          = getid3_lib::LittleEndian2Int(substr($MACheaderData, 12, 4));
+			$thisfile_monkeysaudio_raw['nHeaderDataBytes']     = getid3_lib::LittleEndian2Int(substr($MACheaderData, 16, 4));
+			$thisfile_monkeysaudio_raw['nWAVTerminatingBytes'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 20, 4));
+			$thisfile_monkeysaudio_raw['nTotalFrames']         = getid3_lib::LittleEndian2Int(substr($MACheaderData, 24, 4));
+			$thisfile_monkeysaudio_raw['nFinalFrameSamples']   = getid3_lib::LittleEndian2Int(substr($MACheaderData, 28, 4));
+			$thisfile_monkeysaudio_raw['nPeakLevel']           = getid3_lib::LittleEndian2Int(substr($MACheaderData, 32, 4));
+			$thisfile_monkeysaudio_raw['nSeekElements']        = getid3_lib::LittleEndian2Int(substr($MACheaderData, 38, 2));
+			$offset = 8;
+		} else {
+			$offset = 8;
+			// APE_DESCRIPTOR
+			$thisfile_monkeysaudio_raw['nDescriptorBytes']       = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset,  4));
+			$offset += 4;
+			$thisfile_monkeysaudio_raw['nHeaderBytes']           = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset,  4));
+			$offset += 4;
+			$thisfile_monkeysaudio_raw['nSeekTableBytes']        = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset,  4));
+			$offset += 4;
+			$thisfile_monkeysaudio_raw['nHeaderDataBytes']       = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset,  4));
+			$offset += 4;
+			$thisfile_monkeysaudio_raw['nAPEFrameDataBytes']     = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset,  4));
+			$offset += 4;
+			$thisfile_monkeysaudio_raw['nAPEFrameDataBytesHigh'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset,  4));
+			$offset += 4;
+			$thisfile_monkeysaudio_raw['nTerminatingDataBytes']  = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset,  4));
+			$offset += 4;
+			$thisfile_monkeysaudio_raw['cFileMD5']               =                              substr($MACheaderData, $offset, 16);
+			$offset += 16;
+
+			// APE_HEADER
+			$thisfile_monkeysaudio_raw['nCompressionLevel']    = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 2));
+			$offset += 2;
+			$thisfile_monkeysaudio_raw['nFormatFlags']         = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 2));
+			$offset += 2;
+			$thisfile_monkeysaudio_raw['nBlocksPerFrame']      = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4));
+			$offset += 4;
+			$thisfile_monkeysaudio_raw['nFinalFrameBlocks']    = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4));
+			$offset += 4;
+			$thisfile_monkeysaudio_raw['nTotalFrames']         = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4));
+			$offset += 4;
+			$thisfile_monkeysaudio_raw['nBitsPerSample']       = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 2));
+			$offset += 2;
+			$thisfile_monkeysaudio_raw['nChannels']            = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 2));
+			$offset += 2;
+			$thisfile_monkeysaudio_raw['nSampleRate']          = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4));
+			$offset += 4;
+		}
+
 		$thisfile_monkeysaudio['flags']['8-bit']         = (bool) ($thisfile_monkeysaudio_raw['nFormatFlags'] & 0x0001);
 		$thisfile_monkeysaudio['flags']['crc-32']        = (bool) ($thisfile_monkeysaudio_raw['nFormatFlags'] & 0x0002);
 		$thisfile_monkeysaudio['flags']['peak_level']    = (bool) ($thisfile_monkeysaudio_raw['nFormatFlags'] & 0x0004);
@@ -61,12 +100,10 @@
 		$thisfile_monkeysaudio['flags']['no_wav_header'] = (bool) ($thisfile_monkeysaudio_raw['nFormatFlags'] & 0x0020);
 		$thisfile_monkeysaudio['version']                = $thisfile_monkeysaudio_raw['nVersion'] / 1000;
 		$thisfile_monkeysaudio['compression']            = $this->MonkeyCompressionLevelNameLookup($thisfile_monkeysaudio_raw['nCompressionLevel']);
-		$thisfile_monkeysaudio['samples_per_frame']      = $this->MonkeySamplesPerFrame($thisfile_monkeysaudio_raw['nVersion'], $thisfile_monkeysaudio_raw['nCompressionLevel']);
+		if ($thisfile_monkeysaudio_raw['nVersion'] < 3980) {
+			$thisfile_monkeysaudio['samples_per_frame']      = $this->MonkeySamplesPerFrame($thisfile_monkeysaudio_raw['nVersion'], $thisfile_monkeysaudio_raw['nCompressionLevel']);
+		}
 		$thisfile_monkeysaudio['bits_per_sample']        = ($thisfile_monkeysaudio['flags']['24-bit'] ? 24 : ($thisfile_monkeysaudio['flags']['8-bit'] ? 8 : 16));
-		if ($thisfile_monkeysaudio['bits_per_sample'] == 0) {
-			$ThisFileInfo['error'][] = 'Corrupt MAC file: bits_per_sample == zero';
-			return false;
-		}
 		$thisfile_monkeysaudio['channels']               = $thisfile_monkeysaudio_raw['nChannels'];
 		$ThisFileInfo['audio']['channels']               = $thisfile_monkeysaudio['channels'];
 		$thisfile_monkeysaudio['sample_rate']            = $thisfile_monkeysaudio_raw['nSampleRate'];
@@ -75,10 +112,15 @@
 			return false;
 		}
 		$ThisFileInfo['audio']['sample_rate']            = $thisfile_monkeysaudio['sample_rate'];
-		$thisfile_monkeysaudio['peak_level']             = $thisfile_monkeysaudio_raw['nPeakLevel'];
-		$thisfile_monkeysaudio['peak_ratio']             = $thisfile_monkeysaudio['peak_level'] / pow(2, $thisfile_monkeysaudio['bits_per_sample'] - 1);
-		$thisfile_monkeysaudio['frames']                 = $thisfile_monkeysaudio_raw['nTotalFrames'];
-		$thisfile_monkeysaudio['samples']                = (($thisfile_monkeysaudio['frames'] - 1) * $thisfile_monkeysaudio['samples_per_frame']) + $thisfile_monkeysaudio_raw['nFinalFrameSamples'];
+		if ($thisfile_monkeysaudio['flags']['peak_level']) {
+			$thisfile_monkeysaudio['peak_level']         = $thisfile_monkeysaudio_raw['nPeakLevel'];
+			$thisfile_monkeysaudio['peak_ratio']         = $thisfile_monkeysaudio['peak_level'] / pow(2, $thisfile_monkeysaudio['bits_per_sample'] - 1);
+		}
+		if ($thisfile_monkeysaudio_raw['nVersion'] >= 3980) {
+			$thisfile_monkeysaudio['samples']            = (($thisfile_monkeysaudio_raw['nTotalFrames'] - 1) * $thisfile_monkeysaudio_raw['nBlocksPerFrame']) + $thisfile_monkeysaudio_raw['nFinalFrameBlocks'];
+		} else {
+			$thisfile_monkeysaudio['samples']            = (($thisfile_monkeysaudio_raw['nTotalFrames'] - 1) * $thisfile_monkeysaudio['samples_per_frame']) + $thisfile_monkeysaudio_raw['nFinalFrameSamples'];
+		}
 		$thisfile_monkeysaudio['playtime']               = $thisfile_monkeysaudio['samples'] / $thisfile_monkeysaudio['sample_rate'];
 		if ($thisfile_monkeysaudio['playtime'] == 0) {
 			$ThisFileInfo['error'][] = 'Corrupt MAC file: playtime == zero';
@@ -91,13 +133,39 @@
 			$ThisFileInfo['error'][] = 'Corrupt MAC file: uncompressed_size == zero';
 			return false;
 		}
-		$thisfile_monkeysaudio['compression_ratio']      = $thisfile_monkeysaudio['compressed_size'] / ($thisfile_monkeysaudio['uncompressed_size'] + $thisfile_monkeysaudio_raw['nWAVHeaderBytes']);
+		$thisfile_monkeysaudio['compression_ratio']      = $thisfile_monkeysaudio['compressed_size'] / ($thisfile_monkeysaudio['uncompressed_size'] + $thisfile_monkeysaudio_raw['nHeaderDataBytes']);
 		$thisfile_monkeysaudio['bitrate']                = (($thisfile_monkeysaudio['samples'] * $thisfile_monkeysaudio['channels'] * $thisfile_monkeysaudio['bits_per_sample']) / $thisfile_monkeysaudio['playtime']) * $thisfile_monkeysaudio['compression_ratio'];
 		$ThisFileInfo['audio']['bitrate']                = $thisfile_monkeysaudio['bitrate'];
 
-		// add size of MAC header to avdataoffset - MD5data
-		$ThisFileInfo['avdataoffset'] += 40;
+		// add size of MAC header to avdataoffset
+		if ($thisfile_monkeysaudio_raw['nVersion'] >= 3980) {
+			$ThisFileInfo['avdataoffset'] += $thisfile_monkeysaudio_raw['nDescriptorBytes'];
+			$ThisFileInfo['avdataoffset'] += $thisfile_monkeysaudio_raw['nHeaderBytes'];
+			$ThisFileInfo['avdataoffset'] += $thisfile_monkeysaudio_raw['nSeekTableBytes'];
+			$ThisFileInfo['avdataoffset'] += $thisfile_monkeysaudio_raw['nHeaderDataBytes'];
 
+			$ThisFileInfo['avdataend'] -= $thisfile_monkeysaudio_raw['nTerminatingDataBytes'];
+		} else {
+			$ThisFileInfo['avdataoffset'] += $offset;
+		}
+
+		if ($thisfile_monkeysaudio_raw['nVersion'] >= 3980) {
+			if ($thisfile_monkeysaudio_raw['cFileMD5'] === str_repeat("\x00", 16)) {
+				//$ThisFileInfo['warning'][] = 'cFileMD5 is null';
+			} else {
+				$ThisFileInfo['md5_data_source'] = '';
+				$md5 = $thisfile_monkeysaudio_raw['cFileMD5'];
+				for ($i = 0; $i < strlen($md5); $i++) {
+					$ThisFileInfo['md5_data_source'] .= str_pad(dechex(ord($md5{$i})), 2, '00', STR_PAD_LEFT);
+				}
+				if (!preg_match('/^[0-9a-f]{32}$/', $ThisFileInfo['md5_data_source'])) {
+					unset($ThisFileInfo['md5_data_source']);
+				}
+			}
+		}
+
+
+
 		$ThisFileInfo['audio']['bits_per_sample'] = $thisfile_monkeysaudio['bits_per_sample'];
 		$ThisFileInfo['audio']['encoder']         = 'MAC v'.number_format($thisfile_monkeysaudio['version'], 2);
 		$ThisFileInfo['audio']['encoder_options'] = ucfirst($thisfile_monkeysaudio['compression']).' compression';

Modified: plog/trunk/class/gallery/getid3/module.audio.mp3.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio.mp3.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio.mp3.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -20,9 +20,7 @@
 // mpeg-audio streams
 define('GETID3_MP3_VALID_CHECK_FRAMES', 35);
 
-/**
- * \ingroup getid3
- */
+
 class getid3_mp3
 {
 
@@ -198,6 +196,8 @@
 				$KnownEncoderValues['**'][88][4][1][3][3][19500] = '--r3mix';                    // 3.90,   3.90.1, 3.92
 				$KnownEncoderValues['**'][88][4][1][3][3][19600] = '--r3mix';                    // 3.90.2, 3.90.3, 3.91
 				$KnownEncoderValues['**'][67][4][1][3][4][18000] = '--r3mix';                    // 3.94,   3.95
+				$KnownEncoderValues['**'][68][3][2][3][4][18000] = '--alt-preset medium';        // 3.90.3
+				$KnownEncoderValues['**'][68][4][2][3][4][18000] = '--alt-preset fast medium';   // 3.90.3
 
 				$KnownEncoderValues[0xFF][99][1][1][1][2][0]     = '--preset studio';            // 3.90,   3.90.1, 3.90.2, 3.91, 3.92
 				$KnownEncoderValues[0xFF][58][2][1][3][2][20600] = '--preset studio';            // 3.90.3, 3.93.1
@@ -521,7 +521,7 @@
 					if (($thisfile_mpeg_audio['bitrate'] == 'free') || ($thisfile_mpeg_audio['bitrate'] == 64000) || ($thisfile_mpeg_audio['bitrate'] >= 96000)) {
 						// these are ok
 					} else {
-						$ThisFileInfo['error'][] = round($thisfile_mpeg_audio['bitrate'] / 1000).'kbps not allowed in Layer 2, '.$thisfile_mpeg_audio['channelmode'].'.';
+						$ThisFileInfo['error'][] = intval(round($thisfile_mpeg_audio['bitrate'] / 1000)).'kbps not allowed in Layer 2, '.$thisfile_mpeg_audio['channelmode'].'.';
 						return false;
 					}
 					break;
@@ -1173,7 +1173,7 @@
 				$nextoffset += $framelength;
 			}
 			if (count($ActualFrameLengthValues) > 0) {
-				$framelength = round(array_sum($ActualFrameLengthValues) / count($ActualFrameLengthValues));
+				$framelength = intval(round(array_sum($ActualFrameLengthValues) / count($ActualFrameLengthValues)));
 			}
 		}
 		return $framelength;
@@ -1332,7 +1332,7 @@
 
 		}
 
-		$header_len = strlen($header) - round(GETID3_FREAD_BUFFER_SIZE / 2);
+		$header_len = strlen($header) - intval(round(GETID3_FREAD_BUFFER_SIZE / 2));
 		while (true) {
 
 			if (($SynchSeekOffset > $header_len) && (($avdataoffset + $SynchSeekOffset)  < $ThisFileInfo['avdataend']) && !feof($fd)) {
@@ -1354,7 +1354,7 @@
 				} elseif ($header .= fread($fd, GETID3_FREAD_BUFFER_SIZE)) {
 
 					// great
-					$header_len = strlen($header) - round(GETID3_FREAD_BUFFER_SIZE / 2);
+					$header_len = strlen($header) - intval(round(GETID3_FREAD_BUFFER_SIZE / 2));
 
 				} else {
 
@@ -1798,7 +1798,7 @@
 	function ClosestStandardMP3Bitrate($bitrate) {
 		static $StandardBitrates = array(320000, 256000, 224000, 192000, 160000, 128000, 112000, 96000, 80000, 64000, 56000, 48000, 40000, 32000, 24000, 16000, 8000);
 		static $BitrateTable = array(0=>'-');
-		$roundbitrate = round($bitrate, -3);
+		$roundbitrate = intval(round($bitrate, -3));
 		if (!isset($BitrateTable[$roundbitrate])) {
 			if ($roundbitrate > 320000) {
 				$BitrateTable[$roundbitrate] = round($bitrate, -4);
@@ -1924,18 +1924,17 @@
 			$LAMEpresetUsedLookup[1006] = '--alt-preset medium';
 			$LAMEpresetUsedLookup[1007] = '--alt-preset fast medium';
 
-			if ($LAMEtag['short_version'] >= 'LAME3.94') {
-				// LAME 3.94 additions/changes
-				$LAMEpresetUsedLookup[320]  = '--preset insane';                                                             // 3.94a15 Nov 12 2003
-				$LAMEpresetUsedLookup[430]  = '--preset radio';                                                              // 3.94a15 Nov 12 2003
-				$LAMEpresetUsedLookup[450]  = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'portable'; // 3.94a15 Nov 12 2003
-				$LAMEpresetUsedLookup[460]  = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'medium';   // 3.94a15 Nov 12 2003
-				$LAMEpresetUsedLookup[470]  = '--r3mix';                                                                     // 3.94b1  Dec 18 2003
-				$LAMEpresetUsedLookup[480]  = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'standard'; // 3.94a15 Nov 12 2003
-				$LAMEpresetUsedLookup[500]  = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'extreme';  // 3.94a15 Nov 12 2003
-				$LAMEpresetUsedLookup[1010] = '--preset portable';                                                           // 3.94a15 Oct 21 2003
-				$LAMEpresetUsedLookup[1015] = '--preset radio';                                                              // 3.94a15 Oct 21 2003
-			}
+			// LAME 3.94 additions/changes
+			$LAMEpresetUsedLookup[1010] = '--preset portable';                                                           // 3.94a15 Oct 21 2003
+			$LAMEpresetUsedLookup[1015] = '--preset radio';                                                              // 3.94a15 Oct 21 2003
+
+			$LAMEpresetUsedLookup[320]  = '--preset insane';                                                             // 3.94a15 Nov 12 2003
+			$LAMEpresetUsedLookup[430]  = '--preset radio';                                                              // 3.94a15 Nov 12 2003
+			$LAMEpresetUsedLookup[450]  = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'portable';  // 3.94a15 Nov 12 2003
+			$LAMEpresetUsedLookup[460]  = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'medium';    // 3.94a15 Nov 12 2003
+			$LAMEpresetUsedLookup[470]  = '--r3mix';                                                                     // 3.94b1  Dec 18 2003
+			$LAMEpresetUsedLookup[480]  = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'standard';  // 3.94a15 Nov 12 2003
+			$LAMEpresetUsedLookup[500]  = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'extreme';   // 3.94a15 Nov 12 2003
 		}
 		return (isset($LAMEpresetUsedLookup[$LAMEtag['preset_used_id']]) ? $LAMEpresetUsedLookup[$LAMEtag['preset_used_id']] : 'new/unknown preset: '.$LAMEtag['preset_used_id'].' - report to info at getid3.org');
 	}

Modified: plog/trunk/class/gallery/getid3/module.audio.mpc.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio.mpc.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio.mpc.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_mpc
 {
 
@@ -33,7 +31,7 @@
 
 		fseek($fd, $ThisFileInfo['avdataoffset'], SEEK_SET);
 
-		$thisfile_mpc_header['size']    = 30;
+		$thisfile_mpc_header['size'] = 28;
 		$MPCheaderData = fread($fd, $thisfile_mpc_header['size']);
 		$offset = 0;
 
@@ -46,6 +44,11 @@
 		} elseif (preg_match('/^[\x00\x01\x10\x11\x40\x41\x50\x51\x80\x81\x90\x91\xC0\xC1\xD0\xD1][\x20-37][\x00\x20\x40\x60\x80\xA0\xC0\xE0]/s', substr($MPCheaderData, 0, 4))) {
 
 			// this is SV4 - SV6, handle seperately
+            $thisfile_mpc_header['size'] = 8;
+
+            // add size of file header to avdataoffset - calc bitrate correctly + MD5 data
+		    $ThisFileInfo['avdataoffset'] += $thisfile_mpc_header['size'];
+
 			// Most of this code adapted from Jurgen Faul's MPEGplus source code - thanks Jurgen! :)
 			$HeaderDWORD[0] = getid3_lib::LittleEndian2Int(substr($MPCheaderData, 0, 4));
 			$HeaderDWORD[1] = getid3_lib::LittleEndian2Int(substr($MPCheaderData, 4, 4));
@@ -73,6 +76,7 @@
 				case 4:
 					$thisfile_mpc_header['frame_count'] = ($HeaderDWORD[1] >> 16);
 					break;
+
 				case 5:
 				case 6:
 					$thisfile_mpc_header['frame_count'] =  $HeaderDWORD[1];
@@ -89,9 +93,9 @@
 				$ThisFileInfo['warning'][] = 'Block size expected to be 1, actual value found: '.$thisfile_mpc_header['block_size'];
 			}
 
-			$thisfile_mpc_header['sample_rate'] = 44100; // AB: used by all files up to SV7
-			$ThisFileInfo['audio']['sample_rate']         = $thisfile_mpc_header['sample_rate'];
-			$thisfile_mpc_header['samples']     = $thisfile_mpc_header['frame_count'] * 1152 * $ThisFileInfo['audio']['channels'];
+			$thisfile_mpc_header['sample_rate']   = 44100; // AB: used by all files up to SV7
+			$ThisFileInfo['audio']['sample_rate'] = $thisfile_mpc_header['sample_rate'];
+			$thisfile_mpc_header['samples']       = $thisfile_mpc_header['frame_count'] * 1152 * $ThisFileInfo['audio']['channels'];
 
 			if ($thisfile_mpc_header['target_bitrate'] == 0) {
 				$ThisFileInfo['audio']['bitrate_mode'] = 'vbr';
@@ -115,7 +119,7 @@
 		}
 
 		// Continue with SV7+ handling
-		$StreamVersionByte                                     = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 1));
+		$StreamVersionByte                           = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 1));
 		$offset += 1;
 		$thisfile_mpc_header['stream_major_version'] = ($StreamVersionByte & 0x0F);
 		$thisfile_mpc_header['stream_minor_version'] = ($StreamVersionByte & 0xF0) >> 4;
@@ -132,7 +136,7 @@
 				return false;
 		}
 
-		$FlagsDWORD1                                             = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 4));
+		$FlagsDWORD1                                   = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 4));
 		$offset += 4;
 		$thisfile_mpc_header['intensity_stereo']       = (bool) (($FlagsDWORD1 & 0x80000000) >> 31);
 		$thisfile_mpc_header['mid_side_stereo']        = (bool) (($FlagsDWORD1 & 0x40000000) >> 30);
@@ -153,7 +157,7 @@
 		$thisfile_mpc_header['raw']['album_gain']      = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 2), true);
 		$offset += 2;
 
-		$FlagsDWORD2                                             = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 4));
+		$FlagsDWORD2                                   = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 4));
 		$offset += 4;
 		$thisfile_mpc_header['true_gapless']           = (bool) (($FlagsDWORD2 & 0x80000000) >> 31);
 		$thisfile_mpc_header['last_frame_length']      =         ($FlagsDWORD2 & 0x7FF00000) >> 20;
@@ -164,16 +168,16 @@
 		$thisfile_mpc_header['raw']['encoder_version'] = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 1));
 		$offset += 1;
 
-		$thisfile_mpc_header['profile']                = $this->MPCprofileNameLookup($thisfile_mpc_header['raw']['profile']);
-		$thisfile_mpc_header['sample_rate']            = $this->MPCfrequencyLookup($thisfile_mpc_header['raw']['sample_rate']);
+		$thisfile_mpc_header['profile']     = $this->MPCprofileNameLookup($thisfile_mpc_header['raw']['profile']);
+		$thisfile_mpc_header['sample_rate'] = $this->MPCfrequencyLookup($thisfile_mpc_header['raw']['sample_rate']);
 		if ($thisfile_mpc_header['sample_rate'] == 0) {
 			$ThisFileInfo['error'][] = 'Corrupt MPC file: frequency == zero';
 			return false;
 		}
-		$ThisFileInfo['audio']['sample_rate']                    = $thisfile_mpc_header['sample_rate'];
-		$thisfile_mpc_header['samples']                = ((($thisfile_mpc_header['frame_count'] - 1) * 1152) + $thisfile_mpc_header['last_frame_length']) * $ThisFileInfo['audio']['channels'];
+		$ThisFileInfo['audio']['sample_rate'] = $thisfile_mpc_header['sample_rate'];
+		$thisfile_mpc_header['samples']       = ((($thisfile_mpc_header['frame_count'] - 1) * 1152) + $thisfile_mpc_header['last_frame_length']) * $ThisFileInfo['audio']['channels'];
 
-		$ThisFileInfo['playtime_seconds']                        = ($thisfile_mpc_header['samples'] / $ThisFileInfo['audio']['channels']) / $ThisFileInfo['audio']['sample_rate'];
+		$ThisFileInfo['playtime_seconds']     = ($thisfile_mpc_header['samples'] / $ThisFileInfo['audio']['channels']) / $ThisFileInfo['audio']['sample_rate'];
 		if ($ThisFileInfo['playtime_seconds'] == 0) {
 			$ThisFileInfo['error'][] = 'Corrupt MPC file: playtime_seconds == zero';
 			return false;
@@ -184,33 +188,33 @@
 
 		$ThisFileInfo['audio']['bitrate'] = (($ThisFileInfo['avdataend'] - $ThisFileInfo['avdataoffset']) * 8) / $ThisFileInfo['playtime_seconds'];
 
-		$thisfile_mpc_header['title_peak']             = $thisfile_mpc_header['raw']['title_peak'];
-		$thisfile_mpc_header['title_peak_db']          = $this->MPCpeakDBLookup($thisfile_mpc_header['title_peak']);
+		$thisfile_mpc_header['title_peak']        = $thisfile_mpc_header['raw']['title_peak'];
+		$thisfile_mpc_header['title_peak_db']     = $this->MPCpeakDBLookup($thisfile_mpc_header['title_peak']);
 		if ($thisfile_mpc_header['raw']['title_gain'] < 0) {
-			$thisfile_mpc_header['title_gain_db']      = (float) (32768 + $thisfile_mpc_header['raw']['title_gain']) / -100;
+			$thisfile_mpc_header['title_gain_db'] = (float) (32768 + $thisfile_mpc_header['raw']['title_gain']) / -100;
 		} else {
-			$thisfile_mpc_header['title_gain_db']      = (float) $thisfile_mpc_header['raw']['title_gain'] / 100;
+			$thisfile_mpc_header['title_gain_db'] = (float) $thisfile_mpc_header['raw']['title_gain'] / 100;
 		}
 
-		$thisfile_mpc_header['album_peak']             = $thisfile_mpc_header['raw']['album_peak'];
-		$thisfile_mpc_header['album_peak_db']          = $this->MPCpeakDBLookup($thisfile_mpc_header['album_peak']);
+		$thisfile_mpc_header['album_peak']        = $thisfile_mpc_header['raw']['album_peak'];
+		$thisfile_mpc_header['album_peak_db']     = $this->MPCpeakDBLookup($thisfile_mpc_header['album_peak']);
 		if ($thisfile_mpc_header['raw']['album_gain'] < 0) {
-			$thisfile_mpc_header['album_gain_db']      = (float) (32768 + $thisfile_mpc_header['raw']['album_gain']) / -100;
+			$thisfile_mpc_header['album_gain_db'] = (float) (32768 + $thisfile_mpc_header['raw']['album_gain']) / -100;
 		} else {
-			$thisfile_mpc_header['album_gain_db']      = (float) $thisfile_mpc_header['raw']['album_gain'] / 100;;
+			$thisfile_mpc_header['album_gain_db'] = (float) $thisfile_mpc_header['raw']['album_gain'] / 100;;
 		}
-		$thisfile_mpc_header['encoder_version']        = $this->MPCencoderVersionLookup($thisfile_mpc_header['raw']['encoder_version']);
+		$thisfile_mpc_header['encoder_version']   = $this->MPCencoderVersionLookup($thisfile_mpc_header['raw']['encoder_version']);
 
-		$ThisFileInfo['replay_gain']['track']['adjustment']      = $thisfile_mpc_header['title_gain_db'];
+		$ThisFileInfo['replay_gain']['track']['adjustment'] = $thisfile_mpc_header['title_gain_db'];
 		$ThisFileInfo['replay_gain']['album']['adjustment'] = $thisfile_mpc_header['album_gain_db'];
 
 		if ($thisfile_mpc_header['title_peak'] > 0) {
-			$ThisFileInfo['replay_gain']['track']['peak']            = $thisfile_mpc_header['title_peak'];
+			$ThisFileInfo['replay_gain']['track']['peak'] = $thisfile_mpc_header['title_peak'];
 		} elseif (round($thisfile_mpc_header['max_level'] * 1.18) > 0) {
-			$ThisFileInfo['replay_gain']['track']['peak']            = getid3_lib::CastAsInt(round($thisfile_mpc_header['max_level'] * 1.18)); // why? I don't know - see mppdec.c
+			$ThisFileInfo['replay_gain']['track']['peak'] = getid3_lib::CastAsInt(round($thisfile_mpc_header['max_level'] * 1.18)); // why? I don't know - see mppdec.c
 		}
 		if ($thisfile_mpc_header['album_peak'] > 0) {
-			$ThisFileInfo['replay_gain']['album']['peak']       = $thisfile_mpc_header['album_peak'];
+			$ThisFileInfo['replay_gain']['album']['peak'] = $thisfile_mpc_header['album_peak'];
 		}
 
 		//$ThisFileInfo['audio']['encoder'] = 'SV'.$thisfile_mpc_header['stream_major_version'].'.'.$thisfile_mpc_header['stream_minor_version'].', '.$thisfile_mpc_header['encoder_version'];

Modified: plog/trunk/class/gallery/getid3/module.audio.ogg.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio.ogg.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio.ogg.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -15,9 +15,6 @@
 
 getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.flac.php', __FILE__, true);
 
-/**
- * \ingroup getid3
- */
 class getid3_ogg
 {
 
@@ -242,7 +239,7 @@
 					if ($ThisFileInfo['audio']['bitrate_mode'] == 'abr') {
 
 						// Set -b 128 on abr files
-						$ThisFileInfo['audio']['encoder_options'] = '-b '.ceil($ThisFileInfo['ogg']['bitrate_nominal'] / 1000);
+						$ThisFileInfo['audio']['encoder_options'] = '-b '.round($ThisFileInfo['ogg']['bitrate_nominal'] / 1000);
 
 					} elseif (($ThisFileInfo['audio']['bitrate_mode'] == 'vbr') && ($ThisFileInfo['audio']['channels'] == 2) && ($ThisFileInfo['audio']['sample_rate'] >= 44100) && ($ThisFileInfo['audio']['sample_rate'] <= 48000)) {
 						// Set -q N on vbr files
@@ -252,7 +249,7 @@
 				}
 
 				if (empty($ThisFileInfo['audio']['encoder_options']) && !empty($ThisFileInfo['ogg']['bitrate_nominal'])) {
-					$ThisFileInfo['audio']['encoder_options'] = 'Nominal bitrate: '.ceil(round($ThisFileInfo['ogg']['bitrate_nominal'] / 1000)) .'kbps';
+					$ThisFileInfo['audio']['encoder_options'] = 'Nominal bitrate: '.intval(round($ThisFileInfo['ogg']['bitrate_nominal'] / 1000)).'kbps';
 				}
 			}
 		}
@@ -521,25 +518,24 @@
 	function get_quality_from_nominal_bitrate($nominal_bitrate) {
 
 		// decrease precision
-		$nominal_bitrate = ceil(round($nominal_bitrate / 1000));
+		$nominal_bitrate = $nominal_bitrate / 1000;
 
-		// q-1 to q4
 		if ($nominal_bitrate < 128) {
-			return ($nominal_bitrate - 64) / 16;
+			// q-1 to q4
+			$qval = ($nominal_bitrate - 64) / 16;
+		} elseif ($nominal_bitrate < 256) {
+			// q4 to q8
+			$qval = $nominal_bitrate / 32;
+		} elseif ($nominal_bitrate < 320) {
+			// q8 to q9
+			$qval = ($nominal_bitrate + 256) / 64;
+		} else {
+			// q9 to q10
+			$qval = ($nominal_bitrate + 1300) / 180;
 		}
-
-		// q4 to q8
-		if ($nominal_bitrate < 256) {
-			return $nominal_bitrate / 32;
-		}
-
-		// q8 to q9
-		if ($nominal_bitrate < 320) {
-			return ($nominal_bitrate + 256) / 64;
-		}
-
-		// q9 to q10
-		return ($nominal_bitrate + 1300) / 180;
+		//return $qval; // 5.031324
+		//return intval($qval); // 5
+		return round($qval, 1); // 5 or 4.9
 	}
 
 }

Modified: plog/trunk/class/gallery/getid3/module.audio.optimfrog.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio.optimfrog.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio.optimfrog.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -15,9 +15,6 @@
 
 getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true);
 
-/**
- * \ingroup getid3
- */
 class getid3_optimfrog
 {
 
@@ -52,7 +49,9 @@
 		$OptimFROGheaderData = fread($fd, 45);
 		$ThisFileInfo['avdataoffset'] = 45;
 
-		$OptimFROGencoderVersion = getid3_lib::LittleEndian2Int(substr($OptimFROGheaderData, 0, 1)) / 10;
+		$OptimFROGencoderVersion_raw   = getid3_lib::LittleEndian2Int(substr($OptimFROGheaderData, 0, 1));
+		$OptimFROGencoderVersion_major = floor($OptimFROGencoderVersion_raw / 10);
+		$OptimFROGencoderVersion_minor = $OptimFROGencoderVersion_raw - ($OptimFROGencoderVersion_major * 10);
 		$RIFFdata                = substr($OptimFROGheaderData, 1, 44);
 		$OrignalRIFFheaderSize   = getid3_lib::LittleEndian2Int(substr($RIFFdata,  4, 4)) +  8;
 		$OrignalRIFFdataSize     = getid3_lib::LittleEndian2Int(substr($RIFFdata, 40, 4)) + 44;
@@ -69,7 +68,7 @@
 		$RIFFdata = substr($RIFFdata, 0, 36).substr($RIFFdata, 44).substr($RIFFdata, 36, 8);
 		getid3_riff::ParseRIFFdata($RIFFdata, $ThisFileInfo);
 
-		$ThisFileInfo['audio']['encoder']         = 'OptimFROG '.round($OptimFROGencoderVersion, 1);
+		$ThisFileInfo['audio']['encoder']         = 'OptimFROG '.$OptimFROGencoderVersion_major.'.'.$OptimFROGencoderVersion_minor;
 		$ThisFileInfo['audio']['channels']        = $ThisFileInfo['riff']['audio'][0]['channels'];
 		$ThisFileInfo['audio']['sample_rate']     = $ThisFileInfo['riff']['audio'][0]['sample_rate'];
 		$ThisFileInfo['audio']['bits_per_sample'] = $ThisFileInfo['riff']['audio'][0]['bits_per_sample'];
@@ -219,7 +218,9 @@
 					$thisfile_ofr_thisblock['offset'] = $BlockOffset;
 					$thisfile_ofr_thisblock['size']   = $BlockSize;
 
-					$RIFFdata .= fread($fd, $BlockSize);
+					if ($BlockSize > 0) {
+						$RIFFdata .= fread($fd, $BlockSize);
+					}
 					break;
 
 				case 'RECV':

Modified: plog/trunk/class/gallery/getid3/module.audio.rkau.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio.rkau.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio.rkau.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_rkau
 {
 

Modified: plog/trunk/class/gallery/getid3/module.audio.shorten.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio.shorten.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio.shorten.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_shorten
 {
 

Modified: plog/trunk/class/gallery/getid3/module.audio.tta.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio.tta.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio.tta.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_tta
 {
 
@@ -27,7 +25,7 @@
 		$ThisFileInfo['audio']['bitrate_mode'] = 'vbr';
 
 		fseek($fd, $ThisFileInfo['avdataoffset'], SEEK_SET);
-		$ttaheader = fread($fd, 20);
+		$ttaheader = fread($fd, 26);
 
 		$ThisFileInfo['tta']['magic'] = substr($ttaheader,  0,  3);
 		if ($ThisFileInfo['tta']['magic'] != 'TTA') {
@@ -39,11 +37,12 @@
 		}
 
 		switch ($ttaheader{3}) {
-			case "\x01":
-			case "\x02":
-			case "\x03":
+			case "\x01": // TTA v1.x
+			case "\x02": // TTA v1.x
+			case "\x03": // TTA v1.x
+				// "It was the demo-version of the TTA encoder. There is no released format with such header. TTA encoder v1 is not supported about a year."
 				$ThisFileInfo['tta']['major_version'] = 1;
-				$ThisFileInfo['avdataoffset']         = 16;
+				$ThisFileInfo['avdataoffset'] += 16;
 
 				$ThisFileInfo['tta']['compression_level']   = ord($ttaheader{3});
 				$ThisFileInfo['tta']['channels']            = getid3_lib::LittleEndian2Int(substr($ttaheader,  4,  2));
@@ -51,12 +50,14 @@
 				$ThisFileInfo['tta']['sample_rate']         = getid3_lib::LittleEndian2Int(substr($ttaheader,  8,  4));
 				$ThisFileInfo['tta']['samples_per_channel'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 12,  4));
 
+				$ThisFileInfo['audio']['encoder_options']   = '-e'.$ThisFileInfo['tta']['compression_level'];
 				$ThisFileInfo['playtime_seconds']           = $ThisFileInfo['tta']['samples_per_channel'] / $ThisFileInfo['tta']['sample_rate'];
 				break;
 
-			case '2':
+			case '2': // TTA v2.x
+				// "I have hurried to release the TTA 2.0 encoder. Format documentation is removed from our site. This format still in development. Please wait the TTA2 format, encoder v4."
 				$ThisFileInfo['tta']['major_version'] = 2;
-				$ThisFileInfo['avdataoffset']         = 20;
+				$ThisFileInfo['avdataoffset'] += 20;
 
 				$ThisFileInfo['tta']['compression_level']   = getid3_lib::LittleEndian2Int(substr($ttaheader,  4,  2));
 				$ThisFileInfo['tta']['audio_format']        = getid3_lib::LittleEndian2Int(substr($ttaheader,  6,  2));
@@ -65,15 +66,32 @@
 				$ThisFileInfo['tta']['sample_rate']         = getid3_lib::LittleEndian2Int(substr($ttaheader, 12,  4));
 				$ThisFileInfo['tta']['data_length']         = getid3_lib::LittleEndian2Int(substr($ttaheader, 16,  4));
 
+				$ThisFileInfo['audio']['encoder_options']   = '-e'.$ThisFileInfo['tta']['compression_level'];
 				$ThisFileInfo['playtime_seconds']           = $ThisFileInfo['tta']['data_length'] / $ThisFileInfo['tta']['sample_rate'];
 				break;
 
+			case '1': // TTA v3.x
+				// "This is a first stable release of the TTA format. It will be supported by the encoders v3 or higher."
+				$ThisFileInfo['tta']['major_version'] = 3;
+				$ThisFileInfo['avdataoffset'] += 26;
+
+				$ThisFileInfo['tta']['audio_format']        = getid3_lib::LittleEndian2Int(substr($ttaheader,  4,  2)); // getid3_riff::RIFFwFormatTagLookup()
+				$ThisFileInfo['tta']['channels']            = getid3_lib::LittleEndian2Int(substr($ttaheader,  6,  2));
+				$ThisFileInfo['tta']['bits_per_sample']     = getid3_lib::LittleEndian2Int(substr($ttaheader,  8,  2));
+				$ThisFileInfo['tta']['sample_rate']         = getid3_lib::LittleEndian2Int(substr($ttaheader, 10,  4));
+				$ThisFileInfo['tta']['data_length']         = getid3_lib::LittleEndian2Int(substr($ttaheader, 14,  4));
+				$ThisFileInfo['tta']['crc32_footer']        =                              substr($ttaheader, 18,  4);
+				$ThisFileInfo['tta']['seek_point']          = getid3_lib::LittleEndian2Int(substr($ttaheader, 22,  4));
+
+				$ThisFileInfo['playtime_seconds']           = $ThisFileInfo['tta']['data_length'] / $ThisFileInfo['tta']['sample_rate'];
+				break;
+
 			default:
 				$ThisFileInfo['error'][] = 'This version of getID3() only knows how to handle TTA v1 and v2 - it may not work correctly with this file which appears to be TTA v'.$ttaheader{3};
+				return false;
 				break;
 		}
 
-		$ThisFileInfo['audio']['encoder_options'] = '-e'.$ThisFileInfo['tta']['compression_level'];
 		$ThisFileInfo['audio']['encoder']         = 'TTA v'.$ThisFileInfo['tta']['major_version'];
 		$ThisFileInfo['audio']['bits_per_sample'] = $ThisFileInfo['tta']['bits_per_sample'];
 		$ThisFileInfo['audio']['sample_rate']     = $ThisFileInfo['tta']['sample_rate'];

Modified: plog/trunk/class/gallery/getid3/module.audio.voc.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio.voc.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio.voc.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_voc
 {
 

Modified: plog/trunk/class/gallery/getid3/module.audio.vqf.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.audio.vqf.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.audio.vqf.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_vqf
 {
 	function getid3_vqf(&$fd, &$ThisFileInfo) {
@@ -66,13 +64,15 @@
 				$ThisFileInfo['error'][] = 'Invalid chunk size ('.$ChunkSize.') for chunk "'.$ChunkName.'" at offset '.$ChunkBaseOffset;
 				break;
 			}
-			$ChunkData .= fread($fd, $ChunkSize);
+			if ($ChunkSize > 0) {
+				$ChunkData .= fread($fd, $ChunkSize);
+			}
 
 			switch ($ChunkName) {
 				case 'COMM':
 					// shortcut
 					$thisfile_vqf['COMM'] = array();
-					$thisfile_vqf_COMM    = $thisfile_vqf['COMM'];
+					$thisfile_vqf_COMM    = &$thisfile_vqf['COMM'];
 
 					$thisfile_vqf_COMM['channel_mode']   = getid3_lib::BigEndian2Int(substr($ChunkData, $chunkoffset, 4));
 					$chunkoffset += 4;
@@ -150,7 +150,7 @@
 			'COMT' => 'comment',
 			'ALBM' => 'album'
 		);
-		return (isset($VQFcommentNiceNameLookup["$shortname"]) ? $VQFcommentNiceNameLookup["$shortname"] : $shortname);
+		return (isset($VQFcommentNiceNameLookup[$shortname]) ? $VQFcommentNiceNameLookup[$shortname] : $shortname);
 	}
 
 }

Copied: plog/trunk/class/gallery/getid3/module.audio.wavpack.php (from rev 2357, plog/branches/plog-1.0.2/class/gallery/getid3/module.audio.wavpack.php)

Modified: plog/trunk/class/gallery/getid3/module.graphic.bmp.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.graphic.bmp.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.graphic.bmp.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_bmp
 {
 
@@ -27,16 +25,40 @@
 	    $thisfile_bmp_header                  = &$thisfile_bmp['header'];
 	    $thisfile_bmp_header_raw              = &$thisfile_bmp_header['raw'];
 
-		$ThisFileInfo['fileformat']                  = 'bmp';
-		$ThisFileInfo['video']['dataformat']         = 'bmp';
-		$ThisFileInfo['video']['lossless']           = true;
-		$ThisFileInfo['video']['pixel_aspect_ratio'] = (float) 1;
+		// BITMAPFILEHEADER [14 bytes] - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_62uq.asp
+		// all versions
+		// WORD    bfType;
+		// DWORD   bfSize;
+		// WORD    bfReserved1;
+		// WORD    bfReserved2;
+		// DWORD   bfOffBits;
 
 		fseek($fd, $ThisFileInfo['avdataoffset'], SEEK_SET);
 		$offset = 0;
-
 		$BMPheader = fread($fd, 14 + 40);
 
+		$thisfile_bmp_header_raw['identifier']  = substr($BMPheader, $offset, 2);
+		$offset += 2;
+
+		if ($thisfile_bmp_header_raw['identifier'] != 'BM') {
+			$ThisFileInfo['error'][] = 'Expecting "BM" at offset '.$ThisFileInfo['avdataoffset'].', found "'.$thisfile_bmp_header_raw['identifier'].'"';
+			unset($ThisFileInfo['fileformat']);
+			unset($ThisFileInfo['bmp']);
+			return false;
+		}
+
+		$thisfile_bmp_header_raw['filesize']    = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4));
+		$offset += 4;
+		$thisfile_bmp_header_raw['reserved1']   = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2));
+		$offset += 2;
+		$thisfile_bmp_header_raw['reserved2']   = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2));
+		$offset += 2;
+		$thisfile_bmp_header_raw['data_offset'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4));
+		$offset += 4;
+		$thisfile_bmp_header_raw['header_size'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4));
+		$offset += 4;
+
+
 		// check if the hardcoded-to-1 "planes" is at offset 22 or 26
 		$planes22 = getid3_lib::LittleEndian2Int(substr($BMPheader, 22, 2));
 		$planes26 = getid3_lib::LittleEndian2Int(substr($BMPheader, 26, 2));
@@ -58,34 +80,17 @@
 		} elseif ($thisfile_bmp_header_raw['header_size'] == 100) {
 			$thisfile_bmp['type_os']      = 'Windows';
 			$thisfile_bmp['type_version'] = 5;
-		}
-
-
-		// BITMAPFILEHEADER [14 bytes] - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_62uq.asp
-		// all versions
-		// WORD    bfType;
-		// DWORD   bfSize;
-		// WORD    bfReserved1;
-		// WORD    bfReserved2;
-		// DWORD   bfOffBits;
-		$thisfile_bmp_header_raw['identifier']       =                  substr($BMPheader, $offset, 2);
-		$offset += 2;
-
-		if ($thisfile_bmp_header_raw['identifier'] != 'BM') {
-			$ThisFileInfo['error'][] = 'Expecting "BM" at offset '.$ThisFileInfo['avdataoffset'].', found "'.$thisfile_bmp_header_raw['identifier'].'"';
+		} else {
+			$ThisFileInfo['error'][] = 'Unknown BMP subtype (or not a BMP file)';
 			unset($ThisFileInfo['fileformat']);
-			unset($thisfile_bmp);
+			unset($ThisFileInfo['bmp']);
 			return false;
 		}
 
-		$thisfile_bmp_header_raw['filesize']    = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4));
-		$offset += 4;
-		$thisfile_bmp_header_raw['reserved1']   = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2));
-		$offset += 2;
-		$thisfile_bmp_header_raw['reserved2']   = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2));
-		$offset += 2;
-		$thisfile_bmp_header_raw['data_offset'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4));
-		$offset += 4;
+		$ThisFileInfo['fileformat']                  = 'bmp';
+		$ThisFileInfo['video']['dataformat']         = 'bmp';
+		$ThisFileInfo['video']['lossless']           = true;
+		$ThisFileInfo['video']['pixel_aspect_ratio'] = (float) 1;
 
 		if ($thisfile_bmp['type_os'] == 'OS/2') {
 
@@ -98,8 +103,6 @@
 			// WORD   NumPlanes;        /* Number of bit planes (color depth) */
 			// WORD   BitsPerPixel;     /* Number of bits per pixel per plane */
 
-			$thisfile_bmp_header_raw['header_size']    = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4));
-			$offset += 4;
 			$thisfile_bmp_header_raw['width']          = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2));
 			$offset += 2;
 			$thisfile_bmp_header_raw['height']         = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2));
@@ -182,8 +185,6 @@
 			// DWORD  biClrUsed;
 			// DWORD  biClrImportant;
 
-			$thisfile_bmp_header_raw['header_size']      = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4));
-			$offset += 4;
 			$thisfile_bmp_header_raw['width']            = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4), true);
 			$offset += 4;
 			$thisfile_bmp_header_raw['height']           = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4), true);
@@ -211,7 +212,8 @@
 			$ThisFileInfo['video']['codec']           = $thisfile_bmp_header['compression'].' '.$thisfile_bmp_header_raw['bits_per_pixel'].'-bit';
 			$ThisFileInfo['video']['bits_per_sample'] = $thisfile_bmp_header_raw['bits_per_pixel'];
 
-			if ($thisfile_bmp['type_version'] >= 4) {
+			if (($thisfile_bmp['type_version'] >= 4) || ($thisfile_bmp_header_raw['compression'] == 3)) {
+				// should only be v4+, but BMPs with type_version==1 and BI_BITFIELDS compression have been seen
 				$BMPheader .= fread($fd, 44);
 
 				// BITMAPV4HEADER - [44 bytes] - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_2k1e.asp
@@ -296,9 +298,6 @@
 					// BYTE    rgbGreen;
 					// BYTE    rgbRed;
 					// BYTE    rgbReserved;
-					//$thisfile_bmp['palette']['blue'][$i]   = getid3_lib::LittleEndian2Int(substr($BMPpalette, $paletteoffset++, 1));
-					//$thisfile_bmp['palette']['green'][$i] = getid3_lib::LittleEndian2Int(substr($BMPpalette, $paletteoffset++, 1));
-					//$thisfile_bmp['palette']['red'][$i]  = getid3_lib::LittleEndian2Int(substr($BMPpalette, $paletteoffset++, 1));
 					$blue  = getid3_lib::LittleEndian2Int(substr($BMPpalette, $paletteoffset++, 1));
 					$green = getid3_lib::LittleEndian2Int(substr($BMPpalette, $paletteoffset++, 1));
 					$red   = getid3_lib::LittleEndian2Int(substr($BMPpalette, $paletteoffset++, 1));
@@ -307,7 +306,7 @@
 					} else {
 						$paletteoffset++; // padding byte
 					}
-					$thisfile_bmp['palette'][$i] = (($red << 16) | ($green << 8) | ($blue));
+					$thisfile_bmp['palette'][$i] = (($red << 16) | ($green << 8) | $blue);
 				}
 			}
 		}
@@ -317,14 +316,14 @@
 			$RowByteLength = ceil(($thisfile_bmp_header_raw['width'] * ($thisfile_bmp_header_raw['bits_per_pixel'] / 8)) / 4) * 4; // round up to nearest DWORD boundry
 			$BMPpixelData = fread($fd, $thisfile_bmp_header_raw['height'] * $RowByteLength);
 			$pixeldataoffset = 0;
-			switch ($thisfile_bmp_header_raw['compression']) {
+			switch (@$thisfile_bmp_header_raw['compression']) {
 
 				case 0: // BI_RGB
 					switch ($thisfile_bmp_header_raw['bits_per_pixel']) {
 						case 1:
 							for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) {
 								for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col = $col) {
-									$paletteindexbyte = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1));
+									$paletteindexbyte = ord($BMPpixelData{$pixeldataoffset++});
 									for ($i = 7; $i >= 0; $i--) {
 										$paletteindex = ($paletteindexbyte & (0x01 << $i)) >> $i;
 										$thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindex];
@@ -341,7 +340,7 @@
 						case 4:
 							for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) {
 								for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col = $col) {
-									$paletteindexbyte = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1));
+									$paletteindexbyte = ord($BMPpixelData{$pixeldataoffset++});
 									for ($i = 1; $i >= 0; $i--) {
 										$paletteindex = ($paletteindexbyte & (0x0F << (4 * $i))) >> (4 * $i);
 										$thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindex];
@@ -358,7 +357,7 @@
 						case 8:
 							for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) {
 								for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col++) {
-									$paletteindex = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1));
+									$paletteindex = ord($BMPpixelData{$pixeldataoffset++});
 									$thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindex];
 								}
 								while (($pixeldataoffset % 4) != 0) {
@@ -369,16 +368,23 @@
 							break;
 
 						case 24:
+							for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) {
+								for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col++) {
+									$thisfile_bmp['data'][$row][$col] = (ord($BMPpixelData{$pixeldataoffset+2}) << 16) | (ord($BMPpixelData{$pixeldataoffset+1}) << 8) | ord($BMPpixelData{$pixeldataoffset});
+									$pixeldataoffset += 3;
+								}
+								while (($pixeldataoffset % 4) != 0) {
+									// lines are padded to nearest DWORD
+									$pixeldataoffset++;
+								}
+							}
+							break;
+
 						case 32:
 							for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) {
 								for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col++) {
-									$blue  = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1));
-									$green = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1));
-									$red   = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1));
-									if ($thisfile_bmp_header_raw['bits_per_pixel'] == 32) {
-										$paletteoffset++; // filler byte
-									}
-									$thisfile_bmp['data'][$row][$col] = (($red << 16) | ($green << 8) | ($blue));
+									$thisfile_bmp['data'][$row][$col] = (ord($BMPpixelData{$pixeldataoffset+3}) << 24) | (ord($BMPpixelData{$pixeldataoffset+2}) << 16) | (ord($BMPpixelData{$pixeldataoffset+1}) << 8) | ord($BMPpixelData{$pixeldataoffset});
+									$pixeldataoffset += 4;
 								}
 								while (($pixeldataoffset % 4) != 0) {
 									// lines are padded to nearest DWORD
@@ -388,6 +394,8 @@
 							break;
 
 						case 16:
+							// ?
+							break;
 
 						default:
 							$ThisFileInfo['error'][] = 'Unknown bits-per-pixel value ('.$thisfile_bmp_header_raw['bits_per_pixel'].') - cannot read pixel data';
@@ -581,9 +589,9 @@
 									$pixelvalue = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset, $thisfile_bmp_header_raw['bits_per_pixel'] / 8));
 									$pixeldataoffset += $thisfile_bmp_header_raw['bits_per_pixel'] / 8;
 
-									$red   = round(((($pixelvalue & $thisfile_bmp_header_raw['red_mask'])   >> $redshift)   / ($thisfile_bmp_header_raw['red_mask']   >> $redshift))   * 255);
-									$green = round(((($pixelvalue & $thisfile_bmp_header_raw['green_mask']) >> $greenshift) / ($thisfile_bmp_header_raw['green_mask'] >> $greenshift)) * 255);
-									$blue  = round(((($pixelvalue & $thisfile_bmp_header_raw['blue_mask'])  >> $blueshift)  / ($thisfile_bmp_header_raw['blue_mask']  >> $blueshift))  * 255);
+									$red   = intval(round(((($pixelvalue & $thisfile_bmp_header_raw['red_mask'])   >> $redshift)   / ($thisfile_bmp_header_raw['red_mask']   >> $redshift))   * 255));
+									$green = intval(round(((($pixelvalue & $thisfile_bmp_header_raw['green_mask']) >> $greenshift) / ($thisfile_bmp_header_raw['green_mask'] >> $greenshift)) * 255));
+									$blue  = intval(round(((($pixelvalue & $thisfile_bmp_header_raw['blue_mask'])  >> $blueshift)  / ($thisfile_bmp_header_raw['blue_mask']  >> $blueshift))  * 255));
 									$thisfile_bmp['data'][$row][$col] = (($red << 16) | ($green << 8) | ($blue));
 								}
 								while (($pixeldataoffset % 4) != 0) {
@@ -616,7 +624,7 @@
 			echo 'ERROR: no pixel data<BR>';
 			return false;
 		}
-		set_time_limit(round($BMPinfo['resolution_x'] * $BMPinfo['resolution_y'] / 10000));
+		set_time_limit(intval(round($BMPinfo['resolution_x'] * $BMPinfo['resolution_y'] / 10000)));
 		if ($im = ImageCreateTrueColor($BMPinfo['resolution_x'], $BMPinfo['resolution_y'])) {
 			for ($row = 0; $row < $BMPinfo['resolution_y']; $row++) {
 				for ($col = 0; $col < $BMPinfo['resolution_x']; $col++) {

Modified: plog/trunk/class/gallery/getid3/module.graphic.gif.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.graphic.gif.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.graphic.gif.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_gif
 {
 

Modified: plog/trunk/class/gallery/getid3/module.graphic.jpg.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.graphic.jpg.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.graphic.jpg.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_jpg
 {
 
@@ -50,13 +48,13 @@
 
 				} else {
 
-					$ThisFileInfo['warning'][] = 'EXIF parsing only available when compiled with --enable-exif (or php_exif.dll enabled for Windows)';
+					$ThisFileInfo['warning'][] = 'EXIF parsing only available when '.(GETID3_OS_ISWINDOWS ? 'php_exif.dll enabled' : 'compiled with --enable-exif');
 
 				}
 
 			} else {
 
-				$ThisFileInfo['warning'][] = 'EXIF parsing only available in PHP v4.2.0 and higher (you are using PHP v'.phpversion().') compiled with --enable-exif (or php_exif.dll enabled for Windows)';
+				$ThisFileInfo['warning'][] = 'EXIF parsing only available in PHP v4.2.0 and higher compiled with --enable-exif (or php_exif.dll enabled for Windows). You are using PHP v'.phpversion();
 
 			}
 

Modified: plog/trunk/class/gallery/getid3/module.graphic.pcd.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.graphic.pcd.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.graphic.pcd.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_pcd
 {
 	function getid3_pcd(&$fd, &$ThisFileInfo, $ExtractData=0) {
@@ -65,8 +63,8 @@
 
 				$PCD_data_Y1 = fread($fd, $PCD_width);
 				$PCD_data_Y2 = fread($fd, $PCD_width);
-				$PCD_data_Cb = fread($fd, round($PCD_width / 2));
-				$PCD_data_Cr = fread($fd, round($PCD_width / 2));
+				$PCD_data_Cb = fread($fd, intval(round($PCD_width / 2)));
+				$PCD_data_Cr = fread($fd, intval(round($PCD_width / 2)));
 
 				for ($x = 0; $x < $PCD_width; $x++) {
 					if ($PCDisVertical) {
@@ -114,10 +112,12 @@
 		foreach ($RGBcolor as $rgbname => $dummy) {
 			$RGBcolor[$rgbname] = max(0,
 										min(255,
-											round(
-												($YCbCr_constants[$rgbname]['Y'] * $Y) +
-												($YCbCr_constants[$rgbname]['Cb'] * ($Cb - 156)) +
-												($YCbCr_constants[$rgbname]['Cr'] * ($Cr - 137))
+											intval(
+												round(
+													($YCbCr_constants[$rgbname]['Y'] * $Y) +
+													($YCbCr_constants[$rgbname]['Cb'] * ($Cb - 156)) +
+													($YCbCr_constants[$rgbname]['Cr'] * ($Cr - 137))
+												)
 											)
 										)
 									);

Modified: plog/trunk/class/gallery/getid3/module.graphic.png.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.graphic.png.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.graphic.png.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_png
 {
 
@@ -113,8 +111,8 @@
 
 						case 2:
 							$thisfile_png_chunk_type_text['transparent_color_red']   = getid3_lib::BigEndian2Int(substr($thisfile_png_chunk_type_text['header']['data'], 0, 2));
-							$thisfile_png_chunk_type_text['transparent_color_green'] = getid3_lib::BigEndian2Int(substr($thisfile_png_chunk_type_text['header']['data'], 0, 2));
-							$thisfile_png_chunk_type_text['transparent_color_blue']  = getid3_lib::BigEndian2Int(substr($thisfile_png_chunk_type_text['header']['data'], 0, 2));
+							$thisfile_png_chunk_type_text['transparent_color_green'] = getid3_lib::BigEndian2Int(substr($thisfile_png_chunk_type_text['header']['data'], 2, 2));
+							$thisfile_png_chunk_type_text['transparent_color_blue']  = getid3_lib::BigEndian2Int(substr($thisfile_png_chunk_type_text['header']['data'], 4, 2));
 							break;
 
 						case 3:

Copied: plog/trunk/class/gallery/getid3/module.graphic.tiff.php (from rev 2357, plog/branches/plog-1.0.2/class/gallery/getid3/module.graphic.tiff.php)

Modified: plog/trunk/class/gallery/getid3/module.misc.exe.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.misc.exe.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.misc.exe.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,19 +13,44 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_exe
 {
 
 	function getid3_exe(&$fd, &$ThisFileInfo) {
 
+		fseek($fd, $ThisFileInfo['avdataoffset'], SEEK_SET);
+		$EXEheader = fread($fd, 28);
+
+		if (substr($EXEheader, 0, 2) != 'MZ') {
+			$ThisFileInfo['error'][] = 'Expecting "MZ" at offset '.$ThisFileInfo['avdataoffset'].', found "'.substr($EXEheader, 0, 2).'" instead.';
+			return false;
+		}
+
 		$ThisFileInfo['fileformat'] = 'exe';
+		$ThisFileInfo['exe']['mz']['magic'] = 'MZ';
 
-		$ThisFileInfo['error'][] = 'EXE parsing not enabled in this version of getID3()';
-		return false;
+		$ThisFileInfo['exe']['mz']['raw']['last_page_size']          = getid3_lib::LittleEndian2Int(substr($EXEheader,  2, 2));
+		$ThisFileInfo['exe']['mz']['raw']['page_count']              = getid3_lib::LittleEndian2Int(substr($EXEheader,  4, 2));
+		$ThisFileInfo['exe']['mz']['raw']['relocation_count']        = getid3_lib::LittleEndian2Int(substr($EXEheader,  6, 2));
+		$ThisFileInfo['exe']['mz']['raw']['header_paragraphs']       = getid3_lib::LittleEndian2Int(substr($EXEheader,  8, 2));
+		$ThisFileInfo['exe']['mz']['raw']['min_memory_paragraphs']   = getid3_lib::LittleEndian2Int(substr($EXEheader, 10, 2));
+		$ThisFileInfo['exe']['mz']['raw']['max_memory_paragraphs']   = getid3_lib::LittleEndian2Int(substr($EXEheader, 12, 2));
+		$ThisFileInfo['exe']['mz']['raw']['initial_ss']              = getid3_lib::LittleEndian2Int(substr($EXEheader, 14, 2));
+		$ThisFileInfo['exe']['mz']['raw']['initial_sp']              = getid3_lib::LittleEndian2Int(substr($EXEheader, 16, 2));
+		$ThisFileInfo['exe']['mz']['raw']['checksum']                = getid3_lib::LittleEndian2Int(substr($EXEheader, 18, 2));
+		$ThisFileInfo['exe']['mz']['raw']['cs_ip']                   = getid3_lib::LittleEndian2Int(substr($EXEheader, 20, 4));
+		$ThisFileInfo['exe']['mz']['raw']['relocation_table_offset'] = getid3_lib::LittleEndian2Int(substr($EXEheader, 24, 2));
+		$ThisFileInfo['exe']['mz']['raw']['overlay_number']          = getid3_lib::LittleEndian2Int(substr($EXEheader, 26, 2));
 
+		$ThisFileInfo['exe']['mz']['byte_size']          = (($ThisFileInfo['exe']['mz']['raw']['page_count'] - 1)) * 512 + $ThisFileInfo['exe']['mz']['raw']['last_page_size'];
+		$ThisFileInfo['exe']['mz']['header_size']        = $ThisFileInfo['exe']['mz']['raw']['header_paragraphs'] * 16;
+		$ThisFileInfo['exe']['mz']['memory_minimum']     = $ThisFileInfo['exe']['mz']['raw']['min_memory_paragraphs'] * 16;
+		$ThisFileInfo['exe']['mz']['memory_recommended'] = $ThisFileInfo['exe']['mz']['raw']['max_memory_paragraphs'] * 16;
+
+$ThisFileInfo['error'][] = 'EXE parsing not enabled in this version of getID3()';
+return false;
+
 	}
 
 }

Modified: plog/trunk/class/gallery/getid3/module.misc.iso.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.misc.iso.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.misc.iso.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_iso
 {
 
@@ -78,12 +76,12 @@
 
 
 		$thisfile_iso_primaryVD_raw['volume_descriptor_version']     = getid3_lib::LittleEndian2Int(substr($ISOheader,    6, 1));
-		$thisfile_iso_primaryVD_raw['unused_1']                      =                              substr($ISOheader,    7, 1);
+		//$thisfile_iso_primaryVD_raw['unused_1']                      =                              substr($ISOheader,    7, 1);
 		$thisfile_iso_primaryVD_raw['system_identifier']             =                              substr($ISOheader,    8, 32);
 		$thisfile_iso_primaryVD_raw['volume_identifier']             =                              substr($ISOheader,   40, 32);
-		$thisfile_iso_primaryVD_raw['unused_2']                      =                              substr($ISOheader,   72, 8);
+		//$thisfile_iso_primaryVD_raw['unused_2']                      =                              substr($ISOheader,   72, 8);
 		$thisfile_iso_primaryVD_raw['volume_space_size']             = getid3_lib::LittleEndian2Int(substr($ISOheader,   80, 4));
-		$thisfile_iso_primaryVD_raw['unused_3']                      =                              substr($ISOheader,   88, 32);
+		//$thisfile_iso_primaryVD_raw['unused_3']                      =                              substr($ISOheader,   88, 32);
 		$thisfile_iso_primaryVD_raw['volume_set_size']               = getid3_lib::LittleEndian2Int(substr($ISOheader,  120, 2));
 		$thisfile_iso_primaryVD_raw['volume_sequence_number']        = getid3_lib::LittleEndian2Int(substr($ISOheader,  124, 2));
 		$thisfile_iso_primaryVD_raw['logical_block_size']            = getid3_lib::LittleEndian2Int(substr($ISOheader,  128, 2));
@@ -105,7 +103,7 @@
 		$thisfile_iso_primaryVD_raw['volume_expiration_date_time']   =                              substr($ISOheader,  847, 17);
 		$thisfile_iso_primaryVD_raw['volume_effective_date_time']    =                              substr($ISOheader,  864, 17);
 		$thisfile_iso_primaryVD_raw['file_structure_version']        = getid3_lib::LittleEndian2Int(substr($ISOheader,  881, 1));
-		$thisfile_iso_primaryVD_raw['unused_4']                      = getid3_lib::LittleEndian2Int(substr($ISOheader,  882, 1));
+		//$thisfile_iso_primaryVD_raw['unused_4']                      = getid3_lib::LittleEndian2Int(substr($ISOheader,  882, 1));
 		$thisfile_iso_primaryVD_raw['application_data']              =                              substr($ISOheader,  883, 512);
 		//$thisfile_iso_primaryVD_raw['unused_5']                      =                              substr($ISOheader, 1395, 653);
 
@@ -150,10 +148,10 @@
 		}
 
 		$thisfile_iso_supplementaryVD_raw['volume_descriptor_version'] = getid3_lib::LittleEndian2Int(substr($ISOheader,    6, 1));
-		$thisfile_iso_supplementaryVD_raw['unused_1']                  =                              substr($ISOheader,    7, 1);
+		//$thisfile_iso_supplementaryVD_raw['unused_1']                  =                              substr($ISOheader,    7, 1);
 		$thisfile_iso_supplementaryVD_raw['system_identifier']         =                              substr($ISOheader,    8, 32);
 		$thisfile_iso_supplementaryVD_raw['volume_identifier']         =                              substr($ISOheader,   40, 32);
-		$thisfile_iso_supplementaryVD_raw['unused_2']                  =                              substr($ISOheader,   72, 8);
+		//$thisfile_iso_supplementaryVD_raw['unused_2']                  =                              substr($ISOheader,   72, 8);
 		$thisfile_iso_supplementaryVD_raw['volume_space_size']         = getid3_lib::LittleEndian2Int(substr($ISOheader,   80, 4));
 		if ($thisfile_iso_supplementaryVD_raw['volume_space_size'] == 0) {
 			// Supplementary Volume Descriptor not used
@@ -161,7 +159,7 @@
 			//return false;
 		}
 
-		$thisfile_iso_supplementaryVD_raw['unused_3']                       =                              substr($ISOheader,   88, 32);
+		//$thisfile_iso_supplementaryVD_raw['unused_3']                       =                              substr($ISOheader,   88, 32);
 		$thisfile_iso_supplementaryVD_raw['volume_set_size']                = getid3_lib::LittleEndian2Int(substr($ISOheader,  120, 2));
 		$thisfile_iso_supplementaryVD_raw['volume_sequence_number']         = getid3_lib::LittleEndian2Int(substr($ISOheader,  124, 2));
 		$thisfile_iso_supplementaryVD_raw['logical_block_size']             = getid3_lib::LittleEndian2Int(substr($ISOheader,  128, 2));
@@ -183,7 +181,7 @@
 		$thisfile_iso_supplementaryVD_raw['volume_expiration_date_time']    =                              substr($ISOheader,  847, 17);
 		$thisfile_iso_supplementaryVD_raw['volume_effective_date_time']     =                              substr($ISOheader,  864, 17);
 		$thisfile_iso_supplementaryVD_raw['file_structure_version']         = getid3_lib::LittleEndian2Int(substr($ISOheader,  881, 1));
-		$thisfile_iso_supplementaryVD_raw['unused_4']                       = getid3_lib::LittleEndian2Int(substr($ISOheader,  882, 1));
+		//$thisfile_iso_supplementaryVD_raw['unused_4']                       = getid3_lib::LittleEndian2Int(substr($ISOheader,  882, 1));
 		$thisfile_iso_supplementaryVD_raw['application_data']               =                              substr($ISOheader,  883, 512);
 		//$thisfile_iso_supplementaryVD_raw['unused_5']                       =                              substr($ISOheader, 1395, 653);
 
@@ -274,7 +272,6 @@
 			$TextEncoding = 'ISO-8859-1'; // Latin-1
 		}
 
-
 		fseek($fd, $directorydata['location_bytes'], SEEK_SET);
 		$DirectoryRecordData = fread($fd, 1);
 

Modified: plog/trunk/class/gallery/getid3/module.tag.apetag.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.tag.apetag.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.tag.apetag.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,6 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
 class getid3_apetag
 {
 
@@ -105,7 +102,7 @@
 		// shortcut
 		$ThisFileInfo['replay_gain'] = array();
 		$thisfile_replaygain = &$ThisFileInfo['replay_gain'];
-
+		
 		for ($i = 0; $i < $thisfile_ape['footer']['raw']['tag_items']; $i++) {
 			$value_size = getid3_lib::LittleEndian2Int(substr($APEtagData, $offset, 4));
 			$offset += 4;

Modified: plog/trunk/class/gallery/getid3/module.tag.id3v1.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.tag.id3v1.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.tag.id3v1.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,9 +13,7 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_id3v1
 {
 

Modified: plog/trunk/class/gallery/getid3/module.tag.id3v2.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.tag.id3v2.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.tag.id3v2.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -15,9 +15,6 @@
 
 getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v1.php', __FILE__, true);
 
-/**
- * \ingroup getid3
- */
 class getid3_id3v2
 {
 
@@ -47,8 +44,8 @@
 		// shortcuts
 		$ThisFileInfo['id3v2']['header'] = true;
 		$thisfile_id3v2                  = &$ThisFileInfo['id3v2'];
-		$thisfile_id3v2['flags'] = array();
-		$thisfile_id3v2_flags    = &$thisfile_id3v2['flags'];
+		$thisfile_id3v2['flags']         =  array();
+		$thisfile_id3v2_flags            = &$thisfile_id3v2['flags'];
 
 
 		fseek($fd, $StartingOffset, SEEK_SET);
@@ -169,6 +166,7 @@
 			$sizeofframes -= 10; // footer takes last 10 bytes of ID3v2 header, after frame data, before audio
 		}
 		if ($sizeofframes > 0) {
+
 			$framedata = fread($fd, $sizeofframes); // read all frames from file into $framedata variable
 
 			//    if entire frame data is unsynched, de-unsynch it now (ID3v2.3.x)
@@ -379,7 +377,7 @@
 		if (isset($thisfile_id3v2['comments']['track'])) {
 			foreach ($thisfile_id3v2['comments']['track'] as $key => $value) {
 				if (strstr($value, '/')) {
-					list($thisfile_id3v2['comments']['track'][$key], $thisfile_id3v2['comments']['totaltracks'][$key]) = explode('/', $thisfile_id3v2['comments']['track'][$key]);
+					list($thisfile_id3v2['comments']['tracknum'][$key], $thisfile_id3v2['comments']['totaltracks'][$key]) = explode('/', $thisfile_id3v2['comments']['track'][$key]);
 				}
 			}
 		}
@@ -500,7 +498,13 @@
 			//    Frame-level de-compression
 			if ($parsedFrame['flags']['compression']) {
 				$parsedFrame['decompressed_size'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 0, 4));
-				$parsedFrame['data'] = gzuncompress(substr($parsedFrame['data'], 4));
+				if (!function_exists('gzuncompress')) {
+					$ThisFileInfo['warning'][] = 'gzuncompress() support required to decompress ID3v2 frame "'.$parsedFrame['frame_name'].'"';
+				} elseif ($decompresseddata = @gzuncompress(substr($parsedFrame['data'], 4))) {
+					$parsedFrame['data'] = $decompresseddata;
+				} else {
+					$ThisFileInfo['warning'][] = 'gzuncompress() failed on compressed contents of ID3v2 frame "'.$parsedFrame['frame_name'].'"';
+				}
 			}
 		}
 
@@ -543,6 +547,7 @@
 
 			$frame_offset = 0;
 			$frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+
 			if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
 				$ThisFileInfo['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
 			}
@@ -874,32 +879,40 @@
 			// Short content descrip. <text string according to encoding> $00 (00)
 			// The actual text        <full text string according to encoding>
 
-			$frame_offset = 0;
-			$frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
-			if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
-				$ThisFileInfo['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
-			}
-			$frame_language = substr($parsedFrame['data'], $frame_offset, 3);
-			$frame_offset += 3;
-			$frame_terminatorpos = strpos($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding), $frame_offset);
-			if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
-				$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
-			}
-			$frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
-			if (ord($frame_description) === 0) {
-				$frame_description = '';
-			}
-			$frame_text = (string) substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)));
+			if (strlen($parsedFrame['data']) < 5) {
 
-			$parsedFrame['encodingid']   = $frame_textencoding;
-			$parsedFrame['encoding']     = $this->TextEncodingNameLookup($frame_textencoding);
+				$ThisFileInfo['warning'][] = 'Invalid data (too short) for "'.$parsedFrame['frame_name'].'" frame at offset '.$parsedFrame['dataoffset'];
 
-			$parsedFrame['language']     = $frame_language;
-			$parsedFrame['languagename'] = $this->LanguageLookup($frame_language, false);
-			$parsedFrame['description']  = $frame_description;
-			$parsedFrame['data']         = $frame_text;
-			if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {
-				$ThisFileInfo['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $ThisFileInfo['id3v2']['encoding'], $parsedFrame['data']);
+			} else {
+
+				$frame_offset = 0;
+				$frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+				if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
+					$ThisFileInfo['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
+				}
+				$frame_language = substr($parsedFrame['data'], $frame_offset, 3);
+				$frame_offset += 3;
+				$frame_terminatorpos = strpos($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding), $frame_offset);
+				if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
+					$frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
+				}
+				$frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+				if (ord($frame_description) === 0) {
+					$frame_description = '';
+				}
+				$frame_text = (string) substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)));
+
+				$parsedFrame['encodingid']   = $frame_textencoding;
+				$parsedFrame['encoding']     = $this->TextEncodingNameLookup($frame_textencoding);
+
+				$parsedFrame['language']     = $frame_language;
+				$parsedFrame['languagename'] = $this->LanguageLookup($frame_language, false);
+				$parsedFrame['description']  = $frame_description;
+				$parsedFrame['data']         = $frame_text;
+				if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {
+					$ThisFileInfo['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $ThisFileInfo['id3v2']['encoding'], $parsedFrame['data']);
+				}
+
 			}
 
 		} elseif (($id3v2_majorversion >= 4) && ($parsedFrame['frame_name'] == 'RVA2')) { // 4.11  RVA2 Relative volume adjustment (2) (ID3v2.4+ only)
@@ -1190,7 +1203,7 @@
 
 			$imagechunkcheck = getid3_lib::GetDataImageSize($parsedFrame['data']);
 			if (($imagechunkcheck[2] >= 1) && ($imagechunkcheck[2] <= 3)) {
-				$parsedFrame['image_mime']       = getid3_lib::ImageTypesLookup($imagechunkcheck[2]);
+				$parsedFrame['image_mime']       = 'image/'.getid3_lib::ImageTypesLookup($imagechunkcheck[2]);
 				if ($imagechunkcheck[0]) {
 					$parsedFrame['image_width']  = $imagechunkcheck[0];
 				}
@@ -2928,7 +2941,7 @@
 			WCP	copyright
 			WOAF	url_file
 			WOAR	url_artist
-			WOAS	url_souce
+			WOAS	url_source
 			WORS	url_station
 			WPB	url_publisher
 			WPUB	url_publisher
@@ -2958,7 +2971,7 @@
 	function TextEncodingNameLookup($encoding) {
 		// http://www.id3.org/id3v2.4.0-structure.txt
 		static $TextEncodingNameLookup = array(0=>'ISO-8859-1', 1=>'UTF-16', 2=>'UTF-16BE', 3=>'UTF-8', 255=>'UTF-16BE');
-		return @$TextEncodingNameLookup[$encoding];
+		return (isset($TextEncodingNameLookup[$encoding]) ? $TextEncodingNameLookup[$encoding] : 'ISO-8859-1');
 	}
 
 	function IsValidID3v2FrameName($framename, $id3v2majorversion) {

Modified: plog/trunk/class/gallery/getid3/module.tag.lyrics3.php
===================================================================
--- plog/trunk/class/gallery/getid3/module.tag.lyrics3.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/gallery/getid3/module.tag.lyrics3.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,17 +13,15 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
-/**
- * \ingroup getid3
- */
+
 class getid3_lyrics3
 {
 
 	function getid3_lyrics3(&$fd, &$ThisFileInfo) {
 		// http://www.volweb.cz/str/tags.htm
 
-		fseek($fd, (0 - 128 - 9 - 6), SEEK_END); // end - ID3v1 - LYRICSEND - [Lyrics3size]
-		$lyrics3_id3v1 = fread($fd, (128 + 9 + 6));
+		fseek($fd, (0 - 128 - 9 - 6), SEEK_END);          // end - ID3v1 - LYRICSEND - [Lyrics3size]
+		$lyrics3_id3v1 = fread($fd, 128 + 9 + 6);
 		$lyrics3lsz    = substr($lyrics3_id3v1,  0,   6); // Lyrics3size
 		$lyrics3end    = substr($lyrics3_id3v1,  6,   9); // LYRICSEND or LYRICS200
 		$id3v1tag      = substr($lyrics3_id3v1, 15, 128); // ID3v1
@@ -110,6 +108,9 @@
 		// http://www.volweb.cz/str/tags.htm
 
 		fseek($fd, $endoffset, SEEK_SET);
+		if ($length <= 0) {
+			return false;
+		}
 		$rawdata = fread($fd, $length);
 
 		if (substr($rawdata, 0, 11) != 'LYRICSBEGIN') {
@@ -154,7 +155,7 @@
 					while (strlen($rawdata) > 0) {
 						$fieldname = substr($rawdata, 0, 3);
 						$fieldsize = (int) substr($rawdata, 3, 5);
-						$ParsedLyrics3['raw']["$fieldname"] = substr($rawdata, 8, $fieldsize);
+						$ParsedLyrics3['raw'][$fieldname] = substr($rawdata, 8, $fieldsize);
 						$rawdata = substr($rawdata, 3 + 5 + $fieldsize);
 					}
 
@@ -163,15 +164,15 @@
 						$flagnames = array('lyrics', 'timestamps', 'inhibitrandom');
 						foreach ($flagnames as $flagname) {
 							if (strlen($ParsedLyrics3['raw']['IND']) > ++$i) {
-								$ParsedLyrics3['flags']["$flagname"] = $this->IntString2Bool(substr($ParsedLyrics3['raw']['IND'], $i, 1));
+								$ParsedLyrics3['flags'][$flagname] = $this->IntString2Bool(substr($ParsedLyrics3['raw']['IND'], $i, 1));
 							}
 						}
 					}
 
 					$fieldnametranslation = array('ETT'=>'title', 'EAR'=>'artist', 'EAL'=>'album', 'INF'=>'comment', 'AUT'=>'author');
 					foreach ($fieldnametranslation as $key => $value) {
-						if (isset($ParsedLyrics3['raw']["$key"])) {
-							$ParsedLyrics3['comments']["$value"][] = trim($ParsedLyrics3['raw']["$key"]);
+						if (isset($ParsedLyrics3['raw'][$key])) {
+							$ParsedLyrics3['comments'][$value][] = trim($ParsedLyrics3['raw'][$key]);
 						}
 					}
 
@@ -180,9 +181,9 @@
 						foreach ($imagestrings as $key => $imagestring) {
 							if (strpos($imagestring, '||') !== false) {
 								$imagearray = explode('||', $imagestring);
-								$ParsedLyrics3['images']["$key"]['filename']     = $imagearray[0];
-								$ParsedLyrics3['images']["$key"]['description']  = $imagearray[1];
-								$ParsedLyrics3['images']["$key"]['timestamp']    = $this->Lyrics3Timestamp2Seconds($imagearray[2]);
+								$ParsedLyrics3['images'][$key]['filename']     = $imagearray[0];
+								$ParsedLyrics3['images'][$key]['description']  = $imagearray[1];
+								$ParsedLyrics3['images'][$key]['timestamp']    = $this->Lyrics3Timestamp2Seconds($imagearray[2]);
 							}
 						}
 					}
@@ -235,7 +236,7 @@
 				$thislinetimestamps[] = $this->Lyrics3Timestamp2Seconds($regs[0]);
 				$lyricline = str_replace($regs[0], '', $lyricline);
 			}
-			$notimestamplyricsarray["$key"] = $lyricline;
+			$notimestamplyricsarray[$key] = $lyricline;
 			if (isset($thislinetimestamps) && is_array($thislinetimestamps)) {
 				sort($thislinetimestamps);
 				foreach ($thislinetimestamps as $timestampkey => $timestamp) {

Modified: plog/trunk/class/locale/locale.class.php
===================================================================
--- plog/trunk/class/locale/locale.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/locale/locale.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -21,6 +21,7 @@
 
 	
     include_once( PLOG_CLASS_PATH."class/config/config.class.php" );
+    include_once( PLOG_CLASS_PATH."class/data/jalalicalendar.class.php" );
 
 	define( "DEFAULT_LOCALE_FOLDER", PLOG_CLASS_PATH . "locale" );
 	
@@ -512,6 +513,15 @@
 			$values["%%"] = "%";
             $values["%T"] = $this->getDayOrdinal( $timeStamp )." ".$this->tr("of")." ".$monthStr;
             $values["%D"] = $this->getDayOrdinal( $timeStamp );
+            /* Start Hack By FiFtHeLeMeNt For Persian Language */
+      		list( $jyear, $jmonth, $jday ) = JalaliCalendar::gregorian_to_jalali($timeStamp->getYear(), $timeStamp->getMonth(), $timeStamp->getDay());
+      		$values["%q"] = JalaliCalendar::Convertnumber2farsi($jyear);
+      		$values["%w"]= JalaliCalendar::Convertnumber2farsi($jmonth);
+      		$values["%o"] = JalaliCalendar::Convertnumber2farsi($jday);
+      		$values["%R"] = JalaliCalendar::monthname($jmonth);
+      		$values["%T"] = JalaliCalendar::Convertnumber2farsi($timeStamp->getHour());
+      		$values["%U"] = JalaliCalendar::Convertnumber2farsi($timeStamp->getMinutes());
+			/* End Hack By FiFtHeLeMeNt For Persian Language */		
 
 			$text = $format;
 			foreach( array_keys($values) as $key ) {

Modified: plog/trunk/class/logger/logger/loggedmessage.class.php
===================================================================
--- plog/trunk/class/logger/logger/loggedmessage.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/logger/logger/loggedmessage.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -52,7 +52,7 @@
 				// if we're logging an array
 				$message = "Arrary [ ";
 				foreach( $this->_message as $key => $value ) {
-					$mesage .= "$key => $value, ";
+					$message .= "$key => $value, ";
 				}
 				$message .= " ]";
 			}

Modified: plog/trunk/class/net/customrequestgenerator.class.php
===================================================================
--- plog/trunk/class/net/customrequestgenerator.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/net/customrequestgenerator.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -63,7 +63,7 @@
 			$day = $t->getDay();
 			if( $day < 10 ) $day = "0".$day;
             
-            $params = Array( '{blogname}' => TextFilter::urlize($this->_blogInfo->getBlog()),
+            $params = Array( '{blogname}' => $this->_blogInfo->getMangledBlog(),
                              '{blogid}' => $this->_blogInfo->getId(),
 							 '{blogowner}' => $ownerInfo->getUsername(),
                              '{year}' => $t->getYear(),
@@ -100,7 +100,7 @@
             
             $params = Array( "{year}" => $t->getYear(),
                              "{month}" => $t->getMonth(),
-                             "{blogname}" => TextFilter::urlize($this->_blogInfo->getBlog()),
+                             "{blogname}" => $this->_blogInfo->getMangledBlog(),
 							 "{blogowner}" => $ownerInfo->getUsername(),
                              "{blogid}" => $this->_blogInfo->getId());
 			if( strlen($date) == 6 ) $params["{day}"] = "";
@@ -172,7 +172,7 @@
                              "{catname}" => TextFilter::urlize($category->getName()),
                              "{blogid}" => $this->_blogInfo->getId(),
 							 "{blogowner}" => $ownerInfo->getUsername(),
-                             "{blogname}" => TextFilter::urlize($this->_blogInfo->getBlog()));
+                             "{blogname}" => $this->_blogInfo->getMangledBlog());
             $result = $this->_replaceTags( $categoryFormat, $params );
             
             $categoryLink = $this->getBaseUrl().$result;
@@ -195,8 +195,8 @@
 			$ownerInfo = $this->_blogInfo->getOwnerInfo();			
             
             $params = Array( "{blogid}" => $this->_blogInfo->getId(),
-                             "{blogname}" => TextFilter::urlize($this->_blogInfo->getBlog()),
-							 "{blogowner}" => $ownerInfo->getUsername(),							 
+                             "{blogname}" => $this->_blogInfo->getMangledBlog(),
+							 "{blogowner}" => $ownerInfo->getUsername(),
                              "{username}" => $user->getUsername(),
                              "{userid}" => $user->getId(),
 							 "{year}" => "",
@@ -223,7 +223,7 @@
 
             $blogLinkFormat = $this->_config->getValue( "blog_link_format" );
             $params = Array( "{blogid}" => $blogInfo->getId(),
-                             "{blogname}" => TextFilter::urlize($blogInfo->getBlog()),
+                             "{blogname}" => $blogInfo->getMangledBlog(),
 							 "{blogowner}" => $ownerInfo->getUsername());
             $result = $this->getBaseUrl().$this->_replaceTags( $blogLinkFormat, $params );
             
@@ -337,7 +337,7 @@
 			$ownerInfo = $this->_blogInfo->getOwnerInfo();			
 			
 			$params = Array( "{blogid}" => $this->_blogInfo->getId(),
-			                 "{blogname}" => Textfilter::urlize($this->_blogInfo->getBlog()),
+			                 "{blogname}" => $this->_blogInfo->getMangledBlog(),
 							 "{blogowner}" => $ownerInfo->getUsername(),							 
 							 "{albumid}" => "",
 							 "{albumname}" => "" );
@@ -387,7 +387,7 @@
 			$ownerInfo = $this->_blogInfo->getOwnerInfo();			
 			
 			$params = Array( "{blogid}" => $this->_blogInfo->getId(),
-			                 "{blogname}" => Textfilter::urlize($this->_blogInfo->getBlog()),
+			                 "{blogname}" => $this->_blogInfo->getMangledBlog(),
 							 "{blogowner}" => $ownerInfo->getUsername(),
 							 "{templatename}" => $template );
 			
@@ -465,15 +465,15 @@
             	$blogId = $ownerId;
             	$blogs =& new Blogs();
 				$blogInfo = $blogs->getBlogInfo($blogId);
-				$blogShortName = $blogInfo->getBlog();
+				$blogShortName = $blogInfo->getMangledBlog();
 				$ownerInfo = $blogInfo->getOwnerInfo();
 			} else {
-				$blogShortName = $this->_blogInfo->getBlog();
+				$blogShortName = $this->_blogInfo->getMangledBlog();
 				$ownerInfo = $this->_blogInfo->getOwnerInfo();
 			}
 		
 			$params = Array( "{blogid}" => $blogId,
-			                 "{blogname}" => Textfilter::urlize($blogShortName),
+			                 "{blogname}" => $blogShortName,
 							 "{blogowner}" => $ownerInfo->getUsername(),							 
 							 "{resourceid}" => $resource->getId(),
 							 "{resourcename}" => rawurlencode($resource->getFileName()),

Modified: plog/trunk/class/net/http/httpcache.class.php
===================================================================
--- plog/trunk/class/net/http/httpcache.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/net/http/httpcache.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -1,196 +1,211 @@
 <?php
 
-	include_once( PLOG_CLASS_PATH."class/net/http/httpvars.class.php" );
+include_once( PLOG_CLASS_PATH."class/net/http/httpvars.class.php" );
 
-
-//In RSS/ATOM feedMode, contains the date of the clients last update.
-$clientCacheDate=0; //Global variable because PHP4 does not allow conditional arguments by reference
-
-/**
- *
+/*
  * \ingroup Net_HTTP
- *
- *
  * Enable support for HTTP/1.x conditional requests in PHP.
  * Goal: Optimisation
  * - If the client sends a HEAD request, avoid transferring data and return the correct headers.
  * - If the client already has the same version in its cache, avoid transferring data again (304 Not Modified).
  * - Possibility to control cache for client and proxies (public or private policy, life time).
  * - When $feedMode is set to true, in the case of a RSS/ATOM feed,
- *  it puts a timestamp in the global variable $clientCacheDate to allow the sending of only the articles newer than the client's cache.
- * - When $compression is set to true, compress the data before sending it to the client and persitent connections are allowed. (Beta1 version)
+ *   it puts a timestamp in the global variable $clientCacheDate to allow the sending of only the articles newer than the client's cache.
+ * - When $compression is set to true, compress the data before sending it to the client and persitent connections are allowed.
+ * - When $session is set to true, automatically checks if $_SESSION has been modified during the last generation the document.
  *
- *Interface:
+ * Interface:
  * - function httpConditional($UnixTimeStamp,$cacheSeconds=0,$cachePrivacy=0,$feedMode=false,$compression=false)
- * [Required] $UnixTimeStamp: Date of the last modification of the data to send to the client (Unix Timestamp format).
- * [Implied] $cacheSeconds=0: Lifetime in seconds of the document. If $cacheSeconds>0, the document will be cashed and not revalidated against the server for this delay.
- * [Implied] $cachePrivacy=0: 0=private, 1=normal (public), 2=forced public. When public, it allows a cashed document ($cacheSeconds>0) to be shared by several users.
- * [Implied] $feedMode=false: Special RSS/ATOM feeds. When true, it sets $cachePrivacy to 0 (private), does not use the modification time of the script itself, and puts the date of the client's cache (or a old date from 1980) in the global variable $clientCacheDate.
- * [implied] $compression=false: Enable the compression and allows persistant connections.
- * Return: True if the connection can be closed (e.g.: the client has already the lastest version), false if the new content has to be send to the client.
+ *  [Required] $UnixTimeStamp: Date of the last modification of the data to send to the client (Unix Timestamp format).
+ *  [Implied] $cacheSeconds=0: Lifetime in seconds of the document. If $cacheSeconds>0, the document will be cashed and not revalidated against the server for this delay.
+ *  [Implied] $cachePrivacy=0: 0=private, 1=normal (public), 2=forced public. When public, it allows a cashed document ($cacheSeconds>0) to be shared by several users.
+ *  [Implied] $feedMode=false: Special RSS/ATOM feeds. When true, it sets $cachePrivacy to 0 (private), does not use the modification time of the script itself, and puts the date of the client's cache (or a old date from 1980) in the global variable $clientCacheDate.
+ *  [implied] $compression=false: Enable the compression and allows persistant connections (automatic detection of the capacities of the client).
+ *  [implied] $session=false: To be turned on when sessions are used. Checks if the data contained in $_SESSION has been modified during the last generation the document.
+ *  Returns: True if the connection can be closed (e.g.: the client has already the lastest version), false if the new content has to be send to the client.
  *
  * Typical use:
- *
- * <pre>
  * <?php
- * require_once('http-conditional.php');
- * //Date of the last modification of the content (Unix Timestamp format).
- * //Examples: query the database, or last modification of this script.
- * $dateLastModification=...;
- * if (httpConditional($dateLastModification))
- * {
- *  ... //Close database connections, and other cleaning.
- *  exit(); //No need to send anything
- * }
- * //Do not send any text to the client before this line.
- * ... //Rest of the script, just as you would do normally.
+ *  require_once('http-conditional.php');
+ *  //Date of the last modification of the content (Unix Timestamp format).
+ *  //Examples: query the database, or last modification of a static file.
+ *  $dateLastModification=...;
+ *  if (httpConditional($dateLastModification))
+ *  {
+ *   ... //Close database connections, and other cleaning.
+ *   exit(); //No need to send anything
+ *  }
+ *  //Do not send any text to the client before this line.
+ *  ... //Rest of the script, just as you would do normally.
  * ?>
- * </pre>
  *
- * Version 1.3, 2004-08-05, http://alexandre.alapetite.net/doc-alex/php-http-304/
+ * Version 1.6.1, 2005-04-03, http://alexandre.alapetite.net/doc-alex/php-http-304/
  *
  * ------------------------------------------------------------------
  * Written by Alexandre Alapetite, http://alexandre.alapetite.net/cv/
  *
- * Copyright 2004, Licence: Creative Commons "Attribution-ShareAlike 2.0" BY-SA,
- * http://creativecommons.org/licenses/by-sa/2.0/
+ * Copyright 2004-2005, Licence: Creative Commons "Attribution-ShareAlike 2.0 France" BY-SA (FR),
+ * http://creativecommons.org/licenses/by-sa/2.0/fr/
  * http://alexandre.alapetite.net/divers/apropos/#by-sa
  * - Attribution. You must give the original author credit
  * - Share Alike. If you alter, transform, or build upon this work,
- *  you may distribute the resulting work only under a license identical to this one
+ *   you may distribute the resulting work only under a license identical to this one
+ * - The French law is authoritative
  * - Any of these conditions can be waived if you get permission from Alexandre Alapetite
  * - Please send to Alexandre Alapetite the modifications you make,
- *  in order to improve this file for the benefit of everybody
+ *   in order to improve this file for the benefit of everybody
  *
  * If you want to distribute this code, please do it as a link to:
  * http://alexandre.alapetite.net/doc-alex/php-http-304/
  */
+
+//In RSS/ATOM feedMode, contains the date of the clients last update.
+$clientCacheDate=0; //Global public variable because PHP4 does not allow conditional arguments by reference
+$_sessionMode=false; //Global private variable
+
 class HttpCache {
-	function httpConditional($UnixTimeStamp,$cacheSeconds=0,$cachePrivacy=0,$feedMode=false,$compression=false)
-	{//Credits: http://alexandre.alapetite.net/doc-alex/php-http-304/
-	 //RFC2616 HTTP/1.1: http://www.w3.org/Protocols/rfc2616/rfc2616.html
-	 //RFC1945 HTTP/1.0: http://www.w3.org/Protocols/rfc1945/rfc1945.txt
-	 
-			$SERVER = HttpVars::getServer();
-			
-			if( $cacheSeconds == 0 )
-				$cacheSeconds = 788400000;
-			
-			if (headers_sent()) return false;
-			
-			if (isset($SERVER['SCRIPT_FILENAME'])) $scriptName=$SERVER['SCRIPT_FILENAME'];
-			elseif (isset($SERVER['PATH_TRANSLATED'])) $scriptName=$SERVER['PATH_TRANSLATED'];
-			else return false;
-			
-			if ((!$feedMode)&&(($modifScript=filemtime($scriptName))>$UnixTimeStamp))
-				$UnixTimeStamp=$modifScript;
-			$UnixTimeStamp=min($UnixTimeStamp,time());
-			$is304=true;
-			$is412=false;
-			$nbCond=0;
-			
-			//rfc2616-sec3.html#sec3.3.1
-			$dateLastModif=gmdate('D, d M Y H:i:s \G\M\T',$UnixTimeStamp);
-			$dateCacheClient='Tue, 10 Jan 1980 20:30:40 GMT';
-			
-			//rfc2616-sec14.html#sec14.19 //='"0123456789abcdef0123456789abcdef"'
-			if (isset($SERVER['QUERY_STRING'])) $myQuery='?'.$SERVER['QUERY_STRING'];
-			else $myQuery='';
-			$etagServer='"'.md5($scriptName.$myQuery.'#'.$dateLastModif).'"';
-			
-			if ((!$is412)&&isset($SERVER['HTTP_IF_MATCH']))
-			{//rfc2616-sec14.html#sec14.24
-				$etagsClient=stripslashes($SERVER['HTTP_IF_MATCH']);
-				$is412=(($etagClient!='*')&&(strpos($etagsClient,$etagServer)===false));
-			}
-			if ($is304&&isset($SERVER['HTTP_IF_MODIFIED_SINCE']))
-			{//rfc2616-sec14.html#sec14.25 //rfc1945.txt
-				$nbCond++;
-				$dateCacheClient=$SERVER['HTTP_IF_MODIFIED_SINCE'];
-				$is304=($dateCacheClient==$dateLastModif);
-			}
-			if ($is304&&isset($SERVER['HTTP_IF_NONE_MATCH']))
-			{//rfc2616-sec14.html#sec14.26
-				$nbCond++;
-				$etagClient=stripslashes($SERVER['HTTP_IF_NONE_MATCH']);
-				$is304=(($etagClient==$etagServer)||($etagClient=='*'));
-			}
-			if ((!$is412)&&isset($SERVER['HTTP_IF_UNMODIFIED_SINCE']))
-			{//rfc2616-sec14.html#sec14.28
-				$dateCacheClient=$SERVER['HTTP_IF_UNMODIFIED_SINCE'];
-				$is412=($dateCacheClient!=$dateLastModif);
-			}
-			if ($feedMode)
-			{//Special RSS/ATOM
-				global $clientCacheDate;
-				$clientCacheDate=strtotime($dateCacheClient);
-				$cachePrivacy=0;
-			}
-			
-			if ($is412)
-			{//rfc2616-sec10.html#sec10.4.13
-				header('HTTP/1.1 412 Precondition Failed');
-				header('Cache-Control: private, max-age=0, must-revalidate');
-				header('Content-Type: text/plain');
-				echo "HTTP/1.1 Error 412 Precondition Failed: Precondition request failed positive evaluation\n";
-				return true;
-			}
-			elseif ($is304&&($nbCond>0))
-			{//rfc2616-sec10.html#sec10.3.5
-				header('HTTP/1.0 304 Not Modified');
-				header('Etag: '.$etagServer);
-				if ($feedMode) header('Connection: close'); //Comment this line under IIS
-				
-				if ($cacheSeconds==0)
-				{
-					$cache='private, must-revalidate, ';
-					//$cacheSeconds=-1500000; //HTTP/1.0
-				}
-				elseif ($cachePrivacy==0) $cache='private, ';
-				elseif ($cachePrivacy==2) $cache='public, ';
-				else $cache='';
-				$cache.='max-age='.floor($cacheSeconds);
-				header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T',time()+$cacheSeconds)); //HTTP/1.0 //rfc2616-sec14.html#sec14.21a
-				header('Cache-Control: '.$cache); //rfc2616-sec14.html#sec14.9
-				header('Pragma: public');
-				
-				return true;
-			}
-			else
-			{//rfc2616-sec10.html#sec10.2.1
-			 //rfc2616-sec14.html#sec14.3
-				if ($compression&&isset($SERVER['HTTP_ACCEPT_ENCODING'])&&
-					extension_loaded('zlib')&&(!ini_get('zlib.output_compression')))
-					ob_start('_httpConditionalCallBack');
-				//header('HTTP/1.0 200 OK');
-				if ($cacheSeconds==0)
-				{
-					$cache='private, must-revalidate, ';
-					//$cacheSeconds=-1500000; //HTTP/1.0
-				}
-				elseif ($cachePrivacy==0) $cache='private, ';
-				elseif ($cachePrivacy==2) $cache='public, ';
-				else $cache='';
-				$cache.='max-age='.floor($cacheSeconds);
-				header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T',time()+$cacheSeconds)); //HTTP/1.0 //rfc2616-sec14.html#sec14.21a
-				header('Cache-Control: '.$cache); //rfc2616-sec14.html#sec14.9
-				
-				header('Last-Modified: '.$dateLastModif);
-				header('Etag: '.$etagServer);
-				if ($feedMode) header('Connection: close'); //rfc2616-sec14.html#sec14.10 //Comment this line under IIS
-				return $SERVER['REQUEST_METHOD']=='HEAD'; //rfc2616-sec9.html#sec9.4
-			}
-	}
+    function httpConditional($UnixTimeStamp,$cacheSeconds=0,
+                             $cachePrivacy=0,$feedMode=false,
+                             $compression=false,$session=false){
+            //Credits: http://alexandre.alapetite.net/doc-alex/php-http-304/
+            //RFC2616 HTTP/1.1: http://www.w3.org/Protocols/rfc2616/rfc2616.html
+            //RFC1945 HTTP/1.0: http://www.w3.org/Protocols/rfc1945/rfc1945.txt
 
-}
+        if (headers_sent()) return false;
 
-function _httpConditionalCallBack($buffer,$mode=5)
-{//Private function automatically called at the end of the script when compression is enabled
- //rfc2616-sec14.html#sec14.11
- //You can adjust the level of compression with zlib.output_compression_level in php.ini
-	$buffer=ob_gzhandler($buffer,$mode); //Will check HTTP_ACCEPT_ENCODING and put correct headers
-	header('Content-Length: '.strlen($buffer));
-	return $buffer;
+        if (isset($_SERVER['SCRIPT_FILENAME'])) $scriptName=$_SERVER['SCRIPT_FILENAME'];
+        elseif (isset($_SERVER['PATH_TRANSLATED'])) $scriptName=$_SERVER['PATH_TRANSLATED'];
+        else return false;
+
+        if ((!$feedMode)&&(($modifScript=filemtime($scriptName))>$UnixTimeStamp))
+            $UnixTimeStamp=$modifScript;
+        $UnixTimeStamp=min($UnixTimeStamp,time());
+        $is304=true;
+        $is412=false;
+        $nbCond=0;
+
+            //rfc2616-sec3.html#sec3.3.1
+        $dateLastModif=gmdate('D, d M Y H:i:s \G\M\T',$UnixTimeStamp);
+        $dateCacheClient='Thu, 10 Jan 1980 20:30:40 GMT';
+
+            //rfc2616-sec14.html#sec14.19 //='"0123456789abcdef0123456789abcdef"'
+        if (isset($_SERVER['QUERY_STRING'])) $myQuery='?'.$_SERVER['QUERY_STRING'];
+        else $myQuery='';
+        if ($session&&isset($_SESSION))
+        {
+            global $_sessionMode;
+            $_sessionMode=$session;
+            $myQuery.=print_r($_SESSION,true).session_name().'='.session_id();
+        }
+        $etagServer='"'.md5($scriptName.$myQuery.'#'.$dateLastModif).'"';
+
+        if ((!$is412)&&isset($_SERVER['HTTP_IF_MATCH']))
+        {//rfc2616-sec14.html#sec14.24
+            $etagsClient=stripslashes($_SERVER['HTTP_IF_MATCH']);
+            $is412=(($etagClient!='*')&&(strpos($etagsClient,$etagServer)===false));
+        }
+        if ($is304&&isset($_SERVER['HTTP_IF_MODIFIED_SINCE']))
+        {//rfc2616-sec14.html#sec14.25 //rfc1945.txt
+            $nbCond++;
+            $dateCacheClient=$_SERVER['HTTP_IF_MODIFIED_SINCE'];
+            $p=strpos($dateCacheClient,';');
+            if ($p!==false)
+                $dateCacheClient=substr($dateCacheClient,0,$p);
+            $is304=($dateCacheClient==$dateLastModif);
+        }
+        if ($is304&&isset($_SERVER['HTTP_IF_NONE_MATCH']))
+        {//rfc2616-sec14.html#sec14.26
+            $nbCond++;
+            $etagClient=stripslashes($_SERVER['HTTP_IF_NONE_MATCH']);
+            $is304=(($etagClient==$etagServer)||($etagClient=='*'));
+        }
+        if ((!$is412)&&isset($_SERVER['HTTP_IF_UNMODIFIED_SINCE']))
+        {//rfc2616-sec14.html#sec14.28
+            $dateCacheClient=$_SERVER['HTTP_IF_UNMODIFIED_SINCE'];
+            $p=strpos($dateCacheClient,';');
+            if ($p!==false)
+                $dateCacheClient=substr($dateCacheClient,0,$p);
+            $is412=($dateCacheClient!=$dateLastModif);
+        }
+        if ($feedMode)
+        {//Special RSS/ATOM
+            global $clientCacheDate;
+            $clientCacheDate=strtotime($dateCacheClient);
+            $cachePrivacy=0;
+        }
+
+        if ($is412)
+        {//rfc2616-sec10.html#sec10.4.13
+            header('HTTP/1.1 412 Precondition Failed');
+            header('Cache-Control: private, max-age=0, must-revalidate');
+            header('Content-Type: text/plain');
+            echo "HTTP/1.1 Error 412 Precondition Failed: Precondition request failed positive evaluation\n";
+            return true;
+        }
+        elseif ($is304&&($nbCond>0))
+        {//rfc2616-sec10.html#sec10.3.5
+            header('HTTP/1.0 304 Not Modified');
+            header('Etag: '.$etagServer);
+            if ($feedMode) header('Connection: close'); //Comment this line under IIS
+            return true;
+        }
+        else
+        {//rfc2616-sec10.html#sec10.2.1
+                //rfc2616-sec14.html#sec14.3
+            if ($compression) ob_start('_httpConditionalCallBack'); //Will check HTTP_ACCEPT_ENCODING
+                //header('HTTP/1.0 200 OK');
+            if ($cacheSeconds==0)
+            {
+                $cache='private, must-revalidate, ';
+                    //$cacheSeconds=-1500000; //HTTP/1.0
+            }
+            elseif ($cachePrivacy==0) $cache='private, ';
+            elseif ($cachePrivacy==2) $cache='public, ';
+            else $cache='';
+            $cache.='max-age='.floor($cacheSeconds);
+	    // header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T',time()+$cacheSeconds)); //HTTP/1.0 //rfc2616-sec14.html#sec14.21
+            header('Cache-Control: '.$cache); //rfc2616-sec14.html#sec14.9
+            header('Last-Modified: '.$dateLastModif);
+            header('Etag: '.$etagServer);
+            if ($feedMode) header('Connection: close'); //rfc2616-sec14.html#sec14.10 //Comment this line under IIS
+            return $_SERVER['REQUEST_METHOD']=='HEAD'; //rfc2616-sec9.html#sec9.4
+        }
+    }
+
+    function _httpConditionalCallBack($buffer,$mode=5){
+            //Private function automatically called at the end of the script when compression is enabled
+            //rfc2616-sec14.html#sec14.11
+            //You can adjust the level of compression with zlib.output_compression_level in php.ini
+        if (extension_loaded('zlib')&&(!ini_get('zlib.output_compression')))
+        {
+            $buffer2=ob_gzhandler($buffer,$mode); //Will check HTTP_ACCEPT_ENCODING and put correct headers
+            if (strlen($buffer2)>1) //When ob_gzhandler succeeded
+                $buffer=$buffer2;
+        }
+        header('Content-Length: '.strlen($buffer)); //Allows persistant connections //rfc2616-sec14.html#sec14.13
+        return $buffer;
+    }
+    
+    function httpConditionalRefresh($UnixTimeStamp){
+            //Update HTTP headers if the content has just been modified by the client's request
+            //See an example on http://alexandre.alapetite.net/doc-alex/compteur/
+        if (headers_sent()) return false;
+        
+        if (isset($_SERVER['SCRIPT_FILENAME'])) $scriptName=$_SERVER['SCRIPT_FILENAME'];
+        elseif (isset($_SERVER['PATH_TRANSLATED'])) $scriptName=$_SERVER['PATH_TRANSLATED'];
+        else return false;
+        
+        $dateLastModif=gmdate('D, d M Y H:i:s \G\M\T',$UnixTimeStamp);
+        
+        if (isset($_SERVER['QUERY_STRING'])) $myQuery='?'.$_SERVER['QUERY_STRING'];
+        else $myQuery='';
+        global $_sessionMode;
+        if ($_sessionMode&&isset($_SESSION))
+            $myQuery.=print_r($_SESSION,true).session_name().'='.session_id();
+        $etagServer='"'.md5($scriptName.$myQuery.'#'.$dateLastModif).'"';
+        
+        header('Last-Modified: '.$dateLastModif);
+        header('Etag: '.$etagServer);
+    }
 }
-
 ?>
\ No newline at end of file

Modified: plog/trunk/class/net/http/session/sessionmanager.class.php
===================================================================
--- plog/trunk/class/net/http/session/sessionmanager.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/net/http/session/sessionmanager.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -36,7 +36,7 @@
             $sessionPath   = SessionManager::setSessionCookiePath();
             $sessionDomain = SessionManager::setSessionCookieDomain();
 		
-			//session_cache_limiter( "public" );
+			session_cache_limiter( "" );
 			session_name( "plogsession" );
             session_set_cookie_params(0, $sessionPath, $sessionDomain);
 			session_start();

Modified: plog/trunk/class/plugin/pluginbase.class.php
===================================================================
--- plog/trunk/class/plugin/pluginbase.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/plugin/pluginbase.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -11,7 +11,6 @@
      * available in this class.
      */
 
-	
 
     /**
      * \ingroup Plugin
@@ -21,10 +20,6 @@
     class PluginBase  
 	{
 
-    	/** ADOConnection object to connect to the database
-        */
-    	var $db;
-
         /**
          * This should be filled by the objects that extend this class to provide
          * some help on how to use the plugin.

Modified: plog/trunk/class/summary/action/summaryrssaction.class.php
===================================================================
--- plog/trunk/class/summary/action/summaryrssaction.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/summary/action/summaryrssaction.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -5,10 +5,13 @@
     include_once( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
     include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
 	include_once( PLOG_CLASS_PATH."class/summary/view/summaryrssview.class.php" );
+	include_once( PLOG_CLASS_PATH."class/net/rawrequestgenerator.class.php" );
 	
 	define( "SUMMARY_RSS_TYPE_DEFAULT", "default" );
 	define( "SUMMARY_RSS_TYPE_MOST_COMMENTED", "mostcommented" );
 	define( "SUMMARY_RSS_TYPE_MOST_READ", "mostread" );
+	define( "SUMMARY_RSS_TYPE_MOST_ACTIVE_BLOGS", "mostactiveblogs" );
+	define( "SUMMARY_RSS_TYPE_NEWEST_BLOGS", "newestblogs" );
 
      /**
       * This is the one and only default action. It simply fetches all the most recent
@@ -33,8 +36,11 @@
 			$this->_mode = $this->_request->getValue( "type" );
 			if( $this->_mode != SUMMARY_RSS_TYPE_DEFAULT &&
 			    $this->_mode != SUMMARY_RSS_TYPE_MOST_COMMENTED &&
-				$this->_mode != SUMMARY_RSS_TYPE_MOST_READ ) {
+				$this->_mode != SUMMARY_RSS_TYPE_MOST_READ &&
+				$this->_mode != SUMMARY_RSS_TYPE_MOST_ACTIVE_BLOGS &&
+				$this->_mode != SUMMARY_RSS_TYPE_NEWEST_BLOGS ) {
 				
+				// in case the parameter looks weird, let's use a default one...
 				$this->_mode = SUMMARY_RSS_TYPE_DEFAULT;
 			}
 			
@@ -48,37 +54,77 @@
          */
         function perform()
         {
-			$this->_view = new SummaryRssView( $this->_profile, Array( "summary" => "rss", 
-			                                                    "mode" => $this->_mode,
-																"profile" => $this->_profile ));
-			if( $this->_view->isCached()) {
-				return true;
-			}
+            if( $this->_mode == SUMMARY_RSS_TYPE_MOST_COMMENTED ||
+                $this->_mode == SUMMARY_RSS_TYPE_MOST_READ ||
+                $this->_mode == SUMMARY_RSS_TYPE_DEFAULT ) {	                
+	                
+	            // RSS feeds for posts stuff
+	            $this->_view = new SummaryRssView( $this->_profile, Array( "summary" => "rss", 
+			                                       "mode" => $this->_mode,
+												   "profile" => $this->_profile ));
+				if( $this->_view->isCached()) {
+					return true;
+				}
 		
-            $blogs       = new Blogs();
-            $stats       = new SummaryStats();
-
-			if( $this->_mode == SUMMARY_RSS_TYPE_MOST_COMMENTED ) {
-				$posts = $stats->getMostCommentedArticles( $this->_numPosts);
+            	$blogs       = new Blogs();
+            	$stats       = new SummaryStats();
+	                
+				if( $this->_mode == SUMMARY_RSS_TYPE_MOST_COMMENTED ) {
+					$posts = $stats->getMostCommentedArticles( $this->_numPosts);
+				}
+				elseif( $this->_mode == SUMMARY_RSS_TYPE_MOST_READ ) {
+					$posts = $stats->getMostReadArticles( $this->_numPosts);			
+				}
+				else {
+					// load the most recent posts, filtering out all those registration messages...
+					$registerTopic = $this->_locale->tr( "register_default_article_topic" );
+					$registerText = $this->_locale->tr( "register_default_article_text" );
+					$posts = $stats->getRecentArticles( $this->_numPosts, $registerTopic, $registerText );
+				}
+	
+	            if( !$posts ) {
+					$posts = Array();
+	            }
+	
+				$this->_view->setValue( "posts", $posts );
 			}
-			elseif( $this->_mode == SUMMARY_RSS_TYPE_MOST_READ ) {
-				$posts = $stats->getMostReadArticles( $this->_numPosts);			
+			elseif( $this->_mode == SUMMARY_RSS_TYPE_MOST_ACTIVE_BLOGS ||
+			        $this->_mode == SUMMARY_RSS_TYPE_NEWEST_BLOGS ) {
+				// RSS feeds for blogs, need different template sets...
+				
+	            $this->_view = new SummaryRssView( "blogs_".$this->_profile, Array( "summary" => "rss", 
+			                                       "mode" => $this->_mode,
+												   "profile" => $this->_profile ));
+				if( $this->_view->isCached()) {
+					return true;
+				}
+				
+				// load the stuff
+				$stats = new SummaryStats();
+				
+				if( $this->_mode == SUMMARY_RSS_TYPE_MOST_ACTIVE_BLOGS ) {
+					$blogs = $stats->getMostActiveBlogs( $this->_numPosts );	
+				}
+				else {
+					$blogs = $stats->getRecentBlogs( $this->_numPosts);
+				}
+				
+				// in case there is really no data to fetch...
+				if( !$blogs )
+					$blogs = Array();
+					
+				// this 'url' object is just a dummy one... But we cannot get it from the list
+				// of blogs that we fetched because it could potentially be null! Besides, we only
+				// need it to generate the base url to rss.css and to summary.php, so no need to
+				// have a fully-featured object
+				$this->_view->setValue( "url", new RawRequestGenerator( null ));
+				$this->_view->setValue( "blogs", $blogs );								
 			}
-			else {
-				// load the most recent posts, filtering out all those registration messages...
-				$registerTopic = $this->_locale->tr( "register_default_article_topic" );
-				$registerText = $this->_locale->tr( "register_default_article_text" );
-				$posts = $stats->getRecentArticles( $this->_numPosts, $registerTopic, $registerText );
-			}
-
-            if( !$posts ) {
-				$posts = Array();
-            }
-
-			$this->_view->setValue( "posts", $posts );
+			
+			$this->_view->setValue( "type", $this->_mode );
 			$this->_view->setValue( "summary", true );
 			
-			$this->setCommonData();			
+			$this->setCommonData();		
 
             return true;
         }

Modified: plog/trunk/class/summary/dao/summarystats.class.php
===================================================================
--- plog/trunk/class/summary/dao/summarystats.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/summary/dao/summarystats.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -22,11 +22,25 @@
      */
     class SummaryStats extends Model
     {
+        
+        var $_now;
+        var $_sevenDaysAgo;
 
         function SummaryStats()
         {
             // initialize ADOdb
             $this->Model();
+            
+            // common object for all methods so that we can reuse caches
+            $this->articles = new Articles();
+            $this->blogs = new Blogs();            
+            
+            // calculate the date limits
+            $t = new Timestamp();
+            $this->_now = $t->getTimestamp(); 
+            // 7 days ago
+            $t->subtractSeconds( 7 * 24 * 60 * 60 );
+            $this->_sevenDaysAgo = $t->getTimestamp();
         }
 
         /**
@@ -51,15 +65,8 @@
        				         AND c.status = ".COMMENT_STATUS_NONSPAM."
        				         AND b.id = a.blog_id
        				         AND b.status = ".BLOG_STATUS_ACTIVE."
-       				         AND a.date <= NOW()";
+       				         AND a.date <= ".$this->_now;
 
-			// ignore certain topics and/or certain texts
-			/*if( $ignoreTopic != "" )
-				$query .= " AND t.topic NOT LIKE '%".Db::qstr( $ignoreTopic )."%' ";
-
-			if( $ignoreText != "" )
-				$query .= " AND t.text NOT LIKE '%".Db::qstr( $ignoreTopic )."%' ";*/
-
 			$query .= " GROUP BY c.article_id ORDER BY total_comments DESC ";
 
             if( $maxPosts > 0 )
@@ -73,10 +80,11 @@
             }
 
             $posts = Array();
-            $articles = new Articles();
             while( $row = $result->FetchRow()) {
-            	array_push( $posts, $articles->_fillArticleInformation($row));
+            	array_push( $posts, $this->articles->_fillArticleInformation($row));
             }
+            
+            $result->Close();
 
             return $posts;
         }
@@ -94,7 +102,6 @@
         {
              include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
 
-             $prefix = $this->getPrefix();
              $query = " SELECT 
                  a.id as id, 
                  a.properties as properties, 
@@ -106,7 +113,7 @@
                  a.slug as slug
                  FROM {$prefix}articles a
                  WHERE status = ".POST_STATUS_PUBLISHED."
-                 AND TO_DAYS(NOW()) - TO_DAYS(date) < 7  ";
+                 AND a.date <= ".$this->_now." AND a.date > ".$this->_sevenDaysAgo;
 
 			$query .= " ORDER BY a.num_reads DESC ";
 
@@ -119,11 +126,12 @@
             	return Array();
 
             $posts = Array();
-            $articles = new Articles();
             while( $row = $result->FetchRow()) {
-				$post = $articles->_fillArticleInformation($row);
+				$post = $this->articles->_fillArticleInformation($row);
             	array_push( $posts, $post );
             }
+            
+            $result->Close();            
 
             return $posts;
         }
@@ -150,11 +158,12 @@
             }
 
             $blogs = Array();
-            $blogdao = new Blogs();
             while( $row = $result->FetchRow()) {
-            	$blog = $blogdao->_fillBlogInformation( $row );
+            	$blog = $this->blogs->_fillBlogInformation( $row );
                 $blogs[$blog->getId()] = $blog;
             }
+            
+            $result->Close();            
 
             return $blogs;
         }
@@ -173,7 +182,8 @@
                        FROM {$prefix}articles AS a
                        INNER JOIN {$prefix}blogs AS b 
                            ON b.id=a.blog_id AND b.status=".BLOG_STATUS_ACTIVE.
-                       " GROUP BY a.blog_id ORDER BY rank DESC ";
+                       " WHERE a.date >= ".$this->_sevenDaysAgo." AND a.date <= ".$this->_now." 
+                       GROUP BY a.blog_id ORDER BY rank DESC ";
 
             if( $maxBlogs > 0 )
                 $query .= " LIMIT 0,".$maxBlogs;
@@ -185,11 +195,12 @@
             }
 
             $blogs = Array();
-            $blogdao = new Blogs();
             while( $row = $result->FetchRow()) {
-                $blog = $blogdao->_fillBlogInformation( $row );
+                $blog = $this->blogs->_fillBlogInformation( $row );
                 $blogs[$blog->getId()] = $blog;
             }
+            
+            $result->Close();            
 
             return $blogs;
         }
@@ -228,6 +239,8 @@
             	$user = $usersDao->_fillUserInformation( $row, true );
                 $users[$user->getId()] = $user;
             }
+            
+            $result->Close();            
 
             return $users;
         }
@@ -251,19 +264,17 @@
             $date   = $t->getTimestamp();
 			$prefix = $this->getPrefix();
 
-			$query = "SELECT a.id as id, a.id,t.topic,t.text,a.date,
+			$query = "SELECT a.id as id, a.id,a.date,
                              a.user_id,a.blog_id, a.status, a.properties,
                              a.num_reads, a.slug
 					  FROM {$prefix}articles a, 
 					       {$prefix}blogs b
-					  WHERE TO_DAYS(NOW()) - TO_DAYS(a.date) < 7 
+					  WHERE a.date >= ".$this->_sevenDaysAgo." AND a.date <= ".$this->_now."
 					        AND a.blog_id = b.id
 					        AND b.status = ".BLOG_STATUS_ACTIVE."
-					        AND a.status = ".POST_STATUS_PUBLISHED."
-					        AND a.date < NOW()";
+					        AND a.status = ".POST_STATUS_PUBLISHED;
 
 			$query .= " GROUP BY a.id ORDER BY a.date DESC LIMIT 0, $maxPosts";
-
             $result = $this->Execute( $query );
 
             if( !$result )
@@ -272,15 +283,17 @@
             $blogs = Array();
             $posts = Array();
             $i     = 0;
-            $articles = new Articles();
+
             while( ($row = $result->FetchRow()) && ($i < $maxPosts) ) {
                 if (!in_array($row["blog_id"], $blogs))
                 {
                     $blogs[] = $row["blog_id"];
-                    array_push( $posts, $articles->_fillArticleInformation($row) );
+                    array_push( $posts, $this->articles->_fillArticleInformation($row) );
                     $i++;
                 }
             }
+            
+            $result->Close();            
 
             return $posts;
         }
@@ -316,16 +329,18 @@
 
                 if (empty($maxPosts))
                 {
-                    array_push( $posts, $articles->_fillArticleInformation($row));
+                    array_push( $posts, $this->articles->_fillArticleInformation($row));
                     $count++;
                 }
                 else if($count <= $maxPosts && empty($ids[$row["blog_id"]]))
                 {
                     $ids[$row["blog_id"]] = true;
-                    array_push( $posts, $articles->_fillArticleInformation($row));
+                    array_push( $posts, $this->articles->_fillArticleInformation($row));
                     $count++;
                 }
             }
+            
+            $result->Close();            
 
             return $posts;
         }

Modified: plog/trunk/class/summary/view/summarycachedview.class.php
===================================================================
--- plog/trunk/class/summary/view/summarycachedview.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/summary/view/summarycachedview.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -87,7 +87,22 @@
 			print $this->_template->fetch( $this->_viewId );		
 		}
 					
+		function getCacheTimeSeconds()
+		{
+			$config =& Config::getConfig();
+			
+			$cacheTime = $config->getValue( "template_cache_lifetime" );
+			
+			if( $cacheTime == "" || !is_numeric($cacheTime))
+				$cacheTime = 1; // [almost] no value, just one second of caching
+			if( $cacheTime == -1 )
+				$cacheTime = 788400000; // a veeery long time!
+			if( $cacheTime > 788400000)
+				$cacheTime = 788400000;
 
+			return( $cacheTime );
+		}		
+
         function render()
         {
 	       include_once( PLOG_CLASS_PATH."class/config/config.class.php" );
@@ -106,7 +121,7 @@
 				// some debug information
 				$timestamp = $this->_template->getCreationTimestamp();
 				// and now send the correct headers
-				if( HttpCache::httpConditional( $timestamp ))
+				if( HttpCache::httpConditional( $timestamp, $this->getCacheTimeSeconds()))
 					$sendOutput = false;
 					
 				header( "Last-Modified: ".gmdate('D, d M Y H:i:s', $timestamp).' GMT');	

Modified: plog/trunk/class/summary/view/summaryrssview.class.php
===================================================================
--- plog/trunk/class/summary/view/summaryrssview.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/summary/view/summaryrssview.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -12,9 +12,9 @@
 
         function SummaryRssView( $profile, $data = Array())
         {
-			if( $profile == "" ) {
+			if( $profile == "" || $profile == "blogs_" ) {
 				$config =& Config::getConfig();
-				$profile = $config->getValue( "default_rss_profile", "rss090" );
+				$profile .= $config->getValue( "default_rss_profile", "rss090" );
 			}
             $this->SummaryCachedView( $profile, $data );			
 				
@@ -26,13 +26,21 @@
         function generateTemplate()
         {
             $templateService = new TemplateService();
-            $this->_template = $templateService->CachedTemplate( $this->_templateName, "summary/rss" );        
+            $this->_template = $templateService->customTemplate( $this->_templateName, "summary/rss", true );
+            
+            // by default, these compiled files would be saved and cached to tmp/summary/rss but that's too
+            // many folders so we'll overwrite the default settings set by TemplateService::customTemplate()
+            // and save the files to tmp/summary/ with the other summary pages
+			$config =& Config::getConfig();
+			$templateTmpFolder = $config->getValue( "temp_folder" ).'/summary';
+			$this->_template->cache_dir = $templateTmpFolder;
+			$this->_template->compile_dir = $templateTmpFolder;
         }		
 
         function sendUncachedOutput()
         {
             //$templateService = new TemplateService();
-            //$template = $templateService->Template( $this->_profile, "summary/rss" );
+            //$template = $templateService->Template( $this->_profile, "summary/rss" );           
 
             $config =& Config::getConfig();
             $this->_locale =& Locales::getLocale( $config->getValue("default_locale" ));

Modified: plog/trunk/class/template/template.class.php
===================================================================
--- plog/trunk/class/template/template.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/template/template.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -18,6 +18,11 @@
 
     include_once( PLOG_CLASS_PATH.'class/template/smarty/Smarty.class.php' );
     include_once( PLOG_CLASS_PATH.'class/config/config.class.php' );
+	
+	// Smarty dynamic block function
+	function smarty_block_dynamic($param, $content, &$smarty) {
+    	return $content;
+	}	
 
     /**
      * \ingroup Template
@@ -83,6 +88,9 @@
             $this->compile_check = $config->getValue( 'template_compile_check', true );
             // this helps if php is running in 'safe_mode'
             $this->use_sub_dirs = false;
+
+			// register dynamic block for every template instance
+			$this->register_block('dynamic', 'smarty_block_dynamic', false);            
         }
 
         /**

Modified: plog/trunk/class/view/resourceserverview.class.php
===================================================================
--- plog/trunk/class/view/resourceserverview.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/view/resourceserverview.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -7,6 +7,7 @@
 	define( 'RESOURCE_VIEW_MODE_DEFAULT', '' );
 	define( 'RESOURCE_VIEW_MODE_PREVIEW', 'preview' );
 	define( 'RESOURCE_VIEW_MODE_MEDIUM', 'medium' );
+    define( 'DEFAULT_HTTP_CACHE_LIFETIME', '86400');
 
     /**
      * \ingroup View

Modified: plog/trunk/class/view/smartyview.class.php
===================================================================
--- plog/trunk/class/view/smartyview.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/view/smartyview.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -149,7 +149,23 @@
 
 			return( $httpCacheEnabled );
 		}
+		
+		function getCacheTimeSeconds()
+		{
+			$config =& Config::getConfig();
+			
+			$cacheTime = $config->getValue( "template_cache_lifetime" );
+			
+			if( $cacheTime == "" || !is_numeric($cacheTime))
+				$cacheTime = 1; // [almost] no value, just one second of caching
+			if( $cacheTime == -1 )
+				$cacheTime = 788400000; // a veeery long time!
+			if( $cacheTime > 788400000)
+				$cacheTime = 788400000;
 
+			return( $cacheTime );
+		}
+
         /**
 		 * Renders the view using the Smarty template object that we created in the constructor. This method
 		 * sends data to the client so it should be called as the last bit of code in our custom classes
@@ -171,7 +187,8 @@
 				// some debug information
 				$timestamp = $this->_template->getCreationTimestamp();
 				// and now send the correct headers
-				if( HttpCache::httpConditional( $timestamp ))
+				
+				if( HttpCache::httpConditional( $timestamp, $this->getCacheTimeSeconds()))
 					$sendOutput = false;
 					
 				$header = "Last-Modified: ".gmdate('D, d M Y H:i:s', $timestamp).' GMT';

Modified: plog/trunk/class/view/view.class.php
===================================================================
--- plog/trunk/class/view/view.class.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/class/view/view.class.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -81,6 +81,11 @@
 			// and no form has caused any success yet either!
 			$this->setValue( "formIsSuccess", false );
 			
+			// let's send an HTTP 200 header response... If somebody wants to overwrite it later
+			// on, php should keep in mind that the valid one will be the last one so it is
+			// fine to do this more than once and twice
+			$this->addHeaderResponse( "HTTP/1.0 200 OK" );
+			
 			// initialize a request object, in case it is needed somewhere
 			$this->_request = new Request( HttpVars::getRequest());
         }

Modified: plog/trunk/config/config.properties.php
===================================================================
--- plog/trunk/config/config.properties.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/config/config.properties.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -2,9 +2,8 @@
 #
 # database settings
 #
-$config["db_host"] = "localhost";
-$config["db_username"] = "root";
-$config["db_password"] = "1796sz";
-$config["db_database"] = "plog_11_test";
-$config["db_prefix"] = "plog_";
-?>
\ No newline at end of file
+$config["db_host"] = "";
+$config["db_username"] = "";
+$config["db_password"] = "";
+$config["db_database"] = "";
+$config["db_prefix"] = "";

Copied: plog/trunk/imgs/admin/icon_archive-16.png (from rev 2357, plog/branches/plog-1.0.2/imgs/admin/icon_archive-16.png)


Property changes on: plog/trunk/imgs/admin/icon_archive-16.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Copied: plog/trunk/imgs/admin/icon_home-24.png (from rev 2357, plog/branches/plog-1.0.2/imgs/admin/icon_home-24.png)


Property changes on: plog/trunk/imgs/admin/icon_home-24.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: plog/trunk/locale/locale_ca_ES.php
===================================================================
--- plog/trunk/locale/locale_ca_ES.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/locale/locale_ca_ES.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -631,7 +631,7 @@
 $messages['error_invalid_user'] = 'L\'identificador d\'usuari no és correcte o l\'usuari no existeix';
 $messages['error_updating_user'] = 'Hi ha hagut un error actualitzant les preferències d\'usuari. Comprova les dades i prova-ho de nou';
 $messages['blogs'] = 'Blocs';
-$messages['user_blogs_helps'] = 'Blocs d\'aquest usuari o als quals pot tenir accés';
+$messages['user_blogs_help'] = 'Blocs d\'aquest usuari o als quals pot tenir accés';
 $messages['site_admin'] = 'Administrador';
 $messages['site_admin_help'] = 'Aquest usuari té privilegis d\'administrador i pot anar a la secció "Administració" i realitzar les tasques administratives pertinents';
 $messages['user_updated_ok'] = 'Usuari "%s" actualitzat correctament';
@@ -918,9 +918,7 @@
 $messages['trackbacks'] = 'Retroenllaços';
 $messages['menu'] = 'Menú';
 $messages['albums'] = 'Àlbums';
-
-// Traducció realitzada per Ramon Forns (www.sopadelletres.com)
-// This translation was made by Ramon Forns (www.sopadelletres.com)
-// Ets lliure d'usar-la i modificar-la! Feel free to use it and modify at your own.
-
+$messages['xmlrpc_ping_ok'] = 'Ping XMLRPC enviat correctament: ';
+$messages['error_sending_xmlrpc_ping'] = 'Hi ha hagut un error enviant el ping XMLRPC a: ';
+$messages['error_sending_xmlrpc_ping_message'] = 'Hi ha hagut un error enviant el ping XMLRPC: ';
 ?>
\ No newline at end of file


Property changes on: plog/trunk/locale/locale_ca_ES.php
___________________________________________________________________
Name: svn:executable
   - *

Modified: plog/trunk/locale/locale_de_DE.php
===================================================================
--- plog/trunk/locale/locale_de_DE.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/locale/locale_de_DE.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -118,7 +118,7 @@
 $messages['error_dont_belong_to_any_blog'] = 'Entschuldigung, f&uuml;r Sie ist noch kein Weblog freigeschaltet.';
 $messages['logout_message'] = 'Sie sind erfolgreich abgemeldet worden.';
 $messages['logout_message_2'] = 'Klicken Sie <a href="%1$s">hier</a> um zu "%2$s" zu gelangen.</a>.';
-$messages['error_access_forbidden'] = 'Der Zugang ist gesch&uuml;tzt, Sie m&uuml;ssen sich erst <a href=\"admin.php\">anmelden</a>.';
+$messages['error_access_forbidden'] = 'Der Zugang ist gesch&uuml;tzt, Sie m&uuml;ssen sich erst <a href="admin.php">anmelden</a>.';
 $messages['username'] = 'Benutzername';
 $messages['password'] = 'Kennwort';
 
@@ -417,7 +417,7 @@
 $messages['error_incorrect_album_id'] = 'Die ID des Albums ist ung&uuml;ltig.';
 $messages['error_base_storage_folder_missing_or_unreadable'] = 'pLog kann die Verzeichnisse nicht erstellen, in denen die Ressourcen gespeichert werden sollen. Dies kann verschiedene Ursachen haben. Eventuell wird PHP bei Ihnen im "safe mode" ausgef&uuml;hrt, oder Sie haben nicht die erforderlichen Berechtigungen. Sie k&ouml;nnen die Operation eventuell manuell ausf&uuml;hren, indem Sie die folgenden Verzeichnisse anlegen: <br/><br/>%s<br/><br/>. Wenn diese Verzeichnisse bereits existieren, stellen Sie sicher, dass Lese- und Schreibzugriff vorhanden ist.';
 $messages['items_deleted_ok'] = '%s Positionen erfolgreich gel&ouml;scht.';
-$messages['error_album_has_children'] = 'Das Album "%s" konnte nicht gel&ouml;scht werden, da es Unteralben enth&auml;lt. Wenn Sie das Album wirklich l&ouml;schen möchten, entfernen Sie zuerst die Unteralben und versuchen es anschlie&szlig;end erneut.';
+$messages['error_album_has_children'] = 'Das Album "%s" konnte nicht gel&ouml;scht werden, da es Unteralben enth&auml;lt. Wenn Sie das Album wirklich l&ouml;schen m&ouml;chten, entfernen Sie zuerst die Unteralben und versuchen es anschlie&szlig;end erneut.';
 $messages['item_deleted_ok'] = 'Position "%s" erfolgreich gel&ouml;scht.';
 $messages['error_deleting_album'] = 'Beim L&ouml;schen des Albums "%s" ist ein Fehler aufgetreten.';
 $messages['error_deleting_album2'] = 'Beim L&ouml;schen des Albums mit der ID "%s" ist ein Fehler aufgetreten.';
@@ -612,7 +612,7 @@
 $messages['error_invalid_user'] = 'Die Benutzer-ID ist nicht g&uuml;ltig, oder der Benutzer existiert nicht.';
 $messages['error_updating_user'] = 'Beim Aktualisieren der Benutzereinstellungen ist ein Fehler aufgetreten. Bitte &uuml;berpr&uuml;fen Sie Ihre Eingaben.';
 $messages['blogs'] = 'Blogs';
-$messages['user_blogs_helps'] = 'Blogs des Benutzers oder zu denen der Benutzer Zugang hat.';
+$messages['user_blogs_help'] = 'Blogs des Benutzers oder zu denen der Benutzer Zugang hat.';
 $messages['site_admin'] = 'Administrator';
 $messages['site_admin_help'] = 'Entscheiden Sie, ob der Benutzer Administrationsrechte zugewiesen bekommt und Zugang zum Administrationsbereich bekommt, um dort Verwaltungsaufgaben durchf&uuml;hren zu d&uuml;rfen.';
 $messages['user_updated_ok'] = 'Benutzer "%s" erfolgreich aktualisiert';
@@ -885,7 +885,7 @@
 $messages['password_updated_ok'] = 'Ihr Kennwort wurde erfolgreich aktualisiert.';
 
 // Suggested by BCSE, some useful messages that not available in official locale
-$messages['upgrade_information'] = 'Diese Seite wird unsch&ouml;n dargestellt, da Sie einen Browser benutzen, der aktelle Web-Standards nicht unterstützt. Um diese Seite richtig darzustellen, empfehlen wir Ihnen den Browser zu <a href="http://www.webstandards.org/upgrade/" title="The Web Standards Project\'s Browser Upgrade initiative">aktualisieren</a>. Dies ist kostenlos und wird Sie nicht viel Zeit kosten.';
+$messages['upgrade_information'] = 'Diese Seite wird unsch&ouml;n dargestellt, da Sie einen Browser benutzen, der aktelle Web-Standards nicht unterst&uuml;tzt. Um diese Seite richtig darzustellen, empfehlen wir Ihnen den Browser zu <a href="http://www.webstandards.org/upgrade/" title="The Web Standards Project\'s Browser Upgrade initiative">aktualisieren</a>. Dies ist kostenlos und wird Sie nicht viel Zeit kosten.';
 $messages['jump_to_navigation'] = 'Zur Navigation wechseln.';
 $messages['comment_email_never_display'] = 'Zeilenumbr&uuml;che und Abs&auml;tze werden automatisch hinzugef&uuml;gt. Die E-Mail Adresse wird nicht angezeigt.';
 $messages['comment_html_allowed'] = '<acronym title="Hypertext Markup Language">HTML</acronym> erlaubt: &lt;<acronym title="Hyperlink">a</acronym> href=&quot;&quot; title=&quot;&quot; rel=&quot;&quot;&gt; &lt;<acronym title="Acronym Description">acronym</acronym> title=&quot;&quot;&gt; &lt;<acronym title="Quote">blockquote</acronym> cite=&quot;&quot;&gt; &lt;<acronym title="Strike">del</acronym>&gt; &lt;<acronym title="Italic">em</acronym>&gt; &lt;<acronym title="Underline">ins</acronym>&gt; &lt;<acronym title="Bold">strong</acronym>&gt;';


Property changes on: plog/trunk/locale/locale_de_DE.php
___________________________________________________________________
Name: svn:executable
   - *

Modified: plog/trunk/locale/locale_en_UK.php
===================================================================
--- plog/trunk/locale/locale_en_UK.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/locale/locale_en_UK.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -206,6 +206,8 @@
 $messages['text_help'] = 'Text of the post. This part will always appear in the front page';
 $messages['extended_text'] = 'Extended Text';
 $messages['extended_text_help'] = 'Extended text of the post. This part can optionally appear only in the post page or in the main page. See the blog settings for more information';
+$messages['trackback_urls'] = 'Real Trackback Urls';
+$messages['trackback_urls_help'] = 'If the article you want to send the trackback does not support Trackback Auto-Discover mechanism, please put its real trackback url here and use the new line to seperate different urls.';
 $messages['post_slug'] = 'Slug';
 $messages['post_slug_help'] = 'The slug will be used to generate nice permanent links';
 $messages['date'] = 'Date';
@@ -234,6 +236,10 @@
 $messages['post_added_not_published'] = 'Post added successfully but not published';
 $messages['post_added_ok'] = 'Post added successfully.';
 $messages['send_notifications_ok'] = 'A notification will be sent every time there is a new comment or trackback.';
+$messages['bookmarklet'] = "Bookmarklet";
+$messages['bookmarklet_help'] = "Drag this link to your toolbar or right-click it and choose Add to Favorites or Bookmark.";
+$messages['blogit_to_plog'] = "Blog It to pLog!";
+$messages['original_post'] = "(Original Post)";
 
 // send trackbacks
 $messages['error_sending_trackbacks'] = 'There was an error sending the following trackbacks';
@@ -357,6 +363,7 @@
 $messages['error_adding_link'] = 'There was an error adding the link. Please check the data and try again';
 $messages['error_invalid_url'] = 'The address is not correct';
 $messages['link_added_ok'] = 'Link "%s" was successfully added';
+$messages['bookmarkit_to_plog'] = "Bookmark It to pLog!";
 
 // update link
 $messages['error_updating_link'] = 'There was an error updating the link. Please check the data and try again';
@@ -612,7 +619,7 @@
 $messages['error_invalid_user'] = 'The user identifier is not correct or the user does not exist';
 $messages['error_updating_user'] = 'There was an error updating the user settings. Please check the data and try again';
 $messages['blogs'] = 'Blogs';
-$messages['user_blogs_helps'] = 'Blogs which this user currently owns or where this user has access';
+$messages['user_blogs_help'] = 'Blogs which this user currently owns or where this user has access';
 $messages['site_admin'] = 'Administrator';
 $messages['site_admin_help'] = 'Whether this user has administrator privileges and is allowed to see the "Administration" area and perform administrative tasks';
 $messages['user_updated_ok'] = 'User "%s" updated successfully';
@@ -795,7 +802,7 @@
 $messages['help_thumbnail_generator_user_smoothing_algorithm'] = 'Algorithm used to smooth thumbnails. Only used when the thumbnail method is GD [Default = PHP Imagecopyresampled]';
 $messages['help_resources_quota'] = 'Global resource quota for blogs in bytes (i.e. 5242880 Bytes = 5MB), or set to 0 for unlimited quota [Default = 0]';
 $messages['help_resource_server_http_cache_enabled'] = 'Enable support for the "If-Modified-Since" header and HTTP conditional requests. Enable for increased bandwidth savings  [Default = No]';
-$messages['help_resource_server_http_cache_lifetime'] = 'Time in microseconds that clients should use the cached version of resources [Default = 9999999]';
+$messages['help_resource_server_http_cache_lifetime'] = 'Time in seconds that clients should use the cached version of resources [Default = 86400]';
 $messages['same_as_image'] = 'Same as original image';
 // search
 $messages['help_search_engine_enabled'] = 'Enable the search engine  [Default = Yes]';
@@ -900,6 +907,9 @@
 $messages['menu'] = 'Menu';
 $messages['albums'] = 'Albums';
 $messages['admin'] = 'Admin';
+$messages['xmlrpc_ping_ok'] = 'XMLRPC Ping sent successfully: ';
+$messages['error_sending_xmlrpc_ping'] = 'There was an error sending the XMLRPC ping to: ';
+$messages['error_sending_xmlrpc_ping_message'] = 'There was an error sending the XMLRPC ping: ';
 
 //
 // new strings for 1.1 -- no need to translate yet!
@@ -919,7 +929,6 @@
 $messages['blogs_purged_ok'] = 'Blogs purged successfully';
 $messages['help_use_http_accept_language_detection'] = 'Most web browsers such as Mozilla Firefox, Safari or Internet Explorer send at least one language code the user <i>should</i> understand. If this feature is activated, pLog tries to serve the user with the requested language if it\'s available. [Default = No]';
 
-
 $messages['error_invalid_blog_category'] = 'Invalid blog category';
 $messages['error_adding_blog_category'] = 'There was an error adding the blog category';
 $messages['newBlogCategory'] = 'New Blog Category';
@@ -931,4 +940,4 @@
 $messages['blog_categories_deleted_ok'] = '%s blog categories deleted successfully';
 $messages['error_deleting_blog_category2'] = 'There was an error removing the blog category with id %s';
 
-?>
+?>
\ No newline at end of file

Modified: plog/trunk/locale/locale_es_ES.php
===================================================================
--- plog/trunk/locale/locale_es_ES.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/locale/locale_es_ES.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -187,7 +187,7 @@
 $messages['emailSettings'] = 'Email';
 $messages['uploadSettings'] = 'Transferencias';
 $messages['helpersSettings'] = 'Herramientas';
-$messages['interfacesSettings'] = 'Interfícies';
+$messages['interfacesSettings'] = 'Interfaces';
 $messages['securitySettings'] = 'Seguridad';
 $messages['bayesianSettings'] = 'Filtro Bayesiano';
 $messages['resourcesSettings'] = 'Ficheros';
@@ -610,7 +610,7 @@
 $messages['error_invalid_user'] = 'El nombre de usuario no es correcto o no existe';
 $messages['error_updating_user'] = 'Hubo un error actualizando el usuario. Compruebe los datos y vuélvalo a intentar';
 $messages['blogs'] = 'Bitácoras';
-$messages['user_blogs_helps'] = 'Bitácoras a las que el usuario tiene acceso como usuario o como propietario de la bitácora';
+$messages['user_blogs_help'] = 'Bitácoras a las que el usuario tiene acceso como usuario o como propietario de la bitácora';
 $messages['site_admin'] = 'Administrador';
 $messages['site_admin_help'] = 'Dar permisos de administrador a este usuario de forma que pueda acceder a la sección de "Administración"';
 $messages['user_updated_ok'] = 'El usuario "%s" fue actualizado correctamente';
@@ -897,4 +897,7 @@
 $messages['menu'] = 'Menú';
 $messages['albums'] = 'Albums';
 $messages['admin'] = 'Administración';
+$messages['xmlrpc_ping_ok'] = 'Ping XMLRPC enviado correctamente: ';
+$messages['error_sending_xmlrpc_ping'] = 'Hubo un error enviando el ping XMLRPC a: ';
+$messages['error_sending_xmlrpc_ping_message'] = 'Hubo un error enviando el ping XMLRPC: ';
 ?>
\ No newline at end of file

Modified: plog/trunk/locale/locale_fi_FI.php
===================================================================
--- plog/trunk/locale/locale_fi_FI.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/locale/locale_fi_FI.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -613,7 +613,7 @@
 $messages['error_invalid_user'] = 'Käyttäjän tunnus ei ole oikea tai käyttäjää ei ole olemassa';
 $messages['error_updating_user'] = 'Käyttäjän asetusten päivittämisessä tapahtui virhe. Ole hyvä ja tarkasta antamasi tiedot';
 $messages['blogs'] = 'Blogit';
-$messages['user_blogs_helps'] = 'Blogit jotka käyttäjä omistaa tai hänellä on kirjoitusoikeus';
+$messages['user_blogs_help'] = 'Blogit jotka käyttäjä omistaa tai hänellä on kirjoitusoikeus';
 $messages['site_admin'] = 'Administrator';
 $messages['site_admin_help'] = 'Onko käyttäjällä pääkäyttäjäoikeudet ja saako saa nähdä "Administration" -alueen ja suorittaa pääkäyttäjätehtäviä';
 $messages['user_updated_ok'] = 'Käyttäjä "%s" päivitettiin onnistuneesti';


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

Modified: plog/trunk/locale/locale_fr_FR.php
===================================================================
--- plog/trunk/locale/locale_fr_FR.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/locale/locale_fr_FR.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -604,7 +604,7 @@
 $messages["error_invalid_user"] = "ID du Membre invalide ou le Membre n'exite pas.";
 $messages["error_updating_user"] = "Erreur en mettant à jour les paramètres Membre. Vérifiez les données entrées et recommencez";
 $messages["blogs"] = "Blogs";
-$messages["user_blogs_helps"] = "Blogs du Membre ou ceux auxquels il a accès";
+$messages["user_blogs_help"] = "Blogs du Membre ou ceux auxquels il a accès";
 $messages["site_admin"] = "Administrateur";
 $messages["site_admin_help"] = "Si cet Membre est administrateur, il pourra accéder à la partie \"Administration\" et accomplir des taches administratives.";
 $messages["user_updated_ok"] = "Membre \"%s\" mis à jour";

Modified: plog/trunk/locale/locale_it_IT.php
===================================================================
--- plog/trunk/locale/locale_it_IT.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/locale/locale_it_IT.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -1,12 +1,12 @@
 <?php
 // set this to the encoding that should be used to display the pages correctly
-$messages['encoding'] = 'iso-8859-1';
+$messages['encoding'] = 'iso-8859-15';
 $messages['locale_description'] = 'File di localizzazione italiano per pLog';
 // locale format, see Locale::formatDate for more information
 $messages['date_format'] = '%d/%m/%Y %H:%M';
 
 // days of the week
-$messages['days'] = Array( 'Domenica', 'Lunedi', 'Martedi', 'Mercoledi', 'Giovedi', 'Venerdi', 'Sabato' );
+$messages['days'] = Array( 'Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato' );
 // -- compatibility, do not touch -- //
 $messages['Monday'] = $messages['days'][1];
 $messages['Tuesday'] = $messages['days'][2];
@@ -42,9 +42,9 @@
 $messages['October'] = $messages['months'][9];
 $messages['November'] = $messages['months'][10];
 $messages['December'] = $messages['months'][11];
-$messages['message'] = 'Message';
-$messages['error'] = 'Error';
-$messages['date'] = 'Date';
+$messages['message'] = 'Messaggio';
+$messages['error'] = 'Errore';
+$messages['date'] = 'Data';
 
 // miscellaneous texts
 $messages['of'] = 'di';
@@ -58,7 +58,7 @@
 $messages['search_s'] = 'Cerca';
 $messages['search_this_blog'] = 'Cerca questo blog:';
 $messages['about_myself'] = 'Chi sono?';
-$messages['permalink_title'] = 'Permanent link agli archivi';
+$messages['permalink_title'] = 'Link permanente agli archivi';
 $messages['permalink'] = 'Permalink';
 $messages['posted_by'] = 'Inviato da';
 $messages['reply'] = 'Replica';
@@ -67,43 +67,43 @@
 $messages['add_comment'] = 'Aggiungi commento';
 $messages['comment_topic'] = 'Argomento';
 $messages['comment_text'] = 'Testo';
-$messages['comment_username'] = 'Tuo nome';
-$messages['comment_email'] = 'Tua e-mail (se ne hai una)';
-$messages['comment_url'] = 'Tuo sito (se ne hai uno)';
+$messages['comment_username'] = 'Il tuo nome';
+$messages['comment_email'] = 'La tua e-mail (se ne hai una)';
+$messages['comment_url'] = 'Il tuo sito (se ne hai uno)';
 $messages['comment_send'] = 'Invia';
 $messages['comment_added'] = 'Commento registrato!';
-$messages['comment_add_error'] = 'Erroro in inserimento del commento';
+$messages['comment_add_error'] = 'Errore nell\'inserimento del commento';
 $messages['article_does_not_exist'] = 'L\'articolo non esiste';
-$messages['no_posts_found'] = 'No posts were found';
-$messages['user_has_no_posts_yet'] = 'L\'utente non ha ancora nessun post';
+$messages['no_posts_found'] = 'Nessun articolo trovato';
+$messages['user_has_no_posts_yet'] = 'L\'utente non ha ancora nessun articolo';
 $messages['back'] = 'Indietro';
-$messages['post'] = 'post';
-$messages['trackbacks_for_article'] = 'Trackbacks per l\'articolo: ';
+$messages['post'] = 'articolo';
+$messages['trackbacks_for_article'] = 'Trackback per l\'articolo: ';
 $messages['trackback_excerpt'] = 'Brano';
 $messages['trackback_weblog'] = 'Weblog';
-$messages['search_results'] = 'Risultati Ricerca';
-$messages['search_matching_results'] = 'I seguenti posts soddisfano i criteri di ricerca: ';
-$messages['search_no_matching_posts'] = 'Nessun post trovato';
-$messages['read_more'] = '(Ancora)';
+$messages['search_results'] = 'Risultati della Ricerca';
+$messages['search_matching_results'] = 'I seguenti articoli soddisfano i criteri di ricerca: ';
+$messages['search_no_matching_posts'] = 'Nessun articolo trovato';
+$messages['read_more'] = '(Continua)';
 $messages['syndicate'] = 'Syndicate';
-$messages['main'] = 'Main';
-$messages['about'] = 'About';
-$messages['download'] = 'Download';
+$messages['main'] = 'Principale';
+$messages['about'] = 'Informazioni';
+$messages['download'] = 'Scarica';
 
 ////// error messages /////
-$messages['error_fetching_article'] = 'L\'articolo richiesto non puo essere trovato.';
+$messages['error_fetching_article'] = 'L\'articolo richiesto non può essere trovato.';
 $messages['error_fetching_articles'] = 'Impossibile selezionare gli articoli';
-$messages['error_trackback_no_trackback'] = 'Nonb sono presenti trackbacks per l\'articolo.';
-$messages['error_incorrect_article_id'] = 'Identificativo Articolo non corretto.';
-$messages['error_incorrect_blog_id'] = 'Identificativo blog non corretto.';
+$messages['error_trackback_no_trackback'] = 'Non sono presenti trackback per l\'articolo.';
+$messages['error_incorrect_article_id'] = 'Identificativo dell\'articolo non corretto.';
+$messages['error_incorrect_blog_id'] = 'Identificativo del blog non corretto.';
 $messages['error_comment_without_text'] = 'Devi almeno inserire del testo.';
 $messages['error_comment_without_name'] = 'Devi almeno inserire il tuo nome o nickname.';
 $messages['error_adding_comment'] = 'Errore durante l\'inserimento del commento.';
 $messages['error_incorrect_parameter'] = 'Parametri errati.';
 $messages['error_parameter_missing'] = 'Manca un parametro nella richiesta.';
-$messages['error_comments_not_enabled'] = 'La funzione di commento e disabilitata su questo sito.';
+$messages['error_comments_not_enabled'] = 'La funzione di commento è disabilitata su questo sito.';
 $messages['error_incorrect_search_terms'] = 'I termini di ricerca non sono validi';
-$messages['error_no_search_results'] = 'Non ci sono item che soddisfano i criteri di ricerca';
+$messages['error_no_search_results'] = 'Non ci sono elementi che soddisfano i criteri di ricerca';
 $messages['error_no_albums_defined'] = 'Non ci sono album in questo blog.';
 
 /////////////////                                          //////////////////
@@ -112,123 +112,132 @@
 
 // login page
 $messages['login'] = 'Login';
-$messages['welcome_message'] = 'Benvenuti in pLog';
-$messages['error_incorrect_username_or_password'] = 'Utente e password errate.';
+$messages['welcome_message'] = 'Benvenuto in pLog';
+$messages['error_incorrect_username_or_password'] = 'Utente e password errati.';
 $messages['error_dont_belong_to_any_blog'] = 'Spiacente ma non appartieni ancora a nessun blog.';
-$messages['logout_message'] = 'Log out effettuata con successo.';
+$messages['logout_message'] = 'Log out effettuato con successo.';
 $messages['logout_message_2'] = 'Clicca <a href="%1$s">qui</a> per andare %2$s</a>.';
-$messages['error_access_forbidden'] = 'Accesso negato. devi prima loggarti.';
+$messages['error_access_forbidden'] = 'Accesso negato. Devi prima effettuare il login.';
 $messages['username'] = 'Utente';
 $messages['password'] = 'Password';
 
 // dashboard
 $messages['dashboard'] = 'Cruscotto';
+$messages['recent_articles'] = 'Ultimi articoli';
+$messages['recent_comments'] = 'Ultimi commenti';
+$messages['recent_trackbacks'] = 'Ultimi trackback';
+$messages['blog_statistics'] = 'Statistiche del blog';
+$messages['total_posts'] = 'Totale articoli';
+$messages['total_comments'] = 'Totale commenti';
+$messages['total_trackbacks'] = 'Totale trackback';
+$messages['total_viewed'] = 'Totale visualizzazioni articoli';
+$messages['in'] = 'In';
 
 // menu options
-$messages['newPost'] = 'Nuovo Post';
+$messages['newPost'] = 'Nuovo articolo';
 $messages['Manage'] = 'Gestione';
-$messages['managePosts'] = 'Gestione Posts';
-$messages['editPosts'] = 'Posts';
-$messages['editArticleCategories'] = 'categorie';
-$messages['newArticleCategory'] = 'Nuova Categoria';
-$messages['manageLinks'] = 'Gestione Links';
-$messages['editLinks'] = 'Links';
-$messages['newLink'] = 'Neuovo Link';
-$messages['editLink'] = 'Edita Link';
-$messages['editLinkCategories'] = 'Classificazione Link';
-$messages['newLinkCategory'] = 'Nuova Classificazione Link';
-$messages['editLinkCategory'] = 'Edita Classificazione Link';
-$messages['manageCustomFields'] = 'Manage Custom Fields';
-$messages['blogCustomFields'] = 'Campi Personalizzati';
-$messages['newCustomField'] = 'Nuovo campo Personalizzato';
-$messages['resourceCenter'] = 'Centro Risorse';
+$messages['managePosts'] = 'Gestione articoli';
+$messages['editPosts'] = 'Articoli';
+$messages['editArticleCategories'] = 'Categorie';
+$messages['newArticleCategory'] = 'Nuova categoria';
+$messages['manageLinks'] = 'Gestione link';
+$messages['editLinks'] = 'Link';
+$messages['newLink'] = 'Nuovo link';
+$messages['editLink'] = 'Modifica link';
+$messages['editLinkCategories'] = 'Classificazione link';
+$messages['newLinkCategory'] = 'Nuova Classificazione link';
+$messages['editLinkCategory'] = 'Modifica classificazione link';
+$messages['manageCustomFields'] = 'Gestisci i campi personalizzati';
+$messages['blogCustomFields'] = 'Campi personalizzati';
+$messages['newCustomField'] = 'Nuovo campo personalizzato';
+$messages['resourceCenter'] = 'Centro risorse';
 $messages['resources'] = 'Risorse';
-$messages['newResourceAlbum'] = 'Nuovo Album';
-$messages['newResource'] = 'Nuoova Risorsa';
-$messages['controlCenter'] = 'Centro di Controllo';
+$messages['newResourceAlbum'] = 'Nuovo album';
+$messages['newResource'] = 'Nuova risorsa';
+$messages['controlCenter'] = 'Centro di controllo';
 $messages['manageSettings'] = 'Impostazioni';
-$messages['blogSettings'] = 'Impostazioni Blog';
-$messages['userSettings'] = 'Impostazioni Utente';
-$messages['pluginCenter'] = 'Centro Plugin';
+$messages['blogSettings'] = 'Impostazioni blog';
+$messages['userSettings'] = 'Impostazioni utente';
+$messages['pluginCenter'] = 'Centro plugin';
 $messages['Stats'] = 'Statistiche';
-$messages['manageBlogUsers'] = 'Gestione Utenti Blog';
-$messages['newBlogUser'] = 'Nuovo Utente Blog';
-$messages['showBlogUsers'] = 'Utenti Blog';
-$messages['manageBlogTemplates'] = 'Template Blog';
-$messages['newBlogTemplate'] = 'Nuovo Template Blog';
-$messages['blogTemplates'] = 'Template Blog';
+$messages['manageBlogUsers'] = 'Gestione utenti blog';
+$messages['newBlogUser'] = 'Nuovo utente blog';
+$messages['showBlogUsers'] = 'Utenti blog';
+$messages['manageBlogTemplates'] = 'Cornici del blog';
+$messages['newBlogTemplate'] = 'Nuova cornice di blog';
+$messages['blogTemplates'] = 'Cornici di blog';
 $messages['adminSettings'] = 'Amministrazione';
 $messages['Users'] = 'Utenti';
-$messages['createUser'] = 'Creazione Utente';
-$messages['editSiteUsers'] = 'Utenti Sito';
-$messages['Blogs'] = 'Gestione Blog';
-$messages['createBlog'] = 'Create Blog';
-$messages['editSiteBlogs'] = 'Blogs';
-$messages['Locales'] = 'Gestione Linguaggi';
-$messages['newLocale'] = 'Nuovo Linguaggio';
-$messages['siteLocales'] = 'Linguaggi Sito';
-$messages['Templates'] = 'Gestione Template';
-$messages['newTemplate'] = 'Nuovo Template';
-$messages['siteTemplates'] = 'template Sito';
-$messages['GlobalSettings'] = 'Impostazioni Globali';
+$messages['createUser'] = 'Creazione utente';
+$messages['editSiteUsers'] = 'Utenti sito';
+$messages['Blogs'] = 'Gestione blog';
+$messages['createBlog'] = 'Crea blog';
+$messages['editSiteBlogs'] = 'Blog';
+$messages['Locales'] = 'Gestione linguaggi';
+$messages['newLocale'] = 'Nuovo linguaggio';
+$messages['siteLocales'] = 'Linguaggi sito';
+$messages['Templates'] = 'Gestione cornici';
+$messages['newTemplate'] = 'Nuova cornice';
+$messages['siteTemplates'] = 'Cornici sito';
+$messages['GlobalSettings'] = 'Impostazioni globali';
 $messages['editSiteSettings'] = 'Generale';
-$messages['summarySettings'] = 'Summario';
-$messages['templateSettings'] = 'Template';
-$messages['urlSettings'] = 'URLs';
+$messages['summarySettings'] = 'Sommario';
+$messages['templateSettings'] = 'Cornici';
+$messages['urlSettings'] = 'URL';
 $messages['emailSettings'] = 'Email';
-$messages['uploadSettings'] = 'Uploads';
-$messages['helpersSettings'] = 'Aiuti Esterni';
+$messages['uploadSettings'] = 'Upload';
+$messages['helpersSettings'] = 'Programmi esterni';
 $messages['interfacesSettings'] = 'Interfacce';
 $messages['securitySettings'] = 'Sicurezza';
-$messages['bayesianSettings'] = 'Filtro Bayesian';
+$messages['bayesianSettings'] = 'Filtro bayesiano';
 $messages['resourcesSettings'] = 'Risorse';
-$messages['searchSettings'] = 'Cesta';
+$messages['searchSettings'] = 'Impostazioni di ricerca';
 $messages['cleanUpSection'] = 'Pulizia';
 $messages['cleanUp'] = 'Pulizia';
-$messages['editResourceAlbum'] = 'Edita Album';
-$messages['resourceInfo'] = 'Edita Risorsa';
-$messages['editBlog'] = 'Edita Blog';
+$messages['editResourceAlbum'] = 'Modifica album';
+$messages['resourceInfo'] = 'Modifica risorsa';
+$messages['editBlog'] = 'Modifica blog';
 $messages['Logout'] = 'Logout';
 
 // new post
 $messages['topic'] = 'Argomento';
-$messages['topic_help'] = 'Titolo del post';
+$messages['topic_help'] = 'Titolo dell\'articolo';
 $messages['text'] = 'Testo';
-$messages['text_help'] = 'Testo del post. Questaparte apaprira sempre nella pagina iniziale';
+$messages['text_help'] = 'Testo dell\'articolo. Questa parte apparirà sempre nella pagina iniziale';
 $messages['extended_text'] = 'Testo esteso';
-$messages['extended_text_help'] = 'Testo esteso del post. Questa pare puo appearire nella pagina del post page o nella pagina iniziale. Fare riferimento alle impostazioni del blog.';
-$messages['post_slug'] = 'Interlinea';
-$messages['post_slug_help'] = 'L\'interlina sarautilizzata per rendere piu carino i link permanenti';
+$messages['extended_text_help'] = 'Testo esteso dell\'articolo. Questa parte può apparire nella pagina dell\'articolo  completo o nella pagina iniziale. Fare riferimento alle impostazioni del blog.';
+$messages['post_slug'] = 'Permalink Personalizzato';
+$messages['post_slug_help'] = 'Usa questo campo per migliorare la leggibilità del permalink';
 $messages['date'] = 'Data';
-$messages['post_date_help'] = 'Data in cui questo post dovra essere pubblicato';
+$messages['post_date_help'] = 'Data in cui questo articolo dovrà essere pubblicato';
 $messages['status'] = 'Stato';
-$messages['post_status_help'] = 'Selezionare uno di questi stati';
+$messages['post_status_help'] = 'Seleziona uno stato';
 $messages['post_status_published'] = 'Pubblicato';
 $messages['post_status_draft'] = 'Bozza';
 $messages['post_status_deleted'] = 'Cancellato';
 $messages['categories'] = 'Categorie';
-$messages['post_categories_help'] = 'Selezionare una o piu categorie';
-$messages['post_comments_enabled_help'] = 'Abilitare i commenti';
+$messages['post_categories_help'] = 'Seleziona una o più categorie';
+$messages['post_comments_enabled_help'] = 'Abilita i commenti';
 $messages['send_notification_help'] = 'Notifica nuovi commenti';
-$messages['send_trackback_pings_help'] = 'Invia trackbacks';
-$messages['send_xmlrpc_pings_help'] = 'Invia XMLRPC pings';
+$messages['send_trackback_pings_help'] = 'Invia trackback';
+$messages['send_xmlrpc_pings_help'] = 'Invia ping XMLRPC';
 $messages['save_draft_and_continue'] = 'Salva bozza';
-$messages['preview'] = 'Preview';
-$messages['add_post'] = 'Blogga questo!';
-$messages['error_saving_draft'] = 'Errore durante il salvataggiodella bozza';
+$messages['preview'] = 'Anteprima';
+$messages['add_post'] = 'Pubblica sul blog';
+$messages['error_saving_draft'] = 'Errore durante il salvataggio della bozza';
 $messages['draft_saved_ok'] = 'Bozza salvata';
-$messages['error_sending_request'] = 'Errore nell\'invio delal richiesta';
-$messages['error_no_category_selected'] = 'Selezionare almeno una categoria';
-$messages['error_missing_post_topic'] = 'Scrivere un arcometo per il post';
-$messages['error_missing_post_text'] = 'Scrivere il testo del post';
-$messages['error_adding_post'] = 'Errore in aggiunta del post';
-$messages['post_added_not_published'] = 'Post aaggiunto am non pubblicato';
-$messages['post_added_ok'] = 'Post aggiunto.';
-$messages['send_notifications_ok'] = 'Una notifica verra inviata per ciascun commento o trackback.';
+$messages['error_sending_request'] = 'Errore nell\'invio della richiesta';
+$messages['error_no_category_selected'] = 'Seleziona almeno una categoria';
+$messages['error_missing_post_topic'] = 'Inserisci un argomento per l\'articolo';
+$messages['error_missing_post_text'] = 'Scrivi il testo dell\'articolo';
+$messages['error_adding_post'] = 'Errore durante l\'aggiunta dell\'articolo';
+$messages['post_added_not_published'] = 'Articolo aggiunto ma non pubblicato';
+$messages['post_added_ok'] = 'Articolo aggiunto.';
+$messages['send_notifications_ok'] = 'Una notifica verrà inviata per ciascun commento o trackback.';
 
 // send trackbacks
-$messages['error_sending_trackbacks'] = 'Si e verificato un errore durante l\'invio dei seguenti trackback';
-$messages['send_trackbacks_help'] = 'Selezionare dai seguenti URL dove vuoi inviare il pig di trackback. Assicurarasi che i siti supportino il trackback.';
+$messages['error_sending_trackbacks'] = 'Si è verificato un errore durante l\'invio dei seguenti trackback';
+$messages['send_trackbacks_help'] = 'Seleziona dai seguenti URL dove vuoi inviare il ping di trackback. Assicurati che i siti supportino il trackback.';
 $messages['send_trackbacks'] = 'Trackback inviati';
 $messages['ping_selected'] = 'Ping selezionati';
 $messages['trackbacks_sent_ok'] = 'Trackback inviati con successo ai seguenti URL';
@@ -237,34 +246,34 @@
 $messages['show_by'] = 'Mostra per';
 $messages['category'] = 'Categoria';
 $messages['author'] = 'Autore';
-$messages['post_status_all'] = 'Tutto';
-$messages['author_all'] = 'Tutto';
+$messages['post_status_all'] = 'Qualunque';
+$messages['author_all'] = 'Qualunque';
 $messages['search_terms'] = 'Criteri di ricerca';
 $messages['show'] = 'Mostra';
 $messages['delete'] = 'Cancella';
 $messages['actions'] = 'Azioni';
-$messages['all'] = 'Tutto';
-$messages['category_all'] = 'Tutte';
+$messages['all'] = 'Qualunque';
+$messages['category_all'] = 'Qualunque';
 $messages['error_incorrect_article_id'] = 'Id articolo errato';
-$messages['error_deleting_article'] = 'Errore durante la cancellazione del post "%s"';
-$messages['article_deleted_ok'] = 'Post "%s" cancellato';
-$messages['articles_deleted_ok'] = '%s post cancellati';
-$messages['error_deleting_article2'] = 'Errore durante la cancellazione del post con id "%s"';
+$messages['error_deleting_article'] = 'Errore durante la cancellazione dell\'articolo "%s"';
+$messages['article_deleted_ok'] = 'Articolo "%s" cancellato';
+$messages['articles_deleted_ok'] = '%s articoli cancellati';
+$messages['error_deleting_article2'] = 'Errore durante la cancellazione dell\'articolo con id "%s"';
 
 // edit post page
-$messages['update'] = 'Modifica';
-$messages['editPost'] = 'Edita Post';
+$messages['update'] = 'Aggiorna';
+$messages['editPost'] = 'Modifica articolo';
 $messages['error_fetching_post'] = 'Errore durante la lettura dell\'articolo';
-$messages['post_updated_ok'] = 'Post "%s" modificato';
-$messages['error_updating_post'] = 'Errore durante la modifica del post';
+$messages['post_updated_ok'] = 'Articolo "%s" modificato';
+$messages['error_updating_post'] = 'Errore durante la modifica dell\'articolo';
 $messages['notification_added'] = 'Riceverai una notifica per ciascun commento o trackback';
 $messages['notification_removed'] = 'NON riceverai una notifica per ciascun commento o trackback';
 
 // post comments
 $messages['url'] = 'URL';
-$messages['comment_status_all'] = 'Tutti';
+$messages['comment_status_all'] = 'Qualunque';
 $messages['comment_status_spam'] = 'Spam';
-$messages['comment_status_nonspam'] = 'No Spam';
+$messages['comment_status_nonspam'] = 'Non Spam';
 $messages['error_fetching_comments'] = 'Errore durante la lettura dei commenti all\'articolo';
 $messages['error_deleting_comments'] = 'Errore durante la cancellazione del commento o nessun commento selezionato';
 $messages['comment_deleted_ok'] = 'Commento "%s" cancellato';
@@ -273,69 +282,69 @@
 $messages['error_deleting_comment2'] = 'Errore in fase di cancellazione del commento con id %s';
 $messages['editComments'] = 'Commenti';
 $messages['mark_as_spam'] = 'Marca come spam';
-$messages['mark_as_no_spam'] = 'Marca come no spam';
-$messages['error_incorrect_comment_id'] = 'Id commentonon corretto';
+$messages['mark_as_no_spam'] = 'Marca come non spam';
+$messages['error_incorrect_comment_id'] = 'Id del commento non corretto';
 $messages['error_marking_comment_as_spam'] = 'Errore durante la marcatura del commento come spam';
-$messages['comment_marked_as_spam_ok'] = 'Il commento e stato marcato come spam';
-$messages['error_marking_comment_as_nonspam'] = 'Errore durante la marcatura del commento come no spam';
-$messages['comment_marked_as_nonspam_ok'] = 'Il commento e stato marcato come no spam';
+$messages['comment_marked_as_spam_ok'] = 'Il commento è stato marcato come spam';
+$messages['error_marking_comment_as_nonspam'] = 'Errore durante la marcatura del commento come non spam';
+$messages['comment_marked_as_nonspam_ok'] = 'Il commento è stato marcato come non spam';
 
 // post trackbacks
 $messages['blog'] = 'Blog';
 $messages['excerpt'] = 'Brano';
-$messages['error_fetching_trackbacks'] = 'Erore durante la lettura dei trackback';
-$messages['error_deleting_trackbacks'] = 'Erore durante la cancellazione dei trackback o nessun item selezionato';
-$messages['error_deleting_trackback'] = 'Erore durante la cancellazione del trackback "%s"';
-$messages['error_deleting_trackback2'] = 'Erore durante la cancellazione del trackbackcon id "%s"';
+$messages['error_fetching_trackbacks'] = 'Errore durante la lettura dei trackback';
+$messages['error_deleting_trackbacks'] = 'Errore durante la cancellazione dei trackback o nessun elemento selezionato';
+$messages['error_deleting_trackback'] = 'Errore durante la cancellazione del trackback "%s"';
+$messages['error_deleting_trackback2'] = 'Errore durante la cancellazione del trackback con id "%s"';
 $messages['trackback_deleted_ok'] = 'Trackback "%s" cancellato';
 $messages['trackbacks_deleted_ok'] = '%s trackback cancellati ';
 $messages['editTrackbacks'] = 'Trackback';
 
 // post statistics
-$messages['referrer'] = 'Referrer';
-$messages['hits'] = 'Click';
+$messages['referrer'] = 'Origine';
+$messages['hits'] = 'Visualizzazioni';
 $messages['error_no_items_selected'] = 'Nessun item da rimuovere selezionato';
-$messages['error_deleting_referrer'] = 'Errore in fase di cancellazione del referrer "%s"';
-$messages['error_deleting_referrer2'] = 'Errore in fase di cancellazione del referrer con id "%s"';
-$messages['referrer_deleted_ok'] = 'Referrer "%s" cancellato';
-$messages['referrers_deleted_ok'] = '%s referrer cancellati';
+$messages['error_deleting_referrer'] = 'Errore in fase di cancellazione dell\'origine "%s"';
+$messages['error_deleting_referrer2'] = 'Errore in fase di cancellazione dell\'origine con id "%s"';
+$messages['referrer_deleted_ok'] = 'Origine "%s" cancellata';
+$messages['referrers_deleted_ok'] = '%s origini cancellate';
 
 // categories
-$messages['posts'] = 'Post';
-$messages['show_in_main_page'] = 'Mostrare nella pagina iniziale';
-$messages['error_incorrect_category_id'] = 'L\'id della categoria non e corretto o nessun item selezionato';
-$messages['error_category_has_articles'] = 'Categoria "%s" e usata per catalogare qualche articolo. Modificare gli articoli peima di eliminare la categoria';
+$messages['posts'] = 'Articoli';
+$messages['show_in_main_page'] = 'Mostra nella pagina iniziale';
+$messages['error_incorrect_category_id'] = 'L\'id della categoria non è corretto o nessun elemento selezionato';
+$messages['error_category_has_articles'] = 'La categoria "%s" è usata per catalogare qualche articolo. Modificare gli articoli prima di eliminare la categoria';
 $messages['category_deleted_ok'] = 'Categoria "%s" eliminata';
 $messages['categories_deleted_ok'] = '%s categorie eliminate';
 $messages['error_deleting_category'] = 'Errore durante la cancellazione della categoria "%s"';
 $messages['error_deleting_category2'] = 'Errore durante la cancellazione della categoria con id "%s"';
-$messages['yes'] = 'Si';
+$messages['yes'] = 'Sì';
 $messages['no'] = 'No';
 
 // new category
 $messages['name'] = 'Nome';
 $messages['category_name_help'] = 'Nome da mostrare per visualizzare la categoria';
 $messages['description'] = 'Descrizione';
-$messages['category_description_help'] = 'Decrizione troppo lunga';
-$messages['show_in_main_page_help'] = 'I post sotto questa categoria devono essere mostarti nella pagina principale o solo quando si accede a questa particolare categoria';
-$messages['error_empty_name'] = 'Devi definire un nome name';
+$messages['category_description_help'] = 'Descrizione estesa della categoria';
+$messages['show_in_main_page_help'] = 'Gli articoli sotto questa categoria devono essere mostrati nella pagina principale o solo quando si accede a questa particolare categoria';
+$messages['error_empty_name'] = 'Devi definire un nome';
 $messages['error_empty_description'] = 'Devi dare una descrizione';
-$messages['error_adding_article_category'] = 'Errore durante l\'agginta di una nuova categoria. Verificare i dati e riprovare';
-$messages['category_added_ok'] = 'Categoria "%s" agginta';
+$messages['error_adding_article_category'] = 'Errore durante l\'aggiunta di una nuova categoria. Verifica i dati e riprovare';
+$messages['category_added_ok'] = 'Categoria "%s" aggiunta';
 $messages['add'] = 'Aggiungi';
 $messages['reset'] = 'Annulla';
 
 // update category
-$messages['error_updating_article_category'] = 'Errore durante la modifica della ctegoria';
+$messages['error_updating_article_category'] = 'Errore durante la modifica della categoria';
 $messages['error_fetching_category'] = 'Errore durante la lettura della categoria';
 $messages['article_category_updated_ok'] = 'Categoria "%s" modificata';
 
 // links
 $messages['feed'] = 'Feed';
-$messages['error_no_links_selected'] = 'L\'id del link non e corretto o non sono stati selezionati item da eliminare';
-$messages['error_incorrect_link_id'] = 'L\'id del link non e corretto';
-$messages['error_removing_link'] = 'Si e verificato un errore in fase di cancellazione del link "%s"';
-$messages['error_removing_link2'] = 'Si e verificato un errore in fase di cancellazione del link con id "%s"';
+$messages['error_no_links_selected'] = 'L\'id del link non è corretto o non sono stati selezionati elementi da eliminare';
+$messages['error_incorrect_link_id'] = 'L\'id del link non è corretto';
+$messages['error_removing_link'] = 'Si è verificato un errore in fase di cancellazione del link "%s"';
+$messages['error_removing_link2'] = 'Si è verificato un errore in fase di cancellazione del link con id "%s"';
 $messages['link_deleted_ok'] = 'Link "%s" eliminato';
 $messages['links_deleted_ok'] = '%s link eliminati';
 
@@ -343,549 +352,574 @@
 $messages['link_name_help'] = 'Nome da dare a questo link';
 $messages['link_url_help'] = 'Indirizzo a a cui punta questo link';
 $messages['link_description_help'] = 'Breve descrizione del link';
-$messages['link_feed_help'] = 'E\' possibile lincare  feed di tipo  RSS o Atom';
+$messages['link_feed_help'] = 'E\' possibile linkare feed di tipo  RSS o Atom';
 $messages['link_category_help'] = 'Selezionare una delle categorie di link';
-$messages['error_adding_link'] = 'Si e verificato un errore durante l\'aggiunta del nuovo link. Verificare le informazioni inserite e riprovare';
-$messages['error_invalid_url'] = 'L\'indirizzo non e corretto';
+$messages['error_adding_link'] = 'Si e verificato un errore durante l\'aggiunta del nuovo link. Verifica le informazioni inserite e riprovare';
+$messages['error_invalid_url'] = 'L\'indirizzo non è corretto';
 $messages['link_added_ok'] = 'Link "%s" aggiunto';
 
 // update link
-$messages['error_updating_link'] = 'Si e verificato un errore durante la modifica del link. Verificare le informazioni inserite e riprovare';
-$messages['error_invalid_url'] = 'L\'indirizzo non e corretto';
+$messages['error_updating_link'] = 'Si e verificato un errore durante la modifica del link. Verifica le informazioni inserite e riprovare';
+$messages['error_invalid_url'] = 'L\'indirizzo non è corretto';
 $messages['error_fetching_link'] = 'Errore durante la lettura del link';
 $messages['link_updated_ok'] = 'Link "%s" modificato';
 
 // link categories
-$messages['links'] = 'Links';
-$messages['error_invalid_link_category_id'] = 'The link category identifier was not correct or there was no link category selected';
-$messages['error_links_in_link_category'] = 'Link category "%s" is used by some links. Modify the links first and try again';
-$messages['error_removing_link_category'] = 'There was an error removing link category "%s"';
-$messages['link_category_deleted_ok'] = 'Link category "%s" deleted succesfully';
-$messages['link_categories_deleted_ok'] = '%s link categories deleted succesfully';
-$messages['error_removing_link_category2'] = 'There was an error removing link category with identifier "%s"';
+$messages['links'] = 'Link';
+$messages['error_invalid_link_category_id'] = 'L\'identificativo della categoria del link non è corretto o non è stata selezionata nessuna categoria';
+$messages['error_links_in_link_category'] = 'La categoria "%s" è usata da qualche link. Modifica i link quindi riprova';
+$messages['error_removing_link_category'] = 'E\' avvenuto un errore durante la rimozione della categoria "%s"';
+$messages['link_category_deleted_ok'] = 'La categoria "%s" è stata rimossa';
+$messages['link_categories_deleted_ok'] = '%s categorie rimosse';
+$messages['error_removing_link_category2'] = 'E\' avvenuto un errore durante la rimozione della categoria con identificativo "%s"';
 
 // new link category
-$messages['link_category_name_help'] = 'Name given to this link category';
-$messages['error_adding_link_category'] = 'There was an error adding the new link category';
-$messages['link_category_added_ok'] = 'Link category "%s" was successfully added';
+$messages['link_category_name_help'] = 'Nome per questa categoria di link';
+$messages['error_adding_link_category'] = 'E\' avvenuto un errore durante l\' aggiunta della categoria';
+$messages['link_category_added_ok'] = 'La categoria "%s" è stata aggiunta';
 
 // edit link category
-$messages['error_updating_link_category'] = 'There was an error updating the link category. Please check the data and try again';
-$messages['link_category_updated_ok'] = 'Link category "%s" updated successfully';
-$messages['error_fetching_link_category'] = 'There was an error fetching the link category';
+$messages['error_updating_link_category'] = 'E\' avvenuto un errore durante l\'aggiunta della categoria . Controlla i dati e riprova';
+$messages['link_category_updated_ok'] = 'Categoria "%s" aggiornata con successo';
+$messages['error_fetching_link_category'] = 'E\' avvenuto un errore durante la lettura della categoria';
 
 // custom fields
-$messages['type'] = 'Type';
-$messages['hidden'] = 'Hidden';
-$messages['fields_deleted_ok'] = '%s custom fields deleted successfully';
-$messages['field_deleted_ok'] = 'Custom field "%s" deleted successfully';
-$messages['error_deleting_field'] = 'There was an error deleting custom field "%s"';
-$messages['error_deleting_field2'] = 'There was an error deleting custom field with identifier "%s"';
-$messages['error_incorrect_field_id'] = 'The custom field identifier was not valid';
+$messages['type'] = 'Tipo';
+$messages['hidden'] = 'Nascosto';
+$messages['fields_deleted_ok'] = '%s campi personalizzati eliminati con successo';
+$messages['field_deleted_ok'] = 'Il campo personalizzato "%s" è stato cancellato';
+$messages['error_deleting_field'] = 'E\' avvenuto un errore durante la cancellazione del campo personalizzato "%s"';
+$messages['error_deleting_field2'] = 'E\' avvenuto un errore durante l\'eliminazione del campo personalizzato "%s"';
+$messages['error_incorrect_field_id'] = 'L\'id del campo personalizzato non è valido';
 
 // new custom field
-$messages['field_name_help'] = 'Identifer that will be used to refer to the value of this field in posts';
-$messages['field_description_help'] = 'Brief description of this field that will be shown when adding or editing posts';
-$messages['field_type_help'] = 'Select one of the available field types';
-$messages['field_hidden_help'] = 'If a field is hidden, it will not be shown when adding a or editing a post. This feature is mainly used by plugins';
-$messages['error_adding_custom_field'] = 'There was an error adding the custom field. Please check the data and try again';
-$messages['custom_field_added_ok'] = 'Custom field "%s" added successfully';
-$messages['text_field'] = 'Text field';
-$messages['text_area'] = 'Text box';
+$messages['field_name_help'] = 'Identificativo che verrà utilizzato nell\'articolo per riferirsi al valore di questo campo.';
+$messages['field_description_help'] = 'Breve descrizione del campo, che verrà mostrata durante l\'aggiunta o la modifica degli articoli.';
+$messages['field_type_help'] = 'Seleziona uno dei tipi di campo';
+$messages['field_hidden_help'] = 'Se un campo è nascosto, non verrà mostrato durante l\'edizione o la modifica dell\'articolo. Questa caratteristica è utilizzata principalmente dai plugin.';
+$messages['error_adding_custom_field'] = 'E\' avvenuto un errore durante l\'inserimento del campo personalizzato. Controlla i dati e riprova.';
+$messages['custom_field_added_ok'] = 'Campo personalizzato "%s" inserito con successo';
+$messages['text_field'] = 'Campo di testo';
+$messages['text_area'] = 'Area di testo';
 $messages['checkbox'] = 'Checkbox';
-$messages['date_field'] = 'Date chooser';
+$messages['date_field'] = 'Campo data';
 
 // edit custom field
-$messages['error_fetching_custom_field'] = 'There was an error fetching the custom field';
-$messages['error_updating_custom_field'] = 'There was an error updating the custom field. Please check the data and try again';
-$messages['custom_field_updated_ok'] = 'Custom field "%s" updated successfully';
+$messages['error_fetching_custom_field'] = 'E\' avvenuto un errore durante la lettura del campo personalizzato';
+$messages['error_updating_custom_field'] = 'E\' avvenuto un errore durante l\'aggiornamento del campo personalizzato. Controlla i dati e riprova.';
+$messages['custom_field_updated_ok'] = 'Campo personalizzato "%s" aggiornato';
 
 // resources
-$messages['root_album'] = 'Root album';
-$messages['num_resources'] = 'Number of resources';
-$messages['total_size'] = 'Total size';
+$messages['root_album'] = 'Album principale';
+$messages['num_resources'] = 'Numero di risorse';
+$messages['total_size'] = 'Dimensione totale';
 $messages['album'] = 'Album';
-$messages['error_incorrect_album_id'] = 'The album identifier is not correct';
-$messages['error_base_storage_folder_missing_or_unreadable'] = 'It was not possible for pLog to create the necessary folders where resources are going to be installed. This might be due to several reasons, such as your PHP installation running with safe mode enabled or your user not having enough permissions to do so. You may still try to carry out the operation manually, by creating the following folders: <br/><br/>%s<br/><br/>If these folders already exist please make sure that they can be read and written by the user running the web server.';
-$messages['items_deleted_ok'] = '%s items deleted successfully';
-$messages['error_album_has_children'] = 'Album "%s" has children. Please edit first the album and try again';
-$messages['item_deleted_ok'] = 'Item "%s"deleted successfully';
-$messages['error_deleting_album'] = 'There was an error deleting album "%s"';
-$messages['error_deleting_album2'] = 'There was an error deleting album with identifier "%s"';
-$messages['error_deleting_resource'] = 'There was an error deleting resource "%s"';
-$messages['error_deleting_resource2'] = 'There was an error deleting resource with identifier "%s"';
-$messages['error_no_resources_selected'] = 'No items were selected to delete';
-$messages['resource_deleted_ok'] = 'Resource "%s" was deleted successfully';
-$messages['album_deleted_ok'] = 'Album "%s" was deleted successfully';
-$messages['add_resource'] = 'Add resource';
-$messages['add_resource_preview'] = 'Add preview';
-$messages['add_album'] = 'Add album';
+$messages['error_incorrect_album_id'] = 'L\'identificativo del album non è corretto';
+$messages['error_base_storage_folder_missing_or_unreadable'] = 'pLog non è riuscito a creare le cartelle necessarie per le risorse. Ci sono diversi motivi possibili, in particolare, PHP potrebbe essere configurato in modalità sicura (safe mode), oppure il tuo utente potrebbe non avere i permessi per crearle. Puoi comunque provare ad effettuare l\'operazione manualmente, creando le seguenti cartelle: <br/><br/>%s<br/><br/>Se queste cartelle esistono già, controlla che siano leggibili e scrivibili dall\'utente che esegue il server web';
+$messages['items_deleted_ok'] = '%s elementi cancellati con successo';
+$messages['error_album_has_children'] = 'L\'album "%s" ha sottoelementi. Modifica l\'album e riprova';
+$messages['item_deleted_ok'] = 'Elemento "%s" eliminato con successo';
+$messages['error_deleting_album'] = 'E\' avvenuto un errore durante la cancellazione dell\'album "%s"';
+$messages['error_deleting_album2'] = 'E\' avvenuto un errore durante la cancellazione dell\'album con id "%s"';
+$messages['error_deleting_resource'] = 'E\' avvenuto un errore durante la cancellazione della risorsa "%s"';
+$messages['error_deleting_resource2'] = 'TE\' avvenuto un errore durante la cancellazione della risorsa con id "%s"';
+$messages['error_no_resources_selected'] = 'Non hai selezionato alcun elemento da cancellare';
+$messages['resource_deleted_ok'] = 'Risorsa "%s" cancellata con successo';
+$messages['album_deleted_ok'] = 'Album "%s" cancellato con successo';
+$messages['add_resource'] = 'Aggiungi risorsa';
+$messages['add_resource_preview'] = 'Aggiungi anteprima';
+$messages['add_resource_medium'] = 'Aggiungi anteprima media';
+$messages['add_album'] = 'Aggiungi album';
 
 // new album
-$messages['album_name_help'] = 'Short name for the new album';
-$messages['parent'] = 'Parent';
-$messages['no_parent'] = 'No parent';
-$messages['parent_album_help'] = 'Use this to have albums within albums and better organize your files';
-$messages['album_description_help'] = 'Longer description of the contents of this album';
-$messages['error_adding_album'] = 'There was an error adding the new album. Please check the data and try again';
-$messages['album_added_ok'] = 'Album "%s" successfully added';
+$messages['album_name_help'] = 'Nome breve per l\'album';
+$messages['parent'] = 'Album superiore';
+$messages['no_parent'] = 'Nessun album superiore';
+$messages['parent_album_help'] = 'Usa questa funzione per avere album annidati all\'interno di altri, per organizzare meglio i tuoi file';
+$messages['album_description_help'] = 'Descrizione estesa del contenuto dell\'album';
+$messages['error_adding_album'] = 'E\' avvenuto un errore durante l\'inserimento del nuovo album. Controlla i dati e riprova.';
+$messages['album_added_ok'] = 'Album "%s" aggiunto con successo';
 
 // edit album
-$messages['error_incorrect_album_id'] = 'The album identifier is not correct';
-$messages['error_fetching_album'] = 'There was an error fetching the album';
-$messages['error_updating_album'] = 'There was an error updating the album. Please check the data and try again';
-$messages['album_updated_ok'] = 'Album "%s" updated successfully';
-$messages['show_album_help'] = 'If disabled, the album will not be shown in the list of albums available in this blog';
+$messages['error_incorrect_album_id'] = 'L\'identificativo dell\'album non è corretto';
+$messages['error_fetching_album'] = 'E\' avvenuto un errore durante la lettura dell\'album';
+$messages['error_updating_album'] = 'E\' avvenuto un errore durante l\'aggiornamento dell\'album. Controlla i dati e riprova.';
+$messages['album_updated_ok'] = 'Album "%s" aggiornato con successo';
+$messages['show_album_help'] = 'Se disabilitato, l\'album non verrà mostrato nella lista degli album disponibili in questo blog';
 
 // new resource
 $messages['file'] = 'File';
-$messages['resource_file_help'] = 'File that will be added to the current blog. Use the "Add field" link to upload more than one file at the same time';
-$messages['add_field'] = 'Add field';
-$messages['resource_description_help'] = 'Longer description of the contents of this file';
-$messages['resource_album_help'] = 'Select the album to which this file will be added';
-$messages['error_no_resource_uploaded'] = 'There was no file selected to upload';
-$messages['resource_added_ok'] = 'Resource "%s" added successfully';
-$messages['error_resource_forbidden_extension'] = 'The file was not added because it is of a forbidden type';
-$messages['error_resource_too_big'] = 'The file was not added because it is too big';
-$messages['error_uploads_disabled'] = 'The file was not added because uploads have been disabled';
-$messages['error_quota_exceeded'] = 'The file was not added because resource quota has been exceeded';
-$messages['error_adding_resource'] = 'There was an error adding the resource file';
+$messages['resource_file_help'] = 'File che verranno aggiunti al blog corrente. Usa il link "Aggiungi campo" per caricare più un file allo stesso tempo';
+$messages['add_field'] = 'Aggiungi campo';
+$messages['resource_description_help'] = 'Descrizione estesa del contenuto del file';
+$messages['resource_album_help'] = 'Seleziona l\'album al quale questo file verrà aggiunto';
+$messages['error_no_resource_uploaded'] = 'Non hai selezionato il file da caricare';
+$messages['resource_added_ok'] = 'Risorsa "%s" inserita con successo';
+$messages['error_resource_forbidden_extension'] = 'Il file non è stato aggiunto in quanto è di un tipo non ammesso (estensione vietata)';
+$messages['error_resource_too_big'] = 'Il file non è stato aggiunto in quanto troppo grande';
+$messages['error_uploads_disabled'] = 'Il file non è stato aggiunto in quanto gli upload sono stati disabilitati';
+$messages['error_quota_exceeded'] = 'Il file non è stato aggiunto in quanto lo spazio disponibile per le risorse è stato superato';
+$messages['error_adding_resource'] = 'E\' avvenuto un errore nell\'aggiunta della risorsa';
 
 // edit resource
-$messages['editResource'] = 'Edit Resource';
-$messages['resource_information_help'] = 'Below is some information about this resource file';
-$messages['information'] = 'Information';
-$messages['size'] = 'Size';
-$messages['format'] = 'Format';
-$messages['dimensions'] = 'Dimensions';
-$messages['bits_per_sample'] = 'Bits per sample';
-$messages['sample_rate'] = 'Sample rate';
-$messages['number_of_channels'] = 'Number of channels';
-$messages['legnth'] = 'Length';
-$messages['thumbnail_format'] = 'Thumbnail format';
-$messages['regenerate_preview'] = 'Regenerate preview';
-$messages['error_fetching_resource'] = 'There was an error fetching the resource';
-$messages['error_updating_resource'] = 'There was an error updating the resource';
-$messages['resource_updated_ok'] = 'Resource "%s" updated successfully';
+$messages['editResource'] = 'Modifica risorsa';
+$messages['resource_information_help'] = 'Alcune informazioni sul file';
+$messages['information'] = 'Informazioni';
+$messages['size'] = 'Dimensione';
+$messages['format'] = 'Formato';
+$messages['dimensions'] = 'Dimensioni';
+$messages['bits_per_sample'] = 'Bit per campione (bps)';
+$messages['sample_rate'] = 'Frequenza di campionamento';
+$messages['number_of_channels'] = 'Numero di canali';
+$messages['legnth'] = 'Lunghezza';
+$messages['thumbnail_format'] = 'Miniatura';
+$messages['regenerate_preview'] = 'Rigenera l\'anteprima';
+$messages['error_fetching_resource'] = 'E\' avvenuto un errore durante la lettura della risorsa';
+$messages['error_updating_resource'] = 'E\' avvenuto un errore durante l\'aggiornamento della risorsa';
+$messages['resource_updated_ok'] = 'Risorsa "%s" aggiornata con successo';
 
 // blog settings
-$messages['blog_link'] = 'Blog link';
-$messages['blog_link_help'] = 'Permanent link to this blog';
-$messages['blog_name_help'] = 'Title for this blog';
-$messages['blog_description_help'] = 'Longer description about the contents of this blog';
-$messages['language'] = 'Language';
-$messages['blog_language_help'] = 'Language used to display the texts of this blog, both in the public and administration side';
-$messages['max_main_page_items'] = 'Number of items in the main page';
-$messages['max_main_page_items_help'] = 'Number of posts that should be displayed at all times in the main page of the blog';
-$messages['max_recent_items'] = 'Number of recent items';
-$messages['max_recent_items_help'] = 'Maximum number of posts that will be shown as recent in the front page';
-$messages['template'] = 'Template';
-$messages['choose'] = 'Choose';
-$messages['blog_template_help'] = 'Template that will be used to display the contents of the blog. This list includes global templates plus all the templates installed only for this blog';
-$messages['use_read_more'] = 'Use "more..." link in posts';
-$messages['use_read_more_help'] = 'If enabled, only the text typed in the "Text" textbox will be shown in the main page. In order to display the "Extended text", a "more..." link will be added to each post';
-$messages['enable_wysiwyg'] = 'Enable the visual editor of posts';
-$messages['enable_wysiwyg_help'] = 'Enables a more powerful, visual editor of HTML mark up. The editor only works in Internet Explorer 5.5 or higher or Mozilla 1.3 or higher';
-$messages['enable_comments'] = 'Enable comments by default';
-$messages['enable_comments_help'] = 'Enable comments for all posts by default. Comments can still be enabled/disabled for certain posts when creating new posts or editing old ones';
-$messages['show_future_posts'] = 'Show future posts in the calendar';
-$messages['show_future_posts_help'] = 'Whether posts which have a date in the future should appear in the calendar and visible to users';
-$messages['comments_order'] = 'Comments order';
-$messages['comments_order_help'] = 'Order in which comments should be displayed in the front page';
-$messages['oldest_first'] = 'Oldest first';
-$messages['newest_first'] = 'Newest first';
-$messages['categories_order'] = 'Categories order';
-$messages['categories_order_help'] = 'Order in which categories should be displayed in the front page';
-$messages['most_recent_updated_first'] = 'Most recently updated first';
-$messages['alphabetical_order'] = 'Alphabetical order';
-$messages['reverse_alphabetical_order'] = 'Reverse alphabetical order';
-$messages['most_articles_first'] = 'Most articles first';
-$messages['link_categories_order'] = 'Link categories order';
-$messages['link_categories_order_help'] = 'Order in which link categores should appear in the front page';
-$messages['most_links_first'] = 'Most links first';
-$messages['most_links_last'] = 'Most links last';
-$messages['time_offset'] = 'Time offset';
-$messages['time_offset_help'] = 'Time difference in hours that will be dynamically added to each date and time in the blog';
-$messages['close'] = 'Close';
-$messages['select'] = 'Select';
-$messages['error_updating_settings'] = 'There was an error updating the blog settings. Please check the data and try again';
-$messages['error_invalid_number'] = 'The number is not correct';
-$messages['error_incorrect_time_offset'] = 'The time offset is not valid';
-$messages['blog_settings_updated_ok'] = 'Blog settings updated successfully';
+$messages['blog_link'] = 'Link al blog';
+$messages['blog_link_help'] = 'Link permanente del blog';
+$messages['blog_name_help'] = 'Titolo del blog';
+$messages['blog_description_help'] = 'Descrizione estesa del blog';
+$messages['language'] = 'Lingua';
+$messages['blog_language_help'] = 'Lingua usata per la visualizzazione dei testi del blog, sia nella parte pubblica che in quella amministrativa';
+$messages['max_main_page_items'] = 'Numero di elementi nella pagina principale';
+$messages['max_main_page_items_help'] = 'Numero di articoli da mostrare contemporaneamente nella pagina principale del blog';
+$messages['max_recent_items'] = 'Numero di elementi recenti';
+$messages['max_recent_items_help'] = 'Numero massimo di articoli che verranno mostrati come recenti nella pagina principale';
+$messages['template'] = 'Cornice';
+$messages['choose'] = 'Scegli';
+$messages['blog_template_help'] = 'Cornice da usare per la presentazione dei contenuti del blog. La lista include le cornici globali e tutte le cornici speciali installate solo per questo blog.';
+$messages['use_read_more'] = 'Usa il link "continua..." negli articoli';
+$messages['use_read_more_help'] = 'Se abilitato, solamente quanto scritto nella casella "Testo" verrà mostrato nella pagina principale. Per visualizzare anche il "Testo esteso", sarà necessario cliccare sul link "continua...", che sarà aggiunto ad ogni articolo';
+$messages['enable_wysiwyg'] = 'Abilita l\'editor visuale per gli articoli';
+$messages['enable_wysiwyg_help'] = 'Abilita un potente editor visuale del codice HTML. L\'editor funziona con Internet Explorer 5.5 o superiore o con Mozilla 1.3 o superiore';
+$messages['enable_comments'] = 'Abilita i commenti in maniera predefinita';
+$messages['enable_comments_help'] = 'Abilita i commenti in tutti gli articoli in maniera predefinita. I commenti possono comunque essere abilitati e disabilitati per i singoli articoli, alla loro creazione o modifica';
+$messages['show_future_posts'] = 'Mostra gli articoli nel futuro nel calendario';
+$messages['show_future_posts_help'] = 'Decide se gli articoli che hanno una data nel futuro devono apparire nel calendario ed essere visibili agli utenti';
+$messages['comments_order'] = 'Ordine dei commenti';
+$messages['comments_order_help'] = 'Ordine nel quale i commenti devono apparire nella pagina principale';
+$messages['oldest_first'] = 'I più vecchi in cima';
+$messages['newest_first'] = 'I più recenti in cima';
+$messages['categories_order'] = 'Ordine delle categorie';
+$messages['categories_order_help'] = 'Ordine nel quale le categorie devono apparire nella pagina principale';
+$messages['most_recent_updated_first'] = 'Quelle con modifiche più recenti in cima';
+$messages['alphabetical_order'] = 'In ordine alfabetico';
+$messages['reverse_alphabetical_order'] = 'In ordine alfabetico inverso';
+$messages['most_articles_first'] = 'Quelle con più articoli in cima';
+$messages['link_categories_order'] = 'Ordine delle categorie di link';
+$messages['link_categories_order_help'] = 'Ordine nel quale le categorie dei link devono apparire nella pagina principale';
+$messages['most_links_first'] = 'Quelle con più link in cima';
+$messages['most_links_last'] = 'Quelle con più link in fondo';
+$messages['time_offset'] = 'Fuso orario';
+$messages['time_offset_help'] = 'Numero di ore da aggiungere dinamicamente ad ogni data ed ora nel blog';
+$messages['close'] = 'Chiudi';
+$messages['select'] = 'Seleziona';
+$messages['error_updating_settings'] = 'E\' avvenuto un errore durante l\'aggiornamento delle impostazioni del blog. Controlla i dati e riprova.';
+$messages['error_invalid_number'] = 'Il numero non è corretto';
+$messages['error_incorrect_time_offset'] = 'Il fuso orario non è valido';
+$messages['blog_settings_updated_ok'] = 'Impostazioni del blog aggiornate con successo';
+$messages['hours'] = 'Ore';
 
 // user settings
-$messages['username_help'] = 'Public username. It cannot be changed';
-$messages['full_name'] = 'Full name';
-$messages['full_name_help'] = 'Complete full name';
-$messages['password_help'] = 'Type and confirm a new password, or leave empty for no change';
-$messages['confirm_password'] = 'Confirm password';
+$messages['username_help'] = 'Nome utente pubblico. Non è possibile modificarlo.';
+$messages['full_name'] = 'Nome completo';
+$messages['full_name_help'] = 'Nome completo';
+$messages['password_help'] = 'Scrivi una password e confermala, oppure lascia vuoto per lasciare invariata quella corrente';
+$messages['confirm_password'] = 'Conferma la password';
 $messages['email'] = 'Email';
-$messages['email_help'] = 'Email address where notifications will be sent';
-$messages['bio'] = 'Your bio';
-$messages['bio_help'] = 'A longer description of yourself can be provided here';
-$messages['picture'] = 'Picture';
-$messages['user_picture_help'] = 'Please select a picture form the ones uploaded to this blog as your personal picture';
-$messages['error_invalid_password'] = 'The password is not correct. Please make sure that it is not too short';
-$messages['error_passwords_dont_match'] = 'Sorry, passwords do not match';
-$messages['error_incorrect_email_address'] = 'The email address is not correct';
-$messages['error_updating_user_settings'] = 'There was an error updating your user settings. Please check the data and try again';
-$messages['user_settings_updated_ok'] = 'User settings updated successfully';
-$messages['resource'] = 'Resource';
+$messages['email_help'] = 'Indirizzo email al quale spedire le modifiche';
+$messages['bio'] = 'Informazioni su di te';
+$messages['bio_help'] = 'Puoi scrivere qui una descrizione più estesa di te stesso';
+$messages['picture'] = 'Immagine';
+$messages['user_picture_help'] = 'Seleziona un\'immagine da quelle caricate su questo blog come immagine personale';
+$messages['error_invalid_password'] = 'La password non è corretta. Controlla che non sia troppo corta';
+$messages['error_passwords_dont_match'] = 'Le password non coincidono';
+$messages['error_incorrect_email_address'] = 'L\'indirizzo email non è corretto';
+$messages['error_updating_user_settings'] = 'E\' avvenuto un errore durante l\'aggiornamento delle impostazioni. Controlla i dati e riprova';
+$messages['user_settings_updated_ok'] = 'Impostazioni utente aggiornate con successo';
+$messages['resource'] = 'Risorsa';
 
 // plugin centre
-$messages['identifier'] = 'Identifier';
-$messages['error_plugins_disabled'] = 'Sorry, Plugins are disabled.';
+$messages['identifier'] = 'Identificativo';
+$messages['error_plugins_disabled'] = 'Spiacente, i plugin sono disabilitati';
 
 // blog users
-$messages['revoke_permissions'] = 'Revoke permissions';
-$messages['error_no_users_selected'] = 'There were no users selected';
-$messages['user_removed_from_blog_ok'] = 'User "%s" does not have permissions to access this blog any more';
-$messages['users_removed_from_blog_ok'] = '%s users do not have access to this blog any more';
-$messages['error_removing_user_from_blog'] = 'There was an error removing access to this blog from user "%s"';
-$messages['error_removing_user_from_blog2'] = 'There was an error removing access to this blog from user whose identifier is "%s"';
+$messages['revoke_permissions'] = 'Annulla i permessi';
+$messages['error_no_users_selected'] = 'Non è stato selezionato alcun utente';
+$messages['user_removed_from_blog_ok'] = 'L\'utente "%s" non ha più l\'autorizzazione ad accedere a questo blog';
+$messages['users_removed_from_blog_ok'] = '%s utenti non hanno più l\'autorizzazione ad accedere a questo blog';
+$messages['error_removing_user_from_blog'] = 'E\' avvenuto un problema durante la rimozione dei diritti di accesso a questo blog all\'utente "%s"';
+$messages['error_removing_user_from_blog2'] = 'E\' avvenuto un problema durante la rimozione dei diritti di accesso a questo blog agli utenti con gli identificativi "%s"';
 
 // new blog user
-$messages['new_blog_username_help'] = 'Username of the user to whom you would like to give access to this blog. New users will only have access to the "Manage" and "Resources" sections.';
-$messages['send_notification'] = 'Send notification';
-$messages['send_user_notification_help'] = 'Send an email notification to this user';
-$messages['notification_text'] = 'Notification Text';
-$messages['notification_text_help'] = 'Text that will be included in the notification message';
-$messages['error_adding_user'] = 'There was an error granting access to the user. Please check the data and try again';
-$messages['error_empty_text'] = 'You must provide some text';
-$messages['error_adding_user'] = 'There was an error adding the user. Please check the data and try again';
-$messages['error_invalid_user'] = 'The user "%s" is not valid or does not exist';
-$messages['user_added_to_blog_ok'] = 'User "%s" has been given access to this blog successfully';
+$messages['new_blog_username_help'] = 'Username dell\'utente al quale vuoi concedere l\'autorizzazione all\'accesso a questo blog. I nuovi utenti avranno accesso solamente alle sezioni "Gestisci" e "Risorse.';
+$messages['send_notification'] = 'Invia la notifica';
+$messages['send_user_notification_help'] = 'Invia una notifica via email a questo utente';
+$messages['notification_text'] = 'Testo della notifica';
+$messages['notification_text_help'] = 'Testo da includere nel messaggio di notifica';
+$messages['error_adding_user'] = 'E\' avvenuto un errore durante la concessione delle autorizzazioni all\'utente. Controlla i dati e riprova';
+$messages['error_empty_text'] = 'E\' necessario specificare del testo';
+$messages['error_adding_user'] = 'E\' avvenuto un errore durante l\'inserimento dell\'utente. Controlla i dati e riprova.';
+$messages['error_invalid_user'] = 'Lo username "%s" non è valido o non esiste';
+$messages['user_added_to_blog_ok'] = 'L\'utente "%s" ha ora l\'autorizzazione ad accedere a questo blog';
 
 // blog templates
-$messages['error_no_templates_selected'] = 'There were no templates selected';
-$messages['error_template_is_current'] = 'Template "%s" cannot be deleted because it is the current one';
-$messages['error_removing_template'] = 'There was an error deleting template "%s"';
-$messages['template_removed_ok'] = 'Template "%s" deleted successfully';
-$messages['templates_removed_ok'] = '%s templates deleted successfully';
+$messages['error_no_templates_selected'] = 'Nessuna cornice selezionata';
+$messages['error_template_is_current'] = 'La cornice "%s" non può essere selezionata, in quanto è quella corrente';
+$messages['error_removing_template'] = 'E\' avvenuto un errore durante la cancellazione della cornice "%s"';
+$messages['template_removed_ok'] = 'La cornice "%s" è stata cancellata';
+$messages['templates_removed_ok'] = '%s cornici cancellate';
 
 // new blog template
-$messages['template_installed_ok'] = 'Template "%s" added succesfully';
-$messages['error_installing_template'] = 'There was an error installing template "%s"';
-$messages['error_missing_base_files'] = 'Some of the template files are missing';
-$messages['error_add_template_disabled'] = 'New templates cannot be added because this feature has been disabled in this site';
-$messages['error_must_upload_file'] = 'There was no template package uploaded';
-$messages['error_uploads_disabled'] = 'Uploads have been disabled in this site';
-$messages['error_no_new_templates_found'] = 'No new templates were found';
-$messages['error_template_not_inside_folder'] = 'The files used in the template set must be inside a folder with the same name as the template set';
-$messages['error_missing_base_files'] = 'Some of the basic template files are missing';
-$messages['error_unpacking'] = 'There was an error unpacking the file';
-$messages['error_forbidden_extensions'] = 'The template set included files with forbidden extensions';
-$messages['error_creating_working_folder'] = 'There was an error creating a temporary folder to unpack the files';
-$messages['error_checking_template'] = 'There was an error checking the template: %s';
-$messages['template_package'] = 'Template package';
-$messages['blog_template_package_help']  = 'Use this form to upload a new template set, which will only be available to your blog. If it is not possible to upload a template package using this form, upload the template set manually and place it in <b>%s</b>, which is the folder where your blog templates are stored and click the "<b>Scan templates</b>" button. pLog will scan the folder and will automatically add any new template it can find.';
-$messages['scan_templates'] = 'Scan Templates';
+$messages['template_installed_ok'] = 'La cornice "%s" è stata aggiunta';
+$messages['error_installing_template'] = 'E\' avvenuto un errore durante l\'installazione della cornice "%s"';
+$messages['error_missing_base_files'] = 'Mancano alcuni file della cornice';
+$messages['error_add_template_disabled'] = 'Nuove cornici non possono essere aggiunte, in quanto questa funzionalità è stata disabilitata in questo sito';
+$messages['error_must_upload_file'] = 'Non è stato caricato un pacchetto con una cornice';
+$messages['error_uploads_disabled'] = 'Gli upload sono stati disabilitati in questo sito';
+$messages['error_no_new_templates_found'] = 'Nessuna nuova cornice trovata';
+$messages['error_template_not_inside_folder'] = 'I file della cornice devono essere contenuti in una cartella con lo stesso nome della cornice';
+$messages['error_missing_base_files'] = 'Alcuni dei file di base della cornice sono mancanti';
+$messages['error_unpacking'] = 'E\' avvenuto un errore durante la decompressione del file';
+$messages['error_forbidden_extensions'] = 'La cornice contiene dei file con estensioni non permesse';
+$messages['error_creating_working_folder'] = 'E\' avvenuto un errore durante la creazione di una cartella temporanea per la decompressione della cornice';
+$messages['error_checking_template'] = 'E\' avvenuto un errore durante il controllo della cornice: %s';
+$messages['template_package'] = 'Pacchetto della cornice';
+$messages['blog_template_package_help']  = '
+Utilizza questo modulo per caricare una nuova cornice, che sarà resa disponibile esclusivamente a questo blog. Se non fosse possibile caricare un pacchetto contenente una cornice mediante questo modulo, carica i file manualmente, e posizionali in <b>%s</b>, cioè nella cartella che contiene le cornici del tuo blog. Quindi clicca sul pulsante "<b>Cerca cornici</b>". pLog effettuerà una ricerca nella cartella, ed aggiungerà automaticamente tutte le cornici trovate.';
+$messages['scan_templates'] = 'Cerca cornici';
 
 // site users
-$messages['user_status_active'] = 'Active';
-$messages['user_status_disabled'] = 'Disabled';
-$messages['user_status_all'] = 'All';
-$messages['user_status_unconfirmed'] = 'Unconfirmed';
-$messages['error_invalid_user2'] = 'User with identifier "%s" does not exist';
-$messages['error_deleting_user'] = 'There was an error disabling user "%s"';
-$messages['user_deleted_ok'] = 'User "%s" disabled successfully';
-$messages['users_deleted_ok'] = '%s users disabled successfully';
+$messages['user_status_active'] = 'Attivo';
+$messages['user_status_disabled'] = 'Disabilitato';
+$messages['user_status_all'] = 'Qualunque';
+$messages['user_status_unconfirmed'] = 'Non confermato';
+$messages['error_invalid_user2'] = 'L\'utente con identificativo "%s" non esiste';
+$messages['error_deleting_user'] = 'E\' avvenuto un errore durante la disabilitazione dell\'utente "%s"';
+$messages['user_deleted_ok'] = 'Utente "%s" disabilitato';
+$messages['users_deleted_ok'] = '%s utenti disabilitati';
 
 // create user
-$messages['user_added_ok'] = 'User "%s" added successfully';
-$messages['error_incorrect_username'] = 'The username is not correct or it is already in use';
-$messages['user_status_help'] = 'Current status for this user';
-$messages['user_blog_help'] = 'Blog to which this user will be initially assigned';
-$messages['none'] = 'None';
+$messages['user_added_ok'] = 'Utente "%s" inserito con successo';
+$messages['error_incorrect_username'] = 'Lo username inserito non è corretto oppure è già in uso';
+$messages['user_status_help'] = 'Stato corrente per questo utente:';
+$messages['user_blog_help'] = 'Blog al quale assegnare inizialmente l\'utente';
+$messages['none'] = 'Nessuno';
 
 // edit user
-$messages['error_invalid_user'] = 'The user identifier is not correct or the user does not exist';
-$messages['error_updating_user'] = 'There was an error updating the user settings. Please check the data and try again';
-$messages['blogs'] = 'Blogs';
-$messages['user_blogs_helps'] = 'Blogs which this user currently owns or where this user has access';
-$messages['site_admin'] = 'Administrator';
-$messages['site_admin_help'] = 'Whether this user has administrator privileges and is allowed to see the "Administration" area and perform administrative tasks';
-$messages['user_updated_ok'] = 'User "%s" updated successfully';
+$messages['error_invalid_user'] = 'L\'identificativo dell\'utente non è corretto o l\'utente non esiste';
+$messages['error_updating_user'] = 'E\' avvenuto un errore durante l\'aggiornamento delle impostazioni dell\'utente. Controlla i dati e riprova.';
+$messages['blogs'] = 'Blog';
+$messages['user_blogs_help'] = 'Blog che questo utente possiede al momento, o ai quali ha accesso';
+$messages['site_admin'] = 'Amministratore';
+$messages['site_admin_help'] = 'Selezionare, se questo utente ha privilegi di amministratore e ha i diritti di accesso all\'area amministrativa e di effettuare le operazioni di amministrazione';
+$messages['user_updated_ok'] = 'Utente "%s" aggiornato con successo';
 
 // site blogs
-$messages['blog_status_all'] = 'All';
-$messages['blog_status_active'] = 'Active';
-$messages['blog_status_disabled'] = 'Disabled';
-$messages['blog_status_unconfirmed'] = 'Unconfirmed';
-$messages['owner'] = 'Owner';
+$messages['blog_status_all'] = 'Qualunque';
+$messages['blog_status_active'] = 'Attivo';
+$messages['blog_status_disabled'] = 'Disabilitato';
+$messages['blog_status_unconfirmed'] = 'Non confermato';
+$messages['owner'] = 'Proprietario';
 $messages['quota'] = 'Quota';
-$messages['bytes'] = 'bytes';
-$messages['error_no_blogs_selected'] = 'No blogs were selected to disable';
-$messages['error_blog_is_default_blog'] = 'Blog "%s" cannot be deleted because it is set as the default blog';
-$messages['blog_deleted_ok'] = 'Blog "%s" disabled successfully';
-$messages['blogs_deleted_ok'] = '%s blogs deleted successfully';
-$messages['error_deleting_blog'] = 'There was an error disabling blog "%s"';
-$messages['error_deleting_blog2'] = 'There was an error disabling blog with identifier "%s"';
+$messages['bytes'] = 'byte';
+$messages['error_no_blogs_selected'] = 'Nessun blog è stato selezionato per la disabilitazione';
+$messages['error_blog_is_default_blog'] = 'Il blog "%s" non può essere disabilitato in quanto è stato selezionato come blog predefinito';
+$messages['blog_deleted_ok'] = 'Il blog "%s" è stato disabilitato';
+$messages['blogs_deleted_ok'] = '%s blog disabilitati';
+$messages['error_deleting_blog'] = 'E\' avvenuto un errore durante la disabilitazione del blog "%s"';
+$messages['error_deleting_blog2'] = 'E\' avvenuto un errore durante la disabilitazione del blog con identificativo "%s"';
 
 // create blog
-$messages['error_adding_blog'] = 'There was an error adding the blog. Please check the data and try again';
-$messages['blog_added_ok'] = 'Blog "%s" successfully added';
+$messages['error_adding_blog'] = 'E\' avvenuto un errore durante l\'inserimento del blog. Controlla i dati e riprova.';
+$messages['blog_added_ok'] = 'Il blog "%s" è stato aggiunto';
 
 // edit blog
-$messages['blog_status_help'] = 'Blog status';
-$messages['blog_owner_help'] = 'User who will be set as the owner, with full control on the blog settings';
-$messages['users'] = 'Users';
-$messages['blog_quota_help'] = 'Resource quota in bytes. Set as 0 for unlimited or leave empty to make the blog use the global quota';
-$messages['blog_users_help'] = 'Users who have access to this blog. Select a user from the left and move it to the right list in order to give this user access in this blog';
-$messages['edit_blog_settings_updated_ok'] = 'Blog "%s" updated successfully';
-$messages['error_updating_blog_settings'] = 'There was an error updating blog "%s"';
-$messages['error_incorrect_blog_owner'] = 'The user selected as blog owner is not correct';
-$messages['error_fetching_blog'] = 'There was an error fetching the blog';
-$messages['error_updating_blog_settings2'] = 'There was an error updating the blog. Please check the data and try again';
-$messages['add_or_remove'] = 'Add or remove users';
+$messages['blog_status_help'] = 'Stato del blog';
+$messages['blog_owner_help'] = 'Amministratore del blog, cioè l\'utente che ha il controllo completo delle impostazioni del blog';
+$messages['users'] = 'Utenti';
+$messages['blog_quota_help'] = 'Spazio su disco massimo per le risorse in byte. Imposta a 0 o lascia vuoto per far usare al blog lo spazio su disco generale';
+$messages['blog_users_help'] = 'Utenti che hanno accesso a questo blog. Seleziona un utente da sinistra e spostalo nella lista di destra per dargli accesso al blog';
+$messages['edit_blog_settings_updated_ok'] = 'Blog "%s" aggiornato con successo';
+$messages['error_updating_blog_settings'] = 'E\' avvenuto un errore durante l\'aggiornamento del blog "%s"';
+$messages['error_incorrect_blog_owner'] = 'L\'utente selezionato come amministratore del blog non è corretto';
+$messages['error_fetching_blog'] = 'E\' avvenuto un errore durante la lettura del blog';
+$messages['error_updating_blog_settings2'] = 'E\' avvenuto un errore durante l\'aggiornamento del blog. Controlla i dati e riprova.';
+$messages['add_or_remove'] = 'Aggiungi o rimuovi utenti';
 
 // site locales
-$messages['locale'] = 'Locale';
-$messages['locale_encoding'] = 'Encoding';
-$messages['locale_deleted_ok'] = 'Locale "%s" deleted successfully';
-$messages['error_no_locales_selected'] = 'There were no locales selected to remove';
-$messages['error_deleting_only_locale'] = 'The locale cannot be deleted because is is the only one left in the system';
-$messages['locales_deleted_ok']= '%s locales deleted successfully';
-$messages['error_deleting_locale'] = 'There was an error deleting locale "%s"';
-$messages['error_locale_is_default'] = 'Locale "%s" cannot be deleted because it is the default locale for new blogs';
+$messages['locale'] = 'Lingua';
+$messages['locale_encoding'] = 'Codifica';
+$messages['locale_deleted_ok'] = 'Lingua "%s" cancellata';
+$messages['error_no_locales_selected'] = 'Non è stata selezionata alcuna lingua da cancellare';
+$messages['error_deleting_only_locale'] = 'La lingua non può essere cancellata perché è l\'ultima rimasta nel sistema';
+$messages['locales_deleted_ok']= '%s lingue cancellate';
+$messages['error_deleting_locale'] = 'E\' avvenuto un errore durante la cancellazione della lingua "%s"';
+$messages['error_locale_is_default'] = 'La lingua "%s" non può essere cancellata in quanto è stata selezionata come lingua predefinita per i nuovi blog';
 
 // add locale
-$messages['error_invalid_locale_file'] = 'The locale file is not valid';
-$messages['error_no_new_locales_found'] = 'No new locale files were found';
-$messages['locale_added_ok'] = 'Locale "%s" added successfully';
-$messages['error_saving_locale'] = 'There was an error saving the new locale';
-$messages['scan_locales'] = 'Scan Locales';
-$messages['add_locale_help'] = 'Use this form to upload a new locale file. If it is not possible to upload files using this form, upload the locale file manually and place it in <b>./locales/</b>, which is the folder where locale files are stored and click the "<b>Scan Locales</b>" button. pLog will scan the folder and will automatically add any new locale file can find.';
+$messages['error_invalid_locale_file'] = 'Il file della lingua non è valido';
+$messages['error_no_new_locales_found'] = 'Non sono state trovate nuove lingue';
+$messages['locale_added_ok'] = 'Lingua "%s" inserita con successo';
+$messages['error_saving_locale'] = 'E\' avvenuto un errore durante il salvataggio della nuova lingua';
+$messages['scan_locales'] = 'Cerca lingue';
+$messages['add_locale_help'] = 'Utilizza questo modulo per caricare una nuova lingua. Se non fosse possibile caricare un file mediante questo modulo, caricalo manualmente, e posizionalo in <b>%s</b>, cioè nella cartella che contiene i file di lingua. Quindi clicca sul pulsante "<b>Cerca lingue</b>". pLog effettuerà una ricerca nella cartella, ed aggiungerà automaticamente tutte le lingue trovate.';
 
 // site templates
-$messages['error_template_is_default'] = 'Template "%s" cannot be deleted because it is the default one for new blogs';
+$messages['error_template_is_default'] = 'La cornice "%s" non può essere rimossa in quanto è quella predefinita per i nuovi blog';
 
 // add template
-$messages['global_template_package_help'] = 'Use this form to upload a new template set, which will be available to all blogs in the site. If it is not possible to upload a template package using this form, upload the template set manually and place it in <b>%s</b>, which is the folder where globally available templates are stored and click the "<b>Scan templates</b>" button. pLog will scan the folder and will automatically add any new template it can find.';
+$messages['global_template_package_help'] = '
+Utilizza questo modulo per caricare una nuova cornice, che sarà resa disponibile a tutti i blog nel sito. Se non fosse possibile caricare un pacchetto contenente una cornice mediante questo modulo, carica i file manualmente, e posizionali in <b>%s</b>, cioè nella cartella che contiene le cornici disponibili a tutti i blog. Quindi clicca sul pulsante "<b>Cerca cornici</b>". pLog effettuerà una ricerca nella cartella, ed aggiungerà automaticamente tutte le cornici trovate.';
 
 // global settings
-$messages['site_config_saved_ok'] = 'Site settings saved successfully';
-$messages['error_saving_site_config'] = 'There was an error saving the site settings';
+$messages['site_config_saved_ok'] = 'Le impostazioni del sito sono state salvate';
+$messages['error_saving_site_config'] = 'E\' avvenuto un errore durante il salvataggio delle impostazioni del sito';
 /// general settings
-$messages['help_comments_enabled'] = 'Enable comments for new blogs by default [Default = Yes]';
-$messages['help_beautify_comments_text'] = 'If enabled, comments posted by users will be formatted by adding paragraphs and auto-linking all URLs [Default = Yes]';
-$messages['help_temp_folder'] = 'Folder that pLog can use to write its temporary data such as compiled templates, etc. Use a folder outside the web server tree for incresed security [Default = ./tmp]';
-$messages['help_base_url'] = 'Base URL where this blog is installed';
-$messages['help_subdomains_enabled'] = 'Enable or disable subdomains. Please see the documentation for more information regarding subdomains [Default = No]';
-$messages['help_subdomains_base_url'] = 'When subdomains are enabled, this base URL is used instead of base_url. Use {blogname} to get the blog name and {username} to get the name of the user owner of the blog in order to generate a link to a blog. (i.e. http://{blogname}.yourdomain.com})';
-$messages['help_include_blog_id_in_url'] = 'Meaningful only when subdomains are enabled and "normal" URLs are enabled, forces internally-generated URLs not to have the "blogId" parameter. Do not change unless you know what you are doing [Default = Yes]';
-$messages['help_script_name'] = 'Set this if you need to rename index.php to something else [Default = index.php]';
-$messages['help_show_posts_max'] = 'Maximum number of posts shown in the main page. Only meaningful for new blogs [Default = 15]';
-$messages['help_recent_posts_max'] = 'Maximum number of recent posts shown in the main page. Only meaningful for new blogs [Default = 10]';
-$messages['help_save_drafts_via_xmlhttprequest_enabled'] = 'Whether the feature that allows to save drafts via Javascript and the XmlHttpRequest is enabled [Default = Yes]';
-$messages['help_locale_folder'] = 'Folder where the locale files are stored [Default = ./locale]';
-$messages['help_default_locale'] = 'Default language settings for new blogs [Default = en_UK]';
-$messages['help_default_blog_id'] = 'Default blog that will be shown if no other is specified [Default = 1]';
-$messages['help_default_time_offset'] = 'Default time offset for new blogs [Default = 0]';
-$messages['help_html_allowed_tags_in_comments'] = 'Space-separated list of the HTML tags that are allowed in comments [Default = &lt;a&gt;&lt;i&gt;&lt;br&gt;&lt;br/&gt;&lt;b&gt;]';
-$messages['help_referer_tracker_enabled'] = 'Enable or disable the feature to save referrers to the database. Set to disabled for higher performance [Default = Yes]';
-$messages['help_show_more_enabled'] = 'Enable or disable the "more..." feature by default for new blogs [Default = Yes]';
-$messages['help_update_article_reads'] = 'Enable or disable the update of the counter of times that an article has been read is updated or not. Set to disabled for higher performance [Default = Yes]';
-$messages['help_update_cached_article_reads'] = 'Enable or disable the update of the counter of times that an article has been read is updated, even when caching has been turned on [Default = Yes]';
-$messages['help_xmlrpc_ping_enabled'] = 'Enable or disable sending XMLRPC pings to sites that support this feature [Default = Yes]';
-$messages['help_send_xmlrpc_pings_enabled_by_default'] = 'Enable or disable by default this feature when posting or updating an article [Default = Yes]';
-$messages['help_xmlrpc_ping_hosts'] = 'URL pointing to the XMLRPC interface of sites that support the XMLRPC ping specifictaion. Put each URL in one new line [Default = http://rpc.weblogs.com/RPC2]';
-$messages['help_trackback_server_enabled'] = 'Enable or disable the feature to receive incoming trackbacks [Default = Yes]';
-$messages['help_htmlarea_enabled'] = 'Enable or disable the WYSIWYG post editor by default in new blogs [Default = Yes';
-$messages['help_plugin_manager_enabled'] = 'Enable or disable plugins [Default = Yes]';
-$messages['help_minimum_password_length'] = 'Minimun length for passwords [Default = 4]';
-$messages['help_xhtml_converter_enabled'] = 'If enabled, pLog will try to convert all HTML code into proper XHTML code [Default = Yes]';
-$messages['help_xhtml_converter_aggressive_mode_enabled'] = 'If enabled, pLog will try even harder to generate XHTML out of HTML code, but it will be more prone to errors [Default = No]';
-$messages['help_session_save_path'] = 'Please use this setting to change the folder where pLog stores its session data, via the PHP function session_save_path() Please make sure that the folder is writable by the web server. Leave empty to use PHP\'s default session folder [Default = (empty)]';
+$messages['help_comments_enabled'] = 'Abilita automaticamente i commenti per i nuovi blog. [Predefinito = Sì]';
+$messages['help_beautify_comments_text'] = 'Se abilitato, i commenti aggiunti dagli utenti verranno formattati aggiungendo i marcatori di paragrafo e rendendo cliccabili gli URL [Predefinito = Sì]';
+$messages['help_temp_folder'] = 'Cartella che pLog può usare per scrivere i propri dati temporanei, come le cornici compilate, ecc. Utilizza una cartella al di fuori di quelle accessibili dal server web, per aumentare la sicurezza. [Predefinito = ./tmp]';
+$messages['help_base_url'] = 'URL di base dove è installato questo blog';
+$messages['help_subdomains_enabled'] = 'Abilita o disabilita i sottodomini. Consulta la documentazione per avere maggiori informazioni su questo argomento [Predefinito = No]';
+$messages['help_subdomains_base_url'] = 'Se i sottodomini sono abilitati, questo URL di base è utilizzato al posto del base_url. Per generare i link al blog, usa {blogname} per il nome del blog, e {username} per il nome dell\'utente a cui il blog appartiene (per esempio: http://{blogname}.yourdomain.com)';
+$messages['help_include_blog_id_in_url'] = 'Significativo solamente se sono abilitati sia i sottodomini che gli URL "normali". Forza gli URL generati internamente ad omettere il parametro "blogId". Non cambiare questa impostazione se non ne comprendi a pieno le conseguenze [Predefinito = Sì]';
+$messages['help_script_name'] = 'Modifica questa impostazione se desideri rinominare index.php [Predefinito = index.php]';
+$messages['help_show_posts_max'] = 'Numero massimo di articoli mostrati nella pagina principale. Significativo solo per i nuovi blog [Predefinito = 15]';
+$messages['help_recent_posts_max'] = 'Numero massimo di articoli recenti mostrati nella pagina principale. Significativo solo per i nuovi blog [Predefinito = 10]';
+$messages['help_save_drafts_via_xmlhttprequest_enabled'] = 'Abilita la funzionalità che permette di salvare le bozze utilizzando Javascript e XmlHttpRequest [Predefinito = Sì]';
+$messages['help_locale_folder'] = 'Cartella dove sono contenuti i file di lingua [Predefinito = ./locale]';
+$messages['help_default_locale'] = 'Lingua predefinita per i nuovi blog [Predefinito = en_UK]';
+$messages['help_default_blog_id'] = 'Blog da mostrare se non ne viene esplicitamente specificato uno [Predefinito = 1]';
+$messages['help_default_time_offset'] = 'Fuso orario predefinito per i nuovi blog [Predefinito = 0]';
+$messages['help_html_allowed_tags_in_comments'] = '
+Lista, separata da spazi, dei tag HTML che sono permessi nei commenti [Predefinito = &lt;a&gt;&lt;i&gt;&lt;br&gt;&lt;br/&gt;&lt;b&gt;]';
+$messages['help_referer_tracker_enabled'] = 'Abilita la caratteristica che permette di salvare i referrer nel database. Imposta a No (disabilitato) per aumentare le prestazioni [Predefinito = Sì]';
+$messages['help_show_more_enabled'] = 'Abilita la caratteristica "Continua..." in modo predefinito per i nuovi blog [Predefinito = Sì]';
+$messages['help_update_article_reads'] = 'Abilita l\' aggiornamento del contatore del numero di volte in cui l\'articolo è stato letto. Imposta a No (disabilitato) per aumentare le prestazioni [Predefinito = Sì]';
+$messages['help_update_cached_article_reads'] = 'Abilita l\' aggiornamento del contatore del numero di volte in cui l\'articolo è stato letto, anche nel caso nel quale il caching è stato abilitato [Predefinito = Sì]';
+$messages['help_xmlrpc_ping_enabled'] = 'Abilita la spedizione di ping XMLRPC a siti che supportano questa caratteristica [Predefinito = Sì]';
+$messages['help_send_xmlrpc_pings_enabled_by_default'] = 'Abilita in modo predefinito questa caratteristica quando un articolo viene postato o aggiornato [Predefinito = Sì]';
+$messages['help_xmlrpc_ping_hosts'] = 'URL che puntano alle interfacce ping XMLRPC dei siti che li supportano. Inserire un URL per riga [Predefinito = http://rpc.weblogs.com/RPC2]';
+$messages['help_trackback_server_enabled'] = 'Abilita la ricezione di trackback in ingresso [Predefinito = Sì]';
+$messages['help_htmlarea_enabled'] = 'Abilita l\'editor visuale degli articoli per i nuovi blog in maniera predefinita [Predefinito = Sì]';
+$messages['help_plugin_manager_enabled'] = 'Abilita i plugin [Predefinito = Sì]';
+$messages['help_minimum_password_length'] = 'Lunghezza minima delle password [Predefinito = 4]';
+$messages['help_xhtml_converter_enabled'] = 'Se abilitato, pLog tenterà di convertire il codice HTML in codice XHTML corretto [Predefinito = Sì]';
+$messages['help_xhtml_converter_aggressive_mode_enabled'] = 'Se abilitato, pLog tenterà di convertire il codice HTML in codice XHTML in modo più aggressivo. Questo tuttavia potrà generare errori [Predefinito = No]';
+$messages['help_session_save_path'] = 'Usa questa impostazione per cambiare la cartella nella quale pLog tiene i dati della sessione, mediante la funzione di PHP session_save_path(). Assicurati che la cartella sia scrivibile dal server. Lascia vuoto per utilizzare la cartella delle sessioni predefinita di PHP [Predefinito = (vuoto)]';
 // summary settings
-$messages['help_summary_page_show_max'] = 'Number of items that will be shown in the summary page. This setting control all lists in the summary page (recent articles, most active blogs, etc) [Default = 10]';
-$messages['help_summary_blogs_per_page'] = 'Number of blogs per page in the "Blogs List" section [Default = 25]';
-$messages['help_forbidden_usernames'] = 'List of usernames separated by a blank space that are not allowed to be registered [Default = admin www blog ftp]';
-$messages['help_force_one_blog_per_email_account'] = 'Restrict to only one blog per email account [Default = No]';
-$messages['help_summary_show_agreement'] = 'Show and an agreement text and make users accept it before proceeding to the registration process [Default = Yes]';
-$messages['help_need_email_confirm_registration'] = 'Force users to confirm their registration by clicking a link embedded in an email sent to their account [Default = Yes]';
-$messages['help_summary_disable_registration'] = 'Whether users are allowed to register new blogs in this site [Default = Yes]';
+$messages['help_summary_page_show_max'] = 'Numero di elementi che verranno mostrati nella pagina di riepilogo. Questo parametro controlla tutte le lista nella pagina di sommario (articoli recenti, blog più attivi, ecc.) [Predefinito = 10]';
+$messages['help_summary_blogs_per_page'] = 'Numero di blog per pagina nella sezione "Lista dei blog" [Predefinito = 25]';
+$messages['help_forbidden_usernames'] = 'Lista di nomi utente, separati da spazi, che non possono essere registrati [Predefinito = admin www blog ftp]';
+$messages['help_force_one_blog_per_email_account'] = 'Permetti solo un blog per indirizzo email [Predefinito = No]';
+$messages['help_summary_show_agreement'] = 'Mostra agli utenti un testo con le condizioni da accettare prima di completare il processo di registrazione [Predefinito = Sì]';
+$messages['help_need_email_confirm_registration'] = 'Obbliga gli utenti a confermare la loro registrazione, cliccando un link contenuto in un messaggio email inviato al loro account [Predefinito = Sì]';
+$messages['help_summary_disable_registration'] = 'Disabilita la possibilità di registrare nuovi blog in questo sito [Predefinito = No]';
 // templates
-$messages['help_template_folder'] = 'Folder where templates are stored [Default = ./templates]';
-$messages['help_default_template'] = 'Default template for new blogs [Default = standard]';
-$messages['help_users_can_add_templates'] = 'Allow users to upload their own custom templates [Default = Yes]';
-$messages['help_template_compile_check'] = 'If disabled, Smarty will check every time if template files have changed and if so, use the new version. Set this to disabled for higher performance [Default = Yes]';
-$messages['help_template_cache_enabled'] = 'Enable the template cache. If enabled, the cached version of a page will be used whenever possible. No data will need to be fetched from the database and templates will not need to be recompiled [Default = Yes]';
-$messages['help_template_cache_lifetime'] = 'Lifetime in seconds of the cache. Set to -1 to force the cache to never expire. If set to 0, the cache will be disabled but it is recommended to set template_cache_enabled to "No" in order to disable the cache [Default = 0]';
-$messages['help_template_http_cache_enabled'] = 'Enable support for HTTP conditional requests. If enabled, pLog will take the "If-Modified-Since" HTTP header into account and send only content if strictly needed. Enable this to save bandwidth [Default = No]';
-$messages['help_allow_php_code_in_templates'] = 'Allows to embed native PHP code in Smarty templates inside {php}...{/php} blocks [Default = No]';
+$messages['help_template_folder'] = 'Cartella dove vengono salvate le cornici [Predefinito = ./templates]';
+$messages['help_default_template'] = 'Cornice predefinita per i nuovi blog [Predefinito = standard]';
+$messages['help_users_can_add_templates'] = 'Permette agli utenti di caricare le proprie cornici [Predefinito = Sì]';
+$messages['help_template_compile_check'] = 'Se abilitato, Smarty controllerà ogni volta se i file della cornice sono stati modificati, e, se sì, userà la nuova versione. Disabilitare per aumentare le prestazioni. [Predefinito = Sì]';
+$messages['help_template_cache_enabled'] = 'Abilita la cache delle cornici. Se abilitata, la versione in cache della cornice verrà utilizzata quando possibile. Non sarà necessario estrarre dati dal database, e le cornici non dovranno venire ricompilate [Predefinito = Sì]';
+$messages['help_template_cache_lifetime'] = 'Tempo di validità in secondi della cache. Imposta a -1 per forzare la cache a non scadere mai. Se impostato a 0 la cache verrà disabilitata, per ottenere lo stesso effetto è tuttavia preferibile impostare l\'opzione template_cache_enabled a "No" [Predefinito = -1]';
+$messages['help_template_http_cache_enabled'] = 'Abilita il supporto per le richieste HTTP condizionate. Se abilitate, pLog prenderà in considerazione l\'intestazione HTTP "If-Modified-Since", e spedirà il contenuto solo se strettamente necessario. Abilita per risparmiare banda. [Predefinito = No]';
+$messages['help_allow_php_code_in_templates'] = 'Permetti di incorporare codice PHP nelle cornici Smarty, racchiudendolo in blocchi {php}...{/php} [Predefinito = No]';
 // urls
-$messages['help_request_format_mode'] = 'Select one of the available URL format. If using custom URLs, make sure to configure the settings below [Default = Plain]';
-$messages['plain'] = 'Plain';
-$messages['search_engine_friendly'] = 'Search engine friendly';
-$messages['custom_url_format'] = 'Custom URLs';
-$messages['help_permalink_format'] = 'Format for permalinks when using custom URLs [Default = /blog/{blogname}/{catname}/{year}/{month}/{day}/{postname}$]';
-$messages['help_category_link_format'] = 'Format for links to categories when using custom URLs [Default = /blog/{blogname}/{catname}$]';
-$messages['help_blog_link_format'] = 'Format for links to blogs when using custom URLs [Default = /blog/{blogname}$]';
-$messages['help_archive_link_format'] = 'Format for links to archives when using custom URLs [Default = /blog/{blogname}/archives/{year}/?{month}/?{day}]';
-$messages['help_user_posts_link_format'] = 'Format for articles posted by a certain user when using custom URLs [Default = /blog/{blogname}/user/{username}$]';
-$messages['help_post_trackbacks_link_format'] = 'Format for links to the trackbacks page when using custom URLs [Default = /blog/{blogname}/post/trackbacks/{postname}$]';
-$messages['help_template_link_format'] = 'Format for links to custom static template pages when using custom URLs [Default = /blog/{blogname}/page/{templatename}$]';
-$messages['help_album_link_format'] = 'Format for links to resource albums when using custom URLs [Default = /blog/{blogname}/album/{albumname}$]';
-$messages['help_resource_link_format'] = 'Format for links to resource pages with files when using custom URLs [Default = /blog/{blogname}/resource/{albumname}/{resourcename}$]';
-$messages['help_resource_preview_link_format'] = 'Format for links to resource previews when using custom URLs [Default = /blog/{blogname}/resource/{albumname}/preview/{resourcename}$]';
-$messages['help_resource_medium_size_preview_link_format'] = 'Format for links to medium-sized resource previews when using custom URLs [Default = /blog/{blogname}/resource/{albumname}/preview-med/{resourcename}$]';
-$messages['help_resource_download_link_format'] = 'Format for links to files when using custom URLs [Default = /blog/{blogname}/resource/{albumname}/download/{resourcename}$]';
+$messages['help_request_format_mode'] = 'Seleziona uno dei formati URL disponibili. Se utilizzi URL personalizzati, imposta le opzioni qui sotto [Predefinito = Normale]';
+$messages['plain'] = 'Normale';
+$messages['search_engine_friendly'] = 'Amichevole ai motori di ricerca';
+$messages['custom_url_format'] = 'URL personalizzati';
+$messages['help_permalink_format'] = 'Formato per i link permanenti (permalink) quanto vengono utilizzati URL personalizzati [Predefinito = /blog/{blogname}/{catname}/{year}/{month}/{day}/{postname}$]';
+$messages['help_category_link_format'] = 'Formato dei link alle categorie quando vengono utilizzati URL personalizzati [Predefinito = /blog/{blogname}/{catname}$]';
+$messages['help_blog_link_format'] = 'Formato dei link ai blog quando vengono utilizzati URL personalizzati [Predefinito = /blog/{blogname}$]';
+$messages['help_archive_link_format'] = 'Formato dei link agli archivi quando vengono utilizzati URL personalizzati  [Predefinito = /blog/{blogname}/archives/{year}/?{month}/?{day}]';
+$messages['help_user_posts_link_format'] = 'Formato dei link agli articoli postati da un certo utente quando vengono utilizzati URL personalizzati [Predefinito = /blog/{blogname}/user/{username}$]';
+$messages['help_post_trackbacks_link_format'] = 'Formato dei link alla pagina dei trackback quando vengono utilizzati URL personalizzati [Predefinito = /blog/{blogname}/post/trackbacks/{postname}$]';
+$messages['help_template_link_format'] = 'Formato dei link alle pagine di cornice statiche personalizzate quando vengono utilizzati URL personalizzati [Predefinito = /blog/{blogname}/page/{templatename}$]';
+$messages['help_album_link_format'] = 'Formato dei link agli album delle risorse quando vengono utilizzati URL personalizzati  [Predefinito = /blog/{blogname}/album/{albumname}$]';
+$messages['help_resource_link_format'] = 'Formato dei link alle pagine delle risorse quando vengono utilizzati URL personalizzati  [Predefinito = /blog/{blogname}/resource/{albumname}/{resourcename}$]';
+$messages['help_resource_preview_link_format'] = 'Formato dei link alle anteprime delle risorse quando vengono utilizzati URL personalizzati  [Predefinito = /blog/{blogname}/resource/{albumname}/preview/{resourcename}$]';
+$messages['help_resource_medium_size_preview_link_format'] = 'Formato dei link alle anteprime di medie dimensioni delle risorse quando vengono utilizzati URL personalizzati  [Predefinito = /blog/{blogname}/resource/{albumname}/preview-med/{resourcename}$]';
+$messages['help_resource_download_link_format'] = 'Formato dei link ai file quando vengono utilizzati URL personalizzati  [Predefinito = /blog/{blogname}/resource/{albumname}/download/{resourcename}$]';
 // email
-$messages['help_check_email_address_validity'] = 'When checking email addresses, perform some basic checks to see whether an MX record exists in the given domain and if so, if the email address is actually a valid mailbox [Default = No]';
-$messages['help_email_service_enabled'] = 'Enable or disable sending out emails [Default = Yes]';
-$messages['help_post_notification_source_address'] = 'Email address that will appear in the "From:" field when sending emails from pLog [Default = noreply at your.host.com]';
-$messages['help_email_service_type'] = 'Which system to use in order to send emails [Default = PHP]';
-$messages['help_smtp_host'] = 'If using SMTP as the email sending system, set this to the SMTP server that will be used to send out the messages [Default = (empty)]';
-$messages['help_smtp_port'] = 'If the SMTP server is running in a port other than 25, configure this value [Default = (empty)]';
-$messages['help_smtp_use_authentication'] = 'Enable this if the SMTP server requires basic authentication  [Default = No]';
-$messages['help_smtp_username'] = 'If the SMTP server requires authentication, set this to the right username [Default = (empty)]';
-$messages['help_smtp_password'] = 'If the SMTP server requires authentication, set this to the password of the username above [Default = (empty)]';
+$messages['help_check_email_address_validity'] = 'Durante il controllo dell\'indirizzo email, esegui alcuni controlli di base per vedere se esiste un record MX nel dominio specificato, e, in tal caso, se la casella è effettivamente valida [Predefinito = No]';
+$messages['help_email_service_enabled'] = 'Abilita la spedizione di email [Predefinito = Sì]';
+$messages['help_post_notification_source_address'] = 'Indirizzo email che compare nel campo "Da:" ("From:") nelle email spedite da pLog [Predefinito = noreply at your.host.com]';
+$messages['help_email_service_type'] = 'Sistema da usare per la spedizione delle email [Predefinito = PHP]';
+$messages['help_smtp_host'] = 'Se viene utilizzato SMTP per la spedizione delle email, imposta qui il server SMTP che verrà utilizzato per la spedizione [Predefinito = (vuoto)]';
+$messages['help_smtp_port'] = 'Se il server SMTP utilizza una porta differente dalla 25, configura qui il suo valore [Predefinito = (vuoto)]';
+$messages['help_smtp_use_authentication'] = 'Rispondi Sì se il server richiede l\'autenticazione di base [Predefinito = No]';
+$messages['help_smtp_username'] = 'Se il server SMTP richiede autenticazione, imposta qui il nome utente [Predefinito = (vuoto)]';
+$messages['help_smtp_password'] = 'Se il server SMTP richiede autenticazione, imposta qui la password [Predefinito = (vuoto)]';
 // helpers
-$messages['help_path_to_tar'] = 'Path to the "tar" tool, needed to unpack template sets in .tar.gz or tar.bz2 formats [Default = /bin/tar]';
-$messages['help_path_to_gzip'] = 'Path to the "gzip" tool, needed to unpack template sets in .tar.gz format [Default = /bin/gzip]';
-$messages['help_path_to_bz2'] = 'Path to the "bzip2" tool, needed to unpack template sets in .tar.bz2 format [Default = /usr/bin/bzip2]';
-$messages['help_path_to_unzip'] = 'Path to the "unzip" tool, needed to unpack template sets in .zip format [Default = /usr/bin/unzip]';
-$messages['help_unzip_use_native_version'] = 'Use a bundled PHP native version to unpack .zip files [Default = No]';
+$messages['help_path_to_tar'] = 'Percorso al comando "tar", necessario per scompattare i pacchetti cornice in formato .tar.gz o tar.bz2 [Predefinito = /bin/tar]';
+$messages['help_path_to_gzip'] = 'Percorso al comando "gzip", necessario per scompattare i pacchetti cornice in formato .tar.gz [Predefinito = /bin/gzip]';
+$messages['help_path_to_bz2'] = 'Percorso al comando "bzip2", necessario per scompattare i pacchetti cornice in formato .tar.bz2 [Predefinito = /usr/bin/bzip2]';
+$messages['help_path_to_unzip'] = 'Percorso al comando "unzip", necessario per scompattare i pacchetti cornice in formato .zip [Predefinito = /usr/bin/unzip]';
+$messages['help_unzip_use_native_version'] = 'Usa lo zip fornito nativamente da PHP per scompattare gli archivi zip [Predefinito = No]';
 // uploads
-$messages['help_uploads_enabled'] = 'Whether users are allowed to upload files. This affects the resources section and the upload of custom templates and locales [Default = Yes]';
-$messages['help_maximum_file_upload_size'] = 'Maximum file size allowed in bytes. This limit will never be higher than PHP\'s own limit  [Default = 2000000]';
-$messages['help_upload_forbidden_files'] = 'Space-separated list of file types not allowed to be uploaded. Usage of \'*\' and \'?\' is allowed [Default = *.php *.php3 *.php4 *.phtml]';
+$messages['help_uploads_enabled'] = 'Abilita gli utenti a caricare file. Questo riguarda la sezione delle risorse e il caricamento di cornici personalizzate e lingue [Predefinito = Sì]';
+$messages['help_maximum_file_upload_size'] = 'Dimensione massima del file in byte. Questo limite non può superare quello impostato per PHP [Predefinito = 2000000]';
+$messages['help_upload_forbidden_files'] = 'Lista dei tipi di file che non possono essere caricati. E\' possibile usare \'*\' e \'?\' [Predefinito = *.php *.php3 *.php4 *.phtml]';
 // interfaces
-$messages['help_xmlrpc_api_enabled'] = 'Enable or disable access via XMLRPC to blogs [Default = No]';
-$messages['help_rdf_enabled'] = 'Enable the syndication of contents via Atom or RSS [Default = Yes]';
-$messages['help_default_rss_profile'] = 'Default version of RSS or Atom used to syndicate contents unless otherwise specified [Default = RSS 1.0]';
+$messages['help_xmlrpc_api_enabled'] = 'Abilita l\'accesso ai blog mediante XMLRPC [Predefinito = No]';
+$messages['help_rdf_enabled'] = 'Abilita la preparazione dei contenuti mediante Atom e RSS (syndication) [Predefinito = Sì]';
+$messages['help_default_rss_profile'] = 'Versione predefinita di RSS o Atom da usare per la preparazione dei contenuti, quando non specificato diversamente [Predefinito = RSS 1.0]';
 // security
-$messages['security_pipeline_enabled'] = 'Enable the security pipeline and all related filters. This also affects plugins that register new filters [Default = Yes]';
-$messages['help_ip_address_filter_enabled'] = 'Enable the IP address filter. The security pipeline also needs to be enabled in order for this feature to work [Default = Yes]';
-$messages['help_content_filter_enabled'] = 'Enable the regular expression-based content filter. The security pipeline also needs to be enabled in order for this feature to work [Default = Yes]';
-$messages['help_maximum_comment_size'] = 'Maximum size in bytes that a comment can have, set to 0 to disable this feature [Default = 0]';
+$messages['help_security_pipeline_enabled'] = 'Abilita la pipeline relativa alla sicurezza e tutti i filtri connessi. Questo influenza anche i plugin che registrano nuovi filtri  [Predefinito = Sì]';
+$messages['help_ip_address_filter_enabled'] = 'Abilita il filtro degli indirizzi IP. Per abilitare questa caratteristica è necessario abilitare anche la pipeline relativa alla sicurezza [Predefinito = Sì]';
+$messages['help_content_filter_enabled'] = 'Abilita il filtro sui contenuti basato sulle espressioni regolari. Per abilitare questa caratteristica è necessario abilitare anche la pipeline relativa alla sicurezza [Predefinito = Sì]';
+$messages['help_maximum_comment_size'] = 'Dimensione massima in byte che un commento può avere. Imposta a 0 per disabilitare questo controllo [Predefinito = 0]';
 // bayesian filter
-$messages['help_bayesian_filter_enabled'] = 'Enable the Bayesian filter for improved automatic spam filterting  [Default = Yes]';
-$messages['help_bayesian_filter_spam_probability_treshold'] = 'Maximum threshold before which a comment can be considered spam  [Default = 0.9]';
-$messages['help_bayesian_filter_nonspam_probability_treshold'] = 'Minimum threshold after which a post can be considered non-spam [Default = 0.2]';
-$messages['help_bayesian_filter_min_length_token'] = 'Minimum length of a token in order for it to be considered meaningful for the Bayesian filter  [Default = 3]';
-$messages['help_bayesian_filter_max_length_token'] = 'Maximum length of a token in order for it to be considered meaningful for the Bayesian filter  [Default = 100]';
-$messages['help_bayesian_filter_number_significant_tokens'] = 'Number of significant tokens  [Default = 15]';
-$messages['help_bayesian_filter_spam_comments_action'] = 'What to do with comments that are considered spam. Set to "Throw away" only when your filter has been properly trained  [Default = Keep]';
-$messages['keep_spam_comments'] = 'Keep in the database marked as "Spam"';
-$messages['throw_away_spam_comments'] = 'Throw them away (do not save them)';
+$messages['help_bayesian_filter_enabled'] = 'Abilita il filtro Bayesiano per ottenere un filtraggio automatico dello spam [Predefinito = Sì]';
+$messages['help_bayesian_filter_spam_probability_treshold'] = 'Soglia massima prima della quale un commento può essere considerato spam [Predefinito = 0.9]';
+$messages['help_bayesian_filter_nonspam_probability_treshold'] = 'Soglia minima dopo la quale un articolo può essere considerato non spam [Predefinito = 0.2]';
+$messages['help_bayesian_filter_min_length_token'] = 'Lunghezza minima di un simbolo affinché venga considerato significativo per il filtro Bayesiano [Predefinito = 3]';
+$messages['help_bayesian_filter_max_length_token'] = 'Lunghezza massima di un simbolo affinché venga considerato significativo per il filtro Bayesiano [Predefinito = 100]';
+$messages['help_bayesian_filter_number_significant_tokens'] = 'Numero di simboli significativi [Predefinito = 15]';
+$messages['help_bayesian_filter_spam_comments_action'] = 'Cosa fare con i commenti classificati spam  [Predefinito = Conserva]';
+$messages['keep_spam_comments'] = 'Conservali nel database, marcandoli come "Spam"';
+$messages['throw_away_spam_comments'] = 'Cancellali senza salvarli';
 // resources
-$messages['help_resources_enabled'] = 'Enable or disable resources [Default = Yes]';
-$messages['help_resources_folder'] = 'Folder where resource files will be kept. Set outside the web server tree for increased security  [Default = ./gallery]';
-$messages['help_thumbnail_method'] = 'Method used to generate thumbnails. If using PHP, support for GD is required  [Default = PHP]';
-$messages['help_path_to_convert'] = 'Path to the "convert" tool from the ImageMagick package. Mandatory if the thumbnail method is "ImageMagick"  [Default = /usr/bin/convert]';
-$messages['help_thumbnail_format'] = 'Format in which thumbnails are saved  [Default = Same as image]';
-$messages['help_thumbnail_height'] = 'Default height for small thumbnails  [Default = 120]';
-$messages['help_thumbnail_width'] = 'Default width for small thumbnails  [Default = 120]';
-$messages['help_medium_size_thumbnail_height'] = 'Default height for medium thumbnails  [Default = 480]';
-$messages['help_medium_size_thumbnail_width'] = 'Default width for medium thumbnails  [Default = 640]';
-$messages['help_thumbnails_keep_aspect_ratio'] = 'Keep the aspect ratio when generating thumbnails. Might generate thumbnails bigger than the sizes specified above but quality is better [Default = Yes]';
-$messages['help_thumbnail_generator_force_use_gd1'] = 'Force pLog to use GD1-only functions [Default = No]';
-$messages['help_thumbnail_generator_user_smoothing_algorithm'] = 'Algorithm used to smooth thumbnails. Only used when the thumbnail method is GD [Default = Yes]';
-$messages['help_resources_quota'] = 'Global resource quota for blogs in bytes (i.e. 5242880 Bytes = 5MB), or set to 0 for unlimited quota [Default = 0]';
-$messages['help_resource_server_http_cache_enabled'] = 'Enable support for the "If-Modified-Since" header and HTTP conditional requests. Enable for increased bandwidth savings  [Default = No]';
-$messages['help_resource_server_http_cache_lifetime'] = 'Time in microseconds that clients should use the cached version of resources [Default = 9999999]';
+$messages['help_resources_enabled'] = 'Abilita le risorse [Predefinito = Sì]';
+$messages['help_resources_folder'] = 'Cartella dove le risorse sono salvate. Seleziona una cartella al di fuori del server, per aumentare la sicurezza [Predefinito = ./gallery]';
+$messages['help_thumbnail_method'] = 'Metodo utilizzato per la generazione delle miniature. Se viene usato PHO, è necessario il supporto per GD [Predefinito = PHP]';
+$messages['help_path_to_convert'] = 'Percorso del comando "convert" di ImageMagick. Obbligatorio se il metodo di creazione delle miniature è "ImageMagick" [Predefinito = /usr/bin/convert]';
+$messages['help_thumbnail_format'] = 'Formato nel quale vengono salvate le miniature [Predefinito = Quello dell\'immagine]';
+$messages['help_thumbnail_height'] = 'Altezza predefinita per le miniature piccole [Predefinito = 120]';
+$messages['help_thumbnail_width'] = 'Larghezza predefinita per le miniature piccole [Predefinito = 120]';
+$messages['help_medium_size_thumbnail_height'] = 'Altezza predefinita per le miniature [Predefinito = 480]';
+$messages['help_medium_size_thumbnail_width'] = 'Larghezza predefinita per le miniature medie [Predefinito = 640]';
+$messages['help_thumbnails_keep_aspect_ratio'] = 'Mantieni le proporzioni nella generazione delle anteprime. Se abilitato, le anteprime potrebbero essere di dimensioni maggiori di quanto specificato sopra, tuttavia la qualità è migliore [Predefinito = Sì]';
+$messages['help_thumbnail_generator_force_use_gd1'] = 'Permetti a pLog di usare solamente le funzioni di GD-1 [Predefinito = No]';
+$messages['help_thumbnail_generator_user_smoothing_algorithm'] = 'Algoritmo per lo smoothing delle miniature. Utilizzato solamente se il metodo per le miniature è GD [Predefinito = Sì]';
+$messages['help_resources_quota'] = 'Spazio su disco massimo disponibile per i blog in byte (esempio: 5242880 Byte = 5MB). Impostare a 0 per non porre limite [Predefinito = 0]';
+$messages['help_resource_server_http_cache_enabled'] = 'Abilita il supporto per le richieste HTTP condizionate, con intestazione "If-Modified-Since".. Abilita per migliorare il risparmio di banda [Predefinito = No]';
+$messages['help_resource_server_http_cache_lifetime'] = 'Tempo in microsecondi per il quale i client devono usare la versione in cache delle risorse [Predefinito = 9999999]';
+$messages['same_as_image'] = 'Come l\'immagine originale';
+
 // search
-$messages['help_search_engine_enabled'] = 'Enable the search engine  [Default = Yes]';
-$messages['help_search_in_custom_fields'] = 'Search in custom fields  [Default = Yes]';
-$messages['help_search_in_comments'] = 'Search in comments  [Default = Yes]';
+$messages['help_search_engine_enabled'] = 'Abilita il motore di ricerca [Predefinito = Sì]';
+$messages['help_search_in_custom_fields'] = 'Cerca nei campi personalizzati  [Predefinito = Sì]';
+$messages['help_search_in_comments'] = 'Cerca nei commenti [Predefinito = Sì]';
 
 // cleanup
-$messages['purge'] = 'Purge';
-$messages['cleanup_spam'] = 'Purge Spam';
-$messages['cleanup_spam_help'] = 'This will remove all comments that have been marked as spam by users. It will not be possible to recover them once they have been removed';
-$messages['spam_comments_purged_ok'] = 'Spam comments purged successfully';
-$messages['cleanup_posts'] = 'Purge Posts';
-$messages['cleanup_posts_help'] = 'This will remove all posts that have been deleted by users (marked as "Deleted") It will not be possible to recover them once they have been removed';
-$messages['posts_purged_ok'] = 'Posts purged successfully';
+$messages['purge'] = 'Pulisci';
+$messages['cleanup_spam'] = 'Pulisci lo spam';
+$messages['cleanup_spam_help'] = 'Tutti i commenti marcati dagli utenti come spam verranno eliminati. Non sarà possibile annullare l\'operazione, una volta cancellati';
+$messages['spam_comments_purged_ok'] = 'Commenti marcati come spam cancellati';
+$messages['cleanup_posts'] = 'Pulisci gli articoli';
+$messages['cleanup_posts_help'] = 'Tutti gli articoli cancellati (marcati dagli utenti come "cancellati") verranno eliminati. Non sarà possibile annullare l\'operazione, una volta cancellati';
+$messages['posts_purged_ok'] = 'Articoli cancellati';
 
 /// summary ///
 // front page
-$messages['summary'] = 'Summary';
-$messages['register'] = 'Register';
-$messages['summary_welcome'] = 'Welcome!';
-$messages['summary_most_active_blogs'] = 'Most Active Blogs';
-$messages['summary_most_commented_articles'] = 'Most Commented Articles';
-$messages['summary_most_read_articles'] = 'Most Read articles';
-$messages['password_forgotten'] = 'Forgot your password?';
-$messages['summary_newest_blogs'] = 'Newest Blogs';
-$messages['summary_latest_posts'] = 'Latest Posts';
-$messages['summary_search_blogs'] = 'Search Blogs';
+$messages['summary'] = 'Sommario';
+$messages['register'] = 'Registrati';
+$messages['summary_welcome'] = 'Benvenuto!';
+$messages['summary_most_active_blogs'] = 'I blog più attivi';
+$messages['summary_most_commented_articles'] = 'Gli articoli più commentati';
+$messages['summary_most_read_articles'] = 'Gli articoli più letti';
+$messages['password_forgotten'] = 'Dimenticato la password?';
+$messages['summary_newest_blogs'] = 'I blog più recenti';
+$messages['summary_latest_posts'] = 'Gli articoli più recenti';
+$messages['summary_search_blogs'] = 'Cerca nei blog';
 
 // blog list
-$messages['updated'] = 'Updated';
+$messages['updated'] = 'Aggiornato';
 $messages['total_reads'] = 'tota';
 
 // blog profile
 $messages['blog'] = 'Blog';
-$messages['latest_posts'] = 'Latest posts';
+$messages['latest_posts'] = 'Articoli recenti';
 
 // registration
-$messages['register_step0_title'] = 'Service terms acceptance';
-$messages['decline'] = 'Decline';
-$messages['accept'] = 'Accept';
-$messages['read_service_agreement'] = 'Please read the terms of this service and click the "Accept" button if you agree';
-$messages['register_step1_title'] = 'Create a user [1/4]';
-$messages['register_step1_help'] = 'First you need to create a new user in order to get a blog. This user will be the owner of the blog and will have access to all its functionalities';
-$messages['register_next'] = 'Next';
-$messages['register_back'] = 'Back';
-$messages['register_step2_title'] = 'Create a blog [2/4]';
-$messages['register_blog_name_help'] = 'Name for your new blog';
-$messages['register_step3_title'] = 'Choose a Template [3/4]';
-$messages['step1'] = 'Step 1';
-$messages['step2'] = 'Step 2';
-$messages['step3'] = 'Step 3';
-$messages['register_step3_help'] = 'Please select one of the available templates as the default one for your blog. If you do not like it later on, it can always be changed';
-$messages['error_must_choose_template'] = 'Please select one template';
-$messages['select_template'] = 'Select template';
-$messages['register_step5_title'] = 'Congratulations! [4/4]';
-$messages['finish'] = 'Finish';
-$messages['register_need_confirmation'] = 'An email message including the confirmation has been sent to your email address, please click the link as soon as you receive the message to start blogging!';
-$messages['register_step5_help'] = 'Congratulations, your new user and blog have been successfully created!';
-$messages['register_blog_link'] = 'If you would like to take a look at your new blog, you can go there now: <a href="%2$s">%1$s</a>';
-$messages['register_blog_admin_link'] = 'If you prefer to start posting right away, please click to go to the <a href="admin.php">administration interface</a>';
-$messages['register_error'] = 'There was an error during the process';
-$messages['error_registration_disabled'] = 'Sorry, registration of new blogs in this site has been disabled';
+$messages['register_step0_title'] = 'Accettazione delle condizioni del servizio';
+$messages['agreement'] = 'Accordo'; 
+$messages['decline'] = 'Rifiuta';
+$messages['accept'] = 'Accetta';
+$messages['read_service_agreement'] = 'Leggi le condizioni di questo servizio, e clicca sul pulsante "Accetta" se sei d\'accordo';
+$messages['register_step1_title'] = 'Crea un utente [1/4]';
+$messages['register_step1_help'] = 'Per prima cosa, per avere un blog è necessario creare un utente. Questo utente sarà il proprietario del blog, ed avrà accesso a tutte le sue funzionalità.';
+$messages['register_next'] = 'Avanti';
+$messages['register_back'] = 'Indietro';
+$messages['register_step2_title'] = 'Crea un blog [2/4]';
+$messages['register_blog_name_help'] = 'Nome del nuovo blog';
+$messages['register_step3_title'] = 'Seleziona una cornice [3/4]';
+$messages['step1'] = 'Passo 1';
+$messages['step2'] = 'Passo 2';
+$messages['step3'] = 'Passo 3';
+$messages['register_step3_help'] = 'Seleziona una delle cornici disponibili, che diventerà quella predefinita del tuo blog. Sarà sempre possibile cambiarla in seguito';
+$messages['error_must_choose_template'] = 'E\' necessario selezionare una cornice';
+$messages['select_template'] = 'Seleziona una cornice';
+$messages['register_step5_title'] = 'Congratulazioni! [4/4]';
+$messages['finish'] = 'Termina';
+$messages['register_need_confirmation'] = 'Un messaggio di posta elettronica è stato spedito al tuo indirizzo email, per confermare l\'attivazione. Appena lo ricevi, clicca sul link che contiene, per poter iniziare a usare il tuo blog!';
+$messages['register_step5_help'] = 'Congratulazioni! Il tuo nuovo utente e il tuo blog sono stati creati';
+$messages['register_blog_link'] = 'Se vuoi dare un\'occhiata al tuo nuovo blog, usa questo link: <a href="%2$s">%1$s</a>';
+$messages['register_blog_admin_link'] = 'Se preferisci scrivere un articolo subito, clicca qui per entrare nell\'<a href="admin.php">interfaccia di amministrazione</a>';
+$messages['register_error'] = 'E\' avvenuto un errore durante l\'operazione';
+$messages['error_registration_disabled'] = 'Spiacente, ma la creazione di nuovi blog è stata disabilitata in questo sito';
 // registration article topic and text
-$messages['register_default_article_topic'] = 'Congratulations!';
-$messages['register_default_article_text'] = 'If you can read this post, it means that the registration process was successful and that you can start blogging';
-$messages['register_default_category'] = 'General';
+$messages['register_default_article_topic'] = 'Congratulazioni!';
+$messages['register_default_article_text'] = 'Se stai leggendo questo articolo, significa che il processo di registrazione è stato completato con successo: puoi cominciare ad usare il tuo blog!';
+$messages['register_default_category'] = 'Generale';
 // confirmation email
-$messages['register_confirmation_email_text'] = 'Please click the link below in order to activate your blog:
+$messages['register_confirmation_email_text'] = 'Visita la seguente pagina per attivare il tuo blog:
 
 %s
 
-Have a nice day';
-$messages['error_invalid_activation_code'] = 'Sorry, the confirmation code is not valid';
-$messages['blog_activated_ok'] = 'Congratulations, your new user and blog have been successfully validated!';
+Ciao!';
+$messages['error_invalid_activation_code'] = 'Spiacente, ma il codice di conferma non è valido';
+$messages['blog_activated_ok'] = 'Congratulazioni! Il tuo nuovo utente ed il tuo blog sono stati convalidati con successo';
 // forgot your password?
-$messages['reset_password'] = 'Reset your password';
-$messages['reset_password_username_help'] = 'Name of the user whose password you would like to reset';
-$messages['reset_password_email_help'] = 'Email address which was used to register this user';
-$messages['reset_password_help'] = 'Use this form to reset the password of your user, should you not remember it. Please type the name of the user whose password you would like to reset, as well as the email address that was used to register this user';
-$messages['error_resetting_password'] = 'There was an error resetting the password. Please check the data and try again';
-$messages['reset_password_error_incorrect_email_address'] = 'The email address is not correct or it is not the email address used to register this user';
-$messages['password_reset_message_sent_ok'] = 'An email message with a link has been sent to your email address. Please click the link in order to reset your password';
-$messages['error_incorrect_request'] = 'The parameters in the URL are not correct';
-$messages['change_password'] = 'Set new password';
-$messages['change_password_help'] = 'Please type and confirm your new password';
-$messages['new_password'] = 'New password';
-$messages['new_password_help'] = 'Type here your new password';
-$messages['password_updated_ok'] = 'Your password has been successfully updated';
+$messages['reset_password'] = 'Reimposta la tua password';
+$messages['reset_password_username_help'] = 'Nome dell\'utente a cui reimpostare la password';
+$messages['reset_password_email_help'] = 'Indirizzo email che è stato utilizzato per registrare questo utente';
+$messages['reset_password_help'] = 'Usa questo form per reimpostare la password del tuo utente, nel caso te la fossi dimenticata. Inserisci il nome dell\'utente, di cui vorresti reimpostare la password, e l\'indirizzo email che è stato usato, per registrare l\'utente';
+$messages['error_resetting_password'] = 'E\' avvenuto un errore durante l\'azzeramento della password. Controlla i dati e riprova';
+$messages['reset_password_error_incorrect_email_address'] = 'L\'indirizzo email non è corretto, o non è l\'indirizzo usato per la registrazione di questo utente';
+$messages['password_reset_message_sent_ok'] = 'Un messaggio con un link è stato inviato al tuo indirizzo di posta elettronica. Visita il link che contiene, per reimpostare la tua password';
+$messages['error_incorrect_request'] = 'I parametri nell\'URL non sono corretti';
+$messages['change_password'] = 'Imposta la nuova password';
+$messages['change_password_help'] = 'Inserisci e conferma la tua nuova password';
+$messages['new_password'] = 'Nuova password';
+$messages['new_password_help'] = 'Inserisci qui la tua nuova password';
+$messages['password_updated_ok'] = 'La password è stata modificata';
 
 // Suggested by BCSE, some useful messages that not available in official locale
-$messages['upgrade_information'] = 'This page looks plain and unstyled because you\'re using a non-standard compliant browser. To see it in its best form, please <a href="http://www.webstandards.org/upgrade/" title="The Web Standards Project\'s Browser Upgrade initiative">upgrade</a> to a browser that supports web standards. It\'s free and painless.';
-$messages['jump_to_navigation'] = 'Jump to Navigation.';
-$messages['comment_email_never_display'] = 'Line and paragraph breaks automatic, e-mail address never displayed.';
-$messages['comment_html_allowed'] = '<acronym title="Hypertext Markup Language">HTML</acronym> allowed: &lt;<acronym title="Hyperlink">a</acronym> href=&quot;&quot; title=&quot;&quot; rel=&quot;&quot;&gt; &lt;<acronym title="Acronym Description">acronym</acronym> title=&quot;&quot;&gt; &lt;<acronym title="Quote">blockquote</acronym> cite=&quot;&quot;&gt; &lt;<acronym title="Strike">del</acronym>&gt; &lt;<acronym title="Italic">em</acronym>&gt; &lt;<acronym title="Underline">ins</acronym>&gt; &lt;<acronym title="Bold">strong</acronym>&gt;';
-$messages['trackback_uri'] = 'The <acronym title="Uniform Resource Identifier">URI</acronym> to trackback this entry is: ';
-$messages['previous_post'] = 'Previous';
-$messages['next_post'] = 'Next';
-$messages['comment_default_title'] = '(Untitled)';
-$messages['guestbook'] = 'Guestbook';
-$messages['trackbacks'] = 'Trackbacks';
-$messages['menu'] = 'Menu';
-$messages['albums'] = 'Albums';
-$messages['admin'] = 'Admin';
-?>
\ No newline at end of file
+$messages['upgrade_information'] = 'Questa pagina ha un aspetto semplice e senza stile, perché stai usando un browser che non è compatibile con gli standard. Per vederlo nel suo aspetto migliore, ti preghiamo di <a href="http://www.webstandards.org/upgrade/" title="The Web Standards Project\'s Browser Upgrade initiative">aggiornarlo</a> ad un browser che supporti gli standard del web. E\' gratis, ed è indolore.';
+$messages['jump_to_navigation'] = 'Vai alla navigazione.';
+$messages['comment_email_never_display'] = 'Le interruzioni di linea e paragrafo sono automatiche. La tua email non sarà mai mostrata.';
+$messages['comment_html_allowed'] = '<acronym title="Hypertext Markup Language">HTML</acronym> permesso: &lt;<acronym title="Link ipertestuale">a</acronym> href=&quot;&quot; title=&quot;&quot; rel=&quot;&quot;&gt; &lt;<acronym title="Descrizione di acronimo">acronym</acronym> title=&quot;&quot;&gt; &lt;<acronym title="Indentazione">blockquote</acronym> cite=&quot;&quot;&gt; &lt;<acronym title="Sbarrato">del</acronym>&gt; &lt;<acronym title="Corsivo">em</acronym>&gt; &lt;<acronym title="Sottolineato">ins</acronym>&gt; &lt;<acronym title="Grassetto">strong</acronym>&gt;';
+$messages['trackback_uri'] = 'L\'<acronym title="Uniform Resource Identifier">URI</acronym> per il trackback di questa entità è: ';
+$messages['previous_post'] = 'Precedente';
+$messages['next_post'] = 'Successivo';
+$messages['comment_default_title'] = '(Senza titolo)';
+$messages['guestbook'] = 'Libro degli ospiti';
+$messages['trackbacks'] = 'Trackback';
+$messages['menu'] = 'Menù';
+$messages['albums'] = 'Album';
+$messages['admin'] = 'Amministratore';
+
+//
+// new strings for 1.1 -- no need to translate yet!
+//
+$messages['error_incorrect_trackback_id'] = 'L\'identificatore del trackback non è corretto';
+$messages['error_marking_trackback_as_spam'] = 'E\' avvenuto un errore nella classificazione del trackback come spam';
+$messages['trackback_marked_as_spam_ok'] = 'Il trackback è stato classificato come spam';
+$messages['error_marking_trackback_as_nonspam'] = 'E\' avvenuto un errore nella classificazione del trackback come non-spam';
+$messages['trackback_marked_as_nonspam_ok'] = 'Il trackback è stato classificato come non-spam';
+$messages['upload_here'] = 'Carica qui';
+$messages['reply_string'] = 'Re: ';
+$messages['cleanup_users'] = 'Pulizia degli utenti';
+$messages['cleanup_users_help'] = 'Verranno rimossi tutti gli utenti cancellati dall\'amministratore (marcati come cancellati). Verranno eliminati anche tutti i blog appartenenti a quegli utenti, assieme a tutto il loro contenuto. Se l\'utente era autorizzato a pubblicare articoli su altri blog, anche questi articoli verranno eliminati. Questa operazione non può essere annullata.';
+$messages['users_purged_ok'] = 'Pulizia utenti completata';
+$messages['cleanup_blogs'] = 'Pulizia dei blog';
+$messages['cleanup_blogs_help'] = 'Verranno rimossi tutti i blog che sono stati cancellati dall\'amministratore (marcati come cancellati). Tutto il contenuto di questi blog verrà eliminato. Una volta eliminati, questi blog non potranno essere ripristinati.';
+$messages['blogs_purged_ok'] = 'Pulizia dei blog completata';
+?>

Modified: plog/trunk/locale/locale_nb_NO.php
===================================================================
--- plog/trunk/locale/locale_nb_NO.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/locale/locale_nb_NO.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -630,7 +630,7 @@
 $messages['error_invalid_user'] = 'Bruker ID er ikke gyldig eller brukeren eksisterer ikke';
 $messages['error_updating_user'] = 'Det oppsto en feil under oppdateringen av brukerinstillingene. Vennligst sjekk det du tastet inn og prøv igjen';
 $messages['blogs'] = 'Blogger';
-$messages['user_blogs_helps'] = 'Blogger denne brukeren "eier" eller har tilgang til';
+$messages['user_blogs_help'] = 'Blogger denne brukeren "eier" eller har tilgang til';
 $messages['site_admin'] = 'Administrator';
 $messages['site_admin_help'] = 'Om denne brukeren har administratorrettigheter og har tilgang til administrasjonsområdet';
 $messages['user_updated_ok'] = 'Bruker "%s" oppdatert, ok';

Modified: plog/trunk/locale/locale_pt_BR.php
===================================================================
--- plog/trunk/locale/locale_pt_BR.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/locale/locale_pt_BR.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -612,7 +612,7 @@
 $messages['error_invalid_user'] = 'O identificador do usuário não está correto ou o usuário não existe';
 $messages['error_updating_user'] = 'Houve erro na atualização das configurações do usuário. Verifique os dados e tente novamente';
 $messages['blogs'] = 'Blogs';
-$messages['user_blogs_helps'] = 'Blogs dos quais este usuário é dono ou aos quais tem acesso';
+$messages['user_blogs_help'] = 'Blogs dos quais este usuário é dono ou aos quais tem acesso';
 $messages['site_admin'] = 'Administrador';
 $messages['site_admin_help'] = 'Se este usuário possui privilégios de administrador e portanto lhe é permitido ver a área "Administração" e executar tarefas administrativas';
 $messages['user_updated_ok'] = 'Usuário "%s" atualizado com sucesso';

Modified: plog/trunk/locale/locale_zh_CN.php
===================================================================
--- plog/trunk/locale/locale_zh_CN.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/locale/locale_zh_CN.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -1,9 +1,9 @@
 <?php
 // set this to the encoding that should be used to display the pages correctly,translated by JianxinLiu,Tianjin University
-$messages['encoding'] = 'utf-8';
+$messages['encoding'] = 'UTF-8';
 $messages['locale_description'] = 'Simplified Chinese translation (UTF-8)';
 // locale format, see Locale::formatDate for more information
-$messages['date_format'] = '%d/%m/%Y %H:%M';
+$messages['date_format'] = '%Y/%m/%d %H:%M';
 
 // days of the week
 $messages['days'] = Array( '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六' );
@@ -198,6 +198,7 @@
 $messages['resourceInfo'] = '编辑资源';
 $messages['editBlog'] = '编辑博客';
 $messages['Logout'] = '注销';
+$messages['editUser'] = '编辑用户';
 
 // new post
 $messages['topic'] = '标题';
@@ -206,6 +207,8 @@
 $messages['text_help'] = '摘要内容:(该部分内容将在您的首页显示)';
 $messages['extended_text'] = '扩展内容';
 $messages['extended_text_help'] = '扩展内容:(该部分可以通过后台设置决定是否显示在首页中或仅仅出现在文章内容中,在博客设置中会找到更多信息。';
+$messages['trackback_urls'] = '真实引用网址';
+$messages['trackback_urls_help'] = '如果您要引用的文章没有支援‘引用网址自动搜寻’机制,请在这里输入他们的真实引用网址,并用断行来隔开。';
 $messages['post_slug'] = '文章代成';
 $messages['post_slug_help'] = '文章代成可以为文章标题生成静态地址。';
 $messages['date'] = '日期';
@@ -234,6 +237,10 @@
 $messages['post_added_not_published'] = '添加文章成功但未发布';
 $messages['post_added_ok'] = '添加文章成功';
 $messages['send_notifications_ok'] = '有新评论或引用时将向您发送通告。';
+$messages['bookmarklet'] = "书签小程式";
+$messages['bookmarklet_help'] = "把下面的连结拉到你工具列,或是按下滑鼠右键把连结加到我的最爱。";
+$messages['blogit_to_plog'] = "把文章加到 pLog!";
+$messages['original_post'] = "(原文)";
 
 // send trackbacks
 $messages['error_sending_trackbacks'] = '发送以下引用通知时发生错误';
@@ -251,7 +258,7 @@
 $messages['search_terms'] = '搜索条件';
 $messages['show'] = '显示';
 $messages['delete'] = '删除';
-$messages['actions'] = '激活';
+$messages['actions'] = '操作';
 $messages['all'] = '全部';
 $messages['category_all'] = '全部分类';
 $messages['error_incorrect_article_id'] = '不正确的文章标识';
@@ -357,6 +364,7 @@
 $messages['error_adding_link'] = '添加链接时出错,请检查数据并重试';
 $messages['error_invalid_url'] = '地址错';
 $messages['link_added_ok'] = '链接 "%s" 添加成功';
+$messages['bookmarkit_to_plog'] = "把书签加到 pLog!";
 
 // update link
 $messages['error_updating_link'] = '修改链接时出错,请检查数据并重试。';
@@ -466,8 +474,8 @@
 $messages['information'] = '文件信息';
 $messages['size'] = '文件大小';
 $messages['format'] = '文件格式';
-$messages['dimensions'] = '滤镜';
-$messages['bits_per_sample'] = '文件样本位数';
+$messages['dimensions'] = '尺寸';
+$messages['bits_per_sample'] = '位深';
 $messages['sample_rate'] = '样本率';
 $messages['number_of_channels'] = '通道数';
 $messages['legnth'] = '长度';
@@ -612,7 +620,7 @@
 $messages['error_invalid_user'] = '用户标识不正确或该用户不存在';
 $messages['error_updating_user'] = '更新用户设置时出错,请检查数据并重试';
 $messages['blogs'] = '博客列表';
-$messages['user_blogs_helps'] = '该用户当前拥有的或有权限的博客';
+$messages['user_blogs_help'] = '该用户当前拥有的或有权限的博客';
 $messages['site_admin'] = '管理员权限';
 $messages['site_admin_help'] = '该用户是否具有管理员权限';
 $messages['user_updated_ok'] = '用户 "%s" 修改成功';
@@ -624,7 +632,7 @@
 $messages['blog_status_unconfirmed'] = '未确认';
 $messages['owner'] = '管理员';
 $messages['quota'] = '配额';
-$messages['bytes'] = '字节数';
+$messages['bytes'] = '字节';
 $messages['error_no_blogs_selected'] = '您必须选择您想要禁用的博客网站。';
 $messages['error_blog_is_default_blog'] = '"%s"是系统默认博客,无法禁用。';
 $messages['blog_deleted_ok'] = '博客 "%s" 禁用成功';
@@ -719,7 +727,7 @@
 $messages['help_template_folder'] = '存储模板的文件夹';
 $messages['help_default_template'] = '新建博客的默认模板';
 $messages['help_users_can_add_templates'] = '允许用户加入自己的模板';
-$messages['help_template_compile_check'] = '如果禁用该项,模板文件变更时Smarty将检查所有的请求,可以提高更多性能。';
+$messages['help_template_compile_check'] = '如果启用该项,模板文件变更时Smarty将检查所有的请求,可以提高更多性能。';
 $messages['help_template_cache_enabled'] = '启用模板缓存';
 $messages['help_template_cache_lifetime'] = '缓存保留时间,设置为-1则永久存留,设置为0则禁用缓存。';
 $messages['help_template_http_cache_enabled'] = '启用HTTP条件请求的缓存支持。如果启用可以节省带宽。';
@@ -766,7 +774,7 @@
 $messages['help_rdf_enabled'] = '启动Atom或RSS聚合';
 $messages['help_default_rss_profile'] = '默认的RSS或Atom方式';
 // security
-$messages['help_security_pipeline_enabled'] = '是否启用安全以及所有相关插件。注意,这也会印象到其它的新插件。';
+$messages['help_security_pipeline_enabled'] = '是否启用安全以及所有相关插件。注意,这也会影响到其它的新插件。';
 $messages['help_ip_address_filter_enabled'] = '是否启用ip地址过滤';
 $messages['help_content_filter_enabled'] = '启用或禁用规则过滤,启动该项目时,需要打开安全功能。';
 $messages['help_maximum_comment_size'] = '评论的最大字节数';
@@ -897,7 +905,7 @@
 $messages['comment_default_title'] = '(无标题)';
 $messages['guestbook'] = '留言板';
 $messages['trackbacks'] = '引用';
-$messages['menu'] = '新闻聚合';
+$messages['menu'] = '主选单';
 $messages['albums'] = '资源中心';
 $messages['admin'] = '管理控制台';
 ?>
\ No newline at end of file

Modified: plog/trunk/locale/locale_zh_TW.php
===================================================================
--- plog/trunk/locale/locale_zh_TW.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/locale/locale_zh_TW.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -206,6 +206,8 @@
 $messages['text_help'] = '這部份的內容會在網誌首頁出現。';
 $messages['extended_text'] = '延伸內文';
 $messages['extended_text_help'] = '您在此輸入的文字只會在單篇彙整狀態下顯示,除非您在「設定」頁面中修改了設定。';
+$messages['trackback_urls'] = '真實引用網址';
+$messages['trackback_urls_help'] = '如果您要引用的文章沒有支援『引用網址自動搜尋』機制,請在這裡輸入他們的真實引用網址,並用斷行來隔開。';
 $messages['post_slug'] = '短標題 ';
 $messages['post_slug_help'] = '短標題將會用來建立簡潔的靜態連結網址';
 $messages['date'] = '日期';
@@ -234,6 +236,10 @@
 $messages['post_added_not_published'] = '文章已順利新增,但尚未正式發表。';
 $messages['post_added_ok'] = '文章已順利新增';
 $messages['send_notifications_ok'] = '當有新的迴響或是引用時,便向我發送電子郵件通知';
+$messages['bookmarklet'] = "書籤小程式";
+$messages['bookmarklet_help'] = "把下面的連結拉到你工具列,或是按下滑鼠右鍵把連結加到我的最愛。";
+$messages['blogit_to_plog'] = "把文章加到 pLog!";
+$messages['original_post'] = "(原文)";
 
 // send trackbacks
 $messages['error_sending_trackbacks'] = '發送下列引用通知時產生錯誤。';
@@ -357,6 +363,7 @@
 $messages['error_adding_link'] = '新增網站連結時發生錯誤。請檢查輸入的資料,再重試一次。';
 $messages['error_invalid_url'] = '網址不正確';
 $messages['link_added_ok'] = '網站連結「%s」已順利新增';
+$messages['bookmarkit_to_plog'] = "把書籤加到 pLog!";
 
 // update link
 $messages['error_updating_link'] = '更新網站連結時發生錯誤。請檢查輸入的資料,再重試一次。';
@@ -612,7 +619,7 @@
 $messages['error_invalid_user'] = '使用者ID不正確或使用者不存在。';
 $messages['error_updating_user'] = '更新使用者設定時發生錯誤。請檢查輸入資料後再重試一次。';
 $messages['blogs'] = '網誌';
-$messages['user_blogs_helps'] = '使用者擁有或可以存取的網誌。';
+$messages['user_blogs_help'] = '使用者擁有或可以存取的網誌。';
 $messages['site_admin'] = '全站系統管理';
 $messages['site_admin_help'] = '如果使用者擁有全站系統管理權限,他就可以看見[站台設定]區域,可以進行全站的管理工作。';
 $messages['user_updated_ok'] = '使用者帳號「%s」已順利更新。';

Modified: plog/trunk/locale/unsupport/locale_zh_CN_gb2312.php
===================================================================
--- plog/trunk/locale/unsupport/locale_zh_CN_gb2312.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/locale/unsupport/locale_zh_CN_gb2312.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -612,7 +612,7 @@
 $messages['error_invalid_user'] = 'Óû§±êʶ²»ÕýÈ·»ò¸ÃÓû§²»´æÔÚ';
 $messages['error_updating_user'] = '¸üÐÂÓû§ÉèÖÃʱ³ö´í£¬Çë¼ì²éÊý¾Ý²¢ÖØÊÔ';
 $messages['blogs'] = '²©¿ÍÁбí';
-$messages['user_blogs_helps'] = '¸ÃÓû§µ±Ç°ÓµÓеĻòÓÐȨÏ޵IJ©¿Í';
+$messages['user_blogs_help'] = '¸ÃÓû§µ±Ç°ÓµÓеĻòÓÐȨÏ޵IJ©¿Í';
 $messages['site_admin'] = '¹ÜÀíԱȨÏÞ';
 $messages['site_admin_help'] = '¸ÃÓû§ÊÇ·ñ¾ßÓйÜÀíԱȨÏÞ';
 $messages['user_updated_ok'] = 'Óû§ "%s" Ð޸ijɹ¦';

Modified: plog/trunk/locale/unsupport/locale_zh_TW_big5.php
===================================================================
--- plog/trunk/locale/unsupport/locale_zh_TW_big5.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/locale/unsupport/locale_zh_TW_big5.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -612,7 +612,7 @@
 $messages['error_invalid_user'] = '¨Ï¥ÎªÌID¤£¥¿½T©Î¨Ï¥ÎªÌ¤£¦s¦b¡C';
 $messages['error_updating_user'] = '§ó·s¨Ï¥ÎªÌ³]©w®Éµo¥Í¿ù»~¡C½ÐÀˬd¿é¤J¸ê®Æ«á¦A­«¸Õ¤@¦¸¡C';
 $messages['blogs'] = 'ºô»x';
-$messages['user_blogs_helps'] = '¨Ï¥ÎªÌ¾Ö¦³©Î¥i¥H¦s¨úªººô»x¡C';
+$messages['user_blogs_help'] = '¨Ï¥ÎªÌ¾Ö¦³©Î¥i¥H¦s¨úªººô»x¡C';
 $messages['site_admin'] = '¥þ¯¸¨t²ÎºÞ²z';
 $messages['site_admin_help'] = '¦pªG¨Ï¥ÎªÌ¾Ö¦³¥þ¯¸¨t²ÎºÞ²zÅv­­¡A¥L´N¥i¥H¬Ý¨£[¯¸¥x³]©w]°Ï°ì¡A¥i¥H¶i¦æ¥þ¯¸ªººÞ²z¤u§@¡C';
 $messages['user_updated_ok'] = '¨Ï¥ÎªÌ±b¸¹¡u%s¡v¤w¶¶§Q§ó·s¡C';

Copied: plog/trunk/styles/admin-rtl.css (from rev 2357, plog/branches/plog-1.0.2/styles/admin-rtl.css)

Copied: plog/trunk/styles/summary-rtl.css (from rev 2357, plog/branches/plog-1.0.2/styles/summary-rtl.css)

Modified: plog/trunk/templates/admin/createuser.template
===================================================================
--- plog/trunk/templates/admin/createuser.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/admin/createuser.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -19,11 +19,11 @@
       <input type="text" name="userFullName" value="{$userFullName}" id="userFullName" />
     </div>
     <div class="field">
-      <label for="userPassword">{$locale->tr("password")}</label>
+      <label for="newUserPassword">{$locale->tr("password")}</label>
       <span class="required">*</span>
       <div class="formHelp">{$locale->tr("password_help")}</div>
-      <input type="password" name="userPassword" value="{$userPassword}" id="userPassword" />
-      {include file="$admintemplatepath/validate.template" field=userPassword message=$locale->tr("error_invalid_password")}
+      <input type="password" name="newUserPassword" value="{$newUserPassword}" id="newUserPassword" />
+      {include file="$admintemplatepath/validate.template" field=newUserPassword message=$locale->tr("error_invalid_password")}
     </div>
     <div class="field">
       <label for="userEmail">{$locale->tr("email")}</label>

Modified: plog/trunk/templates/admin/editlinks.template
===================================================================
--- plog/trunk/templates/admin/editlinks.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/admin/editlinks.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -45,8 +45,8 @@
  {foreach from=$links item=link}
   <tr class="{cycle values="odd,even"}">
    <td><input class="checkbox" type="checkbox" name="linkIds[{counter}]" value="{$link->getId()}"/></td>  
-   <td class="col_highlighted"><a href="admin.php?op=editLink&amp;linkId={$link->getId()}">{$link->getName()}</a></td>
-   <td><a href="{$link->getUrl()}">{$link->getUrl()}</a></td>
+   <td class="col_highlighted"><a href="admin.php?op=editLink&amp;linkId={$link->getId()}">{$link->getName()|wordwrap:20:"<br/>":false}</a></td>
+   <td><a href="{$link->getUrl()}">{$link->getUrl()|wordwrap:40:"<br/>":true}</a></td>
    {assign var=linkcategory value=$link->getCategoryId()}
    <td>
     {assign var=linkcategory value=$link->getMyLinkCategory()}

Modified: plog/trunk/templates/admin/editpost.template
===================================================================
--- plog/trunk/templates/admin/editpost.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/admin/editpost.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,6 +13,9 @@
   <script type="text/javascript" src="js/xinha/dialog.js"/></script>
   <script type="text/javascript" src="js/xinha/htmlarea-plog.js"/></script>
   <link type="text/css" rel="stylesheet" title="blue-look" href="js/xinha/skins/blue-look/skin.css">    
+  {if $locale->getLocaleCode()=="fa_IR"}
+  <script type="text/javascript" src="js/htmlarea/htmlarea-plog-farsi.js"/></script>
+  {/if}    
  {else}
   <link rel="stylesheet" href="js/editor/plogeditor.css" type="text/css" />
   <script type="text/javascript" src="js/editor/plogeditor.js"></script>
@@ -61,6 +64,12 @@
 		 <a href="javascript:resource_list_window(2);">{$locale->tr("add_resource")}</a>
 	     {/if}
 	   </div>
+
+	   <div class="field">
+	     <label for="trackbackUrls">{$locale->tr("trackback_urls")}</label>
+		 <div class="formHelp">{$locale->tr("trackback_urls_help")}</div>
+	     <textarea rows="5" id="trackbackUrls" name="trackbackUrls" style="width:100%">{$trackbackUrls}</textarea>
+	   </div>	   
 	   
 	   <!-- text area custom fields -->
       {include file="$admintemplatepath/newpost_customfields.template" type=2 fields=$customfields}

Modified: plog/trunk/templates/admin/header.template
===================================================================
--- plog/trunk/templates/admin/header.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/admin/header.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -6,7 +6,11 @@
 <meta http-equiv="Content-Style-Type" content="text/css" />
 <meta name="generator" content="{$version}" />
 <title>pLog Admin</title>
+{if $locale->getDirection()=="rtl"}
+<link rel="stylesheet" href="styles/admin-rtl.css" type="text/css" media="screen" />
+{else}
 <link rel="stylesheet" href="styles/admin.css" type="text/css" media="screen" />
+{/if}
 <!--[if IE ]>
 <link rel="stylesheet" href="styles/admin-ie.css" type="text/css" media="screen" />
 <![endif] -->
@@ -15,6 +19,15 @@
 <script type="text/javascript">
     var blogLocale = '{$locale->getCharset()|upper}';
 </script>
+{literal}
+<script type="text/javascript">
+	function MM_jumpMenu(targ,selObj,restore){ //v3.0 
+    	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); 
+    	if (restore) selObj.selectedIndex=0; 
+	}
+</script>
+{/literal}    
+
 </head>
 <body>
 
@@ -40,8 +53,16 @@
     <div id="menubar">
         <div id="menu">
             {$menu->generateAt("menu",1)}
-            <br style="clear:both;"/>
         </div>
     </div>
 
+   	<div style="text-align: right;">
+   		<img style="vertical-align: middle;" src="imgs/admin/icon_home-24.png" alt="Blog" />&nbsp;
+   		<select name="userBlog" id="userBlog" onChange="MM_jumpMenu('parent',this,0)">
+     	{foreach from=$userBlogs item=userBlog}
+     		<option value="admin.php?op=blogSelect&amp;blogId={$userBlog->getId()}" {if $userBlog->getId() == $blog->getId()}selected="selected"{/if}>{$userBlog->getBlog()}</option>
+       	{/foreach}
+       	</select>
+    </div>
+
     <div id="content" >
\ No newline at end of file

Modified: plog/trunk/templates/admin/newlink.template
===================================================================
--- plog/trunk/templates/admin/newlink.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/admin/newlink.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -1,6 +1,11 @@
 {include file="$admintemplatepath/header.template"}
 {include file="$admintemplatepath/navigation.template" showOpt=newLink title=$locale->tr("newLink")}
-
+{if $smarty.request.linkName}
+	{assign var=linkName value=$smarty.request.linkName}
+{/if}
+{if $smarty.request.linkUrl}
+	{assign var=linkUrl value=$smarty.request.linkUrl}
+{/if}
    <form name="newLink" action="admin.php" method="post"> 
       
         <fieldset class="inputField">
@@ -50,6 +55,13 @@
 			 {/foreach}
 			</select>
         </div>
+        
+        <div class="field">
+        	<label for="bookmarklet">{$locale->tr("bookmarklet")}</label>
+        	<div class="formHelp">{$locale->tr("bookmarklet_help")}</div>
+        	<a href="javascript:void(plogbm=window.open('{$url->getAdminUrl()}?op=newLink&linkName='+encodeURIComponent(document.title)+'&linkUrl='+encodeURIComponent(location.href),'plogbm','toolbar=1,status=1,location=1,scrollbars=1,menubar=1,resizable=1'));" onclick="window.alert('{$locale->tr("bookmarklet_help")}');">{$locale->tr("bookmarkit_to_plog")}</a>
+        </div>
+        
         </fieldset>
         <div class="buttons">
 		    <input type="hidden" name="op" value="addLink" />

Modified: plog/trunk/templates/admin/newpost.template
===================================================================
--- plog/trunk/templates/admin/newpost.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/admin/newpost.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -1,5 +1,8 @@
 {include file="$admintemplatepath/header.template"}
 {include file="$admintemplatepath/navigation.template" showOpt=newPost title=$locale->tr("newPost")}
+{if $smarty.request.postText}
+	{assign var=postText value=$smarty.request.postText}
+{/if}
 {assign var=htmlarea value=$blogsettings->getValue("htmlarea_enabled")}
  <script type="text/javascript" src="js/ui/plogui.js"></script>
  <script type="text/javascript" src="js/calendar/datetimepicker.js"></script>
@@ -12,6 +15,11 @@
   <script type="text/javascript" src="js/xinha/dialog.js"/></script>
   <script type="text/javascript" src="js/xinha/htmlarea-plog.js"/></script>  
   <link type="text/css" rel="stylesheet" title="blue-look" href="js/xinha/skins/blue-look/skin.css">
+  <!--
+  {if $locale->getLocaleCode()=="fa_IR"}
+  <script type="text/javascript" src="js/htmlarea/htmlarea-plog-farsi.js"/></script>
+  {/if} 
+  -->
  {else}
   <link rel="stylesheet" href="js/editor/plogeditor.css" type="text/css" />
   <script type="text/javascript" src="js/editor/plogeditor.js"></script>
@@ -81,7 +89,13 @@
 	     {if !$htmlarea}
 		 <a href="javascript:resource_list_window(2);">{$locale->tr("add_resource")}</a>
 	     {/if}
-	   </div>	   	   
+	   </div>
+
+	   <div class="field">
+	     <label for="trackbackUrls">{$locale->tr("trackback_urls")}</label>
+		 <div class="formHelp">{$locale->tr("trackback_urls_help")}</div>
+	     <textarea rows="5" id="trackbackUrls" name="trackbackUrls" style="width:100%">{$trackbackUrls}</textarea>
+	   </div>	      	   
 	   
 	   <!-- text area custom fields -->
       {include file="$admintemplatepath/newpost_customfields.template" type=2 fields=$customfields}
@@ -165,6 +179,12 @@
 		 <label for="sendPings">{$locale->tr("send_xmlrpc_pings_help")}</label>
 		 {/if}
       </div>
+
+      <div class="field">
+       	<br /><label for="bookmarklet">{$locale->tr("bookmarklet")}</label>
+       	<div class="formHelp">{$locale->tr("bookmarklet_help")}</div>
+		<a href="javascript:bm=document.selection?document.selection.createRange().text:document.getSelection();void(plogbm=window.open('{$url->getAdminUrl()}?op=newPost&sendTrackbacks=1&postText='+encodeURIComponent('&lt;p&gt;'+bm+' ... '+'&lt;a href=&quot;'+window.location.href+'&quot;&gt;'+'{$locale->tr("original_post")}'+'&lt;/a&gt;&lt;/p&gt;'),'plogbm','toolbar=1,status=1,location=1,scrollbars=1,menubar=1,resizable=1'))" onclick="window.alert('{$locale->tr("bookmarklet_help")}');">{$locale->tr("blogit_to_plog")}</a> 
+      </div>	 
 	  
 	  <!-- checkbox custom fields -->
 	   {include file="$admintemplatepath/newpost_customfields.template" type=3 fields=$customfields}	  

Modified: plog/trunk/templates/admin/poststats.template
===================================================================
--- plog/trunk/templates/admin/poststats.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/admin/poststats.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -22,7 +22,7 @@
                             <input class="checkbox" type="checkbox" name="referrerIds[{$referrer->getId()}]" id="checks_1" value="{$referrer->getId()}" />
                         </td>
                         <td class="col_highlighted">
-                            <a href="{$referrer->getUrl()}">{$referrer->getUrl()|truncate:55:"..."}</a>
+                            <a href="{$referrer->getUrl()}">{$referrer->getUrl()|wordwrap:55:"<br/>",true}</a>
                         </td>
 						<td>
 						   {$referrer->getHits()}
@@ -48,4 +48,4 @@
         </div>		
 	</form>
 {include file="$admintemplatepath/footernavigation.template"}
-{include file="$admintemplatepath/footer.template"}
\ No newline at end of file
+{include file="$admintemplatepath/footer.template"}

Modified: plog/trunk/templates/admin/resourceinfo.template
===================================================================
--- plog/trunk/templates/admin/resourceinfo.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/admin/resourceinfo.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -44,7 +44,7 @@
 	 {$locale->tr("number_of_files")}: {$metadata->getTotalFiles()}<br/>
 	 {$locale->tr("uncompressed_size")}: {$metadata->getUncompressedSize()} {$locale->tr("bytes")}<br/>
 	{else} 
-	 {assign var=imgPath value="imgs/icon_file-48.gif"}
+	 {assign var=imgPath value="imgs/admin/icon_file-48.png"}
 	 {$locale->tr("size")}: {$metadata->getFileSize()} {$locale->tr("bytes")}<br/>
 	{/if}
 	</span>   

Modified: plog/trunk/templates/admin/sendtrackbacks.template
===================================================================
--- plog/trunk/templates/admin/sendtrackbacks.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/admin/sendtrackbacks.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -5,12 +5,22 @@
   <legend>{$locale->tr("send_trackbacks")}</legend>
   {include file="$admintemplatepath/successmessage.template"}
   {include file="$admintemplatepath/errormessage.template"} 
+  
   <label for="postLink">{$locale->tr("send_trackbacks")}</label>
   <div class="formHelp">{$locale->tr("send_trackbacks_help")}</div>
-  {foreach from=$postlinks item=postlink}
-   <input class="checkbox" type="checkbox" id="postLink[{counter}]" name="postLink[{counter}]" value="{$postlink}" />
-    <a href="{$postlink}">{$postlink}</a><br/>
+  {if count($postLinks) != 0}
+   {foreach from=$postLinks item=postLink}
+    <input class="checkbox" type="checkbox" id="postLink[{counter}]" name="postLink[{counter}]" value="{$postLink}" />
+    <a href="{$postLink}">{$postLink}</a><br/>
    {/foreach}
+  {/if}
+  {if count($trackbackLinks) != 0}  
+   {foreach from=$trackbackLinks item=trackbackLink}
+    <input class="checkbox" type="checkbox" id="trackbackLink[{counter}]" name="trackbackLink[{counter}]" value="{$trackbackLink}" checked />
+    <a href="{$trackbackLink}">{$trackbackLink}</a><br/>
+   {/foreach}
+  {/if}
+  
  </fieldset>
  <div class="buttons">
   <input type="submit" value="{$locale->tr("ping_selected")}" name="PingSelected"/>
@@ -19,4 +29,4 @@
  </div>
 </form>
 {include file="$admintemplatepath/footernavigation.template"}
-{include file="$admintemplatepath/footer.template"}
+{include file="$admintemplatepath/footer.template"}
\ No newline at end of file

Modified: plog/trunk/templates/admin/simpleheader.template
===================================================================
--- plog/trunk/templates/admin/simpleheader.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/admin/simpleheader.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -5,7 +5,11 @@
 <title>pLog Admin</title>
 <meta http-equiv="Content-Style-Type" content="text/css" />
 <meta name="generator" content="{$version}" />
+{if $locale->getDirection()=="rtl"}
+<link rel="stylesheet" href="styles/admin-rtl.css" type="text/css" media="screen" />
+{else}
 <link rel="stylesheet" href="styles/admin.css" type="text/css" media="screen" />
+{/if}
 <!--[if IE ]>
 <link rel="stylesheet" href="styles/admin-ie.css" type="text/css" media="screen" />
 <![endif] -->

Modified: plog/trunk/templates/admin/statistics.template
===================================================================
--- plog/trunk/templates/admin/statistics.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/admin/statistics.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -21,7 +21,7 @@
                             <input class="checkbox" type="checkbox" name="referrerIds[{$referrer->getId()}]" id="checks_1" value="{$referrer->getId()}" />
                         </td>
                         <td class="col_highlighted">
-                            <a href="{$referrer->getUrl()}">{$referrer->getUrl()|truncate:55:"..."}</a>
+                            <a href="{$referrer->getUrl()}">{$referrer->getUrl()|wordwrap:55:"<br/>":true}</a>
                         </td>
 						<td>
 						   {$referrer->getHits()}

Modified: plog/trunk/templates/admin/userprofile.template
===================================================================
--- plog/trunk/templates/admin/userprofile.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/admin/userprofile.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -8,7 +8,6 @@
 
     <div class="field">
       <label for="userName">{$locale->tr("username")}</label>
-      <span class="required">*</span>
       <div class="formHelp">{$locale->tr("username_help")}</div>
       <input type="text" id="userName" name="userName" value="{$userName}" readonly="readonly" />
     </div>
@@ -19,11 +18,10 @@
       <input type="text" id="userFullName" name="userFullName" value="{$userFullName}"/>
     </div>
     <div class="field">
-      <label for="userPassword">{$locale->tr("password")}</label>
-      <span class="required">*</span>
+      <label for="userProfilePassword">{$locale->tr("password")}</label>
       <div class="formHelp">{$locale->tr("password_help")}</div>
-      <input type="password" name="userPassword" id="userPassword" value="{$userPassword}"/>
-      {include file="$admintemplatepath/validate.template" field=userPassword message=$locale->tr("error_password_incorrect")}
+      <input type="password" name="userProfilePassword" id="userProfilePassword" value="{$userProfilePassword}" />
+      {include file="$admintemplatepath/validate.template" field=userProfilePassword message=$locale->tr("error_invalid_password")}
     </div>
     <div class="field">
       <label for="userEmail">{$locale->tr("email")}</label>
@@ -68,4 +66,4 @@
   </div>
  </form>
 {include file="$admintemplatepath/footernavigation.template"}
-{include file="$admintemplatepath/footer.template"}
\ No newline at end of file
+{include file="$admintemplatepath/footer.template"}

Modified: plog/trunk/templates/admin/usersettings.template
===================================================================
--- plog/trunk/templates/admin/usersettings.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/admin/usersettings.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -20,10 +20,10 @@
       </div>
 
      <div class="field">
-       <label for="userPassword">{$locale->tr("password")}</label>
+       <label for="userSettingsPassword">{$locale->tr("password")}</label>
        <div class="formHelp">{$locale->tr("password_help")}</div>
-       <input type="password" name="userPassword" value="{$userPassword}" id="userPassword" />
-       {include file="$admintemplatepath/validate.template" field=userPassword message=$locale->tr("error_invalid_password")}
+       <input type="password" name="userSettingsPassword" value="{$userSettingsPassword}" id="userSettingsPassword" />
+       {include file="$admintemplatepath/validate.template" field=userSettingsPassword message=$locale->tr("error_invalid_password")}
        <br/>
        <label for="confirmPassword">{$locale->tr("confirm_password")}</label>
        <input type="password" name="confirmPassword" value="" id="confirmPassword" />

Modified: plog/trunk/templates/blueish/post.template
===================================================================
--- plog/trunk/templates/blueish/post.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/blueish/post.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -1,4 +1,3 @@
-<!-- {$url->postTrackbackLink($post)} -->
 {assign var="postDate" value=$post->getDateObject()}
 {assign var="postOwner" value=$post->getUserInfo()}
 <div class="blog">

Modified: plog/trunk/templates/blueish/postandcomments.template
===================================================================
--- plog/trunk/templates/blueish/postandcomments.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/blueish/postandcomments.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -6,6 +6,7 @@
 {assign var="postOwner" value=$post->getUserInfo()}
 
 <div id="content">
+<!-- {$url->postTrackbackLink($post)} -->
  {include file="$blogtemplate/post.template"}
 
  <div class="blog">

Modified: plog/trunk/templates/grey/post.template
===================================================================
--- plog/trunk/templates/grey/post.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/grey/post.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -1,4 +1,3 @@
-<!-- {$url->postTrackbackLink($post)} -->
 <h3>{$post->getTopic()}</h3>
 {assign var="postDate" value=$post->getDateObject()}
 {assign var="postOwner" value=$post->getUserInfo()}

Modified: plog/trunk/templates/grey/postandcomments.template
===================================================================
--- plog/trunk/templates/grey/postandcomments.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/grey/postandcomments.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,6 +13,7 @@
    {/if}
    </p>
    {assign var="poster" value=$post->getUserInfo()}
+    <!-- {$url->postTrackbackLink($post)} -->
    {include file="$blogtemplate/post.template"}
    {foreach from=$comments item=comment}
     <p class="commentheader">

Modified: plog/trunk/templates/grey-sf/post.template
===================================================================
--- plog/trunk/templates/grey-sf/post.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/grey-sf/post.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -1,4 +1,3 @@
-<!-- {$url->postTrackbackLink($post)} -->
 <h3>{$post->getTopic()}</h3>
 {assign var="postDate" value=$post->getDateObject()}
 {assign var="postOwner" value=$post->getUserInfo()}

Modified: plog/trunk/templates/grey-sf/postandcomments.template
===================================================================
--- plog/trunk/templates/grey-sf/postandcomments.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/grey-sf/postandcomments.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -11,6 +11,7 @@
    {/if}
    </p>
    {assign var="poster" value=$post->getUserInfo()}
+   <!-- {$url->postTrackbackLink($post)} -->
    {include file="$blogtemplate/post.template"}
    {foreach from=$comments item=comment}
     <p class="commentheader">

Modified: plog/trunk/templates/plogworld/post.template
===================================================================
--- plog/trunk/templates/plogworld/post.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/plogworld/post.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -1,4 +1,3 @@
-<!-- {$url->postTrackbackLink($post)} -->
 {assign var="postDate" value=$post->getDateObject()}
 <div class="postTopic">
    <a href="{$url->postPermalink($post)}" title="{$locale->tr("permalink")}">

Modified: plog/trunk/templates/plogworld/postandcomments.template
===================================================================
--- plog/trunk/templates/plogworld/postandcomments.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/plogworld/postandcomments.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -5,6 +5,7 @@
 {assign var="postOwner" value=$post->getUserInfo()}
 {include file="$blogtemplate/blogcommon.template"}
 <div id="posts">
+ <!-- {$url->postTrackbackLink($post)} -->
  {include file="$blogtemplate/post.template"}
  <div class="blog">
  <div class="comments-head">

Modified: plog/trunk/templates/rss/atom.template
===================================================================
--- plog/trunk/templates/rss/atom.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/rss/atom.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -17,7 +17,7 @@
  <modified>{$postDate->getW3Date()}</modified> 
  <issued>{$locale->formatDate($postDate, "%Y-%m-%dT%H:%M:%S")}</issued> 
  <created>{$locale->formatDate($postDate, "%Y-%m-%dT%H:%M:%SZ")}</created> 
- <summary type="text/plain">{$post->getText()|strip_tags|truncate:200:" ..."}</summary> 
+ <summary type="text/plain">{$post->getText()|strip_tags|truncate:200:" ..."|escape:"html"}</summary> 
  <author> 
  {assign var="postOwner" value=$post->getUserInfo()} 
  <name>{$postOwner->getUsername()|escape}</name> 

Modified: plog/trunk/templates/standard/post.template
===================================================================
--- plog/trunk/templates/standard/post.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/standard/post.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -1,5 +1,4 @@
 <h2>{$post->getTopic()}</h2>
-		<!-- {$url->postTrackbackLink($post)} -->
 		{assign var="postDate" value=$post->getDateObject()}
 		{assign var="postOwner" value=$post->getUserInfo()}
 <p class="date">{$postOwner->getUsername()} | {$locale->formatDate($postDate,"%d %B, %Y %H:%M")}</p>

Modified: plog/trunk/templates/standard/postandcomments.template
===================================================================
--- plog/trunk/templates/standard/postandcomments.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/standard/postandcomments.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -14,6 +14,7 @@
 </p>
    
    		{assign var="poster" value=$post->getUserInfo()}
+   		<!-- {$url->postTrackbackLink($post)} -->
    		
    		{include file="$blogtemplate/post.template"}
 <h2>{$locale->tr("comments")}</h2>	

Modified: plog/trunk/templates/standard-with-plugins/post.template
===================================================================
--- plog/trunk/templates/standard-with-plugins/post.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/standard-with-plugins/post.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -1,5 +1,4 @@
 <h2>{$post->getTopic()}</h2>
-		<!-- {$url->postTrackbackLink($post)} -->
 		{assign var="postDate" value=$post->getDateObject()}
 		{assign var="postOwner" value=$post->getUserInfo()}
 <p class="date">{$postOwner->getUsername()} | {$locale->formatDate($postDate,"%d %B, %Y %H:%M")}</p>

Modified: plog/trunk/templates/standard-with-plugins/postandcomments.template
===================================================================
--- plog/trunk/templates/standard-with-plugins/postandcomments.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/standard-with-plugins/postandcomments.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -13,6 +13,7 @@
 </p>
    
    		{assign var="poster" value=$post->getUserInfo()}
+        <!-- {$url->postTrackbackLink($post)} -->
    		
    		{include file="$blogtemplate/post.template"}
 <h2>{$locale->tr("comments_for_post")}</h2>	

Modified: plog/trunk/templates/summary/header.template
===================================================================
--- plog/trunk/templates/summary/header.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/summary/header.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -4,7 +4,11 @@
 <meta http-equiv="content-type" content="text/html;charset={$locale->getCharset()}" />
 <meta http-equiv="Content-Style-Type" content="text/css" />
 <title>{$locale->tr("summary")}</title>
+{if $locale->getDirection()=="rtl"}
+<link rel="stylesheet" href="styles/summary-rtl.css" type="text/css" media="screen" />
+{else}
 <link rel="stylesheet" href="styles/summary.css" type="text/css" media="screen" />
+{/if}
 <!--[if IE ]>
 <link rel="stylesheet" href="styles/summary-ie.css" type="text/css" media="screen" />
 <![endif] -->

Modified: plog/trunk/templates/summary/index.template
===================================================================
--- plog/trunk/templates/summary/index.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/summary/index.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -18,7 +18,13 @@
 	    <a href="?op=resetPasswordForm">{$locale->tr("password_forgotten")}</a>		
     </fieldset>
     </form>
-    <h4>{$locale->tr("summary_newest_blogs")}</h4>
+    <h4>{$locale->tr("summary_newest_blogs")}
+    {if $recentBlogs}
+      <a href="{$url->getRssUrl()}?summary=1&amp;type=newestblogs">
+        <img src="{$url->getUrl("/imgs/rss_logo_small.gif")}" 
+         alt="RSS" /></a>    
+    {/if}
+    </h4>
     <ul class="itemList">
     {foreach from=$recentBlogs item=blog}
         {assign var="url" value=$blog->getBlogRequestGenerator()}
@@ -51,7 +57,13 @@
         <input type="submit" class="button" name="summarySearch" value="{$locale->tr("search")}" tabindex="21" />
     </fieldset>
     </form>	
-    <h4>{$locale->tr("summary_most_active_blogs")}</h4>
+    <h4>{$locale->tr("summary_most_active_blogs")}
+    {if $activeBlogs}
+      <a href="{$url->getRssUrl()}?summary=1&amp;type=mostactiveblogs">
+        <img src="{$url->getUrl("/imgs/rss_logo_small.gif")}" 
+         alt="RSS" /></a>    
+    {/if}
+    </h4>
     <ul class="itemList">
     {foreach from=$activeBlogs item=blog}
 	    {assign var="url" value=$blog->getBlogRequestGenerator()}
@@ -102,4 +114,4 @@
        {/if}
     {/foreach}
 </div>
-{include file="summary/footer.template"}
+{include file="summary/footer.template"}
\ No newline at end of file

Modified: plog/trunk/templates/summary/rss/atom.template
===================================================================
--- plog/trunk/templates/summary/rss/atom.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/summary/rss/atom.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -19,7 +19,7 @@
  <modified>{$postDate->getW3Date()}</modified> 
  <issued>{$locale->formatDate($postDate, "%Y-%m-%dT%H:%M:%S")}</issued> 
  <created>{$locale->formatDate($postDate, "%Y-%m-%dT%H:%M:%SZ")}</created> 
- <summary type="text/plain">{$post->getText()|strip_tags|truncate:200:" ..."}</summary> 
+ <summary type="text/plain">{$post->getText()|strip_tags|truncate:200:" ..."|escape:"html"}</summary> 
  <author> 
  {assign var="postOwner" value=$post->getUserInfo()} 
  <name>{$postOwner->getUsername()}</name> 

Copied: plog/trunk/templates/summary/rss/blogs_atom.template (from rev 2357, plog/branches/plog-1.0.2/templates/summary/rss/blogs_atom.template)

Copied: plog/trunk/templates/summary/rss/blogs_rss090.template (from rev 2357, plog/branches/plog-1.0.2/templates/summary/rss/blogs_rss090.template)

Copied: plog/trunk/templates/summary/rss/blogs_rss10.template (from rev 2357, plog/branches/plog-1.0.2/templates/summary/rss/blogs_rss10.template)

Copied: plog/trunk/templates/summary/rss/blogs_rss20.template (from rev 2357, plog/branches/plog-1.0.2/templates/summary/rss/blogs_rss20.template)

Modified: plog/trunk/templates/summary/rss/rss20.template
===================================================================
--- plog/trunk/templates/summary/rss/rss20.template	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/templates/summary/rss/rss20.template	2005-09-19 01:34:39 UTC (rev 2479)
@@ -7,7 +7,7 @@
   <title>Your service title</title>
   <description>Your service description</description>
   <link>{$url->getBaseUrl(false)}/summary.php</link>
-  <generator>pLog 0.3</generator>
+  <generator>pLog 1.0</generator>
   {foreach from=$posts item=post}
    {assign var=blog value=$post->getBlogInfo()}
    {assign var=url value=$blog->getBlogRequestGenerator()}  

Modified: plog/trunk/wizard.php
===================================================================
--- plog/trunk/wizard.php	2005-09-19 01:20:36 UTC (rev 2478)
+++ plog/trunk/wizard.php	2005-09-19 01:34:39 UTC (rev 2479)
@@ -585,6 +585,7 @@
 $Inserts[111] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('thumbnail_generator_use_smoothing_algorithm', '1', 1);";
 $Inserts[112] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_cache_lifetime', '-1', 3);";
 $Inserts[113] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('use_http_accept_language_detection', '0', 1);";
+$Inserts[114] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('session_save_path', '', 3);";
 
     /**
      * Open a connection to the database




More information about the pLog-svn mailing list