Fanatic (December 9th, 2012), kilador (April 28th, 2013), paulogoode (December 11th, 2012), rubencio (May 11th, 2013), talent (April 28th, 2013)
$message .= '-----------------------------------------' . "\r\n";
//MOD START ==================================================================================================================
$message .= __('SELLER INFORMATION FOR THIS LISTING:', 'appthemes') . "\r\n\r\n";
global $wpdb;
$category = stripslashes( appthemes_get_custom_taxonomy($postID, APP_TAX_CAT, 'term_id') );
//Get form ID from ad category, If you have special form comment out line below
$fid = cp_get_form_id($category);
//If you have special form uncomment line below and enter form ID
//$fid = 1;
// 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 "
. "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);
// get results from db
$results = $wpdb->get_results($sql);
if($results) {
foreach ($results as $result) {
//we are don't want to display title, description and tags
if( $result->field_name == 'post_title' || $result->field_name == 'post_content' || $result->field_name == 'tags_input' )
continue;
// now grab all ad fields and print out the field label and value
$post_meta_val = get_post_meta($postID, $result->field_name, true);
//Field title
$message .= stripslashes( strip_tags( translate( $result->field_label, 'appthemes' ) ) ) . ': ';
//Field value
$message .= ( !empty( $post_meta_val ) ) ? stripslashes( strip_tags( $post_meta_val ) ) : __('N/A', 'appthemes');
//break line
$message .= "\r\n";
}
}
$message .= '-----------------------------------------' . "\r\n";
//MOD END ==================================================================================================================
//Get form ID from ad category, If you have special form comment out line below
$fid = cp_get_form_id($category);
//Get form ID from ad category, If you have special form comment out line below
//$fid = cp_get_form_id($category);
//If you have special form uncomment line below and enter form ID
//$fid = 1;
//If you have special form uncomment line below and enter form ID
$fid = 1;
arthemes.org - AppThemes plugins, tutorials, modifications and services |
Fanatic (December 9th, 2012), kilador (April 28th, 2013), paulogoode (December 11th, 2012), rubencio (May 11th, 2013), talent (April 28th, 2013)
dikiyforester (November 20th, 2012)
There are currently 1 users browsing this thread. (0 members and 1 guests)