Open Graph Protocol Design

Posted by mahmud ahsan in Facebook | No Comments

If you want to make your website as a part of social web you should implement the Open Graph protocol. It allows any web page to become a rich object in any social graph, making it easy to find what people are liking across the Web — from a movie to a blog.

Checkout the documentation and visit the presentation to learn more.

Continue

PHP SDK & Graph API base Facebook Connect Tutorial

Posted by mahmud ahsan in FB Connect, Facebook | 177 Comments

facebookIn this article I’m focusing facebook latest php sdk to integrate facebook features in your site. Some days ago facebook released their new graph api system and updated their core structure. They also officially released php sdk so that you can easily call facebook latest graph api and old legacy api from server side by php.

Before proceeding first have a look my previous article specially Facebook connect authentication part.

In this post I’ll show

  1. How to check valid session of user, if user successfully logged in
  2. How to call graph api
  3. How to call legacy api
  4. How to update status dynamically using graph api
  5. How to use FQL Query

So take a look my demo of this tutorial. Please login by FBConnect and approve all the permission if you’re first time accessing the page.

Continue

Graph api & javascript base Facebook Connect tutorial

Posted by mahmud ahsan in FB Connect, Facebook | 145 Comments

facebook-social Some days ago facebook released their new graph api system to develop social sites more easily. Its really cool and I personally like the facebook’s new graph api system.  Facebook also updated their old facebook connect system and provided better way to integrate facebook connect feature, user authentication and calling facebook api from website.

In this article, I’ll highlight javascript base

  1. Facebook connect authentication for websites
  2. How to use graph api
  3. How to show stream publish prompt and share prompt
  4. How to run FQL query using javascript
  5. How to set status using old legacy api calling by javascript

Here is the demo  http://thinkdiff.net/demo/newfbconnect1/newconnect.php

fbconnect-demo
Continue

Amazon S3 vs Rackspace cloud files

Posted by mahmud ahsan in Review | No Comments

amazons3I have been using rackspace cloud storage as a CDN for my site for some months. Before moving to rackspace I first used Amazon S3 and my overall experience is amazon S3 is slower than rackspace. Some of my senior brothers also told me that, but I first didn’t believe them. But practically when I used s3 I found its not working faster. And then I moved to rackspace files and it loads really faster. That’s why I suggest my blog readers and clients to use rackspace cloud files.

rackspace-cloudAmazon opted to build their own content delivery network (CDN) while Rackspace chose to partner with Limelight Networks, a leading, global CDN provider.  Limelight serves some of the largest media customers in the world (including Disney, MSNBC, NetFlix, Microsoft Xbox, and Amazon Video on Demand) and has an extensive world-wide network. For a brief comparison read this article.

If you have wordpress powered sites and want to use CDN either amazon s3 or rackspace cloud files, then you could easily integrate them using the following plugins.

Continue

Using MySQL Stored Procedure to create sample data

Posted by mahmud ahsan in MySQL | No Comments

mysqlMySQL stored procedures are programs that are stored and can be executed on the MySQL server. You can call stored procedure from any application over a distributed network. Stored procedures provide a means of interacting in a prescribed way with the database without placing any additional traffic on the network. Here I’m describing a stored procedure that I used to create some sample data.

To learn more about stored procedure checkout this link.

Suppose you may need to create a large number of dataset for a table and your table structure looks like this

CREATE TABLE IF NOT EXISTS `dictionary` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `word` varchar(100) NOT NULL,
  `mean` varchar(300) NOT NULL,
  PRIMARY KEY (`id`)
);

Now you’ve to add 110000 dummy data to this table. You can dump some dummy data to the table by the following way.

Continue

MySQL random data selection

Posted by mahmud ahsan in MySQL, PHP | 13 Comments

mysqlSome days ago I was working in a vocabulary game and dictionary. The dictionary contains 1,10,000 words and meanings. I developed a vocabulary game where I had to randomly choose 10 words out of 1,10,000 dataset. Here I’m describing the possible solutions for this problem and which solution I used.

Data table

Table name is dictionary and it has id, word and meaning fields. id contains auto incremented id and it is unbroken sequence 1,2,3…..n.

id word meaning
1 aback Having the wind against the forward side of the sails
2 abandon Forsake, leave behind
….. ….

Continue

Some of my favorite web related books

Posted by mahmud ahsan in Review | 3 Comments

Here I listed some programming and web related books those I found important for knowledge/skills/career whatever you said. Some of the books I read completely and some books partially. But all of these books I found very helpful to increase knowledge.

PHP

php 5 and mysql Beginning PHP 5 and MySQL If you’re beginner and want to learn from the start then you should read this book. You’ll find lot of examples of php, mysql in this book.

Continue

Make your site more social using facebook social plugins

Posted by mahmud ahsan in FB Connect, Facebook, Web | No Comments

facebook-socialJust think 100 facebook users visit your site, among them 50 users like one of the article or product of your site. So 50 users friends will see in their homepage, that their friend liked your article or product. If 50 users have average 100 friends and among them 50 will visit your site then the calculation will be like 50 * 50 * …… = 2500 and more.

So using facebook social plugins you can make your site more social and engaging. Do you know how many users currently using facebook ? Its 400 milion. So why you will not take the power of facebook to promote your site.

Continue

In actionscript 3 how to remove duplicates from array

Posted by mahmud ahsan in ActionScript | No Comments

actionscriptToday I was working in  actionscript 3 + php project. I was working in an array and I needed to remove duplicate entries from array. In php its very easy to remove duplicate entries.

There is a function in php named array_unique($array); that removes duplicate elements from array. So in php I could easily use

    $arr = array('a', 'b', 'a', 'c', 'd', 'b');
    $arr = array_unique($arr); //removes duplicate entries

But there is no such type of built in function in actionscript 3 for array. So I created my own function and used it

function removeDuplicate(arr:Array) : void{
    var i:int;
    var j: int;
    for (i = 0; i < arr.length - 1; i++){
        for (j = i + 1; j < arr.length; j++){
            if (arr[i] === arr[j]){
                arr.splice(j, 1);
            }
        }
    }
}

Now just call the function and pass an array

var arr:Array = new Array("a", "b", "a", "c", "d", "b");
removeDuplicate(arr);

splice(startIndex:int, deleteCount:uint); method removes elements from an array. So using 2 simple loops I solved my problem. But as my arrays are short 20 elements max so I don’t need to optimize this function.

reference: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/Array.html

How to detect administrator of facebook fan page

Posted by mahmud ahsan in Facebook | No Comments

facebookSometimes you may need to check whether your fan page application viewer is the administrator of the page or not. You may provide some special information for the administrator of the page. Like you may provide a control panel to control the application so that the administrator can modify or update the application within the same page. So if you want to do something like that then use the following fbml tag in your facebook fan page application:

<fb:visible-to-owner>
    You're Admin Dude!!!! This information only shows to admin
</fb:visible-to-owner>

So the information within <fb:visible-to-owner> will only show to administrator of the page. Other users will not see the information.

Page 3 of 15«12345»10...Last »