Beispiel #1
0
function wpbusdirman_menu_button_viewlistings()
{
    echo wpbusdirman_post_menu_button_viewlistings();
}
Beispiel #2
0
 public function main_page()
 {
     $html = '';
     if (count(get_terms(WPBDP_CATEGORY_TAX, array('hide_empty' => 0))) == 0) {
         if (is_user_logged_in() && current_user_can('install_plugins')) {
             $html .= wpbdp_render_msg(_x('There are no categories assigned to the business directory yet. You need to assign some categories to the business directory. Only admins can see this message. Regular users are seeing a message that there are currently no listings in the directory. Listings cannot be added until you assign categories to the business directory.', 'templates', 'WPBDM'), 'error');
         } else {
             $html .= "<p>" . _x('There are currently no listings in the directory.', 'templates', 'WPBDM') . "</p>";
         }
     }
     if (current_user_can('administrator')) {
         if ($errors = wpbdp_payments_api()->check_config()) {
             foreach ($errors as $error) {
                 $html .= wpbdp_render_msg($error, 'error');
             }
         }
     }
     $listings = '';
     if (wpbdp_get_option('show-listings-under-categories')) {
         $listings = $this->view_listings(false);
     }
     if (current_user_can('administrator') && wpbdp_get_option('hide-empty-categories') && wp_count_terms(WPBDP_CATEGORY_TAX, 'hide_empty=0') > 0 && wp_count_terms(WPBDP_CATEGORY_TAX, 'hide_empty=1') == 0) {
         $msg = _x('You have "Hide Empty Categories" on and some categories that don\'t have listings in them. That means they won\'t show up on the front end of your site. If you didn\'t want that, click <a>here</a> to change the setting.', 'templates', 'WPBDM');
         $msg = str_replace('<a>', '<a href="' . admin_url('admin.php?page=wpbdp_admin_settings&groupid=listings#hide-empty-categories') . '">', $msg);
         $html .= wpbdp_render_msg($msg);
     }
     $html .= wpbdp_render(array('businessdirectory-main-page', 'wpbusdirman-index-categories'), array('submit_listing_button' => wpbusdirman_post_menu_button_submitlisting(), 'view_listings_button' => wpbusdirman_post_menu_button_viewlistings(), 'action_links' => wpbusdirman_post_menu_button_submitlisting() . wpbusdirman_post_menu_button_viewlistings(), 'search_form' => wpbdp_get_option('show-search-listings') ? wpbdp_search_form() : '', 'listings' => $listings));
     return $html;
 }
<div id="wpbdmentry">
	<div id="lco">
		<div class="left buttonform">
			<?php 
echo wpbusdirman_post_menu_button_submitlisting();
?>
			<?php 
echo wpbusdirman_post_menu_button_viewlistings();
?>
		</div>
		
		<div class="right">
			<form id="wpbdmsearchform" action="<?php 
echo esc_url(home_url('/'));
?>
" method="get">
			<input id="intextbox" maxlength="150" name="s" size="20" type="text" value="" />
			<input name="post_type" type="hidden" value="<?php 
echo wpbdp()->get_post_type();
?>
" />
			<input id="wpbdmsearchsubmit" class="wpbdmsearchbutton" type="submit" value="<?php 
_ex('Search Listings', 'templates', 'WPBDM');
?>
" />
			</form>
		</div>
	</div>

	<div id="wpbusdirmancats">
		<div style="clear:both;"></div>