Advertisement
sanshr

search.php

May 13th, 2013
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.58 KB | None | 0 0
  1. <?php
  2. //set theme options
  3. $oswc_ad_shuffle=$oswc_ads['ad_shuffle'];
  4. $oswc_ad1 = $oswc_ads['ad1'];
  5. $oswc_ad2 = $oswc_ads['ad2'];
  6. $oswc_ad3 = $oswc_ads['ad3'];
  7. $oswc_ad4 = $oswc_ads['ad4'];
  8. $oswc_ad5 = $oswc_ads['ad5'];
  9. $oswc_ad6 = $oswc_ads['ad6'];
  10. $oswc_ad7 = $oswc_ads['ad7'];
  11. $oswc_ad8 = $oswc_ads['ad8'];
  12. $oswc_ad9 = $oswc_ads['ad9'];
  13. $oswc_ad10 = $oswc_ads['ad10'];
  14. $oswc_search_sidebar_unique = $oswc_other['search_sidebar_unique'];
  15. $oswc_search_meta_enabled = $oswc_other['search_meta_enabled'];
  16. $oswc_search_excerpt_enabled = $oswc_other['search_excerpt_enabled'];
  17. $oswc_search_more_enabled = $oswc_other['search_more_enabled'];
  18. $oswc_trending_show = $oswc_other['search_trending_enabled'];
  19. $oswc_skin = $oswc_misc['skin'];
  20.  
  21. //setup ad array
  22. $ads=array();
  23. if($oswc_ad1!='') array_push($ads,$oswc_ad1);
  24. if($oswc_ad2!='') array_push($ads,$oswc_ad2);
  25. if($oswc_ad3!='') array_push($ads,$oswc_ad3);
  26. if($oswc_ad4!='') array_push($ads,$oswc_ad4);
  27. if($oswc_ad5!='') array_push($ads,$oswc_ad5);
  28. if($oswc_ad6!='') array_push($ads,$oswc_ad6);
  29. if($oswc_ad7!='') array_push($ads,$oswc_ad7);
  30. if($oswc_ad8!='') array_push($ads,$oswc_ad8);
  31. if($oswc_ad9!='') array_push($ads,$oswc_ad9);
  32. if($oswc_ad10!='') array_push($ads,$oswc_ad10);
  33. if($oswc_ad_shuffle) {
  34.     shuffle($ads);
  35. }
  36. ?>
  37. <?php
  38. get_header(); // show header
  39.  
  40. // user specified a unique search sidebar
  41. if ($oswc_search_sidebar_unique) {
  42.     $sidebar="Search Sidebar";
  43. } else {
  44.     $sidebar="Default Sidebar";
  45. }
  46. ?>
  47.  
  48. <div class="main-content-left">
  49.        
  50.     <div class="post-loop search-loop">
  51.  
  52.         <div class="ribbon-shadow-left">&nbsp;</div>      
  53.        
  54.         <div class="section-wrapper">
  55.        
  56.             <div class="section">
  57.            
  58.                 <?php _e( 'Search Results', 'made' ); ?>
  59.            
  60.             </div>        
  61.        
  62.         </div>
  63.        
  64.         <div class="ribbon-shadow-right">&nbsp;</div>  
  65.    
  66.         <div class="section-arrow">&nbsp;</div>
  67.            
  68.         <?php if (have_posts()) : while (have_posts()) : the_post(); $postcount++; ?>
  69.  
  70. $options = get_post_meta($_GET['formid'], 'awqsf-relbool', true);
  71. if(isset($_GET['wqsfsubmit']) && $_GET['wqsfsubmit']==$options[0]['button']){
  72. include(TEMPLATEPATH . '/search-phones.php');
  73. }else{
  74. include(TEMPLATEPATH . '/search.php');
  75. }
  76.  
  77. $thisPostType = get_post_type(); //get post type
  78.             $thisReviewType = $oswcPostTypes->get_type_by_id($thisPostType); //get review type object  
  79.             $isreview=false;
  80.             if($thisPostType!='post' && $thisPostType!='page' && $thisPostType!='attachment') $isreview=true; //set review variable
  81.             if($isreview) {
  82.                 $icon = $thisReviewType->icon;
  83.                 $icon_light = $thisReviewType->icon_light; 
  84.                 if($oswc_skin=="dark") $icon=$icon_light;  
  85.                 $cat = $thisReviewType->name;
  86.             } else {
  87.                 $cats = get_the_category();
  88.                 $cat = $cats[0]->cat_name; 
  89.             }
  90.             //show rating?
  91.             $rating_hide = get_post_meta($post->ID, "Hide Rating", $single = true);
  92.             //check if this is a video post
  93.             $isvideo=false;
  94.             $video = get_post_meta($post->ID, "Video", $single = true);
  95.             if($video!="") $isvideo=true;  
  96.             ?>         
  97.         <div class="post-panel<?php if(!$oswc_search_more_enabled) { ?> no-more<?php } ?>">
  98.            
  99.                 <div class="post-thumbnail">
  100.    
  101.                     <a class="darken small<?php if($isvideo) { ?> video<?php } ?>" href="<?php the_permalink(); ?>"><?php the_post_thumbnail('single-small', array( 'title'=> '' )); ?></a>
  102.                    
  103.                 </div>
  104.                
  105.                 <div class="inner">
  106.                                            
  107.                     <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
  108.                    
  109.                     <?php if($oswc_search_meta_enabled) { ?>
  110.                    
  111.                         <div class="category">
  112.                        
  113.                             <?php if($isreview) { ?>
  114.                                    
  115.                                 <div class="icon" style="background:url(<?php echo $icon; ?>) no-repeat 0px 0px;">&nbsp;</div>
  116.                                
  117.                             <?php } ?>
  118.                            
  119.                             <div class="catname">
  120.                                        
  121.                                 <?php echo $cat; ?>
  122.                                
  123.                             </div>
  124.                                                              
  125.                         </div>
  126.                        
  127.                         <?php if($rating_hide!="true" && $isreview) { ?>
  128.                      
  129.                             <div class="rating-wrapper small"><?php $oswcPostTypes->the_rating($thisReviewType); // show the rating ?></div>
  130.                            
  131.                         <?php } ?>
  132.                        
  133.                         <?php if(comments_open()) { ?>
  134.                                    
  135.                             <div class="comments">
  136.                            
  137.                                 <?php comments_popup_link(__('0 comments','made'), __('1 comment','made'), __('% comments','made'), '', '-'); ?>
  138.                            
  139.                             </div>
  140.                            
  141.                         <?php } ?>
  142.                        
  143.                         <div class="date">
  144.                                    
  145.                             <?php echo get_the_date(); ?>
  146.                            
  147.                         </div>
  148.                    
  149.                     <?php } ?>
  150.                    
  151.                     <?php if($oswc_search_more_enabled) { ?>
  152.                    
  153.                         <div class="more"><a href="<?php the_permalink(); ?>"><?php _e('More','made'); ?></a></div>
  154.                        
  155.                     <?php } ?>
  156.                    
  157.                     <?php if($oswc_search_excerpt_enabled) { ?>
  158.                    
  159.                         <div class="excerpt"><?php oswc_search_excerpt(); ?></div>
  160.                        
  161.                     <?php } ?>
  162.                    
  163.                 </div>
  164.                
  165.                 <br class="clearer" />                    
  166.                
  167.             </div>
  168.            
  169.             <br class="clearer" />
  170.            
  171.         <?php endwhile;
  172.         else: ?>
  173.            
  174.             <div class="page-content">
  175.            
  176.                 <h2><?php _e('No search results found. Please try your search again.','made'); ?></h2>
  177.                
  178.                 <br />
  179.                
  180.                 <div class="searchform">
  181.            
  182.                     <!-- SEARCH -->  
  183.                     <form method="get" id="search404" action="<?php echo home_url(); ?>/">                            
  184.                         <input type="text" value="<?php _e( 'search', 'made' ); ?>" onfocus="if (this.value == '<?php _e( 'search', 'made' ); ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e( 'search', 'made' ); ?>';}" name="s" id="s" />          
  185.                     </form>
  186.                    
  187.                 </div>
  188.                
  189.                 <div class="note">
  190.                
  191.                     <?php _e( 'Enter keyword(s) and press enter', 'made' ); ?>
  192.                    
  193.                 </div>
  194.                
  195.             </div>
  196.        
  197.         <?php endif; ?>  
  198.            
  199.         <br class="clearer" />
  200.            
  201.         <?php // pagination
  202.         pagination($wp_query->max_num_pages);
  203.         ?>
  204.        
  205.         <br class="clearer" />
  206.        
  207.     </div>
  208.    
  209.     <br class="clearer" />
  210.    
  211.     <?php if($oswc_trending_show) { ?>
  212.    
  213.         <?php oswc_get_template_part('trending'); // show trending ?>
  214.        
  215.     <?php } ?>
  216.  
  217. </div>
  218.  
  219. <div class="sidebar">
  220.  
  221.     <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar($sidebar) ) : else : ?>
  222.    
  223.         <div class="widget-wrapper">
  224.    
  225.             <div class="widget">
  226.    
  227.                 <div class="section-wrapper"><div class="section">
  228.                
  229.                     <?php _e(' Made Magazine ', 'made' ); ?>
  230.                
  231.                 </div></div>
  232.                
  233.                 <div class="textwidget">  
  234.                                              
  235.                     <p><?php _e( 'This is a widget panel. To remove this text, login to your WordPress admin panel and go to Appearance >> Widgets, and drag &amp; drop a widget into the corresponding widget panel.', 'made' ); ?></p>
  236.                    
  237.                 </div>
  238.                            
  239.             </div>
  240.        
  241.         </div>
  242.    
  243.     <?php endif; ?>
  244.  
  245. </div>
  246.  
  247. <br class="clearer" />
  248.  
  249. <?php get_footer(); // show footer ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement