Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-08-31 15:59:40

Christopher
Member
From: T.O.
Registered: 2004-05-27
Posts: 42
Website

urlencode output of <txp:title />?

Hi there,

I’m trying to create a del.icio.us bookmark link for individual articles, like this:

<code>
post to <a href=“http://del.icio.us/post?url=<txp:permlink />&title=<txp:title />”>del.icio.us</a>
</code>

Problem is, the title won’t get encoded properly for this to work.

Is there a way to urlencode the output of <txp:title />, or perhaps a better way to do this?

Last edited by Christopher (2006-08-31 16:00:21)

Offline

#2 2006-09-07 21:40:10

Christopher
Member
From: T.O.
Registered: 2004-05-27
Posts: 42
Website

Re: urlencode output of <txp:title />?

Ar har!

I figured it out:

<code>
post to <a href=“http://del.icio.us/post?url=<txp:permlink />&amp;title=<txp:php>$a = title (array ());echo urlencode($a);</txp:php>”>del.icio.us</a>
</code>

Last edited by Christopher (2006-09-20 13:29:32)

Offline

#3 2006-09-20 12:27:21

alesh
Member
From: Miami, FL
Registered: 2005-04-13
Posts: 228
Website

Re: urlencode output of <txp:title />?

awesome awesome awesome. A similar thing works for Digg ::

post to <a href="http://del.icio.us/post?url=<txp:permlink />&amp;title=<txp:php>$a = title (array ());echo urlencode($a);</txp:php>">del.icio.us</a>

· <a href="http://digg.com/submit?phase=2&url=<txp:permlink />&title=<txp:php>$a = title (array ());echo urlencode($a);</txp:php>&bodytext=<txp:excerpt />&topic=<txp:category1 link=/"n/" />">
digg</a>

Yes, I have tried turning it off and on.

Offline

#4 2006-09-20 12:54:17

Elenita
Member
From: Falls Church, VA
Registered: 2004-05-16
Posts: 407
Website

Re: urlencode output of <txp:title />?

For those linking to lots of bookmarking services, <a href=“http://www.ako-k.com/archive/150”>the ako_social plugin</a> might be of interest.

Offline

#5 2006-09-22 06:12:58

sunnyd503
New Member
From: Sacramento, CA USA
Registered: 2005-07-02
Posts: 9
Website

Re: urlencode output of <txp:title />?

Looks like the digg code only works if you have articles without excerpts – at least on my site.

Offline

#6 2006-09-22 06:53:09

sunnyd503
New Member
From: Sacramento, CA USA
Registered: 2005-07-02
Posts: 9
Website

Re: urlencode output of <txp:title />?

I modified the del.icio.us code for hugg.com and it seems to work:

<a href="http://www.hugg.com/submit?url=<txp:permlink />&amp;title=<txp:php>$a = title (array ());echo urlencode($a);</txp:php>">hugg this</a>

Offline

#7 2006-09-24 20:25:09

marc
New Member
Registered: 2006-09-24
Posts: 2

Re: urlencode output of <txp:title />?

Elenita wrote:

For those linking to lots of bookmarking services, <a href=“http://www.ako-k.com/archive/150”>the ako_social plugin</a> might be of interest.

The text file for that seems to be broken and the site has not been updated since June. Might anyone else have it?

Offline

#8 2006-09-24 20:57:06

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: urlencode output of <txp:title />?

No, the text file isn’t broken – that’s how plugins look (base64 encoding).

Offline

#9 2006-09-24 23:00:19

marc
New Member
Registered: 2006-09-24
Posts: 2

Re: urlencode output of <txp:title />?

Thank you! I should have looked closer.

Offline

Board footer

Powered by FluxBB