Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Nov 23rd, 2012  |  syntax: PHP  |  size: 7.34 KB  |  views: 85  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. global $impress;
  3. if(isset($_POST['submit']))
  4. {
  5.     if( !$_POST['name'] || !$_POST['email'] || !$_POST['comment'] || $_POST['name'] == '' || $_POST['email'] == ''|| $_POST['comment'] == '')
  6.     {
  7.         $error = 'Please fill in all the required fields';
  8.     }
  9.     else
  10.     {
  11.             require('../../../wp-load.php');
  12.             $impress = get_option('impress');
  13.             $name = esc_html($_POST['name']);
  14.             $email = esc_html($_POST['email']);
  15.             $comment = esc_html($_POST['comment']);
  16.             $msg = esc_attr('Name: ', 'impress') . $name . PHP_EOL;
  17.             $msg .= esc_attr('E-mail: ', 'impress') . $email . PHP_EOL;
  18.             $msg .= esc_attr('Message: ', 'impress') . $comment;
  19.             $to = $impress['email'];
  20.             $sitename = is_multisite() ? $current_site->site_name : get_bloginfo('name');
  21.             $subject = '[' . $sitename . ']' . ' New Message';
  22.             $headers = 'From: ' . $name . ' <' . $email . '>' . PHP_EOL;
  23.             wp_mail($to, $subject, $msg, $headers);
  24.     }
  25. }
  26. get_header(); ?>    
  27.     <?php
  28.     if ( ( $locations = get_nav_menu_locations() ) && $locations['top-menu'] ) {
  29.         $menu = wp_get_nav_menu_object( $locations['top-menu'] );
  30.         $menu_items = wp_get_nav_menu_items($menu->term_id);
  31.         $include = array();
  32.         foreach($menu_items as $item) {
  33.             if($item->object == 'page')
  34.                 $include[] = $item->object_id;
  35.         }
  36.         query_posts( array( 'post_type' => 'page', 'post__in' => $include, 'posts_per_page' => count($include), 'orderby' => 'post__in' ) );
  37.     }
  38.     else
  39.     {
  40.         if(isset($impress['pages_topmenu']) && $impress['pages_topmenu'] != '' )
  41.             query_posts(array( 'post_type' => 'page', 'post__in' => $impress['pages_topmenu'], 'posts_per_page' => count($impress['pages_topmenu']), 'orderby' => 'menu_order', 'order' => 'ASC' ) );
  42.         else
  43.             query_posts(array( 'post_type' => 'page', 'posts_per_page' => 4, 'orderby' => 'menu_order', 'order' => 'ASC' ) );
  44.     }
  45.     $i = 1;
  46.     while(have_posts() ) : the_post(); ?>
  47.         <?php $temp = get_post_meta($post->ID, 'vp_settings', true);?>
  48.         <div <?php if($i == 1) echo 'style="margin-top: -65px"';?> class="bg" id="<?php echo $post->post_name;?>"
  49.             <?php if(isset($temp['variation']) && $temp['variation'] == 2) { echo 'style="';
  50.             if(isset($temp['background_color']) && $temp['background_color'] != '') echo 'background-color: #' . $temp['background_color'];
  51.             else if(isset($temp['background']) && $temp['background'] != '') echo 'background-image: url(\'' . $temp['background'] . '\')'; echo '"'; } ?>>
  52.             <div class="container">
  53.                 <div class="sixteen columns">
  54.                     <div class="bar" <?php if($i==1) echo 'style="margin-top: 110px"';?>>
  55.                         <h2>
  56.                             <?php $icon = get_post_meta($post->ID, 'icon', true);
  57.                             if($icon != '') echo '<img src="' . esc_attr($icon) . '" />'; ?>
  58.                                 <?php $top_title = get_post_meta($post->ID, 'top_title', true);
  59.                                 if($top_title != '') echo $top_title; else the_title();?>
  60.                         </h2>
  61.                     </div>
  62.                         <?php $description = get_post_meta($post->ID, 'description', true);
  63.                         if($description != '') { ?>
  64.                                 <p class="sub">
  65.                                     <?php echo $description; ?>
  66.                                 </p>
  67.                         <?php } ?>
  68.                  </div> <!-- end sixteen columns -->
  69.  
  70.                  <div class="clear"></div>            
  71.  
  72.             <?php global $more; $more = 0; the_content('');?>
  73.                
  74.             </div> <!-- end container -->
  75.         </div> <!-- end bg -->
  76.     <?php $i++; endwhile; wp_reset_query(); ?>
  77.  
  78.     <div id="contact">
  79.         <div class="container">
  80.             <div class="sixteen columns">
  81.                 <h2><span class="bar"></span><span class="icn_contact"></span><?php _e('Contact', 'Impress');?><span class="bar"></span></h2>
  82.                
  83.                 <?php if($impress['google_maps'] != '')
  84.                 echo $impress['google_maps'];
  85.                 else { ?>
  86.                 <iframe class="map" width="924" height="208" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/?ie=UTF8&amp;t=m&amp;ll=40.761512,-73.971827&amp;spn=0.003381,0.017231&amp;z=16&amp;output=embed"></iframe>
  87.                 <?php } ?>
  88.                
  89.             </div> <!-- end sixteen columns -->
  90.            
  91.             <div class="ten columns">
  92.                 <div class="contact_form">
  93.                     <div class="done">
  94.                         <?php _e('<b>Thank you!</b> I have received your message.', 'Impress');?>
  95.                     </div>
  96.                
  97.                     <form method="post">
  98.                         <p><?php _e('name', 'Impress');?></p>
  99.                         <input type="text" name="name" class="text" />
  100.                        
  101.                         <p><?php _e('email', 'Impress');?></p>
  102.                         <input type="text" name="email" class="text" id="email" />
  103.  
  104.                         <p><?php _e('message', 'Impress');?></p>
  105.                         <textarea name="comment" class="text textarea"></textarea>
  106.  
  107.                         <input type="submit" id="submit" value="<?php _e('send', 'Impress');?>" class="submit-button" />
  108.                     </form>
  109.                 </div> <!-- contact form -->
  110.             </div> <!-- end ten columns -->
  111.            
  112.             <div class="six columns">
  113.                 <div class="contact_info">
  114.                     <h4>Contact info</h4>
  115.                     <?php if(isset($impress['phone']) && $impress['phone'] != '') { ?><p><img src="<?php echo get_template_directory_uri() . '/images/icn_phone.png'?>" alt="" /> <?php echo $impress['phone'];?> </p> <?php } ?>
  116.                     <?php if(isset($impress['email']) && $impress['email'] != '') { ?><p><img src="<?php echo get_template_directory_uri() . '/images/icn_mail.png'?>" alt="" /> <?php echo encEmail($impress['email']);?></p> <?php } ?>
  117.                     <?php if(isset($impress['location']) && $impress['location'] != '') { ?><p><img src="<?php echo get_template_directory_uri() . '/images/icn_address.png'?>" alt="" /> <?php echo $impress['location'];?></p> <?php } ?>
  118.                 </div> <!-- end contact_info -->
  119.             </div> <!-- end seven columns -->
  120.            
  121.         </div> <!-- end container -->
  122.     </div> <!-- end about -->
  123.    
  124.     <footer>    
  125.         <div class="pixels">
  126.             <p class="pixels_notif"><?php _e('P.S - You\'ve scrolled <span id="pixels">0</span> Pixels!', 'Impress');?></p>
  127.         </div>
  128.         <div class="copyright">
  129.             <p><?php _e('&copy; 2012', 'Impress'); echo bloginfo('name'); _e('All rights reserved.', 'Impress'); _e('Powered by ', 'Impress'); ?>
  130.             <a href="http://wordpress.org">WordPress</a>,
  131.             <?php _e('developed by ', 'Impress');?>
  132.             <a href="http://teothemes.com">TeoThemes</a>
  133.             </p>
  134.         </div>
  135.     </footer>
  136.  
  137.         </div> <!-- end container -->
  138.        
  139.     </div> <!-- end contact -->
  140.  
  141.    
  142.    
  143. <?php get_footer();?>