Jukebox/w3tpl: Difference between revisions
From HypertWiki
< Jukebox
artist query URL construction working; saving work... |
testing album display |
||
| Line 1: | Line 1: | ||
=The Hypertwin Jukebox= | =The Hypertwin Jukebox= | ||
''is under construction, but here are all the artists'' | ''is under construction, but here are all the artists'' | ||
<hide><for db=audioferret table="Artists" sort="sort, name" name=ar | <hide> | ||
===================== | |||
===== functions ===== | |||
===================== | |||
<func GetArtists> | |||
<for db=audioferret table="Artists" sort="sort, name" name=ar> | |||
<let name=ar_name val="@row.ar.name" /> | |||
<let name=outFunc append> | |||
* </let> | * </let> | ||
<let name=outFunc append vars>[{{fullurl:{{PAGENAME}}|artist=[$@row.ar.id$]}} </let> | |||
<let name=out append copy= | <let name=outFunc append copy=ar_name /> | ||
<let name=out append> | <let name=outFunc append>]</let> | ||
</ | </for> | ||
</func> | |||
<func GetAlbums> | |||
<let name=sqlFilt vars>ID_Artist=</let> | |||
<let name=sqlFilt append copy=doArtist /> | |||
<for db=audioferret table="Albums" where=$sqlFilt sort="sort, name" name=al> | |||
<let name=al_name val="@row.al.name" /> | |||
<let name=outFunc append> | |||
* </let> | |||
<let name=outFunc append copy=al_name /> | |||
</for> | |||
</func> | |||
============================ | |||
===== build the output ===== | |||
============================ | |||
Get the input arguments: | |||
<let name=doArtist copy=@query.artist /> | |||
<let name=doAlbum copy=@query.album /> | |||
Always show the artists: | |||
<call GetArtists /> | |||
<let name=out> | |||
{| | |||
|- | |||
! Artists</let> | |||
<if flag=doArtist> | |||
<let name=doTitles val=1 /> | |||
</if> | |||
<if flag=doArtist> | |||
<let name=out append> || Albums</let> | |||
</if> | |||
<if flag=doTitles> | |||
<let name=out append> || Titles</let> | |||
</if> | |||
<let name=out append> | |||
|- | |||
| | |||
</let> | |||
<let name=out append copy=outFunc /> | |||
<if flag=doArtist> | |||
<call GetAlbums /> | |||
<let name=out append> || </let> | |||
<let name=out append copy=outFunc /> | |||
</if> | |||
<let name=out append> | |||
|}</let> | |||
=========================== | |||
===== show the output ===== | |||
=========================== | |||
</hide><get name=out /> | </hide><get name=out /> | ||
Revision as of 22:13, 8 March 2009
The Hypertwin Jukebox
is under construction, but here are all the artists <hide>
=========
functions
=========
<func GetArtists>
<for db=audioferret table="Artists" sort="sort, name" name=ar> <let name=ar_name val="@row.ar.name" /> <let name=outFunc append>
- </let>
<let name=outFunc append vars>[$@row.ar.id$ </let> <let name=outFunc append copy=ar_name /> <let name=outFunc append>]</let> </for>
</func>
<func GetAlbums>
<let name=sqlFilt vars>ID_Artist=</let> <let name=sqlFilt append copy=doArtist /> <for db=audioferret table="Albums" where=$sqlFilt sort="sort, name" name=al> <let name=al_name val="@row.al.name" /> <let name=outFunc append>
- </let>
<let name=outFunc append copy=al_name /> </for>
</func>
================
build the output
================
Get the input arguments: <let name=doArtist copy=@query.artist /> <let name=doAlbum copy=@query.album /> Always show the artists: <call GetArtists />
<let name=out>
| Artists</let>
<if flag=doArtist> <let name=doTitles val=1 /> </if> <if flag=doArtist> <let name=out append> || Albums</let> </if> <if flag=doTitles> <let name=out append> || Titles</let> </if> <let name=out append> |
|---|
|
</let> <let name=out append copy=outFunc /> <if flag=doArtist> <call GetAlbums /> <let name=out append> || </let> <let name=out append copy=outFunc /> </if> <let name=out append> |
</let>
===============
show the output
===============
</hide><get name=out />
