View previous topic :: View next topic |
Author |
Message |
Cyberian75
Joined: 26 Sep 2002 Posts: 1054 Location: Oregon
|
Posted: Wed Jan 08, 2003 2:49 am Post subject: ascending/descending code |
|
|
I'm trying to implement an ascending/descending feature which users can use to change the order of date of blogs. This doesn't have to remember its value, but I would like it to be functional when $cat and/or $m variables are defined. So far, I have the following:
Code: |
$cq = $HTTP_SERVER_VARS['QUERY_STRING'];
echo '<a href="?'.$cq.'order=ASC">ASC</a>';
echo ' | ';
echo '<a href="?'.$cq.'order=DESC">DESC</a>';
|
This works okay, but the problem is that it keeps adding to the existing variables in the URL. To resolve this, I think I should use preg_replace function, but I'm utterly lost with it.
Also, it should be able to take in variables if they are already defined in the URL, something like what next_posts function does.
Could someone please help me with this? Thanks in advance.  _________________ Michael P. |
|
Back to top |
|
 |
alex_t_king
Joined: 09 Oct 2002 Posts: 194
|
Posted: Wed Jan 08, 2003 4:39 am Post subject: |
|
|
on a per session level (let each visitor set their preferred order?) or on a system level (a setting for the site which controls ascending/descending?)?
If it isn't on a per session/visitor, there is no reason not to just add a var into the config file and reference that - no need to put it in the URL at all. _________________ Yahoo! Messenger ID: alex_t_king |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1054 Location: Oregon
|
Posted: Wed Jan 08, 2003 4:46 am Post subject: |
|
|
I meant on a session level. What I'm trying to do is let the user switch back and forth between ascending and descending orders.
Am I missing something here?
Thanks for replying by the way.  _________________ Michael P. |
|
Back to top |
|
 |
initself
Joined: 09 Apr 2003 Posts: 12
|
Posted: Wed Jul 16, 2003 1:54 am Post subject: Ascending/Descending on a Global Level |
|
|
Michael,
I can't even figure out how to set ascending and descending on a global level. I post to show from oldest to newest, not the other way around. How would you do that?
mb |
|
Back to top |
|
 |
|