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

<channel>
	<title>Cedik's blog</title>
	<atom:link href="http://cedik.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://cedik.com</link>
	<description>Php, SEO, webdesign and such...</description>
	<pubDate>Sat, 30 May 2009 19:31:28 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>English exam composition</title>
		<link>http://cedik.com/2009/05/28/english-exam-composition/</link>
		<comments>http://cedik.com/2009/05/28/english-exam-composition/#comments</comments>
		<pubDate>Thu, 28 May 2009 09:32:13 +0000</pubDate>
		<dc:creator>Cedik</dc:creator>
		
		<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://cedik.com/?p=26</guid>
		<description><![CDATA[When I was in my second year of college (I&#8217;m in the third now), I had an English exam in the winter. One of the subjects required us to do a composition based on certain keywords, like eccentric, visionary, software program, on-line shopping, boost and a few others, but the subject was free of choice. [...]]]></description>
			<content:encoded><![CDATA[<p>When I was in my second year of college (I&#8217;m in the third now), I had an English exam in the winter. One of the subjects required us to do a composition based on certain keywords, like eccentric, visionary, software program, on-line shopping, boost and a few others, but the subject was free of choice. Because we were at an Informatics college, we were supposed to write about something related to that topic and the keywords were giving us a hint to write about Apple and Steve Jobs, since we studied an article about him that semester, where he was presented as an eccentric and visionary guy, but since I was really bored at that time, I decided to write something different.</p>
<p>Here it goes!<span id="more-26"></span></p>
<p class="MsoNormal">One day, an eccentric guy who thought himself to be a visionary tried to develop a software program that would allow the computer to fly using the cooler as a propeller. Of course, this was a complete failure as the machine had absolutely no intention to fly. But since that guy was an eccentric as in “nuts”, this was only a boost to his morale. He attached even more coolers to the computer, sticking them with duck tape but even so, you can’t turn a Pentium into a Boeing.</p>
<p class="MsoNormal">“Hmm”, he thought, “this is bad news for me since I planned to create an on-line shopping empire that would have the flying computers as the top merchandise. What to do, what to do?”</p>
<p class="MsoNormal">He looked at the computer lying on the floor. It had about 20 coolers attached to it and it still wasn’t able to fly. Or in other words, it was able to fly just like a concrete brick would.</p>
<p class="MsoNormal">-“Hmm”, he thought again, “maybe propellers aren’t the answer. After all, the first thing that was able to fly and was made by humans was the plane, not the helicopter. Well, that is of course if I don’t take into account the witches broom or the flying carpet. But they wouldn’t look good on a computer so I’ll stick to the wings idea!”</p>
<p class="MsoNormal">He un-duck taped the coolers (I just made that word up) and he attached a pair of wings to the computer. Then, he threw it over the balcony in order to see it fly.</p>
<p class="MsoNormal">Now, our eccentric visionary is in jail since the mayor’s car was passing just underneath his balcony. But that’s ok with him because now he has time to develop his greatest invention, the swimming tie. Let’s wish him the best of luck and keep our fingers crossed.</p>
<p class="MsoNormal">Go and make the world a better place, eccentric visionary guy!</p>
]]></content:encoded>
			<wfw:commentRss>http://cedik.com/2009/05/28/english-exam-composition/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to monetize the images from your site</title>
		<link>http://cedik.com/2008/12/16/how-to-monetize-the-images-from-your-site/</link>
		<comments>http://cedik.com/2008/12/16/how-to-monetize-the-images-from-your-site/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 23:19:01 +0000</pubDate>
		<dc:creator>Cedik</dc:creator>
		
		<category><![CDATA[Php tricks]]></category>

		<category><![CDATA[monetize images]]></category>

		<guid isPermaLink="false">http://cedik.com/?p=22</guid>
		<description><![CDATA[I ran across that problem when a friend of mine asked me to help him with something. He has a number of successful blogs and he receives quite a large number of visitors from Google Images so he wanted a specific plugin to help him place ads around an image so everytime a visitor would [...]]]></description>
			<content:encoded><![CDATA[<p>I ran across that problem when <a title="nosfer" href="http://nosfer.ro">a friend of mine</a> asked me to help him with something. He has a number of successful blogs and he receives quite a large number of visitors from Google Images so he wanted a specific plugin to help him place ads around an image so everytime a visitor would click the &#8220;Show original picture&#8221; link, he would&#8217;t just see the image, but also some ads. I didn&#8217;t manage to complete a solution for that (yet) but I did manage to start off a little something&#8230;<span id="more-22"></span></p>
<p>Let&#8217;s say you have a thumbnail of a picture on your site. Everytime someone clicks on the thumbnail, he is redirected to the full-size image. But why not show that image surrounded by ads?</p>
<p>Here&#8217;s what you need to do&#8230;</p>
<p>First of all, make sure you have all your images (the full-sized ones) in the same folder. Than, simply link the thumbnail to yoursite.com/image.php?image=image-name.jpg</p>
<p>Now, I&#8217;ll show you how to make that image.php file. Here&#8217;s the code</p>
<blockquote><p>&lt;?php<br />
$image_name=$_GET['image'];<br />
$image_path=&#8221;imagefolder&#8221;;<br />
$ads_top=&#8217; &#8216;;<br />
$ads_down=&#8217; &#8216;;<br />
$ads_left=&#8217; &#8216;;<br />
$ads_right=&#8217; &#8216;;<br />
echo &#8221;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Image &#8220;.$image_name.&#8221;&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body style=\&#8221;margin-top:20px;\&#8221;&gt;<br />
&lt;center&gt;<br />
&#8220;.$ads_top.&#8221;<br />
&lt;br&gt;<br />
&lt;br&gt;<br />
&lt;table border=\&#8221;0\&#8221; cellpadding=\&#8221;0\&#8221; cellspacing=\&#8221;0\&#8221; width=\&#8221;95%\&#8221;&gt;<br />
&lt;tr&gt;<br />
&lt;td width=\&#8221;180px\&#8221;&gt;<br />
&#8220;.$ads_left.&#8221;<br />
&lt;/td&gt;<br />
&lt;td&gt;<br />
&lt;img src=\&#8221;".$image_path.&#8221;/&#8221;.$image_name.&#8221;\&#8221;&gt;<br />
&lt;/td&gt;<br />
&lt;td width=\&#8221;180px\&#8221;&gt;<br />
&#8220;.$ads_right.&#8221;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
&#8220;.$ads_bottom.&#8221;<br />
&lt;/center&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
&#8220;;<br />
?&gt;</p></blockquote>
<p>Now, let&#8217;s explain&#8230; $image_path must have the path to the folder with images. Im my case, they are in the &#8220;imagefolder&#8221; folder. And where you see the $ads variables, just paste there the ad code that you want to be displayed.</p>
<p>Note that this is just a starting point. I&#8217;m going to develop this into a real plugin, but it will take some time. Meanwhile&#8230; maybe someone here needs this small modification.</p>
]]></content:encoded>
			<wfw:commentRss>http://cedik.com/2008/12/16/how-to-monetize-the-images-from-your-site/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A new beggining</title>
		<link>http://cedik.com/2008/12/15/a-new-beggining/</link>
		<comments>http://cedik.com/2008/12/15/a-new-beggining/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 20:56:23 +0000</pubDate>
		<dc:creator>Cedik</dc:creator>
		
		<category><![CDATA[personal]]></category>

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

		<guid isPermaLink="false">http://cedik.com/?p=17</guid>
		<description><![CDATA[It&#8217;s been a while since I posted something here, I&#8217;m pretty sure that this blog has runned out of visitors already but still&#8230; I belive a comeback post is quite necessary.
As I said, it&#8217;s been a while since my last post. I kind of gave up on blogging in english but I didn&#8217;t gave up [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since I posted something here, I&#8217;m pretty sure that this blog has runned out of visitors already but still&#8230; I belive a comeback post is quite necessary.</p>
<p>As I said, it&#8217;s been a while since my last post. I kind of gave up on blogging in english but I didn&#8217;t gave up on my other blog, the one written in my native language so, before I knew it, I started to enjoy blogging so that&#8217;s why I decided to revive this one too. It&#8217;s actually a shame I gave up on him. I mean, I think I know english at a decent level, I believe I might find some subjects to blog about&#8230; I should manage to handle this blog too. So here a gow with a new post on this newly relaunched blog about a new beginning!</p>
<p>Happy posting to me!</p>
<script type="text/javascript"><!--
google_ad_client = "pub-7567168275518252";
/* 468x60 after post english blog */
google_ad_slot = "1348942353";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>]]></content:encoded>
			<wfw:commentRss>http://cedik.com/2008/12/15/a-new-beggining/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Blog review: Roshan&#8217;s blog</title>
		<link>http://cedik.com/2008/06/12/blog-review-roshans-blog/</link>
		<comments>http://cedik.com/2008/06/12/blog-review-roshans-blog/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 14:17:14 +0000</pubDate>
		<dc:creator>Cedik</dc:creator>
		
		<category><![CDATA[Blog review]]></category>

		<guid isPermaLink="false">http://cedik.com/2008/06/12/blog-review-roshans-blog/</guid>
		<description><![CDATA[Today, I&#8217;m going to tell about a blog that I happen to read, Roshan&#8217;s blog.
Ace color mood for the blog. I like the way how posts are assorted by date,  month and year. I enjoy the quick quotations available in the blog. I cannot  help but stare why such ideas were not discussed [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I&#8217;m going to tell about a blog that I happen to read, <a href="http://roshanbh.com.np/" title="roshan's blog">Roshan&#8217;s blog</a>.</p>
<p>Ace color mood for the blog. I like the way how posts are assorted by date,  month and year. I enjoy the quick quotations available in the blog. I cannot  help but stare why such ideas were not discussed already. I could not stop but  admit with every line the writer has penned. The site appeals you to read again.  Interesting clickable links can be discovered within each post. The blog&#8217;s  writer holds on the quality in each post. I enjoy the background colors, anyone  can read everything without doubt. I love the logo of the site. The posts titles  makes you want to see more. I enjoy the real life demonstrations and  illustrations blog frequently appeals to.<span id="more-15"></span> It is an interesting site with a nice  visual appeal. It&#8217;s great to observe how the illustrations are always the best  size. Absolutely like the simplicity with which even topmost difficult topics  are written. Enjoying the sense of humor in the articles. Like the way the blog  caters to young and old visitors even. Real original approach and priceless  articles on this site, love it. Frequently gives you the impression : why I  hadn&#8217;t think of that. The formidable appearance and mood of this site set my  cast for reading on it. The method the knowledge has been placed proves the great knowing  and analysis the writer has done.</p>
<p>I learned a lot of things from that blog, and I hope others will do too! And you know what I like about that blog the most? Post like <a href="http://roshanbh.com.np/2008/06/letter-to-bill-gates-problem-with-microsofts-products.html" title="funny post">this one</a>, that can also make your day more happier!</p>
]]></content:encoded>
			<wfw:commentRss>http://cedik.com/2008/06/12/blog-review-roshans-blog/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to make a php feedback form</title>
		<link>http://cedik.com/2008/06/07/how-to-make-a-php-feedback-form/</link>
		<comments>http://cedik.com/2008/06/07/how-to-make-a-php-feedback-form/#comments</comments>
		<pubDate>Sat, 07 Jun 2008 19:42:54 +0000</pubDate>
		<dc:creator>Cedik</dc:creator>
		
		<category><![CDATA[Php tricks]]></category>

		<guid isPermaLink="false">http://cedik.com/2008/06/07/how-to-make-a-php-feedback-form/</guid>
		<description><![CDATA[I recently started coding a site, based on theme made in Photoshop for one of my friends and I also had to make my own feedback form for that site, where the visitors could leave their opinion about the site. This feedback page also has the possibility to limit the number of characters that can [...]]]></description>
			<content:encoded><![CDATA[<p>I recently started coding a site, based on theme made in Photoshop for one of my <a href="http://agx-themes.net" title="agx-themes">friends</a> and I also had to make my own feedback form for that site, where the visitors could leave their opinion about the site. This feedback page also has the possibility to limit the number of characters that can be posted, and it also display how much of those characters you have used, thanks to a javascript code taken from <a href="http://dynamicdrive.com" title="dynamic drive">DynamicDrive</a>. In order to use this feedback form, you&#8217;ll also need a MySql database and access to it.  First of all, insert this code in the head of your document (it&#8217;s used for the part that limits the number of characters in the comment)<span id="more-14"></span></p>
<blockquote><p>&lt;style type=&#8221;text/css&#8221;&gt;</p>
<p>.progress{<br />
width: 1px;<br />
height: 14px;<br />
color: white;<br />
font-size: 12px;<br />
overflow: hidden;<br />
background-color: navy;<br />
padding-left: 5px;<br />
}</p>
<p>&lt;/style&gt;</p>
<p>&lt;script type=&#8221;text/JavaScript&#8221;&gt;</p>
<p>/***********************************************<br />
* Form Field Progress Bar- By Ron Jonk- http://www.euronet.nl/~jonkr/<br />
* Modified by Dynamic Drive for minor changes<br />
* Script featured/ available at Dynamic Drive- http://www.dynamicdrive.com<br />
* Please keep this notice intact<br />
***********************************************/</p>
<p>function textCounter(field,counter,maxlimit,linecounter) {<br />
// text width//<br />
var fieldWidth =  parseInt(field.offsetWidth);<br />
var charcnt = field.value.length;</p>
<p>// trim the extra text<br />
if (charcnt &gt; maxlimit) {<br />
field.value = field.value.substring(0, maxlimit);<br />
}</p>
<p>else {<br />
// progress bar percentage<br />
var percentage = parseInt(100 - (( maxlimit - charcnt) * 100)/maxlimit) ;<br />
document.getElementById(counter).style.width =  parseInt((fieldWidth*percentage)/100)+&#8221;px&#8221;;<br />
document.getElementById(counter).innerHTML=&#8221;Limit: &#8220;+percentage+&#8221;%&#8221;<br />
// color correction on style from CCFFF -&gt; CC0000<br />
setcolor(document.getElementById(counter),percentage,&#8221;background-color&#8221;);<br />
}<br />
}</p>
<p>function setcolor(obj,percentage,prop){<br />
obj.style[prop] = &#8220;rgb(80%,&#8221;+(100-percentage)+&#8221;%,&#8221;+(100-percentage)+&#8221;%)&#8221;;<br />
}</p>
<p>&lt;/script&gt;</p></blockquote>
<p><code></p>
<style type="text/css">  .progress{ 	width: 1px; 	height: 14px; 	color: white; 	font-size: 12px;   overflow: hidden; 	background-color: navy; 	padding-left: 5px; }  </style>
<p> </code></p>
<p><script type="text/JavaScript">   /*********************************************** * Form Field Progress Bar- By Ron Jonk- http://www.euronet.nl/~jonkr/ * Modified by Dynamic Drive for minor changes * Script featured/ available at Dynamic Drive- http://www.dynamicdrive.com * Please keep this notice intact ***********************************************/  function textCounter(field,counter,maxlimit,linecounter) { 	// text width// 	var fieldWidth =  parseInt(field.offsetWidth); 	var charcnt = field.value.length;          	// trim the extra text 	if (charcnt > maxlimit) {  		field.value = field.value.substring(0, maxlimit); 	}  	else {  	// progress bar percentage 	var percentage = parseInt(100 - (( maxlimit - charcnt) * 100)/maxlimit) ; 	document.getElementById(counter).style.width =  parseInt((fieldWidth*percentage)/100)+"px"; 	document.getElementById(counter).innerHTML="Limit: "+percentage+"%" 	// color correction on style from CCFFF -> CC0000 	setcolor(document.getElementById(counter),percentage,"background-color"); 	} }  function setcolor(obj,percentage,prop){ 	obj.style[prop] = &#8220;rgb(80%,&#8221;+(100-percentage)+&#8221;%,&#8221;+(100-percentage)+&#8221;%)&#8221;; }  </script>   Next, you&#8217;ll need to make a config.php file, that will contain the details needed for the database connexion.  The code needed for that file is the following:</p>
<blockquote><p> &lt;?php<br />
$db_host=&#8221;localhost&#8221;;<br />
$db_user=&#8221;your username&#8221;;<br />
$db_pass=&#8221;your password&#8221;;<br />
$db_name=&#8221;the database name&#8221;;<br />
?&gt;</p></blockquote>
<p>Now that you&#8217;re done, you should make a table to store the comments in, and make sure you&#8217;ll make in the database you declared above, in the config file. You can do it by running the following sql query:</p>
<blockquote><p> CREATE TABLE `ak_comments` (<br />
`id` int(11) NOT NULL auto_increment,<br />
`date` text NOT NULL,<br />
`nume` text NOT NULL,<br />
`mail` text NOT NULL,<br />
`comment` text NOT NULL,<br />
PRIMARY KEY  (`id`)<br />
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=20 ;</p></blockquote>
<p>Ok, so you have a config.php file and a database where to store the comments. You should also make sure that this feedback form will be sure and have some protection against hacking attempts like a SQL injection or Cross-site Scripting. You&#8217;ll do this by making another php file, secure.php, which will contain a function that makes it very difficult for hackers to insert malicious codes inside your form.</p>
<blockquote><p> &lt;?php<br />
function secure($input)<br />
{<br />
$badchars = array(&#8221;&lt;&#8221;, &#8220;&gt;&#8221;, &#8220;/&#8221;, &#8220;&#8216;&#8221;, &#8220;\&#8221;", &#8220;;&#8221;);<br />
$input = str_replace($badchars, &#8220;&#8221;, $input);<br />
return $input;<br />
}<br />
?&gt;</p></blockquote>
<p>It&#8217;s not the best function, but it will do the trick, that&#8217;s sure. Now, make another function, so you&#8217;ll be able to have your comments displayed on more than one page. If you&#8217;ll get more than 10-20 comments, I doubt it you will want to have them all displayed on the same page. So, make a pages.php file with the following code:</p>
<blockquote><p> &lt;?php<br />
function pages()<br />
{<br />
global $total_comm;<br />
$i=1;<br />
if($total_comm&gt;10)<br />
{<br />
$no=$total_comm/10;<br />
do<br />
{<br />
echo &#8220;&lt;a href=\&#8221;feedback.php?page=&#8221;.$i.&#8221;\&#8221;&gt;&#8221;.$i.&#8221;&lt;/a&gt; &#8220;;<br />
$i++;<br />
$no&#8211;;<br />
}<br />
while($no&gt;0);<br />
}<br />
}<br />
?&gt;</p></blockquote>
<p>Finally, here&#8217;s the code for the feedback form.</p>
<blockquote><p> &lt;?php<br />
include (&#8221;config.php&#8221;);<br />
include (&#8221;secure.php&#8221;);<br />
include (&#8221;pages.php&#8221;);<br />
$conexiune=mysql_connect($db_host,$db_user,$db_pass) or die(&#8221;Erorr!&#8221;);<br />
@mysql_select_db($db_name) or die(&#8221;Erorr2!&#8221;);</p>
<p>echo &#8220;&lt;strong&gt;Feedback form&#8217;s name&lt;/strong&gt;&lt;br&gt;&#8221;;</p>
<p>if($_POST)<br />
{<br />
$nume=$_POST['nume'];<br />
$mail=$_POST['mail'];<br />
$date=$_POST['data'];<br />
$comm=$_POST['maxcharfield'];<br />
mysql_query(&#8221;INSERT INTO `ak_comments` (`id` ,`date` ,`nume` ,`mail` ,`comment`) VALUES (NULL , &#8216;$date&#8217;, &#8216;$nume&#8217;, &#8216;$mail&#8217;, &#8216;$comm&#8217;);&#8221;);<br />
}<br />
$query=mysql_query(&#8221;SELECT * FROM `ak_comments`&#8221;);<br />
$total_comm=mysql_num_rows($query);<br />
$page=$_GET['page'];<br />
if($page!=0&amp;&amp;$page!=1)<br />
$ini=$page*10-10;<br />
else<br />
$ini=0;</p>
<p>$query=mysql_query(&#8221;SELECT * FROM `ak_comments` ORDER BY id DESC LIMIT $ini,10&#8243;);<br />
while($row = mysql_fetch_array($query))<br />
{<br />
echo &#8220;&lt;strong&gt;&#8221;.$row['nume'].&#8221;&lt;/strong&gt; said at  &#8220;.$row['date'].&#8221;:&lt;br&gt;&#8221;.$row['comment'].&#8221;&lt;br&gt;&#8221;;<br />
}<br />
pages();</p>
<p>echo &#8220;&lt;br&gt;What do you think?&lt;br&gt;&lt;form method=\&#8221;POST\&#8221; action=\&#8221;feedback.php\&#8221;&gt;&#8221;;<br />
echo &#8220;Name :&lt;input type=\&#8221;text\&#8221; name=\&#8221;nume\&#8221; value=\&#8221;\&#8221;&gt;&lt;br&gt;&#8221;;<br />
echo &#8220;Mail :&lt;input type=\&#8221;text\&#8221; name=\&#8221;mail\&#8221; value=\&#8221;\&#8221;&gt;&lt;br&gt;&#8221;;<br />
$date=date(&#8221;d-m-Y&#8221;);<br />
echo &#8220;&lt;input type=\&#8221;hidden\&#8221; name=\&#8221;data\&#8221; value=\&#8221;".$date.&#8221;\&#8221;&gt;&lt;br&gt;&#8221;;<br />
echo &#8216;&lt;textarea rows=&#8221;5&#8243; cols=&#8221;40&#8243; name=&#8221;maxcharfield&#8221; id=&#8221;maxcharfield&#8221;<br />
onKeyDown=&#8221;textCounter(this,\&#8217;progressbar1\&#8217;,1000)&#8221;<br />
onKeyUp=&#8221;textCounter(this,\&#8217;progressbar1\&#8217;,1000)&#8221;<br />
onFocus=&#8221;textCounter(this,\&#8217;progressbar1\&#8217;,1000)&#8221; &gt;&lt;/textarea&gt;&lt;br /&gt;</p>
<p>&lt;div id=&#8221;progressbar1&#8243; class=&#8221;progress&#8221;&gt;&lt;/div&gt;</p>
<p>&lt;script&gt;textCounter(document.getElementById(&#8221;maxcharfield&#8221;),&#8221;progressbar1&#8243;,20)&lt;/script&gt;&#8217;;<br />
echo &#8220;&lt;input type=\&#8221;submit\&#8221; name=\&#8221;submit\&#8221; value=\&#8221;Send\&#8221;&gt;&lt;br&gt;&#8221;;<br />
mysql_close($conexiune);<br />
?&gt;</p></blockquote>
<p>Just insert this where you want your feedback form to be displayed. Also, this will display only 10 comments per page, in the following manner:</p>
<blockquote><p><strong>Name</strong> said at 07-06-2008:</p>
<p>His comment</p></blockquote>
<p>After those 10 comments, the feedback form will appear. Also, the comments who are the most recent are displayed first. If you want to display more than 10 comments per page (or less), just change the underlined value from this line:</p>
<blockquote><p> $query=mysql_query(&#8221;SELECT * FROM `ak_comments` ORDER BY id DESC LIMIT $ini,<strike>10</strike>&#8220;);</p></blockquote>
<p>To change the maximum number of characters allowed in the comment (default is 1000), change the following value in the next lines:</p>
<blockquote><p>onKeyDown=&#8221;textCounter(this,\&#8217;progressbar1\&#8217;,<strike>1000</strike>)&#8221;<br />
onKeyUp=&#8221;textCounter(this,\&#8217;progressbar1\&#8217;,<strike>1000</strike>)&#8221;<br />
onFocus=&#8221;textCounter(this,\&#8217;progressbar1\&#8217;,<strike>1000</strike>)&#8221; &gt;&lt;/textarea&gt;&lt;br /&gt;</p></blockquote>
<p>That was all! You can see a live demo <a href="http://animekaze.net/nr1/feedback.php">here</a>, and if you have any questions at all, just ask me!</p>
]]></content:encoded>
			<wfw:commentRss>http://cedik.com/2008/06/07/how-to-make-a-php-feedback-form/feed/</wfw:commentRss>
		</item>
		<item>
		<title>5 important steps to keep in mind when making a php site</title>
		<link>http://cedik.com/2008/06/04/5-important-steps-to-keep-in-mind-when-making-a-php-site/</link>
		<comments>http://cedik.com/2008/06/04/5-important-steps-to-keep-in-mind-when-making-a-php-site/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 16:28:30 +0000</pubDate>
		<dc:creator>Cedik</dc:creator>
		
		<category><![CDATA[Php tricks]]></category>

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

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

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

		<category><![CDATA[steps in making a php site]]></category>

		<guid isPermaLink="false">http://cedik.com/2008/06/04/5-important-steps-to-keep-in-mind-when-making-a-php-site/</guid>
		<description><![CDATA[First of all, I&#8217;d like to mention that this is not a post for an absolute beginner. This is more of a post for those who work with php and know their way around but who simply don&#8217;t know certain things about how you should make a php page. So, without further adu, the 5 [...]]]></description>
			<content:encoded><![CDATA[<p>First of all, I&#8217;d like to mention that this is not a post for an absolute beginner. This is more of a post for those who work with php and know their way around but who simply don&#8217;t know certain things about how you should make a php page. So, without further adu, the<em> 5 important steps you should keep in mind when making a php site</em> are:</p>
<p>1. Put all the essential data inside a <strong>config.php</strong> file. This way, you won&#8217;t have to rewrite  the passwords and all the <strong>global variables inside each php file</strong>. And by global variables I mean those variables keep their value all over the site. If $var1 has the same value in index.php and gallery.php, why declair it twice?</p>
<p>What are the advantages of this? <span id="more-13"></span>Well, if you need to change something, it will automatically change all over the site, so you won&#8217;t have to edit each file that uses those values.</p>
<p>2. Make all the parts of the site that<strong> remain the same</strong> all over the pages into <strong>separate php files</strong>. For example, make a header.php file, a footer.php file, a menu.php file and so on. It&#8217;s just like I said above: if you need, for example, to add an extra link in the menu, you&#8217;ll just have to edit the menu.php file and not all the pages that run the menu inside them.</p>
<p>This works for the cases where the html part is the same, but the content is different. But I&#8217;ll speak about it on the next step.</p>
<p>3. Keep <strong>separating files</strong> even if their content is different, as long as the structure is the same. For example, if your header will be the same all over the site, but it will have different keywords for each page, make a header.php file that will read it&#8217;s keywords from a mysql database. Depending on what page you are on, it will select different records from the database. If you&#8217;re wondering how to do it, the switch statement is a good answer.</p>
<p>4. This one is a more general statement. When you are making php sites, try to think the pages in manner where the code can do <strong>different things</strong> with <strong>different values</strong>. It&#8217;s good to decrease the sizes of a page. For example, I managed to combine 8 different pages into a single page that does everything those pages did, depending on the values it receives via the POST or the GET method.</p>
<p>5. Make your site <strong>portable</strong>. Don&#8217;t just think that you&#8217;ll only use it on that host for that specific reason. If you could easily move the site to another host and change it&#8217;s template and content, but keep the coding time, you could save yourself from a lot of effort. Basically, think of your site more like a <strong>CMS</strong> than a simple personal website.</p>
]]></content:encoded>
			<wfw:commentRss>http://cedik.com/2008/06/04/5-important-steps-to-keep-in-mind-when-making-a-php-site/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to make a browser reload an image from the server</title>
		<link>http://cedik.com/2008/06/01/how-to-make-a-browser-reload-an-image-from-the-server/</link>
		<comments>http://cedik.com/2008/06/01/how-to-make-a-browser-reload-an-image-from-the-server/#comments</comments>
		<pubDate>Sun, 01 Jun 2008 20:05:22 +0000</pubDate>
		<dc:creator>Cedik</dc:creator>
		
		<category><![CDATA[Php tricks]]></category>

		<category><![CDATA[no-cache]]></category>

		<category><![CDATA[no-store]]></category>

		<guid isPermaLink="false">http://cedik.com/2008/06/01/how-to-make-a-browser-reload-an-image-from-the-server/</guid>
		<description><![CDATA[No-cache and no-store tags not working? It happened to me too. I tried all the tricks: the pragma meta tags, the cache-control meta tags, I even made the page have an expiration date from the past. Useless! All of these tactics were useless agains Internet Explorer and Opera. They only worked on Firefox and Safari.
You [...]]]></description>
			<content:encoded><![CDATA[<p>No-cache and no-store tags not working? It happened to me too. I tried all the tricks: the pragma meta tags, the cache-control meta tags, I even made the page have an expiration date from the past. Useless! All of these tactics were useless agains Internet Explorer and Opera. They only worked on Firefox and Safari.</p>
<p>You see, I made this script that updated an image every time someone went to the next page. The image was modified by the php command before the &lt; img src &gt; tag was output but still&#8230; no matter what I did, IE and Opera used to run that image from their cache, so the user had to reload the page in order to see the newly generated image.  But I managed to get things going.<span id="more-12"></span></p>
<p>The solution was quite a simple one. All you need to do is to turn your static url towards the image into an dynamic one, that changes along with the pages, but also display the same image. Since generating a new image everytime some accessed certain pages would be so not a good idea, I did something else.</p>
<p>I converted the &lt;img src=&#8217;image.gif&#8217;&gt; part into the following one:</p>
<blockquote><p>$r=rand(1,100);</p>
<p>echo &#8220;&lt; img src=&#8217;image.gif?&#8221;.$r&#8221;&#8216;/&gt;&#8221;;</p></blockquote>
<p>The  image.gif link will look like image.gif?45 for an example in the current page and image.gif?1 in the following page. Even though they will act just as if the would have been image.gif, the browser will interpret them as different images. So, even though the same image will be displayed, it will be refreshed every time the browser loads a new page.</p>
<p>The advantage of this method is that it also allows you not to use the no-cache tags and there for, the rest of the content will be cached and the page will load faster.</p>
<p>That was it! I hope this will be as helpful for you as it has been for me!</p>
]]></content:encoded>
			<wfw:commentRss>http://cedik.com/2008/06/01/how-to-make-a-browser-reload-an-image-from-the-server/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to repair tables with a php file</title>
		<link>http://cedik.com/2008/05/30/how-to-repair-tables-with-a-php-file/</link>
		<comments>http://cedik.com/2008/05/30/how-to-repair-tables-with-a-php-file/#comments</comments>
		<pubDate>Fri, 30 May 2008 21:17:57 +0000</pubDate>
		<dc:creator>Cedik</dc:creator>
		
		<category><![CDATA[Php tricks]]></category>

		<category><![CDATA[how to repair a crashed table]]></category>

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

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

		<category><![CDATA[repair table]]></category>

		<guid isPermaLink="false">http://cedik.com/2008/05/30/how-to-repair-tables-with-a-php-file/</guid>
		<description><![CDATA[I just run recently on a problem that was affecting a forum that I administer. One of the forum&#8217;s table was marked as crashed and therefor the whole site wasn&#8217;t working. Since I&#8217;m not the root admin, I do not have complete access at the site&#8217;s resources. If I&#8217;d had mysql access, this could have [...]]]></description>
			<content:encoded><![CDATA[<p>I just run recently on a problem that was affecting a forum that I administer. One of the forum&#8217;s table was marked as crashed and therefor the whole site wasn&#8217;t working. Since I&#8217;m not the root admin, I do not have complete access at the site&#8217;s resources. If I&#8217;d had mysql access, this could have been fixed easily. But I didn&#8217;t have. And I couldn&#8217;t wait for the root admin to come on-line, I had to do something. Fortunately, I did had ftp access so I made a php file that could fix that table for me. Here is the code:<span id="more-11"></span></p>
<p><code></code></p>
<blockquote><p>&lt;?php<br />
$db_server = &#8216;localhost&#8217;;<br />
$db_name = &#8216;  &#8216;;<br />
$db_user = &#8216;  &#8216;;<br />
$db_passwd = &#8216;  &#8216;;<br />
function secure($input)<br />
{<br />
$badchars = array(&#8221;&lt;&#8221;, &#8220;&gt;&#8221;, &#8220;/&#8221;, &#8220;&#8216;&#8221;, &#8220;\&#8221;", &#8220;;&#8221;,&#8221;*&#8221;, &#8220;FROM&#8221;,&#8221;SELECT&#8221;,&#8221; &#8220;);<br />
$input = str_replace($badchars, &#8220;&#8221;, $input);<br />
return $input;<br />
}<br />
if($_POST)<br />
{<br />
$db_table=$_POST['table'];<br />
$db_table=secure($db_table);<br />
$conexiune=mysql_connect($db_server,$db_user,$db_passwd) or die(&#8221;Erorr!&#8221;);<br />
@mysql_select_db($db_name) or die(&#8221;Erorr2!&#8221;);<br />
mysql_query(&#8221;REPAIR TABLE $db_table&#8221;);<br />
echo &#8220;Done!&#8221;;<br />
}<br />
else<br />
{<br />
echo &#8220;&lt;form method=&#8217;POST&#8217; action=&#8217;repair.php&#8217;&gt;&#8221;;<br />
echo &#8220;Insert here the table&#8217;s name : &lt;input type=&#8217;text&#8217; name=&#8217;table&#8217; value=&#8221;&gt;&#8221;;<br />
echo &#8220;&lt;br&gt;&lt;input type=&#8217;submit&#8217; name=&#8217;submit&#8217; value=&#8217;Repair&#8217;&gt;&lt;/form&gt;&#8221;;<br />
}<br />
?&gt;</p></blockquote>
<p>All you have to do is to upload that file somewhere in the root and run it. Then, type in the table marked as crashed&#8217;s name and press repair. That&#8217;s it! It worked for me!</p>
]]></content:encoded>
			<wfw:commentRss>http://cedik.com/2008/05/30/how-to-repair-tables-with-a-php-file/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Php-fusion pet shop infusion</title>
		<link>http://cedik.com/2008/05/12/php-fusion-pet-shop-infusion/</link>
		<comments>http://cedik.com/2008/05/12/php-fusion-pet-shop-infusion/#comments</comments>
		<pubDate>Mon, 12 May 2008 08:10:56 +0000</pubDate>
		<dc:creator>Cedik</dc:creator>
		
		<category><![CDATA[Php-fusion CMS]]></category>

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

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

		<category><![CDATA[pet shop]]></category>

		<category><![CDATA[pet shop infusion]]></category>

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

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

		<category><![CDATA[php-fusion]]></category>

		<guid isPermaLink="false">http://cedik.com/2008/05/12/php-fusion-pet-shop-infusion/</guid>
		<description><![CDATA[It&#8217;s also official. Me and my friend Falcon have started working on a php-fusion pet shop infusion. I know, some might think that I start a lot of things (like the Anime CMS) and I don&#8217;t finish any of them, but the php-fusion shop already exists. I mean, I made a php-fusion shop for one [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s also official. Me and my friend <a href="http://agx-themes.com" title="agx-themes">Falcon</a> have started working on a php-fusion pet shop infusion. I know, some might think that I start a lot of things (like the Anime CMS) and I don&#8217;t finish any of them, but the php-fusion shop already exists. I mean, I made a php-fusion shop for one of my sites and you can see it <a href="http://bleach.animezup.com/petshop.php" title="php-fusion pet shop">here</a>, but it&#8217;s only a rough version, manually coded into the fusion source files and with the database tables also manually created. Oh yeah, and the style is not the one from the themes so used with another theme on another site it will look really bad.<span id="more-10"></span></p>
<p>But that&#8217;s why I have Falcon to help me. He knows php-fusion very well and we&#8217;re good to go. This mod will soon has an infusion that will create the new sql tables and an administration interface. It&#8217;s actually not that hard to code such an infusion, I should have it done in a day of work. The only problem is that my schedule is really busy right now, with exams and such, and I have to work on it bit by bit when I have some spare time. But don&#8217;t worry, this month the mod will be done for sure!</p>
]]></content:encoded>
			<wfw:commentRss>http://cedik.com/2008/05/12/php-fusion-pet-shop-infusion/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SMF anti-spam bots registration mod</title>
		<link>http://cedik.com/2008/05/10/smf-anti-spam-bots-registration-mod/</link>
		<comments>http://cedik.com/2008/05/10/smf-anti-spam-bots-registration-mod/#comments</comments>
		<pubDate>Sat, 10 May 2008 09:04:18 +0000</pubDate>
		<dc:creator>Cedik</dc:creator>
		
		<category><![CDATA[SMF]]></category>

		<category><![CDATA[anti-spam]]></category>

		<category><![CDATA[anti-spambots]]></category>

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

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

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

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

		<guid isPermaLink="false">http://cedik.com/2008/05/10/smf-anti-spam-bots-registration-mod/</guid>
		<description><![CDATA[Among other sites, I&#8217;m also an administrator on the romanian anime forum Manga-anime.ro. That forum is a SMF one and recently we had some problems with the spam bots registering our boards and spamming them with porn or pharmaceutical stuff. The root admin tried to install a SMF mod that should have prevented them from [...]]]></description>
			<content:encoded><![CDATA[<p>Among other sites, I&#8217;m also an administrator on the romanian anime forum Manga-anime.ro. That forum is a SMF one and recently we had some problems with the spam bots registering our boards and spamming them with porn or pharmaceutical stuff. The root admin tried to install a SMF mod that should have prevented them from registering by making them solve some simple puzzles, but the mod just didn&#8217;t work. So I tried to make something myself, from scratch. I came with the idea of adding a simple math problem for them to solve: the sum of two numbers. The numbers are randomly generated from 1 to 5 so the sum should be pretty simple to solve by anyone. However, since I don&#8217;t know how SMF system works, this modification is not that complex or accurate.</p>
<p>In order to do this on your SMF site too, you must follow three simple steps.<span id="more-9"></span></p>
<p><strong>Step 1. </strong>Editing the Register.template.php file</p>
<p>In this step, you will create the extra form where you will ask for the sum of those two numbers. You can find this file in each theme&#8217;s folder, but you only need to modify it for the default theme. It&#8217;s location should be themes/default-theme/Register.template.php. There, search for the part that generates the password fiels. It should look like this:</p>
<blockquote><p><em>    echo &#8216;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;&lt;tr&gt;<br />
&lt;td width=&#8221;40%&#8221;&gt;<br />
&lt;b&gt;&#8217;, $txt[81], &#8216;:&lt;/b&gt;<br />
&lt;/td&gt;<br />
&lt;td&gt;<br />
&lt;input type=&#8221;password&#8221; name=&#8221;passwrd1&#8243; size=&#8221;30&#8243; tabindex=&#8221;&#8216;, $context['tabindex']++, &#8216;&#8221; /&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;&lt;tr&gt;<br />
&lt;td width=&#8221;40%&#8221;&gt;<br />
&lt;b&gt;&#8217;, $txt[82], &#8216;:&lt;/b&gt;<br />
&lt;/td&gt;<br />
&lt;td&gt;<br />
&lt;input type=&#8221;password&#8221; name=&#8221;passwrd2&#8243; size=&#8221;30&#8243; tabindex=&#8221;&#8216;, $context['tabindex']++, &#8216;&#8221; /&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;&#8217;; </em></p></blockquote>
<p>Now, add below the following code:</p>
<blockquote><p><em>                    /*spam bote code begin*/</p>
<p>$a=rand(1,5);<br />
$b=rand(1,5);<br />
$suma=$a+$b;<br />
echo &#8220;&lt;tr&gt;&lt;td width=&#8217;40%&#8217;&gt;&lt;b&gt;In casuta urmatoare scrieti suma numerelor $a si $b:&lt;b&gt;&lt;td&gt; &lt;input type=&#8217;text&#8217; name=&#8217;sumafals&#8217; size =&#8217;30&#8242; value=&#8221;&gt;&lt;/td&gt;&lt;/td&gt;&lt;/tr&gt;&#8221;;<br />
echo &#8220;&lt;td&gt;&lt;input type=&#8217;hidden&#8217; name=&#8217;suma&#8217; value=&#8217;$suma&#8217;&gt;&lt;/td&gt;&#8221;;<br />
/*spam bote code end*/</em></p></blockquote>
<p>This part will generate the two random numbers from 1 to 5 and will send the correct sum among with the sum inputed by the user, so you can verify if he did the sum right or wrong. Now, we can move to the next step.</p>
<p><strong>Step 2.</strong> Editing the Register.php file</p>
<p>You should be able to find this file in the Sources folder, placed in the root of your forum. Just like above, search for the part of the code that looks something like this:</p>
<blockquote><p><em>    // Make sure they came from *somewhere*, have a session.<br />
if (!isset($_SESSION['old_url']))<br />
redirectexit(&#8217;action=register&#8217;);</em></p></blockquote>
<p>and then add below:</p>
<blockquote><p><em>    //the spam  bot modification<br />
if ($_POST['sumafals']!=$_POST['suma'])<br />
fatal_lang_error(&#8217;visual_verification_failed&#8217;, false);   </em></p></blockquote>
<p>Now you&#8217;re ready to move to the final step.</p>
<p><strong>Step 3.</strong> Editing the errors language file.</p>
<p>This step isn&#8217;t actually necessary but you should do it anyways. In the default theme&#8217;s Languages directory, search the default language error file. In my case, it&#8217;s name is Errors.english.php. In this file, search for the following line:</p>
<blockquote><p><em> $txt['visual_verification_failed'] = &#8216;The letters you typed don\&#8217;t match the letters that were shown in the picture.&#8217;;</em></p></blockquote>
<p>and modify it to display this message:</p>
<blockquote><p><em>$txt['visual_verification_failed'] = &#8216;The letters you typed don\&#8217;t match the letters that were shown in the picture or the sum was incorect.&#8217;;  </em></p></blockquote>
<p>And that was it! All done! I hope this will help you just as much as it helped me.</p>
]]></content:encoded>
			<wfw:commentRss>http://cedik.com/2008/05/10/smf-anti-spam-bots-registration-mod/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
