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 ping in b2evo :: Scrobbling with Audacious on Fedora Core 5 »

More little buttons of sharing


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="<?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="<?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="<?php echo $Item->get_permanent_url(); ?>&title=<?php echo $Item->title; ?>"><img src="/images/delicious.png" alt="Share on" class="middle" /></a>
  <a href="<?php echo $Item->get_permanent_url(); ?>&title=<?php echo $Item->title; ?>"><img src="/images/magnolia.png" alt="Share on" class="middle" /></a>

Tweet this!


Comment from: robertc [Member] ·
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: