Welcome Guest, Not a member yet? Register   Sign In
prev/next using session & conditional query
#1

[eluser]romero619[/eluser]
Hi,
Im trying to setup a 'photogallery browsing' page that has the following requirements:
- allows the user to enter search/filter criteria & display a paginated subset of the entire gallery
- the search results are displayed in a tiled set of thumbnail images
- clicking a thumbnail redirects the user to a separate 'photo_view' page, where a full-sized version of the thumbnailed image can be seen

- the user must be able to navigate the filtered result set by:
a) clicking the paginated navigation links on the main browsing page(s)
(example: "<< 1 2 3 4 5 6 >>")
b) clicking a "prev" or "next" button on the "photo_view" page, which should lead the user to the previous/next photo in the filtered result set...

here's an existing gallery that serves as a working example:
http://magicseaweed.com/photoLab/browsePhotos.php

requirement 'a' above is easy;
I have no problem creating a filtered sql query (using a 'where' clause), paginating the results, and creating the paginated navigation links...

my problem is requirement 'b';
I dont know how to keep track of the user's previous filter/search criteria in order to create the 'prev'/'next' buttons on the 'photo_view' sub-page(s).
As seen in the example page that I provided above, once the user exits the main browsing page by clicking a thumbnail and being redirected to the 'view_photo' page, it seems necessary to keep track of the original search query in order to scroll through the result set.

the 'magicseaweed.com' example somehow uses a 'browsing session' that keeps track of the user's position within the resultset & creates the prev/next nav links. The uid for this 'browsing session' variable can be seen in the querystring/urls for the 'prev/next' links on the full-sized photo sub-pages...
example:
-here's a 'next' button url from the 'photo_view' subpage
(link which leads to next image in filtered resultset)
http://magicseaweed.com/photoLab/viewPho...d9eca221de


I desperately need help figuring out how to set something like this up...
Im guessing this would require somehow creating a separate php session (specifically for use in browsing/searching the gallery), and storing the search results in mysql.
however, Im not sure if this is the right way to go, and I need advice on how to set this up in the most efficient way possible.

sorry if my description was confusing; please let me know if I should clarify something...
please help, thanks...


Messages In This Thread
prev/next using session & conditional query - by El Forum - 11-09-2009, 11:57 PM
prev/next using session & conditional query - by El Forum - 11-10-2009, 01:30 AM
prev/next using session & conditional query - by El Forum - 11-15-2009, 03:46 PM
prev/next using session & conditional query - by El Forum - 11-15-2009, 05:03 PM



Theme © iAndrew 2016 - Forum software by © MyBB