function flagShowSkin_video_default($args)
{
    extract($args);
    $flag_options = get_option('flag_options');
    $skinID = 'id_' . mt_rand();
    // look up for the path
    $playlistpath = ABSPATH . $flag_options['galleryPath'] . 'playlists/video/' . $playlist . '.xml';
    $data = file_get_contents($playlistpath);
    $flashBackcolor = flagGetBetween($data, '<property1>0x', '</property1>');
    if (empty($width)) {
        $width = flagGetBetween($data, '<width><![CDATA[', ']]></width>');
    }
    if (empty($height)) {
        $height = flagGetBetween($data, '<height><![CDATA[', ']]></height>');
    }
    if (empty($wmode)) {
        $wmode = flagGetBetween($data, '<property0><![CDATA[', ']]></property0>');
    }
    if (empty($flashBackcolor)) {
        $flashBackcolor = $flag_options['flashBackcolor'];
    }
    require_once FLAG_ABSPATH . 'admin/video.functions.php';
    $playlist_data = get_v_playlist_data($playlistpath);
    $alternative = '';
    if (count($playlist_data['items'])) {
        foreach ($playlist_data['items'] as $id) {
            $videoObject = get_post($id);
            $url = wp_get_attachment_url($videoObject->ID);
            $thumb = get_post_meta($videoObject->ID, 'thumbnail', true);
            $aimg = $thumb ? '<img src="' . $thumb . '" style="float:left;margin-right:10px;width:150px;height:auto;" alt="" />' : '';
            $atitle = $videoObject->post_title ? '<strong>' . $videoObject->post_title . '</strong>' : '';
            $acontent = $videoObject->post_content ? '<div style="padding:4px 0;">' . $videoObject->post_content . '</div>' : '';
            $alternative .= '<div id="video_' . $videoObject->ID . '" style="overflow:hidden;padding:7px 0;">' . $aimg . $atitle . $acontent . '<div style="font-size:80%;">This browser does not support flv files! You can <a href="' . $url . '">download the video</a> instead.</div></div>';
        }
    }
    // init the flash output
    $swfobject = new flag_swfobject($flag_options['skinsDirURL'] . $skin . '/gallery.swf', $skinID, $width, $height, '10.1.52', plugins_url('/' . FLAGFOLDER . '/') . 'skins/expressInstall.swf');
    global $swfCounter;
    $swfobject->add_params('wmode', $wmode);
    $swfobject->add_params('allowfullscreen', 'true');
    $swfobject->add_params('allowScriptAccess', 'always');
    $swfobject->add_params('saling', 'lt');
    $swfobject->add_params('scale', 'noScale');
    $swfobject->add_params('menu', 'false');
    $swfobject->add_params('bgcolor', '#' . $flashBackcolor);
    $swfobject->add_attributes('id', $skinID);
    $swfobject->add_attributes('name', $skinID);
    // adding the flash parameter
    $swfobject->add_flashvars('path', $flag_options['skinsDirURL'] . $skin . '/');
    $swfobject->add_flashvars('skinID', $skinID);
    $swfobject->add_flashvars('playlist', $playlist);
    // create the output
    $out = '<div class="grandvideo">' . $swfobject->output($alternative) . '</div>';
    // add now the script code
    $out .= '<script type="text/javascript" defer="defer">';
    $out .= $swfobject->javascript();
    $out .= '</script>';
    $out = apply_filters('flag_show_flash_v_content', $out);
    return $out;
}
function flagShowSkin_banner_widget_default($args)
{
    extract($args);
    $flag_options = get_option('flag_options');
    $skinID = 'id_' . mt_rand();
    // look up for the path
    $skinpath = trailingslashit($flag_options['skinsDirABS']) . $skin;
    $playlistpath = $flag_options['galleryPath'] . 'playlists/banner/' . $xml . '.xml';
    $js = $flag_options['skinsDirURL'] . $skin . "/jquery.cycle.lite.js";
    $data = file_get_contents($skinpath . '/settings/settings.xml');
    $flashBackcolor = flagGetBetween($data, '<property1>0x', '</property1>');
    if (empty($width)) {
        $width = flagGetBetween($data, '<width><![CDATA[', ']]></width>');
    }
    if (empty($height)) {
        $height = flagGetBetween($data, '<height><![CDATA[', ']]></height>');
    }
    $wmode = flagGetBetween($data, '<property0><![CDATA[', ']]></property0>');
    if (empty($flashBackcolor)) {
        $flashBackcolor = $flag_options['flashBackcolor'];
    }
    $params['autoPlay'] = flagGetBetween($data, '<autoPlay>', '</autoPlay>');
    $params['slideshowDelay'] = flagGetBetween($data, '<slideshowDelay>', '</slideshowDelay>');
    $alternate = get_include_contents($skinpath . "/jgallery.php", $playlistpath, $skin, $skinID, $width, $height, $params);
    // init the flash output
    $swfobject = new flag_swfobject($flag_options['skinsDirURL'] . $skin . '/gallery.swf', $skinID, $width, $height, '10.1.52', plugins_url('/' . FLAGFOLDER . '/') . 'skins/expressInstall.swf');
    global $swfCounter;
    $swfobject->add_params('wmode', $wmode);
    $swfobject->add_params('allowfullscreen', 'true');
    $swfobject->add_params('allowScriptAccess', 'always');
    $swfobject->add_params('saling', 'lt');
    $swfobject->add_params('scale', 'noScale');
    $swfobject->add_params('menu', 'false');
    $swfobject->add_params('bgcolor', '#' . $flashBackcolor);
    $swfobject->add_attributes('id', $skinID);
    $swfobject->add_attributes('name', $skinID);
    // adding the flash parameter
    $swfobject->add_flashvars('path', $flag_options['skinsDirURL'] . $skin . '/');
    $swfobject->add_flashvars('skinID', $skinID);
    $swfobject->add_flashvars('playlist', $xml);
    // create the output
    $out = '<div class="grandbanner ' . $wmode . '">' . $swfobject->output($alternate) . '</div>';
    // add now the script code
    $out .= "\n" . '<script type="text/javascript" src="' . $js . '"></script>';
    $out .= "\n" . '<script type="text/javascript" defer="defer">';
    $out .= $swfobject->javascript();
    $out .= "\n" . '</script>';
    $out = apply_filters('flag_show_flash_w_content', $out);
    return $out;
}
function flagShowSkin_music_default($args)
{
    extract($args);
    $flag_options = get_option('flag_options');
    $skinID = 'id_' . mt_rand();
    // look up for the path
    $playlistpath = ABSPATH . $flag_options['galleryPath'] . 'playlists/' . $playlist . '.xml';
    if ($isWidget) {
        $skinpath = trailingslashit($flag_options['skinsDirABS']) . $skin;
        $data = file_get_contents($skinpath . '/settings/settings.xml');
    } else {
        $data = file_get_contents($playlistpath);
    }
    $flashBackcolor = flagGetBetween($data, '<property1>0x', '</property1>');
    if (empty($width)) {
        $width = flagGetBetween($data, '<width><![CDATA[', ']]></width>');
    }
    if (empty($height)) {
        $height = flagGetBetween($data, '<height><![CDATA[', ']]></height>');
    }
    if (empty($wmode)) {
        $wmode = flagGetBetween($data, '<property0><![CDATA[', ']]></property0>');
    }
    if (empty($flashBackcolor)) {
        $flashBackcolor = $flag_options['flashBackcolor'];
    }
    require_once FLAG_ABSPATH . 'admin/playlist.functions.php';
    $playlist_data = get_playlist_data($playlistpath);
    $alternative = '';
    if (count($playlist_data['items'])) {
        foreach ($playlist_data['items'] as $id) {
            $mp3Object = get_post($id);
            $url = wp_get_attachment_url($mp3Object->ID);
            $thumb = get_post_meta($mp3Object->ID, 'thumbnail', true);
            $aimg = $thumb ? '<img src="' . $thumb . '" style="float:left;margin-right:10px;width:150px;height:auto;" alt="" />' : '';
            $atitle = $mp3Object->post_title ? '<strong style="display:block;">' . $mp3Object->post_title . '</strong>' : '';
            $acontent = $mp3Object->post_content ? '<div style="padding:4px 0;">' . $mp3Object->post_content . '</div>' : '';
            $alternative .= '<div id="audio_' . $mp3Object->ID . '" style="overflow:hidden;padding:7px 0;">' . $aimg . $atitle . $acontent . '<p><audio src="' . $url . '" controls preload="none" autobuffer="false"></audio></p></div>';
        }
    }
    // init the flash output
    $swfobject = new flag_swfobject($flag_options['skinsDirURL'] . $skin . '/gallery.swf', $skinID, $width, $height, '10.1.52', plugins_url('/' . FLAGFOLDER . '/') . 'skins/expressInstall.swf');
    global $swfCounter;
    $swfobject->add_params('wmode', $wmode);
    $swfobject->add_params('allowfullscreen', 'true');
    $swfobject->add_params('allowScriptAccess', 'always');
    $swfobject->add_params('saling', 'lt');
    $swfobject->add_params('scale', 'noScale');
    $swfobject->add_params('menu', 'false');
    $swfobject->add_params('bgcolor', '#' . $flashBackcolor);
    $swfobject->add_attributes('id', $skinID);
    $swfobject->add_attributes('name', $skinID);
    // adding the flash parameter
    $swfobject->add_flashvars('path', $flag_options['skinsDirURL'] . $skin . '/');
    $swfobject->add_flashvars('skinID', $skinID);
    $swfobject->add_flashvars('playlist', $playlist);
    if ($isWidget) {
        $swfobject->add_flashvars('widget', 1);
    }
    // create the output
    $out = '<div class="grandmusic">' . $swfobject->output($alternative) . '</div>';
    // add now the script code
    if (!$crawler) {
        $out .= '<script type="text/javascript" defer="defer">';
        $out .= $swfobject->javascript();
        $out .= '</script>';
    }
    $out = apply_filters('flag_show_flash_content', $out);
    return $out;
}
 function grandbannerwidget($atts)
 {
     extract(shortcode_atts(array('xml' => '', 'w' => '', 'h' => '', 'skin' => ''), $atts));
     $out = sprintf(__('[XML %s not found]', 'flash-album-gallery'), $xml);
     if ($xml && $skin) {
         $flag_options = get_option('flag_options');
         $skinpath = trailingslashit($flag_options['skinsDirABS']) . $skin;
         if (!file_exists($skinpath)) {
             return $out;
         }
         $data = @file_get_contents($skinpath);
         $swfmousewheel = false;
         $swfmousewheel = flagGetBetween($data, '<swfmousewheel>', '</swfmousewheel>');
         if ($swfmousewheel == 'true') {
             $this->flag_add_mousewheel = true;
         }
         $this->flag_shortcode = true;
         $out = flagShowWidgetBanner($xml, $w, $h, $skin);
     }
     return $out;
 }
function flagShowSkin_banner_default($args)
{
    extract($args);
    $flag_options = get_option('flag_options');
    $skinID = mt_rand();
    // look up for the path
    $playlistpath = ABSPATH . $flag_options['galleryPath'] . 'playlists/banner/' . $xml . '.xml';
    $data = file_get_contents($playlistpath);
    if (empty($width)) {
        $width = flagGetBetween($data, '<width><![CDATA[', ']]></width>');
    }
    if (empty($height)) {
        $height = flagGetBetween($data, '<height><![CDATA[', ']]></height>');
    }
    $theme = flagGetBetween($data, '<theme><![CDATA[', ']]></theme>');
    if (empty($theme)) {
        $theme = 'default';
    }
    $effect = flagGetBetween($data, '<effect><![CDATA[', ']]></effect>');
    $slices = flagGetBetween($data, '<slices><![CDATA[', ']]></slices>');
    $animSpeed = flagGetBetween($data, '<animSpeed><![CDATA[', ']]></animSpeed>');
    $pauseTime = flagGetBetween($data, '<pauseTime><![CDATA[', ']]></pauseTime>');
    $startSlide = flagGetBetween($data, '<startSlide><![CDATA[', ']]></startSlide>');
    $pauseOnHover = flagGetBetween($data, '<pauseOnHover>', '</pauseOnHover>');
    $directionNav = flagGetBetween($data, '<directionNav>', '</directionNav>');
    $controlNav = flagGetBetween($data, '<controlNav>', '</controlNav>');
    $randomStart = flagGetBetween($data, '<randomStart>', '</randomStart>');
    $linkTarget = flagGetBetween($data, '<linkTarget>', '</linkTarget>') == 'false' ? '' : ' target="_blank"';
    $out = '';
    if (count($items)) {
        $out .= '<link rel="stylesheet" href="' . plugins_url('/' . FLAGFOLDER . '/') . 'admin/js/themes/' . $theme . '/styles.css" type="text/css" media="screen" />
<link rel="stylesheet" href="' . plugins_url('/' . FLAGFOLDER . '/') . 'admin/js/nivo-slider.css" type="text/css" media="screen" />
<script src="' . plugins_url('/' . FLAGFOLDER . '/') . 'admin/js/jquery.nivo.slider.pack.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(window).load(function() {
    jQuery("#slider_' . $skinID . '").nivoSlider({
        effect:"' . $effect . '",
        slices:' . $slices . ',
        boxCols:8,
        boxRows:4,
        animSpeed:' . $animSpeed . ',
        pauseTime:' . $pauseTime . ',
        startSlide:' . $startSlide . ',
        directionNav:' . $directionNav . ',
        controlNav:' . $controlNav . ',
        controlNavThumbs:false,
        pauseOnHover:' . $pauseOnHover . ',
        prevText:"Prev",
        nextText:"Next",
		randomStart: ' . $randomStart . '
    });
});
</script>';
        $marginBot = isset($keyboardNav) && $keyboardNav ? '55px' : '0';
        $out .= '
<div class="slider-wrapper theme-' . $theme . '" style="position: relative; margin-bottom:' . $marginBot . '">
    <div class="ribbon"></div>
    <div id="slider_' . $skinID . '" class="nivoSlider">';
        $suffix = $width . 'x' . $height;
        foreach ($items as $id) {
            $ban = get_post($id);
            //$thumb = get_post_meta($id, 'thumbnail', true);
            $url = wp_get_attachment_url($ban->ID);
            $path = get_attached_file($ban->ID);
            $info = pathinfo($path);
            $dir = $info['dirname'];
            $ext = $info['extension'];
            $name = urldecode(basename(str_replace('%2F', '/', urlencode($path)), ".{$ext}"));
            $img_file = "{$dir}/{$name}-{$suffix}.{$ext}";
            if (!file_exists($img_file)) {
                $track = $url;
            } else {
                $track = dirname($url) . "/{$name}-{$suffix}.{$ext}";
            }
            $link = get_post_meta($id, 'link', true);
            $title = $ban->post_title ? ' title="' . strip_tags($ban->post_title) . '"' : '';
            if ($link) {
                $out .= '
		<a href="' . $link . '"' . $linkTarget . '><img src="' . $track . '" alt=""' . $title . ' /></a>';
            } else {
                $out .= '
	    <img src="' . $track . '" alt=""' . $title . ' />';
            }
        }
    }
    $out .= '
    </div>
	<div class="grandlovelink"><a href="http://wordpress.org/extend/plugins/flash-album-gallery/">GRAND FlAGallery WordPress plugin</a></div>
</div>';
    $out = apply_filters('flag_show_flash_b_content', $out);
    return $out;
}