/** * add the ad price field in the loop before the ad title * @since 3.1.3 */ function cp_ad_loop_price() { if (is_page()) { return; } // don't do ad-meta on pages global $post; if ($post->post_type == 'page' || $post->post_type == 'post') { return; } ?> <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> <?php }
/** * add the ad price field in the loop before the ad title * @since 3.1.3 */ function cp_ad_loop_price() { if (is_page()) { return; } // don't do ad-meta on pages global $post; ?> <div class="price-wrap"> <span class="tag-head"> </span><p class="post-price"> <span style="font-size:10px;"><?php echo get_post_meta($post->ID, 'cp_divisa', true); ?> </span> <?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> <?php }
/** * add the ad price field in the loop before the ad title * @since 3.1.3 */ function cp_ad_loop_price() { global $post; if ($post->post_type == 'page' || $post->post_type == 'post') { return; } ?> <div class="price-wrap"> <span class="tag-head"> </span><p class="post-price"><?php cp_get_price($post->ID, 'cp_price'); ?> </p> </div> <?php }
/** * add the ad price field in the loop before the ad title * @since 3.1.3 */ function cp_ad_loop_price() { global $post; // don't add the ad price to pages and posts if (is_page()) { return; } if ($post->post_type == 'page' || $post->post_type == 'post') { return; } ?> <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($post->ID, 'price'); } else { cp_get_price($post->ID, 'cp_price'); } ?> </p> </div> <?php }
function cp_custom_fields_meta_box() { global $wpdb, $post, $meta_boxes, $key; // use nonce for verification wp_nonce_field(basename(__FILE__), $key . '_wpnonce', false, true); // get the ad category id $ad_cat_id = appthemes_get_custom_taxonomy($post->ID, APP_TAX_CAT, 'term_id'); // get the form id $fid = cp_get_form_id($ad_cat_id); // if there's no form id it must mean the default form is being used so let's go grab those fields if (!$fid) { // use this if there's no custom form being used and give us the default form $sql = $wpdb->prepare("SELECT field_label, field_name, field_type, field_values, field_tooltip, field_req " . "FROM " . $wpdb->prefix . "cp_ad_fields " . "WHERE field_core = '1' " . "ORDER BY field_id asc"); } else { // now we should have the formid so show the form layout based on the category selected $sql = $wpdb->prepare("SELECT f.field_label, f.field_name, f.field_type, f.field_values, f.field_perm, f.field_tooltip, m.meta_id, m.field_pos, m.field_req, m.form_id " . "FROM " . $wpdb->prefix . "cp_ad_fields f " . "INNER JOIN " . $wpdb->prefix . "cp_ad_meta m " . "ON f.field_id = m.field_id " . "WHERE m.form_id = %s " . "ORDER BY m.field_pos asc", $fid); } $results = $wpdb->get_results($sql); // display the write panel for the custom fields if ($results) { ?> <script type="text/javascript"> //<![CDATA[ /* initialize the datepicker feature */ jQuery(document).ready(function($) { $('table input#datepicker').datetimepicker({ showSecond: true, timeFormat: 'hh:mm:ss', showOn: 'button', dateFormat: 'mm/dd/yy', minDate: 0, buttonImageOnly: true, buttonText: '', buttonImage: '../wp-includes/images/blank.gif' // calling the real calendar image in the admin-style.css. need a blank placeholder image b/c of IE. }); }); //]]> </script> <table class="form-table ad-meta-table"> <tr> <th style="width:20%"><label for="cp_sys_ad_conf_id"><?php _e('Ad Info', 'appthemes'); ?> :</label></th> <td class="ad-conf-id"> <div id="ad-id"><div id="keyico"></div><?php _e('Ad ID', 'appthemes'); ?> : <span><?php echo esc_html(get_post_meta($post->ID, 'cp_sys_ad_conf_id', true)); ?> </span></div> <div id="ad-stats"><div id="statsico"></div><?php _e('Views Today', 'appthemes'); ?> : <strong><?php echo esc_html(get_post_meta($post->ID, 'cp_daily_count', true)); ?> </strong> | <?php _e('Views Total:', 'appthemes'); ?> <strong><?php echo esc_html(get_post_meta($post->ID, 'cp_total_count', true)); ?> </strong></div> </td> </tr> <tr> <th style="width:20%"><label for="cp_sys_ad_conf_id"><?php _e('Submitted By', 'appthemes'); ?> :</label></th> <td style="line-height:3.4em;"> <?php // show the gravatar for the author echo get_avatar($post->post_author, $size = '48', $default = ''); // show the author drop-down box wp_dropdown_users(array('who' => 'authors', 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author, 'include_selected' => true)); // display the author display name $author = get_userdata($post->post_author); echo '<br/><a href="user-edit.php?user_id=' . $author->ID . '">' . $author->display_name . '</a>'; ?> </td> </tr> <tr> <th style="width:20%"><label for="cp_sys_ad_conf_id"><?php _e('Ad Terms', 'appthemes'); ?> :</label></th> <td><?php echo cp_get_price($post->ID, 'cp_sys_total_ad_cost'); ?> <?php _e('for', 'appthemes'); ?> <?php echo esc_html(get_post_meta($post->ID, 'cp_sys_ad_duration', true)); ?> <?php _e('days', 'appthemes'); ?> </td> </tr> <tr> <th style="width:20%"><label for="cp_sys_expire_date"><?php _e('Ad Expires', 'appthemes'); ?> :</label></th> <td><input readonly type="text" name="cp_sys_expire_date" class="text" id="datepicker" value="<?php echo esc_html(get_post_meta($post->ID, 'cp_sys_expire_date', true)); ?> " /></td> </tr> <tr> <th colspan="2" style="padding:0px;"> </th> </tr> <?php cp_edit_ad_fields($results, $post->ID); // build the edit ad meta box ?> <tr> <th style="width:20%"><label for="cp_sys_userIP"><?php _e('Submitted from IP', 'appthemes'); ?> :</label></th> <td><?php echo esc_html(get_post_meta($post->ID, 'cp_sys_userIP', true)); ?> </td> </tr> </table> <?php } ?> <?php }
function xtremecarousel() { global $wpdb, $post; ?> <?php if (is_home()) { query_posts(array('post__in' => get_option('sticky_posts'), 'post_type' => APP_POST_TYPE, 'post_status' => 'publish', 'orderby' => 'rand', 'posts_per_page' => 20)); } else { if (is_tax()) { $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy')); query_posts(array('post__in' => get_option('sticky_posts'), 'post_type' => APP_POST_TYPE, 'post_status' => 'publish', 'orderby' => 'rand', 'posts_per_page' => '-1', 'posts_per_page' => 20, 'ad_cat' => $term->slug)); } } if (have_posts()) { ?> <div id="services-example-1" class="theme1"> <ul> <?php while (have_posts()) { the_post(); ?> <?php $attachment = get_posts(array('post_type' => 'attachment', 'post_status' => null, 'order' => 'ASC', 'orderby' => 'menu_order', 'post_mime_type' => 'image', 'post_parent' => $post->ID)); if ($attachment) { $url_thumb = TT . '?src=' . wp_get_attachment_url($attachment[0]->ID, false) . '&h=110&w=150'; $url = TT . '?src=' . wp_get_attachment_url($attachment[0]->ID, false) . '&h=280&w=498'; } else { $url_thumb = get_bloginfo('template_url') . '/images/no-thumb.jpg'; $url = TT . '?src=' . get_bloginfo('template_url') . '/images/no-thumb.jpg&h=280&w=498&zc=3'; } ?> <!-- SLIDES --> <li> <img class="thumb" src="<?php echo $url_thumb; ?> " data-bw="<?php echo $url_thumb; ?> "> <div style="margin-top:16px"></div> <a id="rb_title"><?php if (mb_strlen(get_the_title()) >= 14) { echo mb_substr(get_the_title(), 0, 14) . '...'; } else { the_title(); } ?> </a> <p id="rb_xtrmcarousel"> Under: <?php if (get_the_category()) { the_category(', '); } else { echo get_the_term_list($post->ID, APP_TAX_CAT, '', ', ', ''); } ?> <br /> By: <span class="owner"><?php the_author_posts_link(); ?> </span><br /> <span class="rb_price">Price: <?php if (get_post_meta($post->ID, 'price', true)) { cp_get_price_legacy($post->ID); } else { cp_get_price($post->ID, 'cp_price'); } ?> </span> </p> <a class="buttonlight morebutton" href="#">View More</a> <!-- EXTRA SHOWN IN "BUTTON" EVENT --> <div class="page-more"> <a href="<?php the_permalink(); ?> "> <img class="big-image" src="<?php echo $url; ?> "> </a> <div class="details_double"> <?php //livechat $meta_values = get_post_meta($post->ID, 'myplugin_new_field', true); if (!empty($meta_values)) { $meta_values = htmlspecialchars_decode($meta_values); echo '<div class = "dazake_live_chat_page" >'; echo $meta_values; echo '</div>'; } ?> <h2><a id="rb_title_inside" href="<?php the_permalink(); ?> "><?php if (mb_strlen(get_the_title()) >= 60) { echo mb_substr(get_the_title(), 0, 60) . '...'; } else { the_title(); } ?> </a></h2> <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> <p id="rb_xtrmcarousel_inside"> Under: <?php if (get_the_category()) { the_category(', '); } else { echo get_the_term_list($post->ID, APP_TAX_CAT, '', ', ', ''); } ?> <br /> By: <span class="owner"><?php the_author_posts_link(); ?> </span><br /> On: <?php echo appthemes_date_posted($post->post_date); ?> <br /> </p> <p id="rb_xtrmcarousel_description"> <?php $tcontent = strip_tags(get_the_content()); if (mb_strlen($tcontent) >= 200) { echo mb_substr($tcontent, 0, 200) . '...'; } else { echo $tcontent; } ?> </p> <a class="buttonlight" href="<?php the_permalink(); ?> ">Go to Ad Details</a> </div> <div class="closer"></div> </div> </li> <?php } ?> </ul> <!-- TOOLBAR (LEFT/RIGHT) BUTTONS --> <div class="toolbar"> <div class="left"></div><div class="right"></div> </div> <div class="clr"></div> </div><!-- services-example-1 --> <script type="text/javascript"> jQuery(document).ready(function() { jQuery.noConflict(); jQuery('#services-example-1').services( { width:900, height:290, slideAmount:5, slideSpacing:20, touchenabled:"on", mouseWheel:"on", slideshow:6000, callBack:function() { } }); }); </script> <?php wp_reset_query(); } else { $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy')); query_posts(array('post_type' => APP_POST_TYPE, 'post_status' => 'publish', 'orderby' => 'rand', 'posts_per_page' => '-1', 'ad_cat' => $term->slug)); } }
cp_get_price_legacy($post->ID); } else { cp_get_price($post->ID, 'cp_price'); } ?> </p> <?php } else { ?> <span class="tag-head"></span><p class="post-price-sticky"><?php if (get_post_meta($post->ID, 'price', true)) { cp_get_price_legacy($post->ID); } else { cp_get_price($post->ID, 'cp_price'); } ?> </p> <?php } ?> <div class="clr"></div> <p class="post-meta"><span class="folder"><?php if (get_the_category()) { the_category(', '); } else {
?> "><a title="Remove horse" class="badge closebtn" onclick="removehorsefromshow('<?php echo $id; ?> ','<?php echo $sid; ?> ','<?php echo $current_user->ID; ?> ');">Remove horse</a></span> <?php } ?> <span class="price_span" style="float:right;">Price:<?php cp_get_price($id, 'cp_price'); ?> </span> <div class="<?php cp_display_style(array('ad_images', 'ad_class')); ?> "> <h3><a href="<?php the_permalink(); ?>
/** * Get the ad price and position the currency symbol. * Meta field 'price' used on CP 2.9.3 and earlier * * @deprecated 3.2 * @deprecated Use cp_get_price() * @see cp_get_price() * * @param int $post_id * * @return string */ function cp_get_price_legacy($post_id) { _deprecated_function(__FUNCTION__, '3.2', 'cp_get_price'); return cp_get_price($post_id, 'price'); }
function cp_custom_columns($column) { global $post; $custom = get_post_custom(); switch ($column) { case 'cp_sys_expire_date': if (isset($custom['cp_sys_expire_date'][0]) && !empty($custom['cp_sys_expire_date'][0])) { echo appthemes_display_date($custom['cp_sys_expire_date'][0]); } break; case 'cp_price': cp_get_price($post->ID, 'cp_price'); break; case 'cp_daily_count': if (isset($custom['cp_daily_count'][0]) && !empty($custom['cp_daily_count'][0])) { echo $custom['cp_daily_count'][0]; } break; case 'cp_total_count': if (isset($custom['cp_total_count'][0]) && !empty($custom['cp_total_count'][0])) { echo $custom['cp_total_count'][0]; } break; case APP_TAX_TAG: echo get_the_term_list($post->ID, APP_TAX_TAG, '', ', ', ''); break; case APP_TAX_CAT: echo get_the_term_list($post->ID, APP_TAX_CAT, '', ', ', ''); break; } }
/** * Displays ad listing custom columns data. * * @param string $column_index * @param int $post_id * * @return void */ function cp_ad_listing_add_column_data($column_index, $post_id) { $post = get_post($post_id); if (!$post) { return; } $post_meta = get_post_custom($post_id); switch ($column_index) { case 'cp_sys_expire_date': if (isset($post_meta['cp_sys_expire_date'][0]) && !empty($post_meta['cp_sys_expire_date'][0])) { echo appthemes_display_date($post_meta['cp_sys_expire_date'][0]); } break; case 'cp_price': cp_get_price($post->ID, 'cp_price'); break; case 'cp_daily_count': if (isset($post_meta['cp_daily_count'][0]) && !empty($post_meta['cp_daily_count'][0])) { echo $post_meta['cp_daily_count'][0]; } break; case 'cp_total_count': if (isset($post_meta['cp_total_count'][0]) && !empty($post_meta['cp_total_count'][0])) { echo $post_meta['cp_total_count'][0]; } break; } }
/** * add the ad price field in the loop before the ad title * @since 3.1.3 */ function cp_ad_loop_price() { global $post; if ($post->post_type == 'page' || $post->post_type == 'post') { return; } //$current_list_price=get_post_meta( $post->ID, 'cp_price' );// returns array $current_list_price = ''; $cp_price_display_model = get_post_meta($post->ID, 'cp_price_display_model'); if (is_array($cp_price_display_model)) { $cp_price_display_model = $cp_price_display_model[0]; } //if($cp_price_display_model=='Show Actual Price') // checking added below, the cp_get_price function will autoprint the value // $current_list_price=$current_list_price; ///else if ($cp_price_display_model == 'Inquire for Price') { $current_list_price = 'Inquire'; } elseif ($cp_price_display_model == 'Four figures 9999 or less') { $current_list_price = '9999 or less'; } elseif ($cp_price_display_model == 'Low five figures 10000-19999') { $current_list_price = '10000-19999'; } elseif ($cp_price_display_model == 'Mid low five figures 20000-39999') { $current_list_price = '20000-39999'; } elseif ($cp_price_display_model == 'Mid five figures 40000-59999') { $current_list_price = '40000-59999'; } elseif ($cp_price_display_model == 'Mid high five figures 60000-79999') { $current_list_price = '60000-79999'; } elseif ($cp_price_display_model == 'High five figures 80000-999999') { $current_list_price = '80000-999999'; } elseif ($cp_price_display_model == 'Six figures +100000 or more') { $current_list_price = '100000+'; } ?> <div class="price-wrap"> <span class="tag-head"> </span><p class="post-price"><?php if ($cp_price_display_model == 'Show Actual Price' || $cp_price_display_model == '') { cp_get_price($post->ID, 'cp_price'); } else { echo $current_list_price; } ?> </p> </div> <?php }