Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Next Button Conundrum
Old 06-16-2004, 08:14 PM Next Button Conundrum
milomedia's Avatar
Super Talker

Posts: 133
Location: durango, colorado
Trades: 0
Hey i kinda posted this before, someone posted back saying they'd PM me and never did, so the thread died. Anyway..

I had a database of pictures - they're for touring a property on a real estate site

the pictures get uploaded in records which contain 5 pictures, so i have id,groupname,file1,file2,file3,file4,file5,propert yid

so then i query saying give me all the results where propertyid = $this

so.... I get "living room" followed by 5 thumbnails, then "bathroom" followed by 5 thumbnails etc. When you click on the thumbnails the main image changes.

My question is: how can i make previous and next buttons for something like this, basically it will have to first get the record, then move through the files 1-5 and then next record. I want the user interface to be seemless to the user just clicks next next next and it will gop through the pictures in order.


thanks!
__________________
_______________________________
Feeling down? listen to
Please login or register to view this content. Registration is FREE
milomedia is offline
Reply With Quote
View Public Profile Visit milomedia's homepage!
 
 
Register now for full access!
Old 06-16-2004, 08:29 PM
Experienced Talker

Posts: 31
Trades: 0
Quote:
so.... I get "living room" followed by 5 thumbnails, then "bathroom" followed by 5 thumbnails etc. When you click on the thumbnails the main image changes.
This will require JavaScript.

Quote:
My question is: how can i make previous and next buttons for something like this, basically it will have to first get the record, then move through the files 1-5 and then next record. I want the user interface to be seemless to the user just clicks next next next and it will gop through the pictures in order.
I don't quite get what you're trying to do right here, please try to explain better.
yaoherm50 is offline
Reply With Quote
View Public Profile
 
Old 06-21-2004, 01:45 PM
milomedia's Avatar
Super Talker

Posts: 133
Location: durango, colorado
Trades: 0
right... I already got the javascript in there working. Basically what i'm trying to do is easily navigate through all the pictures with "next" and "previous" buttons. The problem being, instead of one picture per record (row) I have 5 pictures per row. So, let's say I run a query asking for all the slideshow records which belong to a certain property. This will load a row like "bedroom" which contains 5 image columns, then a row called "bathroom" that also contains 5 image columns. So, I'm trying to get a next button that will just go through all the pictures. I'm guessing that I need to make some sort of array containing each filename and have the button move through the array. The only problem is: i have no idea how to do this.
__________________
_______________________________
Feeling down? listen to
Please login or register to view this content. Registration is FREE
milomedia is offline
Reply With Quote
View Public Profile Visit milomedia's homepage!
 
Old 06-21-2004, 02:19 PM
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
Trades: 0
milomedia,

Are you indicating that you don't mind if the screen refreshes after hitting 'Next?' If that's the case, then you can do the initial pull to identify which primary keys are the photos you wish to display. You could either store that in the session or you could POST it from screen to screen using an <input type="hidden"> field. Then use your 'Next' and 'Previous' buttons to keep track which of those images you are currently displaying. So let's say your list of images to display for the bedroom are 455,456,461,467,475 (primary keys out of your image table).

Then your URL could look something like this:

displayPicture?list=455,456,461,467,475&displaying =456

Here, your logic would pick apart the list and see that you have 5 images to display and that you are currently displaying the 2nd in a series of 5. From that, you could derive the logic to display or not to display the next/previous buttons (e.g., if you were displaying 455, then no previous button).

Is this close to what you are asking for?

Sorry, I'm not in a place where I can write and test code right now, but let me know how this satisfies your problem.
__________________
—Kyrnt
Kyrnt is offline
Reply With Quote
View Public Profile Visit Kyrnt's homepage!
 
Old 06-21-2004, 02:53 PM
milomedia's Avatar
Super Talker

Posts: 133
Location: durango, colorado
Trades: 0
oh sweet, thanks! That seems like it'll work. I'll let you know after I try to implement this. Thanks again.
-e
__________________
_______________________________
Feeling down? listen to
Please login or register to view this content. Registration is FREE
milomedia is offline
Reply With Quote
View Public Profile Visit milomedia's homepage!
 
Old 07-06-2004, 05:57 PM
milomedia's Avatar
Super Talker

Posts: 133
Location: durango, colorado
Trades: 0
Ok so i wasn't having much luck with the above way, so i did this,

I collected all of the filename for all of the pictures for any given tour and put them in an array falled $filenames, so to display the main picture i use $filenames[0] as the source.

So now for the next button i just need to do filenames[1] etc etc etc.. However, because I'm not reloading the page (because the picture changes via javascript) I really have no way of buming up the array each time the page loads.

So now the conundrum is trying to get a next button that changes value each time it is clicked.

Think I'm barking up the right tree?
__________________
_______________________________
Feeling down? listen to
Please login or register to view this content. Registration is FREE
milomedia is offline
Reply With Quote
View Public Profile Visit milomedia's homepage!
 
Old 07-06-2004, 09:25 PM
milomedia's Avatar
Super Talker

Posts: 133
Location: durango, colorado
Trades: 0
hey heya, btw I got this to work... not EXACTLY how I wanted, but it works! Case closed, thanks to all you guys who put in in put
__________________
_______________________________
Feeling down? listen to
Please login or register to view this content. Registration is FREE
milomedia is offline
Reply With Quote
View Public Profile Visit milomedia's homepage!
 
Old 07-07-2004, 12:17 PM
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
Trades: 0
milo,

I'm glad to hear that you finally reached a resolution. WHEW! At the end of the day, it's nice to get things done, isn't it?
__________________
—Kyrnt
Kyrnt is offline
Reply With Quote
View Public Profile Visit Kyrnt's homepage!
 
Old 07-07-2004, 02:53 PM
milomedia's Avatar
Super Talker

Posts: 133
Location: durango, colorado
Trades: 0
if the day ever ends, lol.

thanks again
__________________
_______________________________
Feeling down? listen to
Please login or register to view this content. Registration is FREE
milomedia is offline
Reply With Quote
View Public Profile Visit milomedia's homepage!
 
Reply     « Reply to Next Button Conundrum
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.32997 seconds with 12 queries