boogdesign posts

Longer posts on standards based web design, portable web development and Linux, intermingled with some stuff on my other nerd interests.

Rob Crowther, London, UK based Blogger, Web Developer, Web Designer and System Administrator - read my Curriculum Vitae

Buy my book!

Book CoverHello! HTML5 and CSS3 available now

Buy my other book!

Book CoverEarly access to HTML5 in Action available now
« Fixing blo.gs ping in b2evo :: Scrobbling with Audacious on Fedora Core 5 »

More little buttons of sharing

03/01/07

06:29:31 pm Permalink More little buttons of sharing

Categories: Web Develop, Server Side Web Development

In an earlier post, I described how I added 'share on reddit' and 'share on delicious' buttons to my b2evo skin. Today I spent some time cleaning up and adding new buttons for Digg and Ma.gnolia.

I noticed on Arto Bendiken's blog his 'sharing buttons' also added a title after you click on them. It didn't seem like it would be too difficult to extend my previous code, and it wasn't &#59;) Here's what I've finished up with in _main.php:

<h3 class="bTitle">
  <?php $Item->title(); ?>
  <a href="http://reddit.com/submit?url=<?php echo $Item->get_permanent_url(); ?>&title=<?php echo $Item->title; ?>"><img src="/images/reddit.png" alt="Share on reddit" class="middle" /></a>
  <a href="http://digg.com/submit?phase=2&url=<?php echo $Item->get_permanent_url(); ?>&title=<?php echo $Item->title; ?>"><img src="/images/digg.png" alt="Share on digg" class="middle" /></a>
  <a href="http://del.icio.us/post?url=<?php echo $Item->get_permanent_url(); ?>&title=<?php echo $Item->title; ?>"><img src="/images/delicious.png" alt="Share on del.icio.us" class="middle" /></a>
  <a href="http://ma.gnolia.com/bookmarklet/add?url=<?php echo $Item->get_permanent_url(); ?>&title=<?php echo $Item->title; ?>"><img src="/images/magnolia.png" alt="Share on ma.gnolia.com" class="middle" /></a>
</h3>


Tweet this!
PermalinkPermalink

Comments:

Comment from: robertc [Member] · http://www.boogdesign.com/
08/01/07 @ 15:39
Just realised today, the above code makes the URIs invalid, because the titles mostly have spaces in them. Easy to fix though. Replace:
$Item->title
With:
urlencode($Item->title)