Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Search multiple IDs in list pages
Since TXP4.0.7 is gearing up to be The Release of Lists, would it be possible to amend one line in each of txp_list, txp_file, txp_link and txp_image such that comma-separated lists of IDs can be returned?
That is, replace this:
'id' => "ID = '$crit_escaped'",
with:
'id' => "ID IN (" .join(",", doArray(do_list($crit_escaped), 'doQuote')). ")",
so that other pages could call the 4 list pages to show particular items? Or, of course, so people could type more than one ID in the search box if they wished.
Last edited by Bloke (2008-06-29 23:34:07)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Search multiple IDs in list pages
Just remembered this thread and noticed the code is a bit wordy, sorry. To save a function call:
'id' => "ID IN (" .doQuote(join("','", do_list($crit_escaped))). ")",
or even leaner still:
'id' => "ID IN ('" .join("','", do_list($crit_escaped)). "')",
?
If 4.0.7 is in lockdown or this impacts other stuff I’ve not thought of, or something like this is not likely to make it into the core at any point in future, would you please let me know so I can try to find some other way of listing specific items in the list pages from my plugin.
Many thanks in advance.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Search multiple IDs in list pages
Offline
Re: Search multiple IDs in list pages
Game on! Thank you very much, kind sir.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline