items)) foreach ($feed -> items as $key => $image) { $title = $image['title']; $link = $image['link']; preg_match ('/.*src="(http:\/\/[^"]+)"/', $image['description'], $img); $img = $img[1]; $ret[] = array ('title' => $title,'link' => $link, 'img' => $img); } return $ret; } function control () { $options = $newoptions = get_option ('widget_atpic'); if ( $_POST["atpic-submit"] ) { $newoptions['title'] = trim (strip_tags (stripslashes ($_POST["atpic-title"]))); $newoptions['url'] = trim ($_POST["atpic-url"]); } if ( $options != $newoptions ) { $options = $newoptions; update_option ('widget_atpic', $options); } $title = htmlspecialchars ($options['title'], ENT_QUOTES); if ($title == '') $title = 'Atpic'; $url = $options['url'] == ''? 'http://atpic.com/rss/.php?uuid=5117': $options['url']; if (empty($delay)) $delay ='5000'; // widget control template include (dirname (__FILE__) . '/tpl/control.php'); } } add_action('widgets_init', array ('atpic', 'init')); ?>