Welcome to Geeklog, Anonymous Sunday, September 01 2024 @ 12:57 am 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.
5
5
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
3
7
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
5
5
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
6
4
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
4
5
Quote
All times are EDT. The time is now 12:57 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