staticpage.txt

Media Gallery supports the ability to create an album list using glFusion's
Static Page.

In order to use this, you must have PHP enabled for static pages. See the
glFusion documentation for information about enabling PHP for static pages.

Create a static page

Make the following 2 lines the contents of the static page

	global $MG_albums;
	echo $MG_albums[0]->showTree(0);

The showTree(##) is the depth.  0 prints all albums in Media Gallery,
1 prints the first level of albums, 2 - print 2 levels deep...

Make sure you select the following for the static page:

Check Wrap Static Page in a block
PHP: execute PHP

Save the file and it should now display a full list of your albums when
the page is loaded.

*** Splash Slide show for Static Page ***

Add the following to your lib-custom.php

function phpblock_mg_fsplash($aid, $width, $height, $delay, $transition, $enable_link=0){
    global $MG_albums, $_MG_CONF, $_CONF, $LANG_MG03, $swfjsinclude;

    if ( $MG_albums[$aid]->access == 0 ) {
        return 'No access';
    }
    if ( $MG_albums[$aid]->hidden || $enable_link == 0 ) {
        $nolink = 'true';
    } else {
        $nolink = 'false';
    }

    $swfobject  = '<script type="text/javascript">' . LB;
    $swfobject .= '	var flashvars = {};' . LB;
    $swfobject .= '	var params = {};' . LB;
    $swfobject .= '	var attributes = {};' . LB;
    $swfobject .= '	flashvars.action="true";' . LB;
    $swfobject .= '	flashvars.xmlUrl="' . $_MG_CONF['site_url'] . '/xml.php?aid=' . $aid . '%26src=disp&amp;showDropShadow=false&amp;dely=' . $delay . '&amp;transInType=Fade&amp;transOutType=Fade&amp;noLink=' . $nolink . '&amp;showtitle=bottom";' . LB;
    $swfobject .= '    swfobject.embedSWF("' . $_MG_CONF['site_url'] . '/players/minislideshow.swf", "fsplash", "' . $width . '", "' . $height . '", "9.0.0", "expressInstall.swf", flashvars, params, attributes);' . LB;
    $swfobject .= '</script>' . LB;
    $swfobject .= '<div id="fsplash">' . LB;
    $swfobject .= '	<a href="http://www.adobe.com/go/getflashplayer">' . LB;
    $swfobject .= '		<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player">' . LB;
    $swfobject .= '	</a>' . LB;
    $swfobject .= '</div>' . LB;

    return $swfobject;
}

---
In the static page, call the function like this:

echo phpblock_mg_fsplash(23, 300, 300, 5, 'fade', 1);

Set the static page to execute PHP.

The parameters are:

    album-Id = The album id to use
    width
    height
    delay
    transition
    link

