Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
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.3 (2017-02-15)

Textpattern 4.6 compatibility update

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 (2017-02-16 02:33:12)


Code is topiary

Offline

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

artagesw
Member
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
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
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.


Code is topiary

Offline

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

artagesw
Member
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
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
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)


Code is topiary

Offline

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

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

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
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
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.


Code is topiary

Offline

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

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
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.


Code is topiary

Offline

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

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

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
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: soo_article_filter: additional control over article lists

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


Code is topiary

Offline

#11 2009-09-29 01:19:45

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: soo_article_filter: additional control over article lists

Version 0.2.2. just released.

New attribute: article_image. Only show articles with (or without) an article image. [As requested by Fernando.]


Code is topiary

Offline

#12 2010-01-21 18:26:42

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: soo_article_filter: additional control over article lists

Version 0.2.3 released. Fixes custom field handling bug that was probably introduced in v0.2.1.


Code is topiary

Offline

#13 2010-02-19 17:56:45

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: soo_article_filter: additional control over article lists

Version 0.2.4 released. There are two new attributes, index_ignore and index_field. Used in combination, these convert article titles to the form used for alphabetizing indexes, e.g. “The Article Title” becomes “Article Title, The”. This converted title is then stored in a custom field that you can access with the usual Txp tags. Plugin help includes an example.

Edit: Version 0.2.5 released, in response to this.

Last edited by jsoo (2010-02-19 22:14:07)


Code is topiary

Offline

#14 2010-03-08 12:08:32

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

Re: soo_article_filter: additional control over article lists

Hi Jeff
Possible future feature suggestion: Is it within the scope of this plugin to filter by status? I suggest it because I recently had the need to output draft articles

Offline

#15 2010-03-08 17:35:33

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: soo_article_filter: additional control over article lists

The plugin could easily be modified to do this, but it wouldn’t help with your issue, because with this plugin you are still using article and article_custom tags to fetch articles.

Edit: However the plugin could change the article status from draft to live or sticky. Could you work with that?

Last edited by jsoo (2010-03-08 17:41:11)


Code is topiary

Offline

Board footer

Powered by FluxBB