prepare("delete from ".$wpdb->prefix."advps_optionset where id = %d",$_POST['optset-id']); if($wpdb->query($q_del)){ delete_option('optset'.$_POST['optset-id']); $stsMgs = "Deleted successfully."; } } elseif(isset($_POST['dup-optset'])){ $q_sel = "select * from ".$wpdb->prefix."advps_optionset where id = ".$_POST['optset-id']; $res = $wpdb->get_results($q_sel); //echo get_option('advpssmethod'.$_POST['optset-id']);exit; //echo '
';
//print_r($res);exit;
$q_add = $wpdb->prepare("insert into ".$wpdb->prefix."advps_optionset (template,plist,query,slider,caro_ticker,container,content,navigation) values(%s,%s,%s,%s,%s,%s,%s,%s)",$res[0]->template,$res[0]->plist,$res[0]->query,$res[0]->slider,$res[0]->caro_ticker,$res[0]->container,$res[0]->content,$res[0]->navigation);
if($wpdb->query($q_add)){
update_option('advpssmethod'.$_POST['nextoptid'],get_option('advpssmethod'.$_POST['optset-id']));
$stsMgs = "Duplicated successfully.";
}
}
}
if(isset($_POST['advps_submit'])){
if($_POST['advps_submit'] == 'Add new slideshow'){
if ( !isset($_POST['advps_wpnonce']) || !wp_verify_nonce($_POST['advps_wpnonce'],'advps-checkauthnonce') )
{
print 'Sorry, your nonce did not verify.';
exit;
}
$all_field = $_POST;
$tem_list = array('one','two','three');
$template = sanitize_text_field($_POST['template']);
if( ! in_array( $template, $tem_list )){
exit;
}
global $advpsPlist;
global $advpsQuery;
global $advpsSlide;
//global $advpsSlide2;
global $advpsCaroTicker;
global $advpsContainer;
global $advpsContainer2;
global $advpsContainer3;
global $advpsContent;
global $advpsContent2;
global $advpsNavigation;
if( $template == 'one'){
$q_add = $wpdb->prepare("insert into ".$wpdb->prefix."advps_optionset (template,plist,query,slider,caro_ticker,container,content,navigation) values(%s,%s,%s,%s,%s,%s,%s,%s)",$template,serialize($advpsPlist),serialize($advpsQuery),serialize($advpsSlide),serialize($advpsCaroTicker),serialize($advpsContainer),serialize($advpsContent),serialize($advpsNavigation));
}
elseif( $template == 'two'){
$q_add = $wpdb->prepare("insert into ".$wpdb->prefix."advps_optionset (template,plist,query,slider,caro_ticker,container,navigation) values(%s,%s,%s,%s,%s,%s,%s)",$template,serialize($advpsPlist),serialize($advpsQuery),serialize($advpsSlide),serialize($advpsCaroTicker),serialize($advpsContainer2),serialize($advpsNavigation));
}
elseif($template == 'three'){
$q_add = $wpdb->prepare("insert into ".$wpdb->prefix."advps_optionset (template,plist,query,slider,caro_ticker,container,content,navigation) values(%s,%s,%s,%s,%s,%s,%s,%s)",$template,serialize($advpsPlist),serialize($advpsQuery),serialize($advpsSlide),serialize($advpsCaroTicker),serialize($advpsContainer3),serialize($advpsContent2),serialize($advpsNavigation));
}
if($wpdb->query($q_add)){
update_option('advpssmethod'.$_POST['nextoptid'],'plist');
$stsMgs = "Added successfully.";
}
}
}
if(isset($_POST['advps_add_thumb'])){
if($_POST['advps_add_thumb'] == 'Add'){
if ( !isset($_POST['advps_wpnonce']) || !wp_verify_nonce($_POST['advps_wpnonce'],'advps-checkauthnonce') )
{
print 'Sorry, your nonce did not verify.';
exit;
}
$thumb_name = sanitize_text_field($_POST['advps_thumb_name']);
$width = sanitize_text_field($_POST['advps_thumb_width']);
$height = sanitize_text_field($_POST['advps_thumb_height']);
$crop = sanitize_text_field($_POST['advps_crop']);
$q = $wpdb->prepare("insert into ".$wpdb->prefix."advps_thumbnail (thumb_name,width,height,crop) values(%s,%d,%d,%s)",$thumb_name,$width,$height,$crop);
if($wpdb->query($q)){
$stsMgs = "Added successfully.";
}
}
}
if(isset($_POST['update_thumb'])){
if ( !isset($_POST['advps_wpnonce']) || !wp_verify_nonce($_POST['advps_wpnonce'],'advps-checkauthnonce') )
{
print 'Sorry, your nonce did not verify.';
exit;
}
$thumb_id = sanitize_text_field($_POST['thumb_id']);
$thumb_name = sanitize_text_field($_POST['advps_thumb_name']);
$width = sanitize_text_field($_POST['advps_thumb_width']);
$height = sanitize_text_field($_POST['advps_thumb_height']);
$crop = sanitize_text_field($_POST['advps_crop']);
$q = $wpdb->prepare("update ".$wpdb->prefix."advps_thumbnail set thumb_name = '%s',width = %d, height = %d, crop = '%s' where id = %d",$thumb_name,$width,$height,$crop,$thumb_id);
if($wpdb->query($q)){
$stsMgs = "Updated successfully.";
}
}
$q1 = "select * from ".$wpdb->prefix."advps_optionset where template = 'one'";
$q2 = "select * from ".$wpdb->prefix."advps_optionset where template = 'two'";
$q3 = "select * from ".$wpdb->prefix."advps_optionset where template = 'three'";
$res1 = $wpdb->get_results($q1);
$res2 = $wpdb->get_results($q2);
$res3 = $wpdb->get_results($q3);
$q_thumb = "select * from ".$wpdb->prefix."advps_thumbnail";
$res_thumb = $wpdb->get_results($q_thumb);
$catList = get_categories();
$customPostTypes = get_post_types(array('public' => true, '_builtin' => false));
?>
Advanced post slider is updated.
Template One Template Two Template ThreeThumbnails
Advanced post slider 2.3.0
Do you like this Plugin?
I spend lots of free hours to develop, maintain and providing support to this plugin. Any kind of participation will be highly appreciated and real inspiration for me to work more.
- Write a small blog for Advanced post slider and give link to our site.
- Share it to your social media.
- Give it a good rating and review
- Vote that it work