Guest User

Untitled

a guest
Oct 29th, 2011
74
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php get_header(); ?>
  2.    
  3.      <?php
  4.         //Get value from Admin Panel
  5.         $cp_categories = get_categories('hide_empty=0');
  6.        
  7.         $status1 = get_settings( "cp_preventHeadline" );
  8.        
  9.         if ( $status1 != "No" ) {
  10.        
  11.         $ar_headline = get_settings( "ar_headline" );
  12.         $ar_featured = get_settings( "ar_featured" );
  13.        
  14.         }
  15.        
  16.         ?>
  17.  
  18.  
  19.     <div id="bottom" class="clearfloat">
  20.        
  21.     <div id="bottom-left">
  22.  
  23.     <?php if(!is_paged()) { ?> 
  24.  
  25.     <div id="front-list">  
  26.    
  27.     <?php $width = get_settings ( "cp_thumbWidth_LatestPost" );
  28.         $height = get_settings ( "cp_thumbHeight_LatestPost" );
  29.         if ( $width == 0 ) { $width = 150; }
  30.         if ( $height == 0 ) { $height = 150; }
  31.     ?>
  32.    
  33.     <?php query_posts(array(
  34.             'category__not_in' => array($ar_headline,$ar_featured),
  35.             'showposts' => 1,
  36.             )); ?>
  37.    
  38.     <?php while (have_posts()) : the_post(); ?>
  39.         <?php if ( get_post_meta($post->ID, 'Exclude', true) == '') { ?>   
  40.     <?php global $ar_ID; global $post; $ar_ID[] = $post->ID; ?>
  41.      
  42.     <div class="clearfloat">
  43.     <h3 class="cat_title"><?php the_category(', '); ?> &raquo;</h3>
  44.     <span class="title"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></span>
  45.     <div class="meta"><?php the_time(get_option('date_format')); ?> &#150; <?php the_time(); ?> | <?php comments_popup_link(__('No Comment','arthemia'), __('One Comment','arthemia'), __('% Comments','arthemia'));?></div>       
  46.    
  47.     <?php $status = get_settings ( "cp_postThumb" );
  48.         $status2 = get_settings ( "cp_thumbAuto" );
  49.        
  50.         if (( $status2 != "first" ) && ( $status != "no" )) { ?>
  51.  
  52.     <?php $values = get_post_custom_values("Image");
  53.     if (isset($values[0])) { ?>
  54.     <p><img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=/<?php
  55. $values = get_post_custom_values("Image"); echo $values[0]; ?>&amp;w=<?php echo $width; ?>&amp;h=<?php echo $height; ?>&amp;zc=1&amp;q=100"
  56. alt="<?php the_title(); ?>" class="left" width="<?php echo $width; ?>px" height="<?php echo $height; ?>px"  /></p>
  57.     <?php } ?>
  58.  
  59.     <?php } ?>
  60.  
  61.        
  62.     <?php the_content(__('Read the full story &raquo;','arthemia')); ?>
  63.     </div>
  64.  
  65.     <?php } ?> 
  66.         <?php endwhile; ?>
  67.     <?php wp_reset_query(); ?>
  68.  
  69.     </div>
  70.  
  71.     <?php } ?>
  72.  
  73.     <?php $column = get_settings ( "cp_status_Column" );
  74.         if ( $column != "one" ) { ?>   
  75.  
  76.     <div id="paged-list">  
  77.     <?php add_filter('post_limits', 'my_post_limit'); ?>
  78.    
  79.     <?php
  80.         global $myOffset;
  81.         $myOffset = 1;
  82.         $temp = $wp_query;
  83.         $wp_query= null;
  84.         $wp_query = new WP_Query();
  85.         $wp_query->query(array(
  86.                 'offset' => $myOffset,
  87.                 'category__not_in' => array($ar_headline,$ar_featured),
  88.                 'paged' => $paged,
  89.                 )); ?>
  90.  
  91.         <?php if (have_posts()) : ?>
  92.         <?php $i = 1; ?>
  93.  
  94.         <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>  
  95.         <?php global $ar_ID; global $post; $ar_ID[] = $post->ID; ?>
  96.        
  97.     <?php if( $odd = $i%2 ) { echo '<div class="clearfloat">'; } ?>
  98.    
  99.    
  100.    
  101.     <div class="tanbox <?php if( $odd = $i%2 ) { echo 'left'; } else { echo 'right'; } ?>">
  102.         <span class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></span>
  103.         <div class="meta"><?php the_time(get_option('date_format')); ?> &#150; <?php the_time(); ?> | <?php comments_popup_link(__('No Comment','arthemia'), __('One Comment','arthemia'), __('% Comments','arthemia'));?></div>
  104.    
  105.     <?php $width = get_settings ( "cp_thumbWidth_Column" );
  106.         $height = get_settings ( "cp_thumbHeight_Column" );
  107.         if ( $width == 0 ) { $width = 80; }
  108.         if ( $height == 0 ) { $height = 80; }
  109.     ?>
  110.  
  111.     <?php $status = get_settings ( "cp_thumbAuto" );
  112.         if ( $status != "first" ) { ?>
  113.  
  114.     <?php
  115.     //Check if custom field key "Image" has a value
  116.     $values = get_post_custom_values("Image");
  117.     if (isset($values[0])) {
  118.     ?>
  119.         <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=/<?php
  120. $values = get_post_custom_values("Image"); echo $values[0]; ?>&amp;w=<?php echo $width; ?>&amp;h=<?php echo $height; ?>&amp;zc=1&amp;q=100"
  121. alt="<?php the_title(); ?>" class="left" width="<?php echo $width; ?>px" height="<?php echo $height; ?>px"  /></a>
  122.         <?php } ?>
  123.  
  124.     <?php } else { ?>
  125.  
  126.     <?php $id =$post->ID;
  127. $the_content =$wpdb->get_var("SELECT post_content FROM $wpdb->posts WHERE ID = $id");
  128. $pattern = '!<img.*?src="(.*?)"!';
  129. preg_match_all($pattern, $the_content, $matches);
  130. $image_src = $matches['1'][0]; ?>
  131.                
  132.     <?php if($image_src != '') { ?><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
  133. <img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=<?php echo $image_src; ?>&amp;w=<?php echo $width; ?>&amp;h=<?php echo $height; ?>&amp;zc=1&amp;q=100"
  134.     alt="<?php the_title(); ?>" class="left" width="<?php echo $width; ?>px" height="<?php echo $height; ?>px"  /></a><?php } ?>
  135.  
  136.     <?php } ?>
  137.  
  138.  
  139.         <?php $status = get_settings ( "cp_excerptColumn" );        if ( $status != "no" ) { ?>
  140.         <?php the_excerpt() ?>
  141.         <?php } ?>
  142.     </div>
  143.    
  144.     <?php if( $odd = $i%2 ) { } else { echo '</div>'; } ?>
  145.        
  146.       <?php $i++; endwhile; ?>
  147.      
  148.  
  149.     <?php if( $odd = $i%2 ) { } else { echo '</div>'; } ?>
  150.            
  151.     <div id="navigation">
  152.     <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
  153.    
  154.     </div>
  155.  
  156.    
  157.     <?php endif; ?>
  158.     </div>
  159.  
  160.     <?php } else { ?>
  161.  
  162.     <div id="paged-list">  
  163.     <?php add_filter('post_limits', 'my_post_limit'); ?>
  164.    
  165.     <?php
  166.         global $myOffset;
  167.         $myOffset = 1;
  168.         $temp = $wp_query;
  169.         $wp_query= null;
  170.         $wp_query = new WP_Query();
  171.         $wp_query->query(array(
  172.                 'offset' => $myOffset,
  173.                 'category__not_in' => array($ar_headline,$ar_featured),
  174.                 'paged' => $paged,
  175.                 )); ?>
  176.  
  177.         <?php if (have_posts()) : ?>
  178.  
  179.         <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>  
  180.         <?php global $ar_ID; global $post; $ar_ID[] = $post->ID; ?>
  181.        
  182.         <div class="onecolumn clearfloat">
  183.    
  184.         <span class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></span>
  185.         <div class="meta"><?php the_time(get_option('date_format')); ?> &#150; <?php the_time(); ?> | <?php comments_popup_link(__('No Comment','arthemia'), __('One Comment','arthemia'), __('% Comments','arthemia'));?> | <?php if(function_exists('the_views')) { the_views(); } ?></div>
  186.    
  187.     <?php $width = get_settings ( "cp_thumbWidth_Column" );
  188.         $height = get_settings ( "cp_thumbHeight_Column" );
  189.         if ( $width == 0 ) { $width = 80; }
  190.         if ( $height == 0 ) { $height = 80; }
  191.     ?>
  192.  
  193.     <?php $status = get_settings ( "cp_thumbAuto" );
  194.         if ( $status != "first" ) { ?>
  195.  
  196.     <?php
  197.     //Check if custom field key "Image" has a value
  198.     $values = get_post_custom_values("Image");
  199.     if (isset($values[0])) {
  200.     ?>
  201.         <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=/<?php
  202. $values = get_post_custom_values("Image"); echo $values[0]; ?>&amp;w=<?php echo $width; ?>&amp;h=<?php echo $height; ?>&amp;zc=1&amp;q=100"
  203. alt="<?php the_title(); ?>" class="left" width="<?php echo $width; ?>px" height="<?php echo $height; ?>px"  /></a>
  204.         <?php } ?>
  205.  
  206.     <?php } else { ?>
  207.  
  208.     <?php $id =$post->ID;
  209. $the_content =$wpdb->get_var("SELECT post_content FROM $wpdb->posts WHERE ID = $id");
  210. $pattern = '!<img.*?src="(.*?)"!';
  211. preg_match_all($pattern, $the_content, $matches);
  212. $image_src = $matches['1'][0]; ?>
  213.                
  214.     <?php if($image_src != '') { ?><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
  215. <img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=<?php echo $image_src; ?>&amp;w=<?php echo $width; ?>&amp;h=<?php echo $height; ?>&amp;zc=1&amp;q=100"
  216.     alt="<?php the_title(); ?>" class="left" width="<?php echo $width; ?>px" height="<?php echo $height; ?>px"  /></a><?php } ?>
  217.  
  218.     <?php } ?>
  219.  
  220.  
  221.         <?php $status = get_settings ( "cp_excerptColumn" );        if ( $status != "no" ) { ?>
  222.         <?php the_excerpt() ?>
  223.         <?php } ?>
  224.         </div>
  225.            
  226.         <?php endwhile; ?>
  227.            
  228.         <div id="navigation">
  229.         <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?></div>
  230.  
  231.         <?php endif; ?>
  232.  
  233.     </div>
  234.    
  235.     <?php } ?> 
  236.  
  237.     <?php $wp_query = null; $wp_query = $temp;?>
  238.     <?php remove_filter('post_limits', 'my_post_limit'); ?>
  239.  
  240.     </div>
  241.     <?php get_sidebar(); ?>
  242.  
  243.     </div> 
  244.  
  245. <?php get_footer(); ?>
  246.  
RAW Paste Data