<?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"
	>

<channel>
	<title>.: TRSplet - internetne storitve .:</title>
	<atom:link href="http://trsplet.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://trsplet.com/blog</link>
	<description>O spletu, življenju in RT le tega</description>
	<pubDate>Wed, 02 Jul 2008 09:53:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Anti IE6 propaganda - Save the Developers</title>
		<link>http://trsplet.com/blog/2008/07/02/anti-ie6-propaganda-save-the-developers/</link>
		<comments>http://trsplet.com/blog/2008/07/02/anti-ie6-propaganda-save-the-developers/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 09:49:31 +0000</pubDate>
		<dc:creator>Roky</dc:creator>
		
		<category><![CDATA[Splet]]></category>

		<category><![CDATA[IE 6.0]]></category>

		<category><![CDATA[internet explorer 6]]></category>

		<category><![CDATA[save the developers]]></category>

		<guid isPermaLink="false">http://trsplet.com/blog/?p=266</guid>
		<description><![CDATA[Čas bi že bil, da vsi uporabniki namestijo Internet Explorer 7, ki je veliko boljši kot Internet Explorer 6 (čeprav daleč od popolnosti). V ta namen je grupa razvijalcev razvila lep in uporaben Javascript pripomoček, ki vsakemu, ki dostopa preko Internet Explorer 6 brskalnika priproča namestitev novejšega brskalnika. 
Kot je omenjeno v naslovu se grupa [...]]]></description>
			<content:encoded><![CDATA[<p>Čas bi že bil, da vsi uporabniki namestijo Internet Explorer 7, ki je veliko boljši kot Internet Explorer 6 (čeprav daleč od popolnosti). V ta namen je grupa razvijalcev razvila lep in uporaben Javascript pripomoček, ki vsakemu, ki dostopa preko Internet Explorer 6 brskalnika priproča namestitev novejšega brskalnika. <span id="more-266"></span></p>
<p>Kot je omenjeno v naslovu se grupa razvijalcev, ki so začeli s to iniciativo, imenuje <a target="_blank" href="http://www.savethedevelopers.org/index.php ">Save the Developers</a>.</p>
<p><strong>Uporaba:</strong><br />
V header sekcijo dodajate sledečo vrstico:</p>
<div class="igBar"><span id="ljavascript-2"><a href="#" onclick="javascript:showPlainTxt('javascript-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-2">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;script src=<span style="color: #3366CC;">"http://www.savethedevelopers.org/say.no.to.ie.6.js"</span>&gt;&lt;/script&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>... oz. mogoče še boljše, da zadevo shranite in jo kopirate na vaš strežnik za hitrejše nalaganje skripte.</p>
<p><strong>Kako zadeva izgleda:</strong><br />
<a target="_blank" href='http://trsplet.com/blog/wp-content/uploads/2008/07/savethedevelopers_ie6_dropdown.png'><img src="http://trsplet.com/blog/wp-content/uploads/2008/07/savethedevelopers_ie6_dropdown-150x150.png" alt="Save the developers IE 6 dropdown" title="savethedevelopers_ie6_dropdown" width="150" height="150" class="alignnone size-thumbnail wp-image-267" /></a></p>
<p><strong>Zakaj bi to dodal na svojo spletno stran?</strong><br />
Ker bomo s tem pohitrili proces posodobitve zastarelih brskalnikov in vsem nam, ki izdelujemo spletne strani oz. aplikacije (kakor želite) naredili življenje lažje, mogoče se bomo namesto popravljanja napak v IE 6.0 lotili izdelave kakšnega novega super duper fancy bonbončka:)?</p>
<p><strong>Stranka želi, da zadeva deluje pod IE 6.0</strong><br />
Ni problema, še vedno lahko stran optimizirate za Internet Explorer 6.0. S zgoraj omenjenim dodatkom le stranki oz. obiskovalcu sporočate, da bi bilo zelo vredu, če bi posodobili svoj brskalnik.</p>
<p><strong>Jezik - angleščina:</strong><br />
Se strinjam, veliko bolj uporabno bi bilo, če bi bila zadeva v slovenščini. No, tudi to ni tak problem. Ko se bo našel nekdo, ki bo <a target="_blank" href="http://www.savethedevelopers.org/js/lang/en/popDown.gif">poslovenil zadevo</a> lahko dodamo tudi slovenski napis:)</p>
<p><strong>Dodatne informacije:</strong></p>
<ul>
<li><a target="_blank" href="http://wordpress.org/extend/plugins/save-the-developers/">Wordpress Save The Developers dodatek - vtičnik</a></li>
<li><a target="_blank" href="http://www.w3schools.com/browsers/browsers_stats.asp">Statistika uporabe različnih brskalnikov</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://trsplet.com/blog/2008/07/02/anti-ie6-propaganda-save-the-developers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP - Virtualne pod-domene - virtual subdomains</title>
		<link>http://trsplet.com/blog/2008/06/28/php-virtualne-pod-domene-subdomains/</link>
		<comments>http://trsplet.com/blog/2008/06/28/php-virtualne-pod-domene-subdomains/#comments</comments>
		<pubDate>Sat, 28 Jun 2008 07:32:37 +0000</pubDate>
		<dc:creator>Roky</dc:creator>
		
		<category><![CDATA[Splet]]></category>

		<category><![CDATA[Splet (PHP &amp; MySQL)]]></category>

		<category><![CDATA[.htaccess]]></category>

		<category><![CDATA[Apache]]></category>

		<category><![CDATA[IIS]]></category>

		<category><![CDATA[isapi]]></category>

		<category><![CDATA[mod_rewrite]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[redirect]]></category>

		<category><![CDATA[subdomain]]></category>

		<category><![CDATA[virtual]]></category>

		<guid isPermaLink="false">http://trsplet.com/blog/?p=265</guid>
		<description><![CDATA[Vrsto spletnih strani vam ponuja lastno pod-domeno naprimer roky.album.net ali karkoli.vašadomena.com. Kako to dosežemo? Za vsaka uporabnika kreiramo novo pod-domeno? Ne, pomagamo si s virtualnimi pod-domenami.
Princip delovanja je podoben kot pri kreiranju prijaznih URL-jev za uporabnika in iskalnike. Karkoli uporabnik vpiše v naslovno vrstico (address bar) mod_rewrite modul preusmeri na našo glavno domeno (index.php) kjer [...]]]></description>
			<content:encoded><![CDATA[<p>Vrsto spletnih strani vam ponuja lastno pod-domeno naprimer roky.album.net ali karkoli.vašadomena.com. Kako to dosežemo? Za vsaka uporabnika kreiramo novo pod-domeno? Ne, pomagamo si s virtualnimi pod-domenami.<span id="more-265"></span></p>
<p>Princip delovanja je podoben kot pri <a target="_blank" href="http://trsplet.com/blog/2008/03/13/iskalnikom-in-uporabnikom-prijazni-url-ji-user-seo-freindly-url-apache-iis/">kreiranju prijaznih URL-jev za uporabnika in iskalnike</a>. Karkoli uporabnik vpiše v naslovno vrstico (address bar) mod_rewrite modul preusmeri na našo glavno domeno (index.php) kjer s PHP-jem preberemo ali je uporabnik vpisal kakšno pod-domeno ali ne. Na podlagi vpisane pod-domene pa potem vrnemo podatke le za tistega uporabnika (naprimer vrnemo slike, ki se virtualno nahajajo na vpisana_pod_domena oz. roky.album.com naprimer). S tem uporabniku damo možnost personalizacije ter lažjega pomnjenja naslova, kjer lahko dostopa do svojih slik, saj bi se uporabnik težje zapomnil index.php?album=roky&#038;list=view kot pa roky.album.com. <strong>Torej potrebujemo:</strong></p>
<ul>
<li>mod rewrite(Apache) ali ISAPI Rewrite (IIS)</li>
<li>.htaccess</li>
</ul>
<p>Ko vam mod_rewrite modul deluje (poglejte s phpinfo) <strong>dodajte sledečo vsebino pod .htaccess:</strong></p>
<div class="igBar"><span id="lphp-6"><a href="#" onclick="javascript:showPlainTxt('php-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-6">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">RewriteEngine on</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">RewriteCond %<span style="color:#006600; font-weight:bold;">&#123;</span>HTTP_HOST<span style="color:#006600; font-weight:bold;">&#125;</span> !^www\.vasa_domena\.com$ <span style="color:#006600; font-weight:bold;">&#91;</span>NC<span style="color:#006600; font-weight:bold;">&#93;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">RewriteRule <span style="color:#006600; font-weight:bold;">&#40;</span>.*<span style="color:#006600; font-weight:bold;">&#41;</span> http:<span style="color:#FF9933; font-style:italic;">//www.vasa_domena.com/$1 [R=301,L] </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>S tem dosežemo, da vsakega uporabnika preusmerimo na root domene ne glede na to kaj uporabnik vpiše. Sedaj potrebujemo še <strong>PHP kodo, ki bo prebrala kakšno pod-domeno je uporabnik vpisal:</strong></p>
<div class="igBar"><span id="lphp-7"><a href="#" onclick="javascript:showPlainTxt('php-7'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-7">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> getSubDomain<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color:#0000FF;">$full_url</span>&nbsp; &nbsp;= <a href="http://www.php.net/sprintf"><span style="color:#000066;">sprintf</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$_SERVER</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'HTTP_HOST'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color:#0000FF;">$subdomain</span>&nbsp; &nbsp;= <span style="color:#FF0000;">''</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color:#616100;">for</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$i</span> = <span style="color:#CC66CC;color:#800000;">0</span>; <span style="color:#0000FF;">$i</span> &lt;= <a href="http://www.php.net/strlen"><span style="color:#000066;">strlen</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$full_url</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#0000FF;">$i</span>++<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$dummy</span> = <a href="http://www.php.net/substr"><span style="color:#000066;">substr</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$full_url</span>, <span style="color:#0000FF;">$i</span>, <span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$dummy</span> == <span style="color:#FF0000;">"."</span> and <span style="color:#0000FF;">$subdomain</span> !== <span style="color:#FF0000;">'www'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#616100;">break</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$subdomain</span> = <span style="color:#0000FF;">$subdomain</span>.<span style="color:#0000FF;">$dummy</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color:#FF9933; font-style:italic;">// Get Subdomain List</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/strpos"><span style="color:#000066;">strpos</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$subdomain</span>, <span style="color:#FF0000;">'www'</span><span style="color:#006600; font-weight:bold;">&#41;</span> !== <span style="color:#000000; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#0000FF;">$subdomain</span> = <a href="http://www.php.net/str_replace"><span style="color:#000066;">str_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'www.'</span>, <span style="color:#FF0000;">''</span>, <span style="color:#0000FF;">$subdomain</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color:#0000FF;">$subdomain</span> = <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$subdomain</span> &lt;&gt; <span style="color:#FF0000;">"www"</span><span style="color:#006600; font-weight:bold;">&#41;</span> ? <span style="color:#0000FF;">$subdomain</span> : <span style="color:#000000; font-weight:bold;">false</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color:#0000FF;">$subdomain</span> = <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$subdomain</span> === <span style="color:#FF0000;">'trsplet'</span><span style="color:#006600; font-weight:bold;">&#41;</span>&nbsp; ? <span style="color:#000000; font-weight:bold;">false</span> : <span style="color:#0000FF;">$subdomain</span>; <span style="color:#FF9933; font-style:italic;">// mišljeno kot short host, recimo http://test.com, bi napisal === 'test'</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color:#0000FF;">$subdomain</span> = <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$subdomain</span> === <span style="color:#FF0000;">''</span><span style="color:#006600; font-weight:bold;">&#41;</span> ? <span style="color:#000000; font-weight:bold;">false</span> : <span style="color:#0000FF;">$subdomain</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color:#616100;">return</span> <span style="color:#0000FF;">$subdomain</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Sedaj lahko preprosto preberemo katera pod-domena je bila vpisana:</strong></p>
<div class="igBar"><span id="lphp-8"><a href="#" onclick="javascript:showPlainTxt('php-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-8">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$subdomain</span> = getSubDomain<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$subdomain</span> !== <span style="color:#000000; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> getAlbum<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$subdomain</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> welcomePage<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Dodatne informacije:</strong></p>
<ul>
<li><a target="_blank" href="http://www.php-si.com/index.php?lokacija=forum_prikazi_temo&#038;forum=6&#038;tema=6820">php-si.com - prvotna težava, kjer sem opisal rešitev</a></li>
<li><a target="_blank" href="http://trsplet.com/blog/2008/03/13/iskalnikom-in-uporabnikom-prijazni-url-ji-user-seo-freindly-url-apache-iis/">Iskalnikom in uporabnikom prijazni URL-ji (User - SEO freindly URL - Apache, IIS)</a></li>
<li><a target="_blank" href="http://www.webdeveloper.com/forum/showthread.php?t=104901">Podobni opis težave</a></li>
</ul>
<p><em>Če potrebujete še kakšno dodatno informacijo ali pa imate kakšne težave nam to sporočite pod komentarje.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://trsplet.com/blog/2008/06/28/php-virtualne-pod-domene-subdomains/feed/</wfw:commentRss>
		</item>
		<item>
		<title>DoFollow - Wordpress vtičnik</title>
		<link>http://trsplet.com/blog/2008/06/26/dofollow-wordpress-vticnik/</link>
		<comments>http://trsplet.com/blog/2008/06/26/dofollow-wordpress-vticnik/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 10:36:10 +0000</pubDate>
		<dc:creator>Roky</dc:creator>
		
		<category><![CDATA[Splet]]></category>

		<category><![CDATA[dofollow]]></category>

		<category><![CDATA[index]]></category>

		<category><![CDATA[vtičnik]]></category>

		<guid isPermaLink="false">http://trsplet.com/blog/?p=264</guid>
		<description><![CDATA[Kot že nekateri drugi smo se tudi mi odločili, da dodamo DoFollow dodatek na trsplet.com blog in s tem nadgradimo vse tiste, ki pridno komentirajo in dodajo svoje znanje / vprašanje za določeno vsebino in s tem pomagajo pri oblikovanju kvalitetne vsebine. DoFollow smo vklopili tudi za vse tiste, ki so ali še bodo dodali [...]]]></description>
			<content:encoded><![CDATA[<p>Kot že nekateri drugi smo se tudi mi odločili, da dodamo <a target="_blank" href="http://kimmo.suominen.com/sw/dofollow/">DoFollow dodatek</a> na <a target="_blank" href="http://trsplet.com/blog/">trsplet.com blog</a> in s tem nadgradimo vse tiste, ki pridno komentirajo in dodajo svoje znanje / vprašanje za določeno vsebino in s tem pomagajo pri oblikovanju kvalitetne vsebine. DoFollow smo vklopili tudi za vse tiste, ki so ali še bodo dodali povezavo iz svojega bloga na našo vsebino. <span id="more-264"></span></p>
<p><strong>DoFollow:</strong><br />
S DoFollow dosežemo, da vse povezave ter komentarje (povezave v komentarju) iskalnik pregleda in povezavi, ki jo obišče doda trsplet.com kot zunanjo objavo, to pa lahko pozitivno vpliva na pozicijo v rezultatih iskalnika. <a target="_blank" href="http://trsplet.com/blog/2008/04/09/optimizacija-spletne-strani-za-iskalnike-iskalniku-prijazna-spletna-stran-seo/#comment-6297">Več o optimizacije pa lahko preberete v ločeni temi</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://trsplet.com/blog/2008/06/26/dofollow-wordpress-vticnik/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Email.si - slovenski email ponudnik - dober ali slab?</title>
		<link>http://trsplet.com/blog/2008/06/22/emailsi-slovenski-email-ponudnik-dober-ali-slab/</link>
		<comments>http://trsplet.com/blog/2008/06/22/emailsi-slovenski-email-ponudnik-dober-ali-slab/#comments</comments>
		<pubDate>Sat, 21 Jun 2008 22:00:06 +0000</pubDate>
		<dc:creator>Roky</dc:creator>
		
		<category><![CDATA[Splet]]></category>

		<category><![CDATA[e-pošta]]></category>

		<category><![CDATA[email]]></category>

		<category><![CDATA[email.si]]></category>

		<category><![CDATA[kritika]]></category>

		<category><![CDATA[ponudnik]]></category>

		<guid isPermaLink="false">http://trsplet.com/blog/?p=263</guid>
		<description><![CDATA[Skoraj vsak ima svoj e-poštni naslov (nekateri več njih) in kar nekaj slovencev se je odločilo za email.si ponudnika:
Brezplačen, stalen, varen, enostaven in vedno dostopen slovenski email ponudnik.
OK, s tem nimam nobenega problema, spoštujem njihovo odločitev vendar na živce mi pa gre, da tako velik slovenski internetni ponudnik ne more porihtati osnovnih stvari. Naj opišem [...]]]></description>
			<content:encoded><![CDATA[<p>Skoraj vsak ima svoj e-poštni naslov (nekateri več njih) in <strong>kar nekaj slovencev se je odločilo za <a href="http://www.email.si/apps/es/">email.si</a> ponudnika:</strong></p>
<blockquote><p>Brezplačen, stalen, varen, enostaven in vedno dostopen slovenski email ponudnik.</p></blockquote>
<p>OK, s tem nimam nobenega problema, spoštujem njihovo odločitev vendar na živce mi pa gre, da tako velik slovenski internetni ponudnik ne more porihtati osnovnih stvari. <strong>Naj opišem nekaj standardnih težav, ki me doletijo ko pošiljam e-sporočila email.si uporabnikom:</strong><span id="more-263"></span> </p>
<p><strong>#1</strong> Skoraj vsako tretje sporočilo, ki ga pošljem email.si uporabniku, pride nazaj.</p>
<blockquote><p>This is the mail system at host jack.email.si.<br />
I'm sorry to have to inform you that your message could not<br />
be delivered to one or more recipients. It's attached below.<br />
For further assistance, please send mail to
<postmaster></blockquote>
<p><strong>#2</strong> Velikokrat se zgodi, da priponke, ki jih dodam uporabniki ne dobijo (priponke so ponavadi v .html formatu)</p>
<p><strong>#3</strong> Velikokrat se zgodi, da uporabnik pošlje email kjer sprašuje zakaj mu nisem poslal emaila, če sva se tako dogovorila, pa čeprav imam jaz pod sent email v Gmailu sporočilo, ki je bilo poslano. </p>
<p><em>In to se dogaja samo takrat ko email pošiljam email.si uporabnikom. Imate tudi vi takšne izkušnje ali se samo meni dogajajo takšne stvari?</em></p>
<p><strong>P.S: Vem, da je bilo veliko časa ter dela porabljeno zato, da veliko slovenskih uporabnikov email.si ponudnika uživa v pošiljanje/prejemanju elektronski sporočil a vseeno sem moral povedati moje težave, ki me doletijo ko skušam poslati epošto in zadevo opraviti tako kot je treba, brez da 10x pošljem in še to 100% ne vem ali je zadeva prišla ali ne.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://trsplet.com/blog/2008/06/22/emailsi-slovenski-email-ponudnik-dober-ali-slab/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP - pretvorba RGB vrednosti v HTML hex color - HTML hex color v RGB vrednost (RGB to HTML, HTML to RGB)</title>
		<link>http://trsplet.com/blog/2008/06/20/php-pretvorba-rgb-vrednost-v-html-hex-color-html-hex-color-v-rgb-vrednost-rgb-to-html-html-to-rgb/</link>
		<comments>http://trsplet.com/blog/2008/06/20/php-pretvorba-rgb-vrednost-v-html-hex-color-html-hex-color-v-rgb-vrednost-rgb-to-html-html-to-rgb/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 22:00:01 +0000</pubDate>
		<dc:creator>Roky</dc:creator>
		
		<category><![CDATA[Splet]]></category>

		<category><![CDATA[Splet (PHP &amp; MySQL)]]></category>

		<category><![CDATA[html hex color]]></category>

		<category><![CDATA[html to rgb]]></category>

		<category><![CDATA[php convert html]]></category>

		<category><![CDATA[php convert rgb]]></category>

		<category><![CDATA[rgb]]></category>

		<category><![CDATA[rgb to html]]></category>

		<guid isPermaLink="false">http://trsplet.com/blog/?p=257</guid>
		<description><![CDATA[Včasih se zgodi, da potrebujemo RGB vrednost namesto HTML kod, včasih pa ravno obratno in sicer iz HTML kod v RGB vrednost. Zato si poglejmo dve kratki PHP funkciji, ki skrbita za pretvorbo med RGB in HTML (RGB v HTML, HTML v RGB).
Najprej si poglejmo HTML2RGB. Malce več informacij o HTML hex colors:
HTML color codes [...]]]></description>
			<content:encoded><![CDATA[<p>Včasih se zgodi, da potrebujemo RGB vrednost namesto HTML kod, včasih pa ravno obratno in sicer iz HTML kod v RGB vrednost. Zato si poglejmo dve kratki PHP funkciji, ki skrbita za pretvorbo med RGB in HTML (RGB v HTML, HTML v RGB).<span id="more-257"></span></p>
<p><strong>Najprej si poglejmo HTML2RGB. Malce več informacij o HTML hex colors:</strong></p>
<blockquote><p>HTML color codes are hexadecimal triplets representing the colors red, green, and blue. For example, in the the color red, the color code is FF0000, which is '255' red, '0' green, and '0' blue.</p></blockquote>
<div class="igBar"><span id="lphp-11"><a href="#" onclick="javascript:showPlainTxt('php-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-11">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> HTML2RGB<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$htmlHexColor</span>, <span style="color:#0000FF;">$defaultColor</span> = <span style="color:#FF0000;">'FF0000'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// Remove #</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$htmlHexColor</span> = <a href="http://www.php.net/str_replace"><span style="color:#000066;">str_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'#'</span>, <span style="color:#FF0000;">''</span>, <span style="color:#0000FF;">$htmlHexColor</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// We can have FF 00 00 or F 0 0</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/strlen"><span style="color:#000066;">strlen</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$htmlHexColor</span><span style="color:#006600; font-weight:bold;">&#41;</span> == <span style="color:#CC66CC;color:#800000;">3</span> OR <a href="http://www.php.net/strlen"><span style="color:#000066;">strlen</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$htmlHexColor</span><span style="color:#006600; font-weight:bold;">&#41;</span> == <span style="color:#CC66CC;color:#800000;">6</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$rgbValues</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// Create from F 0 0 -&gt; FF 00 00</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/strlen"><span style="color:#000066;">strlen</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$htmlHexColor</span><span style="color:#006600; font-weight:bold;">&#41;</span> == <span style="color:#CC66CC;color:#800000;">3</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">for</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$i</span>=<span style="color:#CC66CC;color:#800000;">0</span>; <span style="color:#0000FF;">$i</span>&lt;<span style="color:#CC66CC;color:#800000;">3</span>; <span style="color:#0000FF;">$i</span>++<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$rgbValues</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF;">$htmlHexColor</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$i</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#0000FF;">$htmlHexColor</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$i</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">for</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$i</span>=<span style="color:#CC66CC;color:#800000;">0</span>; <span style="color:#0000FF;">$i</span>&lt;<span style="color:#CC66CC;color:#800000;">6</span>; <span style="color:#0000FF;">$i</span>=<span style="color:#0000FF;">$i</span>+<span style="color:#CC66CC;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$rgbValues</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF;">$htmlHexColor</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$i</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#0000FF;">$htmlHexColor</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$i</span>+<span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// Go trough rgb values and convert from hex to dec</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rgbValues</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$key</span> =&gt; <span style="color:#0000FF;">$hex</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$rgbValues</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <a href="http://www.php.net/hexdec"><span style="color:#000066;">hexdec</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$hex</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$rgbValues</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// Return default rgb color</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">return</span> HTML2RGB<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$defaultColor</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Sedaj pa še v obratni smeri in sicer RGB2HTML:</strong></p>
<div class="igBar"><span id="lphp-12"><a href="#" onclick="javascript:showPlainTxt('php-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-12">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> RGB2HTML<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rgbColors</span>, <span style="color:#0000FF;">$defaultColor</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">255</span>, <span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/is_array"><span style="color:#000066;">is_array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rgbColors</span><span style="color:#006600; font-weight:bold;">&#41;</span> &amp;&amp; <a href="http://www.php.net/count"><span style="color:#000066;">count</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rgbColors</span><span style="color:#006600; font-weight:bold;">&#41;</span> == <span style="color:#CC66CC;color:#800000;">3</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// Go trough all values</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rgbColors</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$key</span> =&gt; <span style="color:#0000FF;">$color</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// trim any spaces</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$rgbColors</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <a href="http://www.php.net/trim"><span style="color:#000066;">trim</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rgbColors</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// Convert values greater then 255 to 255, values smaller then 0 to 0</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/intval"><span style="color:#000066;">intval</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$color</span><span style="color:#006600; font-weight:bold;">&#41;</span>&gt; <span style="color:#CC66CC;color:#800000;">255</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#0000FF;">$rgbColors</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#CC66CC;color:#800000;">255</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">elseif</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/intval"><span style="color:#000066;">intval</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$color</span><span style="color:#006600; font-weight:bold;">&#41;</span> &lt;<span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#0000FF;">$rgbColors</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#CC66CC;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// Convert dec to hex</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$rgbColors</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <a href="http://www.php.net/dechex"><span style="color:#000066;">dechex</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rgbColors</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// If we only have X Y Z convert to XX YY ZZ</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/strlen"><span style="color:#000066;">strlen</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rgbColors</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> == <span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$rgbColors</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">'0'</span>.<span style="color:#0000FF;">$rgbColors</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$htmlColor</span> = <a href="http://www.php.net/implode"><span style="color:#000066;">implode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">''</span>, <span style="color:#0000FF;">$rgbColors</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#FF0000;">"#$htmlColor"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">return</span> RGB2HTML<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$defaultColor</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Dodatne informacije:</strong></p>
<ul>
<li><a target="_blank" href="http://www.anyexample.com/programming/php/php_convert_rgb_from_to_html_hex_color.xml">Podobna skripta, kjer sem našel navdih</a></li>
<li><a target="_blank" href="http://www.computerhope.com/htmcolor.htm">Imena HTML barv ter kratka razlaga le-teh</a></li>
<li><a target="_blank" href="http://www.pitt.edu/~nisg/cis/web/cgi/rgb.html">Seznam RGB vrednosti in le-teh ekvivalentne HTML kode</a></li>
</ul>
<p><a target="_blank" href='http://trsplet.com/blog/wp-content/uploads/2008/06/rgb_to_html_html_to_rgb_php_converter.php'>Preizkusite delovanje pretvorbe med RGB v HTML in HTML v RGB s pomočjo PHP skripte - testna skripta</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://trsplet.com/blog/2008/06/20/php-pretvorba-rgb-vrednost-v-html-hex-color-html-hex-color-v-rgb-vrednost-rgb-to-html-html-to-rgb/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP - pošiljanje emaila - epošte - sending email - HTML Mime Mail</title>
		<link>http://trsplet.com/blog/2008/06/18/php-posiljanje-emaila-eposte-sending-email-html-mime-mail-php/</link>
		<comments>http://trsplet.com/blog/2008/06/18/php-posiljanje-emaila-eposte-sending-email-html-mime-mail-php/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 22:00:18 +0000</pubDate>
		<dc:creator>Roky</dc:creator>
		
		<category><![CDATA[Splet]]></category>

		<category><![CDATA[Splet (PHP &amp; MySQL)]]></category>

		<category><![CDATA[email charset]]></category>

		<category><![CDATA[html mime mail paket]]></category>

		<category><![CDATA[mail attachment]]></category>

		<category><![CDATA[php email]]></category>

		<category><![CDATA[send email]]></category>

		<category><![CDATA[utf8 charset]]></category>

		<guid isPermaLink="false">http://trsplet.com/blog/?p=252</guid>
		<description><![CDATA[Na blogu smo si že pogledali kako nastaviti pravilni charset oz. kodno tabelo pri uporabi HTML Mime Mail paketa, da zadeva deluje na Outlook Express aplikaciji. Sedaj pa si poglejmo še kratek primer kako poslati e-pošto oz. email s pomočjo HTML Mime Mail PHP paketa, saj se velikokrat na forumih pojavi vprašanje kako to storiti. [...]]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://trsplet.com/blog/2008/04/08/html-mime-mail-php-nastavljanje-kodne-tabele-charset-windows-1250-utf-8-outlook-express/">Na blogu smo si že pogledali kako nastaviti pravilni charset oz. kodno tabelo pri uporabi HTML Mime Mail paketa, da zadeva deluje na Outlook Express aplikaciji</a>. Sedaj pa si poglejmo še kratek primer kako poslati e-pošto oz. email s pomočjo HTML Mime Mail PHP paketa, saj se velikokrat na forumih pojavi vprašanje kako to storiti. <span id="more-252"></span><strong>Kratek primer pošiljanja e-pošte:</strong></p>
<div class="igBar"><span id="lphp-15"><a href="#" onclick="javascript:showPlainTxt('php-15'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-15">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Content-Type: text/html; charset=utf-8'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">require_once</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'htmlMimeMail5/htmlMimeMail5.php'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$htmlBody</span> = <span style="color:#FF0000;">"&lt;b&gt;Testiram UTF-8 - č,š,ž&lt;/b&gt;&lt;ul&gt;&lt;li&gt;Prva alineja&lt;/li&gt;&lt;/ul&gt;"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$textBody</span> = <span style="color:#FF0000;">"Testiram UTF-8 - č,š,ž<span style="color:#000099; font-weight:bold;">\n</span>Prva alineja"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Create new instance</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$mail</span> = <span style="color:#000000; font-weight:bold;">new</span> htmlMimeMail5<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Set proper charset</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$mail</span>-&gt;<span style="color:#006600;">setHTMLCharset</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"UTF-8"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$mail</span>-&gt;<span style="color:#006600;">setHeadCharset</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"UTF-8"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$mail</span>-&gt;<span style="color:#006600;">setTextCharset</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"UTF-8"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$mail</span>-&gt;<span style="color:#006600;">setSubject</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Testni Email'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Set HTML body. If email application doesn't support HTML, text body will be displayed</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$mail</span>-&gt;<span style="color:#006600;">setHtml</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$htmlBody</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$mail</span>-&gt;<span style="color:#006600;">setText</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$textBody</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Who send this?</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$mail</span>-&gt;<span style="color:#006600;">setFrom</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Rok Meglič &lt;rok.meglic@gmail.com&gt;'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// You can also add cc, bcc</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$mail</span>-&gt;<span style="color:#006600;">setBcc</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'test@test.com'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$mail</span>-&gt;<span style="color:#006600;">setCc</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'test@test.com'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Add some files</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$mail</span>-&gt;<span style="color:#006600;">addEmbeddedImage</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">new</span> fileEmbeddedImage<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'trspletlogo.bmp'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$mail</span>-&gt;<span style="color:#006600;">addAttachment</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">new</span> fileAttachment<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Excel.rar'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Try to send email</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$status</span> = <span style="color:#0000FF;">$mail</span>-&gt;<span style="color:#006600;">send</span><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/array"><span style="color:#000066;">array</span></a> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'rok.meglic@gmail.com'</span>, <span style="color:#FF0000;">'info@trsplet.com'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$status</span> === <span style="color:#000000; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'Pošiljanje e-pošte ni uspelo'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'Pošiljanje e-pošte je uspelo'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Rezultat:</strong><br />
<a target="_blank" href='http://trsplet.com/blog/wp-content/uploads/2008/06/testni_email.png'><img src="http://trsplet.com/blog/wp-content/uploads/2008/06/testni_email-150x150.png" alt="Testni email poslan s pomočjo PHP HTML Mail Mime paketa" title="Testni email poslan s pomočjo PHP HTML Mail Mime paketa" width="150" height="150" class="alignnone size-thumbnail wp-image-253" /></a></p>
<p><strong>Namig:</strong><br />
Če se vam ne da ukvarjati s posebno vsebino za plain text mail oz. za uporabnike, ki nimajo e-poštnega odjemalca z HTML podporo, lahko preprosto uporabe strip_tags ter br2nl nad vašim HTML sporočilom. Tako bodo vsi br-ji pretvorjni v new line znak, vsi ostali HTML atributi pa bodo pobrisani. <strong>Primer:</strong></p>
<div class="igBar"><span id="lphp-16"><a href="#" onclick="javascript:showPlainTxt('php-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-16">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$htmlBody</span> = <span style="color:#FF0000;">"&lt;b&gt;Testiram UTF-8 - č,š,ž&lt;/b&gt;&lt;ul&gt;&lt;li&gt;Prva alineja&lt;/li&gt;&lt;/ul&gt;"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$textBody</span> = <a href="http://www.php.net/strip_tags"><span style="color:#000066;">strip_tags</span></a><span style="color:#006600; font-weight:bold;">&#40;</span>br2nl<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$htmlBody</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//Source: http://si.php.net/manual/en/function.nl2br.php#62801</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> br2nl<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$text</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">return</span>&nbsp; <a href="http://www.php.net/preg_replace"><span style="color:#000066;">preg_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'/&lt;br<span style="color:#000099; font-weight:bold;">\\</span><span style="color:#000099; font-weight:bold;">\\</span>s*?<span style="color:#000099; font-weight:bold;">\\</span>/??&gt;/i'</span>, <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\\</span>n"</span>, <span style="color:#0000FF;">$text</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Download:</strong></p>
<ul>
<li><a target="_blank" href="http://www.phpguru.org/downloads/html.mime.mail/htmlMimeMail-2.5.2.zip">HTML Mime Mail koda, ki deluje na PHP4 &#038; PHP5</a></li>
<li><a target="_blank" href="http://www.phpguru.org/downloads/html.mime.mail/htmlMimeMail5.zip">HTML Mime Mail koda, ki deluje le na PHP5</a></li>
</ul>
<p><strong>Datoteka:</strong></p>
<ul>
<li><a target="_blank" href='http://trsplet.com/blog/wp-content/uploads/2008/06/send_email.inc'>Skripta, ki pošlje email s pomočjo HTML Mime Mail paketa</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://trsplet.com/blog/2008/06/18/php-posiljanje-emaila-eposte-sending-email-html-mime-mail-php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Simultano poganjane Firefox2 in Firefox3</title>
		<link>http://trsplet.com/blog/2008/06/16/simultano-poganjane-firefox2-in-firefox3/</link>
		<comments>http://trsplet.com/blog/2008/06/16/simultano-poganjane-firefox2-in-firefox3/#comments</comments>
		<pubDate>Sun, 15 Jun 2008 22:00:10 +0000</pubDate>
		<dc:creator>Roky</dc:creator>
		
		<category><![CDATA[Splet]]></category>

		<category><![CDATA[firefox2]]></category>

		<category><![CDATA[firefox3]]></category>

		<category><![CDATA[hkratno poganjane]]></category>

		<category><![CDATA[simultano pogajanje]]></category>

		<guid isPermaLink="false">http://trsplet.com/blog/?p=259</guid>
		<description><![CDATA[Kot veste je Mozzila izdala novo verzijo Firefox3 brskalnika (Firefox 3 Release Candidate 3), ki je zadnja beta verzija pred uradnim izidom, ki se bo zgodil 17 junija. Ker pa je Firefox3 še vedno v beta stanju in kar nekaj pluginov oz. dodatkov, ki jih redno uporabljam še ne podpira Firefox3 sem se odločil, da [...]]]></description>
			<content:encoded><![CDATA[<p>Kot veste je Mozzila izdala novo verzijo Firefox3 brskalnika (Firefox 3 Release Candidate 3), ki je zadnja beta verzija pred uradnim izidom, <a target="_blank" href="http://www.mozillazine.org/talkback.html?article=23871">ki se bo zgodil 17 junija</a>. Ker pa je Firefox3 še vedno v beta stanju in kar nekaj pluginov oz. dodatkov, ki jih redno uporabljam še ne podpira Firefox3 sem se odločil, da namestim Firefox3 ob bok Firefox2 in s tem dodam možnost simultanega - hkratnega poganjanja Firefox2 ter Firefox3 brskalnika. <span id="more-259"></span></p>
<p><strong>S spodaj opisanim postopkom si zagotovimo, da bomo Firefox2 pustili čisto pri miru (kar je zelo pomembno, da nam ne pokvari vseh osebnih nastavitev, dodatkov itd), dodali pa bomo Firefox3:</strong></p>
<p><strong>#1</strong> Dol-povlecite Firefox3 beta. Lahko v <a target="_blank" href="http://download.mozilla.org/?product=firefox-3.0rc3&#038;os=win&#038;lang=en-US">Angleški verziji</a> ali <a target="_blank" href="http://download.mozilla.org/?product=firefox-3.0rc3&#038;os=win&#038;lang=sl">Slovenski</a>.</p>
<p><strong>#2</strong> Namestite Firefox3 v svoj imenik (folder) in <strong>NE v imenik kjer se trenutno nahaja Firefox2!!!</strong></p>
<p><strong>#3</strong> Med nastavitvijo vas bo namestitveni program vprašal ali naj kreira bližnjice. <strong>Odkljukajte vse</strong>, saj ne želimo nobenih bližnjic, ki bi prepisale Firefox2 bližnjice. Ob koncu vas bo namestitveni program vprašal ali želite takoj zagnati Firefox3, tudi to <strong>odkljukate</strong> saj moramo najprej postoriti še nekaj stvari.</p>
<p><strong>#4</strong> V Start, Run vpišite sledečo komando: <em>D:\Firefox\firefox.exe -profilemanager -no-remote</em> (D:\Firefox\ nadomestite z vašo potjo). Odprlo se vam bo okno za urejanje profilov, tam kreirajte novege. Najboljše z imenom Firefox3-BETA. Nov uporabniški profil kreiramo zato, da ne povozimo starega oz. da starega pustimo nedotaknjenega.<br />
<a target="_blank" href='http://trsplet.com/blog/wp-content/uploads/2008/06/zagon_upravljalnika_profilov.png'><img src="http://trsplet.com/blog/wp-content/uploads/2008/06/zagon_upravljalnika_profilov-150x150.png" alt="Start, run - zaženemo upravljalnika profilov" title="zagon_upravljalnika_profilov" width="150" height="150" class="alignnone size-thumbnail wp-image-260" /></a></p>
<p><strong>#5 </strong> Sedaj le še kreiraje bližnjico do Firefox3 brskalnika, nato desni klik in izberite Properties. Tam pod target polje dodajte: <em>- P Firefox3-BETA -no-remote</em>. Firefox3-BETA je ime profila, ki ste ga prej kreirali.<br />
<a target="_blank" href='http://trsplet.com/blog/wp-content/uploads/2008/06/nastavitev_bliznjice.png'><img src="http://trsplet.com/blog/wp-content/uploads/2008/06/nastavitev_bliznjice-300x166.png" alt="Kreiramo bližnjico do Firefox3" title="nastavitev_bliznjice" width="300" height="166" class="alignnone size-medium wp-image-261" /></a></p>
<p>Sedaj lahko hkrati poganjate Firefox2 ter Firefox3. <strong>Dokaz:</strong><br />
<a target="_blank" href='http://trsplet.com/blog/wp-content/uploads/2008/06/firefox2_in_firefox3_hkrati.png'><img src="http://trsplet.com/blog/wp-content/uploads/2008/06/firefox2_in_firefox3_hkrati-150x150.png" alt="Hkratno oz. simultano poganjanje Firefox2 ter Firefox3 brskalnika" title="firefox2_in_firefox3_hkrati" width="150" height="150" class="alignnone size-thumbnail wp-image-262" /></a></p>
<p>Kot sem že omenil nekaj dodatkov iz Firefox2 na Firefox3 ne deluje. Naprimer HTML validator. <strong>Lista mojih ključnih dodatkov, ki delujejo:</strong></p>
<ul>
<li><a target="_blank" href="https://addons.mozilla.org/en-US/firefox/addon/3046">Slovenski slovar - črkovalnik</a></li>
<li><a target="_blank" href="https://addons.mozilla.org/en-US/firefox/addon/1843">Firebug</a></li>
<li><a target="_blank" href="http://www.quirk.biz/searchstatus/">SearchStatus</a></li>
<li><a target="_blank" href="https://addons.mozilla.org/en-US/firefox/addon/3829">Live HTTP headers</a></li>
</ul>
<p><strong>Dodatne informacije:</strong></p>
<ul>
<li><a target="_blank" href="http://www.dailygyan.com/2008/02/how-to-run-firefox-2-and-firefox-3-on.html">Referenca za hkratno poganjanje Firefox2 ter Firefox3</a></li>
</ul>
<p><em>Vsekakor Firefox3 namestitev priporočam saj je veliko bolj stabilen kot Firefox2 (vsaj pri meni, kjer  se Firebug in recimo gmail redno tepeta in potem REDNO sesuvata Firefox), pa tudi samo delovanje je hitrejše v primerjavi s Firefox2 brskalnikom. Imate kakšne dobre dodatke za Firefox3? Imate kakšno nadomestitev za HTML validator dodatek? Sporočite svoje mnenje o Firefox3 pod komentarje.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://trsplet.com/blog/2008/06/16/simultano-poganjane-firefox2-in-firefox3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP - Zen Cart - Easy Populate - UTF8 podpora - UTF8 support</title>
		<link>http://trsplet.com/blog/2008/06/14/php-zen-cart-easy-populate-utf8-podpora-utf8-support/</link>
		<comments>http://trsplet.com/blog/2008/06/14/php-zen-cart-easy-populate-utf8-podpora-utf8-support/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 22:00:48 +0000</pubDate>
		<dc:creator>Roky</dc:creator>
		
		<category><![CDATA[Splet]]></category>

		<category><![CDATA[Splet (PHP &amp; MySQL)]]></category>

		<category><![CDATA[easy populate]]></category>

		<category><![CDATA[easy populate advanced]]></category>

		<category><![CDATA[easy populate standard]]></category>

		<category><![CDATA[utf8 support]]></category>

		<category><![CDATA[zen cart]]></category>

		<guid isPermaLink="false">http://trsplet.com/blog/?p=255</guid>
		<description><![CDATA[Vsi tisti, ki uporabljate Zen Cart spletno trgovino veste, da Zen Cart (zaenkrat) ne podpira UTF-8. Zadeva se, da hitro spremeniti. Celotni postopek spreminjanja Zen Cart baze ter nastavitev (php header) je opisan tukaj. Naredili smo tudi celotno pretvorbo slovenskega jezika (zen cart slovenian language pack) za Zen Cart 1.3.8a z UTF-8 podporo. Vendar, ko [...]]]></description>
			<content:encoded><![CDATA[<p>Vsi tisti, ki uporabljate <a target="_blank" href="http://www.zen-cart.com/">Zen Cart spletno trgovino</a> veste, da Zen Cart (zaenkrat) ne podpira UTF-8. Zadeva se, da hitro spremeniti. <a target="_blank" href="http://trsplet.com/blog/2008/05/23/zen-cart-utf-8-podpora-pretvorba/">Celotni postopek spreminjanja Zen Cart baze ter nastavitev (php header) je opisan tukaj</a>. <a target="_blank" href="http://trsplet.com/blog/2008/05/28/php-zencart-utf8-slovenski-jezik-slovenski-prevod-pretvorba-jezikov/">Naredili smo tudi celotno pretvorbo slovenskega jezika (zen cart slovenian language pack) za Zen Cart 1.3.8a z UTF-8 podporo</a>. <strong>Vendar, ko imamo celotno strukturo in jezikovne datoteke v UTF8 formatu nastane problem pri uvozu novih podatkov, saj <a target="_blank" href="http://modhole.com/modhole/index.php?module=documents&#038;JAS_DocumentManager_op=viewDocument&#038;JAS_Document_id=2">Easy Populate</a>, ki omogoča hitro vnašanje podatkov in je eden izmed bolj priljubljenih dodatkov za Zen Cart, ne podpira UTF-8 branje podatkov / pisanje podatkov. Na srečo je potrebno le malo modifikacije za ustrezen rezultat.</strong> <span id="more-255"></span></p>
<p>If you are using <a target="_blank" href="http://www.zen-cart.com/">zen cart internet shop</a> you know that Zen Cart (for now) doesn't support UTF8. <a target="_blank" href="http://trsplet.com/blog/2008/05/23/zen-cart-utf-8-podpora-pretvorba/">Likely this can be easily changed (whole procedure in Slovene)</a>. After we change the Zen Cart database structure, data and language files to UTF-8 charset we get a new problem with importing / exporting data using <a target="_blank" href="http://modhole.com/modhole/index.php?module=documents&#038;JAS_DocumentManager_op=viewDocument&#038;JAS_Document_id=2">Easy Populate</a> module which is one of the most popular modules out there. Unlickely the Easy Populate doesn't support UTF8 and I didn't find any solution on the web so I've decided to modify the files myself. Luckily there aren't many changes necessary to get UTF8 support. Here is the list of files which needs to be changed (backup first!!!). Just copy the whole function code and replace it with the old one at files which are written above the php code block. If you have any problems let me know (comments or email).</p>
<p><strong><a target="_blank" href="http://www.zencartbuilder.com/index.php?main_page=product_info&#038;products_id=1">Easy Populate Advanced 3.0.3 - 65.00 USD</a>:</strong><br />
<strong>#1 FileWriter.php -> /admin/includes/easypopulate/classes/eclipse/FileWriter.php</strong></p>
<div class="igBar"><span id="lphp-20"><a href="#" onclick="javascript:showPlainTxt('php-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-20">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> FileWriter <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$file</span>, <span style="color:#0000FF;">$append</span>=<span style="color:#000000; font-weight:bold;">false</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">append</span> = <span style="color:#0000FF;">$append</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$type</span> = <a href="http://www.php.net/gettype"><span style="color:#000066;">gettype</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$file</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">switch</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$type</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">case</span> <span style="color:#FF0000;">'string'</span>:</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;_fileString<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$file</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">break</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">case</span> <span style="color:#FF0000;">'object'</span>:</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;_fileObject<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$file</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">break</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">write</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\x</span>EF<span style="color:#000099; font-weight:bold;">\x</span>BB<span style="color:#000099; font-weight:bold;">\x</span>BF"</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// Added for UTF-8 support</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>#2 FileIterator -> /admin/includes/easypopulate/classes/eclipse/FileIterator.php</strong></p>
<div class="igBar"><span id="lphp-21"><a href="#" onclick="javascript:showPlainTxt('php-21'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-21">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> readLine<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// Get the text</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$test</span> = <a href="http://www.php.net/fgets"><span style="color:#000066;">fgets</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">pointer</span>, <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">bufferSize</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// Check which encoding is this - if this is UTF-8 dont try to convert it again to UTF-8 as corupted chars will apear</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$encoding</span> = <a href="http://www.php.net/mb_detect_encoding"><span style="color:#000066;">mb_detect_encoding</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$test</span>, <span style="color:#FF0000;">"UTF-8, ISO-8859-1"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// Only convert if ISO-8859-1 / CP1250</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$encoding</span> == <span style="color:#FF0000;">"ISO-8859-1"</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$test</span> = <a href="http://www.php.net/iconv"><span style="color:#000066;">iconv</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"CP1250"</span>, <span style="color:#FF0000;">"UTF-8"</span>, <span style="color:#0000FF;">$test</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// If there is BOM char at the begining, clear it</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/strpos"><span style="color:#000066;">strpos</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$test</span>, <span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\x</span>EF<span style="color:#000099; font-weight:bold;">\x</span>BB<span style="color:#000099; font-weight:bold;">\x</span>BF"</span><span style="color:#006600; font-weight:bold;">&#41;</span> !== <span style="color:#000000; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$test</span> = <a href="http://www.php.net/str_replace"><span style="color:#000066;">str_replace</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"<span style="color:#000099; font-weight:bold;">\x</span>EF<span style="color:#000099; font-weight:bold;">\x</span>BB<span style="color:#000099; font-weight:bold;">\x</span>BF"</span>, <span style="color:#FF0000;">""</span>, <span style="color:#0000FF;">$test</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$test</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>#3 MyDatabase.php -> /admin/includes/easypopulate/classes/eclipse/MyDatabase.php</strong></p>
<div class="igBar"><span id="lphp-22"><a href="#" onclick="javascript:showPlainTxt('php-22'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-22">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> connect<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$username</span>, <span style="color:#0000FF;">$password</span>, <span style="color:#0000FF;">$type</span> = ECLIPSE_DB_NON_PERSISTENT<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">setLink</span><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$type</span> == ECLIPSE_DB_PERSISTENT<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; ? <a href="http://www.php.net/mysql_pconnect"><span style="color:#000066;">mysql_pconnect</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">getHost</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#0000FF;">$username</span>, <span style="color:#0000FF;">$password</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; : <a href="http://www.php.net/mysql_connect"><span style="color:#000066;">mysql_connect</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">getHost</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#0000FF;">$username</span>, <span style="color:#0000FF;">$password</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/mysql_select_db"><span style="color:#000066;">mysql_select_db</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">getName</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">getLink</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$charset</span>&nbsp; &nbsp; = <span style="color:#FF0000;">'utf8'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$collation</span>&nbsp; = <span style="color:#FF0000;">'utf8_slovenian_ci'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>!<a href="http://www.php.net/mysql_query"><span style="color:#000066;">mysql_query</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"SET NAMES '$charset' COLLATE '$collation'"</span>, <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">getLink</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/die"><span style="color:#000066;">die</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Error executing query SET NAMES - MyDatabase.php - easyupload - classes-eclipse'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">isConnected</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><em><a target="_blank" href="http://modhole.com/modhole/index.php?module=documents&#038;JAS_DocumentManager_op=viewDocument&#038;JAS_Document_id=2">Obstaja tudi zastonjska verzija Easy Populate</a>, vendar je koda še bolj "zbegana" kot pri advanced easy populate, kjer mi ni jasno, zakaj je potrebno toliko kodo. Če bo čas, med poletjem spišemo nov modul za import / export Zen Cart baze s pomočjo Excela s boljšo podporo atributom ter podporo Attribute to Stock modulom. Je kdo zainteresiran za kaj takšnega?</em></p>
<p><a target="_blank" href="http://modhole.com/modhole/index.php?module=documents&#038;JAS_DocumentManager_op=viewDocument&#038;JAS_Document_id=2">There is also a free version of easy populate module</a>, but the code is even more messier then in advanced easy populate. In both cases I don't understand why so much code has to be written for that little functionality. If there will be free time in summer I'll write a new module which will support direct Excel import / export with better attributes support and also support for Attribute to Stock module. If anybody is interested in this new module please drop me a line at rok.meglic@gmail.com.</p>
]]></content:encoded>
			<wfw:commentRss>http://trsplet.com/blog/2008/06/14/php-zen-cart-easy-populate-utf8-podpora-utf8-support/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MySQL - date funkcije - current date, now, add date, sub date, interval</title>
		<link>http://trsplet.com/blog/2008/06/12/mysql-date-funkcije-current-date-now-add-date-sub-date-interval/</link>
		<comments>http://trsplet.com/blog/2008/06/12/mysql-date-funkcije-current-date-now-add-date-sub-date-interval/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 22:00:09 +0000</pubDate>
		<dc:creator>Roky</dc:creator>
		
		<category><![CDATA[Splet]]></category>

		<category><![CDATA[Splet (PHP &amp; MySQL)]]></category>

		<category><![CDATA[add date]]></category>

		<category><![CDATA[current date]]></category>

		<category><![CDATA[date]]></category>

		<category><![CDATA[date fomrat]]></category>

		<category><![CDATA[interval]]></category>

		<category><![CDATA[MySQL]]></category>

		<category><![CDATA[now]]></category>

		<category><![CDATA[strtotime]]></category>

		<category><![CDATA[sub date]]></category>

		<guid isPermaLink="false">http://trsplet.com/blog/?p=256</guid>
		<description><![CDATA[Velikokrat je bolj modro, da že pri pridobivanju podatkov iz podatkovne baze opravite določene operacije nad MySQL polji tipa Date, DateTime, Time, Year, Timestamp. Zadeva je hitrejša kot, če iste operacije nato izvedemo nad vsemi vrsticami s pomočjo PHP-ja in na primer foreach konstrukta.
Kratek primer:
#1 Date polje s poljubnim formatom:
PLAIN TEXT
MySQL:




SELECT DATE_FORMAT&#40; `DATE` , '%H:%i:%s' [...]]]></description>
			<content:encoded><![CDATA[<p>Velikokrat je bolj modro, da že pri pridobivanju podatkov iz podatkovne baze opravite določene operacije nad <a target="_blank" href="http://dev.mysql.com/doc/refman/5.0/en/date-and-time-types.html">MySQL polji tipa Date, DateTime, Time, Year, Timestamp</a>. Zadeva je hitrejša kot, če iste operacije nato izvedemo nad vsemi vrsticami s pomočjo PHP-ja in na primer <a target="_blank" href="http://docs.php.net/foreach">foreach konstrukta</a>.<span id="more-256"></span></p>
<p><strong>Kratek primer:</strong><br />
<strong>#1 Date polje s poljubnim formatom:</strong></p>
<div class="igBar"><span id="lmysql-25"><a href="#" onclick="javascript:showPlainTxt('mysql-25'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">MySQL:</span>
<div id="mysql-25">
<div class="mysql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">DATE_FORMAT</span><span style="color: #66cc66;">&#40;</span> `<span style="color: #aa9933; font-weight: bold;">DATE</span>` , <span style="color: #ff0000;">'%H:%i:%s'</span> <span style="color: #66cc66;">&#41;</span> AS <span style="color: #aa9933; font-weight: bold;">DATE</span> <span style="color: #993333; font-weight: bold;">FROM</span> `table` </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>#2 Prečesamo celotno tabelo podatkov in spremenimo date polje</strong></p>
<div class="igBar"><span id="lphp-26"><a href="#" onclick="javascript:showPlainTxt('php-26'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-26">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rowsFromMySQL</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$rowKey</span> =&gt; <span style="color:#0000FF;">$row</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$rowsFromMySQL</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$rowKey</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'date'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <a href="http://www.php.net/date"><span style="color:#000066;">date</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'H:i:s'</span>, <a href="http://www.php.net/strtotime"><span style="color:#000066;">strtotime</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$row</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'date'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>MySQL date funkcije:</strong><br />
<strong>#1 Currentdate - CURDATE( ) - CURRENT_DATE:</strong><br />
 - SELECT CURDATE( ) AS `current_date` FROM `table` vrne 2008-06-05<br />
 - SELECT DATE_FORMAT( CURDATE( ) , '%d.%c.%Y' ) AS `current_date` FROM `table` vrne 05.6.2008</p>
<p><strong>#2 NOW - NOW()</strong><br />
-  SELECT NOW(); vrne 2008-06-05 14:25:31<br />
-  SELECT DATE_FORMAT(NOW() , '%d.%c.%Y' ) AS `current_date`; vrne 05.6.2008</p>
<p><strong>#3 add date - ADDDATE - ADDTIME</strong><br />
- SELECT ADDDATE( '2007-01-01', 100 ); vrne 2007-04-11, k prvotnemu datumu dodamo 100 dni<br />
- SELECT ADDDATE( '2007-01-01', '2007-04-11' ) ; vrne 2012-06-30, k prvotnemu datumu dodamo še drugi poljubni datum (isti format)</p>
<p><strong>#4 sub date - DATE_SUB</strong><br />
Ista funkcionalnost kot ADDDATE, le da funkcija odšteje drugi parameter od prvega parametra (drugi datum odšteje od prvega datuma).</p>
<p><strong>#5 interval - INTERVAL 31 DAY, INTERVAL 1 MONTH, INTERVAL 1 WEEK. <a target="_blank" href="http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date-add">Celotni seznam možnih vrednosti za INTERVAL</a></strong><br />
Interval keyword je moč uporabiti na skoraj vseh DATE funkcijah. Struktura je Datum +/- INTERVAL X Y oz. '2007-06-20' + INTERVAL 356 DAY;<br />
- SELECT '2007-06-20' + INTERVAL 356 DAY; vrne 2008-06-1. Dodamo interval 356 dni, kar ni vedno ekvivalentno INTERVAL 1 YEAR!<br />
- SELECT ADDDATE( '2008-06-20', 5 ) + INTERVAL 1 YEAR vrne 2009-06-25. Dodamo 5 dni ter interval 1 leto.</p>
<p><a target="_blank" href="http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html">Poglejte si še ostale MySQL date funkcije kot so UNIX_TIMESTAMP, PERIOD_DIFF(), LAST_DAY, DATEDIFF.</a></p>
<p><strong>Dodatne informacije:</strong></p>
<ul>
<li><a target="_blank" href="http://www.devshed.com/c/a/MySQL/Practical-Date-Time-examples-with-PHP-and-MySQL/">Praktični primeri pri PHP &#038; MySQL date poljih</a></li>
<li><a target="_blank" href="http://www.melbournechapter.net/wordpress/programming-languages/php/rich/2006/11/29/working-with-dates-in-php-and-mysql/">Pretvorba polj tipa date iz MySQL s pomočjo PHP-ja</a></li>
<li><a target="_blank" href="http://simonwillison.net/2003/Jul/11/storingDatesInMySQL/">Shranjevanje datumov v MySQL</a></li>
</ul>
<p><em>Uporabljate MySQL date funkcije? Uporabljate še kakšne druge, kot je recimo <a target="_blank" href="http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_trim">TRIM</a>? Imate tudi vi kakšen nasvet v povezavi z MySQL in PHP? Sporočite pod komentarje.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://trsplet.com/blog/2008/06/12/mysql-date-funkcije-current-date-now-add-date-sub-date-interval/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP - Kreiranje Excel datoteke - Pisanje v Excel datoteko - PHP - xls</title>
		<link>http://trsplet.com/blog/2008/06/10/php-kreiranje-excel-datoteke-pisanje-v-excel-datoteko-php-xls/</link>
		<comments>http://trsplet.com/blog/2008/06/10/php-kreiranje-excel-datoteke-pisanje-v-excel-datoteko-php-xls/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 22:00:44 +0000</pubDate>
		<dc:creator>Roky</dc:creator>
		
		<category><![CDATA[Splet]]></category>

		<category><![CDATA[Splet (PHP &amp; MySQL)]]></category>

		<category><![CDATA[create]]></category>

		<category><![CDATA[excel]]></category>

		<category><![CDATA[kreiranje]]></category>

		<category><![CDATA[kreiranje excel datoteke]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[pisanje]]></category>

		<category><![CDATA[pisanje v excel datoteko]]></category>

		<category><![CDATA[Spreadsheet_Excel_Writer]]></category>

		<category><![CDATA[utf8]]></category>

		<guid isPermaLink="false">http://trsplet.com/blog/?p=247</guid>
		<description><![CDATA[Po pregledu branja Excel datoteke in nato konvertiranja Excel datoteke v .txt datoteko s pomočjo PHP-ja, si poglejmo še kreiranje oz. pisanje PHP podatkov v Excel datoteko. Sam za kreiranje Excel datotek uporabljam PEAR modul oz. paket, ki se imenuje Spreadsheet_Excel_Writer.
Stvar je zelo napredna saj pokriva veliko funkcionalnosti, poglejmo si nekaj primerov uporabe:
PLAIN TEXT
PHP:




// New [...]]]></description>
			<content:encoded><![CDATA[<p><a target="_blank"  href="http://trsplet.com/blog/2008/06/06/php-branje-excel-xls-datoteke-excel-utf8-branje/">Po pregledu branja Excel datoteke</a> in <a target="_blank" href="http://trsplet.com/blog/2008/06/08/php-pretvorba-excel-datoteke-v-txt-datoteko-excel-converter/">nato konvertiranja Excel datoteke v .txt datoteko s pomočjo PHP-ja</a>, si poglejmo še kreiranje oz. pisanje PHP podatkov v Excel datoteko. <a target="_blank" href="http://pear.php.net/package/Spreadsheet_Excel_Writer/">Sam za kreiranje Excel datotek uporabljam PEAR modul oz. paket, ki se imenuje Spreadsheet_Excel_Writer</a>.<span id="more-247"></span></p>
<p><strong>Stvar je zelo napredna saj pokriva veliko funkcionalnosti, poglejmo si nekaj primerov uporabe:</strong></p>
<div class="igBar"><span id="lphp-29"><a href="#" onclick="javascript:showPlainTxt('php-29'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-29">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// New instance of excel writer</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">require_once</span> <span style="color:#FF0000;">"Spreadsheet/Excel/Writer.php"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$xls</span> = <span style="color:#000000; font-weight:bold;">new</span> Spreadsheet_Excel_Writer<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'created_test.xls'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$xls</span>-&gt;<span style="color:#006600;">setVersion</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">8</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sheet</span> = &amp; <span style="color:#0000FF;">$xls</span>-&gt;<span style="color:#006600;">addWorksheet</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'test_worksheet'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sheet</span>-&gt;<span style="color:#006600;">setInputEncoding</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'UTF-8'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//Append data</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sheet</span>-&gt;<span style="color:#006600;">writeString</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#FF0000;">"Prvi stolpec"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sheet</span>-&gt;<span style="color:#006600;">writeString</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#CC66CC;color:#800000;">1</span>, <span style="color:#FF0000;">"Drugi stolpec"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sheet</span>-&gt;<span style="color:#006600;">writeString</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#CC66CC;color:#800000;">2</span>, <span style="color:#FF0000;">"Tretji stolpec"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sheet</span>-&gt;<span style="color:#006600;">writeString</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#CC66CC;color:#800000;">3</span>, <span style="color:#FF0000;">"Četrti stolpec"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sheet</span>-&gt;<span style="color:#006600;">writeString</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#CC66CC;color:#800000;">4</span>, <span style="color:#FF0000;">"Datum"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//Set column width (if you set width for one column, all next column will inherit this attribute)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sheet</span>-&gt;<span style="color:#006600;">setColumn</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#CC66CC;color:#800000;">9</span>.<span style="color:#CC66CC;color:#800000;">14</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sheet</span>-&gt;<span style="color:#006600;">setColumn</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#CC66CC;color:#800000;">1</span>, <span style="color:#CC66CC;color:#800000;">11</span>.<span style="color:#CC66CC;color:#800000;">14</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sheet</span>-&gt;<span style="color:#006600;">setColumn</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#CC66CC;color:#800000;">2</span>, <span style="color:#CC66CC;color:#800000;">29</span>.<span style="color:#CC66CC;color:#800000;">86</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sheet</span>-&gt;<span style="color:#006600;">setColumn</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#CC66CC;color:#800000;">3</span>, <span style="color:#CC66CC;color:#800000;">8</span>.<span style="color:#CC66CC;color:#800000;">57</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sheet</span>-&gt;<span style="color:#006600;">setColumn</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#CC66CC;color:#800000;">4</span>, <span style="color:#CC66CC;color:#800000;">15</span>.<span style="color:#CC66CC;color:#800000;">57</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Set row height</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sheet</span>-&gt;<span style="color:#006600;">setRow</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#CC66CC;color:#800000;">15</span>.<span style="color:#CC66CC;color:#800000;">75</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-famil