PHP Classes

PHP Socializer: Embed social buttons and widgets in Web pages

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 51%Total: 816 All time: 4,229 This week: 488Up
Version License PHP version Categories
php-socializer 1.0BSD License5.3HTML, PHP 5, Social Networking
Description 

Author

This package can embed social buttons and widgets in Web pages.

It can generate HTML with JavaScript for embedding several types of buttons of social networks and other sites in Web pages.

Currently it supports Facebook, Twitter, Google Plus, LinkedIn, StumbleUpon, GitHub, Pinterest and Flattr.

The buttons can be made invisible initially and fade in when they are loaded.

The sharing events of some buttons can be tracked with Google Analytics.

The manager class can combine the JavaScript necessary for different types of buttons, compress the code and cache it to avoid subsequent processing overhead.

Picture of Mike
Name: Mike <contact>
Classes: 1 package by
Country: New Zealand New Zealand

 

Details

PHP Socializer ---------- PHP module intended to make adding social sharing buttons more enjoyable. Includes Google Analytics hooks to enable tracking of share activity. Currently supports Twitter, Facebook, Google Plus, LinkedIn, StumbleUpon, GitHub and Flattr buttons. Basic Example ------------- ![PHP Socializer Basic Example](http://pagesofinterest.net/images/github/coi-social/basic.png "PHP Socializer Basic Example") These buttons can be created with the following code: ```php <?php use COI\Social; include_once 'include.php'; // Contains constants include_once 'require.php'; // Not necessary if you're using an autoloader /* Somehere in your config */ // Create a manager for the Twitter, Google+ & LinkedIn button set new Social\Manager(array( 'twitter' => new Social\Twitter(array( 'username' => 'pagesofinterest', )), 'googleplus' => new Social\GooglePlus(array( 'size' => 'medium' )), 'linkedIn' => new Social\LinkedIn() ), array( 'fadeIn' => 400 )); /* Where the buttons should be displayed */ echo $socialManager->render(array( // These options override those used in the manager initialisation above 'url' => 'http://pagesofinterest.net/', 'title' => 'Pages of Interest', )); /* In your footer, just above the closing <body> tag */ // Output the <script> with src pointing to the combined, compressed & cached JavaScript echo COI\Social\Manager::combinedJavaScript(); ?> ``` Single Button ------------- ![PHP Socializer Single Button](http://pagesofinterest.net/images/github/coi-social/watch.png "PHP Socializer Single Button") To render a single button, use the following syntax: ```php <?php use COI\Social; include_once 'include.php'; // Contains constants include_once 'require.php'; // Not necessary if you're using an autoloader // Render a single button echo Social\GitHub(array( 'user' => 'faceleg', 'repository' => 'COI-Social', 'type' => Social\GitHub\Type\WATCH )); ?> ``` Credits ------- GitHub buttons created by Mark Dotto - [GitHub buttons](http://markdotto.github.com/github-buttons/ "GitHub Buttons").

  Files folder image Files (43)  
File Role Description
Files folder imageclasses (1 directory)
Files folder imagefunctions (2 files)
Files folder imagepublic (1 file, 1 directory)
Files folder imagetemplates (1 file, 8 directories)
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file include.php Conf. Configuration script
Accessible without login Plain text file LICENSE Data Auxiliary data
Accessible without login Plain text file README.md Doc. Auxiliary data
Accessible without login Plain text file require.php Aux. Configuration script

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:816
This week:0
All time:4,229
This week:488Up
 User Ratings  
 
 All time
Utility:75%StarStarStarStar
Consistency:68%StarStarStarStar
Documentation:68%StarStarStarStar
Examples:-
Tests:-
Videos:-
Overall:51%StarStarStar
Rank:2577