Textpattern Forum

You are not logged in. Register | Login | Help

#31 2010-12-09 16:50:08

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

Re: soo_article_filter: additional control over article lists

Version 0.3.1 available.

Added limit, offset, and sort attributes.

If you are concerned about memory usage, these attributes give you more options for winnowing down the size of the temporary table. (Idea came out of this discussion.)


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

Offline

#32 2011-01-03 23:44:51

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

Re: soo_article_filter: additional control over article lists

Version 0.3.2 available.

Multidoc compatibility update.


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

Offline

#33 2011-03-03 22:35:10

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: soo_article_filter: additional control over article lists

I really need to use txp’s default search in updated textpattern table. I even tried do disable this line if ( $pretext['q'] ) return parse($thing);, but without success. Is there any way to allow soo_article_filter to work with search? Why plugin disables at searchs?


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#34 2011-03-04 01:21:48

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

Re: soo_article_filter: additional control over article lists

I could be wrong but I don’t think fulltext search on a temporary table is possible.


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

Offline

#35 2011-03-04 13:50:44

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

Re: soo_article_filter: additional control over article lists

I’m wrong; it is possible. But the index would have to be built separately for the temp table, as here.


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

Offline

#36 2011-03-04 19:43:33

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: soo_article_filter: additional control over article lists

Just read this article :) Maybe it’s worth to add fulltext if search is defined?


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#37 2011-03-04 20:39:18

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

Re: soo_article_filter: additional control over article lists

Looks like it would be easy to add the needed code. The question is whether or not this is really practical with regard to performance and database usage, particularly for low-budget shared hosting. I may be able to look at it this weekend.


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

Offline

#38 2011-03-04 20:46:34

mrdale
Moderator
From: Walla Walla
Registered: 2004-11-19
Posts: 2,053
Website

Re: soo_article_filter: additional control over article lists

wow, just came aross this plugin which would have been a good fit for a dilemma I just solved. jsoo: Off the top of your head can you think of a way to attack the challenge of grouping articles into one issue for the purposes of a newsletter?

Offline

#39 2011-04-29 22:10:17

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 1,898
Website

Re: soo_article_filter: additional control over article lists

Jeff, in the docs you show that it’s possible to search for all articles where a custom field includes a string with soo_article_filter:

<txp:soo_article_filter my-custom-field="blue">
<txp:article />
</txp:soo_article_filter>

… or even without it:

<txp:article_custom my-custom-field="%blue%" />

… noting that this will also match “Blues” or “true blue”, etc. That’s great for extracting a value from one of several values in a custom field, for example when it’s a comma-separated list.

But what if the custom_field contains some combination of the following as a comma-separated list: janet,fred,jo,jane,john? An article_custom or soo_article_filter for “jane” will also find all articles with “janet”, similarly filtering against “jo” will also find all those with “john”.
Another typical situation might be a custom field containing 1,3,23,31,52 where the problem is even more extreme: filtering against “3” also gives you those articles with “23” and “31” in the custom_field.

Is it possible to use soo_article_filter to make it more exacting? I have a feeling the where attribute could help, but how could I make it find an explicit value in a series of comma-separated items in a custom_field? Any pointers much appreciated.


TXP Builders – finely-crafted code, design and txp

Offline

#40 2011-04-30 00:15:44

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

Re: soo_article_filter: additional control over article lists

jakob wrote:

JBut what if the custom_field contains some combination of the following as a comma-separated list: janet,fred,jo,jane,john? An article_custom or soo_article_filter for “jane” will also find all articles with “janet”, similarly filtering against “jo” will also find all those with “john”.

Not quite. On custom fields, soo_article_filter uses the MySQL REGEXP operator; article_custom uses the MySQL LIKE operator. So, in your example, using “jane” as the attribute value, soo_article_filter will indeed match “janet”, but article_custom will not (unless you add the wildcard character).

However, matching exact values in a comma-separated list is a different problem. You can solve that using the MySQL regex word boundary markers: [[:<:]] for the start of a word, and [[:>:]] for the end of a word. So, e.g.,

soo_article_filter some_custom_field="[[:<]]jane[[:>:]]"

would match “jane” but not “janet” in a comma-separated list.

soo_article_filter some_custom_field="jane[[:>:]]"

would match “maryjane” and “jane”, but still not “janet”.


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

Offline

Board footer

Powered by FluxBB