"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 = '