<?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>The PHP tamer</title>
	<atom:link href="http://utd.hu/feed" rel="self" type="application/rss+xml" />
	<link>http://utd.hu</link>
	<description>PHP, WordPress, SQL, Javascript</description>
	<lastBuildDate>Wed, 09 May 2012 09:34:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Worpdress &#8211; 404 error with an external php under a plugin folder</title>
		<link>http://utd.hu/worpdress-404-error-with-an-external-php-under-a-plugin-folder</link>
		<comments>http://utd.hu/worpdress-404-error-with-an-external-php-under-a-plugin-folder#comments</comments>
		<pubDate>Wed, 09 May 2012 09:34:28 +0000</pubDate>
		<dc:creator>utd</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[404]]></category>
		<category><![CDATA[external php]]></category>
		<category><![CDATA[permission]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://utd.hu/?p=369</guid>
		<description><![CDATA[I have a small plugin, what provided a shortcode to the editor, to show phone numbers  in the posts asa dinamically created image. The plugin uses a php file, what creates the image based on the url parameters. In an installation, the browsers was not showed the images, and when we tried to call the [...]]]></description>
			<content:encoded><![CDATA[<p>I have a small plugin, what provided a shortcode to the editor, to show phone numbers  in the posts asa dinamically created image.</p>
<p>The plugin uses a php file, what creates the image based on the url parameters.</p>
<p>In an installation, the browsers was not showed the images, and when we tried to call the php directly from the browser, we got 404 error. The file was on the appropriate place, under the plugins folder.</p>
<p>After some investigation I found the following rows in the cpanel error log;<br />
<em>[Wed May 09 10:02:01 2012] [error] [client x.x.131.2] SoftException in Application.cpp:601: Directory &#8220;/home/site/public_html/wp-content&#8221; is writeable by group, referer: http://www.site.ie/wp-content/plugins/utdplugin1/callus.php?number=01825990</em><br />
<em>[Wed May 09 10:01:59 2012] [error] [client x.9x2.131.2] SoftException in Application.cpp:601: Directory &#8220;/home/site/public_html/wp-content&#8221; is writeable by group</em></p>
<p>Based on these messages I checked the permissions of the wp-content folder, and saw, that has been set to 777.</p>
<p>Changing the permissions to 755 has been fixed the problem.</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://utd.hu/worpdress-404-error-with-an-external-php-under-a-plugin-folder/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>/category/page/404 &#8211; What happened after the 10th page in the category archive?</title>
		<link>http://utd.hu/wordpress-category-archive-page-not-found</link>
		<comments>http://utd.hu/wordpress-category-archive-page-not-found#comments</comments>
		<pubDate>Wed, 21 Mar 2012 21:02:55 +0000</pubDate>
		<dc:creator>utd</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[404]]></category>
		<category><![CDATA[category]]></category>
		<category><![CDATA[continuum]]></category>
		<category><![CDATA[paginator]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://utd.hu/?p=353</guid>
		<description><![CDATA[On a site, what used Continuum theme, the designer show me an interesting problem. In the category archive there was 13 pages, and the first ten page worked correctly, but after the 11th, we got 404 errors on all pages. First I checked the count of the posts in the related category, and saw, the [...]]]></description>
			<content:encoded><![CDATA[<p>On a site, what used Continuum theme, the designer show me an interesting problem. In the category archive there was 13 pages, and the first ten page worked correctly, but after the 11th, we got 404 errors on all pages. First I checked the count of the posts in the related category, and saw, the paginator calculated the number of pages correctly.</p>
<p>I thought the permalink structure is correct, and the problem not related with the theme. But what can cause this kind of malfunction?</p>
<p><span id="more-353"></span></p>
<p>After some investigation I found the reason. The system show only 8 post on a page, but the WordPress has been set-up to count with 10 post. This difference caused the problem, so the wordpress calculated with only ten pages, but the paginator contained 13 page references.</p>
<p>After I changed the wordpress setting to 8, the site loaded all pages correctly.</p>
<p>The related Continuum setting is in the Page Layout -&gt; Category Archive Pages section, named &#8220;Posts Per Page&#8221;.</p>
<p style="text-align: center;"><a href="http://utd.hu/wp-content/uploads/2012/03/2012-03-21_2150021.jpg"><img class="aligncenter  wp-image-355" style="border: 2px solid black;" title="2012-03-21_215002" src="http://utd.hu/wp-content/uploads/2012/03/2012-03-21_2150021.jpg" alt="" width="611" height="330" /></a></p>
<p>The related WordPress setting is on the Settings -&gt; Reading page.</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="http://utd.hu/wp-content/uploads/2012/03/2012-03-21_215326.jpg"><img class="aligncenter  wp-image-356" style="border: 2px solid black;" title="2012-03-21_215326" src="http://utd.hu/wp-content/uploads/2012/03/2012-03-21_215326.jpg" alt="" width="356" height="344" /></a></p>
<p>So, if you have same kind of problem, just check the wordpress settings, to contain the appropriate number.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://utd.hu/wordpress-category-archive-page-not-found/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why did not work my Javascript replace with accented letters?</title>
		<link>http://utd.hu/why-did-not-work-my-javascript-replace-with-accented-letters</link>
		<comments>http://utd.hu/why-did-not-work-my-javascript-replace-with-accented-letters#comments</comments>
		<pubDate>Tue, 20 Mar 2012 15:10:43 +0000</pubDate>
		<dc:creator>utd</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[javascipt]]></category>

		<guid isPermaLink="false">http://utd.hu/?p=347</guid>
		<description><![CDATA[I made a short javascript function to replace accented letter with regular ones, and change all special characters to an underscore, but that did not worked correctly. function removeAccents(mytext) {        mytext=mytext.replace(new RegExp(/[őóö]/ig) ,&#8217;o');     mytext=mytext.replace(new RegExp(/[úűü]/ig) ,&#8217;u');     mytext=mytext.replace(new RegExp(/[á]/ig) ,&#8217;a');     mytext=mytext.replace(new RegExp(/[í]/ig) ,&#8217;i');     mytext=mytext.replace(new RegExp(/[é]/ig),&#8217;e');     mytext=mytext.replace(new RegExp(/[^a-zA-Z 0-9 ]+/g),&#8221; &#8220;).replace(new [...]]]></description>
			<content:encoded><![CDATA[<p>I made a short javascript function to replace accented letter with regular ones, and change all special characters to an underscore, but that did not worked correctly.</p>
<blockquote><p><span style="color: #000080;">function removeAccents(mytext)</span><br />
<span style="color: #000080;">{    </span><br />
<span style="color: #000080;">    mytext=mytext.replace(new RegExp(/[őóö]/ig) ,&#8217;o');</span><br />
<span style="color: #000080;">    mytext=mytext.replace(new RegExp(/[úűü]/ig) ,&#8217;u');</span><br />
<span style="color: #000080;">    mytext=mytext.replace(new RegExp(/[á]/ig) ,&#8217;a');</span><br />
<span style="color: #000080;">    mytext=mytext.replace(new RegExp(/[í]/ig) ,&#8217;i');</span><br />
<span style="color: #000080;">    mytext=mytext.replace(new RegExp(/[é]/ig),&#8217;e');</span><br />
<span style="color: #000080;">    mytext=mytext.replace(new RegExp(/[^a-zA-Z 0-9 ]+/g),&#8221; &#8220;).replace(new RegExp(/\s+/g),&#8221;_&#8221;);</span><br />
<span style="color: #000080;">    return mytext;</span><br />
<span style="color: #000080;">}</span></p></blockquote>
<p>The script has very strange behavior. When I tried to use on a string what contained accented letters, the script did not changed them to regular ones, but handle them as special characters.</p>
<p>When I tried to debug the script, I saw, the mytext variable never got the new value after the replaces, only after the last one. When I used the function in the Watch Expression tab, that give back the appropriate value, but didn&#8217;t when I run the script on normal way. I tried the script in more browsers, and all test had same result.</p>
<p>After some rest, I tried to find the problem again, and finally found the solution.</p>
<p>I stored the javascript code in a separate file, what was not UTF8 encoded, while the main html page, where I used the script was that.</p>
<p>On the firebug, everything seemed fine, but the encoding difference was enough to cause this hard-to-find reson.</p>
<p>&nbsp;</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://utd.hu/why-did-not-work-my-javascript-replace-with-accented-letters/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mappress loading problem</title>
		<link>http://utd.hu/mappress-loading-problem</link>
		<comments>http://utd.hu/mappress-loading-problem#comments</comments>
		<pubDate>Wed, 14 Mar 2012 09:46:08 +0000</pubDate>
		<dc:creator>utd</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Mappress]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://utd.hu/?p=335</guid>
		<description><![CDATA[On a new site the owner tried to use the mappress plugin to show maps to the posts. The plugin seemed to works well, but the maps did not loaded properly. Sometimes the half of them loaded, sometimes nothing. In firefox, when I opened the firebug, the rest of the map loaded immediately. Based on [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">On a new site the owner tried to use the mappress plugin to show maps to the posts.<br />
The plugin seemed to works well, but the maps did not loaded properly. Sometimes the half of them loaded, sometimes nothing. In firefox, when I opened the firebug, the rest of the map loaded immediately. Based on these information, I knew the problem somewhere around the order of loading and running javascript scripts, but because the site used very lot of plugins I did not want to start to investigate where is the conflict. So I decided to add one more plugin, to solve this problem for me.<br />
<span id="more-335"></span><br />
My plan was the following; I make a shortcode, what loads only the mappress map into an iframe, when the document has been loaded successfully, so eliminate the conflicts with other plugins.</p>
<p>The PHP code to of the shortcode:</p>
<p>&nbsp;</p>
<blockquote><p><span style="color: #000080;">add_shortcode(&#8220;utdmap&#8221;,&#8221;utdmap_shortcode&#8221;); </span></p>
<p><span style="color: #000080;">function utdmap_shortcode($mshort)</span><br />
<span style="color: #000080;"> {</span></p>
<p style="padding-left: 30px;"><span style="color: #000080;">$mshortid=$mshort['mapid'];</span><br />
<span style="color: #000080;"> $width=$mshort['width'];</span><br />
<span style="color: #000080;"> $height=$mshort['height'];</span><br />
<span style="color: #000080;"> $path=plugin_dir_url( $file ).&#8221;myplugin/getmap.php?mapid=&#8221;.$mshortid;</span><br />
<span style="color: #000080;"> $map=&#8221;&lt;div id=&#8217;utdxmap&#8217;&gt;&lt;/div&gt;&lt;script type=&#8217;text/javascript&#8217;&gt;jQuery(document).ready(function() {jQuery(&#8216;#utdxmap&#8217;)[0].innerHTML=&#8217;&lt;iframe id=\&#8221;utdmapframe\&#8221; src=\&#8221;$path\&#8221; frameborder=\&#8221;0\&#8221; scrolling=\&#8221;no\&#8221; width=\&#8221;$width\&#8221; height=\&#8221;$height\&#8221; marginwidth=\&#8221;0\&#8221; marginheight=\&#8221;0\&#8221;&gt;&lt;/iframe&gt;&#8217;;</span><br />
<span style="color: #000080;"> });&lt;/script&gt;&#8221;;</span><br />
<span style="color: #000080;"> return $map;</span></p>
<p><span style="color: #000080;">}</span></p></blockquote>
<p>The usage of the shortcode:</p>
<p><span style="color: #888888;"><strong><span style="color: #800000;">[utdmap mapid=X width=600 height=400]</span></strong> <span style="color: #333333;">where the X is the mappress ID of the map, the widht and height are the size of the iframe</span></span></p>
<p>So, when I used my new shortcode, the wordpress added a script to the page, what waited till the page finished to loading, then inserted an iframe to the post, what referenced to the getmap.php. This is a small script, what generate only the appropriate map, based on the shortcode.</p>
<p>The GETMAP.PHP</p>
<blockquote><p><span style="color: #000080;">&lt;?php</span></p>
<p style="padding-left: 30px;"><span style="color: #000080;">require( &#8216;../../../wp-load.php&#8217; );</span><br />
<span style="color: #000080;"> $mapid=$_REQUEST["mapid"];</span><br />
<span style="color: #000080;"> $shortcode=&#8221;[mappress mapid=\"$mapid\"]&#8220;;</span><br />
<span style="color: #000080;"> $content= do_shortcode($shortcode);</span><br />
<span style="color: #000080;"> echo $content;</span></p>
<p><span style="color: #000080;">?&gt;</span></p></blockquote>
<p>With this changes the maps loaded properly in all browsers.</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://utd.hu/mappress-loading-problem/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Why are the IMAGEPNG creates PNG files, what contains only 33 bytes of data</title>
		<link>http://utd.hu/why-the-imagepng-creates-png-files-what-contains-only-33-bytes-of-data</link>
		<comments>http://utd.hu/why-the-imagepng-creates-png-files-what-contains-only-33-bytes-of-data#comments</comments>
		<pubDate>Mon, 05 Mar 2012 10:48:29 +0000</pubDate>
		<dc:creator>utd</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[33 bytes]]></category>
		<category><![CDATA[imagepng]]></category>
		<category><![CDATA[PNG]]></category>

		<guid isPermaLink="false">http://utd.hu/?p=324</guid>
		<description><![CDATA[I had a script to manipulate images, what worked without problem, but one day, the script stopped to work, and did not created the images appropriately anymore. After several housr of investigation, I found the reason of the problem. The script used the IMAGEPNG command to create the images.On this part I set the quality [...]]]></description>
			<content:encoded><![CDATA[<p>I had a script to manipulate images, what worked without problem, but one day, the script stopped to work, and did not created the images appropriately anymore.</p>
<p>After several housr of investigation, I found the reason of the problem.</p>
<p>The script used the IMAGEPNG command to create the images.On this part I set the quality parameter to 100. Ok I know, I know, this parameter can accept values between 0 and 9 only, but I forgot this, and used the parameter as we can use at the IMAGEJPG command.</p>
<p>Why did not got error earlier? Because while the server used PHP4, the system worked well, and created the image without problem, but one day the system administrator changed the PHP version to the version 5.</p>
<p>Under PHP5, the IMAGEPNG still created the file what needed, but saved only 33 bytes to the file, and did not create the image properl, without any error messages.</p>
<p>So, to fix the issue, had been enough to change the quality value to the needed range.</p>
<p>&nbsp;</p>
<table>
<tbody>
<tr>
<td>imagepng($image,$filename,<span style="color: #0000ff;">8</span>);</td>
<td>PHP4   <span style="color: #339966;"><strong>√</strong></span></td>
<td>PHP5     <strong><span style="color: #339966;">√</span></strong></td>
</tr>
<tr>
<td>imagepng($image,$filename,<span style="color: #0000ff;">100</span>);</td>
<td>PHP4   <span style="color: #339966;"><strong>√</strong></span></td>
<td>PHP5     <span style="color: #ff0000;"><strong>X</strong></span></td>
</tr>
</tbody>
</table>
<p>I hope this small information can save lot of time, to find, why did not work your script when tries to create a PNG file.</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://utd.hu/why-the-imagepng-creates-png-files-what-contains-only-33-bytes-of-data/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to make changes in the HTML output of an ionCube protected PHP script.</title>
		<link>http://utd.hu/how-to-make-changes-in-the-html-output-of-an-ioncube-protected-php-script</link>
		<comments>http://utd.hu/how-to-make-changes-in-the-html-output-of-an-ioncube-protected-php-script#comments</comments>
		<pubDate>Wed, 18 Jan 2012 08:15:08 +0000</pubDate>
		<dc:creator>utd</dc:creator>
				<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">http://utd.hu/?p=305</guid>
		<description><![CDATA[Sometimes I get requests to make changes on an IonCube protected script, but the protection prevents us, to do this. In some cases we can make smaller changes with and easy solution. Firts we have to make a wrapper for the protected PHP, what contains the include for that. &#160; Example; The name of the [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes I get requests to make changes on an IonCube protected script, but the protection prevents us, to do this.</p>
<p>In some cases we can make smaller changes with and easy solution.</p>
<p>Firts we have to make a wrapper for the protected PHP, what contains the include for that.</p>
<p>&nbsp;</p>
<p>Example;</p>
<p>The name of the protected PHP is PROTECTED.PHP.</p>
<p>We have to make a wrapper what includes the original file, but before we use the include, we have to turn on the output buffering, so the server wont send the output to the browser immediately, only when reached the end of the script, or when we force this.</p>
<p>&nbsp;</p>
<blockquote><p>ob_start(); // Turn on the output buffering</p>
<p>include &#8220;PROTECTED.PHP&#8221;; // include the IonCube protected script</p>
<p>$output=ob_get_clean(); // read the HTML output to a string variable and clear the contents of the buffer</p>
<p>$new_output=str_replace(&#8220;old text&#8221;,&#8221;new text&#8221;,$output); // change the content of the HTML output</p>
<p>echo $new_output; // send out the changed string into the buffer</p>
<p>ob_end_flush(); // send the buffer content out to the browser, and turn off the output buffering.</p>
<p>&nbsp;</p></blockquote>
<p>&nbsp;</p>
<p>On this way, you can easily make smaller changes on the output of a protected script.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://utd.hu/how-to-make-changes-in-the-html-output-of-an-ioncube-protected-php-script/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add watermark to uploaded images</title>
		<link>http://utd.hu/add-watermark-to-uploaded-images</link>
		<comments>http://utd.hu/add-watermark-to-uploaded-images#comments</comments>
		<pubDate>Mon, 18 Jul 2011 09:16:50 +0000</pubDate>
		<dc:creator>utd</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[php image watermark]]></category>

		<guid isPermaLink="false">http://utd.hu/?p=292</guid>
		<description><![CDATA[I had a work, when the customer wanted to add watermark to the uploaded images. I tried some solutions, and finally found that one, what works well. What we need for this task? A png image what contains the watermark image. This must be transparent background, and semi transparent image, otherwise the result won&#8217;t be [...]]]></description>
			<content:encoded><![CDATA[<p>I had a work, when the customer wanted to add watermark to the uploaded images. I tried some solutions, and finally found that one, what works well. What we need for this task? A png image what contains the watermark image. This must be transparent background, and semi transparent image, otherwise the result won&#8217;t be watermark, just an image what merged with another. We need a form too, to upload the image, and a script, what process the request, and add the watermark to the uploaded image.</p>
<p><span id="more-292"></span></p>
<p>Here provide only the php script, what process the file. Of course, we need a page, what contains the form, to posts the image to the server.</p>
<p>&nbsp;</p>
<p>First a small function, what returns the extension of the uploaded file.</p>
<blockquote><p>function getExtension($str)<br />
{</p>
<p style="padding-left: 30px;">$i = strrpos($str,&#8221;.&#8221;);<br />
if (!$i) { return &#8220;&#8221;; }<br />
$l = strlen($str) &#8211; $i;<br />
$ext = substr($str,$i+1,$l);<br />
return $ext;</p>
<p>}</p>
<p>$saved_image_name=$_FILES['image_file']['name'];<br />
$img_info=$_GET['img_info'];<br />
if ($saved_image_name)<br />
{</p>
<p style="padding-left: 30px;">$filename = stripslashes($_FILES['image_file']['name']);<br />
$extension = getExtension($filename);<br />
$extension = strtolower($extension);<br />
if (($extension != &#8220;jpg&#8221;) &amp;&amp; ($extension != &#8220;jpeg&#8221;) &amp;&amp; ($extension != &#8220;png&#8221;))<br />
{</p>
<p style="padding-left: 60px;">echo &#8220;You can upload only JPG or PNG files!&#8221;;</p>
<p style="padding-left: 30px;">}<br />
else<br />
{</p>
<p style="padding-left: 60px;">$size=filesize($_FILES['image_file']['tmp_name']);<br />
if ($size &gt; MAX_SIZE*1024)<br />
{</p>
<p style="padding-left: 90px;">echo &#8220;The file is too large!&#8221;;</p>
<p style="padding-left: 60px;">}<br />
else<br />
{</p>
<p style="padding-left: 90px;">$image_name=time().&#8217;.png&#8217;; // we create a unique name to save the file<br />
$uploadsDirectory = &#8216;/upload_folder/&#8217;;<br />
$newname=$uploadsDirectory.$image_name;</p>
<p>$uploadedfile = $_FILES['image_file']['tmp_name'];<br />
if($extension==&#8221;jpg&#8221; || $extension==&#8221;jpeg&#8221; )<br />
{</p>
<p style="padding-left: 120px;">$src = imagecreatefromjpeg($uploadedfile);</p>
<p style="padding-left: 90px;">}<br />
else if($extension==&#8221;png&#8221;)<br />
{</p>
<p style="padding-left: 120px;">$src = imagecreatefrompng($uploadedfile);</p>
<p style="padding-left: 90px;">}<br />
list($width,$height)=getimagesize($uploadedfile);</p>
<p>$wmimage=get_option(&#8216;watermark&#8217;,&#8221;);<br />
if ($wmimage!=&#8221;")<br />
{</p>
<p style="padding-left: 120px;">$watermark = imagecreatefrompng($wmimage);<br />
$watermark_width = imagesx($watermark);<br />
$watermark_height = imagesy($watermark);<br />
$dest_x = 5;<br />
$dest_y = 5;<br />
imagecopy($src, $watermark, $dest_x,$dest_y, 0, 0, $watermark_width, $watermark_height);<br />
imagepng($src,$newname,100);<br />
@imagedestroy($src);<br />
@imagedestroy($watermark);</p>
<p style="padding-left: 90px;">}</p>
<p style="padding-left: 60px;">}</p>
<p style="padding-left: 30px;">}</p>
<p>}</p></blockquote>
<p>This script opens the uploaded and the watermark image, then &#8211; with the <em>imagecopy </em>function &#8211; copies the watermark onto the top of the original image. The<strong> $dest_x</strong> and <strong>$dest_y</strong> gives the starting coordinates, and can contains negativ values too.</p>
<p>This solution saves the images with watermark to the upload folder, so if you want to keep the original images too, you have to make a copy before you merge them with the watermark.</p>
<p>&nbsp;</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://utd.hu/add-watermark-to-uploaded-images/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add PayGol payment gateway to Classipress sites</title>
		<link>http://utd.hu/add-paygol-payment-gateway-to-classipress-sites</link>
		<comments>http://utd.hu/add-paygol-payment-gateway-to-classipress-sites#comments</comments>
		<pubDate>Mon, 18 Jul 2011 08:41:41 +0000</pubDate>
		<dc:creator>utd</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[classipress]]></category>
		<category><![CDATA[paygol]]></category>
		<category><![CDATA[payment gateway]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://utd.hu/?p=282</guid>
		<description><![CDATA[Classipress is a very useful wordpress theme from AppThemes, what add functionality to the sites to post and manage ads. The theme had gateways for lot of payment methods, but there isn&#8217;t contains the PayGol payment gateway. The PayGol is a sms based micro-payment solution, with lot of configurable options. To add the appropriate functions, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.appthemes.com/themes/classipress/" target="_blank"><img class="alignleft" style="margin: 5px;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK8AAABOCAIAAADZ6NEFAAAgAElEQVR4nO1daZBc1Xk93RpJo2U0SKMBSYhFaLSwSQZkVkOJJJhA4gDBKuPEcRXgYMpR7DhOjCEBA2bsBEGohFQlMuU4JiCwQWgZLbP19D6979v0vu/7vvfNj6tpWjM9rUECWyR96hXVJW7f96bfed9yvu/eB9LF/wNUKpVqtUoIaTQajUZjoWH4LV5SF78ztDKgy4YuSL1eL5fLpVKpy4bPPUqlUi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j8XjPPjweT4cXlvwfYcNC1W2K+eb0wkFfUt6KSqVyHm+47oBqtdqcfJEvSb5AfJ7YQF//lUql5sQQqVSqgzaqUqk+3Zv0fxifJzYQQoLBoEwmMxqNNGQJBAJ2u71zNuHz+T6VN8D8f8DnjA3JZPKcuW4rRCLRIrdf74J87thQLBYX0iTawul0dg3D4vE5Y0O9Xl+MCE2h0Wgu/J1x/6/wOWMDOXsRXwcolcoOrQxdtMUZNrTtIKL4LNKzC0GHKnkTFoulGy6cB86wIRqN0ne2z8d5v1TpM0KxWPT5fGazWavVKhQKiUQiFovFYrFUKtVqtU6nM5PJ/K72Cvq8o7sLWBcfo8uGLj5Glw1dfIwuG7r4GF02dPExumzo4mP8L7cmouF1nhJWAAAAAElFTkSuQmCC" alt="" width="175" height="78" />Classipress</a> is a very useful wordpress theme from <a href="http://www.appthemes.com/" target="_blank">AppThemes</a>, what add functionality to the sites to post and manage ads. The theme had gateways for lot of payment methods, but there isn&#8217;t contains the <a href="http://www.paygol.com/" target="_blank">PayGol</a> payment gateway. The <a href="http://www.paygol.com/" target="_blank">PayGol </a>is a sms based micro-payment solution, with lot of configurable options.</p>
<p><span id="more-282"></span></p>
<p>To add the appropriate functions, we have to make several changes on the code.</p>
<h2>First step</h2>
<p>We have to register the new gateway in the <strong>classipress/include/gateways/admin-gateway-values.php</strong></p>
<p>You have to add the following code part into the <strong>$options_gateways</strong> array definition. You have to copy the <strong>paygol.png </strong>image into the <strong>images </strong>folder of the theme.</p>
<blockquote><p>array( &#8216;type&#8217; =&gt; &#8216;tab&#8217;, &#8216;tabname&#8217; =&gt; &#8216;PayGol&#8217;,),<br />
array(    &#8216;name&#8217; =&gt; &#8216;PayGol Options&#8217;,</p>
<p style="padding-left: 30px;">&#8216;type&#8217; =&gt; &#8216;title&#8217;,<br />
&#8216;id&#8217; =&gt; &#8221;</p>
<p>),<br />
array(   &#8216;name&#8217; =&gt; &#8216;&lt;img src=&#8221;&#8216;.get_bloginfo(&#8216;template_directory&#8217;).&#8217;/images/paygol.png&#8221; /&gt;&#8217;,</p>
<p style="padding-left: 30px;">&#8216;type&#8217; =&gt; &#8216;logo&#8217;,<br />
&#8216;id&#8217; =&gt; &#8221;</p>
<p>),</p>
<p>array(   &#8216;name&#8217; =&gt; &#8216;Enable PayGol&#8217;,</p>
<p style="padding-left: 30px;">&#8216;desc&#8217; =&gt; &#8221;,<br />
&#8216;tip&#8217; =&gt; &#8216;Set this to yes if you want to offer paygol mobil transfer as a payment option on your site. Note: the &amp;quot;Charge for Listing Ads&amp;quot; option on the pricing page must be set to yes for this option to work.&#8217;,<br />
&#8216;id&#8217; =&gt; $app_abbr.&#8217;_enable_paygol&#8217;,<br />
&#8216;css&#8217; =&gt; &#8216;width:100px;&#8217;,<br />
&#8216;std&#8217; =&gt; &#8221;,<br />
&#8216;js&#8217; =&gt; &#8221;,<br />
&#8216;type&#8217; =&gt; &#8216;select&#8217;,<br />
&#8216;options&#8217; =&gt; array(  &#8216;yes&#8217; =&gt; __(&#8216;Yes&#8217;, &#8216;appthemes&#8217;),<br />
&#8216;no&#8217;  =&gt; __(&#8216;No&#8217;, &#8216;appthemes&#8217;))),</p>
<p>array(  &#8216;name&#8217; =&gt; &#8216;PayGol Instructions&#8217;,<br />
&#8216;desc&#8217; =&gt; &#8216;Enter your specific PayGol payment instructions here. HTML can be used.&#8217;,<br />
&#8216;tip&#8217; =&gt; &#8216;This will be shown on the payment page after a new ad has been submitted. IMPORTANT: THE INFORMATION IN THIS TEXT BOX WILL BE SHOWN ON YOUR WEB SITE CONFIRMATION PAGE.&#8217;,<br />
&#8216;id&#8217; =&gt; $app_abbr.&#8217;_paygol_instructions&#8217;,<br />
&#8216;css&#8217; =&gt; &#8216;width:500px;height:150px;&#8217;,<br />
&#8216;vis&#8217; =&gt; &#8221;,<br />
&#8216;req&#8217; =&gt; &#8221;,<br />
&#8216;min&#8217; =&gt; &#8221;,<br />
&#8216;type&#8217; =&gt; &#8216;textarea&#8217;,<br />
&#8216;std&#8217; =&gt; &#8221;</p>
<p>),</p>
<p>array( &#8216;type&#8217; =&gt; &#8216;tabend&#8217;),</p></blockquote>
<p>&nbsp;</p>
<h2>Second Step</h2>
<p>Now, on the admin area of the classipress theme, you can enable the PayGol payment gateway, and you will be able to add instructions about the payment.</p>
<p style="text-align: center;"><a href="http://utd.hu/wp-content/uploads/2011/07/2011-07-18_095932.png"><img class="aligncenter size-full wp-image-284" style="border: 1px solid black;" title="2011-07-18_095932" src="http://utd.hu/wp-content/uploads/2011/07/2011-07-18_095932.png" alt="" width="601" height="310" /></a></p>
<h2>Third Step</h2>
<p>When the users post a new ad, they can select the payment method from the list, what the system provides them. In the <strong>classipress/includes/forms</strong> folder there are the <strong>step2.php</strong>, what control the payments. We have to change this script. Around the line 144, there is the part, what creates the select control, what contains the payment methods. You have to add the new method to this list.</p>
<blockquote><p>&lt;select name=&#8221;cp_payment_method&#8221;&gt;<br />
&lt;?php if(get_option(&#8216;cp_enable_paypal&#8217;) == &#8216;yes&#8217;) { ?&gt;&lt;option value=&#8221;paypal&#8221;&gt;&lt;?php echo _e(&#8216;PayPal&#8217;, &#8216;appthemes&#8217;) ?&gt;&lt;/option&gt;&lt;?php } ?&gt;<br />
<strong>&lt;?php if(get_option(&#8216;cp_enable_paygol&#8217;) == &#8216;yes&#8217;) { ?&gt;&lt;option value=&#8221;paygol&#8221;&gt;&lt;?php echo &#8216;PayGol&#8217; ?&gt;&lt;/option&gt;&lt;?php } ?&gt;</strong><br />
&lt;?php if(get_option(&#8216;cp_enable_bank&#8217;) == &#8216;yes&#8217;) { ?&gt;&lt;option value=&#8221;banktransfer&#8221;&gt;&lt;?php echo _e(&#8216;Bank Transfer&#8217;, &#8216;appthemes&#8217;) ?&gt;&lt;/option&gt;&lt;?php } ?&gt;<br />
&lt;?php if(get_option(&#8216;cp_enable_gcheckout&#8217;) == &#8216;yes&#8217;) { ?&gt;&lt;option value=&#8221;gcheckout&#8221;&gt;&lt;?php echo _e(&#8216;Google Checkout&#8217;, &#8216;appthemes&#8217;) ?&gt;&lt;/option&gt;&lt;?php } ?&gt;<br />
&lt;?php if(get_option(&#8216;cp_enable_2checkout&#8217;) == &#8216;yes&#8217;) { ?&gt;&lt;option value=&#8221;2checkout&#8221;&gt;&lt;?php echo _e(&#8217;2Checkout&#8217;, &#8216;appthemes&#8217;) ?&gt;&lt;/option&gt;&lt;?php } ?&gt;<br />
&lt;?php if(get_option(&#8216;cp_enable_authorize&#8217;) == &#8216;yes&#8217;) { ?&gt;&lt;option value=&#8221;authorize&#8221;&gt;&lt;?php echo _e(&#8216;Authorize.net&#8217;, &#8216;appthemes&#8217;) ?&gt;&lt;/option&gt;&lt;?php } ?&gt;<br />
&lt;?php if(get_option(&#8216;cp_enable_chronopay&#8217;) == &#8216;yes&#8217;) { ?&gt;&lt;option value=&#8221;chronopay&#8221;&gt;&lt;?php echo _e(&#8216;Chronopay&#8217;, &#8216;appthemes&#8217;) ?&gt;&lt;/option&gt;&lt;?php } ?&gt;<br />
&lt;?php if(get_option(&#8216;cp_enable_mbookers&#8217;) == &#8216;yes&#8217;) { ?&gt;&lt;option value=&#8221;mbookers&#8221;&gt;&lt;?php echo _e(&#8216;MoneyBookers&#8217;, &#8216;appthemes&#8217;) ?&gt;&lt;/option&gt;&lt;?php } ?&gt;<br />
&lt;/select&gt;</p></blockquote>
<p>After this change, the PayGol will be selectable when customers want to post a new ad.</p>
<p style="padding-left: 30px;"><img class="aligncenter" style="border: 1px solid black; margin: 3px;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgIAAAB5CAIAAADEXd6wAAAROUlEQVR4nO2dy07kSp6H83nOdnaon8G5Pw/AihSPUEskkFJsz67EAjQqpFG3NEgjEJfNwbCA2tSigUkNF/X0HFWinmEaznSReBa+xd3hW978ffqpRDntcEQ44v+LCGfavQgAADpMb9YZAACAWYINAAB0GmwAAKDTYAMAAJ0GGwAA6DTYAABAp8EGAAA6DTYAANBpsAFwMZlM7u/vz8/PT05ODgFgDjg5OQnD8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Ci+f8txVbs8UBC+UWKozBJ1Uq+PC/Gk6HBjz7J3Df+YJg+eSjUYV1Bt5VfEN/FsTq9N+z2NNmS8rua8oRZ1tDn1q2Dt0shHU++qC6GlblQN28C33YHl3uB02lbiw8ZRhj1vqM0rsqt+HbCdq+C69KiMsIFMXWlUPFMIIYQ6LWwAIYQ6LWwAIYQ6LWwAIYQ6LWwAIYQ6LWwAIYQ6LWwAIYQ6LWwAIYQ6LWwAIYQ6LWwAIYQ6rf8HGSZS1DIV0UwAAAAASUVORK5CYII=" alt="" width="514" height="121" /></p>
<h2>Fourth Step</h2>
<p>To select the payment method, won&#8217;t be enough, we need to make some scripts, what redirect the customer onto the payment site, and send the appropriate data to there, then receive the response about the success or failure of the payment.</p>
<p>This part of the solution use the settings of <a href="http://codex.appwebmaster.com/easy-paypal-wordpress-plugin" target="_blank">easy-paygol plugin</a>, so don&#8217;t forget to install that, and set up a service what you made on the PayGol site.</p>
<p>We have to create a folder named <strong>paygol </strong>under the <strong>classipress/includes/gateways</strong> folder, and add a new file, named <strong>paygol.php </strong>to there. The script what handle the payment are the following;</p>
<blockquote><p>&lt;?php<br />
/**<br />
* PaGol payment gateway script<br />
*<br />
* @package ClassiPress<br />
* @author UTD<br />
* @version 3.0<br />
*<br />
* @param int $post_id<br />
* @param text $type<br />
*<br />
*/</p>
<p>// payment processing script that is used on the new ad confirmation page<br />
// and also the ad dashboard so ad owners can pay for unpaid ads<br />
function cp_dashboard_paygol_button($post_id, $type)</p>
<p>{</p>
<p style="padding-left: 30px;">global $wpdb;</p>
<p style="padding-left: 30px;">// figure out the number of days this ad was listed for<br />
if (get_post_meta($post_id, &#8216;cp_sys_ad_duration&#8217;, true))</p>
<p style="padding-left: 60px;">$prun_period = get_post_meta($post_id, &#8216;cp_sys_ad_duration&#8217;, true);</p>
<p style="padding-left: 30px;">else</p>
<p style="padding-left: 60px;">$prun_period = get_option(&#8216;cp_prun_period&#8217;);</p>
<p style="padding-left: 30px;">$table_name_setting=get_option(table_name_setting);<br />
$table_name_service=get_option(table_name_service);<br />
$sql = &#8220;SELECT * FROM $table_name_setting &#8220;;</p>
<p style="padding-left: 30px;">$settings = $wpdb-&gt;get_results($sql);<br />
foreach ($settings as $service)<br />
{</p>
<p style="padding-left: 60px;">// retrieve service information we need<br />
$pg_serviceid = $service-&gt;pg_serviceid;<br />
$pg_currency = $service-&gt;pg_currency;<br />
$pg_price = $service-&gt;pg_price;<br />
$pg_button = $service-&gt;pg_button;</p>
<p style="padding-left: 30px;">}<br />
// I used the same URL in all cases, just add different url parameter in the different cases.<br />
$pg_cancel_url= home_url().&#8217;/&#8217;.&#8221;payment/?cancel_post_id=$post_id&#8221;;<br />
$pg_notify_url =  home_url().&#8217;/&#8217;.&#8221;payment/?success_post_id=$post_id&#8221;;<br />
$pg_return_url = home_url().&#8217;/&#8217;.&#8221;payment/?success_post_id=$post_id&#8221;;<br />
?&gt;<br />
&lt;script src=http://www.paygol.com/micropayment/js/pg.js type=text/javascript&gt;&lt;/script&gt;<br />
&lt;link rel=stylesheet href=http://www.paygol.com/micropayment/css/pg_pre.css type=text/css media=screen /&gt;</p>
<p style="padding-left: 30px;">&lt;script type=&#8217;text/javascript&#8217;&gt;<br />
function pgredirect()<br />
{</p>
<p style="padding-left: 60px;">document.getElementById(&#8216;pg_button&#8217;).click();</p>
<p style="padding-left: 30px;">}<br />
&lt;/script&gt;<br />
&lt;form name=&#8217;pg_frm&#8217; method=&#8217;post&#8217;&gt;</p>
<p style="padding-left: 60px;">&lt;input type=&#8217;hidden&#8217; name=&#8217;pg_serviceid&#8217; value=&#8217;&lt;?=$pg_serviceid;?&gt;&#8217;&gt;<br />
&lt;input type=&#8217;hidden&#8217; name=&#8217;pg_currency&#8217; value=&#8217;&lt;?=$pg_currency;?&gt;&#8217;&gt;<br />
&lt;input type=&#8217;hidden&#8217; name=&#8217;pg_price&#8217; value=&#8217;&lt;?=$pg_price;?&gt;&#8217;&gt;<br />
&lt;input type=&#8217;hidden&#8217; name=&#8217;pg_name&#8217; value=&#8217;&lt;?=$pg_name;?&gt;&#8217;&gt;<br />
&lt;input type=&#8217;hidden&#8217; name=&#8217;pg_notify_url&#8217; value=&#8217;&lt;?=$pg_notify_url;?&gt;&#8217;&gt;<br />
&lt;input type=&#8217;hidden&#8217; name=&#8217;pg_return_url&#8217; value=&#8217;&lt;?=$pg_return_url;?&gt;&#8217;&gt;<br />
&lt;input type=&#8217;hidden&#8217; name=&#8217;pg_cancel_url&#8217; value=&#8217;&lt;?=$pg_cancel_url;?&gt;&#8217;&gt;<br />
&lt;center&gt;<br />
&lt;input type=&#8217;image&#8217; name=&#8217;pg_button&#8217; id=&#8217;pg_button&#8217; class=&#8217;paygol&#8217; src=&#8217;&lt;?=$pg_button;?&gt;&#8217; border=&#8217;0&#8242; alt=&#8217;PayGol&#8217; title=&#8217;PayGol&#8217; onClick=&#8217;pg_reDirect(this.form)&#8217;&gt;&lt;br&gt;<br />
&lt;input type=&#8221;submit&#8221; onClick=&#8217;pg_reDirect(this.form)&#8217; value=&#8221;&lt;?php _e(&#8216;Continue&#8217;,'appthemes&#8217;);?&gt; &amp;rsaquo;&amp;rsaquo;&#8221; /&gt;&lt;/center&gt;<br />
&lt;script type=&#8221;text/javascript&#8221;&gt; setTimeout(&#8220;pgredirect()&#8221;,500); &lt;/script&gt;</p>
<p style="padding-left: 30px;">&lt;/form&gt;</p>
<p>&lt;?php<br />
}<br />
?&gt;</p>
<p style="padding-left: 60px;">
</blockquote>
<p>This script acquire the payment data based on the post_id, prepare the form for the payment, then redirects the user to the PayGol website, where the can finish the payment. When the payment finished, the user will be redirected to the success or cancel URL, what we earlier defined.</p>
<h2>Fifth Step</h2>
<p>The script, what receives the payment info must process the requested data. We can publish the new ad, make it featured, or just update the ad expiration date based on the payment info.</p>
<blockquote><p>wp_publish_post($post_id);<br />
stick_post($post_id);<br />
update_post_meta($post_id, &#8216;cp_sys_expire_date&#8217;, $new_expire_date);</p></blockquote>
<p>I hope this small description will help you to add PayGol or any other payment gateway solution to your classipress powered site.<br />
<a href="http://utd.hu/wp-content/uploads/2011/07/2011-07-18_103755.png"><img class="size-full wp-image-285 aligncenter" title="2011-07-18_103755" src="http://utd.hu/wp-content/uploads/2011/07/2011-07-18_103755.png" alt="" width="536" height="427" /></a></p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://utd.hu/add-paygol-payment-gateway-to-classipress-sites/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How can you expand your site easily with SEO friendly URL-s</title>
		<link>http://utd.hu/how-can-you-expand-your-site-easily-with-seo-friendly-url-s</link>
		<comments>http://utd.hu/how-can-you-expand-your-site-easily-with-seo-friendly-url-s#comments</comments>
		<pubDate>Fri, 24 Jun 2011 18:55:12 +0000</pubDate>
		<dc:creator>utd</dc:creator>
				<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://utd.hu/?p=273</guid>
		<description><![CDATA[I had to expand a site to handle SEO-friendly URL-s. The site was not based on a CMS, but had lot of posts in the database, so I had to do something what isn&#8217;t change the actual structure, because the site had lot of references from other sites. I solved the problem with two easy [...]]]></description>
			<content:encoded><![CDATA[<p>I had to expand a site to handle SEO-friendly URL-s. The site was not based on a CMS, but had lot of posts in the database, so I had to do something what isn&#8217;t change the actual structure, because the site had lot of references from other sites.</p>
<p>I solved the problem with two easy steps.</p>
<p><span id="more-273"></span></p>
<h2>First step</h2>
<h3>Add SEO friendly URL-s to the posts.</h3>
<p>First, I added a new field to the database table what containd the posts, named <span style="color: #888888;"><strong>POST_SEO</strong></span> varchar(1000).</p>
<p>Then I added the following code after the script what saved the post data into the database. (Oh yes, I needed the hungarian characters too in the SEO title, thats why they are in the preg_replace pattern. The variable <span style="color: #888888;"><strong>$pid</strong></span> contained the post_id of the edited or inserted post. The <span style="color: #888888;"><strong>$pseo</strong></span> variable contained the string what the user typed into the SEO-Title field. If this field was empty I created the SEO-Title from the Post-Title. Then I checked the database. If there I founded a pot , what has the same SEO-Title, I just added the post_id to the end of the title, and finally updated the record in the database.</p>
<blockquote><p>if ($pseo==&#8221;")</p>
<p style="padding-left: 30px;">$pseo= preg_replace(&#8220;/[^A-Za-z0-9áÁéÉóÓőŐöÖüÜúÚűŰíÍ_]/&#8221;,&#8221;",str_replace(&#8221; &#8220;,&#8221;_&#8221;,$post_title));</p>
<p>else</p>
<p style="padding-left: 30px;">$pseo= preg_replace(&#8220;/[^A-Za-z0-9áÁéÉóÓőŐöÖüÜúÚűŰíÍ_]/&#8221;,&#8221;",str_replace(&#8221; &#8220;,&#8221;_&#8221;,$pseo));</p>
<p>$sql=&#8221;select * from post where post_seo=&#8217;$pseo&#8217; and post_id&lt;&gt;$pid&#8221;;<br />
$psr=mysql_query($sql);<br />
if (mysql_numrows($psr)&gt;0)</p>
<p style="padding-left: 30px;">$pseo.=&#8221;_&#8221;.$pid;</p>
<p>$sql=&#8221;update post set post_seo=&#8217;&#8221;.addslashes($pseo).&#8221;&#8216; where post_id=$pid&#8221;;<br />
mysql_query($sql);</p></blockquote>
<p>&nbsp;</p>
<h3>One and half step</h3>
<p>When I want to show links to the post with the new SEO-Title, just needed to build the anchor in the following format;</p>
<blockquote><p>&lt;a href=&#8221;http://www.oursite.com?<span style="color: #333333;"><strong>$post_seo</strong></span>&#8220;&gt;<strong>$post_title</strong>&lt;/a&gt;</p></blockquote>
<p>Yes, the variable <strong><span style="color: #888888;">$post_seo</span></strong> containes the SEO-Title, and the <span style="color: #888888;"><strong>$post_title</strong></span> contains the title of the post.</p>
<p>&nbsp;</p>
<h2>Second step</h2>
<h3>Find the appropriate post based on the URL.</h3>
<p>When the users hit the link what redirects them to our site, the index.php runs first in case of the new SEO-Title URL-s.</p>
<p>On the top of the index.php, we have to add the following code. The database connection must be there before this code part. In this case, the SEO-Title was the only one URL parameter, so we tried to process SEO-Titles only when we had one parameter.</p>
<blockquote><p>if (count($_GET)==1 )<br />
{</p>
<p style="padding-left: 30px;">unset($post_id);<br />
reset($_GET);<br />
while (list($key,$value) = each($_GET))<br />
{</p>
<p style="padding-left: 60px;">$sql=&#8221;select post_id from post where post_seo=&#8221;$key&#8221;;<br />
$result=@mysql_query($sql);<br />
if (@mysql_numrows($result)!=0)<br />
{</p>
<p style="padding-left: 90px;">$post_id=mysql_result($reasult,0,0);</p>
<p style="padding-left: 90px;">include &#8220;showpost.php&#8221;;</p>
<p style="padding-left: 90px;">include &#8220;footer.php&#8221;</p>
<p style="padding-left: 90px;">exit;</p>
<p style="padding-left: 60px;">}</p>
<p style="padding-left: 30px;">}</p>
<p>}</p></blockquote>
<p>If we found the post based on the URL parameter&#8217;s name, we call the include what show the post content, then we show the footer and close the page, otherwise let the index.php finish the rest.</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://utd.hu/how-can-you-expand-your-site-easily-with-seo-friendly-url-s/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tweet from PHP</title>
		<link>http://utd.hu/tweet-from-php</link>
		<comments>http://utd.hu/tweet-from-php#comments</comments>
		<pubDate>Wed, 15 Jun 2011 08:18:22 +0000</pubDate>
		<dc:creator>utd</dc:creator>
				<category><![CDATA[Twitter]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://utd.hu/?p=255</guid>
		<description><![CDATA[I have to add some extension to a site, to post tweets onto the site&#8217;s Twitter account, when a new post submitted. I tried some version, first the old way with curl, then some versions with oAuth, but all solution based on a manual user login. I don&#8217;t want to force the site admin, to [...]]]></description>
			<content:encoded><![CDATA[<p>I have to add some extension to a site, to post tweets onto the site&#8217;s Twitter account, when a new post submitted. I tried some version, first the old way with curl, then some versions with oAuth, but all solution based on a manual user login. I don&#8217;t want to force the site admin, to every time log in to the twitter too, when submits a post.</p>
<p>Finally I found the most easy solution, what don&#8217;t need any specialties. The solution is based on the post of Jaisen Mathai <a href="http://www.jaisenmathai.com/articles/twitter-php-oauth.html" target="_blank">http://www.jaisenmathai.com/articles/twitter-php-oauth.html</a></p>
<p><span id="more-255"></span></p>
<p>The steps;</p>
<p>&nbsp;</p>
<p>1. Register the application on the Twitter as Browser application.</p>
<p>2. Add the following part to the PHP code of your site; (The EpiCurl,EpiOAuth,EpiTwitter are downloadable from this site; <a href="http://www.jaisenmathai.com/articles/twitter-php-oauth.html" target="_blank">http://www.jaisenmathai.com/articles/twitter-php-oauth.html</a> )</p>
<blockquote><p>include &#8216;twitter/EpiCurl.php&#8217;;<br />
include &#8216;twitter/EpiOAuth.php&#8217;;<br />
include &#8216;twitter/EpiTwitter.php&#8217;;<br />
include &#8216;twitter/secret.php&#8217;;  <span style="color: #99cc00;"> &lt;&#8211; the secret.php contains the consumer_key &amp; consumer_secret values.</span></p>
<p>$twitterObj = new EpiTwitter($consumer_key, $consumer_secret);<br />
$oauth_token = &#8220;<em>&#8212;&gt; the oauth token from the twitter &lt;&#8212;</em>&#8220;;<br />
$oauth_secret = &#8220;<em>&#8212;&gt; the oauth token secret from the twitter &lt;&#8212;</em>&#8220;;<br />
$twitterObj-&gt;setToken($oauth_token, $oauth_secret);<br />
$message=&#8221;<em>&#8212;&gt; The message, what you want to post onto the twitter &lt;&#8212;</em>&#8220;;<br />
$update_status = $twitterObj-&gt;post_statusesUpdate(array(&#8216;status&#8217; =&gt; $message));<br />
$temp = $update_status-&gt;response;<br />
<em>&#8212;&gt;code if you want to process the response&lt;&#8212;</em></p></blockquote>
<p>This small codepart will send the tweet when you call the function, without you have to login onto the twitter manually.</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://utd.hu/tweet-from-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

