"; $default_comicpress_config_file = implode("\n", $default_comicpress_config_file_lines); cpm_initialize_options(); /** * Initialize ComicPress Manager options. */ function cpm_initialize_options() { global $comicpress_manager; include('cpm_configuration_options.php'); foreach ($configuration_options as $option_info) { if (is_array($option_info)) { $result = $comicpress_manager->get_cpm_option($option_info['id']); if (isset($option_info['not_blank']) && empty($result)) { $result = false; } if ($result === false) { $default = (isset($option_info['default']) ? $option_info['default'] : ""); $comicpress_manager->set_cpm_option($option_info['id'], $default); } } } } /** * Wrap the help text and activity content in the CPM page style. * @param string $help_content The content to show in the Help box. * @param string $activity_content The content to show in the Activity box. */ function cpm_wrap_content($help_content, $activity_content, $show_sidebar = true) { global $wp_scripts, $comicpress_manager; cpm_write_global_styles_scripts(); ?>
get_cpm_option('cpm-sidebar-type') == "none")) ? "class=\"no-sidebar\"" : "" ?>>
get_cpm_option('cpm-sidebar-type') == "none")) ? "class=\"no-sidebar\"" : "" ?>>
get_cpm_option('cpm-sidebar-type') !== "none")) { ?>
get_cpm_option('cpm-sidebar-type')) { case "latest": cpm_show_latest_posts(); break; case "standard": default: cpm_show_comicpress_details(); break; } ?> get_cpm_option('cpm-sidebar-type') == "standard")) { ?>

get_cpm_option('cpm-did-first-run')) { $all_comic_folders_found = true; foreach (array(''. 'rss_', 'archive_') as $folder_name) { if (!file_exists(CPM_DOCUMENT_ROOT . '/' . $comicpress_manager->properties["${folder_name}comic_folder"])) { $all_comic_folders_found = false; break; } } $do_first_run = !$all_comic_folders_found; if (!$do_first_run) { if (!function_exists('get_site_option')) { update_option("comicpress-manager-cpm-did-first-run", 1); } } } if ($do_first_run) { include("pages/comicpress_first_run.php"); cpm_manager_first_run(plugin_basename(__FILE__)); if (!function_exists('get_site_option')) { update_option("comicpress-manager-cpm-did-first-run", 1); } } else { if ($comicpress_manager->did_first_run) { $page = "config"; } include("pages/comicpress_${page}.php"); call_user_func("cpm_manager_${page}"); } } /** * Wrappers around page calls to reduce the amount of code in _admin.php. */ function cpm_manager_index_caller() { cpm_manager_page_caller("index"); } function cpm_manager_status_caller() { cpm_manager_page_caller("status"); } function cpm_manager_dates_caller() { cpm_manager_page_caller("dates"); } function cpm_manager_import_caller() { cpm_manager_page_caller("import"); } function cpm_manager_config_caller() { cpm_manager_page_caller("config"); } function cpm_manager_cpm_config_caller() { cpm_manager_page_caller("cpm_config"); } function cpm_manager_storyline_caller() { cpm_manager_page_caller("storyline"); } function cpm_manager_write_comic_caller() { include("pages/write_comic_post.php"); cpm_manager_write_comic(plugin_basename(__FILE__)); } /** * Show the header. */ function cpm_show_manager_header() { global $comicpress_manager; ?>

category_info['comiccat'])) { ?> category_info['comiccat']['name']) ?>

separate_thumbs_folder_defined[$type]) { $path = CPM_DOCUMENT_ROOT . '/' . $comicpress_manager->properties[$type . "_comic_folder"]; if (($subdir = $comicpress_manager->get_subcomic_directory()) !== false) { $path .= '/' . $subdir; } $files = glob($path . '/' . $date_root . "*"); if ($files === false) { $files = array(); } if (count($files) > 0) { $thumbnails_found[$type] = substr(realpath(array_shift($files)), CPM_STRLEN_REALPATH_DOCUMENT_ROOT); } } } return $thumbnails_found; } function cpm_display_storyline_checkboxes($category_tree, $post_categories, $prefix = null, $root_name = "in-comic-category") { foreach ($category_tree as $node) { $parts = explode("/", $node); $category_id = end($parts); $name = (empty($prefix) ? "" : "${prefix}-") . $root_name; ?>
normalize_storyline_structure()); if ($comicpress_manager->get_subcomic_directory() !== false) { $default_category = get_option('comicpress-manager-manage-subcomic'); } else { if ($comicpress_manager->get_cpm_option('cpm-default-comic-category-is-last-storyline') == 1) { $default_category = end(explode("/", end($category_tree))); } else { $default_category = $comicpress_manager->properties['comiccat']; } } ob_start(); foreach (get_all_category_ids() as $cat_id) { $ok = ($cat_id == $default_category); if ($ok) { $number_of_categories++; $category = get_category($cat_id); if (is_null($first_category)) { $first_category = $category; } ?> cat_ID}\" />"; if ($label) { $output .= $first_category->cat_name; } return $output; } else { return ""; } } } /** * Write the current ComicPress Config to disk. */ function write_comicpress_config_functions_php($filepath, $just_show_config = false, $use_default_file = false) { global $comicpress_manager, $default_comicpress_config_file; $file_lines = array(); if ($use_default_file) { $file_lines = $default_comicpress_config_file; } else { foreach (file($filepath) as $line) { $file_lines[] = rtrim($line, "\r\n"); } } include('cp_configuration_options.php'); $properties_written = array(); $closing_line = null; for ($i = 0; $i < count($file_lines); $i++) { foreach (array_keys($comicpress_manager->properties) as $variable) { if (!in_array($variable, $properties_written)) { if (preg_match("#\\$${variable}\ *\=\ *([^\;]*)\;#", $file_lines[$i], $matches) > 0) { $value = $comicpress_manager->properties[$variable]; $file_lines[$i] = '$' . $variable . ' = "' . $value . '";'; $properties_written[] = $variable; } } } if (strpos($file_lines[$i], "?>") !== false) { $closing_line = $i; } } foreach (array_keys($comicpress_manager->properties) as $variable) { if (!in_array($variable, $properties_written)) { foreach ($comicpress_configuration_options as $option_info) { if ($option_info['id'] == $variable) { $comicpress_lines = array(); $comicpress_lines[] = "//{$option_info['name']} - {$option_info['description']} (default \"{$option_info['default']}\")"; $comicpress_lines[] = "\${$option_info['id']} = \"{$comicpress_manager->properties[$variable]}\";"; $comicpress_lines[] = ""; array_splice($file_lines, $closing_line, 0, $comicpress_lines); break; } } } } $file_output = implode("\n", $file_lines); if (!$just_show_config) { if ($comicpress_manager->can_write_config) { $target_filepath = $filepath . '.' . time(); $temp_filepath = $target_filepath . '-tmp'; if ($comicpress_manager->_f->file_write_contents($temp_filepath, $file_output) !== false) { if (file_exists($temp_filepath)) { @chmod($temp_filepath, CPM_FILE_UPLOAD_CHMOD); if (@rename($filepath, $target_filepath)) { if (@rename($temp_filepath, $filepath)) { return array($target_filepath); } else { @unlink($temp_filepath); @rename($target_filepath, $filepath); } } else { @unlink($temp_filepath); } } } } } return $file_output; } /** * Generate links to view or edit a particular post. * @param array $post_info The post information to use. * @return string The view & edit post links for the post. */ function generate_view_edit_post_links($post_info) { $view_post_link = sprintf("%s", __("View post", 'comicpress-manager')); $edit_post_link = sprintf("%s", __("Edit post", 'comicpress-manager')); return $view_post_link . ' | ' . $edit_post_link; } /** * Show the Post Body Template. * @param integer $width The width of the editor in pixels. */ function cpm_show_post_body_template($width = 435) { global $comicpress_manager; ?> $b[1]) ? -1 : 1; } /** * Show the details of the current setup in the Sidebar. */ function cpm_show_comicpress_details() { global $comicpress_manager; $all_comic_dates_ok = true; $all_comic_dates = array(); foreach ($comicpress_manager->comic_files as $comic_file) { if (($result = $comicpress_manager->breakdown_comic_filename(pathinfo($comic_file, PATHINFO_BASENAME))) !== false) { if (isset($all_comic_dates[$result['date']])) { $all_comic_dates_ok = false; break; } $all_comic_dates[$result['date']] = true; } } $subdir_path = ''; if (($subdir = $comicpress_manager->get_subcomic_directory()) !== false) { $subdir_path .= '/' . $subdir; } ?>

query_posts() as $comic_post) { $timestamp = strtotime($comic_post->post_date); if ($timestamp < $current_timestamp) { $is_current = true; } if ($is_current) { if ($is_previous) { $previous_post = $comic_post; break; } $current_post = $comic_post; $is_previous = true; } else { $upcoming_post = $comic_post; } } $found_posts = compact('previous_post', 'current_post', 'upcoming_post'); $post_titles = array('previous_post' => __("Last Post", 'comicpress-manager'), 'current_post' => __("Current Post", 'comicpress-manager'), 'upcoming_post' => __("Upcoming Post", 'comicpress-manager')); ?>
$title) { if (!empty($found_posts[$key])) { $timestamp = strtotime($found_posts[$key]->post_date); $post_date = date(CPM_DATE_FORMAT, $timestamp); $comic_file = null; foreach ($comicpress_manager->comic_files as $file) { if (($result = $comicpress_manager->breakdown_comic_filename(pathinfo($file, PATHINFO_BASENAME))) !== false) { if ($result['date'] == $post_date) { $comic_file = $file; break; } } } ?>
">

post_title ?> []

<?php echo $found_posts[$key]->post_title ?>
Comic file not found!

You don't have any comic posts!