forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: paquets on May 20, 2010, 01:47:15 pm

Title: Problem with "No image to display" with functions.inc.php
Post by: paquets on May 20, 2010, 01:47:15 pm
Hello,
Hope this is the right place to post this and I hope it can help with the development of CPG 1.5

In 1.5, when I searched a non-existant image, it did not give me the "No image to display" anymore. I know this has been discussed and fixed in this thread: http://forum.coppermine-gallery.net/index.php/topic,63939.0.html (http://forum.coppermine-gallery.net/index.php/topic,63939.0.html)

But fort some reason the error message still did not show up. I think I fixed it but I did that by changing a few lines in functions.inc.php that was edited before in revision 6979 from the SVN. Not being a CPG developer nor an experienced programmer, I'm not sure this won't cause other problems, but if it can help development of this great product... here's what I did:

I simply added back in functions.inc.php:
Code: [Select]
default : // Invalid meta album
cpg_die(ERROR, $lang_errors['non_exist_ap']." - $album", __FILE__, __LINE__);

before:
Code: [Select]
} // switch
} // function get_pic_data

And
changed:
Code: [Select]
} elseif (is_numeric($album) || in_array($album, $valid_meta_albums)) {

to:
Code: [Select]
} else {And it seems that the search function is working fine and giving the "No image to display" when supposed to.
Title: Re: Problem with "No image to display" with functions.inc.php
Post by: Αndré on May 20, 2010, 03:25:49 pm
Please describe what you are doing when you expect the error message. And please post a link to your gallery so we can test it on your gallery and on our testbeds.
Title: Re: Problem with "No image to display" with functions.inc.php
Post by: paquets on May 20, 2010, 03:41:58 pm
With the changes described in the original entry, the error actually does not happen anymore. So I was basically stating the error and describing how I fixed it.

The error happened when I was doing a search on my test site http://adpharm.net/cpg15/search.php

Hope this helps...
Title: Re: Problem with "No image to display" with functions.inc.php
Post by: Αndré on May 20, 2010, 04:00:19 pm
Your fix breaks other functions (you can find them somewhere in the bugs boards, e.g. http://forum.coppermine-gallery.net/index.php/topic,63977.0.html). That's why I need to know these things and cannot blindly apply your suggestion.
Title: Re: Problem with "No image to display" with functions.inc.php
Post by: paquets on May 20, 2010, 04:17:49 pm
That's what I figured... Would have been too easy a fix.

Should I repost my error in a new forum thread? I've re-uploaded the latest functions.inc.php from the SVN and it went back to not display "No image to display" when the search results come up empty.

To reproduce this: http://adpharm.net/cpg15/search.php (http://adpharm.net/cpg15/search.php) type in: aptamil in the search form

And you can try with a keyword such as Avamys (which gives the proper result)

Thanks!
Title: "No image to display" does not show in empty search results
Post by: paquets on May 20, 2010, 05:13:28 pm
In 1.5, when I searched a non-existant image, it does not give me the "No image to display" anymore. I know this has been discussed and fixed in this thread: http://forum.coppermine-gallery.net/index.php/topic,63939.0.html (http://forum.coppermine-gallery.net/index.php/topic,63939.0.html)

But for some reason, the error message still does not show up.

To reproduce this: http://adpharm.net/cpg15/search.php (http://adpharm.net/cpg15/search.php) type in: aptamil in the search form

And you can try with a keyword such as Avamys (which gives the proper result)

Any idea how to fix this?

Thanks in advance
Title: Re: Problem with "No image to display" with functions.inc.php
Post by: Joachim Müller on May 20, 2010, 05:18:20 pm
Merged with existing thread. Perform a SVN checkout of the entire package.
Title: Re: Problem with "No image to display" with functions.inc.php
Post by: paquets on May 20, 2010, 05:22:14 pm
Okay, thank you for the quick reply, I'll do that.