items, 0, $num_items); shuffle($items); # builds html from array foreach ( $items as $item ) { if(preg_match('', $item['description'],$imgUrlMatches)) { $imgurl = $imgUrlMatches[1]; #change image size if ($imagesize == "square") { $imgurl = str_replace("m.jpg", "s.jpg", $imgurl); } elseif ($imagesize == "thumbnail") { $imgurl = str_replace("m.jpg", "t.jpg", $imgurl); } elseif ($imagesize == "medium") { $imgurl = str_replace("_m.jpg", ".jpg", $imgurl); } #get actual images for lightwindow - modification by eMac (http://www.weboutsourceit.com) if ($imagesize == "square") { $img_actual = str_replace ("_s.jpg",".jpg", $imgurl); } elseif ($imagesize == "thumbnail") { $img_actual = str_replace ("_m.jpg",".jpg", $imgurl); } $title = htmlspecialchars(stripslashes($item['title'])); $url = $item['link']; preg_match('', $imgurl, $flickrSlugMatches); $flickrSlug = $flickrSlugMatches[1]; # cache images if ($useImageCache) { # check if file already exists in cache # if not, grab a copy of it if (!file_exists("$fullPath$flickrSlug.jpg")) { if ( function_exists('curl_init') ) { // check for CURL, if not use fopen $curl = curl_init(); $localimage = fopen("$fullPath$flickrSlug.jpg", "wb"); curl_setopt($curl, CURLOPT_URL, $imgurl); curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 1); curl_setopt($curl, CURLOPT_FILE, $localimage); curl_exec($curl); curl_close($curl); } else { $filedata = ""; $remoteimage = fopen($imgurl, 'rb'); if ($remoteimage) { while(!feof($remoteimage)) { $filedata.= fread($remoteimage,1024*8); } } fclose($remoteimage); $localimage = fopen("$fullPath$flickrSlug.jpg", 'wb'); fwrite($localimage,$filedata); fclose($localimage); } // end CURL check } // end file check # use cached image print $before_image . "\"$title\"" . $after_image; } else { # grab image direct from flickr print $before_image . "\"$title\"" . $after_image; } // end use imageCache } // end pregmatch } // end foreach } else { #print "Flickr is having a massage (Flickr Blog)"; } } # end get_flickrRSS() function function widget_flickrrss_init() { if (!function_exists('register_sidebar_widget')) return; function widget_flickrrss($args) { extract($args); $options = get_option('widget_flickrrss'); $title = $options['title']; echo $before_widget . $before_title . $title . $after_title; get_flickrRSS(); echo $after_widget; } function widget_flickrrss_control() { $options = get_option('widget_flickrrss'); if ( !is_array($options) ) $options = array('title'=>''); if ( $_POST['flickrrss-submit'] ) { $options['title'] = strip_tags(stripslashes($_POST['flickrrss-title'])); update_option('widget_flickrrss', $options); } $title = htmlspecialchars($options['title'], ENT_QUOTES); echo '

'; echo ''; } register_sidebar_widget('flickrRSS', 'widget_flickrrss'); register_widget_control('flickrRSS', 'widget_flickrrss_control', 300, 100); } function flickrRSS_subpanel() { if (isset($_POST['update_flickrrss'])) { $option_flickrid = $_POST['flickr_nsid']; $option_tags = $_POST['tags']; $option_display_type = $_POST['display_type']; $option_display_numitems = $_POST['display_numitems']; $option_display_imagesize = $_POST['display_imagesize']; $option_before = $_POST['before_image']; $option_after = $_POST['after_image']; update_option('flickrRSS_flickrid', $option_flickrid); update_option('flickrRSS_tags', $option_tags); update_option('flickrRSS_display_type', $option_display_type); update_option('flickrRSS_display_numitems', $option_display_numitems); update_option('flickrRSS_display_imagesize', $option_display_imagesize); update_option('flickrRSS_before', $option_before); update_option('flickrRSS_after', $option_after); ?>

Options changes saved.

Cache settings saved.

flickrRSS Options

:

Use the idGettr to find your id.

Display:

photos using

Comma separated, no spaces

/:

/ e.g. <li></li>, <p></p>

Cache Settings

e.g. http://url.com/cache/

e.g. /home/path/to/wp-content/flickrrss/cache/

/>