<?php

automatic_feed_links();

include 'theme_options.php';
include 'guide.php';
include 'popular.php';
include 'talkers.php';

if ( function_exists('register_sidebar') )

    register_sidebar(array(

	'name' => 'Sidebar1',

    'before_widget' => '<div class="sidebox">',

    'after_widget' => '</div>',

	'before_title' => '<h3 class="sidetitl">',

    'after_title' => '</h3>',

    ));
if ( function_exists( 'add_theme_support' ) ) { // Added in 2.9
	add_theme_support( 'post-thumbnails' );
	add_image_size( 'solar_home', 310, 120, true ); 

}

function solar_home_image(){

if ( has_post_thumbnail() ) {
	 the_post_thumbnail( 'solar_home', array('class' => 'postim') );
} else {

};

}

function register_menu() {
	register_nav_menu('main-menu', __('Main Menu'));
}
add_action('init', 'register_menu');

function catch_that_image() {
  global $post, $posts;
  $first_img = '';
  ob_start();
  ob_end_clean();
  $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
  $first_img = $matches [1] [0];

  if(empty($first_img)){ //Defines a default image
    $first_img = "/images/default.jpg";
  }
  return $first_img;
}
?>