예제 #1
0
 function render_slideshow($galleryID, $irWidth = '', $irHeight = '')
 {
     require_once dirname(__FILE__) . '/../lib/swfobject.php';
     global $wpdb;
     $ngg_options = get_option('ngg_options');
     // remove media file from RSS feed
     if (is_feed()) {
         $out = '[' . $ngg_options['galTextSlide'] . ']';
         return $out;
     }
     if (empty($irWidth)) {
         $irWidth = (int) $ngg_options['irWidth'];
     }
     if (empty($irHeight)) {
         $irHeight = (int) $ngg_options['irHeight'];
     }
     // init the flash output
     $swfobject = new swfobject(NGGALLERY_URLPATH . 'imagerotator.swf', 'sbsl' . $galleryID, $irWidth, $irHeight, '7.0.0', 'false');
     $swfobject->classname = 'ngg-widget-slideshow';
     $swfobject->message = __('<a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see the slideshow.', 'nggallery');
     $swfobject->add_params('wmode', 'opaque');
     $swfobject->add_params('bgcolor', $ngg_options['irScreencolor'], '000000', 'string', '#');
     $swfobject->add_attributes('styleclass', 'slideshow-widget');
     // adding the flash parameter
     $swfobject->add_flashvars('file', NGGALLERY_URLPATH . 'xml/imagerotator.php?gid=' . $galleryID);
     $swfobject->add_flashvars('shownavigation', 'false', 'true', 'bool');
     $swfobject->add_flashvars('shuffle', $ngg_options['irShuffle'], 'true', 'bool');
     $swfobject->add_flashvars('showicons', $ngg_options['irShowicons'], 'true', 'bool');
     $swfobject->add_flashvars('overstretch', $ngg_options['irOverstretch'], 'false', 'string');
     $swfobject->add_flashvars('rotatetime', $ngg_options['irRotatetime'], 5, 'int');
     $swfobject->add_flashvars('transition', $ngg_options['irTransition'], 'random', 'string');
     $swfobject->add_flashvars('backcolor', $ngg_options['irBackcolor'], 'FFFFFF', 'string', '0x');
     $swfobject->add_flashvars('frontcolor', $ngg_options['irFrontcolor'], '000000', 'string', '0x');
     $swfobject->add_flashvars('lightcolor', $ngg_options['irLightcolor'], '000000', 'string', '0x');
     $swfobject->add_flashvars('screencolor', $ngg_options['irScreencolor'], '000000', 'string', '0x');
     $swfobject->add_flashvars('width', $irWidth, '260');
     $swfobject->add_flashvars('height', $irHeight, '320');
     // create the output
     $out = $swfobject->output();
     // add now the script code
     $out .= "\n" . '<script type="text/javascript" defer="defer">';
     $out .= "\n" . '<!--';
     $out .= "\n" . '//<![CDATA[';
     $out .= $swfobject->javascript();
     $out .= "\n" . '//]]>';
     $out .= "\n" . '-->';
     $out .= "\n" . '</script>';
     echo $out;
 }
 function render_slideshow($galleryID, $irWidth = '', $irHeight = '')
 {
     require_once dirname(__FILE__) . '/../lib/swfobject.php';
     $ngg_options = get_option('ngg_options');
     //Redirect all calls to the JavaScript slideshow if wanted
     if ($ngg_options['enableIR'] !== '1' || nggGallery::detect_mobile_phone() === true || NGGALLERY_IREXIST == false) {
         return nggShow_JS_Slideshow($galleryID, $irWidth, $irHeight, 'ngg-widget-slideshow');
     }
     if (empty($irWidth)) {
         $irWidth = (int) $ngg_options['irWidth'];
     }
     if (empty($irHeight)) {
         $irHeight = (int) $ngg_options['irHeight'];
     }
     // init the flash output
     $swfobject = new swfobject($ngg_options['irURL'], 'sbsl' . $galleryID, $irWidth, $irHeight, '7.0.0', 'false');
     $swfobject->classname = 'ngg-widget-slideshow';
     $swfobject->message = __('<a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see the slideshow.', 'nggallery');
     $swfobject->add_params('wmode', 'opaque');
     $swfobject->add_params('bgcolor', $ngg_options['irScreencolor'], 'FFFFFF', 'string', '#');
     $swfobject->add_attributes('styleclass', 'slideshow-widget');
     // adding the flash parameter
     $swfobject->add_flashvars('file', urlencode(trailingslashit(home_url()) . 'index.php?callback=imagerotator&gid=' . $galleryID));
     $swfobject->add_flashvars('shownavigation', 'false', 'true', 'bool');
     $swfobject->add_flashvars('shuffle', $ngg_options['irShuffle'], 'true', 'bool');
     $swfobject->add_flashvars('showicons', $ngg_options['irShowicons'], 'true', 'bool');
     $swfobject->add_flashvars('overstretch', $ngg_options['irOverstretch'], 'false', 'string');
     $swfobject->add_flashvars('rotatetime', $ngg_options['irRotatetime'], 5, 'int');
     $swfobject->add_flashvars('transition', $ngg_options['irTransition'], 'random', 'string');
     $swfobject->add_flashvars('backcolor', $ngg_options['irBackcolor'], 'FFFFFF', 'string', '0x');
     $swfobject->add_flashvars('frontcolor', $ngg_options['irFrontcolor'], '000000', 'string', '0x');
     $swfobject->add_flashvars('lightcolor', $ngg_options['irLightcolor'], '000000', 'string', '0x');
     $swfobject->add_flashvars('screencolor', $ngg_options['irScreencolor'], '000000', 'string', '0x');
     $swfobject->add_flashvars('width', $irWidth, '260');
     $swfobject->add_flashvars('height', $irHeight, '320');
     // create the output
     $out = $swfobject->output();
     // add now the script code
     $out .= "\n" . '<script type="text/javascript" defer="defer">';
     $out .= "\n" . '<!--';
     $out .= "\n" . '//<![CDATA[';
     $out .= $swfobject->javascript();
     $out .= "\n" . '//]]>';
     $out .= "\n" . '-->';
     $out .= "\n" . '</script>';
     $out = apply_filters('ngg_show_slideshow_widget_content', $out, $galleryID, $irWidth, $irHeight);
     return $out;
 }
예제 #3
0
/**
 * Return a script for the Imagerotator flash slideshow. Can be used in any template with <?php echo nggShowSlideshow($galleryID, $width, $height) ?>
 * Require the script swfobject.js in the header or footer
 * 
 * @access public 
 * @param integer $galleryID ID of the gallery
 * @param integer $irWidth Width of the flash container
 * @param integer $irHeight Height of the flash container
 * @return the content
 */
function nggShowSlideshow($galleryID, $width, $height)
{
    require_once dirname(__FILE__) . '/lib/swfobject.php';
    $ngg_options = nggGallery::get_option('ngg_options');
    // remove media file from RSS feed
    if (is_feed()) {
        $out = '[' . nggGallery::i18n($ngg_options['galTextSlide']) . ']';
        return $out;
    }
    //Redirect all calls to the JavaScript slideshow if wanted
    if ($ngg_options['enableIR'] !== '1' || nggGallery::detect_mobile_phone() === true) {
        return nggShow_JS_Slideshow($galleryID, $width, $height);
    }
    // If the Imagerotator didn't exist, skip the output
    if (NGGALLERY_IREXIST == false) {
        return;
    }
    if (empty($width)) {
        $width = (int) $ngg_options['irWidth'];
    }
    if (empty($height)) {
        $height = (int) $ngg_options['irHeight'];
    }
    // Doesn't work fine with zero
    $ngg_options['irRotatetime'] = $ngg_options['irRotatetime'] == 0 ? 5 : $ngg_options['irRotatetime'];
    // init the flash output
    $swfobject = new swfobject($ngg_options['irURL'], 'so' . $galleryID, $width, $height, '7.0.0', 'false');
    $swfobject->message = '<p>' . __('The <a href="http://www.macromedia.com/go/getflashplayer">Flash Player</a> and <a href="http://www.mozilla.com/firefox/">a browser with Javascript support</a> are needed.', 'nggallery') . '</p>';
    $swfobject->add_params('wmode', 'opaque');
    $swfobject->add_params('allowfullscreen', 'true');
    $swfobject->add_params('bgcolor', $ngg_options['irScreencolor'], 'FFFFFF', 'string', '#');
    $swfobject->add_attributes('styleclass', 'slideshow');
    $swfobject->add_attributes('name', 'so' . $galleryID);
    // adding the flash parameter
    $swfobject->add_flashvars('file', urlencode(trailingslashit(home_url()) . 'index.php?callback=imagerotator&gid=' . $galleryID));
    $swfobject->add_flashvars('shuffle', $ngg_options['irShuffle'], 'true', 'bool');
    // option has oposite meaning : true should switch to next image
    $swfobject->add_flashvars('linkfromdisplay', !$ngg_options['irLinkfromdisplay'], 'false', 'bool');
    $swfobject->add_flashvars('shownavigation', $ngg_options['irShownavigation'], 'true', 'bool');
    $swfobject->add_flashvars('showicons', $ngg_options['irShowicons'], 'true', 'bool');
    $swfobject->add_flashvars('kenburns', $ngg_options['irKenburns'], 'false', 'bool');
    $swfobject->add_flashvars('overstretch', $ngg_options['irOverstretch'], 'false', 'string');
    $swfobject->add_flashvars('rotatetime', $ngg_options['irRotatetime'], 5, 'int');
    $swfobject->add_flashvars('transition', $ngg_options['irTransition'], 'random', 'string');
    $swfobject->add_flashvars('backcolor', $ngg_options['irBackcolor'], 'FFFFFF', 'string', '0x');
    $swfobject->add_flashvars('frontcolor', $ngg_options['irFrontcolor'], '000000', 'string', '0x');
    $swfobject->add_flashvars('lightcolor', $ngg_options['irLightcolor'], '000000', 'string', '0x');
    $swfobject->add_flashvars('screencolor', $ngg_options['irScreencolor'], '000000', 'string', '0x');
    if ($ngg_options['irWatermark']) {
        $swfobject->add_flashvars('logo', $ngg_options['wmPath'], '', 'string');
    }
    $swfobject->add_flashvars('audio', $ngg_options['irAudio'], '', 'string');
    $swfobject->add_flashvars('width', $width, '260');
    $swfobject->add_flashvars('height', $height, '320');
    // create the output
    $out = '<div class="slideshow">' . $swfobject->output() . '</div>';
    // add now the script code
    $out .= "\n" . '<script type="text/javascript" defer="defer">';
    // load script via jQuery afterwards
    // $out .= "\n".'jQuery.getScript( "'  . NGGALLERY_URLPATH . 'admin/js/swfobject.js' . '", function() {} );';
    if ($ngg_options['irXHTMLvalid']) {
        $out .= "\n" . '<!--';
    }
    if ($ngg_options['irXHTMLvalid']) {
        $out .= "\n" . '//<![CDATA[';
    }
    $out .= $swfobject->javascript();
    if ($ngg_options['irXHTMLvalid']) {
        $out .= "\n" . '//]]>';
    }
    if ($ngg_options['irXHTMLvalid']) {
        $out .= "\n" . '-->';
    }
    $out .= "\n" . '</script>';
    $out = apply_filters('ngg_show_slideshow_content', $out, $galleryID, $width, $height);
    return $out;
}
예제 #4
0
/**
 * Return a script for the Imagerotator flash slideshow. Can be used in any tmeplate with <?php echo nggShowSlideshow($galleryID, $width, $height) ?>
 * Require the script swfobject.js in the header or footer
 * 
 * @access public 
 * @param integer $galleryID ID of the gallery
 * @param integer $irWidth Width of the flash container
 * @param integer $irHeight Height of the flash container
 * @return the content
 */
function nggShowSlideshow($galleryID, $width, $height)
{
    require_once dirname(__FILE__) . '/lib/swfobject.php';
    $ngg_options = nggGallery::get_option('ngg_options');
    // remove media file from RSS feed
    if (is_feed()) {
        $out = '[' . nggGallery::i18n($ngg_options['galTextSlide']) . ']';
        return $out;
    }
    // If the Imagerotator didn't exist, skip the output
    if (NGGALLERY_IREXIST == false) {
        return;
    }
    if (empty($width)) {
        $width = (int) $ngg_options['irWidth'];
    }
    if (empty($height)) {
        $height = (int) $ngg_options['irHeight'];
    }
    // init the flash output
    $swfobject = new swfobject($ngg_options['irURL'], 'so' . $galleryID, $width, $height, '7.0.0', 'false');
    $swfobject->message = '<p>' . __('The <a href="http://www.macromedia.com/go/getflashplayer">Flash Player</a> and <a href="http://www.mozilla.com/firefox/">a browser with Javascript support</a> are needed..', 'nggallery') . '</p>';
    $swfobject->add_params('wmode', 'opaque');
    $swfobject->add_params('allowfullscreen', 'true');
    $swfobject->add_params('bgcolor', $ngg_options['irScreencolor'], '000000', 'string', '#');
    $swfobject->add_attributes('styleclass', 'slideshow');
    $swfobject->add_attributes('name', 'so' . $galleryID);
    // adding the flash parameter
    $swfobject->add_flashvars('file', urlencode(get_option('siteurl') . '/' . 'index.php?slideshow=true&gid=' . $galleryID));
    $swfobject->add_flashvars('shuffle', $ngg_options['irShuffle'], 'true', 'bool');
    $swfobject->add_flashvars('linkfromdisplay', $ngg_options['irLinkfromdisplay'], 'false', 'bool');
    $swfobject->add_flashvars('shownavigation', $ngg_options['irShownavigation'], 'true', 'bool');
    $swfobject->add_flashvars('showicons', $ngg_options['irShowicons'], 'true', 'bool');
    $swfobject->add_flashvars('kenburns', $ngg_options['irKenburns'], 'false', 'bool');
    $swfobject->add_flashvars('overstretch', $ngg_options['irOverstretch'], 'false', 'string');
    $swfobject->add_flashvars('rotatetime', $ngg_options['irRotatetime'], 5, 'int');
    $swfobject->add_flashvars('transition', $ngg_options['irTransition'], 'random', 'string');
    $swfobject->add_flashvars('backcolor', $ngg_options['irBackcolor'], 'FFFFFF', 'string', '0x');
    $swfobject->add_flashvars('frontcolor', $ngg_options['irFrontcolor'], '000000', 'string', '0x');
    $swfobject->add_flashvars('lightcolor', $ngg_options['irLightcolor'], '000000', 'string', '0x');
    $swfobject->add_flashvars('screencolor', $ngg_options['irScreencolor'], '000000', 'string', '0x');
    if ($ngg_options['irWatermark']) {
        $swfobject->add_flashvars('logo', $ngg_options['wmPath'], '', 'string');
    }
    $swfobject->add_flashvars('audio', $ngg_options['irAudio'], '', 'string');
    $swfobject->add_flashvars('width', $width, '260');
    $swfobject->add_flashvars('height', $height, '320');
    // create the output
    $out = '<div class="slideshow">' . $swfobject->output() . '</div>';
    // add now the script code
    $out .= "\n" . '<script type="text/javascript" defer="defer">';
    if ($ngg_options['irXHTMLvalid']) {
        $out .= "\n" . '<!--';
    }
    if ($ngg_options['irXHTMLvalid']) {
        $out .= "\n" . '//<![CDATA[';
    }
    $out .= $swfobject->javascript();
    if ($ngg_options['irXHTMLvalid']) {
        $out .= "\n" . '//]]>';
    }
    if ($ngg_options['irXHTMLvalid']) {
        $out .= "\n" . '-->';
    }
    $out .= "\n" . '</script>';
    $out = apply_filters('ngg_show_slideshow_content', $out);
    return $out;
}
예제 #5
0
파일: index.php 프로젝트: bensethro/runcyb
 if ($flash_background_color && $flash_background_color[0] == '#') {
     $flash_background_color = substr($flash_background_color, 1);
 }
 if ($flash_text_color && $flash_text_color[0] == '#') {
     $flash_text_color = substr($flash_text_color, 1);
 }
 if ($flash_rollover_color && $flash_rollover_color[0] == '#') {
     $flash_rollover_color = substr($flash_rollover_color, 1);
 }
 if ($flash_screen_color && $flash_screen_color[0] == '#') {
     $flash_screen_color = substr($flash_screen_color, 1);
 }
 // init the flash output
 $swfobject = new swfobject($flash_path, 'so' . $displayed_gallery_id, $width, $height, '7.0.0', 'false');
 $swfobject->message = '<p>' . __('Slideshows require the&nbsp;<a href="http://www.macromedia.com/go/getflashplayer">Flash Player</a>&nbsp;and a&nbsp;<a href="http://www.mozilla.com/firefox/">browser with Javascript support</a>.', 'nggallery') . '</p>';
 $swfobject->add_params('wmode', 'opaque');
 $swfobject->add_params('allowfullscreen', 'true');
 $swfobject->add_params('bgcolor', $flash_screen_color, 'FFFFFF', 'string', '#');
 $swfobject->add_attributes('styleclass', 'slideshow');
 $swfobject->add_attributes('name', 'so' . $displayed_gallery_id);
 // adding the flash parameter
 $swfobject->add_flashvars('file', urlencode($mediarss_link));
 $swfobject->add_flashvars('shuffle', !empty($flash_shuffle) ? TRUE : FALSE, '', 'bool');
 // option has oposite meaning : true should switch to next image
 $swfobject->add_flashvars('linkfromdisplay', !$flash_next_on_click, 'false', 'bool');
 $swfobject->add_flashvars('shownavigation', $flash_navigation_bar, 'true', 'bool');
 $swfobject->add_flashvars('showicons', $flash_loading_icon, 'true', 'bool');
 $swfobject->add_flashvars('kenburns', $flash_slow_zoom, 'false', 'bool');
 $swfobject->add_flashvars('overstretch', $flash_stretch_image, 'false', 'string');
 $swfobject->add_flashvars('rotatetime', $cycle_interval, 5, 'int');
 $swfobject->add_flashvars('transition', $flash_transition_effect, 'random', 'string');