Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: tru_tags: A tagging plugin for textpattern
I changed around tru_tags_list()
so that leading spaces in the keywords field got stripped out, and just wanted to run my meager php skills by you:
I changed lines 151-154 from:
<pre><code>
foreach ($rs as $row) {
$all_tags = array_merge($all_tags, explode(“,”, trim(strtolower($row[$tags_field]))));
}
</code></pre>
to:
<pre><code>
foreach ($rs as $row) {
$keywords = str_replace(“, “, “,”, trim(strtolower($row[$tags_field])));
$all_tags = array_merge($all_tags, explode(“,”, $keywords));
}
</code></pre>
I wasn’t sure why leading spaces in the first place weren’t stripped out. Was there any particular reason behind the decision? And do you see any big deal conflicts with my change?
Offline
Re: tru_tags: A tagging plugin for textpattern
Anyone know how to have textpattern output a list of articles related to the current article? Could be a cool feature in this plugin… just an idea.
Offline
Re: tru_tags: A tagging plugin for textpattern
jbhis8up wrote:
Anyone know how to have textpattern output a list of articles related to the current article? Could be a cool feature in this plugin… just an idea.
you can achieve this very easily with textpatterns built-in txp:related_articles
Offline
Re: tru_tags: A tagging plugin for textpattern
A new version with some minor changes:
It still displays a warning message at the top of the page while in debugging mode
I think I fixed this. If you upgrade and end up testing in debugging mode again, can you let me know?
I changed around tru_tags_list() so that leading spaces in the keywords field got stripped out…
Great idea, and it’s just one I never took the time to implement. You inspired me to do so, and it’s in this version. I didn’t use your code, though – I wanted it to be more robust. I did this:
<pre>
foreach ($rs as $row) {
$temp_array = explode(“,”, trim(strtolower($row[$tags_field])));
for ($i = 0; $i < count($temp_array); $i++) {
$temp_array[$i] = trim($temp_array[$i]);
}
$all_tags = array_merge($all_tags, $temp_array);
}
</pre>
Also:
Are the appropriate sections marked as “searchable”? (See admin -> presentation -> sections). (I may have just discovered a bug related to this!).
There is a bug. The tag search will show articles that are from sections that are not marked ‘searchable’ but the tag cloud won’t show those tags. I can’t fix the tag search (because textpattern is doing it), and I’m not sure it’s the right thing to fix the tag cloud. So unless it’s seriously hurting somebody, I’m going to leave it broken.
Anyone know how to have textpattern output a list of articles related to the current article?
How is this different from the existing tag search?
Offline
Re: tru_tags: A tagging plugin for textpattern
This looks like a great plugin. It’s inspired me to clean out some old junk from my textpattern install and make some updates.
When I first started using tags (with compooter’s technorati_tags plugin), for some reason I changed the default separator (comma) to a space — I think I was trying to match it to some other tag syntax that I was using elsewhere. Maybe? Anyway, this means that all my existing entries are separated with spaces instead of commas. I think I can rectify this with a couple of replace statements in mysql, but I want to make sure I don’t goof it up. To be very clear: Should I replace my existing spaces only with commas, or can I use “, “ (comma space) so that the tags will wrap in the textbox?
(I’m sort of assuming that either is okay — but I just want to make sure before I do it.)
-Alan
Offline
Re: tru_tags: A tagging plugin for textpattern
As of v1.5, “comma space” should work.
Offline
Re: tru_tags: A tagging plugin for textpattern
Awesome. Thanks, truist. My mysql replacement went just fine, so I’m ready to move ahead and put the plugin through some of its paces.
-Alan
Offline
#68 2006-04-25 22:06:01
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: tru_tags: A tagging plugin for textpattern
Thanks for this plugin.
Offline
Re: tru_tags: A tagging plugin for textpattern
I have it up and running, and it works great. Such a good plugin, truist, and really well documented, to boot. Really nice.
A quick note about clean urls: They work fine for me, but any tag that’s not the last (or only) one for any given entry is prefixed with ““; so, if an entry is tagged “apple, os x”, I get clean urls to /tag/-apple and /tag/os-x — no prefix “” to the last tag. This isn’t actually a problem, because either /tag/-apple or /tag/apple end up at the same (and correct!) tag page, but it’s just something I noticed. You can see this happening at the site linked in my profile.
Edit: Aha, my crack investigative work reveals to me that it behaves exactly the same at your site. If it’s a documented thing, I apologize for having missed it.
Last edited by schussat (2006-04-26 01:04:55)
-Alan
Offline
Re: tru_tags: A tagging plugin for textpattern
truist wrote:
Change your tru_tags_handler call to add a <code>form=“yourform”</code> attribute. It works just like txp:article.
On the subject of forms, If I’m doing things right, it appears that tru_tags doesn’t use the override form that I have specified with some articles. Is this correct? Although I think I could fix this by using a chunk of txp:if_section code, that means duplicating effort, since I already have the form specified elsewhere. Is that fix-able?
-Alan
Offline
Re: tru_tags: A tagging plugin for textpattern
Just wanted to say this is working great for me!
I have started tagging articles and have started work on a plugin that can pull up any del.icio.us posts from my account that share the same tags.
The site I’m developing will be something like a personal notebook for research and its handy to tag articles and have the associated del.icio.us posts that I’m summarizing show up automatically.
Thanks!
Offline
Re: tru_tags: A tagging plugin for textpattern
Got s slight problem with clean-mode. When I add “RewriteBase /sv” in the .htaccess-file, everything works except the tag-links, they add an extra /sv and point to http://www.carbonatedink.com/sv/sv/tag/. A bit annoying.
Edit: solved it by changing the clean-mode-URL-generation-code a little bit.
Last edited by nicklas (2006-04-30 01:06:41)
Offline