Subesh Pokhrel's Blog – Magento Development Tips,PHP,Google Maps
PHP & Magento Tips & Tutorials

I have completed first phase of a simple, yet useful Newsletter System. When I demonstrated to the clients, they came up with a question if the newsletter being send was opened or not by the newsletter subscribers ? I then thought.. let see how its done. Then I came with this simple tracking trick, most of the spammers used to verify if the email address was valid or not.
The first thing I did was adding 1px by 1px image on the footer of the newsletter, whose source was set something like this http://subesh.com.np/newsletter/track.php?identitycode=CLIENTID_SENDEMAILID. Here CLIENTID = Your Clients ID and SENDEMAILID = Id of the Newsletter sent. Now, when the image is loaded while viewing the newsletter on the mail or say when the client reads the newsletter email. The track.php page is requested with identitycode as the GET parameter. And when you get the request from the mail to your server’s page, you can do anything you want. What I did was setting the mail_read column of the database field as 1. And echoed the source of the image file on the last line.
The code below is for the track.php.

Continue reading “Newsletter Email Tracking: Read or Not?” »

  • Share/Bookmark

Facebook Chat On a Side Bar Of Mozilla

Posted on September 23, 2008 | 2 Comments

These days I am using Facebook a lot and no wonder everyone is using Facebook a lot. And the number of online users on Facebook are sometimes more then my MSN Messager online friends list. I get so much of words from my friends saying I did not reply to their message on Facebook Chat. In fact I open so much of mozilla window and tabs while working that, I come across the Facebook page once in a while. Then I came up with this idea of opening Facebook Chat on the side bar (i.e Bookmark Side Bar), and to my delight….. IT WORKED!….

Continue reading “Facebook Chat On a Side Bar Of Mozilla” »

  • Share/Bookmark

Today, while writing a code for AJAX file uploader, I was trying to do with [wiki]SALAJAX[/wiki]. But, with SALAJAX I could not manage to send the headers for $_FILES. So I thought of an alternative. And the alternative was to load the action page of the form on [wiki]IFrame[/wiki], whose display would be hidden and the work for uploading the file will be done on the background without refreshing the page. Yeha.. Its not [wiki]AJAX[/wiki], but it gives a user the feel of asynchronous working on the page. So, my code is Asynchronous Feel Without Javascript and XML (AFWJAX). What do think about this?
So, Here’s the code.The code below is for the form.

<form action="iframeinc.php" method="post" enctype="multipart/form-data" id="uploadform" target="iframe" name="uploadform">
 File:
  <input name="pic" type="file" id="pic" style="margin-right:50px;" />
  <br />
<input type="submit" name="Submit" value="Upload" /><br />
<iframe name="iframe" src="iframeinc.php" width="200" height="500" style="display:none;"> </iframe>
</form>

Continue reading “Ajaxified File Uploader Using IFrame” »

  • Share/Bookmark

Tabbed Infowindow in Google Maps

Posted on July 16, 2008 | No Comments

I wanted to show different categories of information on one GMarker. That is I wanted to show different types of information on a Infowindow for a point on Google Maps. For that I used a tabbed info window, which helped me to show different data on each tabs. Here is the code of what I have done. I have shown the latitude and longitude of a placed clicked on the map on the tabbed info window. This is just the script part. The demo and download links are given below.

Continue reading “Tabbed Infowindow in Google Maps” »

  • Share/Bookmark

At last I found hostip.info provides a service for getting the latitude and longitude of a place on the basis of the user’s ip address. Its light weight and free, rather than downloading bulky database and getting paid services, for getting latitude and longitude on the basis of IP.
Here is the simplest way to do it. Requested to http://api.hostip.info/?ip=$ip&position=true it responds XML formatted output. So we need to parse XML code using DOM class of PHP.(#19-#23). Remember, the position=true should be set to get the latitude and longitude otherwise it will not show on default.

Here is the code and I will soon upload the working demo.

< ?php
/*
Subesh Pokhrel
subesh.com.np
Get the code for Real IP of the site from roshanbh.com.np
Mapping The IP Address to Latitude and Longitude.
*/
function IPtoLatLng($ip)
{
$latlngValue=array();
$dom = new DOMDocument();
$ipcheck = ip2long($ip);

Continue reading “Mapping The IP Address to Latitude and Longitude In Google Maps” »

  • Share/Bookmark

Wikilinki Ver 1.0 Released

Posted on July 8, 2008 | 5 Comments

For last few days I have been trying to understand wordpress ins and outs, and had an idea of developing simple plugin for [wiki]wordpress[/wiki]. I thought people would want to give the reference of most of the words they use in their post to wikipedia, and placing it manually would be a very difficult task. Like the way I have done for the wordpress word above. So thought “wikilinki” would be a helpful plugin for those people.
And here I have it today the wikilinki plugin developed. This is just the initial version, I would add more functionality later. Because I am so excited to release it, I will add other things later on. Its easy to implement it just use [WIKI]Words[/WIKI] all in small on the post to get the reference URL of the word from wikipedia. I had to encode the usage because I have already installed it and it would parse it too. Place wikilinki.php under wp-content/plugins and activate from the admin.
You can download wikilinki from Get Wikilinki (Updated)

Continue reading “Wikilinki Ver 1.0 Released” »

  • Share/Bookmark

I was just wandering through the themes factories of wordpress I came across this theme BlueUzor by skinpress, had a demo view and I had opened the last theme I installed on the tab of mozilla. Then I compared the two.. I thought what a bad choice I had before! :D

Continue reading “Surprised ! I installed a new theme.. Yeha” »

  • Share/Bookmark

Configuring TinyMCE:Simple Setup

Posted on June 26, 2008 | 7 Comments

Everybody is already familiar with WYSIWYG editor. Before, doing CMS projects I used to use fckeditor, and I always had a problem with its bad design and loading time. Though you can config the editor to just the actions you need. I still felt something was not right about it. And I searched about editors, then I came across TinyMCE editor.

Continue reading “Configuring TinyMCE:Simple Setup” »

  • Share/Bookmark

I have already posted similar post for finding out the latitude and longitude of a place using Google maps, but when I studied the traffic details and found out that when people visit that post, they sometime come with keywords like zipcode+latitude and longitudes, so I thought it would be better to them to post another article, giving them what they exactly want.

Continue reading “Latitude and Longitude Of a Place in Google Maps Using Zip Code” »

  • Share/Bookmark

On doing one of my project, I came across this situation when I need to find out whether the domain name supplied by the user is available or not? I then came up with a solution, here’s is what I did. But before that let me explain somethings. There is something called WHOIS LOOKUP. WHOIS LOOKUP is action relating to look on official WHOIS database server for the information related to domain name.

Continue reading “Checking if the domain is registered or not ?” »

  • Share/Bookmark

Search engine optimization by SEO Design Solutions