Welcome to Geeklog Saturday, October 21 2017 @ 10:59 pm EDT


Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/2002
Posts: 13073
Location:Stuttgart, Germany
Here's a little hack I made a while ago and completely forgot about: The idea is to add a little "Save to Delicious" link next to the links listed in the Links plugin.

We need 2 new variables for that. Open public_html/links/index.php and in function prepare_link_item, add the 2 lines as pointed out below:
PHP Formatted Code
    $template->set_var ('link_url', $url);
    $template->set_var ('link_actual_url', $A['url']);
    $template->set_var ('link_actual_url_encoded', urlencode($A['url'])); // <-- add this line
    $template->set_var ('link_name', stripslashes ($A['title']));
    $template->set_var ('link_name_encoded', urlencode(stripslashes ($A['title']))); // <-- add this line


Then, open plugins/links/templates/linkdetails.thtml and add the link to Delicious, e.g. like so (this is the complete file):
PHP Formatted Code
<li>
  <strong>{link_html}</strong> ({link_hits}) <span><a href="http://delicious.com/save?url={link_actual_url_encoded}&amp;title={link_name_encoded}" title="Save to Delicious"><img src="{site_url}/images/icons/delicious.small.gif" alt="[Delicious]"></a></span> {edit_icon} {link_broken}<br{xhtml}>
  {link_description}
</li>


I've downloaded the delicious.small.gif icon from here: http://static.delicious.com/img/delicious.small.gif and put it into the site's public_html/images/icons directory.

Now you see the Delicious icon next to every link in your Links section. Clicking on it will take you to Delicious where, assuming you have an account, it will let you save it to your bookmarks. The title is automatically filled in from the title in the Links plugin.

Have fun.

bye, Dirk

P.S. The 2 new variables will also be built into the next Geeklog release.

Status: offline

RickW

Forum User
Full Member
Registered: 28/01/2004
Posts: 240
Location:United States
Is this in the latest release (1.5.2)?

www.antisource.com

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/2002
Posts: 13073
Location:Stuttgart, Germany
The two new variables are in 1.5.2.

bye, Dirk

Status: offline

1000ideen

Forum User
Full Member
Registered: 04/08/2003
Posts: 1289
Would it be possible to get instructions how to put this under a story in GL 1.6.0 ? Maybe also with Twitter http://twitthis.com/tools Confused:

All times are EDT. The time is now 10:59 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content