Author: Gizmo (James of
VNC Web Design)
Requirements:
Valid UBB.Threads 7.5.8 install and license as well as a
Shareaholic account as you'll need to setup your site for use with their bar (through
Publisher Tools).
About:
I rather detest the built in Facebook/Twitter "like" buttons, so I poked around for a replacement and stumbled on
Shareaholic which is a service which lets you display a listing of "share" buttons for content (which you can see running here above the "Quick Reply" box and on
A Gardeners Forum).
Note: The "Thread View" portion of the initial modification is in the stock version of UBB.Threads 7.5.8; additional coding was added to 7.5.8 that this mod (in this thread) now relies on. If you're looking for the version pre-7.5.8 look
here.
In the Control Panel (CP -> Display Options -> General -> HTML Includes Tab -> "Shareaholic 'Setup Code'") add:
Your "Shareaholic" setup code for your site.
To make this work at all you must complete this step, it is not optional (unlike several below):
In libs/html.inc.php"
Move:
// Determine the header insert contents
if ($shareHeader) {
$insert = @file_get_contents("{$config['FULL_PATH']}/includes/header-shareaholic.php");
$shareinsert = ($insert === FALSE) ? '' : $insert;
$headerinsert .= $shareinsert;
}
Above:
// Special for diplaying a topic
To add a Shareaholic Bar to the "Category Index" page:
In scripts/cfrm.inc.php:
Find:
Add Above:
if (is_numeric($config['SHAREAHOLIC']) && $config['SHAREAHOLIC'] > 0) {
$shareaholic = '<div class="shareaholic-canvas" data-app="share_buttons" data-app-id="' . $config['SHAREAHOLIC'] . '"></div>';
$shareHeader = 1;
}
Find:
Add Below:
'shareaholic' => $shareaholic,
Find:
Add Below:
"shareHeader" => $shareHeader,
In templates/default/cfrm.tpl:
Find:
{include file="forum.tpl" type="cfrm" catrow=$catrow forum=$forum}
Add Below:
{if $shareaholic}
<div class="ubb-shareaholic">{$shareaholic}</div>
{/if}
To add a Shareaholic Bar to the "Post Listing" page:
In scripts/postlist.inc.php:
Find:
Add Above:
if (is_numeric($config['SHAREAHOLIC']) && $config['SHAREAHOLIC'] > 0) {
$shareaholic = '<div class="shareaholic-canvas" data-app="share_buttons" data-link="' . make_ubb_url("ubb=postlist&Board=$Board&page=1", $forum_title, true) . '" data-app-id="' . $config['SHAREAHOLIC'] . '"></div>';
$shareHeader = 1;
}
Find:
Add Below:
"shareaholic" => $shareaholic,
Find:
Add Below:
"shareHeader" => $shareHeader,
In templates/default/postlist.tpl:
<br />
{if $modlist}{$lang.USER_MOD}: {$modlist}{/if}
Add Above:
{if $shareaholic}
<div class="ubb-shareaholic">{$shareaholic}</div>
{/if}
To add a Shareaholic Bar to the "Post Listing" page:
In scripts/activetopics.inc.php:
Find:
Add Above:
if (is_numeric($config['SHAREAHOLIC']) && $config['SHAREAHOLIC'] > 0) {
$shareaholic = '<div class="shareaholic-canvas" data-app="share_buttons" data-app-id="' . $config['SHAREAHOLIC'] . '"></div>';
$shareHeader = 1;
}
Find:
Add Below:
"shareaholic" => $shareaholic,
Find:
Add Below:
"shareHeader" => $shareHeader,
In templates/default/activetopics.tpl:
<div style="clear:both;"></div>
Add Below:
{if $shareaholic}
<div class="ubb-shareaholic">{$shareaholic}</div>
{/if}
To add a Shareaholic Bar to the Portal page:
In scripts/portal.inc.php:
Find:
Add Above:
if (is_numeric($config['SHAREAHOLIC']) && $config['SHAREAHOLIC'] > 0) {
$shareaholic = '<div class="shareaholic-canvas" data-app="share_buttons" data-app-id="' . $config['SHAREAHOLIC'] . '"></div>';
$shareHeader = 1;
}
Find:
Add Below:
"shareaholic" => $shareaholic,
Find:
Add Below:
"shareHeader" => $shareHeader,
In templates/default/portal.tpl:
Add Below:
{if $shareaholic}
<div class="ubb-shareaholic">{$shareaholic}</div>
{/if}
Please leave your thanks below so we can know that we've helped you!