Results 1 to 2 of 2

Thread: Ad Listing Page Help Needed

  1. #1
    Thread Starter
    Senior Member webcrafty's Avatar
    Join Date
    Aug 2011
    Location
    Ireland
    Posts
    114
    Thanks
    4
    Thanked 2 Times in 2 Posts

    Question Ad Listing Page Help Needed

    Hi Guys,
    Im having some problems with my ad listing page. I have modified it a little to ad related links (youtube and external links) but for some reason in the past few days I have noticed it is not pulling the Ad Reference, Post Tags or Number of views.

    I have attached the code for the page, Cant paste it in here as it is too big, maybe some of you could help me out by having a look at it and see if you can find if I have deleted something or over written something I should not have. Below is also a screen shot of an ad which I know has tags and a ref no and has been viewed several times.

    Code:
    <?php get_header(); ?>
    
    <script type='text/javascript'>
    // <![CDATA[
    /* setup the form validation */
    jQuery(document).ready(function ($) { 
        $('#mainform').validate({
            errorClass: 'invalid'
        });
    });
    // ]]>
    </script>
    
    <?php // if($_GET['reportpost'] == $post->ID) { app_report_post($post->ID); $reported = true;} ?>
    
    <div class="content">
    
        <div class="content_botbg">
    
            <div class="content_res">
    
                <div id="breadcrumb">
    
                    <?php if ( function_exists('cp_breadcrumb') ) cp_breadcrumb(); ?>
                      
                </div>
                  
                <!-- <div style="width: 105px; height:16px; text-align: right; float: left; font-size:11px; margin-top:-10px; padding:0 10px 5px 5px;"> -->
                    <?php // if($reported) : ?>
                        <!-- <span id="reportedPost"><?php _e('Post Was Reported', 'appthemes'); ?></span> -->
                    <?php // else : ?>
                        <!--    <a id="reportPost" href="?reportpost=<?php echo $post->ID; ?>"><?php _e('Report This Post','appthemes') ?></a> -->
                    <?php // endif; ?>
                <!-- </div> -->
                  
                <div class="clr"></div>
    
                <div class="content_left">
        
                    <?php appthemes_before_loop(); ?>
    
                    <?php if ( have_posts() ) : ?>
    
                        <?php while ( have_posts() ) : the_post() ?>
                        
                            <?php appthemes_before_post(); ?>
    
                            <?php appthemes_stats_update( $post->ID ); //records the page hit ?>
    
                            <div class="shadowblock_out">
    
                                <div class="shadowblock">
                                    
                                    <?php appthemes_before_post_title(); ?>
    
                                    <h1 class="single-ad"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
                                    
                                    <div class="clr"></div>
                                    
                                    <?php appthemes_after_post_title(); ?>
    
                                    <div class="pad5 dotted"></div>
    
                                    <div class="bigright"<?php if(get_option($GLOBALS['app_abbr'].'_ad_images') == 'no') echo 'style="float:none;"'; ?>>
        
                                        <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>
        
                                                <?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><img src="http://sellit.arignadesign.com/wp-content/uploads/2011/09/sold.png"></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' ) ) ?></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>
                                                    
                                                    <br /><br />
                                                    
                                                    <li><span><?php _e('Posted by:','appthemes');?></span>
    <?php
    // check to see if ad is legacy or not
    if ( get_post_meta($post->ID, 'name', true) ) {
    if ( get_the_author() != '' ) { ?>
    <a href="<?php echo get_author_posts_url(get_the_author_id()); ?>"><?php the_author_meta('display_name'); ?></a>
    <?php
    } else {
    echo get_post_meta($post->ID, 'name', true);
    } ?>
    
    <?php } else { ?>
    <a href="<?php echo get_author_posts_url( get_the_author_meta('ID') ); ?>"><b><?php the_author_meta('display_name'); ?></b></a>
    <?php
    }
    ?>
    </li>
    
    </ul>
    <?php
      } // end legacy check
     ?>
        <br />
     </ul>
      <p><?php if (function_exists('wpfp_link')) { wpfp_link(); } ?></p>
        
     </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>
     <?php appthemes_before_post_content(); ?>
    <div class="single-main">
             <!-- Mod For External Links -->
     <h3 class="description-area"><?php _e( 'Description', 'appthemes' ); ?></h3>
    <?php the_content(); ?>
                                        
     </div>   <br />
     <div class="shadowblock_out">
    <div class="shadowblock">
    
    <h3 class="single dotted">Related Links</h3>
                        <?php
                      // 3.0+ display text areas in content area before content.
                       cp_get_ad_details( $post->ID, $cat_id, 'content' );
                        ?>  
                            </div>
    </div>            
          <br />    
      <div class="shadowblock_out">
    <div class="shadowblock">
    <h2 class="single dotted">Related ads</h2>
    <div class="related">
    <ul>
    <?php
    $term = wp_get_object_terms($post->ID, APP_TAX_CAT);
    $parent = $term[0]->parent;
    $parents[] = $term[0]->term_id;
    
    $sql = "SELECT term_id, slug FROM `wp_terms` WHERE term_id = $parent";
    $resultat = mysql_query($sql);
    
    while($post=mysql_fetch_array($resultat)) {
    $newslug = $post['slug'];
    }
    
    $thePostID = $wp_query->post->ID;
    
    $args = array( 'numberposts' => 3, 'orderby' => 'rand', 'post_type' => APP_POST_TYPE, APP_TAX_CAT => $newslug, 'exclude' => $thePostID);
    $rand_posts = get_posts( $args );
    foreach( $rand_posts as $post ) : ?>
        <li><?php cp_ad_featured_thumbnail(); ?><a id="related-title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>
    </ul>
    
    </div>
    </div>
    </div> 
     <?php appthemes_after_post_content(); ?>
    </div><!-- /shadowblock -->
    </div><!-- /shadowblock_out -->
    <?php appthemes_after_post(); ?>
    <?php endwhile; ?>
    <?php appthemes_after_endwhile(); ?>
    <?php else: ?>
    <?php appthemes_loop_else(); ?>
    <?php endif; ?>
    <div class="clr"></div>
     <?php appthemes_after_loop(); ?>
    <?php wp_reset_query(); ?>
    <div class="clr"></div>
    <?php comments_template( '/comments-ad_listing.php' ); ?>
    </div><!-- /content_left -->
    <?php get_sidebar( 'ad' ); ?>
    <div class="clr"></div>
    </div><!-- /content_res -->
    </div><!-- /content_botbg -->
    </div><!-- /content -->
    
    <?php get_footer(); ?>
    SCREENSHOT -
    no-tags.png

    Thanks in advance.
    Ireland's New Classified Ad's website, The New way to buy and sell in Ireland ,
    http://www.sellitnow.ie

  2. #2
    Veteran barukar's Avatar
    Join Date
    Sep 2010
    Location
    Brasil, São Paulo, SP
    Posts
    6,784
    Thanks
    186
    Thanked 742 Times in 623 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    -------------------------------------------------------------------------------------------
    Projects: ClassiNoiva - Classimóveis - vocênoenem - i50 - Clube DETRAN

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Updated needed on Showcase Page
    By ddashwood in forum Showcase & Feedback
    Replies: 4
    Last Post: August 9th, 2011, 05:11 AM
  2. Links page template help needed?
    By sportingjobs in forum Report JobRoller Bugs
    Replies: 1
    Last Post: December 28th, 2010, 07:54 AM
  3. Replies: 2
    Last Post: November 12th, 2010, 09:42 AM