flush_rules(); wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'apml', APML::get_path() . '/js/apml.js', array('jquery') ); } function widget_init() { global $wp_version, $wp_rewrite, $wp_query; /** * sidebar widget code to display the search form */ function apml_search_widget($args) { global $wp_rewrite, $before_widget, $before_title, $after_title, $after_widget; extract($args); echo $before_widget; echo $before_title; echo (!empty($title)) ? $title : "Find interesting posts"; echo $after_title; ?>

Use your APML-Feed to find weblog-posts that might interest you.

using_mod_rewrite_permalinks()) { echo ''; } ?>
query_vars['apml'] == "search" && $wp_query->query_vars['apml_matching'] != null) { extract($args); echo $before_widget; echo $before_title; echo (!empty($title)) ? $title : "APML Matching"; echo $after_title; $tags = explode(",", $wp_query->query_vars['tag']); //print_r($wp_query); $endtag = false; ?>

Your interests are matching with this blog:

query_vars['apml_matching']; ?>

The matching "tags" are: 20) { $endtag = true; ?>

show/hide more

APML url: query_vars['s'] ) )?>

= 2.3 && (!function_exists( "register_sidebar_widget" ) || !function_exists( "register_widget_control" ))) return; register_sidebar_widget('APML Matching', 'apml_search_widget'); register_sidebar_widget('APML Meta', 'apml_meta_widget'); } /** * Set the path for the plugin. */ function get_path($abs = false) { $plugin = 'wp-apml'; $base = plugin_basename(__FILE__); if ($base != __FILE__) { $plugin = dirname($base); } $path = 'wp-content/plugins/' . $plugin; if ($abs) return ABSPATH . $path; else return get_option('siteurl') . '/' . $path; } /** * Define the rewrite rules */ function rewrite_rules($wp_rewrite) { $new_rules = array( 'apml$' => 'index.php?apml=apml', 'apml/(.+)' => 'index.php?apml=' . $wp_rewrite->preg_index(1), 'wp-apml.php$' => 'index.php?apml=apml' ); $wp_rewrite->rules = $new_rules + $wp_rewrite->rules; } /** * Add 'apml' as a valid query variables. */ function query_vars($vars) { $vars[] = 'apml'; return $vars; } /** * Print APML document if 'apml' query variable is present */ function apml_xml() { global $wp_query, $wp_version;; $vars = array('tags', 'categories', 'links', 'feeds'); $var = $wp_query->query_vars['apml']; if( isset( $var )) { if ($var == 'search' && $wp_version >= 2.3) { add_action('template_redirect', array('APML', 'template_redirect')); } elseif (in_array($var, $vars)) { APML::printAPML($var); } else { APML::printAPML(); } } } /** * **/ function template_redirect() { global $wp_query, $wpdb; $wp_query->is_single = false; $wp_query->is_page = false; $wp_query->is_archive = false; $wp_query->is_home = false; $wp_query->is_404 = false; $wp_query->is_archive = false; $wp_query->is_tag = false; $wp_query->is_search = false; $apml_array = APML::get_apml_as_array(); if ($apml_array != null) { // find matching tags $matching_tags = array_intersect($apml_array, WordPressSources::getTagsArray()); $matching = round(count($matching_tags)*100/count($apml_array), 2) . "%"; $taglist = implode (',',$matching_tags); $s = $wp_query->query_vars['s']; $wp_query->query('tag='.$taglist); $wp_query->set("s", $s); $wp_query->set("apml", "search"); $wp_query->set("apml_matching", $matching); } $wp_query->is_search = true; } /** * */ function get_apml_as_array() { global $wp_query; // define url of .apml file $url = $wp_query->query_vars['s']; $apml_array = wp_cache_get($url); if ($apml_array == false) { // define new parser class $parser = new APML_Parser(); // get concepts $apml_array = $parser->getAPMLConcepts($url); wp_cache_add($url, $apml_array); } return $apml_array; } /** * Insert the meta tags */ function insert_meta_tags() { global $wp_rewrite; $css_path = APML::get_path() . '/css/apml-style.css'; echo '' . "\n"; echo '' . "\n"; } /** * APML-XML output */ function printAPML($var = 'apml') { global $wp_version; $date = date('Y-m-d\Th:i:s'); $url = get_bloginfo('url'); $url = str_replace('https://', '', $url); $url = str_replace('http://', '', $url); header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true); echo ''; ?> APML for <?php echo get_bloginfo('name', 'display') ?> wordpress/ " type="text/html" from="" updated=""> " type="text/xml" from="" updated="" />