Example #1
0
/**
 * Displays a list of albums. For use in admin center.
 */
function albums_admin_show_albums()
{
    global $lang;
    $albums = albums_get_albums();
    if ($albums == FALSE) {
        echo '<span class="kop4">' . $lang['general']['nothing_yet'] . '</span>';
    } else {
        foreach ($albums as $album) {
            ?>
				<div class="menudiv">
					<span>
						<img src="<?php 
            echo MODULE_DIR;
            ?>
/images/albums.png" alt="" />
					</span>
					<span class="title-page"><?php 
            echo $album['title'];
            ?>
</span>
					<span>
						<a href="?module=albums&amp;page=editalbum&amp;var1=<?php 
            echo $album['seoname'];
            ?>
">
							<img src="data/image/edit.png" title="<?php 
            echo $lang['albums']['edit_album'];
            ?>
" alt="<?php 
            echo $lang['albums']['edit_album'];
            ?>
" />
						</a>
					</span>
					<span>
						<a href="?module=albums&amp;page=deletealbum&amp;var1=<?php 
            echo $album['seoname'];
            ?>
">
							<img src="data/image/delete_from_trash.png"  title="<?php 
            echo $lang['albums']['delete_album'];
            ?>
" alt="<?php 
            echo $lang['albums']['delete_album'];
            ?>
" />
						</a>
					</span>
				</div>
			<?php 
        }
        unset($albums);
    }
}
Example #2
0
function albums_info()
{
    global $lang;
    return array('name' => $lang['albums']['title'], 'intro' => $lang['albums']['descr'], 'version' => '0.2', 'author' => $lang['general']['pluck_dev_team'], 'website' => 'http://www.pluck-cms.org', 'icon' => 'images/albums.png', 'compatibility' => '4.7', 'categories' => albums_get_albums(TRUE));
}
Example #3
0
function albums_theme_main($area, $category)
{
    //Only show category listing if category = null
    if ($category == null) {
        $albums = albums_get_albums();
        if ($albums != FALSE) {
            //Loop through dirs.
            foreach ($albums as $album) {
                include ALBUMS_DIR . '/' . $album['seoname'] . '.php';
                //Find the first image.
                $files = read_dir_contents(ALBUMS_DIR . '/' . $album['seoname'], 'files');
                //Only display album if it contains images.
                if (!empty($files)) {
                    natcasesort($files);
                    foreach ($files as $file) {
                        $parts = explode('.', $file);
                        if (count($parts) == 4) {
                            list($number, $fdirname, $ext, $php) = $parts;
                            $first_image = $fdirname . '.' . $ext;
                            break;
                        }
                    }
                    unset($file);
                    ?>
					<div class="album">
						<table>
							<tr>
								<td>
									<a href="<?php 
                    echo SITE_URL . '/' . PAGE_URL_PREFIX . CURRENT_PAGE_SEONAME . ALBUM_URL_PREFIX . $album['seoname'];
                    ?>
" title="album <?php 
                    echo $album['title'];
                    ?>
">
										<img alt="<?php 
                    echo $album['title'];
                    ?>
" title="<?php 
                    echo $album['title'];
                    ?>
" src="<?php 
                    echo SITE_URL;
                    ?>
/data/modules/albums/albums_getimage.php?image=<?php 
                    echo $album['seoname'];
                    ?>
/thumb/<?php 
                    echo $first_image;
                    ?>
" />
									</a>
								</td>
								<td>
									<span class="albuminfo">
										<a href="<?php 
                    echo SITE_URL . '/' . PAGE_URL_PREFIX . CURRENT_PAGE_SEONAME . ALBUM_URL_PREFIX . $album['seoname'];
                    ?>
" title="<?php 
                    echo $album['title'];
                    ?>
"><?php 
                    echo $album['title'];
                    ?>
</a>
									</span>
								</td>
							</tr>
						</table>
					</div>
					<?php 
                }
            }
            unset($albums);
        }
    } else {
        albums_site_show_images(seo_url($category));
    }
}