Facebook Apps – Get User’s Friendlists

For your apps see User Friendlists and names. Use these 2 files: index.php lists_data.php For index.php, [php]<?php $colnams=" flid, name "; $pgno="1"; $defaultresultrownum="5"; $lowerlimit=($pgno-1)*$defaultresultrownum; $upperlimit=$defaultresultrownum; $searchtbnam="friendlist"; $wherequery = "WHERE owner=’$fbuid’"; //$wherequery = ""; $resultsort="name"; $resultsortorder="asc"; $orderby="ORDER BY $resultsort $resultsortorder"; //$limit="LIMIT $lowerlimit,$upperlimit"; $fql    =  "SELECT $colnams FROM $searchtbnam $wherequery $orderby $limit"; $param  =   array( ‘method’     => … Read more

Facebook Apps – Get User’s Friends and List

For your apps see User Friend Ids and in which Friendlist friend is. Use these 2 files: index.php friendlists_data.php For index.php, [php]<?php $colnams=" flid, uid "; $pgno="1"; $defaultresultrownum="5"; $lowerlimit=($pgno-1)*$defaultresultrownum; $upperlimit=$defaultresultrownum; $searchtbnam="friendlist_member"; $wherequery = "WHERE flid IN (SELECT flid FROM friendlist WHERE owner=’$fbuid’)"; //$wherequery = ""; $resultsort="uid"; $resultsortorder="asc"; $orderby="ORDER BY $resultsort $resultsortorder"; //$limit="LIMIT $lowerlimit,$upperlimit"; $fql    =  … Read more

Facebook Apps – Get User Friends Data

Lets see how to get User’s Friend data. Create 2 files: index.php friends_data.php Please note that this is only the code, you need to include Facebook Api scripts and Apps information. In index.php, use this code [php]$colnams=" uid, email, proxied_email, username, name, first_name, last_name, sex, birthday, birthday_date, profile_url "; $pgno="1"; $defaultresultrownum="5"; $lowerlimit=($pgno-1)*$defaultresultrownum; $upperlimit=$defaultresultrownum; $searchtbnam="user"; $wherequery … Read more

Get Page Name or File Name or Extension from Page URL

If you want to know Page Name, File Name, File Extension and directory name from a URL then you can use following function for it in PHP. [php]$path_name = "abc/xyz/name.somename.txt"; $path_parts = pathinfo($path_name); echo $path_parts[‘dirname’], "n"; echo $path_parts[‘basename’], "n"; echo $path_parts[‘extension’], "n"; echo $path_parts[‘filename’], "n";[/php] For more information you can visit: http://php.net/manual/en/function.pathinfo.php You can access its … Read more

How to show only some part of Email

Often we see that Email Address on websites are not shown completely but only first few characters are shown i.e. before @ part, 1 character after @ and last few characters of email address. It is used so that user (whose email id we are displaying) can recall what email address he has used. So, … Read more

Count Number of Files in Directory and Subdirectories

Count number of files in a directory and it’s subdirectories. Use the following code to count number of files. [php] <h1>Count Number of Files in Directory and Subdirectories</h1> <?php $dirnam=dirname(__FILE__); //No Trailing Slash// function count_files($dirpath, &$count) { $directorynames = glob($dirpath.’/*’); if(!empty($directorynames)) { foreach($directorynames as $directoryname) { if(is_dir($directoryname)) { $count[‘dirs’]++; count_files($directoryname, $count); } if(is_file($directoryname)) { $count[‘files’]++; … Read more

Quick Links for Facebook

URL related to Facebook Apps Development Your Apps Page http://www.facebook.com/developers/apps.php Developers Page http://developers.facebook.com/ Graph API http://developers.facebook.com/docs/api Legacy API http://developers.facebook.com/docs/reference/rest/ Create new Application – http://developers.facebook.com/setup/ Edit Applications you are subscribed toLegacy API – Go to Account – Privacy Settings Graph API reference – http://developers.facebook.com/docs/reference/api/ By others: Thinkdiff.net – PHP SDK &amp; Graph API base Facebook Connect … Read more