<?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>MySandbox</title>
	<atom:link href="http://sandbox.ronggur.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sandbox.ronggur.com</link>
	<description>Ronggur Hutasuhut Playground</description>
	<lastBuildDate>Tue, 02 Feb 2010 08:00:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Houston, We&#8217;ve Got a Problem</title>
		<link>http://sandbox.ronggur.com/2010/02/02/houston-weve-got-a-problem/</link>
		<comments>http://sandbox.ronggur.com/2010/02/02/houston-weve-got-a-problem/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 08:00:50 +0000</pubDate>
		<dc:creator>ronggur</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://sandbox.ronggur.com/?p=196</guid>
		<description><![CDATA[Last nite i found my blog down for several hours, i don&#8217;t know what happened and now it&#8217;s up again but unfortunately there are some comments lost (sorry). But it&#8217;s okay since i&#8217;, not losing the whole database
images taken from here
]]></description>
			<content:encoded><![CDATA[<div id="attachment_197" class="wp-caption alignleft" style="width: 301px"><a href="http://sandbox.ronggur.com/wp-content/uploads/2010/02/moon.jpg"><img class="size-medium wp-image-197" title="moon" src="http://sandbox.ronggur.com/wp-content/uploads/2010/02/moon-291x300.jpg" alt="houston we've got problem" width="291" height="300" /></a><p class="wp-caption-text">houston we&#39;ve got problem</p></div>
<p>Last nite i found my blog down for several hours, i don&#8217;t know what happened and now it&#8217;s up again but unfortunately there are some comments lost (sorry). But it&#8217;s okay since i&#8217;, not losing the whole database</p>
<p>images taken from <a href="http://nopicturenostory.com/the_cartoon_parade/michel_rilhac/groney/bin/images/large/moon.jpg" onclick="pageTracker._trackPageview('/outgoing/nopicturenostory.com/the_cartoon_parade/michel_rilhac/groney/bin/images/large/moon.jpg?referer=');">here</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fsandbox.ronggur.com%2F2010%2F02%2F02%2Fhouston-weve-got-a-problem%2F&amp;linkname=Houston%2C%20We%26%238217%3Bve%20Got%20a%20Problem" onclick="pageTracker._trackPageview('/outgoing/www.addtoany.com/share_save?linkurl=http_3A_2F_2Fsandbox.ronggur.com_2F2010_2F02_2F02_2Fhouston-weve-got-a-problem_2F_amp_linkname=Houston_2C_20We_26_238217_3Bve_20Got_20a_20Problem&amp;referer=');"><img src="http://sandbox.ronggur.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://sandbox.ronggur.com/2010/02/02/houston-weve-got-a-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Tutorial : Simple ajax star rating with php (extended)</title>
		<link>http://sandbox.ronggur.com/2010/01/19/jquery-tutorial-simple-ajax-star-rating-with-php-extended/</link>
		<comments>http://sandbox.ronggur.com/2010/01/19/jquery-tutorial-simple-ajax-star-rating-with-php-extended/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 23:32:41 +0000</pubDate>
		<dc:creator>ronggur</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery tutorial]]></category>

		<guid isPermaLink="false">http://sandbox.ronggur.com/?p=186</guid>
		<description><![CDATA[Some people ask me question about how to implement my last star rating in multiple star rating, and here is the answer on how to implement it.
1. Upgrade latest table
Since you&#8217;ll need to add &#8216;id&#8217; on multiple record then we need to upgrade the existing table. Here is the full sql

CREATE TABLE IF NOT EXISTS [...]]]></description>
			<content:encoded><![CDATA[<p>Some people ask me question about how to implement my <a title="simple ajax star rating with php" href="http://sandbox.ronggur.com/2009/05/30/jquery-tutorial-simple-ajax-star-rating-with-php">last star rating</a> in multiple star rating, and here is the answer on how to implement it.</p>
<h3>1. Upgrade latest table</h3>
<p>Since you&#8217;ll need to add &#8216;id&#8217; on multiple record then we need to upgrade the existing table. Here is the full sql</p>
<pre class="brush: sql;">
CREATE TABLE IF NOT EXISTS `vote` (
 `id` int(11) NOT NULL auto_increment,
 `desc` varchar(50) NOT NULL,
 `counter` int(8) NOT NULL default '0',
 `value` int(8) NOT NULL default '0',
 PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `vote`
--

INSERT INTO `vote` (`id`, `desc`, `counter`, `value`) VALUES
(1, 'star - 1', 0, 0),
(2, 'star - 2', 0,0);
</pre>
<h3>2. CSS</h3>
<p>We still can stylesheet from the previous post. No need to modify it.</p>
<p><span id="more-186"></span></p>
<h3>3. PHP files (index.php &amp; update.php)</h3>
<p>There are some code changes in this files. If in previous post we just need an html file to represent the star rating, now we need php file to do it. Here is full code for <em>index.php</em> and some simple code explanation in it</p>
<pre class="brush: php;">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /&gt;
&lt;title&gt;jQuery Tutorial : Simple ajax star rating&lt;/title&gt;
&lt;meta name=&quot;Keywords&quot; content=&quot;Star rating, jQuery, ajax&quot;&gt;
&lt;meta name=&quot;Description&quot; content=&quot;jQuery Tutorial : Simple ajax star rating&quot;&gt;
&lt;meta http-equiv=&quot;Content-Language&quot; content=&quot;en&quot;&gt;
&lt;meta name=&quot;robots&quot; content=&quot;index,follow&quot;&gt;
&lt;script src=&quot;rating/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;rating/starrating.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;link href=&quot;rating/starrating.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php
// include update.php
include_once 'update.php';
// get all data from tabel
$arr_star = fetchStar();
?&gt;
&lt;?php
// start looping datas
foreach($arr_star as $star){ ?&gt;
&lt;h2&gt;Star Rater - &lt;?php echo $star['id'];?&gt;&lt;/h2&gt;
&lt;ul class='star-rating' id=&quot;star-rating-&lt;?php echo $star['id'];?&gt;&quot;&gt;
&lt;?php /* getRating($id) is to generate current rating */?&gt;
 &lt;li id=&quot;current-rating-&lt;?php echo $star['id'];?&gt;&quot; style=&quot;width:&lt;?php echo getRating($star['id'])?&gt;%&quot;&gt;&lt;!-- will show current rating --&gt;&lt;/li&gt;
 &lt;?php
 /* we need to generate 'id' for star rating.. this 'id' will identify which data to execute  */
 /* we will pass it in ajax later */
 ?&gt;
 &lt;span id=&quot;&lt;?php echo $star['id'];?&gt;&quot;&gt;
 &lt;li&gt;&lt;a href=&quot;javascript:void(0)&quot; title=&quot;1 star out of 5&quot;&gt;1&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href=&quot;javascript:void(0)&quot; title=&quot;2 stars out of 5&quot;&gt;2&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href=&quot;javascript:void(0)&quot; title=&quot;3 stars out of 5&quot;&gt;3&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href=&quot;javascript:void(0)&quot; title=&quot;4 stars out of 5&quot;&gt;4&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href=&quot;javascript:void(0)&quot; title=&quot;5 stars out of 5&quot;&gt;5&lt;/a&gt;&lt;/li&gt;
 &lt;/span&gt;
&lt;/ul&gt;
&lt;?php } ?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>And this is for <em>update.php</em></p>
<pre class="brush: php;">
&lt;?php
// connect to database
$dbh=mysql_connect (&quot;localhost&quot;, &quot;user&quot;, &quot;password&quot;) or die ('Cannot connect to the database');
mysql_select_db (&quot;database&quot;,$dbh);

if($_GET['do']=='rate'){
 // do rate and get id
 rate($_GET['id']);
}else if($_GET['do']=='getrate'){
 // get rating and get id
 getRating($_GET['id']);
}

// get data from tabel
function fetchStar(){
 $sql = &quot;select * from `vote`&quot;;
 $result=@mysql_query($sql);
 while($rs = @mysql_fetch_array($result,MYSQL_ASSOC)){
 $arr_data[] = $rs;
 }
 return $arr_data;
}

// function to retrieve
function getRating($id){
 $sql= &quot;select * from vote`` where id='&quot;.$id.&quot;' &quot;;
 $result=@mysql_query($sql);
 $rs=@mysql_fetch_array($result);
 // set width of star
 $rating = (@round($rs[value] / $rs[counter],1)) * 20;
 echo $rating;
}

// function to insert rating
function rate($id){
 $text = strip_tags($_GET['rating']);
 $update = &quot;update `vote` set counter = counter + 1, value = value + &quot;.$_GET['rating'].&quot;  where id='&quot;.$id.&quot;' &quot;;

 $result = @mysql_query($update);
}
?&gt;
</pre>
<h3>4. Javascript</h3>
<pre class="brush: jscript;">
// JavaScript Document
 $(document).ready(function() {
 // get rating function
 function getRating(id){
 $.ajax({
 type: &quot;GET&quot;,
 url: &quot;update.php&quot;,
 data: &quot;do=getrate&amp;id=&quot;+id,
 cache: false,
 async: false,
 success: function(result) {
 // apply star rating to element
 $(&quot;#current-rating-&quot;+id+&quot;&quot;).css({ width: &quot;&quot; + result + &quot;%&quot; });
 },
 error: function(result) {
 alert(&quot;some error occured, please try again later&quot;);
 }
 });
 }

 // link handler
 $('.ratelinks li a').click(function(){
 // get the parent id
 var idStar = $(this).parent().parent().attr('id');
 $.ajax({
 type: &quot;GET&quot;,
 url: &quot;update.php&quot;,
 data: &quot;rating=&quot;+$(this).text()+&quot;&amp;do=rate&amp;id=&quot;+idStar,
 cache: false,
 async: false,
 success: function(result) {
 // remove #ratelinks element to prevent another rate
 $(&quot;#ratelinks&quot;).remove();
 // get rating after click
 getRating(idStar);
 },
 error: function(result) {
 alert(&quot;some error occured, please try again later&quot;);
 }
 });

 });
 });
</pre>
<p>That&#8217;s it! hope it works for you <img src='http://sandbox.ronggur.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . You can add some modification like notification, or loader while processing.</p>
<p>- <a title="Simple star rating" href="http://dock.ronggur.com/tutorial/jquery_tutorial_starrating_extended/" onclick="pageTracker._trackPageview('/outgoing/dock.ronggur.com/tutorial/jquery_tutorial_starrating_extended/?referer=');">View Demo</a></p>
<p>- Download zip file <a class="downloadlink" href="http://sandbox.ronggur.com/wp-content/plugins/download-monitor/download.php?id=8" title=" downloaded 75 times" >jQuery Tutorial : Simple ajax star rating with php (extended) (75)</a></p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="ronggur.mh@gmail.com" /><input type="hidden" name="return" value="Thank you for your kindness :D" /><input type="hidden" name="item_name" value="Buy Me a Beer for jQuery Tutorial : Simple ajax star rating with php (extended)" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="" /><input type="image" src="http://sandbox.ronggur.com/wp-content/plugins/buy-me-beer/icon_cafe.gif" align="left" alt="coffee" title="coffee" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=ronggur.mh@gmail.com&amp;currency_code=USD&amp;amount=&amp;return=Thank you for your kindness :D&amp;item_name=Buy+Me+a+Beer+for+jQuery+Tutorial+:+Simple+ajax+star+rating+with+php+(extended)" target="paypal" onclick="pageTracker._trackPageview('/outgoing/www.paypal.com/cgi-bin/webscr?cmd=_xclick_amp_business=ronggur.mh_gmail.com_amp_currency_code=USD_amp_amount=_amp_return=Thank_you_for_your_kindness_D_amp_item_name=Buy+Me+a+Beer+for+jQuery+Tutorial+_+Simple+ajax+star+rating+with+php+_extended&amp;referer=');">You can give me some coffee if you want to :D</a></p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fsandbox.ronggur.com%2F2010%2F01%2F19%2Fjquery-tutorial-simple-ajax-star-rating-with-php-extended%2F&amp;linkname=jQuery%20Tutorial%20%3A%20Simple%20ajax%20star%20rating%20with%20php%20%28extended%29" onclick="pageTracker._trackPageview('/outgoing/www.addtoany.com/share_save?linkurl=http_3A_2F_2Fsandbox.ronggur.com_2F2010_2F01_2F19_2Fjquery-tutorial-simple-ajax-star-rating-with-php-extended_2F_amp_linkname=jQuery_20Tutorial_20_3A_20Simple_20ajax_20star_20rating_20with_20php_20_28extended_29&amp;referer=');"><img src="http://sandbox.ronggur.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://sandbox.ronggur.com/2010/01/19/jquery-tutorial-simple-ajax-star-rating-with-php-extended/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>New Google search interface</title>
		<link>http://sandbox.ronggur.com/2009/11/26/new-google-searc-interface/</link>
		<comments>http://sandbox.ronggur.com/2009/11/26/new-google-searc-interface/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 18:04:35 +0000</pubDate>
		<dc:creator>ronggur</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[featured]]></category>

		<guid isPermaLink="false">http://sandbox.ronggur.com/?p=177</guid>
		<description><![CDATA[Have you tried the new google search intrerface? here i put the screenshot
This interface isn&#8217;t officially launch, so you need do simple trick to view it.

Visit http://google.com
On your url address field type in this code


javascript:void(document.cookie=&#34;PREF=ID=20b6e4c2f44943bb:U=4bf292d46faad806:TM=1249677602:LM=1257919388:S=odm0Ys-53ZueXfZG;path=/; domain=.google.com&#34;);

Refresh your browser

I get this trick from gizmodo
]]></description>
			<content:encoded><![CDATA[<p>Have you tried the new google search intrerface? here i put the screenshot</p>
<div id="attachment_178" class="wp-caption alignnone" style="width: 310px"><a href="http://sandbox.ronggur.com/wp-content/uploads/2009/11/google.PNG"><img class="size-medium wp-image-178 " title="google" src="http://sandbox.ronggur.com/wp-content/uploads/2009/11/google-300x155.PNG" alt="google" width="300" height="155" /></a><p class="wp-caption-text">google search new interface</p></div>
<p>This interface isn&#8217;t officially launch, so you need do simple trick to view it.</p>
<ol>
<li>Visit http://google.com</li>
<li>On your url address field type in this code</li>
<pre class="brush: xml;">

javascript:void(document.cookie=&quot;PREF=ID=20b6e4c2f44943bb:U=4bf292d46faad806:TM=1249677602:LM=1257919388:S=odm0Ys-53ZueXfZG;path=/; domain=.google.com&quot;);
</pre>
<li>Refresh your browser</li>
</ol>
<p>I get this trick from <a title="gizmodo" href="http://gizmodo.com/5412801/how-to-try-the-new-google-search" onclick="pageTracker._trackPageview('/outgoing/gizmodo.com/5412801/how-to-try-the-new-google-search?referer=');">gizmodo</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F11%2F26%2Fnew-google-searc-interface%2F&amp;linkname=New%20Google%20search%20interface" onclick="pageTracker._trackPageview('/outgoing/www.addtoany.com/share_save?linkurl=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F11_2F26_2Fnew-google-searc-interface_2F_amp_linkname=New_20Google_20search_20interface&amp;referer=');"><img src="http://sandbox.ronggur.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://sandbox.ronggur.com/2009/11/26/new-google-searc-interface/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to generate image on the fly with codeIgniter</title>
		<link>http://sandbox.ronggur.com/2009/11/20/how-to-generate-image-on-the-fly-with-codegniter/</link>
		<comments>http://sandbox.ronggur.com/2009/11/20/how-to-generate-image-on-the-fly-with-codegniter/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 16:45:27 +0000</pubDate>
		<dc:creator>ronggur</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[feat]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://sandbox.ronggur.com/?p=165</guid>
		<description><![CDATA[This post is talking about how to generate image on the fly with codeigniter. This is the basic code and sure you can improve it as you far as you need, All we need is only 1 controller and 1 view
1. Controller
Create controller and named it &#8220;preview&#8221;, we also need function in it to call [...]]]></description>
			<content:encoded><![CDATA[<p>This post is talking about how to generate image on the fly with codeigniter. This is the basic code and sure you can improve it as you far as you need, All we need is only 1 controller and 1 view</p>
<h3>1. Controller</h3>
<p>Create controller and named it &#8220;preview&#8221;, we also need function in it to call the image class. See the script below</p>
<pre class="brush: php;">

&lt;?php

class preview extends Controller {

function preview()
{
parent::Controller();
$this-&gt;load-&gt;helper('url');
}

function index($height='50',$width='50')
{

// we will need to pass the height and with of the image
$arr_data['height']    =    $height;
$arr_data['width']    =    $width;
$this-&gt;load-&gt;view('preview', $arr_data);
}

function get_photo($height,$width){
$path = [ absolute path to your image ex : /public-html/dock/image.jpg ];
$this-&gt;load-&gt;library('image_lib');
$imageinit['image_library']     = 'gd2';
$imageinit['quality']            = '90%'; // set quality
$imageinit['dynamic_output']    = true;     // set to true to generate it dynamically
$imageinit['source_image']         = $path;
$imageinit['maintain_ratio']     = false;
$imageinit['width']             = $width;
$imageinit['height']             = $height;
$this-&gt;image_lib-&gt;initialize($imageinit);
if(!$this-&gt;image_lib-&gt;resize()){
echo $this-&gt;image_lib-&gt;display_errors(); // print error if it fails
}
}
}

?&gt;
</pre>
<p>&#8220;get_photo&#8221; function is where we will generate the image dynamically. We call this function in &lt;img&gt; html tag in &#8220;view&#8221; file.</p>
<p><span id="more-165"></span></p>
<h3>2. View</h3>
<p>Here is the view code where we will call &#8220;get_photo&#8221; function</p>
<pre class="brush: php;">

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Code Igniter : Image on the fly&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;img src=&quot;&lt;?php echo base_url().'index.php/preview/get_photo/'.$height.'/'.$width.'' ?&gt;&quot; title=&quot;image on the fly&quot; alt=&quot;image on the fly&quot; /&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>That&#8217;s it</p>
<ul>
<li><a title="image on the fly with code igniter" href="http://demo.ronggur.com/citutorial/index.php/preview/get_photo/600/800" onclick="pageTracker._trackPageview('/outgoing/demo.ronggur.com/citutorial/index.php/preview/get_photo/600/800?referer=');">View demo</a></li>
<li>Download source (only controller and view) :  <a class="downloadlink" href="http://sandbox.ronggur.com/wp-content/plugins/download-monitor/download.php?id=7" title=" downloaded 29 times" >Image on the fly with codeigniter (29)</a></li>
</ul>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F11%2F20%2Fhow-to-generate-image-on-the-fly-with-codegniter%2F&amp;linkname=How%20to%20generate%20image%20on%20the%20fly%20with%20codeIgniter" onclick="pageTracker._trackPageview('/outgoing/www.addtoany.com/share_save?linkurl=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F11_2F20_2Fhow-to-generate-image-on-the-fly-with-codegniter_2F_amp_linkname=How_20to_20generate_20image_20on_20the_20fly_20with_20codeIgniter&amp;referer=');"><img src="http://sandbox.ronggur.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://sandbox.ronggur.com/2009/11/20/how-to-generate-image-on-the-fly-with-codegniter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3 Ways to Create Round Corner Menu</title>
		<link>http://sandbox.ronggur.com/2009/09/11/3-ways-to-creat-round-corner-menu/</link>
		<comments>http://sandbox.ronggur.com/2009/09/11/3-ways-to-creat-round-corner-menu/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 06:34:11 +0000</pubDate>
		<dc:creator>ronggur</dc:creator>
				<category><![CDATA[Tips and Trick]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[featured]]></category>

		<guid isPermaLink="false">http://sandbox.ronggur.com/?p=153</guid>
		<description><![CDATA[There are 3 ways (as far as i knows) to create round corner menu, by image and css, css property and javascript. And in this post we&#8217;ll try to create in that 3 different ways. Actually this is some old issue but maybe one of you will need it someday  . So let&#8217;s start [...]]]></description>
			<content:encoded><![CDATA[<p>There are 3 ways (as far as i knows) to create round corner menu, by image and css, css property and javascript. And in this post we&#8217;ll try to create in that 3 different ways. Actually this is some old issue but maybe one of you will need it someday <img src='http://sandbox.ronggur.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . So let&#8217;s start it</p>
<h4>1. CSS Property</h4>
<p>By adding <em>&#8216;</em><span><em>-moz-border-radius&#8217;</em> for FF or <em>&#8216;</em></span><em>-webkit-border-radius&#8217;</em> for Safari, ucan create round corner element. Comparing to other maybe this one is the lightest and easiest way to create round corner element. Here is some example how to use it</p>
<p><strong>applying bottom left</strong></p>
<pre class="brush: css;">

-moz-border-radius-bottomleft:7px;
</pre>
<p><strong>applying bottom right</strong></p>
<pre class="brush: css;">

-moz-border-radius-bottomright:7px;
</pre>
<p><strong>applying top left</strong></p>
<pre class="brush: css;">

-moz-border-radius-topleft:7px;
</pre>
<p><strong>applying top right<br />
</strong></p>
<pre class="brush: css;">

-moz-border-radius-topright:7px
</pre>
<p><strong>applying all corner<br />
</strong></p>
<pre class="brush: css;">

-moz-border-radius:7px;
</pre>
<p>So far i only know that this technique only works for Firefox and Safari. Remember that <span style="text-decoration: underline;">&#8216;-moz-border-radius&#8217; is works for Firefox and <span><em>&#8216;</em></span><em>-webkit-border-radius&#8217;</em> for safari</span></p>
<p><a title="round corner menu using css property" href="http://dock.ronggur.com/tutorial/roundcorner_menu/css.html" target="_self" onclick="pageTracker._trackPageview('/outgoing/dock.ronggur.com/tutorial/roundcorner_menu/css.html?referer=');"><strong>view demo (all corner)</strong></a></p>
<h4>2. Javascript</h4>
<p>By using some javascript function or plugin we can create round corner element. So far if i need it i use <a title="jquery corner" href="http://malsup.com/jquery/corner/" onclick="pageTracker._trackPageview('/outgoing/malsup.com/jquery/corner/?referer=');">jquery corner</a> you can download this plugin here <a title="jquery corner" href="http://malsup.com/jquery/corner/jquery.corner.js?v1.99" onclick="pageTracker._trackPageview('/outgoing/malsup.com/jquery/corner/jquery.corner.js?v1.99&amp;referer=');">http://malsup.com/jquery/corner/jquery.corner.js?v1.99</a>. The best thing using this plugin, you can create diffent shape for corner, not only round. And it have good browser compatibility.</p>
<p>Here is basic sample how to use it.</p>
<pre class="brush: jscript;">

jQuery(document).ready(function(){

$(&quot;#nav li&quot;).corner(&quot;7px&quot;);
});
</pre>
<p><strong><a title="round corner menu using javascript" href="http://dock.ronggur.com/tutorial/roundcorner_menu/js.html" target="_self" onclick="pageTracker._trackPageview('/outgoing/dock.ronggur.com/tutorial/roundcorner_menu/js.html?referer=');"><strong>view demo</strong></a> </strong>. For complete example, please visit the official site.</p>
<h4>3. Image and CSS</h4>
<p>In this part we use images as background to create the menu. We slice rounded images into 2 parts. First is for the left side and the other is for the righ side (see picture)</p>
<p>One of the image will wider than the other, in this example we create the left side wider than the right one.</p>
<div id="attachment_156" class="wp-caption aligncenter" style="width: 290px"><a href="http://sandbox.ronggur.com/wp-content/uploads/2009/09/menu.jpg"><img class="size-full wp-image-156" title="menu" src="http://sandbox.ronggur.com/wp-content/uploads/2009/09/menu.jpg" alt="Images slice for menu" width="280" height="215" /></a><p class="wp-caption-text">Images slice for menu</p></div>
<p>As you see at image above, we will put the wider background in &lt;li&gt; and make the left side menu looks round. Then we put the right side in &lt;a&gt;. Don&#8217;t forget to make &lt;li&gt; and &lt;a&gt; have the same height so the round corner will look perfect (use padding to adjust it). Here is the the css code</p>
<pre class="brush: css;">
ul,ol{
padding: 10px 10px;
margin-left:10px;
}
ul li {
list-style: decimal inside;
list-style:none !important;
}

#nav {
margin:0;
padding0;
overflow:hidden;
float:left;
position:relative;
}
#nav li{
float:left;
margin:0;
text-align:center;
height:32px;
margin-right:10px;
background:transparent url('images/menuleft_bg.jpg') left bottom no-repeat;
}

#nav li a{
margin:0;
height:16px;
display:block;
vertical-align:middle;
padding:8px 10px;
background:transparent url('images/menuright_bg.jpg') right bottom no-repeat;
}
</pre>
<p><strong><strong><a title="round corner menu using javascript" href="http://dock.ronggur.com/tutorial/roundcorner_menu/image.html" target="_self" onclick="pageTracker._trackPageview('/outgoing/dock.ronggur.com/tutorial/roundcorner_menu/image.html?referer=');"><strong>view demo</strong></a></strong></strong></p>
<p>Thats it, thanks for visiting my sandbox <img src='http://sandbox.ronggur.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="ronggur.mh@gmail.com" /><input type="hidden" name="return" value="Thank you for your kindness :D" /><input type="hidden" name="item_name" value="Buy Me a Beer for 3 Ways to Create Round Corner Menu" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="" /><input type="image" src="http://sandbox.ronggur.com/wp-content/plugins/buy-me-beer/icon_cafe.gif" align="left" alt="coffee" title="coffee" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=ronggur.mh@gmail.com&amp;currency_code=USD&amp;amount=&amp;return=Thank you for your kindness :D&amp;item_name=Buy+Me+a+Beer+for+3+Ways+to+Create+Round+Corner+Menu" target="paypal" onclick="pageTracker._trackPageview('/outgoing/www.paypal.com/cgi-bin/webscr?cmd=_xclick_amp_business=ronggur.mh_gmail.com_amp_currency_code=USD_amp_amount=_amp_return=Thank_you_for_your_kindness_D_amp_item_name=Buy+Me+a+Beer+for+3+Ways+to+Create+Round+Corner+Menu&amp;referer=');">You can give me some coffee if you want to :D</a></p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F09%2F11%2F3-ways-to-creat-round-corner-menu%2F&amp;linkname=3%20Ways%20to%20Create%20Round%20Corner%20Menu" onclick="pageTracker._trackPageview('/outgoing/www.addtoany.com/share_save?linkurl=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F09_2F11_2F3-ways-to-creat-round-corner-menu_2F_amp_linkname=3_20Ways_20to_20Create_20Round_20Corner_20Menu&amp;referer=');"><img src="http://sandbox.ronggur.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://sandbox.ronggur.com/2009/09/11/3-ways-to-creat-round-corner-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redesign!</title>
		<link>http://sandbox.ronggur.com/2009/08/24/redesign/</link>
		<comments>http://sandbox.ronggur.com/2009/08/24/redesign/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 08:00:29 +0000</pubDate>
		<dc:creator>ronggur</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[featured]]></category>

		<guid isPermaLink="false">http://sandbox.ronggur.com/?p=136</guid>
		<description><![CDATA[Finally i finished designing new theme for my sandbox . This design is based on my submission for a wp theme contest view months ago and with some modifications. I named it &#8220;Humble&#8221;
This theme comes with featured post feature that attached at the first page, dynamic thumbnail feature, and background image feature for post and [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_144" class="wp-caption alignnone" style="width: 310px"><a href="http://sandbox.ronggur.com/wp-content/uploads/2009/08/humble.jpg"><img class="size-medium wp-image-144" title="humble" src="http://sandbox.ronggur.com/wp-content/uploads/2009/08/humble-300x168.jpg" alt="Humble - New Deesing for my sandbox" width="300" height="168" /></a><p class="wp-caption-text">Humble - New Deesing for my sandbox</p></div>
<p>Finally i finished designing new theme for my <a title="sandbox" href="http://sandbox.ronggur.com">sandbox</a> . This design is based on <a title="humble" href="http://sandbox.ronggur.com/2009/01/24/colorlabsproject-design-contest-humble/">my submission</a> for a wp theme contest view months ago and with some modifications. I named it &#8220;Humble&#8221;</p>
<p>This theme comes with featured post feature that attached at the first page, dynamic thumbnail feature, and background image feature for post and one widget ready at sidebar. I planning to release this theme for free and of course with some more features and theme customization.</p>
<p>Anyway this theme tested in firefox 3.5, safari 4, chrome, opera,</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F08%2F24%2Fredesign%2F&amp;linkname=Redesign%21" onclick="pageTracker._trackPageview('/outgoing/www.addtoany.com/share_save?linkurl=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F08_2F24_2Fredesign_2F_amp_linkname=Redesign_21&amp;referer=');"><img src="http://sandbox.ronggur.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://sandbox.ronggur.com/2009/08/24/redesign/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The difference between real news portal and news-ads portal</title>
		<link>http://sandbox.ronggur.com/2009/08/15/the-difference-between-real-news-portal-and-news-ads-portal/</link>
		<comments>http://sandbox.ronggur.com/2009/08/15/the-difference-between-real-news-portal-and-news-ads-portal/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 21:48:01 +0000</pubDate>
		<dc:creator>ronggur</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://sandbox.ronggur.com/?p=130</guid>
		<description><![CDATA[See?
]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignnone" style="width: 364px"><a href="http://dock.ronggur.com/mehong/gambar/portal-ads.jpg" onclick="pageTracker._trackPageview('/outgoing/dock.ronggur.com/mehong/gambar/portal-ads.jpg?referer=');"><img class="     " title="ads portal and news portal" src="http://dock.ronggur.com/mehong/gambar/portal-ads.jpg" alt="the difference" width="354" height="221" /></a><p class="wp-caption-text">the difference</p></div>
<p>See?</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F08%2F15%2Fthe-difference-between-real-news-portal-and-news-ads-portal%2F&amp;linkname=The%20difference%20between%20real%20news%20portal%20and%20news-ads%20portal" onclick="pageTracker._trackPageview('/outgoing/www.addtoany.com/share_save?linkurl=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F08_2F15_2Fthe-difference-between-real-news-portal-and-news-ads-portal_2F_amp_linkname=The_20difference_20between_20real_20news_20portal_20and_20news-ads_20portal&amp;referer=');"><img src="http://sandbox.ronggur.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://sandbox.ronggur.com/2009/08/15/the-difference-between-real-news-portal-and-news-ads-portal/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Google Maps : Pointing and get your marker location</title>
		<link>http://sandbox.ronggur.com/2009/08/01/google-maps-pointing-and-get-your-marker-location/</link>
		<comments>http://sandbox.ronggur.com/2009/08/01/google-maps-pointing-and-get-your-marker-location/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 11:13:44 +0000</pubDate>
		<dc:creator>ronggur</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery tutorial]]></category>

		<guid isPermaLink="false">http://sandbox.ronggur.com/?p=102</guid>
		<description><![CDATA[ In this post i want to try give some simple script to get your marker location in google maps. Next we will ceate one marker and when you  drag and drop it, you'll get the position of the marker ( latitude and langitude ). You can use this kind of script if you want to add google maps feature in to your websites and want to point position and save it in to your database
]]></description>
			<content:encoded><![CDATA[<p>In this post i want to try give some simple script to get your marker location in google maps. Next we will ceate one marker and when you  drag and drop it, you&#8217;ll get the position of the marker ( latitude and langitude ). You can use this kind of script if you want to add google maps feature in to your websites and want to point position and save it in to your database</p>
<div id="attachment_111" class="wp-caption aligncenter" style="width: 310px"><a href="http://sandbox.ronggur.com/wp-content/uploads/2009/08/image.jpg"><img class="size-medium wp-image-111" title="image" src="http://sandbox.ronggur.com/wp-content/uploads/2009/08/image-300x141.jpg" alt="Image Preview" width="300" height="141" /></a><p class="wp-caption-text">Image Preview</p></div>
<p>As usual we&#8217;ll use  jQuery to give some little help. Lets start</p>
<h4 style="text-align: left;"><strong>1. HTML &amp; PHP files</strong></h4>
<p>You can copy html below. Make sure you already have key for your google maps and use your own key <img src='http://sandbox.ronggur.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . And also don&#8217;t forget to include <a title="jquery" href="http://jquery.com" onclick="pageTracker._trackPageview('/outgoing/jquery.com?referer=');">jQuery</a> library.</p>
<p>To get the current position of the marker, we will use hidden intput to store the position temporary before we post it to php file.</p>
<pre class="brush: xml;">

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /&gt;
&lt;title&gt;Google Map in Learning&lt;/title&gt;
&lt;link href=&quot;styles/style.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; /&gt;
&lt;script src=&quot;js/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://maps.google.com/maps?file=api&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;v=2&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;sensor=false&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;key=ABQIAAAAYeuJd8iDXzlrlsewUFBcLhQCLRJBQIjl4T4yd7P58JjfH0ny1BRyKA-JaUsGkxqxnC7LUYx0xI7rAQ&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;js/addmarker.js&quot;  type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;wrapper_map&quot;&gt;
&lt;div id=&quot;map_canvas&quot; style=&quot;width: 640px; height: 300px&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;wrapper_form&quot;&gt;
&lt;p&gt;&lt;strong&gt;Your Location : &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Latitude : &lt;span id=&quot;sLat&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Longitude : &lt;span id=&quot;sLng&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;form name=&quot;fLocation&quot; id=&quot;fLocation&quot; method=&quot;post&quot; action=&quot;post.php&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;lat&quot; id=&quot;lat&quot; value=&quot;&quot; /&gt;
&lt;input type=&quot;hidden&quot; name=&quot;lng&quot; id=&quot;lng&quot; value=&quot;&quot; /&gt;
&lt;input type=&quot;submit&quot; value=&quot;Save&quot; /&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Next is one line php script and named it &#8216;post.php&#8217;, this script just to show that your post data from html is work.</p>
<pre class="brush: php;">

var_dump($_POST);
</pre>
<p><span id="more-102"></span></p>
<h4 style="text-align: left;"><strong>2. JavaScript</strong></h4>
<p>Lets create addmarker.js. Here is the code, i put some comment above the line</p>
<pre class="brush: jscript;">

$(document).ready(function() {
$(&quot;#wrapper_map&quot;).width($(&quot;#map_canvas&quot;).width());
// initialize default lat &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp; lang in this case i set to Indonesia

var indLat = -2;
var indLng = 120;

// setup default position into text and hidden input

$(&quot;#sLat&quot;).text(indLat);
$(&quot;#sLng&quot;).text(indLng);
$(&quot;#lat&quot;).val(indLat);
$(&quot;#lng&quot;).val(indLng);

// start setup google maps

var map = new GMap2(document.getElementById(&quot;map_canvas&quot;));
var center = new GLatLng(indLat, indLng);
map.setCenter(center, 4);
map.setUIToDefault();

var marker = new GMarker(center, { draggable: true });

GEvent.addListener(marker, &quot;dragstart&quot;, function() {
map.closeInfoWindow();
});

// a listener to get current position and store it to hidden input in html

GEvent.addListener(marker, &quot;dragend&quot;, function() {
// latitude
$(&quot;#sLat&quot;).text(roundNumber(getObjectLoc(marker, 'lat'), 5));
// store it temporary in hidden input (lat)
$(&quot;#lat&quot;).val(getObjectLoc(marker, 'lat'));
// longitude
$(&quot;#sLng&quot;).text(roundNumber(getObjectLoc(marker, 'lang'), 5));
// store it temporary in hidden input (lng)
$(&quot;#lng&quot;).val(getObjectLoc(marker, 'lang'));
});

// adding marker
map.addOverlay(marker);
// end setup google maps

// fungction to get the marker posistion

getObjectLoc = function(object, type){
var objectLoc = '';
if(type=='lat'){
objectLoc = object.getLatLng().lat();
}else{
objectLoc = object.getLatLng().lng();
}

return objectLoc;
}

// just round your position if you think it is too long to show

roundNumber = function(rnum, rlength) {
newnumber = Math.round(rnum*Math.pow(10,rlength))/Math.pow(10,rlength);
return newnumber;
}
});
</pre>
<p>That&#8217;s all. So when you press &#8216;Save&#8217; button it should print out your current marker position.</p>
<p><strong>- <a title="Simple star rating" href="http://dock.ronggur.com/tutorial/pointingmarker/" onclick="pageTracker._trackPageview('/outgoing/dock.ronggur.com/tutorial/pointingmarker/?referer=');">View Demo</a></strong></p>
<p><strong>- Download file <a class="downloadlink" href="http://sandbox.ronggur.com/wp-content/plugins/download-monitor/download.php?id=6" title=" downloaded 50 times" >Google Maps : Pointing and get your marker location (50)</a></strong></p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="ronggur.mh@gmail.com" /><input type="hidden" name="return" value="Thank you for your kindness :D" /><input type="hidden" name="item_name" value="Buy Me a Beer for Google Maps : Pointing and get your marker location" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="" /><input type="image" src="http://sandbox.ronggur.com/wp-content/plugins/buy-me-beer/icon_cafe.gif" align="left" alt="coffee" title="coffee" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=ronggur.mh@gmail.com&amp;currency_code=USD&amp;amount=&amp;return=Thank you for your kindness :D&amp;item_name=Buy+Me+a+Beer+for+Google+Maps+:+Pointing+and+get+your+marker+location" target="paypal" onclick="pageTracker._trackPageview('/outgoing/www.paypal.com/cgi-bin/webscr?cmd=_xclick_amp_business=ronggur.mh_gmail.com_amp_currency_code=USD_amp_amount=_amp_return=Thank_you_for_your_kindness_D_amp_item_name=Buy+Me+a+Beer+for+Google+Maps+_+Pointing+and+get+your+marker+location&amp;referer=');">You can give me some coffee if you want to :D</a></p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F08%2F01%2Fgoogle-maps-pointing-and-get-your-marker-location%2F&amp;linkname=Google%20Maps%20%3A%20Pointing%20and%20get%20your%20marker%20location" onclick="pageTracker._trackPageview('/outgoing/www.addtoany.com/share_save?linkurl=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F08_2F01_2Fgoogle-maps-pointing-and-get-your-marker-location_2F_amp_linkname=Google_20Maps_20_3A_20Pointing_20and_20get_20your_20marker_20location&amp;referer=');"><img src="http://sandbox.ronggur.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://sandbox.ronggur.com/2009/08/01/google-maps-pointing-and-get-your-marker-location/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Understanding Flow Charts</title>
		<link>http://sandbox.ronggur.com/2009/06/09/understanding-flow-charts/</link>
		<comments>http://sandbox.ronggur.com/2009/06/09/understanding-flow-charts/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 06:21:19 +0000</pubDate>
		<dc:creator>ronggur</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[flow charts]]></category>

		<guid isPermaLink="false">http://sandbox.ronggur.com/?p=91</guid>
		<description><![CDATA[
Can&#8217;t read or understand flow charts? hope it will help you :p
]]></description>
			<content:encoded><![CDATA[<p><a href="http://xkcd.com/518/" onclick="pageTracker._trackPageview('/outgoing/xkcd.com/518/?referer=');"><img class="alignnone" title="Understanding flow charts" src="http://imgs.xkcd.com/comics/flow_charts.png" alt="" width="472" height="341" /></a></p>
<p>Can&#8217;t read or understand flow charts? hope it will help you :p</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F06%2F09%2Funderstanding-flow-charts%2F&amp;linkname=Understanding%20Flow%20Charts" onclick="pageTracker._trackPageview('/outgoing/www.addtoany.com/share_save?linkurl=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F06_2F09_2Funderstanding-flow-charts_2F_amp_linkname=Understanding_20Flow_20Charts&amp;referer=');"><img src="http://sandbox.ronggur.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://sandbox.ronggur.com/2009/06/09/understanding-flow-charts/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>jQuery Tutorial : Simple ajax star rating with php</title>
		<link>http://sandbox.ronggur.com/2009/05/30/jquery-tutorial-simple-ajax-star-rating-with-php/</link>
		<comments>http://sandbox.ronggur.com/2009/05/30/jquery-tutorial-simple-ajax-star-rating-with-php/#comments</comments>
		<pubDate>Sat, 30 May 2009 03:08:11 +0000</pubDate>
		<dc:creator>ronggur</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery tutorial]]></category>

		<guid isPermaLink="false">http://sandbox.ronggur.com/?p=75</guid>
		<description><![CDATA[I made this simple ajax star rating for my latest poject. And now i want to share it to you. Let&#8217;s start it  .
Step 1 : CSS Star Rater
First thing is the star rater. I got this cool  &#8216;css star rater&#8217; from http://www.komodomedia.com/ . I assumed that we already understood how to use [...]]]></description>
			<content:encoded><![CDATA[<p>I made this simple ajax star rating for my latest poject. And now i want to share it to you. Let&#8217;s start it <img src='http://sandbox.ronggur.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<p><strong>Step 1 : </strong><strong>CSS Star Rater</strong></p>
<p>First thing is the star rater. I got this cool  &#8216;css star rater&#8217; from <a title="komodomedia.com" href="http://www.komodomedia.com/blog/2007/01/css-star-rating-redux/" onclick="pageTracker._trackPageview('/outgoing/www.komodomedia.com/blog/2007/01/css-star-rating-redux/?referer=');">http://www.komodomedia.com/</a> . I assumed that we already understood how to use it, so we will not talk too much about this &#8216;css star rater&#8217;.</p>
<p><strong>Step 2 : </strong><strong>Create MySQL table<br />
</strong></p>
<p>Next is create table (using MySQL) to store the data. You can copy the script below</p>
<pre class="brush: sql;">

CREATE TABLE IF NOT EXISTS `vote` (
`counter` int(8) NOT NULL default '0',
`value` int(8) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
</pre>
<p><strong>Step 3 : </strong><strong>PHP</strong></p>
<p>After finished create table, then we can start create some php code to handle input, update and retrieve data from the database, here is the code. I added some important comment in it</p>
<p><span id="more-75"></span></p>
<pre class="brush: php;">

&lt;?php

// connect to database
$dbh=mysql_connect (&quot;localhost&quot;, &quot;username&quot;, &quot;password&quot;) or die ('Cant connect to the database');
mysql_select_db (&quot;rating&quot;,$dbh);

if($_GET['do']=='rate'){
// do rate
rate();
}else if($_GET['do']=='getrate'){
// get rating
getRating();
}

// function to retrieve
function getRating(){
$sql= &quot;select * from vote&quot;;
$result=@mysql_query($sql);
$rs=@mysql_fetch_array($result);
// set width of star
$rating = (@round($rs[value] / $rs[counter],1)) * 20;
echo $rating;
}

// function to insert rating
function rate(){
$text = strip_tags($_GET['rating']);
$update = &quot;update vote set counter = counter + 1, value = value + &quot;.$_GET['rating'].&quot;&quot;;

$result = @mysql_query($update);
if(@mysql_affected_rows() == 0){
$insert = &quot;insert into vote (counter,value) values ('1','&quot;.$_GET['rating'].&quot;')&quot;;
$result = @mysql_query($insert);
}
}

?&gt;
</pre>
<p><strong>Step 4 : </strong><strong>JavaScript</strong></p>
<p>Next thing is javascript code. Below is the code, you can put this code between &lt;head&gt; tag or put it in separated javascript file.</p>
<pre class="brush: jscript;">

&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function() {
// get current rating
getRating();
// get rating function
function getRating(){
$.ajax({
type: &quot;GET&quot;,
url: &quot;update.php&quot;,
data: &quot;do=getrate&quot;,
cache: false,
async: false,
success: function(result) {
// apply star rating to element
$(&quot;#current-rating&quot;).css({ width: &quot;&quot; + result + &quot;%&quot; });
},
error: function(result) {
alert(&quot;some error occured, please try again later&quot;);
}
});
}

// link handler
$('#ratelinks li a').click(function(){
$.ajax({
type: &quot;GET&quot;,
url: &quot;update.php&quot;,
data: &quot;rating=&quot;+$(this).text()+&quot;&amp;amp;amp;do=rate&quot;,
cache: false,
async: false,
success: function(result) {
// remove #ratelinks element to prevent another rate
$(&quot;#ratelinks&quot;).remove();
// get rating after click
getRating();
},
error: function(result) {
alert(&quot;some error occured, please try again later&quot;);
}
});
});
});
&lt;/script&gt;
</pre>
<p>Don&#8217;t forget to link the jquery library into your document</p>
<pre class="brush: jscript;">

&lt;script src=&quot;rating/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
</pre>
<p><strong>Step 5 : Put it all together</strong></p>
<p>Put your css, javascript in one html</p>
<pre class="brush: xml;">

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /&gt;
&lt;title&gt;jQuery Tutorial : Simple ajax star rating&lt;/title&gt;
&lt;meta name=&quot;Keywords&quot; content=&quot;Star rating, jQuery, ajax&quot;&gt;
&lt;meta name=&quot;Description&quot; content=&quot;jQuery Tutorial : Simple ajax star rating&quot;&gt;
&lt;meta http-equiv=&quot;Content-Language&quot; content=&quot;en&quot;&gt;
&lt;meta name=&quot;robots&quot; content=&quot;index,follow&quot;&gt;
&lt;style&gt;
body{
font:12px Arial, Helvetica, sans-serif;
padding:40px;
}
&lt;/style&gt;
&lt;script src=&quot;rating/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;rating/starrating.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;link href=&quot;rating/starrating.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h2&gt;Star Rater&lt;/h2&gt;
&lt;ul class='star-rating'&gt;
&lt;li class=&quot;current-rating&quot; id=&quot;current-rating&quot;&gt;&lt;!-- will show current rating --&gt;&lt;/li&gt;
&lt;span id=&quot;ratelinks&quot;&gt;
&lt;li&gt;&lt;a href=&quot;javascript:void(0)&quot; title=&quot;1 star out of 5&quot; class=&quot;one-star&quot;&gt;1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;javascript:void(0)&quot; title=&quot;2 stars out of 5&quot; class=&quot;two-stars&quot;&gt;2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;javascript:void(0)&quot; title=&quot;3 stars out of 5&quot; class=&quot;three-stars&quot;&gt;3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;javascript:void(0)&quot; title=&quot;4 stars out of 5&quot; class=&quot;four-stars&quot;&gt;4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;javascript:void(0)&quot; title=&quot;5 stars out of 5&quot; class=&quot;five-stars&quot;&gt;5&lt;/a&gt;&lt;/li&gt;
&lt;/span&gt;
&lt;/ul&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>That&#8217;s it! <img src='http://sandbox.ronggur.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . You can add some modification like notification, or loader while processing.</p>
<p>- <a title="Simple star rating" href="http://dock.ronggur.com/tutorial/jquery_tutorial_starrating/" onclick="pageTracker._trackPageview('/outgoing/dock.ronggur.com/tutorial/jquery_tutorial_starrating/?referer=');">View Demo</a></p>
<p>- Download zip file <a class="downloadlink" href="http://sandbox.ronggur.com/wp-content/plugins/download-monitor/download.php?id=5" title="Version1 downloaded 1532 times" >jQuery Tutorial : Simple ajax star rating with php (1532)</a></p>
<p><em>This article inspired by <a href="http://www.yvoschaap.com/index.php/weblog/css_star_rater_ajax_version/" onclick="pageTracker._trackPageview('/outgoing/www.yvoschaap.com/index.php/weblog/css_star_rater_ajax_version/?referer=');">http://www.yvoschaap.com/</a> </em></p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="ronggur.mh@gmail.com" /><input type="hidden" name="return" value="Thank you for your kindness :D" /><input type="hidden" name="item_name" value="Buy Me a Beer for jQuery Tutorial : Simple ajax star rating with php" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="" /><input type="image" src="http://sandbox.ronggur.com/wp-content/plugins/buy-me-beer/icon_cafe.gif" align="left" alt="coffee" title="coffee" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=ronggur.mh@gmail.com&amp;currency_code=USD&amp;amount=&amp;return=Thank you for your kindness :D&amp;item_name=Buy+Me+a+Beer+for+jQuery+Tutorial+:+Simple+ajax+star+rating+with+php" target="paypal" onclick="pageTracker._trackPageview('/outgoing/www.paypal.com/cgi-bin/webscr?cmd=_xclick_amp_business=ronggur.mh_gmail.com_amp_currency_code=USD_amp_amount=_amp_return=Thank_you_for_your_kindness_D_amp_item_name=Buy+Me+a+Beer+for+jQuery+Tutorial+_+Simple+ajax+star+rating+with+php&amp;referer=');">You can give me some coffee if you want to :D</a></p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F05%2F30%2Fjquery-tutorial-simple-ajax-star-rating-with-php%2F&amp;linkname=jQuery%20Tutorial%20%3A%20Simple%20ajax%20star%20rating%20with%20php" onclick="pageTracker._trackPageview('/outgoing/www.addtoany.com/share_save?linkurl=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F05_2F30_2Fjquery-tutorial-simple-ajax-star-rating-with-php_2F_amp_linkname=jQuery_20Tutorial_20_3A_20Simple_20ajax_20star_20rating_20with_20php&amp;referer=');"><img src="http://sandbox.ronggur.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://sandbox.ronggur.com/2009/05/30/jquery-tutorial-simple-ajax-star-rating-with-php/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>
