**********/ $output .= ''; $lazyload_class = ''; $output_local = ''; // LAZY LOAD GRID $lazyload_class = 'fg_lazyload_off'; if($lazyload == 'on' && $layout == 'fmg-grid') { $output .= ''; $lazyload_class = 'fg_lazyload'; } if($layout == 'fmg-masonry') { $image_thumb_size = $thumbs_masonry; if($lazyload == 'off') { // MASONRY WHEN LAZY LOAD IS OFF $output .= ''; } else { // LAZY LOAD IS ON $output .= ''; $lazyload_class = 'fg_lazyload'; } #LAZY LOAD IS ON } // OUTPUT $output .= "".$gallery_name.""; if($pagination_active == 'on') { $output .= '
'.get_fmg_pagination($num_page_for_pagination,$pagination).'
'; } $output = $output_local . $output; return $output; } } new fastmediagallery_function(); /*************************************************** #### Function: fmg_enqueue_css_and_javascript() #### #### Since: version 1.0 ############################ ***************************************************/ function fmg_enqueue_css_and_javascript($type,$layout,$responsive_type,$lazyload,$active_custom_responsive,$fg_animate) { // LOAD GENERAL CSS AND JAVASCRIPT wp_enqueue_script('fastmediagallery-frontend-script'); wp_enqueue_style('fonts-vc'); // CUSTOM RESPONSIVE: LOAD CSS if($active_custom_responsive == 'active_custom_responsive') { wp_enqueue_style( 'fastmediagallery-custom-responsive-vc' ); } // MASONRY: LOAD JAVASCRIPT if($layout == 'fmg-masonry') { wp_enqueue_script('jquery-masonry'); } // LIGHTGALLERY: LOAD CSS AND JAVASCRIPT if($type == 'lightgallery') { wp_enqueue_style( 'fastmediagallery-lightgallery' ); wp_enqueue_script( 'fastmediagallery-lightgallery-js'); } if($fg_animate == 'on') { wp_enqueue_style( 'fastmediagallery-animations' ); wp_enqueue_script( 'fastmediagallery-appear-js'); wp_enqueue_script( 'fastmediagallery-animate-js'); } if($lazyload == 'on') { wp_enqueue_script( 'fastmediagallery-lazyload-js'); wp_enqueue_script( 'fastmediagallery-imagesLoaded-js'); } } /*************************************************** #### Function: fmg_thumbnails() #################### #### Since: version 1.0 ############################ ***************************************************/ function fmg_thumbnails() { add_image_size( 'fmg-default-thumb', 1000, 800, true ); add_image_size( 'fmg-default-thumb-masonry', 800 ); add_image_size( 'fmg-default-lightbox', 1200, 1000, true ); } add_action( 'init', 'fmg_thumbnails' ); /*************************************************** #### Function: fastmediagallery_vc_hex2rgb() ####### #### Since: version 1.0 ############################ ***************************************************/ function fastmediagallery_vc_hex2rgb($hex) { $hex = str_replace("#", "", $hex); if(strlen($hex) == 3) { $r = hexdec(substr($hex,0,1).substr($hex,0,1)); $g = hexdec(substr($hex,1,1).substr($hex,1,1)); $b = hexdec(substr($hex,2,1).substr($hex,2,1)); } else { $r = hexdec(substr($hex,0,2)); $g = hexdec(substr($hex,2,2)); $b = hexdec(substr($hex,4,2)); } $rgb = array($r, $g, $b); return $rgb; } /*************************************************** #### Function: fmg_add_query_vars_pagination() ##### #### Since: version 1.0 ############################ ***************************************************/ function fmg_add_query_vars_pagination( $vars ){ $vars[] = "fmg_page"; return $vars; } add_filter( 'query_vars', 'fmg_add_query_vars_pagination' ); /*************************************************** #### Function: get_fmg_pagination() ################ #### Since: version 1.0 ############################ ***************************************************/ function get_fmg_pagination($num_page_for_pagination,$pagination) { $output = ''; return $output; } /*************************************************** #### Function: fmg_style() ######################### #### Since: version 1.0 ############################ ***************************************************/ function fmg_style($selector, $main_color, $main_color_opacity, $secondary_color, $spacing_active, $spacing, $name_show, $gallery_name_font_size, $gallery_name_font_color, $gallery_name_text_align, $pagination_active, $pagination_style, $image_width) { // CHECK MAIN COLOR $rgb_main_color = fastmediagallery_vc_hex2rgb($main_color); $rgba_main_color = "rgba( ".$rgb_main_color[0]." , ".$rgb_main_color[1]." , ".$rgb_main_color[2]." , ".$main_color_opacity.")"; $rgb_secondary_color = fastmediagallery_vc_hex2rgb($secondary_color); $rgba_secondary_color = "rgba( ".$rgb_secondary_color[0]." , ".$rgb_secondary_color[1]." , ".$rgb_secondary_color[2]." , 0.3)"; // END MAIN COLOR $output = " '; return $output; } ?>