It creates a "Digg this" link.
Variables are:
- &diggTitle: the var used as Story Title on Digg. Select it from the classic document vars, like title, pagetitle, longtitle and so on.
Defaults to "pagetitle" if not set.
- &diggDesc: as before, the value passed to Digg as Story Description. Again select it from the document vars.
Defaults to "introtext" if not set.
- &diggTopic: the topic passed to Digg. The list of selectable topic is here (.pdf).
There is no default if not set.
- &linkTitle: the title="" attribute of the link.
Defaults to "Digg this story" if not set.
- &linkText: the text of the link. Look at the code to find where to replace what to have a fully customized "Digg This" link.
Defaults to "Digg this".
Try it and let me know, it works for me with FUrls ON but I think it can work even with them OFF (but not sure).
// First attempt to create a "Digg this" auto creating link.
// for feedback [email protected] or www.modxcms.com/community_forums.html
// collect variables, none of this is required.
$diggTitle = (isset($diggTitle)) ? $diggTitle : 'pagetitle';
$diggDesc = (isset($diggDesc)) ? $diggDesc : 'introtext';
$diggTopic = (isset($diggTopic)) ? $diggTopic : '';
$linkTitle = (isset($linkTitle)) ? $linkTitle : 'Digg this story';
$linkText = (isset($linkText)) ? $linkText : 'Digg this';
// work
$output = '<a href="http://digg.com/submit?phase=2&url=';
// strip out "http://"
$dirtyUrl = str_replace("http://", '', $modx->config['site_url']);
// there are two "/" between site url and request_uri, let's strip one
$url = substr_replace($dirtyUrl, '', -1, 1);
// replace '.$linkText.' with your html for a fully customized "Digg this" link
$output .= urlencode($url.$_SERVER["REQUEST_URI"]).'&title='.urlencode($modx->documentObject[$diggTitle]).'&bodytext='.urlencode($modx->documentObject[$diggDesc]).'&topic='.$diggTopic.'" title="'.$linkTitle.'">'.$linkText.'</a>';
return $output;
Now that’s a cool addition

Bloggers will love it !
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
Well, you can digg every page you want. Not a blog entry only.
It’s about visibility and user bookmarking. Using it only on a blog is limiting, no?
Certainly yes, but forgive my poor knowledge of Digg, it’s only for english content if I am not mistaken... I never used it so far...
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
It’s not your fault! It’s the general use that’s limited to blog.
In fact the base idea is good, but is the lack of categories (there are no international categories as you said, and the rest are very limited) is inexplicable for me.