Ignore:
Timestamp:
Oct 31, 2020, 8:28:51 PM (3 years ago)
Author:
ddtddt
Message:

[title] php7.4 Notice

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/title/initadmin.php

    r32070 r32302  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | Title plugin for piwigo                                               |
     3// | Title plugin for piwigo by TEMMII                                     |
    44// +-----------------------------------------------------------------------+
    55// | Copyright(C) 2011 - 2020 ddtddt             http://temmii.com/piwigo/ |
     
    3838add_event_handler('loc_begin_admin_page', 'titlePadminA',60);
    3939
    40 function titlePadminf()
    41         {
    42         global $template;
    43         $template->set_prefilter('picture_modify', 'titlePadminfT');
    44         }
     40function titlePadminf(){
     41  global $template;
     42  $template->set_prefilter('picture_modify', 'titlePadminfT');
     43}
    4544
    46 function titlePadminfT($content, &$smarty)
    47         {
     45function titlePadminfT($content, &$smarty){
    4846  $search = '#<p style="margin:40px 0 0 0">#';
    49  
    5047  $replacement = '
    5148    <p>
     
    5855
    5956  return preg_replace($search, $replacement, $content);
    60         }
     57}
    6158 
    6259function titlePadminA(){
    6360  if (isset($_GET['image_id'])){
    64         global $template, $prefixeTable;
     61        global $template, $prefixeTable, $pwg_loaded_plugins;
    6562        $query = 'select id,title FROM ' . TITLE_PHOTO_TABLE . ' WHERE id = '.$_GET['image_id'].';';
    6663        $result = pwg_query($query);
    6764        $row = pwg_db_fetch_assoc($result);
    6865    $titleP=$row['title'];
    69     $PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';"));
    70         if($PAED['state'] == 'active'){
     66        if (isset($pwg_loaded_plugins['ExtendedDescription'])){
    7167          $template->assign('useED',1);
    7268    }else{
     
    119115function titleAadminA(){
    120116  if (isset($_GET['cat_id'])){
    121         global $template, $prefixeTable;
     117        global $template, $prefixeTable, $pwg_loaded_plugins;
    122118        $query = 'select id,title FROM ' . TITLE_ALBUM_TABLE . ' WHERE id = '.$_GET['cat_id'].';';
    123119        $result = pwg_query($query);
    124120        $row = pwg_db_fetch_assoc($result);
    125121        $titleA=$row['title'];
    126     $PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';"));
    127         if($PAED['state'] == 'active'){
     122        if (isset($pwg_loaded_plugins['ExtendedDescription'])){
    128123          $template->assign('useED',1);
    129124    }else{
Note: See TracChangeset for help on using the changeset viewer.