Ignore:
Timestamp:
May 6, 2020, 10:07:34 PM (5 years ago)
Author:
ddtddt
Message:

[Photo_add_by] change for compatibilty new mpp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Photo_add_by/initpicture.php

    r31465 r32181  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | Photo added by plugin for Piwigo                                      |
     3// | Photo added by plugin for Piwigo  by TEMMII                           |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2012-2016 ddtddt               http://temmii.com/piwigo/ |
     5// | Copyright(C) 2012-2020 ddtddt               http://temmii.com/piwigo/ |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
     
    2222//Ajout du prefiltre
    2323add_event_handler('loc_begin_picture', 'pabI', 55 );
    24 
    25 function pabI()
    26  {
     24function pabI(){
    2725        global $template;
    2826        $template->set_prefilter('picture', 'pabIT');
    29  }
     27}
    3028
    31 
    32 function pabIT($content, &$smarty)
    33  {
    34  
    35  global $conf;
    36  
    37   $search = '#<div id="'.$conf['Photo_add_by'].'" class="imageInfo">#';
    38 
    39   $replacement = '
     29function pabIT($content, &$smarty){
     30  global $conf, $pwg_loaded_plugins;
     31        $search = '#<div id="'.$conf['Photo_add_by'].'" class="imageInfo">#';
     32  if (isset($pwg_loaded_plugins['manage_properties_photos'])){
     33        $replacement = '<div id="'.$conf['Photo_add_by'].'" class="imageInfo">';
     34  }else{
     35        $replacement = '
    4036  {if $PAB}
    4137  <div id="pab1" class="imageInfo">
     
    4541{/if}
    4642<div id="'.$conf['Photo_add_by'].'" class="imageInfo">';
    47 
     43  }
    4844  return preg_replace($search, $replacement, $content);
    4945 }
Note: See TracChangeset for help on using the changeset viewer.