Location: PHPKode > scripts > AmaroK Web Frontend > obsidianmusic-2.3.0/pages/artist.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
//
//  artist.php - List all the artists in the collection
//
///////////////////////////////////////

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

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

// In turn, grab the artists on both sides of the page
foreach($abc2sides as $key=>$value){
	// Clear the side we're working on
	$tpl->clearTemplate($key."box");
	// Populate each letter box in turn
	foreach($value as $letter){
		$box = $key."box";
		$name = $key."name";
		$abclist[] = array('letter' => $letter);
		if($letter == "#"){
			$q = query(getquery("artist", $sort, "^A-Za-z"));
		}else{
			$q = query(getquery("artist", $sort, $letter));
		}
		$artists = array();
		while($artist = fetch_assoc($q)){
			$artists[] = array('curraction' => "artistview",
					   'aid' => $artist['id'],
					   'name' => $artist['name']);
		}
		// Recreating the addRows functionality
		$tpl->clearTemplate($name);
		$tpl->addVar($box, "letter", $letter);
		$tpl->addRows($name, $artists);
		$tpl->parseTemplate($box, "a");
	}
}

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