Archives.Php
<?php
?>
<?php get_header(); ?>
<div id="content" class="widecolumn">
<?php include (TEMPLATEPATH . '/searchform.php'); ?>
<h2>Архив по месяцам:</h2>
<ul>
<?php wp_get_archives('type=monthly'); ?>
</ul>
<h2>Архив по рубрикам:</h2>
<ul>
<?php wp_list_categories(); ?>
</ul>
</div>
<?php get_footer(); ?>
Header-img.Php
<?php
$img = 'kubrickheader.jpg';
if ( ! function_exists('imagecreatefromjpeg') )
die(header("Location: kubrickheader.jpg"));
$default = false;
$vars = array('upper'=>array('r1', 'g1', 'b1'), 'lower'=>array('r2', 'g2', 'b2'));
foreach ( $vars as $var => $subvars ) {
if ( isset($_GET[$var]) ) {
foreach ( $subvars as $index => $subvar ) {
$length = strlen($_GET[$var]) / 3;
$v = substr($_GET[$var], $index * $length, $length);
if ( $length == 1 ) $v = '' . $v . $v;
$$subvar = hexdec( $v );
if ( $$subvar < 0 || $$subvar > 255 )
$default = true;
}
} else {
$default = true;
}
}
if ( $default )
list ( $r1, $g1, $b1, $r2, $g2, $b2 ) = array ( 105, 174, 231, 65, 128, 182 );
$im = imagecreatefromjpeg($img);
$white = imagecolorat( $im, 15, 15 );
$h = 182;
Продовження дод. Д
$corners = array(
0 => array ( 25, 734 ),
1 => array ( 23, 736 ),
2 => array ( 22, 737 ),
3 => array ( 21, 738 ),
4 => array ( 21, 738 ),
177 => array ( 21, 738 ),
178 => array ( 21, 738 ),
179 => array ( 22, 737 ),
180 => array ( 23, 736 ),
181 => array ( 25, 734 ),
);
for ( $i = 0; $i < $h; $i++ ) {
$x1 = 19;
$x2 = 740;
imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white );
}
for ( $i = 0; $i < $h; $i++ ) {
$x1 = 20;
$x2 = 739;
$r = ( $r2 - $r1 != 0 ) ? $r1 + ( $r2 - $r1 ) * ( $i / $h ) : $r1;
$g = ( $g2 - $g1 != 0 ) ? $g1 + ( $g2 - $g1 ) * ( $i / $h ) : $g1;
$b = ( $b2 - $b1 != 0 ) ? $b1 + ( $b2 - $b1 ) * ( $i / $h ) : $b1;
$color = imagecolorallocate( $im, $r, $g, $b );
if ( array_key_exists($i, $corners) ) {
imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white );
list ( $x1, $x2 ) = $corners[$i];
}
imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $color );
}
header("Content-Type: image/jpeg");
imagejpeg($im, '', 92);
imagedestroy($im);
?>
Links.Php
<?php
?>
<?php get_header(); ?>
<div id="content" class="widecolumn">
<h2>Ссылки:</h2>
<ul>
<?php get_links_list(); ?>
</ul>
</div>
Продовження дод. Д
<?php get_footer(); ?>
Archive.Php
<?php get_header(); ?>
<div id="content" class="narrowcolumn">
<?php is_tag(); ?>
<?php if (have_posts()) : ?>
<?php $post = $posts[0];?>
<?php if (is_category()) { ?>
<h2 class="pagetitle">Рубрика: <?php single_cat_title(); ?></h2>
<?php } elseif( is_tag() ) { ?>
<h2 class="pagetitle">Метка: <?php single_tag_title(); ?></h2>
<?php } elseif (is_day()) { ?>
<h2 class="pagetitle">Архив за <?php the_time('d M Y'); ?></h2>
<?php } elseif (is_month()) { ?>
<h2 class="pagetitle">Архив за <?php the_time('F Y'); ?></h2>
<?php } elseif (is_year()) { ?>
<h2 class="pagetitle">Archive for <?php the_time('Y'); ?></h2>
<?php } elseif (is_author()) { ?>
<h2 class="pagetitle">Author Archive</h2>
<?php } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h2 class="pagetitle">Blog Archives</h2>
<?php } ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('« Раньше') ?></div>
<div class="alignright"><?php previous_posts_link('Позже »') ?></div>
</div>
<?php while (have_posts()) : the_post(); ?>
<div class="post">
<h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
<small><?php the_time('l, d M Y') ?></small>
<div class="entry">
<?php the_content() ?>
</div>
<p class="postmetadata"><?php the_tags('Метки: ', ', ', '<br />'); ?> Рубрика: <?php the_category(', ') ?> | <?php edit_post_link('Править', '', ' | '); ?> <?php comments_popup_link('Ваш отзыв »', '1 отзыв »', 'Отзывов: % »'); ?></p>
</div>
<?php endwhile; ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('« Раньше') ?></div>
<div class="alignright"><?php previous_posts_link('Позже »') ?></div>
Продовження дод. Д
</div>
<?php else : ?>
<h2 class="center">Не найдено</h2>
<?php include (TEMPLATEPATH . '/searchform.php'); ?>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
