Exemplo n.º 1
0
/**
 * Displays the non-custom fields below the main listing submission form.
 *
 * @param int $listing_id
 *
 * @return void
 */
function cp_other_fields($listing_id)
{
    global $cp_options;
    // are images on ads allowed
    if ($cp_options->ad_images) {
        if (appthemes_plupload_is_enabled()) {
            echo html('div class="ad-details-images-sep"', ' ');
            appthemes_plupload_form($listing_id);
        } else {
            $images_count = cp_get_ad_images($listing_id);
            cp_ad_edit_image_input_fields($images_count);
        }
    }
    // show the chargeable options if enabled
    if (cp_payments_is_enabled()) {
        // show the featured ad box if enabled
        if ($cp_options->sys_feat_price) {
            ?>

			<div class="ad-details-featured-sep"></div>

			<li id="list_featured_ad" class="withborder">
				<div class="labelwrapper">
					<label><?php 
            printf(__('Featured Listing %s', APP_TD), appthemes_get_price($cp_options->sys_feat_price));
            ?>
</label>
				</div>
				<div class="clr"></div>
				<input name="featured_ad" value="1" type="checkbox" <?php 
            checked(is_sticky($listing_id));
            ?>
 />
				<?php 
            _e('Your listing will appear in the featured slider section at the top of the front page.', APP_TD);
            ?>
				<div class="clr"></div>
			</li>

		<?php 
        }
        if ($cp_options->price_scheme == 'single') {
            ?>

			<li>
				<div class="labelwrapper">
					<label><?php 
            _e('Ad Package:', APP_TD);
            ?>
</label>
				</div>

				<?php 
            // go get all the active ad packs and create a drop-down of options
            $packages = cp_get_listing_packages();
            if ($packages) {
                ?>

					<select name="ad_pack_id" class="dropdownlist required">

					<?php 
                foreach ($packages as $package) {
                    // external plugins can modify or disable field
                    $result = apply_filters('cp_package_field', $package, 'ad');
                    if (!$package) {
                        continue;
                    }
                    ?>
							<option value="<?php 
                    echo esc_attr($package->ID);
                    ?>
"><?php 
                    echo esc_attr($package->pack_name);
                    ?>
</option>
						<?php 
                }
                ?>

					</select>

				<?php 
            } else {
                _e('Error: no ad pack has been defined. Please contact the site administrator.', APP_TD);
            }
            ?>

				<div class="clr"></div>
			</li>

		<?php 
        }
        ?>

	<?php 
    }
}
function cp_other_fields($renew_id = false)
{
    global $wpdb, $cp_options;
    // are images on ads allowed
    if ($cp_options->ad_images) {
        if (appthemes_plupload_is_enabled()) {
            echo appthemes_plupload_form($renew_id);
        } else {
            if ($renew_id) {
                $imagecount = cp_get_ad_images($renew_id);
                echo cp_ad_edit_image_input_fields($imagecount);
            } else {
                echo cp_image_input_fields();
            }
        }
    }
    // show the chargeable options if enabled
    if (cp_payments_is_enabled()) {
        // show the featured ad box if enabled
        if ($cp_options->sys_feat_price) {
            ?>

			<?php 
            /*?><li id="list_featured_ad" class="withborder">
            			<div class="labelwrapper">
            				<label><?php printf( __( 'Featured Listing %s', APP_TD ), appthemes_get_price( $cp_options->sys_feat_price ) ); ?></label>
            			</div>
            			<div class="clr"></div>
            			<input name="featured_ad" value="1" type="checkbox" <?php checked( isset($_POST['featured_ad']) ); ?> />
            			<?php _e( 'Your listing will appear in the featured slider section at the top of the front page.', APP_TD ); ?>
            			<div class="clr"></div>
            		</li><?php */
            ?>

		<?php 
        }
        if ($cp_options->price_scheme == 'single') {
            ?>

			<li>
				<div class="labelwrapper">
					<label><?php 
            _e('Ad Package:', APP_TD);
            ?>
</label>
				</div>

				<?php 
            // go get all the active ad packs and create a drop-down of options
            $results = $wpdb->get_results("SELECT * FROM {$wpdb->cp_ad_packs} WHERE pack_status = 'active' ORDER BY pack_id asc");
            if ($results) {
                ?>

					<select name="ad_pack_id" class="dropdownlist required">

					<?php 
                foreach ($results as $result) {
                    // external plugins can modify or disable field
                    $result = apply_filters('cp_package_field', $result, 'ad');
                    if (!$result) {
                        continue;
                    }
                    ?>
							<option value="<?php 
                    echo esc_attr($result->pack_id);
                    ?>
"><?php 
                    echo esc_attr(stripslashes($result->pack_name));
                    ?>
</option>
						<?php 
                }
                ?>

					</select>

				<?php 
            } else {
                _e('Error: no ad pack has been defined. Please contact the site administrator.', APP_TD);
            }
            ?>

				<div class="clr"></div>
			</li>

		<?php 
        }
        ?>

	<?php 
    }
    // end charge for ads check
}
Exemplo n.º 3
0
        // 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>
											<div class="labelwrapper">
												<label><?php 
        _e('Images:', APP_TD);
        ?>
</label><?php 
        _e('Sorry, image editing is not supported for this ad.', APP_TD);
        ?>
											</div>
										</li>
Exemplo n.º 4
0
function cp_other_fields($renew_id = false)
{
    global $wpdb;
    // are images on ads allowed
    if (get_option('cp_ad_images') == 'yes') {
        if (appthemes_plupload_is_enabled()) {
            echo appthemes_plupload_form($renew_id);
        } else {
            if ($renew_id) {
                $imagecount = cp_get_ad_images($renew_id);
                echo cp_ad_edit_image_input_fields($imagecount);
            } else {
                echo cp_image_input_fields();
            }
        }
    }
    // show the chargeable options if enabled
    if (get_option('cp_charge_ads') == 'yes') {
        // show the featured ad box if enabled
        if (get_option('cp_sys_feat_price')) {
            ?>

			<li id="list_featured_ad" class="withborder">
				<div class="labelwrapper">
					<label><?php 
            printf(__('Featured Listing %s', APP_TD), cp_display_price(get_option('cp_sys_feat_price'), '', false));
            ?>
</label>
				</div>
				<div class="clr"></div>
				<input name="featured_ad" value="1" type="checkbox" <?php 
            checked(isset($_POST['featured_ad']));
            ?>
 />
				<?php 
            _e('Your listing will appear in the featured slider section at the top of the front page.', APP_TD);
            ?>
				<div class="clr"></div>
			</li>

		<?php 
        }
        if (get_option('cp_price_scheme') == 'single') {
            ?>

			<li>
				<div class="labelwrapper">
					<label><?php 
            _e('Ad Package:', APP_TD);
            ?>
</label>
				</div>

				<?php 
            // go get all the active ad packs and create a drop-down of options
            $results = $wpdb->get_results("SELECT pack_id, pack_name FROM {$wpdb->cp_ad_packs} WHERE pack_status = 'active' ORDER BY pack_id asc");
            if ($results) {
                ?>

					<select name="ad_pack_id" class="dropdownlist required">

						<?php 
                foreach ($results as $result) {
                    ?>
							<option value="<?php 
                    echo esc_attr($result->pack_id);
                    ?>
"><?php 
                    echo esc_attr(stripslashes($result->pack_name));
                    ?>
</option>
						<?php 
                }
                ?>

					</select>

				<?php 
            } else {
                _e('Error: no ad pack has been defined. Please contact the site administrator.', APP_TD);
            }
            ?>

				<div class="clr"></div>
			</li>

		<?php 
        }
        ?>

		<?php 
        if (get_option('cp_enable_coupons') == 'yes') {
            ?>

			<li>
				<div class="labelwrapper">
					<label><?php 
            _e('Coupon Code:', APP_TD);
            ?>
</label>
				</div>
				<input type="text" class="text" value="" id="cp_coupon_code" name="cp_coupon_code" />
				<div class="clr"></div>
			</li>

		<?php 
        }
    }
    // end charge for ads check
}
Exemplo n.º 5
0
							<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 {
    ?>

									<div class="pad10"></div>
									<li>
										<div class="labelwrapper">
											<label><?php 
    _e('Images:', APP_TD);
    ?>
</label><?php 
    _e('Sorry, image editing is not supported for this ad.', APP_TD);
    ?>
										</div>
									</li>