Author Topic: Preview Box Enable & Disable  (Read 2034 times)

0 Members and 1 Guest are viewing this topic.

Offline slasherx

  • Occasional poster
  • *
  • Posts: 98
    • View Profile
Preview Box Enable & Disable
« 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

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12953
    • View Profile
Re: Preview Box Enable & Disable
« Reply #1 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.}

Offline slasherx

  • Occasional poster
  • *
  • Posts: 98
    • View Profile
Re: Preview Box Enable & Disable
« Reply #2 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


Offline bacter

  • Operator
  • Tireless poster
  • *****
  • Posts: 682
    • View Profile
Re: Preview Box Enable & Disable
« Reply #3 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 !
your computer has no brain - use your own !

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12953
    • View Profile
Re: Preview Box Enable & Disable
« Reply #4 on: August 14, 2009, 12:52:24 PM »
yes, i forgot the "|"

Offline slasherx

  • Occasional poster
  • *
  • Posts: 98
    • View Profile
Re: Preview Box Enable & Disable
« Reply #5 on: August 15, 2009, 06:53:34 AM »
thanks working awsome.