rejetto forum
Software => HFS ~ HTTP File Server => HTML & templates => Topic started by: raybob on April 02, 2011, 03:43:14 PM
-
Just add this to your template.
[file=folder=link|private]
<tr class='{.if|{.mod|{.count|row.}|2.}|even.}'><td>
<input type='checkbox' class='selector' name='selection' value='%item-url%' {.if not|{.or|{.get|can delete.}|{.get|can access.}|{.get|can archive item.}.}|disabled='disabled'.} />
{.if|{.get|is new.}|<span class='flag'> NEW </span>.}
{.if not|{.get|can access.}|<img src='/~img_lock'>.}
<a href="%item-url%"><img src="%item-icon%"> %item-name%</a>
[color=blue]{.if|
{.or|
{.count substring|.mp3|{.lower|%item-name%.}.}|
{.count substring|.wav|{.lower|%item-name%.}.}|
{.count substring|.mid|{.lower|%item-name%.}.}|
{.count substring|.m4a|{.lower|%item-name%.}.}|
{.count substring|.wma|{.lower|%item-name%.}.}|
.}|
<div style="float:right" >
<button style="background-color:white; border:1px solid; height:24px; font-size:12px; padding-bottom:2px; width:72px;" onclick="this.parentNode.innerHTML = '<object height=\'24\' > <embed src=\'%item-url%\' autostart=\'true\' loop=\'false\' height=\'24\' > </object>'">
<img style="height:12px;" src="/~img51" /> Stream</button>
</div>
.}[/color]
{.123 if 2|<div class='comment'>|{.commentNL|%item-comment%.}|</div>.}
{.if| {.?search.} |{:{.123 if 2|<br /><div class='item-folder'>{.!item folder.} |{.breadcrumbs|{:<a href="%bread-url%">%bread-name%/</a>:}|from={.count substring|/|%folder%.}/breadcrumbs.}|</div>.}:} .}
</td>
-
Hi raybob95! ;)
You can further simplify the code. :)
[file=folder=link|private]
<tr class='{.if|{.mod|{.count|row.}|2.}|even.}'><td>
<input type='checkbox' class='selector' name='selection' value='%item-url%' {.if not|{.or|{.get|can delete.}|{.get|can access.}|{.get|can archive item.}.}|disabled='disabled'.} />
{.if|{.get|is new.}|<span class='flag'> NEW </span>.}
{.if not|{.get|can access.}|<img src='/~img_lock'>.}
<a href="%item-url%"><img src="%item-icon%"> %item-name%</a>
{.if| {.?search.} |{:{.123 if 2|<div class='item-folder'>{.!item folder.} |{.breadcrumbs|{:<a href="%bread-url%">%bread-name%/</a>:}|from={.count substring|/|%folder%.}/breadcrumbs.}|</div>.}:} .}
[color=blue]{.switch|%item-ext%|,|mp3,wav,mid,m4z,wma|
<div>
<button style="background-color:white; height:20px; font-size:10px; padding-bottom:2px; width:45px" onclick="this.parentNode.innerHTML = '<object height=\'24\' > <embed src=\'%item-url%\' autostart=\'true\' loop=\'false\' height=\'24\' ></object>'">Play</button>
</div>
.}[/color]
{.123 if 2|<div class='comment'>|{.commentNL|%item-comment%.}|</div>.}[/color]
-
... {.count substring|... is a bad solution in this context.
e.g:
{.count substring|.mp3|my_playlist.mp3.m3u.} return true here, while it's not an mp3 file.
-
thanks for sharing :)
-
can anybody send me full script for mp3 streeming?
-
What I posted above is all you need.
Alternatively, you can use this from Yahoo:
<script type="text/javascript" src="http://webplayer.yahooapis.com/player.js"></script>