function cp_addnew_dropdown_child_categories()
{
    global $cp_options;
    if ('POST' != $_SERVER['REQUEST_METHOD']) {
        die(json_encode(array('success' => false, 'message' => __('Sorry, only post method allowed.', APP_TD))));
    }
    $parent_cat = isset($_POST['cat_id']) ? (int) $_POST['cat_id'] : 0;
    if ($parent_cat < 1) {
        die(json_encode(array('success' => false, 'message' => __('Sorry, item does not exist.', APP_TD))));
    }
    $terms = (array) get_terms(APP_TAX_CAT, array('child_of' => $parent_cat, 'hide_empty' => 0));
    if (empty($terms)) {
        die(json_encode(array('success' => false, 'message' => __('Sorry, no results found.', APP_TD))));
    }
    $args = array('show_option_none' => __('Select one', APP_TD), 'class' => 'dropdownlist', 'id' => 'ad_cat_id', 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 0, 'hierarchical' => 1, 'depth' => 1, 'echo' => 0, 'taxonomy' => APP_TAX_CAT, 'child_of' => $parent_cat);
    $result = cp_dropdown_categories_prices($args);
    // return the result to the ajax post
    die(json_encode(array('success' => true, 'html' => $result)));
}
									<div class="ad-static-field"><?php 
cp_cost_per_listing();
?>
</div>
									<div class="clr"></div>
								</li>

								<li>
									<div class="labelwrapper"><label><?php 
_e('Select a Category', APP_TD);
?>
</label></div>
									<div id="ad-categories" style="display:block; margin-left:170px;">
										<div id="catlvl0">
											<?php 
cp_dropdown_categories_prices();
?>
											<div style="clear:both;"></div>
										</div>
									</div>
									<div id="ad-categories-footer" class="button-container">
										<input type="submit" name="getcat" id="getcat" class="btn_orange" value="<?php 
_e('Go &rsaquo;&rsaquo;', APP_TD);
?>
" />
										<div id="chosenCategory"><input id="ad_cat_id" name="cat" type="input" value="-1" /></div>
										<div style="clear:both;"></div>
									</div>
									<div style="clear:both;"></div>
								</li>
Ejemplo n.º 3
0
 <?php 
    // printf(__('for %s days', 'appthemes'), get_option('cp_prun_period'));
    ?>
                            <div class="clr"></div>
                        </li>

                        <li>
                            <div class="labelwrapper"><label><?php 
    _e('Select a Category:', 'appthemes');
    ?>
</label></div>
                            <div id="ad-categories" style="display:block; margin-left:170px;">						
                                <div id="catlvl0">
                                <?php 
    if (get_option('cp_price_scheme') == 'category' && get_option('cp_enable_paypal') == 'yes' && get_option('cp_ad_parent_posting') != 'no') {
        cp_dropdown_categories_prices('show_option_none=' . __('Select one', 'appthemes') . '&class=dropdownlist&orderby=name&order=ASC&hide_empty=0&hierarchical=1&taxonomy=' . APP_TAX_CAT . '&depth=1');
    } else {
        wp_dropdown_categories('show_option_none=' . __('Select one', 'appthemes') . '&class=dropdownlist&orderby=name&order=ASC&hide_empty=0&hierarchical=1&taxonomy=' . APP_TAX_CAT . '&depth=1');
    }
    ?>
                                <div style="clear:both;"></div>
                                </div>
                            </div>    
                            <div id="ad-categories-footer" style="display:block-inline; float:left; margin-left:170px; width: 314px;">
                            	<input type="submit" name="getcat" id="getcat" class="btn_orange" value="<?php 
    _e('Go', 'appthemes');
    ?>
&rsaquo;&rsaquo;" />
	                            <div id="chosenCategory"><input id="cat" name="cat" type="input" value="-1" /></div>
                                <div style="clear:both;"></div>
                            </div>
Ejemplo n.º 4
0
 function cp_getChildrenCategories()
 {
     $parentCat = $_POST['catID'];
     $result = '';
     if ($parentCat < 1) {
         die($result);
     }
     //$result .= '<!-- Looking for child categories for category ID: '.$parentCat.' -->'.PHP_EOL;
     if (get_categories('taxonomy=' . APP_TAX_CAT . '&child_of=' . $parentCat . '&hide_empty=0')) {
         if (get_option('cp_price_scheme') == 'category' && get_option('cp_charge_ads') == 'yes' && get_option('cp_ad_parent_posting') != 'no') {
             $result .= cp_dropdown_categories_prices('show_option_none=' . __('Select one', APP_TD) . '&class=dropdownlist&orderby=name&order=ASC&hide_empty=0&hierarchical=1&taxonomy=' . APP_TAX_CAT . '&depth=1&echo=0&child_of=' . $parentCat);
         } else {
             $result .= wp_dropdown_categories('show_option_none=' . __('Select one', APP_TD) . '&class=dropdownlist&orderby=name&order=ASC&hide_empty=0&hierarchical=1&taxonomy=' . APP_TAX_CAT . '&depth=1&echo=0&child_of=' . $parentCat) . "\n" . '<div style="clear:both;">';
         }
     } else {
         die('');
     }
     //return the result to the ajax post
     die($result);
 }
Ejemplo n.º 5
0
        $terms = wp_get_post_terms($_GET['renew'], APP_TAX_CAT);
        $category = !empty($terms) ? $terms[0] : false;
    }
    if (!isset($_GET['renew']) || !$category || isset($_GET['action']) && $_GET['action'] == 'change') {
        ?>

			<li>
				<div class="labelwrapper"><label><?php 
        _e('Select a Category:', APP_TD);
        ?>
</label></div>
				<div id="ad-categories" style="display:block; margin-left:170px;">						
					<div id="catlvl0">
						<?php 
        $args = array('show_option_none' => __('Select one', APP_TD), 'class' => 'dropdownlist', 'id' => 'ad_cat_id', 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 0, 'hierarchical' => 1, 'depth' => 1, 'taxonomy' => APP_TAX_CAT);
        cp_dropdown_categories_prices($args);
        ?>
						<div style="clear:both;"></div>
					</div>
				</div>
				<div id="ad-categories-footer" class="button-container">
					<input type="submit" name="getcat" id="getcat" class="btn_orange" value="<?php 
        _e('Go &rsaquo;&rsaquo;', APP_TD);
        ?>
" />
					<div id="chosenCategory"><input id="ad_cat_id" name="cat" type="input" value="-1" /></div>
					<div style="clear:both;"></div>
				</div>
				<div style="clear:both;"></div>
			</li>