Textpattern Forum

You are not logged in. Register | Login | Help

#1 2009-07-03 14:30:11

jsoo
Developer
From: NC, USA
Registered: 2004-11-15
Posts: 1,730
Website

soo_article_filter: additional control over article lists

Allows you to pre-select articles to limit the scope of an article or article_custom tag, using selection criteria not offered by those tags. In short, it’s like adding selection attributes to one of those tags.

Thanks to net-carver for clueing me in to MySQL temporary tables.

Version 0.3.2 (Jan 3, 2011)

Multidoc compatibility update

Version 0.3.1 (Dec 9, 2010)

Added limit, offset, and sort attributes.

Version 0.3.0 (Jul 11, 2010)

New attribute: where, allows you to add a raw WHERE expression to the selection criteria. (Thanks to Victor for the idea.)

Version 0.2.7 (Jun 6, 2010)

Fixed bug in index_ignore attribute. (Thanks to th3lonius for spotting it.)

Version 0.2.6 (Mar 8, 2010)

Two new attributes, update_set and update_where, which can be used in tandem to add a custom UPDATE query on soo_article_filter’s temporary `textpattern` table.

Version 0.2.5 (Feb 19, 2010)

Checks that temporary table creation was successful, else returns nothing.

Version 0.2.4 (Feb 19, 2010)

Create properly-alphabetized indexes with the new index_ignore and index_field attributes.

Version 0.2.3 (Jan 21, 2010)

Fixed custom field handling bug that was probably introduced in version 0.2.1

Version 0.2.2. (Sept 28, 2009)

New attribute: article_image.

Version 0.2.1 (July 7, 2009)

Multidoc compatibility
Filter now disabled on search results pages

Version 0.2 (July 4, 2009)

Fixed behavior of expires attribute.

Version 0.1 (July 3, 2009)

Initial release. Allows filtering on the Expires field, and regexp pattern matching on any custom field.

Info and download

Edit: Errr, see this first; a simple no-plugin solution for matching any non-empty custom field.

Last edited by jsoo (2011-01-03 23:44:05)


Txp tags not doing what you expect? Learn to use a tag trace. And the Tag Reference.

Offline

#2 2009-07-03 17:38:03

artagesw
Developer
From: Seattle, WA
Registered: 2007-04-29
Posts: 227
Website

Re: soo_article_filter: additional control over article lists

I would advise caution with this approach. Use of temporary tables is a clever hack indeed, but it can inflict a fairly steep performance penalty. You might want to consider an optional attribute that will tell the plugin to create the temporary table in memory rather than on disk, as this will increase performance 10x to 100x (at the cost of additional RAM usage).

Offline

#3 2009-07-03 18:24:16

jsoo
Developer
From: NC, USA
Registered: 2004-11-15
Posts: 1,730
Website

Re: soo_article_filter: additional control over article lists

Thanks for the tip. I don’t think it can be done because, apparently, columns with data type text or blob can’t be stored in memory. I haven’t had any performance problems with this technique yet, but haven’t tried it with truly large tables. But this would be a good caveat to add to the documentation.


Txp tags not doing what you expect? Learn to use a tag trace. And the Tag Reference.

Offline

#4 2009-07-03 18:42:40

artagesw
Developer
From: Seattle, WA
Registered: 2007-04-29
Posts: 227
Website

Re: soo_article_filter: additional control over article lists

Ahh, yes that is true. Wasn’t thinking about the specifics of which textpattern table you were mirroring.

Offline

#5 2009-07-03 19:58:13

jsoo
Developer
From: NC, USA
Registered: 2004-11-15
Posts: 1,730
Website

Re: soo_article_filter: additional control over article lists

Just uploaded a slightly modified version plus an alternate. Haven’t changed the version number (except for the alternate). On an earlier project using temporary tables I had problems with a client getting “Not unique table/alias” errors, which I solved by using a second, temporary-temporary, table as an intermediate step. Of course this isn’t great for performance, and I don’t know what configurations are likely to result in this error. Anyway, the main version of the plugin now does the one-step table creation so should be incrementally faster. If that doesn’t work for you, try the alternate version.

Edit: Also see this. Will probably obviate the need for this plugin for most users.

Last edited by jsoo (2009-07-03 22:47:53)


Txp tags not doing what you expect? Learn to use a tag trace. And the Tag Reference.

Offline

#6 2009-07-07 09:36:37

woof
Member
Registered: 2004-08-01
Posts: 127

Re: soo_article_filter: additional control over article lists

Hello jsoo

this is great and was working perfectly for my needs until I installed and activated the soo_multidoc plugin (soo_multidoc 1.0.b.1 and soo_txp_obj 1.0.b.1)

with soo_multidoc enabled it stops working and gives the following error message

Tag error: <txp:soo_article_filter expires=“future”> -> Textpattern Warning: Table ‘textpattern’ already exists
create temporary table textpattern select * from textpattern where Expires > now() on line 82

Offline

#7 2009-07-07 10:13:55

jsoo
Developer
From: NC, USA
Registered: 2004-11-15
Posts: 1,730
Website

Re: soo_article_filter: additional control over article lists

Arghh, the engineer, hoist with his own petard …

I’ll give some thought to this.


Txp tags not doing what you expect? Learn to use a tag trace. And the Tag Reference.

Offline

#8 2009-07-07 15:06:07

jsoo
Developer
From: NC, USA
Registered: 2004-11-15
Posts: 1,730
Website

Re: soo_article_filter: additional control over article lists

Just uploaded v0.2.1, updated for Multidoc compatibility. See soo_article_filter plugin help for a note about getting the two to work together. Thanks to woof for catching this.


Txp tags not doing what you expect? Learn to use a tag trace. And the Tag Reference.

Offline

#9 2009-07-07 19:08:47

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 483

Re: soo_article_filter: additional control over article lists

FYI: in the soo_article_filter download page the colophon still says: Version 0.,1 released 2009-07-03.

Offline

#10 2009-07-07 19:17:58

jsoo
Developer
From: NC, USA
Registered: 2004-11-15
Posts: 1,730
Website

Re: soo_article_filter: additional control over article lists

Hmm, I wonder if you’re seeing a cached page. Looks correct to me.


Txp tags not doing what you expect? Learn to use a tag trace. And the Tag Reference.

Offline

Board footer

Powered by FluxBB