From 74c2872215449b5270bb004fa152926d11cd664c Mon Sep 17 00:00:00 2001 From: saxmatt Date: Fri, 16 Apr 2004 02:24:37 +0000 Subject: [PATCH] Plugin enhancements. git-svn-id: http://svn.automattic.com/wordpress/trunk@1081 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- index.php | 30 +++++------ wp-admin/plugins.php | 1 + wp-includes/functions.php | 111 ++------------------------------------ 3 files changed, 18 insertions(+), 124 deletions(-) diff --git a/index.php b/index.php index 8e6e71d4eb..ff20194e2f 100644 --- a/index.php +++ b/index.php @@ -1,14 +1,11 @@ - + <?php bloginfo('name'); ?><?php wp_title(); ?> @@ -20,22 +17,21 @@ require('wp-blog-header.php'); - - +
-

+

- + ',''); ?> @@ -59,9 +55,9 @@ require('wp-blog-header.php');
- +

- +
@@ -80,11 +76,11 @@ require('wp-blog-header.php');

- " /> + " />
-
  • +
  • @@ -101,9 +97,9 @@ require('wp-blog-header.php');
  • @@ -114,6 +110,6 @@ require('wp-blog-header.php'); -

    || WordPress

    "), __("Powered by WordPress, state-of-the-art semantic personal publishing platform")); ?> +

    WordPress"), __("Powered by WordPress, state-of-the-art semantic personal publishing platform")); ?>

    diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index 4c880e03d7..d17152d15c 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -111,6 +111,7 @@ if (!$plugins_dir || !$plugin_files) { if (!empty($current_plugins) && in_array($plugin_file, $current_plugins)) { $action = "Deactivate"; + $plugin = "$plugin"; } else { $action = "Activate"; } diff --git a/wp-includes/functions.php b/wp-includes/functions.php index c3104401ec..f0ce486d79 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1162,113 +1162,6 @@ function remove_action($tag, $function_to_remove, $priority = 10) { remove_filter($tag, $function_to_remove, $priority); } -/* Highlighting code c/o Ryan Boren */ -function get_search_query_terms($engine = 'google') { - global $s, $s_array; - $referer = urldecode($_SERVER[HTTP_REFERER]); - $query_array = array(); - switch ($engine) { - case 'google': - // Google query parsing code adapted from Dean Allen's - // Google Hilite 0.3. http://textism.com - $query_terms = preg_replace('/^.*q=([^&]+)&?.*$/i','$1', $referer); - $query_terms = preg_replace('/\'|"/', '', $query_terms); - $query_array = preg_split ("/[\s,\+\.]+/", $query_terms); - break; - - case 'lycos': - $query_terms = preg_replace('/^.*query=([^&]+)&?.*$/i','$1', $referer); - $query_terms = preg_replace('/\'|"/', '', $query_terms); - $query_array = preg_split ("/[\s,\+\.]+/", $query_terms); - break; - - case 'yahoo': - $query_terms = preg_replace('/^.*p=([^&]+)&?.*$/i','$1', $referer); - $query_terms = preg_replace('/\'|"/', '', $query_terms); - $query_array = preg_split ("/[\s,\+\.]+/", $query_terms); - break; - - case 'wordpress': - // Check the search form vars if the search terms - // aren't in the referer. - if ( ! preg_match('/^.*s=/i', $referer)) { - if (isset($s_array)) { - $query_array = $s_array; - } else if (isset($s)) { - $query_array = array($s); - } - - break; - } - - $query_terms = preg_replace('/^.*s=([^&]+)&?.*$/i','$1', $referer); - $query_terms = preg_replace('/\'|"/', '', $query_terms); - $query_array = preg_split ("/[\s,\+\.]+/", $query_terms); - break; - } - - return $query_array; -} - -function is_referer_search_engine($engine = 'google') { - $siteurl = get_settings('siteurl'); - $referer = urldecode($_SERVER['HTTP_REFERER']); - //echo "referer is: $referer
    "; - if ( ! $engine ) { - return 0; - } - - switch ($engine) { - case 'google': - if (preg_match('/^http:\/\/w?w?w?\.?google.*/i', $referer)) { - return 1; - } - break; - - case 'lycos': - if (preg_match('/^http:\/\/search\.lycos.*/i', $referer)) { - return 1; - } - break; - - case 'yahoo': - if (preg_match('/^http:\/\/search\.yahoo.*/i', $referer)) { - return 1; - } - break; - - case 'wordpress': - if (preg_match("#^$siteurl#i", $referer)) { - return 1; - } - break; - } - - return 0; -} - -function hilite($text) { - $search_engines = array('wordpress', 'google', 'lycos', 'yahoo'); - - foreach ($search_engines as $engine) { - if ( is_referer_search_engine($engine)) { - $query_terms = get_search_query_terms($engine); - foreach ($query_terms as $term) { - if (!empty($term) && $term != ' ') { - if (!preg_match('/<.+>/',$text)) { - $text = preg_replace('/(\b'.$term.'\b)/i','$1',$text); - } else { - $text = preg_replace('/(?<=>)([^<]+)?(\b'.$term.'\b)/i','$1$2',$text); - } - } - } - break; - } - } - - return $text; -} - /* rewrite_rules * Construct rewrite matches and queries from permalink structure. * matches - The name of the match array to use in the query strings. @@ -1450,4 +1343,8 @@ function check_comment($author, $email, $url, $comment, $user_ip) { return true; } +function wp_head() { + do_action('wp_head', ''); +} + ?> \ No newline at end of file