Re: Pager_Sliding - better way to do this.

From: Date: Thu, 13 Feb 2003 13:02:11 +0000
Subject: Re: Pager_Sliding - better way to do this.
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-13224@lists.php.net to get a copy of this message
At 13/02/2003 19.55 +0800, Alan Knowles wrote:
yeah - I think it's mostly a query string thing - my query may include sort=colname, which is a reversing flag on the sort, being stored in a session, so if it gets included in the url it ends up flipping the sort order on each page view.. - which is why I was trying to override the use of it.
mmm... so basically you have a "sort=colname" option, and if it's set the order of the array gets reversed like this: ------------- Page1 - sort=colname in the querystring => sorted up/down Page2 - sort=colname in the querystring => sorted down/up Page3 - sort=colname in the querystring => sorted up/down ------------- but ------------- Page1 - sort=colname in the querystring => sorted up/down Page2 - sort=colname NOT in the querystring => sorted up/down Page3 - sort=colname NOT in the querystring => sorted up/down ------------- am I right? If yes, you have two options here: 1) add a querystring flag, with "order=alphabetical" or "order=reverse".
    This way, you can keep the "switch" under control and you don't
    have to worry about rewriting the url.
- or - 2) after getting the "sort" switch, and before instantiating a new Pager_Sliding object, you can unset($_GET['sort']), so it's not moved along with the next page.
- the other trouble was the path and fileName appear to get their preceding '/' stripped. so I got stuck both way rounds. :)
er... nope... I stripped leading slash on fileName and trailing slash on path, but I add it afterward if necessary... it's done so you don't get urls with a double slash in the middle: http://www.myserver.com/path//fileName.php Hope this helped... if not, please provide a clear example of what you exactly need: I'm a little dumb, sometimes :D :D Regards, Lorenzo --- [Quipo ISP - Questa E-mail e' stata controllata dal programma Declude Virus] [Quipo ISP - This E-mail was scanned for viruses by Declude Virus]

« previous php.pear.dev (#13224) next »