<?php 
/*
Template Name: Page/Post Full Width - No Widgets
Single Post Template: Page/Post Full Width - No Content Widgets
Description: Full Width Page or Post - No Sidebar
*/

/* 
This file is part of HeatMap Theme Pro v5
Copyright: Stuart Wider
Website: HeatMapTheme.com
*/
?>

<?php get_header(); ?>

<!--
page-full-width-no-widgets.php
~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ -->

<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 

<!--
Content of the page (inc comments and post details)
~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ -->

    <div id="page-body-wrapper">
        
        <div id="content-full-width">
            
        <?php global $have_posts; ?>        
                    
        <?php
        if ($have_posts):
        ?>	
	
<!--
The Post
~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ -->
	
			<div class="post-content">
	
<!--
The Post Title 
~~~ -->			
				<?php 
                $hide_for_page = hmt4_get_option('hmt_hide_page_titles') && is_page();
                $hide_for_post = hmt4_get_option('hmt_hide_post_titles') && is_single();
                
                if (!$hide_for_page && !$hide_for_post) {?>
                <?php
                    if (is_page()) {
                        if (!hmt4_get_option('hmt_assign_h2_page_titles')){ ?>
                            <h1 class="h1-underline"><?php the_title(); ?></h1>  
                        <?php 
                        } else {
                        ?>
                            <h2 class="h2-simulate-h1-size-underline"><?php the_title(); ?></h2>
                        <?php
                        }
                    }
                    
                    if (is_single()) {
                        if (!hmt4_get_option('hmt_assign_h2_post_titles')){ ?>
                            <h1 class="h1-underline"><?php the_title(); ?></h1>  
                        <?php 
                        } else {
                        ?>
                            <h2 class="h2-simulate-h1-size-underline"><?php the_title(); ?></h2>
                        <?php
                        }
                    }
                }
                ?>
<!--
The content itself 
~~~ -->
				<?php
                if (function_exists('has_post_thumbnail') && has_post_thumbnail()) { //  okay so if this post has a thumbnail (as per wp 2.9 thumnail features) then do something about it
                
                    if (is_page()) {
                    
                        if (hmt4_get_option('hmt_page_thumbnail_left_or_right')!='OFF') {
                            if (hmt4_get_option('hmt_page_thumbnail_left_or_right')=='RIGHT') print '<div class="page-thumbnail-right">';
                            else print '<div class="page-thumbnail-left">';

                        if( get_post_meta($post->ID, "aff-link", true)){  
                        	echo ' <a href="'.get_post_meta($post->ID, "aff-link", true).'" ';                         
                        	if( get_post_meta($post->ID, "aff-link-nofollow", true)){  echo ' rel="nofollow" '; } 
                       		echo '  title="' . the_title_attribute('echo=0') . '" target="_blank" >';
                        }
	   
                        the_post_thumbnail('post-image-size');
			if( get_post_meta($post->ID, "aff-link", true)){
                        	echo "</a>";
                        }

                            ?>
                            </div>
                    
                    <?php
                        }
                    }
                    
                    if (is_single()) {
                    
                        if (hmt4_get_option('hmt_post_thumbnail_left_or_right')!='OFF') {
                            if (hmt4_get_option('hmt_post_thumbnail_left_or_right')=='RIGHT') print '<div class="post-thumbnail-right">';
                            else print '<div class="post-thumbnail-left">';

                        if( get_post_meta($post->ID, "aff-link", true)){  
                        	echo ' <a href="'.get_post_meta($post->ID, "aff-link", true).'" ';                         
                        	if( get_post_meta($post->ID, "aff-link-nofollow", true)){  echo ' rel="nofollow" '; } 
                       		echo '  title="' . the_title_attribute('echo=0') . '" target="_blank" >';
                        }
	   
                        the_post_thumbnail('post-image-size');
			if( get_post_meta($post->ID, "aff-link", true)){
                        	echo "</a>";
                        }

                            ?>
                            </div>
                
                <?php
                        }
                    }
                    
                }
    
    
                the_content(''); ?>
                
                <?php edit_post_link(__('(Edit)','hmth'), '<p>', '</p>'); ?>
				
<!--
Pagination for Multi-page posts
~~~ -->
				<?php wp_link_pages('before=<p class="multi-page">' . __('Pages:','hmth') . '&after=</p>'); ?>
                    
            </div> <!-- class="post-content" -->
        
            <div class="clearFloat"></div>
	
<!--
Post Details 
~~~ -->
		
			<?php            
            $leave_out_details ="";
            $leave_out_comments="";

			if (is_page()) {	
				if (hmt4_get_option('hmt_hide_details_for_pages')) $leave_out_details = true;
            	if (hmt4_get_option('hmt_hide_comments_for_pages')) $leave_out_comments = true;
			}
			
			if (is_single()) {	
				if (hmt4_get_option('hmt_hide_details_for_posts')) $leave_out_details = true;
            	if (hmt4_get_option('hmt_hide_comments_for_posts')) $leave_out_comments = true;
			}
			?>
    
            <?php 
            
            /* logic to enable hiding of post details as per settings in the heatmap options admin */
            
            if (!$leave_out_details) { /* the logic here is reverse to what you think */ 
            ?> 
    
                <div class="post-details">
                
                	<?php get_template_part('like-buttons'); ?>
    
                    <p class="comment-button-box">
                    <?php 
                    if (($post->comment_status != 'closed')) { // if comments are not closed then show the comments button ?>
                        
                        <?php 
                        if (!$leave_out_comments) { ?>
                            <span class="comment-button"><a href="<?php the_permalink(); ?>#respond"><?php comments_number(__('Be the first to comment','hmth'), __('1 comment','hmth'), __('% comments','hmth'));?></a><?php if ('closed' != $post->comment_status){ print ' - '; _e('What do you think?','hmth'); }?></span><br /> 
                        <?php 
                        }
                    } else {
                    ?>	
                        <?php
                        $number_of_comments = get_comments_number();
                        if ($number_of_comments > 0) {
                        ?>
                            <?php 
                            if (!$leave_out_comments) { 
                            ?>
                                <span class="comment-button"><?php comments_number(__('No comments','hmth'), __('1 Comment','hmth'), __('% Comments','hmth'));?></span>&nbsp;<?php _e('[Comments are now closed for this post]','hmth') ?><br />
                            <?php 
                            }
                        }
                    } 
                    ?>
                    
                    <?php if (!$leave_out_details) { ?><?php _e('Posted by','hmth'); ?>
                        <?php echo get_the_author(); ?>
                        <?php /* the_author_posts_link(); */ /*uncomment this if you actually want a link to the authors posts - it reveals the authors username though - or am I being too security concious? */?>
                         - 
                        <?php echo get_the_date();?> <?php _e('at','hmth'); ?>  <?php the_time(); /* changed date and time format so that default system date and time is used instead of preset date and time */ ?>
                    <?php }?>
                    </p>
                
                    <?php 
                    if (is_single()) { 
                    ?>
                        <p><?php _e('Categories','hmth'); ?>:
                            <?php the_category(', ') ?>
                        &nbsp;<?php _e('Tags','hmth'); ?>:
                            <?php the_tags('') ?>
                        </p>
                    <?php
                    }
                    ?>
            
                </div> <!-- class="post-details" -->
            
            <?php 
            } 
            else if (!$leave_out_comments) { /* logic so to allow only the comments # button to show as set in the Heatmap Admin */ ?>
                    
                <?php 
                if (($post->comment_status != 'closed')) { // if comments are not closed then show the comments button ?>
                
                    <div class="post-details nobg">
                    
                    	<?php get_template_part('like-buttons'); ?>
                
                        <p class="comment-button-box"><span class="comment-button"><a href="<?php the_permalink(); ?>#respond"><?php comments_number(__('Be the first to comment','hmth'), __('1 comment','hmth'), __('% comments','hmth'));?></a><?php if ('closed' != $post->comment_status){ print ' - '; _e('What do you think?','hmth'); }?></span></p>
            
                    </div> <!-- class="post-details" -->
        
                <?php 
                } else { 
                ?>
                
                    <?php
                    $number_of_comments = get_comments_number();
                    if ($number_of_comments > 0) {
                    ?>
    
                    <div class="post-details nobg">
                                
                        <p class="comment-button-box"><span class="comment-button"><?php comments_number(__('No comments','hmth'), __('1 Comment','hmth'), __('% Comments','hmth'));?></span>&nbsp;<?php _e('[Comments are now closed for this post]','hmth'); ?></p>
                    
                    </div> <!-- class="post-details" -->
                    
                    <?php
                    }
                } 
            }
            ?>
                
            <!--
            <?php trackback_rdf(); ?>
            -->
        
            <?php else: ?>
                <h2 class="h2-simulate-h1-size"><?php _e('No posts found','hmth'); ?></h2>
            <?php endif; ?>
	

<!--
The comments
~~~ -->
			<?php 
            if ((!$leave_out_comments)||!$leave_out_details) { /* the logic here is reverse to what you think */ 
            ?>
        
                <div class="comment-item">
                    <?php comments_template('',true); ?>
                </div> <!-- class="comment-item" -->
            
            <?php 
            } 
            ?> 
            
        </div> <!-- id="content" -->
    
   <!-- </div>--> <!-- post_class -->  
    
<!--
[Footer Above]
~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ -->

	<?php 
    if (hmt_is_sidebar_active('footer_above')):
    ?>

        <div id="footer-above">
            <ul class="footer-above-widget-block">
            	<?php dynamic_sidebar('footer_above'); ?> 
            </ul>
        </div> <!-- id="footer-above" -->
            
        <div class="clearFloat"></div>
    
    <?php 
    endif;
    ?>    
    

  </div> <!-- id="page-body-wrapper" -->
</div> <!-- end of  id="post... -->
	
<?php get_footer(); ?>
	

	
<!--
End of page-full-width-no-widgets.php 
~~~ -->