Security
Headlines
HeadlinesLatestCVEs

Headline

CVE-2023-2710: wp-responsive-video-gallery-with-lightbox.php in wp-responsive-video-gallery-with-lightbox/tags/1.0.22 – WordPress Plugin Repository

The video carousel slider with lightbox plugin for WordPress is vulnerable to Reflected Cross-Site Scripting via the search_term parameter in versions up to, and including, 1.0.22 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.

CVE
#sql#xss#web#android#google#js#java#wordpress#php#auth#firefox

1<?php2/*3 * Plugin Name: video carousel slider with lightbox4 * Plugin URI:https://www.i13websolution.com/product/wordpress-responsive-video-gallery-with-lightbox-pro/ 5 * Author URI:https://www.i13websolution.com/6 * Description:This is beautiful responsive carousel slider with responsive lightbox.Add any number of video from admin panel. 7 * Author:I Thirteen Web Solution 8 * Version:1.0.229 * Text Domain:wp-responsive-video-gallery-with-lightbox10 * Domain Path: /languages11 */12//error_reporting ( 0 );13add_filter ( 'widget_text’, ‘do_shortcode’ );14add_action ( 'admin_menu’, ‘responsive_video_gallery_plus_lightbox_add_admin_menu’ );15//add_action ( ‘admin_init’, ‘responsive_video_gallery_plus_lightbox_add_admin_init’ );16register_activation_hook ( __FILE__, ‘install_responsive_video_gallery_plus_lightbox’ );17register_deactivation_hook(__FILE__,’rvg_responsive_video_gallery_remove_access_capabilities’);18add_action ( ‘wp_enqueue_scripts’, ‘responsive_video_gallery_plus_lightbox_load_styles_and_js’ );19add_shortcode ( ‘print_responsive_video_gallery_plus_lightbox’, ‘print_responsive_video_gallery_plus_lightbox_func’ );20add_action ( ‘admin_notices’, ‘responsive_video_gallery_plus_lightbox_admin_notices’ );2122add_action( ‘wp_ajax_check_file_exist’, ‘check_file_exist_callback’ );23add_action( ‘wp_ajax_get_youtube_info’, ‘get_youtube_info_callback’ );24add_action(‘plugins_loaded’, ‘wrvgwl_load_lang_for_responsive_video_gallery_plus_lightbox’);25add_filter( ‘user_has_cap’, ‘rvg_responsive_video_gallery_admin_cap_list’ , 10, 4 );2627function wrvgwl_load_lang_for_responsive_video_gallery_plus_lightbox() {28 29 load_plugin_textdomain( ‘wp-responsive-video-gallery-with-lightbox’, false, basename( dirname( __FILE__ ) ) . ‘/languages/’ );30 add_filter( ‘map_meta_cap’, ‘map_rvg_responsive_video_gallery_meta_caps’, 10, 4 );31 }3233 34function map_rvg_responsive_video_gallery_meta_caps( array $caps, $cap, $user_id, array $args ) {35 36 37 if ( ! in_array( $cap, array(38 ‘rvg_responsive_video_gallery_settings’,39 ‘rvg_responsive_video_gallery_view_video’,40 ‘rvg_responsive_video_gallery_add_video’,41 ‘rvg_responsive_video_gallery_edit_video’,42 ‘rvg_responsive_video_gallery_delete_video’,43 ‘rvg_responsive_video_gallery_preview’,44 45 ), true ) ) {46 47 return $caps;48 }4950 51 52 53 $caps = array();5455 switch ( $cap ) {56 57 case ‘rvg_responsive_video_gallery_settings’:58 $caps[] = ‘rvg_responsive_video_gallery_settings’;59 break;60 61 case ‘rvg_responsive_video_gallery_view_video’:62 $caps[] = ‘rvg_responsive_video_gallery_view_video’;63 break;64 65 case ‘rvg_responsive_video_gallery_add_video’:66 $caps[] = ‘rvg_responsive_video_gallery_add_video’;67 break;68 69 case ‘rvg_responsive_video_gallery_edit_video’:70 $caps[] = ‘rvg_responsive_video_gallery_edit_video’;71 break;72 73 case ‘rvg_responsive_video_gallery_delete_video’:74 $caps[] = ‘rvg_responsive_video_gallery_delete_video’;75 break;76 77 case ‘rvg_responsive_video_gallery_preview’:78 $caps[] = ‘rvg_responsive_video_gallery_preview’;79 break;80 81 82 default:83 84 $caps[] = ‘do_not_allow’;85 break;86 }8788 89 return apply_filters( ‘rvg_responsive_video_gallery_meta_caps’, $caps, $cap, $user_id, $args );90}919293 function rvg_responsive_video_gallery_admin_cap_list($allcaps, $caps, $args, $user){94 95 96 if ( ! in_array( ‘administrator’, $user->roles ) ) {97 98 return $allcaps;99 }100 else{101 102 if(!isset($allcaps[‘rvg_responsive_video_gallery_settings’])){103 104 $allcaps[‘rvg_responsive_video_gallery_settings’]=true;105 }106 107 if(!isset($allcaps[‘rvg_responsive_video_gallery_view_video’])){108 109 $allcaps[‘rvg_responsive_video_gallery_view_video’]=true;110 }111 112 if(!isset($allcaps[‘rvg_responsive_video_gallery_add_video’])){113 114 $allcaps[‘rvg_responsive_video_gallery_add_video’]=true;115 }116 if(!isset($allcaps[‘rvg_responsive_video_gallery_edit_video’])){117 118 $allcaps[‘rvg_responsive_video_gallery_edit_video’]=true;119 }120 if(!isset($allcaps[‘rvg_responsive_video_gallery_delete_video’])){121 122 $allcaps[‘rvg_responsive_video_gallery_delete_video’]=true;123 }124 if(!isset($allcaps[‘rvg_responsive_video_gallery_preview’])){125 126 $allcaps[‘rvg_responsive_video_gallery_preview’]=true;127 }128 129 }130 131 return $allcaps;132 133 }134135function rvg_responsive_video_gallery_add_access_capabilities() {136 137 // Capabilities for all roles.138 $roles = array( ‘administrator’ );139 foreach ( $roles as $role ) {140 141 $role = get_role( $role );142 if ( empty( $role ) ) {143 continue;144 }145 146 147 if(!$role->has_cap( ‘rvg_responsive_video_gallery_settings’ ) ){148 149 $role->add_cap( ‘rvg_responsive_video_gallery_settings’ );150 }151 152 if(!$role->has_cap( ‘rvg_responsive_video_gallery_view_video’ ) ){153 154 $role->add_cap( ‘rvg_responsive_video_gallery_view_video’ );155 }156 157 158 if(!$role->has_cap( ‘rvg_responsive_video_gallery_add_video’ ) ){159 160 $role->add_cap( ‘rvg_responsive_video_gallery_add_video’ );161 }162 163 if(!$role->has_cap( ‘rvg_responsive_video_gallery_edit_video’ ) ){164 165 $role->add_cap( ‘rvg_responsive_video_gallery_edit_video’ );166 }167 168 if(!$role->has_cap( ‘rvg_responsive_video_gallery_delete_video’ ) ){169 170 $role->add_cap( ‘rvg_responsive_video_gallery_delete_video’ );171 }172 173 if(!$role->has_cap( ‘rvg_responsive_video_gallery_preview’ ) ){174 175 $role->add_cap( ‘rvg_responsive_video_gallery_preview’ );176 }177 178 179 }180 181 $user = wp_get_current_user();182 $user->get_role_caps();183 184}185186function rvg_responsive_video_gallery_remove_access_capabilities(){187 188 global $wp_roles;189190 if ( ! isset( $wp_roles ) ) {191 $wp_roles = new WP_Roles();192 }193194 foreach ( $wp_roles->roles as $role => $details ) {195 $role = $wp_roles->get_role( $role );196 if ( empty( $role ) ) {197 continue;198 }199200 $role->remove_cap( ‘rvg_responsive_video_gallery_settings’ );201 $role->remove_cap( ‘rvg_responsive_video_gallery_view_video’ );202 $role->remove_cap( ‘rvg_responsive_video_gallery_add_video’ );203 $role->remove_cap( ‘rvg_responsive_video_gallery_edit_video’ );204 $role->remove_cap( ‘rvg_responsive_video_gallery_delete_video’ );205 $role->remove_cap( ‘rvg_responsive_video_gallery_preview’ );206 207208 }209210 // Refresh current set of capabilities of the user, to be able to directly use the new caps.211 $user = wp_get_current_user();212 $user->get_role_caps();213 214}215216function vgallery_save_image_curl($url,$saveto){217 218 $raw = wp_remote_retrieve_body( wp_remote_get( $url ) );219 220 if(file_exists($saveto)){221 @unlink($saveto);222 }223 $fp = @fopen($saveto,’x’);224 @fwrite($fp, $raw);225 @fclose($fp);226 227}228229function get_youtube_info_callback(){230 231 if(isset($_POST) and is_array($_POST) and isset($_POST[‘url’])){232 233 234 $retrieved_nonce = ‘’;235236 if (isset($_POST[‘vNonce’]) and $_POST[‘vNonce’] != ‘’) {237238 $retrieved_nonce = $_POST[‘vNonce’];239 }240 if (!wp_verify_nonce($retrieved_nonce, ‘vNonce’)) {241242243 wp_die(‘Security check fail’);244 }245246 $vid=htmlentities(strip_tags($_POST[‘vid’]),ENT_QUOTES);247 $url=esc_url_raw($_POST[‘url’]); 248 $output= wp_remote_retrieve_body( wp_remote_get( $url ) ); 249250 $output=json_decode($output);251 252 253 $videoInfo= file_get_contents(“https://www.youtube.com/watch?v=$vid”);254255 $doc = new DomDocument;256257 $doc->validateOnParse = false;258 259 @$doc->loadHTML($videoInfo);260261 $node= $doc->getElementById(‘watch-description-text’);262 263 $description=’’;264 if($node!=null and $node!=false){265 266 $description = $node->ownerDocument->saveHTML( $node );267268 $description= strip_tags($description,’<br>’);269 270 $breaks = array(“<br />","<br>","<br/>”); 271 $description = str_ireplace($breaks, “\r\n", $description); 272 }273 274 $return=array();275 if(is_object($output)){276 277 $return[‘title’]=$output->title;278 $return[‘thumbnail_url’]=$output->thumbnail_url;279 $return[‘description’]=$description;280 281 }282 283 echo json_encode($return);284 exit;285 286 }287 288}289290function check_file_exist_callback() {291 292 if(isset($_POST) and is_array($_POST) and isset($_POST[‘url’])){293294 $retrieved_nonce = ‘’;295296 if (isset($_POST[‘vNonce’]) and $_POST[‘vNonce’] != ‘’) {297298 $retrieved_nonce = $_POST[‘vNonce’];299 }300 if (!wp_verify_nonce($retrieved_nonce, ‘vNonce’)) {301302303 wp_die(‘Security check fail’);304 }305306 $response = wp_remote_get(sanitize_text_field($_POST[‘url’]));307 $httpCode = wp_remote_retrieve_response_code( $response );308 309 echo trim((string)$httpCode);die;310 311 312 }313 //echo die;314 315}316317318function responsive_video_gallery_plus_lightbox_admin_notices() {319 if (is_plugin_active ( ‘wp-responsive-video-gallery-with-lightbox/wp-responsive-video-gallery-with-lightbox.php’ )) {320 321 $uploads = wp_upload_dir ();322 $baseDir = $uploads [‘basedir’];323 $baseDir = str_replace ( "\\", "/", $baseDir );324 $pathToImagesFolder = $baseDir . ‘/wp-responsive-video-gallery-with-lightbox’;325 326 if (file_exists ( $pathToImagesFolder ) and is_dir ( $pathToImagesFolder )) {327 328 if (! is_writable ( $pathToImagesFolder )) {329 330 echo “<div class=’updated’><p>".__( ‘Video Carousel Slider is active but does not have write permission on’,’wp-responsive-video-gallery-with-lightbox’)."</p><p><b>” . $pathToImagesFolder . "</b>".__( ' directory.Please allow write permission.’,’wp-responsive-video-gallery-with-lightbox’)."</p></div> ";331 332 }333 } else {334 335 wp_mkdir_p ( $pathToImagesFolder );336 if (! file_exists ( $pathToImagesFolder ) and ! is_dir ( $pathToImagesFolder )) {337 338 echo “<div class=’updated’><p>".__( ‘Video Carousel Slider is active but plugin does not have permission to create directory’,’wp-responsive-video-gallery-with-lightbox’)."</p><p><b>” . $pathToImagesFolder . "</b>".__( ' Please create wp-responsive-video-gallery-with-lightbox directory inside upload directory and allow write permission.’,’wp-responsive-video-gallery-with-lightbox’)."</p></div> “;339 340 }341 }342 }343}344function responsive_video_gallery_plus_lightbox_load_styles_and_js() {345 if (! is_admin ()) {346 347 wp_register_style ( 'wp-video-gallery-lighbox-style’, plugins_url ( ‘/css/wp-video-gallery-lighbox-style.css’, __FILE__ ),array(),’1.0.20’ );348 wp_register_style ( 'vl-box-css’, plugins_url ( '/css/vl-box-css.css’, __FILE__ ) );349 wp_register_script ( 'video-gallery-jc’, plugins_url ( ‘/js/video-gallery-jc.js’, __FILE__ ),array(‘jquery’),’1.0.20’ );350 wp_register_script ( 'vl-box-js’, plugins_url ( ‘/js/vl-box-js.js’, __FILE__ ),array(‘jquery’),’1.0.19’ );351 }352}353function install_responsive_video_gallery_plus_lightbox() {354 global $wpdb;355 $table_name = $wpdb->prefix . “responsive_video_gallery_plus_responsive_lightbox";356 $charset_collate = $wpdb->get_charset_collate();357 358 $sql = “CREATE TABLE " . $table_name . " (359 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,360 `vtype` varchar(50) NOT NULL,361 `vid` varchar(500) NOT NULL,362 `video_url` varchar(1000) DEFAULT NULL,363 `embed_url` varchar(300) NOT NULL,364 `HdnMediaSelection` varchar(500) NOT NULL,365 `image_name` varchar(500) NOT NULL,366 `videotitle` varchar(1000) NOT NULL,367 `videotitleurl` varchar(1000) DEFAULT NULL,368 `video_description` text DEFAULT NULL,369 `video_order` int(11) NOT NULL DEFAULT '0’,370 `open_link_in` tinyint(1) NOT NULL DEFAULT '1’,371 `enable_light_box_video_desc` tinyint(1) NOT NULL DEFAULT '1’,372 `createdon` datetime NOT NULL,373 `slider_id` int(10) unsigned NOT NULL DEFAULT '1’,374 PRIMARY KEY (`id`)375 ) $charset_collate;";376 377 $responsive_video_gallery_slider_settings=array(378 ‘pauseonmouseover’ => '1’,379 ‘auto’ =>’’,380 ‘speed’ => '1000’,381 'pause’=>1000,382 ‘circular’ => '1’,383 ‘imageheight’ => '120’,384 ‘imagewidth’ => '120’,385 'imageMargin’=>’15’,386 'visible’=> '3’,387 'min_visible’=> '1’,388 ‘scroll’ => '1’,389 'resizeImages’=>’1’,390 'scollerBackground’=>’#FFFFFF’,391 'show_caption’=>’0’,392 'show_pager’=>’0’393 394 );395 396 397 398 $existingopt=get_option(‘responsive_video_gallery_slider_settings’);399 if(!is_array($existingopt)){400401 update_option('responsive_video_gallery_slider_settings’,$responsive_video_gallery_slider_settings);402403 }404 else{405406 $flag=false;407 if(!isset($existingopt[‘show_caption’])){408409 $flag=true; 410 $existingopt[‘show_caption’]=’0’; 411412 }413 if(!isset($existingopt[‘show_pager’])){414415 $flag=true; 416 $existingopt[‘show_pager’]=’0’; 417418 }419420 if($flag==true){421422 update_option('responsive_video_gallery_slider_settings’, $existingopt); 423424 }425 }426 427 428 429 require_once (ABSPATH . ‘wp-admin/includes/upgrade.php’);430 dbDelta ( $sql );431 432 $uploads = wp_upload_dir ();433 $baseDir = $uploads [‘basedir’];434 $baseDir = str_replace ( “\\", “/", $baseDir );435 $pathToImagesFolder = $baseDir . '/wp-responsive-video-gallery-with-lightbox’;436 wp_mkdir_p ( $pathToImagesFolder );437 rvg_responsive_video_gallery_add_access_capabilities();438 439 440}441function responsive_video_gallery_plus_lightbox_add_admin_menu() {442 $hook_suffix=add_menu_page ( __ ( ‘Responsive Video Carousel’,’wp-responsive-video-gallery-with-lightbox’ ), __ ( ‘Video Carousel with Lightbox’,’wp-responsive-video-gallery-with-lightbox’ ), 'rvg_responsive_video_gallery_settings’, 'responsive_video_gallery_with_lightbox’, ‘responsive_video_gallery_with_lightbox_admin_options_func’ );443 $hook_suffix=add_submenu_page ( 'responsive_video_gallery_with_lightbox’, __ ( ‘Carousel Settings’,’wp-responsive-video-gallery-with-lightbox’ ), __ ( 'Carousel Settings’, ‘wp-responsive-video-gallery-with-lightbox’), 'rvg_responsive_video_gallery_settings’, 'responsive_video_gallery_with_lightbox’, ‘responsive_video_gallery_with_lightbox_admin_options_func’ );444 $hook_suffix_image=add_submenu_page ( 'responsive_video_gallery_with_lightbox’, __ ( ‘Manage Videos’,’wp-responsive-video-gallery-with-lightbox’ ), __ ( ‘Manage Videos’,’wp-responsive-video-gallery-with-lightbox’ ), 'rvg_responsive_video_gallery_view_video’, 'responsive_video_gallery_with_lightbox_video_management’, ‘responsive_video_gallery_with_lightbox_video_management_func’ );445 $hook_suffix_prev=add_submenu_page ( 'responsive_video_gallery_with_lightbox’, __ ( ‘Preview Carousel’,’wp-responsive-video-gallery-with-lightbox’ ), __ ( ‘Preview Gallery’,’wp-responsive-video-gallery-with-lightbox’ ), 'rvg_responsive_video_gallery_preview’, 'responsive_video_gallery_with_lightbox_video_preview’, ‘responsive_video_gallery_with_lightbox_video_preview_func’ );446 447 add_action( 'load-' . $hook_suffix , ‘responsive_video_gallery_plus_lightbox_add_admin_init’ );448 add_action( 'load-' . $hook_suffix_image , ‘responsive_video_gallery_plus_lightbox_add_admin_init’ );449 add_action( 'load-' . $hook_suffix_prev , ‘responsive_video_gallery_plus_lightbox_add_admin_init’ );450 451}452function responsive_video_gallery_plus_lightbox_add_admin_init() {453 $url = plugin_dir_url ( __FILE__ );454 455 wp_enqueue_style ( 'wp-video-gallery-lighbox-style’, plugins_url ( '/css/wp-video-gallery-lighbox-style.css’, __FILE__ ) );456 wp_enqueue_style ( 'vl-box-css’, plugins_url ( '/css/vl-box-css.css’, __FILE__ ) );457 wp_enqueue_style( 'admin-css-resp-video-gallery’, plugins_url('/css/admin-css.css’, __FILE__) );458 wp_enqueue_script ( ‘jquery’ );459 wp_enqueue_script ( 'jquery.validate’, $url . ‘js/jquery.validate.js’ );460 wp_enqueue_script ( 'video-gallery-jc’, plugins_url ( '/js/video-gallery-jc.js’, __FILE__ ) );461 wp_enqueue_script ( 'vl-box-js’, plugins_url ( ‘/js/vl-box-js.js’, __FILE__ ) );462 463 responsive_video_gallery_plus_lightbox_admin_scripts_init ();464}465466467 function responsive_video_gallery_with_lightbox_admin_options_func(){468 469 if ( ! current_user_can( ‘rvg_responsive_video_gallery_settings’ ) ) {470471 wp_die( __( "Access Denied", “wp-responsive-video-gallery-with-lightbox” ) );472473 } 474 475 if(isset($_POST[‘btnsave’])){476 477 if (!check_admin_referer(‘action_image_add_edit’, ‘add_edit_image_nonce’)) {478479 wp_die(‘Security check fail’,’wp-responsive-video-gallery-with-lightbox’);480 }481482483 $auto=trim(htmlentities(sanitize_text_field($_POST[‘isauto’]),ENT_QUOTES));484 485 if($auto==’auto’)486 $auto=true;487 else if($auto==’manuall’)488 $auto=false; 489 else490 $auto=2; 491 492 $speed=(int)trim(htmlentities(sanitize_text_field($_POST[‘speed’]),ENT_QUOTES));493 $pause=(int)trim(htmlentities(sanitize_text_field($_POST[‘pause’]),ENT_QUOTES));494 495 if(isset($_POST[‘circular’]))496 $circular=true; 497 else498 $circular=false; 499500 //$scrollerwidth=$_POST[‘scrollerwidth’];501 502 $visible=intval(htmlentities(sanitize_text_field($_POST[‘visible’]),ENT_QUOTES));503 504 $min_visible=intval(htmlentities(sanitize_text_field($_POST[‘min_visible’]),ENT_QUOTES));505506 $show_caption=intval(htmlentities(sanitize_text_field($_POST[‘show_caption’],ENT_QUOTES))); 507508 $show_pager=intval(htmlentities(sanitize_text_field($_POST[‘show_pager’],ENT_QUOTES))); 509510 511 if(isset($_POST[‘pauseonmouseover’]))512 $pauseonmouseover=true; 513 else 514 $pauseonmouseover=false;515 516 if(isset($_POST[‘linkimage’]))517 $linkimage=true; 518 else 519 $linkimage=false;520 521 $scroll=intval(htmlentities(sanitize_text_field($_POST[‘scroll’]),ENT_QUOTES));522 523 if($scroll=="”)524 $scroll=1;525 526 $imageMargin=(int) trim(htmlentities(sanitize_text_field($_POST[‘imageMargin’]),ENT_QUOTES));527 $imageheight=(int) trim(htmlentities(sanitize_text_field($_POST[‘imageheight’]),ENT_QUOTES));528 $imagewidth=(int) trim(htmlentities(sanitize_text_field($_POST[‘imagewidth’]),ENT_QUOTES));529 530 $scollerBackground=trim(htmlentities(sanitize_text_field($_POST[‘scollerBackground’]),ENT_QUOTES));531 532 $options=array();533 $options[‘pauseonmouseover’]=$pauseonmouseover; 534 $options[‘auto’]=$auto; 535 $options[‘speed’]=$speed; 536 $options[‘pause’]=$pause; 537 $options[‘circular’]=$circular; 538 //$options[‘scrollerwidth’]=$scrollerwidth; 539 $options[‘imageMargin’]=$imageMargin; 540 $options[‘imageheight’]=$imageheight; 541 $options[‘imagewidth’]=$imagewidth; 542 $options[‘visible’]=$visible; 543 $options[‘min_visible’]=$min_visible; 544 $options[‘scroll’]=$scroll; 545 $options[‘resizeImages’]=1; 546 $options[‘scollerBackground’]=$scollerBackground; 547 $options[‘show_caption’]=$show_caption; 548 $options[‘show_pager’]=$show_pager; 549 550 551 $settings=update_option('responsive_video_gallery_slider_settings’,$options); 552 $responsive_video_gallery_plus_lightbox_messages=array();553 $responsive_video_gallery_plus_lightbox_messages[‘type’]=’succ’;554 $responsive_video_gallery_plus_lightbox_messages[‘message’]=__(‘Settings saved successfully.’,’wp-responsive-video-gallery-with-lightbox’);555 update_option('responsive_video_gallery_plus_lightbox_messages’, $responsive_video_gallery_plus_lightbox_messages);556557 558 559 } 560 $settings=get_option(‘responsive_video_gallery_slider_settings’);561 562?> 563<div id="poststuff” > 564 <div id="post-body” class="metabox-holder columns-2” > 565 <div id="post-body-content">566 <div class="wrap">567 <table><tr>568 <td>569 <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>570 <div id="fb-root"></div>571 <script>(function(d, s, id) {572 var js, fjs = d.getElementsByTagName(s)[0];573 if (d.getElementById(id)) return;574 js = d.createElement(s); js.id = id;575 js.src = ‘https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.2&appId=158817690866061&autoLogAppEvents=1’;576 fjs.parentNode.insertBefore(js, fjs);577 }(document, ‘script’, ‘facebook-jssdk’));</script>578 </td>579 <td>580 <a target="_blank" title="Donate" href="http://www.i13websolution.com/donate-wordpress_image_thumbnail.php">581 <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">582 </a>583 </td>584 </tr>585 </table>586 <span><h3 style="color: blue;"><a target="_blank" href="https://www.i13websolution.com/product/wordpress-responsive-video-gallery-with-lightbox-pro/"><?php echo __(‘UPGRADE TO PRO VERSION’,’wp-responsive-video-gallery-with-lightbox’);?></a></h3></span>587 <?php588 $messages=get_option(‘responsive_video_gallery_plus_lightbox_messages’); 589 $type=’’;590 $message=’’;591 if(isset($messages[‘type’]) and $messages[‘type’]!=""){592593 $type=$messages[‘type’];594 $message=$messages[‘message’];595596 } 597598599 if(trim($type)==’err’){ echo "<div class=’notice notice-error is-dismissible’><p>"; echo $message; echo "</p></div>";}600 else if(trim($type)==’succ’){ echo “<div class=’notice notice-success is-dismissible’><p>"; echo $message; echo “</p></div>";}601 602 update_option('responsive_video_gallery_plus_lightbox_messages’, array()); 603 ?> 604 605 <h2><?php echo __(‘Gallery Slider Settings’,’wp-responsive-video-gallery-with-lightbox’);?></h2>606 <div id="poststuff">607 <div id="post-body” class="metabox-holder columns-2">608 <div id="post-body-content">609 <form method="post” action="" id="scrollersettiings" name="scrollersettiings" >610611 612 <div class="stuffbox" id="namediv" style="width:100%;">613 <h3><label><?php echo __(‘Auto Scroll ?’,’wp-responsive-video-gallery-with-lightbox’);?></label></h3>614 <div class="inside">615 <table>616 <tr>617 <td>618 <?php $settings[‘auto’]=(int)$settings[‘auto’];?>619 <input style="width:20px;" type=’radio’ <?php if($settings[‘auto’]==1){echo "checked=’checked’";}?> name=’isauto’ value=’auto’ ><?php echo __(‘Auto’,’wp-responsive-video-gallery-with-lightbox’);?>  <input style="width:20px;" type=’radio’ name=’isauto’ <?php if($settings[‘auto’]==0){echo "checked=’checked’";} ?> value=’manuall’ ><?php echo __(‘Scroll By Left & Right Arrow’,’wp-responsive-video-gallery-with-lightbox’);?>    <input style="width:20px;" type=’radio’ name=’isauto’ <?php if($settings[‘auto’]==2){echo "checked=’checked’";} ?> value=’both’ ><?php echo __(‘Scroll Auto With Arrow’,’wp-responsive-video-gallery-with-lightbox’);?>620 <div style="clear:both"></div>621 <div></div>622 </td>623 </tr>624 </table>625 <div style="clear:both"></div>626 </div>627 </div>628 <div class="stuffbox" id="namediv" style="width:100%;">629 <h3><label ><?php echo __(‘Speed’,’wp-responsive-video-gallery-with-lightbox’);?></label></h3>630 <div class="inside">631 <table>632 <tr>633 <td>634 <input type="text" id="speed" size="30" name="speed" value="<?php echo $settings[‘speed’]; ?>" style="width:100px;">635 <div style="clear:both"></div>636 <div></div>637 </td>638 </tr>639 </table>640 <div style="clear:both"></div>641642 </div>643 </div>644 <div class="stuffbox" id="namediv" style="width:100%;">645 <h3><label ><?php echo __(‘Pause’,’wp-responsive-video-gallery-with-lightbox’);?></label></h3>646 <div class="inside">647 <table>648 <tr>649 <td>650 <input type="text" id="pause" size="30" name="pause" value="<?php echo $settings[‘pause’]; ?>" style="width:100px;">651 <div style="clear:both"></div>652 <div></div>653 </td>654 </tr>655 </table>656 <div style="clear:both"><?php echo __(‘The amount of time (in ms) between each auto transition’,’wp-responsive-video-gallery-with-lightbox’);?></div>657658 </div>659 </div>660 <div class="stuffbox" id="namediv" style="width:100%;">661 <h3><label ><?php echo __(‘Circular Slider ?’,’wp-responsive-video-gallery-with-lightbox’);?></label></h3>662 <div class="inside">663 <table>664 <tr>665 <td>666 <input type="checkbox" id="circular" size="30" name="circular" value="" <?php if($settings[‘circular’]==true){echo “checked=’checked’";} ?> style="width:20px;"> <?php echo __(‘Circular Slider ?’,’wp-responsive-video-gallery-with-lightbox’);?>667 <div style="clear:both"></div>668 <div></div>669 </td>670 </tr>671 </table>672 <div style="clear:both"></div>673674 </div>675 </div>676 <div class="stuffbox” id="namediv" style="width:100%;">677 <h3><label><?php echo __(‘Slider Background color’,’wp-responsive-video-gallery-with-lightbox’);?></label></h3>678 <div class="inside">679 <table>680 <tr>681 <td>682 <input type="text" id="scollerBackground" size="30" name="scollerBackground" value="<?php echo $settings[‘scollerBackground’]; ?>" style="width:100px;">683 <div style="clear:both"></div>684 <div></div>685 </td>686 </tr>687 </table>688689 <div style="clear:both"></div>690 </div>691 </div>692 <div class="stuffbox" id="namediv" style="width:100%;">693 <h3><label><?php echo __(‘Max Visible’,’wp-responsive-video-gallery-with-lightbox’);?></label></h3>694 <div class="inside">695 <table>696 <tr>697 <td>698 <input type="text" id="visible" size="30" name="visible" value="<?php echo $settings[‘visible’]; ?>" style="width:100px;">699 <div style="clear:both"><?php echo __(‘This will decide your slider width automatically’,’wp-responsive-video-gallery-with-lightbox’);?></div>700 <div></div>701 </td>702 </tr>703 </table>704 <?php echo __(‘Specify the number of items visible at all times within the slider.’,’wp-responsive-video-gallery-with-lightbox’);?>705 <div style="clear:both"></div>706707 </div>708 </div>709 <div class="stuffbox" id="namediv" style="width:100%;">710 <h3><label><?php echo __(‘Min Visible’,’wp-responsive-video-gallery-with-lightbox’);?></label></h3>711 <div class="inside">712 <table>713 <tr>714 <td>715 <input type="text" id="min_visible" size="30" name="min_visible" value="<?php echo $settings[‘min_visible’]; ?>" style="width:100px;">716 <div style="clear:both"><?php echo __(‘This will decide your slider width in responsive layout’,’wp-responsive-video-gallery-with-lightbox’);?></div>717 <div></div>718 </td>719 </tr>720 </table>721 <?php echo __(‘The responsive layout decide by slider itself using min visible.’,’wp-responsive-video-gallery-with-lightbox’);?>722 <div style="clear:both"></div>723 724 </div>725 </div>726 <div class="stuffbox" id="namediv" style="width:100%;">727 <h3><label><?php echo __(‘Scroll’,’wp-responsive-video-gallery-with-lightbox’);?></label></h3>728 <div class="inside">729 <table>730 <tr>731 <td>732 <input type="text" id="scroll" size="30" name="scroll" value="<?php echo $settings[‘scroll’]; ?>" style="width:100px;">733 <div style="clear:both"></div>734 <div></div>735 </td>736 </tr>737 </table>738 <?php echo __(‘You can specify the number of items to scroll when you click the next or prev buttons.’,’wp-responsive-video-gallery-with-lightbox’);?>739 <div style="clear:both"></div>740 </div>741 </div>742 <div class="stuffbox" id="namediv" style="width:100%;">743 <h3><label><?php echo __(‘Pause On Mouse Over ?’,’wp-responsive-video-gallery-with-lightbox’);?></label></h3>744 <div class="inside">745 <table>746 <tr>747 <td>748 <input type="checkbox" id="pauseonmouseover" size="30" name="pauseonmouseover" value="" <?php if($settings[‘pauseonmouseover’]==true){echo “checked=’checked’";} ?> style="width:20px;"> Pause On Mouse Over ? 749 <div style="clear:both"></div>750 <div></div>751 </td>752 </tr>753 </table>754 <div style="clear:both"></div>755 </div>756 </div>757 758 <div class="stuffbox” id="namediv" style="width:100%;">759 <h3><label><?php echo __(‘Image Height’,’wp-responsive-video-gallery-with-lightbox’);?></label></h3>760 <div class="inside">761 <table>762 <tr>763 <td>764 <input type="text" id="imageheight" size="30" name="imageheight" value="<?php echo $settings[‘imageheight’]; ?>" style="width:100px;">765 <div style="clear:both"></div>766 <div></div>767 </td>768 </tr>769 </table>770771 <div style="clear:both"></div>772 </div>773 </div>774 <div class="stuffbox" id="namediv" style="width:100%;">775 <h3><label><?php echo __(‘Image Width’,’wp-responsive-video-gallery-with-lightbox’);?></label></h3>776 <div class="inside">777 <table>778 <tr>779 <td>780 <input type="text" id="imagewidth" size="30" name="imagewidth" value="<?php echo $settings[‘imagewidth’]; ?>" style="width:100px;">781 <div style="clear:both"></div>782 <div></div>783 </td>784 </tr>785 </table>786787 <div style="clear:both"></div>788 </div>789 </div>790 <div class="stuffbox" id="namediv" style="width:100%;">791 <h3><label><?php echo __(‘Image Margin’,’wp-responsive-video-gallery-with-lightbox’);?></label></h3>792 <div class="inside">793 <table>794 <tr>795 <td>796 <input type="text" id="imageMargin" size="30" name="imageMargin" value="<?php echo $settings[‘imageMargin’]; ?>" style="width:100px;">797 <div style="clear:both;padding-top:5px"><?php echo __(‘Gap between two images’,’wp-responsive-video-gallery-with-lightbox’);?> </div>798 <div></div>799 </td>800 </tr>801 </table>802803 <div style="clear:both"></div>804 </div>805 </div>806 <div class="stuffbox" id="namediv" style="width:100%;">807 <h3><label><?php echo __( ‘Show Caption?’,’wp-responsive-video-gallery-with-lightbox’);?></label></h3>808 <div class="inside">809 <table>810 <tr>811 <td>812 <input style="width:20px;" type=’radio’ <?php if($settings[‘show_caption’]==true){echo "checked=’checked’";}?> name=’show_caption’ value=’1’ ><?php echo __( ‘Yes’,’wp-responsive-video-gallery-with-lightbox’);?>  <input style="width:20px;" type=’radio’ name=’show_caption’ <?php if($settings[‘show_caption’]==false){echo "checked=’checked’";} ?> value=’0’ ><?php echo __( ‘No’,’wp-responsive-video-gallery-with-lightbox’);?>813 <div style="clear:both"></div>814 <div></div>815 </td>816 </tr>817 </table>818 <div style="clear:both"></div>819 </div>820 </div>821 <div class="stuffbox" id="namediv" style="width:100%;">822 <h3><label><?php echo __( ‘Show Pager?’,’wp-responsive-video-gallery-with-lightbox’);?></label></h3>823 <div class="inside">824 <table>825 <tr>826 <td>827 <input style="width:20px;" type=’radio’ <?php if($settings[‘show_pager’]==true){echo "checked=’checked’";}?> name=’show_pager’ value=’1’ ><?php echo __( ‘Yes’,’wp-responsive-video-gallery-with-lightbox’);?>  <input style="width:20px;" type=’radio’ name=’show_pager’ <?php if($settings[‘show_pager’]==false){echo "checked=’checked’";} ?> value=’0’ ><?php echo __( ‘No’,’wp-responsive-video-gallery-with-lightbox’);?>828 <div style="clear:both"></div>829 <div></div>830 </td>831 </tr>832 </table>833 <div style="clear:both"></div>834 </div>835 </div>836 <?php wp_nonce_field(‘action_image_add_edit’, ‘add_edit_image_nonce’); ?> 837 <input type="submit" name="btnsave" id="btnsave" value="<?php echo __(‘Sage Changes’,’wp-responsive-video-gallery-with-lightbox’);?>" class="button-primary">  <input type="button" name="cancle" id="cancle" value="<?php echo __(‘Cancel’,’wp-responsive-video-gallery-with-lightbox’);?>" class="button-primary" onclick="location.href=’admin.php?page=responsive_video_gallery_with_lightbox_video_management’">838839 </form> 840 <script type="text/javascript">841842 jQuery(document).ready(function() {843844 jQuery(“#scrollersettiings”).validate({845 rules: {846 isauto: {847 required:true848 },speed: {849 required:true, 850 number:true, 851 maxlength:15852 },pause: {853 required:true, 854 number:true, 855 maxlength:15856 },857 visible:{858 required:true, 859 number:true,860 maxlength:15861862 },863 min_visible:{864 required:true, 865 number:true,866 maxlength:15867868 },869 scroll:{870 required:true,871 number:true,872 maxlength:15 873 },874 scollerBackground:{875 required:true,876 maxlength:7 877 },878 /*scrollerwidth:{879 required:true,880 number:true,881 maxlength:15 882 },*/imageheight:{883 required:true,884 number:true,885 maxlength:15 886 },887 imagewidth:{888 required:true,889 number:true,890 maxlength:15 891 },imageMargin:{892 required:true,893 number:true,894 maxlength:15 895 }896897 },898 errorClass: “image_error",899 errorPlacement: function(error, element) {900 error.appendTo( element.next().next());901 } 902903904 })905 906 jQuery(‘#scollerBackground’).wpColorPicker();907 908 });909910 </script> 911912 </div>913 </div>914 </div> 915 </div> 916 </div>917 <div id="postbox-container-1” class="postbox-container" > 918919 <div class="postbox"> 920 <h3 class="hndle"><span></span><?php echo __(‘Access All Themes In One Price’,’wp-responsive-video-gallery-with-lightbox’);?></h3> 921 <div class="inside">922 <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>923924 <div style="margin:10px 5px">925926 </div>927 </div></div>928 <div class="postbox"> 929 <h3 class="hndle"><span></span><?php echo __(‘Google For Business Coupon’,’wp-responsive-video-gallery-with-lightbox’);?></h3> 930 <div class="inside">931 <center><a href="https://goo.gl/OJBuHT" target="_blank">932 <img src="<?php echo plugins_url( ‘images/g-suite-promo-code-4.png’, __FILE__ );?>" width="250" height="250" border="0">933 </a></center>934 <div style="margin:10px 5px">935 </div>936 </div>937 938 </div>939940 </div> 941 942 <div class="clear"></div>943 </div> 944 </div> 945<?php946 } 947 948function responsive_video_gallery_with_lightbox_video_management_func() {949 950 $action = ‘gridview’;951 global $wpdb;952 953 954 955 if (isset ( $_GET [‘action’] ) and $_GET [‘action’] != ‘’) {956 957 $action = trim ( $_GET [‘action’] );958 }959 ?>960961 <?php962 if (strtolower ( $action ) == strtolower ( ‘gridview’ )) {963 964 965 if ( ! current_user_can( ‘rvg_responsive_video_gallery_view_video’ ) ) {966967 wp_die( __( “Access Denied", “wp-responsive-video-gallery-with-lightbox” ) );968969 }970971 $wpcurrentdir = dirname ( __FILE__ );972 $wpcurrentdir = str_replace ( “\\", “/", $wpcurrentdir );973 974 $uploads = wp_upload_dir ();975 $baseurl = $uploads [‘baseurl’];976 $baseurl .= '/wp-responsive-video-gallery-with-lightbox/’;977 ?> 978 <div class="wrap">979 <?php980 $messages = get_option ( ‘responsive_video_gallery_plus_lightbox_messages’ );981 $type = ‘’;982 $message = ‘’;983 if (isset ( $messages [‘type’] ) and $messages [‘type’] != “”) {984 985 $type = $messages [‘type’];986 $message = $messages [‘message’];987 }988 989 if(trim($type)==’err’){ echo "<div class=’notice notice-error is-dismissible’><p>"; echo $message; echo "</p></div>";}990 else if(trim($type)==’succ’){ echo “<div class=’notice notice-success is-dismissible’><p>"; echo $message; echo “</p></div>";}991 992 993 update_option ( 'responsive_video_gallery_plus_lightbox_messages’, array () );994 ?>995 <div id="poststuff” > 996 <div id="post-body” class="metabox-holder columns-2” > 997 <div id="post-body-content">998 <div class="wrap">999 <span><h3 style="color: blue;"><a target="_blank” href="https://www.i13websolution.com/product/wordpress-responsive-video-gallery-with-lightbox-pro/"><?php echo __(‘UPGRADE TO PRO VERSION’,’wp-responsive-video-gallery-with-lightbox’);?></a></h3></span>1000 <div style="width: 100%;">1001 <div style="float: left; width: 100%;">1002 <div class="icon32 icon32-posts-post” id="icon-edit">1003 <br>1004 </div>1005 <h2>1006 <?php echo __(‘Videos’,’wp-responsive-video-gallery-with-lightbox’);?><a class="button add-new-h2" href="admin.php?page=responsive_video_gallery_with_lightbox_video_management&action=addedit"><?php echo __(‘Add New’,’wp-responsive-video-gallery-with-lightbox’);?></a>1007 </h2>1008 <br />10091010 <form method="POST"1011 action="admin.php?page=responsive_video_gallery_with_lightbox_video_management&action=deleteselected"1012 id="posts-filter" onkeypress="return event.keyCode != 13;">1013 <div class="alignleft actions">1014 <select name="action_upper" id="action_upper">1015 <option selected="selected" value="-1"><?php echo __(‘Bulk Actions’,’wp-responsive-video-gallery-with-lightbox’);?></option>1016 <option value="delete"><?php echo __(‘Delete’,’wp-responsive-video-gallery-with-lightbox’);?></option>1017 </select> <input type="submit" value="<?php echo __(‘Apply’,’wp-responsive-video-gallery-with-lightbox’);?>"1018 class="button-secondary action" id="deleteselected"1019 name="deleteselected" onclick="return confirmDelete_bulk();">1020 </div>1021 <br class="clear">1022 1023 <?php1024 $setacrionpage=’admin.php?page=responsive_video_gallery_with_lightbox_video_management’;10251026 if(isset($_GET[‘order_by’]) and $_GET[‘order_by’]!=""){1027 $setacrionpage.=’&order_by=’.sanitize_text_field($_GET[‘order_by’]); 1028 }10291030 if(isset($_GET[‘order_pos’]) and $_GET[‘order_pos’]!=""){1031 $setacrionpage.=’&order_pos=’.sanitize_text_field($_GET[‘order_pos’]); 1032 }10331034 $seval="";1035 if(isset($_GET[‘search_term’]) and $_GET[‘search_term’]!=""){1036 $seval=trim(sanitize_text_field($_GET[‘search_term’])); 1037 }10381039 ?>1040 <?php1041 global $wpdb;1042 1043 $settings=get_option(‘responsive_video_gallery_slider_settings’);1044 1045 $visibleImages = $settings [‘visible’];1046 1047 $order_by=’id’;1048 $order_pos="asc";10491050 if(isset($_GET[‘order_by’]) and sanitize_sql_orderby($_GET[‘order_by’])!==false){10511052 $order_by=trim($_GET[‘order_by’]); 1053 }10541055 if(isset($_GET[‘order_pos’])){10561057 $order_pos=trim(sanitize_text_field($_GET[‘order_pos’])); 1058 }1059 $search_term_=’’;1060 if(isset($_GET[‘search_term’])){10611062 $search_term_=’&search_term=’.urlencode(sanitize_text_field($_GET[‘search_term’]));1063 }1064 $search_term=’’;1065 if(isset($_GET[‘search_term’])){10661067 $search_term= sanitize_text_field(esc_sql($_GET[‘search_term’]));1068 }1069 1070 $query = "SELECT * FROM " . $wpdb->prefix . "responsive_video_gallery_plus_responsive_lightbox ";1071 $querycount = "SELECT count(*) FROM " . $wpdb->prefix . "responsive_video_gallery_plus_responsive_lightbox ";1072 if($search_term!=’’){1073 $query.=" where id like ‘%$search_term%’ or videotitle like ‘%$search_term%’ “; 1074 $querycount.=” where id like ‘%$search_term%’ or videotitle like ‘%$search_term%’ “; 1075 }10761077 $order_by=sanitize_text_field(sanitize_sql_orderby($order_by));1078 $order_pos=sanitize_text_field(sanitize_sql_orderby($order_pos));10791080 $query.=” order by $order_by $order_pos";1081 $rowCount=$wpdb->get_var($querycount);1082 1083 1084 1085 $query1 = "SELECT count(*) FROM " . $wpdb->prefix . “responsive_video_gallery_plus_responsive_lightbox “;1086 $rowsCount=$wpdb->get_var($query1);1087 1088 ?>1089 <?php if ($rowsCount < $visibleImages) { ?>1090 <h4 style="color: green"> <?php echo __(‘Current slider setting’,’wp-responsive-video-gallery-with-lightbox’);?> - <?php echo __(‘Total visible Videos’,’wp-responsive-video-gallery-with-lightbox’);?> <?php echo $visibleImages; ?></h4>1091 <h4 style="color: green"><?php echo __(‘Please add atleast’,’wp-responsive-video-gallery-with-lightbox’);?> <?php echo $visibleImages; ?> <?php echo __(‘Videos’,’wp-responsive-video-gallery-with-lightbox’);?></h4>1092 <?php1093 } else {1094 echo “<br/>";1095 }1096 ?>1097 1098 <div style="padding-top:5px;padding-bottom:5px">1099 <b><?php echo __( ‘Search’,’full-width-responsive-slider-wp’);?> : </b>1100 <input type="text” value="<?php echo $seval;?>” id="search_term” name="search_term"> 1101 <input type=’button’ value=’<?php echo __( ‘Search’,’wp-responsive-video-gallery-with-lightbox’);?>’ name=’searchusrsubmit’ class=’button-primary’ id=’searchusrsubmit’ onclick="SearchredirectTO();" > 1102 <input type=’button’ value=’<?php echo __( ‘Reset Search’,’wp-responsive-video-gallery-with-lightbox’);?>’ name=’searchreset’ class=’button-primary’ id=’searchreset’ onclick="ResetSearch();" >1103 </div> 1104 <script type="text/javascript" >1105 1106 jQuery(‘#search_term’).on(“keyup", function(e) {1107 if (e.which == 13) {11081109 SearchredirectTO();1110 }1111 }); 1112 function SearchredirectTO(){1113 var redirectto=’<?php echo $setacrionpage; ?>’;1114 var searchval=jQuery(‘#search_term’).val();1115 redirectto=redirectto+’&search_term=’+jQuery.trim(encodeURIComponent(searchval)); 1116 window.location.href=redirectto;1117 }1118 function ResetSearch(){11191120 var redirectto=’<?php echo $setacrionpage; ?>’;1121 window.location.href=redirectto;1122 exit;1123 }1124 </script> 1125 <div id="no-more-tables">1126 <table cellspacing="0” id="gridTbl"1127 class="table-bordered table-striped table-condensed cf">1128 <thead>1129 <tr>1130 <th class="manage-column column-cb check-column" scope="col"><input type="checkbox"></th>1131 <?php if($order_by=="id" and $order_pos=="asc"):?>1132 <th><a href="<?php echo $setacrionpage;?>&order_by=id&order_pos=desc<?php echo $search_term_;?>"><?php echo __(‘Id’,’wp-responsive-video-gallery-with-lightbox’);?><img style="vertical-align:middle" src="<?php echo plugins_url(‘/images/desc.png’, __FILE__); ?>"/></a></th>1133 <?php else:?>1134 <?php if($order_by=="id"):?>1135 <th><a href="<?php echo $setacrionpage;?>&order_by=id&order_pos=asc<?php echo $search_term_;?>"><?php echo __(‘Id’,’wp-responsive-video-gallery-with-lightbox’);?><img style="vertical-align:middle" src="<?php echo plugins_url(‘/images/asc.png’, __FILE__); ?>"/></a></th>1136 <?php else:?>1137 <th><a href="<?php echo $setacrionpage;?>&order_by=id&order_pos=asc<?php echo $search_term_;?>"><?php echo __(‘Id’,’wp-responsive-video-gallery-with-lightbox’);?></a></th>1138 <?php endif;?> 1139 <?php endif;?> 1140 <?php if($order_by=="vtype" and $order_pos=="asc"):?>1141 <th><a href="<?php echo $setacrionpage;?>&order_by=vtype&order_pos=desc<?php echo $search_term_;?>"><?php echo __(‘Video Type’,’wp-responsive-video-gallery-with-lightbox’);?><img style="vertical-align:middle" src="<?php echo plugins_url(‘/images/desc.png’, __FILE__); ?>"/></a></th>1142 <?php else:?>1143 <?php if($order_by=="vtype"):?>1144 <th><a href="<?php echo $setacrionpage;?>&order_by=vtype&order_pos=asc<?php echo $search_term_;?>"><?php echo __(‘Video Type’,’wp-responsive-video-gallery-with-lightbox’);?><img style="vertical-align:middle" src="<?php echo plugins_url(‘/images/asc.png’, __FILE__); ?>"/></a></th>1145 <?php else:?>1146 <th><a href="<?php echo $setacrionpage;?>&order_by=vtype&order_pos=asc<?php echo $search_term_;?>"><?php echo __(‘Video Type’,’wp-responsive-video-gallery-with-lightbox’);?></a></th>1147 <?php endif;?> 1148 <?php endif;?> 1149 1150 <?php if($order_by=="videotitle" and $order_pos=="asc"):?>1151 <th><a href="<?php echo $setacrionpage;?>&order_by=videotitle&order_pos=desc<?php echo $search_term_;?>"><?php echo __(‘Title’,’wp-responsive-video-gallery-with-lightbox’);?><img style="vertical-align:middle" src="<?php echo plugins_url(‘/images/desc.png’, __FILE__); ?>"/></a></th>1152 <?php else:?>1153 <?php if($order_by=="videotitle"):?>1154 <th><a href="<?php echo $setacrionpage;?>&order_by=videotitle&order_pos=asc<?php echo $search_term_;?>"><?php echo __(‘Title’,’wp-responsive-video-gallery-with-lightbox’);?><img style="vertical-align:middle" src="<?php echo plugins_url(‘/images/asc.png’, __FILE__); ?>"/></a></th>1155 <?php else:?>1156 <th><a href="<?php echo $setacrionpage;?>&order_by=videotitle&order_pos=asc<?php echo $search_term_;?>"><?php echo __(‘Title’,’wp-responsive-video-gallery-with-lightbox’);?></a></th>1157 <?php endif;?> 1158 <?php endif;?> 1159 <th><span></span></th>1160 <?php if($order_by=="createdon" and $order_pos=="asc"):?>1161 <th><a href="<?php echo $setacrionpage;?>&order_by=createdon&order_pos=desc<?php echo $search_term_;?>"><?php echo __(‘Published On’,’wp-responsive-video-gallery-with-lightbox’);?><img style="vertical-align:middle" src="<?php echo plugins_url(‘/images/desc.png’, __FILE__); ?>"/></a></th>1162 <?php else:?>1163 <?php if($order_by=="createdon"):?>1164 <th><a href="<?php echo $setacrionpage;?>&order_by=createdon&order_pos=asc<?php echo $search_term_;?>"><?php echo __(‘Published On’,’wp-responsive-video-gallery-with-lightbox’);?><img style="vertical-align:middle" src="<?php echo plugins_url(‘/images/asc.png’, __FILE__); ?>"/></a></th>1165 <?php else:?>1166 <th><a href="<?php echo $setacrionpage;?>&order_by=createdon&order_pos=asc<?php echo $search_term_;?>"><?php echo __(‘Published On’,’wp-responsive-video-gallery-with-lightbox’);?></a></th>1167 <?php endif;?> 1168 <?php endif;?> 1169 <th><span><?php echo __(‘Edit’,’wp-responsive-video-gallery-with-lightbox’);?></span></th>1170 <th><span><?php echo __(‘Delete’,’wp-responsive-video-gallery-with-lightbox’);?></span></th>1171 </tr>1172 </thead>11731174 <tbody id="the-list">1175 <?php1176 if ($rowCount > 0) {1177 1178 global $wp_rewrite;1179 $rows_per_page = 10;1180 1181 $current = (isset ( $_GET [‘paged’] )) ? ((int) htmlentities(strip_tags($_GET [‘paged’]),ENT_QUOTES)) : 1;1182 $pagination_args = array (1183 ‘base’ => @add_query_arg ( ‘paged’, ‘%#%’ ),1184 ‘format’ => ‘’,1185 ‘total’ => ceil ( $rowCount / $rows_per_page ),1186 ‘current’ => $current,1187 ‘show_all’ => false,1188 ‘type’ => ‘plain’ 1189 );1190 1191 $delRecNonce = wp_create_nonce(‘delete_image’);1192 $offset = ($current - 1) * $rows_per_page;1193 $query.=" limit $offset, $rows_per_page";1194 1195 $rows = $wpdb->get_results ( $query ,’ARRAY_A’ );1196 foreach($rows as $row) {1197 1198 1199 $id = $row [‘id’];1200 $editlink = “admin.php?page=responsive_video_gallery_with_lightbox_video_management&action=addedit&id=$id";1201 $deletelink = “admin.php?page=responsive_video_gallery_with_lightbox_video_management&action=delete&id=$id&nonce=$delRecNonce";1202 1203 $outputimgmain = $baseurl . $row [‘image_name’].’?rand=’. rand(0, 5000);1204 ?>1205 <tr valign="top">1206 <td class="alignCenter check-column” data-title="<?php echo __(‘Select Record’,’wp-responsive-video-gallery-with-lightbox’);?>">1207 <input type="checkbox” value="<?php echo $row[‘id’] ?>" name="thumbnails[]“>1208 </td>1209 <td data-title="<?php echo __(‘Id’,’wp-responsive-video-gallery-with-lightbox’);?>” class="alignCenter"><?php echo $row[‘id’]; ?></td>1210 <td data-title="<?php echo __(‘Video Type’,’wp-responsive-video-gallery-with-lightbox’);?>" class="alignCenter">1211 <div>1212 <strong><?php echo $row[‘vtype’]; ?></strong>1213 </div>1214 </td>1215 <td data-title="<?php echo __(‘Title’,’wp-responsive-video-gallery-with-lightbox’);?>" class="alignCenter">1216 <div>1217 <strong><?php echo $row[‘videotitle’]; ?></strong>1218 </div>1219 </td>1220 <td class="alignCenter">1221 <img src="<?php echo $outputimgmain; ?>" style="width: 50px" height="50px" />1222 </td>1223 <td data-title="<?php echo __(‘Published On’,’wp-responsive-video-gallery-with-lightbox’);?>" class="alignCenter"><?php echo $row[‘createdon’] ?></td>1224 <td data-title="<?php echo __(‘Edit’,’wp-responsive-video-gallery-with-lightbox’);?>" class="alignCenter">1225 <strong><a href=’<?php echo $editlink; ?>’ title="<?php echo __(‘Edit’,’wp-responsive-video-gallery-with-lightbox’);?>"><?php echo __(‘Edit’,’wp-responsive-video-gallery-with-lightbox’);?></a></strong>1226 </td>1227 <td data-title="<?php echo __(‘Delete’,’wp-responsive-video-gallery-with-lightbox’);?>" class="alignCenter">1228 <strong>1229 <a href=’<?php echo $deletelink; ?>’ onclick="return confirmDelete();" title="<?php echo __(‘Delete’,’wp-responsive-video-gallery-with-lightbox’);?>"><?php echo __(‘Delete’,’wp-responsive-video-gallery-with-lightbox’);?></a> 1230 </strong>1231 </td>1232 </tr>1233 <?php1234 }1235 } else {1236 ?>1237 <tr valign="top" class=""1238 id="">1239 <td colspan="8" data-title="<?php echo __(‘No Records’,’wp-responsive-video-gallery-with-lightbox’);?>" align="center"><strong><?php echo __(‘No Videos Found’,’wp-responsive-video-gallery-with-lightbox’);?></strong></td>1240 </tr>1241 <?php1242 }1243 ?> 1244 </tbody>1245 </table>1246 </div>1247 <?php1248 if ($rowCount > 0) {1249 echo "<div class=’pagination’ style=’padding-top:10px’>";1250 echo paginate_links ( $pagination_args );1251 echo “</div>";1252 }1253 ?>1254 <br />1255 <div class="alignleft actions">1256 <select name="action” id="action_bottom">1257 <option selected="selected" value="-1"><?php echo __(‘Bulk Actions’,’wp-responsive-video-gallery-with-lightbox’);?></option>1258 <option value="delete"><?php echo __(‘Delete’,’wp-responsive-video-gallery-with-lightbox’);?></option>1259 </select>1260 <?php wp_nonce_field(‘action_settings_mass_delete’, ‘mass_delete_nonce’); ?>1261 <input type="submit" value="<?php echo __(‘Apply’,’wp-responsive-video-gallery-with-lightbox’);?>"1262 class="button-secondary action" id="deleteselected"1263 name="deleteselected" onclick="return confirmDelete_bulk();">1264 </div>12651266 </form>1267 <script type="text/JavaScript">12681269 function confirmDelete_bulk(){1270 var topval=document.getElementById(“action_bottom”).value;1271 var bottomVal=document.getElementById(“action_upper”).value;12721273 if(topval==’delete’ || bottomVal==’delete’){127412751276 var agree=confirm(“<?php echo __(‘Are you sure you want to delete selected videos?’,’wp-responsive-video-gallery-with-lightbox’);?>”);1277 if (agree)1278 return true ;1279 else1280 return false;1281 }1282 }1283 function confirmDelete(){12841285 var agree=confirm(“<?php echo __(‘Are you sure you want to delete this video ?’,’wp-responsive-video-gallery-with-lightbox’);?>”);1286 if (agree)1287 return true ;1288 else1289 return false;1290 }1291 </script>12921293 <br class="clear">1294 </div>1295 <div style="clear: both;"></div>1296 <?php $url = plugin_dir_url(__FILE__); ?>129712981299 </div>1300 <h3><?php echo __(‘To print this video carousel into WordPress Post/Page use below code’,’wp-responsive-video-gallery-with-lightbox’);?></h3>1301 <input type="text"1302 value=’[print_responsive_video_gallery_plus_lightbox] ‘1303 style="width: 400px; height: 30px"1304 onclick="this.focus(); this.select()" />1305 <div class="clear"></div>1306 <h3><?php echo __(‘To print this video carousel into WordPress theme/template PHP files use below code’,’wp-responsive-video-gallery-with-lightbox’);?></h3>1307 <?php1308 $shortcode = '[print_responsive_video_gallery_plus_lightbox]‘;1309 ?>1310 <input type="text"1311 value="<?php echo do_shortcode(‘<?php echo htmlentities($shortcode, ENT_QUOTES); ?>’); ?>"1312 style="width: 400px; height: 30px"1313 onclick="this.focus(); this.select()" />1314 <div class="clear"></div>1315 </div>1316 </div>1317 <div id="postbox-container-1" class="postbox-container" > 13181319 <div class="postbox"> 1320 <h3 class="hndle"><span></span><?php echo __(‘Access All Themes In One Price’,’wp-responsive-video-gallery-with-lightbox’);?></h3> 1321 <div class="inside">1322 <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>13231324 <div style="margin:10px 5px">13251326 </div>1327 </div></div>1328 <div class="postbox"> 1329 <h3 class="hndle"><span></span><?php echo __(‘Google For Business Coupon’,’wp-responsive-video-gallery-with-lightbox’);?></h3> 1330 <div class="inside">1331 <center><a href="https://goo.gl/OJBuHT" target="_blank">1332 <img src="<?php echo plugins_url( ‘images/g-suite-promo-code-4.png’, __FILE__ );?>" width="250" height="250" border="0">1333 </a></center>1334 <div style="margin:10px 5px">1335 </div>1336 </div>1337 1338 </div>13391340 </div>1341 </div>1342 </div>1343</div>1344 <?php1345 } else if (strtolower ( $action ) == strtolower ( ‘addedit’ )) {1346 $url = plugin_dir_url ( __FILE__ );1347 $vNonce = wp_create_nonce(‘vNonce’);1348 ?><?php1349 if (isset ( $_POST [‘btnsave’] )) {1350 1351 if (!check_admin_referer(‘action_image_add_edit’, ‘add_edit_image_nonce’)) {13521353 wp_die(‘Security check fail’);1354 }13551356 $uploads = wp_upload_dir ();1357 $baseDir = $uploads [‘basedir’];1358 $baseDir = str_replace ( "\\", "/", $baseDir );1359 $pathToImagesFolder = $baseDir . ‘/wp-responsive-video-gallery-with-lightbox’;1360 1361 $vtype = trim ( htmlentities(sanitize_text_field( $_POST [‘vtype’] ),ENT_QUOTES) );1362 $videourl = trim ( htmlentities(esc_url_raw($_POST [‘videourl’] ),ENT_QUOTES));1363 // echo $videourl;die;1364 $vid = uniqid ( ‘vid_’ );1365 $embed_url=’’;1366 if ($vtype == ‘youtube’) {1367 // parse1368 1369 $parseUrl = @parse_url ( $videourl );1370 if (is_array ( $parseUrl )) {1371 1372 $queryStr = $parseUrl [‘query’];1373 parse_str ( $queryStr, $array );1374 if (is_array ( $array ) and isset ( $array [‘v’] )) {1375 1376 $vid = $array [‘v’];1377 }1378 }1379 1380 $embed_url="//www.youtube.com/embed/$vid"; 1381 }1382 else if($vtype==’dailymotion’){1383 1384 $url_arr = parse_url($videourl);1385 if(is_array($url_arr) and isset($url_arr[‘query’])){1386 1387 $query = $url_arr[‘query’];1388 $videourl = str_replace(array($query,’?’), ‘’, $videourl);1389 }1390 $pos = strpos($videourl, ‘/video/’);1391 $vid=0;1392 if ($pos !== false){13931394 $vid=substr($videourl, $pos+strlen(‘/video/’));13951396 }13971398 $embed_url="//www.dailymotion.com/embed/video/$vid";1399 1400 }1401 1402 1403 $HdnMediaSelection = trim ( htmlentities(esc_url_raw($_POST [‘HdnMediaSelection’] ),ENT_QUOTES));1404 $videotitle = trim ( htmlentities(sanitize_text_field($_POST [‘videotitle’] ),ENT_QUOTES)) ;1405 $videotitleurl = trim ( htmlentities(esc_url_raw($_POST [‘videotitleurl’] ),ENT_QUOTES));1406 $video_order = 0;1407 1408 $video_description = ‘’;1409 1410 $videotitle = str_replace(“’","’",$videotitle);1411 $videotitle = str_replace('"’, ‘"’, $videotitle);1412 1413 $open_link_in = 1;1414 1415 $enable_light_box_video_desc = 0;14161417 $location = "admin.php?page=responsive_video_gallery_with_lightbox_video_management";1418 // edit save1419 if (isset ( $_POST [‘videoid’] )) {1420 1421 if ( ! current_user_can( ‘rvg_responsive_video_gallery_edit_video’ ) ) {14221423 $location=’admin.php?page=responsive_video_gallery_with_lightbox_video_management’;1424 $responsive_video_gallery_plus_lightbox_messages=array();1425 $responsive_video_gallery_plus_lightbox_messages[‘type’]=’err’;1426 $responsive_video_gallery_plus_lightbox_messages[‘message’]=__(‘Access Denied. Please contact your administrator.’,’wp-responsive-video-gallery-with-lightbox’);1427 update_option(‘responsive_video_gallery_plus_lightbox_messages’, $responsive_video_gallery_plus_lightbox_messages);1428 echo "<script type=’text/javascript’> location.href=’$location’;</script>"; 1429 exit; 14301431 }1432 1433 try {1434 1435 $videoidEdit=intval(htmlentities(strip_tags($_POST [‘videoid’]),ENT_QUOTES));1436 if (trim ( $_POST [‘HdnMediaSelection’] ) != ‘’) {1437 1438 $pInfo = pathinfo ( $HdnMediaSelection );1439 $ext = @$pInfo [‘extension’];1440 if($ext==’’){1441 if (exif_imagetype($HdnMediaSelection) == IMAGETYPE_PNG) {14421443 $ext=’png’; 1444 } 1445 else if (exif_imagetype($HdnMediaSelection) == IMAGETYPE_JPEG) {14461447 $ext=’jpeg’; 1448 } 1449 else if (exif_imagetype($HdnMediaSelection) == IMAGETYPE_GIF) {14501451 $ext=’gif’; 1452 } 14531454 }1455 $imagename = $vid . ‘_big.’ . $ext;1456 $imageUploadTo = $pathToImagesFolder . ‘/’ . $imagename;1457 @copy ( $HdnMediaSelection, $imageUploadTo );1458 if(!file_exists($imageUploadTo)){1459 vgallery_save_image_curl($HdnMediaSelection,$imageUploadTo);1460 }1461 $settings=get_option(‘responsive_video_gallery_slider_settings’);1462 $imageheight = $settings [‘imageheight’];1463 $imagewidth = $settings [‘imagewidth’];1464 @unlink($pathToImagesFolder.’/’.$vid . ‘_big_’.$imageheight.’_’.$imagewidth.’.’.$ext);1465 }1466 1467 $query = “update " . $wpdb->prefix . “responsive_video_gallery_plus_responsive_lightbox1468 set vtype=’$vtype’,vid=’$vid’,video_url=’$videourl’,embed_url=’$embed_url’,image_name=’$imagename’,HdnMediaSelection=’$HdnMediaSelection’,1469 videotitle=’$videotitle’,videotitleurl=’$videotitleurl’,video_description=’$video_description’,video_order=$video_order,1470 open_link_in=$open_link_in,enable_light_box_video_desc=$enable_light_box_video_desc where id=$videoidEdit";1471 1472 1473 $wpdb->query ( $query );1474 1475 $responsive_video_gallery_plus_lightbox_messages = array ();1476 $responsive_video_gallery_plus_lightbox_messages [‘type’] = 'succ’;1477 $responsive_video_gallery_plus_lightbox_messages [‘message’] = __(‘Video updated successfully.’,’wp-responsive-video-gallery-with-lightbox’);1478 update_option ( 'responsive_video_gallery_plus_lightbox_messages’, $responsive_video_gallery_plus_lightbox_messages );1479 } 1480 catch ( Exception $e ) {1481 1482 $responsive_video_gallery_plus_lightbox_messages = array ();1483 $responsive_video_gallery_plus_lightbox_messages [‘type’] = 'err’;1484 $responsive_video_gallery_plus_lightbox_messages [‘message’] = __(‘Error while adding video.’,’wp-responsive-video-gallery-with-lightbox’);1485 update_option ( 'responsive_video_gallery_plus_lightbox_messages’, $responsive_video_gallery_plus_lightbox_messages );1486 }14871488 1489 1490 echo “<script type=’text/javascript’> location.href=’$location’;</script>";1491 exit ();1492 } 1493 else {1494 1495 // add new1496 1497 if ( ! current_user_can( ‘rvg_responsive_video_gallery_add_video’ ) ) {14981499 $location=’admin.php?page=responsive_video_gallery_with_lightbox_video_management’;1500 $responsive_video_gallery_plus_lightbox_messages=array();1501 $responsive_video_gallery_plus_lightbox_messages[‘type’]=’err’;1502 $responsive_video_gallery_plus_lightbox_messages[‘message’]=__(‘Access Denied. Please contact your administrator.’,’wp-responsive-video-gallery-with-lightbox’);1503 update_option(‘responsive_video_gallery_plus_lightbox_messages’, $responsive_video_gallery_plus_lightbox_messages);1504 echo "<script type=’text/javascript’> location.href=’$location’;</script>"; 1505 exit; 15061507 }1508 1509 $createdOn = current_time ( ‘Y-m-d h:i:s’ );1510 1511 try {1512 1513 if (trim ( $_POST [‘HdnMediaSelection’] ) != ‘’) {1514 $pInfo = pathinfo ( $HdnMediaSelection );1515 $ext = @$pInfo [‘extension’];1516 if($ext==’’){1517 if (exif_imagetype($HdnMediaSelection) == IMAGETYPE_PNG) {15181519 $ext=’png’; 1520 } 1521 else if (exif_imagetype($HdnMediaSelection) == IMAGETYPE_JPEG) {15221523 $ext=’jpeg’; 1524 } 1525 else if (exif_imagetype($HdnMediaSelection) == IMAGETYPE_GIF) {15261527 $ext=’gif’; 1528 } 15291530 }1531 $imagename = $vid . ‘_big.’ . $ext;1532 $imageUploadTo = $pathToImagesFolder . ‘/’ . $imagename;1533 @copy ( $HdnMediaSelection, $imageUploadTo );1534 if(!file_exists($imageUploadTo)){1535 vgallery_save_image_curl($HdnMediaSelection,$imageUploadTo);1536 }15371538 }1539 1540 $query = “INSERT INTO " . $wpdb->prefix . “responsive_video_gallery_plus_responsive_lightbox 1541 (vtype, vid,video_url,embed_url,image_name,HdnMediaSelection,videotitle,videotitleurl,video_description,video_order,open_link_in,1542 enable_light_box_video_desc,createdon) 1543 VALUES (‘$vtype’,’$vid’,’$videourl’,’$embed_url’,’$imagename’,’$HdnMediaSelection’,’$videotitle’,’$videotitleurl’,’$video_description’,1544 $video_order,$open_link_in,$enable_light_box_video_desc,’$createdOn’)“;1545 1546 //echo $query;die;1547 $wpdb->query ( $query );1548 1549 $responsive_video_gallery_plus_lightbox_messages = array ();1550 $responsive_video_gallery_plus_lightbox_messages [‘type’] = 'succ’;1551 $responsive_video_gallery_plus_lightbox_messages [‘message’] = __(‘New video added successfully.’,’wp-responsive-video-gallery-with-lightbox’);1552 update_option ( 'responsive_video_gallery_plus_lightbox_messages’, $responsive_video_gallery_plus_lightbox_messages );1553 } catch ( Exception $e ) {1554 1555 $responsive_video_gallery_plus_lightbox_messages = array ();1556 $responsive_video_gallery_plus_lightbox_messages [‘type’] = 'err’;1557 $responsive_video_gallery_plus_lightbox_messages [‘message’] = __(‘Error while adding video’,’wp-responsive-video-gallery-with-lightbox’);1558 update_option ( 'responsive_video_gallery_plus_lightbox_messages’, $responsive_video_gallery_plus_lightbox_messages );1559 }1560 1561 echo “<script type=’text/javascript’> location.href=’$location’;</script>";1562 exit ();1563 }1564 } else {1565 1566 $uploads = wp_upload_dir ();1567 $baseurl = $uploads [‘baseurl’];1568 $baseurl .= '/wp-responsive-video-gallery-with-lightbox/’;1569 ?>1570 <div id="poststuff” > 1571 <div id="post-body” class="metabox-holder columns-2” > 1572 <div id="post-body-content">1573 <div class="wrap">1574 <div style="float: left; width: 100%;">1575 <div class="wrap">1576 <?php1577 if (isset ( $_GET [‘id’] ) and intval($_GET [‘id’]) > 0) {1578 1579 if ( ! current_user_can( ‘rvg_responsive_video_gallery_edit_video’ ) ) {15801581 $location=’admin.php?page=responsive_video_gallery_with_lightbox_video_management’;1582 $responsive_video_gallery_plus_lightbox_messages=array();1583 $responsive_video_gallery_plus_lightbox_messages[‘type’]=’err’;1584 $responsive_video_gallery_plus_lightbox_messages[‘message’]=__(‘Access Denied. Please contact your administrator.’,’wp-responsive-video-gallery-with-lightbox’);1585 update_option('responsive_video_gallery_plus_lightbox_messages’, $responsive_video_gallery_plus_lightbox_messages);1586 echo “<script type=’text/javascript’> location.href=’$location’;</script>"; 1587 exit; 15881589 }1590 1591 $id = intval($_GET [‘id’]);1592 $query = “SELECT * FROM " . $wpdb->prefix . “responsive_video_gallery_plus_responsive_lightbox WHERE id=$id";1593 1594 $myrow = $wpdb->get_row ( $query );1595 1596 if (is_object ( $myrow )) {1597 1598 1599 if ( ! current_user_can( ‘rvg_responsive_video_gallery_edit_video’ ) ) {16001601 $location=’admin.php?page=responsive_video_gallery_with_lightbox_video_management’;1602 $responsive_video_gallery_plus_lightbox_messages=array();1603 $responsive_video_gallery_plus_lightbox_messages[‘type’]=’err’;1604 $responsive_video_gallery_plus_lightbox_messages[‘message’]=__(‘Access Denied. Please contact your administrator.’,’wp-responsive-video-gallery-with-lightbox’);1605 update_option('responsive_video_gallery_plus_lightbox_messages’, $responsive_video_gallery_plus_lightbox_messages);1606 echo “<script type=’text/javascript’> location.href=’$location’;</script>"; 1607 exit; 16081609 }1610 1611 $vtype = $myrow->vtype ;1612 $title = $myrow->videotitle ;1613 $image_name = $myrow->image_name;1614 $video_url = $myrow->video_url ;1615 $HdnMediaSelection = $myrow->HdnMediaSelection;1616 $videotitle = $myrow->videotitle;1617 $videotitleurl=$myrow->videotitleurl;1618 $video_order = $myrow->video_order;1619 $video_description = $myrow->video_description;1620 $open_link_in = $myrow->open_link_in ;1621 $enable_light_box_video_desc = $myrow->enable_light_box_video_desc ;1622 }1623 ?>1624 <h2><?php echo __(‘Update Video’,’wp-responsive-video-gallery-with-lightbox’);?></h2>1625 <?php1626 } else {16271628 1629 if ( ! current_user_can( ‘rvg_responsive_video_gallery_add_video’ ) ) {16301631 $location=’admin.php?page=responsive_video_gallery_with_lightbox_video_management’;1632 $responsive_video_gallery_plus_lightbox_messages=array();1633 $responsive_video_gallery_plus_lightbox_messages[‘type’]=’err’;1634 $responsive_video_gallery_plus_lightbox_messages[‘message’]=__(‘Access Denied. Please contact your administrator.’,’wp-responsive-video-gallery-with-lightbox’);1635 update_option('responsive_video_gallery_plus_lightbox_messages’, $responsive_video_gallery_plus_lightbox_messages);1636 echo “<script type=’text/javascript’> location.href=’$location’;</script>"; 1637 exit; 16381639 } 1640 $vtype=’’;1641 $title = '’;1642 $videotitle=’’;1643 $videotitleurl=’’;1644 $HdnMediaSelection=’’;1645 $video_url = '’;1646 $image_link = '’;1647 $image_name = '’;1648 $video_order = '’;1649 $video_description = '’;1650 $open_link_in = true;1651 $enable_light_box_video_desc = true;1652 ?>16531654 <div style="clear:both">1655 <span><h3 style="color: blue;"><a target="_blank” href="https://www.i13websolution.com/product/wordpress-responsive-video-gallery-with-lightbox-pro/"><?php echo __(‘UPGRADE TO PRO VERSION’,’wp-responsive-video-gallery-with-lightbox’);?></a></h3></span>1656 </div> 1657 <h2><?php echo __(‘Add Video’,’wp-responsive-video-gallery-with-lightbox’);?></h2>1658 <?php } ?>1659 <br />1660 <div id="poststuff">1661 <div id="post-body” class="metabox-holder columns-2">1662 <div id="post-body-content">1663 <form method="post” action="” id="addimage” name="addimage"1664 enctype="multipart/form-data">1665 <div class="stuffbox” id="namediv” style="width: 100%">1666 <h3>1667 <label for="link_name"><?php echo __(‘Video Information’,’wp-responsive-video-gallery-with-lightbox’);?> (<span1668 style="font-size: 11px; font-weight: normal"><?php _e(‘Choose Video Site’,’wp-responsive-video-gallery-with-lightbox’); ?></span>)1669 </label>1670 </h3>1671 <div class="inside">1672 <div>1673 <input type="radio” value="youtube” name="vtype"1674 <?php if($vtype==’youtube’): ?> checked=’checked’ <?php endif;?> style="width: 15px” id="type_youtube" /><?php echo __(‘Youtube’,’wp-responsive-video-gallery-with-lightbox’);?>  1675 <input <?php if($vtype==’dailymotion’): ?> checked=’checked’ <?php endif;?> type="radio" value="dailymotion" name="vtype"1676 style="width: 15px" id="type_DailyMotion" /><?php echo __(‘DailyMotion’,’wp-responsive-video-gallery-with-lightbox’);?>  1677 </div>1678 <div style="clear: both"></div>1679 <div></div>1680 <div style="clear: both"></div>1681 <br />1682 <div>1683 <b><?php echo __(‘Video Url’,’wp-responsive-video-gallery-with-lightbox’);?></b> <input type="text" id="videourl"1684 class="url" tabindex="1" size="30" name="videourl"1685 value="<?php echo $video_url; ?>">1686 </div>1687 <div style="clear: both"></div>1688 <div></div>1689 <div style="clear: both"></div>1690 </div>1691 </div>1692 <div class="stuffbox" id="namediv" style="width: 100%">1693 <h3>1694 <label for="link_name"><?php echo __(‘Video Information’,’wp-responsive-video-gallery-with-lightbox’);?></label>1695 </h3>1696 <div class="inside" id="fileuploaddiv">1697 <?php if ($image_name != “”) { ?>1698 <div>1699 <b><?php echo __(‘Current Image : ‘,’wp-responsive-video-gallery-with-lightbox’);?></b>1700 <br/>1701 <img id="img_disp" name="img_disp"1702 src="<?php echo $baseurl . $image_name; ?>" />1703 </div>1704 <?php }else{ ?> 1705 <img1706 src="<?php echo plugins_url(‘/images/no-img.jpeg’, __FILE__); ?>"1707 id="img_disp" name="img_disp" />1708 1709 <?php } ?>1710 <br /> <a1711 href="javascript:;" class="niks_media"1712 id="videoFromExternalSite" ><b><?php echo __(‘Click Here to get video information and thumbnail’,’wp-responsive-video-gallery-with-lightbox’);?><span id=’fromval’> From <?php echo $vtype;?></span>1713 </b></a> <img1714 src="<?php echo plugins_url(‘/images/ajax-loader.gif’, __FILE__); ?>"1715 style="display: none" id="loading_img" name="loading_img" />1716 <div style="clear: both"></div>1717 <div></div>1718 <div class="uploader">1719 <br /> <b style="margin-left: 50px;">OR</b>1720 <div style="clear: both; margin-top: 15px;"></div>1721 <?php if (responsive_video_gallery_plus_responsive_lightbox_get_wp_version() >= 3.5) { ?>1722 <a href="javascript:;" class="niks_media" id="myMediaUploader"><b><?php echo __(‘Click Here to upload custom video thumbnail’,’wp-responsive-video-gallery-with-lightbox’);?></b></a>1723 <?php } ?> 1724 <br /> <br />1725 <div>1726 <input id="HdnMediaSelection" name="HdnMediaSelection" type="hidden" value="<?php echo $HdnMediaSelection;?>" />1727 </div>1728 <div style="clear: both"></div>1729 <div></div>1730 <div style="clear: both"></div>17311732 <br />1733 </div>1734 <script>17351736 function GetParameterValues(param,str) {1737 var return_p=’’; 1738 var url = str.slice(str.indexOf(‘?’) + 1).split(‘&’);1739 for (var i = 0; i < url.length; i++) {1740 var urlparam = url[i].split(‘=’);1741 if (urlparam[0] == param) {1742 return_p= urlparam[1];1743 }1744 }1745 return return_p;1746 }17471748 17491750 function UrlExists(url, cb){1751 jQuery.ajax({1752 url: url,1753 dataType: ‘text’,1754 type: ‘GET’,1755 complete: function(xhr){1756 if(typeof cb === ‘function’)1757 cb.apply(this, [xhr.status]);1758 }1759 });1760 }17611762 function getDailyMotionId(url) {1763 1764 if (url.indexOf(“?”) > 0) {1765 url = url.substring(0, url.indexOf(“?”));1766 }1767 var m = url.match(/^.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/);1768 if (m !== null) {1769 if(m[4] !== undefined) {1770 return m[4];1771 }1772 return m[2];1773 }1774 return null;1775 }177617771778 jQuery(document).ready(function() {177917801781 jQuery(“input:radio[name=vtype]").click(function() {178217831784 var value = jQuery(this).val();1785 jQuery(“#fromval”).html(" from " + value);1786 });17871788 jQuery(“#videoFromExternalSite”).click(function() {178917901791 var videoService = jQuery('input[name="vtype”]:checked’).length;1792 var videourlVal = jQuery.trim(jQuery(“#videourl”).val());1793 var flag = true;1794 if (videourlVal == ‘’ && videoService == 0){17951796 alert(‘Please select video site.\nPlease enter video url.’);1797 jQuery(“input:radio[name=vtype]").focus();1798 flag = false;17991800 }1801 else if (videoService == 0){18021803 alert(‘Please select video site.’);1804 jQuery(“input:radio[name=vtype]").focus();1805 flag = false;1806 }1807 else if (videourlVal == ‘’){18081809 alert(‘Please enter video url.’);1810 jQuery(“#videourl”).focus();1811 flag = false;1812 }18131814 if (flag){18151816 setTimeout(function() {1817 jQuery(“#loading_img”).show(); 1818 }, 100);18191820 var selectedRadio = jQuery('input[name=vtype]');1821 var checkedValueRadio = selectedRadio.filter(‘:checked’).val();1822 if (checkedValueRadio == ‘youtube’) {1823 var vId = GetParameterValues(‘v’, videourlVal);1824 if(vId!=’’){182518261827 var tumbnailImg=’http://img.youtube.com/vi/’+vId+’/maxresdefault.jpg’;18281829 var data = {1830 'action’: ‘check_file_exist’,1831 ‘url’: tumbnailImg,1832 ‘vNonce’:’<?php echo $vNonce; ?>’1833 };18341835 jQuery.post(ajaxurl, data, function(response) {1836183718381839 var youtubeJsonUri=’https://www.youtube.com/oembed?url=https://www.youtube.com/watch%3Fv=’+vId+’&format=json’;1840 var data_youtube = {1841 ‘action’: ‘get_youtube_info’,1842 ‘url’: youtubeJsonUri,1843 ‘vid’:vId,1844 ‘vNonce’:’<?php echo $vNonce; ?>’1845 };18461847 jQuery.post(ajaxurl, data_youtube, function(data) {18481849 data = jQuery.parseJSON(data);1850 1851 if(typeof data ==’object’){ 1852 if(typeof data ==’object’){ 1853 1854 if(data.title!=’’ && data.title!=’’){1855 jQuery(“#videotitle”).val(data.title); 1856 }1857 jQuery(“#videotitleurl”).val(videourlVal);1858 if(data.description!=’’ && data.description!=’’){1859 jQuery(“#video_description”).val(data.description); 1860 }1861 if(response==’404’ && data.thumbnail_url!=’’){1862 tumbnailImg=data.thumbnail_url;1863 }1864 else{1865 tumbnailImg=’http://img.youtube.com/vi/’+vId+’/0.jpg’;1866 }18671868 jQuery(“#img_disp”).attr(‘src’, tumbnailImg);1869 jQuery(“#HdnMediaSelection”).val(tumbnailImg);1870 jQuery(“#loading_img”).hide();18711872 }18731874 }1875 jQuery(“#loading_img”).hide();1876 }) 187718781879 });1880 1881 }1882 else{1883 alert(‘Could not found such video’);1884 jQuery(“#loading_img”).hide();1885 }1886 }1887 else if(checkedValueRadio == ‘dailymotion’){18881889 var vid=getDailyMotionId(videourlVal); 1890 var apiUrl=’https://api.dailymotion.com/video/’+vid+’?fields=description,id,thumbnail_720_url,title’;1891 jQuery.getJSON( apiUrl, function( data ) {1892 if(typeof data ==’object’){ 189318941895 jQuery(“#HdnMediaSelection”).val(data.thumbnail_720_url); 1896 jQuery(“#videotitle”).val(jQuery.trim(data.title));1897 jQuery(“#videotitleurl”).val(videourlVal);1898 jQuery(“#img_disp”).attr('src’, data.thumbnail_720_url);1899 jQuery(“#loading_img”).hide();1900 } 1901 jQuery(“#loading_img”).hide(); 1902 }) 190319041905 jQuery(“#loading_img”).hide();1906 } 19071908 jQuery(“#loading_img”).hide();1909 }19101911 setTimeout(function() {1912 jQuery(“#loading_img”).hide(); 1913 }, 2000); 19141915 });1916 //uploading files variable1917 var custom_file_frame;1918 jQuery(“#myMediaUploader”).click(function(event) {1919 event.preventDefault();1920 //If the frame already exists, reopen it1921 if (typeof (custom_file_frame) !== “undefined”) {1922 custom_file_frame.close();1923 }19241925 //Create WP media frame.1926 custom_file_frame = wp.media.frames.customHeader = wp.media({1927 //Title of media manager frame1928 title: “WP Media Uploader",1929 library: {1930 type: 'image’1931 },1932 button: {1933 //Button text1934 text: “Set Image"1935 },1936 //Do not allow multiple files, if you want multiple, set true1937 multiple: false1938 });1939 //callback for selected image1940 custom_file_frame.on('select’, function() {19411942 var attachment = custom_file_frame.state().get(‘selection’).first().toJSON();1943 var validExtensions = new Array();1944 validExtensions[0] = 'jpg’;1945 validExtensions[1] = 'jpeg’;1946 validExtensions[2] = 'png’;1947 validExtensions[3] = ‘gif’;19481949 var inarr = parseInt(jQuery.inArray(attachment.subtype, validExtensions));1950 if (inarr > 0 && attachment.type.toLowerCase() == ‘image’){19511952 var titleTouse = “";1953 var imageDescriptionTouse = “";1954 if (jQuery.trim(attachment.title) != ‘’){19551956 titleTouse = jQuery.trim(attachment.title);1957 }1958 else if (jQuery.trim(attachment.caption) != ‘’){19591960 titleTouse = jQuery.trim(attachment.caption);1961 }19621963 if (jQuery.trim(attachment.description) != ‘’){19641965 imageDescriptionTouse = jQuery.trim(attachment.description);1966 }1967 else if (jQuery.trim(attachment.caption) != ‘’){19681969 imageDescriptionTouse = jQuery.trim(attachment.caption);1970 }19711972 // jQuery(“#videotitle”).val(titleTouse);1973 // jQuery(“#video_description”).val(imageDescriptionTouse);19741975 if (attachment.id != ‘’){19761977 jQuery(“#HdnMediaSelection”).val(attachment.url);1978 jQuery(“#img_disp”).attr('src’, attachment.url);19791980 }19811982 }1983 else{19841985 alert(‘Invalid image selection.’);1986 }1987 //do something with attachment variable, for example attachment.filename1988 //Object:1989 //attachment.alt - image alt1990 //attachment.author - author id1991 //attachment.caption1992 //attachment.dateFormatted - date of image uploaded1993 //attachment.description1994 //attachment.editLink - edit link of media1995 //attachment.filename1996 //attachment.height1997 //attachment.icon - don’t know WTF?))1998 //attachment.id - id of attachment1999 //attachment.link - public link of attachment, for example “"http://site.com/?attachment_id=115""2000 //attachment.menuOrder2001 //attachment.mime - mime type, for example image/jpeg"2002 //attachment.name - name of attachment file, for example “my-image"2003 //attachment.status - usual is “inherit"2004 //attachment.subtype - “jpeg” if is “jpg"2005 //attachment.title2006 //attachment.type - “image"2007 //attachment.uploadedTo2008 //attachment.url - http url of image, for example “http://site.com/wp-content/uploads/2012/12/my-image.jpg"2009 //attachment.width2010 });2011 //Open modal2012 custom_file_frame.open();2013 });2014 })2015 </script>2016 </div>2017 </div>20182019 <div class="stuffbox” id="namediv” style="width: 100%">2020 <h3>2021 <label for="link_name"><?php echo __(‘Video Title’,’wp-responsive-video-gallery-with-lightbox’);?> (<span2022 style="font-size: 11px; font-weight: normal"><?php _e(‘Used into lightbox’,’wp-responsive-video-gallery-with-lightbox’); ?></span>)2023 </label>2024 </h3>2025 <div class="inside">2026 <div>2027 <input type="text” id="videotitle” tabindex="1” size="30"2028 name="videotitle” value="<?php echo $videotitle; ?>">2029 </div>2030 <div style="clear: both"></div>2031 <div></div>2032 <div style="clear: both"></div>2033 </div>2034 </div>2035 <div class="stuffbox” id="namediv” style="width: 100%">2036 <h3>2037 <label for="link_name"><?php echo __(‘Video Title Url’,’wp-responsive-video-gallery-with-lightbox’);?> (<span2038 style="font-size: 11px; font-weight: normal"><?php _e(' click on title redirect to this url.Used in lightbox for video title’,’wp-responsive-video-gallery-with-lightbox’); ?></span>)2039 </label>2040 </h3>2041 <div class="inside">2042 <div>2043 <input type="text” id="videotitleurl” class="url"2044 tabindex="1” size="30” name="videotitleurl"2045 value="<?php echo $videotitleurl; ?>">2046 </div>2047 <div style="clear: both"></div>2048 <div></div>2049 <div style="clear: both"></div>20502051 </div>2052 </div>2053 2054 2055 <?php if (isset($_GET[‘id’]) and intval($_GET[‘id’]) > 0) { ?> 2056 <input type="hidden" name="videoid" id="videoid" value="<?php echo (int) htmlentities(strip_tags($_GET[‘id’]),ENT_QUOTES); ?>">2057 <?php2058 }2059 ?>2060 <?php wp_nonce_field(‘action_image_add_edit’,’add_edit_image_nonce’); ?> 2061 <input type="submit"2062 onclick="" name="btnsave" id="btnsave" value="<?php echo __(‘Save Changes’,’wp-responsive-video-gallery-with-lightbox’);?>"2063 class="button-primary">  <input type="button"2064 name="cancle" id="cancle" value="<?php echo __(‘Cancel’,’wp-responsive-video-gallery-with-lightbox’);?>"2065 class="button-primary" onclick="location.href = ‘admin.php?page=responsive_video_gallery_with_lightbox_video_management’">20662067 </form>2068 <script type="text/javascript">20692070 2071 jQuery(document).ready(function() {20722073 jQuery.validator.setDefaults({ 2074 ignore: [],2075 // any other default options and/or rules2076 });20772078 jQuery(“#addimage”).validate({2079 rules: {2080 videotitle: {2081 required:true,2082 maxlength: 2002083 },2084 vtype: {2085 required:true20862087 },2088 videourl: {2089 required:true,2090 url:true,2091 maxlength: 5002092 },2093 HdnMediaSelection:{2094 required:true 2095 },2096 videotitleurl: {20972098 url:true,2099 maxlength: 5002100 }21012102 },2103 errorClass: "image_error",2104 errorPlacement: function(error, element) {2105 error.appendTo(element.parent().next().next());2106 }, messages: {2107 HdnMediaSelection: “Please select video thumbnail or Upload by wordpress media uploader.",21082109 }21102111 })2112 });2113 function validateFile(){21142115 2116 if (jQuery(‘#currImg’).length > 0 || jQuery.trim(jQuery(“#HdnMediaSelection”).val()) != “”){2117 return true;2118 }2119 var fragment = jQuery(“#image_name”).val();2120 var filename = jQuery(“#image_name”).val().replace(/.+[\\\/]/, “”);2121 var videoid = jQuery(“#image_name”).val();2122 if (videoid == “”){21232124 if (filename != “”)2125 return true;2126 else2127 {2128 jQuery(“#err_daynamic”).remove();2129 jQuery(“#image_name”).after('<label class="image_error” id="err_daynamic">Please select file or use media manager to select file.</label>’);2130 return false;2131 }2132 }2133 else{2134 return true;2135 }2136 }2137 function reloadfileupload(){21382139 2140 var fragment = jQuery(“#image_name”).val();2141 var filename = jQuery(“#image_name”).val().replace(/.+[\\\/]/, “”);2142 var validExtensions = new Array();2143 validExtensions[0] = ‘jpg’;2144 validExtensions[1] = ‘jpeg’;2145 validExtensions[2] = ‘png’;2146 validExtensions[3] = ‘gif’;2147 validExtensions[4] = ‘bmp’;2148 validExtensions[5] = ‘tif’;2149 var extension = filename.substr((filename.lastIndexOf(‘.’) + 1)).toLowerCase();2150 var inarr = parseInt(jQuery.inArray(extension, validExtensions));2151 if (inarr < 0){21522153 jQuery(“#err_daynamic”).remove();2154 jQuery(‘#fileuploaddiv’).html(jQuery(‘#fileuploaddiv’).html());2155 jQuery(“#image_name”).after(‘<label class="image_error" id="err_daynamic">Invalid file extension</label>’);2156 }2157 else{2158 jQuery(“#err_daynamic”).remove();2159 }216021612162 }2163 </script>21642165 </div>2166 </div>2167 </div>2168 2169 </div>2170 </div>2171 </div>2172 </div> 2173 <div id="postbox-container-1" class="postbox-container" > 21742175 <div class="postbox"> 2176 <h3 class="hndle"><span></span><?php echo __(‘Access All Themes In One Price’,’wp-responsive-video-gallery-with-lightbox’);?></h3> 2177 <div class="inside">2178 <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>21792180 <div style="margin:10px 5px">21812182 </div>2183 </div></div>2184 <div class="postbox"> 2185 <h3 class="hndle"><span></span><?php echo __(‘Google For Business Coupon’,’wp-responsive-video-gallery-with-lightbox’);?></h3> 2186 <div class="inside">2187 <center><a href="https://goo.gl/OJBuHT" target="_blank">2188 <img src="<?php echo plugins_url( ‘images/g-suite-promo-code-4.png’, __FILE__ );?>" width="250" height="250" border="0">2189 </a></center>2190 <div style="margin:10px 5px">2191 </div>2192 </div>2193 2194 </div>21952196 </div> 2197 </div>2198 </div> 2199<?php2200 }2201 } else if (strtolower ( $action ) == strtolower ( ‘delete’ )) {2202 2203 2204 $retrieved_nonce = ‘’;22052206 if(isset($_GET[‘nonce’]) and $_GET[‘nonce’]!=’’){22072208 $retrieved_nonce=$_GET[‘nonce’];22092210 }2211 if (!wp_verify_nonce($retrieved_nonce, ‘delete_image’ ) ){221222132214 wp_die(‘Security check fail’); 2215 }2216 2217 if ( ! current_user_can( ‘rvg_responsive_video_gallery_delete_video’ ) ) {22182219 $location=’admin.php?page=responsive_video_gallery_with_lightbox_video_management’;2220 $responsive_video_gallery_plus_lightbox_messages=array();2221 $responsive_video_gallery_plus_lightbox_messages[‘type’]=’err’;2222 $responsive_video_gallery_plus_lightbox_messages[‘message’]=__(‘Access Denied. Please contact your administrator.’,’wp-responsive-video-gallery-with-lightbox’);2223 update_option(‘responsive_video_gallery_plus_lightbox_messages’, $responsive_video_gallery_plus_lightbox_messages);2224 echo "<script type=’text/javascript’> location.href=’$location’;</script>"; 2225 exit; 22262227 }2228 2229 $uploads = wp_upload_dir ();2230 $baseDir = $uploads [‘basedir’];2231 $baseDir = str_replace ( "\\", “/", $baseDir );2232 $pathToImagesFolder = $baseDir . ‘/wp-responsive-video-gallery-with-lightbox’;2233 2234 2235 $location = "admin.php?page=responsive_video_gallery_with_lightbox_video_management";2236 $deleteId = ( int ) htmlentities(strip_tags($_GET [‘id’]),ENT_QUOTES);2237 2238 try {2239 2240 $query = "SELECT * FROM " . $wpdb->prefix . “responsive_video_gallery_plus_responsive_lightbox WHERE id=$deleteId";2241 $myrow = $wpdb->get_row ( $query );2242 2243 if (is_object ( $myrow )) {2244 2245 $image_name = $myrow->image_name;2246 $wpcurrentdir = dirname ( __FILE__ );2247 $wpcurrentdir = str_replace ( “\\", “/", $wpcurrentdir );2248 $imagetoDel = $pathToImagesFolder . ‘/’ . $image_name;2249 $settings=get_option(‘responsive_video_gallery_slider_settings’);2250 $imageheight = $settings [‘imageheight’];2251 $imagewidth = $settings [‘imagewidth’];2252 2253 $pInfo = pathinfo ( $myrow->HdnMediaSelection );2254 $ext = $pInfo [‘extension’];22552256 @unlink ( $imagetoDel );2257 @unlink($pathToImagesFolder.’/’.$myrow->vid . '_big_’.$imageheight.’_’.$imagewidth.’.’.$ext);22582259 2260 $query = “delete from " . $wpdb->prefix . “responsive_video_gallery_plus_responsive_lightbox where id=$deleteId";2261 $wpdb->query ( $query );2262 2263 $responsive_video_gallery_plus_lightbox_messages = array ();2264 $responsive_video_gallery_plus_lightbox_messages [‘type’] = 'succ’;2265 $responsive_video_gallery_plus_lightbox_messages [‘message’] = __(‘Video deleted successfully.’,’wp-responsive-video-gallery-with-lightbox’);2266 update_option ( 'responsive_video_gallery_plus_lightbox_messages’, $responsive_video_gallery_plus_lightbox_messages );2267 }2268 } catch ( Exception $e ) {2269 2270 $responsive_video_gallery_plus_lightbox_messages = array ();2271 $responsive_video_gallery_plus_lightbox_messages [‘type’] = 'err’;2272 $responsive_video_gallery_plus_lightbox_messages [‘message’] = __(‘Error while deleting video.’,’wp-responsive-video-gallery-with-lightbox’);2273 update_option ( 'responsive_video_gallery_plus_lightbox_messages’, $responsive_video_gallery_plus_lightbox_messages );2274 }2275 2276 echo “<script type=’text/javascript’> location.href=’$location’;</script>";2277 exit ();2278 2279 } else if (strtolower ( $action ) == strtolower ( ‘deleteselected’ )) {2280 2281 if(!check_admin_referer(‘action_settings_mass_delete’,’mass_delete_nonce’)){22822283 wp_die(‘Security check fail’); 2284 }2285 2286 if ( ! current_user_can( ‘rvg_responsive_video_gallery_delete_video’ ) ) {22872288 $location=’admin.php?page=responsive_video_gallery_with_lightbox_video_management’;2289 $responsive_video_gallery_plus_lightbox_messages=array();2290 $responsive_video_gallery_plus_lightbox_messages[‘type’]=’err’;2291 $responsive_video_gallery_plus_lightbox_messages[‘message’]=__(‘Access Denied. Please contact your administrator.’,’wp-responsive-video-gallery-with-lightbox’);2292 update_option(‘responsive_video_gallery_plus_lightbox_messages’, $responsive_video_gallery_plus_lightbox_messages);2293 echo "<script type=’text/javascript’> location.href=’$location’;</script>"; 2294 exit; 22952296 }2297 2298 $location = "admin.php?page=responsive_video_gallery_with_lightbox_video_management";2299 2300 if (isset ( $_POST ) and isset ( $_POST [‘deleteselected’] ) and ($_POST [‘action’] == ‘delete’ or $_POST [‘action_upper’] == ‘delete’)) {2301 2302 $uploads = wp_upload_dir ();2303 $baseDir = $uploads [‘basedir’];2304 $baseDir = str_replace ( "\\", "/", $baseDir );2305 $pathToImagesFolder = $baseDir . ‘/wp-responsive-video-gallery-with-lightbox’;2306 2307 if (sizeof ( $_POST [‘thumbnails’] ) > 0) {2308 2309 $deleteto = $_POST [‘thumbnails’];2310 $implode = implode ( ‘,’, $deleteto );2311 2312 try {2313 2314 $settings=get_option(‘responsive_video_gallery_slider_settings’);2315 $imageheight = $settings [‘imageheight’];2316 $imagewidth = $settings [‘imagewidth’];23172318 foreach ( $deleteto as $img ) {2319 2320 $img=intval($img);2321 $query = "SELECT * FROM " . $wpdb->prefix . "responsive_video_gallery_plus_responsive_lightbox WHERE id=$img";2322 $myrow = $wpdb->get_row ( $query );2323 2324 if (is_object ( $myrow )) {2325 2326 $image_name = $myrow->image_name;2327 $wpcurrentdir = dirname ( __FILE__ );2328 $wpcurrentdir = str_replace ( "\\", "/", $wpcurrentdir );2329 $imagetoDel = $pathToImagesFolder . ‘/’ . $image_name;2330 2331 $pInfo = pathinfo ( $myrow->HdnMediaSelection );2332 $ext = $pInfo [‘extension’];23332334 @unlink ( $imagetoDel );2335 @unlink($pathToImagesFolder.’/’.$myrow->vid . ‘_big_’.$imageheight.’_’.$imagewidth.’.’.$ext);23362337 2338 2339 $query = "delete from " . $wpdb->prefix . "responsive_video_gallery_plus_responsive_lightbox where id=$img";2340 $wpdb->query ( $query );2341 2342 $responsive_video_gallery_plus_lightbox_messages = array ();2343 $responsive_video_gallery_plus_lightbox_messages [‘type’] = ‘succ’;2344 $responsive_video_gallery_plus_lightbox_messages [‘message’] = __(‘Selected videos deleted successfully.’,’wp-responsive-video-gallery-with-lightbox’);2345 update_option ( ‘responsive_video_gallery_plus_lightbox_messages’, $responsive_video_gallery_plus_lightbox_messages );2346 }2347 }2348 } catch ( Exception $e ) {2349 2350 $responsive_video_gallery_plus_lightbox_messages = array ();2351 $responsive_video_gallery_plus_lightbox_messages [‘type’] = ‘err’;2352 $responsive_video_gallery_plus_lightbox_messages [‘message’] = __(‘Error while deleting videos.’,’wp-responsive-video-gallery-with-lightbox’);2353 update_option ( ‘responsive_video_gallery_plus_lightbox_messages’, $responsive_video_gallery_plus_lightbox_messages );2354 }2355 2356 echo "<script type=’text/javascript’> location.href=’$location’;</script>";2357 exit ();2358 } else {2359 2360 echo "<script type=’text/javascript’> location.href=’$location’;</script>";2361 exit ();2362 }2363 } else {2364 2365 echo "<script type=’text/javascript’> location.href=’$location’;</script>";2366 exit ();2367 }2368 }2369}2370function responsive_video_gallery_with_lightbox_video_preview_func() {2371 2372 if ( ! current_user_can( ‘rvg_responsive_video_gallery_preview’ ) ) {23732374 wp_die( __( "Access Denied", “wp-responsive-video-gallery-with-lightbox” ) );23752376 } 23772378 global $wpdb;2379 $settings=get_option(‘responsive_video_gallery_slider_settings’);2380 2381 $rand_Numb = uniqid ( ‘thumnail_slider’ );2382 $rand_Num_td = uniqid ( ‘divSliderMain’ );2383 $rand_var_name = uniqid ( ‘rand_’ );2384 2385 2386 $wpcurrentdir = dirname ( __FILE__ );2387 $wpcurrentdir = str_replace ( "\\", "/", $wpcurrentdir );2388 // $settings=get_option(‘thumbnail_slider_settings’);2389 2390 $uploads = wp_upload_dir ();2391 $baseDir = $uploads [‘basedir’];2392 $baseDir = str_replace ( “\\", “/", $baseDir );2393 $pathToImagesFolder = $baseDir . '/wp-responsive-video-gallery-with-lightbox’;2394 $baseurl = $uploads [‘baseurl’];2395 $baseurl .= '/wp-responsive-video-gallery-with-lightbox/’;2396 ?> 2397 <style type=’text/css’>2398 #<?php echo $rand_Num_td;?> .bx-wrapper .bx-viewport {background: none repeat scroll 0 0<?php echo $settings [‘scollerBackground’];?> ! important;2399 border: 0px none !important;2400 box-shadow: 0 0 0 0 !important;2401 /*padding:<?php echo $settings[‘imageMargin’]; ?>px !important;*/2402 }2403 #poststuff #post-body.columns-2{margin-right: 0px}2404 </style>2405<?php2406 $wpcurrentdir = dirname ( __FILE__ );2407 $wpcurrentdir = str_replace ( “\\", “/", $wpcurrentdir );2408 $randOmeAlbName = uniqid ( ‘alb_’ );2409 $randOmeRel = uniqid ( ‘rel_’ );2410 2411 ?>2412 <div style="width: 100%;">2413 <div style="float: left; width: 100%;">2414 <div class="wrap">2415 <h2>Slider Preview</h2>2416 2417 <?php if (is_array($settings)) { ?>2418 <div id="poststuff">2419 <div id="post-body” class="metabox-holder columns-2">2420 <div id="post-body-content">2421 <div style="clear: both;"></div>2422 <?php $url = plugin_dir_url(__FILE__); ?> 24232424 <div style="width: auto; postion: relative” id="<?php echo $rand_Num_td; ?>">2425 <div id="<?php echo $rand_Numb; ?>” class="responsiveSlider” style="margin-top: 2px !important;display:none;">2426 <?php2427 global $wpdb;2428 $imageheight = $settings [‘imageheight’];2429 $imagewidth = $settings [‘imagewidth’];2430 $query = "SELECT * FROM " . $wpdb->prefix . "responsive_video_gallery_plus_responsive_lightbox order by createdon desc";2431 $rows = $wpdb->get_results ( $query, ‘ARRAY_A’ );24322433 if (count ( $rows ) > 0) {2434 2435 foreach ( $rows as $row ) {24362437 $imagename = $row [‘image_name’];2438 $video_url = $row [‘video_url’];2439 $imageUploadTo = $pathToImagesFolder . ‘/’ . $imagename;2440 $imageUploadTo = str_replace ( "\\", "/", $imageUploadTo );2441 $pathinfo = pathinfo ( $imageUploadTo );2442 $filenamewithoutextension = $pathinfo [‘filename’];2443 $outputimg = "";24442445 $outputimgmain = $baseurl . $row [‘image_name’];2446 if ($settings [‘resizeImages’] == 0) {24472448 $outputimg = $baseurl . $row [‘image_name’];2449 } else {2450 $imagetoCheck = $pathToImagesFolder . ‘/’ . $filenamewithoutextension . ‘_’ . $imageheight . ‘_’ . $imagewidth . ‘.’ . $pathinfo [‘extension’];24512452 if (file_exists ( $imagetoCheck )) {2453 $outputimg = $baseurl . $filenamewithoutextension . ‘_’ . $imageheight . ‘_’ . $imagewidth . ‘.’ . $pathinfo [‘extension’];2454 } else {24552456 if (function_exists ( ‘wp_get_image_editor’ )) {24572458 $image = wp_get_image_editor ( $pathToImagesFolder . “/” . $row [‘image_name’] );24592460 if (! is_wp_error ( $image )) {2461 $image->resize ( $imagewidth, $imageheight, true );2462 $image->save ( $imagetoCheck );2463 $outputimg = $baseurl . $filenamewithoutextension . ‘_’ . $imageheight . ‘_’ . $imagewidth . ‘.’ . $pathinfo [‘extension’];2464 } else {2465 $outputimg = $baseurl . $row [‘image_name’];2466 }2467 } else if (function_exists ( ‘image_resize’ )) {24682469 $return = image_resize ( $pathToImagesFolder . “/” . $row [‘image_name’], $imagewidth, $imageheight );2470 if (! is_wp_error ( $return )) {24712472 $isrenamed = rename ( $return, $imagetoCheck );2473 if ($isrenamed) {2474 $outputimg = $baseurl . $filenamewithoutextension . ‘_’ . $imageheight . ‘_’ . $imagewidth . ‘.’ . $pathinfo [‘extension’];2475 } else {2476 $outputimg = $baseurl . $row [‘image_name’];2477 }2478 } else {2479 $outputimg = $baseurl . $row [‘image_name’];2480 }2481 } else {24822483 $outputimg = $baseurl . $row [‘image_name’];2484 }24852486 // $url = plugin_dir_url(__FILE__)."imagestoscroll/".$filenamewithoutextension.’_’.$imageheight.’_’.$imagewidth.’.’.$pathinfo[‘extension’];2487 }2488 }2489 $embed_url=$row[‘embed_url’];24902491 $title="";2492 $rowTitle=$row[‘videotitle’];2493 $rowTitle=str_replace("’","’",$rowTitle); 2494 $rowTitle=str_replace(‘"’,’”’,$rowTitle); 2495 2496 $rowDescrption=$row[‘video_description’];2497 $rowDescrption=str_replace("’","’",$rowDescrption); 2498 $rowDescrption=str_replace(‘"’,’”’,$rowDescrption); 2499 $rowDescrption=strip_tags($rowDescrption); 2500 2501 if(strlen($rowDescrption)>300){2502 2503 $rowDescrption=substr($rowDescrption,0,300)."…"; 2504 }2505 //$openImageInNewTab=’_blank’;2506 $open_link_in=$row[‘open_link_in’];2507 // if($open_link_in==0){2508 $openImageInNewTab=’_self’; 2509 //}2510 2511 if(trim($row[‘videotitle’])!=’’ and trim($row[‘videotitleurl’])!=’’){2512 2513 $title="<a class=’Imglink’ target=’$openImageInNewTab’ href=’{$row[‘videotitleurl’]}’>{$rowTitle}</a>";2514 if($row[‘video_description’]!=’’){2515 $title.="<div class=’clear_description_’>{$rowDescrption}</div>";2516 }2517 }2518 else if(trim($row[‘videotitle’])!=’’ and trim($row[‘videotitleurl’])==’’){2519 2520 $title="<a class=’Imglink’ href=’#’>{$rowTitle}</a>"; 2521 if($row[‘video_description’]!=’’){2522 $title.="<div class=’clear_description_’>{$rowDescrption}</div>";2523 }2524 }2525 else{2526 2527 if($row[‘video_description’]!=’’)2528 $title="<div class=’clear_description_’>{$row[‘video_description’]}</div>"; 2529 }2530 2531 2532 ?>2533 <div class="i13_bx_slider">2534 <a rel="<?php echo $randOmeRel;?>” data-overlay="1” data-title="<?php echo $title;?>” class="video_lbox” href="<?php echo $embed_url;?>">2535 <img src="<?php echo $outputimg; ?>” alt="<?php echo $rowTitle; ?>” title="<?php if(trim($rowDescrption)!=’’){ echo $rowDescrption;} else{echo $rowTitle;}; ?>” />2536 <span class="playbtnCss"></span> 2537 </a> 2538 2539 </div>2540 2541 <?php } ?> 2542 <?php } ?> 2543 </div>2544 </div>2545 <script>2546 2547 var uniqObj=jQuery("a[rel^=’<?php echo $randOmeRel;?>’]");2548 2549 jQuery(document).ready(function(){2550 jQuery(“#<?php echo $rand_Numb; ?>”).show();2551 var <?php echo $rand_var_name; ?> = jQuery(‘#<?php echo $rand_Num_td; ?>’).html();2552 jQuery(‘#<?php echo $rand_Numb; ?>’).bxSlider({2553 <?php if($settings[‘visible’]==1 ):?>2554 mode:’fade’,2555 <?php endif;?>2556 slideWidth: <?php echo $settings[‘imagewidth’]; ?>,2557 minSlides: <?php echo $settings[‘min_visible’]; ?>,2558 maxSlides: <?php echo $settings[‘visible’]; ?>,2559 moveSlides: <?php echo $settings[‘scroll’]; ?>,2560 preventDefaultSwipeY: false,2561 slideMargin:<?php echo $settings[‘imageMargin’]; ?>,2562 speed:<?php echo $settings[‘speed’]; ?>,2563 pause:<?php echo $settings[‘pause’]; ?>,2564 <?php if($settings[‘pauseonmouseover’] and ($settings[‘auto’]==1 or $settings[‘auto’]==2) ){ ?>2565 autoHover: true,2566 <?php2567 } else {2568 if ($settings[‘auto’]==1 or $settings[‘auto’]==2) {2569 ?>2570 autoHover:false,2571 <?php2572 }2573 }2574 ?>2575 <?php if ($settings[‘auto’]==1): ?>2576 controls:false,2577 <?php else: ?>2578 controls:true,2579 <?php endif; ?>2580 useCSS:false,2581 <?php if($settings[‘auto’]==1 or $settings[‘auto’]==2):?>2582 autoStart:true,2583 autoDelay:200,2584 auto:true,2585 <?php endif; ?>2586 <?php if ($settings[‘circular’]): ?>2587 infiniteLoop: true,2588 <?php else: ?>2589 infiniteLoop: false,2590 <?php endif; ?>2591 <?php if($settings[‘show_pager’]):?>2592 pager:true, 2593 <?php else:?>2594 pager:false,2595 <?php endif;?>2596 <?php if($settings[‘show_caption’]):?>2597 captions:true, 2598 <?php else:?>2599 captions:false,2600 <?php endif;?>2601 onSlideBefore: function(slideElement){2602 2603 jQuery(slideElement).find(‘img’).each(function(index, elm) {2604 2605 if(!elm.complete || elm.naturalWidth === 0){26062607 var toload=’’;2608 var toloadval=’’;2609 jQuery.each(elm.attributes, function(i, attrib){26102611 var value = attrib.value;2612 var aname=attrib.name;26132614 var pattern = /^((http|https):\/\/)/;26152616 if(pattern.test(value) && aname!=’src’ && aname.indexOf(‘data-html5_vurl’)==-1) {26172618 toload=aname;2619 toloadval=value;2620 }2621 // do your magic :-)2622 });26232624 vsrc= jQuery(elm).attr(“src”);2625 jQuery(elm).removeAttr(“src”);2626 dsrc= jQuery(elm).attr(“data-src”);2627 lsrc= jQuery(elm).attr(“data-lazy-src”);26282629 if(dsrc!== undefined && dsrc!=’’ && dsrc!=vsrc){2630 jQuery(elm).attr("src",dsrc);2631 }2632 else if(lsrc!== undefined && lsrc!=vsrc){26332634 jQuery(elm).attr("src",lsrc);2635 }2636 else if(toload!=’’ && toload!=’srcset’ && toloadval!=’’ && toloadval!=vsrc){26372638 $(elm).attr(“src",toloadval);263926402641 } 2642 else{26432644 jQuery(elm).attr(“src",vsrc);26452646 } 26472648 elm= jQuery(elm)[0]; 2649 if(!elm.complete && elm.naturalHeight == 0){26502651 jQuery(elm).removeAttr(‘loading’);2652 jQuery(elm).removeAttr(‘data-lazy-type’);265326542655 jQuery(elm).removeClass(‘lazy’);26562657 jQuery(elm).removeClass(‘lazyLoad’);2658 jQuery(elm).removeClass(‘lazy-loaded’);2659 jQuery(elm).removeClass(‘jetpack-lazy-image’);2660 jQuery(elm).removeClass(‘jetpack-lazy-image–handled’);2661 jQuery(elm).removeClass(‘lazy-hidden’);26622663 }26642665 2666 }2667 2668 });26692670 }, 2671 onSliderLoad: function(){2672 2673 2674 jQuery(“.video_lbox”).fancybox_vgl({2675 ‘type’ : “iframe",2676 'overlayColor’:’#000000’,2677 'padding’: 10,2678 'autoScale’: true,2679 'autoDimensions’:true,2680 'transitionIn’: 'none’,2681 'uniqObj’:uniqObj,2682 'transitionOut’: 'none’,2683 'titlePosition’: 'outside’,2684 <?php if ($settings[‘circular’]): ?>2685 'cyclic’:true,2686 <?php else: ?>2687 'cyclic’:false,2688 <?php endif; ?>2689 'hideOnContentClick’:false,2690 ‘width’ : 650,2691 ‘height’ : 400,2692 'titleFormat’: function(title, currentArray, currentIndex, currentOpts) {26932694 var currtElem = jQuery('#<?php echo $rand_Numb; ?> a[href="’+currentOpts.href+’”]');26952696 var isoverlay = jQuery(currtElem).attr(‘data-overlay’)26972698 if(isoverlay=="1” && jQuery.trim(title)!="”){2699 return ‘<span id="fancybox_vgl-title-over">’ + title + ‘</span>’;2700 }2701 else{2702 return ‘’;2703 }27042705 },27062707 });2708 2709 2710 2711 2712 } 27132714 });2715 jQuery(“#<?php echo $rand_Numb; ?>”).show();2716 <?php if ($settings[‘auto’]) { ?>2717 <?php $newrand = rand(0, 1111111111); ?>2718 var is_firefox = navigator.userAgent.toLowerCase().indexOf(‘firefox’) > - 1;2719 var is_android = navigator.userAgent.toLowerCase().indexOf(‘android’) > - 1;2720 var is_iphone = navigator.userAgent.toLowerCase().indexOf(‘iphone’) > - 1;2721 var width = jQuery(window).width();2722 if (is_firefox && (is_android || is_iphone)){27232724 } else{2725 var timer;2726 jQuery(window).bind(‘resize’, function(){2727 if (jQuery(window).width() != width){2728 2729 width = jQuery(window).width();2730 timer && clearTimeout(timer);2731 timer = setTimeout(onResize<?php echo $newrand; ?>, 600);2732 }2733 });2734 }27352736 function onResize<?php echo $newrand; ?>(){2737 jQuery(‘#<?php echo $rand_Num_td; ?>’).html(‘’);2738 jQuery(‘#<?php echo $rand_Num_td; ?>’).html(<?php echo $rand_var_name; ?>);2739 jQuery(“#<?php echo $rand_Numb; ?>”).show();2740 jQuery(‘#<?php echo $rand_Numb; ?>’).bxSlider({27412742 <?php if($settings[‘visible’]==1 ):?>2743 mode:’fade’,2744 <?php endif;?>2745 slideWidth: <?php echo $settings[‘imagewidth’]; ?>,2746 minSlides: <?php echo $settings[‘min_visible’]; ?>,2747 maxSlides: <?php echo $settings[‘visible’]; ?>,2748 moveSlides: <?php echo $settings[‘scroll’]; ?>,2749 slideMargin:<?php echo $settings[‘imageMargin’]; ?>,2750 preventDefaultSwipeY: false,2751 speed:<?php echo $settings[‘speed’]; ?>,2752 pause:<?php echo $settings[‘pause’]; ?>,2753 <?php if($settings[‘pauseonmouseover’] and ($settings[‘auto’]==1 or $settings[‘auto’]==2) ){ ?>2754 autoHover: true,2755 <?php2756 } 2757 else {2758 if ($settings[‘auto’]==1 or $settings[‘auto’]==2) {2759 ?>2760 autoHover:false,2761 <?php2762 }2763 }2764 ?>2765 <?php if ($settings[‘auto’]==1): ?>2766 controls:false,2767 <?php else: ?>2768 controls:true,2769 <?php endif; ?>2770 pager:false,2771 useCSS:false,2772 <?php if ($settings[‘auto’]==1 or $settings[‘auto’]==2): ?>2773 autoStart:true,2774 autoDelay:200,2775 auto:true,2776 <?php endif; ?>2777 <?php if ($settings[‘circular’]): ?>2778 infiniteLoop: true,2779 <?php else: ?>2780 infiniteLoop: false,2781 <?php endif; ?>2782 <?php if($settings[‘show_pager’]):?>2783 pager:true, 2784 <?php else:?>2785 pager:false,2786 <?php endif;?>2787 <?php if($settings[‘show_caption’]):?>2788 captions:true, 2789 <?php else:?>2790 captions:false,2791 <?php endif;?> 2792 onSlideBefore: function(slideElement){2793 2794 jQuery(slideElement).find(‘img’).each(function(index, elm) {27952796 if(!elm.complete || elm.naturalWidth === 0){27972798 var toload=’’;2799 var toloadval=’’;2800 jQuery.each(elm.attributes, function(i, attrib){28012802 var value = attrib.value;2803 var aname=attrib.name;28042805 var pattern = /^((http|https):\/\/)/;28062807 if(pattern.test(value) && aname!=’src’ && aname.indexOf(‘data-html5_vurl’)==-1) {28082809 toload=aname;2810 toloadval=value;2811 }2812 // do your magic :-)2813 });28142815 vsrc= jQuery(elm).attr(“src”);2816 jQuery(elm).removeAttr(“src”);2817 dsrc= jQuery(elm).attr(“data-src”);2818 lsrc= jQuery(elm).attr(“data-lazy-src”);28192820 if(dsrc!== undefined && dsrc!=’’ && dsrc!=vsrc){2821 jQuery(elm).attr("src",dsrc);2822 }2823 else if(lsrc!== undefined && lsrc!=vsrc){28242825 jQuery(elm).attr("src",lsrc);2826 }2827 else if(toload!=’’ && toload!=’srcset’ && toloadval!=’’ && toloadval!=vsrc){28282829 $(elm).attr(“src",toloadval);283028312832 } 2833 else{28342835 jQuery(elm).attr(“src",vsrc);28362837 } 28382839 elm= jQuery(elm)[0]; 2840 if(!elm.complete && elm.naturalHeight == 0){28412842 jQuery(elm).removeAttr(‘loading’);2843 jQuery(elm).removeAttr(‘data-lazy-type’);284428452846 jQuery(elm).removeClass(‘lazy’);28472848 jQuery(elm).removeClass(‘lazyLoad’);2849 jQuery(elm).removeClass(‘lazy-loaded’);2850 jQuery(elm).removeClass(‘jetpack-lazy-image’);2851 jQuery(elm).removeClass(‘jetpack-lazy-image–handled’);2852 jQuery(elm).removeClass(‘lazy-hidden’);28532854 }285528562857 }28582859 });28602861 }, 2862 onSliderLoad: function(){2863 2864 2865 jQuery(“.video_lbox”).fancybox_vgl({2866 ‘type’ : “iframe",2867 'overlayColor’:’#000000’,2868 'padding’: 10,2869 'autoScale’: true,2870 'autoDimensions’:true,2871 'transitionIn’: 'none’,2872 'uniqObj’:uniqObj,2873 'transitionOut’: 'none’,2874 'titlePosition’: 'outside’,2875 <?php if ($settings[‘circular’]): ?>2876 'cyclic’:true,2877 <?php else: ?>2878 'cyclic’:false,2879 <?php endif; ?>2880 'hideOnContentClick’:false,2881 ‘width’ : 650,2882 ‘height’ : 400,2883 'titleFormat’: function(title, currentArray, currentIndex, currentOpts) {28842885 var currtElem = jQuery('#<?php echo $rand_Numb; ?> a[href="’+currentOpts.href+’”]');28862887 var isoverlay = jQuery(currtElem).attr(‘data-overlay’)28882889 if(isoverlay=="1” && jQuery.trim(title)!="”){2890 return ‘<span id="fancybox_vgl-title-over">’ + title + ‘</span>’;2891 }2892 else{2893 return ‘’;2894 }28952896 },28972898 });28992900290129022903 } 29042905 });2906 2907 }29082909 <?php } ?>29102911 2912 window.rebind<?php echo $rand_Numb;?> = function() {29132914 jQuery(“.video_lbox”).fancybox_vgl({2915 ‘type’ : “iframe",2916 'overlayColor’:’#000000’,2917 'padding’: 10,2918 'autoScale’: true,2919 'autoDimensions’:true,2920 'transitionIn’: 'none’,2921 'uniqObj’:uniqObj,2922 'transitionOut’: 'none’,2923 'titlePosition’: 'outside’,2924 <?php if ($settings[‘circular’]): ?>2925 'cyclic’:true,2926 <?php else: ?>2927 'cyclic’:false,2928 <?php endif; ?>2929 'hideOnContentClick’:false,2930 ‘width’ : 650,2931 ‘height’ : 400,2932 'titleFormat’: function(title, currentArray, currentIndex, currentOpts) {29332934 var currtElem = jQuery('#<?php echo $rand_Numb; ?> a[href="’+currentOpts.href+’”]');29352936 var isoverlay = jQuery(currtElem).attr(‘data-overlay’)29372938 if(isoverlay=="1" && jQuery.trim(title)!=""){2939 return ‘<span id="fancybox_vgl-title-over">’ + title + ‘</span>’;2940 }2941 else{2942 return ‘’;2943 }29442945 },29462947 });29482949 }2950 2951 2952 });2953 2954 window.addEventListener(‘load’, function() {295529562957 setTimeout(function(){ 29582959 if(jQuery(“#<?php echo $rand_Numb;?>”).find(‘.bx-loading’).length>0){29602961 jQuery(“#<?php echo $rand_Numb;?>”).find(‘img’).each(function(index, elm) {29622963 if(!elm.complete || elm.naturalWidth === 0){2964 2965 var toload=’’;2966 var toloadval=’’;2967 jQuery.each(this.attributes, function(i, attrib){29682969 var value = attrib.value;2970 var aname=attrib.name;29712972 var pattern = /^((http|https):\/\/)/;29732974 if(pattern.test(value) && aname!=’src’) {29752976 toload=aname;2977 toloadval=value;2978 }2979 // do your magic :-)2980 });29812982 vsrc=jQuery(elm).attr(“src”);2983 jQuery(elm).removeAttr(“src”);2984 dsrc=jQuery(elm).attr(“data-src”);2985 lsrc=jQuery(elm).attr(“data-lazy-src”);298629872988 if(dsrc!== undefined && dsrc!=’’ && dsrc!=vsrc){2989 jQuery(elm).attr("src",dsrc);2990 }2991 else if(lsrc!== undefined && lsrc!=vsrc){29922993 jQuery(elm).attr("src",lsrc);2994 }2995 else if(toload!=’’ && toload!=’srcset’ && toloadval!=’’ && toloadval!=vsrc){29962997 jQuery(elm).removeAttr(toload);2998 jQuery(elm).attr("src",toloadval);299930003001 } 3002 else{30033004 jQuery(elm).attr(“src",vsrc);30053006 } 30073008 elm=jQuery(elm)[0]; 3009 if(!elm.complete && elm.naturalHeight == 0){30103011 jQuery(elm).removeAttr(‘loading’);3012 jQuery(elm).removeAttr(‘data-lazy-type’);301330143015 jQuery(elm).removeClass(‘lazy’);30163017 jQuery(elm).removeClass(‘lazyLoad’);3018 jQuery(elm).removeClass(‘lazy-loaded’);3019 jQuery(elm).removeClass(‘jetpack-lazy-image’);3020 jQuery(elm).removeClass(‘jetpack-lazy-image–handled’);3021 jQuery(elm).removeClass(‘lazy-hidden’);30223023 }3024 }30253026 }).promise().done( function(){ 30273028 3029 jQuery(“#<?php echo $rand_Num_td;?>”).find(‘.bx-loading’).remove();3030 } );30313032 }303330343035 }, 6000);30363037 });3038 </script>3039 3040 </div>3041 </div>3042 </div> 3043 <?php } ?>3044 </div>3045 </div>3046 <div class="clear"></div>3047 </div>3048 <?php if (is_array($settings)) { ?>30493050 <h3><?php echo __(‘To print this video carousel into WordPress Post/Page use below code’,’wp-responsive-video-gallery-with-lightbox’);?></h3>3051 <input type="text” value=’[print_responsive_video_gallery_plus_lightbox] ‘3052 style="width: 400px; height: 30px"3053 onclick="this.focus(); this.select()" />3054 <div class="clear"></div>3055 <h3><?php echo __(‘To print this video carousel into WordPress theme/template PHP files use below code’,’wp-responsive-video-gallery-with-lightbox’);?></h3>3056 <?php3057 $shortcode = '[print_responsive_video_gallery_plus_lightbox]‘;3058 ?>3059 <input type="text" value="<?php echo do_shortcode(‘<?php echo htmlentities($shortcode, ENT_QUOTES); ?>’); ?>" style="width: 400px; height: 30px" onclick="this.focus(); this.select()" />3060 <?php } ?>3061 <div class="clear"></div>3062 <?php3063 }3064function print_responsive_video_gallery_plus_lightbox_func($atts) {3065 3066 3067 wp_enqueue_style(‘wp-video-gallery-lighbox-style’);3068 wp_enqueue_style(‘vl-box-css’);3069 wp_enqueue_script(‘jquery’);3070 wp_enqueue_script(‘video-gallery-jc’);3071 wp_enqueue_script(‘effects-video-plus-light-box’);3072 wp_enqueue_script(‘vl-box-js’);30733074 3075 ob_start();3076 global $wpdb;30773078 $settings=get_option(‘responsive_video_gallery_slider_settings’);3079 $rand_Numb = uniqid ( ‘thumnail_slider’ );3080 $rand_Num_td = uniqid ( ‘divSliderMain’ );3081 $rand_var_name = uniqid ( ‘rand_’ );3082 3083 3084 $wpcurrentdir = dirname ( __FILE__ );3085 $wpcurrentdir = str_replace ( "\\", “/", $wpcurrentdir );3086 // $settings=get_option(‘thumbnail_slider_settings’);3087 3088 $uploads = wp_upload_dir ();3089 $baseDir = $uploads [‘basedir’];3090 $baseDir = str_replace ( “\\", “/", $baseDir );3091 $pathToImagesFolder = $baseDir . '/wp-responsive-video-gallery-with-lightbox’;3092 $baseurl = $uploads [‘baseurl’];3093 $baseurl .= '/wp-responsive-video-gallery-with-lightbox/’;3094 $randOmeRel = uniqid ( ‘rel_’ );3095 $randOmVlBox= uniqid(‘video_lbox_’);3096 ?><!-- print_responsive_video_gallery_plus_lightbox_func --><style type=’text/css’>3097 #<?php echo $rand_Num_td;?> .bx-wrapper .bx-viewport {3098 background: none repeat scroll 0 0<?php echo $settings [‘scollerBackground’];?> ! important;3099 border: 0px none !important;3100 box-shadow: 0 0 0 0 !important;3101 /*padding:<?php echo $settings[‘imageMargin’]; ?>px !important;*/3102 }3103 </style> 3104 <?php3105 3106 if (is_array($settings)) 3107 3108 { ?>3109 <div style="clear: both;"></div>3110 <?php $url = plugin_dir_url(__FILE__); ?> 31113112 <div style="width: auto; postion: relative” id="<?php echo $rand_Num_td; ?>">3113 <div id="<?php echo $rand_Numb; ?>” class="responsiveSlider” style="margin-top: 2px !important; display:none">3114 <?php3115 global $wpdb;3116 $imageheight = $settings [‘imageheight’];3117 $imagewidth = $settings [‘imagewidth’];3118 $query = "SELECT * FROM " . $wpdb->prefix . "responsive_video_gallery_plus_responsive_lightbox order by createdon desc";3119 $rows = $wpdb->get_results ( $query, ‘ARRAY_A’ );31203121 if (count ( $rows ) > 0) {3122 foreach ( $rows as $row ) {31233124 $imagename = $row [‘image_name’];3125 $video_url = $row [‘video_url’];3126 $imageUploadTo = $pathToImagesFolder . ‘/’ . $imagename;3127 $imageUploadTo = str_replace ( "\\", "/", $imageUploadTo );3128 $pathinfo = pathinfo ( $imageUploadTo );3129 $filenamewithoutextension = $pathinfo [‘filename’];3130 $outputimg = "";31313132 $outputimgmain = $baseurl . $row [‘image_name’];3133 if ($settings [‘resizeImages’] == 0) {31343135 $outputimg = $baseurl . $row [‘image_name’];3136 } else {3137 $imagetoCheck = $pathToImagesFolder . ‘/’ . $filenamewithoutextension . ‘_’ . $imageheight . ‘_’ . $imagewidth . ‘.’ . $pathinfo [‘extension’];31383139 if (file_exists ( $imagetoCheck )) {3140 $outputimg = $baseurl . $filenamewithoutextension . ‘_’ . $imageheight . ‘_’ . $imagewidth . ‘.’ . $pathinfo [‘extension’];3141 } else {31423143 if (function_exists ( ‘wp_get_image_editor’ )) {31443145 $image = wp_get_image_editor ( $pathToImagesFolder . “/” . $row [‘image_name’] );31463147 if (! is_wp_error ( $image )) {3148 $image->resize ( $imagewidth, $imageheight, true );3149 $image->save ( $imagetoCheck );3150 $outputimg = $baseurl . $filenamewithoutextension . ‘_’ . $imageheight . ‘_’ . $imagewidth . ‘.’ . $pathinfo [‘extension’];3151 } else {3152 $outputimg = $baseurl . $row [‘image_name’];3153 }3154 } else if (function_exists ( ‘image_resize’ )) {31553156 $return = image_resize ( $pathToImagesFolder . “/” . $row [‘image_name’], $imagewidth, $imageheight );3157 if (! is_wp_error ( $return )) {31583159 $isrenamed = rename ( $return, $imagetoCheck );3160 if ($isrenamed) {3161 $outputimg = $baseurl . $filenamewithoutextension . ‘_’ . $imageheight . ‘_’ . $imagewidth . ‘.’ . $pathinfo [‘extension’];3162 } else {3163 $outputimg = $baseurl . $row [‘image_name’];3164 }3165 } else {3166 $outputimg = $baseurl . $row [‘image_name’];3167 }3168 } else {31693170 $outputimg = $baseurl . $row [‘image_name’];3171 }31723173 // $url = plugin_dir_url(__FILE__)."imagestoscroll/".$filenamewithoutextension.’_’.$imageheight.’_’.$imagewidth.’.’.$pathinfo[‘extension’];3174 }3175 }3176 $embed_url=$row[‘embed_url’];31773178 $title="";3179 $rowTitle=$row[‘videotitle’];3180 $rowTitle=str_replace("’","’",$rowTitle); 3181 $rowTitle=str_replace(‘"’,’”’,$rowTitle); 31823183 $rowDescrption=$row[‘video_description’];3184 $rowDescrption=str_replace("’","’",$rowDescrption); 3185 $rowDescrption=str_replace(‘"’,’”’,$rowDescrption); 3186 $rowDescrption=strip_tags($rowDescrption); 31873188 if(strlen($rowDescrption)>300){31893190 $rowDescrption=substr($rowDescrption,0,300)."…"; 3191 }3192 // $openImageInNewTab=’_blank’;3193 $open_link_in=$row[‘open_link_in’];3194 //if($open_link_in==0){3195 $openImageInNewTab=’_self’; 3196 //}31973198 if(trim($row[‘videotitle’])!=’’ and trim($row[‘videotitleurl’])!=’’){31993200 $title="<a class=’Imglink’ target=’$openImageInNewTab’ href=’{$row[‘videotitleurl’]}’>{$rowTitle}</a>";3201 if($row[‘video_description’]!=’’){3202 $title.="<div class=’clear_description_’>{$rowDescrption}</div>";3203 }3204 }3205 else if(trim($row[‘videotitle’])!=’’ and trim($row[‘videotitleurl’])==’’){32063207 $title="<a class=’Imglink’ href=’#’>{$rowTitle}</a>"; 3208 if($row[‘video_description’]!=’’){3209 $title.="<div class=’clear_description_’>{$rowDescrption}</div>";3210 }3211 }3212 else{32133214 if($row[‘video_description’]!=’’)3215 $title="<div class=’clear_description_’>{$row[‘video_description’]}</div>"; 3216 }321732183219 ?>3220 <div class="i13_bx_slider">3221 <a rel="<?php echo $randOmeRel;?>" data-overlay="1" data-title="<?php echo htmlentities($title);?>" class="<?php echo $randOmVlBox;?>" href="<?php echo $embed_url;?>">3222 <img src="<?php echo $outputimg; ?>" alt="<?php echo $rowTitle; ?>" title="<?php if(trim($rowDescrption)!=’’){ echo $rowDescrption;} else{echo $rowTitle;}; ?>" />3223 <span class="playbtnCss">3224 </span> 3225 3226 </a> 32273228 </div>3229 3230 <?php } ?> 3231 <?php } ?> 3232 </div>3233 </div>3234 <script>3235 3236 3237 <?php $intval= uniqid(‘interval_’);?>32383239 var <?php echo $intval;?> = setInterval(function() {32403241 if(document.readyState === ‘complete’) {32423243 clearInterval(<?php echo $intval;?>);3244 3245 jQuery(“#<?php echo $rand_Numb; ?>”).show();3246 <?php $uniqId=uniqid();?>3247 var uniqObj<?php echo $uniqId?>=jQuery("a[rel^=’<?php echo $randOmeRel;?>’]");3248 var <?php echo $rand_var_name; ?> = jQuery(‘#<?php echo $rand_Num_td; ?>’).html();3249 jQuery(‘#<?php echo $rand_Numb; ?>’).bxSlider({3250 <?php if($settings[‘visible’]==1 ):?>3251 mode:’fade’,3252 <?php endif;?>3253 slideWidth: <?php echo $settings[‘imagewidth’]; ?>,3254 minSlides: <?php echo $settings[‘min_visible’]; ?>,3255 preventDefaultSwipeY: false,3256 maxSlides: <?php echo $settings[‘visible’]; ?>,3257 moveSlides: <?php echo $settings[‘scroll’]; ?>,3258 slideMargin:<?php echo $settings[‘imageMargin’]; ?>,3259 speed:<?php echo $settings[‘speed’]; ?>,3260 pause:<?php echo $settings[‘pause’]; ?>,3261 <?php if($settings[‘pauseonmouseover’] and ($settings[‘auto’]==1 or $settings[‘auto’]==2) ){ ?>3262 autoHover: true,3263 <?php3264 } else {3265 if ($settings[‘auto’]==1 or $settings[‘auto’]==2) {3266 ?>3267 autoHover:false,3268 <?php3269 }3270 }3271 ?>3272 <?php if ($settings[‘auto’]==1): ?>3273 controls:false,3274 <?php else: ?>3275 controls:true,3276 <?php endif; ?>3277 pager:false,3278 useCSS:false,3279 <?php if($settings[‘auto’]==1 or $settings[‘auto’]==2):?>3280 autoStart:true,3281 autoDelay:200,3282 auto:true,3283 <?php endif; ?>3284 <?php if ($settings[‘circular’]): ?>3285 infiniteLoop: true,3286 <?php else: ?>3287 infiniteLoop: false,3288 <?php endif; ?>3289 <?php if($settings[‘show_pager’]):?>3290 pager:true, 3291 <?php else:?>3292 pager:false,3293 <?php endif;?>3294 <?php if($settings[‘show_caption’]):?>3295 captions:true, 3296 <?php else:?>3297 captions:false,3298 <?php endif;?> 3299 onSlideBefore: function(slideElement){33003301 jQuery(slideElement).find(‘img’).each(function(index, elm) {33023303 if(!elm.complete || elm.naturalWidth === 0){33043305 var toload=’’;3306 var toloadval=’’;3307 jQuery.each(elm.attributes, function(i, attrib){33083309 var value = attrib.value;3310 var aname=attrib.name;33113312 var pattern = /^((http|https):\/\/)/;33133314 if(pattern.test(value) && aname!=’src’ && aname.indexOf(‘data-html5_vurl’)==-1) {33153316 toload=aname;3317 toloadval=value;3318 }3319 // do your magic :-)3320 });33213322 vsrc= jQuery(elm).attr(“src”);3323 jQuery(elm).removeAttr(“src”);3324 dsrc= jQuery(elm).attr(“data-src”);3325 lsrc= jQuery(elm).attr(“data-lazy-src”);33263327 if(dsrc!== undefined && dsrc!=’’ && dsrc!=vsrc){3328 jQuery(elm).attr("src",dsrc);3329 }3330 else if(lsrc!== undefined && lsrc!=vsrc){33313332 jQuery(elm).attr("src",lsrc);3333 }3334 else if(toload!=’’ && toload!=’srcset’ && toloadval!=’’ && toloadval!=vsrc){33353336 $(elm).attr(“src",toloadval);333733383339 } 3340 else{33413342 jQuery(elm).attr(“src",vsrc);33433344 } 33453346 elm= jQuery(elm)[0]; 3347 if(!elm.complete && elm.naturalHeight == 0){33483349 jQuery(elm).removeAttr(‘loading’);3350 jQuery(elm).removeAttr(‘data-lazy-type’);335133523353 jQuery(elm).removeClass(‘lazy’);33543355 jQuery(elm).removeClass(‘lazyLoad’);3356 jQuery(elm).removeClass(‘lazy-loaded’);3357 jQuery(elm).removeClass(‘jetpack-lazy-image’);3358 jQuery(elm).removeClass(‘jetpack-lazy-image–handled’);3359 jQuery(elm).removeClass(‘lazy-hidden’);33603361 }336233633364 }33653366 });33673368 }, 3369 onSliderLoad: function(){3370 3371 3372 3373 jQuery(“.<?php echo $randOmVlBox;?>”).fancybox_vgl({3374 ‘type’ : “iframe",3375 'overlayColor’:’#000000’,3376 'padding’: 10,3377 'autoScale’: true,3378 'autoDimensions’:true,3379 'uniqObj’:uniqObj<?php echo $uniqId;?>,3380 'transitionIn’: 'none’,3381 'transitionOut’: 'none’,3382 'titlePosition’: 'outside’,3383 <?php if ($settings[‘circular’]): ?>3384 'cyclic’:true,3385 <?php else: ?>3386 'cyclic’:false,3387 <?php endif; ?>3388 'hideOnContentClick’:false,3389 ‘width’ : 650,3390 ‘height’ : 400,3391 'titleFormat’: function(title, currentArray, currentIndex, currentOpts) {33923393 var currtElem = jQuery('#<?php echo $rand_Numb; ?> a[href="’+currentOpts.href+’”]');33943395 var isoverlay = jQuery(currtElem).attr(‘data-overlay’)33963397 if(isoverlay=="1” && jQuery.trim(title)!="”){3398 return ‘<span id="fancybox_vgl-title-over">’ + title + ‘</span>’;3399 }3400 else{3401 return ‘’;3402 }34033404 },34053406 }); 3407 3408 } 3409 3410 3411 });3412 3413 <?php if ($settings[‘auto’]) { ?>3414 <?php $newrand = rand(0, 1111111111); ?>3415 var is_firefox = navigator.userAgent.toLowerCase().indexOf(‘firefox’) > - 1;3416 var is_android = navigator.userAgent.toLowerCase().indexOf(‘android’) > - 1;3417 var is_iphone = navigator.userAgent.toLowerCase().indexOf(‘iphone’) > - 1;3418 var width = jQuery(window).width();3419 if (is_firefox && (is_android || is_iphone)){34203421 } else{3422 var timer;3423 jQuery(window).bind(‘resize’, function(){3424 if (jQuery(window).width() != width){34253426 width = jQuery(window).width();3427 timer && clearTimeout(timer);3428 timer = setTimeout(onResize<?php echo $newrand; ?>, 600);3429 }3430 });3431 }34323433 function onResize<?php echo $newrand; ?>(){3434 3435 jQuery(‘#<?php echo $rand_Num_td; ?>’).html(‘’);3436 jQuery(“#<?php echo $rand_Numb; ?>”).show();3437 jQuery(‘#<?php echo $rand_Num_td; ?>’).html(<?php echo $rand_var_name; ?>);3438 jQuery(‘#<?php echo $rand_Numb; ?>’).bxSlider({34393440 <?php if($settings[‘visible’]==1 ):?>3441 mode:’fade’,3442 <?php endif;?>3443 slideWidth: <?php echo $settings[‘imagewidth’]; ?>,3444 minSlides: <?php echo $settings[‘min_visible’]; ?>,3445 maxSlides: <?php echo $settings[‘visible’]; ?>,3446 moveSlides: <?php echo $settings[‘scroll’]; ?>,3447 slideMargin:<?php echo $settings[‘imageMargin’]; ?>,3448 preventDefaultSwipeY: false,3449 speed:<?php echo $settings[‘speed’]; ?>,3450 pause:<?php echo $settings[‘pause’]; ?>,3451 <?php if($settings[‘pauseonmouseover’] and ($settings[‘auto’]==1 or $settings[‘auto’]==2) ){ ?>3452 autoHover: true,3453 <?php3454 } 3455 else {3456 if ($settings[‘auto’]==1 or $settings[‘auto’]==2) {3457 ?>3458 autoHover:false,3459 <?php3460 }3461 }3462 ?>3463 <?php if ($settings[‘auto’]==1): ?>3464 controls:false,3465 <?php else: ?>3466 controls:true,3467 <?php endif; ?>3468 pager:false,3469 useCSS:false,3470 <?php if($settings[‘auto’]==1 or $settings[‘auto’]==2):?>3471 autoStart:true,3472 autoDelay:200,3473 auto:true,3474 <?php endif; ?>3475 <?php if ($settings[‘circular’]): ?>3476 infiniteLoop: true,3477 <?php else: ?>3478 infiniteLoop: false,3479 <?php endif; ?>3480 <?php if($settings[‘show_pager’]):?>3481 pager:true, 3482 <?php else:?>3483 pager:false,3484 <?php endif;?>3485 <?php if($settings[‘show_caption’]):?>3486 captions:true, 3487 <?php else:?>3488 captions:false,3489 <?php endif;?>3490 onSlideBefore: function(slideElement){3491 3492 jQuery(slideElement).find(‘img’).each(function(index, elm) {3493 3494 if(!elm.complete || elm.naturalWidth === 0){34953496 var toload=’’;3497 var toloadval=’’;3498 jQuery.each(elm.attributes, function(i, attrib){34993500 var value = attrib.value;3501 var aname=attrib.name;35023503 var pattern = /^((http|https):\/\/)/;35043505 if(pattern.test(value) && aname!=’src’ && aname.indexOf(‘data-html5_vurl’)==-1) {35063507 toload=aname;3508 toloadval=value;3509 }3510 // do your magic :-)3511 });35123513 vsrc= jQuery(elm).attr(“src”);3514 jQuery(elm).removeAttr(“src”);3515 dsrc= jQuery(elm).attr(“data-src”);3516 lsrc= jQuery(elm).attr(“data-lazy-src”);35173518 if(dsrc!== undefined && dsrc!=’’ && dsrc!=vsrc){3519 jQuery(elm).attr("src",dsrc);3520 }3521 else if(lsrc!== undefined && lsrc!=vsrc){35223523 jQuery(elm).attr("src",lsrc);3524 }3525 else if(toload!=’’ && toload!=’srcset’ && toloadval!=’’ && toloadval!=vsrc){35263527 $(elm).attr(“src",toloadval);352835293530 } 3531 else{35323533 jQuery(elm).attr(“src",vsrc);35343535 } 35363537 elm= jQuery(elm)[0]; 3538 if(!elm.complete && elm.naturalHeight == 0){35393540 jQuery(elm).removeAttr(‘loading’);3541 jQuery(elm).removeAttr(‘data-lazy-type’);354235433544 jQuery(elm).removeClass(‘lazy’);35453546 jQuery(elm).removeClass(‘lazyLoad’);3547 jQuery(elm).removeClass(‘lazy-loaded’);3548 jQuery(elm).removeClass(‘jetpack-lazy-image’);3549 jQuery(elm).removeClass(‘jetpack-lazy-image–handled’);3550 jQuery(elm).removeClass(‘lazy-hidden’);35513552 }35533554 3555 }3556 3557 });35583559 }, 3560 onSliderLoad: function(){3561 3562 35633564 jQuery(“.<?php echo $randOmVlBox;?>”).fancybox_vgl({3565 ‘type’ : “iframe",3566 'overlayColor’:’#000000’,3567 'padding’: 10,3568 'autoScale’: true,3569 'autoDimensions’:true,3570 'uniqObj’:uniqObj<?php echo $uniqId;?>,3571 'transitionIn’: 'none’,3572 'transitionOut’: 'none’,3573 'titlePosition’: 'outside’,3574 <?php if ($settings[‘circular’]): ?>3575 'cyclic’:true,3576 <?php else: ?>3577 'cyclic’:false,3578 <?php endif; ?>3579 'hideOnContentClick’:false,3580 ‘width’ : 650,3581 ‘height’ : 400,3582 'titleFormat’: function(title, currentArray, currentIndex, currentOpts) {35833584 var currtElem = jQuery('#<?php echo $rand_Numb; ?> a[href="’+currentOpts.href+’”]');35853586 var isoverlay = jQuery(currtElem).attr(‘data-overlay’)35873588 if(isoverlay=="1” && jQuery.trim(title)!="”){3589 return ‘<span id="fancybox_vgl-title-over">’ + title + ‘</span>’;3590 }3591 else{3592 return ‘’;3593 }35943595 },35963597 }); 35983599 } 36003601 });3602 3603 }36043605 <?php } ?>36063607 3608 window.rebind<?php echo $rand_Numb;?> = function() {36093610 jQuery(“.<?php echo $randOmVlBox;?>”).fancybox_vgl({3611 ‘type’ : “iframe",3612 'overlayColor’:’#000000’,3613 'padding’: 10,3614 'autoScale’: true,3615 'autoDimensions’:true,3616 'uniqObj’:uniqObj<?php echo $uniqId;?>,3617 'transitionIn’: 'none’,3618 'transitionOut’: 'none’,3619 'titlePosition’: 'outside’,3620 <?php if ($settings[‘circular’]): ?>3621 'cyclic’:true,3622 <?php else: ?>3623 'cyclic’:false,3624 <?php endif; ?>3625 'hideOnContentClick’:false,3626 ‘width’ : 650,3627 ‘height’ : 400,3628 'titleFormat’: function(title, currentArray, currentIndex, currentOpts) {36293630 var currtElem = jQuery('#<?php echo $rand_Numb; ?> a[href="’+currentOpts.href+’”]');36313632 var isoverlay = jQuery(currtElem).attr(‘data-overlay’)36333634 if(isoverlay=="1" && jQuery.trim(title)!=""){3635 return ‘<span id="fancybox_vgl-title-over">’ + title + ‘</span>’;3636 }3637 else{3638 return ‘’;3639 }36403641 },36423643 }); 36443645 }36463647 } 3648 }, 100);36493650 3651 3652 3653 3654 3655 window.addEventListener(‘load’, function() {365636573658 setTimeout(function(){ 36593660 if(jQuery(“#<?php echo $rand_Numb;?>”).find(‘.bx-loading’).length>0){36613662 jQuery(“#<?php echo $rand_Numb;?>”).find(‘img’).each(function(index, elm) {3663 3664 if(!elm.complete || elm.naturalWidth === 0){36653666 var toload=’’;3667 var toloadval=’’;3668 jQuery.each(this.attributes, function(i, attrib){36693670 var value = attrib.value;3671 var aname=attrib.name;36723673 var pattern = /^((http|https):\/\/)/;36743675 if(pattern.test(value) && aname!=’src’) {36763677 toload=aname;3678 toloadval=value;3679 }3680 3681 });36823683 vsrc=jQuery(elm).attr(“src”);3684 jQuery(elm).removeAttr(“src”);3685 dsrc=jQuery(elm).attr(“data-src”);3686 lsrc=jQuery(elm).attr(“data-lazy-src”);368736883689 if(dsrc!== undefined && dsrc!=’’ && dsrc!=vsrc){3690 jQuery(elm).attr("src",dsrc);3691 }3692 else if(lsrc!== undefined && lsrc!=vsrc){36933694 jQuery(elm).attr("src",lsrc);3695 }3696 else if(toload!=’’ && toload!=’srcset’ && toloadval!=’’ && toloadval!=vsrc){36973698 jQuery(elm).removeAttr(toload);3699 jQuery(elm).attr("src",toloadval);370037013702 } 3703 else{37043705 jQuery(elm).attr("src",vsrc);37063707 } 37083709 elm=jQuery(elm)[0]; 3710 if(!elm.complete && elm.naturalHeight == 0){37113712 jQuery(elm).removeAttr(‘loading’);3713 jQuery(elm).removeAttr(‘data-lazy-type’);371437153716 jQuery(elm).removeClass(‘lazy’);37173718 jQuery(elm).removeClass(‘lazyLoad’);3719 jQuery(elm).removeClass(‘lazy-loaded’);3720 jQuery(elm).removeClass(‘jetpack-lazy-image’);3721 jQuery(elm).removeClass(‘jetpack-lazy-image–handled’);3722 jQuery(elm).removeClass(‘lazy-hidden’);37233724 }3725 }37263727 }).promise().done( function(){ 37283729 jQuery(“#<?php echo $rand_Num_td;?>”).find(‘.bx-loading’).remove();3730 } );37313732 }373337343735 }, 6000);37363737 });3738 </script><!-- end print_responsive_video_gallery_plus_lightbox_func --><?php } 3739 $output = ob_get_clean ();3740 return $output;3741}3742function responsive_video_gallery_plus_responsive_lightbox_get_wp_version() {3743 global $wp_version;3744 return $wp_version;3745}37463747// also we will add an option function that will check for plugin admin page or not3748function responsive_video_gallery_plus_lightbox_is_plugin_page() {3749 $server_uri = "http://{$_SERVER[‘HTTP_HOST’]}{$_SERVER[‘REQUEST_URI’]}";3750 3751 foreach ( array (3752 ‘responsive_video_gallery_with_lightbox’ 3753 ) as $allowURI ) {3754 if (stristr ( $server_uri, $allowURI ))3755 return true;3756 }3757 return false;3758}37593760// add media WP scripts3761function responsive_video_gallery_plus_lightbox_admin_scripts_init() {3762 if (responsive_video_gallery_plus_lightbox_is_plugin_page ()) {3763 // double check for WordPress version and function exists3764 if (function_exists ( ‘wp_enqueue_media’ ) && version_compare ( responsive_video_gallery_plus_responsive_lightbox_get_wp_version (), '3.5’, ‘>=’ )) {3765 // call for new media manager3766 wp_enqueue_media ();3767 }3768 wp_enqueue_style ( ‘media’ );3769 wp_enqueue_style( ‘wp-color-picker’ );3770 wp_enqueue_script( ‘wp-color-picker’ );37713772 }3773}377437753776function wrvgwl_remove_extra_p_tags($content){37773778 if(strpos($content, ‘print_responsive_video_gallery_plus_lightbox_func’)!==false){3779 3780 3781 $pattern = "/<!-- print_responsive_video_gallery_plus_lightbox_func -->(.*)<!-- end print_responsive_video_gallery_plus_lightbox_func -->/Uis"; 3782 $content = preg_replace_callback($pattern, function($matches) {378337843785 $altered = str_replace("<p>","",$matches[1]);3786 $altered = str_replace("</p>","",$altered);3787 3788 $altered=str_replace("&","&",$altered);3789 $altered=str_replace("”",’"’,$altered);3790 37913792 return @str_replace($matches[1], $altered, $matches[0]);3793 }, $content);37943795 3796 3797 }3798 3799 $content = str_replace("<p><!-- print_responsive_video_gallery_plus_lightbox_func -->","<!-- print_responsive_video_gallery_plus_lightbox_func -->",$content);3800 $content = str_replace("<!-- end print_responsive_video_gallery_plus_lightbox_func --></p>","<!-- end print_responsive_video_gallery_plus_lightbox_func -->",$content);3801 3802 3803 return $content;3804 }38053806 add_filter('widget_text_content’, 'wrvgwl_remove_extra_p_tags’, 999);3807 add_filter('the_content’, 'wrvgwl_remove_extra_p_tags’, 999);380838093810?>

CVE: Latest News

CVE-2023-50976: Transactions API Authorization by oleiman · Pull Request #14969 · redpanda-data/redpanda
CVE-2023-6905
CVE-2023-6903
CVE-2023-6904
CVE-2023-3907