Advertisement
Guest User

single-tavling.php

a guest
May 28th, 2013
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 10.35 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3.         <!--///////////////////////////// Main Content Area //////////////////////////////////-->
  4.  
  5.         <!-- Main Content Wrapper Start -->
  6.         <div class="container" role="main">
  7.             <!-- Main Content -->
  8.             <section id="main-content" class="row">
  9.                            
  10.                 <div id="content" class="span8">
  11.                  
  12.                     <div class="post-single" id="post">
  13.                         <div class="content-outer">
  14.                             <div class="content-inner">
  15.                            
  16.                                 <?php if (have_posts()) :
  17.  
  18.                                     while (have_posts()) : the_post(); ?>
  19.                                
  20.                                
  21.                                 <article id="contest-<?php the_id(); ?>">
  22.                                 <span class="contest-status status-active"></span>
  23.                                     <div class="article-header">
  24.                                         <h1 class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Direktlänk till <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
  25.                                         <ul class="article-info">
  26.                                             <li><span class="icon ent-user"></span>MrFilm</li>
  27.                                             <li><span class="icon ent-pencil"></span><?php edit_post_link('Redigera', '', ''); ?></li>
  28.                                         </ul>
  29.                                         <div class="separator"></div>
  30.                                     </div>
  31.  
  32.                                        <div class="article-packshot">
  33.                                        <a href="<?php the_permalink() ?>" title="Direktlänk till <?php the_title_attribute(); ?>">
  34.                                           <img src="<?php echo get_post_meta($post->ID, '_cmeta_contest_packshot', true); ?>" />
  35.                                        </a>
  36.                                        </div>
  37.  
  38.                                     <div class="article-content">
  39.                                    
  40.                                     <?php if (get_post_meta($post->ID, '_cmeta_contest_wysiwyg', true) !== '') {
  41.                                         echo get_post_meta($post->ID, '_cmeta_contest_wysiwyg', true); }
  42.                                     else { ?>
  43.                                         <p>Vi på MrFilm har tillsammans med <?php echo get_post_meta($post->ID, '_cmeta_contest_company', true); ?> annordnat en <?php echo get_post_meta($post->ID, '_cmeta_contest_adj', true); ?> <a href="http://www.imdb.com/title/<?php echo get_post_meta($post->ID, '_cmeta_contest_imdb', true); ?>/"><?php the_title(); ?></a>-tävling.</p>
  44.                                         <p><strong>Vinster i potten</strong>: <?php echo get_post_meta($post->ID, '_cmeta_contest_x_win', true); ?> <?php echo get_post_meta($post->ID, '_cmeta_contest_win', true); ?>.</p>
  45.                                     <?php } ?>
  46.  
  47.                                         <div class="accordion contest-meta-info">
  48.                                         <div class="accordion-heading">
  49.                                             <h4><a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne"><span class="icon ent-plus"></span>
  50. Läs mer om &quot;<?php the_title(); ?>&quot;</a></h4>
  51.                                         </div>
  52.                                         <div id="collapseOne" class="accordion-body collapse">
  53.                                             <div class="accordion-inner">
  54.                                             <blockquote>
  55.                                                 <p><?php echo get_post_meta($post->ID, '_cmeta_contest_synopsis', true); ?></p>
  56.                                             </blockquote>
  57.                                             <span class="imdbRatingPlugin" data-user="ur7617002" data-title="<?php echo get_post_meta($post->ID, '_cmeta_contest_imdb', true); ?>" data-style="p4">
  58.                                             <a href="http://www.imdb.com/title/<?php echo get_post_meta($post->ID, '_cmeta_contest_imdb', true); ?>/?ref_=plg_rt_1">
  59.                                                 <img src="http://g-ecx.images-amazon.com/images/G/01/imdb/plugins/rating/images/imdb_31x14.png" alt="IMDb" />
  60.                                             </a>
  61.                                             </span>
  62.                                             <script>
  63.                                             (function(d,s,id){var js,stags=d.getElementsByTagName(s)[0];if(d.getElementById(id)){return;}js=d.createElement(s);js.id=id;js.src="http://g-ec2.images-amazon.com/images/G/01/imdb/plugins/rating/js/rating.min.js";stags.parentNode.insertBefore(js,stags);})(document,'script','imdb-rating-api');
  64.                                             </script>
  65.                                            
  66.                                             <?php if ( function_exists( 'sharing_display' ) ) remove_filter( 'the_content', 'sharing_display', 19 );
  67.                                             echo apply_filters( 'the_content', get_post_meta($post->ID, '_cmeta_contest_trailer', true)); ?>
  68.                                             </div>
  69.                                         </div>
  70.                                         </div>
  71.                                        
  72.                                         <p>För att vara med och tävla, fyll i formuläret nedan. Vi behöver ha era svar senast <strong><?php the_time('j/n-Y') ?></strong>.</p>
  73.                                        
  74.                                             <fieldset class="contest-form-frame"><legend>Tävlingsformulär</legend>
  75.                                            
  76.                                             <?php
  77.                                             // Get question and type Q1
  78.                                             if (get_post_meta($post->ID, '_cmeta_contest_q1_type', true) !== 'field') {
  79.                                                 $question1 = "type='radio' options='". get_post_meta($post->ID, '_cmeta_contest_q1_radio', true) ."'";
  80.                                             } else {
  81.                                                 $question1 = "type='text'";
  82.                                             }
  83.                                            
  84.                                             $cq1 = get_post_meta($post->ID, '_cmeta_contest_q1', true);
  85.                                            
  86.                                             // Get question and type Q2
  87.                                             if (get_post_meta($post->ID, '_cmeta_contest_q2_type', true) !== 'field') {
  88.                                                 $question2 = "type='radio' options='". get_post_meta($post->ID, '_cmeta_contest_q2_radio', true) ."'";
  89.                                             } else {
  90.                                                 $question2 = "type='text'";
  91.                                             }
  92.                                            
  93.                                             $cq2 = get_post_meta($post->ID, '_cmeta_contest_q2', true);
  94.  
  95.                                             // Get question and type Q3
  96.                                             if (get_post_meta($post->ID, '_cmeta_contest_q3_type', true) !== 'field') {
  97.                                                 $question3 = "type='radio' options='". get_post_meta($post->ID, '_cmeta_contest_q3_radio', true) ."'";
  98.                                             } else {
  99.                                                 $question3 = "type='text'";
  100.                                             }
  101.                                            
  102.                                             $cq3 = get_post_meta($post->ID, '_cmeta_contest_q3', true);
  103.                                            
  104.                                             // Get contest form title
  105.                                             $contest_title = the_title_attribute( 'echo=0' );
  106.                                                
  107.                                             echo do_shortcode("
  108.                                                 [contact-form to='tavling@mrfilm.se' subject='". $contest_title ."']
  109.                                                 [contact-field label='". $cq1 ."' ". $question1 ." required='1'/]
  110.                                                 [contact-field label='". $cq2 ."' ". $question2 ." required='1'/]
  111.                                                 [contact-field label='". $cq3 ."' ". $question3 ." required='1'/]
  112.                                                 [contact-field label='Namn och adress' type='textarea' required='1'/]
  113.                                                 [contact-field label='E-postadress' type='email' required='1'/]
  114.                                                 [/contact-form]
  115.                                             ") ?>
  116.                                             </fieldset>
  117.                                        
  118.                                         <p><em><strong>Lycka till!</strong></em></p>
  119.                                        
  120.                                         <p><em>&copy; <?php echo get_post_meta($post->ID, '_cmeta_contest_copyright', true); ?></em></p>
  121.                                        
  122.                                         <?php the_tags('<div class="post-tags"><span class="icon ent-tag"></span> ', ', ', '</div>'); ?>
  123.  
  124.                                   </div>
  125.  
  126.                                     <div class="separator"></div>
  127.                                     <?php if ( function_exists( 'sharing_display' ) ) echo sharing_display(); ?>
  128.                                   <div class="prisjakt">
  129.                                     <img src="http://imp.affiliator.com/imp.php?a=18883&b=524&w=27470&p=41" width="0" height="0" /><script type="text/javascript" src="http://extern.prisjakt.nu/produkt_extern.php?type=info2&p=<?php echo get_post_meta($post->ID, '_cmeta_contest_product', true); ?>&clickTAG=http://click.affiliator.com/click/a/18883/b/524/w/27470/p/41//direct_link/"></script>
  130.                                   </div>
  131.                                   <div class="separator"></div>
  132.                                   <div class="related-items visible-desktop">
  133.                                     <h5>Du kanske gillar</h5>
  134.                                       <ul class="related-posts related-rec">
  135.                                           <?php
  136.                                             $related = get_posts( array( 'post_type' => array('recension'), 'orderby' => 'rand', 'category__in' => wp_get_post_categories($post->ID), 'numberposts' => 5, 'post__not_in' => array($post->ID) ) );
  137.                                             if( $related ) foreach( $related as $post ) {
  138.                                             setup_postdata($post);
  139.                                           ?>
  140.                                             <!-- Related article item -->
  141.                                             <li>
  142.                                               <a class="post-related-item" href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>">
  143.                                                   <img src="<?php echo get_post_meta($post->ID, '_rmeta_rec_packshot', true); ?>" />
  144.                                                   <span><?php the_title(); ?></span>
  145.                                               </a>
  146.                                             </li>
  147.                                             <!-- End - Related article item -->
  148.                                           <?php } wp_reset_postdata(); ?>                                      
  149.                                       </ul>
  150.                                     </div>
  151.                                    
  152.                                 </article>
  153.  
  154.                                 <?php endwhile; endif; ?>
  155.                                
  156.                             </div>
  157.  
  158.                             <!-- content inner -->
  159.                         </div>
  160.                         <!-- content outer -->
  161.                     </div>
  162.                    
  163.                 </div>
  164.                
  165. <?php get_sidebar(); ?>
  166.  
  167.             </section>
  168.             <!-- End Main Content -->
  169.  
  170.         </div>
  171.         <!-- Main Content Wrapper End -->
  172.  
  173. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement