Welcome to Geeklog, Anonymous Thursday, April 25 2024 @ 03:13 am EDT

Geeklog Forums

Help with Gallery Random Block


phanprod

Anonymous
I'm usually pretty good with figuring these things out on my own... but I'm getting this error: Warning: mt_rand(): Invalid range: 1..1 in /lib-common.php on line 2710 And the code for the area in question: // Randomly select an album from the array mt_srand((double)microtime()*1000000); $indexr = (mt_rand(1, count($albums))); $rand_album = $albums[$indexr]; What should I do?
 Quote

Status: offline

dreamscape

Forum User
Junior
Registered: 01/22/02
Posts: 30
Author: phanprod
Dated: Monday, May 20 2002 @ 04:17 AM PDT
Viewed: 2 times Edit
I'm usually pretty good with figuring these things out on
my own... but I'm getting this error:

Warning: mt_rand(): Invalid range: 1..1 in /lib-common.php
on line 2710


And the code for the area in question:

// Randomly select an album from the array
mt_srand((double)microtime()*1000000);
$indexr = (mt_rand(1, count($albums)));
$rand_album = $albums[$indexr];

What should I do?

First, I'd check count($albums) and see if that is

I remember seeing a snippet of code that did this, search for gallery

 Quote

All times are EDT. The time is now 03:13 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content