Welcome to Geeklog, Anonymous Tuesday, April 22 2025 @ 07:33 pm EDT
Geeklog Forums
Errors
Sinjin
Anonymous
I have taken everyones advice on the gallery install and it is now up and working great. The only thing is that on the random picture block I get errors every few times. The more pictures I put in the longer it takes to appear. This is the error i am getting.
Warning: mt_rand(): Invalid range: 1..0 in /usr/local/httpd/htdocs/system/lib-custom.php on line 169
Can some help me. Thanks.
PS Gallery is having a vote on their website on the next blog they should intergrate. Everyone should go and vote for Geeklog.
11
11
Quote
Status: offline
efarmboy
Forum User
Moderator
Registered: 02/26/02
Posts: 147
I believe this error is cause by an empty album. This problem was noted by Tony when he posted the modified code to work with the Gallery Albums.
I implemented the code just earlier this week and saw the same thing. I posted a quick fix that worked for me. See the post here
I also modified the album search to not include certain albums (such as music or other media) as all albums will be included in the search and random routines. I really like this additional feature to the solution.
Cheers,
Blaine
7
13
Quote
Sinjin
Anonymous
I used your code to replace the section in Tony's code.
When I do that my whole gallery quits working. Am I
suppose to replace or put the code in a different place.
Thanks for all your help.
Matthew
11
8
Quote
Status: offline
efarmboy
Forum User
Moderator
Registered: 02/26/02
Posts: 147
My posting shows the changes I made to Tony's phpblock_random_files function. I've basically added an if stmt around the mt_stand function call. So, the function is not called if there is only one image (really just the album). If so, I set the index to 1 which is a valid at this point.
Blaine
13
11
Quote
Sinjin
Anonymous
Can you possible show the code of your lib-
custom.php file. I would like to se your random block
code. I have check mine and it looks right but I am still
getting errors with no empty albums.
I would also like to skip the files that are not jpg files
because I do have some .mov files loaded now.
Matthew
10
10
Quote
All times are EDT. The time is now 07:33 pm.
- 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