Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
List display problem

 

 


kkegans
User

Jul 8, 2008, 4:23 PM

Post #1 of 8 (513 views)
Shortcut
List display problem Can't Post

I am generating a list using RAND() as the order by on the sorting page and using VIEWER OPTIONS set to show 10 records per page with prev & next page links.

The problem I have is that every time the PREV or NEXT links are used, the order changes in the LIST RESULTS, consequently the same item will appear on more than one page of the list. I know I probable have something screwed up, but can't see what it is. Any suggestions?



Kurt


Donna
Staff / Moderator


Jul 8, 2008, 4:59 PM

Post #2 of 8 (509 views)
Shortcut
Re: [kkegans] List display problem [In reply to] Can't Post

Hi Kurt!

Well, that's actually working as intended -- random means just that: Every time the list is generated, it's going to pull in random listings, so some of those might be duplicated.

Can you let me know what the intended result is? Maybe we can come up with a different way of setting it up. :)

Donna


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.


kkegans
User

Jul 8, 2008, 5:29 PM

Post #3 of 8 (508 views)
Shortcut
Re: [Donna] List display problem [In reply to] Can't Post

Donna,

I would expect the list to be generated differently each time it was generated, but I would not expect the list to be regenerated every time the user moves from the first page of a partial list to the next.



If the list generated theses results: D,R,H,E,B,U,M,W,X,U,Z,Q,Y,P,C,T,X,N,I,G,O,... and you were only displaying 5 record, the PREV , Page 1 of 3 NEXT, I would expect this:

D,R,H,E,B prev - next

U,M,W,X,U prev - next

Z,Q,Y,P,C prev - next

T,X,N,I,G prev - next

NOT THIS:

D,R,H,E,B prev - next

R,M,Z,D,C prev - next

Z,D,X,T,B prev - next

Z,M,D,R,B prev - next

That does not represent PREVIOUS and NEXT, but a NEW LIST comprising a completely new random order after each PREV or NEXT is selected.

I expect the next page to be a continuation of the original list until the list end is reached, and the previous page to repeat exactly the ordered items on the preceding page.



Kurt


Dave
Staff / Moderator


Jul 8, 2008, 5:39 PM

Post #4 of 8 (505 views)
Shortcut
Re: [kkegans] List display problem [In reply to] Can't Post

Hi Kurt,

The RAND() function is actually from MySQL, so we don't have any control over how it works. It's not really meant to work with prev/next pages.

To show multiple pages of random records in the same order you'd need to store the sequence information somewhere. You'd either need to update the random order at set intervals and store that or store it on a per user basis.

It can get pretty complicated pretty fast and require some custom PHP/MySQL. Another way you could do is print the entire list on one page and use javascript to only show some records and page through them. But that would require some javascript.

Sorry there's no straightforward way to do what you want. If I can think of any other solutions I'll post.

Dave Edis - Senior Developer
interactivetools.com


kkegans
User

Jul 8, 2008, 6:03 PM

Post #5 of 8 (501 views)
Shortcut
Re: [Dave] List display problem [In reply to] Can't Post

Dave and Donna,

That could really be a show stopper! For any type of sales listing, Auto, Homes, etc, especially where there will potentially be a few hundred record, generating the complete page and then parsing the results with java script to display a true NEXT/PREVIOUS wolud be pretty futile.

Is there any way to store the ordered list of results (INDEX), by user, in a server side file keyed to the user session or a session variable? That would allow the retreival of the next(X) records or previous(X) records to be selected. This would result in a true NEXT PAGE or PREVIOUS PAGE

The file would have to expire after a set period of non-access, like a session id and I guess that could present a problem as a watchdog routine would need to be running all the time to clean up the orphaned indexes.

I know there has to be a solution, as my competition already has their databases working this way.with hundreds of records and many pages of display. Each session maintains the same ordered results, but each session is generated completely differently.


Dave
Staff / Moderator


Jul 8, 2008, 6:15 PM

Post #6 of 8 (499 views)
Shortcut
Re: [kkegans] List display problem [In reply to] Can't Post

Hi Kurt,

It's all possible, but not supported by default in CMS Builder. Can you post some links of other sites that work like this and let me know so more details about what you're trying to do? You can email me directly at dave@interactivetools.com if it's confidential.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com


kkegans
User

Jul 8, 2008, 6:42 PM

Post #7 of 8 (493 views)
Shortcut
Re: [Dave] List display problem [In reply to] Can't Post

Dave,



I dove into the source of the pages I emailed you and it looks like you were right on. They seem to be outputting the entire results list and then parsing the pages using some Java Script.......


Dave
Staff / Moderator


Jul 9, 2008, 11:52 PM

Post #8 of 8 (446 views)
Shortcut
Re: [kkegans] List display problem [In reply to] Can't Post

Hi kkegans,

So it sounds like that might be a solution. I know we've been talking about this over email. If you have any other questions about this feel free to post.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4