'attachment', 'post_mime_type' => array('image/png', 'image/jpeg', 'image/gif'), 'numberposts' => 50, 'offset' => $offset * 50, 'orderby' => 'ID', 'order' => 'DESC', ); $attachments = get_posts( $args ); $options_attachments = get_option('wp_skitter_attachments'); $out = array(); // All images media foreach($attachments as $i => $attachment) { $id = $attachment->ID; if (is_array($options_attachments['image']) && in_array($id, $options_attachments['image'])) continue; $select = getSelectAnimations(array( 'name' => 'wp_skitter_attachments[animation]['.$id.']', 'id' => 'wp_skitter_attachment_animation_'.$id, 'class' => 'attachments_animation' )); $out[] = array( 'id' => $id, 'thumb' => wp_get_attachment_image( $id, array(50, 50) ), 'image' => wp_get_attachment_image( $id, array(150, 150) ), 'select' => $select ); } echo json_encode($out); exit; } /** * Load scripts */ function init_load() { wp_enqueue_script('skitter', WP_PLUGIN_URL . '/wp-skitter-slideshow/js/jquery.skitter.min.js', array('jquery')); // wp_enqueue_script('jquery.animate-colors', WP_PLUGIN_URL . '/wp-skitter-slideshow/js/jquery.animate-colors-min.js', array('jquery')); wp_enqueue_script('jquery.easing', WP_PLUGIN_URL . '/wp-skitter-slideshow/js/jquery.easing.1.3.js', array('jquery')); wp_enqueue_style( 'skitter.styles', WP_PLUGIN_URL . '/wp-skitter-slideshow/css/skitter.styles.min.css'); } /** * Add skitter menu configuration */ function wp_skitter_add_menu() { $page = add_options_page('Skitter Slideshow', 'Skitter Slideshow', 'administrator', 'wp_skitter_menu', 'wp_skitter_menu_function'); } /** * Skitter settings */ function getSkitterSettings() { $wp_skitter_settings = array( 'wp_skitter_category', 'wp_skitter_slides', 'wp_skitter_animation', 'wp_skitter_velocity', 'wp_skitter_interval', 'wp_skitter_navigation', 'wp_skitter_label', 'wp_skitter_type_navigation', 'wp_skitter_easing_default', 'wp_skitter_animateNumberOut', 'wp_skitter_animateNumberOver', 'wp_skitter_animateNumberActive', 'wp_skitter_hideTools', 'wp_skitter_fullscreen', 'wp_skitter_xml', 'wp_skitter_width_label', 'wp_skitter_width', 'wp_skitter_height', 'wp_skitter_show_randomly', 'wp_skitter_crop', 'wp_skitter_attachments', 'wp_skitter_type', 'wp_skitter_numbers_align', 'wp_skitter_enable_navigation_keys', 'wp_skitter_controls', 'wp_skitter_controls_position', 'wp_skitter_focus', 'wp_skitter_focus_position', 'wp_skitter_preview', 'wp_skitter_stop_over', 'wp_skitter_with_animations', 'wp_skitter_auto_play', 'wp_skitter_background', 'wp_skitter_labelAnimation', 'wp_skitter_theme', ); return $wp_skitter_settings; } /** * Options register */ function wp_skitter_reg_function() { $settings = getSkitterSettings(); foreach ($settings as $option) { register_setting( 'wp_skitter_settings', $option ); } } /** * Skitter active */ function wp_skitter_activate() { add_option('wp_skitter_category','1'); add_option('wp_skitter_animation','random'); add_option('wp_skitter_slides','5'); add_option('wp_skitter_navigation','true'); add_option('wp_skitter_label','true'); add_option('wp_skitter_type_navigation','numbers'); add_option('wp_skitter_numbers_align','left'); add_option('wp_skitter_crop','true'); add_option('wp_skitter_type','posts'); add_option('wp_skitter_stop_over','false'); add_option('wp_skitter_auto_play','true'); add_option('wp_skitter_background','#000'); add_option('wp_skitter_animation','slideUp'); add_option('wp_skitter_theme','square'); add_option('wp_skitter_attachments', array( 'image' => array(), 'label' => array(), 'link' => array(), 'animation' => array() )); delete_option('wp_skitter_numbers'); delete_option('wp_skitter_thumbs'); delete_option('wp_skitter_dots'); } /** * Get values skitter formatted */ function filterValueSkitter ($option, $value) { $booleans = array( 'wp_skitter_navigation', 'wp_skitter_label', 'wp_skitter_hideTools', 'wp_skitter_fullscreen', 'wp_skitter_show_randomly', 'wp_skitter_enable_navigation_keys', 'wp_skitter_controls', 'wp_skitter_focus', 'wp_skitter_preview', 'wp_skitter_stop_over', 'wp_skitter_auto_play', ); $strings = array( 'wp_skitter_animation', 'wp_skitter_width', 'wp_skitter_height', 'wp_skitter_easing_default', 'wp_skitter_xml', 'wp_skitter_width_label', 'wp_skitter_numbers_align', 'wp_skitter_controls_position', 'wp_skitter_focus_position', 'wp_skitter_background', 'wp_skitter_labelAnimation', 'wp_skitter_theme', ); if (in_array($option, $booleans)) { $value = $value == 'true' ? 'true' : 'false'; } else if (in_array($option, $strings) && !empty($value)) { $value = '"'.$value.'"'; } return $value; } /** * Get animations */ function getAnimations () { $animations = array( 'random', 'randomSmart', 'cube', 'cubeRandom', 'block', 'cubeStop', 'cubeHide', 'cubeSize', 'horizontal', 'showBars', 'showBarsRandom', 'tube', 'fade', 'fadeFour', 'paralell', 'blind', 'blindHeight', 'blindWidth', 'directionTop', 'directionBottom', 'directionRight', 'directionLeft', 'cubeStopRandom', 'cubeSpread', 'cubeJelly', 'glassCube', 'glassBlock', 'circles', 'circlesInside', 'circlesRotate', 'cubeShow', 'upBars', 'downBars', 'hideBars', 'swapBars', 'swapBarsBack', ); return $animations; } /** * Get themes */ function getThemes () { $themes = array( 'default', 'minimalist', 'round', 'clean', 'square', ); return $themes; } /** * Get select options of animations */ function getSelectAnimations ($options = array()) { $name = $options['name']; $id = $options['id']; $class = $options['class']; $animations = getAnimations(); $out = ''; return $out; } /** * Debug arrays and others */ if (!function_exists('pr')) { function pr ($array) { echo '
';
		print_r($array);
		echo '
'; } } /** * Show skitter */ function show_skitter() { $width_skitter = get_option('wp_skitter_width'); $height_skitter = get_option('wp_skitter_height'); $background_skitter = get_option('wp_skitter_background'); $category = get_option('wp_skitter_category'); $wp_skitter_slides = get_option('wp_skitter_slides'); ?> $image[0], 'link' => $attachments['link'][$id_post], 'label' => $attachments['label'][$id_post], 'animation' => $attachments['animation'][$id_post], ); } wp_reset_query(); } break; case 'xml' : $skitter_xml = true; break; case 'posts' : default : $query_posts = 'cat='.$category.'&posts_per_page='.$wp_skitter_slides; query_posts( $query_posts ); if ( have_posts() ) : while ( have_posts() ) : the_post(); if (has_post_thumbnail()) : $content = strip_tags(get_the_content()); if (preg_match('/^Link:(http:\/\/.*)/i', $content, $matches)) { $link = $matches[1]; } else { $link = get_permalink(); } $thumbnail = get_the_post_thumbnail($post->ID, 'large'); preg_match('/src="([^"]*)"/i', $thumbnail, $matches); $image = (isset($matches[1])? $matches[1] : null); $skitter_images[] = array( 'image' => $image, 'link' => $link, 'label' => get_the_title(), 'animation' => null, ); endif; endwhile; endif; wp_reset_query(); break; } if (!empty($skitter_images) || isset($skitter_xml)) { ?>
'attachment', 'post_mime_type' => array('image/png', 'image/jpeg', 'image/gif'), 'numberposts' => 50, 'offset' => 0, 'orderby' => 'ID', 'order' => 'DESC', ); $attachments = get_posts( $args ); $wp_skitter_type = get_option('wp_skitter_type'); ?>

Skitter Slideshow

Category
Number of slides
XML Path
Loading...
$attachment) { $id = $attachment->ID; $style = (is_array($options_attachments['image']) && in_array($id, $options_attachments['image'])) ? ' style="opacity:0.3;"' : ''; ?>
>
'wp_skitter_attachments[animation]['.$id.']', 'id' => 'wp_skitter_attachment_animation_'.$id, 'selected' => $animation, 'class' => 'attachments_animation' ));?>
x
$attachment) { $id = $attachment->ID; if (is_array($options_attachments['image']) && in_array($id, $options_attachments['image'])) continue; ?>
'wp_skitter_attachments[animation]['.$id.']', 'id' => 'wp_skitter_attachment_animation_'.$id, 'class' => 'attachments_animation' ));?>
x

Customization

Skitter Theme
Animation type
Navigation type
width px
height px
background
crop image />
/>
Default: Example: