coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: FTK on December 08, 2005, 03:23:00 PM

Title: Warning: implode(): Bad arguments
Post by: FTK on December 08, 2005, 03:23:00 PM
anyone ....
I've never had any problems with Coppermine Photo mgmt even till yesterday
a user uploaded 2 times some files.

click on
http://tweelijners.com/gallery/displayimage.php?album=lastup&cat=0&pos=4
Everithing works but on top of the coppermine Gallery
I get
Warning: implode(): Bad arguments. in /home/janwal/public_html/gallery/displayimage.php on line 334
Warning: implode(): Bad arguments. in /home/janwal/public_html/gallery/displayimage.php on line 336

Anyone any idea how this can be solved & how did this error occured after upload?

strange thing is that other uploads work correctly
regards,
J
Title: Re: Warning: implode(): Bad arguments
Post by: kegobeer on December 08, 2005, 04:12:59 PM
Turn off debug notices in your config settings.
Title: Re: Warning: implode(): Bad arguments
Post by: FTK on December 08, 2005, 04:30:54 PM
thx, I looked it up but debug notices are off
If I turn them on its even worse! I get approx one page of errors
so something is very wrong .....
Title: Re: Warning: implode(): Bad arguments
Post by: kegobeer on December 08, 2005, 04:45:11 PM
Did your host upgrade PHP?  Ask them if they've done anything lately.
Title: Re: Warning: implode(): Bad arguments
Post by: FTK on December 09, 2005, 07:44:25 AM
nothing, host provides automated upgrades (patches)
user has the ability to implemented them as needed/wanted
last upgrade was from 1.3.4 => 1.3.5 a while ago
Title: Re: Warning: implode(): Bad arguments
Post by: Joachim Müller on December 09, 2005, 08:02:02 AM
not coppermine updates, but php updates!
Title: Re: Warning: implode(): Bad arguments
Post by: FTK on December 09, 2005, 08:07:22 AM
checked, non last 1/2 year still php 4.4.0

this is rather new for me, I'm using coppermine sinds end of 2004
Q: I just took a full backup of my website including a seperate one from the mysql DB
suppose I remove everithing, then reinstall coppermine from scratch, then restor
mysql db would everithing work then ok? Is it worth a try?
Title: Re: Warning: implode(): Bad arguments
Post by: Joachim Müller on December 09, 2005, 11:30:15 AM
no, what should this be good for?
Title: Re: Warning: implode(): Bad arguments
Post by: Nibbler on December 09, 2005, 12:09:29 PM
Find the lines it talks about in the file and add an @ just before the word implode on each line.
Title: Re: Warning: implode(): Bad arguments
Post by: Abbas Ali on December 09, 2005, 12:28:38 PM
Edit displayimage.php

Replace (line 134)

if (isset($iptc['Keywords'])) $info[$lang_picinfo['iptcKeywords']] = trim(implode(" ",$iptc['Keywords']));


with

if (isset($iptc['Keywords']) && is_array($iptc['Keywords'])) $info[$lang_picinfo['iptcKeywords']] = trim(implode(" ",$iptc['Keywords']));


and Replace (line 336)

if (isset($iptc['SubCategories'])) $info[$lang_picinfo['iptcSubCategories']] = trim(implode(" ",$iptc['SubCategories']));


with

if (isset($iptc['SubCategories']) && is_array($iptc['SubCategories'])) $info[$lang_picinfo['iptcSubCategories']] = trim(implode(" ",$iptc['SubCategories']));


This should stop showing the above mentioned warninings.


Abbas

[edit]
Removed the parse error.
[/edit]
Title: Re: Warning: implode(): Bad arguments
Post by: FTK on December 10, 2005, 09:36:39 AM
dear all,
solution of abbas gives

Parse error: parse error, unexpected T_VARIABLE in /home/janwal/public_html/gallery/displayimage.php on line 334

altough solution of Nibbler (adding the @ befor the implode works perfectly

a question remains (out of curiosity & to understand better)
what caused the errors in the first place .... ?
Title: Re: Warning: implode(): Bad arguments
Post by: Abbas Ali on December 10, 2005, 09:53:13 AM
Oops, missed one ")" in the code. Modified the code above.

The warnings were coming because of IPTC data of image.
Title: Re: Warning: implode(): Bad arguments
Post by: FTK on December 10, 2005, 12:05:03 PM
indeed works too now
I just looked up IPTC Data,
(http://www.breezesys.com/BreezeBrowser/help/iptc.htm)
I understand why the error occured now
in a way can be seen as a kind of small bug ....
-Case closed-
Many thx!!!