Automatic Sort
Status: Alpha
Brought to you by:
stecy
Is there a way to automatically sort the data in
ascending or descending order the instant the data is
viewed? I mean, without having to click on the heading
names to sort the data.
What links may I need to change to make it work?
Thanks for your help!
Tom
Logged In: NO
This is ghetto, but it seems to work:
diff entry.php entry.php.orig
83,88d82
< // BEGIN MY EDITS
<
< // get information
< $item = get_items($categoryid);
< $col = get_cols($categoryid);
<
91,92c85
< list($by, $column) = each ($col);
< $queryorderby = "colid".str_prepare($by);
---
> $queryorderby = "itemid";
106,107c99,102
< // END MY EDITS
<
---
> // get information
> $item = get_items($categoryid);
> $col = get_cols($categoryid);
>
Logged In: NO
The last snippet does not work. Forgive me, but I'm just
starting to learn php tonight while reviewing the author's
code. This one seems to work though.
diff entry.php entry.php.orig
83,88d82
< // BEGIN MY EDITS
<
< // get information
< $item = get_items($categoryid);
< $col = get_cols($categoryid);
<
91c85
< $queryorderby = "colid".key($col);
---
> $queryorderby = "itemid";
105,106c99,102
< // END MY EDITS
<
---
> // get information
> $item = get_items($categoryid);
> $col = get_cols($categoryid);
>
Logged In: NO
Bah, the last one does not work correctly.
diff entry.php entry.php.orig
83,88d82
< // BEGIN MY EDITS
<
< // get information
< $item = get_items($categoryid);
< $col = get_cols($categoryid);
<
91c85
< $queryorderby = "colid".key($col);
---
> $queryorderby = "itemid";
105,106c99,102
< // END MY EDITS
<
---
> // get information
> $item = get_items($categoryid);
> $col = get_cols($categoryid);
>