<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:ymaps="http://api.maps.yahoo.com/Maps/V2/AnnotatedMaps.xsd">

<channel>
	<title>Tiw Works &#187; PHP</title>
	<atom:link href="http://tiw.blogginggeek.com/category/programming/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://tiw.blogginggeek.com</link>
	<description>something like a portfolio</description>
	<lastBuildDate>Wed, 14 Oct 2009 13:25:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Pixel Bow: My Cute Image Viewer with an Annotation Editor</title>
		<link>http://tiw.blogginggeek.com/2009/10/pixel-bow-my-cute-image-viewer-with-an-annotation-editor/</link>
		<comments>http://tiw.blogginggeek.com/2009/10/pixel-bow-my-cute-image-viewer-with-an-annotation-editor/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 17:30:59 +0000</pubDate>
		<dc:creator>tiw</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[VU]]></category>
		<category><![CDATA[Picture]]></category>
		<category><![CDATA[Pixel]]></category>
		<category><![CDATA[Source-code]]></category>

		<guid isPermaLink="false">http://tiw.blogginggeek.com/?p=404</guid>
		<description><![CDATA[Pixel Bow
I made an image viewer using Flex and Actionscript 3 where you can view the images as thumbnails and select an image and annotate it and even download that image with your annotations on it or save it to my server. Since I can view these images later, this can be a good way [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_405" class="wp-caption alignnone" style="width: 310px"><a href="http://tiw.blogginggeek.com/wp-content/uploads/2009/10/pixelbowss.JPG"><img class="size-medium wp-image-405" title="my image viewer with annotation editor" src="http://tiw.blogginggeek.com/wp-content/uploads/2009/10/pixelbowss-300x264.jpg" alt="Pixel Bow" width="300" height="264" /></a><p class="wp-caption-text">Pixel Bow</p></div>
<p>I made an image viewer using Flex and Actionscript 3 where you can view the images as thumbnails and select an image and annotate it and even download that image with your annotations on it or save it to my server. Since I can view these images later, this can be a good way to send me a secret message ;)</p>
<p>Anyway here you can <a href="http://tiw.blogginggeek.com/resources/CGMMediaViewerWithAnnotation/CGMMediaViewerWithAnnotation.html">view my pixel bow application</a> or <a href="http://tiw.blogginggeek.com/resources/CGMMediaViewerWithAnnotation/pixelbow.zip">download it</a> and embed it in your website. Or even better, you can <a href="http://tiw.blogginggeek.com/resources/CGMMediaViewerWithAnnotation/CGMMediaViewerWithAnnotation.zip">download my source code</a> and play around with it.</p>
<p>Your comments are appreciated :)</p>



Share this:


	<a rel="nofollow"  target="_blank" href="mailto:?subject=Pixel%20Bow%3A%20My%20Cute%20Image%20Viewer%20with%20an%20Annotation%20Editor&amp;body=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F10%2Fpixel-bow-my-cute-image-viewer-with-an-annotation-editor%2F" title="email"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F10%2Fpixel-bow-my-cute-image-viewer-with-an-annotation-editor%2F&amp;partner=sociable" title="Print"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Pixel%20Bow%3A%20My%20Cute%20Image%20Viewer%20with%20an%20Annotation%20Editor%20-%20http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F10%2Fpixel-bow-my-cute-image-viewer-with-an-annotation-editor%2F" title="Twitter"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F10%2Fpixel-bow-my-cute-image-viewer-with-an-annotation-editor%2F&amp;title=Pixel%20Bow%3A%20My%20Cute%20Image%20Viewer%20with%20an%20Annotation%20Editor&amp;annotation=%0A%0D%0AI%20made%20an%20image%20viewer%20using%20Flex%20and%20Actionscript%203%20where%20you%20can%20view%20the%20images%20as%20thumbnails%20and%20select%20an%20image%20and%20annotate%20it%20and%20even%20download%20that%20image%20with%20your%20annotations%20on%20it%20or%20save%20it%20to%20my%20server.%20Since%20I%20can%20view%20these%20images%20la" title="Google Bookmarks"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F10%2Fpixel-bow-my-cute-image-viewer-with-an-annotation-editor%2F&amp;title=Pixel%20Bow%3A%20My%20Cute%20Image%20Viewer%20with%20an%20Annotation%20Editor" title="Reddit"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F10%2Fpixel-bow-my-cute-image-viewer-with-an-annotation-editor%2F&amp;title=Pixel%20Bow%3A%20My%20Cute%20Image%20Viewer%20with%20an%20Annotation%20Editor&amp;notes=%0A%0D%0AI%20made%20an%20image%20viewer%20using%20Flex%20and%20Actionscript%203%20where%20you%20can%20view%20the%20images%20as%20thumbnails%20and%20select%20an%20image%20and%20annotate%20it%20and%20even%20download%20that%20image%20with%20your%20annotations%20on%20it%20or%20save%20it%20to%20my%20server.%20Since%20I%20can%20view%20these%20images%20la" title="del.icio.us"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F10%2Fpixel-bow-my-cute-image-viewer-with-an-annotation-editor%2F&amp;title=Pixel%20Bow%3A%20My%20Cute%20Image%20Viewer%20with%20an%20Annotation%20Editor&amp;bodytext=%0A%0D%0AI%20made%20an%20image%20viewer%20using%20Flex%20and%20Actionscript%203%20where%20you%20can%20view%20the%20images%20as%20thumbnails%20and%20select%20an%20image%20and%20annotate%20it%20and%20even%20download%20that%20image%20with%20your%20annotations%20on%20it%20or%20save%20it%20to%20my%20server.%20Since%20I%20can%20view%20these%20images%20la" title="Digg"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F10%2Fpixel-bow-my-cute-image-viewer-with-an-annotation-editor%2F&amp;title=Pixel%20Bow%3A%20My%20Cute%20Image%20Viewer%20with%20an%20Annotation%20Editor" title="DZone"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F10%2Fpixel-bow-my-cute-image-viewer-with-an-annotation-editor%2F" title="Technorati"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F10%2Fpixel-bow-my-cute-image-viewer-with-an-annotation-editor%2F&amp;t=Pixel%20Bow%3A%20My%20Cute%20Image%20Viewer%20with%20an%20Annotation%20Editor" title="Facebook"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://tiw.blogginggeek.com/2009/10/pixel-bow-my-cute-image-viewer-with-an-annotation-editor/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How To Get Geographical Location Details from IP and Show Them on a Map</title>
		<link>http://tiw.blogginggeek.com/2009/10/how-to-get-geographical-location-details-from-ip-and-show-them-on-a-map/</link>
		<comments>http://tiw.blogginggeek.com/2009/10/how-to-get-geographical-location-details-from-ip-and-show-them-on-a-map/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 17:26:11 +0000</pubDate>
		<dc:creator>tiw</dc:creator>
				<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[SOAP]]></category>
		<category><![CDATA[VU]]></category>
		<category><![CDATA[Web Service]]></category>
		<category><![CDATA[Source-code]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://tiw.blogginggeek.com/?p=377</guid>
		<description><![CDATA[Our first assignment for Intelligent Web Applications course at VU was to transform a WSDL web service (either GeoIPService or Fraudlabs IP2Location Webservice) to a RESTful web service and display the result using either Google Maps or Yahoo Maps.
Me and my project mate Mies developed 2 different versions for this assignment.

Version 1 &#8211; uses the [...]]]></description>
			<content:encoded><![CDATA[<p>Our first assignment for Intelligent Web Applications course at VU was to transform a WSDL web service (either <a href="http://www.webservicex.net/WCF/ServiceDetails.aspx?SID=46">GeoIPService</a> or <a href="http://www.fraudlabs.com/ip2location.aspx">Fraudlabs IP2Location Webservice</a>) to a RESTful web service and display the result using either Google Maps or Yahoo Maps.</p>
<p>Me and my project mate <a href="http://twitter.com/mies">Mies</a> developed 2 different versions for this assignment.</p>
<ul>
<li>Version 1 &#8211; uses the GeoIPService, the Ruby programming language, Sinatra, soap4r, the jquery Javascript framework and the Yahoo Maps API and can be found here:<br />
<a href="http://iwa-wsdl2ruby.heroku.com">iwa-wsdl2ruby</a></li>
<li>Version 2 – uses the Fraudlabs IP2Location webservice, the PHP programming language, nusoap, Javascript and the Google Maps API and can be found here:<br />
<a href="http://tiw.blogginggeek.com/resources/iwa/ip2geo/DisplayGeographicalLocation.html">DisplayGeographicalLocation.html</a></li>
</ul>
<p><strong>Version 1:</strong><br />
Since Version 1 was fully developed by Mies, I will not post the source code for this here. Maybe he can give a link to his code if he wants. So here is the explanation for the version 1:</p>
<p>The GeoIP WSDL-to-REST service is built using Sinatra, soap4r, the Ruby programming language, Yahoo Maps and the jquery javascript framework. Sinatra is an open source web application framework and domain specific language written in Ruby. As opposed to other web frameworks such as Rails (also in Ruby) or Django (written in Python), Sinatra is very minimal in its design and implementation. URL Routes in Sinatra are HTTP methods combined with some pattern matching and logic. The simplest URL route and thus web application in Sinatra is:<br />
<code><br />
get '/' do<br />
"Hello World"<br />
end<br />
</code><br />
which basically prints out &#8220;Hello World&#8221; if invoked via the web server using the root url (http://localhost/). As such Sinatra is ideal for building small REST services, API&#8217;s and web hooks, and thus a perfect candidate for completing this assignment.</p>
<p>All application logic resides in the &#8216;main.rb&#8217; file. Using the soap4r library (an implementation of Soap 1.1 in Ruby), a request object is created using the provided .wsdl file. The IP address as provided by the user is passed as parameter to the getGeoIP method of the request object. Second a result object (in fact a key-value pair, or dictionary) is created using the getGeoIPResult method, invoked upon the same request object. The actual country name is the value of the CountryName key within the result key-value pair.</p>
<p>Two forms of URL routes are provided, one for the html representation and a second route for the REST API. The html representation is a simple .erb (a ruby templating language) template with a form. The IP address can be submitted and the result is displayed.</p>
<p>The second URL route provides the methods for the RESTful API. The following methods are supported: /api/location.<FORMAT>?ip=<IP-ADDRESS> where <FORMAT> is the desired output format.<br />
Current options are .xml and .json</p>
<p>For instance the url:</p>
<p><a href="http://iwa-wsdl2ruby.heroku.com/api/location.xml?ip=62.69.184.53">/api/location.xml?ip=62.69.184.53</a> will render a response NETHERLANDS </p>
<p>whereas </p>
<p>the <a href="http://iwa-wsdl2ruby.heroku.com/api/location.json?ip=62.69.184.53">location.json?ip=62.69.184.53</a> equivalent will render a {&#8221;CountryName&#8221;:&#8221;NETHERLANDS&#8221;} response.</p>
<p>The ajax response and yahoo maps calls are handled using jquery; a javascript framework.</p>
<p>Figure 1 displays an overview of the application&#8217;s architecture:<br />
<a href="http://tiw.blogginggeek.com/wp-content/uploads/2009/10/architecture1.JPG"><img class="alignnone size-full wp-image-382" title="architecture" src="http://tiw.blogginggeek.com/wp-content/uploads/2009/10/architecture1.JPG" alt="architecture" width="553" height="391" /></a></p>
<p>The final web application is deployed using Heroku, a cloud-based hosting environment for ruby applications at <a href="http://iwa-wsdl2ruby.heroku.com/">http://iwa-wsdl2ruby.heroku.com/</a>. The initial version used the Google Maps Geocoding API for requesting a latitude and longitude and subsequently render the actual map. However as Heroku uses a reverse proxy (Nginx) and http caching layer (Varnish) to service and load balance requests, and being able to dynamically scale deployed web applications, the IP address used for this web application is not static. As such the Google Maps API key can not be coupled to this web application and thus an error message appears and the actual map is not rendered. The Yahoo Maps API is less strict in this sense about its usage and thus we ended up using this service in rendering the final map.</p>
<p><strong>Version 2:</strong><br />
This version of the application makes use of Javascript in the front-end and PHP at the back-end and only works for IE  for now. This can be avoided by using a framework like <a href="http://www.prototypejs.org/">prototypejs</a>.</p>
<p>When the user browses to <a href="http://tiw.blogginggeek.com/resources/iwa/ip2geo/DisplayGeographicalLocation.html">DisplayGeographicalLocation.html</a> 2 new Ajax objects are created as the page is loaded(one for getting IP asynchronously and the other for getting the geographical location asynchronously).</p>
<p>The logic of the application resides in ipToMap function. If the ip input text field is empty, it makes an HTTP GET request to getUserIP.php which returns the user IP to the client. </p>
<p>The Javascript code for this would look like this:</p>
<p><a href="http://tiw.blogginggeek.com/wp-content/uploads/2009/10/ipToMap.JPG"><img src="http://tiw.blogginggeek.com/wp-content/uploads/2009/10/ipToMap.JPG" alt="ipToMap" title="ipToMap" width="731" height="270" class="alignnone size-full wp-image-388" /></a></p>
<p>The PHP code for getting user ip is as below:</p>
<p><a href="http://tiw.blogginggeek.com/wp-content/uploads/2009/10/getuserip.JPG"><img src="http://tiw.blogginggeek.com/wp-content/uploads/2009/10/getuserip.JPG" alt="getuserip" title="getuserip" width="608" height="271" class="alignnone size-full wp-image-400" /></a></p>
<p>After the ip is successfully assigned to the ip input text field, a new http GET request is made to getGeoLoc.php and ip is given as a parameter.</p>
<p><a href="http://tiw.blogginggeek.com/wp-content/uploads/2009/10/statechangeip.JPG"><img src="http://tiw.blogginggeek.com/wp-content/uploads/2009/10/statechangeip.JPG" alt="when the response comes from getUserIP.php" title="when the response comes from getUserIP.php" width="637" height="236" class="alignnone size-full wp-image-389" /></a><br />
<a href="http://tiw.blogginggeek.com/wp-content/uploads/2009/10/getGeoLocFromIP.JPG"><img src="http://tiw.blogginggeek.com/wp-content/uploads/2009/10/getGeoLocFromIP.JPG" alt="getGeoLocFromIP" title="getGeoLocFromIP" width="553" height="142" class="alignnone size-full wp-image-391" /></a><br />
<a href="http://tiw.blogginggeek.com/wp-content/uploads/2009/10/getGeoLocFromIPstatechange.JPG"><img src="http://tiw.blogginggeek.com/wp-content/uploads/2009/10/getGeoLocFromIPstatechange.JPG" alt="getGeoLocFromIPstatechange" title="getGeoLocFromIPstatechange" width="1162" height="570" class="alignnone size-full wp-image-392" /></a></p>
<p>This php file makes use of nusoap library in order to create a soap client using the WSDL file provided by fraudlabs: <a href="http://ws.fraudlabs.com/ip2locationwebservice.asmx?wsdl">ip2locationwebservice.asmx?wsdl</a> and to call the fraudlabs IP2Location webservice with a message including the ip and licence key needed to use this webservice. </p>
<p>A sample call to getGeoLoc.php and its result would look like this:</p>
<p><a href="http://tiw.blogginggeek.com/wp-content/uploads/2009/10/screenshotcallGetGeoLoc.JPG"><img class="alignnone size-full wp-image-379" title="Get Geographical Location - the RESTful way" src="http://tiw.blogginggeek.com/wp-content/uploads/2009/10/screenshotcallGetGeoLoc.JPG" alt="Get Geographical Location - the RESTful way" width="515" height="244" /></a></p>
<p>And the source code for getGeoLoc.php which turns WSDL webservice into REST.</p>
<p><a href="http://tiw.blogginggeek.com/wp-content/uploads/2009/10/getgeolocphp.jpg"><img class="alignnone size-full wp-image-385" title="getGeoLoc.php source code" src="http://tiw.blogginggeek.com/wp-content/uploads/2009/10/getgeolocphp.jpg" alt="getGeoLoc.php source code" width="778" height="561" /></a></p>
<p>The result is then processed and turned into XML format within getGeoLoc.php and returned to the ajaxObject as a responseText. This text is than recognized as an XMLDOM and parsed and the latitude and longtitude are retrieved. These latitude and longtitude variables are then used for creating a map using the Google Maps API.</p>
<p><a href="http://tiw.blogginggeek.com/wp-content/uploads/2009/10/screenshotdisplaygeoloc.JPG"><img class="alignnone size-full wp-image-380" title="Display Geographical Location on Google Maps" src="http://tiw.blogginggeek.com/wp-content/uploads/2009/10/screenshotdisplaygeoloc.JPG" alt="Display Geographical Location on Google Maps" width="545" height="557" /></a></p>
<p>Please note that the free version of fraudlabs includes only 90 calls to their webservice per month, so when the credits are finished the result will not be accurate, it will return a latitude of 0 and longtitude of 0.</p>
<p>These examples are bound to external services though.<br />
In practice, if it is a crucial functionality for your projects, I would recommend keeping the ip to geographical details on your database and write a service of your own, so that when these external services are down or you are out of credits, you wouldn&#8217;t be angry at other parties :)</p>



Share this:


	<a rel="nofollow"  target="_blank" href="mailto:?subject=How%20To%20Get%20Geographical%20Location%20Details%20from%20IP%20and%20Show%20Them%20on%20a%20Map&amp;body=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F10%2Fhow-to-get-geographical-location-details-from-ip-and-show-them-on-a-map%2F" title="email"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F10%2Fhow-to-get-geographical-location-details-from-ip-and-show-them-on-a-map%2F&amp;partner=sociable" title="Print"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=How%20To%20Get%20Geographical%20Location%20Details%20from%20IP%20and%20Show%20Them%20on%20a%20Map%20-%20http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F10%2Fhow-to-get-geographical-location-details-from-ip-and-show-them-on-a-map%2F" title="Twitter"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F10%2Fhow-to-get-geographical-location-details-from-ip-and-show-them-on-a-map%2F&amp;title=How%20To%20Get%20Geographical%20Location%20Details%20from%20IP%20and%20Show%20Them%20on%20a%20Map&amp;annotation=Our%20first%20assignment%20for%20Intelligent%20Web%20Applications%20course%20at%20VU%20was%20to%20transform%20a%20WSDL%20web%20service%20%28either%20GeoIPService%20or%20Fraudlabs%20IP2Location%20Webservice%29%20to%20a%20RESTful%20web%20service%20and%20display%20the%20result%20using%20either%20Google%20Maps%20or%20Yahoo%20Maps.%0D%0A" title="Google Bookmarks"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F10%2Fhow-to-get-geographical-location-details-from-ip-and-show-them-on-a-map%2F&amp;title=How%20To%20Get%20Geographical%20Location%20Details%20from%20IP%20and%20Show%20Them%20on%20a%20Map" title="Reddit"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F10%2Fhow-to-get-geographical-location-details-from-ip-and-show-them-on-a-map%2F&amp;title=How%20To%20Get%20Geographical%20Location%20Details%20from%20IP%20and%20Show%20Them%20on%20a%20Map&amp;notes=Our%20first%20assignment%20for%20Intelligent%20Web%20Applications%20course%20at%20VU%20was%20to%20transform%20a%20WSDL%20web%20service%20%28either%20GeoIPService%20or%20Fraudlabs%20IP2Location%20Webservice%29%20to%20a%20RESTful%20web%20service%20and%20display%20the%20result%20using%20either%20Google%20Maps%20or%20Yahoo%20Maps.%0D%0A" title="del.icio.us"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F10%2Fhow-to-get-geographical-location-details-from-ip-and-show-them-on-a-map%2F&amp;title=How%20To%20Get%20Geographical%20Location%20Details%20from%20IP%20and%20Show%20Them%20on%20a%20Map&amp;bodytext=Our%20first%20assignment%20for%20Intelligent%20Web%20Applications%20course%20at%20VU%20was%20to%20transform%20a%20WSDL%20web%20service%20%28either%20GeoIPService%20or%20Fraudlabs%20IP2Location%20Webservice%29%20to%20a%20RESTful%20web%20service%20and%20display%20the%20result%20using%20either%20Google%20Maps%20or%20Yahoo%20Maps.%0D%0A" title="Digg"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F10%2Fhow-to-get-geographical-location-details-from-ip-and-show-them-on-a-map%2F&amp;title=How%20To%20Get%20Geographical%20Location%20Details%20from%20IP%20and%20Show%20Them%20on%20a%20Map" title="DZone"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F10%2Fhow-to-get-geographical-location-details-from-ip-and-show-them-on-a-map%2F" title="Technorati"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F10%2Fhow-to-get-geographical-location-details-from-ip-and-show-them-on-a-map%2F&amp;t=How%20To%20Get%20Geographical%20Location%20Details%20from%20IP%20and%20Show%20Them%20on%20a%20Map" title="Facebook"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://tiw.blogginggeek.com/2009/10/how-to-get-geographical-location-details-from-ip-and-show-them-on-a-map/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress vs. HomeMade PHP Website</title>
		<link>http://tiw.blogginggeek.com/2009/01/wordpress-vs-homemade-php-website/</link>
		<comments>http://tiw.blogginggeek.com/2009/01/wordpress-vs-homemade-php-website/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 00:08:31 +0000</pubDate>
		<dc:creator>tiw</dc:creator>
				<category><![CDATA[Database Design]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[My Other]]></category>

		<guid isPermaLink="false">http://tiw.blogginggeek.com/?p=205</guid>
		<description><![CDATA[After my graduation in 2005, I started drawing some cartoons -which is nowhere near my favorite cartoon series &#8220;Fox Trot&#8221; or anything like that..- It was just for fun, spending some time while learning some tools.. Anyway, I also wanted to display these cartoons on the internet. But I didn&#8217;t have a WordPress account back [...]]]></description>
			<content:encoded><![CDATA[<p>After my graduation in 2005, I started drawing some cartoons -which is nowhere near my favorite cartoon series &#8220;<a href="http://www.foxtrot.com/" target="_blank">Fox Trot</a>&#8221; or anything like that..- It was just for fun, spending some time while learning some tools.. Anyway, I also wanted to display these cartoons on the internet. But I didn&#8217;t have a WordPress account back then, or didn&#8217;t know about it yet.. So I decided to make my own PHP website in order to display the cartoons dynamically.</p>
<p>Here is the design I made for the database:</p>
<p>2 tables only. Nothing fancy :-)<br />
One for the images &#8220;TBLIMAGE&#8221;, and the other for the subjects &#8220;TBLSUBJECT&#8221;.</p>
<p>Image table has the columns below:</p>
<ul>
<li>imageID: unique id</li>
<li>fileName: name of the file that we will show</li>
<li>subjectID (key for getting the subject name from the subjects table)</li>
<li>filePreTxt: Some text to display just before the image</li>
<li>filePostTxt: Some text to display just after the image</li>
<li>strImageQueue: Within the subject every image has a queue which shows their priority to be shown</li>
</ul>
<div id="attachment_206" class="wp-caption alignnone" style="width: 438px"><a href="http://tiw.blogginggeek.com/wp-content/uploads/2009/01/tableimage.jpg"><img class="size-full wp-image-206" title="tableimage" src="http://tiw.blogginggeek.com/wp-content/uploads/2009/01/tableimage.jpg" alt="TBLIMAGE" width="428" height="139" /></a><p class="wp-caption-text">TBLIMAGE</p></div>
<p>Subject table has the columns below:</p>
<ul>
<li>parentSubjectID</li>
<li>subjectText: The title of the cartoon will use what ever text is in here</li>
<li>strSubjectDate: We will order the cartoon files first according to their subject dates</li>
</ul>
<div id="attachment_207" class="wp-caption alignnone" style="width: 424px"><a href="http://tiw.blogginggeek.com/wp-content/uploads/2009/01/tablesubject.jpg"><img class="size-full wp-image-207" title="tablesubject" src="http://tiw.blogginggeek.com/wp-content/uploads/2009/01/tablesubject.jpg" alt="TBLSUBJECT" width="414" height="118" /></a><p class="wp-caption-text">TBLSUBJECT</p></div>
<p>And here are some parts of the PHP codes, that you may find useful:</p>
<p>Setting up the <a href="http://tiw.blogginggeek.com/wp-content/uploads/2009/01/configphp.txt">configuration file</a> by assigning the dbname, username, password values to their variables respectively:<br />
<code><br />
$dbhost = 'localhost';<br />
$dbuser = 'yourdbusername';<br />
$dbpass = 'yourdbpassword';<br />
$dbname = 'yourdbname';<br />
</code></p>
<p><a href="http://tiw.blogginggeek.com/wp-content/uploads/2009/01/opendbphp.txt">Opening</a> the database connection to work with:<br />
<code><br />
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');<br />
mysql_select_db($dbname);<br />
</code></p>
<p>And finally, defining and running my query:<br />
<code><br />
$query = "SELECT filepretxt, fileposttxt, filename, subjecttext, strimagequeue FROM tblimage, tblsubject  WHERE subjectid = parentsubjectid order by strsubjectdate asc, strimagequeue asc";<br />
$result = mysql_query($query) or die('Error, query failed');<br />
</code></p>
<p>Well, I didn&#8217;t forget to <a href="http://tiw.blogginggeek.com/wp-content/uploads/2009/01/closedbphp.txt" target="_blank">close the database connection</a> of course.<br />
<code><br />
mysql_close($conn);<br />
</code></p>
<p>So, here is my question:<br />
Now that we have a chance to use a powerful and easy to integrate web application like Wordpress, would you rather use it, or make your own PHP Website for displaying your works/cartoons/etc.?<br />
Or lets put it this way:<br />
Which one is better?<br />
<a href="http://whibdatt.blogginggeek.com" target="_blank">Whibdatt [WordPress]</a> or <a href="http://whiblog.blogginggeek.com/" target="_blank">Whibdatt [HomeMade]</a>?</p>
<p>Special thanks to <a href="http://www.w3schools.com/" target="_blank">W3Schools</a> for their nice and explanatory web development tutorials ^^</p>



Share this:


	<a rel="nofollow"  target="_blank" href="mailto:?subject=WordPress%20vs.%20HomeMade%20PHP%20Website&amp;body=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F01%2Fwordpress-vs-homemade-php-website%2F" title="email"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F01%2Fwordpress-vs-homemade-php-website%2F&amp;partner=sociable" title="Print"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=WordPress%20vs.%20HomeMade%20PHP%20Website%20-%20http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F01%2Fwordpress-vs-homemade-php-website%2F" title="Twitter"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F01%2Fwordpress-vs-homemade-php-website%2F&amp;title=WordPress%20vs.%20HomeMade%20PHP%20Website&amp;annotation=After%20my%20graduation%20in%202005%2C%20I%20started%20drawing%20some%20cartoons%20-which%20is%20nowhere%20near%20my%20favorite%20cartoon%20series%20%22Fox%20Trot%22%20or%20anything%20like%20that..-%20It%20was%20just%20for%20fun%2C%20spending%20some%20time%20while%20learning%20some%20tools..%20Anyway%2C%20I%20also%20wanted%20to%20display%20th" title="Google Bookmarks"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F01%2Fwordpress-vs-homemade-php-website%2F&amp;title=WordPress%20vs.%20HomeMade%20PHP%20Website" title="Reddit"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F01%2Fwordpress-vs-homemade-php-website%2F&amp;title=WordPress%20vs.%20HomeMade%20PHP%20Website&amp;notes=After%20my%20graduation%20in%202005%2C%20I%20started%20drawing%20some%20cartoons%20-which%20is%20nowhere%20near%20my%20favorite%20cartoon%20series%20%22Fox%20Trot%22%20or%20anything%20like%20that..-%20It%20was%20just%20for%20fun%2C%20spending%20some%20time%20while%20learning%20some%20tools..%20Anyway%2C%20I%20also%20wanted%20to%20display%20th" title="del.icio.us"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F01%2Fwordpress-vs-homemade-php-website%2F&amp;title=WordPress%20vs.%20HomeMade%20PHP%20Website&amp;bodytext=After%20my%20graduation%20in%202005%2C%20I%20started%20drawing%20some%20cartoons%20-which%20is%20nowhere%20near%20my%20favorite%20cartoon%20series%20%22Fox%20Trot%22%20or%20anything%20like%20that..-%20It%20was%20just%20for%20fun%2C%20spending%20some%20time%20while%20learning%20some%20tools..%20Anyway%2C%20I%20also%20wanted%20to%20display%20th" title="Digg"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F01%2Fwordpress-vs-homemade-php-website%2F&amp;title=WordPress%20vs.%20HomeMade%20PHP%20Website" title="DZone"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F01%2Fwordpress-vs-homemade-php-website%2F" title="Technorati"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Ftiw.blogginggeek.com%2F2009%2F01%2Fwordpress-vs-homemade-php-website%2F&amp;t=WordPress%20vs.%20HomeMade%20PHP%20Website" title="Facebook"><img src="http://tiw.blogginggeek.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://tiw.blogginggeek.com/2009/01/wordpress-vs-homemade-php-website/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
