$export_type = 'block'; $version = '2.0'; $block_name = isset($block_name)? $block_name: 'YouTube_Video'; $block_set = 'universal'; $block_parent_name = 'universal'; $queries[] = "INSERT INTO {$this->pre}blocks (block_name, block_owner, block_set, block_parent_name, block_display_name, block_url, block_description, block_active, block_type, block_html, block_php, block_cache_settings, block_settings) VALUES ('{$block_name}', '{$skin_name}', 'universal', 'universal', 'YouTube_Video', 'YouTube_Video', '', 1, 0, 'video}&hl=en&fs=1&color1=0x5d1719&color2=0xcd311b\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"320\" height=\"265\">', ' \$this->words = trim(\$Article->title); \$this->tags = str_replace(\" \", \"+\", \$this->words); //Give our script a keyword to work with \$keyword = \$this->article->keywords; //Generate a URL for our RSS feed, and download the feed using SimpleXML \$rss = simplexml_load_file(\'http://gdata.youtube.com/feeds/base/videos?q=\' .urlencode(\$this->tags). \'&client=ytapi-youtube-search&v=2\'); //Get the part of the RSS feed which contains the number of the first video, and save it to the variable \$id \$id = \$rss->entry->id; //Get rid of some stuff we don\'t need \$id = str_replace(\"tag:youtube.com,2008:video:\", \"\", \$id); \$this->video = \$id; ', '', '')";