[wp-hackers] Search plugin and problem with paged searches in WP 2.1

Alex Günsche ag.ml2007 at zirona.com
Mon Feb 19 16:48:57 GMT 2007

Hello everybody,

I maintain the plugin AdvancedSearch which provides a boolean search and
a couple of other features. I now have a really heavy problem with
WordPress 2.1 and paged search results. (You'll find the main file of
latest release at http://pastebin.ca/363672 and the entire plugin at

The plugin was first designed for WP 2.0.x and it inserts an own SQL
query via the posts_request filter. In WP 2.0.x, I could simply set the
range of post to fetch from the db with LIMIT (the LIMIT being
calculated from $wp_query->query_vars['paged'] and the results per page
entered by the user). Paged searches worked perfectly, although I have
to admit that I don't know how WordPress determined if there were more
posts before or after. Now, in WP 2.1, this doesn't work anymore; it
either doesn't display the before/after links anymore, or it always
loops on the same page.

I'm totally stuck and I would really apprechiate if somebody had an idea
on what I would have to change or where I have to search in order to get
the paged comments working in WP 2.1 again. The relevant parts for the
query construction are in the function ctas_queryfilter, ll. 375-501,
the actual query is in ll. 465-497. I'm thankful for any hint; if
something isn't clear, I'll be glad to answer any questions.

Best regards,

Alex Günsche, Zirona OpenSource-Consulting
work: http://www.zirona.com/ | leisure: http://www.roggenrohl.net
PubKey for this address: http://www.zirona.com/misc/ag.ml2007.asc

More information about the wp-hackers mailing list