We apologize for the interruption. However, seabreezecomputers.com has been offering free tools and downloads for many years. Unfortunately, server expenses are now starting to exceed revenue earned. If you appreciate the free tools and downloads at seabreezcomputers.com please consider making a donation.
With "Cool Social Share Buttons with Share Count Script for PHP" you can still display share buttons with share count for Google+, Facebook, Pinterest, Twitter and/or LinkedIn without slowing down your visitor's browsers because the share count is retrieved and cached on your server, so your visitor's browsers to not have to load any data from remote servers to display the share count.
Copy the data below to your website:dlc_b
Please make a donation to reveal the download link.
Unzip the 3 files in coolsocial.zip and upload them to your website after you edit the following variables in coolsocial.php:
/* Edit the variables below */ $share_url = $_SERVER['HTTP_REFERER']; // The url to share will be detected by the webpage address //$share_url = "http://www.seabreezecomputers.com"; // Or uncomment this line to specify URL to like $share_text = ""; // Used on Twitter and Pinterest as description. Blank out to use current document.title $share_image = ""; // Used on Pinterest. Blank out to use the webpage's meta og: or itemprop tags $get_count_onclick = true; // Get count whenever a user clicks a social button $get_count_minutes = 720; // 0 = Don't get count every n minutes; (720 = Get count every 12 hours) $use_twitter_newsharecounts = false; // If true then register your website at newsharecounts.com $db_username="your_mysql_username"; $db_pw="your_mysql_password"; $server="localhost"; // Usually keep as "localhost" $database="your_mysql_database";
coolsocial.zip includes these files:
March 8, 2021 - Version 1.1c - Bug Fix - Put inet_pton() inside of escape_string because on the outside mysql sometimes has an error because inet_pton() sometimes puts an unescaped single quote in the string.
2/19/2018 - Version 1.1b - On February 7, 2018 LinkedIn announced that they are no longer keeping track of or displaying share counts for LinkedIn. So now the script will keep track of the LinkedIn shares itself in the MySQL database by keeping count of the clicks on the LinkedIn share button. Also, added PHP curl as an alternative to get share count from Facebook and Pinterest in case of file_get_contents() not working such as getting the error: PHP Warning: file_get_contents(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0.
2/17/2018 - Version 1.1a - Fixed a number of bugs including adding $get_count_minutes to the global variable in check_network() function and not updating the mysql database if the last share count in the database is the same as the share count retrieved from the share network. Also if the count is updated or added to the database because it is the first time or because $get_count_minutes as elapsed then it won't use the ip address of the user visiting so that they can still click on the share button.
1/18/2018 - Version 1.1 - Google announced that Google+ will no longer keep track of display social share count. So now the script will keep track of the Google+ shares itself in the MySQL database. Also, previously a user click on the share button was not added to the database, only what was received from the share service itself was recorded in the database. This has been changed. Now user clicks on a share button are recorded in the database as long as they are from a different IP address then the last click on the share button.
12/22/2016 - Version 1.0 - Cool Social Share Buttons with Share Count Script for PHP Created
Last updated on March 8, 2021