Hello!
I needed to show information from some social networks in a client site. So I decided to create this addon for CouchCMS. It displays information from Facebook, Twitter, Google+ and Instagram.
Installation:
1. Extracting the attached zip will yield a folder named 'social'.
Place it within your Couch installation's 'addons' folder.
2. Add the follwing line of code to 'addons/kfunctions.php' file
(v1.4 will have a file named 'kfunctions.example.php' in the addons folder. Please rename it to 'kfunctions.php)
Configuration:
You need to enter the keys and information from social networks in 'social/config.php' file
Usage:
This addon creates a new tag on the Couch, named "social_stats".
To use it, place it within a Couch template like this
This addon only supports the parameter handle, it is used to specify which social network you want to display information.
Variables:
There are different variables for each social network. Following is the list.
Facebook - id, about, category, checkins, cover_id, cover_image, name, username, website, likes, link.
Twitter - id, name, screen_name, description, link, friends, followers, favourites, statuses, profile_image_url.
Google+ - followers, circledByCount, about, cover_image, link.
Instagram - username, bio, profile_picture, id, link, followers, media, follows.
A example:
The code displays the amount of likes or followers and link profile in social network
Hope this helps.
I needed to show information from some social networks in a client site. So I decided to create this addon for CouchCMS. It displays information from Facebook, Twitter, Google+ and Instagram.
Installation:
1. Extracting the attached zip will yield a folder named 'social'.
Place it within your Couch installation's 'addons' folder.
2. Add the follwing line of code to 'addons/kfunctions.php' file
(v1.4 will have a file named 'kfunctions.example.php' in the addons folder. Please rename it to 'kfunctions.php)
- Code: Select all
require_once( K_COUCH_DIR.'addons/social/social.php' );
Configuration:
You need to enter the keys and information from social networks in 'social/config.php' file
- Code: Select all
//Facebook
$facebook = '';
//Twitter
$twitter = '';
$consumerkey = "";
$consumersecret = "";
$accesstoken = "";
$accesstokensecret = "";
//Google+
$googleplus_id = '';
$googleplus_key = '';
//Instagram
$instagram_id = '';
$instagram_accesstoken = '';
Usage:
This addon creates a new tag on the Couch, named "social_stats".
To use it, place it within a Couch template like this
- Code: Select all
<cms:social_stats handle=''>
<!-- info -->
</cms:social_stats>
This addon only supports the parameter handle, it is used to specify which social network you want to display information.
Variables:
There are different variables for each social network. Following is the list.
Facebook - id, about, category, checkins, cover_id, cover_image, name, username, website, likes, link.
Twitter - id, name, screen_name, description, link, friends, followers, favourites, statuses, profile_image_url.
Google+ - followers, circledByCount, about, cover_image, link.
Instagram - username, bio, profile_picture, id, link, followers, media, follows.
A example:
The code displays the amount of likes or followers and link profile in social network
- Code: Select all
<cms:social_stats handle='facebook'>
<div>
<a href="<cms:show link />"><img alt="facebook" src="img/fb.png" />
<span><cms:show likes /></span>
</a>
</div>
</cms:social_stats>
<cms:social_stats handle='twitter'>
<div>
<a href="<cms:show link />"><img alt="twitter" src="img/tw.png" />
<span><cms:show followers /></span>
</a>
</div>
</cms:social_stats>
<cms:social_stats handle='google+'>
<div>
<a href="<cms:show link />"><img alt="google+" src="img/gplus.png" />
<span><cms:show followers /></span>
</a>
</div>
</cms:social_stats>
<cms:social_stats handle='instagram'>
<div>
<a href="<cms:show link />"><img alt="instagram" src="img/ig.png" />
<span><cms:show followers /></span>
</a>
</div>
</cms:social_stats>
Hope this helps.