Changeset 28210


Ignore:
Timestamp:
04/17/14 10:48:48 (6 years ago)
Author:
sarybe
Message:

[thumbnailTooltip] Update core files

Location:
extensions/ThumbnailTooltip
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/ThumbnailTooltip/admin/admin.tpl

    r28174 r28210  
    112112</fieldset> 
    113113 
    114 <p><input type="submit" name="submit" value="{'Submit'|@translate}" {$TAG_INPUT_ENABLED}> 
    115 <input type="submit" name="restore" value="{'tn_default_parameters'|@translate}" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');" {$TAG_INPUT_ENABLED}></p> 
     114<p><input type="submit" name="submit" value="{'Submit'|@translate}"> 
     115<input type="submit" name="restore" value="{'tn_default_parameters'|@translate}" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');"></p> 
    116116</form> 
    117117 
  • extensions/ThumbnailTooltip/admin/config_default.inc.php

    r28174 r28210  
    22$config_default = array( 
    33  'display_name'        => true, 
    4   'value1'                      => 'tn_type1', 
    5   'value2'                      => 'tn_type8', 
    6   'value3'                      => 'tn_type4', 
    7   'value4'                      => 'none', 
    8   'value5'                      => 'none', 
    9   'value6'                      => 'none', 
    10   'separator'                   => '1', 
    11   'display_author_cat'  => '1', 
     4  'value1'              => 'tn_type1', 
     5  'value2'              => 'tn_type8', 
     6  'value3'              => 'tn_type4', 
     7  'value4'              => 'none', 
     8  'value5'              => 'none', 
     9  'value6'              => 'none', 
     10  'separator'           => '1', 
     11  'display_author_cat'  => '1' 
    1212); 
    1313?> 
  • extensions/ThumbnailTooltip/admin/index.php

    r27644 r28210  
    11<?php 
    22// +-----------------------------------------------------------------------+ 
    3 // | PhpWebGallery - a PHP based picture gallery                           | 
    4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 
    5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 
     3// | Piwigo - a PHP based photo gallery                                    | 
    64// +-----------------------------------------------------------------------+ 
    7 // | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $ 
    8 // | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $ 
    9 // | last modifier : $Author: rub $ 
    10 // | revision      : $Revision: 1912 $ 
     5// | Copyright(C) 2008-2014 Piwigo Team                  http://piwigo.org | 
     6// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net | 
     7// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick | 
    118// +-----------------------------------------------------------------------+ 
    129// | This program is free software; you can redistribute it and/or modify  | 
  • extensions/ThumbnailTooltip/include/class.inc.php

    r28174 r28210  
    2020    global $user; 
    2121       
    22           $query = ' 
    23                 SELECT param, value, comment 
    24                 FROM ' . CONFIG_TABLE . ' 
    25                 WHERE param="thumbnail_tooltip" 
    26                 ;'; 
    27           $row = pwg_db_fetch_assoc( pwg_query($query) ); 
     22        $query = 'SELECT param, value, comment FROM ' . CONFIG_TABLE . ' WHERE param="thumbnail_tooltip"'; 
     23        $row = pwg_db_fetch_assoc( pwg_query($query) ); 
    2824   
    29       $params = unserialize($row['value']); 
    30  
    31       $values = array( 
     25        $params = unserialize($row['value']); 
     26        $values = array( 
    3227                  'DISPLAY_NAME'         => $params['display_name'], 
    3328                  'value1'               => $params['value1'], 
     
    3833                  'value6'               => $params['value6'], 
    3934                  'separator'            => $params['separator'] 
    40       ); 
     35        ); 
     36         
     37        if ($params['display_name']==true) { 
     38      foreach($tpl_var as $cle=>$valeur) { 
     39        $query = " 
     40                  SELECT name AS value1, hit AS value2, hit AS value3, comment AS value4, author AS value5, CONCAT('".l10n('Author').' : '."', author,'') AS value6, rating_score AS value7 
     41                  FROM ".IMAGES_TABLE." 
     42                  WHERE id = ".(int)$tpl_var[$cle]['id']." 
     43                ;"; 
     44            $row = pwg_db_fetch_assoc( pwg_query($query) ); 
     45 
     46        $details = array(); 
     47        $details_param = array(); 
    4148           
    42     foreach($tpl_var as $cle=>$valeur) { 
    43       $query = " 
    44                 SELECT name AS value1, hit AS value2, hit AS value3, comment AS value4, author AS value5, CONCAT('".l10n('Author').' : '."', author,'') AS value6, rating_score AS value7 
    45                 FROM ".IMAGES_TABLE." 
    46                 WHERE id = ".(int)$tpl_var[$cle]['id']." 
    47                 ;"; 
    48           $row = pwg_db_fetch_assoc( pwg_query($query) ); 
     49        $details['tn_type1'] = $row['value1']; 
    4950 
    50       $details = array(); 
    51       $details_param = array(); 
     51        if (!empty($row['value2'])) { 
     52                  $details['tn_type2'] = $row['value2'].' '.strtolower(l10n('Visits')); 
     53        } 
     54        if (!empty($row['value3'])) { 
     55                  $details['tn_type3'] = '('.$row['value3'].' '.strtolower(l10n('Visits')).')'; 
     56            if (!empty($row['value7'])) { $type8 = ', '.strtolower(l10n('Rating score')).' '.$row['value7']; } else { $type8 = ''; } 
     57                  $details['tn_type8'] = '('.$row['value3'].' '.strtolower(l10n('Visits')).$type8.')'; 
     58        } 
     59        if (!empty($row['value4'])) { 
     60                  $details['tn_type4'] = $row['value4']; 
     61        } 
     62        if (!empty($row['value5'])) { 
     63                  $details['tn_type5'] = $row['value5']; 
     64        } 
     65        if (!empty($row['value6'])) { 
     66                  $details['tn_type6'] = $row['value6']; 
     67        } 
     68        if (!empty($row['value7'])) { 
     69                  $details['tn_type7'] = strtolower(l10n('Rating score')).' '.$row['value7']; 
     70        } 
     71                   
     72        if ((!empty($details[$values['value1']])) && ($details[$values['value1']]!='none')) { $details_param[] = $details[$values['value1']]; } 
     73        if ((!empty($details[$values['value2']])) && ($details[$values['value2']]!='none')) { $details_param[] = $details[$values['value2']]; } 
     74        if ((!empty($details[$values['value3']])) && ($details[$values['value3']]!='none')) { $details_param[] = $details[$values['value3']]; } 
     75        if ((!empty($details[$values['value4']])) && ($details[$values['value4']]!='none')) { $details_param[] = $details[$values['value4']]; } 
     76        if ((!empty($details[$values['value5']])) && ($details[$values['value5']]!='none')) { $details_param[] = $details[$values['value5']]; } 
     77        if ((!empty($details[$values['value6']])) && ($details[$values['value6']]!='none')) { $details_param[] = $details[$values['value6']]; } 
    5278           
    53       $details['tn_type1'] = $row['value1']; 
    54  
    55       if (!empty($row['value2'])) 
    56       { 
    57                 $details['tn_type2'] = $row['value2'].' '.strtolower(l10n('Visits')); 
     79        if ($params['separator']=='1') { $title = implode(' - ', $details_param); } else { $title = implode(' ', $details_param); } 
     80           
     81        $tpl_var[$cle]['TN_TITLE'] = $title; 
    5882      } 
    59           if (!empty($row['value3'])) 
    60       { 
    61                 $details['tn_type3'] = '('.$row['value3'].' '.strtolower(l10n('Visits')).')'; 
    62             if (!empty($row['value7'])) { $type8 = ', '.strtolower(l10n('Rating score')).' '.$row['value7']; } else { $type8 = ''; } 
    63                 $details['tn_type8'] = '('.$row['value3'].' '.strtolower(l10n('Visits')).$type8.')'; 
    64           } 
    65       if (!empty($row['value4'])) 
    66       { 
    67                 $details['tn_type4'] = $row['value4']; 
    68       } 
    69       if (!empty($row['value5'])) 
    70       { 
    71                 $details['tn_type5'] = $row['value5']; 
    72       } 
    73       if (!empty($row['value6'])) 
    74       { 
    75                 $details['tn_type6'] = $row['value6']; 
    76       } 
    77       if (!empty($row['value7'])) 
    78       { 
    79                 $details['tn_type7'] = strtolower(l10n('Rating score')).' '.$row['value7']; 
    80       } 
    81                    
    82           if ((!empty($details[$values['value1']])) && ($details[$values['value1']]!='none')) { $details_param[] = $details[$values['value1']]; } 
    83           if ((!empty($details[$values['value2']])) && ($details[$values['value2']]!='none')) { $details_param[] = $details[$values['value2']]; } 
    84           if ((!empty($details[$values['value3']])) && ($details[$values['value3']]!='none')) { $details_param[] = $details[$values['value3']]; } 
    85           if ((!empty($details[$values['value4']])) && ($details[$values['value4']]!='none')) { $details_param[] = $details[$values['value4']]; } 
    86           if ((!empty($details[$values['value5']])) && ($details[$values['value5']]!='none')) { $details_param[] = $details[$values['value5']]; } 
    87           if ((!empty($details[$values['value6']])) && ($details[$values['value6']]!='none')) { $details_param[] = $details[$values['value6']]; } 
    88            
    89           if ($params['separator']=='1') { $title = implode(' - ', $details_param); } else { $title = implode(' ', $details_param); } 
    90            
    91           if ($params['display_name']==true) { $tpl_var[$cle]['TN_TITLE'] = $title; } else { $tpl_var[$cle]['TN_TITLE']=''; } 
    9283    } 
    9384    return $tpl_var; 
     
    9687   
    9788  function Author_Description_affich($tpl_var) { 
    98     global $user; 
     89    global $user, $lang; 
    9990 
    10091        $query = 'SELECT param, value, comment FROM ' . CONFIG_TABLE . ' WHERE param="thumbnail_tooltip";'; 
     
    109100            $result = pwg_query($query); 
    110101            $row = pwg_db_fetch_assoc($result); 
    111             $auteur = ''; 
     102 
    112103            if (!empty($row['author'])) { 
    113               if (preg_match('#(,|\/)#i', $row['author'])) { $s = 's'; } else { $s = ''; } 
    114               if (!empty($tpl_var[$cle]['DESCRIPTION'])) { $tpl_var[$cle]['DESCRIPTION'] = $tpl_var[$cle]['DESCRIPTION'].'<br/>Auteur'.$s.' : '.$row['author']; } else { $tpl_var[$cle]['DESCRIPTION'] = 'Auteur'.$s.' : '.$row['author']; } 
     104              if (preg_match('#(,|\/)#i', $row['author'])) { $auteur = str_replace(array('(',')'), '', ucfirst(sprintf($lang['author(s) : %s'],$row['author']))); } else { $auteur = $lang['Author'].' : '.$row['author']; } 
     105              if (!empty($tpl_var[$cle]['DESCRIPTION'])) { $tpl_var[$cle]['DESCRIPTION'] = $tpl_var[$cle]['DESCRIPTION'].'<br/>'.$auteur; } else { $tpl_var[$cle]['DESCRIPTION'] = $auteur; } 
    115106            } 
    116107      } 
  • extensions/ThumbnailTooltip/initialize.inc.php

    r27648 r28210  
    11<?php 
    2 /* 
    3 Plugin Name: Thumbnail Tooltip 
    4 Version: 1.2 
    5 Description: Permet de changer l'infobulle sur les images dans les albums. 
    6 Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=736 
    7 Author: Sarybe 
    8 Author URI: http://www.lesrempartsdetours.com 
    9 */ 
    10  
    112 
    123if (!defined('PHPWG_ROOT_PATH')) { 
Note: See TracChangeset for help on using the changeset viewer.