Welcome to Geeklog Thursday, December 05 2019 @ 09:46 pm EST

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.
 Quote

Status: offline

efarmboy

Forum User
Full Member
Registered: 26/02/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

 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
 Quote

Status: offline

efarmboy

Forum User
Full Member
Registered: 26/02/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

 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
 Quote

Status: offline

efarmboy

Forum User
Full Member
Registered: 26/02/02
Posts: 147
You can see my lib-custom.php file functions for the random photo with gallery integration here

You also need to define the variables $gallery_url and $path_gallery_albums in the geeklog config.php file

Blaine

 Quote

All times are EST. The time is now 09:46 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