function bp_checkins_single_place_load_cssjs() { add_action('comment_form_after_fields', 'bp_checkins_places_geo_fields'); if (bp_checkins_if_single_place()) { wp_enqueue_script('google-maps', 'http://maps.google.com/maps/api/js?sensor=false'); wp_enqueue_script('gmap3', BP_CHECKINS_PLUGIN_URL_JS . '/gmap3.min.js', array('jquery')); wp_enqueue_script('bp-ckeckins-single', BP_CHECKINS_PLUGIN_URL_JS . '/bp-checkins-single.js'); bp_checkins_localize_script('single'); add_action('bpci_map_single', 'bp_checkins_place_map'); add_action('comment_form_top', 'bp_checkins_places_geo_fields'); wp_enqueue_style('bpcistyle', BP_CHECKINS_PLUGIN_URL_CSS . '/bpcinstyle.css'); } else { if (bp_checkins_if_category_place()) { wp_enqueue_style('bpcistyle', BP_CHECKINS_PLUGIN_URL_CSS . '/bpcinstyle.css'); wp_enqueue_script('bp-ckeckins-cats', BP_CHECKINS_PLUGIN_URL_JS . '/bp-checkins-cats.js', array('jquery')); } else { if (bp_checkins_if_place_home()) { wp_enqueue_style('bpcistyle', BP_CHECKINS_PLUGIN_URL_CSS . '/bpcinstyle.css'); wp_enqueue_script('bp-jquery-autocomplete', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.autocomplete.js', array('jquery'), '20110723'); wp_enqueue_script('bp-jquery-bgiframe', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.bgiframe.js', array(), '20110723'); wp_enqueue_script('bp-jquery-dimensions', BP_PLUGIN_URL . '/bp-messages/js/autocomplete/jquery.dimensions.js', array(), '20110723'); add_action('wp_footer', 'bp_checkins_init_autocomplete'); } } } }
function bp_checkins_is_category_place() { global $wp_query; if (bp_checkins_if_category_place()) { $wp_query->is_404 = false; $wp_query->is_archive = true; return true; } else { return false; } }
function bp_checkins_browser_header($title_and_sep, $title, $sep, $seplocation) { if (bp_checkins_if_single_place()) { $place_title = ucfirst(bp_get_checkins_slug()) . ' ' . $sep . ' Place' . $title_and_sep; $place = wp_cache_get('single_query', 'bp_checkins_single'); if (false === $place || is_null($place->query->post->ID)) { $place = new BP_Checkins_Place(); $place->get(array('p' => bp_action_variable(0))); } $place_title = apply_filters('get_the_title', $place->query->post->post_title) . ' ' . $sep . ' Place' . $title_and_sep; return $place_title; } elseif (bp_checkins_if_category_place()) { return ucfirst(bp_get_checkins_places_term_info('name', bp_action_variable(1))) . $title_and_sep; } elseif (bp_checkins_if_place_home()) { return __('Browse or Search Places', 'bp-checkins') . $title_and_sep; } elseif (bp_checkins_is_directory()) { return ucfirst(bp_get_checkins_slug()) . ' & Places ' . $sep . ' '; } else { return $title_and_sep; } }