&lt;?php
/*
Plugin Name: Translucent image slideshow gallery
Plugin URI: http://www.gopiplus.com/work/2010/07/18/translucent-image-slideshow-gallery/
Description: Translucent image slideshow gallery WordPress plugin will create a image slideshow. All images are animated with translucent effect. 
Author: Gopi Ramasamy
Version: 8.2
Author URI: http://www.gopiplus.com/work/2010/07/18/translucent-image-slideshow-gallery/
Donate link: http://www.gopiplus.com/work/2010/07/18/translucent-image-slideshow-gallery/
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: translucent-image-slideshow-gallery
Domain Path: /languages
*/

function TISG_slideshow() 
{
	$TISG_returnstr = &quot;&quot;;
	$TISG_width = get_option(&#039;TISG_width&#039;);
	$TISG_height = get_option(&#039;TISG_height&#039;);
	$TISG_delay = get_option(&#039;TISG_delay&#039;);
	$TISG_speed = get_option(&#039;TISG_speed&#039;);
	$TISG_dir = get_option(&#039;TISG_dir&#039;);
	$TISG_link = get_option(&#039;TISG_link&#039;);
	$siteurl_link = get_option(&#039;siteurl&#039;) . &quot;/&quot;;

	if(is_dir($TISG_dir))
	{
		if($TISG_link  ""){
			$TISG_str_link = $TISG_link;
		}
		else{
			$TISG_str_link = "";
		}
		
		$TISG_dirHandle = opendir($TISG_dir);
		$TISG_count = 0;
		while ($TISG_file = readdir($TISG_dirHandle)) 
		{
			$TISG_file_caps = strtoupper($TISG_file);
			if(!is_dir($TISG_file) &amp;&amp; (strpos($TISG_file_caps, '.JPG')>0 or strpos($TISG_file_caps, '.GIF')>0 or strpos($TISG_file_caps, '.PNG')>0 or strpos($TISG_file_caps, '.JPEG')>0)) 
			{
				if($TISG_link == "" )
				{
					$TISG_str =  '["' . $siteurl_link . $TISG_dir . $TISG_file . '", "", ""],';
				}
				else
				{
					$TISG_str =  '["' . $siteurl_link . $TISG_dir . $TISG_file . '", "'. $TISG_link .'", "_new"],';
				}
				$TISG_returnstr = $TISG_returnstr . $TISG_str;
				$TISG_count++;
			}
		} 
		$TISG_returnstr = substr($TISG_returnstr,0,(strlen($TISG_returnstr)-1));
		closedir($TISG_dirHandle)
		?>
		
		var TISG=new TISG_translideshow({
			TISG_wrapperid: "myslideshow",
			TISG_dimensions: [, ],
			TISG_imagearray: [],
			TISG_displaymode: {type:'auto', pause:, cycles:5, pauseonmouseover:true},
			TISG_orientation: "h", 
			TISG_persist: true, 
			TISG_slideduration: 
		})
		
		&lt;?php
		echo &quot;";
	}
	else
	{
		echo $TISG_dir . ' '. __('Folder Does Not Exist', 'translucent-image-slideshow-gallery');
	}
}

function TISG_install() 
{
	add_option('TISG_title', "Slide Show");
	add_option('TISG_width', "200");
	add_option('TISG_height', "155");
	add_option('TISG_delay', "3000");
	add_option('TISG_speed', "400");
	add_option('TISG_dir', "wp-content/plugins/translucent-image-slideshow-gallery/gallery/");
	add_option('TISG_link', "#");
	add_option('TISG_dir_1', "wp-content/plugins/translucent-image-slideshow-gallery/gallery/");
	add_option('TISG_link_1', "#");
	add_option('TISG_dir_2', "wp-content/plugins/translucent-image-slideshow-gallery/gallery/");
	add_option('TISG_link_2', "#");
	add_option('TISG_dir_3', "wp-content/plugins/translucent-image-slideshow-gallery/gallery/");
	add_option('TISG_link_3', "#");
	add_option('TISG_dir_4', "wp-content/plugins/translucent-image-slideshow-gallery/gallery/");
	add_option('TISG_link_4', "#");
}

function TISG_widget($args) 
{
	$TISG_title = get_option('TISG_title');
	extract($args);
	if($TISG_title  "")
	{
		echo $before_widget . $before_title;
		echo get_option('TISG_title');
		echo $after_title;
	}
	else
	{
		echo "";
	}
	TISG_slideshow();
	if($TISG_title  "")
	{
		echo $after_widget;
	}
	else
	{
		echo "";
	}
}

function TISG_control() 
{
	echo '';
	_e('Translucent slideshow', 'translucent-image-slideshow-gallery');
	echo '. ';
	_e('Check official website for more information', 'translucent-image-slideshow-gallery');
	?> 
	
	  
		
		
		
		
			
				
			
			&lt;?php
		}
		
		echo &#039;';
		echo ''.__('Widget', 'translucent-image-slideshow-gallery').'';
		echo "";
		echo ''.__('Title:', 'translucent-image-slideshow-gallery').'';
		echo '';
		echo '';
		echo '';
		echo '';
		echo ''.__('Width:', 'translucent-image-slideshow-gallery').'';
		echo ''.__('Height:', 'translucent-image-slideshow-gallery').'';
		echo ''.__('Speed:', 'translucent-image-slideshow-gallery').'';
		echo ''.__('Delay:', 'translucent-image-slideshow-gallery').'';
		echo '';
		echo '';
		echo 'px';
		echo 'px';
		echo '';
		echo 'ms';
		echo '';
		echo '';
		echo '';
		echo ''.__('Image directory:', 'translucent-image-slideshow-gallery').''.__('Short code:', 'translucent-image-slideshow-gallery').' [translucent-show code="SD0" width="200" height="150" delay="3000" speed="400"]';
		echo ''.__('Image hyper link:', 'translucent-image-slideshow-gallery').'';
		echo "";
		
		echo "".__('Short code 1', 'translucent-image-slideshow-gallery')."";
		
		echo "";
		echo ''.__('Image directory:', 'translucent-image-slideshow-gallery').''.__('Short code:', 'translucent-image-slideshow-gallery').' [translucent-show code="SD1" width="200" height="150" delay="3000" speed="400"]';
		echo ''.__('Image hyper link:', 'translucent-image-slideshow-gallery').'';
		echo "";
		
		echo "".__('Short code 2', 'translucent-image-slideshow-gallery')."";
	
		echo "";
		echo ''.__('Image directory:', 'translucent-image-slideshow-gallery').''.__('Short code:', 'translucent-image-slideshow-gallery').' [translucent-show code="SD2" width="200" height="150" delay="3000" speed="400"]';
		echo ''.__('Image hyper link:', 'translucent-image-slideshow-gallery').'';
		echo "";
		
		echo "".__('Short code 3', 'translucent-image-slideshow-gallery')."";
	
		echo "";
		echo ''.__('Image directory:', 'translucent-image-slideshow-gallery').''.__('Short code:', 'translucent-image-slideshow-gallery').' [translucent-show code="SD3" width="200" height="150" delay="3000" speed="400"]';
		echo ''.__('Image hyper link:', 'translucent-image-slideshow-gallery').'';
		echo "";
		
		echo "".__('Short code 4', 'translucent-image-slideshow-gallery')."";
	
		echo "";
		echo ''.__('Image directory:', 'translucent-image-slideshow-gallery').''.__('Short code:', 'translucent-image-slideshow-gallery').' [translucent-show code="SD4" width="200" height="150" delay="3000" speed="400"]';
		echo ''.__('Image hyper link:', 'translucent-image-slideshow-gallery').'';
		echo "";
		?>
		
		
		&lt;input name=&quot;TISG_submit&quot; id=&quot;TISG_submit&quot; class=&quot;button&quot; value=&quot;" type="submit" />&nbsp;
		
		
		
		
		
	   
	  
	
	0 or strpos($TISG_file_caps, '.GIF')>0 or strpos($TISG_file_caps, '.PNG')>0 or strpos($TISG_file_caps, '.JPEG')>0)) 
			{
				if($TISG_link == "" )
				{
					$TISG_str =  '["' . $siteurl_link . $TISG_dir . $TISG_file . '", "", ""],';
				}
				else
				{
					$TISG_str =  '["' . $siteurl_link . $TISG_dir . $TISG_file . '", "'. $TISG_link .'", "_new"],';
				}
				$TISG_returnstr = $TISG_returnstr . $TISG_str;
				$TISG_count++;
			}
		} 
		$TISG_returnstr = substr($TISG_returnstr,0,(strlen($TISG_returnstr)-1));
		closedir($TISG_dirHandle);
	
		$tiag = ' ';
		$tiag = $tiag . 'var TISG=new TISG_translideshow({ ';
			$tiag = $tiag . 'TISG_wrapperid: "'.$myslideshow.'", ';
			$tiag = $tiag . 'TISG_dimensions: ['.$TISG_width.','.$TISG_height.'], ';
			$tiag = $tiag . 'TISG_imagearray: ['.$TISG_returnstr.'], ';
			$tiag = $tiag . 'TISG_displaymode: {type:"auto", pause:'.$TISG_delay.', cycles:5, pauseonmouseover:true}, ';
			$tiag = $tiag . 'TISG_orientation: "h",  ';
			$tiag = $tiag . 'TISG_persist: true,  ';
			$tiag = $tiag . 'TISG_slideduration: '.$TISG_speed;
		$tiag = $tiag . '}) ';
		$tiag = $tiag . ' ';
	
		$tiag = $tiag . '';
	}
	else
	{
		$tiag = $TISG_dir . ' '. __('Folder Does Not Exist', 'translucent-image-slideshow-gallery');
	}
	return $tiag;
}

function TISG_add_to_menu() 
{
	if (is_admin()) 
	{
		add_options_page( __('Translucent slideshow', 'translucent-image-slideshow-gallery'), 
				__('Translucent slideshow', 'translucent-image-slideshow-gallery'), 'manage_options', 'translucent-image-slideshow-gallery', 'ISG_admin_option' );
	}
}

function TISG_add_javascript_files() 
{
	if (!is_admin())
	{
		wp_enqueue_script( 'jquery');
		wp_enqueue_script( 'translucent-image-slideshow-gallery', plugins_url().'/translucent-image-slideshow-gallery/translucent-image-slideshow-gallery.js');
	}	
}

function TISG_textdomain() 
{
	  load_plugin_textdomain( 'translucent-image-slideshow-gallery', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
}

add_action('plugins_loaded', 'TISG_textdomain');
add_action('admin_menu', 'TISG_add_to_menu');
add_action('wp_enqueue_scripts', 'TISG_add_javascript_files');
add_action("plugins_loaded", "TISG_widget_init");
register_activation_hook(__FILE__, 'TISG_install');
register_deactivation_hook(__FILE__, 'TISG_deactivation');
add_action('init', 'TISG_widget_init');
?>