'; print_r($data); echo ''; } } if(!function_exists('ap_has_term')){ function ap_has_term($taxonomy){ $response = false; switch($taxonomy){ case 'category': $response = is_category(); break; case 'post_tag': $response = is_tag(); break; default: $response = has_term('', $taxonomy); break; } return $response; } } if(!function_exists('ap_go')){ function ap_go(){ $allowed_taxes = get_option('ap_tax'); $ap_go = FALSE; if(!empty($allowed_taxes) && $allowed_taxes[0]!=''){ foreach($allowed_taxes as $taxonomy_allowed){ $ap_go = ap_has_term($taxonomy_allowed); if($ap_go) break; } } if(get_option('ap_all')){ $ap_go = TRUE; } return $ap_go; } } if(!function_exists('ap_ready')){ function ap_ready(){ echo ''; } } if(!function_exists('ap_start')){ function ap_start(){ update_option( 'ap_case', 'U'); update_option( 'ap_layout', 'H'); update_option( 'ap_dom', '#content' ); } } if(!function_exists('ap_end')){ function ap_end(){ delete_option( 'ap_case'); delete_option( 'ap_layout'); delete_option( 'ap_dom'); } } if(!function_exists('ap_pagination')){ function ap_pagination(){ global $wpdb; if(!is_admin() && is_main_query())// && $wpdb->num_rows>0){ if(!function_exists('ap_where')){ function ap_where($where){ global $wpdb; global $ap; $where .= ' AND '.$wpdb->prefix.'posts.post_title LIKE "'.mysql_real_escape_string($ap).'%"'; return $where; } } add_filter( 'posts_where' , 'ap_where' ); if(!function_exists('render_alphabets')){ function render_alphabets(){ global $ap; $default_place = get_option('ap_dom')==''?'#content':get_option('ap_dom'); $alphabets = ap_alphabets(); $alphabets_bar = ''; foreach($alphabets as $language=>$alphabetz){ $alphabets_bar .= ''; } $script = ''; if(ap_go()) echo $script; } } add_action("wp_footer", 'render_alphabets'); } } if(!function_exists('ap_alphabets')){ function ap_alphabets(){ $languages_selected = get_option('ap_lang'); if(empty($languages_selected)) $languages_selected = array(); require_once('languages.php'); global $ap_langs; $alphabets = array(); if(empty($languages_selected) || in_array('English', $languages_selected)){ //LETS START WITH AN OLD STRING $str = "quick brown fox jumps over the lazy dog"; $alpha_array = array_unique(str_split(str_replace(' ', '', $str))); asort($alpha_array); $alphabets['english'] = array_values($alpha_array); } if(!empty($languages_selected)){ foreach($languages_selected as $language_selected){ $language_selected = strtolower($language_selected); if(in_array($language_selected, array_keys($ap_langs)) && !isset($alphabets[$language_selected])){ $alphabets[$language_selected] = $ap_langs[$language_selected]; } } } return $alphabets; } } ?>