Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#631 2009-10-24 01:22:48
- shilmy
- Member
- Registered: 2006-04-29
- Posts: 49
Re: tru_tags: A tagging plugin for textpattern
hello, do this tag scale well?
I’ve been using this tag plugin on my sites with excellent results. But most are small site with at most contain hundreds articles.
When I install this plugin in site with about 5 thousands articles, I got a Fatal ERROR:Fatal error: Maximum execution time of 30 seconds exceeded in /home/shilmy/public_html/calendars/textpattern/lib/txplib_misc.php(594) : eval()’d code on line 283
this is happen when I click tags in the tags cloud.
Offline
#632 2009-10-24 04:41:48
Re: tru_tags: A tagging plugin for textpattern
shilmy wrote:
hello, do this tag scale well?
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.
You can also speed it up by not using those article tag functions, but instead keywords and so on. For example I severly speeded up my article listings by using:
<txp:php>
global $thisarticle;
if(isset($thisarticle['keywords']) && $thisarticle['keywords']) {
$out = array();
$tags = explode(',',$thisarticle['keywords']);
foreach($tags as $tag)
$out[] = '<a rel="nofollow" href="'.hu.'tag/'.$tag.'">'.$tag.'</a>';
echo implode(', ',$out);
}
</txp:php>
…instead <txp:tru_tags_if_has_tags> and <txp:tru_tags_from_article /> tags.
Offline
#633 2009-10-24 12:10:45
Re: tru_tags: A tagging plugin for textpattern
@shilmy The scaling issue seems to be the total number of keywords and not the number of articles.
Using the standard tru_tags template tags it helps to minimize presentation attributes to default output. The caclulation of tru_tags clouds with many additional HTML rendering seems to be the issue.
More here and somewhere before in the thread.
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline
#634 2009-10-24 12:28:38
Re: tru_tags: A tagging plugin for textpattern
@Gocom
For example I severly speeded up my article listings
How much was the speed gain for article lists?
Is that code also much faster in single article context?
Is '.hu.' a fix variable for home URL wherever you use it in TXP-PHP context?
Btw: Why don’t you use the more specific microformat rel=“tag” or rel=“tag nofollow”?
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline
#635 2009-10-24 12:43:17
Re: tru_tags: A tagging plugin for textpattern
shilmy wrote:
hello, do this tag scale well?
Hm, I can’t think of a reason why the article listing would perform badly, as compared to Gocom’s solution. (And tru_tags will handle things like spaces and hyphens better.) But it could be slow because it is looking up (and rendering) the tags for each article in the results (assuming that you show tags with each article), and it would be extra slow if you were using settings like useroverallcounts.
Can you try setting your article limit on a normal section page to a really high number? I’m curious to see if that also times out.
Offline
#636 2009-10-24 13:48:46
Re: tru_tags: A tagging plugin for textpattern
merz1 wrote:
How much was the speed gain for article lists?
Depends how much shit you have there. One saved query and couple function calls and extract() do the differences.
merz1 wrote:
Btw: Why don’t you use the more specific microformat rel=“tag” or rel=“tag nofollow”?
It’s an example.
merz1 wrote:
Is ‘.hu.’ a fix variable for home URL wherever you use it in TXP-PHP context?
hu is defined string for site path.
truist wrote:
Hm, I can’t think of a reason why the article listing would perform badly, as compared to Gocom’s solution. (And tru_tags will handle things like spaces and hyphens better.)
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.
Last edited by Gocom (2009-10-24 13:52:05)
Offline
#637 2009-10-24 17:17:12
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
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, thetru_tags_from_article()function callstru_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_customand it’skeywordattribute. 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
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
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
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_excerptfor tag search pages. - Added a
404_redirectattribute to tru_tags_handler to allow disabling of the 404 redirect feature. This is necessary when callingtru_tags_handlertwice, 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_articleon 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
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