source: extensions/see_my_photos/pagessmp.php @ 31941

Last change on this file since 31941 was 31459, checked in by ddtddt, 8 years ago

[extensions] - see_my_photos - 2.8

File size: 2.4 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | See My Photos plugin for piwigo                                       |
4// +-----------------------------------------------------------------------+
5// | Copyright(C) 2014 - 2016 ddtddt             http://temmii.com/piwigo/ |
6// +-----------------------------------------------------------------------+
7// | This program is free software; you can redistribute it and/or modify  |
8// | it under the terms of the GNU General Public License as published by  |
9// | the Free Software Foundation                                          |
10// |                                                                       |
11// | This program is distributed in the hope that it will be useful, but   |
12// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
13// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
14// | General Public License for more details.                              |
15// |                                                                       |
16// | You should have received a copy of the GNU General Public License     |
17// | along with this program; if not, write to the Free Software           |
18// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
19// | USA.                                                                  |
20// +-----------------------------------------------------------------------+
21
22global $page, $conf, $user;
23$forbidden = get_sql_condition_FandF(
24  array( 'visible_images' => 'id' ),
25  'AND'
26);
27$page['section'] = 'see_my_photos';
28$page['section_title'] =  '<a href="'.get_absolute_root_url().'">'.l10n('Home').'</a>'.$conf['level_separator']. '<a href="'.get_absolute_root_url().'index.php?/see_my_photos">'.l10n('My photos').'</a>';
29
30$query = '
31SELECT DISTINCT(id)
32 FROM '.IMAGES_TABLE.'
33 INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id
34 '.get_sql_condition_FandF
35  (
36    array
37      (
38        'forbidden_categories' => 'category_id',
39        'visible_categories' => 'category_id',
40        'visible_images' => 'id'
41      ),
42    'WHERE'
43  ).'
44 AND added_by = \''.$user['id'].'\'
45 '.$conf['order_by'].';';
46$page = array_merge(
47 $page,
48  array(
49  'title' => '<a href="'.duplicate_index_url(array('start'=>0)).'">'.l10n('See photos by author').'</a>',
50  'items' => array_from_query($query, 'id'),
51  )
52 );
53?>
Note: See TracBrowser for help on using the repository browser.