Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
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:
Code
			// 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:
Code
		// Special for diplaying a topic



To add a Shareaholic Bar to the "Category Index" page:
In scripts/cfrm.inc.php:
Find:
Code
	$smarty_data = array(

Add Above:
Code
	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:
Code
		'catrow' => & $catrow,

Add Below:
Code
		'shareaholic' => $shareaholic,

Find:
Code
			"refresh" => 0,

Add Below:
Code
			"shareHeader" => $shareHeader,


In templates/default/cfrm.tpl:
Find:
Code
{include file="forum.tpl" type="cfrm" catrow=$catrow forum=$forum}

Add Below:
Code
{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:
Code
	$smarty_data = array(

Add Above:
Code
	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:
Code
		"Title" => $Title,

Add Below:
Code
		"shareaholic" => $shareaholic,

Find:
Code
			"refresh" => 0,

Add Below:
Code
			"shareHeader" => $shareHeader,


In templates/default/postlist.tpl:
Code
<br />

{if $modlist}{$lang.USER_MOD}: {$modlist}{/if}

Add Above:
Code
{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:
Code
	$smarty_data = array(

Add Above:
Code
	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:
Code
		"pages" => $pages,

Add Below:
Code
		"shareaholic" => $shareaholic,

Find:
Code
			"refresh" => 0,

Add Below:
Code
			"shareHeader" => $shareHeader,


In templates/default/activetopics.tpl:
Code
<div style="clear:both;"></div>

Add Below:
Code
{if $shareaholic}
<div class="ubb-shareaholic">{$shareaholic}</div>
{/if}



To add a Shareaholic Bar to the Portal page:
In scripts/portal.inc.php:
Find:
Code
	$smarty_data = array(

Add Above:
Code
	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:
Code
		"news" => $news,

Add Below:
Code
		"shareaholic" => $shareaholic,

Find:
Code
			"refresh" => 0,

Add Below:
Code
			"shareHeader" => $shareHeader,


In templates/default/portal.tpl:
Code
{/section}

Add Below:
Code
{if $shareaholic}
<div class="ubb-shareaholic">{$shareaholic}</div>
{/if}

Please leave your thanks below so we can know that we've helped you!


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Sponsored Links
Entire Thread
Subject Posted By Posted
[7.5.8] Shareaholic Bar v0.3 (2013.12.07) Gizmo 12/08/2013 5:55 AM
Re: [7.5.8] Shareaholic Bar v0.3 (2013.12.07) StanCA 12/17/2013 7:20 AM
Re: [7.5.8] Shareaholic Bar v0.3 (2013.12.07) PianoWorld 12/25/2013 6:12 AM
Re: [7.5.8] Shareaholic Bar v0.3 (2013.12.07) Gizmo 12/25/2013 8:07 AM
Re: [7.5.8] Shareaholic Bar v0.3 (2013.12.07) PianoWorld 12/26/2013 6:21 AM
Re: [7.5.8] Shareaholic Bar v0.3 (2013.12.07) Gizmo 12/26/2013 7:39 AM
Re: [7.5.8] Shareaholic Bar v0.3 (2013.12.07) PianoWorld 12/26/2013 9:59 AM
Re: [7.5.8] Shareaholic Bar v0.3 (2013.12.07) Gizmo 12/27/2013 3:35 PM
Re: [7.5.8] Shareaholic Bar v0.3 (2013.12.07) PianoWorld 12/27/2013 10:30 PM
Re: [7.5.8] Shareaholic Bar v0.3 (2013.12.07) isaac 12/27/2013 6:19 PM
Re: [7.5.8] Shareaholic Bar v0.3 (2013.12.07) Gizmo 12/28/2013 4:24 AM
Re: [7.5.8] Shareaholic Bar v0.3 (2013.12.07) isaac 12/28/2013 4:33 AM
Re: [7.5.8] Shareaholic Bar v0.3 (2013.12.07) PianoWorld 01/27/2014 12:08 AM
Re: [7.5.8] Shareaholic Bar v0.3 (2013.12.07) Gizmo 01/27/2014 3:58 AM
Re: [7.5.8] Shareaholic Bar v0.3 (2013.12.07) PianoWorld 01/27/2014 4:57 AM
Re: [7.5.8] Shareaholic Bar v0.3 (2013.12.07) Gizmo 01/27/2014 6:08 AM
Re: [7.5.8] Shareaholic Bar v0.3 (2013.12.07) PianoWorld 01/27/2014 6:51 AM
Re: [7.5.8] Shareaholic Bar v0.3 (2013.12.07) Gizmo 01/27/2014 8:15 AM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)