<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>gablog &#187; PHP</title>
	<atom:link href="http://gabo.homelinux.com/en/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://gabo.homelinux.com</link>
	<description>Fino ad ora ho avuto un sito brutto. Ora ho un blog.</description>
	<lastBuildDate>Fri, 13 Nov 2009 14:29:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>(Italiano) Shared Memory in PHP</title>
		<link>http://gabo.homelinux.com/en/2009/06/shared-memory-in-php/</link>
		<comments>http://gabo.homelinux.com/en/2009/06/shared-memory-in-php/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 13:21:07 +0000</pubDate>
		<dc:creator>gabo</dc:creator>
				<category><![CDATA[programmazione]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://gabo.homelinux.com/?p=402</guid>
		<description><![CDATA[Sorry, this entry is only available in Italiano.]]></description>
			<content:encoded><![CDATA[<p>Sorry, this entry is only available in <a href="http://gabo.homelinux.com/tag/php/feed/">Italiano</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://gabo.homelinux.com/en/2009/06/shared-memory-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>(Italiano) Impaginare tabelle con i CSS</title>
		<link>http://gabo.homelinux.com/en/2009/04/impaginare-tabelle-con-i-css/</link>
		<comments>http://gabo.homelinux.com/en/2009/04/impaginare-tabelle-con-i-css/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 13:57:47 +0000</pubDate>
		<dc:creator>gabo</dc:creator>
				<category><![CDATA[programmazione]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[tabelle]]></category>

		<guid isPermaLink="false">http://gabo.homelinux.com/?p=330</guid>
		<description><![CDATA[Sorry, this entry is only available in Italiano.]]></description>
			<content:encoded><![CDATA[<p>Sorry, this entry is only available in <a href="http://gabo.homelinux.com/tag/php/feed/">Italiano</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://gabo.homelinux.com/en/2009/04/impaginare-tabelle-con-i-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Embedding images in phplist messages</title>
		<link>http://gabo.homelinux.com/en/2009/04/phplist-embedding-images/</link>
		<comments>http://gabo.homelinux.com/en/2009/04/phplist-embedding-images/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 16:30:39 +0000</pubDate>
		<dc:creator>gabo</dc:creator>
				<category><![CDATA[programmazione]]></category>
		<category><![CDATA[newsletter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phplist]]></category>

		<guid isPermaLink="false">http://gabo.homelinux.com/?p=292</guid>
		<description><![CDATA[Dalla versione 2.10.8 di phplist (o forse qualcuna prima), vi è la possibilità di inserire immagini all'interno delle nostre mailing, senza dover ricorrere al link esterno (che l'odioso outlook e altri MUA) visualizzano come se si trattasse di errori (per l'utente di medio-basso livello). ]]></description>
			<content:encoded><![CDATA[<p>From phplist version 2.10.8 (maybe from some version earlier), there's the possibility to embed images directly into the email messages, avoiding the usage of the external link. You have just to put the following statement into config/config.php:</p>

<pre class="brush: php;">
# Aggiunta di Gabo per permettere di inserire le immagini nel corpo del messaggio
define(&quot;EMBEDUPLOADIMAGES&quot;,1);
</pre>

<p>The problem was that it didn't work for me. No way. So I had a look into the code and I found the problem. There where no way to embed images stored in any subdirectory of what stated in:</p>

<pre class="brush: php;">
# If you want to upload images to the FCKeditor, you need to specify the location
# of the directory where the images go. This needs to be writable by the webserver,
# and it needs to be in your public document (website) area
# the directory is relative to the root of PHPlist as set above
# This is a potential security risk, so read README.security for more information
define(&quot;FCKIMAGES_DIR&quot;,&quot;uploadimages&quot;);
</pre>

<p>Substituting filesystem_image_exists() and get_filesystem_image() functions (both in admin/class.phplistmailer.php) whith the code below worked, allowing me to embed images in mails even if them are in a directory different from uploadimages.</p>
<p>First of all, I added the following to the config file, just to permit embedding images when sending through cronjob and PHP-cli:</p>

<pre class="brush: php;">
//ADDED BY GABO
$phplistRoot = '/home/mysite/public_html';
//END ADDED BY GABO
[/code]

Ecco le funzioni modificate:

[code lang=&quot;php&quot;]
## addition for filesystem images - MODIFYED BY GABO
    function filesystem_image_exists($filename) {
      ##  find the image referenced and see if it's on the server

      $elements = parse_url($filename);
      $localfile = basename($elements['path']);

      // search for subdirectory
      $basePath = $GLOBALS['phplistRoot'].$GLOBALS['pageroot'].'/'.FCKIMAGES_DIR;
      $dir = substr($elements['path'],
                    strpos($elements['path'],FCKIMAGES_DIR)+strlen(FCKIMAGES_DIR),
                    strlen($elements['path']) -
                       strpos($elements['path'],FCKIMAGES_DIR) -
                       strlen(FCKIMAGES_DIR)-strlen($localfile));

      return is_file($basePath.$dir.$localfile);
    }

    function get_filesystem_image($filename) {
      ## get the image contents
      $elements = parse_url($filename);
      $localfile = basename($elements['path']);

      $basePath = $GLOBALS['phplistRoot'].$GLOBALS['pageroot'].'/'.FCKIMAGES_DIR;
      $dir = substr($elements['path'],
                    strpos($elements['path'],FCKIMAGES_DIR)+strlen(FCKIMAGES_DIR),
                    strlen($elements['path']) -
                       strpos($elements['path'],FCKIMAGES_DIR) -
                       strlen(FCKIMAGES_DIR)-strlen($localfile));

      if (is_file($basePath.$dir.$localfile)) {
        return base64_encode( file_get_contents($basePath.$dir.$localfile) );
      }
      return 0;
    }
    ## end addition - MODIFYED BY GABO
</pre>

<p>Hope it helps saving time to someone <img src='http://gabo.homelinux.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
]]></content:encoded>
			<wfw:commentRss>http://gabo.homelinux.com/en/2009/04/phplist-embedding-images/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>(Italiano) GDate &#8211; Gestire le date in PHP</title>
		<link>http://gabo.homelinux.com/en/2009/03/gdate/</link>
		<comments>http://gabo.homelinux.com/en/2009/03/gdate/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 22:01:03 +0000</pubDate>
		<dc:creator>gabo</dc:creator>
				<category><![CDATA[programmazione]]></category>
		<category><![CDATA[classi]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://gabo.homelinux.com/?p=270</guid>
		<description><![CDATA[GDate, la classe definitiva per la gestione delle date in PHP]]></description>
			<content:encoded><![CDATA[<p>Sorry, this entry is only available in <a href="http://gabo.homelinux.com/tag/php/feed/">Italiano</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://gabo.homelinux.com/en/2009/03/gdate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
