Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - StormB

Pages: [1]
1
Templates & Styles (Requests & Discussions) / Displaying PDFs
« on: April 22, 2005, 09:29:13 PM »
I hardly think this counts as a Mod when stacked against some of the fantastic stuff in here (and it's probably been discussed elewhere) but I couldn't find a better place to post this.

With the standard layout the only option for a PDF file is to download. So I wanted to give an option to view online.

From the templates/default/media I edited pdf.html to read:

Code: [Select]
<HTML>
  <HEAD>
    <TITLE>PDF File</TITLE>
  </HEAD>
  <BODY>
    <BR>
      <CENTER>
         <A HREF="{media_src}" TARGET="_blank"><IMG SRC="http://SITENAME.com/gallery/templates/default/icons/pdf.gif" BORDER="1">
         <BR>View In a New Window</A>
      </CENTER>
      <BR>
   </BODY>
</HTML>

Obviously the path to the icon is hard coded as I haven't figured how to make {media_icon} display properly.

Also I haven't figured how to be able to display a thumbnail other than the default.

'View In a New Window' is only there because so many people block new windows opening.

It's real rough but it works in IE, Firefox and Opera. I think it also allows a PDF to be added to a lightbox or sent as an e-card too.

Feel free to polish or pull it to pieces ;)

Pages: [1]