themepack mods

Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
This commit is contained in:
Philip M. Hofer (Frumph) 2009-09-29 12:11:28 -07:00
parent 94639dca9b
commit 2739b4bf34
3 changed files with 44 additions and 12 deletions

View File

@ -87,22 +87,46 @@ foreach ( $years as $year ) {
<div class="cpcal-cals">
<?php $i=1; while($i<=12) {
$calendar_directory = get_option('comicpress-calendar_directory');
$themepack_directory = get_option('comicpress-themepack_directory');
if (!empty($calendar_directory) && $calendar_directory != 'none') { ?>
<div class="cpcal-month" style="height: 257px;" id="<?php echo $month[$i]['month'] ?>">
<?php if (file_exists(get_template_directory().'/images/cal/'.$calendar_directory.'/'.$archive_year)) { ?>
<?php if (count($monthfile = glob(get_template_directory().'/images/cal/'.$calendar_directory.'/'.$archive_year.'/'.strtolower($month[$i]['month']).'.*')) > 0) {
if (is_array($monthfile)) $monthfile = reset($monthfile); ?>
<img class="cpcal-image" src="<?php bloginfo('stylesheet_directory'); ?>/images/cal/<?php echo $calendar_directory; ?>/<?php echo $archive_year; ?>/<?php echo basename($monthfile); ?>" alt="<?php echo $month[$i]['month'] ?>" title="<?php echo $month[$i]['month'] ?>" />
<?php if ($calendar_directory == 'themepack') { ?>
<?php if (file_exists(get_template_directory().'/themepack/'.$themepack_directory.'/cal/'.$archive_year)) { ?>
<?php if (count($monthfile = glob(get_template_directory().'/themepack/'.$themepack_directory.'/cal/'.$archive_year.'/'.strtolower($month[$i]['month']).'.*')) > 0) {
if (is_array($monthfile)) $monthfile = reset($monthfile); ?>
<img class="cpcal-image" src="<?php bloginfo('stylesheet_directory'); ?>/themepack/<?php echo $themepack_directory; ?>/cal/<?php echo $archive_year; ?>/<?php echo basename($monthfile); ?>" alt="<?php echo $month[$i]['month'] ?>" title="<?php echo $month[$i]['month'] ?>" />
<?php } else { ?>
<img class="cpcal-image" src="<?php bloginfo('stylesheet_directory'); ?>/images/cal/default.png" alt="<?php echo $month[$i]['month'] ?>" title="<?php echo $month[$i]['month'] ?>" />
<?php } ?>
<?php } else { ?>
<img class="cpcal-image" src="<?php bloginfo('stylesheet_directory'); ?>/images/cal/default.png" alt="<?php echo $month[$i]['month'] ?>" title="<?php echo $month[$i]['month'] ?>" />
<?php if (count($monthfile = glob(get_template_directory().'/themepack/'.$themepack_directory.'/cal/'.strtolower($month[$i]['month']).'.*')) > 0) {
if (is_array($monthfile)) $monthfile = reset($monthfile); ?>
<img class="cpcal-image" src="<?php bloginfo('stylesheet_directory'); ?>/themepack/<?php echo $themepack_directory; ?>/cal/<?php echo basename($monthfile); ?>" alt="<?php echo $month[$i]['month'] ?>" title="<?php echo $month[$i]['month'] ?>" />
<?php } else { ?>
<img class="cpcal-image" src="<?php bloginfo('stylesheet_directory'); ?>/images/cal/default.png" alt="<?php echo $month[$i]['month'] ?>" title="<?php echo $month[$i]['month'] ?>" />
<?php } ?>
<?php } ?>
<?php } else { ?>
<?php if (count($monthfile = glob(get_template_directory().'/images/cal/'.$calendar_directory.'/'.strtolower($month[$i]['month']).'.*')) > 0) {
if (is_array($monthfile)) $monthfile = reset($monthfile); ?>
<img class="cpcal-image" src="<?php bloginfo('stylesheet_directory'); ?>/images/cal/<?php echo $calendar_directory; ?>/<?php echo basename($monthfile); ?>" alt="<?php echo $month[$i]['month'] ?>" title="<?php echo $month[$i]['month'] ?>" />
<?php if (file_exists(get_template_directory().'/images/cal/'.$calendar_directory.'/'.$archive_year)) { ?>
<?php if (count($monthfile = glob(get_template_directory().'/images/cal/'.$calendar_directory.'/'.$archive_year.'/'.strtolower($month[$i]['month']).'.*')) > 0) {
if (is_array($monthfile)) $monthfile = reset($monthfile); ?>
<img class="cpcal-image" src="<?php bloginfo('stylesheet_directory'); ?>/images/cal/<?php echo $calendar_directory; ?>/<?php echo $archive_year; ?>/<?php echo basename($monthfile); ?>" alt="<?php echo $month[$i]['month'] ?>" title="<?php echo $month[$i]['month'] ?>" />
<?php } else { ?>
<img class="cpcal-image" src="<?php bloginfo('stylesheet_directory'); ?>/images/cal/default.png" alt="<?php echo $month[$i]['month'] ?>" title="<?php echo $month[$i]['month'] ?>" />
<?php } ?>
<?php } else { ?>
<img class="cpcal-image" src="<?php bloginfo('stylesheet_directory'); ?>/images/cal/default.png" alt="<?php echo $month[$i]['month'] ?>" title="<?php echo $month[$i]['month'] ?>" />
<?php if (count($monthfile = glob(get_template_directory().'/images/cal/'.$calendar_directory.'/'.strtolower($month[$i]['month']).'.*')) > 0) {
if (is_array($monthfile)) $monthfile = reset($monthfile); ?>
<img class="cpcal-image" src="<?php bloginfo('stylesheet_directory'); ?>/images/cal/<?php echo $calendar_directory; ?>/<?php echo basename($monthfile); ?>" alt="<?php echo $month[$i]['month'] ?>" title="<?php echo $month[$i]['month'] ?>" />
<?php } else { ?>
<img class="cpcal-image" src="<?php bloginfo('stylesheet_directory'); ?>/images/cal/default.png" alt="<?php echo $month[$i]['month'] ?>" title="<?php echo $month[$i]['month'] ?>" />
<?php } ?>
<?php } ?>
<?php } ?>
<?php } else { ?>
<div class="cpcal-month" style="height: 137px;" id="<?php echo $month[$i]['month'] ?>">

View File

@ -5,7 +5,7 @@
<?php
global $archive_display_order;
if (empty($archive_display_order)) $archive_display_order = 'desc';
$tmp_search = new WP_Query($query_string.'&order='.$archive_display_order.'&show_posts=-1&posts_per_page=-1&cat=-'.$members_post_category);
$tmp_search = new WP_Query($query_string.'&order='.$archive_display_order.'&show_posts=-1&posts_per_page=-1');
$count = $tmp_search->post_count;
?>
<?php if (!$count) $count = "no"; ?>

View File

@ -127,6 +127,11 @@
$count = count($results = glob(get_template_directory() . '/images/cal/'.$current_cal_directory.'/*'));
$cal_directories = glob(get_template_directory() . '/images/cal/*');
$themepack_directory = get_option('comicpress-themepack_directory');
if (!empty($themepack_directory) && $themepack_directory != 'none') {
if (file_exists(get_template_directory().'/themepack/'.$themepack_directory.'/cal')) $themepackcal = 1;
}
?>
<tr>
<th scope="row"><strong>Calendar Directory</strong><br /><br />Choose a directory to get the Archive Calendar styling from.<br /></th>
@ -134,6 +139,9 @@
<label>
<select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
<option class="level-0" value="none" <?php if ($current_cal_directory == "none") { ?>selected="selected"<?php } ?>>none</option>
<?php if ($themepackcal) { ?>
<option class="level-0" value="themepack" <?php if ($current_cal_directory == "themepack") { ?>selected="selected"<?php } ?>>ThemePack (<?php echo $themepack_directory; ?>)</option>
<?php } ?>
<?php
foreach ($cal_directories as $cal_dirs) {
if (is_dir($cal_dirs)) {