Example #1
0
 function show_flashalbum($atts)
 {
     global $wpdb, $flagdb;
     extract(shortcode_atts(array('gid' => '', 'album' => '', 'name' => '', 'w' => '', 'h' => '', 'orderby' => '', 'order' => '', 'exclude' => '', 'skin' => '', 'playlist' => '', 'wmode' => '', 'fullwindow' => false, 'align' => ''), $atts));
     $out = '';
     // make an array out of the ids
     $draft_clause = get_option('flag_db_version') < 2.75 ? '' : 'AND status=0';
     if ($album) {
         $gallerylist = $flagdb->get_album($album);
         $ids = explode(',', $gallerylist);
         $galleryIDs = array();
         foreach ($ids as $id) {
             $galleryIDs[] = $wpdb->get_var($wpdb->prepare("SELECT gid FROM {$wpdb->flaggallery} WHERE gid = %d {$draft_clause}", $id));
         }
         $galleryIDs = array_filter($galleryIDs);
         if (empty($galleryIDs)) {
             return $out = sprintf(__('[Gallery %s not found]', 'flash-album-gallery'), $gallerylist);
         }
         $gids = implode('_', $galleryIDs);
         $out = flagShowFlashAlbum($gids, $name, $w, $h, $skin, $playlist, $wmode, false, $fullwindow, $align);
     } elseif ($gid == "all") {
         $flag_options = get_option('flag_options');
         if (empty($orderby)) {
             $orderby = $flag_options['albSort'];
         }
         if (empty($order)) {
             $order = $flag_options['albSortDir'];
         }
         if (!in_array($orderby, array('title', 'rand'))) {
             $orderby = 'gid';
         }
         if (!$order) {
             $order = 'DESC';
         }
         $gallerylist = $flagdb->find_all_galleries($orderby, $order);
         if (is_array($gallerylist)) {
             $excludelist = explode(',', $exclude);
             $gids = '';
             foreach ($gallerylist as $gallery) {
                 if (in_array($gallery->gid, $excludelist)) {
                     continue;
                 }
                 $gids .= '_' . $gallery->gid;
             }
             $gids = ltrim($gids, '_');
             $out = flagShowFlashAlbum($gids, $name, $w, $h, $skin, $playlist, $wmode, false, $fullwindow, $align);
         } else {
             $out = __('[Galleries not found]', 'flash-album-gallery');
         }
     } else {
         $ids = explode(',', $gid);
         $galleryIDs = array();
         foreach ($ids as $id) {
             $id = intval($id);
             $galleryIDs[] = $wpdb->get_var($wpdb->prepare("SELECT gid FROM {$wpdb->flaggallery} WHERE gid = %d  {$draft_clause}", $id));
         }
         $galleryIDs = array_filter($galleryIDs);
         if (empty($galleryIDs)) {
             $out = sprintf(__('[Galleries %s not found]', 'flash-album-gallery'), $gid);
             return $out;
         }
         $gids = implode('_', $galleryIDs);
         $out = flagShowFlashAlbum($gids, $name, $w, $h, $skin, $playlist, $wmode, false, $fullwindow, $align);
     }
     $flag_options = get_option('flag_options');
     if ($skin == '') {
         $skin = $flag_options['flashSkin'];
     }
     $skinpath = trailingslashit($flag_options['skinsDirABS']) . $skin;
     if (!is_dir($skinpath)) {
         $skin = 'minima_jn';
         $skinpath = trailingslashit($flag_options['skinsDirABS']) . $skin;
     }
     $this->flag_shortcode = true;
     $this->flag_add_script = true;
     if (in_array($skin, array('slider_gallery', 'slider_gallery_demo', 'slider', 'slider_demo')) || !$flag_options['jAlterGalScript']) {
         $this->flag_fancybox = true;
     } else {
         $this->flag_fancybox = false;
     }
     $swfmousewheel = false;
     if (file_exists($skinpath . "/settings/settings.xml")) {
         $data = file_get_contents($skinpath . "/settings/settings.xml");
         $swfmousewheel = flagGetBetween($data, '<swfmousewheel>', '</swfmousewheel>');
     }
     if ($swfmousewheel == 'true') {
         $this->flag_add_mousewheel = true;
     }
     if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
         do_action('flag_footer_scripts');
     }
     return $out;
 }
Example #2
0
        $orderby = $flag_options['albSort'];
        $order = $flag_options['albSortDir'];
        $gallerylist = $flagdb->find_all_galleries($orderby, $order);
        if (is_array($gallerylist)) {
            foreach ($gallerylist as $gallery) {
                $gids .= '_' . $gallery->gid;
            }
            $gids = ltrim($gids, '_');
        }
    } else {
        $gids = explode('_', $gids);
        $mapping = array_map('intval', $gids);
        $gids = implode('_', $mapping);
    }
    if ($gids) {
        echo flagShowFlashAlbum($gids, $name = 'Gallery', $width = '100%', $height = $h, $skin, $playlist = '', $wmode = 'opaque', $linkto);
        ?>


<link href="<?php 
        echo plugins_url('/flash-album-gallery/admin/js/jquery.fancybox-1.3.4.css');
        ?>
" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="<?php 
        echo plugins_url('/flash-album-gallery/admin/js/jquery.fancybox-1.3.4.pack.js');
        ?>
" type="text/javascript"></script>
<script language="JavaScript" src="<?php 
        echo plugins_url('/flash-album-gallery/admin/js/flagscroll.js');
        ?>
" type="text/javascript"></script>