Welcome to Geeklog, Anonymous Monday, December 09 2024 @ 07:18 am EST

Geeklog Forums

New - Gallery Random Photo Block

Page navigation


ken

Anonymous
Try this

I think it is covered in the fourth one. You might have warnings turned off, so you don't see the warning about the rand() function. Look for this line just a little before line 98:

$choose = rand(1, $count);

And change it to:

$choose = rand(1, intval($count));

Hope that helps.
 Quote

Status: offline

squatty

Forum User
Full Member
Registered: 01/21/02
Posts: 269
Still getting the same warning message both on the browser and in the Apache error.log: Warning: Invalid argument supplied for foreach() in /usr/products/apache/htdocs/public_html/block-random.php on line 98 I have my php.ini error reporting set to error_reporting = E_ALL I also made the update to the block-random.php file: //$choose = rand(1, $count); $choose = rand(1, intval($count)); The block displays "No photo chosen." Any other ideas?
In a world without walls and fences, who needs Windows and Gates?
 Quote

ken

Anonymous
Check the path to your albums... my guess is that the $count variable is null, so it can't do the foreach. That would also explain why your cache file is empty.
 Quote

Status: offline

47ronin

Forum User
Newbie
Registered: 07/25/02
Posts: 6
I'm on Mac OS X Jaguar, using mySQL 3.23.51 and PHP 4.2.3 ... Geeklog version 1.3.5, Apache 1.3.26.. Everything worked fine with PHP 4.1.2, but with the upgrade to 4.2.3 the index.php page is broken with... Warning: extract() expects first argument to be an array in /Volumes/Taki/Projects_Web/gallery/init.php on line 60 Warning: extract() expects first argument to be an array in /Volumes/Taki/Projects_Web/gallery/init.php on line 61 Warning: extract() expects first argument to be an array in /Volumes/Taki/Projects_Web/gallery/init.php on line 62 Warning: Invalid argument supplied for foreach() in /Volumes/Taki/Projects_Web/gallery/init.php on line 64 Warning: rand() expects parameter 2 to be long, string given in /Volumes/Taki/Projects_Web/geeklog/public_html/block-random.php on line 70 ERROR: requested index [] out of bounds [12] Fatal error: Call to a member function on a non-object in /Volumes/Taki/Projects_Web/gallery/classes/Album.php on line 570 I'm not sure how to fix this for now except to manually disable the block. Any ideas? Fix for new PHP?
 Quote

Page navigation

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