Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $post;
- $post_id = $_POST['post_id'];
- //var_dump( $post_id );
- if( count( $post_id ) > 0 ) {
- ?>
- <?php get_header(); ?>
- <div class="content">
- <div class="content_botbg">
- <div class="compare_container">
- <table id="hor-minimalist-a">
- <tr>
- <th>Title</th>
- <th>City</th>
- <th>State</th>
- <th>Country</th>
- <th>Price</th>
- </tr>
- <?php
- $count = 0;
- foreach( $post_id as $entry ) {
- $post = get_post( $entry );
- setup_postdata( $post );
- //var_dump( $post );
- ?>
- <tr>
- <td><a href="#" class="search_post_title"><?php the_title(); ?></a></td>
- <td><?php echo get_post_meta($post->ID, 'cp_city', true); ?></td>
- <td><?php echo get_post_meta($post->ID, 'cp_state', true); ?></td>
- <td><?php echo get_post_meta($post->ID, 'cp_country', true); ?></td>
- <td><?php echo get_post_meta($post->ID, 'cp_price', true); ?></td>
- </tr>
- <tr class="ad_details">
- <td colspan="6">
- <div class="detail-container">
- <div class="price-wrap">
- <span class="tag-head"> </span><p class="post-price"><?php if ( get_post_meta( $post->ID, 'price', true ) ) cp_get_price_legacy( $post->ID ); else cp_get_price( $post->ID, 'cp_price' ); ?></p>
- </div>
- <h1 class="single-ad"><a href="<?php get_permalink( $post->ID ) ?>" title="<?php echo get_the_title( $post->ID ); ?>"><?php echo get_the_title( $post->ID ); ?></a></h1>
- <div class="pad5 dotted"></div>
- <div class="bigright">
- <ul>
- <?php
- // grab the category id for the functions below
- $cat_id = appthemes_get_custom_taxonomy( $post->ID, APP_TAX_CAT, 'term_id' );
- // check to see if ad is legacy or not
- if ( get_post_meta($post->ID, 'expires', true) ) { ?>
- <li><span><?php _e('Location:', 'appthemes') ?></span> <?php echo get_post_meta($post->ID, 'location', true); ?></li>
- <li><span><?php _e('Phone:', 'appthemes') ?></span> <?php echo get_post_meta($post->ID, 'phone', true); ?></li>
- <?php if(get_post_meta($post->ID, 'cp_adURL', true)) ?>
- <li><span><?php _e('URL:','appthemes'); ?></span> <?php echo appthemes_make_clickable( get_post_meta( $post->ID, 'cp_adURL', true ) ); ?></li>
- <li><span><?php _e('Listed:', 'appthemes') ?></span> <?php the_time( get_option('date_format') . ' ' . get_option('time_format') ) ?></li>
- <li><span><?php _e('Expires:', 'appthemes') ?></span> <?php echo cp_timeleft( strtotime( get_post_meta( $post->ID, 'expires', true ) ) ); ?></li>
- <?php
- } else {
- if ( get_post_meta($post->ID, 'cp_ad_sold', true) == 'yes' ) : ?>
- <li id="cp_sold"><span><?php _e('This item has been sold', 'appthemes'); ?></span></li>
- <?php endif; ?>
- <?php
- // 3.0+ display the custom fields instead (but not text areas)
- cp_get_ad_details( $post->ID, $cat_id );
- ?>
- <li id="cp_listed"><span><?php _e('Listed:', 'appthemes') ?></span> <?php the_time( get_option('date_format') . ' ' . get_option('time_format') ) ?></li>
- <?php if ( get_post_meta($post->ID, 'cp_sys_expire_date', true) ) ?>
- <li id="cp_expires"><span><?php _e('Expires:', 'appthemes') ?></span> <?php echo cp_timeleft( strtotime( get_post_meta( $post->ID, 'cp_sys_expire_date', true) ) ); ?></li>
- <?php
- } // end legacy check
- ?>
- </ul>
- </div><!-- /bigright -->
- <?php if ( get_option('cp_ad_images') == 'yes' ) : ?>
- <div class="bigleft">
- <div id="main-pic">
- <?php cp_get_image_url(); ?>
- <div class="clr"></div>
- </div>
- <div id="thumbs-pic">
- <?php if ( get_post_meta($post->ID, 'images', true) ) echo cp_get_image_thumbs_legacy( $post->ID, get_option('thumbnail_size_w'), get_option('thumbnail_size_h'), $post->post_title ); else cp_get_image_url_single( $post->ID, 'thumbnail', $post->post_title, -1 ); ?>
- <div class="clr"></div>
- </div>
- </div><!-- /bigleft -->
- <?php endif; ?>
- <div class="clr"></div>
- <div class="single-main">
- <?php
- // 3.0+ display text areas in content area before content.
- cp_get_ad_details( $post->ID, $cat_id, 'content' );
- ?>
- <h3 class="description-area"><?php _e('Description','appthemes'); ?></h3>
- <?php echo $post->post_content; ?>
- </div>
- </div> <!-- detail-container -->
- </td>
- </tr> <!-- ad_details -->
- <?php } //foreach ?>
- </table>
- </div> <!-- .compare_container -->
- <div class="clr"></div>
- </div> <!-- .content_botbg -->
- </div> <!-- .content -->
- <style type="text/css">
- .compare_container {
- background: #FFFFFF;
- border: 1px solid #DDDDDD;
- border-radius: 5px 5px 5px 5px;
- margin: 40px auto;
- overflow: hidden;
- padding: 10px 15px;
- width: 960px;
- }
- .compare {
- border: 1px solid #DDDDDD;
- border-radius: 5px 5px 5px 5px;
- float: left;
- margin-right: 15px;
- margin-bottom: 15px;
- padding: 10px;
- width: 440px;
- }
- div.bigleft {
- background: none repeat scroll 0 0 #FFFFFF;
- border-color: #DEDEDE;
- border-radius: 6px 6px 6px 6px;
- border-style: solid;
- border-width: 1px;
- float: left;
- margin-top: 20px;
- padding: 5px;
- width: 220px;
- }
- div.bigright ul {
- padding-left: 5px;
- }
- div.bigright {
- float: right;
- margin-top: 18px;
- width: 195px;
- }
- #hor-minimalist-a {
- font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
- font-size: 12px;
- background: #fff;
- margin: 0 0 20px 0;
- width: 100%;
- border-collapse: collapse;
- text-align: left;
- border: 1px solid #ccc;
- }
- #hor-minimalist-a th {
- font-size: 14px;
- font-weight: normal;
- color: #039;
- padding: 10px 8px;
- border-bottom: 2px solid #6678b1;
- }
- #hor-minimalist-a td {
- color: #669;
- padding: 9px 8px 0px 8px;
- }
- #hor-minimalist-a tbody tr:hover td {
- color: #009;
- }
- tr.ad_details {
- display: none;
- }
- </style>
- <script type="text/javascript">
- jQuery(document).ready(function($) {
- $('a.search_post_title').click(function(){
- $(this).parents('tr').next('tr.ad_details').slideToggle('slow');
- return false;
- });
- });
- </script>
- <?php get_footer(); ?>
- <?php } //count ?>
Advertisement
Add Comment
Please, Sign In to add comment