trk's weblog http://www.trk7.com/blog My virtual home. Wed, 12 Dec 2007 08:09:06 +0000 http://wordpress.org/?v=2.2 en Movie News http://www.trk7.com/blog/uncategorized/movie-news/ http://www.trk7.com/blog/uncategorized/movie-news/#comments Wed, 12 Dec 2007 08:09:06 +0000 trkesavan http://www.trk7.com/blog/uncategorized/movie-news/ news2u.in is a place to read interesting happenings in Tamil Cinema World.

]]>
http://www.trk7.com/blog/uncategorized/movie-news/feed/
Tamil Movie reviews site. http://www.trk7.com/blog/links/tamil-movie-reviews-site/ http://www.trk7.com/blog/links/tamil-movie-reviews-site/#comments Fri, 16 Nov 2007 14:46:58 +0000 trkesavan http://www.trk7.com/blog/links/tamil-movie-reviews-site/ 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/.

]]>
http://www.trk7.com/blog/links/tamil-movie-reviews-site/feed/
Getting visitor location in PHP. http://www.trk7.com/blog/programming/getting-visitor-location-in-php/ http://www.trk7.com/blog/programming/getting-visitor-location-in-php/#comments Wed, 07 Nov 2007 13:54:25 +0000 trkesavan http://www.trk7.com/blog/programming/getting-visitor-location-in-php/ 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.

]]>
http://www.trk7.com/blog/programming/getting-visitor-location-in-php/feed/
Pagination issue in Pligg http://www.trk7.com/blog/pligg/pagination-issue-in-pligg/ http://www.trk7.com/blog/pligg/pagination-issue-in-pligg/#comments Mon, 05 Nov 2007 12:13:14 +0000 trkesavan http://www.trk7.com/blog/pligg/pagination-issue-in-pligg/ —-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.

]]>
http://www.trk7.com/blog/pligg/pagination-issue-in-pligg/feed/
Shopping Deals in India http://www.trk7.com/blog/shopdeals/shopping-deals-in-india/ http://www.trk7.com/blog/shopdeals/shopping-deals-in-india/#comments Sun, 04 Nov 2007 10:17:35 +0000 trkesavan http://www.trk7.com/blog/shopdeals/shopping-deals-in-india/ 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.

]]>
http://www.trk7.com/blog/shopdeals/shopping-deals-in-india/feed/
SansJ Newsletter http://www.trk7.com/blog/sansj/sansj-newsletter/ http://www.trk7.com/blog/sansj/sansj-newsletter/#comments Sun, 14 Oct 2007 05:27:59 +0000 trkesavan http://www.trk7.com/blog/sansj/sansj-newsletter/ 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.

]]>
http://www.trk7.com/blog/sansj/sansj-newsletter/feed/
Customizing Pligg http://www.trk7.com/blog/pligg/customizing-pligg/ http://www.trk7.com/blog/pligg/customizing-pligg/#comments Sat, 29 Sep 2007 04:54:40 +0000 trkesavan http://www.trk7.com/blog/pligg/customizing-pligg/ 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.

]]>
http://www.trk7.com/blog/pligg/customizing-pligg/feed/