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

<channel>
	<title>Gudubeth: Web Tasarım, Programlama</title>
	<atom:link href="http://www.gudubeth.net/tr/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gudubeth.net/tr</link>
	<description>Web tasarım ve programlama (php, javascript, actionscript, java, css) blog&#039;u</description>
	<lastBuildDate>Mon, 03 May 2010 19:21:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CSS Sayfa Yerleşimi Taslakları</title>
		<link>http://www.gudubeth.net/tr/yazi/css-sayfa-yerlesimi-taslaklari/</link>
		<comments>http://www.gudubeth.net/tr/yazi/css-sayfa-yerlesimi-taslaklari/#comments</comments>
		<pubDate>Mon, 03 May 2010 19:21:33 +0000</pubDate>
		<dc:creator>Gudubeth</dc:creator>
				<category><![CDATA[Tasarım]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[taslak]]></category>
		<category><![CDATA[yerleşim]]></category>

		<guid isPermaLink="false">http://www.gudubeth.net/tr/?p=252</guid>
		<description><![CDATA[CSS&#8216;te tablosuz tasarım yapmak günümüzün popüler tasarım konsepti. Aynı zamanda web programcıları için popüler intihar sebebi. Her ne kadar bu işler eskisine göre daha rahat olsa da, Internet Explorer 6&#8242;nın ölemediği bir dünyada hiç bir şey gerçekten kolay değil. Her neyse, saygıdeğer bir kardeşimiz tablosuz tasarım yapmak isteyenler için çeşitli sayfa yerleşimlerini (layout) dizmiş sayfasına. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>CSS</strong>&#8216;te <strong>tablosuz tasarım</strong> yapmak günümüzün popüler tasarım konsepti. Aynı zamanda web programcıları için popüler intihar sebebi. Her ne kadar bu işler eskisine göre daha rahat olsa da, Internet Explorer 6&#8242;nın ölemediği bir dünyada hiç bir şey gerçekten kolay değil. Her neyse, saygıdeğer bir kardeşimiz tablosuz tasarım yapmak isteyenler için <a href="http://www.mycelly.com/" target="_blank">çeşitli sayfa yerleşimlerini (layout)</a> dizmiş sayfasına. Kimi sayfalarda gerekli <strong>CSS</strong> kodları sayfa içerisinde verilmiş, kimisinde ise sayfa koduna bakmanız gerekecek. Sol sütundaki örnek resimlere tıklayarak ilgili sayfalara gidebilirsiniz.</p>
<table border="0">
<tbody>
<tr>
<td><a href="http://www.mycelly.com/css_templates/css_template_01.htm" target="_blank"><img class="alignnone size-full wp-image-263" title="CSS örnek ve kodlarını gör" src="http://www.gudubeth.net/tr/wp-content/uploads/2010/04/layout_01.gif" alt="2 sütun" width="106" height="68" /></a></td>
<td>2 sütun. Menü sağda, içerik solda, dinamik genişliğe sahipler.</td>
</tr>
<tr>
<td><a href="http://www.mycelly.com/css_templates/css_template_02.htm" target="_blank"><img class="alignnone size-full wp-image-263" title="CSS örneğini ve kodlarını gör" src="http://www.gudubeth.net/tr/wp-content/uploads/2010/04/layout_02.gif" alt="2 Kolon" width="106" height="68" /></a></td>
<td>2 Sütun. Menü solda ve sabit genişlikte, içerik dinamik genişliğe sahip sayfanın geri kalanın kaplıyor</td>
</tr>
<tr>
<td><a href="http://www.mycelly.com/css_templates/css_template_02a.htm" target="_blank"><img class="alignnone size-full wp-image-263" title="Örneğe ve CSS kodlarına bak" src="http://www.gudubeth.net/tr/wp-content/uploads/2010/04/layout_02.gif" alt="2 Sütun" width="106" height="68" /></a></td>
<td>2 sütun. Menü solda, içerik sağda, dinamik genişliğe sahipler.</td>
</tr>
<tr>
<td><a href="http://www.mycelly.com/css_templates/css_template_03.htm" target="_blank"><img class="alignnone size-full wp-image-263" title="CSS örnek ve kodlarına bak" src="http://www.gudubeth.net/tr/wp-content/uploads/2010/04/layout_03.gif" alt="3 dinamik sütun" width="106" height="68" /></a></td>
<td>3 sütun, Hepsi de dinamik genişliğe sahip. </td>
</tr>
<tr>
<td><a href="http://www.mycelly.com/css_templates/css_template_04.htm" target="_blank"><img class="alignnone size-full wp-image-263" title="CSS örneği ve kodlarına bak" src="http://www.gudubeth.net/tr/wp-content/uploads/2010/04/layout_12.gif" alt="4 dinamik sütun" width="106" height="68" /></a></td>
<td>4 sütun. Hepsi de dinamik genişliğe sahip.</td>
</tr>
<tr>
<td><a href="http://www.mycelly.com/css_templates/css_template_08.htm" target="_blank"><img class="alignnone size-full wp-image-263" title="Örneğe ve CSS kodlarına bak" src="http://www.gudubeth.net/tr/wp-content/uploads/2010/04/layout_08.gif" alt="Float" width="106" height="68" /></a></td>
<td>Menü wikipedia&#8217;daki sayfa indeksi gibi içeriğe sahil bir şekilde sağ üst köşede duruyor.</td>
</tr>
<tr>
<td><a href="http://www.mycelly.com/css_templates/css_template_05.htm" target="_blank"><img class="alignnone size-full wp-image-263" title="CSS ve HTML kod ve örneğine bak" src="http://www.gudubeth.net/tr/wp-content/uploads/2010/04/layout_05.gif" alt="3 sütun" width="106" height="68" /></a></td>
<td>3 sütun. sağ ve sol menü sütunları sabit genişliğe sahip, içerik sütunu dinamik genişlikte sayfaya yayılıyor.</td>
</tr>
<tr>
<td><a href="http://www.mycelly.com/css_templates/css_template_06.htm" target="_blank"><img class="alignnone size-full wp-image-263" title="CSS/HTML koduna bak" src="http://www.gudubeth.net/tr/wp-content/uploads/2010/04/layout_06.gif" alt="3 sabit genşlikte sütun" width="106" height="68" /></a></td>
<td>3 sütun, hepsi de sabit genişlikte sayfaya ortalanmış biçimde duruyorlar.</td>
</tr>
<tr>
<td><a href="http://www.mycelly.com/css_templates/css_template_09.htm" target="_blank"><img class="alignnone size-full wp-image-263" title="Örnek sayfaya git" src="http://www.gudubeth.net/tr/wp-content/uploads/2010/04/layout_09.gif" alt="yatay ortada sabit sütun" width="106" height="68" /></a></td>
<td>Yatay düzlemde ortalanmış genişliği sabit tek bir kutu/sütun.</td>
</tr>
<tr>
<td><a href="http://www.mycelly.com/css_templates/css_template_10.htm" target="_blank"><img class="alignnone size-full wp-image-263" title="CSS ve HTML örneğine bak" src="http://www.gudubeth.net/tr/wp-content/uploads/2010/04/layout_10.gif" alt="Yatay ortada dinamik sütun" width="106" height="68" /></a></td>
<td>Yatay düzlemde ortalanmış dinamik genişlikte tek bir kutu/sütun.</td>
</tr>
<tr>
<td><a href="http://www.mycelly.com/css_templates/css_template_11.htm" target="_blank"><img class="alignnone size-full wp-image-263" title="CSS kodunu gör" src="http://www.gudubeth.net/tr/wp-content/uploads/2010/04/layout_11.gif" alt="Sayfa ortasında tek kutu" width="106" height="68" /></a></td>
<td>Hem yatay hem düşey düzlemde ortalanmış yani sayfanın tam ortasında sabit genişlik ve yüksekliğe sahip tek bir kutu.</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.gudubeth.net/tr/yazi/css-sayfa-yerlesimi-taslaklari/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sitenize javascript ile kısayollar ekleyin</title>
		<link>http://www.gudubeth.net/tr/yazi/sitenize-javascript-ile-kisayollar-ekleyin/</link>
		<comments>http://www.gudubeth.net/tr/yazi/sitenize-javascript-ile-kisayollar-ekleyin/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 18:29:46 +0000</pubDate>
		<dc:creator>Gudubeth</dc:creator>
				<category><![CDATA[Programlama]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[kütüphane]]></category>

		<guid isPermaLink="false">http://www.gudubeth.net/tr/?p=237</guid>
		<description><![CDATA[Çeşitli e-posta sitelerinde, hiç kullandınız mı bilmiyorum, kimi klasik klavye kısayolları kullanarak sık yapılan işleri kolaylaştırabilirsiniz. &#8220;n&#8221; ile sonraki mesaja, &#8220;p&#8221;  ile önceki mesaja gitmek, &#8220;c&#8221; ile yeni e-posta yaratmak, vs&#8230; http://www.openjs.com/scripts/events/keyboard_shortcuts/ adresinde bulacağınız javascript sınıfı ile bu özellikleri kolaylıkla kendi sitenize ekleyebilirsiniz.
Basitçe nasıl kullanıldığını anlatayım. Önce javascript dosyasını şuradan indiriyorsunuz. Javascript dosyasını sayfanıza ekledikten [...]


İlgili Yazılar:<ol><li><a href='http://www.gudubeth.net/tr/yazi/javascript-ile-flash-boyutunu-degistirme/' rel='bookmark' title='Permanent Link: Javascript ile Flash Boyutunu Değiştirme'>Javascript ile Flash Boyutunu Değiştirme</a></li><li><a href='http://www.gudubeth.net/tr/yazi/php-ile-dizin-silme-fonksiyonu/' rel='bookmark' title='Permanent Link: PHP ile dizin silme fonksiyonu'>PHP ile dizin silme fonksiyonu</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Çeşitli e-posta sitelerinde, hiç kullandınız mı bilmiyorum, kimi klasik <a href="http://mail.google.com/support/bin/answer.py?hl=en&amp;answer=6594">klavye kısayolları kullanarak</a> sık yapılan işleri kolaylaştırabilirsiniz. &#8220;n&#8221; ile sonraki mesaja, &#8220;p&#8221;  ile önceki mesaja gitmek, &#8220;c&#8221; ile yeni e-posta yaratmak, vs&#8230; <a href="http://www.openjs.com/scripts/events/keyboard_shortcuts/" target="_blank">http://www.openjs.com/scripts/events/keyboard_shortcuts/</a> adresinde bulacağınız javascript sınıfı ile bu özellikleri kolaylıkla kendi sitenize ekleyebilirsiniz.</p>
<p>Basitçe nasıl kullanıldığını anlatayım. Önce javascript dosyasını <a href="http://www.openjs.com/scripts/events/keyboard_shortcuts/shortcut.js" target="_blank">şuradan</a> indiriyorsunuz. Javascript dosyasını sayfanıza ekledikten sonra kullanabileceğiniz iki fonksiyon var: shotcut.add() ve shortcut.remove().</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">shortcut.add(tuslar, fonksyion, secenekler);</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">tuslar: string formatında tuşlar. &#8220;a&#8221;, &#8220;b&#8221;, &#8220;8&#8243;, &#8220;#&#8221; gibi tek karakterlik kısayol tanımlayabileceğiniz gibi &#8220;ctrl+s&#8221;, &#8220;alt+f&#8221;, &#8220;ctrl+shift+x&#8221; gibi kombinasyolar da kullanabilirsiniz.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">fonksiyon: tanımlanan tuşlara basıldığında çağırılacak fonksyion.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">secenekler: Javascript nesnesi. Varolan seçenekler:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>type: &#8220;event&#8221; tipi. fonksiyonun hangi anda çağırılacağını belirler. şunlardan bir tanesi olabilir: &#8220;keydown&#8221;, &#8220;keyup&#8221;, &#8220;keypress&#8221;. Geçerli olan &#8220;keydown&#8221; yani tuşa basıldığı an.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>disable_in_input: &#8220;true&#8221; ya da &#8220;false&#8221;. İmleç input, textarea gibi alanlardayken kısayolların çalışmasını engeller. Geçerli değer: false</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>target: DOM nesnesi. Tuşların aktif olduğu DOM nesnesi. Geçerli değer: document (her yer)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>propagate: &#8220;true&#8221; ya da &#8220;false&#8221;. Taracının kendi içinde tanımlı kısayolu aktif kalsın mı?</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>keycode: tuşun kodu. mesela &#8220;a&#8221; için &#8220;65&#8243;.</div>
<h2><strong>shortcut.add()</strong></h2>
<p><strong><span style="font-weight: normal;">Yeni kısayol ekleme.</span></strong></p>
<p><strong>Kullanımı: </strong></p>
<p><strong> </strong>shortcut.add(tuslar, fonksiyon, secenekler);</p>
<p><strong>Parametreler:</strong></p>
<ul>
<li><strong>tuslar<span style="font-weight: normal; ">: string formatında tuşlar. &#8220;a&#8221;, &#8220;b&#8221;, &#8220;8&#8243;, &#8220;#&#8221; gibi tek karakterlik kısayol tanımlayabileceğiniz gibi &#8220;ctrl+s&#8221;, &#8220;alt+f&#8221;, &#8220;ctrl+shift+x&#8221; gibi kombinasyolar da kullanabilirsiniz.</span></strong></li>
<li><strong>fonksiyon</strong>: tanımlanan tuşlara basıldığında çağırılacak fonksyion.</li>
<li><strong>secenekler</strong>: Javascript nesnesi. Varolan seçenekler:
<ul>
<li><strong>type</strong>: &#8220;event&#8221; tipi. fonksyionun hangi anda çağırılacağını belirler. şunlardan bir tanesi olabilir: &#8220;keydown&#8221;, &#8220;keyup&#8221;, &#8220;keypress&#8221;. Geçerli olan &#8220;keydown&#8221; yani tuşa basıldığı an.</li>
<li><strong>disable_in_input</strong>: &#8220;true&#8221; ya da &#8220;false&#8221;. İmleç input, textarea gibi alanlardayken kısayolların çalışmasını engeller. Geçerli değer: false</li>
<li><strong>target</strong>: DOM nesnesi. Tuşların aktif olduğu DOM nesnesi. Geçerli değer: document (her yer)</li>
<li><strong>propagate</strong>: &#8220;true&#8221; ya da &#8220;false&#8221;. Taracının kendi içinde tanımlı kısayolu aktif kalsın mı?</li>
<li><strong>keycode</strong>: tuşun kodu. mesela &#8220;a&#8221; için &#8220;65&#8243;.</li>
</ul>
</li>
</ul>
<p><strong>Örnek:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">shortcut.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Ctrl+B&quot;</span><span style="color: #339933;">,</span>
		<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ctrl+b tuşlarına bastınız&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
shortcut.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Ctrl+B&quot;</span><span style="color: #339933;">,</span>
		<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;propogate:true olduğu için bu mesajdan sonra tarayınızın kendi işlevi çalışacak&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
		<span style="color: #009900;">&#123;</span>propogate<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2 style="font-size: 1.5em;"><strong>shortcut.remove()</strong></h2>
<p><strong><span style="font-weight: normal;">Kısayol kaldırma.</span></strong></p>
<p><strong>Kullanımı:</strong></p>
<p><strong></strong>shortcut.remove(tuslar);</p>
<p><strong>Parametreler:</strong></p>
<ul>
<li>tuslar: kaldırılacak kısayol tuşları.</li>
</ul>
<p><strong>Örnek:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//kisayol ekle</span>
shortcut.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Ctrl+B&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Yeni kısayol eklendi&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">//kisayolu kaldir</span>
shortcut.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Ctrl+B&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>Kullanılabilecek özel tuşlar:</h2>
<p>Tab<br />
Space<br />
Return<br />
Enter<br />
Backspace<br />
Scroll_lock<br />
Caps_lock<br />
Num_lock<br />
Pause<br />
Insert<br />
Home<br />
Delete<br />
End<br />
Page_up<br />
Page_down<br />
Left<br />
Up<br />
Right<br />
Down<br />
F1<br />
F2<br />
F3<br />
F4<br />
F5<br />
F6<br />
F7<br />
F8<br />
F9<br />
F10<br />
F11<br />
F12</p>


<p>İlgili Yazılar:<ol><li><a href='http://www.gudubeth.net/tr/yazi/javascript-ile-flash-boyutunu-degistirme/' rel='bookmark' title='Permanent Link: Javascript ile Flash Boyutunu Değiştirme'>Javascript ile Flash Boyutunu Değiştirme</a></li><li><a href='http://www.gudubeth.net/tr/yazi/php-ile-dizin-silme-fonksiyonu/' rel='bookmark' title='Permanent Link: PHP ile dizin silme fonksiyonu'>PHP ile dizin silme fonksiyonu</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gudubeth.net/tr/yazi/sitenize-javascript-ile-kisayollar-ekleyin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>9 Ücretsiz CSS Web Sitesi Taslağı</title>
		<link>http://www.gudubeth.net/tr/yazi/9-ucretsiz-css-web-sitesi-taslagi/</link>
		<comments>http://www.gudubeth.net/tr/yazi/9-ucretsiz-css-web-sitesi-taslagi/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 15:04:02 +0000</pubDate>
		<dc:creator>Gudubeth</dc:creator>
				<category><![CDATA[Tasarım]]></category>
		<category><![CDATA[css taslaklar]]></category>
		<category><![CDATA[ücretsiz]]></category>
		<category><![CDATA[web sitesi taslakları]]></category>
		<category><![CDATA[web taslakları]]></category>

		<guid isPermaLink="false">http://www.gudubeth.net/tr/?p=221</guid>
		<description><![CDATA[OSWD.org, Open Source Web Design insanların yaptıkları web sitesi taslaklarını ücretsiz olarak paylaştıkları bir site. Bu taslaklar tasarımcıya link verme zorunluluğu olmadan ticari işlerde de kullanılabiliyor (yine de link verilmesi güzel olur tabi). Tasarımlar çok parlak olmasa da nispeten güzel bulduklarımı aşağıda listeledim. Linklere tıklayarak tasarımları görebilir ve indirebilirsiniz.



Jefferson by dreamlogic



BusyCity by JJenZz





Dark Shine by [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.oswd.org">OSWD.org</a>, Open Source Web Design insanların yaptıkları web sitesi taslaklarını ücretsiz olarak paylaştıkları bir site. Bu taslaklar tasarımcıya link verme zorunluluğu olmadan ticari işlerde de kullanılabiliyor (yine de link verilmesi güzel olur tabi). Tasarımlar çok parlak olmasa da nispeten güzel bulduklarımı aşağıda listeledim. Linklere tıklayarak tasarımları görebilir ve indirebilirsiniz.</p>
<table border="0">
<tr>
<td width="50%">
<a href="http://www.oswd.org/design/preview/id/2812" target="_blank"><strong>Jefferson by dreamlogic</strong><br/><img class="alignnone" style="text-decoration:none !important" title="web sitesi taslağı 2812" src="http://www.gudubeth.net/res/oswd/oswd2812.jpg" alt="" width="300" height="200" /></a><br />
<br/>
</td>
<td width="50%">
<a href="http://www.oswd.org/design/preview/id/2903" target="_blank"><strong>BusyCity by JJenZz</strong><br/><img class="alignnone" style="text-decoration:none !important" title="web sitesi taslağı 2903" src="http://www.gudubeth.net/res/oswd/oswd2903.jpg" alt="" width="300" height="200" /></a><br />
<br/>
</td>
</tr>
<tr>
<td>
<a href="http://www.oswd.org/design/preview/id/2952" target="_blank"><strong>Dark Shine by Jack</strong><br/><img class="alignnone" style="text-decoration:none !important" title="web sitesi taslağı 2952" src="http://www.gudubeth.net/res/oswd/oswd2952.jpg" alt="" width="300" height="200" /></a><br />
<br/>
</td>
<td>
<a href="http://www.oswd.org/design/preview/id/3299" target="_blank"><strong>Optimistic by nelchee</strong><br/><img class="alignnone" style="text-decoration:none !important" title="web sitesi taslağı 3299" src="http://www.gudubeth.net/res/oswd/oswd3299.jpg" alt="" width="300" height="200" /></a><br />
<br/>
</td>
</tr>
<tr>
<td>
<a href="http://www.oswd.org/design/preview/id/3630" target="_blank"><strong>The Hobbit by Arcsin</strong><br/><img class="alignnone" style="text-decoration:none !important" title="web sitesi taslağı 3630" src="http://www.gudubeth.net/res/oswd/oswd3630.jpg" alt="" width="300" height="200" /></a><br />
<br/>
</td>
<td>
<a href="http://www.oswd.org/design/preview/id/2780" target="_blank"><strong>Fashionista v2 by dreamlogic</strong><br/><img class="alignnone" style="text-decoration:none !important" title="web sitesi taslağı 2780" src="http://www.gudubeth.net/res/oswd/oswd2780.jpg" alt="" width="300" height="200" /></a><br />
<br/>
</td>
</tr>
<tr>
<td>
<a href="http://www.oswd.org/design/preview/id/2811" target="_blank"><strong>Mother Russia by dreamlogic</strong><br/><img class="alignnone" style="text-decoration:none !important" title="web sitesi taslağı 2811" src="http://www.gudubeth.net/res/oswd/oswd2811.jpg" alt="" width="300" height="200" /></a><br />
<br/>
</td>
<td>
<a href="http://www.oswd.org/design/preview/id/3401" target="_blank"><strong>FreeStyle by mrpires</strong><br/><img class="alignnone" style="text-decoration:none !important" title="web sitesi taslağı 3401" src="http://www.gudubeth.net/res/oswd/oswd3401.jpg" alt="" width="300" height="200" /></a><br />
<br/>
</td>
</tr>
<tr>
<td>
<a href="http://www.oswd.org/design/preview/id/3466" target="_blank"><strong>Lonelyness by Dieter</strong><br/><img class="alignnone" style="text-decoration:none !important" title="web sitesi taslağı 3466" src="http://www.gudubeth.net/res/oswd/oswd3466.jpg" alt="" width="300" height="200" /></a><br />
<br/>
</td>
<td>&nbsp;</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.gudubeth.net/tr/yazi/9-ucretsiz-css-web-sitesi-taslagi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Portfolyonuzu Yayınlayabileceğiniz 10 Yabancı Site</title>
		<link>http://www.gudubeth.net/tr/yazi/portfolyonuzu-yayinlayabileceginiz-10-yabanci-site/</link>
		<comments>http://www.gudubeth.net/tr/yazi/portfolyonuzu-yayinlayabileceginiz-10-yabanci-site/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 19:28:23 +0000</pubDate>
		<dc:creator>Gudubeth</dc:creator>
				<category><![CDATA[Tasarım]]></category>
		<category><![CDATA[portfolyo]]></category>
		<category><![CDATA[sosyal]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.gudubeth.net/tr/?p=212</guid>
		<description><![CDATA[Devinatart
Portfolyo adresiniz: isminiz.deviantart.com
 Sosyal öğeler: Yorum, kritik, forum, gruplar, arkadaş olma, mesajlaşma, blog, ne ararsanız var.
 Notlar: Bu listedeki portfolyo siteleri içerisinde açık ara en büyük olan deviantart. Burada herkes birşeyler yayınlıyor. Bu yüzden kalite biraz düşük gibi gözükebilir ama biraz dolaşırsanız gerçekten harika insanlarla tanışabilirsiniz. Pek çok farklı formatta dosya gönderilebiliyor. Direkt video yükleyemiyorsunuz [...]]]></description>
			<content:encoded><![CDATA[<h3><a href="http://www.deviantart.com" target="_blank">Devinatart</a></h3>
<p><strong><strong><strong><a href="http://www.deviantart.com"><img class="alignleft" title="Deviantart" src="http://www.gudubeth.net/res/portfoliosites/deviantart.jpg" alt="" width="180" height="120" /></a></strong></strong>Portfolyo adresiniz:</strong> isminiz.deviantart.com<br />
<strong> Sosyal öğeler</strong>: Yorum, kritik, forum, gruplar, arkadaş olma, mesajlaşma, blog, ne ararsanız var.<br />
<strong> Notlar:</strong> Bu listedeki portfolyo siteleri içerisinde açık ara en büyük olan deviantart. Burada herkes birşeyler yayınlıyor. Bu yüzden kalite biraz düşük gibi gözükebilir ama biraz dolaşırsanız gerçekten harika insanlarla tanışabilirsiniz. Pek çok farklı formatta dosya gönderilebiliyor. Direkt video yükleyemiyorsunuz ama flash dosyaları görüntülebiliyor. Ayrıca çok sayıda program için temalar (windows, linux, vs.), eklentiler (photoshop, illustrator, vs.) yüklenebiliyor. Amacınız sadece portfolyonuzu yayınlamak değilse buraya mutlaka üye olmalısınız.</p>
<div style="clear:both;"></div>
<h3><a href="http://www.behance.net" target="_blank">Behance</a></h3>
<p><strong><strong><a href="http://www.behance.net"><img class="alignleft" title="Behance" src="http://www.gudubeth.net/res/portfoliosites/behance.jpg" alt="" width="180" height="120" /></a></strong>Portfolyo adresiniz:</strong> http://www.behance.net/isminiz<br />
<strong> Sosyal öğeler:</strong> Yorum, mesajlaşma, gruplar, iş arama.<br />
<strong> Notlar:</strong> Diğer sitelerden en önemli farkı davetiye ile üye almaları. Hemen belirteyim ki davetiye için süründümüyorlar. Üye olma (signup) sayfasında sol tarafatki formu kullanarak hemen bir davetiye isteyebiliyorsunuz. Onlar da hemen gönderiyorlar zaten. Portfolyo sahipleri için en büyük &#8211; profesyonel sitelerden birisi burası. Zaten işlere baktığınızda da göreceksiniz bunu. Son olarak burada tanıttığınız projelerin içine video ekleyebiliyorsunuz.</p>
<div style="clear:both;"></div>
<h3><a href="http://www.coroflot.com/" target="_blank">Coroflot</a></h3>
<p><strong><strong><a href="http://www.coroflot.com"><img class="alignleft" title="Coroflot" src="http://www.gudubeth.net/res/portfoliosites/coroflot.jpg" alt="" width="180" height="120" /></a></strong>Portfolyo adresiniz</strong>: http://www.coroflot.com/public/individual_details.asp?individual_id=kullanici_numaraniz<br />
<strong> Sosyal öğeler:</strong> Yorum, gruplar, iş arama<br />
<strong> Notlar:</strong> Size verdikleri adres biraz can sıkıcı olsa da güzel bir site olduğunu söyleyebilirim. Sanırım Türkiye&#8217;de protfolyolar için bolca kullanılıyor. Portfolyo görüntülemek dışında Twitter tarzı &#8216;updates&#8217; bölümü var.</p>
<div style="clear:both;"></div>
<h3><a href="http://www.carbonmade.com/" target="_blank">Carbonmade</a></h3>
<p><strong><strong><a href="http://www.carbonmade.com"><img class="alignleft" title="Carbonmade" src="http://www.gudubeth.net/res/portfoliosites/carbonmade.jpg" alt="" width="180" height="120" /></a></strong>Portfolyo adresiniz:</strong> http://isminiz.carbonmade.com<br />
<strong> Sosyal öğeler:</strong> Yok<br />
<strong> Notlar:</strong> En önemli özelliği size verdikleri portfolyo sayfasının son derece sade olması. Sayfalarınızda reklam ya da an alt köşedeki carbonmade logosu dışında sizin portfolyonuz harici birşey gösterilmiyor. Flash ekleneilibiyor. Video eklemek isterseniz ücretli üyeliğe geçmeniz gerekiyor. 35 resimlik 5 proje oluşturma ücretsiz daha fazlası için yine aylık 12$ ücreti olan paralı üyeliğe geçmeniz gerekiyor.</p>
<div style="clear:both;"></div>
<h3><a href="http://designrelated.com/" target="_blank">Designrelated</a></h3>
<p><strong><strong><a href="http://www.designrelated.com"><img class="alignleft" title="Designrelated" src="http://www.gudubeth.net/res/portfoliosites/designrelated.jpg" alt="" width="180" height="120" /></a></strong>Portfolyo adresiniz:</strong> http://www.designrelated.com/portfolio/isminiz<br />
<strong> Sosyal öğeler: </strong>Yorum, arkadaş olma, blog, iş arama</p>
<div style="clear:both;"></div>
<h3><a href="http://www.gfxartist.com/" target="_blank">Gfxartist</a></h3>
<p><strong><strong><a href="http://www.gfxartist.com" target="_blank"><img class="alignleft" title="Gfxartist" src="http://www.gudubeth.net/res/portfoliosites/gfxartist.jpg" alt="" width="180" height="120" /></a></strong>Portfolyo adresiniz:</strong> http://isminiz.gfxartist.com/<br />
<strong> Sosyal öğeler:</strong> Yorum, forum, blog.<br />
<strong> Notlar: </strong>Deviantart gibi bir komünite sitesi gibi duruyor. yorumlar, forumlar bloglar ve envai çeşit şey mevcut. Arkadaş olma ve ilintili şeyler ise yok. Her ay bazı üyeler &#8216;elite&#8217; olarak seçiyorlar. Bu şekilde çalışmalarınız daha farklı yerlerde daha büyük boyularda listeleniyor ve bu da sizin ön plana çıkmanızı kolaylaştırıyor.</p>
<div style="clear:both;"></div>
<h3><a href="http://www.dripbook.com/" target="_blank">Dripbook</a></h3>
<p><strong><strong><a href="http://www.dripbook.com" target="_blank"><img class="alignleft" title="Dripbook" src="http://www.gudubeth.net/res/portfoliosites/dripbook.jpg" alt="" width="180" height="120" /></a></strong>Portfolyo adresiniz:</strong> http://www.dripbook.com/isminiz<br />
<strong> Sosyal öğeler: </strong>Yorum, gruplar.<br />
<strong> Notlar:</strong> Baştan söyleyeyim dripbook ücretli bir site. Protfolyo sayfalarınız reklamsız ama carbonmade gibi sade de değil. Diğer portfolyo siteleirnde en önemli farkı size portfolyonuzu başka yerler aktarabilme seçeneği sunmaları. Şu anda IPhone, Facebook, Twitter ya da kendi web sitenize aktarım yapabiliyorsunuz.</p>
<div style="clear:both;"></div>
<h3><a href="http://shownd.com/" target="_blank">Shownd</a></h3>
<p><strong><a href="http://www.behance.com"></a><strong><a href="http://www.shownd.com" target="_blank"><img class="alignleft" title="Shownd" src="http://www.gudubeth.net/res/portfoliosites/shownd.jpg" alt="" width="180" height="120" /></a></strong>Portfolyo adresiniz:</strong> http://shownd.com/isminiz<br />
<strong> Sosyal öğeler:</strong> İş arama<br />
<strong> Notlar:</strong> Carbonmade&#8217;i hatırlatan sade ve reklamsız bir portfolyo sayfası var ve tamamen ücretsiz, iş arama seçeneği de cabası.</p>
<div style="clear:both;"></div>
<h3><a href="http://shadowness.com/" target="_blank">Shadowness</a></h3>
<p><strong><strong><a href="http://shadowness.com" target="_blank"><img class="alignleft" title="Shadowness" src="http://www.gudubeth.net/res/portfoliosites/shadowness.jpg" alt="" width="180" height="120" /></a></strong>Portfolyo adresiniz:</strong> http://shadowness.com/isminiz<br />
<strong> Sosyal öğeler:</strong> Yorum, forum<br />
<strong> Notlar:</strong> Twitter&#8217;a benzeyen bir sistemi var. Bu biraz kafa karıştırabilir, farklı sitelerde resimlerimizi nereye yükleyeceğiz diyen kızgın insanlar gördüm. Hemen söyleyeyim: yeni bir post (yazı) eklerken metin yazma kutusunun hemen altındaki &#8216;add image&#8217;e tıklıyorsunuz ve resminizi ekliyorsunuz.</p>
<div style="clear:both;"></div>
<h3><a href="http://www.finalcrit.com/" target="_blank">Finalcrit</a></h3>
<p><strong><strong><a href="http://www.finalcrit.com" target="_blank"><img class="alignleft" title="Finalcrit" src="http://www.gudubeth.net/res/portfoliosites/finalcrit.jpg" alt="" width="180" height="120" /></a></strong>Portfolyo adresiniz:</strong> http://www.finalcrit.com/kategori/isminiz<br />
<strong> Sosyal öğeler</strong>: İş arama<br />
<strong> Notlar:</strong> Burada da sade, reklamsız bir portfolyo sayfanız var. Sağ alt köşeye logonuzu koyabiliyorsunuz. Diğerlerinden farklı olarak portfolyo sayfası tamamen flash ile yapılmış.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gudubeth.net/tr/yazi/portfolyonuzu-yayinlayabileceginiz-10-yabanci-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Resim İşlemleri Sınıfı</title>
		<link>http://www.gudubeth.net/tr/yazi/java-resim-islemleri-sinifi/</link>
		<comments>http://www.gudubeth.net/tr/yazi/java-resim-islemleri-sinifi/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 17:34:39 +0000</pubDate>
		<dc:creator>Gudubeth</dc:creator>
				<category><![CDATA[Programlama]]></category>
		<category><![CDATA[hazır kod]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.gudubeth.net/tr/?p=193</guid>
		<description><![CDATA[Java&#8217;da resim formatı değiştirmek, resim boyutlarını öğrenmek gibi temel işlemler kolayca yapılabilir. Yine de bu işlemleri bir genel amaçlı bir &#8220;resim işleme sınıfı&#8221; toplamak isteyebilirsiniz. Bu sayfada bulacağınız ImageUtil sınıfı böyle bir sınıf için iyi bir başlangıç olabilir. Şu anda sadece resim genişliği, yüksekliği, dosya boyutunu bulabiliyor, jpg, gif, png, bmp formatları arasında çevrim yapabiliyor. [...]


İlgili Yazılar:<ol><li><a href='http://www.gudubeth.net/tr/yazi/java-ve-mysqlde-turkce-karakter-sorunu/' rel='bookmark' title='Permanent Link: Java ve MySQL&#8217;de Türkçe Karakter Sorunu'>Java ve MySQL&#8217;de Türkçe Karakter Sorunu</a></li><li><a href='http://www.gudubeth.net/tr/yazi/javada-stringi-sayiya-int-float-vs-cevirme/' rel='bookmark' title='Permanent Link: Java’da String’i Sayıya (int, float, vs) Çevirme'>Java’da String’i Sayıya (int, float, vs) Çevirme</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Java&#8217;da <strong>resim formatı değiştirmek</strong>, <strong>resim boyutlarını öğrenmek</strong> gibi temel işlemler kolayca yapılabilir. Yine de bu işlemleri bir genel amaçlı bir &#8220;<strong>resim işleme sınıfı</strong>&#8221; toplamak isteyebilirsiniz. Bu sayfada bulacağınız <em>ImageUtil </em>sınıfı böyle bir sınıf için iyi bir başlangıç olabilir. Şu anda sadece resim genişliği, yüksekliği, dosya boyutunu bulabiliyor, <strong>jpg</strong>, <strong>gif</strong>, <strong>png</strong>, <strong>bmp </strong>formatları arasında çevrim yapabiliyor. İlerleyen zamanlarda resim boyutu değiştirme, üstüne yazı yazma ve resme watermark ekleme gibi işlemleri de ekleyeceğim. <em>ImageUtil</em>&#8216;i direkt olarak kullanmasanız bile kodlarını inceleyerek bu işlemlerin nasıl yapıldığını rahatlıkla öğrenebilirsiniz. Sonuçta bütün bu işlemler için Java ile gelen <a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/ImageIO.html" target="_blank">javax.imageio.ImageIO</a> sınıfını kullanılmakta.</p>
<p>ImageUtil metotları resim dosyasını &#8216;dosya adı&#8217; olarak değil de <em>File </em>sınıfı olarak almakta. Elinizde sadece dosya adı varsa <em>File </em>nesnesini aşağıdaki gibi oluşturabilirsiniz.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">File</span> dosya<span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;c:/dizinadi/resim.jpg&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Metotları burada tek tek açıklamayacağım, bütün açıklamalar JavaDoc formatında kodun içerisinde bulunmakta. Aşağıdaki örneğe bakarak da sınıfın nasıl kullanıldığını görebilirsiniz.</p>
<h3>Örnekler:</h3>
<p>Not: Bu örnek ImageUtil sınıfının main metodu içerisinde aynen bulunmakta.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">	<span style="color: #000000; font-weight: bold;">try</span><span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">//test</span>
		<span style="color: #003399;">String</span> filePath<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;d:/_dev/temp/&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//!!!bunu ve dosya adini degistirmeyi unutmayin!!!</span>
		<span style="color: #003399;">File</span> f <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span>filePath<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;test.png&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;test.png: &quot;</span><span style="color: #339933;">+</span>ImageUtil.<span style="color: #006633;">findWidth</span><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;x&quot;</span><span style="color: #339933;">+</span>ImageUtil.<span style="color: #006633;">findHeight</span><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		f<span style="color: #339933;">=</span>ImageUtil.<span style="color: #006633;">convertTo</span><span style="color: #009900;">&#40;</span>f, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span>filePath<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;/test.gif&quot;</span><span style="color: #009900;">&#41;</span>, ImageUtil.<span style="color: #006633;">GIF</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;test.gif: &quot;</span><span style="color: #339933;">+</span>ImageUtil.<span style="color: #006633;">findWidth</span><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;x&quot;</span><span style="color: #339933;">+</span>ImageUtil.<span style="color: #006633;">findHeight</span><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		f<span style="color: #339933;">=</span>ImageUtil.<span style="color: #006633;">convertTo</span><span style="color: #009900;">&#40;</span>f, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span>filePath<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;/test.bmp&quot;</span><span style="color: #009900;">&#41;</span>, ImageUtil.<span style="color: #006633;">BMP</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;test.bmp: &quot;</span><span style="color: #339933;">+</span>ImageUtil.<span style="color: #006633;">findWidth</span><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;x&quot;</span><span style="color: #339933;">+</span>ImageUtil.<span style="color: #006633;">findHeight</span><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		f<span style="color: #339933;">=</span>ImageUtil.<span style="color: #006633;">convertToJpg</span><span style="color: #009900;">&#40;</span>f, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span>filePath<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;/test.jpg&quot;</span><span style="color: #009900;">&#41;</span>, 0.9f<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;test.jpg: &quot;</span><span style="color: #339933;">+</span>ImageUtil.<span style="color: #006633;">findWidth</span><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;x&quot;</span><span style="color: #339933;">+</span>ImageUtil.<span style="color: #006633;">findHeight</span><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></div></div>

<p><span id="more-193"></span></p>
<h3>Kod:</h3>
<p><a href='http://www.gudubeth.net/tr/wp-content/uploads/2010/01/net.gudubeth.common.ImageUtil.zip'>ImageUtil sınıfını buraya tıklayarak indirebilirsiniz.</a></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">net.gudubeth.common</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.awt.image.BufferedImage</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.File</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.FileInputStream</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.IOException</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.imageio.ImageIO</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.image.codec.jpeg.ImageFormatException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.image.codec.jpeg.JPEGCodec</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.image.codec.jpeg.JPEGEncodeParam</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.image.codec.jpeg.JPEGImageDecoder</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.image.codec.jpeg.JPEGImageEncoder</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.FileOutputStream</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 * Resim / imaj / gorsel isleme sinifi. Bu sinif ile resimlerin genisliklerini, 
 * yuksekliklerini ve dosya boyutlarini bulabilir ve bu resimleri farkli formatlarda 
 * resimlere donusturebilirsiniz. denenmis formatlar jpg, png, bmp ve gif formatlaridir.
 * metotlarda parametre olarak dosya adi yerine File nesnesi kullailmistir. Dosya adindan 
 * File nesnesini su sekilde olusturabilirsiniz:
 *  	File file=new File(&quot;c:/dizinadi/resim.jpg&quot;);
 * 
 *
 * @author gudubeth
 * @since 20-01-2010
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ImageUtil<span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> JPG<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;jpg&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> GIF<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;gif&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> BMP<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;bmp&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> PNG<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;png&quot;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * dosyadan BufferedImage nesnesi yaratir. bu dosya diger resim islemlerinde kullanilir
     * @param imageFile
     * @return image
     * @throws ImageFormatException
     * @throws IOException
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">BufferedImage</span> findBufferedImage<span style="color: #009900;">&#40;</span><span style="color: #003399;">File</span> imageFile<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> ImageFormatException, <span style="color: #003399;">IOException</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> ImageIO.<span style="color: #006633;">read</span><span style="color: #009900;">&#40;</span>imageFile<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * jpg dosyasindan BufferedImage nesnesi yaratir. bu dosya diger resim islemlerinde kullanilir
     * @param imageFile
     * @return image
     * @throws ImageFormatException
     * @throws IOException
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">BufferedImage</span> findBufferedImageForJpeg<span style="color: #009900;">&#40;</span><span style="color: #003399;">File</span> imageFile<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> ImageFormatException, <span style="color: #003399;">IOException</span><span style="color: #009900;">&#123;</span>
            JPEGImageDecoder jpegDecoder <span style="color: #339933;">=</span> JPEGCodec.<span style="color: #006633;">createJPEGDecoder</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">FileInputStream</span><span style="color: #009900;">&#40;</span>imageFile.<span style="color: #006633;">getPath</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">return</span> jpegDecoder.<span style="color: #006633;">decodeAsBufferedImage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * resmin gensilgini bulur.
     * @param imageFile gecerli formatlar: jpg,tif,png,bmp,gif. diger formatlari deneyiniz
     * @return
     * @throws ImageFormatException
     * @throws IOException
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">int</span> findWidth<span style="color: #009900;">&#40;</span><span style="color: #003399;">File</span> imageFile<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> ImageFormatException, <span style="color: #003399;">IOException</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> findBufferedImage<span style="color: #009900;">&#40;</span>imageFile<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getWidth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * resim yuksekligini bulur
     * @param imageFile. gecerli formatlar: jpg,tif,png,bmp,gif. diger formatlari deneyiniz
     * @return image height in int
     * @throws ImageFormatException
     * @throws IOException
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">int</span> findHeight<span style="color: #009900;">&#40;</span><span style="color: #003399;">File</span> imageFile<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> ImageFormatException, <span style="color: #003399;">IOException</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> findBufferedImage<span style="color: #009900;">&#40;</span>imageFile<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getHeight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * resim genislik ve yuksekligini bulur. findHeight ve findWidth metotlarini
	 * ayri ayri cagirmaktan daha hizlidir.
     * @param imageFile
     * @return  int array containing width and height
     * @throws ImageFormatException
     * @throws IOException
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> findWidthAndHeight<span style="color: #009900;">&#40;</span><span style="color: #003399;">File</span> imageFile<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> ImageFormatException, <span style="color: #003399;">IOException</span><span style="color: #009900;">&#123;</span>
            <span style="color: #003399;">BufferedImage</span> buffy <span style="color: #339933;">=</span> findBufferedImage<span style="color: #009900;">&#40;</span>imageFile<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#123;</span>buffy.<span style="color: #006633;">getWidth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, buffy.<span style="color: #006633;">getHeight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * dosya boyutunu bulur
     * @param imageFile
     * @return 
     * @throws IOException
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">long</span> findFileSize<span style="color: #009900;">&#40;</span><span style="color: #003399;">File</span> imageFile<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">IOException</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> imageFile.<span style="color: #006633;">length</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * resmi baska bir resim formatina cevirir. gecerli formatlar jpg, png, gif, bmp
     * 
     * @param input File        cevrilecek dosya. ImageIO tarafinda okunabilen tum formatlar 
	 * 							gecerlidir. bu formatlar arasinda jpg, png, gif, bmp bulunmaktadir
     * @param output File       cikti dosyasi
     * @param format String     jpg, png, gif veya bmp
     * @return output file		cikti dosyasi
     * @throws IOException
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">File</span> convertTo<span style="color: #009900;">&#40;</span><span style="color: #003399;">File</span> input, <span style="color: #003399;">File</span> output, <span style="color: #003399;">String</span> format<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">IOException</span><span style="color: #009900;">&#123;</span>
        ImageIO.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span>ImageIO.<span style="color: #006633;">read</span><span style="color: #009900;">&#40;</span>input<span style="color: #009900;">&#41;</span>, format, output<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">return</span> output<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * resmi gif'e cevirir
     * @param input      cevrilecek dosya
     * @param output    olusturulacak dosya
     * @return output file
     * @throws IOException
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">File</span> convertToGif<span style="color: #009900;">&#40;</span><span style="color: #003399;">File</span> input, <span style="color: #003399;">File</span> output<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">IOException</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> convertTo<span style="color: #009900;">&#40;</span>input, output, GIF<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * resim dosyasini bmp'ye cevirir
     * @param input     cevrilecek dosya
     * @param output    olusturulacak dosya
     * @return output file
     * @throws IOException
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">File</span> convertToBmp<span style="color: #009900;">&#40;</span><span style="color: #003399;">File</span> input, <span style="color: #003399;">File</span> output<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">IOException</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> convertTo<span style="color: #009900;">&#40;</span>input, output, BMP<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * resmi png'ye cevirir
     * @param input     cevrilecek dosya
     * @param output    olusturulacak dosya
     * @return output file
     * @throws IOException
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">File</span> convertToPng<span style="color: #009900;">&#40;</span><span style="color: #003399;">File</span> input, <span style="color: #003399;">File</span> output<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">IOException</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> convertTo<span style="color: #009900;">&#40;</span>input, output, PNG<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * resmi belirtilen kalitede jpeg formatina cevirir.
     * @param input     cevrilecek dosya
     * @param output    olusturulacak dosya
     * @param quality   jpeg kalitesi. 0 ve 1 arasinda bir deger olabilir.
     * @return output file
     * @throws ImageFormatException, IOException
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">File</span> convertToJpg<span style="color: #009900;">&#40;</span><span style="color: #003399;">File</span> input, <span style="color: #003399;">File</span> output, <span style="color: #000066; font-weight: bold;">float</span> quality<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> ImageFormatException, <span style="color: #003399;">IOException</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>quality<span style="color: #339933;">&gt;</span><span style="color: #cc66cc;">1</span> <span style="color: #339933;">||</span> quality<span style="color: #339933;">&lt;=</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">IllegalArgumentException</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;quality must be between 0 and 1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
        <span style="color: #003399;">BufferedImage</span> bim <span style="color: #339933;">=</span> findBufferedImage<span style="color: #009900;">&#40;</span>input<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">FileOutputStream</span> fos <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">FileOutputStream</span><span style="color: #009900;">&#40;</span>output<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        JPEGImageEncoder encoder <span style="color: #339933;">=</span> JPEGCodec.<span style="color: #006633;">createJPEGEncoder</span><span style="color: #009900;">&#40;</span>fos<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        JPEGEncodeParam encodeParams <span style="color: #339933;">=</span> encoder.<span style="color: #006633;">getDefaultJPEGEncodeParam</span><span style="color: #009900;">&#40;</span>bim<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        encodeParams.<span style="color: #006633;">setQuality</span><span style="color: #009900;">&#40;</span>quality, <span style="color: #000066; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        encoder.<span style="color: #006633;">setJPEGEncodeParam</span><span style="color: #009900;">&#40;</span>encodeParams<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        encoder.<span style="color: #006633;">encode</span><span style="color: #009900;">&#40;</span>bim<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        fos.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">return</span> output<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     *
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">try</span><span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">//test</span>
            <span style="color: #003399;">String</span> filePath<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;d:/_dev/temp/&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//!!!bunu ve dosya adini degistirmeyi unutmayin!!!</span>
            <span style="color: #003399;">File</span> f <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span>filePath<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;test.png&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;test.png: &quot;</span><span style="color: #339933;">+</span>ImageUtil.<span style="color: #006633;">findWidth</span><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;x&quot;</span><span style="color: #339933;">+</span>ImageUtil.<span style="color: #006633;">findHeight</span><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            f<span style="color: #339933;">=</span>ImageUtil.<span style="color: #006633;">convertTo</span><span style="color: #009900;">&#40;</span>f, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span>filePath<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;/test.gif&quot;</span><span style="color: #009900;">&#41;</span>, ImageUtil.<span style="color: #006633;">GIF</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;test.gif: &quot;</span><span style="color: #339933;">+</span>ImageUtil.<span style="color: #006633;">findWidth</span><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;x&quot;</span><span style="color: #339933;">+</span>ImageUtil.<span style="color: #006633;">findHeight</span><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            f<span style="color: #339933;">=</span>ImageUtil.<span style="color: #006633;">convertTo</span><span style="color: #009900;">&#40;</span>f, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span>filePath<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;/test.bmp&quot;</span><span style="color: #009900;">&#41;</span>, ImageUtil.<span style="color: #006633;">BMP</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;test.bmp: &quot;</span><span style="color: #339933;">+</span>ImageUtil.<span style="color: #006633;">findWidth</span><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;x&quot;</span><span style="color: #339933;">+</span>ImageUtil.<span style="color: #006633;">findHeight</span><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            f<span style="color: #339933;">=</span>ImageUtil.<span style="color: #006633;">convertToJpg</span><span style="color: #009900;">&#40;</span>f, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span>filePath<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;/test.jpg&quot;</span><span style="color: #009900;">&#41;</span>, 0.9f<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;test.jpg: &quot;</span><span style="color: #339933;">+</span>ImageUtil.<span style="color: #006633;">findWidth</span><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;x&quot;</span><span style="color: #339933;">+</span>ImageUtil.<span style="color: #006633;">findHeight</span><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>



<p>İlgili Yazılar:<ol><li><a href='http://www.gudubeth.net/tr/yazi/java-ve-mysqlde-turkce-karakter-sorunu/' rel='bookmark' title='Permanent Link: Java ve MySQL&#8217;de Türkçe Karakter Sorunu'>Java ve MySQL&#8217;de Türkçe Karakter Sorunu</a></li><li><a href='http://www.gudubeth.net/tr/yazi/javada-stringi-sayiya-int-float-vs-cevirme/' rel='bookmark' title='Permanent Link: Java’da String’i Sayıya (int, float, vs) Çevirme'>Java’da String’i Sayıya (int, float, vs) Çevirme</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gudubeth.net/tr/yazi/java-resim-islemleri-sinifi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP E-posta Adresi Doğrulama Fonksiyonu</title>
		<link>http://www.gudubeth.net/tr/yazi/php-e-posta-adresi-dogrulama-fonksiyonu/</link>
		<comments>http://www.gudubeth.net/tr/yazi/php-e-posta-adresi-dogrulama-fonksiyonu/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 18:41:45 +0000</pubDate>
		<dc:creator>Gudubeth</dc:creator>
				<category><![CDATA[Programlama]]></category>
		<category><![CDATA[hazır kod]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[regular expressions]]></category>

		<guid isPermaLink="false">http://www.gudubeth.net/tr/?p=189</guid>
		<description><![CDATA[Email adresi kontrolü için pek çok fonksiyon yazılmıştır. Bunları internette kolayca bulabilirsiniz. Fakat bu fonksiyonlar ne kadar doğru çalışıyor? &#8216;Comparing E-mail Address Validating Regular Expressions&#8217; isimli yazıda vakti bol saygıdeğer bir arkadaşımız &#8216;Regular Expression&#8217; ile yapılan 13 adet e-posta doğrulamasını sistemli bir şekilde test etmiş, hangisinin nerede doğru, nerede yanlış çalıştığını güzel bir şekilde listelemiş. [...]


İlgili Yazılar:<ol><li><a href='http://www.gudubeth.net/tr/yazi/php-ile-dizin-silme-fonksiyonu/' rel='bookmark' title='Permanent Link: PHP ile dizin silme fonksiyonu'>PHP ile dizin silme fonksiyonu</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Email adresi kontrolü için pek çok fonksiyon yazılmıştır. Bunları internette kolayca bulabilirsiniz. Fakat bu fonksiyonlar ne kadar doğru çalışıyor? <a href="http://fightingforalostcause.net/misc/2006/compare-email-regex.php" target="_blank">&#8216;Comparing E-mail Address Validating Regular Expressions&#8217;</a> isimli yazıda vakti bol saygıdeğer bir arkadaşımız &#8216;Regular Expression&#8217; ile yapılan 13 adet e-posta doğrulamasını sistemli bir şekilde test etmiş, hangisinin nerede doğru, nerede yanlış çalıştığını güzel bir şekilde listelemiş. Bu testlere göre mükemmel doğrulukta çalışan bir metot bulamamış ama <a href="http://kohanaphp.com/" target="_blank">Kohana project</a>&#8216;ten Geert De Deckere tarafından geliştirilen aşağıda göreceğiniz &#8216;regular expression&#8217;ı en başarılı olarak seçmiş. Bu regex&#8217;te eksik olan 2 nokta bulmuş. Bu iki noktasizin için problem çıkarmayacaktır. Detayları yukarıda verdiğim adreste bulabilirsiniz. Aşağıda bu regex&#8217;in fonksiyon haline getirilmiş halini bulabilirsiniz.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
* Eposta adresinin gecerli olup olmadigini kontrol eder.
* @param $eposta
* @return bool eposta gecerli ise 'true', degilse 'false' dondurur.
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> epostaDogrumu<span style="color: #009900;">&#40;</span><span style="color: #000088;">$eposta</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span>bool<span style="color: #009900;">&#41;</span> <span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/^[-_a-z0-9\'+*$^&amp;%=~!?{}]++(?:\.[-_a-z0-9\'+*$^&amp;%=~!?{}]+)*+@(?:(?![-.])[-a-z0-9.]+(?&lt;![-.])\.[a-z]{2,6}|\d{1,3}(?:\.\d{1,3}){3})(?::\d++)?$/iD'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$eposta</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>



<p>İlgili Yazılar:<ol><li><a href='http://www.gudubeth.net/tr/yazi/php-ile-dizin-silme-fonksiyonu/' rel='bookmark' title='Permanent Link: PHP ile dizin silme fonksiyonu'>PHP ile dizin silme fonksiyonu</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gudubeth.net/tr/yazi/php-e-posta-adresi-dogrulama-fonksiyonu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP&#8217;de Tarih ve Saat Farkı Hesaplama</title>
		<link>http://www.gudubeth.net/tr/yazi/php-tarih-ve-saat-farki-hesaplama/</link>
		<comments>http://www.gudubeth.net/tr/yazi/php-tarih-ve-saat-farki-hesaplama/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 09:44:06 +0000</pubDate>
		<dc:creator>Gudubeth</dc:creator>
				<category><![CDATA[Programlama]]></category>
		<category><![CDATA[hazır kod]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tarih-saat fonksiyonları]]></category>

		<guid isPermaLink="false">http://www.gudubeth.net/tr/?p=173</guid>
		<description><![CDATA[For english: Date &#038; Time Difference in PHP
İki tarih arasındaki farkı hesaplamak için PHP&#8217;de date_diff diye bir fonksiyon bulunmakta ama ne yazık ki bu fonksiyon PHP&#8217;nin sadece 5.3 ve sonraki versiyonlarında çalışıyor. Dolayısıyla pek çok kişi için tarih-saat farkı hesaplayan bir fonksiyona ihtiyaç var. Bu sayfada bu işi yapan bir fonksiyon bulacaksınız. Aradığınız sadece Türkçe [...]


İlgili Yazılar:<ol><li><a href='http://www.gudubeth.net/tr/yazi/php-turkce-tarih/' rel='bookmark' title='Permanent Link: PHP ile Türkçe Tarih Gösterimi-Çevrimi'>PHP ile Türkçe Tarih Gösterimi-Çevrimi</a></li><li><a href='http://www.gudubeth.net/tr/yazi/phpde-gun-once-seklinde-bagil-tarih-yazma/' rel='bookmark' title='Permanent Link: PHP&#8217;de &#8220;&#8230; gün önce&#8221; Şeklinde Bağıl Tarih Yazma'>PHP&#8217;de &#8220;&#8230; gün önce&#8221; Şeklinde Bağıl Tarih Yazma</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>For english: <a href="http://www.gudubeth.net/en/articles/date-time-difference-in-php">Date &#038; Time Difference in PHP</a></p>
<p>İki tarih arasındaki farkı hesaplamak için PHP&#8217;de date_diff diye bir fonksiyon bulunmakta ama ne yazık ki bu fonksiyon PHP&#8217;nin sadece 5.3 ve sonraki versiyonlarında çalışıyor. Dolayısıyla pek çok kişi için tarih-saat farkı hesaplayan bir fonksiyona ihtiyaç var. Bu sayfada bu işi yapan bir fonksiyon bulacaksınız. Aradığınız sadece Türkçe tarih &#038; saat göstermek ise şu yazıya bakınız: <a href="http://www.gudubeth.net/tr/yazi/php-turkce-tarih/">PHP ile Türkçe Tarih Gösterimi-Çevrimi</a> </p>
<h2>Kullanım</h2>
<p>Fonksiyon 3 adet değişken alıyor. Bunlardan sadece birincisi zorunlu.<br />
<strong>dateDiff($d1[, $d2=null [, $format="*"]);</strong></p>
<p>İlk iki parametre olarak farkı alınacak tarih ve/veya saatleri giriyorsunuz. Tarih formatı olarak Unix zaman damgası veya &#8216;<em>strtotime</em>&#8216; fonksiyonunun kabul ettiği herhangi bir değer kullanılabilir. Dolayısıyla tarih girmek için &#8216;<em>time()</em>&#8216; fonksiyonun ya da acayip bir format kullanmıyorsanız <strong>MySQL </strong>verilerini doğrudan kullanabilirsiniz. &#8216;<em>strtotime</em>&#8216; fonksiyonunu kabul ettiği değerler ile ilgili <a href="http://tr.php.net/manual/en/function.strtotime.php" target="_blank">php.net strtotime</a> sayfasına bakabilirsiniz. Girilen zamanların hangisinin büyük olduğu önemli değil. Yani <em>tarihFarki(&#8217;12-03-2009&#8242;, &#8216;01-01-2010&#8242;)</em> ve <em>tarihFarki(&#8217;01-01-2010&#8242;, &#8216;12-03-2009&#8242;)</em> size aynı sonuçları getirecektir. Son parametre olan <strong>$format</strong> sonucun hangi şekilde döndürüleceğini belirler. <strong>$format</strong> olarak &#8220;saniye&#8221;, &#8220;dakika&#8221;, &#8220;saat&#8221;, &#8220;gun&#8221;, &#8220;hafta&#8221;, &#8220;ay&#8221;, &#8220;yil&#8221; veya &#8220;*&#8221; değerlerinden birisini girebilirsiniz. &#8220;*&#8221; dışındaki seçeneklerde fonksiyon size belirtilen formatta bir sayı döndürecekir. Yani <em>tarihFarki(&#8217;2010-01-02&#8242;, &#8216;2010-01-01&#8242;, &#8216;gun&#8217;)</em> yazarsanız alacağınız sonuç &#8216;1&#8242;, <em>tarihFarki(&#8217;2010-01-02&#8242;, &#8216;2010-01-01&#8242;, &#8216;dakika&#8217;)</em> yazarsanız &#8216;86400&#8242; (bir gündeki dakika sayısı) olur. Eğer <strong>$format</strong> olarak &#8220;*&#8221; girerseniz ya da bu alanı hiç kullanmazsanız fonksiyon yukarıda geçen tüm değerleri içeren bir dizi döndürür. </p>
<h2>Örnekler</h2>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Şu an:&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;r&quot;</span><span style="color: #339933;">,</span><span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;1: &quot;</span><span style="color: #339933;">.</span>tarihFarki<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;20090401040302&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;ay&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; ay&lt;br&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;2: &quot;</span><span style="color: #339933;">.</span>tarihFarki<span style="color: #009900;">&#40;</span><span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;2009-07-23 04:00:00&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;saat&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; saat&lt;br&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;3: &quot;</span><span style="color: #339933;">.</span>tarihFarki<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;-3 day&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;2009-07-23 04:00:00&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;gun&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; gun&lt;br&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;4: &quot;</span><span style="color: #339933;">.</span>tarihFarki<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;2008-06-23&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;2009-07-23&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;yil&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; yıl&lt;br&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$t</span><span style="color: #339933;">=</span>tarihFarki<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;2008-06-23&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;2009-07-23&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;5: &quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$t</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;br&gt;&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>Kod</h2>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * Iki tarih arasindaki farki bulur.&lt;br&gt;
 * &lt;strong&gt;kullanim:&lt;/strong&gt; dateDiff($d1[, $d2=null [, $format=&quot;*&quot;]);&lt;br&gt;
 * &lt;strong&gt;ornek:&lt;/strong&gt;&lt;br&gt;
 * echo &quot;şu an:&quot;.date(&quot;r&quot;,time()).&quot;&lt;br&gt;&quot;;
 * echo &quot;1: &quot;.tarihFarki(&quot;20090401040302&quot;, time(), &quot;ay&quot;).&quot; ay&lt;br&gt;&quot;;
 * echo &quot;2: &quot;.tarihFarki(time(), &quot;2009-07-23 04:00:00&quot;, &quot;saat&quot;).&quot; saat&lt;br&gt;&quot;;
 * echo &quot;3: &quot;.tarihFarki(&quot;-3 day&quot;, &quot;2009-07-23 04:00:00&quot;, &quot;gun&quot;).&quot; gun&lt;br&gt;&quot;;
 * echo &quot;4: &quot;.tarihFarki(&quot;2008-06-23&quot;, &quot;2009-07-23&quot;, &quot;yil&quot;).&quot; yıl&lt;br&gt;&quot;;
 * $t=tarihFarki(&quot;2008-06-23&quot;, &quot;2009-07-23&quot;);
 * echo &quot;5: &quot;; print_r($t);
 *
 * @param mixed $d1     ilk tarih. unix zaman damgasi ya da strtome 
 *                      fonsksiyonunun kabul ettigi herhangi bir deger olabilir. 
 *                      ornek: '2009-05-23', '2009-05-23 12:10:04', '-2 day',
 *                      '23-05-2009 12:23', '20090523121004'
 * @param mixed $d2     ikinci tarih. ilkiyle ayni ozellikleri tasir. eger 
 *                      girilmez ya da bos bir deger olarak girilirse o anki 
 *                      tarih olarak alinir. bu iki tarih arasinda 
 *                      hangisinin buyuk hangisinin kucuk oldugu onemli degildir.
 *                      ikisi de ayni sonuc verir.
 * @param str $format   &quot;saniye&quot;, &quot;dakika&quot;, &quot;saat&quot;, &quot;gun&quot;, &quot;hafta&quot;, &quot;ay&quot;, 
 *                      &quot;gun&quot;, &quot;*&quot;.
 *                      eger girilmez ya da &quot;*&quot; olarak girilirse yukaridaki 
 *                      butun degerleri iceren bir dizi dondurur. belirtilen 
 *                      diger degerlerden birisi girilirse bu tipte bir sayi 
 *                      dondurur.
 * @return mixed        sayi ya da dizi tipinde tarihler arasindaki farki 
 *                      dondurur. dizinin icinde bulunan  degiskenler 
 *                      sunlardir: &quot;saniye&quot;, &quot;dakika&quot;, &quot;saat&quot;, &quot;gun&quot;, &quot;hafta&quot;, 
 *                      &quot;ay&quot;, &quot;gun&quot; olacaktir.
 */</span>
<span style="color: #000000; font-weight: bold;">function</span> tarihFarki<span style="color: #009900;">&#40;</span><span style="color: #000088;">$d1</span><span style="color: #339933;">,</span> <span style="color: #000088;">$d2</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #000088;">$format</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;*&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$d2</span><span style="color: #339933;">==</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$d2</span><span style="color: #339933;">=</span><span style="color: #000088;">$d1</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$d1</span><span style="color: #339933;">=</span><span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_int</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$d1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$d1</span><span style="color: #339933;">=</span><span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$d1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_int</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$d2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$d2</span><span style="color: #339933;">=</span><span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$d2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$d</span><span style="color: #339933;">=</span><span style="color: #990000;">abs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$d1</span><span style="color: #339933;">-</span><span style="color: #000088;">$d2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$format</span><span style="color: #339933;">=</span><span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$format</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;*&quot;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;*&quot;</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$format</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;gun&quot;</span><span style="color: #009900;">&#41;</span>    <span style="color: #000088;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;gun&quot;</span><span style="color: #009900;">&#93;</span>   <span style="color: #339933;">=</span> <span style="color: #990000;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$d</span><span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">24</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;*&quot;</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$format</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;ay&quot;</span><span style="color: #009900;">&#41;</span>     <span style="color: #000088;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;ay&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$d</span><span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">24</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">30</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;*&quot;</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$format</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;yil&quot;</span><span style="color: #009900;">&#41;</span>    <span style="color: #000088;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;yil&quot;</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #990000;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$d</span><span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">24</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">365</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;*&quot;</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$format</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;hafta&quot;</span><span style="color: #009900;">&#41;</span>  <span style="color: #000088;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;hafta&quot;</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #990000;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$d</span><span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">24</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">7</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;*&quot;</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$format</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;saat&quot;</span><span style="color: #009900;">&#41;</span>   <span style="color: #000088;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;saat&quot;</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #990000;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$d</span><span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">60</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;*&quot;</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$format</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;dakika&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;dakika&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span> <span style="color: #990000;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$d</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">60</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #339933;">!=</span><span style="color: #0000ff;">&quot;*&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000088;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$format</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">return</span> <span style="color: #000088;">$result</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>



<p>İlgili Yazılar:<ol><li><a href='http://www.gudubeth.net/tr/yazi/php-turkce-tarih/' rel='bookmark' title='Permanent Link: PHP ile Türkçe Tarih Gösterimi-Çevrimi'>PHP ile Türkçe Tarih Gösterimi-Çevrimi</a></li><li><a href='http://www.gudubeth.net/tr/yazi/phpde-gun-once-seklinde-bagil-tarih-yazma/' rel='bookmark' title='Permanent Link: PHP&#8217;de &#8220;&#8230; gün önce&#8221; Şeklinde Bağıl Tarih Yazma'>PHP&#8217;de &#8220;&#8230; gün önce&#8221; Şeklinde Bağıl Tarih Yazma</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gudubeth.net/tr/yazi/php-tarih-ve-saat-farki-hesaplama/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP ile dizin silme fonksiyonu</title>
		<link>http://www.gudubeth.net/tr/yazi/php-ile-dizin-silme-fonksiyonu/</link>
		<comments>http://www.gudubeth.net/tr/yazi/php-ile-dizin-silme-fonksiyonu/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 22:09:30 +0000</pubDate>
		<dc:creator>Gudubeth</dc:creator>
				<category><![CDATA[Programlama]]></category>
		<category><![CDATA[dosya işlemleri]]></category>
		<category><![CDATA[hazır kod]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.gudubeth.net/tr/?p=161</guid>
		<description><![CDATA[Asağıdaki fonksiyon ile bir dizindeki dosyaları silebilirsiniz. Fonksiyon ihtiyacınıza göre farklı şekillerde çalışabilir. Bir dizini alt dizinleriyle birlikte silebilirsiniz, dosya silerken &#8216;regular expression&#8217; kullanıp dosya adına göre silme işlemi yapabilirsiniz, dizinin sadece içeriğini silebilirsiniz. Aşağıda gerekli bilgileri ve kullanım örneklerini PHPDoc şeklinde türkçe olarak yazdım.
(Click for english: Remove a Directory and Its Content with PHP)

/**
 [...]


İlgili Yazılar:<ol><li><a href='http://www.gudubeth.net/tr/yazi/php-e-posta-adresi-dogrulama-fonksiyonu/' rel='bookmark' title='Permanent Link: PHP E-posta Adresi Doğrulama Fonksiyonu'>PHP E-posta Adresi Doğrulama Fonksiyonu</a></li><li><a href='http://www.gudubeth.net/tr/yazi/php-tarih-ve-saat-farki-hesaplama/' rel='bookmark' title='Permanent Link: PHP&#8217;de Tarih ve Saat Farkı Hesaplama'>PHP&#8217;de Tarih ve Saat Farkı Hesaplama</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Asağıdaki fonksiyon ile bir dizindeki dosyaları silebilirsiniz. Fonksiyon ihtiyacınıza göre farklı şekillerde çalışabilir. Bir dizini alt dizinleriyle birlikte silebilirsiniz, dosya silerken &#8216;regular expression&#8217; kullanıp dosya adına göre silme işlemi yapabilirsiniz, dizinin sadece içeriğini silebilirsiniz. Aşağıda gerekli bilgileri ve kullanım örneklerini PHPDoc şeklinde türkçe olarak yazdım.</p>
<p>(Click for english: <a href="http://www.gudubeth.net/en/articles/remove-directory-with-php">Remove a Directory and Its Content with PHP</a>)</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * bir dizin/klasör icindeki dosyalari siler.
 * kullanim sekli:
 * dizinSil(string $dizin [, bool $dizininKendisiniSil=true 
 *                      [, bool $altDizinleriSil=true 
 *                      [, string $regEx='/.* /']]]); 
 * 
 * kullanim ornekleri:
 * dizinSil('/home/gudubeth/resimler');
 *      //dizin icindeki dosyalari, alt dizinleri ve dizinin kendisi siler
 * dizinSil('/home/gudubeth/resimler', false);
 *      //sadece dizinin icerigini siler. alt dizinler silinir
 * dizinSil('/home/gudubeth/resimler', false, false);
 *      //sadece dizinin icerigini siler. alt dizinler silinMEZ
 * dizinSil('/home/gudubeth/resimler', false, true, '/.*\.jpg/');
 *      //dizin ve altdizinlerdeki jpg uzantili dosyalari siler.
 *
 * @param str $dizin
 *                      dizinin yeri. ornek: /home/guest/temp
 *                      veya c:/appserv/www/tmp
 * @param bool $dizininKendisiniSil
 *                      eger 'true' ise dizinin kendisini siler.
 *                      degil ise sadece dizin icerigi silinir.
 *                      varsayilan deger: 'true'
 * @param bool $altDizinleriSil
 *                      'true' ise yinelemeli (rekursif) calisip
 *                      alt dizinleri de siler.
 *                      varsayilan deger: 'true'
 * @param str $regEx
 *                      sadece $regEx ile secilen dosyalari siler.
 *                      regEx fonksiyonu olarak preg_match kullanilir.
 *                      varsayilan deger: '/.* /' (yani tum dosyalari sil).
 *                      ornek degerler:
 *                          mp3 uzantili dosyalari sil: '/.*\.mp3/'
 *                          adi a ile baslayan dosyalari sil: '/a.* /'
 *                          adinda 'tmp' gecen dosylari sil: '/.*tmp.* /'
 *
 * @return  bool        eger denenen her dosya silindiyse veya silinecek bir
 *                      dosya bulunamadiysa 'true' degerini dondurur.
 *                      Dosya silme islemlerinden herhnagi birisi hatali ise
 *                      'false' dondurur.
 * */</span>
<span style="color: #000000; font-weight: bold;">function</span> dizinSil<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dizin</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dizininKendisiniSil</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #000088;">$altDizinleriSil</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #000088;">$regEx</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/.*/&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$dh</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">opendir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dizin</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$sonuc</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dosya</span><span style="color: #339933;">=</span><span style="color: #990000;">readdir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dh</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">!==</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dosya</span><span style="color: #339933;">!=</span><span style="color: #0000ff;">'.'</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$dosya</span><span style="color: #339933;">!=</span><span style="color: #0000ff;">'..'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">is_dir</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$dizin</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$dosya</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$altDizinleriSil</span><span style="color: #009900;">&#41;</span>
                <span style="color: #000088;">$sonuc</span> <span style="color: #339933;">=</span> dizinSil<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dizin</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$dosya</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #000088;">$regEx</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$sonuc</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$regEx</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dosya</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                <span style="color: #000088;">$sonuc</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">unlink</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dizin</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$dosya</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$sonuc</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #990000;">closedir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dh</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dizininKendisiniSil</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$sonuc</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">rmdir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dizin</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$sonuc</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$sonuc</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>



<p>İlgili Yazılar:<ol><li><a href='http://www.gudubeth.net/tr/yazi/php-e-posta-adresi-dogrulama-fonksiyonu/' rel='bookmark' title='Permanent Link: PHP E-posta Adresi Doğrulama Fonksiyonu'>PHP E-posta Adresi Doğrulama Fonksiyonu</a></li><li><a href='http://www.gudubeth.net/tr/yazi/php-tarih-ve-saat-farki-hesaplama/' rel='bookmark' title='Permanent Link: PHP&#8217;de Tarih ve Saat Farkı Hesaplama'>PHP&#8217;de Tarih ve Saat Farkı Hesaplama</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gudubeth.net/tr/yazi/php-ile-dizin-silme-fonksiyonu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP ile Türkçe Tarih Gösterimi-Çevrimi</title>
		<link>http://www.gudubeth.net/tr/yazi/php-turkce-tarih/</link>
		<comments>http://www.gudubeth.net/tr/yazi/php-turkce-tarih/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 23:21:12 +0000</pubDate>
		<dc:creator>Gudubeth</dc:creator>
				<category><![CDATA[Programlama]]></category>
		<category><![CDATA[hazır kod]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tarih-saat fonksiyonları]]></category>

		<guid isPermaLink="false">http://www.gudubeth.net/tr/?p=147</guid>
		<description><![CDATA[Kolaylıkların dili PHP ile tarih formatlamak gerçekten kolay bir iş ama sadece ingilizce siteler için. İngilizce bir sitede tarih göstermek için tek ihtiyacınız &#8216;date&#8216; fonksiyonu. İlk parametre olarak gireceğiniz belirli karakterlerle tarihi istediğiniz gibi gösterebilirsiniz. Mesela &#8216;January 12, 2009&#8216; yazdırmak için &#8216;echo date(&#8221;F j, Y&#8221;)&#8216; yazmanız yeterli olacaktır. 
Türkçe Tarih &#038; Saat Fonksiyonu
Tarih ve saat [...]


İlgili Yazılar:<ol><li><a href='http://www.gudubeth.net/tr/yazi/php-tarih-ve-saat-farki-hesaplama/' rel='bookmark' title='Permanent Link: PHP&#8217;de Tarih ve Saat Farkı Hesaplama'>PHP&#8217;de Tarih ve Saat Farkı Hesaplama</a></li><li><a href='http://www.gudubeth.net/tr/yazi/phpde-gun-once-seklinde-bagil-tarih-yazma/' rel='bookmark' title='Permanent Link: PHP&#8217;de &#8220;&#8230; gün önce&#8221; Şeklinde Bağıl Tarih Yazma'>PHP&#8217;de &#8220;&#8230; gün önce&#8221; Şeklinde Bağıl Tarih Yazma</a></li><li><a href='http://www.gudubeth.net/tr/yazi/java-ve-mysqlde-turkce-karakter-sorunu/' rel='bookmark' title='Permanent Link: Java ve MySQL&#8217;de Türkçe Karakter Sorunu'>Java ve MySQL&#8217;de Türkçe Karakter Sorunu</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Kolaylıkların dili <strong>PHP </strong>ile<strong> tarih formatlamak</strong> gerçekten kolay bir iş ama sadece ingilizce siteler için. İngilizce bir sitede tarih göstermek için tek ihtiyacınız &#8216;<em>date</em>&#8216; fonksiyonu. İlk parametre olarak gireceğiniz belirli karakterlerle tarihi istediğiniz gibi gösterebilirsiniz. Mesela &#8216;<em>January 12, 2009</em>&#8216; yazdırmak için &#8216;<em>echo date(&#8221;F j, Y&#8221;)</em>&#8216; yazmanız yeterli olacaktır. </p>
<h2>Türkçe Tarih &#038; Saat Fonksiyonu</h2>
<p>Tarih ve saat gösterimini en basit şekilde halledebilmeniz için aşağıdaki göreceğiniz fonksiyonu kullanabilirsiniz. Fonksiyonun çalışma prensibi çok basit: <em>date</em> fonksiyonunu çağırıp aldığı çıktıdaki ingilizce kelimeleri türkçeye çeviriyor. Fonksiyonun dışında kalan diziler de bu çevrimler için zaten. Doğrudan date fonksiyonu kullanıldığı için aldığı parametreler temelde date ile aynı. Sadece işleri biraz daha kolaylaştırmak için bu parametrelerin yeteneklerini arttırdım. Şöyle ki: tarih formatının belirlendiği ilk parametrede ay, gün, yıl gibi türkçe kelimeler; gösterilecek tarihin belirlendiği ikinci parametrede ise tek bir tane yerine çok daha çeşitli formatlarda tarihler kullabiliyorsunuz. Basitçe örneklersek, <em>date(&#8221;d F Y&#8221;)</em> fonksiyonunu <em>tarih(&#8221;d F Y&#8221;)</em> şeklinde yazabileceğiniz gibi<em> tarih(&#8221;gun ay yil&#8221;) </em>şeklinde de yazabilirsiniz (çıktısı &#8216;17 Mayıs 2009&#8242; gibi birşey olacaktır).</p>
<h3>Tanımlama:</h3>
<p><em>tarih($format, [$zaman]);</em><br />
$zaman ile belirtilen zamanı ilk parametrede belirtilen formatta biçimlendirir. $zaman parametresi girilmemişse çalışma zamanındaki zaman kullanılır.</p>
<h3>Parametreler:</h3>
<h4>$format</h4>
<p>Biçilendirilecek tarihin formatı. String içerisine yazılan format bilgilerinden oluşur (&#8221;d-F-Y&#8221; gibi). date fonksiyonunda kullanılan seçeneklerin hepsi bu değişken için de geçerlidir. <a href="http://www.php.net/manual/tr/function.date.php">php.net:date fonksiyonu</a> adresinde detaylı seçenekleri görebilirsiniz. Bu sayfada belirtilen seçeneklerin yanı sıra aşağıda belirtilen türkçe değerler de kullanılabilir.</p>
<table border="0">
<thead>
<th>Biçim</th>
<th>Açıklama</th>
<th>Örnek sonuç</th>
</thead>
<tbody>
<tr>
<td>gun</td>
<td>Ay günlerinin sıfır dolgulu iki haneli gösterimi</td>
<td>01&#8242;den 31&#8242;e</td>
</tr>
<tr>
<td>kisagun</td>
<td>Ay günlerinin sıfır dolgusuz gösterimi</td>
<td>1&#8242;den 31&#8242;e</td>
</tr>
<tr>
<td>hgun</td>
<td>Hafta günlerinin tam metinsel gösterimi</td>
<td>Pazar&#8217;dan Cumartesi&#8217;ye</td>
</tr>
<tr>
<td>hgunkisa</td>
<td>Ay günlerinin iki harfli metinsel gösterimi</td>
<td>Pzt&#8217;den Paz&#8217;a</td>
</tr>
<tr>
<td>ay</td>
<td>Ayın tam metinsel gösterimi, Ocak ya da Mart gibi</td>
<td>Ocak&#8217;tan Aralık&#8217;a</td>
</tr>
<tr>
<td>kisaay</td>
<td>Ayın üç karakterli, metinsel kısa gösterimi</td>
<td>Oca&#8217;dan Ara&#8217;ya kadar</td>
</tr>
<tr>
<td>aysayi</td>
<td>Ayın sıfır dolgulu sayısal gösterimi</td>
<td>01&#8242;den 12&#8242;ye</td>
</tr>
<tr>
<td>kisaaysayi</td>
<td>Ayın sıfır dolgusuz sayısal gösterimi</td>
<td>1&#8242;den 12&#8242;ye kadar</td>
</tr>
<tr>
<td>yil</td>
<td>Yılın 4 haneli sayısal, tam gösterimi</td>
<td>1999 ya da 2003 gibi</td>
</tr>
<tr>
<td>kisayil</td>
<td>Yılın iki haneli gösterimi</td>
<td>99 ya da 03 gibi</td>
</tr>
<tr>
<td>saat</td>
<td>Saatin, 24-saatlik sıfır dolgulu gösterimi</td>
<td>00&#8242;dan 23&#8242;e</td>
</tr>
<tr>
<td>kisasaat</td>
<td>Saatin, 12-saatlik sıfır dolgulu gösterimi</td>
<td>01&#8242;den 12&#8242;ye</td>
</tr>
<tr>
<td>dakika</td>
<td>Sıfır dolgulu dakika gösterimi</td>
<td>00 ile 59 arasında</td>
</tr>
<tr>
<td>saniye</td>
<td>Sıfır dolgulu saniye gösterimi</td>
<td>00 ile 59 arasında</td>
</tr>
</tbody>
</table>
<table border="0">
<thead>
<th>Örnek format</th>
<th>Örnek sonuç</th>
</thead>
<tbody>
<tr>
<td>&#8220;ay, yil&#8221;</td>
<td>Ocak, 2010</td>
</tr>
<tr>
<td>&#8220;kisagun ay, hgun&#8221;</td>
<td>7 Ocak, Pazartesi</td>
</tr>
<tr>
<td>&#8220;gun-aysayi-kisayil saat:dakika:saniye&#8221;</td>
<td>07-01-10 12:10:54</td>
</tr>
</tbody>
</table>
<h4>$zaman:</h4>
<p>Biçimlendirilecek zamanı belirtir. Eğer girilmemişse o anki zaman kullanılır. $zaman değeri strtotime fonksiyonun kabul ettiği tüm değerler olabilir. MySQL veritabanından aldığınız değerleri doğrudan kullanabilirsiniz. Aşağıda bu parametrenin alabileceği bazı değerler örneklenmiştir:<br />
&#8220;31-12-2009 13:23:10&#8243;<br />
&#8220;2009-12-31 13:23:10&#8243;<br />
&#8220;31-12-2009&#8243;<br />
&#8220;3 gun once&#8221;<br />
&#8220;-3 gun&#8221;<br />
&#8220;+5 gun&#8221;<br />
&#8220;2 yil sonra&#8221;</p>
<h4>Kullanım Örnekleri</h4>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> tarih<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;gun/ay/yil saat:dakika:saniye&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;; &quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// çıktısı: 30/Aralık/2009 01:06:58;</span>
<span style="color: #b1b100;">echo</span> tarih<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;gun-ay-yil, hgun saat:dakika&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;3 gun once&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;; &quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// çıktısı: 27-Aralık-2009, Pazar 01:06;</span>
<span style="color: #b1b100;">echo</span> tarih<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;kisagun-kisaaysayi-kisayil, hgun saat:dakika&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;+2 ay&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;; &quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// çıktısı: 2-3-10, Salı 01:08;</span>
<span style="color: #b1b100;">echo</span> tarih<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;yil.ay.gun saat:dakika:saniye&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;2009-12-20 12:10:23&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;; &quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// çıktısı: 2009.Aralık.20 12:10:23;</span>
<span style="color: #b1b100;">echo</span> tarih<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;gun ay yil saat:dakika&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;20081118100630&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// çıktısı: 18 Kasım 2008 10:06</span></pre></div></div>

<h4>Kod</h4>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$aylarIng</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;January&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;February&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;March&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;April&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;May&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;June&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;July&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;August&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;September&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;October&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;November&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;December&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$aylarKisaIng</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Jan&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Feb&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Mar&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Apr&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;May&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Jun&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Jul&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Aug&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Sep&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Oct&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Nov&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Dec&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$gunlerIng</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Monday&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Tuesday&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Wednesday&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Thursday&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Friday&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Saturday&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Sunday&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$gunlerKisaIng</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Mon&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Tue&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Wed&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Thu&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Fri&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Sat&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Sun&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$aylar</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Ocak&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Şubat&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Mart&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Nisan&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Mayıs&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Haziran&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Temmuz&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Ağustos&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Eylül&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Ekim&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Kasım&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Aralık&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$aylarKisa</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Oca&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Şub&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Mar&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Nis&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;May&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Haz&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Tem&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Ağu&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Eyl&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Eki&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Kas&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Ara&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$gunler</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Pazartesi&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Salı&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Çarşamba&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Perşembe&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Cuma&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Cumartesi&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Pazar&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$gunlerKisa</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Pt&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Sa&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Ça&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Pe&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Cu&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Ct&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Pa&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * tarihi turkceye cevirir. tarih temelde date fonksiyonu ile olusturulur.
 * $zaman ise strtotime ile timestamp'e cevrilir. $format'in kullanımi
 * date fonksiyonunda oldugu gibidir. ayni sekilde  $zaman'in alacagi degerler
 * strtotime fonksiyonuna uygun secilebilir.
 *
 * @global array    $aylarIng, $aylar, $gunlerIng, $gunler, $aylarKisaIng,
 *                      $aylarKisa, $gunlerKisaIng, $gunlerKisa
 * @param str       $format
 * @param str/int   $zaman
 * @return str
 */</span>
<span style="color: #000000; font-weight: bold;">function</span> tarih<span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #339933;">,</span> <span style="color: #000088;">$zaman</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$zaman</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$zaman</span><span style="color: #339933;">=</span><span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$zaman</span><span style="color: #339933;">=</span><span style="color: #990000;">str_ireplace</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;once&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;ay&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;gun&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;yil&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;dakika&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;saniye&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;hafta&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
                           <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ago&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;month&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;day&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;year&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;minute&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;second&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;week&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$zaman</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$zaman</span><span style="color: #339933;">=</span><span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$zaman</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000088;">$format</span><span style="color: #339933;">=</span><span style="color: #990000;">str_ireplace</span><span style="color: #009900;">&#40;</span>
        <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;kisaaysayi&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;kisaay&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;aysayi&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;kisagun&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;hgunkisa&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;hgun&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;gun&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;kisayil&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;yil&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;kisasaat&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;saat&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;dakika&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;saniye&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;ay&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;n&quot;</span><span style="color: #339933;">,</span>         <span style="color: #0000ff;">&quot;M&quot;</span><span style="color: #339933;">,</span>     <span style="color: #0000ff;">&quot;m&quot;</span><span style="color: #339933;">,</span>     <span style="color: #0000ff;">&quot;j&quot;</span><span style="color: #339933;">,</span>      <span style="color: #0000ff;">&quot;D&quot;</span><span style="color: #339933;">,</span>       <span style="color: #0000ff;">&quot;l&quot;</span><span style="color: #339933;">,</span>   <span style="color: #0000ff;">&quot;d&quot;</span><span style="color: #339933;">,</span>  <span style="color: #0000ff;">&quot;y&quot;</span><span style="color: #339933;">,</span>      <span style="color: #0000ff;">&quot;Y&quot;</span><span style="color: #339933;">,</span>  <span style="color: #0000ff;">&quot;h&quot;</span><span style="color: #339933;">,</span>       <span style="color: #0000ff;">&quot;H&quot;</span><span style="color: #339933;">,</span>   <span style="color: #0000ff;">&quot;i&quot;</span><span style="color: #339933;">,</span>     <span style="color: #0000ff;">&quot;s&quot;</span><span style="color: #339933;">,</span>      <span style="color: #0000ff;">&quot;F&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #000088;">$format</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$tarihStr</span><span style="color: #339933;">=</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #339933;">,</span> <span style="color: #000088;">$zaman</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;F&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">!==</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$aylarIng</span><span style="color: #339933;">,</span> <span style="color: #000088;">$aylar</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$tarihStr</span><span style="color: #339933;">=</span><span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$aylarIng</span><span style="color: #339933;">,</span> <span style="color: #000088;">$aylar</span><span style="color: #339933;">,</span> <span style="color: #000088;">$tarihStr</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;l&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">!==</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$gunlerIng</span><span style="color: #339933;">,</span> <span style="color: #000088;">$gunler</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$tarihStr</span><span style="color: #339933;">=</span><span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$gunlerIng</span><span style="color: #339933;">,</span> <span style="color: #000088;">$gunler</span><span style="color: #339933;">,</span> <span style="color: #000088;">$tarihStr</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;M&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">!==</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$aylarKisaIng</span><span style="color: #339933;">,</span> <span style="color: #000088;">$aylarKisa</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$tarihStr</span><span style="color: #339933;">=</span><span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$aylarKisaIng</span><span style="color: #339933;">,</span> <span style="color: #000088;">$aylarKisa</span><span style="color: #339933;">,</span> <span style="color: #000088;">$tarihStr</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;D&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">!==</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$gunlerKisaIng</span><span style="color: #339933;">,</span> <span style="color: #000088;">$gunlerKisa</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$tarihStr</span><span style="color: #339933;">=</span><span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$gunlerKisaIng</span><span style="color: #339933;">,</span> <span style="color: #000088;">$gunlerKisa</span><span style="color: #339933;">,</span> <span style="color: #000088;">$tarihStr</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$tarihStr</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><strong>Kaynaklar:</strong><br />
<a href="http://www.php.net/manual/tr/function.date.php" target="blank">&#8216;date&#8217; fonksiyonu</a></p>
<h2>SetLocale ile Türkçe Tarih&#038;Saat</h2>
<p>Aslında <em>strftime</em> fonksiyonunu kullanarak da türkçe tarih gösterebiliyorsunuz. Fakat bunun için sunucunun bölgesel ayarlarının türkçe olacak şekilde değiştirilmiş olması gerekiyor. Bu ayar yapılamamış olsa bile eğer sunucunuz buna izin veriyorsa PHP kodunuzun başına bir yerlere<br />
setlocale(LC_TIME, &#8216;tr_TR&#8217;);<br />
satırını ekleyerek bölgesel ayarları türkçeye uygun hale getirebilirsiniz. Test için şu php kodunu suncunuzda çalıştırınız:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">setlocale</span><span style="color: #009900;">&#40;</span>LC_TIME<span style="color: #339933;">,</span> <span style="color: #0000ff;">'tr_TR'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #990000;">strftime</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%A, %d. %B %Y'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Eğer &#8216;Salı, 05. Ocak 2010&#8242; gibi bir sonuç alıyorsanız bu yöntemi kullanabilirsiniz. </p>
<p><strong>Kaynaklar:</strong><br />
<a href="http://www.php.net/manual/tr/function.strftime.php" target="blank">&#8217;strftime&#8217; fonksiyonu</a><br />
<a href="http://www.php.net/manual/tr/function.setlocale.php" target="blank">&#8217;setlocale&#8217; fonksiyonu</a></p>


<p>İlgili Yazılar:<ol><li><a href='http://www.gudubeth.net/tr/yazi/php-tarih-ve-saat-farki-hesaplama/' rel='bookmark' title='Permanent Link: PHP&#8217;de Tarih ve Saat Farkı Hesaplama'>PHP&#8217;de Tarih ve Saat Farkı Hesaplama</a></li><li><a href='http://www.gudubeth.net/tr/yazi/phpde-gun-once-seklinde-bagil-tarih-yazma/' rel='bookmark' title='Permanent Link: PHP&#8217;de &#8220;&#8230; gün önce&#8221; Şeklinde Bağıl Tarih Yazma'>PHP&#8217;de &#8220;&#8230; gün önce&#8221; Şeklinde Bağıl Tarih Yazma</a></li><li><a href='http://www.gudubeth.net/tr/yazi/java-ve-mysqlde-turkce-karakter-sorunu/' rel='bookmark' title='Permanent Link: Java ve MySQL&#8217;de Türkçe Karakter Sorunu'>Java ve MySQL&#8217;de Türkçe Karakter Sorunu</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gudubeth.net/tr/yazi/php-turkce-tarih/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux Komut Satırı: 10 soru, 10 cevap #1</title>
		<link>http://www.gudubeth.net/tr/yazi/linux-komut-satiri-10-soru-10-cevap-1/</link>
		<comments>http://www.gudubeth.net/tr/yazi/linux-komut-satiri-10-soru-10-cevap-1/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 22:25:14 +0000</pubDate>
		<dc:creator>Gudubeth</dc:creator>
				<category><![CDATA[Genel]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.gudubeth.net/tr/?p=132</guid>
		<description><![CDATA[Linux uzmanı olmak bir yana, linux komut satırını doğru düzgün kullanmayı bile beceremem. Fakat arada bir sunuculara SSH ile bağlanıp türlü işler yapmam gerekebiliyor. Bu iş çok sık olmadığı için genelde kullandığım komutları unutuyorum. Bu yüzden görece sık kullandığım komutları bir yerlere not ediyorum. Aşağıdaki listenin büyük kısmını bu notlardan çıkardım. Birçoğu gerçekten basit ama [...]


İlgili Yazılar:<ol><li><a href='http://www.gudubeth.net/tr/yazi/php-ile-dizin-silme-fonksiyonu/' rel='bookmark' title='Permanent Link: PHP ile dizin silme fonksiyonu'>PHP ile dizin silme fonksiyonu</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Linux uzmanı olmak bir yana, linux komut satırını doğru düzgün kullanmayı bile beceremem. Fakat arada bir sunuculara SSH ile bağlanıp türlü işler yapmam gerekebiliyor. Bu iş çok sık olmadığı için genelde kullandığım komutları unutuyorum. Bu yüzden görece sık kullandığım komutları bir yerlere not ediyorum. Aşağıdaki listenin büyük kısmını bu notlardan çıkardım. Birçoğu gerçekten basit ama yine de birilerinin işine yaracığını umuyorum. En azından benim işime yarayacak.</p>
<p><strong>1. Metin içeren dosyanın içeriği nasıl okunur?</strong><br />
<em>&#8216;cat&#8217; </em>ya da &#8216;<em>more&#8217; </em>komutları ile dosya içeriğini görebilirsiniz. Kullanımları gayet basit: komut + dosya adı.<br />
&gt; cat benioku.txt<br />
&gt; more benideoku.txt<br />
bu iki komuttan <em>&#8216;cat&#8217; </em>dosyanın içeriğini gösterip işini bitirirken &#8216;<em>more&#8217; </em>dosya gösterim işini sayfa sayfa  yapar. Sayfalama modundayken sonraki sayfaya geçmek için &lt;boşluk&gt; tuşu, sonraki satıra geçmek için &lt;giriş/enter&gt; tuşunu kullanabilirsiniz. çıkış için de &lt;q&gt;&#8217;ya basınız.</p>
<p><strong>2. Dosya arama nasıl yapılır?</strong><br />
dosya bulmanın en kolay ve hızlı yolu &#8216;<em>locate</em>&#8216; komutu.<br />
&gt; locate benibul<br />
&#8216;<em>locate</em>&#8216;in yanına bir &#8216;i&#8217; parametresi eklerseniz aramanız küçük-büyük harf ayrımı olmadan yapılır.<br />
Yalnız &#8216;<em>locate</em>&#8216; komutunun düzgün çalışması için dosya listesinin önceden yedeklemiş olması gerekiyor. Yedekleme işlemi haftada bir kere otomatik olarak yapılır. Bu sebeple bulduğunuz sonuçlar pek güncel olmayabilir.</p>
<p>Diğer yöntem ise güncel arama yaptığınız find komutu. Tonlarca parametresi var ama bizim durumumuzda basitçe şöyle kulanılıyor:<br />
&gt; find / -name &#8216;benibul&#8217;<br />
&gt; find / -iname &#8216;benibul&#8217;<br />
name parametresi dosya isminde arama yaptığımızı belirtmek, iname ise bu aramayı küçük-büyük harf ayrımı yapmadan yapmak istediğimizi göstermek için kullanılıyor. dosya isimlerinde joker karakter olarak &#8216;*&#8217; işaretini kullanabilirsiniz. Yani uzantısı <em>mp3 </em>olan tüm dosyaları bulmak için <em>find / iname &#8216;*.mp3&#8242; </em>yazmalısınız. komuttaki &#8216;/&#8217; işareti hangi dizinde arama yaptığımızı belirtmek için kullanılıyor. eğer bulunduğunuz dizinde arama yapacaksanız kullanmanız gerekmiyor. Bütün dosyaları arayacaksanız buradaki gibi &#8216;/&#8217; yazmalısınız.</p>
<p><strong>3. Dosya içeriklerinde nasıl arama yapılır?</strong><br />
&gt; find / -iname &#8216;*php&#8217; | xargs grep &#8216;mysql&#8217; -sl<br />
Yukarıdaki komut tüm php uzantılı dosyalar içerisinde mysql geçen satırları arar, bulduklarını dosya ve satır şeklinde listeler. Yukarıdaki komutun sonucu şöyle birşey olabilir:<br />
/home/gudubeth/public_html/index.php:     while($rs = mysql_fetch_assoc($q)){<br />
/home/gudubeth/public_html/index.php:     else return mysql_errno();<br />
/home/gudubeth/public_html/include.php:      if ($conn = mysql_connect($dhost, $duser, $dpass)){</p>
<p><strong>4. Programlar arka planda (background) nasıl çalıştırılır?</strong><br />
Bazı uzun sürecek işleri arka planda çalıştırmak isteyebilirsiniz, böylece programın çalışması devam ederken siz diğer işlerinize devam edebilirsiniz. Bunu başarmak için tek yapmanız gereken komutun sonuna &#8216;&amp;&#8217; işareti koymak ya da program çalışırken &lt;ctrl&gt;+&lt;z&gt; tuşlarına basmak. Arka planda çalışan programları listelemek için &#8216;jobs&#8217; komutunu kullanabilirsiniz. &#8216;<em>jobs</em>&#8216; yazıldıktan sonra gelen listedeki programlar &#8216;<em>fg %n</em>&#8216; komutu ile öne getirilebilir. Buradaki <em>&#8216;n&#8217;</em> <em>&#8216;jobs&#8217;</em> listesinde gösterilen programa ait numara oluyor. Şöyle örnekleyelim:<br />
&gt; gdbt@server [/home/]# man locate<br />
(karşınıza <em>locate </em>komutu ile ilgili yardım sayfası gelecek. Bu ekrandayken &lt;ctrl&gt;+&lt;z&gt; tuşlarına basınız. Aşağıdaki gibi bir satır çıkacak.)<br />
&gt; [1]+  Stopped                 man locate<br />
(arka plandaki programları listeleyelim)<br />
&gt; gdbt@server [/home/]# jobs<br />
[1]+  Stopped                 man locate<br />
(şimdi bu programı tekrar ön plana getirelim. <em>&#8216;fg&#8217; </em>komutu ile birlikte kullanılacak sayı için yukarıdaki &#8216;<em>jobs</em>&#8216; listesinde programın adının bulunduğu satırın en başına bakıyoruz.)<br />
&gt; gdbt@server [/home/]# fg %1<br />
(karşımıza tekrar man sayfası gelecek. <em>&#8216;q&#8217;</em> ile bu sayfadan çıkabilirsiniz.)</p>
<p><strong>5. Bir dizinin altındaki dosya sayısı nasıl bulunur?</strong><br />
&gt; ls -laR | wc -l<br />
Yukarıdaki komutu ilgilendiğiniz dizinin altında çalıştırın. Bu arkadaş alt dizinlerdeki dosyaları da sayar.</p>
<p><strong>6. Disk kapasitesi ve disklerde kalan boş alan nasıl öğrenilir?</strong><br />
Bu en kolayı:<br />
&gt; df</p>
<p><strong>7. Kısayol nasıl yaratılır?</strong><br />
&gt; ln -s /link/verilecek/dosya/ya/da/dizin<br />
<em>&#8216;ln&#8217;</em> komutunu kısayolun yaratılacağı dizinde çalıştırmalısınız. Örneğin<em> /var/www </em>dizini altında <em>/home/naci/resimler </em>dizinine bir kısayol yaratmak istiyorsunuz:<br />
&gt; cd /var/www<br />
&gt; ln -s /home/naci/resimler<br />
Yukarıdaki komutlar ile <em>/var/www</em> dizini altında <em>&#8216;resimler&#8217;</em> isimli bir kısayol oluşturdu.<br />
&gt; ls /var/www/resimler<br />
komutunu yazdığınızda karşınıza <em>/home/naci/resimler</em> dizini altındaki dosyalar gelecek.<br />
<strong><br />
8. Daha önce girilen komutlar nasıl görülebilir?</strong><br />
Yukarı ok ile önceden girilen komutları görebildiğinizi bilyorsunuzdur. &#8216;<em>history</em>&#8216; komutu ile bunların tam bir listesini alabilirsiniz.<br />
&gt; history</p>
<p><strong>9. Log&#8217;lar canlı olarak nasıl görüntülenir?</strong><br />
Sık güncellenen log&#8217;ları akan yazı şeklinde anında görüntülemek için &#8216;<em>tail</em>&#8216; komutunu kullanabilirsiniz. Bu komutu bir dosyanın son satırlarını görmek için de kullanabilirsiniz.<br />
&gt; tail -f -n100 /var/log/messages<br />
Yukarıdaki komutta -f parametresi dosyaya son yapılan eklemelerin anında görüntülenmesini sağlar (akan yazı şeklinde). -f kullanmazsanız komut çalıştırıldığı andaki dosya gösterilir sadece. -n&#8217;den sonra gelen 100 sayısı dosyanın sondan başlayarak kaç satırının gösterileceğini belirtir. Bu örnekte dosyanın son 100 satırı görüntülenmiş. Son parametre de tahmin edileceği üzere görüntülenecek dosyamızın adı.</p>
<p><strong>10. Bir dizin nasıl sıkıştırılır?</strong><br />
Dizin sıkıştırmak için:<br />
&gt; tar -c /dizinin/bulundugu/yer/dizinadi/ | bzip2 &gt; dizinadi.tar.bz2<br />
Sıkıştırılmış dosyayı aşmak için:<br />
&gt; bzip2 -dc dizinadi.tar.bz2 | tar -x<br />
<em>bzip2 </em>yerine <em>gzip </em>de kullanabilirsiniz.</p>
<p><strong>Kaynaklar:</strong><br />
<a href="http://docstore.mik.ua/orelly/unix/upt/ch12_01.htm" target="_blank">Unix Job Control </a><br />
<a href="http://www.pixelbeat.org/cmdline.html" target="_blank">Linux Commands: A Practical Reference</a></p>


<p>İlgili Yazılar:<ol><li><a href='http://www.gudubeth.net/tr/yazi/php-ile-dizin-silme-fonksiyonu/' rel='bookmark' title='Permanent Link: PHP ile dizin silme fonksiyonu'>PHP ile dizin silme fonksiyonu</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.gudubeth.net/tr/yazi/linux-komut-satiri-10-soru-10-cevap-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
