Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: Agents List
- */
- ?>
- <?php
- if( isset( $_REQUEST['vCard'] ) ) {
- $filename = strtolower( preg_replace( '/W+/', '_', $_REQUEST['vCard'] ) );
- // Set headers to force download
- $now = gmdate('D, d M Y H:i:s') . ' GMT'; // Header expires
- header("Content-Type: text/x-vCard");
- header("Content-Disposition: attachment; filename=" . $filename . "");
- header("Connection: close");
- header('Expires: ' . $now);
- header("Pragma: no-cache");
- makeVcard();
- exit;
- }
- ?>
- <?php get_header(); ?>
- <article id="leftcol" class="left">
- <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
- <div id="">
- <h1><?php the_title(); ?></h1>
- <?php the_content(); ?>
- <?php
- global $wpdb;
- $query = "SELECT ID, user_nicename from $wpdb->users ORDER BY user_nicename";
- $author_ids = $wpdb->get_results($query);
- foreach($author_ids as $author) : $curauth = get_userdata($author->ID);
- if($curauth->user_level >= 0 && $curauth->user_level != 10) : $user_link = get_author_posts_url($curauth->ID); ?>
- <div class="listing authorarchive left">
- <?php if($curauth->ct_profile_url) { ?>
- <div class="imgwrapagent left marginRight">
- <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" />
- </div>
- <?php } ?>
- <div class="textwrapagent left">
- <h2><a href="<?php echo $user_link; ?>" title="<?php echo $curauth->display_name; ?>"><?php echo $curauth->display_name; ?></a></h2>
- <?php if($curauth->tagline) { ?><h4><?php echo $curauth->tagline; ?></h4><?php } ?>
- <h5><a href="<?php echo $user_link; ?>" title="<?php echo $curauth->display_name; ?>">View All Listings</a></h5>
- <ul class="authorDetails left">
- <li class="authorPhone"><?php if($curauth->phone) { ?><?php echo $curauth->phone; ?><?php } ?>
- </li>
- <li class="authorFax"><?php if($curauth->fax) { ?><?php echo $curauth->fax; ?><?php } ?>
- </li>
- <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 } ?>
- </li>
- <li class="authorVcard">
- <?php $author_vCard = strtolower( preg_replace( '/W+/', '_', $curauth->display_name ) );
- <a href="<?php echo add_query_arg( 'vCard', $author_vCard ); ?>">Download Contact Info</a>
- </li>
- </ul>
- </div>
- <div class="clear"></div>
- <?php if($curauth->description) { ?><p class="bio"><?php echo $curauth->description; ?><?php } ?>
- </div>
- <?php endif; ?>
- <?php endforeach; ?>
- </div>
- <?php endwhile; endif; ?>
- </article>
- <?php get_sidebar(); ?>
- <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment