Jukebox/w3tpl
The Hypertwin Jukebox Demo
Right now, all you can do here is see our music collection; downloads only work within our house network. <hide>
=========
functions
=========
<func GetArtists>
<for db=audioferret table="qryArtists_index" sort="name" name=ar> <let name=ar_name val="@row.ar.name" /> <let name=outFunc append>
- </let>
<if comp=@row.ar.id with=$doArtist> <let name=chosen_artist_name copy=ar_name /> <let name=outFunc append></let> <let name=outFunc append copy=ar_name /> <let name=outFunc append></let> </if><else> <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>idartist=</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 vars>[$doArtist$&album=[$@row.al.id$] </let> <let name=outFunc append copy=al_name /> <let name=outFunc append>]</let> </for>
</func>
<func GetTitles>
<if flag=doAlbum> <let name=sqlFilt vars>album_id=</let> <let name=sqlFilt append copy=doAlbum /> </if><else> <let name=sqlFilt vars>artist_id=</let> <let name=sqlFilt append copy=doArtist /> </else> <let name=outFunc><for db=audioferret table="qryTitle_Files" where=$sqlFilt sort="track, name" name=ti> <let name=outFunc append>
</let>
<let name=outFunc append copy=@row.ti.track /> <let name=outFunc append>. </let> <let name=outFunc append copy=@row.ti.name /> <let name=outFunc append> || [</let> <let name=outFunc append copy=urlAudio /> <let name=outFunc append copy=@row.ti.filespec /> <let name=outFunc append> download]</let> </for> <let name=outFunc append> |
</let>
</func>
================
build the output
================
Set up the environment: -- Turn off page cache: <w3tpl nocache /> -- base URL for audio files: <let name=urlAudio>smb://rizzo/shared/sdd/audio/Jukebox/content/</let>
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 vars> || albums: [$chosen_artist_name$]</let> </if> <if flag=doTitles> <let name=out append> || titles (only works from our house network)</let> </if> <let name=out append> | ||
</let> <let name=out append copy=outFunc /> <let name=outFunc null /> <if flag=doArtist> <call GetAlbums /> <let name=out append> |
</let>
<let name=out append copy=outFunc /> <let name=outFunc null /> </if> <if flag=doTitles> <call GetTitles /> <let name=out append> |
</let>
<let name=out append copy=outFunc /> <let name=outFunc null /> </if> <let name=out append> |
</let>
===============
show the output
===============
</hide><get name=out />