I have some questions for the PHP wizards here.
I've just pimped out my blog (http://www.hastalasiesta.org) with some digg/reddit-buttons. I think it looks fairly nice, but I crave some advanced functionality.
Seing how not all of my posts are particularly digg-worthy (I can't imagine anyone digging an entry that is about me stubbing my toe or something.) I would really like to be able to choose whether or not the buttons are shown or not.
I've tried the custom fields but I have several issues with this method. First of these is that it breaks the digg/reddit count on the buttons. I use {entry.link} in the template to make sure the digg count is working well, but when I include the code with a custom field it goes back to zero.
Secondly, and less of a problem, is that with the custom fields it seems I'd have to paste the JS-code into the custom field every time, which is not really ideal.
To summarize my questions:
1. Could anyone help me make the Custom Fields method work properly with the digg and reddit counters?
2. Is there some method to make a custom field default to include the same piece of code whenever I choose to use it?
Below is the HTML/JS I currently have included in entries.tpl
Code: Select all
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script><br /><br />
<script>reddit_url="http://www.hastalasiesta.org{$entry.link}"</script>
<script>reddit_title='{$entry.title}'</script>
<script language="javascript" src="http://reddit.com/button.js?t=2"></script>
<noscript>...</noscript>
</div>