<?php
  
class autoInstall {

    static function init(){
        global $_GET;
        if( isSet( $_GET['all_plugins_installed'] ) ){
            fOpt::Set('autoinstall', 'plugins', 'finished' );
            return;
        }

        switch ( fOpt::Get('autoinstall', 'plugins' ) ) {

            case 'activate-required-plugins-page':
                // plugins.php - just to look - all activated
                add_action( 'admin_enqueue_scripts', array('autoInstall','moveToThemeOptions') );
                break;

            case 'move-to-activate-required-plugins-page':
                // showing installation
                add_action( 'admin_enqueue_scripts', array('autoInstall','addAfterAutoInstall') );
                break;

            case 'install-required-plugins-page':
                // showing in tgm strange stuff
                add_action( 'admin_enqueue_scripts', array('autoInstall','addAutoInstallJavaScript') );
                break;

            default:
                // just on theme switch
                add_action("admin_footer", array('autoInstall','redirectToInstallPlugins') );
                break;
        }
    }
    
    static function addDefaultSliderIfPossible(){
        global $wpdb;
        // Adding slides
        $prefix = $wpdb->prefix;

        // SLIDERS empty ?
        $sql = "SELECT COUNT(`id`) AS cnt FROM ".$prefix."revslider_sliders";
        if( false == ( $result = @mysql_query( $sql ) )) return;
        $row = mysql_fetch_array( $result );
        if( 0 != 1 * $row['cnt'] ) return;

        // SLIDES empty ?
        $sql = "SELECT COUNT(`id`) AS cnt FROM ".$prefix."revslider_slides";
        if( false == ( $result = @mysql_query( $sql ) )) return;
        $row = mysql_fetch_array( $result );
        if( 0 != 1 * $row['cnt'] ) return;

        $f = explode("\n", '
        
                  /* SLIDERS */
                  INSERT INTO `'.$prefix.'revslider_sliders` (`id`, `title`, `alias`, `params`) VALUES (1, \'Default\', \'default\', \'{"title":"Default","alias":"default","shortcode":"[rev_slider default]","slider_type":"responsitive","width":"1000","height":"400","responsitive_w1":"959","responsitive_sw1":"768","responsitive_w2":"767","responsitive_sw2":"420","responsitive_w3":"480","responsitive_sw3":"300","responsitive_w4":"","responsitive_sw4":"","responsitive_w5":"","responsitive_sw5":"","responsitive_w6":"","responsitive_sw6":"","delay":"9000","touchenabled":"on","stop_on_hover":"on","shuffle":"off","load_googlefont":"false","google_font":"PT+Sans+Narrow:400,700","stop_slider":"off","stop_after_loops":"0","stop_at_slide":"2","position":"center","margin_top":"0","margin_bottom":"0","margin_left":"0","margin_right":"0","shadow_type":"0","show_timerbar":"true","timebar_position":"bottom","background_color":"","padding":"0","show_background_image":"false","background_image":"","navigaion_type":"bullet","navigation_arrows":"none","navigation_style":"round","nav_offset_hor":"0","nav_offset_vert":"20","navigaion_always_on":"true","hide_thumbs":"200","thumb_width":"100","thumb_height":"50","thumb_amount":"5","hide_slider_under":"0","hide_defined_layers_under":"0","hide_all_layers_under":"0","jquery_noconflict":"on","js_to_body":"true","output_type":"none"}\');
                  /* SLIDES */
                  INSERT INTO `'.$prefix.'revslider_slides` (`id`, `slider_id`, `slide_order`, `params`, `layers`) VALUES(1, 1, 1, \'{"slide_transition":"fade","slot_amount":"7","transition_rotation":"0","transition_duration":"300","delay":"","enable_link":"false","link_type":"regular","link":"","link_open_in":"same","slide_link":"nothing","link_pos":"front","enable_video":"false","video_id":"","video_autoplay":"true","slide_thumb":"","0":"Choose Image","fullwidth_centering":"true","image":"%%%THEME-URL%%%\\/images\\/slider_default\\/transparent.png"}\', \'[{"style":"","text":"Image 1","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/splash.png","left":500,"top":10,"animation":"lfr","easing":"easeOutExpo","speed":900,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":500,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"0","endTimeFinal":8100,"endSpeedFinal":300,"realEndTime":9000,"timeLast":8500},{"style":"","text":"Image 2","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/wehavethe.png","left":207,"top":83,"animation":"lfl","easing":"easeOutExpo","speed":900,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":800,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"1","endTimeFinal":8100,"endSpeedFinal":300,"realEndTime":9000,"timeLast":8200},{"style":"","text":"Image 3","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/creativejuice.png","left":82,"top":133,"animation":"lft","easing":"easeOutExpo","speed":900,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":1100,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"2","endTimeFinal":8100,"endSpeedFinal":300,"realEndTime":9000,"timeLast":7900},{"style":"","text":"Image 4","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/yourelookingfor.png","left":79,"top":211,"animation":"lfb","easing":"easeOutExpo","speed":900,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":1400,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"3","endTimeFinal":8100,"endSpeedFinal":300,"realEndTime":9000,"timeLast":7600},{"text":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut sit amet nibh arcu, vitae<br \\/>adipiscing vuo metus. Sed ultricies, neque ac vulputate tempus, arcu libero sodales<br \\/>lacus, eleifend molestie tre tellus neque eget dolor. Sed et arcu non orci iaculis loborti.","type":"text","left":78,"top":270,"animation":"lfl","easing":"easeOutExpo","speed":900,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"style":"normal_grey","time":1700,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"4","endTimeFinal":8100,"endSpeedFinal":300,"realEndTime":9000,"timeLast":7300}]\')
                  INSERT INTO `'.$prefix.'revslider_slides` (`id`, `slider_id`, `slide_order`, `params`, `layers`) VALUES(2, 1, 2, \'{"slide_transition":"fade","slot_amount":"7","transition_rotation":"0","transition_duration":"300","delay":"","enable_link":"false","link_type":"regular","link":"","link_open_in":"same","slide_link":"nothing","link_pos":"front","enable_video":"false","video_id":"","video_autoplay":"true","slide_thumb":"","0":"Choose Image","fullwidth_centering":"true","image":"%%%THEME-URL%%%\\/images\\/slider_default\\/transparent.png"}\', \'[{"style":"","text":"Image 1","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/packed.png","left":188,"top":135,"animation":"lfl","easing":"easeOutExpo","speed":900,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":500,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"0","endTimeFinal":8100,"endSpeedFinal":300,"realEndTime":9000,"timeLast":8500},{"style":"","text":"Image 2","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/awesomefeatures.png","left":201,"top":183,"animation":"lfl","easing":"easeOutExpo","speed":900,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":800,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"1","endTimeFinal":8100,"endSpeedFinal":300,"realEndTime":9000,"timeLast":8200},{"style":"","text":"Image 3","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/youcould.png","left":185,"top":264,"animation":"lfl","easing":"easeOutExpo","speed":900,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":1100,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"2","endTimeFinal":8100,"endSpeedFinal":300,"realEndTime":9000,"timeLast":7900},{"style":"","text":"Image 4","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/finger.png","left":70,"top":81,"animation":"lfl","easing":"easeOutExpo","speed":900,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":1400,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"3","endTimeFinal":8100,"endSpeedFinal":300,"realEndTime":9000,"timeLast":7600},{"style":"","text":"Image 5","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/check.png","left":738,"top":112,"animation":"sfl","easing":"easeOutExpo","speed":300,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":1700,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"4","endTimeFinal":8700,"endSpeedFinal":300,"realEndTime":9000,"timeLast":7300},{"text":"Responsive and mobile friendly","type":"text","left":762,"top":112,"animation":"lfr","easing":"easeOutExpo","speed":300,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"style":"normal_grey","time":1700,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"5","endTimeFinal":8700,"endSpeedFinal":300,"realEndTime":9000,"timeLast":7300},{"style":"","text":"Image 7","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/check.png","left":738,"top":132,"animation":"sfl","easing":"easeOutExpo","speed":300,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":2000,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"6","endTimeFinal":8700,"endSpeedFinal":300,"realEndTime":9000,"timeLast":6700},{"text":"Flexible and highly customizable","type":"text","left":762,"top":132,"animation":"lfr","easing":"easeOutExpo","speed":300,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"style":"normal_grey","time":2000,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"7","endTimeFinal":8700,"endSpeedFinal":300,"realEndTime":9000,"timeLast":6700},{"style":"","text":"Image 9","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/check.png","left":738,"top":152,"animation":"sfl","easing":"easeOutExpo","speed":300,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":2300,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"8","endTimeFinal":8700,"endSpeedFinal":300,"realEndTime":9000,"timeLast":6100},{"text":"36 page templates","type":"text","left":762,"top":152,"animation":"lfr","easing":"easeOutExpo","speed":300,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"style":"normal_grey","time":2300,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"9","endTimeFinal":8700,"endSpeedFinal":300,"realEndTime":9000,"timeLast":6100},{"style":"","text":"Image 11","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/check.png","left":738,"top":172,"animation":"sfl","easing":"easeOutExpo","speed":300,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":2600,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"10","endTimeFinal":8700,"endSpeedFinal":300,"realEndTime":9000,"timeLast":5500},{"text":"Over 200 shortcodes","type":"text","left":762,"top":172,"animation":"lfr","easing":"easeOutExpo","speed":300,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"style":"normal_grey","time":2600,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"11","endTimeFinal":8700,"endSpeedFinal":300,"realEndTime":9000,"timeLast":5500},{"style":"","text":"Image 13","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/check.png","left":738,"top":192,"animation":"sfl","easing":"easeOutExpo","speed":300,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":2900,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"12","endTimeFinal":8700,"endSpeedFinal":300,"realEndTime":9000,"timeLast":4900},{"text":"10 pre-built skins","type":"text","left":762,"top":192,"animation":"lfr","easing":"easeOutExpo","speed":300,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"style":"normal_grey","time":2900,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"13","endTimeFinal":8700,"endSpeedFinal":300,"realEndTime":9000,"timeLast":6100},{"style":"","text":"Image 15","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/check.png","left":738,"top":212,"animation":"sfl","easing":"easeOutExpo","speed":300,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":3200,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"14","endTimeFinal":8700,"endSpeedFinal":300,"realEndTime":9000,"timeLast":4300},{"text":"JackBox lightbox ($10)","type":"text","left":762,"top":212,"animation":"lfr","easing":"easeOutExpo","speed":300,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"style":"normal_grey","time":3200,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"15","endTimeFinal":8700,"endSpeedFinal":300,"realEndTime":9000,"timeLast":5800},{"style":"","text":"Image 17","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/check.png","left":738,"top":232,"animation":"sfl","easing":"easeOutExpo","speed":300,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":3500,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"16","endTimeFinal":8700,"endSpeedFinal":300,"realEndTime":9000,"timeLast":3700},{"text":"Revolution slider ($12)","type":"text","left":762,"top":232,"animation":"lfr","easing":"easeOutExpo","speed":300,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"style":"normal_grey","time":3500,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"17","endTimeFinal":8700,"endSpeedFinal":300,"realEndTime":9000,"timeLast":5500},{"style":"","text":"Image 19","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/check.png","left":738,"top":252,"animation":"sfl","easing":"easeOutExpo","speed":300,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":3800,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"18","endTimeFinal":8700,"endSpeedFinal":300,"realEndTime":9000,"timeLast":3100},{"text":"Ajax contact form Extended ($5)","type":"text","left":762,"top":252,"animation":"lfr","easing":"easeOutExpo","speed":300,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"style":"normal_grey","time":3800,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"19","endTimeFinal":8700,"endSpeedFinal":300,"realEndTime":9000,"timeLast":2800},{"style":"","text":"Image 21","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/check.png","left":738,"top":272,"animation":"sfl","easing":"easeOutExpo","speed":300,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":4100,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"20","endTimeFinal":8700,"endSpeedFinal":300,"realEndTime":9000,"timeLast":2500},{"text":"Isotope portfolio ($25)","type":"text","left":762,"top":272,"animation":"lfr","easing":"easeOutExpo","speed":300,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"style":"normal_grey","time":4100,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"21","endTimeFinal":8700,"endSpeedFinal":300,"realEndTime":9000,"timeLast":2200},{"style":"","text":"Image 23","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/check.png","left":738,"top":292,"animation":"sfl","easing":"easeOutExpo","speed":300,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":4400,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"22","endTimeFinal":8700,"endSpeedFinal":300,"realEndTime":9000,"timeLast":1900},{"text":"Flex portfolio slider","type":"text","left":762,"top":292,"animation":"lfr","easing":"easeOutExpo","speed":300,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"style":"normal_grey","time":4400,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"23","endTimeFinal":8700,"endSpeedFinal":300,"realEndTime":9000,"timeLast":4600}]\')
                  INSERT INTO `'.$prefix.'revslider_slides` (`id`, `slider_id`, `slide_order`, `params`, `layers`) VALUES(3, 1, 3, \'{"slide_transition":"fade","slot_amount":"7","transition_rotation":"0","transition_duration":"300","delay":"","enable_link":"false","link_type":"regular","link":"","link_open_in":"same","slide_link":"nothing","link_pos":"front","enable_video":"false","video_id":"","video_autoplay":"true","slide_thumb":"","0":"Choose Image","fullwidth_centering":"true","image":"%%%THEME-URL%%%\\/images\\/slider_default\\/transparent.png"}\', \'[{"style":"","text":"Image 1","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/somecool.png","left":206,"top":95,"animation":"lfl","easing":"easeOutExpo","speed":900,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":500,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"0","endTimeFinal":8100,"endSpeedFinal":300,"realEndTime":9000,"timeLast":8500},{"style":"","text":"Image 2","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/vimeovideo.png","left":78,"top":135,"animation":"lfl","easing":"easeOutExpo","speed":900,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":800,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"1","endTimeFinal":8100,"endSpeedFinal":300,"realEndTime":9000,"timeLast":8200},{"style":"","text":"Image 3","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/fingerright.png","left":392,"top":135,"animation":"lft","easing":"easeOutExpo","speed":900,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":1100,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"2","endTimeFinal":8100,"endSpeedFinal":300,"realEndTime":9000,"timeLast":7900},{"text":"Lorem ipsum dolor sit amet, consectetur adipiscing<br \\/>elit. Ut sit amet nibh arcu, vitae adipiscing vuomas<br \\/>metus. Sed ultricies, neque ac vulputate tempus, mi<br \\/>arcu libero sodales lacus, eleifend molestie tre tellus<br \\/>neque eget dolor. Sed et arcu non orci iaculis lobort.","type":"text","left":88,"top":216,"animation":"lfl","easing":"easeOutExpo","speed":900,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"style":"normal_grey","time":1400,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"3","endTimeFinal":8100,"endSpeedFinal":300,"realEndTime":9000,"timeLast":7600},{"type":"video","style":"boxshadow","video_id":"29298709","video_type":"vimeo","video_title":"The City","video_image_url":"http:\\/\\/b.vimeocdn.com\\/ts\\/196\\/161\\/196161330_200.jpg","video_width":"398","video_height":"223","text":"Vimeo: The City","left":525,"top":88,"animation":"lfr","easing":"easeOutExpo","speed":900,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":1700,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"4","endTimeFinal":8100,"endSpeedFinal":300,"realEndTime":9000,"timeLast":7300}]\')
                  INSERT INTO `'.$prefix.'revslider_slides` (`id`, `slider_id`, `slide_order`, `params`, `layers`) VALUES(4, 1, 4, \'{"slide_transition":"fade","slot_amount":"7","transition_rotation":"0","transition_duration":"300","delay":"","enable_link":"false","link_type":"regular","link":"","link_open_in":"same","slide_link":"nothing","link_pos":"front","enable_video":"false","video_id":"","video_autoplay":"true","slide_thumb":"","0":"Choose Image","fullwidth_centering":"true","image":"%%%THEME-URL%%%\\/images\\/slider_default\\/transparent.png"}\', \'[{"style":"","text":"Image 1","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/somecool.png","left":629,"top":95,"animation":"lfr","easing":"easeOutExpo","speed":900,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":500,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"0","endTimeFinal":8100,"endSpeedFinal":300,"realEndTime":9000,"timeLast":8500},{"style":"","text":"Image 2","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/youtubevideo.png","left":627,"top":135,"animation":"lfr","easing":"easeOutExpo","speed":900,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":800,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"1","endTimeFinal":8100,"endSpeedFinal":300,"realEndTime":9000,"timeLast":8200},{"style":"","text":"Image 3","type":"image","image_url":"%%%THEME-URL%%%\\/images\\/slider_default\\/fingerleft.png","left":500,"top":130,"animation":"lft","easing":"easeOutExpo","speed":900,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":1100,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"2","endTimeFinal":8100,"endSpeedFinal":300,"realEndTime":9000,"timeLast":7900},{"text":"Lorem ipsum dolor sit amet, consectetur adipiscing<br \\/>elit. Ut sit amet nibh arcu, vitae adipiscing vuomas<br \\/>metus. Sed ultricies, neque ac vulputate tempus, mi<br \\/>arcu libero sodales lacus, eleifend molestie tre tellus<br \\/>neque eget dolor. Sed et arcu non orci iaculis lobort.","type":"text","left":633,"top":206,"animation":"lfr","easing":"easeOutExpo","speed":900,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"style":"normal_grey","time":1400,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"3","endTimeFinal":8100,"endSpeedFinal":300,"realEndTime":9000,"timeLast":7600},{"type":"video","style":"boxshadow","video_id":"e2rWG0DCrpI","video_type":"youtube","video_title":"GTA 5, XBL\'\'s 10th Anniv & the Return of Mega Man?! - IGN Daily Fix 11.14.12","video_image_url":"http:\\/\\/i.ytimg.com\\/vi\\/e2rWG0DCrpI\\/mqdefault.jpg","video_width":"398","video_height":"223","text":"Youtube: GTA 5, XBL\'\'s 10th Anniv & the Return of Mega Man?! - IGN Daily Fix 11.14.12","left":75,"top":88,"animation":"lfl","easing":"easeOutExpo","speed":900,"hiddenunder":false,"link":"","link_open_in":"same","link_slide":"nothing","video_autoplay":false,"time":1700,"endtime":"","endspeed":300,"endanimation":"auto","endeasing":"nothing","serial":"4","endTimeFinal":8100,"endSpeedFinal":300,"realEndTime":9000,"timeLast":7300}]\')

        ');
        $sqlF = array();
        foreach ($f as $value) {
            $value = trim($value);
            if( '/' == substr($value, 0, 1) ) continue;
            if( empty($value) ) continue;

            $tdu = get_template_directory_uri();
            $tdu = str_replace("/","\\\\/",$tdu);
            
            $value = str_replace("%%%THEME-URL%%%", $tdu, $value);
            $sqlF[] = $value;
        }
        
        foreach ($sqlF as $sql) {
            //echo '<hr><hr><hr>';
            //echo $sql;
            @mysql_query( $sql );
        }
        //exit;
    }

    static function moveToThemeOptions(){

        autoInstall::addDefaultSliderIfPossible();

        fOpt::Set('autoinstall', 'plugins', 'finished' );
        wp_enqueue_script(
              'ff_autoinstall4',
              get_template_directory_uri().'/plugins/autoinstall4.js',
              array('jquery')
        );
    }

    static function addAfterAutoInstall(){
        fOpt::Set('autoinstall', 'plugins', 'activate-required-plugins-page' );
        wp_enqueue_script(
              'ff_autoinstall3',
              get_template_directory_uri().'/plugins/autoinstall3.js',
              array('jquery')
        );
    }

    static function addAutoInstallJavaScript(){
        fOpt::Set('autoinstall', 'plugins', 'move-to-activate-required-plugins-page' );
        wp_enqueue_script(
              'ff_autoinstall2',
              get_template_directory_uri().'/plugins/autoinstall2.js',
              array('jquery')
        );
    }

    static function redirectToInstallPlugins(){
        fOpt::Set('autoinstall', 'plugins', 'install-required-plugins-page' );
        wp_enqueue_script(
              'ff_autoinstall1',
              get_template_directory_uri().'/plugins/autoinstall1.js',
              array('jquery')
        );
    }
}


