Headline
CVE-2023-2708: video-slider-with-thumbnails.php in video-slider-with-thumbnails/tags/1.0.11 – WordPress Plugin Repository
The Video Gallery plugin for WordPress is vulnerable to Reflected Cross-Site Scripting via the ‘search_term’ parameter in versions up to, and including, 1.0.10 due to insufficient input sanitization and output escaping. This makes it possible for unauthenticated attackers to inject arbitrary web scripts in pages that execute if they can successfully trick a user into performing an action such as clicking on a link.
1<?php2/*3 * Plugin Name: Video Slider With Thumbnails4 * Plugin URI:https://www.i13websolution.com/product/wordpress-video-slider-plugin-pro/5 * Author URI:https://www.i13websolution.com6 * Description:This is beautiful responsive video slider plugin.Add any number of images,video from admin panel.your video slider will be ready within few min. 7 * Author:I Thirteen Web Solution 8 * Version:1.0.119 * Text Domain:video-slider-with-thumbnails10 * Domain Path: /languages11 */1213if ( ! defined( ‘ABSPATH’ ) ) exit; 1415$dir = plugin_dir_path( __FILE__ );16$dir=str_replace(“\\","/",$dir);17if(!class_exists(‘vgwt_resize’)){18 require_once($dir.’classes/vgwt.class.Images.php’);19}20add_filter ( 'widget_text’, ‘do_shortcode’ );21add_action ( ‘admin_menu’, ‘vgwt_responsive_gallery__add_admin_menu’ );2223register_activation_hook ( __FILE__, ‘vgwt_install_responsive_gallery’ );24register_deactivation_hook(__FILE__,’vgwt_video_slider_remove_access_capabilities’);25add_action ( 'wp_enqueue_scripts’, ‘vgwt_responsive_gallery__load_styles_and_js’ );26add_shortcode ( 'vgwt_print_responsive_video_slider_with_thumbnail’, ‘vgwt_print_responsive_video_slider_with_thumbnail_func’ );27add_action ( 'admin_notices’, ‘vgwt_responsive_gallery__admin_notices’ );2829add_action( 'wp_ajax_vgwt_check_file_exist_gallery’, ‘vgwt_check_file_exist_gallery_callback’ );30add_action( 'wp_ajax_vgwt_get_youtube_info_gallery’, ‘vgwt_get_youtube_info_gallery_callback’ );31add_action( 'wp_ajax_vgwt_get_metacafe_info_gallery’, ‘vgwt_get_metacafe_info_gallery_callback’ );3233add_action('wp_ajax_vgwt_get_grid_data_gallery’, ‘vgwt_get_grid_data_gallery_callback’);34add_action('wp_ajax_nopriv_vgwt_get_grid_data_gallery’, ‘vgwt_get_grid_data_gallery_callback’);35add_action('plugins_loaded’, ‘vgwt_lang_for_responsive_video_thumbnail_gallery’);36add_filter( 'user_has_cap’, ‘vgwt_video_slider_admin_cap_list’ , 10, 4 );3738function vgwt_lang_for_responsive_video_thumbnail_gallery() {39 40 load_plugin_textdomain( 'video-slider-with-thumbnails’, false, basename( dirname( __FILE__ ) ) . ‘/languages/’ );41 add_filter( 'map_meta_cap’, 'map_vgwt_video_slider_meta_caps’, 10, 4 );42 }43 44 45 function map_vgwt_video_slider_meta_caps( array $caps, $cap, $user_id, array $args ) {46 47 48 if ( ! in_array( $cap, array(49 'vgwt_video_slider_settings’,50 'vgwt_video_slider_view_images’,51 'vgwt_video_slider_add_media’,52 'vgwt_video_slider_edit_media’,53 'vgwt_video_slider_delete_media’,54 'vgwt_video_slider_preview’,55 56 ), true ) ) {57 58 return $caps;59 }6061 62 63 64 $caps = array();6566 switch ( $cap ) {67 68 case 'vgwt_video_slider_settings’:69 $caps[] = 'vgwt_video_slider_settings’;70 break;71 72 case 'vgwt_video_slider_view_images’:73 $caps[] = 'vgwt_video_slider_view_images’;74 break;75 76 case 'vgwt_video_slider_add_media’:77 $caps[] = 'vgwt_video_slider_add_media’;78 break;79 80 case 'vgwt_video_slider_edit_media’:81 $caps[] = 'vgwt_video_slider_edit_media’;82 break;83 84 case 'vgwt_video_slider_delete_media’:85 $caps[] = 'vgwt_video_slider_delete_media’;86 break;87 88 case 'vgwt_video_slider_preview’:89 $caps[] = 'vgwt_video_slider_preview’;90 break;91 92 default:93 94 $caps[] = 'do_not_allow’;95 break;96 }9798 99 return apply_filters( 'vgwt_video_slider_meta_caps’, $caps, $cap, $user_id, $args );100}101102103 function vgwt_video_slider_admin_cap_list($allcaps, $caps, $args, $user){104 105 106 if ( ! in_array( ‘administrator’, $user->roles ) ) {107 108 return $allcaps;109 }110 else{111 112 if(!isset($allcaps[‘vgwt_video_slider_settings’])){113 114 $allcaps[‘vgwt_video_slider_settings’]=true;115 }116 117 if(!isset($allcaps[‘vgwt_video_slider_view_images’])){118 119 $allcaps[‘vgwt_video_slider_view_images’]=true;120 }121 122 if(!isset($allcaps[‘vgwt_video_slider_add_media’])){123 124 $allcaps[‘vgwt_video_slider_add_media’]=true;125 }126 if(!isset($allcaps[‘vgwt_video_slider_edit_media’])){127 128 $allcaps[‘vgwt_video_slider_edit_media’]=true;129 }130 if(!isset($allcaps[‘vgwt_video_slider_delete_media’])){131 132 $allcaps[‘vgwt_video_slider_delete_media’]=true;133 }134 if(!isset($allcaps[‘vgwt_video_slider_preview’])){135 136 $allcaps[‘vgwt_video_slider_preview’]=true;137 }138 139 }140 141 return $allcaps;142 143 }144145function vgwt_video_slider_add_access_capabilities() {146 147 // Capabilities for all roles.148 $roles = array( ‘administrator’ );149 foreach ( $roles as $role ) {150 151 $role = get_role( $role );152 if ( empty( $role ) ) {153 continue;154 }155 156 157 if(!$role->has_cap( ‘vgwt_video_slider_settings’ ) ){158 159 $role->add_cap( ‘vgwt_video_slider_settings’ );160 }161 162 if(!$role->has_cap( ‘vgwt_video_slider_view_images’ ) ){163 164 $role->add_cap( ‘vgwt_video_slider_view_images’ );165 }166 167 168 if(!$role->has_cap( ‘vgwt_video_slider_add_media’ ) ){169 170 $role->add_cap( ‘vgwt_video_slider_add_media’ );171 }172 173 if(!$role->has_cap( ‘vgwt_video_slider_edit_media’ ) ){174 175 $role->add_cap( ‘vgwt_video_slider_edit_media’ );176 }177 178 if(!$role->has_cap( ‘vgwt_video_slider_delete_media’ ) ){179 180 $role->add_cap( ‘vgwt_video_slider_delete_media’ );181 }182 183 if(!$role->has_cap( ‘vgwt_video_slider_preview’ ) ){184 185 $role->add_cap( ‘vgwt_video_slider_preview’ );186 }187 188 189 }190 191 $user = wp_get_current_user();192 $user->get_role_caps();193 194}195196function vgwt_video_slider_remove_access_capabilities(){197 198 global $wp_roles;199200 if ( ! isset( $wp_roles ) ) {201 $wp_roles = new WP_Roles();202 }203204 foreach ( $wp_roles->roles as $role => $details ) {205 $role = $wp_roles->get_role( $role );206 if ( empty( $role ) ) {207 continue;208 }209210 $role->remove_cap( ‘vgwt_video_slider_settings’ );211 $role->remove_cap( ‘vgwt_video_slider_view_images’ );212 $role->remove_cap( ‘vgwt_video_slider_add_media’ );213 $role->remove_cap( ‘vgwt_video_slider_edit_media’ );214 $role->remove_cap( ‘vgwt_video_slider_delete_media’ );215 $role->remove_cap( ‘vgwt_video_slider_preview’ );216 217218 }219220 // Refresh current set of capabilities of the user, to be able to directly use the new caps.221 $user = wp_get_current_user();222 $user->get_role_caps();223 224}225226function vgwt_save_image_remote($url,$saveto){227 228 $raw = wp_remote_retrieve_body( wp_remote_get( $url ) );229 230 if(file_exists($saveto)){231 @unlink($saveto);232 }233 $fp = @fopen($saveto,’x’);234 @fwrite($fp, $raw);235 @fclose($fp);236}237238239240function vgwt_get_youtube_info_gallery_callback(){241 242 if(isset($_POST) and is_array($_POST) and isset($_POST[‘url’])){243 244245 $retrieved_nonce = '’;246247 if (isset($_POST[‘vNonce’]) and $_POST[‘vNonce’] != ‘’) {248249 $retrieved_nonce = sanitize_text_field($_POST[‘vNonce’]);250 }251 if (!wp_verify_nonce($retrieved_nonce, ‘vNonce’)) {252253254 wp_die(‘Security check fail’);255 }256257 258 $vid=sanitize_text_field($_POST[‘vid’]);259 $url=$_POST[‘url’]; 260 261 $output= wp_remote_retrieve_body( wp_remote_get( $url ) ); 262263 $output=json_decode($output);264 265266 267 $return=array();268 if(is_object($output)){269 270 $return[‘title’]=sanitize_text_field($output->title);271 $return[‘thumbnail_url’]=sanitize_text_field($output->thumbnail_url);272 273 274 }275 276 echo json_encode($return);277 exit;278 279 }280 281}282function vgwt_check_file_exist_gallery_callback() {283 284 if(isset($_POST) and is_array($_POST) and isset($_POST[‘url’])){285286 287 $retrieved_nonce = '’;288289 if (isset($_POST[‘vNonce’]) and $_POST[‘vNonce’] != ‘’) {290291 $retrieved_nonce = sanitize_text_field($_POST[‘vNonce’]);292 }293 if (!wp_verify_nonce($retrieved_nonce, ‘vNonce’)) {294295296 wp_die(‘Security check fail’);297 }298 299 $response = wp_remote_get(sanitize_text_field($_POST[‘url’]));300 $httpCode = wp_remote_retrieve_response_code( $response );301 302 echo trim((string)$httpCode);die;303 304 }305 //echo die;306 307}308309function vgwt_i13_get_http_response_code_gallery($url) {310 $headers = @get_headers($url);311 return @substr($headers[0], 9, 3);312}313314function vgwt_get_metacafe_info_gallery_callback() {315 316 if (isset($_POST) and is_array($_POST) and isset($_POST[‘url’])) {317318 $retrieved_nonce = '’;319320 if (isset($_POST[‘vNonce’]) and $_POST[‘vNonce’] != ‘’) {321322 $retrieved_nonce = sanitize_text_field($_POST[‘vNonce’]);323 }324 if (!wp_verify_nonce($retrieved_nonce, ‘vNonce’)) {325326327 wp_die(‘Security check fail’);328 }329330 $videoUrl = trim($_POST[‘url’]);331 $videoInfo = wp_remote_retrieve_body( wp_remote_get($videoUrl));332 $doc = new DomDocument();333 $doc->validateOnParse = false;334 $doc->loadHTML('<?xml encoding="utf-8” ?>’.$videoInfo);335 $xpath = new DomXpath($doc);336 $imgUrl=’’;337 $title=’’;338 $description=’’;339 $entries = $xpath->query(“//video[@id=’video’]/@poster”);340 foreach($entries as $element){341342 $imgUrl= $element->nodeValue;343 break;344 }345346 $entries = $xpath->query(‘//h5[contains(@class, “font-size-21”)]');347348 foreach($entries as $element){349350 $title= $description= $element->textContent; 351 break;352 }353354 $entries = $xpath->query(‘//p/span[contains(@class, “d-inline-flex”)]');355356 foreach($entries as $element){357358 $description= $description= $element->textContent; 359 break;360 }361362363 // $description = strip_tags($description);364 $description = preg_replace(‘/(?<=Ranked)\b.*/is’, ‘’, $description);365 $description = str_replace(‘Ranked’, ‘’, $description);366367 $description = str_replace(‘quot;’, ‘’, $description);368 $description = str_replace(‘&’, ‘’, $description);369 // $description = strip_tags($description);370 $description = preg_replace(‘/(?<=Ranked)\b.*/is’, ‘’, $description);371 $description = str_replace(‘Ranked’, ‘’, $description);372373 $description = str_replace(‘quot;’, ‘’, $description);374 $description = str_replace(‘&’, ‘’, $description);375376377378379380 $returnArray = array(‘vid’ => $vid, ‘HdnMediaSelection’ => $imgUrl, “videotitle” => $title, ‘videotitleurl’ => $videoUrl, “video_description” => $description);381 $returnArray = json_encode($returnArray);382 echo $returnArray;383 die;384 }385 echo die;386}387388function vgwt_responsive_gallery__admin_notices() {389 if (is_plugin_active ( ‘video-slider-with-thumbnails/video-slider-with-thumbnails.php’ )) {390 391 $uploads = wp_upload_dir ();392 $baseDir = $uploads [‘basedir’];393 $baseDir = str_replace ( “\\", “/", $baseDir );394 $pathToImagesFolder = $baseDir . '/video-slider-with-thumbnails’;395 396 if (file_exists ( $pathToImagesFolder ) and is_dir ( $pathToImagesFolder )) {397 398 if (! is_writable ( $pathToImagesFolder )) {399 echo “<div class=’updated’><p>".__( 'Video Slider With Thumbnail is active but does not have write permission on ‘,’video-slider-with-thumbnails’)."</p><p><b>” . $pathToImagesFolder . “</b> “.__( ‘directory.Please allow write permission.’,’video-slider-with-thumbnails’)."</p></div> “;400 }401 } else {402 403 wp_mkdir_p ( $pathToImagesFolder );404 if (! file_exists ( $pathToImagesFolder ) and ! is_dir ( $pathToImagesFolder )) {405 echo “<div class=’updated’><p>".__( 'Video Slider With Thumbnail is active but plugin does not have permission to create directory ‘,’video-slider-with-thumbnails’)."</p><p><b>” . $pathToImagesFolder . “</b> .".__( ‘Please create video-slider-with-thumbnails directory inside upload directory and allow write permission.’,’video-slider-with-thumbnails’)."</p></div> “;406 }407 }408 }409}410411412function vgwt_responsive_gallery_gallery__add_admin_init() {413 414 415 $url = plugin_dir_url ( __FILE__ );416 417 wp_enqueue_style( 'admincss’, plugins_url('/css/admincss.css’, __FILE__) );418 wp_enqueue_style( 'video-slider-responsive’, plugins_url('/css/video-slider-responsive.css’, __FILE__) );419 wp_enqueue_script(‘jquery’); 420 wp_enqueue_script(“jquery-ui-core”);421 wp_enqueue_script('jquery.timers-1.2-video-slider’,plugins_url('/js/jquery.timers-1.2-video-slider.js’, __FILE__));422 wp_enqueue_script('jquery.easing.1.3-video-slider’,plugins_url('/js/jquery.easing.1.3-video-slider.js’, __FILE__));423 wp_enqueue_script('video-gallery-js’,plugins_url('/js/video-gallery-js.js’, __FILE__));424 wp_enqueue_script('jquery.validate’,plugins_url('/js/jquery.validate.js’, __FILE__));425 426 427 428 vgwt_responsive_gallery__admin_scripts_init();429}430431function vgwt_responsive_gallery__load_styles_and_js() {432 433 if (! is_admin ()) {434 435 wp_register_style ( 'video-slider-responsive’, plugins_url ( ‘/css/video-slider-responsive.css’, __FILE__ ),array(),’1.0.7’ );436 wp_enqueue_script ( ‘jquery’ );437 wp_register_script ( 'jquery.timers-1.2-video-slider’, plugins_url ( ‘/js/jquery.timers-1.2-video-slider.js’, __FILE__ ),array(‘jquery’),’1.0.7’ );438 wp_register_script ( 'jquery.easing.1.3-video-slider’, plugins_url ( ‘/js/jquery.easing.1.3-video-slider.js’, __FILE__ ) ,array(‘jquery’),’1.0.7’);439 wp_register_script ( 'video-gallery-js’, plugins_url ( ‘/js/video-gallery-js.js’, __FILE__ ),array(‘jquery’),’1.0.7’ );440 441 }442}443function vgwt_install_responsive_gallery() {444 445 global $wpdb;446 $table_name = $wpdb->prefix . “e_gallery";447 $table_name2 = $wpdb->prefix . “e_gallery_settings";448 449 $charset_collate = $wpdb->get_charset_collate();450 451 $sql = “CREATE TABLE " . $table_name . " (452 `id` int(11) NOT NULL AUTO_INCREMENT,453 `media_type` varchar(10) NOT NULL,454 `image_name` varchar(500) NOT NULL,455 `title` varchar(500) NOT NULL,456 `morder` int(11) NOT NULL DEFAULT '0’,457 `vtype` varchar(50) DEFAULT NULL,458 `vid` varchar(300) DEFAULT NULL,459 `videourl` varchar(1000) DEFAULT NULL,460 `embed_url` varchar(300) DEFAULT NULL,461 `HdnMediaSelection` varchar(300) NOT NULL,462 `createdon` datetime NOT NULL, 463 `slider_id` int(11) NOT NULL DEFAULT '1’,464 PRIMARY KEY (`id`)465 ) $charset_collate “;466467 468 require_once (ABSPATH . ‘wp-admin/includes/upgrade.php’);469 dbDelta ( $sql );470471 //delete_option(‘vgwt_video_slider_settings’);472 $vgwt_video_slider_settings=array(‘transition_speed’ => '1000’,473 ‘transition_interval’ => '4000’,474 ‘show_panels’ =>1,475 ‘show_panel_nav’ =>1,476 ‘enable_overlays’ => 0,477 'panel_width’=>550,478 ‘panel_height’ => 400,479 ‘panel_animation’ => 'fade’,480 ‘panel_scale’ => 'fit’,481 'overlay_position’=> 'bottom’,482 'start_frame’=>1,483 'show_filmstrip’=>1,484 'show_filmstrip_nav’=>0,485 'enable_slideshow’=>1,486 'autoplay’=>0,487 'filmstrip_position’=>’bottom’,488 'frame_width’=>80,489 'frame_height’=>80,490 'frame_opacity’=>0.4,491 'frame_scale’=>’crop’,492 'filmstrip_style’=>’scroll’,493 'frame_gap’=>1,494 'show_captions’=>0,495 'show_infobar’=>0,496 'infobar_opacity’=>1497 );498499 if( !get_option( ‘vgwt_video_slider_settings’ ) ) {500501 update_option('vgwt_video_slider_settings’,$vgwt_video_slider_settings);502 } 503 504 $uploads = wp_upload_dir ();505 $baseDir = $uploads [‘basedir’];506 $baseDir = str_replace ( “\\", “/", $baseDir );507 $pathToImagesFolder = $baseDir . '/video-slider-with-thumbnails’;508 wp_mkdir_p ( $pathToImagesFolder );509 vgwt_video_slider_add_access_capabilities();510 511 512 513 514}515function vgwt_responsive_gallery__add_admin_menu() {516 517 $hook_suffix = add_menu_page ( __( ‘Video Slider With Thumbnail’,’video-slider-with-thumbnails’) , __ ( ‘Video Slider With Thumbnail’,’video-slider-with-thumbnails’ ), 'vgwt_video_slider_settings’, 'responsive_video_slider_with_thumbnail’, ‘vgwt_responsive_video_slider_with_thumbnail_admin_options_func’ );518 $hook_suffix=add_submenu_page ( 'responsive_video_slider_with_thumbnail’, __ ( ‘Slider Settings’,’video-slider-with-thumbnails’ ), __ ( ‘Slider Settings’,’video-slider-with-thumbnails’ ), 'vgwt_video_slider_settings’, 'responsive_video_slider_with_thumbnail’, ‘vgwt_responsive_video_slider_with_thumbnail_admin_options_func’ );519 $hook_suffix_image=add_submenu_page ( 'responsive_video_slider_with_thumbnail’, __ ( ‘Manage Media’,’video-slider-with-thumbnails’ ), __ ( ‘Manage Media’,’video-slider-with-thumbnails’ ), 'vgwt_video_slider_view_images’, 'responsive_video_slider_with_thumbnail_media_management’, ‘vgwt_responsive_video_slider_with_thumbnail_media_management_func’ );520 $hook_suffix_prev=add_submenu_page ( 'responsive_video_slider_with_thumbnail’, __ ( ‘Preview Video Slider’,’video-slider-with-thumbnails’ ), __ ( ‘Preview Video Slider’,’video-slider-with-thumbnails’ ), 'vgwt_video_slider_preview’, 'responsive_video_slider_with_thumbnail_media_preview’, ‘vgwt_responsive_video_slider_with_thumbnail_media_preview_func’ );521 522 add_action( 'load-' . $hook_suffix , ‘vgwt_responsive_gallery_gallery__add_admin_init’ );523 add_action( 'load-' . $hook_suffix_image , ‘vgwt_responsive_gallery_gallery__add_admin_init’ );524 add_action( 'load-' . $hook_suffix_prev , ‘vgwt_responsive_gallery_gallery__add_admin_init’ );525 526 vgwt_responsive_gallery__admin_scripts_init();527 528}529530531function vgwt_responsive_video_slider_with_thumbnail_admin_options_func(){532533 if ( ! current_user_can( ‘vgwt_video_slider_settings’ ) ) {534535 wp_die( __( “Access Denied", “video-slider-with-thumbnails” ) );536537 } 538539 if(isset($_POST[‘btnsave’])){540541 if ( !check_admin_referer( ‘action_image_add_edit’,’add_edit_image_nonce’)){542543 wp_die(‘Security check fail’); 544 }545546 547 $transition_speed=sanitize_text_field($_POST[‘transition_speed’]); 548 $transition_speed=intval($transition_speed); 549 550 551 $transition_interval=sanitize_text_field($_POST[‘transition_interval’]); 552 $transition_interval=intval($transition_interval); 553 554 $show_panel_nav=sanitize_text_field($_POST[‘show_panel_nav’]); 555 $show_panel_nav=intval($show_panel_nav); 556 557 558 $panel_width=sanitize_text_field($_POST[‘panel_width’]); 559 $panel_width=intval($panel_width); 560 561 $panel_height=sanitize_text_field($_POST[‘panel_height’]); 562 $panel_height=intval($panel_height); 563 564 $panel_scale=sanitize_text_field($_POST[‘panel_scale’]); 565 566 $show_filmstrip=sanitize_text_field($_POST[‘show_filmstrip’]); 567 $show_filmstrip=intval($show_filmstrip); 568 569 $autoplay=sanitize_text_field($_POST[‘autoplay’]); 570 $autoplay=intval($autoplay); 571 572 $frame_width=sanitize_text_field($_POST[‘frame_width’]); 573 $frame_width=intval($frame_width); 574 575 576 $frame_height=sanitize_text_field($_POST[‘frame_height’]); 577 $frame_height=intval($frame_height); 578 579 580 $frame_opacity=sanitize_text_field($_POST[‘frame_opacity’]); 581 $frame_opacity=floatval($frame_opacity); 582 583 584 $frame_gap=sanitize_text_field($_POST[‘frame_gap’]); 585 $frame_gap=intval($frame_gap); 586 587 $show_infobar=sanitize_text_field($_POST[‘show_infobar’]); 588 $show_infobar=intval($show_infobar); 589 590 591 $infobar_opacity=sanitize_text_field($_POST[‘infobar_opacity’]); 592 $infobar_opacity=floatval($infobar_opacity); 593 594 595 $start_frame=1; 596 597 598 $panel_animation=sanitize_text_field($_POST[‘panel_animation’]); 599 $overlay_position=sanitize_text_field($_POST[‘overlay_position’]); 600 601 $enable_overlays=sanitize_text_field($_POST[‘enable_overlays’]); 602 $enable_overlays=intval($enable_overlays); 603 604 605 $show_captions=sanitize_text_field($_POST[‘show_captions’]); 606 $show_captions=intval($show_captions); 607 608 609 $show_filmstrip_nav=sanitize_text_field($_POST[‘show_filmstrip_nav’]); 610 $show_filmstrip_nav=intval($show_filmstrip_nav); 611 612 613 614 615 616 $options=array();617 $options[‘transition_speed’] =$transition_speed;618 $options[‘transition_interval’] =$transition_interval;619 $options[‘show_panel_nav’] =$show_panel_nav;620 $options[‘panel_width’] =$panel_width;621 $options[‘panel_height’] =$panel_height;622 $options[‘panel_scale’] =trim($panel_scale);623 $options[‘show_filmstrip’] =$show_filmstrip;624 $options[‘autoplay’] =$autoplay;625 $options[‘frame_width’] =$frame_width;626 $options[‘frame_height’] =$frame_height;627 $options[‘frame_opacity’] =$frame_opacity;628 $options[‘frame_scale’] =’crop’;629 $options[‘filmstrip_style’] =’scroll’;630 $options[‘frame_gap’] =$frame_gap;631 $options[‘show_infobar’] =$show_infobar;632 $options[‘infobar_opacity’] =$infobar_opacity;633 $options[‘start_frame’] =$start_frame;634 $options[‘panel_animation’] =trim($panel_animation);635 $options[‘overlay_position’] =trim($overlay_position);636 $options[‘filmstrip_position’] =’bottom’;637 $options[‘enable_overlays’] =$enable_overlays;638 $options[‘show_captions’] =$show_captions;639 $options[‘show_filmstrip_nav’] =$show_filmstrip_nav;640 641 if($autoplay)642 $options[‘enable_slideshow’] =1;643 else 644 $options[‘enable_slideshow’] =0;645646 $settings=update_option(‘vgwt_video_slider_settings’,$options); 647 $wp_vgallery_thumbnail_msg=array();648 $wp_vgallery_thumbnail_msg[‘type’]=’succ’;649 $wp_vgallery_thumbnail_msg[‘message’]=__("Settings saved successfully",’video-slider-with-thumbnails’);650 update_option('wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg);651652653654 } 655 $settings=get_option(‘vgwt_video_slider_settings’);656 657 658659 ?> 660 <div style="width: 100%;"> 661 <div style="float:left;width:100%;">662 <div class="wrap">663 <table><tr>664 <td>665 <div class="fb-like” data-href="https://www.facebook.com/i13websolution” data-layout="button” data-action="like” data-size="large” data-show-faces="false” data-share="false"></div>666 <div id="fb-root"></div>667 <script>(function(d, s, id) {668 var js, fjs = d.getElementsByTagName(s)[0];669 if (d.getElementById(id)) return;670 js = d.createElement(s); js.id = id;671 js.src = 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.2&appId=158817690866061&autoLogAppEvents=1’;672 fjs.parentNode.insertBefore(js, fjs);673 }(document, 'script’, ‘facebook-jssdk’));</script>674 </td> 675 <td>676 <a target="_blank” title="Donate” href="http://i13websolution.com/donate-wordpress_image_thumbnail.php">677 <img id="help us for free plugin” height="30” width="90” src="<?php echo plugins_url( 'images/paypaldonate.jpg’, __FILE__ );?>” border="0” alt="help us for free plugin” title="help us for free plugin">678 </a>679 </td>680 </tr>681 </table>682 <div style="clear:both">683 <span><h3 style="color: blue;"><a target="_blank" href="https://www.i13websolution.com/product/wordpress-video-slider-plugin-pro/"><?php echo __("UPGRADE TO PRO VERSION",’video-slider-with-thumbnails’);?></a></h3></span>684 </div> 685 <?php686 $messages=get_option(‘wp_vgallery_thumbnail_msg’); 687 $type=’’;688 $message=’’;689 if(isset($messages[‘type’]) and $messages[‘type’]!=""){690691 $type=$messages[‘type’];692 $message=$messages[‘message’];693694 } 695696697 if(trim($type)==’err’){ echo "<div class=’notice notice-error is-dismissible’><p>"; echo $message; echo "</p></div>";}698 else if(trim($type)==’succ’){ echo “<div class=’notice notice-success is-dismissible’><p>"; echo $message; echo “</p></div>";}699 700701702 update_option(‘wp_vgallery_thumbnail_msg’, array()); 703 ?> 704705706 <h2><?php echo __("Slider Settings",’video-slider-with-thumbnails’);?></h2>707 <div id="poststuff"> 708 <div id="post-body” class="metabox-holder columns-2">709 <div id="post-body-content” >710 <form method="post" action="" id="scrollersettiings" name="scrollersettiings" >711 <div class="stuffbox" id="namediv" style="width:100%;">712 <h3><label for="link_name"><?php echo __("Settings",’video-slider-with-thumbnails’);?></label></h3>713 <table cellspacing="0" class="form-list" cellpadding="10">714 <tbody>715 716 <tr>717 <td class="label">718 <label for="transition_speed"><?php echo __("Transition Speed",’video-slider-with-thumbnails’);?> <span class="required">*</span></label>719 </td>720 <td class="value">721 <input id="transition_speed" value="<?php echo intval($settings[‘transition_speed’]); ?>" name="transition_speed" class="input-text" type="text"> 722 <div style="clear:both"></div>723 <div></div> 724 </td>725 </tr>726 <tr>727 <td class="label">728 <label for="transition_interval"><?php echo __("Transition Interval",’video-slider-with-thumbnails’);?> <span class="required">*</span></label>729 </td>730 <td class="value">731 <input id="transition_interval" value="<?php echo intval($settings[‘transition_interval’]); ?>" name="transition_interval" class="input-text" type="text"> 732 <div style="clear:both"></div>733 <div></div>734 </td>735 </tr>736 <tr>737 <td class="label">738 <label for="show_panel_nav"><?php echo __("Show Slider Navigation arrows",’video-slider-with-thumbnails’);?> <span class="required">*</span></label>739 </td>740 <td class="value">741 <select id="show_panel_nav" name="show_panel_nav" class="select">742 <option value=""><?php echo __("Select",’video-slider-with-thumbnails’);?></option>743 <option <?php if(intval($settings[‘show_panel_nav’])==1):?> selected="selected" <?php endif;?> value="1" ><?php echo __("Yes",’video-slider-with-thumbnails’);?></option>744 <option <?php if(intval($settings[‘show_panel_nav’])==0):?> selected="selected" <?php endif;?> value="0"><?php echo __("No",’video-slider-with-thumbnails’);?></option>745 </select> 746 <div style="clear:both"></div>747 <div></div>748 </td>749 </tr> 750 <tr>751 <td class="label">752 <label for="enable_overlays"><?php echo __("Show Slider image Caption",’video-slider-with-thumbnails’);?> <span class="required">*</span></label>753 </td>754 <td class="value">755 <select id="enable_overlays" name="enable_overlays" class="select">756 <option value=""><?php echo __("Select",’video-slider-with-thumbnails’);?></option>757 <option <?php if(intval($settings[‘enable_overlays’])==1):?> selected="selected" <?php endif;?> value="1" ><?php echo __("Yes",’video-slider-with-thumbnails’);?></option>758 <option <?php if(intval($settings[‘enable_overlays’])==0):?> selected="selected" <?php endif;?> value="0"><?php echo __("No",’video-slider-with-thumbnails’);?></option>759 </select> 760 <div style="clear:both"></div>761 <div></div>762 </td>763 </tr>764 <tr>765 <td class="label">766 <label for="panel_width"><?php echo __("Slider Width",’video-slider-with-thumbnails’);?> <span class="required">*</span></label>767 </td>768 <td class="value">769 <input id="panel_width" value="<?php echo intval($settings[‘panel_width’]); ?>" name="panel_width" class="input-text" type="text"> 770 <div style="clear:both"></div>771 <div></div>772 </td>773 </tr>774 <tr>775 <td class="label">776 <label for="panel_height"><?php echo __("Slider Height",’video-slider-with-thumbnails’);?><span class="required">*</span></label>777 </td>778 <td class="value">779 <input id="panel_height" value="<?php echo intval($settings[‘panel_height’]); ?>" name="panel_height" class="input-text" type="text"> 780 <div style="clear:both"></div>781 <div></div>782 </td>783 </tr>784 <tr>785 <td class="label">786 <label for="panel_animation"><?php echo __("Slider Animation",’video-slider-with-thumbnails’);?> <span class="required">*</span></label>787 </td>788 <td class="value">789 <select id="panel_animation" name="panel_animation" class="select">790 <option value=""><?php echo __("Select",’video-slider-with-thumbnails’);?></option>791 <option <?php if(esc_html($settings[‘panel_animation’])==’fade’):?> selected="selected" <?php endif;?> value="fade"><?php echo __(“Fade",’video-slider-with-thumbnails’);?></option>792 <option <?php if(esc_html($settings[‘panel_animation’])==’crossfade’):?> selected="selected” <?php endif;?> value="crossfade" ><?php echo __(“crossfade",’video-slider-with-thumbnails’);?></option>793 <option <?php if(esc_html($settings[‘panel_animation’])==’slide’):?> selected="selected” <?php endif;?> value="slide" ><?php echo __(“Slide",’video-slider-with-thumbnails’);?></option>794 </select> 795 <div style="clear:both"></div>796 <div></div> 797 </td>798 </tr> 799 <tr>800 <td class="label">801 <label for="panel_scale"><?php echo __(“Slider Scale",’video-slider-with-thumbnails’);?> <span class="required">*</span></label>802 </td>803 <td class="value">804 <select id="panel_scale” name="panel_scale” class="select">805 <option value=""><?php echo __(“Select",’video-slider-with-thumbnails’);?></option>806 <option <?php if(esc_html($settings[‘panel_scale’])==’crop’):?> selected="selected” <?php endif;?> value="crop"><?php echo __(“Crop",’video-slider-with-thumbnails’);?></option>807 <option <?php if(esc_html($settings[‘panel_scale’])==’fit’):?> selected="selected” <?php endif;?> value="fit" ><?php echo __(“Fit",’video-slider-with-thumbnails’);?></option>808 </select> 809 <div style="clear:both"></div>810 <div></div> 811 </td>812 </tr>813 <tr>814 <td class="label">815 <label for="overlay_position"><?php echo __(“Caption Position",’video-slider-with-thumbnails’);?> <span class="required">*</span></label>816 </td>817 <td class="value">818 <select id="overlay_position” name="overlay_position” class="select">819 <option value=""><?php echo __(“Select",’video-slider-with-thumbnails’);?></option>820 <option <?php if(esc_html($settings[‘overlay_position’])==’bottom’):?> selected="selected” <?php endif;?> value="bottom"><?php echo __(“Bottom",’video-slider-with-thumbnails’);?></option>821 <option <?php if(esc_html($settings[‘overlay_position’])==’top’):?> selected="selected” <?php endif;?> value="top" ><?php echo __(“Top",’video-slider-with-thumbnails’);?></option>822 </select> 823 <div style="clear:both"></div>824 <div></div> 825 </td>826 </tr>827 828829 830831832 <tr>833 <td class="label">834 <label for="show_filmstrip"><?php echo __(“Show Thumbnail Gallery",’video-slider-with-thumbnails’);?> <span class="required">*</span></label>835 </td>836 <td class="value">837 <select id="show_filmstrip” name="show_filmstrip” class="select">838 <option value="">Select</option>839 <option <?php if(intval($settings[‘show_filmstrip’])==1):?> selected="selected" <?php endif;?> value="1" ><?php echo __(“Yes",’video-slider-with-thumbnails’);?></option>840 <option <?php if(intval($settings[‘show_filmstrip’])==0):?> selected="selected” <?php endif;?> value="0"><?php echo __(“No",’video-slider-with-thumbnails’);?></option>841 </select> 842 <div style="clear:both"></div>843 <div></div> 844 </td>845 </tr>846 <tr>847 <td class="label">848 <label for="show_filmstrip_nav"><?php echo __(“Show Thumbnail Gallery Navigation",’video-slider-with-thumbnails’);?> <span class="required">*</span></label>849 </td>850 <td class="value">851 <select id="show_filmstrip_nav” name="show_filmstrip_nav” class="select">852 <option value="">Select</option>853 <option <?php if(intval($settings[‘show_filmstrip_nav’])==1):?> selected="selected" <?php endif;?> value="1" ><?php echo __(“Yes",’video-slider-with-thumbnails’);?></option>854 <option <?php if(intval($settings[‘show_filmstrip_nav’])==0):?> selected="selected” <?php endif;?> value="0"><?php echo __(“No",’video-slider-with-thumbnails’);?></option>855 </select> 856 <div style="clear:both"></div>857 <div></div> 858 </td>859 </tr>860 <tr>861 <td class="label"><label for="autoplay"><?php echo __(“Auto Play",’video-slider-with-thumbnails’);?> <span class="required">*</span></label></td>862 <td class="value">863 <select id="autoplay” name="autoplay” class="select">864 <option value="">Select</option>865 <option <?php if(intval($settings[‘autoplay’])==1):?> selected="selected" <?php endif;?> value="1" ><?php echo __(“Yes",’video-slider-with-thumbnails’);?></option>866 <option <?php if(intval($settings[‘autoplay’])==0):?> selected="selected” <?php endif;?> value="0"><?php echo __(“No",’video-slider-with-thumbnails’);?></option>867 </select> 868 <div style="clear:both;margin-top: 10px"><?php echo __(“Recommend to set ‘no’ if you have video in list",’video-slider-with-thumbnails’);?> </div>869 <div></div> 870 </td>871 </tr>872 873 <tr>874 <td class="label">875 <label for="frame_width"><?php echo __(“Thumbnail Width",’video-slider-with-thumbnails’);?> <span class="required">*</span></label>876 </td>877 <td class="value">878 <input id="frame_width” value="<?php echo intval($settings[‘frame_width’]); ?>” name="frame_width” value="80" class="input-text" type="text"> 879 <div style="clear:both"></div>880 <div></div>881 </td>882 </tr>883 <tr>884 <td class="label">885 <label for="frame_height"><?php echo __(“Thumbnail Height",’video-slider-with-thumbnails’);?> <span class="required">*</span></label>886 </td>887 <td class="value">888 <input id="frame_height” value="<?php echo intval($settings[‘frame_height’]); ?>" name="frame_height" class="input-text" type="text"> 889 <div style="clear:both"></div>890 <div></div>891 </td>892 </tr>893 <tr>894 <td class="label">895 <label for="frame_opacity"><?php echo __(“Thumbnail Opacity",’video-slider-with-thumbnails’);?> <span class="required">*</span></label>896 </td>897 <td class="value">898 <input id="frame_opacity” value="<?php echo floatval($settings[‘frame_opacity’]); ?>" name="frame_opacity" class="input-text" type="text"> 899 <div style="clear:both"></div>900 <div></div>901 </td>902 </tr>903 904 <tr>905 <td class="label">906 <label for="frame_gap"><?php echo __(“Thumbnail Gap",’video-slider-with-thumbnails’);?> <span class="required">*</span></label>907 </td>908 <td class="value">909 <input id="frame_gap” value="<?php echo intval($settings[‘frame_gap’]); ?>" name="frame_gap" class="input-text" type="text"> 910 <div style="clear:both"></div>911 <div></div>912 </td>913 </tr>914 <tr>915 <td class="label"><label for="show_infobar"><?php echo __(“Show Infobar",’video-slider-with-thumbnails’);?> <span class="required">*</span></label></td>916 <td class="value">917 <select id="show_infobar” name="show_infobar" class=" select">918 <option value="">Select</option>919 <option <?php if(intval($settings[‘show_infobar’])==1):?> selected="selected" <?php endif;?> value="1"><?php echo __(“Yes",’video-slider-with-thumbnails’);?></option>920 <option <?php if(intval($settings[‘show_infobar’])==0):?> selected="selected” <?php endif;?> value="0" ><?php echo __(“No",’video-slider-with-thumbnails’);?></option>921 </select> 922 <div style="clear:both"></div>923 <div></div>924 </td>925 </tr>926 <tr style="display: none;">927 <td class="label"><label for="show_captions"><?php echo __(“Show Thumbnail Image Caption",’video-slider-with-thumbnails’);?> <span class="required">*</span></label></td>928 <td class="value">929 <select id="show_captions” name="show_captions” class=" select">930 <option <?php if(intval($settings[‘show_captions’])==0):?> selected="selected" <?php endif;?> value="0" ><?php echo __(“No",’video-slider-with-thumbnails’);?></option>931 <option <?php if(intval($settings[‘show_captions’])==1):?> selected="selected” <?php endif;?> value="1"><?php echo __(“Yes",’video-slider-with-thumbnails’);?></option>932 </select> 933 <div style="clear:both"></div>934 <div></div>935 </td>936 </tr>937 <tr>938 <td class="label">939 <label for="infobar_opacity"><?php echo __(“Infobar Opacity",’video-slider-with-thumbnails’);?> <span class="required">*</span></label>940 </td>941 <td class="value">942 <input id="infobar_opacity” value="<?php echo floatval($settings[‘infobar_opacity’]); ?>” name="infobar_opacity" class="input-text" type="text"> 943 <div style="clear:both"></div>944 <div></div>945 </td>946 </tr> 947 <tr>948 <td class="label">949 950 <?php wp_nonce_field(‘action_image_add_edit’,’add_edit_image_nonce’); ?>951 <input type="submit" name="btnsave" id="btnsave" value="<?php echo __(“Save Changes",’video-slider-with-thumbnails’);?>” class="button-primary"> 952953 </td>954 <td></td>955 </tr>956 </tbody>957 </table> 958 </div>959960 </form>961 <script type="text/javascript">962963 964 jQuery(document).ready(function() {965966 jQuery(“#scrollersettiings”).validate({967 rules: {968 name: {969 required:true,970 maxlength:250971 }, 972 transition_speed: {973 required:true,974 number:true,975 maxlength:10976 },transition_interval: {977 required:true,978 number:true,979 maxlength:10980 },show_panel_nav: {981 required:true, 982 },enable_overlays: {983 required:true, 984 },985 panel_width:{986 required:true, 987 number:true,988 maxlength:10989990 },991 panel_height:{992 required:true,993 number:true,994 maxlength:10 995 },996 panel_animation:{997 required:true,998 },999 panel_scale:{1000 required:true1001 },1002 overlay_position:{1003 required:true1004 },1005 show_filmstrip:{1006 required:true10071008 },show_filmstrip_nav:{1009 required:true10101011 },autoplay:{1012 required:true10131014 },filmstrip_position:{1015 required:true10161017 },frame_width:{1018 required:true,1019 number:true,1020 maxlength:10 1021 },frame_height:{1022 required:true,1023 number:true,1024 maxlength:10 1025 }1026 ,frame_opacity:{1027 required:true,1028 number:true,1029 maxlength:10 1030 }1031 ,frame_gap:{1032 required:true,1033 number:true,1034 maxlength:10 10351036 },show_infobar:{1037 required:true10381039 },show_captions:{1040 required:true10411042 },infobar_opacity:{1043 required:true,1044 number:true,1045 maxlength:10 1046 }10471048 },1049 errorClass: “image_error",1050 errorPlacement: function(error, element) {1051 error.appendTo( element.next().next());1052 } 105310541055 })1056 });10571058 </script> 10591060 </div>1061 <div id="postbox-container-1” class="postbox-container" > 10621063 <div class="postbox"> 1064 <h3 class="hndle"><span></span><?php echo __(‘Access All Themes In One Price’,’video-slider-with-thumbnails’);?></h3> 1065 <div class="inside">1066 <center><a href="http://www.elegantthemes.com/affiliates/idevaffiliate.php?id=11715_0_1_10" target="_blank"><img border="0" src="<?php echo plugins_url( ‘images/300x250.gif’, __FILE__ );?>" width="250" height="250"></a></center>10671068 <div style="margin:10px 5px">10691070 </div>1071 </div></div>1072 <div class="postbox"> 1073 <h3 class="hndle"><span></span><?php echo __(‘Google For Business Coupon’,’video-slider-with-thumbnails’);?></h3> 1074 <div class="inside">1075 <center><a href="https://goo.gl/OJBuHT" target="_blank">1076 <img src="<?php echo plugins_url( ‘images/g-suite-promo-code-4.png’, __FILE__ );?>" width="250" height="250" border="0">1077 </a></center>1078 <div style="margin:10px 5px">1079 </div>1080 </div>10811082 </div>10831084 </div> 1085 <div class="clear"></div>1086 </div> 10871088 </div> 1089 </div> 1090 </div>1091109210931094 <div class="clear"></div></div> 1095 <?php1096 } 1097 10981099function vgwt_responsive_video_slider_with_thumbnail_media_management_func() {1100 1101 1102 $action = ‘gridview’;1103 global $wpdb;1104 1105 if (isset ( $_GET [‘action’] ) and $_GET [‘action’] != ‘’) {1106 1107 $action = sanitize_text_field ( sanitize_text_field($_GET [‘action’] ));1108 1109 if(isset($_GET[‘order_by’])){1110 1111 if(sanitize_sql_orderby($_GET[‘order_by’])){1112 1113 $order_by=esc_html(sanitize_text_field($_GET[‘order_by’])); 1114 }1115 else{1116 1117 $order_by=’ id ‘;1118 }1119 }11201121 if(isset($_GET[‘order_pos’])){11221123 $order_pos=esc_html(sanitize_text_field($_GET[‘order_pos’])); 1124 }11251126 $search_term_=’’;1127 if(isset($_GET[‘search_term’])){11281129 $search_term_=’&search_term=’.esc_html(sanitize_text_field($_GET[‘search_term’]));1130 }1131 }1132 1133 $search_term_=’’;1134 if(isset($_GET[‘search_term’])){11351136 $search_term_=’&search_term=’.esc_html(sanitize_text_field($_GET[‘search_term’]));1137 }1138 ?>11391140 <?php1141 if (strtolower ( $action ) == strtolower ( ‘gridview’ )) {1142 1143 1144 if ( ! current_user_can( ‘vgwt_video_slider_view_images’ ) ) {11451146 wp_die( __( “Access Denied", “video-slider-with-thumbnails” ) );11471148 } 11491150 $wpcurrentdir = dirname ( __FILE__ );1151 $wpcurrentdir = str_replace ( “\\", “/", $wpcurrentdir );1152 1153 $uploads = wp_upload_dir ();1154 $baseurl = $uploads [‘baseurl’];1155 $baseurl .= '/video-slider-with-thumbnails/’;1156 ?> 1157 <div class="wrap">1158 1159 <table><tr>1160 <td>1161 <div class="fb-like” data-href="https://www.facebook.com/i13websolution” data-layout="button” data-action="like" data-size="large" data-show-faces="false" data-share="false"></div>1162 <div id="fb-root"></div>1163 <script>(function(d, s, id) {1164 var js, fjs = d.getElementsByTagName(s)[0];1165 if (d.getElementById(id)) return;1166 js = d.createElement(s); js.id = id;1167 js.src = ‘https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.2&appId=158817690866061&autoLogAppEvents=1’;1168 fjs.parentNode.insertBefore(js, fjs);1169 }(document, ‘script’, ‘facebook-jssdk’));</script>1170 </td>1171 <td>1172 <a target="_blank" title="Donate" href="http://i13websolution.com/donate-wordpress_image_thumbnail.php">1173 <img id="help us for free plugin" height="30" width="90" src="<?php echo plugins_url( ‘images/paypaldonate.jpg’, __FILE__ );?>" border="0" alt="help us for free plugin" title="help us for free plugin">1174 </a>1175 </td>1176 </tr>1177 </table>1178 <div style="clear:both">1179 <span><h3 style="color: blue;"><a target="_blank" href="https://www.i13websolution.com/product/wordpress-video-slider-plugin-pro/"><?php echo __("UPGRADE TO PRO VERSION",’video-slider-with-thumbnails’);?></a></h3></span>1180 </div> 1181 <?php1182 $messages = get_option ( ‘wp_vgallery_thumbnail_msg’ );1183 $type = ‘’;1184 $message = ‘’;1185 if (isset ( $messages [‘type’] ) and $messages [‘type’] != “”) {1186 1187 $type = $messages [‘type’];1188 $message = $messages [‘message’];1189 }1190 1191 if(trim($type)==’err’){ echo "<div class=’notice notice-error is-dismissible’><p>"; echo $message; echo "</p></div>";}1192 else if(trim($type)==’succ’){ echo “<div class=’notice notice-success is-dismissible’><p>"; echo $message; echo “</p></div>";}1193 1194 1195 update_option ( 'wp_vgallery_thumbnail_msg’, array () );1196 ?>11971198 <div id="poststuff” >1199 <div id="post-body” class="metabox-holder columns-2">1200 <div style="" id="post-body-content" >1201 <div class="icon32 icon32-posts-post" id="icon-edit">1202 <br>1203 </div>1204 <h2>1205 <?php echo __(‘Media’,’video-slider-with-thumbnails’);?><a class="button add-new-h2" href="admin.php?page=responsive_video_slider_with_thumbnail_media_management&action=addedit"><?php echo __(‘Add New’,’video-slider-with-thumbnails’);?></a>1206 </h2>1207 <br />12081209 <form method="POST"1210 action="admin.php?page=responsive_video_slider_with_thumbnail_media_management&action=deleteselected"1211 id="posts-filter" onkeypress="return event.keyCode != 13;">1212 <div class="alignleft actions">1213 <select name="action_upper" id="action_upper">1214 <option selected="selected" value="-1"><?php echo __(‘Bulk Actions’,’video-slider-with-thumbnails’);?></option>1215 <option value="delete"><?php echo __(‘delete’,’video-slider-with-thumbnails’);?></option>1216 </select> <input type="submit" value="<?php echo __(‘Apply’,’video-slider-with-thumbnails’);?>"1217 class="button-secondary action" id="deleteselected"1218 name="deleteselected" onclick="return confirmDelete_bulk();">1219 </div>1220 <?php1221 12221223 $setacrionpage=’admin.php?page=responsive_video_slider_with_thumbnail_media_management’;12241225 if(isset($_GET[‘order_by’]) and $_GET[‘order_by’]!=""){1226 $setacrionpage.=’&order_by=’.esc_html(sanitize_text_field($_GET[‘order_by’])); 1227 }12281229 if(isset($_GET[‘order_pos’]) and $_GET[‘order_pos’]!=""){1230 $setacrionpage.=’&order_pos=’.esc_html(sanitize_text_field($_GET[‘order_pos’])); 1231 }12321233 $seval="";1234 if(isset($_GET[‘search_term’]) and $_GET[‘search_term’]!=""){1235 $seval=esc_html(sanitize_text_field($_GET[‘search_term’])); 1236 }12371238 ?>1239 <br class="clear">1240 <?php1241 global $wpdb;1242 $settings=get_option(‘vgwt_video_slider_settings’); 1243 1244 if (! is_array ( $settings )) {1245 1246 $wp_vgallery_thumbnail_msg = array ();1247 $wp_vgallery_thumbnail_msg [‘type’] = ‘err’;1248 $wp_vgallery_thumbnail_msg [‘message’] = __(‘No such video slider found.’,’video-slider-with-thumbnails’);1249 update_option ( ‘wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg );1250 $location = ‘admin.php?page=responsive_video_slider_with_thumbnail’;1251 echo "<script type=’text/javascript’> location.href=’$location’;</script>";1252 exit ();1253 }1254 1255 1256 $order_by=’id’;1257 $order_pos="asc";12581259 if(isset($_GET[‘order_by’]) and sanitize_sql_orderby($_GET[‘order_by’])!==false){12601261 $order_by=esc_html(sanitize_text_field($_GET[‘order_by’])); 1262 }12631264 if(isset($_GET[‘order_pos’])){12651266 $order_pos=esc_html(sanitize_text_field($_GET[‘order_pos’])); 1267 }1268 $search_term=’’;1269 if(isset($_GET[‘search_term’])){12701271 $search_term= esc_html(sanitize_text_field(esc_sql($_GET[‘search_term’])));1272 }12731274 $query = "SELECT * FROM " . $wpdb->prefix . "e_gallery ";1275 $queryCount = "SELECT count(*) FROM " . $wpdb->prefix . "e_gallery ";1276 if($search_term!=’’){1277 $query.=" where id like ‘%$search_term%’ or title like ‘%$search_term%’ “; 1278 $queryCount.=” where id like ‘%$search_term%’ or title like ‘%$search_term%’ “; 1279 }12801281 $order_by=sanitize_text_field(sanitize_sql_orderby($order_by));1282 $order_pos=sanitize_text_field(sanitize_sql_orderby($order_pos));12831284 $query.=” order by $order_by $order_pos";12851286 $rowsCount=$wpdb->get_var($queryCount);12871288 1289 ?>1290 1291 <div style="padding-top:5px;padding-bottom:5px">1292 <b><?php echo __( ‘Search’,’video-slider-with-thumbnails’);?> : </b>1293 <input type="text" value="<?php echo $seval;?>" id="search_term" name="search_term"> 1294 <input type=’button’ value=’<?php echo __( ‘Search’,’video-slider-with-thumbnails’);?>’ name=’searchusrsubmit’ class=’button-primary’ id=’searchusrsubmit’ onclick="SearchredirectTO();" > 1295 <input type=’button’ value=’<?php echo __( ‘Reset Search’,’video-slider-with-thumbnails’);?>’ name=’searchreset’ class=’button-primary’ id=’searchreset’ onclick="ResetSearch();" >1296 </div> 1297 <script type="text/javascript" >1298 1299 jQuery(‘#search_term’).on(“keyup", function(e) {1300 if (e.which == 13) {1301 1302 SearchredirectTO();1303 }1304 }); 1305 function SearchredirectTO(){1306 var redirectto=’<?php echo $setacrionpage; ?>’;1307 var searchval=jQuery(‘#search_term’).val();1308 redirectto=redirectto+’&search_term=’+jQuery.trim(encodeURIComponent(searchval)); 1309 window.location.href=redirectto;1310 }1311 function ResetSearch(){13121313 var redirectto=’<?php echo $setacrionpage; ?>’;1314 window.location.href=redirectto;1315 exit;1316 }1317 </script> 1318 <div id="no-more-tables">1319 <table cellspacing="0” id="gridTbl" class="table-bordered table-striped table-condensed cf wp-list-table widefat">1320 <thead>1321 <tr>1322 <th class="manage-column column-cb check-column" scope="col"><input type="checkbox"></th>1323 <?php if($order_by=="id" and $order_pos=="asc"):?>1324 1325 <th><a href="<?php echo $setacrionpage;?>&order_by=id&order_pos=desc<?php echo $search_term_;?>"><?php echo __(‘Id’,’video-slider-with-thumbnails’);?><img style="vertical-align:middle" src="<?php echo plugins_url(‘/images/desc.png’, __FILE__); ?>"/></a></th>1326 <?php else:?>1327 <?php if($order_by=="id"):?>1328 <th><a href="<?php echo $setacrionpage;?>&order_by=id&order_pos=asc<?php echo $search_term_;?>"><?php echo __(‘Id’,’video-slider-with-thumbnails’);?><img style="vertical-align:middle" src="<?php echo plugins_url(‘/images/asc.png’, __FILE__); ?>"/></a></th>1329 <?php else:?>1330 <th><a href="<?php echo $setacrionpage;?>&order_by=id&order_pos=asc<?php echo $search_term_;?>"><?php echo __(‘Id’,’video-slider-with-thumbnails’);?></a></th>1331 <?php endif;?> 1332 <?php endif;?> 1333 <?php if($order_by=="media_type" and $order_pos=="asc"):?>1334 1335 <th><a href="<?php echo $setacrionpage;?>&order_by=media_type&order_pos=desc<?php echo $search_term_;?>"><?php echo __(‘Media Type’,’video-slider-with-thumbnails’);?><img style="vertical-align:middle" src="<?php echo plugins_url(‘/images/desc.png’, __FILE__); ?>"/></a></th>1336 <?php else:?>1337 <?php if($order_by=="media_type"):?>1338 <th><a href="<?php echo $setacrionpage;?>&order_by=media_type&order_pos=asc<?php echo $search_term_;?>"><?php echo __(‘Media Type’,’video-slider-with-thumbnails’);?><img style="vertical-align:middle" src="<?php echo plugins_url(‘/images/asc.png’, __FILE__); ?>"/></a></th>1339 <?php else:?>1340 <th><a href="<?php echo $setacrionpage;?>&order_by=media_type&order_pos=asc<?php echo $search_term_;?>"><?php echo __(‘Media Type’,’video-slider-with-thumbnails’);?></a></th>1341 <?php endif;?> 1342 <?php endif;?> 1343 1344 1345 <?php if($order_by=="title" and $order_pos=="asc"):?>13461347 <th><a href="<?php echo $setacrionpage;?>&order_by=title&order_pos=desc<?php echo $search_term_;?>"><?php echo __(‘Title’,’video-slider-with-thumbnails’);?><img style="vertical-align:middle" src="<?php echo plugins_url(‘/images/desc.png’, __FILE__); ?>"/></a></th>1348 <?php else:?>1349 <?php if($order_by=="title"):?>1350 <th><a href="<?php echo $setacrionpage;?>&order_by=title&order_pos=asc<?php echo $search_term_;?>"><?php echo __(‘Title’,’video-slider-with-thumbnails’);?><img style="vertical-align:middle" src="<?php echo plugins_url(‘/images/asc.png’, __FILE__); ?>"/></a></th>1351 <?php else:?>1352 <th><a href="<?php echo $setacrionpage;?>&order_by=title&order_pos=asc<?php echo $search_term_;?>"><?php echo __(‘Title’,’video-slider-with-thumbnails’);?></a></th>1353 <?php endif;?> 1354 <?php endif;?> 1355 <th><span></span></th>1356 <?php if($order_by=="morder" and $order_pos=="asc"):?>1357 1358 <th><a href="<?php echo $setacrionpage;?>&order_by=morder&order_pos=desc<?php echo $search_term_;?>"><?php echo __(‘Display Order’,’video-slider-with-thumbnails’);?><img style="vertical-align:middle" src="<?php echo plugins_url(‘/images/desc.png’, __FILE__); ?>"/></a></th>1359 <?php else:?>1360 <?php if($order_by=="morder"):?>1361 <th><a href="<?php echo $setacrionpage;?>&order_by=morder&order_pos=asc<?php echo $search_term_;?>"><?php echo __(‘Display Order’,’video-slider-with-thumbnails’);?><img style="vertical-align:middle" src="<?php echo plugins_url(‘/images/asc.png’, __FILE__); ?>"/></a></th>1362 <?php else:?>1363 <th><a href="<?php echo $setacrionpage;?>&order_by=morder&order_pos=asc<?php echo $search_term_;?>"><?php echo __(‘Display Order’,’video-slider-with-thumbnails’);?></a></th>1364 <?php endif;?> 1365 <?php endif;?> 1366 1367 1368 <?php if($order_by=="createdon" and $order_pos=="asc"):?>1369 1370 <th><a href="<?php echo $setacrionpage;?>&order_by=createdon&order_pos=desc<?php echo $search_term_;?>"><?php echo __(‘Published On’,’video-slider-with-thumbnails’);?><img style="vertical-align:middle" src="<?php echo plugins_url(‘/images/desc.png’, __FILE__); ?>"/></a></th>1371 <?php else:?>1372 <?php if($order_by=="createdon"):?>1373 <th><a href="<?php echo $setacrionpage;?>&order_by=createdon&order_pos=asc<?php echo $search_term_;?>"><?php echo __(‘Published On’,’video-slider-with-thumbnails’);?><img style="vertical-align:middle" src="<?php echo plugins_url(‘/images/asc.png’, __FILE__); ?>"/></a></th>1374 <?php else:?>1375 <th><a href="<?php echo $setacrionpage;?>&order_by=createdon&order_pos=asc<?php echo $search_term_;?>"><?php echo __(‘Published On’,’video-slider-with-thumbnails’);?></a></th>1376 <?php endif;?> 1377 <?php endif;?> 1378 1379 1380 <th><span><?php echo __(‘Edit’,’video-slider-with-thumbnails’);?></span></th>1381 <th><span><?php echo __(‘Delete’,’video-slider-with-thumbnails’);?></span></th>1382 </tr>1383 </thead>13841385 <tbody id="the-list">1386 <?php1387 if ($rowsCount > 0) {1388 1389 global $wp_rewrite;1390 $rows_per_page = 10;1391 1392 $current = (isset($_GET [‘paged’])) ? intval(sanitize_text_field($_GET [‘paged’])) : 1;1393 $pagination_args = array (1394 ‘base’ => @add_query_arg ( ‘paged’, ‘%#%’ ),1395 ‘format’ => ‘’,1396 ‘total’ => ceil ( $rowsCount / $rows_per_page ),1397 ‘current’ => $current,1398 ‘show_all’ => false,1399 ‘type’ => ‘plain’ 1400 );1401 1402 $offset = ($current - 1) * $rows_per_page;1403 1404 $query.=" limit $offset, $rows_per_page";1405 $rows = $wpdb->get_results ( $query,’ARRAY_A’);1406 $delRecNonce = wp_create_nonce(‘delete_image’);1407 foreach($rows as $row) {1408 1409 1410 $id = $row [‘id’];1411 $editlink = “admin.php?page=responsive_video_slider_with_thumbnail_media_management&action=addedit&id=$id";1412 $deletelink = “admin.php?page=responsive_video_slider_with_thumbnail_media_management&action=delete&id=$id&nonce=$delRecNonce";1413 1414 $outputimgmain = $baseurl . $row [‘image_name’].’?rand=’. rand(0, 5000);1415 ?>1416 <tr valign="top">1417 <td class="alignCenter check-column” data-title="Select Record"><input1418 type="checkbox” value="<?php echo $row[‘id’] ?>"1419 name="thumbnails[]“></td>1420 <td data-title="<?php echo __(‘Id’,’video-slider-with-thumbnails’);?>” class="alignCenter"><?php echo intval($row[‘id’]); ?></td>1421 <td data-title="Video Type" class="alignCenter"><div>1422 <strong><?php echo $row[‘media_type’]; ?> <?php if($row[‘media_type’]==’video’):?> - <?php echo esc_html($row[‘vtype’]);?><?php endif;?> </strong>1423 </div></td>1424 <td data-title="<?php echo __(‘Title’,’video-slider-with-thumbnails’);?>" class="alignCenter">1425 <div>1426 <strong><?php echo esc_html($row[‘title’]); ?></strong>1427 </div></td>1428 <td class="alignCenter"><img src="<?php echo esc_url($outputimgmain); ?>" style="width: 100px" height="100px" /></td>1429 <td data-title="<?php echo __(‘Display Order’,’video-slider-with-thumbnails’);?>" class="alignCenter"><?php echo intval($row[‘morder’]); ?></td>1430 <td data-title="<?php echo __(‘Published On’,’video-slider-with-thumbnails’);?>" class="alignCenter"><?php echo esc_html($row[‘createdon’]); ?></td>1431 <td data-title="<?php echo __(‘Edit’,’video-slider-with-thumbnails’);?>" class="alignCenter"><strong><a href=’<?php echo esc_url($editlink); ?>’ title="<?php echo __(‘Edit’,’video-slider-with-thumbnails’);?>"><?php echo __(‘Edit’,’video-slider-with-thumbnails’);?></a></strong></td>1432 <td data-title="<?php echo __(‘Delete’,’video-slider-with-thumbnails’);?>" class="alignCenter"><strong><a href=’<?php echo esc_url($deletelink); ?>’ onclick="return confirmDelete();" title="<?php echo __(‘Delete’,’video-slider-with-thumbnails’);?>"><?php echo __(‘Delete’,’video-slider-with-thumbnails’);?></a> </strong></td>1433 </tr>1434 <?php1435 }1436 } else {1437 ?>1438 <tr valign="top" class=""1439 id="">1440 <td colspan="9" data-title="<?php echo __(‘No Record’,’video-slider-with-thumbnails’);?>" align="center"><strong><?php echo __(‘No video slides found’,’video-slider-with-thumbnails’);?></strong></td>1441 </tr>1442 <?php1443 }1444 ?> 1445 </tbody>1446 </table>1447 </div>1448 <?php1449 if ($rowsCount > 0) {1450 echo "<div class=’pagination’ style=’padding-top:10px’>";1451 echo paginate_links ( $pagination_args );1452 echo “</div>";1453 }1454 ?>1455 <br />1456 <div class="alignleft actions">1457 <select name="action” id="action_bottom">1458 <option selected="selected" value="-1"><?php echo __(‘Bulk Actions’,’video-slider-with-thumbnails’);?></option>1459 <option value="delete"><?php echo __(‘Delete’,’video-slider-with-thumbnails’);?></option>1460 </select> 1461 <?php wp_nonce_field(‘action_settings_mass_delete’, ‘mass_delete_nonce’); ?>1462 <input type="submit" value="<?php echo __(‘Apply’,’video-slider-with-thumbnails’);?>"1463 class="button-secondary action" id="deleteselected"1464 name="deleteselected" onclick="return confirmDelete_bulk();">1465 </div>14661467 </form>1468 <script type="text/JavaScript">14691470 function confirmDelete_bulk(){1471 var topval=document.getElementById(“action_bottom”).value;1472 var bottomVal=document.getElementById(“action_upper”).value;14731474 if(topval==’delete’ || bottomVal==’delete’){147514761477 var agree=confirm(“<?php echo __(‘Are you sure you want to delete selected media ?’,’video-slider-with-thumbnails’);?>”);1478 if (agree)1479 return true ;1480 else1481 return false;1482 }1483 }1484 1485 function confirmDelete(){1486 var agree=confirm(“<?php echo __(‘Are you sure you want to delete this media ?’,’video-slider-with-thumbnails’);?>”);1487 if (agree)1488 return true ;1489 else1490 return false;1491 }1492 </script>1493 </div>1494 <div id="postbox-container-1" class="postbox-container" > 14951496 <div class="postbox"> 1497 <h3 class="hndle"><span></span><?php echo __(‘Access All Themes In One Price’,’video-slider-with-thumbnails’);?></h3> 1498 <div class="inside">1499 <center><a href="http://www.elegantthemes.com/affiliates/idevaffiliate.php?id=11715_0_1_10" target="_blank"><img border="0" src="<?php echo plugins_url( ‘images/300x250.gif’, __FILE__ );?>" width="250" height="250"></a></center>15001501 <div style="margin:10px 5px">15021503 </div>1504 </div></div>1505 <div class="postbox"> 1506 <h3 class="hndle"><span></span><?php echo __(‘Google For Business Coupon’,’video-slider-with-thumbnails’);?></h3> 1507 <div class="inside">1508 <center><a href="https://goo.gl/OJBuHT" target="_blank">1509 <img src="<?php echo plugins_url( ‘images/g-suite-promo-code-4.png’, __FILE__ );?>" width="250" height="250" border="0">1510 </a></center>1511 <div style="margin:10px 5px">1512 </div>1513 </div>15141515 </div>15161517 </div> 1518 <br class="clear">1519 </div>1520 <div style="clear: both;"></div>1521 <?php $url = plugin_dir_url(__FILE__); ?>152215231524 </div>1525 <h3><?php echo __(‘To print this video slider into WordPress Post/Page use below code’,’video-slider-with-thumbnails’);?></h3>1526 <input type="text"1527 value=’[vgwt_print_responsive_video_slider_with_thumbnail] ‘1528 style="width: 400px; height: 30px"1529 onclick="this.focus(); this.select()" />1530 <div class="clear"></div>1531 <h3><?php echo __(‘To print this video slider into WordPress theme/template PHP files use below code’,’video-slider-with-thumbnails’);?></h3>1532 <?php1533 $shortcode = '[vgwt_print_responsive_video_slider_with_thumbnail]‘;1534 ?>1535 <input type="text"1536 value="<?php echo do_shortcode(‘<?php echo htmlentities($shortcode, ENT_QUOTES); ?>’); ?>"1537 style="width: 400px; height: 30px"1538 onclick="this.focus(); this.select()" />1539 </div> 1540 <div class="clear"></div>1541 <?php1542 } else if (strtolower ( $action ) == strtolower ( ‘addedit’ )) {1543 $url = plugin_dir_url ( __FILE__ );1544 $vNonce = wp_create_nonce(‘vNonce’);1545 ?><?php1546 if (isset ( $_POST [‘btnsave’] )) {1547 1548 if (!check_admin_referer(‘action_image_add_edit’, ‘add_edit_image_nonce’)) {15491550 wp_die(‘Security check fail’);1551 }1552 $uploads = wp_upload_dir ();1553 $baseDir = $uploads [‘basedir’];1554 $baseDir = str_replace ( "\\", "/", $baseDir );1555 $pathToImagesFolder = $baseDir . ‘/video-slider-with-thumbnails’;1556 1557 if(isset($_POST[‘media_type’]) and $_POST[‘media_type’]==’video’){1558 1559 $media_type=trim(sanitize_text_field($_POST[‘media_type’])); 1560 $vtype = trim (sanitize_text_field( $_POST [‘vtype’] )) ;1561 $videourl = trim (sanitize_text_field($_POST [‘videourl’] ));1562 1563 $vid = uniqid ( ‘vid_’ );1564 $embed_url=’’;1565 if ($vtype == ‘youtube’) {1566 // parse1567 1568 $parseUrl = @parse_url ( $videourl );1569 if (is_array ( $parseUrl )) {1570 1571 $queryStr = $parseUrl [‘query’];1572 parse_str ( $queryStr, $array );1573 if (is_array ( $array ) and isset ( $array [‘v’] )) {1574 1575 $vid = $array [‘v’];1576 }1577 }1578 1579 $embed_url="//www.youtube.com/embed/$vid"; 1580 }1581 1582 else if ($vtype == ‘metacafe’) {15831584 $videourl=rtrim($videourl, ‘/’);1585 $explode=explode(‘/’, $videourl);1586 $end = end($explode);1587 1588 $vid = 0;1589 if ($end) {15901591 $vid = $end;1592 }159315941595 $embed_url = $videourl;1596 $embed_url= str_replace("/watch/", "/embed/", $embed_url);1597 1598 }1599 else if($vtype==’dailymotion’){1600 1601 1602 $url_arr = parse_url($videourl);1603 if(isset($url_arr[‘query’])){1604 1605 $query = $url_arr[‘query’];1606 $videourl = str_replace(array($query,’?’), ‘’, $videourl);1607 }1608 $pos = strpos($videourl, ‘/video/’);1609 $vid=0;1610 if ($pos !== false){1611 1612 $vid=substr($videourl, $pos+strlen(‘/video/’));1613 1614 }1615 1616 1617 $embed_url="//www.dailymotion.com/embed/video/$vid";1618 1619 1620 1621 }1622 1623 1624 1625 $HdnMediaSelection = trim(sanitize_text_field($_POST [‘HdnMediaSelection’]));1626 $videotitle = trim ( sanitize_text_field($_POST [‘title’] )) ;1627 $video_order = intval(trim ( sanitize_text_field($_POST [‘morder’] )));1628 1629 if ($video_order == “” or $video_order == null)1630 $video_order = 0;1631 1632 1633 1634 $videotitle = str_replace(“’","’",$videotitle);1635 $videotitle = str_replace('"’, ‘"’, $videotitle);1636 1637 $videourl=trim ( sanitize_text_field($_POST [‘videourl’] )) ;1638 1639 1640 $location = "admin.php?page=responsive_video_slider_with_thumbnail_media_management";1641 // edit save1642 1643 if (isset ( $_POST [‘videoid’] )) {1644 1645 1646 if ( ! current_user_can( ‘vgwt_video_slider_edit_media’ ) ) {16471648 $location=’admin.php?page=responsive_video_slider_with_thumbnail_media_management’;1649 $wp_vgallery_thumbnail_msg = array ();1650 $wp_vgallery_thumbnail_msg [‘type’] = ‘err’;1651 $wp_vgallery_thumbnail_msg [‘message’] = __(‘Access Denied. Please contact your administrator.’,’video-slider-with-thumbnails’);1652 update_option ( ‘wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg );1653 echo "<script type=’text/javascript’> location.href=’$location’;</script>"; 1654 exit; 16551656 }16571658 try {1659 1660 $videoidEdit=intval(sanitize_text_field($_POST [‘videoid’]));1661 if (trim ( $_POST [‘HdnMediaSelection’] ) != ‘’) {1662 1663 $query = "SELECT * FROM " . $wpdb->prefix . "e_gallery WHERE id=$videoidEdit";1664 $myrow = $wpdb->get_row($query);1665 1666 $settings=get_option(‘vgwt_video_slider_settings’);1667 $imageheight = intval($settings [‘panel_height’]);1668 $imagewidth = intval($settings [‘panel_width’]);1669 1670 if (is_object($myrow)) {16711672 $image_name = $myrow->image_name;1673 $imagetoDel = $pathToImagesFolder . ‘/’ . $image_name;1674 $pInfo = pathinfo($myrow->HdnMediaSelection);1675 $pInfo2 = pathinfo($imagetoDel);1676 $ext = $pInfo2 [‘extension’];16771678 @unlink($imagetoDel);1679 @unlink($pathToImagesFolder . ‘/’ . $pInfo2[‘filename’]. ‘_’ . $imageheight . ‘_’ . $imagewidth . ‘.’ . $ext);1680 }1681 $pInfo = pathinfo ( $HdnMediaSelection );1682 $ext = @$pInfo [‘extension’];1683 if($ext==’’){1684 if (exif_imagetype($HdnMediaSelection) == IMAGETYPE_PNG) {16851686 $ext=’png’; 1687 } 1688 else if (exif_imagetype($HdnMediaSelection) == IMAGETYPE_JPEG) {16891690 $ext=’jpeg’; 1691 } 1692 else if (exif_imagetype($HdnMediaSelection) == IMAGETYPE_GIF) {16931694 $ext=’gif’; 1695 } 16961697 }1698 $imagename = uniqid(“vid_”) .".". $ext;1699 $imageUploadTo = $pathToImagesFolder . ‘/’ . $imagename;1700 1701 @copy ( $HdnMediaSelection, $imageUploadTo );1702 if(!file_exists($imageUploadTo)){1703 vgwt_save_image_remote($HdnMediaSelection,$imageUploadTo);1704 }1705 1706 1707 }1708 1709 $query = "update " . $wpdb->prefix . “e_gallery1710 set media_type=’$media_type’, vtype=’$vtype’,vid=’$vid’,embed_url=’$embed_url’,image_name=’$imagename’,HdnMediaSelection=’$HdnMediaSelection’,1711 title=’$videotitle’,videourl=’$videourl’, morder=$video_order where id=$videoidEdit";1712 1713 //echo $query;die;1714 $wpdb->query ( $query );1715 1716 $wp_vgallery_thumbnail_msg = array ();1717 $wp_vgallery_thumbnail_msg [‘type’] = 'succ’;1718 $wp_vgallery_thumbnail_msg [‘message’] = __(‘Video updated successfully.’,’video-slider-with-thumbnails’);1719 update_option ( 'wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg );1720 } 1721 catch ( Exception $e ) {1722 1723 $wp_vgallery_thumbnail_msg = array ();1724 $wp_vgallery_thumbnail_msg [‘type’] = 'err’;1725 $wp_vgallery_thumbnail_msg [‘message’] = __(‘Error while adding video’,’video-slider-with-thumbnails’);1726 update_option ( 'wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg );1727 1728 1729 }17301731 1732 1733 1734 1735 } else {1736 1737 if ( ! current_user_can( ‘vgwt_video_slider_add_media’ ) ) {17381739 $location=’admin.php?page=responsive_video_slider_with_thumbnail_media_management’;1740 $wp_vgallery_thumbnail_msg = array ();1741 $wp_vgallery_thumbnail_msg [‘type’] = 'err’;1742 $wp_vgallery_thumbnail_msg [‘message’] = __(‘Access Denied. Please contact your administrator.’,’video-slider-with-thumbnails’);1743 update_option ( 'wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg );1744 echo “<script type=’text/javascript’> location.href=’$location’;</script>"; 1745 exit; 17461747 }1748 1749 $createdOn = date ( ‘Y-m-d h:i:s’ );1750 if (function_exists ( ‘date_i18n’ )) {17511752 $createdOn = date_i18n ( ‘Y-m-d’ . ' ' . get_option ( ‘time_format’ ), false, false );1753 if (get_option ( ‘time_format’ ) == ‘H:i’)1754 $createdOn = date ( ‘Y-m-d H:i:s’, strtotime ( $createdOn ) );1755 else1756 $createdOn = date ( ‘Y-m-d h:i:s’, strtotime ( $createdOn ) );1757 }1758 1759 try {1760 1761 if (trim ( $_POST [‘HdnMediaSelection’] ) != ‘’) {1762 $pInfo = pathinfo ( $HdnMediaSelection );1763 $ext = @$pInfo [‘extension’];1764 if($ext==’’){1765 if (exif_imagetype($HdnMediaSelection) == IMAGETYPE_PNG) {1766 1767 $ext=’png’; 1768 } 1769 else if (exif_imagetype($HdnMediaSelection) == IMAGETYPE_JPEG) {1770 1771 $ext=’jpeg’; 1772 } 1773 else if (exif_imagetype($HdnMediaSelection) == IMAGETYPE_GIF) {1774 1775 $ext=’gif’; 1776 } 1777 1778 }1779 $imagename = uniqid(“vid_”) . ".".$ext;1780 $imageUploadTo = $pathToImagesFolder . ‘/’ . $imagename;1781 @copy ( $HdnMediaSelection, $imageUploadTo );1782 if(!file_exists($imageUploadTo)){1783 vgwt_save_image_remote($HdnMediaSelection,$imageUploadTo);1784 }1785 }1786 1787 $query = “INSERT INTO " . $wpdb->prefix . “e_gallery 1788 (media_type,image_name,title,morder,1789 vtype,vid,videourl,embed_url,HdnMediaSelection,createdon) 1790 VALUES ('$media_type’,’$imagename’,’$videotitle’,’$video_order’,1791 '$vtype’,’$vid’,’$videourl’,’$embed_url’,’$HdnMediaSelection’, ‘$createdOn’)“;17921793 1794 $wpdb->query ( $query );1795 1796 1797 17981799 $wp_vgallery_thumbnail_msg = array ();1800 $wp_vgallery_thumbnail_msg [‘type’] = 'succ’;1801 $wp_vgallery_thumbnail_msg [‘message’] = __(‘New video added successfully.’,’video-slider-with-thumbnails’);1802 update_option ( 'wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg );1803 } catch ( Exception $e ) {1804 1805 $wp_vgallery_thumbnail_msg = array ();1806 $wp_vgallery_thumbnail_msg [‘type’] = 'err’;1807 $wp_vgallery_thumbnail_msg [‘message’] = __(‘Error while adding video’,’video-slider-with-thumbnails’);1808 update_option ( ‘wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg );1809 }1810 1811 1812 }1813 1814 }1815 else if(isset($_POST[‘media_type’]) and $_POST[‘media_type’]==’image’){1816 1817 $vid = uniqid ( ‘vid_’ );1818 $media_type=trim(sanitize_text_field($_POST[‘media_type’])); 1819 $HdnMediaSelection = trim ( sanitize_text_field($_POST [‘HdnMediaSelection_image’] ));1820 $mtitle = trim ( sanitize_text_field($_POST [‘title’] )) ;1821 $morder = intval(trim ( sanitize_text_field($_POST [‘morder’] )));1822 1823 1824 if ($morder == “” or $morder == null)1825 $morder = 0;1826 1827 1828 $mtitle = str_replace(“’","’",$mtitle);1829 $mtitle = str_replace('"’, '"’, $mtitle);1830 1831 1832 1833 $location = “admin.php?page=responsive_video_slider_with_thumbnail_media_management";1834 // edit save1835 if (isset ( $_POST [‘imageid’] )) {1836 1837 1838 if ( ! current_user_can( ‘vgwt_video_slider_edit_media’ ) ) {18391840 $location=’admin.php?page=responsive_video_slider_with_thumbnail_media_management’;1841 $wp_vgallery_thumbnail_msg = array ();1842 $wp_vgallery_thumbnail_msg [‘type’] = 'err’;1843 $wp_vgallery_thumbnail_msg [‘message’] = __(‘Access Denied. Please contact your administrator.’,’video-slider-with-thumbnails’);1844 update_option ( 'wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg );1845 echo “<script type=’text/javascript’> location.href=’$location’;</script>"; 1846 exit; 18471848 }1849 1850 try {1851 1852 $videoidEdit=intval(sanitize_text_field($_POST [‘imageid’]));1853 if (trim ( $_POST [‘HdnMediaSelection_image’] ) != ‘’) {1854 1855 $query = “SELECT * FROM " . $wpdb->prefix . “e_gallery WHERE id=$videoidEdit";1856 $myrow = $wpdb->get_row($query);1857 1858 $settings=get_option(‘vgwt_video_slider_settings’); 1859 $imageheight = intval($settings [‘panel_height’]);1860 $imagewidth = intval($settings [‘panel_width’]);1861 1862 if (is_object($myrow)) {18631864 $image_name = $myrow->image_name;1865 $imagetoDel = $pathToImagesFolder . ‘/’ . $image_name;1866 $pInfo = pathinfo($myrow->HdnMediaSelection);1867 $pInfo2 = pathinfo($imagetoDel);1868 $ext = $pInfo2 [‘extension’];18691870 @unlink($imagetoDel);1871 @unlink($pathToImagesFolder . ‘/’ . $pInfo2[‘filename’]. ‘_’ . $imageheight . ‘_’ . $imagewidth . ‘.’ . $ext);1872 }1873 1874 1875 $pInfo = pathinfo ( $HdnMediaSelection );1876 $ext = $pInfo [‘extension’];1877 $imagename = uniqid(“vid_”).".". $ext;1878 $imageUploadTo = $pathToImagesFolder . ‘/’ . $imagename;1879 1880 @copy ( $HdnMediaSelection, $imageUploadTo );1881 if(!file_exists($imageUploadTo)){1882 vgwt_save_image_remote($HdnMediaSelection,$imageUploadTo);1883 }1884 1885 1886 }1887 1888 $query = “update " . $wpdb->prefix . “e_gallery1889 set media_type=’$media_type’,image_name=’$imagename’,HdnMediaSelection=’$HdnMediaSelection’,1890 title=’$mtitle’, morder=$morder where id=$videoidEdit";1891 1892 //echo $query;die;1893 $wpdb->query ( $query );1894 1895 $wp_vgallery_thumbnail_msg = array ();1896 $wp_vgallery_thumbnail_msg [‘type’] = 'succ’;1897 $wp_vgallery_thumbnail_msg [‘message’] = __(‘Image updated successfully.’,’video-slider-with-thumbnails’);1898 update_option ( 'wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg );1899 } catch ( Exception $e ) {1900 1901 $wp_vgallery_thumbnail_msg = array ();1902 $wp_vgallery_thumbnail_msg [‘type’] = 'err’;1903 $wp_vgallery_thumbnail_msg [‘message’] = __(‘Error while adding image’,’video-slider-with-thumbnails’);1904 update_option ( 'wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg );1905 1906 1907 }19081909 1910 1911 } else {1912 1913 if ( ! current_user_can( ‘vgwt_video_slider_add_media’ ) ) {19141915 $location=’admin.php?page=responsive_video_slider_with_thumbnail_media_management’;1916 $wp_vgallery_thumbnail_msg = array ();1917 $wp_vgallery_thumbnail_msg [‘type’] = 'err’;1918 $wp_vgallery_thumbnail_msg [‘message’] = __(‘Access Denied. Please contact your administrator.’,’video-slider-with-thumbnails’);1919 update_option ( 'wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg );1920 echo “<script type=’text/javascript’> location.href=’$location’;</script>"; 1921 exit; 19221923 }1924 1925 $createdOn = date ( ‘Y-m-d h:i:s’ );1926 if (function_exists ( ‘date_i18n’ )) {19271928 $createdOn = date_i18n ( ‘Y-m-d’ . ' ' . get_option ( ‘time_format’ ), false, false );1929 if (get_option ( ‘time_format’ ) == ‘H:i’)1930 $createdOn = date ( 'Y-m-d H:i:s’, strtotime ( $createdOn ) );1931 else1932 $createdOn = date ( 'Y-m-d h:i:s’, strtotime ( $createdOn ) );1933 }1934 1935 try {1936 1937 if (trim ( $_POST [‘HdnMediaSelection_image’] ) != ‘’) {1938 $pInfo = pathinfo ( $HdnMediaSelection );1939 $ext = $pInfo [‘extension’];1940 $imagename = uniqid(“vid_”).".". $ext;1941 $imageUploadTo = $pathToImagesFolder . ‘/’ . $imagename;1942 1943 @copy ( $HdnMediaSelection, $imageUploadTo );1944 if(!file_exists($imageUploadTo)){1945 vgwt_save_image_remote($HdnMediaSelection,$imageUploadTo);1946 }1947 }1948 1949 $query = “INSERT INTO " . $wpdb->prefix . “e_gallery 1950 (media_type,image_name,title,morder,1951 HdnMediaSelection,createdon) 1952 VALUES ('$media_type’,’$imagename’,’$mtitle’,’$morder’,’$HdnMediaSelection’, ‘$createdOn’)“;19531954 1955 $wpdb->query ( $query );1956 1957 $wp_vgallery_thumbnail_msg = array ();1958 $wp_vgallery_thumbnail_msg [‘type’] = 'succ’;1959 $wp_vgallery_thumbnail_msg [‘message’] = __(‘New image added successfully.’,’video-slider-with-thumbnails’);1960 update_option ( 'wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg );1961 } catch ( Exception $e ) {1962 1963 $wp_vgallery_thumbnail_msg = array ();1964 $wp_vgallery_thumbnail_msg [‘type’] = 'err’;1965 $wp_vgallery_thumbnail_msg [‘message’] = __(‘Error while adding image’,’video-slider-with-thumbnails’);1966 update_option ( 'wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg );1967 }1968 1969 1970 }1971 1972 1973 1974 }1975 19761977 1978 echo “<script type=’text/javascript’> location.href=’$location’;</script>";1979 exit ();1980 1981 1982 } else {1983 1984 $uploads = wp_upload_dir ();1985 $baseurl = $uploads [‘baseurl’];1986 $baseurl .= '/video-slider-with-thumbnails/’;1987 ?>1988 <div style="float: left; width: 100%;">1989 <div class="wrap">1990 1991 <table><tr>1992 <td>1993 <div class="fb-like” data-href="https://www.facebook.com/i13websolution” data-layout="button” data-action="like” data-size="large” data-show-faces="false” data-share="false"></div>1994 <div id="fb-root"></div>1995 <script>(function(d, s, id) {1996 var js, fjs = d.getElementsByTagName(s)[0];1997 if (d.getElementById(id)) return;1998 js = d.createElement(s); js.id = id;1999 js.src = 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.2&appId=158817690866061&autoLogAppEvents=1’;2000 fjs.parentNode.insertBefore(js, fjs);2001 }(document, 'script’, ‘facebook-jssdk’));</script>2002 </td> 2003 <td>2004 <a target="_blank” title="Donate” href="http://i13websolution.com/donate-wordpress_image_thumbnail.php">2005 <img id="help us for free plugin” height="30” width="90” src="<?php echo plugins_url( 'images/paypaldonate.jpg’, __FILE__ );?>” border="0” alt="help us for free plugin” title="help us for free plugin">2006 </a>2007 </td>2008 </tr>2009 </table>2010 <div style="clear:both">2011 <span><h3 style="color: blue;"><a target="_blank” href="https://www.i13websolution.com/product/wordpress-video-slider-plugin-pro/"><?php echo __("UPGRADE TO PRO VERSION",’video-slider-with-thumbnails’);?></a></h3></span>2012 </div> 2013 <?php2014 if (isset ( $_GET [‘id’] ) and intval($_GET [‘id’]) > 0) {2015 2016 if ( ! current_user_can( ‘vgwt_video_slider_edit_media’ ) ) {20172018 $location=’admin.php?page=responsive_video_slider_with_thumbnail_media_management’;2019 $wp_vgallery_thumbnail_msg = array ();2020 $wp_vgallery_thumbnail_msg [‘type’] = 'err’;2021 $wp_vgallery_thumbnail_msg [‘message’] = __(‘Access Denied. Please contact your administrator.’,’video-slider-with-thumbnails’);2022 update_option ( 'wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg );2023 echo “<script type=’text/javascript’> location.href=’$location’;</script>"; 2024 exit; 20252026 }2027 2028 $id = intval(sanitize_text_field($_GET [‘id’]));2029 $query = “SELECT * FROM " . $wpdb->prefix . “e_gallery WHERE id=$id";2030 2031 $myrow = $wpdb->get_row ( $query );2032 2033 if (is_object ( $myrow )) {2034 2035 $media_type = esc_html($myrow->media_type);2036 $vtype = esc_html($myrow->vtype) ;2037 $title = esc_html($myrow->title);2038 $image_name = esc_html($myrow->image_name);2039 $HdnMediaSelection = esc_url($myrow->HdnMediaSelection);2040 $videotitle = esc_html($myrow->title);2041 $videourl=esc_url($myrow->videourl);2042 $video_order = intval($myrow->morder);2043 2044 2045 2046 }2047 ?>2048 <h2><?php echo __(‘Update Media’,’video-slider-with-thumbnails’);?></h2><?php2049 } 2050 else {2051 2052 $media_type = '’;2053 $vtype = '’;2054 $title = '’;2055 $image_name = '’;2056 $video_url = '’;2057 $HdnMediaSelection = '’;2058 $videotitle = '’;2059 $videourl=’’;2060 $video_order = '’;2061 2062 if ( ! current_user_can( ‘vgwt_video_slider_add_media’ ) ) {20632064 $location=’admin.php?page=responsive_video_slider_with_thumbnail_media_management’;2065 $wp_vgallery_thumbnail_msg = array ();2066 $wp_vgallery_thumbnail_msg [‘type’] = 'err’;2067 $wp_vgallery_thumbnail_msg [‘message’] = __(‘Access Denied. Please contact your administrator.’,’video-slider-with-thumbnails’);2068 update_option ( 'wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg );2069 echo “<script type=’text/javascript’> location.href=’$location’;</script>"; 2070 exit; 20712072 }2073 2074 ?>2075 <h2><?php echo __(‘Add Media’,’video-slider-with-thumbnails’);?></h2>2076 <?php } ?>2077 <br />2078 <div id="poststuff">2079 <div id="post-body” class="metabox-holder columns-2">2080 <div id="post-body-content">2081 2082 <div class="stuffbox” id="mediatype” style="width: 100%">2083 <h3>2084 <label for="link_name"><?php echo __(‘Media Type’,’video-slider-with-thumbnails’);?> (<span2085 style="font-size: 11px; font-weight: normal"><?php echo __(‘Choose Media Type’,’video-slider-with-thumbnails’);?></span>)2086 </label>2087 </h3>2088 <div class="inside">2089 <div>2090 <input type="radio” value="image” name="media_type_p” <?php if($media_type==’image’): ?> checked=’checked’ <?php endif;?> style="width: 15px” id="type_image" /><?php echo __(‘Image’,’video-slider-with-thumbnails’);?> 2091 <input type="radio" value="video" name="media_type_p" <?php if($media_type==’video’): ?> checked=’checked’ <?php endif;?> style="width: 15px" id="type_video" /><?php echo __(‘Video’,’video-slider-with-thumbnails’);?> 2092 20932094 </div>2095 <div style="clear: both"></div>2096 <div></div>2097 <div style="clear: both"></div>2098 <br />20992100 </div>21012102 <script>2103 2104 2105 jQuery(document).ready(function() {2106 jQuery("input[name = ‘media_type_p’]").click(function(){2107 var radioValue = jQuery("input[name=’media_type_p’]:checked").val();2108 if(radioValue==’video’){21092110 jQuery(“#addvideo”).show(500);2111 jQuery(“#addimage_”).hide(500);2112 jQuery(“#addlink_”).hide(500);2113 2114 }2115 else if(radioValue==’image’){21162117 jQuery(“#addvideo”).hide(500);2118 jQuery(“#addimage_”).show(500);2119 jQuery(“#addlink_”).hide(500);2120 }2121 2122 });2123 2124 <?php if(isset($_GET[‘id’]) and (int) intval(sanitize_text_field($_GET[‘id’]))>0):?>2125 2126 <?php if($media_type==’video’) :?>2127 jQuery(“#type_video”).trigger(‘click’);2128 2129 <?php elseif($media_type==’image’):?>2130 jQuery(“#type_image”).trigger(‘click’);2131 <?php endif;?> 21322133 <?php endif;?> 2134 2135 }); 2136 2137 2138 </script> 2139 </div>2140 <form method="post" action="" id="addvideo" name="addvideo" enctype="multipart/form-data" style="display:none">2141 2142 <input type="hidden" name="media_type" id="media_type" value="video" />2143 <div class="stuffbox" id="videoinfo_div_1" style="width: 100%;">2144 <h3>2145 <label for="link_name"><?php echo __(‘Video Information’,’video-slider-with-thumbnails’);?> 2146 </label>2147 </h3>2148 <div class="inside">2149 <div>2150 <input type="radio" value="youtube" name="vtype"2151 <?php if($vtype==’youtube’): ?> checked=’checked’ <?php endif;?> style="width: 15px" id="type_youtube" /><?php echo __(‘Youtube’,’video-slider-with-thumbnails’);?> 2152 <input <?php if($vtype==’metacafe’): ?> checked=’checked’ <?php endif;?> type="radio" value="metacafe" name="vtype"2153 style="width: 15px" id="type_metacafe" /><?php echo __(‘Metacafe’,’video-slider-with-thumbnails’);?> 2154 <input <?php if($vtype==’dailymotion’): ?> checked=’checked’ <?php endif;?> type="radio" value="dailymotion" name="vtype"2155 style="width: 15px" id="type_DailyMotion" /><?php echo __(‘DailyMotion’,’video-slider-with-thumbnails’);?> 2156 2157 2158 </div>2159 <div style="clear: both"></div>2160 <div></div>2161 <div style="clear: both"></div>2162 <br />2163 <div id=’vurl_’ >2164 <b><?php echo __(‘Video Url’,’video-slider-with-thumbnails’);?></b> <input style="width:98%" type="text" id="videourl" tabindex="1" name="videourl" value="<?php echo $videourl; ?>">2165 2166 </div>2167 2168 2169 <div style="clear: both"></div>2170 <div></div>2171 <div style="clear: both">2172 <div id="youtube_note" style="font-size:12px;display:none">2173 <?php echo __(‘Please do not use youtube.be, instead of use youtube.com’,’video-slider-with-thumbnails’);?>2174 </div>2175 </div>2176 </div>2177 2178 </div>2179 <div class="stuffbox" id="videoinfo_div_2" style="width: 100%;">2180 <h3>2181 <label for="link_name"><?php echo __(‘Video Thumbnail Information’,’video-slider-with-thumbnails’);?></label>2182 </h3>2183 <div class="inside" id="fileuploaddiv">2184 <?php if ($image_name != “”) { ?>2185 <div>2186 <b><?php echo __(‘Current Image’,’video-slider-with-thumbnails’);?>: </b>2187 <br/>2188 <img id="img_disp" name="img_disp"2189 src="<?php echo $baseurl . $image_name; ?>" />2190 </div>2191 <?php }else{ ?> 2192 <img2193 src="<?php echo plugins_url(‘/images/no-img.jpeg’, __FILE__); ?>"2194 id="img_disp" name="img_disp" />2195 2196 <?php } ?>2197 <br /> <a href="javascript:;" class="niks_media"2198 id="videoFromExternalSite" ><b><?php echo __(‘Click Here to get video information and thumbnail’,’video-slider-with-thumbnails’);?><span id=’fromval’> From <?php echo $vtype;?></span>2199 </b></a> <img2200 src="<?php echo plugins_url(‘/images/ajax-loader.gif’, __FILE__); ?>"2201 style="display: none" id="loading_img" name="loading_img" />2202 <div style="clear: both"></div>2203 <div></div>2204 <div class="uploader">2205 <b style="margin-left: 50px;" id=’or__’>OR</b>2206 <div style="clear: both; margin-top: 15px;"></div>2207 2208 <a2209 href="javascript:;" class="niks_media" id="myMediaUploader"><b><?php echo __(‘Click Here to upload video poster’,’video-slider-with-thumbnails’);?></b></a>2210 2211 <br /> <br />2212 <div>2213 <input id="HdnMediaSelection" name="HdnMediaSelection" type="hidden" value="<?php echo $HdnMediaSelection;?>" />2214 </div>2215 <div style="clear: both"></div>2216 <div></div>2217 <div style="clear: both"></div>22182219 <br />2220 </div>2221 2222 2223 <script>2224 2225 2226 function GetParameterValues(param,str) {2227 var return_p=’’; 2228 var url = str.slice(str.indexOf(‘?’) + 1).split(‘&’);2229 for (var i = 0; i < url.length; i++) {2230 var urlparam = url[i].split(‘=’);2231 if (urlparam[0] == param) {2232 return_p= urlparam[1];2233 }2234 }2235 return return_p;2236 }22372238 22392240 function UrlExists(url, cb){2241 jQuery.ajax({2242 url: url,2243 dataType: ‘text’,2244 type: ‘GET’,2245 complete: function(xhr){2246 if(typeof cb === ‘function’)2247 cb.apply(this, [xhr.status]);2248 }2249 });2250 }22512252 function getDailyMotionId(url) {2253 if (url.indexOf(“?”) > 0) {2254 url = url.substring(0, url.indexOf(“?”));2255 }2256 var m = url.match(/^.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/);2257 if (m !== null) {2258 if(m[4] !== undefined) {2259 return m[4];2260 }2261 return m[2];2262 }2263 return null;2264 }226522662267 jQuery(document).ready(function() {226822692270 jQuery(“input:radio[name=vtype]").click(function() {22712272 2273 var value = jQuery(this).val();2274 2275 if(value=="youtube”){2276 2277 jQuery(“#youtube_note”).show();2278 }2279 else{22802281 jQuery(“#youtube_note”).hide();2282 }2283 jQuery(“#fromval”).html(" from " + value);2284 2285 if(value==’html5’){2286 2287 jQuery(“#vurl_”).hide();2288 jQuery(“#vhtml5”).show();2289 jQuery(“#videoFromExternalSite”).hide();2290 jQuery(“#or__”).hide();2291 }2292 else{2293 2294 jQuery(“#vurl_”).show();2295 jQuery(“#vhtml5”).hide();2296 jQuery(“#videoFromExternalSite”).show();2297 jQuery(“#or__”).show();2298 2299 2300 }2301 });23022303 jQuery(“#videoFromExternalSite”).click(function() {230423052306 var videoService = jQuery(‘input[name="vtype"]:checked’).length;2307 var videourlVal = jQuery.trim(jQuery(“#videourl”).val());2308 var flag = true;2309 if (videourlVal == ‘’ && videoService == 0){23102311 alert(‘Please select video site.\nPlease enter video url.’);2312 jQuery(“input:radio[name=vtype]").focus();2313 flag = false;23142315 }2316 else if (videoService == 0){23172318 alert(‘Please select video site.’);2319 jQuery(“input:radio[name=vtype]").focus();2320 flag = false;2321 }2322 else if (videourlVal == ‘’){23232324 alert(‘Please enter video url.’);2325 jQuery(“#videourl”).focus();2326 flag = false;2327 }23282329 if (flag){23302331 setTimeout(function() {2332 jQuery(“#loading_img”).show(); 2333 }, 100);23342335 var selectedRadio = jQuery('input[name=vtype]');2336 var checkedValueRadio = selectedRadio.filter(‘:checked’).val();2337 if (checkedValueRadio == ‘youtube’) {2338 var vId = GetParameterValues(‘v’, videourlVal);2339 if(vId!=’’){234023412342 var tumbnailImg=’https://img.youtube.com/vi/’+vId+’/maxresdefault.jpg’;23432344 var data = {2345 'action’: 'vgwt_check_file_exist_gallery’,2346 'url’: tumbnailImg,2347 ‘vNonce’:’<?php echo $vNonce; ?>’2348 };23492350 jQuery.post(ajaxurl, data, function(response) {2351235223532354 var youtubeJsonUri=’https://www.youtube.com/oembed?url=https://www.youtube.com/watch%3Fv=’+vId+’&format=json’;2355 var data_youtube = {2356 ‘action’: ‘vgwt_get_youtube_info_gallery’,2357 ‘url’: youtubeJsonUri,2358 ‘vid’:vId,2359 ‘vNonce’:’<?php echo $vNonce; ?>’2360 };23612362 jQuery.post(ajaxurl, data_youtube, function(data) {23632364 data = jQuery.parseJSON(data);23652366 if(typeof data ==’object’){ 2367 if(typeof data ==’object’){ 23682369 if(data.title!=’’ && data.title!=’’){2370 jQuery(“#title”).val(data.title); 2371 }2372 2373 if(response==’404’ && data.thumbnail_url!=’’){2374 tumbnailImg=data.thumbnail_url;2375 }2376 else{2377 tumbnailImg=’https://img.youtube.com/vi/’+vId+’/0.jpg’;2378 }23792380 jQuery(“#img_disp”).attr('src’, tumbnailImg);2381 jQuery(“#HdnMediaSelection”).val(tumbnailImg);2382 jQuery(“#loading_img”).hide();23832384 }23852386 }2387 jQuery(“#loading_img”).hide();2388 }) 238923902391 });23922393 }2394 else{2395 alert(‘Could not found such video’);2396 jQuery(“#loading_img”).hide();2397 }2398 }2399 2400 else if(checkedValueRadio == ‘metacafe’){24012402 jQuery(“#loading_img”).show();2403 var data = {2404 'action’: 'vgwt_get_metacafe_info_gallery’,2405 'url’: videourlVal,2406 'vNonce’:’<?php echo $vNonce; ?>’2407 };24082409 jQuery.post(ajaxurl, data,function(response) {24102411 obj = jQuery.parseJSON(response); 2412 jQuery(“#HdnMediaSelection”).val(obj.HdnMediaSelection);2413 jQuery(“#title”).val(jQuery.trim(obj.videotitle));2414 jQuery(“#img_disp”).attr(‘src’, obj.HdnMediaSelection);2415 jQuery(“#loading_img”).hide();2416 }); 241724182419 } 2420 else if(checkedValueRadio == ‘dailymotion’){24212422 var vid=getDailyMotionId(videourlVal); 2423 var apiUrl=’https://api.dailymotion.com/video/’+vid+’?fields=description,id,thumbnail_720_url,title’;2424 jQuery.getJSON( apiUrl, function( data ) {2425 if(typeof data ==’object’){ 242624272428 jQuery(“#HdnMediaSelection”).val(data.thumbnail_720_url); 2429 jQuery(“#title”).val(jQuery.trim(data.title));2430 jQuery(“#img_disp”).attr('src’, data.thumbnail_720_url);2431 jQuery(“#loading_img”).hide();2432 } 2433 jQuery(“#loading_img”).hide(); 2434 }) 243524362437 jQuery(“#loading_img”).hide();2438 } 24392440 jQuery(“#loading_img”).hide();2441 }24422443 setTimeout(function() {2444 jQuery(“#loading_img”).hide(); 2445 }, 2000);24462447 });2448 //uploading files variable2449 2450 2451 2452 2453 2454 2455 var custom_file_frame;2456 jQuery(“#myMediaUploader”).click(function(event) {2457 event.preventDefault();2458 //If the frame already exists, reopen it2459 if (typeof (custom_file_frame) !== “undefined”) {2460 custom_file_frame.close();2461 }24622463 //Create WP media frame.2464 custom_file_frame = wp.media.frames.customHeader = wp.media({2465 //Title of media manager frame2466 title: “WP Media Uploader",2467 library: {2468 type: 'image’2469 },2470 button: {2471 //Button text2472 text: “Set Image"2473 },2474 //Do not allow multiple files, if you want multiple, set true2475 multiple: false2476 });2477 //callback for selected image2478 custom_file_frame.on('select’, function() {24792480 var attachment = custom_file_frame.state().get(‘selection’).first().toJSON();2481 var validExtensions = new Array();2482 validExtensions[1] = 'jpg’;2483 validExtensions[2] = 'jpeg’;2484 validExtensions[3] = 'png’;2485 validExtensions[4] = 'gif’;2486 2487 var inarr = parseInt(jQuery.inArray(attachment.subtype, validExtensions));2488 if (inarr > 0 && attachment.type.toLowerCase() == ‘image’){24892490 var titleTouse = “";2491 var imageDescriptionTouse = “";2492 if (jQuery.trim(attachment.title) != ‘’){24932494 titleTouse = jQuery.trim(attachment.title);2495 }2496 else if (jQuery.trim(attachment.caption) != ‘’){24972498 titleTouse = jQuery.trim(attachment.caption);2499 }25002501 if (jQuery.trim(attachment.description) != ‘’){25022503 imageDescriptionTouse = jQuery.trim(attachment.description);2504 }2505 else if (jQuery.trim(attachment.caption) != ‘’){25062507 imageDescriptionTouse = jQuery.trim(attachment.caption);2508 }25092510 // jQuery(“#videotitle”).val(titleTouse);2511 // jQuery(“#video_description”).val(imageDescriptionTouse);25122513 if (attachment.id != ‘’){25142515 jQuery(“#HdnMediaSelection”).val(attachment.url);2516 jQuery(“#img_disp”).attr('src’, attachment.url);25172518 }25192520 }2521 else{25222523 alert(“<?php echo __(‘Invalid image selection.’,’video-slider-with-thumbnails’);?>”);2524 }2525 //do something with attachment variable, for example attachment.filename2526 //Object:2527 //attachment.alt - image alt2528 //attachment.author - author id2529 //attachment.caption2530 //attachment.dateFormatted - date of image uploaded2531 //attachment.description2532 //attachment.editLink - edit link of media2533 //attachment.filename2534 //attachment.height2535 //attachment.icon - don’t know WTF?))2536 //attachment.id - id of attachment2537 //attachment.link - public link of attachment, for example “"http://site.com/?attachment_id=115""2538 //attachment.menuOrder2539 //attachment.mime - mime type, for example image/jpeg"2540 //attachment.name - name of attachment file, for example “my-image"2541 //attachment.status - usual is “inherit"2542 //attachment.subtype - “jpeg” if is “jpg"2543 //attachment.title2544 //attachment.type - “image"2545 //attachment.uploadedTo2546 //attachment.url - http url of image, for example “http://site.com/wp-content/uploads/2012/12/my-image.jpg"2547 //attachment.width2548 });2549 //Open modal2550 custom_file_frame.open();2551 });2552 })2553 </script>2554 </div>2555 </div>2556 <div class="stuffbox” id="namediv” style="width: 100%">2557 <h3>2558 <label for="link_name"><?php echo __(‘Video Title’,’video-slider-with-thumbnails’);?> 2559 </label>2560 </h3>2561 <div class="inside">2562 <div>2563 <input type="text” id="title” tabindex="1” size="30” name="title” value="<?php echo $videotitle; ?>">2564 </div>2565 <div style="clear: both"></div>2566 <div></div>2567 <div style="clear: both"></div>2568 </div>2569 </div>2570 2571 2572 <div class="stuffbox” id="namediv” style="width: 100%">2573 <h3>2574 <label for="link_name"> Order (<span2575 style="font-size: 11px; font-weight: normal"><?php _e(‘Media order will used in grid display order’); ?></span>)2576 </label>2577 </h3>2578 <div class="inside">2579 <div>2580 <input type="text” id="morder” size="30"2581 name="morder” value="<?php echo $video_order; ?>"2582 style="width: 50px;">2583 </div>2584 <div style="clear: both"></div>2585 <div></div>2586 <div style="clear: both"></div>25872588 </div>2589 </div>25902591 2592 <?php if (isset($_GET[‘id’]) and (int) intval(sanitize_text_field($_GET[‘id’])) > 0) { ?> 2593 <input type="hidden" name="videoid" id="videoid" value="<?php echo (int) intval(sanitize_text_field($_GET[‘id’])); ?>">2594 <?php2595 }2596 ?>2597 <?php wp_nonce_field(‘action_image_add_edit’, ‘add_edit_image_nonce’); ?> 2598 <input type="submit"2599 onclick="" name="btnsave" id="btnsave" value="<?php echo __(‘Save Changes’,’video-slider-with-thumbnails’);?>"2600 class="button-primary"> <input type="button"2601 name="cancle" id="cancle" value="<?php echo __(‘Cancel’,’video-slider-with-thumbnails’);?>"2602 class="button-primary"2603 onclick="location.href = ‘admin.php?page=responsive_video_slider_with_thumbnail_media_management’">26042605 </form>2606 <form method="post" action="" id="addimage_" name="addimage_" enctype="multipart/form-data" style="display:none">2607 2608 <input type="hidden" name="media_type" id="media_type" value="image" />2609 <div class="stuffbox" id="image_info" style="width: 100%;">2610 <h3>2611 <label for="link_name"><?php echo __(‘Image Information’,’video-slider-with-thumbnails’);?></label>2612 </h3>2613 <div class="inside" id="fileuploaddiv">2614 <?php if ($image_name != “”) { ?>2615 <div>2616 <b><?php echo __(‘Current Image’,’video-slider-with-thumbnails’);?> : </b>2617 <br/>2618 <img id="img_disp_img" name="img_disp_img"2619 src="<?php echo esc_url($baseurl . $image_name); ?>" />2620 </div>2621 <?php }else{ ?> 2622 <img2623 src="<?php echo plugins_url(‘/images/no-image-selected.png’, __FILE__); ?>"2624 id="img_disp_img" name="img_disp_img" />2625 2626 <?php } ?>2627 <img2628 src="<?php echo plugins_url(‘/images/ajax-loader.gif’, __FILE__); ?>"2629 style="display: none" id="loading_img" name="loading_img" />2630 <div style="clear: both"></div>2631 <div></div>2632 <div class="uploader">2633 2634 <div style="clear: both; margin-top: 15px;"></div>2635 <a2636 href="javascript:;" class="niks_media" id="myMediaUploader_image"><b><?php echo __(‘Click Here to upload Image’,’video-slider-with-thumbnails’);?></b></a>2637 <br /> <br />2638 <div>2639 <input id="HdnMediaSelection_image" name="HdnMediaSelection_image" type="hidden" value="<?php echo $HdnMediaSelection;?>" />2640 </div>2641 <div style="clear: both"></div>2642 <div></div>2643 <div style="clear: both"></div>26442645 <br />2646 </div>2647 </div>2648 2649 <script>2650 //uploading files variable2651 var custom_file_frame;2652 jQuery(“#myMediaUploader_image”).click(function(event) {2653 event.preventDefault();2654 //If the frame already exists, reopen it2655 if (typeof (custom_file_frame) !== “undefined”) {2656 custom_file_frame.close();2657 }26582659 //Create WP media frame.2660 custom_file_frame = wp.media.frames.customHeader = wp.media({2661 //Title of media manager frame2662 title: “WP Media Uploader",2663 library: {2664 type: 'image’2665 },2666 button: {2667 //Button text2668 text: “Set Image"2669 },2670 //Do not allow multiple files, if you want multiple, set true2671 multiple: false2672 });2673 //callback for selected image2674 custom_file_frame.on('select’, function() {26752676 var attachment = custom_file_frame.state().get(‘selection’).first().toJSON();2677 var validExtensions = new Array();2678 validExtensions[1] = 'jpg’;2679 validExtensions[2] = 'jpeg’;2680 validExtensions[3] = 'png’;2681 validExtensions[4] = 'gif’;2682 2683 var inarr = parseInt(jQuery.inArray(attachment.subtype, validExtensions));2684 if (inarr > 0 && attachment.type.toLowerCase() == ‘image’){26852686 var titleTouse = “";2687 var imageDescriptionTouse = “";2688 if (jQuery.trim(attachment.title) != ‘’){26892690 titleTouse = jQuery.trim(attachment.title);2691 }2692 else if (jQuery.trim(attachment.caption) != ‘’){26932694 titleTouse = jQuery.trim(attachment.caption);2695 }26962697 if (jQuery.trim(attachment.description) != ‘’){26982699 imageDescriptionTouse = jQuery.trim(attachment.description);2700 }2701 else if (jQuery.trim(attachment.caption) != ‘’){27022703 imageDescriptionTouse = jQuery.trim(attachment.caption);2704 }27052706 jQuery(“#addimage_ #title”).val(titleTouse);2707 2708 if (attachment.id != ‘’){27092710 jQuery(“#HdnMediaSelection_image”).val(attachment.url);2711 jQuery(“#img_disp_img”).attr('src’, attachment.url);27122713 }27142715 }2716 else{27172718 alert(“<?php echo __(‘Invalid image selection.’,’video-slider-with-thumbnails’);?>”);2719 }2720 //do something with attachment variable, for example attachment.filename2721 //Object:2722 //attachment.alt - image alt2723 //attachment.author - author id2724 //attachment.caption2725 //attachment.dateFormatted - date of image uploaded2726 //attachment.description2727 //attachment.editLink - edit link of media2728 //attachment.filename2729 //attachment.height2730 //attachment.icon - don’t know WTF?))2731 //attachment.id - id of attachment2732 //attachment.link - public link of attachment, for example “"http://site.com/?attachment_id=115""2733 //attachment.menuOrder2734 //attachment.mime - mime type, for example image/jpeg"2735 //attachment.name - name of attachment file, for example “my-image"2736 //attachment.status - usual is “inherit"2737 //attachment.subtype - “jpeg” if is “jpg"2738 //attachment.title2739 //attachment.type - “image"2740 //attachment.uploadedTo2741 //attachment.url - http url of image, for example “http://site.com/wp-content/uploads/2012/12/my-image.jpg"2742 //attachment.width2743 });2744 //Open modal2745 custom_file_frame.open();2746 });2747 2748 </script>2749 </div>2750 2751 <div class="stuffbox” id="namediv” style="width: 100%">2752 <h3>2753 <label for="link_name"><?php echo __(‘Image Title’,’video-slider-with-thumbnails’);?> 2754 </label>2755 </h3>2756 <div class="inside">2757 <div>2758 <input type="text” id="title” tabindex="1” size="30” name="title” value="<?php echo $videotitle; ?>">2759 </div>2760 <div style="clear: both"></div>2761 <div></div>2762 <div style="clear: both"></div>2763 </div>2764 </div>2765 2766 2767 <div class="stuffbox” id="namediv” style="width: 100%">2768 <h3>2769 <label for="link_name"><?php echo __(‘Order’,’video-slider-with-thumbnails’);?> (<span2770 style="font-size: 11px; font-weight: normal"><?php echo __(‘Media order will used in grid display order’,’video-slider-with-thumbnails’);?></span>)2771 </label>2772 </h3>2773 <div class="inside">2774 <div>2775 <input type="text” id="morder" size="30"2776 name="morder" value="<?php echo $video_order; ?>"2777 style="width: 50px;">2778 </div>2779 <div style="clear: both"></div>2780 <div></div>2781 <div></div>2782 27832784 </div>2785 </div>27862787 2788 <?php if (isset($_GET[‘id’]) and intval(sanitize_text_field($_GET[‘id’])) > 0) { ?> 2789 <input type="hidden" name="imageid" id="imageid" value="<?php echo intval(sanitize_text_field($_GET[‘id’])); ?>">2790 <?php2791 }2792 ?>2793 <?php wp_nonce_field(‘action_image_add_edit’, ‘add_edit_image_nonce’); ?> 2794 <input type="submit"2795 onclick="" name="btnsave" id="btnsave" value="<?php echo __(‘Save Changes’,’video-slider-with-thumbnails’);?>"2796 class="button-primary"> <input type="button"2797 name="cancle" id="cancle" value="<?php echo __(‘Cancel’,’video-slider-with-thumbnails’);?>"2798 class="button-primary"2799 onclick="location.href = ‘admin.php?page=responsive_video_slider_with_thumbnail_media_management’">28002801 </form>2802 2803 <script type="text/javascript">28042805 2806 jQuery(document).ready(function() {28072808 jQuery.validator.setDefaults({ 2809 ignore: [],2810 // any other default options and/or rules2811 });28122813 jQuery(“#addvideo”).validate({2814 rules: {2815 videotitle: {2816 required:true,2817 maxlength: 2002818 },2819 vtype: {2820 required:true28212822 },2823 videourl: {2824 required: function(element) {2825 return jQuery(“#type_html5”).is(‘:checked’)==0;2826 },2827 maxlength: 5002828 },2829 HdnMediaSelection:{2830 required:true 2831 },2832 videotitleurl: {28332834 /*url:true,*/2835 maxlength: 5002836 },2837 morder:{2838 digits:true,2839 maxlength:152840 },2841 html5_vid: {2842 required: function(element) {2843 2844 return jQuery(“#type_html5”).is(‘:checked’)==1;2845 }28462847 }2848 2849 2850 },2851 errorClass: “image_error",2852 errorPlacement: function(error, element) {2853 error.appendTo(element.parent().next().next());2854 }, messages: {2855 HdnMediaSelection: “Please select video thumbnail or Upload by wordpress media uploader.",28562857 }28582859 })2860 2861 2862 jQuery(“#addimage_”).validate({2863 rules: {2864 HdnMediaSelection_image:{2865 required:true 2866 },2867 2868 morder:{2869 digits:true,2870 maxlength:152871 }2872 2873 2874 },2875 errorClass: “image_error",2876 errorPlacement: function(error, element) {2877 error.appendTo(element.parent().next().next());2878 }, messages: {2879 HdnMediaSelection: “Please select image thumbnail or Upload by wordpress media uploader.",28802881 }28822883 })2884 2885 2886 });2887 2888 2889 </script>28902891 </div>2892 <div id="postbox-container-1” class="postbox-container” > 28932894 <div class="postbox"> 2895 <h3 class="hndle"><span></span><?php echo __(‘Access All Themes In One Price’,’video-slider-with-thumbnails’);?></h3> 2896 <div class="inside">2897 <center><a href="http://www.elegantthemes.com/affiliates/idevaffiliate.php?id=11715_0_1_10” target="_blank"><img border="0” src="<?php echo plugins_url( ‘images/300x250.gif’, __FILE__ );?>" width="250" height="250"></a></center>28982899 <div style="margin:10px 5px">29002901 </div>2902 </div></div>2903 <div class="postbox"> 2904 <h3 class="hndle"><span></span><?php echo __(‘Google For Business Coupon’,’video-slider-with-thumbnails’);?></h3> 2905 <div class="inside">2906 <center><a href="https://goo.gl/OJBuHT" target="_blank">2907 <img src="<?php echo plugins_url( ‘images/g-suite-promo-code-4.png’, __FILE__ );?>" width="250" height="250" border="0">2908 </a></center>2909 <div style="margin:10px 5px">2910 </div>2911 </div>29122913 </div>29142915 </div> 2916 </div>2917 </div>2918 </div>2919 </div>2920<?php2921 }2922 } else if (strtolower ( $action ) == strtolower ( ‘delete’ )) {2923 2924 $retrieved_nonce = ‘’;29252926 if(isset($_GET[‘nonce’]) and $_GET[‘nonce’]!=’’){29272928 $retrieved_nonce=sanitize_text_field($_GET[‘nonce’]);29292930 }2931 2932 if ( ! current_user_can( ‘vgwt_video_slider_delete_media’ ) ) {29332934 $location=’admin.php?page=responsive_video_slider_with_thumbnail_media_management’;2935 $wp_vgallery_thumbnail_msg = array ();2936 $wp_vgallery_thumbnail_msg [‘type’] = ‘err’;2937 $wp_vgallery_thumbnail_msg [‘message’] = __(‘Access Denied. Please contact your administrator.’,’video-slider-with-thumbnails’);2938 update_option ( ‘wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg );2939 echo “<script type=’text/javascript’> location.href=’$location’;</script>"; 2940 exit; 29412942 }2943 if (!wp_verify_nonce($retrieved_nonce, ‘delete_image’ ) ){294429452946 wp_die(‘Security check fail’); 2947 }29482949 $uploads = wp_upload_dir ();2950 $baseDir = $uploads [‘basedir’];2951 $baseDir = str_replace ( “\\", “/", $baseDir );2952 $pathToImagesFolder = $baseDir . ‘/video-slider-with-thumbnails’;2953 2954 2955 2956 $location = "admin.php?page=responsive_video_slider_with_thumbnail_media_management";2957 $deleteId = (int) intval(sanitize_text_field($_GET [‘id’]));2958 2959 try {2960 2961 $query = "SELECT * FROM " . $wpdb->prefix . "e_gallery WHERE id=$deleteId ";2962 $myrow = $wpdb->get_row ( $query );2963 $settings=get_option(‘vgwt_video_slider_settings’); 2964 $imageheight = intval($settings [‘panel_height’]);2965 $imagewidth = intval($settings [‘panel_width’]);29662967 if (is_object ( $myrow )) {2968 2969 2970 $image_name = $myrow->image_name;2971 $wpcurrentdir = dirname ( __FILE__ );2972 $wpcurrentdir = str_replace ( “\\", “/", $wpcurrentdir );2973 $imagetoDel = $pathToImagesFolder . ‘/’ . $image_name;2974 $pInfo = pathinfo ( $myrow->HdnMediaSelection );2975 $pInfo2 = pathinfo ( $imagetoDel );2976 $ext = $pInfo2 [‘extension’];2977 2978 @unlink ( $imagetoDel );2979 @unlink($pathToImagesFolder.’/’.$pInfo2[‘filename’] . ‘_’.$imageheight.’_’.$imagewidth.’.’.$ext);2980 2981 $query = "delete from " . $wpdb->prefix . "e_gallery where id=$deleteId “;2982 $wpdb->query ( $query );2983 2984 $wp_vgallery_thumbnail_msg = array ();2985 $wp_vgallery_thumbnail_msg [‘type’] = 'succ’;2986 $wp_vgallery_thumbnail_msg [‘message’] = __(‘Video deleted successfully.’,’video-slider-with-thumbnails’);2987 update_option ( 'wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg );2988 }2989 } catch ( Exception $e ) {2990 2991 $wp_vgallery_thumbnail_msg = array ();2992 $wp_vgallery_thumbnail_msg [‘type’] = 'err’;2993 $wp_vgallery_thumbnail_msg [‘message’] = __(‘Error while deleting video.’,’video-slider-with-thumbnails’);2994 update_option ( ‘wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg );2995 }2996 2997 echo “<script type=’text/javascript’> location.href=’$location’;</script>";2998 exit ();2999 } 3000 else if (strtolower ( $action ) == strtolower ( ‘deleteselected’ )) {3001 3002 if(!check_admin_referer(‘action_settings_mass_delete’,’mass_delete_nonce’)){30033004 wp_die(‘Security check fail’); 3005 }30063007 if ( ! current_user_can( ‘vgwt_video_slider_delete_media’ ) ) {30083009 $location=’admin.php?page=responsive_video_slider_with_thumbnail_media_management’;3010 $wp_vgallery_thumbnail_msg = array ();3011 $wp_vgallery_thumbnail_msg [‘type’] = 'err’;3012 $wp_vgallery_thumbnail_msg [‘message’] = __(‘Access Denied. Please contact your administrator.’,’video-slider-with-thumbnails’);3013 update_option ( ‘wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg );3014 echo "<script type=’text/javascript’> location.href=’$location’;</script>"; 3015 exit; 30163017 }3018 3019 $location = "admin.php?page=responsive_video_slider_with_thumbnail_media_management";3020 3021 if (isset ( $_POST ) and isset ( $_POST [‘deleteselected’] ) and (sanitize_text_field($_POST [‘action’]) == ‘delete’ or sanitize_text_field($_POST [‘action_upper’]) == ‘delete’)) {3022 3023 $uploads = wp_upload_dir ();3024 $baseDir = $uploads [‘basedir’];3025 $baseDir = str_replace ( "\\", “/", $baseDir );3026 $pathToImagesFolder = $baseDir . '/video-slider-with-thumbnails’;3027 3028 if (sizeof ( $_POST [‘thumbnails’] ) > 0) {3029 3030 $deleteto = sanitize_text_field($_POST [‘thumbnails’]);3031 $implode = implode ( ',’, $deleteto );3032 3033 try {3034 3035 foreach ( $deleteto as $img ) {3036 3037 $img=intval($img);3038 $query = “SELECT * FROM " . $wpdb->prefix . “e_gallery WHERE id=$img";3039 $myrow = $wpdb->get_row ( $query );3040 3041 $settings=get_option(‘vgwt_video_slider_settings’); 3042 $imageheight = $settings [‘imageheight’];3043 $imagewidth = $settings [‘imagewidth’];30443045 3046 if (is_object ( $myrow )) {3047 3048 $image_name = $myrow->image_name ;3049 $wpcurrentdir = dirname ( __FILE__ );3050 $wpcurrentdir = str_replace ( “\\", “/", $wpcurrentdir );3051 $imagetoDel = $pathToImagesFolder . ‘/’ . $image_name;3052 3053 $pInfo = pathinfo ( $myrow->HdnMediaSelection );3054 $pInfo2 = pathinfo ( $imagetoDel );3055 $ext = $pInfo2 [‘extension’];3056 3057 @unlink ( $imagetoDel );3058 @unlink($pathToImagesFolder.’/’.$pInfo2[‘filename’] . '_’.$imageheight.’_’.$imagewidth.’.’.$ext);3059 3060 3061 $query = “delete from " . $wpdb->prefix . “e_gallery where id=$img “;3062 $wpdb->query ( $query );3063 3064 $wp_vgallery_thumbnail_msg = array ();3065 $wp_vgallery_thumbnail_msg [‘type’] = 'succ’;3066 $wp_vgallery_thumbnail_msg [‘message’] = __(‘selected videos deleted successfully.’,’video-slider-with-thumbnails’);3067 update_option ( 'wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg );3068 }3069 }3070 } catch ( Exception $e ) {3071 3072 $wp_vgallery_thumbnail_msg = array ();3073 $wp_vgallery_thumbnail_msg [‘type’] = 'err’;3074 $wp_vgallery_thumbnail_msg [‘message’] = __(‘Error while deleting videos.’,’video-slider-with-thumbnails’);3075 update_option ( 'wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg );3076 }3077 3078 echo “<script type=’text/javascript’> location.href=’$location’;</script>";3079 exit ();3080 } else {3081 3082 echo “<script type=’text/javascript’> location.href=’$location’;</script>";3083 exit ();3084 }3085 } else {3086 3087 echo “<script type=’text/javascript’> location.href=’$location’;</script>";3088 exit ();3089 }3090 }3091}309230933094function vgwt_responsive_video_slider_with_thumbnail_media_preview_func(){30953096 3097 if ( ! current_user_can( ‘vgwt_video_slider_preview’ ) ) {30983099 $location=’admin.php?page=responsive_video_slider_with_thumbnail_media_management’;3100 $wp_vgallery_thumbnail_msg = array ();3101 $wp_vgallery_thumbnail_msg [‘type’] = 'err’;3102 $wp_vgallery_thumbnail_msg [‘message’] = __(‘Access Denied. Please contact your administrator.’,’video-slider-with-thumbnails’);3103 update_option ( 'wp_vgallery_thumbnail_msg’, $wp_vgallery_thumbnail_msg );3104 echo “<script type=’text/javascript’> location.href=’$location’;</script>"; 3105 exit; 31063107 }31083109 global $wpdb;3110 3111 $settings=get_option(‘vgwt_video_slider_settings’); 31123113 $location="admin.php?page=responsive_video_slider_with_thumbnail_media_preview"; 3114 3115 $uploads = wp_upload_dir ();3116 $baseDir = $uploads [‘basedir’];3117 $baseDir = str_replace ( “\\", “/", $baseDir );3118 $pathToImagesFolder = $baseDir . '/video-slider-with-thumbnails’;3119 3120 $baseurl=$uploads[‘baseurl’];3121 $baseurl.=’/video-slider-with-thumbnails/’;312231233124 ?> 3125 3126 <div style=""> 3127 <div style="">3128 <div class="wrap">3129 <table><tr><td><a href="https://twitter.com/FreeAdsPost” class="twitter-follow-button” data-show-count="false” data-size="large” data-show-screen-name="false">Follow @FreeAdsPost</a>3130 <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs”);</script></td>3131 <td>3132 <a target="_blank” title="Donate” href="http://i13websolution.com/donate-wordpress_image_thumbnail.php">3133 <img id="help us for free plugin” height="30” width="90” src="<?php echo plugins_url( 'images/paypaldonate.jpg’, __FILE__ );?>” border="0” alt="help us for free plugin” title="help us for free plugin">3134 </a>3135 </td>3136 </tr>3137 </table>3138 <div style="clear:both">3139 <span><h3 style="color: blue;"><a target="_blank” href="https://www.i13websolution.com/product/wordpress-video-slider-plugin-pro/"><?php echo __("UPGRADE TO PRO VERSION",’video-slider-with-thumbnails’);?></a></h3></span>3140 </div> 3141 <h2><?php __(‘Slider Preview’,’video-slider-with-thumbnails’);?></h2>3142 <br>31433144 <?php3145 $wpcurrentdir=dirname(__FILE__);3146 $wpcurrentdir=str_replace(“\\","/",$wpcurrentdir);314731483149 ?>3150 3151 <?php $slider_id_html=time().rand(0,5000);?>3152 <?php if(is_array($settings)){?>3153 <div id="poststuff">3154 <div id="post-body” class="metabox-holder columns-2">3155 <div id="post-body-content">3156 <div style="clear: both;"></div>3157 <?php $url = plugin_dir_url(__FILE__); ?>3158 <div id="divSliderMain_admin” style="max-width:<?php echo intval($settings[‘panel_width’]);?>px;">3159 <ul id="<?php echo $slider_id_html;?>">3160 <?php3161 global $wpdb;3162 $query="SELECT * FROM ".$wpdb->prefix."e_gallery order by morder,createdon desc";3163 $rows=$wpdb->get_results($query,’ARRAY_A’);31643165 if(count($rows) > 0){3166 foreach($rows as $row){31673168 3169 $imageheight=intval($settings[‘panel_height’]);3170 $imagewidth=intval($settings[‘panel_width’]);3171 $imagename=$row[‘image_name’];3172 $imageUploadTo=$pathToImagesFolder.’/’.$imagename;3173 $imageUploadTo=str_replace(“\\","/",$imageUploadTo);3174 $pathinfo=pathinfo($imageUploadTo);3175 $filenamewithoutextension=$pathinfo[‘filename’];3176 $outputimg="";3177 $media_type=esc_html($row[‘media_type’]);3178 $vtype=esc_html($row[‘vtype’]);31793180 $video_url = esc_url($row [‘videourl’]);3181 $Url_vid = @parse_url($row [‘videourl’]);31823183 $relend = ‘’;3184 $flag=false;3185 if (isset($Url_vid[‘query’]) and $Url_vid[‘query’] != ‘’) {318631873188 parse_str($Url_vid[‘query’], $get_array);3189 if(is_array($get_array) and sizeof($get_array)>0){31903191 foreach($get_array as $k=>$v){31923193 if($flag==false){31943195 $flag=true;3196 $relend.="?$k=$v";3197 }3198 else{31993200 $relend.="&$k=$v";32013202 }320332043205 } 320632073208 }3209321032113212 }32133214 $embed_url=esc_url($row[‘embed_url’]).$relend; 3215 if($settings[‘panel_scale’]==’fit’){32163217 $outputimg = esc_url($baseurl.$imagename);32183219 }else{32203221 list($width, $height) = getimagesize(esc_url($pathToImagesFolder."/".$row[‘image_name’]));3222 if($width<$imagewidth){3223 $imagewidth=$width;3224 }32253226 if($height<$imageheight){32273228 $imageheight=$height;3229 }32303231 $imagetoCheck=$pathToImagesFolder.’/’.$filenamewithoutextension.’_’.$imageheight.’_’.$imagewidth.’.’.$pathinfo[‘extension’];3232 $imagetoCheckSmall=$pathToImagesFolder.’/’.$filenamewithoutextension.’_’.$imageheight.’_’.$imagewidth.’.’.strtolower($pathinfo[‘extension’]);32333234 if(file_exists($imagetoCheck)){32353236 $outputimg = $baseurl.$filenamewithoutextension.’_’.$imageheight.’_’.$imagewidth.’.’.$pathinfo[‘extension’];32373238 }3239 else if(file_exists($imagetoCheckSmall)){3240 $outputimg = $baseurl.$filenamewithoutextension.’_’.$imageheight.’_’.$imagewidth.’.’.strtolower($pathinfo[‘extension’]);3241 }3242 else{32433244 if(file_exists($pathToImagesFolder."/".$row[‘image_name’])){32453246 3247 $resizeObj = new vgwt_resize($pathToImagesFolder."/".$row[‘image_name’]); 3248 $resizeObj -> resizeImage($imagewidth, $imageheight, “exact”); 3249 $resizeObj -> saveImage($pathToImagesFolder."/".$filenamewithoutextension.’_’.$imageheight.’_’.$imagewidth.’.’.$pathinfo[‘extension’], 100); 3250 //$outputimg = plugin_dir_url(__FILE__)."imagestoscroll/".$filenamewithoutextension.’_’.$imageheight.’_’.$imagewidth.’.’.$pathinfo[‘extension’];32513252 if(file_exists($imagetoCheck)){3253 $outputimg = $baseurl.$filenamewithoutextension.’_’.$imageheight.’_’.$imagewidth.’.’.$pathinfo[‘extension’];3254 }3255 else if(file_exists($imagetoCheckSmall)){3256 $outputimg = $baseurl.$filenamewithoutextension.’_’.$imageheight.’_’.$imagewidth.’.’.strtolower($pathinfo[‘extension’]);3257 }32583259 }else{32603261 $outputimg = esc_url($baseurl.$imagename);3262 } 32633264 }32653266 } 32673268 326932703271 ?> 3272 <li><img data-poster="<?php echo esc_url($outputimg);?>” data-vurl="<?php echo esc_url($embed_url);?>” data-vtype=’<?php echo $vtype;?>’ data-media="<?php echo $media_type;?>” src-org="<?php echo esc_url($outputimg);?>” <?php if(trim($row[‘title’])!=’’):?> title="<?php echo trim(esc_html($row[‘title’]));?>” <?php else:?> title=” " <?php endif;?> data-description="” /></li> 32733274 <?php }?> 32753276 <?php }?> 3277 </ul>3278 3279 </div>32803281 <script type="text/javascript">32823283 jQuery(document).ready(function() {32843285 <?php $galRandNo=rand(0,13313); ?> 3286 var galleryItems<?php echo $galRandNo;?>;3287 jQuery(function(){3288 galleryItems<?php echo $galRandNo;?> = jQuery(“#<?php echo $slider_id_html;?>”);32893290 var galleryItemDivs = jQuery(‘#divSliderMain_admin’);32913292 galleryItems<?php echo $galRandNo;?>.each(function (index, item){3293 item.parent_data = jQuery(item).parent(“#divSliderMain_admin”);3294 });3295329632973298 galleryItemDivs.each(function(index, item){ 3299 jQuery("ul",this).galleryViewV({33003301 transition_speed:<?php echo intval($settings[‘transition_speed’]);?>, //INT - duration of panel/frame transition (in milliseconds)3302 transition_interval:<?php echo intval($settings[‘transition_interval’]);?>, //INT - delay between panel/frame transitions (in milliseconds)3303 easing:’swing’, //STRING - easing method to use for animations (jQuery provides ‘swing’ or ‘linear’, more available with jQuery UI or Easing plugin)3304 show_panels:’true’,3305 show_panel_nav:<?php echo (intval($settings[‘show_panel_nav’])==1)?’true’:’false’ ;?>, //BOOLEAN - flag to show or hide panel navigation buttons3306 enable_overlays:<?php echo (intval($settings[‘enable_overlays’])==1)?’true’:’false’ ;?>, //BOOLEAN - flag to show or hide panel overlays3307 show_overlays:<?php echo (intval($settings[‘enable_overlays’])==1)?’true’:’false’ ;?>, //BOOLEAN - flag to show or hide frame captions 3308 panel_width:<?php echo intval($settings[‘panel_width’]);?>, //INT - width of gallery panel (in pixels)3309 panel_height:<?php echo intval($settings[‘panel_height’]);?>, //INT - height of gallery panel (in pixels)3310 panel_animation:’<?php echo esc_html($settings[‘panel_animation’]);?>’, //STRING - animation method for panel transitions (crossfade,fade,slide,none)3311 panel_scale: ‘<?php echo esc_html($settings[‘panel_scale’]);?>’, //STRING - cropping option for panel images (crop = scale image and fit to aspect ratio determined by panel_width and panel_height, fit = scale image and preserve original aspect ratio)3312 overlay_position:’<?php echo esc_html($settings[‘overlay_position’]);?>’, //STRING - position of panel overlay (bottom, top)3313 pan_images:’false’, //BOOLEAN - flag to allow user to grab/drag oversized images within gallery3314 pan_style:’drag’, //STRING - panning method (drag = user clicks and drags image to pan, track = image automatically pans based on mouse position3315 start_frame:’<?php echo intval($settings[‘start_frame’]);?>’, //INT - index of panel/frame to show first when gallery loads3316 show_filmstrip:<?php echo (intval($settings[‘show_filmstrip’])==1)?’true’:’false’ ;?>, //BOOLEAN - flag to show or hide filmstrip portion of gallery3317 show_filmstrip_nav:<?php echo (intval($settings[‘show_filmstrip_nav’])==1)?’true’:’false’ ;?>, //BOOLEAN - flag indicating whether to display navigation buttons3318 enable_slideshow:<?php echo (intval($settings[‘enable_slideshow’])==1)?’true’:’false’ ;?>, //BOOLEAN - flag indicating whether to display slideshow play/pause button3319 autoplay:<?php echo (intval($settings[‘autoplay’])==1)?’true’:’false’ ;?>, //BOOLEAN - flag to start slideshow on gallery load3320 show_captions:<?php echo (intval($settings[‘show_captions’])==1)?’true’:’false’ ;?>, //BOOLEAN - flag to show or hide frame captions 3321 filmstrip_style: ‘<?php echo esc_html($settings[‘filmstrip_style’]);?>’, //STRING - type of filmstrip to use (scroll = display one line of frames, scroll filmstrip if necessary, showall = display multiple rows of frames if necessary)3322 filmstrip_position:’<?php echo esc_html($settings[‘filmstrip_position’]);?>’, //STRING - position of filmstrip within gallery (bottom, top, left, right)3323 frame_width:<?php echo intval($settings[‘frame_width’]);?>, //INT - width of filmstrip frames (in pixels)3324 frame_height:<?php echo intval($settings[‘frame_height’]);?>, //INT - width of filmstrip frames (in pixels)3325 frame_opacity:<?php echo floatval($settings[‘frame_opacity’]);?>, //FLOAT - transparency of non-active frames (1.0 = opaque, 0.0 = transparent)3326 frame_scale: ‘crop’, //STRING - cropping option for filmstrip images (same as above)3327 frame_gap:<?php echo intval($settings[‘frame_gap’]);?>, //INT - spacing between frames within filmstrip (in pixels)3328 show_infobar:<?php echo (intval($settings[‘show_infobar’])==1)?’true’:’false’ ;?>, //BOOLEAN - flag to show or hide infobar3329 infobar_opacity:<?php echo floatval($settings[‘infobar_opacity’]);?>, //FLOAT - transparency for info bar3330 link_newwindow: true,3331 filmstrip_size:10,3332 clickable:false3333 33343335 }); 33363337 }); 33383339 });33403341 3342 3343 3344 //3345 // Resize the image gallery3346 //3347 var oldsize_w<?php echo $galRandNo;?>=<?php echo intval($settings[‘panel_width’]);?>;3348 var oldsize_h<?php echo $galRandNo;?>=<?php echo intval($settings[‘panel_height’]);?>;33493350 function resizegallery<?php echo $galRandNo;?>(){3351 if(galleryItems<?php echo $galRandNo;?>==undefined){return;}3352 galleryItems<?php echo $galRandNo;?>.each(function (index, item){3353 var $parent = item.parent_data;33543355 // width based on parent?3356 <?php if((esc_html($settings[‘filmstrip_position’])==’left’ or esc_html($settings[‘filmstrip_position’])==’right’) and esc_html($settings[‘show_filmstrip’])==1):?>3357 var width = ($parent.innerWidth());//2 times 5 pixels margin 3358 <?php else:?>3359 var width = ($parent.innerWidth()-10);//2 times 5 pixels margin3360 <?php endif;?> 3361 3362 3363 var height = ($parent.innerHeight()-10);//2 times 5 pixels margin3364 if(oldsize_w<?php echo $galRandNo;?>==width){3365 3366 // return;3367 }3368 oldsize_w<?php echo $galRandNo;?>=width;3369 3370 thumbfactor = width/(<?php echo intval($settings[‘panel_width’]);?>-10);3371 3372 var resizeToHeight=width/3*2;3373 if(resizeToHeight><?php echo intval($settings[‘panel_height’]);?>){3374 resizeToHeight=<?php echo intval($settings[‘panel_height’]);?>; 3375 }3376 3377 3378 3379 jQuery(item).resizeGalleryView_video(3380 <?php if((esc_html($settings[‘filmstrip_position’])==’left’ or esc_html($settings[‘filmstrip_position’]==’right’)) and intval($settings[‘show_filmstrip’])==1):?>width-(<?php echo intval($settings[‘frame_width’]);?>*thumbfactor)-10,<?php else:?> width,<?php endif;?>3381 resizeToHeight, <?php echo intval($settings[‘frame_width’]);?>*thumbfactor, <?php echo intval($settings[‘frame_height’]);?>*thumbfactor);33823383 });3384 }33853386 var inited<?php echo $galRandNo;?>=false;33873388 function onresize<?php echo $galRandNo;?>(){ 3389 resizegallery<?php echo $galRandNo;?>();3390 inited<?php echo $galRandNo;?>=true;3391 }339233933394 jQuery(window).resize(onresize<?php echo $galRandNo;?>);3395 jQuery( document ).ready(function() {3396 onresize<?php echo $galRandNo;?>();3397 }); 33983399 }); 3400 </script> 3401 </div>3402 </div> 3403 </div> 3404 <div class="clear"></div>3405 </div>34063407 <h3><?php echo __(‘To print this slider into WordPress Post/Page use below code’,’video-slider-with-thumbnails’);?></h3>3408 <input type="text" value=’[vgwt_print_responsive_video_slider_with_thumbnail] ' style="width: 400px;height: 30px" onclick="this.focus();this.select()" />3409 <div class="clear"></div>3410 <h3><?php echo __(‘To print this slider into WordPress theme/template PHP files use below code’,’video-slider-with-thumbnails’);?></h3>3411 <?php3412 $shortcode=’[vgwt_print_responsive_video_slider_with_thumbnail]‘;3413 ?>3414 <input type="text" value="<?php echo do_shortcode(‘<?php echo htmlentities($shortcode, ENT_QUOTES); ?>’); ?>" style="width: 400px;height: 30px" onclick="this.focus();this.select()" />3415 <div class="clear"></div>34163417 <?php }?>3418 </div> 3419 </div>3420 <?php }3421 34223423 3424function vgwt_print_responsive_video_slider_with_thumbnail_func($atts){34253426 global $wpdb;3427 $settings=get_option(‘vgwt_video_slider_settings’); 3428 $rand_Numb=uniqid(‘gallery_slider’);3429 $wpcurrentdir=dirname(__FILE__);3430 $wpcurrentdir=str_replace("\\","/",$wpcurrentdir);3431 $url = plugin_dir_url(__FILE__);3432 3433 $uploads = wp_upload_dir ();3434 $baseDir = $uploads [‘basedir’];3435 $baseDir = str_replace ( “\\", “/", $baseDir );3436 $pathToImagesFolder = $baseDir . '/video-slider-with-thumbnails’;34373438 $baseurl=$uploads[‘baseurl’];3439 $baseurl.=’/video-slider-with-thumbnails/’;3440 3441 wp_enqueue_style ( ‘video-slider-responsive’);3442 wp_enqueue_script ( ‘jquery’ );3443 wp_enqueue_script ( ‘jquery.timers-1.2-video-slider’);3444 wp_enqueue_script ( ‘jquery.easing.1.3-video-slider’);3445 wp_enqueue_script ( ‘video-gallery-js’);34463447 3448 ob_start();3449 ?><!-- vgwt_print_responsive_video_slider_with_thumbnail_func --><div id="divSliderMain_admin_<?php echo $rand_Numb;?>” style="max-width:<?php echo $settings[‘panel_width’];?>px;">3450 <ul id="<?php echo $rand_Numb;?>” style="visibility: hidden">3451 <?php3452 global $wpdb;3453 $query="SELECT * FROM ".$wpdb->prefix."e_gallery order by morder,createdon desc";3454 $rows=$wpdb->get_results($query,’ARRAY_A’);34553456 if(count($rows) > 0){3457 3458 foreach($rows as $row){34593460 3461 $imageheight=intval($settings[‘panel_height’]);3462 $imagewidth=intval($settings[‘panel_width’]);3463 $imagename=$row[‘image_name’];3464 $imageUploadTo=$pathToImagesFolder.’/’.$imagename;3465 $imageUploadTo=str_replace(“\\","/",$imageUploadTo);3466 $pathinfo=pathinfo($imageUploadTo);3467 $filenamewithoutextension=$pathinfo[‘filename’];3468 $outputimg="";3469 $media_type=esc_html($row[‘media_type’]);3470 $vtype=esc_html($row[‘vtype’]);34713472 $video_url = esc_url($row [‘videourl’]);3473 $Url_vid = @parse_url($row [‘videourl’]);34743475 $relend = ‘’;3476 $flag=false;3477 if (isset($Url_vid[‘query’]) and $Url_vid[‘query’] != ‘’) {347834793480 parse_str($Url_vid[‘query’], $get_array);3481 if(is_array($get_array) and sizeof($get_array)>0){34823483 foreach($get_array as $k=>$v){34843485 if($flag==false){34863487 $flag=true;3488 $relend.="?$k=$v";3489 }3490 else{34913492 $relend.="&$k=$v";34933494 }349534963497 } 349834993500 }3501350235033504 }35053506 $embed_url=esc_url($row[‘embed_url’]).$relend; 3507 if($settings[‘panel_scale’]==’fit’){35083509 $outputimg = esc_url($baseurl.$imagename);35103511 }else{35123513 list($width, $height) = getimagesize(esc_url($pathToImagesFolder."/".$row[‘image_name’]));3514 if($width<$imagewidth){3515 $imagewidth=$width;3516 }35173518 if($height<$imageheight){35193520 $imageheight=$height;3521 }35223523 $imagetoCheck=$pathToImagesFolder.’/’.$filenamewithoutextension.’_’.$imageheight.’_’.$imagewidth.’.’.$pathinfo[‘extension’];3524 $imagetoCheckSmall=$pathToImagesFolder.’/’.$filenamewithoutextension.’_’.$imageheight.’_’.$imagewidth.’.’.strtolower($pathinfo[‘extension’]);35253526 if(file_exists($imagetoCheck)){35273528 $outputimg = $baseurl.$filenamewithoutextension.’_’.$imageheight.’_’.$imagewidth.’.’.$pathinfo[‘extension’];35293530 }3531 else if(file_exists($imagetoCheckSmall)){3532 $outputimg = $baseurl.$filenamewithoutextension.’_’.$imageheight.’_’.$imagewidth.’.’.strtolower($pathinfo[‘extension’]);3533 }3534 else{35353536 if(file_exists($pathToImagesFolder."/".$row[‘image_name’])){353735383539 $resizeObj = new vgwt_resize($pathToImagesFolder."/".$row[‘image_name’]); 3540 $resizeObj -> resizeImage($imagewidth, $imageheight, “exact”); 3541 $resizeObj -> saveImage($pathToImagesFolder."/".$filenamewithoutextension.’_’.$imageheight.’_’.$imagewidth.’.’.$pathinfo[‘extension’], 100); 3542 //$outputimg = plugin_dir_url(__FILE__)."imagestoscroll/".$filenamewithoutextension.’_’.$imageheight.’_’.$imagewidth.’.’.$pathinfo[‘extension’];35433544 if(file_exists($imagetoCheck)){3545 $outputimg = $baseurl.$filenamewithoutextension.’_’.$imageheight.’_’.$imagewidth.’.’.$pathinfo[‘extension’];3546 }3547 else if(file_exists($imagetoCheckSmall)){3548 $outputimg = $baseurl.$filenamewithoutextension.’_’.$imageheight.’_’.$imagewidth.’.’.strtolower($pathinfo[‘extension’]);3549 }35503551 }else{35523553 $outputimg = esc_url($baseurl.$imagename);3554 } 35553556 }35573558 } 35593560356135623563 ?> 3564 <li><img data-poster="<?php echo esc_url($outputimg);?>” data-vurl="<?php echo esc_url($embed_url);?>" data-vtype=’<?php echo $vtype;?>’ data-media="<?php echo $media_type;?>" data-target="1" <?php if(isset($row[‘custom_link’]) and trim($row[‘custom_link’])!=’’):?> data-href="<?php echo $row[‘custom_link’];?>" <?php else:?> data-href="" <?php endif;?> src-org="<?php echo $outputimg;?>" <?php if(trim($row[‘title’])!=’’):?> title="<?php echo trim($row[‘title’]);?>" <?php else:?> title=" " <?php endif;?> <?php if(isset($row[‘image_description’]) and trim($row[‘image_description’])!=’’):?> data-description="<?php echo trim($row[‘image_description’]);?>" <?php else:?> data-description="" <?php endif;?> data-description="" /></li> 35653566 <?php } ?> 35673568 <?php }?> 3569 </ul>3570 </div>3571 <script type="text/javascript">35723573 <?php $intval= uniqid(‘interval_’);?>3574 3575 var <?php echo $intval;?> = setInterval(function() {35763577 if(document.readyState === ‘complete’) {35783579 clearInterval(<?php echo $intval;?>);3580 3581 //jQuery(document).ready(function() {3582 jQuery(“#<?php echo $rand_Numb;?>”).css(‘visibility’,’visible’); 35833584 <?php $galRandNo=rand(0,13313); ?> 3585 var galleryItems<?php echo $galRandNo;?>;3586 jQuery(function(){3587 galleryItems<?php echo $galRandNo;?> = jQuery(“#<?php echo $rand_Numb;?>”);35883589 var galleryItemDivs = jQuery(‘#divSliderMain_admin_<?php echo $rand_Numb;?>’);35903591 galleryItems<?php echo $galRandNo;?>.each(function (index, item){3592 item.parent_data = jQuery(item).parent(“#divSliderMain_admin_<?php echo $rand_Numb;?>”);3593 });35943595 3596 galleryItemDivs.each(function(index, item){35973598 jQuery("ul",this).galleryViewV({35993600 transition_speed:<?php echo intval($settings[‘transition_speed’]);?>, //INT - duration of panel/frame transition (in milliseconds)3601 transition_interval:<?php echo intval($settings[‘transition_interval’]);?>, //INT - delay between panel/frame transitions (in milliseconds)3602 easing:’swing’, //STRING - easing method to use for animations (jQuery provides ‘swing’ or ‘linear’, more available with jQuery UI or Easing plugin)3603 show_panels:’true’,3604 show_panel_nav:<?php echo (intval($settings[‘show_panel_nav’])==1)?’true’:’false’ ;?>, //BOOLEAN - flag to show or hide panel navigation buttons3605 enable_overlays:<?php echo (intval($settings[‘enable_overlays’])==1)?’true’:’false’ ;?>, //BOOLEAN - flag to show or hide panel overlays3606 show_overlays:<?php echo (intval($settings[‘enable_overlays’])==1)?’true’:’false’ ;?>, //BOOLEAN - flag to show or hide frame captions 3607 panel_width:<?php echo intval($settings[‘panel_width’]);?>, //INT - width of gallery panel (in pixels)3608 panel_height:<?php echo intval($settings[‘panel_height’]);?>, //INT - height of gallery panel (in pixels)3609 panel_animation:’<?php echo esc_html($settings[‘panel_animation’]);?>’, //STRING - animation method for panel transitions (crossfade,fade,slide,none)3610 panel_scale: ‘<?php echo esc_html($settings[‘panel_scale’]);?>’, //STRING - cropping option for panel images (crop = scale image and fit to aspect ratio determined by panel_width and panel_height, fit = scale image and preserve original aspect ratio)3611 overlay_position:’<?php echo esc_html($settings[‘overlay_position’]);?>’, //STRING - position of panel overlay (bottom, top)3612 pan_images:’false’, //BOOLEAN - flag to allow user to grab/drag oversized images within gallery3613 pan_style:’drag’, //STRING - panning method (drag = user clicks and drags image to pan, track = image automatically pans based on mouse position3614 start_frame:’<?php echo intval($settings[‘start_frame’]);?>’, //INT - index of panel/frame to show first when gallery loads3615 show_filmstrip:<?php echo (intval($settings[‘show_filmstrip’])==1)?’true’:’false’ ;?>, //BOOLEAN - flag to show or hide filmstrip portion of gallery3616 show_filmstrip_nav:<?php echo (intval($settings[‘show_filmstrip_nav’])==1)?’true’:’false’ ;?>, //BOOLEAN - flag indicating whether to display navigation buttons3617 enable_slideshow:<?php echo (intval($settings[‘enable_slideshow’])==1)?’true’:’false’ ;?>, //BOOLEAN - flag indicating whether to display slideshow play/pause button3618 autoplay:<?php echo (intval($settings[‘autoplay’])==1)?’true’:’false’ ;?>, //BOOLEAN - flag to start slideshow on gallery load3619 show_captions:<?php echo (intval($settings[‘show_captions’])==1)?’true’:’false’ ;?>, //BOOLEAN - flag to show or hide frame captions 3620 filmstrip_style: ‘<?php echo esc_html($settings[‘filmstrip_style’]);?>’, //STRING - type of filmstrip to use (scroll = display one line of frames, scroll filmstrip if necessary, showall = display multiple rows of frames if necessary)3621 filmstrip_position:’<?php echo esc_html($settings[‘filmstrip_position’]);?>’, //STRING - position of filmstrip within gallery (bottom, top, left, right)3622 frame_width:<?php echo intval($settings[‘frame_width’]);?>, //INT - width of filmstrip frames (in pixels)3623 frame_height:<?php echo intval($settings[‘frame_height’]);?>, //INT - width of filmstrip frames (in pixels)3624 frame_opacity:<?php echo floatval($settings[‘frame_opacity’]);?>, //FLOAT - transparency of non-active frames (1.0 = opaque, 0.0 = transparent)3625 frame_scale: ‘crop’, //STRING - cropping option for filmstrip images (same as above)3626 frame_gap:<?php echo intval($settings[‘frame_gap’]);?>, //INT - spacing between frames within filmstrip (in pixels)3627 show_infobar:<?php echo (intval($settings[‘show_infobar’])==1)?’true’:’false’ ;?>, //BOOLEAN - flag to show or hide infobar3628 infobar_opacity:<?php echo floatval($settings[‘infobar_opacity’]);?>, //FLOAT - transparency for info bar3629 link_newwindow: true,3630 filmstrip_size:10,3631 clickable:false3632 });36333634 }); 36353636363736383639 //3640 // Resize the image gallery3641 //36423643 var oldsize_w<?php echo $galRandNo;?>=<?php echo intval($settings[‘panel_width’]);?>;3644 var oldsize_h<?php echo $galRandNo;?>=<?php echo intval($settings[‘panel_height’]);?>;36453646 function resizegallery<?php echo $galRandNo;?>(){3647 if(galleryItems<?php echo $galRandNo;?>==undefined){return;}3648 galleryItems<?php echo $galRandNo;?>.each(function (index, item){3649 var $parent = item.parent_data;36503651 // width based on parent?3652 <?php if((esc_html($settings[‘filmstrip_position’])==’left’ or esc_html($settings[‘filmstrip_position’])==’right’) and intval($settings[‘show_filmstrip’])==1):?>3653 var width = ($parent.innerWidth());//2 times 5 pixels margin 3654 <?php else:?>3655 var width = ($parent.innerWidth()-10);//2 times 5 pixels margin3656 <?php endif;?> 365736583659 var height = ($parent.innerHeight()-10);//2 times 5 pixels margin3660 if(oldsize_w<?php echo $galRandNo;?>==width){36613662 // return;3663 }3664 oldsize_w<?php echo $galRandNo;?>=width;36653666 thumbfactor = width/(<?php echo intval($settings[‘panel_width’]);?>-10);36673668 var resizeToHeight=width/3*2;3669 if(resizeToHeight><?php echo intval($settings[‘panel_height’]);?>){3670 resizeToHeight=<?php echo intval($settings[‘panel_height’]);?>; 3671 }3672367336743675 jQuery(item).resizeGalleryView_video(3676 <?php if((esc_html($settings[‘filmstrip_position’])==’left’ or esc_html($settings[‘filmstrip_position’])==’right’) and intval($settings[‘show_filmstrip’])==1):?>width-(<?php echo intval($settings[‘frame_width’]);?>*thumbfactor)-10,<?php else:?> width,<?php endif;?>3677 resizeToHeight, <?php echo intval($settings[‘frame_width’]);?>*thumbfactor, <?php echo intval($settings[‘frame_height’]);?>*thumbfactor);36783679 });3680 }36813682 var inited<?php echo $galRandNo;?>=false;36833684 function onresize<?php echo $galRandNo;?>(){ 3685 resizegallery<?php echo $galRandNo;?>();3686 inited<?php echo $galRandNo;?>=true;3687 }368836893690 jQuery(window).resize(onresize<?php echo $galRandNo;?>);3691 jQuery( document ).ready(function() {3692 onresize<?php echo $galRandNo;?>();3693 }); 36943695 }); 369636973698 } 3699 }, 100);370037013702 </script><!-- end vgwt_print_responsive_video_slider_with_thumbnail_func --><?php3703 $output = ob_get_clean();3704 return $output;3705}3706 37073708function vgwt_e_gallery_get_wp_version() {3709 global $wp_version;3710 return $wp_version;3711}37123713// also we will add an option function that will check for plugin admin page or not3714function vgwt_responsive_gallery__is_plugin_page() {3715 $server_uri = "http://{$_SERVER[‘HTTP_HOST’]}{$_SERVER[‘REQUEST_URI’]}";3716 3717 foreach ( array ('responsive_video_slider_with_thumbnail_media_management’,’responsive_video_slider_with_thumbnail’3718 ) as $allowURI ) {3719 if (stristr ( $server_uri, $allowURI ))3720 return true;3721 }3722 return false;3723}37243725// add media WP scripts3726function vgwt_responsive_gallery__admin_scripts_init() {3727 3728 if (vgwt_responsive_gallery__is_plugin_page ()) {3729 // double check for WordPress version and function exists3730 if (function_exists ( ‘wp_enqueue_media’ ) && version_compare ( vgwt_e_gallery_get_wp_version (), '3.5’, ‘>=’ )) {3731 // call for new media manager3732 wp_enqueue_media ();3733 }3734 wp_enqueue_style ( ‘media’ );3735 wp_enqueue_style( ‘wp-color-picker’ );3736 wp_enqueue_script( ‘wp-color-picker’ );3737 3738 }3739}37403741 function vgwt_remove_extra_p_tags($content){37423743 if(strpos($content, ‘vgwt_print_responsive_video_slider_with_thumbnail_func’)!==false){3744 3745 3746 $pattern = "/<!-- vgwt_print_responsive_video_slider_with_thumbnail_func -->(.*)<!-- end vgwt_print_responsive_video_slider_with_thumbnail_func -->/Uis"; 3747 $content = preg_replace_callback($pattern, function($matches) {374837493750 $altered = str_replace("<p>","",$matches[1]);3751 $altered = str_replace("</p>","",$altered);3752 3753 $altered=str_replace("&","&",$altered);3754 $altered=str_replace("”",’"’,$altered);3755 37563757 return @str_replace($matches[1], $altered, $matches[0]);3758 }, $content);37593760 3761 3762 }3763 3764 $content = str_replace("<p><!-- vgwt_print_responsive_video_slider_with_thumbnail_func -->","<!-- vgwt_print_responsive_video_slider_with_thumbnail_func -->",$content);3765 $content = str_replace("<!-- end vgwt_print_responsive_video_slider_with_thumbnail_func --></p>","<!-- end vgwt_print_responsive_video_slider_with_thumbnail_func -->",$content);3766 3767 3768 return $content;3769 }37703771 add_filter('widget_text_content’, 'vgwt_remove_extra_p_tags’, 999);3772 add_filter('the_content’, 'vgwt_remove_extra_p_tags’, 999);3773?>