ID !== 0) { $post_time = time(); foreach (array('post_date', 'post_modified', 'post_date_gmt', 'post_modified_gmt') as $time_value) { if (($result = strtotime($post->{$time_value})) !== false) { $post_time = $result; break; } } $post_categories = wp_get_post_categories($post->ID); if (isset($cpm_config->properties['comiccat'])) { $in_comics_category = (count(array_intersect($comic_categories, $post_categories)) > 0); } $ok = true; if (cpm_get_subcomic_directory() !== false) { $ok = in_array(get_option('comicpress-manager-manage-subcomic'), wp_get_post_categories($post->ID)); } if ($ok) { if (($comic = find_comic_by_date($post_time)) !== false) { $comic_uri = cpm_build_comic_uri($comic); $comic_filename = preg_replace('#^.*/([^\/]*)$#', '\1', $comic_uri); $link = "${comic_filename}"; $date_root = substr($comic_filename, 0, strlen(date(CPM_DATE_FORMAT))); $thumbnails_found = cpm_find_thumbnails_by_filename($comic); $icon_file_to_use = $comic; foreach (array('rss', 'archive') as $type) { if (isset($thumbnails_found[$type])) { $icon_file_to_use = $thumbnails_found[$type]; } } $icon_uri = cpm_build_comic_uri($icon_file_to_use); $has_comic_file = true; } } } ?>