Fullscreen
[Show/Hide Right Column]

Social Networks


Overview
This feature integrates popular social networks (such as Twitter or Facebook) into Tiki. It turns Tiki into a Facebook/Twitter application interacting directly with these networks without using the client's browser.


Adding the Google +1 icon

Go to http://www.google.com/intl/en/webmasters/+1/button/index.html for the latest code. At the time of this writing, the example code was valid. Customize the button using the form on the Google +1 button page. Of the code made on the Google page to copy and paste, the div syntax, such as

<!-- Place this tag where you want the +1 button to render -->
<div class="g-plusone" data-size="small"></div>

is input where you want the button to be displayed, such as in a user (custom) module.

The JavaScript such as
<!-- Place this render call where appropriate -->
  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();

goes in the Look and Feel custom JavaScript textarea, pasted as illustrated (the script opening and closing tags shouldn't be input, in Tiki 7 at least).

Further customize by adding the metatag information. As of Tiki 7 there's no way to modify the html tag by adding the itemscope and itemtype attributes, but a future release of Tiki should have this functionality.


Using Twitter and Facebook in Shoutbox

When the site has been registered with Twitter and/or Facebook, an admin can allow the Shoutbox module to show two additional checkboxes by setting the options "Tweet" and "Facebook".
If the user has the permission to use Twitter/Facebook and has authorized the site to send tweets or post to his Facebook wall, the Shoutbox will offer a checkbox Tweet with Twitter and a checkbox Post on Facebook wall. By activating these checkboxes, in addition to sending a shout, the message will also be sent by Twitter or posted on your Facebook wall.

Using Twitter and Facebook to share a page

When the above prerequisites are given, a user who authorized the site with Twitter/Facebook can use the Share feature not only to send emails/internal messages, but also tweet them and like those pages on his Facebook wall.

To setup/activate
Click the Social Networks icon Social Networks on the Admin Panel
or
Access http://yourdomain.com/tiki-admin.php?page=social


6.x
Social Networks tab
Social Networks tab


Setting Description Default
Social Networks Activate Social Networking
Consumer key Twitter Site Consumer Key
Consumer secret Twitter Site Consumer Secret
API key: Facebook Site API key
Application secret: Facebook Site Application secret
Application ID: Facebook Site Application ID
bit.ly Login: bit.ly Site Consumer Key
bit.ly Key: bit.ly Site Key
Use site-wide account: Use bit.ly URIs for all URI communications





Note
The following content will eventually be migrated to the Social Networks section of the Tiki User and Admin Guides.



Activate Twitter integration

First of all, go to the Twitter page for new applications and register your site as a new application.

As Callback URL you must give the URL for tiki-socialnetworks.php on your site. This is where users will be redirected when authorizing your app with oauth.

You also must ask for the access type Read & Write otherwise your users will not be allowed to tweet.

After registering your site, you get a consumer key and consumer secret which you must enter in the tab Social networks on the admin panel. If that tab is disabled, turn on the feature Social networks on the features page first.
Social networks admin page

To grant a group access to the social networks functionality, set the permission user can use social network integration (tiki_p_socialnetworks) for that group on the Permissions page.

User authorization

Before being able to use the Twitter integration, users must authorize the TikiWiki site by requesting an oauth token.
This can be done via the Social networks tab on My Tiki.

By clicking on the Authorize button, the user will be redirected to the Twitter page, asking for confirmation. If the user agrees, an oauth token will be stored in the users preferences.

Setting up Facebook integration

First, you need to register a new application with Facebook. This can be done via the Developers tool. Later on, you can edit the Application via Application settings in your Facebook profile.

Step 0

On the Developer page click on Set Up New Application and enter a name for your Application, sell your soul (agree to the terms) and click on Create Application. After a successful captcha check, you can proceed with step 1.

You may need to login in Facebook to accept the validation process in Facebook (to allow the developer application use your account details in Facebook, etc).

Step 1

The name of your application is already set, so you don't need to enter a new one. Feel free to upload a logo and icon for your app. As I give support via e-Mail, I entered my email address for the users support.
Image

Step 2

Enter the site URL and the Site Domain. My test server is at test.ott-consult.de and tiki is at the URL for my test server is at http://test.ott-consult.de/trunk. The Site URL therefore is http://test.ott-consult.de/trunk/tiki-socialnetworks.php?request_facebook.
Image

Step 3


In this step, you don't to change anything since the Post-Authorize Callback URL field has been removed by Facebook.
Image

Step 4

Here, you choose the way your application authorizes with Facebook. As it is set by default, just check that HTML5/mobile web for your Application type is selected.
Image

Step 5

Start Using Facebook Credits, this financial/billing integration mostly not needed for Tikiwiki, leave it that way.
Image

Step 6

On this last step, you can give the Facebook Deauthorize Callback which will be called, when a user disallows your application on Facebook. Don't choose sandbox mode here.

Usually, your web server has a static IP address. By putting it on the server whitelist, you can add a bit of security, as only requests from that IP will be processed. If you run a server farm with multiple servers, add all IP addresses.

You can also uncheck all the "deprecated" setting, it won't hurt.
Image

Now you created the application at Facebook and you can enter the data on your tiki server. Go to Admin->Social networks and enter the data from Facebook.
Image

User authorization


Users need the tiki_p_social_network permission in order to use social networks. To login via facebook, the Anonymous group will need this permission.

Before being able to use the Facebook integration, users must authorize the TikiWiki site by requesting an oauth token.
This can be done via the Social networks tab on My Tiki.

Note : As i (Bernard) authorize it i encounter an error from Facebook servers: "message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration.".
I had to logout/login for Facebook to accept the authorization. It is possible also that you have to wait more than 15mn for the Facebook server to use the setting you just entered.


Setting up bit.ly as URL shortener

At the moment, this is only used by the Share feature. By going to bit.ly, you can register and request a key. As Admin, you can force all users to use the site wide key which gives you a nice overview on the pages shared by your users and the feedback on that.
Image


Using ShareThis

You can also allow your users to send links from pages in your tiki to many social networking sites by means of the widget from ShareThis (http://www.sharethis.com).

Since Tiki6 the widget "share this" is also available in blog posts if you enable it at: "Admin home > Blogs > General Settings > Sharing on social networks > ShareThis buttons"

And since Tiki6.1, it's also available for articles: "Admin home > Articles > General Settings > Sharing on social networks > ShareThis buttons"

In trackers, you can use the widget "Share This" by means of adding a call to PluginShareThis in a static text field.

Related

Aliases
SocialNetwork | SocialNetworks | Social Network | Twitter | Facebook


Contributors to this page: Gary Cunningham-Lee1539 points  , Nelson810 points  , luciash d' being2160 points  , cdrwhite2908 points  , Rick22958 points  , Brian Merritt2299 points  , Bernard Sfez1133 points  and xavi67871 points  .
Page last modified on Tuesday 06 September, 2011 06:58:20 UTC by Gary Cunningham-Lee1539 points .
The content on this page is licensed under the terms of the Creative Commons Attribution-ShareAlike License.

Site Language

Reference Guide

Keywords

These keywords serve as "hubs" for navigation within the Tiki documentation. They correspond to development keywords (bug reports and feature requests):



Tiki Newsletter

Delivered fresh to your email inbox!
Newsletter subscribe icon
Don't miss major announcements and other news!
Contribute to Tiki