Jump to content

Random Database Record (Button)


LukasGr.

Recommended Posts

Hi guys, 

I created a Video Database on our site where everyone is allowed to submit a youtube video. Thus, a lot of database records (a database record is only a youtube video) are stored after a while. So far so good. 

We want to allow our guests to brows through the whole database and get entertained by the videos provided.
(1.) Now comes the part where I need your help: Is there a way to create a button letting users jump to a random database record (video)? I thought about a php way with counting the items stored in the database and select a random number out of the count as the ID. But this won't work cause of every ID is unique and after deleting a post the video won't appear anymore but the ID is still assigned. (I hope you know what I mean)

So, is there a way with IPS varibles to select 1 active random database record??

(2.) Furthermore, can we add a random standard sorting of the database records (those settings can be found in the database settings in the ACP)?

Sorting.thumb.png.35ed47abe2c96845d2745c

Link to comment
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...