Location: PHPKode > scripts > Impleo Music Collection Script > impleo/record.php
<?php
/* ----------------------------------------------------------------------------
 * "THE BEER-WARE LICENSE" (Revision 42):
 * <hide@address.com> wrote this file. As long as you retain this notice you
 * can do whatever you want with this stuff. If we meet some day, and you think
 * this stuff is worth it, you can buy me a beer in return Christoffer Kjeldgaard Petersen
 * ----------------------------------------------------------------------------
 */

header("content-type:text/html;charset=utf-8");

require_once(dirname(__FILE__) . '/classes/Factory.class.php');
require_once(dirname(__FILE__) . '/classes/ImpleoTemplate.class.php');

$tpl = new ImpleoTemplate("record.tpl");
$factory = Factory::getInstance();

$arrGeneralSettings = $factory->getGeneralSettings();

$displayItem = false;
if (isset($_GET['id']) && is_numeric($_GET['id']))
{
	if ($musicItem = $factory->getMusicItem($_GET['id']))
		$displayItem = true;
}

$arrDisplayExtra = array();
if ($displayItem)
{
	$itemDetail = $musicItem->getDetailInfo();
	foreach ($factory->getDetailInfo() as $detail)
	{
		if ($itemDetail[$detail['key']])
			$arrDisplayExtra[] = array("name" => $detail['name'], "key" => $detail['key'], "value" => $itemDetail[$detail['key']]);
	}
}

$tpl->assign('collectionName', $arrGeneralSettings['name']);
$tpl->assign('detail', $arrDisplayExtra);
$tpl->assign('display', $displayItem);
$tpl->assign('item', $musicItem);

$tpl->displayTemplate();

?>
Return current item: Impleo Music Collection Script