Sub Menu
Links Menu
Online Users

In total there are 316 users online :: 3 registered, 0 hidden and 313 guests

Most users ever online was 1091 on Wed Aug 16, 2023 5:27 pm

Registered users: Bing [Bot], Google [Bot], Majestic-12 [Bot] based on users active over the past 60 minutes

[Solved] Digg This Button / Block?

Feature requests for the next versions of IntegraMOD.

Moderator: Integra Moderator

[Solved] Digg This Button / Block?

PostAuthor: jwernerny » Wed Sep 05, 2007 1:57 pm

Hello,

I'm thinking about adding a "Digg This" button to my forum, but I am not sure how best to do it. If I add the most simple button, it pulls the URL from the browser, which is good, as it lets it get to the specific post, but its bad since it contains the session id. If I use the version where the URL is fixed, it won't go to the exact page. Has anyone solved this one yet?

Thanks,
- John
Last edited by jwernerny on Thu Oct 11, 2007 6:39 am, edited 1 time in total.
User avatar
jwernerny
Members
Members
 
Posts: 87
Likes: 0 post
Liked in: 0 post
Joined: Wed Apr 12, 2006 3:58 am
Cash on hand: 0.00
Location: Fairport, NY

Re: Digg This Button / Block?

PostAuthor: jwernerny » Thu Oct 11, 2007 6:37 am

After fooling around trying to do this with Blocks in the portal, I finally decided to do it "down and dirty" by editing the templates files.

The first addition was to add a Digg This button to the Knowledge Base Articles. After some playing, I decided the best place to put the buttons was just after the Article Text. To do this, I edited the kb_article_body.tpl file and added the button link code (java.script) in.

kb_article_body.tpl Before:

Code: Select all
<END>   <tr>        <td><span>{ARTICLE_TEXT}</span></td>   </tr>   <BEGIN>


kb_article_body.tpl After]<END>   <tr>        <td><span>{ARTICLE_TEXT}</span>   <hr><center><script>digg_skin = 'compact';digg_window = 'new';digg_title = 'The Snow Tire FAQ - {ARTICLE_TITLE}';</script>  <script></script><script>  slashdot_title="The Snow Tire FAQ - {ARTICLE_TITLE}"; </script><script></script>  <script>reddit_url='http://www.snowtire.info/forum/kb.php'</script><script>reddit_title='The Snow Tire FAQ - {ARTICLE_TITLE}'</script><script></script></center></td>   </tr>   <BEGIN>[/code]

End Result: http://www.snowtire.info/forum/kb.php?mode=article&k=2


The next thing I added the capability to normal topic viewing. I played around with this a fair amount before I was happy. At first, I thought of doing the "Digg This" buttons on a post level, but that looked too cluttered. I finally decided to places the buttons just above the start of the topic post. This was all done by modifying viewtopic_body.tpl.

viewtopic_body.tpl Before:
Code: Select all
<table><tr><td><BEGIN><a><img></a><END><BEGIN><a><img></a><END></td><td>  {BANNER_14_IMG}<br>  {PAGINATION}</td></tr></table>


viewtopic_body.tplk After]<table><tr><td><BEGIN><a><img></a><END><BEGIN><a><img></a><END></td><td><script>digg_skin = 'compact';digg_window = 'new';digg_title = 'The Snow Tire FAQ - {TOPIC_TITLE}';</script>  <script></script><script>  slashdot_title="The Snow Tire FAQ - {TOPIC_TITLE}"; </script><script></script>  <script>reddit_url='http://www.snowtire.info/forum/viewtopic.php?t={TOPIC_ID}'</script><script>reddit_title='The Snow Tire FAQ - {TOPIC_TITLE}'</script><script></script></td><td>  {BANNER_14_IMG}<br>  {PAGINATION}</td></tr></table>[/code]

End Result: http://www.snowtire.info/forum/viewtopic.php?t=131


Enjoy,
- John
Last edited by jwernerny on Sun Oct 14, 2007 12:07 pm, edited 1 time in total.
User avatar
jwernerny
Members
Members
 
Posts: 87
Likes: 0 post
Liked in: 0 post
Joined: Wed Apr 12, 2006 3:58 am
Cash on hand: 0.00
Location: Fairport, NY

PostAuthor: jwernerny » Sun Oct 14, 2007 12:04 pm

BTW, There seems to be a bug with the Red-it links. If you don't specify the URL, it pulls out a random one. Therefore, you may want to modify the lines slightly.

The above post has been fixed.
Last edited by jwernerny on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
jwernerny
Members
Members
 
Posts: 87
Likes: 0 post
Liked in: 0 post
Joined: Wed Apr 12, 2006 3:58 am
Cash on hand: 0.00
Location: Fairport, NY


Return to Design Your Site

Who is online

Registered users: Bing [Bot], Google [Bot], Majestic-12 [Bot]

cron