<?php
/**
 * @package WordPress
 * @subpackage ROVERNET
 */
?>

<div class="col">
  <? if(!is_user_logged_in()){?>
  <h3>Přihlášení</h3>
  <form name="loginform" id="loginform" action="<?= get_bloginfo('wpurl')?>/wp-login.php" method="post">
    <div class="form">
    	<div>
    		<label for="user_login">Uživatelské jméno</label>
    		<input name="log" id="user_login" class="text" value="" size="20" tabindex="10" type="text">
    	</div>
  
    	<div>
    		<label for="user_pass">Heslo</label>
    		<input name="pwd" id="user_pass" class="text" value="" size="20" tabindex="20" type="password">
    	</div>
    	
      <div class="forgetmenot hid"><label><input name="rememberme" id="rememberme" value="forever" tabindex="90" checked="checked" type="checkbox"> Pamatovat si mě</label></div>
  
    	<div class="submit">
    		<input class="psub" name="wp-submit" id="wp-submit" value="Přihlásit se" tabindex="100" type="submit" />
    		<input name="redirect_to" value="<?php bloginfo('url'); ?>" type="hidden" />
    		<input name="testcookie" value="1" type="hidden" />
    	</div>
    	<a href="<?php echo get_page_link(10)?>">registrace</a>
    </div>
  </form>
  <?}?>
  <h3>Články</h3>
  <ul class="cats font">
    <?php $cats = get_categories(array('type' => 'post', 'orderby' => 'name', 'order' => 'ASC', 'exclude' => 9)); ?>

    <?php foreach($cats as $c) { ?>
      <li><a<?php echo (in_category($c->term_id) && !is_page('clanky'))?' class="active"':'';?> href="<?php echo get_category_link($c->term_id)?>"><?php echo $c->name ?></a></li>
    <?php } ?>
  </ul>
  
  <h3>Nejbližší akce</h3>
  <?php

    $pocetPostuNaStranku = 10;
    $temp = $wp_query;
    $wp_query= null;
    $wp_query = new WP_Query();
    $countQuery = new WP_Query();
    $wp_query->query('showposts=' . $pocetPostuNaStranku .'&cat=9&paged='.$paged);
    
    ?>
  <ul class="akce">
  <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <li>
      <a href="<?php the_permalink() ?>">
        St 12. 8. – Ne 15. 11.
        <span><?php the_title(); ?></span>
      </a>
    </li>
  <?php endwhile; else: ?>
  <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
  <?php endif; ?>
  </ul>
  
  <div class="more"><a href="<?php echo get_page_link(36)?>">zobrazit všechny akce</a></div>
</div>