rejetto forum

Preview Box Enable & Disable

0 Members and 1 Guest are viewing this topic.

Offline slasherx

  • Occasional poster
  • *
    • Posts: 98
    • View Profile
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


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13275
    • View Profile
{.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.}


Offline slasherx

  • Occasional poster
  • *
    • Posts: 98
    • View Profile
{.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



Offline bacter

  • Operator
  • Tireless poster
  • *****
    • Posts: 681
    • View Profile
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 !
your computer has no brain - use your own !


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13275
    • View Profile