"post", "advps_maxpost" => "10", "advps_exclude" => "", "advps_order_by" => "date", "advps_order" => "DESC" ); $advpsQuery2 = array( "advps_post_types" => "post", "advps_maxpost" => "10", "advps_postperslide" => "1", "advps_exclude" => "", "advps_order_by" => "date", "advps_order" => "DESC" ); $advpsEffects = array( "advps_effects" => "uncover", "advps_timeout" => "1500", "advps_easing" => "linear", "advps_speed" => "2000", "advps_ps_hover" => "yes" ); $templateOneDefaultOptions = array( "advps_thumbnail" => "advps_thumbnail_one", "advps_sld_width" => "820", "advps_sld_height" => "270", "advps_contpad1" => "10", "advps_contpad2" => "10", "advps_contpad3" => "10", "advps_contpad4" => "10", "advps_bgcolor" => "#FFFFFF", "advps_border_size" => "1", "advps_border_type" => "solid", "advps_border_color" => "#444444", "advps_remove_border" => "yes", "advps_bxshad1" => "0", "advps_bxshad2" => "1", "advps_bxshad3" => "4", "advps_bxshadcolor" => "#000000", "advps_remove_shd" => "no", "advps_overlay_width" => "30", "advps_overlay_height" => "100", "advps_overlay_color" => "#000000", "advps_overlay_opacity" => "0.6", "advps_text_opacity" => "1", "advps_titleFcolor" => "#FFFFFF", "advps_titleHcolor" => "#E6E6E6", "advps_titleFsize" => "22", "advps_excptFcolor" => "#FFFFFF", "advps_excptFsize" => "12", "advps_excerptlen" => "30", "advps_excpt_visibility" => "always show", "advps_excpt_position" => "left", "advps_ed_link" => "enable", "advps_link_type" => "permalink", "advps_exclude_pager" => "no", "advps_pager_type" => "bullet", "advps_pager_right" => "8", "advps_pager_bottom" => "6", "advps_exclude_nxtprev" => "no", "advps_exclude_playpause" => "no" ); $templatetwoDefaultOptions = array( "advps_thumbnail" => "advps_thumbnail_two", "advps_sld_width" => "644", "advps_sld_height" => "270", "advps_contpad1" => "10", "advps_contpad2" => "10", "advps_contpad3" => "10", "advps_contpad4" => "10", "advps_bgcolor" => "#FFFFFF", "advps_border_size" => "1", "advps_border_type" => "solid", "advps_border_color" => "#444444", "advps_remove_border" => "yes", "advps_bxshad1" => "0", "advps_bxshad2" => "1", "advps_bxshad3" => "4", "advps_bxshadcolor" => "#000000", "advps_remove_shd" => "no", "advps_img_Orientation" => "horizontal", "advps_imagemar" => "10", "advps_ed_link" => "enable", "advps_link_type" => "permalink", "advps_exclude_pager" => "no", "advps_pager_type" => "bullet", "advps_pager_right" => "8", "advps_pager_bottom" => "6", "advps_exclude_nxtprev" => "no", "advps_exclude_playpause" => "no" ); $templatethreeDefaultOptions = array( "advps_content_set" => array(0=>"thumb",1=>"title",2=>"excerpt"), "advps_thumbnail" => "medium", "advps_sld_width" => "624", "advps_sld_height" => "225", "advps_contpad1" => "10", "advps_contpad2" => "10", "advps_contpad3" => "10", "advps_contpad4" => "10", "advps_bgcolor" => "#FFFFFF", "advps_border_size" => "1", "advps_border_type" => "solid", "advps_border_color" => "#444444", "advps_remove_border" => "yes", "advps_bxshad1" => "0", "advps_bxshad2" => "1", "advps_bxshad3" => "4", "advps_bxshadcolor" => "#000000", "advps_remove_shd" => "no", "advps_cont_width" => "280", "advps_titleFcolor" => "#000000", "advps_titleHcolor" => "#E6E6E6", "advps_titleFsize" => "22", "advps_excptFcolor" => "#333333", "advps_excptFsize" => "12", "advps_excerptlen" => "30", "advps_ed_link" => "enable", "advps_link_type" => "permalink", "advps_exclude_pager" => "no", "advps_pager_type" => "bullet", "advps_pager_right" => "8", "advps_pager_bottom" => "6", "advps_exclude_nxtprev" => "no", "advps_exclude_playpause" => "no" ); /* ---------------------------------------------------------------------------------*/ function advps_enqueue() { $pluginsURL = WP_PLUGIN_URL."/advanced-post-slider/"; wp_register_style('advpsStyleSheet', advps_url.'advps-style.css'); wp_enqueue_style( 'advpsStyleSheet'); wp_enqueue_script('jquery'); wp_enqueue_script( 'advps_jcycle',advps_url.'js/jquery.cycle.all.js',array( 'jquery' ) ); wp_enqueue_script( 'advps_easing',advps_url.'js/jquery.easing.1.3.js',array( 'jquery' ) ); wp_enqueue_script( 'advps_front_script',advps_url.'js/advps.frnt.script.js' ); } add_action( 'wp_enqueue_scripts', 'advps_enqueue' ); function load_custom_wp_admin_style() { global $wp_version; if(isset($_GET['page'])){ $pgslug = $_GET['page']; $menuslug = array('advps-slideshow'); if(!in_array($pgslug,$menuslug)) return; if($wp_version >= '3.5'){ wp_enqueue_script( 'wp-color-picker' ); wp_enqueue_style( 'wp-color-picker' ); } else { wp_enqueue_style( 'farbtastic' ); wp_enqueue_script( 'farbtastic' ); } wp_enqueue_script( 'advps-js-script', advps_url . 'js/advps.script.js', array( 'jquery' ) ); wp_localize_script( 'advps-js-script', 'advpsajx', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ),'advpsAjaxReqChck' => wp_create_nonce( 'advpsauthrequst' ))); } } add_action( 'admin_enqueue_scripts', 'load_custom_wp_admin_style' ); /* ---------------------------------------------------------------------------------------*/ register_activation_hook(WP_PLUGIN_DIR.'/advanced-post-slider/advanced-post-slider.php','set_advps_options'); register_deactivation_hook(WP_PLUGIN_DIR.'/advanced-post-slider/advanced-post-slider.php','unset_advps_options'); function set_advps_options(){ global $wpdb; global $advpsQuery; global $advpsQuery2; global $advpsEffects; global $templateOneDefaultOptions; global $templatetwoDefaultOptions; global $templatethreeDefaultOptions; $ins_q = "CREATE TABLE IF NOT EXISTS ".$wpdb->prefix."advps_optionset ( `id` int(5) NOT NULL AUTO_INCREMENT, `template` varchar(10) CHARACTER SET utf8 NOT NULL, `opt_data` text CHARACTER SET utf8 NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1"; $wpdb->query($ins_q); $ins_q2 = "CREATE TABLE IF NOT EXISTS ".$wpdb->prefix."advps_thumbnail ( `id` int(2) NOT NULL AUTO_INCREMENT, `thumb_name` varchar(500) NOT NULL, `width` int(4) NOT NULL, `height` int(4) NOT NULL, `crop` varchar(5) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1"; $wpdb->query($ins_q2); $arrmrg1 = array_merge($advpsQuery,$advpsEffects,$templateOneDefaultOptions); $arrmrg2 = array_merge($advpsQuery2,$advpsEffects,$templatetwoDefaultOptions); $arrmrg3 = array_merge($advpsQuery,$advpsEffects,$templatethreeDefaultOptions); $optdt1 = serialize($arrmrg1); $optdt2 = serialize($arrmrg2); $optdt3 = serialize($arrmrg3); $q1 = "insert into ".$wpdb->prefix."advps_optionset (template,opt_data) values('one','".$optdt1."')"; $q2 = "insert into ".$wpdb->prefix."advps_optionset (template,opt_data) values('two','".$optdt2."')"; $q3 = "insert into ".$wpdb->prefix."advps_optionset (template,opt_data) values('three','".$optdt3."')"; if(!$wpdb->get_results("select id from ".$wpdb->prefix."advps_optionset where template = 'one'")){ $wpdb->query($q1); } if(!$wpdb->get_results("select id from ".$wpdb->prefix."advps_optionset where template = 'two'")){ $wpdb->query($q2); } if(!$wpdb->get_results("select id from ".$wpdb->prefix."advps_optionset where template = 'three'")){ $wpdb->query($q3); } if(!$wpdb->get_results("select id from ".$wpdb->prefix."advps_thumbnail where thumb_name = 'advps_thumbnail_one'")){ $wpdb->query( "insert into ".$wpdb->prefix."advps_thumbnail (thumb_name,width,height,crop) values('advps_thumbnail_one',800,250,'yes')"); } if(!$wpdb->get_results("select id from ".$wpdb->prefix."advps_thumbnail where thumb_name = 'advps_thumbnail_two'")){ $wpdb->query( "insert into ".$wpdb->prefix."advps_thumbnail (thumb_name,width,height,crop) values('advps_thumbnail_two',624,250,'no')"); } } function unset_advps_options(){ } /* ---------------------------------------------------------------------------------------*/ function advps_image_sizes(){ if ( function_exists( 'add_image_size' ) ) { global $wpdb; $rth = $wpdb->get_results( "select * from ".$wpdb->prefix."advps_thumbnail"); foreach($rth as $th){ add_image_size( $th->thumb_name,$th->width,$th->height, true); } } } add_action('wp_loaded', 'advps_image_sizes'); function advps_excerpt_length_one( $length ) { return get_option('advps_excerptlen_one'); } //add_filter( 'excerpt_length', 'advps_excerpt_length_one', 999 ); function advps_excerpt_length( $length ) { return get_option('advps_excerptlen'); } add_action( "wp_ajax_chkCaetegory", "chkCaetegory" ); function chkCaetegory(){ $nonce = $_POST['checkReq']; $posttype = $_POST['post_type']; if(!wp_verify_nonce( $nonce, 'advpsauthrequst' )){ echo "Unauthorized request."; exit; } $catHtml = ''; if($posttype == 'post'){ $catHtml = 'Category[ * You can select multiple category ]'; } else { $posttypeobj = get_post_type_object($posttype); if(in_array('category',$posttypeobj->taxonomies)){ $catHtml = 'Category[ * You can select multiple category ]'; } } echo $catHtml; exit; } /* ---------------------------------------------------------------------------------------*/ function advps_slideshow($atts) { global $post; global $wpdb; global $_wp_additional_image_sizes; $current = $post->ID; if(is_array($atts) && array_key_exists('optset',$atts)){ $q1 = "select template,opt_data from ".$wpdb->prefix."advps_optionset where id = ".$atts['optset']; $res1 = $wpdb->get_results($q1); if($res1){ $optset = unserialize($res1[0]->opt_data); } else return; } else return; if($optset['advps_exclude']){ $exclude = explode(',',$optset['advps_exclude']); if(!in_array($current,$exclude)){ $exclude[] = $current; } } else { $exclude[] = $current; } $query_arg = array( 'post_type' => ($optset['advps_post_types']) ? $optset['advps_post_types'] : 'post', 'post__not_in' => $exclude, //'cat' => (is_array($atts) && array_key_exists('cat',$atts)) ? $atts['cat'] : 1, 'posts_per_page' => ($optset['advps_maxpost']) ? $optset['advps_maxpost'] : 10, 'orderby' => ($optset['advps_order_by']) ? $optset['advps_order_by'] : 'date', 'order' => ($optset['advps_order']) ? $optset['advps_order'] : 'DESC' ); if($optset['advps_post_types'] && $optset['advps_post_types'] != "page"){ if($optset['advps_post_types'] == "post"){ if(isset($optset['advps_category'])){ $query_arg['cat'] = implode(',',$optset['advps_category']); } } else { $post_type_obj = get_post_type_object( $optset['advps_post_types'] ); if(in_array('category',$post_type_obj->taxonomies)){ if(isset($optset['advps_category'])){ $query_arg['cat'] = implode(',',$optset['advps_category']); } } } } $template = $res1[0]->template; // modify it to overwrite through shortcode if($template == "two"){ $postperslide = $optset['advps_postperslide']; } if(($template == "one" || $template == "two") && !post_type_supports( $optset['advps_post_types'], 'thumbnail' )){ return; } if(is_array($atts) && array_key_exists('id',$atts)){ $sldshowID = str_replace(' ','',$atts['id']); } else { $sldshowID = substr(time(),8,2).rand(100,9999); } if($template != 'two'){ if($optset['advps_excerptlen']){ update_option('advps_excerptlen',$optset['advps_excerptlen']); } else { update_option('advps_excerptlen',30); } add_filter( 'excerpt_length', 'advps_excerpt_length', 999 ); } ob_start(); ?>
" style="width:px;height:px; overflow:hidden; position:relative;"> have_posts()) : $the_query->the_post();if($template == 'one'): if(has_post_thumbnail()){ $thumbID = get_post_meta($post->ID,'_thumbnail_id',true); $th_metadata = get_post_meta($thumbID,'_wp_attachment_metadata',true); if($optset['advps_thumbnail'] == 'full' || !array_key_exists($optset['advps_thumbnail'],$th_metadata['sizes']) ){ $th_width = $th_metadata['width']; $th_height = $th_metadata['height']; } else { $th_width = $th_metadata['sizes'][$optset['advps_thumbnail']]['width']; $th_height = $th_metadata['sizes'][$optset['advps_thumbnail']]['height']; } } ?>
">DownLeft Arrow
pause
">UpRight Arrow