Changeset 32112


Ignore:
Timestamp:
Apr 20, 2020, 9:48:16 PM (4 years ago)
Author:
ddtddt
Message:

[Meta_OG] add support page guestbook +size sq et la

Location:
extensions/meta_og
Files:
3 added
9 edited

Legend:

Unmodified
Added
Removed
  • extensions/meta_og/admin.php

    r32107 r32112  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | meta_og plugin for Piwigo by TEMMII                                            |
     3// | meta_og plugin for Piwigo by TEMMII                                   |
    44// +-----------------------------------------------------------------------+
    55// | Copyright(C) 2008-2020 ddtddt               http://temmii.com/piwigo/ |
     
    8585        $metaogpagelistT[]=l10n('contact');
    8686        $metaogpagelist[]='contact';
     87  }
     88$MPG = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'GuestBook';"));
     89  if ($MPG['state'] == 'active'){
     90        $metaogpagelistT[]=l10n('GuestBook');
     91        $metaogpagelist[]='GuestBook';
    8792  }
    8893$MAP = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'AdditionalPages';"));
     
    135140                  'PHOTOINFO' => $info_photos['id'].' - '.$legend,
    136141                  'PHOTOSELECT' => $select,
     142                  'PHOTOURL' => get_absolute_root_url().PWG_DERIVATIVE_DIR.substr($info_photos['path'], 2, -4)."-th".substr($info_photos['path'],-4),
    137143                );
    138144                        $template->append('info_photos', $items);
     
    141147        if (empty($metaog['metaogimage'])){unset($metaog['metaogimage']);}
    142148        if(isset($metaog['metaogimage'])){     
    143           if(isset($_SERVER['HTTPS'])){if($_SERVER['HTTPS'] == 'on'){$protocol="https://";}}
    144           else{$protocol="http://";}
    145            $metaogpath=PWG_DERIVATIVE_DIR.substr($metaog['path'], 2, -4)."-".$conf['mogsize'].substr($metaog['path'],-4);
    146           if (file_exists($metaogpath) AND $conf['mogsize']!='original'){
    147                 $metaogpath=get_absolute_root_url().PWG_DERIVATIVE_DIR.substr($metaog['path'], 2, -4)."-".$conf['mogsize'].substr($metaog['path'],-4);
    148           }else{
    149         $metaogpath=get_absolute_root_url().substr($metaog['path'],2);
    150           }
     149          $metaogpath=get_absolute_root_url().PWG_DERIVATIVE_DIR.substr($metaog['path'], 2, -4)."-th".substr($metaog['path'],-4);
    151150        }else{
    152151          $metaogpath="";
     
    166165
    167166  if (isset($_POST['submetaogsave'])){
    168         if($_POST['metaogimagesave']=="a" || $_POST['metaogimagesave']=="b"){$_POST['metaogimagesave']='';}
     167        if($_POST['metaogimagesave']=="-10" || $_POST['metaogimagesave']=="-20"){$_POST['metaogimagesave']='';}
    169168        if(!empty($_POST['metaogid'])){
    170169        $query = '
     
    181180    pwg_query($q);
    182181    }
    183        
    184182        array_push($page['infos'], l10n('Metadata Open Graph updated'));
    185        
    186        
    187        
    188183  }
    189184
     
    191186 break;
    192187 case 'config':
    193  
     188
    194189$metaogsizelistT = array(
    195190    '2s : '.l10n('size thumbnails modus'),
    196191    'cu : '.l10n('size thumbnails bootstrap'),
    197192    'th : '.l10n('size thumbnails default'),
     193        'sq : '.l10n('size thumbnails square'),
    198194        'me : '.l10n('Size medium'),
     195        'la : '.l10n('size thumbnails large'),
    199196        l10n('Original'),
    200197  );
     
    204201    'cu',
    205202    'th',
     203        'sq',
    206204        'me',
     205        'la',
    207206        'original',
    208207  );
  • extensions/meta_og/admin.tpl

    r32106 r32112  
     1{footer_script}
     2jQuery(function($) {
     3
     4if($('#metaogimagesaveid').children("option:selected").val()=="-20"){
     5 $('#mognp').show();
     6}
     7
     8$('#metaogimagesaveid').change(function(event){
     9 var idphoto=$(this).children("option:selected").val();
     10 $('#metaogimagesave2id').val(idphoto);
     11 if($('#metaogimagesaveid').children("option:selected").val()=="-10" || $('#metaogimagesaveid').children("option:selected").val()=="-20"){
     12   $('#mognp').show();
     13   $('#metaogimagescr').attr("src",'');
     14   $('#metaogimagescr').hide();
     15  }else{
     16  var urliog=$('#metaogimagesaveid').children("option:selected").data('url');
     17   $('#metaogimagescr').attr("src",urliog);
     18   $('#metaogimagescr').show();
     19   $('#mognp').hide();
     20  }
     21  $('#mognpe').hide();
     22  $('#metaogimagesaveid').css('border', 'solid 1px #999');
     23  $('#metaogimagesave2id').css('border', 'solid 1px #999');
     24  $('#submetaogsave').show();
     25});
     26
     27$('#metaogimagesave2id').change(function(){
     28 var idphoto2=$(this).val();
     29 $('#metaogimagesaveid').val(idphoto2);
     30 
     31 if($('#metaogimagesaveid').children("option:selected").val()==idphoto2){
     32  $('#metaogimagesaveid').css('border', 'solid 1px #999');
     33  $('#metaogimagesave2id').css('border', 'solid 1px #999');
     34  $('#mognpe').hide();
     35  $('#submetaogsave').show();
     36  if($('#metaogimagesaveid').children("option:selected").val()=="-10" || $('#metaogimagesaveid').children("option:selected").val()=="-20"){
     37   $('#mognp').show();
     38   $('#metaogimagescr').attr("src",'');
     39   $('#metaogimagescr').hide();
     40  }else{
     41  var urliog=$('#metaogimagesaveid').children("option:selected").data('url');
     42   $('#metaogimagescr').attr("src",urliog);
     43   $('#metaogimagescr').show();
     44   $('#mognp').hide();
     45  }
     46 }else{
     47  $('#metaogimagesaveid').css('border', 'solid 2px red');
     48  $('#metaogimagesave2id').css('border', 'solid 2px red');
     49  $('#mognpe').show();
     50  $('#mognp').hide();
     51  $('#metaogimagescr').attr("src",'');
     52  $('#metaogimagescr').hide();
     53  $('#submetaogsave').hide();
     54 }
     55});
     56
     57});
     58{/footer_script}
     59
    160<div class="titrePage">
    261  <h2>{'Manage tags metadata Open Graph'|@translate}</h2>
     
    3796                                        {'Metadata Open Graph link image'|@translate}
    3897                                <br>
    39                                   <select name="metaogimagesave">
    40                                         <option value="a">-----</option>
    41                                         <option value="b">{'no photo'|@translate}</option>
     98                                  <input id="metaogimagesave2id" type="number" name="metaogimagesave2" value="{$metaog_edit.metaogimage}"> {'or'|@translate}
     99                                  <select id="metaogimagesaveid" name="metaogimagesave">
     100                                        <option value="-20">-----</option>
     101                                        <option value="-10">{'no photo'|@translate}</option>
    42102                                          {foreach from=$info_photos item=infophoto}
    43                                                 <option value="{$infophoto.PHOTOID}" {$infophoto.PHOTOSELECT}>{$infophoto.PHOTOINFO}</option>
     103                                                <option data-url="{$infophoto.PHOTOURL}" value="{$infophoto.PHOTOID}" {$infophoto.PHOTOSELECT}>{$infophoto.PHOTOINFO}</option>
    44104                                          {/foreach}
    45105                                        </select>
    46106                                <br>   
    47107                                <br>
    48                                 {if empty($metaog_edit.metaogpath)}{'don\'t use photo for this page'|@translate}{/if}
    49                                         <img src="{$metaog_edit.metaogpath}"<br>
     108                                <span style="display:none;" id="mognp">{'don\'t use photo for this page'|@translate}</span>
     109                                <span style="display:none;" id="mognpe">{'This ID isn\'t used in your gallery'|@translate}</span>
     110                                        <img id="metaogimagescr" src="{$metaog_edit.metaogpath}"<br>
    50111                                <br>   
    51112                                <br>
    52113                                        <div style="text-align:center;">
    53                                         <input class="submit" name="submetaogsave" type="submit" value="{'save Open Graph metadata in the database'|@translate}" {$TAG_INPUT_ENABLED} />
     114                                        <input class="submit" id="submetaogsave" name="submetaogsave" type="submit" value="{'save Open Graph metadata in the database'|@translate}" {$TAG_INPUT_ENABLED} />
    54115                                        </div>
    55116                        </fieldset>
  • extensions/meta_og/initadmin.php

    r32106 r32112  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | Title plugin for piwigo                                               |
    4 // +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2011 - 2016 ddtddt             http://temmii.com/piwigo/ |
     3// | meta_og plugin for Piwigo by TEMMII                                   |
     4// +-----------------------------------------------------------------------+
     5// | Copyright(C) 2008-2020 ddtddt               http://temmii.com/piwigo/ |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
     
    3333
    3434//add prefiltre photo
    35 add_event_handler('loc_begin_admin', 'metaogPadminf',60);
     35add_event_handler('loc_begin_admin_page', 'metaogPadminf',95);
     36
     37function metaogPadminf(){
     38  global $template;
     39  $template->set_prefilter('picture_modify', 'metaogPadminfT');
     40  $template->set_filename('mog_adminphoto', realpath(metaog_PATH.'mog_adminphoto.tpl'));
     41  $template->assign_var_from_handle('MOG_ADMINPHOTO', 'mog_adminphoto');
     42}
     43
     44function metaogPadminfT($content, &$smarty){
     45  $search = '#<p style="margin:40px 0 0 0">#';
     46  return preg_replace($search,'{$MOG_ADMINPHOTO}', $content);
     47}
     48
    3649add_event_handler('loc_begin_admin_page', 'metaogPadminA',60);
    37 
    38 function metaogPadminf()
    39         {
    40         global $template;
    41         $template->set_prefilter('picture_modify', 'metaogPadminfT');
    42         }
    43 
    44 function metaogPadminfT($content, &$smarty)
    45         {
    46   $search = '#<p style="margin:40px 0 0 0">#';
    47  
    48   $replacement = '
    49     <p>
    50       <strong>{\'Metadata Open Graph - Plugin meta og\'|@translate}</strong>
    51       <br>
    52                 <br>
    53                 <span style="margin: 0 0 0 20px">{\'Metadata Open Graph title\'|@translate}</span>
    54                 <br>
    55                         <input type="hidden" name="metaogidP" value="{$metaog_editP.metaogidid}">
    56                         <input type="hidden" name="metaogidobjP" value="{$metaog_editP.metaogidobj}">
    57                         <span style="margin: 0 0 0 20px"><input type="text" name="metaogtitlesaveP" value="{$metaog_editP.metaogtitle}" size="100" maxlenght="100"></span>
    58                 <br>   
    59                 <br>
    60                         <span style="margin: 0 0 0 20px">{\'Metadata Open Graph description\'|@translate}</span>
    61                 <br>
    62                         <span style="margin: 0 0 0 20px"><textarea rows="2" cols="60" name="metaogdescriptionsaveP" id="metaogdescriptionsaveP" class="metaogdescriptionsaveP">{$metaog_editP.metaogdescription}</textarea></span>
    63                 <br>   
    64                 <br>
    65                         <span style="margin: 0 0 0 20px">{\'Metadata Open Graph link image\'|@translate}</span>
    66                 <br>
    67                   <span style="margin: 0 0 0 20px">
    68                   <select name="metaogimagesaveP">
    69                         <option value="a">-----</option>
    70                         <option value="b">{\'no photo\'|@translate}</option>
    71                           {foreach from=$info_photos item=infophoto}
    72                                 <option value="{$infophoto.PHOTOID}" {$infophoto.PHOTOSELECT}>{$infophoto.PHOTOINFO}</option>
    73                           {/foreach}
    74                  </select>
    75                  </span>
    76                 <br>
    77 {if empty($metaog_editP.metaogpath)}<span style="margin: 0 0 0 20px">{\'use photo for this page\'|@translate}</span>{/if}       
    78                 <br>
    79                         <img src="{$metaog_editP.metaogpath}"><br>
    80                 <br>   
    81     </p>
    82 <p style="margin:40px 0 0 0">';
    83 
    84   return preg_replace($search, $replacement, $content);
    85         }
    8650 
    8751function metaogPadminA(){
     
    10670                }
    10771          if(empty($info_photos['name'])){$legend=$info_photos['file'];}else{$legend=$info_photos['name'];}
     72                $metaoglistphotoT[] = $info_photos['id'].' - '.$legend;
     73                $metaoglistphoto[] = $info_photos['id'];
     74                $metaoglistphotodataurl[] = get_absolute_root_url().PWG_DERIVATIVE_DIR.substr($info_photos['path'], 2, -4)."-th".substr($info_photos['path'],-4);
    10875                $items = array(
    10976                  'PHOTOID' => $info_photos['id'],
    11077                  'PHOTOINFO' => $info_photos['id'].' - '.$legend,
    11178                  'PHOTOSELECT' => $select,
     79                  'PHOTOURL' => get_absolute_root_url().PWG_DERIVATIVE_DIR.substr($info_photos['path'], 2, -4)."-th".substr($info_photos['path'],-4),
    11280                );
    11381                $template->append('info_photos', $items);
     
    11684  if (empty($metaog['metaogimage'])){unset($metaog['metaogimage']);}
    11785  if(isset($metaog['metaogimage'])){   
    118         if(isset($_SERVER['HTTPS'])){if($_SERVER['HTTPS'] == 'on'){$protocol="https://";}}
    119         else{$protocol="http://";}
    120         $metaogpath=PWG_DERIVATIVE_DIR.substr($metaog['path'], 2, -4)."-".$conf['mogsize'].substr($metaog['path'],-4);
    121           if (file_exists($metaogpath) AND $conf['mogsize']!='original'){
    122                 $metaogpath=get_absolute_root_url().PWG_DERIVATIVE_DIR.substr($metaog['path'], 2, -4)."-".$conf['mogsize'].substr($metaog['path'],-4);
    123           }else{
    124         $metaogpath=get_absolute_root_url().substr($metaog['path'],2);
    125           }
     86          $metaogpath=get_absolute_root_url().PWG_DERIVATIVE_DIR.substr($metaog['path'], 2, -4)."-th".substr($metaog['path'],-4);
    12687        }else{
    12788          $metaogpath="";
     
    140101  }
    141102  if(isset($_POST['metaogtitlesaveP']) or isset($_POST['metaogdescriptionsaveP'])or isset($_POST['metaogimagesaveP'])){
    142         if($_POST['metaogimagesaveP']=="a" || $_POST['metaogimagesaveP']=="b" || $_POST['metaogimagesaveP']==$_POST['metaogidobjP']){$_POST['metaogimagesaveP']='';}
     103        if($_POST['metaogimagesaveP']=="-10" || $_POST['metaogimagesaveP']=="-20" || $_POST['metaogimagesaveP']==$_POST['metaogidobjP']){$_POST['metaogimagesaveP']='';}
    143104        if(!empty($_POST['metaogidP'])){
    144105        $query = '
     
    154115    pwg_query($q);
    155116    }
    156         $metaog = pwg_db_fetch_assoc(pwg_query("SELECT * FROM " . METAOG_TABLE . " WHERE type = 2 AND idobj = '".$_POST['metaogidobjP']."';"));
    157   while ($info_photos = pwg_db_fetch_assoc($tab_picture)) {
    158                 if($info_photos['id']==$metaog['metaogimage']){
    159                   $select="SELECTED";
    160                   $metaog['path']=$info_photos['path'];
    161                 }else{
    162                   $select="";
    163                 }
    164           if(empty($info_photos['name'])){$legend=$info_photos['file'];}else{$legend=$info_photos['name'];}
    165                 $items = array(
    166                   'PHOTOID' => $info_photos['id'],
    167                   'PHOTOINFO' => $info_photos['id'].' - '.$legend,
    168                   'PHOTOSELECT' => $select,
    169                 );
    170         $template->append('info_photos', $items);
    171   }
    172     if (empty($metaog['metaogimage'])){unset($metaog['metaogimage']);}
    173         if(isset($metaog['metaogimage'])){     
    174           $picturepth = pwg_db_fetch_assoc(pwg_query('SELECT path FROM ' . IMAGES_TABLE . " WHERE id = '".$_POST['metaogidobjP']."';"));
    175           $metaog['path']=$picturepth['path'];
    176           if(isset($_SERVER['HTTPS'])){if($_SERVER['HTTPS'] == 'on'){$protocol="https://";}}
    177           else{$protocol="http://";}
    178         $metaogpath=PWG_DERIVATIVE_DIR.substr($metaog['path'], 2, -4)."-".$conf['mogsize'].substr($metaog['path'],-4);
    179         if (file_exists($metaogpath) AND $conf['mogsize']!='original'){
    180                 $metaogpath=get_absolute_root_url().PWG_DERIVATIVE_DIR.substr($metaog['path'], 2, -4)."-".$conf['mogsize'].substr($metaog['path'],-4);
    181           }else{
    182         $metaogpath=get_absolute_root_url().substr($metaog['path'],2);
    183           }
    184         }else{
    185           $metaogpath="";
    186           $metaog['metaogimage']="";
    187         }
    188   $template->assign(
    189     'metaog_editP',
    190           array(
    191                 'metaogidid'  => $metaog['id'],
    192                 'metaogidobj'  => $pageog,
    193         'metaogtitle' => $metaog['metaogtitle'],
    194                 'metaogdescription' => $metaog['metaogdescription'],
    195                 'metaogimage' => $metaog['metaogimage'],
    196                 'metaogpath' => $metaogpath,
    197     ));
     117        header('Location:'.get_root_url().'admin.php?page=photo-'.$_POST['metaogidobjP'].'-properties');
    198118}
    199119}
    200120       
    201121//add prefiltre album
    202 add_event_handler('loc_begin_admin', 'metaogAadminf', 60);
    203 add_event_handler('loc_begin_admin_page', 'metaogAadminA', 60);
    204 
    205 function metaogAadminf()
    206  {
     122add_event_handler('loc_begin_admin_page', 'metaogAadminf', 95);
     123
     124function metaogAadminf(){
    207125        global $template;
    208126        $template->set_prefilter('album_properties', 'metaogAadminfT');
    209  }
    210 
    211 function metaogAadminfT($content, &$smarty)
    212  {
     127        $template->set_filename('mog_adminalbum', realpath(metaog_PATH.'mog_adminalbum.tpl'));
     128        $template->assign_var_from_handle('MOG_ADMINALBUM', 'mog_adminalbum');
     129}
     130
     131function metaogAadminfT($content, &$smarty){
    213132  $search = '#<p style="margin:0">#';
    214  
    215   $replacement = '
    216     <p>
    217       <strong>{\'Metadata Open Graph - Plugin meta og\'|@translate}</strong>
    218       <br>
    219                 <br>
    220                 <span style="margin: 0 0 0 20px">{\'Metadata Open Graph title\'|@translate}</span>
    221                 <br>
    222                         <input type="hidden" name="metaogidA" value="{$metaog_editA.metaogidid}">
    223                         <input type="hidden" name="metaogidobjA" value="{$metaog_editA.metaogidobj}">
    224                         <span style="margin: 0 0 0 20px"><input type="text" name="metaogtitlesaveA" value="{$metaog_editA.metaogtitle}" size="100" maxlenght="100"></span>
    225                 <br>   
    226                 <br>
    227                         <span style="margin: 0 0 0 20px">{\'Metadata Open Graph description\'|@translate}</span>
    228                 <br>
    229                         <span style="margin: 0 0 0 20px"><textarea rows="2" cols="60" name="metaogdescriptionsaveA" id="metaogdescriptionsaveA" class="metaogdescriptionsaveA">{$metaog_editA.metaogdescription}</textarea></span>
    230                 <br>   
    231                 <br>
    232                         <span style="margin: 0 0 0 20px">{\'Metadata Open Graph link image\'|@translate}</span>
    233                 <br>
    234                   <span style="margin: 0 0 0 20px">
    235                   <select name="metaogimagesaveA">
    236                         <option value="a">-----</option>
    237                         <option value="b">{\'no photo\'|@translate}</option>
    238                           {foreach from=$info_photos item=infophoto}
    239                                 <option value="{$infophoto.PHOTOID}" {$infophoto.PHOTOSELECT}>{$infophoto.PHOTOINFO}</option>
    240                           {/foreach}
    241                  </select>
    242                  </span>
    243                 <br>
    244 {if empty($metaog_editA.metaogpath)}<span style="margin: 0 0 0 20px">{\'use representative photo for this album\'|@translate}</span>{/if}       
    245                 <br>
    246                         <img src="{$metaog_editA.metaogpath}"><br>
    247                 <br>   
    248     </p>
    249 <p style="margin:0">';
    250 
    251   return preg_replace($search, $replacement, $content);
    252  }
    253 
     133   return preg_replace($search, '{$MOG_ADMINALBUM}', $content);
     134}
     135
     136add_event_handler('loc_begin_admin_page', 'metaogAadminA', 60);
     137 
    254138function metaogAadminA(){
    255139  if (isset($_GET['cat_id']) and !isset($_GET['image_id'])){
     
    278162                  'PHOTOINFO' => $info_photos['id'].' - '.$legend,
    279163                  'PHOTOSELECT' => $select,
     164                  'PHOTOURL' => get_absolute_root_url().PWG_DERIVATIVE_DIR.substr($info_photos['path'], 2, -4)."-th".substr($info_photos['path'],-4),
    280165                );
    281166                $template->append('info_photos', $items);
     
    284169  if (empty($metaog['metaogimage'])){unset($metaog['metaogimage']);}
    285170  if(isset($metaog['metaogimage'])){   
    286         if(isset($_SERVER['HTTPS'])){if($_SERVER['HTTPS'] == 'on'){$protocol="https://";}}
    287         else{$protocol="http://";}
    288         $metaogpath=PWG_DERIVATIVE_DIR.substr($metaog['path'], 2, -4)."-".$conf['mogsize'].substr($metaog['path'],-4);
    289           if (file_exists($metaogpath) AND $conf['mogsize']!='original'){
    290                 $metaogpath=get_absolute_root_url().PWG_DERIVATIVE_DIR.substr($metaog['path'], 2, -4)."-".$conf['mogsize'].substr($metaog['path'],-4);
    291           }else{
    292         $metaogpath=get_absolute_root_url().substr($metaog['path'],2);
    293           }
     171          $metaogpath=get_absolute_root_url().PWG_DERIVATIVE_DIR.substr($metaog['path'], 2, -4)."-th".substr($metaog['path'],-4);
    294172        }else{
    295173          $metaogpath="";
    296174          $metaog['metaogimage']="";
    297175        }
     176  $tab_album = pwg_db_fetch_assoc(pwg_query("SELECT id,representative_picture_id FROM " . CATEGORIES_TABLE . " WHERE id = '".$_GET['cat_id']."';"));
    298177  $template->assign(
    299178    'metaog_editA',
     
    305184                'metaogimage' => $metaog['metaogimage'],
    306185                'metaogpath' => $metaogpath,
     186                'metaogrealbum' => $tab_album['representative_picture_id'],
    307187    ));
    308188 
    309189  }
    310190  if(isset($_POST['metaogtitlesaveA']) or isset($_POST['metaogdescriptionsaveA'])or isset($_POST['metaogimagesaveA'])){
    311         if($_POST['metaogimagesaveA']=="a"){$_POST['metaogimagesaveA']='';}
     191        if($_POST['metaogimagesaveA']=="-10"|| $_POST['metaogimagesaveA']=="-20" || $_POST['metaogimagesaveA']==$tab_album['representative_picture_id']){$_POST['metaogimagesaveA']='';}
    312192        if(!empty($_POST['metaogidA'])){
    313193                if($_POST['metaogidobjA'] == $_POST['metaogimagesaveA']){$_POST['metaogimagesaveA']='';}
     
    324204    pwg_query($q);
    325205    }
    326         $metaog = pwg_db_fetch_assoc(pwg_query("SELECT * FROM " . METAOG_TABLE . " WHERE type = 3 AND idobj = '".$_POST['metaogidobjA']."';"));
    327         $metaog['path']='';
    328   while ($info_photos = pwg_db_fetch_assoc($tab_picture)) {
    329                 if($info_photos['id']==$metaog['metaogimage']){
    330                   $select="SELECTED";
    331                   $metaog['path']=$info_photos['path'];
    332                 }else{
    333                   $select="";
    334                 }
    335           if(empty($info_photos['name'])){$legend=$info_photos['file'];}else{$legend=$info_photos['name'];}
    336                 $items = array(
    337                   'PHOTOID' => $info_photos['id'],
    338                   'PHOTOINFO' => $info_photos['id'].' - '.$legend,
    339                   'PHOTOSELECT' => $select,
    340                 );
    341         $template->append('info_photos', $items);
    342   }
    343     if (empty($metaog['metaogimage'])){unset($metaog['metaogimage']);}
    344         if(isset($metaog['metaogimage'])){     
    345           $picturepth = pwg_db_fetch_assoc(pwg_query('SELECT path FROM ' . IMAGES_TABLE . " WHERE id = '".$_POST['metaogidobjA']."';"));
    346           $metaog['path']=$picturepth['path'];
    347           if(isset($_SERVER['HTTPS'])){if($_SERVER['HTTPS'] == 'on'){$protocol="https://";}}
    348           else{$protocol="http://";}
    349           $metaogpath=PWG_DERIVATIVE_DIR.substr($metaog['path'], 2, -4)."-".$conf['mogsize'].substr($metaog['path'],-4);
    350           if (file_exists($metaogpath) AND $conf['mogsize']!='original'){
    351                 $metaogpath=get_absolute_root_url().PWG_DERIVATIVE_DIR.substr($metaog['path'], 2, -4)."-".$conf['mogsize'].substr($metaog['path'],-4);
    352           }else{
    353         $metaogpath=get_absolute_root_url().substr($metaog['path'],2);
    354           }
    355         }else{
    356           $metaogpath="";
    357           $metaog['metaogimage']="";
    358         }
    359   $template->assign(
    360     'metaog_editA',
    361           array(
    362                 'metaogidid'  => $metaog['id'],
    363                 'metaogidobj'  => $pageog,
    364         'metaogtitle' => $metaog['metaogtitle'],
    365                 'metaogdescription' => $metaog['metaogdescription'],
    366                 'metaogimage' => $metaog['metaogimage'],
    367                 'metaogpath' => $metaogpath,
    368     ));
     206        header('Location:'.get_root_url().'admin.php?page=album-'.$_POST['metaogidobjP'].'-properties');
    369207}
    370208}
  • extensions/meta_og/language/en_UK/index.php

    r32069 r32112  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | Piwigo - a PHP based picture gallery                                  |
    4 // +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2008-2009 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 |
    8 // +-----------------------------------------------------------------------+
    9 // | This program is free software; you can redistribute it and/or modify  |
    10 // | it under the terms of the GNU General Public License as published by  |
    11 // | the Free Software Foundation                                          |
     3// | This file is part of Piwigo.                                          |
    124// |                                                                       |
    13 // | This program is distributed in the hope that it will be useful, but   |
    14 // | WITHOUT ANY WARRANTY; without even the implied warranty of            |
    15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
    16 // | General Public License for more details.                              |
    17 // |                                                                       |
    18 // | You should have received a copy of the GNU General Public License     |
    19 // | along with this program; if not, write to the Free Software           |
    20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
    21 // | USA.                                                                  |
     5// | For copyright and license information, please view the COPYING.txt    |
     6// | file that was distributed with this source code.                      |
    227// +-----------------------------------------------------------------------+
    238
  • extensions/meta_og/language/en_UK/plugin.lang.php

    r32106 r32112  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | meta_og plugin for Piwigo by TEMMII                                            |
     3// | meta_og plugin for Piwigo by TEMMII                                   |
    44// +-----------------------------------------------------------------------+
    55// | Copyright(C) 2008-2020 ddtddt               http://temmii.com/piwigo/ |
     
    2828$lang['size thumbnails bootstrap'] = 'size thumbnails bootstrap';
    2929$lang['size thumbnails default'] = 'size thumbnails default';
     30$lang['size thumbnails default'] = 'size thumbnails square';
     31$lang['size thumbnails default'] = 'size thumbnails large';
    3032$lang['Size medium'] = 'Size medium';
    3133$lang['Add Open Graph metadata on Piwigo page'] = 'Add Open Graph metadata on Piwigo page';
     
    5456$lang['contact'] = 'contact';
    5557$lang['Additional Page'] = 'Additional Page';
     58$lang['This ID isn\'t used in your gallery'] = 'This ID isn\'t used in your gallery';
     59$lang['or'] = 'or';
  • extensions/meta_og/language/fr_FR/index.php

    r32069 r32112  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | Piwigo - a PHP based picture gallery                                  |
    4 // +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2008-2009 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 |
    8 // +-----------------------------------------------------------------------+
    9 // | This program is free software; you can redistribute it and/or modify  |
    10 // | it under the terms of the GNU General Public License as published by  |
    11 // | the Free Software Foundation                                          |
     3// | This file is part of Piwigo.                                          |
    124// |                                                                       |
    13 // | This program is distributed in the hope that it will be useful, but   |
    14 // | WITHOUT ANY WARRANTY; without even the implied warranty of            |
    15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
    16 // | General Public License for more details.                              |
    17 // |                                                                       |
    18 // | You should have received a copy of the GNU General Public License     |
    19 // | along with this program; if not, write to the Free Software           |
    20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
    21 // | USA.                                                                  |
     5// | For copyright and license information, please view the COPYING.txt    |
     6// | file that was distributed with this source code.                      |
    227// +-----------------------------------------------------------------------+
    238
  • extensions/meta_og/language/fr_FR/plugin.lang.php

    r32106 r32112  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | meta_og plugin for Piwigo by TEMMII                                            |
     3// | meta_og plugin for Piwigo by TEMMII                                   |
    44// +-----------------------------------------------------------------------+
    55// | Copyright(C) 2008-2020 ddtddt               http://temmii.com/piwigo/ |
     
    4949$lang['contact'] = 'contact';
    5050$lang['Additional Page'] = 'Page additionelle';
     51$lang['This ID isn\'t used in your gallery'] = 'Cette ID n\'est pas utilisée dans votre galerie';
     52$lang['or'] = 'ou';
    5153?>
  • extensions/meta_og/language/index.php

    r32069 r32112  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | Piwigo - a PHP based picture gallery                                  |
    4 // +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2008-2009 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 |
    8 // +-----------------------------------------------------------------------+
    9 // | This program is free software; you can redistribute it and/or modify  |
    10 // | it under the terms of the GNU General Public License as published by  |
    11 // | the Free Software Foundation                                          |
     3// | This file is part of Piwigo.                                          |
    124// |                                                                       |
    13 // | This program is distributed in the hope that it will be useful, but   |
    14 // | WITHOUT ANY WARRANTY; without even the implied warranty of            |
    15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
    16 // | General Public License for more details.                              |
    17 // |                                                                       |
    18 // | You should have received a copy of the GNU General Public License     |
    19 // | along with this program; if not, write to the Free Software           |
    20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
    21 // | USA.                                                                  |
     5// | For copyright and license information, please view the COPYING.txt    |
     6// | file that was distributed with this source code.                      |
    227// +-----------------------------------------------------------------------+
    238
  • extensions/meta_og/main.inc.php

    r32110 r32112  
    1010
    1111// +-----------------------------------------------------------------------+
    12 // | meta_og plugin for Piwigo by TEMMII                                            |
     12// | meta_og plugin for Piwigo by TEMMII                                   |
    1313// +-----------------------------------------------------------------------+
    1414// | Copyright(C) 2008-2020 ddtddt               http://temmii.com/piwigo/ |
     
    213213  }
    214214 
    215       // og:site_name
     215    // og:site_name
    216216  if (!empty($conf['mogsitename'])) {
    217217    $template->append('head_elements', '<meta property="og:site_name" content="' . $conf['mogsitename'] . '">');
    218218  }
    219219 
    220         // twitter:card
     220    // twitter:card
    221221  if (!empty($conf['mogtwcard'])) {
    222222    $template->append('head_elements', '<meta property="twitter:card" content="' . $conf['mogtwcard'] . '">');
    223223  }
    224224 
    225           // twitter:site
     225    // twitter:site
    226226  if (!empty($conf['mogtwsite'])) {
    227227    $template->append('head_elements', '<meta property="twitter:site" content="' . $conf['mogtwsite'] . '">');
    228228  }
    229   
    230             // twitter:creator
     229 
     230    // twitter:creator
    231231  if (!empty($conf['mogtwcreator'])) {
    232232    $template->append('head_elements', '<meta property="twitter:creator" content="' . $conf['mogtwcreator'] . '">');
    233233  }
    234 
    235  
    236  
    237  
    238 }
    239 
    240 
     234}
    241235?>
Note: See TracChangeset for help on using the changeset viewer.