Exemplo n.º 1
0
 function cp_show_default_form()
 {
     global $wpdb;
     // now we should have the formid so show the form layout based on the category selected
     $sql = $wpdb->prepare("SELECT field_label, field_name, field_type, field_values, field_tooltip, field_req, field_min_length " . "FROM {$wpdb->cp_ad_fields} " . "WHERE field_core = '1' " . "ORDER BY field_id asc");
     $results = $wpdb->get_results($sql);
     if ($results) {
         // loop through the custom form fields and display them
         echo cp_formbuilder($results);
     } else {
         echo appthemes_nl2br(__('ERROR: no results found for the default ad form.', 'appthemes') . "\n\n");
     }
 }
 function cp_show_default_form($renew = false)
 {
     global $wpdb;
     // now we should have the formid so show the form layout based on the category selected
     $sql = "SELECT * FROM {$wpdb->cp_ad_fields} WHERE field_core = '1' ORDER BY field_id asc";
     $results = $wpdb->get_results($sql);
     if ($results) {
         // loop through the custom form fields and display them
         echo cp_formbuilder($results, $renew);
     } else {
         echo __('ERROR: no results found for the default ad form.', APP_TD) . '<br />';
     }
 }
Exemplo n.º 3
0
 function cp_show_default_form($listing)
 {
     $form_fields = cp_get_custom_form_fields();
     if ($form_fields) {
         // loop through the custom form fields and display them
         cp_formbuilder($form_fields, $listing);
     } else {
         echo __('ERROR: no results found for the default ad form.', APP_TD) . '<br />';
     }
 }
Exemplo n.º 4
0
								<?php 
    // we first need to see if this ad is using a custom form
    // so lets search for a catid match and return the id if found
    $fid = cp_get_form_id($getad->term_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 = "SELECT field_label, field_name, field_type, field_values, field_tooltip, field_req FROM {$wpdb->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->cp_ad_fields} f " . "INNER JOIN {$wpdb->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);
    if ($results) {
        // build the edit ad form
        cp_formbuilder($results, $getad);
    }
    // check and make sure images are allowed
    if (get_option('cp_ad_images') == 'yes') {
        if (appthemes_plupload_is_enabled()) {
            echo appthemes_plupload_form($getad->ID);
        } else {
            $imagecount = cp_get_ad_images($getad->ID);
            // print out image upload fields. pass in count of images allowed
            echo cp_ad_edit_image_input_fields($imagecount);
        }
    } else {
        ?>

										<div class="pad10"></div>
										<li>
Exemplo n.º 5
0
?>
</p>

						<form name="mainform" id="mainform" class="form_edit" action="<?php 
echo appthemes_get_step_url();
?>
" method="post" enctype="multipart/form-data">
							<?php 
wp_nonce_field($action);
?>

							<ol>

							<?php 
if ($form_fields) {
    cp_formbuilder($form_fields, $listing);
} else {
    cp_show_default_form($listing);
}
// check and make sure images are allowed
if ($cp_options->ad_images) {
    if (appthemes_plupload_is_enabled()) {
        appthemes_plupload_form($listing->ID);
    } else {
        $images_count = cp_get_ad_images($listing->ID);
        // print out image upload fields. pass in count of images allowed
        cp_ad_edit_image_input_fields($images_count);
    }
} else {
    ?>
Exemplo n.º 6
0
 function cp_edit_ad_formbuilder($fields, $post)
 {
     _deprecated_function(__FUNCTION__, '3.2.1', 'cp_formbuilder');
     cp_formbuilder($fields, $post);
 }
Exemplo n.º 7
0
 function cp_edit_ad_formbuilder($results, $post)
 {
     _deprecated_function(__FUNCTION__, '3.2.1', 'cp_formbuilder');
     include_once TEMPLATEPATH . '/includes/forms/step-functions.php';
     return cp_formbuilder($results, $post);
 }
Exemplo n.º 8
0
 function cp_edit_ad_formbuilder($results, $post)
 {
     _deprecated_function(__FUNCTION__, '3.2.1', 'cp_formbuilder');
     require_once get_template_directory() . '/includes/forms/step-functions.php';
     return cp_formbuilder($results, $post);
 }