Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7017083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:52:07+00:00 2026-05-27T22:52:07+00:00

For my new website I wanted to use a Facebook-button/icon I had found, different

  • 0

For my new website I wanted to use a Facebook-button/icon I had found, different than the standard like button. Furthermore I prefer sharing above liking URLs on Facebook. Therefore I made the icon open a popup onclick showing http://facebook.com/sharer/sharer.php with the right parameters. Using the Facebook graph API I succeeded to get the number of shares of my URL and show it next to the button using the following PHP-script (retrieving) and JavaScript (showing):

<?php
$fql_query_url = 'https://graph.facebook.com/'
. '/fql?q=SELECT+total_count+FROM+link_stat+WHERE+url="URL_GOES_HERE"';
$fql_query_result = file_get_contents($fql_query_url);
$fql_query_num = substr($fql_query_result, 24);
$fql_query_num = substr($fql_query_num, 0, -3);                  
?>

<script type="text/javascript">
function showShares(){
document.getElementById('fb_count').innerHTML = <?php echo $fql_query_num;?>;
}
</script>

(The original file also contains a similar script for Twitter, which I’ve left out here to keep things clear.)

A function I’d like to add now, is that when people have shared the link, the corresponding button turns grey/inactive onload of the page. I expected this could easily be done using a FQL query and a JavaScript, but I couldn’t find it on http://developers.facebook.com yet. So I’m wondering whether someone here knows how to do this (if there is any way at all…).

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:52:08+00:00Added an answer on May 27, 2026 at 10:52 pm

    http://facebook.com/sharer/sharer.php is being deprecated. I’d suggest using the Graph API or one of the new Plugins Facebook has developed to take its place. Once you start implementing the new stuff, your questions might change. FWIW, I don’t think there’s a way to tell if a specific user has shared a link (unless it’s a like for a Facebook page).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just got a new website project for my company internal use. The whole website
I'm making a navigation menu for my website. I wanted it to look like
I am desiging a new website for my company and I am trying to
I'm developing a new website (ASP.Net, VB codebehind pages, .Net 3.5) to replace a
I've got a new website moved to my server. This website uses PHP and
I am planning a new website with codeigniter using wordpress. this site will contain
I have a new website that is linked to from many places but the
When you are working on a new website, what combinations of browsers and operating
I am trying to create a new website on a remote server via msbuild
Currently I am designing a new website and I want to plan it properly.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.