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
}
function cp_other_fields()
{
    global $wpdb;
    // are images on ads allowed
    if (get_option('cp_ad_images') == 'yes') {
        echo cp_image_input_fields();
    }
    // show the featured ad box if enabled
    if (get_option('cp_sys_feat_price')) {
        ?>

        <li class="withborder">
            <div class="labelwrapper">
                <label><?php 
        _e('Featured Listing', 'appthemes');
        ?>
 <?php 
        echo cp_pos_price(get_option('cp_sys_feat_price'));
        ?>
</label>
            </div>
            <div class="clr"></div>
            <input name="featured_ad" value="1" type="checkbox" <?php 
        if (isset($_POST['featured_ad']) == '1') {
            echo 'CHECKED';
        }
        ?>
 />
            <?php 
        _e('Your listing will appear in the featured slider section at the top of the front page.', 'appthemes');
        ?>
            <div class="clr"></div>
        </li>

    <?php 
    }
    // show the payment method box if enabled
    if (get_option('cp_charge_ads') == 'yes') {
        ?>

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

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

                    <?php 
            // go get all the active ad packs and create a drop-down of options
            $results = $wpdb->get_results($wpdb->prepare("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 {
                ?>

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

              <?php 
            }
            ?>
                
                <div class="clr"></div>
            </li>

		<?php 
        }
        ?>

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

			<li>
            	<div class="labelwrapper">
					<label><?php 
            _e('Coupon Code', 'appthemes');
            ?>
:</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
}
示例#3
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
}