Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#16 2004-10-16 01:45:22
- hafnius
- Archived Plugin Author

- From: DK
- Registered: 2004-09-02
- Posts: 47
Re: [plugin] [ORPHAN] zem_link
I dont know i i did not explain myself good enough – it is not the current link i am after.
If i make a link in the link list to cnn.com and then write an article about tv it would be nice if i could output the link to cnn.com in the article without having to categorise it but simply calling it by its id.
If you already had gotten my drift i take the above bach. I am not qiute enough into TXP. But i am thinking that there must be away to do the above. If i can output an article by calling its id, shouldnt it be possible to do the same with a link?
/Hafnius
– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing
Offline
#17 2004-10-16 02:06:21
- zem
- Developer Emeritus

- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: [plugin] [ORPHAN] zem_link
Ah, with you now. Working on a new version.
Alex
Offline
#18 2004-10-16 02:20:43
- zem
- Developer Emeritus

- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: [plugin] [ORPHAN] zem_link
http://vigilant.tv/documents/tp/zem_link-0.3.txt
Two new features:
- Adds a ‘linkid’ attribute, as per Hafnius’ suggestion.
- Can now be used as a self-closing tag when linking by article ID or link ID. The article/link title will be used as the link text in those cases. e.g:
<code><txp:zem_link href=“25” /></code> – link to article #25, with the article title as the link anchor text
<code><txp:zem_link linkid=“10” /></code> – link to link #10, with the link name as the link anchor text
Last edited by zem (2004-10-16 02:24:39)
Alex
Offline
#19 2004-10-16 02:57:57
- hafnius
- Archived Plugin Author

- From: DK
- Registered: 2004-09-02
- Posts: 47
Re: [plugin] [ORPHAN] zem_link
How cool are you !!
Tested the linkid and it works perf. all the eamples are gone and replaced by foo but i guess you know this.
All that lacks now is that the id of the links is showed in admin > Images so that we dont have do look in the db to find the id of the link – maybe a feature request?
——
Could this elephant have any other name then ZEM :)
/Hafnius
Last edited by hafnius (2004-10-16 03:10:24)
– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing
Offline
#20 2004-10-16 03:50:10
- zem
- Developer Emeritus

- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: [plugin] [ORPHAN] zem_link
> Tested the linkid and it works perf. all the eamples are gone and replaced by foo but i guess you know this.
Yeah, something screwy with Textile.
> All that lacks now is that the id of the links is showed in admin > Images so that we dont have do look in the db to find the id of the link – maybe a feature request?
It’s in the URL if you click or hover the link name in content/links.
Alex
Offline
#21 2004-10-23 14:37:22
- hafnius
- Archived Plugin Author

- From: DK
- Registered: 2004-09-02
- Posts: 47
Re: [plugin] [ORPHAN] zem_link
Well that would be possible if the plugin had been made to be called by the link_title rather then the id. The problem with using the link_title is that it might not be unique, whereas the id is always unique.
/Hafnius
– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing
Offline
Re: [plugin] [ORPHAN] zem_link
Hi Zem, it would be great to have a attribute to make this plugin work with links to comments too. It just about adding #comment at the end, atm ive made my own plugin based on yours to do this, but i rather have it in yours :)
Johan Nilsson
Offline
Re: [plugin] [ORPHAN] zem_link
The key to use zem_link efficiently is to know ID number as fast as you can, maybe.
So I’ve decided to hack some php files to show IDs. Here’s what I did.
Show linkid at link page
Hack include/txp_link.php, added:
- <code>column_head(‘id’).</code>
above
- <code>column_head(‘link_name’,‘linksort’,‘link’,1,$dir).</code>
And then added:
- <code>td($id).</code>
above
- <code>td($elink).</code>
Show articleid at writing page
Hack include_txp_article.php, change;
- <code>echo ‘<a href=”?event=article’.a.‘step=edit’.a.‘ID=’.$ID.’”>’.$Title.’</a>’.br.n;</code>
into
- <code>echo ‘’.$ID.’: <a href=”?event=article’.a.‘step=edit’.a.‘ID=’.$ID.’”>’.$Title.’</a>’.br.n;</code>
To show lots of aticles at writing page
- <code>“1 order by LastMod desc limit n”</code>
just change <code>n</code> any number you like. You can find where it should be by searching with your nice editor.
Thank you for your cool plugin Zem. I can’t imagine writing without your stuff!
Last edited by ren (2004-11-07 06:49:16)
Offline
Re: [plugin] [ORPHAN] zem_link
If there are unencoded quotes in the content, zem_link doesn’t encode them. So the output is not valid. Add a call to htmlentities for $title fixes it.
$title = ($title ? “ title=\”“.htmlentities($title).”\”“ : “”);
Sven
<bc />
Offline
Re: [plugin] [ORPHAN] zem_link
Seems to be an problem with txp:title. It does not encode Quotes. So the fix shouldn’t be in zem_link.
Sven
<bc />
Offline
#26 2004-12-08 14:26:40
- odilon
- Member
- Registered: 2004-09-01
- Posts: 15
Re: [plugin] [ORPHAN] zem_link
Can zem_link be used to assign a unique class to a link?
I want to highlight the link for the current page but can’t seem to find a way to do it.
Offline
Offline
#28 2004-12-09 02:35:55
- whit
- New Member
- Registered: 2004-12-02
- Posts: 2
Re: [plugin] [ORPHAN] zem_link
Pardon. This will be obvious to many, but not yet to me, I’m sure already discussed elsewhere but I haven’t found it yet. When I go to http://vigilant.tv/documents/tp/zem_link-0.3.txt I see a file with a long encoded string in it. However, while I trust the author in this case, I don’t as policy run anything on a production server where I don’t at least in principle have the ability to read the source. Is that available on this?
Offline
#29 2004-12-09 02:47:38
- Remillard
- Plugin Author

- From: Lenexa, KS
- Registered: 2004-05-16
- Posts: 169
Re: [plugin] [ORPHAN] zem_link
Sure. If you upload the plugin, it is not enabled until you click on the No/Yes enabled link. Regardless of enabling it, you can click on the plugin title and see the full plugin code and any included documentation.
Offline