<?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>hieudt's blog &#187; fix code</title>
	<atom:link href="http://hieudt.info/tag/fix-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://hieudt.info</link>
	<description>WordPress and Symbian UIQ3</description>
	<lastBuildDate>Sat, 08 May 2010 01:05:46 +0000</lastBuildDate>
	<language>vi</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Plugin tạo watermark cho ảnh trong WordPress</title>
		<link>http://hieudt.info/wp-plugins/viet-nam-plugin-tao-watermark-cho-anh-trong-wordpress/</link>
		<comments>http://hieudt.info/wp-plugins/viet-nam-plugin-tao-watermark-cho-anh-trong-wordpress/#comments</comments>
		<pubDate>Sat, 08 May 2010 01:05:46 +0000</pubDate>
		<dc:creator>hieudt</dc:creator>
				<category><![CDATA[WP Plugins]]></category>
		<category><![CDATA[WP Tips-Tricks]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[fix code]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[watermark]]></category>

		<guid isPermaLink="false">http://hieudt.info/?p=1250</guid>
		<description><![CDATA[Watermark là một ảnh nhỏ (thường là file GIF hay PNG trong suốt) như ảnh logo hoặc một đoạn text ghi địa chỉ trang web được đóng dấu (in chìm) lên các bức ảnh của riêng bạn để ghi lại dấu ấn. Cách làm này từ xưa đã được khá nhiều webmaster sử dụng để [...]]]></description>
			<content:encoded><![CDATA[<p>Watermark là một ảnh nhỏ (thường là file GIF hay PNG trong suốt) như ảnh logo hoặc một đoạn  text ghi địa chỉ trang web được đóng dấu (in chìm) lên các bức ảnh của riêng bạn để ghi lại dấu ấn. Cách làm này từ xưa đã được khá nhiều webmaster sử dụng để giữ bản quyền cho hình ảnh của mình, tránh bị sao chép mà ko ghi rõ nguồn gốc.</p>
<p>Mấy hôm nay nghiên cứu vụ watermark này cho khách hàng, tôi đã tìm được một plugin khá hay tên là <a href="http://www.wp-watermark.com/">Marekki’s Watermark</a>. Plugin này có chức năng tạo watermark cho các file ảnh mà bạn upload lên host khi viết bài, lưu ý là bạn phải dùng công cụ upload ảnh của WordPress thì mới có tác dụng. Tuy ra đời khá lâu (từ năm 2007, lúc WordPress chỉ mới tới phiên bản 2.3) nhưng plugin này vẫn chạy tốt trên WordPress 2.9.x.<span id="more-1250"></span></p>
<div id="attachment_1251" class="wp-caption aligncenter" style="width: 310px"><a class="highslide-image" onclick="return hs.expand(this);" href="http://hieudt.info/media/2010/05/wp-watermark.png"><img class="size-medium wp-image-1251 " title="wp-watermark" src="http://hieudt.info/media/2010/05/wp-watermark-300x222.png" alt="" width="300" height="222" /></a><p class="wp-caption-text">Giao diện của plugin</p></div>
<p>Một nhược điểm của Marekki’s Watermark từ khi có WordPress 2.7 là lúc cài đặt, bạn phải tự tay sửa file /wp-admin/includes/media.php , vì file này nằm trong thư mục wp-admin nên mỗi khi bạn update lên phiên bản mới của WordPress thì file này bị chép đè và bạn phải sửa lại nó, rất bất tiện và tốn thời gian.</p>
<p>Sau một hồi nghiên cứu thì tôi đã tìm được cách khắc phục nhược điểm trên, bạn chỉ việc paste đoạn code dưới đây vào cuối file "watermark.php" là xong, ko cần phải sửa file /wp-admin/includes/media.php nữa.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> addwatermark<span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   MM_Execute_WM<span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'file'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #b1b100;">return</span> <span style="color: #000088;">$file</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_handle_upload'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'addwatermark'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Hy vọng với thủ thật này sẽ giúp các bạn thuận tiện hơn trong việc sử dụng plugin.</p>

	Tags: <a href="http://hieudt.info/tag/filter/" title="filter" rel="tag">filter</a>, <a href="http://hieudt.info/tag/fix-code/" title="fix code" rel="tag">fix code</a>, <a href="http://hieudt.info/tag/plugins/" title="plugins" rel="tag">plugins</a>, <a href="http://hieudt.info/tag/watermark/" title="watermark" rel="tag">watermark</a><br />
]]></content:encoded>
			<wfw:commentRss>http://hieudt.info/wp-plugins/viet-nam-plugin-tao-watermark-cho-anh-trong-wordpress/feed/</wfw:commentRss>
		<slash:comments>68</slash:comments>
		</item>
	</channel>
</rss>

