Warning: rand() expects parameter 2 to be long...
slowmail
Joined: 2002-09-13
Posts: 4 |
Posted: Thu, 2003-04-03 15:25 |
Could anyone shed some light why I'm seeing this error? Warning: rand() expects parameter 2 to be long, string given in /home/user/lib/gallery-1.3.3/block-random.php on line 138 http://photos.mydomain.com/block-random.php showed a random image ONCE, and now it gives me that error. Advice anyone? No idea if it's revelant, but: subdomain photos resolves under /public_html/photos Everything else works well. *scratch head* |
|
Posts: 40
Thats exactly what i get as well... and i dont know why either... (im running standalone)
Posts: 1
I get the exact same thing. Showed a picture once, then got that error. Does anyone have any info on this? I'm running it as a stand alone. I have messages boards, etc, but I'm not trying to embed anything. I just want a random photo on my homepage. Thanks :smile:
Posts: 45
I get the same error.
and this appeared after we upgraded php from 4.1.2 to 4.3.1 (also apache2 and mysql4, but I dun think that should have anything to do with gallery)
Could the new version of php be the problem?
I will look into the random file and see if changing the rand() function will help..
Posts: 45
I think I fixed it.
I am not sure, but it seems it could be a bug in php 4.3.1 (and maybe other earlier version, I dunno...) that was not aparent in php 4.1.2
I put in this at line 141:
$count = floatval($count);
in front of:
$choose = rand(1, $count);
That seems to solve the problem (makes sure the count variable is a float variable, witch is what php complains about)
Posts: 3
:wink:
thanks, this fixed my problem
php 4.32
gallery 1.4.1
block-NG-RandomImproved
Posts: 4
"The gift that keeps on giving" It fixed my problem too with gallery 1.4.1 running on phpnuke 6.9
Posts: 5
Thank you thank you thank you!!
This is just the fix I needed!