03/01/07

Permalink 06:29:31 pm, by robertc Email , 287 words, 580 views   English (UK)
Categories: Web Develop, Server Side Web Development Share on reddit Share on digg Share on del.icio.us Share on ma.gnolia.com Share on StumbleUpon

More little buttons of sharing

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 ;) 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>

Trackback address for this post:

http://www.boogdesign.com/b2evo/th1srv/trackback.php/155

Comments, Trackbacks, Pingbacks:

Comment from: robertc [Member] Email · http://www.boogdesign.com/
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)
PermalinkPermalink 08/01/07 @ 15:39

Leave a comment:

Your email address will not be displayed on this site.
Your URL will be displayed.

Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>
(Line breaks become <br />)
(Set cookies for name, email and url)
(Allow users to contact you through a message form (your email will NOT be displayed.))

Hot Topics

    Popular

    boogdesign posts

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

    Search

    Syndicate this blog XML

    • RSS 0.92 Posts RSS 0.92 Comments
    • RSS 1.0 Posts RSS 1.0 Comments
    • RSS 2.0 Posts RSS 2.0 Comments
    • Atom Posts Atom Comments
    What is RSS?

    License info

    Creative Commons License
    This work is licensed under a Creative Commons Attribution-Share Alike 2.5 License.

    powered by
    b2evolution

    get hCard