Announcement

#1 2023-01-17 13:53:15

BigIsland270972
Member
Norway
2022-03-15
374

[resolved] Where is index.php?/recent_pics tpl located ?

Hello/Hi/Greetings,

Where is index.php?/recent_pics tpl located ?

Piwigo 13.4 Boostrap Darkroom

Piwigo URL: http://

Last edited by BigIsland270972 (2023-01-17 14:00:27)


Piwigo 14.0 | https://fotoarkiv.no | https://foto.arki.vet | http://Bergen.gallery  | http://Ålesund.gallery | http://geiranger.gallery | http://fjord.photos | http://foto.oslo.no
Apache | PHP 8.1 | MariaDB

Offline

 

#2 2023-01-17 14:19:29

TOnin
Member
1970-01-01
106

Re: [resolved] Where is index.php?/recent_pics tpl located ?

Hi,
looks like it's the same template for several page types among category, recent_pics, ... etc.
Give a try to /themes/default/template/thumbnails.tpl

Offline

 

#3 2023-01-17 18:49:01

BigIsland270972
Member
Norway
2022-03-15
374

Re: [resolved] Where is index.php?/recent_pics tpl located ?

Let me explain further. I need to change the recent pics database query to the same  as plugins/PWG_Stuffs/modules/Recent/main.inc.php:  ENTRY:  i.date_metadata_update instead of date_available
to code:  $query ='
SELECT DISTINCT(i.id)
  FROM '.IMAGES_TABLE.' AS i
    INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON i.id = ic.image_id
    INNER JOIN '.CATEGORIES_TABLE.' AS c ON ic.category_id = c.id';

if (!isset($datas['recent_period_only']) or
    $datas['recent_period_only'])
{
  $query .= '
        WHERE i.date_metadata_update >= SUBDATE(
      CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY)
  ';
}

if (isset($page['category']))
{
  $query .= '
        AND ( c.uppercats LIKE \''.$page['category']['uppercats'].',%\' OR c.id = '.$page['category']['id'].' )
  ';
}

Last edited by BigIsland270972 (2023-01-17 18:49:23)


Piwigo 14.0 | https://fotoarkiv.no | https://foto.arki.vet | http://Bergen.gallery  | http://Ålesund.gallery | http://geiranger.gallery | http://fjord.photos | http://foto.oslo.no
Apache | PHP 8.1 | MariaDB

Offline

 

#4 2023-01-17 20:14:13

BigIsland270972
Member
Norway
2022-03-15
374

Re: [resolved] Where is index.php?/recent_pics tpl located ?

FOUND IT! in /include/section_init.inc.php

// +-----------------------------------------------------------------------+
// |                       recent pictures section                         |
// +-----------------------------------------------------------------------+
  else if ($page['section'] == 'recent_pics')
  {
    if ( !isset($page['super_order_by']) )
    {
      $conf['order_by'] = str_replace(
          'ORDER BY ',
          'ORDER BY date_metadata_update DESC,', ===CHANGE
          $conf['order_by']
          );
    }

    $query = '
SELECT DISTINCT(id)
  FROM '.IMAGES_TABLE.'
    INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id
  WHERE '
  .get_recent_photos_sql('date_metadata_update').' ===CHANGE
  '.$forbidden
  .$conf['order_by'].'
;';

    $page = array_merge(
      $page,
      array(
        'title' => '<a href="'.duplicate_index_url(array('start'=>0)).'">'
                    .l10n('Recent photos').'</a>',
        'items' => query2array($query,null, 'id'),
        )
      );
  }


Piwigo 14.0 | https://fotoarkiv.no | https://foto.arki.vet | http://Bergen.gallery  | http://Ålesund.gallery | http://geiranger.gallery | http://fjord.photos | http://foto.oslo.no
Apache | PHP 8.1 | MariaDB

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact