Posted on: 03/22/02 01:44pm
By: Anonymous (Sinjin)
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.
mtrand function error
Posted on: 03/23/02 09:03am
By: efarmboy
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[*1]
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
mtrand function error
Posted on: 03/23/02 11:36am
By: Anonymous (Sinjin)
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
mtrand function error
Posted on: 03/23/02 11:55am
By: efarmboy
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
Errors Gallery
Posted on: 03/24/02 02:20pm
By: Anonymous (Sinjin)
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
My lib-custom.php changes
Posted on: 03/25/02 08:23pm
By: efarmboy
You can see my lib-custom.php file functions for the random photo with gallery integration
here[*2]
You also need to define the variables $gallery_url and $path_gallery_albums in the geeklog config.php file
Blaine