There is embedded content here that you cannot see. Please open the post in a web browser to see this.'; var $debug = false; function wp_noembedder() { parent::plugin_base(); add_filter('the_content', array(&$this, 'add_tags')); $msg = get_option($this->prefix . "message"); if ($msg) { $this->message = $msg; } } function get_youtube_thumbnail($video_id) { $url = "http://www.youtube.com/api2_rest?dev_id=$this->youTube_devID&method=youtube.videos.get_details&video_id=$video_id"; $response = $this->parse_remote_xml($url); if (!empty($response['ut_response']['error'])) { $this->throw_error("The Youtube API returned error code #" . $this->parsed_response['ut_response']['error']['code'] . ": " . $this->parsed_response['ut_response']['error']['description']); } else { return $response['ut_response']['video_details']['thumbnail_url']; } } function add_tags($content) { global $post; $message = str_replace('##POST_URL##', $post->guid, $this->message); $pattern = '/(]+(\/?>))(?:\s|\n)*(<[^>]+>)/im'; if (preg_match_all($pattern, $content, $matches)) { for ($i = 0; $i < count($matches[0]); $i++) { if (preg_match("/youtube.com\/v\/([^\"]+)/im", $matches[2][$i], $int_matches)) { $thumbnail = $this->get_youtube_thumbnail($int_matches[1]); } elseif (preg_match("/gamevideos.com.+id\%3D([0-9]+)\%/i", $matches[2][$i], $int_matches)) { $thumbnail = "http://download.gamevideos.com/{$int_matches[1]}/thumbnail.jpg"; } if (strpos($matches[4][$i], 'embed') === false) { $suffix = "" . $matches[4][$i]; } else { $suffix = $matches[4][$i]; } $replacement = $message; if ($thumbnail) { $replacement = '' . $replacement; } $replacement = $matches[1][$i] . "$replacement" . $suffix; $content = str_replace($matches[0][$i], $replacement, $content); } } return $content; } function options_page() { if ($_POST[$this->prefix . "message"]) { $this->message = stripslashes($_POST[$this->prefix . "message"]); update_option($this->prefix . "message", $this->message); } ?> Noembedder Options This will add <noembed> tags to any embedded content that doesn't already have them. Good for when you use YouTube videos. Set the <noembed> text Noembed Text:Use ##POST_URL## to put the link to the post in the text =$this->message?> Did you find this plugin useful? Please consider donating to help me continue developing it and other plugins.
$replacement
This will add <noembed> tags to any embedded content that doesn't already have them. Good for when you use YouTube videos.
Did you find this plugin useful? Please consider donating to help me continue developing it and other plugins.