Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#109 2006-08-27 05:29:18

truist
Plugin Author
From: Ohio, USA
Registered: 2004-11-09
Posts: 257
Website

Re: tru_tags: A tagging plugin for textpattern

Sorry for the long delay, everyone, but I have finally posted v1.9. It fixes a number of things:

Fatal error: Call to undefined function mb_strtolower()

Fixed, I hope – I have no way to test this, really. I do a check to see if the <code>mb_strtolower()</code> is defined, before I try to use it. That should fix it for everybody, even if you have a version of php that should have the function but doesn’t seem to be working. Can somebody please report if it actually works?

I have two keywords combined by a ’+’.

merz1, I’ve fixed your bug :) This is a good general-purpose fix – it now correctly urlencodes the tags, which it should have been doing all along. <strong>There’s one big problem, though -</strong> mod_rewrite and apache2 don’t seem to mix well, when using urlencoded urls. So I’ve had to hack a fix into the plugin to work around it, and the fix is turned off by default because it would break servers that don’t have the bug. (So this plugin is backwards compatible with all servers, but will not fix merz1’s bug by default.) To enable the fix/hack, edit the plugin and look at the second function (<code>tru_tags_double_urlencode</code>) and uncomment the second line (and re-comment the first).

I also fixed an annoyance. If you put an extra comma at the end of your list of tags for an article (ex: “cats, dogs,”), tru_tags would think there was supposed to be another tag there, and would end up showing an extra comma in the cloud because it was trying to show that blank tag. I made it not do that :)

Finally, I added a new <code>title</code> attribute to <code>tru_tags_from_article</code> and <code>tru_tags_cloud</code> that lets you control the tooltip for the tags.

Last edited by truist (2008-07-03 12:02:36)

Offline

#110 2006-08-27 05:32:14

truist
Plugin Author
From: Ohio, USA
Registered: 2004-11-09
Posts: 257
Website

Re: tru_tags: A tagging plugin for textpattern

then, context sensitive link to next/prev links to limit the article navigation to articles that contain the tag i was looking for

sthmtc, I think you may have a great idea there. But it sounds very complicated, and it would require a lot of work to mimic all the features of textpattern (I think), and I’m not up to it tonight :) Maybe contact me offline about it? You can find my email address on my website.

Offline

#111 2006-08-27 06:17:43

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: tru_tags: A tagging plugin for textpattern

Nathan, maybe it is too early but I don’t get the new configuration:

return 0; #use this if you aren’t using a broken version of apache, or if you only use letters/numbers in your tag names, or if you’re not using clean urls

Set this to 1 to enable the ‘+’ fix or comment it out/deactivate it?

#return tru_tags_use_clean_urls(); #use this if you are using a version of apache that has this problem: http://issues.apache.org/bugzilla/show_bug.cgi?id=34602

Do I have to activate this in all cases if I deactivate the above?

What about about return=1 above and activating return tru_tags_use_clean_urls();

I made the update to 1.9 but left this new configuration unchanged yet.


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#112 2006-08-27 06:53:44

truist
Plugin Author
From: Ohio, USA
Registered: 2004-11-09
Posts: 257
Website

Re: tru_tags: A tagging plugin for textpattern

Sorry, I knew this was going to be unclear :-(

For you, specifically, you want the second line of the function and not the first, so you should comment out the “return 1;” and uncomment the other line. Go ahead and set tru_tags_use_clean_urls() to “return 1;” also – it can be set either way, regardless of the double_urlencode function.

I realize that I forgot to explain something – the bug in apache/mod_rewrite only exists if you’re using clean urls (because that’s when mod_rewrite comes into effect). So if you’re not using clean urls, you don’t need my hack/workaround, and therefore the function should return 0.

But also, if you aren’t using apache, or if they ever fix the bug, you might not need the workaround, even though you are using clean urls. So I couldn’t just say “always do the hack if they’re using clean urls” because that wouldn’t work for everybody. So I made this new function so that users can configure the behavior.

And then by default, I turn the hack/workaround off, because turning it on will break sites that don’t use clean urls, or that don’t need it (because they aren’t using apache, …). To turn it on, you just comment out the “return 0;” line and un-comment the “return tru_tags…” line.

So… end result is that anyone who uses apache and clean urls and the ‘+’ character will want the second line of the function, and not the first, and will have to edit both functions to get it all set up correctly.

Does that make sense?

Offline

#113 2006-08-27 16:58:46

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: tru_tags: A tagging plugin for textpattern

OK my plugin code now looks like this:

#See http://www.truist.com/reference/497/trutags-usage-instructions for instructions

function tru_tags_use_clean_urls()

{ return 1; #DO NOT ENABLE THIS unless you’ve read the instructions
}

#YOU ONLY NEED TO CARE ABOUT THIS FUNCTION IF YOU USE CLEAN URLS AND NON-ALPHANUMERIC CHARACTERS IN YOUR TAGS (LIKE ‘+’)

function tru_tags_double_urlencode()

# MM: more info at http://forum.textpattern.com/viewtopic.php?pid=123007#p123007

{

# return 0; #use this if you aren’t using a broken version of apache, or if you only use letters/numbers in your tag names, or if you’re not using clean urls

return tru_tags_use_clean_urls(); #use this if you are using a version of apache that has this problem: http://issues.apache.org/bugzilla/show_bug.cgi?id=34602

}

I added the line “more info at …”

The tag “Gruner +Jahr” is working now as expected and the URL is “gruner-%252B-jahr”.

Thanks for the effort and the fast reaction!

(Textile formatting and the # sign :(

Last edited by merz1 (2006-08-27 17:02:35)


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#114 2006-08-27 20:58:25

Consuetudinario
New Member
From: Chile
Registered: 2006-08-27
Posts: 6
Website

Re: tru_tags: A tagging plugin for textpattern

truist dijo:

Fatal error: Call to undefined function mb_strtolower()

Fixed, I hope – I have no way to test this, really. I do a check to see if the <code>mb_strtolower()</code> is defined, before I try to use it. That should fix it for everybody, even if you have a version of php that should have the function but doesn’t seem to be working. Can somebody please report if it actually works?

With the new version my problems are solved. Thanks.

Offline

#115 2006-08-28 04:10:51

truist
Plugin Author
From: Ohio, USA
Registered: 2004-11-09
Posts: 257
Website

Re: tru_tags: A tagging plugin for textpattern

Glad to hear it’s all working! Merz1, I added your comment to v1.9 – thanks!

Offline

#116 2006-08-28 12:17:09

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: tru_tags: A tagging plugin for textpattern

Just another small addition to the tru_tags documentation:

tru_tags_if_tag_search works beautiful with txp:else. I have just used it to separate search result listings and the ‘big’ cloud. Now I only have the related tags below the listing and the ‘big’ cloud on a separate conditional page. The search result page is showing much faster now.

For TXP-savvy users this might be standard but for beginners it is worth a little remark :-)


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#117 2006-08-28 12:59:50

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: tru_tags: A tagging plugin for textpattern

truist wrote:

sthmtc, I think you may have a great idea there. But it sounds very complicated, and it would require a lot of work to mimic all the features of textpattern (I think), and I’m not up to it tonight :) Maybe contact me offline about it? You can find my email address on my website.

…actually i could not find your email address on truist.com :)

Offline

#118 2006-08-28 15:21:52

truist
Plugin Author
From: Ohio, USA
Registered: 2004-11-09
Posts: 257
Website

Re: tru_tags: A tagging plugin for textpattern

Sorry about that – it’s hanging out on my resume, but not very obviously. I should have just put it here in the first place – please use truist-20060828@rainskit.com :)

Last edited by truist (2008-07-03 12:02:12)

Offline

#119 2006-08-28 17:16:23

alfette
Member
From: Cologne, Germany
Registered: 2006-08-22
Posts: 20

Re: tru_tags: A tagging plugin for textpattern

Hallo Nathan,
First I’d like to thank you very much for that plugin! It has worked perfekt from the first moment I used it.
I just have one question which I could not solve reading the documentary and this thread.

On my result page after ckicking on one tag, I use
<code>
<h2>&raquo;<txp:tru_tags_if_tag_search>
<txp:tru_tags_tag_parameter />
</txp:tru_tags_if_tag_search>&laquo;</h2>
</code>
to get the current tag listed.

In the output everything works fine, but there is a space around the tag, that I do not want.
Like that: » TAG « (»spaceTAGspace«).

Do you have an idea, if I did something wrong or how I can remove this spaces?

Thank you!
Bye, Alfette

Offline

#120 2006-08-28 17:49:37

truist
Plugin Author
From: Ohio, USA
Registered: 2004-11-09
Posts: 257
Website

Re: tru_tags: A tagging plugin for textpattern

Without looking at the code I’m guessing that the problem is actually caused by your html – the newlines in your html will be converted to spaces in the display. Try putting everything on one line, without the newlines. Does that fix it?

Offline

Board footer

Powered by FluxBB