Guest User

Untitled

a guest
Apr 27th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.56 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Agents List
  4. */
  5. ?>
  6.  
  7. <?php
  8.  
  9. if( isset( $_REQUEST['vCard'] ) ) {
  10.  
  11.  
  12.  
  13. // Set headers to force download
  14. $now = gmdate('D, d M Y H:i:s') . ' GMT'; // Header expires
  15. header("Content-Type: text/x-vCard");
  16. header("Content-Disposition: attachment; filename=" . $the_name . "");
  17. header("Connection: close");
  18. header('Expires: ' . $now);
  19. header("Pragma: no-cache");
  20.  
  21.  
  22. makeVcard();
  23. exit;
  24. }
  25.  
  26.  
  27. ?>
  28.  
  29. <?php get_header(); ?>
  30.  
  31. <article id="leftcol" class="left">
  32.  
  33. <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  34.  
  35. <div id="">
  36. <h1><?php the_title(); ?></h1>
  37. <?php the_content(); ?>
  38.  
  39. <?php
  40.  
  41. global $wpdb;
  42. $query = "SELECT ID, user_nicename from $wpdb->users ORDER BY user_nicename";
  43. $author_ids = $wpdb->get_results($query);
  44.  
  45. foreach($author_ids as $author) : $curauth = get_userdata($author->ID);
  46.  
  47. if($curauth->user_level >= 0 && $curauth->user_level != 10) : $user_link = get_author_posts_url($curauth->ID); ?>
  48.  
  49. <div class="listing authorarchive left">
  50. <?php if($curauth->ct_profile_url) { ?>
  51. <div class="imgwrapagent left marginRight">
  52. <img id="authorimg" src="<?php bloginfo('template_directory'); ?>/img_resize/timthumb.php?src=<?php echo $curauth->ct_profile_url; ?>&h=198&w=158&q=100" />
  53. </div>
  54. <?php } ?>
  55.  
  56. <div class="textwrapagent left">
  57.  
  58. <h2><a href="<?php echo $user_link; ?>" title="<?php echo $curauth->display_name; ?>"><?php echo $curauth->display_name; ?></a></h2>
  59.  
  60. <?php if($curauth->tagline) { ?><h4><?php echo $curauth->tagline; ?></h4><?php } ?>
  61.  
  62. <h5><a href="<?php echo $user_link; ?>" title="<?php echo $curauth->display_name; ?>">View All Listings</a></h5>
  63.  
  64.  
  65. <ul class="authorDetails left">
  66.  
  67. <li class="authorPhone"><?php if($curauth->phone) { ?><?php echo $curauth->phone; ?><?php } ?>
  68. </li>
  69.  
  70. <li class="authorFax"><?php if($curauth->fax) { ?><?php echo $curauth->fax; ?><?php } ?>
  71. </li>
  72.  
  73. <li class="authorEmail"><?php if($curauth->user_email) { ?><a href="mailto:<?php echo $curauth->user_email; ?>" title="E-mail<?php echo $curauth->display_name; ?>"><?php echo $curauth->user_email; ?></a><?php } ?>
  74. </li>
  75.  
  76. <li class="authorVcard">
  77. <a href="">Download Contact Info</a>
  78. </li>
  79.  
  80.  
  81. </ul>
  82. </div>
  83.  
  84. <div class="clear"></div>
  85.  
  86. <?php if($curauth->description) { ?><p class="bio"><?php echo $curauth->description; ?><?php } ?>
  87.  
  88. </div>
  89.  
  90. <?php endif; ?>
  91.  
  92. <?php endforeach; ?>
  93.  
  94. </div>
  95.  
  96. <?php endwhile; endif; ?>
  97.  
  98. </article>
  99.  
  100. <?php get_sidebar(); ?>
  101.  
  102. <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment