Page 1 of 1

Sort data from db in plugin

Posted: Wed May 04, 2005 11:06 am
by Chris
Dear all,

I have made this plugin which fatches all data from a db. It is displayed descending one row. I would like to give the user the ability to change this by clicking on a link. Here comes my question, how do I pass through the sort variable ? I can't just use blabla.php?sort=asc, or can I, and how ????

Thanks in advance,

Chris

Re: Sort data from db in plugin

Posted: Wed May 04, 2005 4:51 pm
by Chris
Is the description fuzzy or doesn't anyone know the sollution ?

Re: Sort data from db in plugin

Posted: Wed May 04, 2005 6:28 pm
by Ted
Well, the easiest solution to do it with a plugin is have the URL constructed with something like (assuming mod_rewrite isn't in effect):

Code: Select all

$url = $_SERVER['PHP_SELF'] . '&sort=asc';
and then have the plugin check for that

Code: Select all

$sort = 'asc';
if (isset($_GET['sort']))
{
$sort = $_GET['sort'];
}
However, it's probably easier to write a module to do these things, since the navigation stuff "just works".