Jump to content

AttachedFile Conditional


Recommended Posts

I have a conditional in the AttachedFile template, that is supposed to ignore files that are mp3 and pdf.  The reason why I want this functionality is because I built a module that reads mp3s and pdfs in a better way (for my forum).  When I edit a topic, the below code works fine.  However when someone creates a new post, the below fails.  I am not sure if this is a bug with IPB, or if there is another template that I am supposed to make an edit to.  But when I searched for the keyword "ipsAttachLink" in the templates, the only files that came up were "attachedFile" and "attachedImage".

See below, for the conditional I added to get this functionality to partially work.

{{if pathinfo($title, PATHINFO_EXTENSION) == 'mp3' OR pathinfo($title, PATHINFO_EXTENSION) == 'pdf'}}
	{$addLink = false}
	{{if $pTag}}<p>{{endif}}<a class="ipsAttachLink" href="{$url}">{$title}</a>{{if $pTag}}</p>{{endif}}


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...