Adding Digg and Reddit To Entry Footer

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
celect
Regular
Posts: 15
Joined: Mon Jun 18, 2007 8:09 pm

Adding Digg and Reddit To Entry Footer

Post by celect »

I was wondering how I would go about adding a Digg and reddit link/code to the footer of all my entries along side the author and date of the post. I would assume adding these codes to entries.tpl?

I want to add the digg code:

Code: Select all

<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
the reddit code:

Code: Select all

<script>reddit_url='[URL]'</script>
<script>reddit_title='[TITLE]'</script>
<script language="javascript" src="http://reddit.com/button.js?t=1"></script>
where or how would I add these into entries.tpl?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Adding Digg and Reddit To Entry Footer

Post by garvinhicking »

Hi!

Exactly, entries.tpl is the place to go. Search for "{$entry.body}" and add your code on top or after that, where you want it.

The Variables you need are {$entry.link} for the URL of your entry, and {$entry.title} for the title:

Code: Select all

<script>reddit_url='{$entry.link}'</script>
<script>reddit_title='{$entry.title}'</script>
<script language="javascript" src="http://reddit.com/button.js?t=1"></script>
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
celect
Regular
Posts: 15
Joined: Mon Jun 18, 2007 8:09 pm

Post by celect »

garv you are the man
Post Reply