Location: PHPKode > scripts > AmaroK Web Frontend > obsidianmusic-2.3.0/pages/album.php
<?php

//
//  ObsidianMusic
//   a.k.a. amaroK Web Frontend 2.0
//
//  Created 1/1/06
//   Copyright (C) Ryan Loebs (ObsidianX) 2005/2006
//   See LICENSE for GPL
//
//  album.php - List and view all the albums in the collection
//
///////////////////////////////////////

if(eregi("album.php", $_SERVER['PHP_SELF'])){
	die("Cannot access directly.");
}

// See artist.php for comments

$tpl->addVar("root", "title", _PG_ALBUM);
$tpl->addVar("songs", "page", _PG_ALBUM);
$tpl->setAttribute("songs", "src", "artistalbum.tpl");
$tpl->loadTemplate("songs");

foreach($abc2sides as $key=>$value){
	$tpl->clearTemplate($key."box");
	foreach($value as $letter){
		$box = $key."box";
		$name = $key."name";
		$abclist[] = array('letter' => $letter);
		if($letter == "#"){
			$q = query(getquery("album", $sort, $localregexp));
		}else{
			$q = query(getquery("album", $sort, $letter));
		}
		$albums = array();
		if(mysql_num_rows($q)){
			while($album = fetch_assoc($q)){
				$albums[] = array('curraction' => "albumview",
						   'aid' => $album['id'],
						   'name' => $album['name']);
			}
			$tpl->clearTemplate($name);
			$tpl->addVar($box, "letter", $letter);
			$tpl->addRows($name, $albums);
			$tpl->parseTemplate($box, "a");
		}
	}
}

$tpl->addRows("letter", $abclist);
Return current item: AmaroK Web Frontend