Go Back   Pligg CMS Forum > Pligg Development > Modification Tutorials

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-12-2008, 12:20 AM
dollars5's Avatar
Pligg is my love :)
 
Join Date: Dec 2006
Location: India
Posts: 2,154
Thanks: 290
Thanked 266 Times in 177 Posts
Thumbs up MOD: Replace your default Pligg Add to/share with Addthis/sharethis widgets

Addthis button:
visit Add This! - Social Bookmark & Feed Button Builder - click on get button code (default options are just fine) and add to desired position in link_summary.tpl - notice I have replaced the [url] and [TITLE] with pligg variables:

Code:
<!-- AddThis Button BEGIN -->
<script type="text/javascript">addthis_pub  = 'stevej123';</script>
<a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '{$enc_url}', '{$title_short}')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="http://s9.addthis.com/button1-addthis.gif" width="125" height="16" border="0" alt="" /></a><script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"></script>
<!-- AddThis Button END -->
If you want to link directly to your site then use {$my_base_url}{$my_pligg_base}{$story_url} instead of {$enc_url}


ShareThis:
Goto http://www.sharethis.com/publisher (no registration needed - you can safely click on 'No Thanks'), set desired options, click get code

Code:
<script type="text/javascript" src="http://w.sharethis.com/widget/?tabs=web%2Cpost%2Cemail&amp;charset=utf-8&amp;style=default&amp;publisher=2975655c-edbd-4475-aa0a-dc4db6ccd1eb"></script>
But this will only provide link to the document.url - so no customization to set particular urls while in index/upcoming pages possible to link to source or story page url.


In default yget template the desired location for adding this code is to replace the code below:
Code:
{if $Enable_AddTo eq 1}
				<span id="linksummaryAddLink">
					<a href="javascript://" onclick="var replydisplay=document.getElementById('addto-{$link_shakebox_index}').style.display ? '' : 'none';document.getElementById('addto-{$link_shakebox_index}').style.display = replydisplay;"> {#PLIGG_Visual_LS_AddThisLinkTo#}</a>&nbsp;
				</span>
			{/if}
Reply With Quote
The Following User Says Thank You to dollars5 For This Useful Post:
  #2 (permalink)  
Old 07-12-2008, 06:47 AM
graphicsguru's Avatar
Pligg Donor
Pligg Version: 9.9.5
 
Join Date: Aug 2006
Location: USA
Posts: 416
Thanks: 75
Thanked 48 Times in 36 Posts
dollars5 I was working on this yesterday
when I add ShareThis to my link_summary.tpl
it shows on the site just fine
but it only works after I click read more
Reply With Quote
  #3 (permalink)  
Old 07-12-2008, 10:10 AM
graphicsguru's Avatar
Pligg Donor
Pligg Version: 9.9.5
 
Join Date: Aug 2006
Location: USA
Posts: 416
Thanks: 75
Thanked 48 Times in 36 Posts
got it had to edit the pligg.tpl and link_summary.tpl for the ShareThis
Reply With Quote
  #4 (permalink)  
Old 07-12-2008, 10:40 PM
dollars5's Avatar
Pligg is my love :)
 
Join Date: Dec 2006
Location: India
Posts: 2,154
Thanks: 290
Thanked 266 Times in 177 Posts
I had mentioned editing only link_summary.tpl will do?

can you share what you edited in pligg.tpl?

In my opinion - Add this widget is lot powerful and better than the share this widget.
Reply With Quote
  #5 (permalink)  
Old 07-13-2008, 12:11 AM
chuckroast's Avatar
Coder/Designer
Pligg Version: 1.0
Pligg Template: ExpertVision
 
Join Date: Jun 2006
Location: PA
Posts: 2,399
Thanks: 171
Thanked 439 Times in 278 Posts
Quote:
Originally Posted by dollars5 View Post
I had mentioned editing only link_summary.tpl will do?

can you share what you edited in pligg.tpl?

In my opinion - Add this widget is lot powerful and better than the share this widget.
I think what he's getting at is that the first javascript needs to be before the </head> which is is pligg.tpl ... The rest should be placed in link_summary.tpl ..
__________________
Visit PliggPro the official Pligg Mods & Template Shop!

Reply With Quote
  #6 (permalink)  
Old 07-13-2008, 04:01 AM
catchpen's Avatar
Pligg Donor
 
Join Date: Jan 2008
Posts: 210
Thanks: 30
Thanked 18 Times in 13 Posts
One thing I know is that the share this widget will slow your site way down sometimes. I'm going to switch over to the add this instead
Reply With Quote
  #7 (permalink)  
Old 07-14-2008, 12:28 AM
dollars5's Avatar
Pligg is my love :)
 
Join Date: Dec 2006
Location: India
Posts: 2,154
Thanks: 290
Thanked 266 Times in 177 Posts
you can use the defer attribute to delay the loading/execution of the scripts - more details at javascript: Defer Execution - with the defer attribute of the script element - since the chance that an user will click on the share button during page load is minimal; defer should give better load time improvements.
Reply With Quote
The Following User Says Thank You to dollars5 For This Useful Post:
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Pligg integration with SMF Forum autoinc Modification Tutorials 64 05-19-2008 02:22 AM
9.6 error xbizsky Bug Report 28 07-04-2007 03:54 AM
Installation - Tables never created julientarta Installation and Upgrade Help 28 02-02-2007 11:04 PM


Search Engine Friendly URLs by vBSEO 3.2.0