'aioslideshow', 'description' => __('All-In-One Slideshow widget', 'aioslideshow') ); /* Create the widget. */ $this->WP_Widget( 'aioslideshow-widget', __('All-In-One Slideshow widget', 'aioslideshow'), $widget_ops, $control_ops ); } /** * How to display the widget on the screen. */ function widget( $args, $instance ) { extract( $args ); /* Our variables from the widget settings. */ $title = apply_filters('widget_title', $instance['title'] ); /* Before widget (defined by themes). */ echo $before_widget; /* Display the widget title if one was input (before and after defined by themes). */ if ( $title ) echo $before_title . $title . $after_title; aio_slideshow(); /* After widget (defined by themes). */ echo $after_widget; } /** * Update the widget settings. */ function update( $new_instance, $old_instance ) { $instance = $old_instance; /* Strip tags for title and name to remove HTML (important for text inputs). */ $instance['title'] = strip_tags( $new_instance['title'] ); return $instance; } /** * Displays the widget settings controls on the widget panel. * when creating your form elements. This handles the confusing stuff. */ function form( $instance ) { /* Set up some default widget settings. */ $defaults = array( 'title' => __('All-In-One Slideshow', 'aioslideshow')); $instance = wp_parse_args( (array) $instance, $defaults ); ?>

'', 'on_pages' => '', 'on_archive' => 1, 'rotate' => 1, 'effect' => 'fade', 'easing' => 'none', 'delay' => 3, 'duration' => 1, 'img_width' => 500, 'img_height' => 300, 'div' => 'aio-slideshow', 'fontFamily' => 'geo-sans-ligh.font.js', 'arrnav' => 'allthetime', 'numnav_position' => 'dont_display', 'text_position' => 'bottom_left', 'textbg_margin' => 5, 'text_align' => 'left', 'text_size' => 40, 'textColorsCSS' => 0, 'text_shadow_enabled' => 1, 'text_bg' => '000', 'text_color1' => 'FFF', 'text_color2' => 'C0C0C0', 'text_shadow' => '000', 'your_css' => '' )); // pull the settings from the db $aio_slideshow_settings = get_option('aio_slideshow_settings'); $aio_slideshow_images = get_option('aio_slideshow_images'); // fallback $aio_slideshow_settings = wp_parse_args($aio_slideshow_settings, $aio_slideshow_defaults); /* /////////////////////////////////////////////// This section hooks the proper functions to the proper actions in WordPress \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ */ // this function registers our settings in the db add_action('admin_init', 'aio_slideshow_register_settings'); function aio_slideshow_register_settings() { register_setting('aio_slideshow_images', 'aio_slideshow_images', 'aio_slideshow_images_validate'); register_setting('aio_slideshow_settings', 'aio_slideshow_settings', 'aio_slideshow_settings_validate'); } add_action('admin_print_scripts', 'aio_slideshow_colorpicker'); function aio_slideshow_colorpicker() {?> %s', admin_url( 'options-general.php?page=aio-slideshow' ), __('Settings') ); array_unshift($links, $aio_slideshow_settings_link); return $links; } /* /////////////////////////////////////////////// this function is the code that gets loaded when the settings page gets loaded by the browser. It calls functions that handle image uploads and image settings changes, as well as producing the visible page output. \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ */ function aio_slideshow_admin_page() { echo '
'; // handle image upload, if necessary if($_REQUEST['action'] == 'wp_handle_upload') aio_slideshow_handle_upload(); // delete an image, if necessary if(isset($_REQUEST['delete'])) aio_slideshow_delete_upload($_REQUEST['delete']); // the image management form aio_slideshow_images_admin(); // the settings management form aio_slideshow_settings_admin(); echo '
'; } /* /////////////////////////////////////////////// this section handles uploading images, adding the image data to the database, deleting images, and deleting image data from the database. \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ */ // this function handles the file upload, // resize/crop, and adds the image data to the db function aio_slideshow_handle_upload() { global $aio_slideshow_settings, $aio_slideshow_images; // upload the image $upload = wp_handle_upload($_FILES['aio_slideshow'], 0); // extract the $upload array extract($upload); // the URL of the directory the file was loaded in $upload_dir_url = str_replace(basename($file), '', $url); // get the image dimensions list($width, $height) = getimagesize($file); // if the uploaded file is NOT an image if(strpos($type, 'image') === FALSE) { unlink($file); // delete the file echo '

Sorry, but the file you uploaded does not seem to be a valid image. Please try again.

'; return; } // if the image doesn't meet the minimum width/height requirements ... if($width < $aio_slideshow_settings['img_width'] || $height < $aio_slideshow_settings['img_height']) { unlink($file); // delete the image echo '

Sorry, but this image does not meet the minimum height/width requirements. Please upload another image

'; return; } /* if (isset($upload['error'])) { $aio_ErrorMessage = $upload['error']; echo '
' . $aio_ErrorMessage . '
'; return; }*/ // if the image is larger than the width/height requirements, then scale it down. if($width > $aio_slideshow_settings['img_width'] || $height > $aio_slideshow_settings['img_height']) { // resize the image $resized = image_resize($file, $aio_slideshow_settings['img_width'], $aio_slideshow_settings['img_height'], true, 'resized'); $resized_url = $upload_dir_url . basename($resized); // delete the original unlink($file); $file = $resized; $url = $resized_url; } // make the thumbnail $thumb_height = round((100 * $aio_slideshow_settings['img_height']) / $aio_slideshow_settings['img_width']); if(isset($upload['file'])) { $thumbnail = image_resize($file, 100, $thumb_height, true, 'thumb'); $thumbnail_url = $upload_dir_url . basename($thumbnail); } // use the timestamp as the array key and id $time = date('YmdHis'); // add the image data to the array $aio_slideshow_images[$time] = array( 'id' => $time, 'file' => $file, 'file_url' => $url, 'thumbnail' => $thumbnail, 'thumbnail_url' => $thumbnail_url, 'image_links_to' => '' ); // add the image information to the database $aio_slideshow_images['update'] = 'Added'; update_option('aio_slideshow_images', $aio_slideshow_images); } // this function deletes the image, // and removes the image data from the db function aio_slideshow_delete_upload($id) { global $aio_slideshow_images; // if the ID passed to this function is invalid, // halt the process, and don't try to delete. if(!isset($aio_slideshow_images[$id])) return; // delete the image and thumbnail unlink($aio_slideshow_images[$id]['file']); unlink($aio_slideshow_images[$id]['thumbnail']); // indicate that the image was deleted $aio_slideshow_images['update'] = 'Deleted'; // remove the image data from the db unset($aio_slideshow_images[$id]); update_option('aio_slideshow_images', $aio_slideshow_images); } /* /////////////////////////////////////////////// these two functions check to see if an update to the data just occurred. if it did, then they will display a notice, and reset the update option. \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ */ // this function checks to see if we just updated the settings // if so, it displays the "updated" message. function aio_slideshow_settings_update_check() { global $aio_slideshow_settings; if(isset($aio_slideshow_settings['update'])) { echo '

All-In-One Slideshow Settings '.$aio_slideshow_settings['update'].'

'; unset($aio_slideshow_settings['update']); update_option('aio_slideshow_settings', $aio_slideshow_settings); } } // this function checks to see if we just added a new image // if so, it displays the "updated" message. function aio_slideshow_images_update_check() { global $aio_slideshow_images; if($aio_slideshow_images['update'] == 'Added' || $aio_slideshow_images['update'] == 'Deleted' || $aio_slideshow_images['update'] == 'Updated') { echo '

Image(s) '.$aio_slideshow_images['update'].' Successfully

'; unset($aio_slideshow_images['update']); update_option('aio_slideshow_images', $aio_slideshow_images); } } /* /////////////////////////////////////////////// these two functions display the front-end code on the admin page. it's mostly form markup. \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ */ // display the images administration code function aio_slideshow_images_admin() { ?>

Please, click and read before you start uploading images.

1. The first you have to set dimensions of the images [General / Image Dimensions].
2. Dimensions of the uploaded image should NOT be smaller than the dimensions you set below.
3. Check if you have correct file permissions set for your uploads directory (CHMOD).
4. Upload folder should be "wp-content/uploads" (check in Settings / Media / Store uploads in this folder). It should never start with a slash "/".
5. If you are still having a problem, let me know in the forum on my site please.

Upload New Image

$data) : ?>
Image Image Links To Title Actions
Image Image Links To Title Actions
Delete

Save

For help, please visit official plugin's site.

My Other WordPress Stuff

If you like this plugin, maybe you'll be interested in my other plugins & themes.

General

Show slideshow on these single posts: 1. Leave this field empty if you want to load the slideshow's scripts / write CSS styles into the header on all single posts.
2. Type in "1,2,3" if you want to load slidesow on single posts with IDs 1,2 and 3.
Show slideshow on these pages: 1. Leave this field empty if you want to load the slideshow's scripts / write CSS styles into the header on all pages.
2. Type in "1,2,3" if you want to load slideshow on pages with IDs 1,2 and 3.
Show on archive pages />
Transition Enabled />
Transition Effect Please select the effect you would like to use when your images rotate (if applicable):
Easing Effect Please select the easing effect:
Transition Delay Length of time (in seconds) you would like each image to be visible (insert 0 to turn automatic transitions off):
Transition Length Length of time (in seconds) you would like the transition length to be:
Image Dimensions Please input the width of the image rotator:


Please input the height of the image rotator:
Rotator DIV ID Please indicate what you would like the rotator DIV ID to be:
Font Select the font:

Navigation

Arrows navigation Select the behavior of the arrows navigation in the gallery:
Position of numbered navigation Select the position of the numbered navigation in the gallery:

Text settings

Text position Select the position of the text in the gallery:


Please input the distance(vertical) from the gallery margin:
Text align Text align:
Text size Please input the size of the text:
Use CSS for colors />
Text shadow Enabled />
Text background Color of the background.
Text color #1 Color of the Text #1.
Text color #2 Color of the Text #2.
Text shadow Text shadow.

Custom code

Your CSS Input your CSS:

$value) : ?>

$value) { if($key != 'update') { $input[$key]['file_url'] = clean_url($value['file_url']); $input[$key]['thumbnail_url'] = clean_url($value['thumbnail_url']); if($value['image_links_to']) $input[$key]['image_links_to'] = clean_url($value['image_links_to']); if($value['title']) $input[$key]['title'] = ($value['title']); } } return $input; } /* /////////////////////////////////////////////// this final section generates all the code that is displayed on the front-end of the WP Theme \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ */ function aio_slideshow($args = array(), $content = null) { global $aio_slideshow_settings, $aio_slideshow_images, $value; // possible future use $args = wp_parse_args($args, $aio_slideshow_settings); $newline = "\n"; // line break echo '
'.$newline; echo ''.$newline; echo '
'; echo '
'.$newline; } // create the shortcode [aio_slideshow] add_shortcode('aio_slideshow', 'aio_slideshow_shortcode'); function aio_slideshow_shortcode($atts) { // Temp solution, output buffer the echo function. ob_start(); aio_slideshow(); $output = ob_get_clean(); return $output; } function aio_slideshow_scripts() { global $aio_slideshow_settings; $font_name = $aio_slideshow_settings['fontFamily']; if(!is_admin()) //wp_enqueue_script('jquery-1.6.1', WP_CONTENT_URL.'/plugins/all-in-one-slideshow/jquery-1.6.1.js', '', '1.6.1', false); wp_enqueue_script('cycle', WP_CONTENT_URL.'/plugins/all-in-one-slideshow/jquery.cycle.all.min.js', array('jquery'), '', false); wp_enqueue_script('easing', WP_CONTENT_URL.'/plugins/all-in-one-slideshow/jquery.easing.1.3.js', array('jquery'), '', false); wp_enqueue_script('cufon-yui', WP_CONTENT_URL.'/plugins/all-in-one-slideshow/cufon/cufon-yui.js', '', '', false); wp_enqueue_script('cufon-font', WP_CONTENT_URL.'/plugins/all-in-one-slideshow/cufon/fonts/' . $font_name, '', '', false); } function aio_slideshow_args() { global $aio_slideshow_settings; ?>