thibaud-rohmer / PhotoShow

A free web gallery in PHP with drag-n-drop support
http://www.photoshow-gallery.com
506 stars 152 forks source link

Foreach Error #108

Open Brouno opened 12 years ago

Brouno commented 12 years ago

I get a foreach error in Judge.php. Error is : Warning: Invalid argument supplied for foreach() in /mnt/136/sda/2/8//photoshow/src/classes/Judge.php on line 183

I'm unable to see how ... The website is a mutual one, on a french provider : free.fr

I made the test on a simple one with one dir and few pics.

Folders are : /photoshow /photos /temp

Config.php is :

$config->photos_dir = "/mnt/136/sda/2/8//photos"; $config->ps_generated = "/mnt/136/sda/2/8//temp";

An idea ?

Thank you. Brouno

thibaud-rohmer commented 12 years ago

Hi,

For your website to work on a Free server, i'd suggest using relative path instead :

$config->photos_dir = "../photos"; $config->ps_generated = "../temp";

(for instance).

Hope it helps... :)

Brouno commented 12 years ago

Thanks for the suggestion, but ...

I get the same error with relative path :-(

You can see it here : http://brunogallerie.free.fr/PhotoShow User/pwd : azerty/azerty

ghost commented 12 years ago

I have the same problem... Has anyone found a solution?

gadget-du-27 commented 12 years ago

I think that the problem is the version of php under version 5.0

ghost commented 12 years ago

I have the version 5.2.17...

That's not a good solution, but I just added "error_reporting(0);" in the "Judge.php" file. Now there is no error message and the photo gallery work pefectly!

synolis commented 12 years ago

Hello, same error here in class Judge.php, I think the problem comes from the repetition of "/".

Echo on $rightsdir (line 180 of Judge.php) says : "/mnt/.../photos_generated/Thumbs//tests"

with "photos_generated" as my directory configured in $config->ps_generated and "tests" my album name.

Brouno commented 12 years ago

Reido > thx for the workaround :-)

saillmone commented 12 years ago

Et en un peu plus propre :

if(!empty($rightsfiles)){ foreach($rightsfiles as $rf){ ... } }

withadancenumber commented 11 years ago

Thanks for the fix Reido.

chrysalysm commented 11 years ago

Thanks for the fix BoboTiG. I didn't want to use "error_reporting(0);" as that just hides the error, but your commit seems to have fixed the issue for now.

jujumanue commented 11 years ago

Hi guys, I just downloadede photoshow and had to correct judge.php by myself. The saillmone comment fixes the issue. Thanks for the job !