' . __('Sorry, NextGEN ImageFlow works only in combination with NextGEN Gallery.','nggflow') . '
\';')); return; } add_action('admin_menu','modify_menu_for_nggImageFlow'); } // ImageFlow settings function ngg_if_default_options() { $ngg_if_options['ngg_if_background_color'] = "ffffff"; // Background color of the reflection $ngg_if_options['ngg_if_effect'] = "none"; // Javascript effect for top image. Can be "none" or "highslide" (more effects to come) $ngg_if_options['ngg_if_reflection'] = 0.7; // Sets the height of the reflection in % of the source image $ngg_if_options['ngg_if_focus'] = 2; // Sets the number of images on each side of the focused one $ngg_if_options['ngg_if_sldr_width'] = 14; // Sets the px width of the slider div $ngg_if_options['ngg_if_img_cursor'] = "pointer"; // Sets the cursor type for all images. Default is "pointer". $ngg_if_options['ngg_if_sldr_cursor'] = "e-resize"; // Sets the slider cursor type. Default is "e-resize". $ngg_if_options['ngg_if_start_image'] = 3; // Sets which image the slideshow will start with $ngg_if_options['ngg_if_use_style'] = "true"; // Sets whether to use the stylesheet or not $ngg_if_options['ngg_if_use_reflection'] = "true"; // Sets whether to use the reflections or not update_option('ngg_if_options', $ngg_if_options); } function SearchForImageFlow($content) { global $wpdb; if ( stristr( $content, '[imageflow' )) { $search = "@(?:)*\s*\[imageflow\s*=\s*(\w+|^\+)(|,(\d+))(|,(\d+))(|,\*(.*?)\*)\]\s*(?:
)*@i"; if (preg_match_all($search, $content, $matches)) { if (is_array($matches)) { foreach ($matches[1] as $key =>$match) { // check for gallery id $galleryID = $wpdb->get_var("SELECT gid FROM $wpdb->nggallery WHERE gid = '$match' "); if(!$galleryID) $galleryID = $wpdb->get_var("SELECT gid FROM $wpdb->nggallery WHERE name = '$match' "); if($galleryID) { $search = $matches[0][$key]; // get the size if they are set and the link if used $width = $matches[3][$key]; $height = $matches[5][$key]; $link = $matches[7][$key]; $replace = nggShowImageFlow($galleryID,$width,$height,$link); $content= str_replace ($search, $replace, $content); } } } }// end slideshow } return $content; } function nggShowImageFlow($galleryID,$irWidth,$irHeight, $link = false) { global $wpdb; $ngg_options = get_option ('ngg_options'); $ngg_if_options = get_option('ngg_if_options'); $pictures = $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE t.gid = '$galleryID' AND tt.exclude != 1 ORDER BY tt.$ngg_options[galSort] $ngg_options[galSortDir] "); $siteurl = get_option ('siteurl'); if (!is_array($pictures)) die; $out = '
';
$out .= "\n".'