Ajax software
Free javascripts
↑
Main Page
‘icon’ => ‘yahoomyweb.tif’,
‘url’ => ‘http://myweb2.search.yahoo.com/myresults/bookmarklet?u={LINK}
i
&t={TITLE}‘)
);
// the constructor
function SocialBookmarking($link, $title, $site_name)
{
$this->_link = $link;
$this->_title = $title;
$this->_site_name = $site_name;
}
// returns the HTML with social bookmarking symbols
function getHTML($sites =
array(‘del.icio.us’, ‘digg’, ‘Furl’, ‘Reddit’, ‘YahooMyWeb’))
{
// build the output
$html_feed = ‘<ul class=”social_bookmarking”>’;
// create HTML for each of the sites received as parameter
foreach($sites as $s)
{
if ($_site_info = $this->_templates[$s])
{
$html_feed .= ‘<li class=”social_bookmarking”>’;
$url = str_replace(array(‘{LINK}‘, ‘{TITLE}‘, ‘{SITENAME}‘),
array(urlencode($this->_link),
urlencode($this->_title),
urlencode($this->_site_name)),
$_site_info[‘url’]);
$html_feed .= ‘<a rel=”nofollow” href=”‘ . $url . ‘“ title=”‘ . $s . ‘“>’;
$html_feed .= ‘<img src=”‘ . SITE_DOMAIN .
‘/social_icons/‘ . $_site_info[‘icon’] . ‘“ alt=”‘ . $s .
‘“ class=”social_bookmarking” />’;
$html_feed .= ‘</a></li>’;
}
}
$html_feed .= ‘</ul>’;
return $html_feed;
}
// returns HTML with social bookmarking links for inclusion in feeds
function getFeedHTML($sites =
array(‘del.icio.us’, ‘digg’, ‘Furl’, ‘Reddit’, ‘YahooMyWeb’))
{
// initialize $html_feed
$html_feed = ‘’;
// build the HTML feed
foreach($sites as $s)
{
if ($_site_info = $this->_templates[$s])
{
$url = str_replace(array(‘{LINK}‘, ‘{TITLE}‘, ‘{SITENAME}‘),
array(urlencode($this->_link),
168
Chapter 7: Web Feeds and Social Bookmarking
c07.qxd:c07 10:42 168
Ajax software
Free javascripts
→