Random Entries and pagination…
Posted: 16 August 2006 12:26 PM   [ Ignore ]  
Grad Student
Rank
Total Posts:  31
Joined  06-22-2005

I’m having a problem here and I am not sure how to proceed. I need to have the entries listed randomly without duplicating entries when I paginate. Right now with the following line

{exp:weblog:entries weblog="{master_weblog_name}" orderby="random" sort="desc" limit="4"}

the first four entries are correct but when I click on subsequent pages, enteries from the first set often show up on the next page. Is there any way around this so that no entries are repeated? I have about 100 entries that need to work this way.

Thanks,

Alex

 Signature 

http://italartnet.com

Profile
 
 
Posted: 16 August 2006 12:41 PM   [ Ignore ]   [ # 1 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5958
Joined  08-04-2002

My guess is no as on each page it’s calling four at random so it can just naturally call one of the same ones. The only way I can think that it would work is if it was keeping track of the ones already displayed. Don’t know how to accomplish that though.
Will be interesting to see if the gurus can come up with something but I’ll bet it won’t be simple.

Profile
 
 
Posted: 16 August 2006 12:48 PM   [ Ignore ]   [ # 2 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  14972
Joined  06-03-2002

PXLated is correct, as each page has to run a new query, the “random” bit is going to be repeated.  A customized cache would be the only way I can see to do it, and you would have to have a separate cache for each IP address or it won’t work for each user.  That could induce a lot of strain on a server continually writing database / file caches for each individual person browsing the site.

 Signature 
Profile
MSG
 
 
Posted: 16 August 2006 12:57 PM   [ Ignore ]   [ # 3 ]  
Grad Student
Rank
Total Posts:  31
Joined  06-22-2005

Thanks for the quick responses. I think I will abandon this idea right away!

Kind regards,

Alex

 Signature 

http://italartnet.com

Profile
 
 
   
 
 
‹‹ categories not showing      Huge MySQL error ››
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 10:33 AM
Total Registered Members: 60974 Total Logged-in Users: 22
Total Topics: 73689 Total Anonymous Users: 19
Total Replies: 397493 Total Guests: 455
Total Posts: 471182    
Members ( View Memberlist )