Commit 34fa0fcc authored by tobyink's avatar tobyink

Yay! My first Smarty loop!

The aim is to allow pages to include extra <link/> elements into the document head (for feeds, etc)
parent 2c0fe17f
......@@ -59,6 +59,22 @@ if(isset($user->name)) {
}
$smarty->assign('isme', ($_SESSION['user']->name == $user->name));
$smarty->assign('profile', true);
$smarty->assign('extra_head_links', array(
array(
'rel'=>'alternate',
'type' => 'application/rss+xml' ,
'title' => 'RSS 1.0 Feed (Recent plays)',
'href' => $base_url.'/rdf.php?fmt=rss&page='.$_SERVER['REQUEST_URI'].'/feed.xml'
),
array(
'rel' => 'meta',
'type' => 'application/rdf+xml' ,
'title' => 'FOAF',
'href' => $base_url.'/rdf.php?fmt=xml&page='.$_SERVER['REQUEST_URI'].'/feed.xml'
)
));
$smarty->display('profile.tpl');
} else {
$smarty->assign('error', 'User not found');
......
......@@ -25,6 +25,9 @@
<link rel="icon" href="{$base_url}/favicon.ico" type="image/x-icon" />
<link rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/us/" />
<script type="text/javascript" src="{$base_url}/js/player.js"></script>
{section name=i loop=$extra_head_links}
<link rel="$extra_head_links[i].rel" href="$extra_head_links[i].href" type="$extra_head_links[i].type" title="$extra_head_links[i].title" />
{/section}
</head>
<body typeof="foaf:Document">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment