Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2005-05-01 20:30:09

bluearc21
Member
From: US.VA
Registered: 2004-02-24
Posts: 62
Website

Re: [plugin] [ORPHAN] zem_link

Just installed zem_link with a current build of RC3. It works fine, however the url-title is being duplicated.

So, if the article url-title for article “25” in section “is_it_real” is “heaven”, the <txp:zem_link href="25" /> points to domain.com/is_it_real/heavenheaven (if url-scheme is /section/title).

A quick fix is to comment out line 34.

//if ($url_mode==1) $url = $url . (empty($rs["url_title"]) ? stripSpace($rs["Title"]) : $rs["url_title"]);


“If you build it, they will come.”

Offline

#38 2005-05-04 09:07:57

ChrisJ
Member
From: Vienna, Austria
Registered: 2004-03-30
Posts: 54
Website

Re: [plugin] [ORPHAN] zem_link

bluearc, you are my star

Offline

#39 2005-05-05 23:56:35

alicson
Member
Registered: 2004-05-26
Posts: 465
Website

Re: [plugin] [ORPHAN] zem_link

that’s why they were being duplicated!?!? bluearc, you’re a <em>super</em>star! thank you :)


textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation

Offline

#40 2005-05-06 00:31:34

Etz Haim
Archived Plugin Author
From: Karlstad, Sweden
Registered: 2005-01-24
Posts: 262
Website

Re: [plugin] [ORPHAN] zem_link

What’s wrong with this plugin (as well as with lots of other ones) is that it depends on the deprecated url_mode variable. You could either opt for bluearc’s solution, or set url_mode to 0 directly in the database as I explain here.

Offline

#41 2005-05-06 02:18:52

alicson
Member
Registered: 2004-05-26
Posts: 465
Website

Re: [plugin] [ORPHAN] zem_link

okay.. so i tried this out.. and i’m still seeing double titles.. am i the only one? could it be another plugin?


textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation

Offline

#42 2005-05-06 19:50:46

Etz Haim
Archived Plugin Author
From: Karlstad, Sweden
Registered: 2005-01-24
Posts: 262
Website

Re: [plugin] [ORPHAN] zem_link

alicson: Are these permlinks generated by the standard tag? I’ve found out that these are affected as well.

Offline

#43 2005-05-06 19:58:50

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,090
Website

Re: [plugin] [ORPHAN] zem_link

I couldn’t find $url_mode in the source files (any more), but urlmode is still there.
My solution was to add the line
<code>$url_mode=urlmode;</code>
just beneath the global definitions at the beginning of the function.

Not sure if it’s any better or worse than other solutions but it works for me…


TXP Builders – finely-crafted code, design and txp

Offline

#44 2005-05-06 20:05:33

Etz Haim
Archived Plugin Author
From: Karlstad, Sweden
Registered: 2005-01-24
Posts: 262
Website

Re: [plugin] [ORPHAN] zem_link

jakob: No, you were not supposed to edit any source code at all. In the txp_prefs table in the MySQL database, You have to change the url_mode value from 1 to 0. In order to this, you have to use a tool like phpMyAdmin.

Offline

#45 2005-05-07 00:00:32

alicson
Member
Registered: 2004-05-26
Posts: 465
Website

Re: [plugin] [ORPHAN] zem_link

generated by the standard tag, i believe…
but i hesitate to change the urlmode in database, because as you say it would likely affect other plugins. might this not be fixed soon in an upcoming RC3 revision? :hopeful:


textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation

Offline

#46 2005-05-12 05:37:34

wazdog
Archived Plugin Author
From: Japan
Registered: 2004-05-26
Posts: 11

Re: [plugin] [ORPHAN] zem_link

Couple of quick changes to fix all these article permlink problems. (It’s great that there are finally functions to return a permlink, without the plugin having to worry about the mode. Now we just need to get all these plugins updated!)

Around line 24 or so, comment out the first line, and add the second:

<code> //$url = ($url_mode==1 ? $thisarticle[“permlink”].$url_title : $thisarticle[“permlink”]); $url = permlinkurl($thisarticle);
</code>
<br />

And around line 33 or so, comment out the first two lines, and add the third:

<code> //$url = formatPermLink($href, $rs[“section”]); //if ($url_mode==1) $url = $url . (empty($rs[“url_title”]) ? stripSpace($rs[“Title”]) : //$rs[“url_title”]); $url = permlinkurl_id($href);
</code>

<br />
Also, as mentioned above, around line 50 or so, you may want to do this in case you have quote marks in your article titles:

<code> //$title = ($title ? “ title=\”$title\”“ : “”); $title = ($title ? “ title=\”“.htmlentities($title).”\”“ : “”);
</code>

Last edited by wazdog (2005-05-12 05:38:52)

Offline

#47 2005-05-13 12:56:36

edburdo
Member
Registered: 2004-09-20
Posts: 79
Website

Re: [plugin] [ORPHAN] zem_link

Etz, I changed the URL mode on my site (only use one plugin that generates URL’s) and everything is working OK now. Thanx…


Eric

Offline

#48 2005-05-14 15:26:26

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [plugin] [ORPHAN] zem_link

wazdog, when I do exactly as you say (at least I think I do), I get this error:

Parse error: parse error, unexpected ‘:’ in /home/httpd/vhosts/doggiez.nl/httpdocs/textpattern/lib/txplib_misc.php(351) : eval()’d code on line 26

Offline

Board footer

Powered by FluxBB