<?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>тяөpsяэlөөЭ &#124; Coolersport &#187; Portfolio</title>
	<atom:link href="http://coolersport.info/category/portfolio/feed/" rel="self" type="application/rss+xml" />
	<link>http://coolersport.info</link>
	<description>&#34;ALL&#34; about HIM</description>
	<lastBuildDate>Mon, 19 Oct 2009 09:42:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>CShout 3 Release</title>
		<link>http://coolersport.info/218/cshout-3-release/</link>
		<comments>http://coolersport.info/218/cshout-3-release/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 13:39:55 +0000</pubDate>
		<dc:creator>coolersport</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://coolersport.info/?p=218</guid>
		<description><![CDATA[The new version of CShout has been renovated quite a lots with many long waited features. As in previous versions, it requires no database but a text file for storing shouts. Following are key important features: Use flat-file database, easy for setup and backup Support emoticons, flooding control (spam protection), bad words filtering. Display timestamp and [...]]]></description>
			<content:encoded><![CDATA[<p>The new version of CShout has been renovated quite a lots with many long waited features. As in previous versions, it requires no database but a text file for storing shouts. Following are key important features:</p>
<ul>
<li>Use <strong>flat-file database</strong>, easy for setup and backup</li>
<li>Support emoticons, flooding control (spam protection), bad words filtering.</li>
<li>Display timestamp and ip address via tooltip.</li>
<li>Timezone adjusting.</li>
<li>Allow the admin to <strong>delete unwanted shouts</strong> on the fly.</li>
<li>Search shouts by date, time, shouter, message, and ip address.</li>
<li>Page navigation.</li>
<li><strong>AJAX-Ready</strong>.</li>
<li><strong>Support any language/charset</strong>.</li>
<li>Extremely easy for customising and supporting themes. <span style="color: red">NEW</span></li>
<li>Support integration with other CMS/Forums where users must log in to shout. Their usernames will be used. <span style="color: red">NEW</span></li>
<li>Auto-refresh. Easy to turn into a chat box (rev28: allow admin to force this feature always on). <span style="color: red">NEW</span></li>
</ul>
<p><a href="/files/">Click here</a> to download the latest package of CShout. Since version 3, CShout&#8217;s source code is Subversion controlled at <a href="http://code.google.com/p/cshout/source/checkout">http://code.google.com/p/cshout/source/checkout</a>. View <a href="http://code.google.com/p/cshout/source/list" target="_blank">full change log</a>.</p>
<p>If you have any suggestion or have found any bugs, please <a href="http://code.google.com/p/cshout/issues/list">create a new issue</a> or submit a comment here. For more information, please <a href="http://code.google.com/p/cshout/w/list">visit the wiki</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://coolersport.info/218/cshout-3-release/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>CShout 2.0 Release</title>
		<link>http://coolersport.info/47/cshout-20-release/</link>
		<comments>http://coolersport.info/47/cshout-20-release/#comments</comments>
		<pubDate>Thu, 28 Sep 2006 02:47:07 +0000</pubDate>
		<dc:creator>coolersport</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://coolersport.igaum.com/?p=47</guid>
		<description><![CDATA[New version 2.0 with AJAX implementation can be download from here. From this version, the shoutbox will expand its size which means there is no longer a single script file. Configuration files are kept separate and make it easier for you to customise it.
Compatibility issue is taken seriously. For those who are using browser with no Javascript support/enabled or even AJAX support, the shoutbox still runs well. Even though, there should be a little bit discrepancy in regard of operation and user interaction.
Instruction of how to install this shoutbox is also added. I have strived my best to make this a piece of cake for you. However, should you have any difficulties as installing it, feel free to pass them onto me.]]></description>
			<content:encoded><![CDATA[<div class="paragraph" style="margin: 10px 5px;text-align: justify">This shoutbox completely needs no database at all. It uses a text file as its database. I have created it since I realised that I would need one for my own. Before that, I used the free shoutbox service at<span> </span><a href="http://www.shoutboxes.com/" target="_blank">http://www.shoutboxes.com</a><span> </span>from which I adopted the idea. I started with a free tutorial on the internet which was really really basic and simple.</div>
<div class="paragraph" style="margin: 10px 5px;text-align: justify">You can download, unrar and enjoy it straight away as well as using it with<span> </span><a href="http://www.phpwcms.de/" target="_blank">php<strong>wcms</strong></a><span> </span>as a mod. I don&#8217;t know if this is considered as a mod but it does something different to the orginial copy of phpwcms. It is my little contribution to phpwcms community. This mod will add a shoutbox into your phpwcms site using phpwcms custom replacement tag.</div>
<div class="paragraph" style="margin: 10px 5px;text-align: justify">If you would not mind, please let me know the website that you use this shoutbox. Put a link in to my shoutbox so that others can have different live demos of this shoutbox.</div>
<div class="paragraph" style="margin: 10px 5px;text-align: justify;font-weight: bold">Features:</div>
<ul>
<li>Use<span> </span><strong>flat-file database</strong>, easy for setup and backup</li>
<li>Support emoticons, flooding control (spam protection), bad words filtering.</li>
<li>Display timestamp and ip address via tooltip.</li>
<li>Timezone adjusting.</li>
<li>Allow the admin to<span> </span><strong>delete unwanted shouts</strong><span> </span>on the fly.</li>
<li>Search shouts by date, time, shouter, message, and ip address.</li>
<li>Page navigation.</li>
<li>New version 2.0 implements<span> </span><strong>AJAX</strong>.</li>
<li><strong>Support any language/charset</strong>.</li>
</ul>
<div class="paragraph" style="margin: 10px 5px;text-align: justify;font-weight: bold">Websites link to this shoutbox:</div>
<div class="paragraph" style="margin: 10px 5px;text-align: justify;padding-left: 20px"><a href="http://freshmeat.net/projects/cshout" target="_blank">http://freshmeat.net/projects/cshout</a><br />
<a href="http://www.hotscripts.com/Detailed/63497.html" target="_blank">http://www.hotscripts.com/Detailed/63497.html</a><br />
<a href="http://sourceforge.net/projects/cshout" target="_blank">http://sourceforge.net/projects/cshout</a><br />
<a href="http://www.sitebeater.com/cshout.html" target="_blank">http://www.sitebeater.com/cshout.html</a><br />
<a href="http://os.job4vn.net/index.php?start_from=4&amp;ucat=&amp;archive=&amp;subaction=&amp;id=&amp;show=8&amp;page=chat" target="_blank">http://os.job4vn.net</a><br />
<a href="http://www.webtaller.com/tallerscripts/scripts/7/?bol0906-4" target="_blank">http://www.webtaller.com</a><br />
<a href="http://www.devscripts.com/scripts/5021/Shoutbox/index.html" target="_blank">http://www.devscripts.com</a><br />
<a href="http://blogs.pathf.com/agileajax/2006/09/application_wat_2.html" target="_blank">http://blogs.pathf.com/agileajax</a><br />
<a href="http://digg.com/programming/CShout_Free_Ajax_Shoutbox_With_Many_Features" target="_blank">http://digg.com/programming</a><span> </span><a href="http://korean.osstrans.net/software/cshout.html" target="_blank">http://korean.osstrans.net/software/cshout.html</a></div>
<div class="paragraph" style="margin: 10px 5px;text-align: justify;font-weight: bold">Websites use this shoutbox:</div>
<div class="paragraph" style="margin: 10px 5px;text-align: justify;padding-left: 20px"><a href="http://www.soronrille.com/v5.o/index.html" target="_blank">http://www.soronrille.com</a><br />
<a href="http://up-yours.us/" target="_blank">http://up-yours.us</a><br />
<a href="http://www.lpv-sev.ch/" target="_blank">http://www.lpv-sev.ch</a><br />
<a href="http://suckamucka.com/anime/blog/biriblog.php" target="_blank">http://suckamucka.com/anime/blog/biriblog.php</a><br />
<a href="http://www.nightoftherhythm.be/index_.htm" target="_blank">http://www.nightoftherhythm.be</a></div>
<div class="articleTitle" style="margin: 15px 0px 5px 5px;font-weight: bold;padding-left: 15px">CShout 2.x</div>
<div style="padding-left: 10px">
<div class="paragraph" style="margin: 10px 5px;text-align: justify;font-weight: bold;font-style: italic">Install instruction:</div>
<div class="paragraph" style="margin: 10px 5px;text-align: justify">- Please refer to<span> </span><a href="http://coolersport.info/cshout/installation.html" target="_blank">installation.html</a><span> </span>in the CShout 2.0 package.</div>
<div class="paragraph" style="margin: 10px 5px;text-align: justify;font-weight: bold;font-style: italic">Versions:</div>
<div class="paragraph" style="margin: 10px 5px;text-align: justify"><span style="text-decoration: underline">2.0</span>: released on 28 September, 2006 with AJAX implementation but still be compatible with browsers that do not support JavaScript or AJAX. It&#8217;s now called CShout 2.0</div>
</div>
<div class="paragraph" style="margin: 10px 5px;text-align: center">Download <a href="http://coolersport.info/wp-content/plugins/download-monitor/download.php?id=1" title="Downloaded 6261 times">CShout 2.0.1</a></div>
<div class="articleTitle" style="margin: 15px 0px 5px 5px;font-weight: bold;padding-left: 15px">Shoutbox 1.x</div>
<div style="padding-left: 10px">
<div class="paragraph" style="margin: 10px 5px;text-align: justify;font-weight: bold;font-style: italic">Notes:</div>
<div class="paragraph" style="margin: 10px 5px;text-align: justify">Version 1.x is out of date and no longer get updated or fixed. It is recommended to install the latest version.<strong>REMEMBER</strong><span> </span>that the replacement tag for php<strong>wcms</strong><span> </span>only works with version 1.x, for newer versions please refer to its installation notes. The replacement tag should be decompressed into/phpwcms_template/inc_script/frontend_render then you can use the tag {SHOUTBOX:‹width›x‹height›} in your articles.</div>
<div class="paragraph" style="margin: 10px 5px;text-align: justify;font-weight: bold;font-style: italic">Versions:</div>
<div class="paragraph" style="margin: 10px 5px;text-align: justify"><span style="text-decoration: underline">1.05</span>: released on 17 June, 2006 with bug fixed and new features. Check the change log in the source code. For those who would like to update from old versions, you only need to replace the file shout.php and off you go.</div>
<div class="paragraph" style="margin: 10px 5px;text-align: justify"><span style="text-decoration: underline">1.02</span>: released on 06 June, 2005 with features added: flooding control, smiley selection panel and paging navigation.</div>
<div class="paragraph" style="margin: 10px 5px;text-align: justify"><span style="text-decoration: underline">1.01</span>: released on 05 June, 2005 with updating of timezone settings. Now it does not matter where you host your website, just set the timezone setting in the shoutbox to exactly where you are in the world it will tell you the right time of those shouts. Stop the mouse over a shout, it will tell you when and where (date, time and ip address) it was posted.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://coolersport.info/47/cshout-20-release/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to write your own GDownloadUrl function</title>
		<link>http://coolersport.info/44/how-to-write-your-own-gdownloadurl-function/</link>
		<comments>http://coolersport.info/44/how-to-write-your-own-gdownloadurl-function/#comments</comments>
		<pubDate>Fri, 15 Sep 2006 02:45:26 +0000</pubDate>
		<dc:creator>coolersport</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://coolersport.igaum.com/?p=44</guid>
		<description><![CDATA[While doing the javascript calendar with ajax, I figured that I would need a wrapper function like GDownloadUrl() as you may see in Google Map API. Now, I would like to share this experience to you. Please have a look.]]></description>
			<content:encoded><![CDATA[<p style="margin: 10px 5px;text-align: justify">While doing the javascript calendar with ajax, I figured that I would need a wrapper function like GDownloadUrl() as you may see in Google Map API. The point is how to pass your custom function to this GDownloadUrl() to process returned xml data.</p>
<p style="margin: 10px 5px;text-align: justify;font-weight: bold">The Code</p>
<p style="margin: 10px 5px;text-align: justify">A few Google searches gave me the idea of how to do it. I would say this function will do exactly what GDownloadUrl does. In that regard, I name it CDownloadUrl.</p>
<p style="margin: 10px 5px;text-align: justify">Now have a look at the code, explanation will be followed.</p>
<pre class="brush: php; title: ; notranslate">
/*
method : POST/GET
url    : Call url
func   : custom function which is used to process returned data,
take only one parameter
*/
function CDownloadUrl(method, url, func) {
tvar httpObj;
tvar browser = navigator.appName;
tif(browser.indexOf(&amp;amp;amp;quot;Microsoft&amp;amp;amp;quot;) &amp;amp;amp;gt; -1)
tthttpObj = new ActiveXObject(&amp;amp;amp;quot;Microsoft.XMLHTTP&amp;amp;amp;quot;);
telse httpObj = new XMLHttpRequest();
tthttpObj.open(method, url, true);
thttpObj.onreadystatechange = function() {
ttif(httpObj.readyState == 4){
tttif (httpObj.status == 200) {
ttttvar contenttype = httpObj.getResponseHeader('Content-Type');
ttttif (contenttype.indexOf('xml')&amp;amp;amp;gt;-1) {
tttttfunc(httpObj.responseXML);
tttt} else {
tttttfunc(httpObj.responseText);
tttt}
ttt} else {
ttttfunc('Error: '+httpObj.status);
ttt}
tt}
t};
thttpObj.send(null);
}
</pre>
<p style="margin: 10px 5px;text-align: justify">The function will take 3 parameters which specify method (GET or POST), url and a function taking return data as its parameter. I will give a example of this custom function later.</p>
<p style="margin: 10px 5px;text-align: justify">From line 8 to 13, it is all about setting up variables and instantate an XML object depending on the kind of browser (Microsoft or Non-Microsoft).</p>
<p style="margin: 10px 5px;text-align: justify">After openning a connection on line 15, a handler is defined for<span> </span><strong>onreadystatechange</strong><span> </span>event up to line 29.</p>
<p style="margin: 10px 5px;text-align: justify">The handler actually runs as all the operations are completed (readyState = 4). The early version of this handler was like this:</p>
<pre class="brush: php; title: ; notranslate">
httpObj.onreadystatechange = function() {
tif(httpObj.readyState == 4){
ttfunc(httpObj.responseXML);
t}
};
</pre>
<p style="margin: 10px 5px;text-align: justify">It lacks of some essential error checking. The handler needs to check if the request was successful (status code 200 means OK), otherwise it will return<span> </span><strong>Error:<span> </span></strong>plus status code.</p>
<p style="margin: 10px 5px;text-align: justify">Now it seems okie to retrieve data, you may get them from<span> </span><em>responseXML</em><span> </span>or<span> </span><em>responseText</em>. By checking its &#8216;Content-Type&#8217; header, it knows what to return. Finally, it just pass the data to your custom function.</p>
<p style="margin: 10px 5px;text-align: justify">The last statement is just send the request away.</p>
<p style="margin: 10px 5px;text-align: justify;font-weight: bold">Example</p>
<p style="margin: 10px 5px;text-align: justify">Many people would find it hard to understand the code without some examples. The following will demonstrate how to use CDownloadUrl to request some text and display it into a div element. Assuming the getsometext.php script return some raw text.</p>
<pre class="brush: php; title: ; notranslate">
document.write('&amp;amp;amp;lt;div id=&amp;amp;amp;quot;test&amp;amp;amp;quot;&amp;amp;amp;gt;Old text&amp;amp;amp;lt;/div&amp;amp;amp;gt;');
CDownloadUrl('get', 'getsometext.php', function(text) {
tdocument.getElementById('test').innerHTML = text;
});
</pre>
<p>It can be rewritten in another way as below which is clearer and easy to understand.</p>
<pre class="brush: php; title: ; notranslate">
document.write('&amp;amp;amp;lt;div id=&amp;amp;amp;quot;test&amp;amp;amp;quot;&amp;amp;amp;gt;Old text&amp;amp;amp;lt;/div&amp;amp;amp;gt;');
function showText(text) {
tdocument.getElementById('test').innerHTML = text;
}
CDownloadUrl('get', 'getsometext.php', showText);
</pre>
<p style="margin: 10px 5px;text-align: justify">That&#8217;s it. I hope you understand and apply it into your own application. If you have any questions or comments, please feel free to shout it in my shoutbox or the form below.</p>
]]></content:encoded>
			<wfw:commentRss>http://coolersport.info/44/how-to-write-your-own-gdownloadurl-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Online Picture EXchange</title>
		<link>http://coolersport.info/65/online-picture-exchange/</link>
		<comments>http://coolersport.info/65/online-picture-exchange/#comments</comments>
		<pubDate>Wed, 12 Oct 2005 07:05:07 +0000</pubDate>
		<dc:creator>coolersport</dc:creator>
				<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://coolersport.igaum.com/?p=65</guid>
		<description><![CDATA[This is an assignment task which was done in PHP and used MySQL as back-end database. Please visithttp://opex.coolersport.info for more information. A demo user has been provided with user for both username and password.]]></description>
			<content:encoded><![CDATA[<p><span class="Apple-style-span" style="color: #000000;font-family: 'times new roman';font-size: 16px;font-style: normal;font-variant: normal;font-weight: normal"><span class="Apple-style-span" style="color: #393f4a;font-family: arial;font-size: 11px;text-align: justify">This is an assignment task which was done in PHP and used MySQL as back-end database. Please visit<a href="http://opex.coolersport.info/" target="_blank">http://opex.coolersport.info</a><span class="Apple-converted-space"> </span>for more information. A demo user has been provided with<span class="Apple-converted-space"> </span><strong>user</strong><span class="Apple-converted-space"> </span>for both username and password.</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://coolersport.info/65/online-picture-exchange/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Neuragenix Pty Ltd</title>
		<link>http://coolersport.info/63/neuragenix-pty-ltd/</link>
		<comments>http://coolersport.info/63/neuragenix-pty-ltd/#comments</comments>
		<pubDate>Tue, 13 Sep 2005 07:04:32 +0000</pubDate>
		<dc:creator>coolersport</dc:creator>
				<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://coolersport.igaum.com/?p=63</guid>
		<description><![CDATA[Visit Neuragenix&#8217;s home page at http://neuragenix.com]]></description>
			<content:encoded><![CDATA[<p><span class="Apple-style-span" style="color: #000000;font-family: 'times new roman';font-size: 16px;font-style: normal;font-variant: normal;font-weight: normal"><span class="Apple-style-span" style="color: #393f4a;font-family: arial;font-size: 11px">Visit Neuragenix&#8217;s home page at<span class="Apple-converted-space"> </span><a href="http://neuragenix.com/" target="_blank">http://neuragenix.com</a></span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://coolersport.info/63/neuragenix-pty-ltd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nunawading Car Sale</title>
		<link>http://coolersport.info/61/nunawading-car-sale/</link>
		<comments>http://coolersport.info/61/nunawading-car-sale/#comments</comments>
		<pubDate>Tue, 23 Aug 2005 07:03:36 +0000</pubDate>
		<dc:creator>coolersport</dc:creator>
				<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://coolersport.igaum.com/?p=61</guid>
		<description><![CDATA[Required by Nunawading Hyundai &#38; Chrysler Jeep. Their websites are available at: http://www.nunawadinghyundai.com.au or http://www.nunawadingchryslerjeep.com.au]]></description>
			<content:encoded><![CDATA[<p><span class="Apple-style-span" style="color: #000000;font-family: 'times new roman';font-size: 16px;font-style: normal;font-variant: normal;font-weight: normal"><span class="Apple-style-span" style="color: #393f4a;font-family: arial;font-size: 11px"></p>
<div class="paragraph" style="margin: 10px 5px;text-align: justify">Required by Nunawading Hyundai &amp; Chrysler Jeep. Their websites are available at:</div>
<div class="paragraph" style="margin: 10px 5px;text-align: justify"><a href="http://www.nunawadinghyundai.com.au/" target="_blank">http://www.nunawadinghyundai.com.au</a><span class="Apple-converted-space"> </span>or<br />
<a href="http://www.nunawadingchryslerjeep.com.au/" target="_blank">http://www.nunawadingchryslerjeep.com.au</a><span class="Apple-converted-space"></span></div>
<p></span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://coolersport.info/61/nunawading-car-sale/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create and Email PDF File &#8216;On The Fly&#8217; With PHP</title>
		<link>http://coolersport.info/224/create-and-email-pdf-file-on-the-fly-with-php/</link>
		<comments>http://coolersport.info/224/create-and-email-pdf-file-on-the-fly-with-php/#comments</comments>
		<pubDate>Sat, 25 Jun 2005 09:57:03 +0000</pubDate>
		<dc:creator>coolersport</dc:creator>
				<category><![CDATA[Code snippets]]></category>
		<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://coolersport.info/?p=224</guid>
		<description><![CDATA[Create a pdf on the fly, I am sure that many people know how to do it but not attaching those into email. You can have a lot tutorials about generating a pdf on the fly without storing anything on webserver. This technique allow you to customise the pdf as client&#8217;s requirements. Let&#8217;s say you [...]]]></description>
			<content:encoded><![CDATA[<p>Create a pdf on the fly, I am sure that many people know how to do it but not attaching those into email. You can have a lot tutorials about generating a pdf on the fly without storing anything on webserver. This technique allow you to customise the pdf as client&#8217;s requirements.</p>
<p>Let&#8217;s say you have a huge database of various types of books. On your website, visitors have the option to download sample booklet (in pdf format) of a book for which they are looking. In the old days, you have to create all of those pdf files manually or whatever way you can then upload them onto web server. Links to those pdf files have to be set up in advance properly. If you add new books to your database, the same process of making sample booklet will be repeated.</p>
<p>Today, that process can be done just in one php file which uses some libraries to generate pdf booklet on the fly as soon as a visitor asks for downloading it. I will show you this simple step in a moment.</p>
<p>However, what could you do if you do want to send those booklet to your visitors through provided email address instead of downloading them. Should you give them a link to the file or attach them with that email? A link in an email is nothing easier but attachment. After showing you how to create a pdf file on the fly using FPDF class, I will demonstrate how to attach that pdf file into emails.</p>
<p><span style="text-decoration: underline"><strong>PART I: Create PDF file on the fly</strong></span></p>
<p>To generate a PDF file using PHP, you need a tool that supports you to do so. In this tutorial, I use FPDF which is completely free and can be downloaded from <a rel="nofollow" href="http://www.astahost.com/redirect.php?url=http%3A%2F%2Fwww.fpdf.org" target="_blank">http://www.fpdf.org</a>. Following are some highlight features:</p>
<p>° Choice of measure unit, page format and margins<br />
° Page header and footer management<br />
° Automatic page break<br />
° Automatic line break and text justification<br />
° Image support (JPEG and PNG)<br />
° Colors<br />
° Links<br />
° TrueType, Type1 and encoding support<br />
° Page compression</p>
<p>You do not need to have any extra tool to get FPDF to work. However, if you choose to use compression feature, zlib is required. FPDF works just fine with PHP version 4 and 5.</p>
<p>In this tutorial, the main purpose is how to send a pdf that you create on the fly as an email attachment. So, the following simple example on how to create a pdf file using PHP is borrowed from FPDF website. Visit <a rel="nofollow" href="http://www.astahost.com/redirect.php?url=http%3A%2F%2Fwww.fpdf.org" target="_blank">FPDF website</a> for full documentation and tutorials.</p>
<pre class="brush: php; title: ; notranslate">&amp;amp;lt;?php
require('fpdf.php');

$pdf=new FPDF();
$pdf-&amp;amp;gt;AddPage();
$pdf-&amp;amp;gt;SetFont('Arial','B',16);
$pdf-&amp;amp;gt;Cell(40,10,'Hello World!');
$pdf-&amp;amp;gt;Output();
?&amp;amp;gt;</pre>
<p>The sample code above just returns a pdf file with the message &#8220;Hello World!&#8221; as usual. I will use the same code in the next part of this tutorial.</p>
<p>Make sure you download the fpdf.php from <a rel="nofollow" href="http://www.astahost.com/redirect.php?url=http%3A%2F%2Fwww.fpdf.org" target="_blank">FPDF website</a> and place it in the same folder with the example file or using absolute/relative path to fpdf.php if it is in another folder.</p>
<p><span style="text-decoration: underline"><strong>PART II: Sending pdf as email attachment</strong></span></p>
<p>You can send email using just native PHP code. However, to make this task simple, I prefer to use PEAR&#8217;s Mail class which can be obtained from <a rel="nofollow" href="http://www.astahost.com/redirect.php?url=http%3A%2F%2Fpear.php.net" target="_blank">http://pear.php.net</a>. Do not forget to get a copy of PEAR&#8217;s Mime class because PEAR&#8217;s Mail need it to attach files into emails.</p>
<p>Make sure you set up all those PEAR classes properly in order to get this to work.</p>
<pre class="brush: php; title: ; notranslate">&amp;amp;lt;?php
require('fpdf/fpdf.php');

$pdf=new FPDF();
$pdf-&amp;amp;gt;AddPage();
$pdf-&amp;amp;gt;SetFont('Arial','B',16);
$pdf-&amp;amp;gt;Cell(40,10,'Hello World!');
$pdfcontent = $pdf-&amp;amp;gt;Output(&amp;amp;quot;helloworld.pdf&amp;amp;quot;, &amp;amp;quot;S&amp;amp;quot;);

require_once('Mail.php');
require_once('Mail/mime.php');

// email address of the recipient
$to = &amp;amp;quot;recipient@yahoo.com&amp;amp;quot;;

// email address of the sender
$from = &amp;amp;quot;sender@yahoo.com&amp;amp;quot;;

// subject of the email
$subject = &amp;amp;quot;Hello world from coolersport&amp;amp;quot;;

// email header format complies the PEAR's Mail class
// this header includes sender's email and subject
$headers = array('From'    =&amp;amp;gt; $from,
'Subject' =&amp;amp;gt; $subject);

// We will send this email as HTML format
// which is well presented and nicer than plain text
// using the heredoc syntax
// REMEMBER: there should not be any space after PDFMAIL keyword in the next following lines
$htmlMessage = &amp;amp;lt;&amp;amp;lt;&amp;amp;lt;PDFMAIL
&amp;amp;lt;html&amp;amp;gt;
&amp;amp;lt;body bgcolor=&amp;amp;quot;#ffffff&amp;amp;quot;&amp;amp;gt;
&amp;amp;lt;p align=&amp;amp;quot;center&amp;amp;quot;&amp;amp;gt;
Please find the pdf attached in the email.&amp;amp;lt;br&amp;amp;gt;
This is generated by &amp;amp;lt;b style=&amp;amp;quot;font-size:18pt;&amp;amp;quot;&amp;amp;gt;FPDF&amp;amp;lt;/b&amp;amp;gt;
&amp;amp;lt;/p&amp;amp;gt;
&amp;amp;lt;/body&amp;amp;gt;
&amp;amp;lt;/html&amp;amp;gt;
PDFMAIL;

// create a new instance of the Mail_Mime class
$mime = new Mail_Mime();

// set HTML content
$mime-&amp;amp;gt;setHtmlBody($htmlMessage);

// IMPORTANT: add pdf content as attachment
$mime-&amp;amp;gt;addAttachment($pdfcontent, 'application/pdf', 'helloworld.pdf', false, 'base64');

// build email message and save it in $body
$body = $mime-&amp;amp;gt;get();

// build header
$hdrs = $mime-&amp;amp;gt;headers($headers);

// create Mail instance that will be used to send email later
$mail = &amp;amp;amp;Mail::factory('mail');

// Sending the email, according to the address in $to,
// the email headers in $hdrs,
// and the message body in $body.
$mail-&amp;amp;gt;send($to, $hdrs, $body);

?&amp;amp;gt;</pre>
<p>You can notice that this will send email using built-in PHP mail() function, so make sure your web server can send email. I reckon the localhost will not work in this case. Look at the line:</p>
<p>// create Mail instance that will be used to send email later<br />
$mail = &amp;Mail::factory(&#8216;mail&#8217;);</p>
<p>If you want to send email using SMTP or other method, please read instruction in PEAR documentation.</p>
<p>As you can see, in the sample in part 1, the function output() is used without any parameter. As default, FPDF will return PDF code to http stream and will be display at client browser. In the example of part 2, output() function has two parameters. The first one is file name of that pdf file, which will be ignored because the second parameter &#8220;S&#8221; is used. Passing string &#8220;S&#8221; in the second parameter of the output() function will tell FPDF to return PDF file as a string instead of output it to client browser. As you can see, the result is stored in $pdfcontent and attached into the email later. The addAttachment() function will cast the $pdfcontent string into &#8220;base64&#8243; format which will produce correct format for the pdf file in email attachment.</p>
<p><span style="text-decoration: underline"><strong>Conclusion</strong></span></p>
<p>I do not want to cover too much information in this tutorial except what has been discussed above. If you&#8217;d like to understand more about FPDF and PEAR&#8217;s functions, please visit their website.</p>
<p>I hope that this will give you a idea of what the tutorial title says and you can put this into work.</p>
]]></content:encoded>
			<wfw:commentRss>http://coolersport.info/224/create-and-email-pdf-file-on-the-fly-with-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New replacement tag for phpwcms</title>
		<link>http://coolersport.info/30/new-replacement-tag-for-phpwcms/</link>
		<comments>http://coolersport.info/30/new-replacement-tag-for-phpwcms/#comments</comments>
		<pubDate>Mon, 13 Jun 2005 02:18:11 +0000</pubDate>
		<dc:creator>coolersport</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://coolersport.igaum.com/?p=30</guid>
		<description><![CDATA[This COLOR CODE tag allows you to insert colorised source code into your article, just like Web collections section of mine. Ah, this replacement tag is only for phpwcms. It takes the advantages of GeSHi that supports colorising many types of source code. Check it out in my portfolio section]]></description>
			<content:encoded><![CDATA[<p><span class="Apple-style-span" style="color: #000000;font-family: 'times new roman';font-size: 16px;font-style: normal;font-variant: normal;font-weight: normal"></span></p>
<div class="paragraph" style="margin: 10px 5px;text-align: justify">Have you ever wanted to display some code in your articles? Can you just copy and paste them into the article with plain text format? That is not a good idea at all.</div>
<div class="paragraph" style="margin: 10px 5px;text-align: justify">This replacement tag will allow you to insert colourised code snippets into your articles. It should be only used with<a href="http://www.phpwcms.de/" target="_blank">php<strong>wcms</strong></a>.</div>
<div class="paragraph" style="margin: 10px 5px;text-align: justify">Code is colourised by<span class="Apple-converted-space"> </span><strong>GeSHi</strong><span class="Apple-converted-space"> </span>at<span class="Apple-converted-space"> </span><a href="http://qbnz.com/highlighter" target="_blank">http://qbnz.com/highlighter</a>. View the source file ctag_colorcode.php for more information.</div>
<div class="paragraph" style="margin: 10px 5px;text-align: justify"><a href="/csite/index.php?a=CDownloadUrl">Click here</a><span class="Apple-converted-space"> </span>for online demo.</div>
<div class="paragraph" style="margin: 10px 5px;text-align: justify;font-weight: bold">Install instruction:</div>
<div class="paragraph" style="margin: 10px 5px;text-align: justify">- Unrar all the files/folders into<span class="Apple-converted-space"> </span>/phpwcms_template/inc_script/frontend_render<br />
- Copy and paste the css code in codecolorizer/geshi.css into your css file.<br />
- Now you can use the tag [COLOR CODE:][/COLOR CODE] in your article.</div>
]]></content:encoded>
			<wfw:commentRss>http://coolersport.info/30/new-replacement-tag-for-phpwcms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linetics Network Solutions</title>
		<link>http://coolersport.info/51/linetics-network-solutions/</link>
		<comments>http://coolersport.info/51/linetics-network-solutions/#comments</comments>
		<pubDate>Sun, 01 Apr 2001 02:59:42 +0000</pubDate>
		<dc:creator>coolersport</dc:creator>
				<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://coolersport.igaum.com/?p=51</guid>
		<description><![CDATA[Visit their website at http://linetics.de.]]></description>
			<content:encoded><![CDATA[<p><span class="Apple-style-span" style="color: #000000;font-family: 'times new roman';font-size: 16px;font-style: normal;font-variant: normal;font-weight: normal"><span class="Apple-style-span" style="color: #393f4a;font-family: arial;font-size: 11px;text-align: justify">Visit their website at<span class="Apple-converted-space"> </span><a href="http://linetics.de/" target="_blank">http://linetics.de</a>.</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://coolersport.info/51/linetics-network-solutions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

