wp/wp-content/themes/themeforest-2964855-scrn-responsive-single-page-portfolio/SCRN/index.php
changeset 8 c7c34916027a
parent 7 cf61fcea0001
child 9 177826044cd9
equal deleted inserted replaced
7:cf61fcea0001 8:c7c34916027a
     1 <?php 
       
     2 global $scrn;
       
     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             $scrn = get_option('scrn');
       
    13             $name = esc_html($_POST['name']);
       
    14             $email = esc_html($_POST['email']);
       
    15             $comment = esc_html($_POST['comment']);
       
    16             $msg = esc_attr('Name: ', 'SCRN') . $name . PHP_EOL;
       
    17             $msg .= esc_attr('E-mail: ', 'SCRN') . $email . PHP_EOL;
       
    18             $msg .= esc_attr('Message: ', 'SCRN') . $comment;
       
    19             $to = $scrn['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($scrn['pages_topmenu']) && $scrn['pages_topmenu'] != '' )
       
    41             query_posts(array( 'post_type' => 'page', 'post__in' => $scrn['pages_topmenu'], 'posts_per_page' => count($scrn['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 class="bg <?php if(isset($temp['variation']) && $temp['variation'] == 2) echo 'dark-bg';?>" id="<?php echo $post->post_name;?>"
       
    49             <?php if(isset($temp['variation']) && $temp['variation'] == 3) { 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                         <h2>
       
    55                             <span class="lines">
       
    56                                 <?php $top_title = get_post_meta($post->ID, 'top_title', true); 
       
    57                                 if($top_title != '') echo $top_title; else the_title();?>
       
    58                             </span>
       
    59                         </h2>
       
    60                  </div> <!-- end sixteen columns -->
       
    61 
       
    62                  <div class="clear"></div>
       
    63 
       
    64             <?php global $more; $more = 0; the_content('');?>
       
    65                 
       
    66             </div> <!-- end container -->
       
    67         </div> <!-- end bg -->
       
    68         <div id="separator1">
       
    69             <div class="bg<?php echo ($i+1); echo ' bg';?>" style="<?php if(isset($temp['slogan_bg']) && $temp['slogan_bg'] != '') echo 'background-image: url(\'' . $temp['slogan_bg'] . '\')';?> "></div>
       
    70             <p class="separator"><?php if(isset($temp['slogan']) && $temp['slogan'] != '') echo $temp['slogan'];?></p>
       
    71         </div>
       
    72     <?php $i++; endwhile; wp_reset_query(); ?>
       
    73 
       
    74     <div id="contact" class="dark-bg">
       
    75         <div class="container">
       
    76         
       
    77             <div class="sixteen columns">
       
    78                 <h2 class="white"><span class="lines"><?php _e('Contact', 'SCRN');?></span></h2>
       
    79             </div> <!-- end sixteen columns -->
       
    80 
       
    81             <?php if(isset($scrn['contact_description']) && $scrn['contact_description'] != '') { ?>
       
    82                 <div class="sixteen columns">
       
    83                     <p><?php echo esc_attr($scrn['contact_description']);?></p>
       
    84                 </div> <!-- end sixteen columns -->
       
    85             <?php } ?>
       
    86             
       
    87             <div class="clear"></div>
       
    88             
       
    89             <div class="eight columns">
       
    90                 <div class="contact-form">
       
    91                     
       
    92                     <div class="done">
       
    93                         <?php _e('<b>Thank you!</b> I have received your message.', 'SCRN');?> 
       
    94                     </div>
       
    95                 
       
    96                     <form method="post" action="process.php">
       
    97                         <p><?php _e('name', 'SCRN');?></p>
       
    98                         <input type="text" name="name" class="text" />
       
    99                         
       
   100                         <p><?php _e('email', 'SCRN');?></p>
       
   101                         <input type="text" name="email" class="text" id="email" />
       
   102 
       
   103                         <p><?php _e('message', 'SCRN');?></p>
       
   104                         <textarea name="comment" class="text"></textarea>
       
   105 
       
   106                         <input type="submit" id="submit" value="<?php _e('send', 'SCRN');?>" class="submit-button" />
       
   107                     </form>
       
   108                         
       
   109                 </div> <!-- end contact-form -->
       
   110             </div> <!-- end eight columns -->
       
   111             
       
   112             <div class="eight columns">
       
   113                 
       
   114                 <div class="contact-info">
       
   115                     
       
   116                     <h5><?php _e('Contact Info', 'SCRN');?></h5>
       
   117                 
       
   118                     <?php if(isset($scrn['phone']) && $scrn['phone'] != '') { ?><p class="white"><img src="<?php echo get_stylesheet_directory_uri();?>/images/icn-phone.png" alt="" /> <?php echo $scrn['phone'];?></p><?php } ?>
       
   119                     <?php if(isset($scrn['email']) && $scrn['email'] != '') { ?><p class="white"><img src="<?php echo get_stylesheet_directory_uri();?>/images/icn-email.png" alt="" /> <a href="mailto:<?php echo $scrn['email'];?>"><?php echo encEmail($scrn['email']);?></a></p><?php } ?>
       
   120                     <?php if(isset($scrn['location']) && $scrn['location'] != '') { ?><p class="white"><img src="<?php echo get_stylesheet_directory_uri();?>/images/icn-address.png" alt="" /> <?php echo $scrn['location'];?></p><?php } ?>
       
   121                 </div> <!-- end contact-info -->
       
   122                 
       
   123                 <div class="social">
       
   124                     <ul>
       
   125                         <?php if(isset($scrn['twitter_username'])  && $scrn['twitter_username'] != '') { ?><li><a href="http://twitter.com/<?php echo $scrn['twitter_username'];?>"><img src="<?php echo get_stylesheet_directory_uri();?>/images/icn-twitter2.png" alt="" /></a></li><?php } ?>
       
   126                         <?php if(isset($scrn['facebook_url'])  && $scrn['facebook_url'] != '') { ?><li><a href="<?php echo $scrn['facebook_url'];?>"><img src="<?php echo get_stylesheet_directory_uri();?>/images/icn-facebook2.png" alt="" /></a></li><?php } ?>
       
   127                         <?php if(isset($scrn['gplus_url'])  && $scrn['gplus_url'] != '') { ?><li><a href="<?php echo $scrn['gplus_url'];?>"><img src="<?php echo get_stylesheet_directory_uri();?>/images/icn-gplus.png" alt="" /></a></li><?php } ?>
       
   128                         <?php if(isset($scrn['linkedin_url'])  && $scrn['linkedin_url'] != '') { ?><li><a href="<?php echo $scrn['linkedin_url'];?>"><img src="<?php echo get_stylesheet_directory_uri();?>/images/icn-linkedin.png" alt="" /></a></li><?php } ?>
       
   129                         <?php if(isset($scrn['forrst_url'])  && $scrn['forrst_url'] != '') { ?><li><a href="<?php echo $scrn['forrst_url'];?>"><img src="<?php echo get_stylesheet_directory_uri();?>/images/icn-forrst.png" alt="" /></a></li><?php } ?>
       
   130                         <?php if(isset($scrn['skype_url'])  && $scrn['skype_url'] != '') { ?><li><a href="<?php echo $scrn['skype_url'];?>"><img src="<?php echo get_stylesheet_directory_uri();?>/images/icn-skype.png" alt="" /></a></li><?php } ?>
       
   131                         <?php if(isset($scrn['dribbble_url'])  && $scrn['dribbble_url'] != '') { ?><li><a href="<?php echo $scrn['dribbble_url'];?>"><img src="<?php echo get_stylesheet_directory_uri();?>/images/icn-dribbble.png" alt="" /></a></li><?php } ?>
       
   132                         <?php if(isset($scrn['pinterest_url'])  && $scrn['pinterest_url'] != '') { ?><li><a href="<?php echo $scrn['pinterest_url'];?>"><img src="<?php echo get_stylesheet_directory_uri();?>/images/icn-pinterest.png" alt="" /></a></li><?php } ?>
       
   133                         <?php if(isset($scrn['vimeo_url'])  && $scrn['vimeo_url'] != '') { ?><li><a href="<?php echo $scrn['vimeo_url'];?>"><img src="<?php echo get_stylesheet_directory_uri();?>/images/icn-vimeo.png" alt="" /></a></li><?php } ?>
       
   134                     </ul>
       
   135                 </div> <!-- end social -->
       
   136                 
       
   137             </div> <!-- end eight columns -->
       
   138             
       
   139             <div class="clear"></div>
       
   140 
       
   141             <div class="sixteen columns">
       
   142                 <div class="copyright">
       
   143                     <p>&copy; <?php the_time("Y");?> <?php _e('All Rights Reserved', 'SCRN');?>, <?php _e('designed by ', 'SCRN');?> <a href="http://teothemes.com">TeoThemes</a></p>
       
   144                 </div>
       
   145             </div>
       
   146             
       
   147             
       
   148         </div> <!-- end container -->
       
   149         
       
   150     </div> <!-- end contact -->
       
   151 
       
   152     
       
   153     
       
   154 <?php get_footer();?>