Changeset 19310 for extensions/pdf2tab


Ignore:
Timestamp:
12/06/12 23:08:40 (7 years ago)
Author:
julien1311
Message:

version auto

Location:
extensions/pdf2tab
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/pdf2tab/main.inc.php

    r19297 r19310  
    22/* 
    33Plugin Name: pdf2tab 
    4 Version: 2.4.C 
     4Version: auto 
    55Description: open pdf files in new tab instead of downloading it 
    66Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=655 
  • extensions/pdf2tab/picture.php

    r19295 r19310  
    33 
    44function pdf2tab_add_tag_picture($content, $element_info) { 
    5         preg_match('/<\s*img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i',$content,$match); 
    6          
    7         $content = str_replace($match[0],'<a href="'.$element_info['element_url'].'" target="_blank">'.$match[0].'</a>',$content); 
     5        if (strrchr($element_info['file'], ".") == ".pdf") { 
     6                preg_match('/<\s*img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i',$content,$match); 
     7                 
     8                $content = str_replace($match[0],'<a href="'.$element_info['element_url'].'" target="_blank">'.$match[0].'</a>',$content); 
     9        } 
    810         
    911        return $content; 
Note: See TracChangeset for help on using the changeset viewer.