Wiki source for DeliciousAction

Show raw source Bookmark Action=====

>>==See also:==
>>This is the development page for the action.::c::


==Short description==
Display a bookmark link for the current page.

This action currently does not accept any parameter.

==Long description==
This simple action displays a link to bookmark the current page at [[]]. It can be used as a stand-alone plugin in the page body or as a [[WikkaMenulets menulet]] in the page header/footer. It retrieves the title from the page body (unicode supported). Obviously, you must be registered at in order to be able to bookmark a page.


""<a style="border:1px dotted #999; height:10px; color:#666; text-decoration:none; font-size:.7em" href="" title="Bookmark this page at"><img src="images/icons/logos/del.icio.us_small.png" /> Post to</a>""

===The code===
Save the following as ##actions/delicious.php## and modify the ICON_PATH constant to match the path to the icon on your server. The icon used on this server can be downloaded [[ here]].

* Display a link to bookmark the current page at
* @package Actions
* @name
* @author {@link Dario Taraborelli}
* @copyright Copyright © 2005, Dario Taraborelli
* @version 0.1
* @since Wikka 1.1.X.X
* @access public
* @uses PageTitle()
* @uses Href()
* @output bookmark link with urlencoded page URL and title
* @todo move style to Wikka stylesheet
* @todo add support for "tag" URL parameter

/* Constants section */
define('ICON_PATH', 'images/icons/logos/del.icio.us_small.png');
define('STYLE', 'border:1px dotted #999; height:10px; color:#666; text-decoration:none; font-size:.7em');
define('DELICIOUS_BASE_URL', '');

/* i18n */
define('LINK_TEXT', 'Post to');
define('LINK_TITLE', 'Bookmark this page at');

//build bookmark link
$url = $this->Href();
$title = $this->PageTitle();
if (isset($url) && isset($title)){
$delicious = DELICIOUS_BASE_URL.urlencode($url).'&title='.urlencode($title);
$icon = '<img src="'.ICON_PATH.'" />';
$output = '<a style="'.STYLE.'" href="'.$delicious.'" title="'.LINK_TITLE.'">'.$icon.' '.LINK_TEXT.'</a>';
echo $output;

Valid XHTML :: Valid CSS: :: Powered by WikkaWiki