Rotator script

Hi everyone, i’m new here and would like to ask some advice!

I want to create a jv mini giveaway page, so say 4 rows with 3 columns to display the gift image, brief description and a link to the download page. But I want the gifts to rotate so each have a fair share of views on the top row. Is there a script that could help me with that? Each person will have their own unique trackable link to their own webpage.

Thanks

Craig

Each person will have their own unique trackable link to their own webpage

Not sure of what the relevance of this is???

Maybe not exactly what you’re asking for, but this code would give you random values on page load for each table row:


$text = array('Gift one','Gift two','Gift three','Gift four','Gift five');
shuffle($text);
echo '
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>


<table>
<tbody>
<tr>
<td>1</td><td>'.array_pop($text).'</td>
</tr>
<tr>
<td>2</td><td>'.array_pop($text).'</td>
</tr>
<tr>
<td>3</td><td>'.array_pop($text).'</td>
</tr>
<tr>
<td>4</td><td>'.array_pop($text).'</td>
</tr>
<tr>
<td>5</td><td>'.array_pop($text).'</td>
</tr>
</tbody>
</table>

    </body>
</html>

';

shuffle is probably the best way to do it without database interaction;

If you want to ensure that they’ve all been displayed equally, you’ll need to track how many times they’ve been top-row.
Insert a counter field into your table, alter your select query to pull the lowest number of the count first, and add an update to increment the count for the top rows.