Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#637 2009-10-24 17:17:12

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

Re: tru_tags: A tagging plugin for textpattern

@Gocom Thanks! Well, I am not using tags in article lists but only because I thought too many links might confuse readers in excerpt lists.

Sounds like the start of an interesting tru_tags performance optimization discussion :)
I am always interested in performance optimization.

Nathan?


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

Offline

#638 2009-10-25 01:00:21

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

Re: tru_tags: A tagging plugin for textpattern

Gocom wrote:

Maybe those thousands of individual queries. The example I provided is just an example code. It’s not faster because hyphens and markup, but because your code causes some queries which will slow the page down.
Example, the tru_tags_from_article() function calls tru_tags_get_tags_for_article() function. It has a query in it:
$rs = safe_row($tags_field, “textpattern”, “ID=’$articleID’ AND $tags_field <> ‘’”);
And well it isn’t needed cause every article field is stored inside globals. That is why my example is faster.

Wow! I misunderstood your original post, when I replied earlier – I thought your code was meant to replace the article list; I didn’t realize it replaced the individual article’s tag list. So yes, I agree, your solution is much better. I didn’t know that the keywords were already available in memory. I’ll switch tru_tags to use that method in the next version, at least in contexts where $thisarticle is available. (The next version is still a ways off – work takes priority – but I will eventually get to it.)

Offline

#639 2009-10-25 23:04:31

shilmy
Member
Registered: 2006-04-29
Posts: 49

Re: tru_tags: A tagging plugin for textpattern

Thanks Gocom, I use your code, and it works. No more fatal error. But I don’t really understand this part

Gocom wrote:

You can increase the speed by using article_custom and it’s keyword attribute. It does the same as the listing. If you use the tag redirection features, please don’t.

Offline

#640 2009-11-10 02:55:06

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

Re: tru_tags: A tagging plugin for textpattern

For some reason, highlighting of selected tags on the Write tab doesn’t get applied in IE, while it works fine in Firefox. I don’t know if this is even specific to the tru_tags plugin. I’ve shrunk the Keywords field down to 0px so that end-users can’t add new keywords, but also if they’re using IE, they have no way of knowing from the Write tab what tags are selected.

Last edited by aswihart (2009-11-10 13:19:07)

Offline

#641 2009-11-14 14:22:45

saccade
Plugin Author
From: Neubeuern, Germany
Registered: 2004-11-05
Posts: 521

Re: tru_tags: A tagging plugin for textpattern

Hi, this is a great plugin.
But now I have some trouble with the sticky-behaviour:

As in txp:article I use two calls of tru_tags_handler, the first with sticky-, the second with live-articles.

Everything is fine when a sticky article exists.
But when there is none it will throw a 404 – (even when commented out!)

I could workaround temporarily by providing stickies for existing tags. But when my clients will add a new tag without creating a sticky article they’ll get problems.

I read about the noarticles-Attribute, but I think another URL will be of no help, it simply should ignore missing sticky-articles, and only throw 404 if there are no articles at all.

Is there any way to get the same behaviour like using twice txp:article?

Offline

#642 2009-11-16 14:13:51

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

Re: tru_tags: A tagging plugin for textpattern

saccade – I can’t think of a way to do what you want, in the current version of tru_tags. What you’d need is another attribute that said “don’t redirect if the results are empty”. I’ll add it to my list for the next release.

What’s the original goal of having the second call? Is it just to have sticky results filter to the top? That might be something else I could just add as a specific feature to tru_tags.

Offline

#643 2009-11-16 14:38:09

saccade
Plugin Author
From: Neubeuern, Germany
Registered: 2004-11-05
Posts: 521

Re: tru_tags: A tagging plugin for textpattern

truist, I figured out a workaround to solve the problem for now by modifying your plugin (the same direction you mentioned above):

Simply by replacing this line in the tru_tags_handler-function

txp_die(gTxt('404_not_found'), '404');

by

return $result;

My goal is to include sticky-articles – which aren’t included by default – and sorting them before other ones. (And maybe formatting them differently)

But I think your second idea (specific feature) mentioned above will be too specific. For if it is done within a single output it will be difficult to give sticky-results a special design (for example by wrapping them differently).

I’d much rather like it to work like the article-tag.
But I don’t quite figure out how empty results in one of two calls are treated there. But it seems to be different than the current redirect in tru_tags.
(There is an open question I have to try out: The article-tag’s-result if sticky articles are empty and live-articles are present is: No redirect. But what is if it’s the other way round: There is a sticky article, but no live-article?)

Offline

#644 2009-11-21 04:59:25

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

Re: tru_tags: A tagging plugin for textpattern

I’m pleased to announce the release of tru_tags v3.6, which fixes most of the outstanding issues that have been reported on the forum (excluding any major feature requests). Please see the releases page for details, but notable items include:

  • Added tru_tags_search_result_excerpt to work around a problem with using TXP’s search_result_excerpt for tag search pages.
  • Added a 404_redirect attribute to tru_tags_handler to allow disabling of the 404 redirect feature. This is necessary when calling tru_tags_handler twice, for example when showing sticky articles followed by non-sticky articles.
  • Expanded the tag clouds on the Write page and Extensions page to include future-dated tags and tags from non-searchable sections.
  • Significantly improved the performance of tru_tags_from_article on article list pages by removing an unnecessary database query.
  • Worked around a few javascript/DOM issues in IE that broke styling of the tags on the Write tab.

Enjoy!

Last edited by truist (2009-11-21 22:46:35)

Offline

#645 2009-11-21 15:44:39

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

Re: tru_tags: A tagging plugin for textpattern

@Nathan Typo: Missing http://www.rainskit.com/ for the reference links.

Btw, Posterous as a sideblog is great for pushing such news & compliments :)

Textpattern CMS: Keyword plug-in tru_tags version 3.6 available


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

Offline

#646 2009-11-21 22:46:46

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

Re: tru_tags: A tagging plugin for textpattern

Whups! Links fixed.

Offline

#647 2009-11-22 17:19:42

saccade
Plugin Author
From: Neubeuern, Germany
Registered: 2004-11-05
Posts: 521

Re: tru_tags: A tagging plugin for textpattern

Great! Thanks for the nicely tailored version!

Offline

#648 2010-01-21 14:44:38

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 305
Website GitHub Twitter

Re: tru_tags: A tagging plugin for textpattern

Hello,

I have a strange problem.

Everytime when I switch the tru_tags plugin on, I get a high cpu load of my fastcgi processes. But I have less than 1 request/second. The most interesting for me is, that all the tags of tru_tag are cached that means in the main section I have something like that:

<txp:zem_cache id="tags_handler" timeout="86400">
<txp:if_section name="tag">
  <txp:tru_tags_handler />
</txp:if_section>
</txp:zem_cache>

and the cloud is generated by

<txp:zem_cache ctx="tags" timeout="86400">
<div id="tagwolke">
<h3>Topthemen</h3>
<txp:tru_tags_cloud listlimit="50" mintagcount="5" minpercent="90" maxpercent="200" countwrapchars="()"  showcounts="1" texttransform="capitalize" title="Favoriten" activeclass="tagwolke" generatelinks="1" usenofollow="1" section="artikel" />
</div>
</txp:zem_cache>

The article form has this inside:

<txp:zem_cache id="keywords" timeout="86400">
<txp:tru_tags_if_has_tags>
<p class="chlforbidden linie_unten">Damit verbundene Stichworte:<br /> 
<strong>
<txp:tru_tags_from_article texttransform="capitalize" generatelinks="1"/>
</strong>
</p>
</txp:tru_tags_if_has_tags>
</txp:zem_cache>

The strange thing is that everything works fine, with a maximum cpu load of 10% per php-cgi process , when tru_tags is switched off.

The server has a 2 core Opteron with 1,6 Ghz, Debian Lenny, PHP 5.2.6-1+lenny3, MySQL v5.0.51a-24+lenny2, Lighttpd 1.25 with XCache 1.2.2, Textpattern 4.2.0 and tried tru_tags 3.5 and 3.6. I also tried first different versions of Lighttpd, selfcompiled and standardpakets. For PHP I tried the standard php.ini`s and some own optimized. MySQL v5.0.51a-24+lenny2. The textpattern table has about 31MB and there are about 2100 articles with at least 3 keywords per article.

At first I supposed, that is has something to do, with clean urls, but switching between these options doesn´t change the behaviour.
I use clean-urls over the server.error-handler-404 directive from Lighttpd, see here

Has anyone else this problem? Where to look? Has anyone a hint? Maybe another plugin together with tru_tags causes this high load??

Last edited by whocarez (2010-01-21 16:11:34)

Offline

Board footer

Powered by FluxBB