Guest User

Untitled

a guest
Apr 27th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.60 KB | None | 0 0
  1. <?php
  2.  
  3. if( isset( $_REQUEST['vCard'] ) ) {
  4.  
  5.     $filename = strtolower( preg_replace( '/W+/', '_', $_REQUEST['vCard'] ) );
  6.    
  7.     // Set headers to force download       
  8.     $now = gmdate('D, d M Y H:i:s') . ' GMT'; // Header expires      
  9.     #header("Content-Type: text/x-vCard");
  10.     #header("Content-Disposition: attachment; filename=" . $filename . "");
  11.     #header("Connection: close");
  12.     #header('Expires: ' . $now);
  13.     #header("Pragma: no-cache");
  14.  
  15.     var_dump( $the_name );
  16.    
  17.     makeVcard();
  18.     exit;  
  19. }  
  20.  
  21.  ?>
  22.  
  23. <?php get_header(); ?>
  24.  
  25. <div id="listingwrap">
  26.    
  27.         <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
  28.            
  29.                
  30.                 <div id="sidebar" class="right">
  31.                
  32.                     <aside id="author-widget" class="left">
  33.                        <div id="authorinfo" class="left">
  34.                            <p id="presented"><?php _e('Agent Information', 'theme_textdomain'); ?></p>
  35.                            <p id="author"><?php the_author_meta('first_name'); ?> <?php the_author_meta('last_name'); ?></p>
  36.                             <ul class="authorDetails" class="left">
  37.                                 <?php if(get_the_author_meta('phone')) { ?>
  38.                                     <li class="authorPhone"><?php the_author_meta('phone'); ?></li>
  39.                                 <?php } ?>
  40.                                 <li class="authorListings">
  41.                                     <a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>">View All Listings</a>
  42.                                 </li>
  43.                                 <li class="authorVcard">
  44.                                    
  45.                                     <?php
  46.                                     $last = get_the_author_meta('last_name');
  47.                                     $first = get_the_author_meta('first_name');
  48.                                    
  49.                                     $the_name = $first."_".$last;
  50.                                     $the_name = strtolower( preg_replace( '/W+/', '_', $the_name ) );
  51.                                     ?>
  52.                                                                    
  53.                                     <a href="<?php echo add_query_arg('vCard', $the_name); ?>">Download Contact Info</a>
  54.                                 </li>
  55.                             </ul>
  56.                         </div>
  57.                         <?php if(get_the_author_meta('ct_profile_url')) { ?><img id="authorimg" class="right" src="<?php bloginfo('template_directory'); ?>/img_resize/timthumb.php?src=<?php the_author_meta('ct_profile_url'); ?>&h=92&w=78&zc=1" /><?php } ?>
  58.                        
  59.                     </aside>
  60.                    
  61.                     <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('Listing Sidebar') ) :else: endif; ?>
  62.                    
  63.                 </div>
  64.                
  65.                     <div class="clear"></div>
  66.                    
  67.             <?php endwhile; ?>
  68.        
  69.     </div>
  70.    
  71.         <div class="clear"></div>
  72.    
  73.        
  74.  
  75. <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment