rejetto forum

Software => HFS ~ HTTP File Server => HTML & templates => Topic started by: slasherx on August 13, 2009, 12:33:38 PM

Title: Preview Box Enable & Disable
Post by: slasherx on August 13, 2009, 12:33:38 PM
I need help disabling preview button. I have two preview buttons one for divx player and one for  VLC player.

I want to only allow preview button to work if it matches the following extentions.
avi,jpg,jpeg,png,gif,bmp,tif,tiff,mp3,flv,mp4,m4a,mov,3gp,aac,avi,divx,wmv,wma,swf

any other extention disable preview button. I tried to follow the rawr template but couldn't get it working.

Here is the [file] code.

Code: [Select]
[file]
<tr>
<td class="iconCol">
<a href="%item-url%">
<div style="background:url('/~img_file') center center no-repeat">

</div>
</a>
</td>
<td class="fileCol{.if not|{.get|can access.}|protected.}">
<div class="fileInfo">
<a href="%item-url%" {.$target.}>%item-name%{.if|{.get|is new.}|&nbsp;-&nbsp;<b class="new">%new%</b>.}</a><br/>
%comment%
<div class="info"><b>{.!Size.}:</b> %item-size%</div>
<div class="info"><b>{.!Hits.}:</b> %item-dl-count%</div>
<div class="age"><b>{.!Age.}:</b> %item-modified%</div>
</div>
</td>
<td class="quickCol">
<div id="s%sequential%" class="quickBtn2"><a href="javascript:void(0);" onclick="initBox('Box-'+(%sequential%+1),this.name)" name="%item-full-url%"><img src="/irresistible/images/divx.png" alt="P" title="{.!Stream with Divx Player.}" align="middle"/></a></div><span id="Box-%sequential%"></span>
<div class="quickBtn {.if not|{.get|can access.}|disabled.}"><a href="#" title="{.!Stream with VLC Player.}" onClick="vlc_controls.play ('%item-full-url%')"><img src="/irresistible/images/vlc.png" alt="Stream"/></a></div>
<div class="quickBtn1 {.if not|{.get|can access.}|disabled.}"><a href="%item-url%" title="{.!Download.}"><img src="/irresistible/images/medDown.png" alt="Download"/>
</td>
</tr>

also attaching full template.

thanks
Title: Re: Preview Box Enable & Disable
Post by: rejetto on August 13, 2009, 01:52:34 PM
{.if|{.match|avi;jpg;jpeg;png;gif;bmp;tif;tiff;mp3;flv;mp4;m4a;mov;3gp;aac;avi;divx;wmv;wma;swf|%item-ext%.}
your preview buttons here
/if.}
Title: Re: Preview Box Enable & Disable
Post by: slasherx on August 14, 2009, 02:47:02 AM
{.if|{.match|avi;jpg;jpeg;png;gif;bmp;tif;tiff;mp3;flv;mp4;m4a;mov;3gp;aac;avi;divx;wmv;wma;swf|%item-ext%.}
your preview buttons here
/if.}

I'm getting error.

macro error: if not supported or illegal parameters

Title: Re: Preview Box Enable & Disable
Post by: bacter on August 14, 2009, 09:46:32 AM
slasherx:

check if the sintaxis of your macro is ok:
Quote
{.if|{.match|avi;jpg;jpeg;png;gif;bmp;tif;tiff;mp3;flv;mp4;m4a;mov;3gp;aac;avi;divx;wmv;wma;swf|%item-ext%.} |
{:your code for preview buttons here :}
/if.}

Don't forget the '|' after the condition of the if statement !
Title: Re: Preview Box Enable & Disable
Post by: rejetto on August 14, 2009, 12:52:24 PM
yes, i forgot the "|"
Title: Re: Preview Box Enable & Disable
Post by: slasherx on August 15, 2009, 06:53:34 AM
thanks working awsome.