trk's weblog My virtual home. 2007-12-12T08:09:06Z WordPress http://www.trk7.com/blog/feed/atom/ trkesavan http:// <![CDATA[Movie News]]> http://www.trk7.com/blog/uncategorized/movie-news/ 2007-12-12T08:09:06Z 2007-12-12T08:09:06Z news2u.in is a place to read interesting happenings in Tamil Cinema World.

]]>
trkesavan http:// <![CDATA[Tamil Movie reviews site.]]> http://www.trk7.com/blog/links/tamil-movie-reviews-site/ 2007-11-16T14:46:58Z 2007-11-16T14:46:58Z Finally, you have a site where, at a glance, one gets to read multiple tamil movie reviews. Very cool!

Check it out at http://www.cinereviews.in/.

]]>
trkesavan http:// <![CDATA[Getting visitor location in PHP.]]> http://www.trk7.com/blog/programming/getting-visitor-location-in-php/ 2007-11-07T13:54:25Z 2007-11-07T13:54:25Z I had been trying to track the location of visitors based on their IP addresses. I ran into problems earlier while trying to acheive that and gave up. Today, I Finally managed to do that. Thanks to the geodb availablehere. I hacked up a function that would accept an IP address as a parameter and return an array with location info.

The code for the function is:

function getIpInfo($ip){
$ipa=explode(".",$ip);
$ipnum=256*256*256*$ipa[0]+256*256*$ipa[1]+256*$ipa[2]+$ipa[3];
 //download the Geo DB file from http://software77.net/geoip-software.htm
$handle = fopen("IpToCountry.txt", "r");
$userinfo=NULL;
while (!feof($handle)){
 list ($start, $finish, $a1,$a2,$a3,$a4,$a5) = explode("\t",fgets($handle));
   if(($start<=$ipnum)&&($ipnum<=$finish)) {$userinfo=array($a3,$a4,$a5); break; }
}
fclose($handle);
if(!$userinfo) $userinfo=array('Cannot Trace the Ip address','Cannot Trace the Ip address','Cannot Trace the Ip address');
return $userinfo;
}

One just needs to change the name of the file (in my case ‘IpToCountry.txt’) to the one that they have downloaded.The array returns (’2 Digit Country Code’, ‘3 Digit Country Code’, ‘Full Country Name’), and, you can use it to display location or use it in your script as a variable. Make sure you do ip validation befor passing the IP address (ip2long()). A demo of it is available here. For a list of Other PHP/Javascript Demos please go to here.

]]>
trkesavan http:// <![CDATA[Pagination issue in Pligg]]> http://www.trk7.com/blog/pligg/pagination-issue-in-pligg/ 2007-11-05T12:13:14Z 2007-11-05T12:13:14Z —-This post is part of my effort to document issues that I face while using Pligg.—-
As the number of posts increase at ShopDeals.in (I have got nothing else to do!), I noticed something that was not right (which I kinda ignored before). As the number of posts became greater that the number of posts that were meant to be one page, I expected a link down at the bottom of the page that would have directed me to older submissions (pagination). That did not occur, after some searching, I came across a Post in the Pligg forum that directed me to download the Admin Total Plugin, that kind of regenerates the total no of pages ;submitted, queued and discarded. after installing and clicking on Regenerate Totals link twice, I was able to fix the issue. If you are unable to see page links in Pligg and have
 do_pages($rows, $page_size, "published");  

uncommented in index_center.tpl , then defintely download the plugin and give it a try.

]]>
trkesavan http:// <![CDATA[Shopping Deals in India]]> http://www.trk7.com/blog/shopdeals/shopping-deals-in-india/ 2007-11-04T10:17:35Z 2007-11-04T10:17:35Z I am currently involved with Shopdeals.in, a site where Indian Shoppers can; submit a shopping deal that they have come across in their city, vote and comment on deals submitted by others.Also I have developed a facebook app based on Shopdeals.in which is accessible here.

]]>
trkesavan http:// <![CDATA[SansJ Newsletter]]> http://www.trk7.com/blog/sansj/sansj-newsletter/ 2007-10-14T05:27:59Z 2007-10-14T05:27:59Z I finally managed to send a newsletter to all SansJ users. It looks great, you can have a look at it here.

I had been looking at Online Newsletter generating services, and, I was surprised to find that they are pretty expensive (around 10$ per month). I spent a day to create the newsletters and sent it through Entourage. Most E-Mail clients cannot send complex HTML E-Mails and usually require some kind of an add-on script. For Entourage I used this, an excellent Script that worked very well.

My newsletter looks great in Entourage,Gmail, YahooMail and Hotmail. Hopefully I will be able to send more of these in the future.

]]>
trkesavan http:// <![CDATA[Customizing Pligg]]> http://www.trk7.com/blog/pligg/customizing-pligg/ 2007-09-29T04:54:40Z 2007-09-29T04:54:40Z Customizing Pligg can be as simple as editing some .tpl files.

If you would like to change; the name of the site, e-mail address that is used to send password reset info, RSS description and a few other things, go to the libs directory under your Pligg Installation directory and edit lang.conf (basically search for ‘pligg’ and replace it with the name of your site).

Also if you want to edit the header, login as god and from the admin page, click Template editor and edit the header.tpl and in the headbar div add your link (code), you might want to add the code under both the {if} and {else} clauses.

If you would like to create a custom FAQs/about page (why wouldn’t you?) edit the faq-en_center.tpl file.

I am still trying learn how to configure Pligg. Pligg is still not yet perfect, but, very good. I would prefer writing my own code that I can use for my new project, but Pligg gives me a head-start and I will continue to use it for some time.

]]>