I copied this code from the functions.inc file into my theme.php file, and added the thumb location, got no errors adding it, but the thumb doesn't show up. Is there a way I can get this to work?
// Use default thumbs
if (is_null($filepathname)) {
// Check for default theme- and global-level thumbs
$thumb_paths[] = $THEME_DIR.'images/'; // Used for custom theme thumbs
$thumb_paths[] = 'images/thumbs/'; // Default Coppermine thumbs
foreach ($thumb_paths as $default_thumb_path) {
if (is_dir($default_thumb_path)) {
if (!$system_pic) {
foreach ($thumb_extensions as $extension) {
// Check for extension-specific thumbs
if (file_exists($default_thumb_path . $CONFIG['thumb_pfx'] . $mime_content['extension'] . $extension)) {
$filepathname = $default_thumb_path . $CONFIG['thumb_pfx'] . $mime_content['extension'] . $extension;
//thumb cropping - if we display a system thumb we calculate the dimension by any and not ex
$pic_row['system_icon'] = true;
break 2;
}
}
foreach ($thumb_extensions as $extension) {
// Check for media-specific thumbs (movie,document,audio)
if (file_exists($default_thumb_path . $CONFIG['thumb_pfx'] . $mime_content['content'] . $extension)) {
$filepathname = $default_thumb_path . $CONFIG['thumb_pfx'] . $mime_content['content'] . $extension;
//thumb cropping
$pic_row['system_icon'] = true;
break 2;
}
}
} else {
// Check for file-specific thumbs for system files
foreach ($thumb_extensions as $extension) {
if (file_exists($default_thumb_path . $CONFIG['thumb_pfx'] . $file_base_name . $extension)) {
$filepathname = $default_thumb_path . $CONFIG['thumb_pfx'] . $file_base_name . $extension;
//thumb cropping
$pic_row['system_icon'] = true;
break 2;
}
} // foreach $thumb_extensions
} // else $system_pic
} // if is_dir($default_thumb_path)
} // foreach $thumbpaths
} // if is_null($filepathname)
if ($filepathname) {
$filepathname = path2url($filepathname);
}
}
if (is_null($filepathname)) {
$localpath = $pic_row['filepath'] . $pic_prefix[$mode] . $pic_row['filename'];
// Check here that the filename we are going to return exists
// If it doesn't exist we return a placeholder image
// We then log the missing file for the admin's attention
if (file_exists($url_prefix[$pic_row['url_prefix']] . $localpath)) {
$filepathname = $url_prefix[$pic_row['url_prefix']] . path2url($localpath);
} else {
$filepathname = 'http://www.solidsnakelegacy.net/images/content/whole/thumbs/thumbs_nopic.jpg';
$pic_row['system_icon'] = true;
if ($CONFIG['log_mode'] != 0) {
log_write("File {$url_prefix[$pic_row['url_prefix']]}$localpath is missing.");
}
}
}