Forum

Please make sure that you have read the documentation and extensive resources provided on this site before posting your question!

Dynamic Content Gallery Resources

DCG Version 4.0 beta is now available for download and testing. This is a development version and not recommended for live sites. Read more here.

Note that the current stable release of the DCG is version 3.3.5.

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search:

— Forum Scope —



— Match —



— Forum Options —




Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 3 characters - maximum search word length is 84 characters

Topic RSS
Issue with the default images code
Status: fixed
August 13, 2011
2:56 am
redboy
Guest

Hi,

I was hoping you might be able to help. I've been trying to get default images working for the One Category option, but I am having no success.

I've followed all of the configuration options and have even debugged the code in dfcg-gallery-constructors.php to verify that $def_img_path has the correct value.

The problem seems to be that every time the if statement on line 532 is executed, the file_exists statement returns false even though the path is correct and the image exists at that location, resulting in the error code being executed and the ERROR image being displayed.

if( $metabox_image ) {
$image_src = $baseimgurl . $metabox_image;
$image_class = "dfcg-metabox";
$image_err = $dfcg_errmsgs['20'];
// Note: No Error message will be triggered if _dfcg-image is set but URL
} elseif( file_exists($def_img_path) ) {
// Display the "Category" default image
$image_src = $def_img_folder_url . $def_img_name;
$image_class = "dfcg-metabox-default";
$image_err = $dfcg_errmsgs['17'];

} else {
$image_src = DFCG_ERRORIMGURL;
$image_class = "dfcg-metabox-error";
$image_err = $dfcg_errmsgs['18'];
}

Any help would be greatly appreciated.

Thanks,

Mark

August 18, 2011
4:22 pm
Ade
Admin
Forum Posts: 2493
Member Since:
August 25, 2008
Offline

Mark,

It's possible that file_exists isn't returning what we expect.

Just to confirm: $def_img_path is returning the correct value, yes?

$def_img_path is built from this (line 394):

$def_img_folder_path = str_replace( get_bloginfo('url'), ABSPATH, $def_img_folder_url );

Is it possible that the folder URL is correct, but ABSPATH and/or get_bloginfo('url') aren't working as expected?

Can you give me the URL to your default images folder?

Dynamic Content Gallery: Have you read the Configuration Guide and FAQ?
Forum Timezone: UTC 1

Most Users Ever Online: 28

Currently Online:
10 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

johnbroome: 13

speedyp: 12

sjpeaches: 12

CherylMcL: 10

gscorp: 8

lsnoei: 8

Member Stats:

Guest Posters: 770

Members: 1300

Moderators: 0

Admins: 1

Forum Stats:

Groups: 2

Forums: 7

Topics: 980

Posts: 4299

Newest Members: jochris26, eva-aa, Tushar, chargers3, jwhetstone, robert

Moderators:

Administrators: Ade (2493)