Beispiel #1
0
 function random_picture()
 {
     $picture_files = K2Header::get_header_images();
     $size = count($picture_files);
     if ($size > 1) {
         return $picture_files[rand(0, $size - 1)];
     } else {
         return $picture_files[0];
     }
 }
Beispiel #2
0
$style_files = K2::get_styles();
// Get the sidebar
$column_number = get_option('k2columns');
$column_options = array(1 => __('Single Column', 'k2_domain'), __('Two Columns', 'k2_domain'), __('Three Columns', 'k2_domain'));
// Get the asides category
$asides_id = get_option('k2asidescategory');
// Get the categories we might use for asides
$asides_cats = get_categories('get=all');
// Get the current K2 header picture
$header_picture = get_option('k2header_picture');
$header_sizes = array(1 => __('560 x 200 px', 'k2_domain'), __('780 x 200 px', 'k2_domain'), __('950 x 200 px', 'k2_domain'));
// Check that we can write to the headers folder and that it exists
$is_headers_writable = is_writable(K2_HEADERS_PATH);
$is_headers_dir = is_dir(K2_HEADERS_PATH);
// Get the header pictures
$picture_files = K2Header::get_header_images();
?>


<?php 
if (isset($_POST['submit']) or isset($_GET['updated'])) {
    ?>
<div id="message2" class="updated fade">
	<p><?php 
    _e('K2 Options have been updated', 'k2_domain');
    ?>
</p>
</div>
<?php 
}
?>
Beispiel #3
0
 function get_header_image_url()
 {
     $header_image = get_option('k2headerimage');
     if (empty($header_image)) {
         return false;
     }
     // randomly select an image
     if ('random' == $header_image) {
         $images = K2Header::get_header_images();
         $size = count($images);
         if ($size > 1) {
             $header_image = $images[rand(0, $size - 1)];
         } else {
             $header_image = $images[0];
         }
     }
     // image is an attachment
     if (is_numeric($header_image)) {
         $header_image = wp_get_attachment_url($header_image);
         if (empty($header_image)) {
             return false;
         }
         return $header_image;
     }
     return K2_HEADERS_URL . "/{$header_image}";
 }