source: extensions/manage_properties_photos/include/function.aip.inc.php @ 32465

Last change on this file since 32465 was 32391, checked in by ddtddt, 4 years ago

[meta] piwigo 11

File size: 3.9 KB
Line 
1<?php 
2
3// +-----------------------------------------------------------------------+
4// | Manage Properties Photos plugin for Piwigo by TEMMII                  |
5// +-----------------------------------------------------------------------+
6// | Copyright(C) 2007-2021 ddtddt               http://temmii.com/piwigo/ |
7// +-----------------------------------------------------------------------+
8// | This program is free software; you can redistribute it and/or modify  |
9// | it under the terms of the GNU General Public License as published by  |
10// | the Free Software Foundation                                          |
11// |                                                                       |
12// | This program is distributed in the hope that it will be useful, but   |
13// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
14// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
15// | General Public License for more details.                              |
16// |                                                                       |
17// | You should have received a copy of the GNU General Public License     |
18// | along with this program; if not, write to the Free Software           |
19// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
20// | USA.                                                                  |
21// +-----------------------------------------------------------------------+
22
23/*picture*/
24function tab_add_info_one_photo($id_img){
25$query = '
26    SELECT aip.id_prop_pho,aip.wording,aipd.data,aip.orderprop,aip.Typ
27    FROM ' . ADD_PROP_PHOTO_TABLE . ' AS aip
28    LEFT JOIN ' . ADD_PROP_PHOTO_DATA_TABLE . ' AS aipd ON aip.id_prop_pho=aipd.id_prop_pho
29    WHERE aipd.id_img = \'' . $id_img . '\'
30    AND aip.active = 0
31    ORDER BY aip.orderprop ASC
32    ;';
33
34return pwg_query($query);
35}
36/*
37function tab_add_info_one_photo2($id_img){
38$query = '
39    SELECT aip.id_prop_pho,aip.wording,aipd.data,aip.orderprop
40    FROM ' . ADD_PROP_PHOTO_DATA_TABLE . ' AS aipd
41    RIGHT JOIN ' . ADD_PROP_PHOTO_TABLE . ' AS aip ON aip.id_prop_pho=aipd.id_prop_pho
42    WHERE aipd.id_img = \'' . $id_img . '\'
43    AND aip.active = 0
44    ORDER BY aip.orderprop ASC
45    ;';
46
47return pwg_query($query);
48}
49*/
50/*Admin*/
51function tab_add_info_by_photo(){
52$query = '
53    SELECT id_prop_pho,wording,Typ,dataprop
54    FROM ' . ADD_PROP_PHOTO_TABLE . '
55    WHERE edit = 1
56        AND typ != 3
57        AND typ != 6
58    ORDER BY orderprop ASC
59    ;';
60return pwg_query($query);
61}
62
63
64/*initpicture*/
65function tab_add_info_by_photo_show(){
66$query = '
67    SELECT id_prop_pho,wording,orderprop,Typ,dataprop
68    FROM ' . ADD_PROP_PHOTO_TABLE . '
69    WHERE active = 0
70    ORDER BY orderprop ASC
71    ;';
72return pwg_query($query);
73}
74
75/*initpicture et admin*/
76function data_info_photos($id_img=null,$id_prop_pho=NULL){
77$query = '
78    SELECT data
79    FROM ' . ADD_PROP_PHOTO_DATA_TABLE;
80    $wa='WHERE';
81    if($id_img!=null){
82        $query .=' '.$wa.' id_img='.$id_img;$wa='AND';
83    }
84    if($id_prop_pho!=null){
85        $query .=' '.$wa.' id_prop_pho='.$id_prop_pho;$wa='AND';
86    }
87$query .= ';';
88return pwg_query($query);
89}
90
91function data_info_photosdate($id_img=null,$id_prop_pho=NULL){
92$query = '
93    SELECT datadate
94    FROM ' . ADD_PROP_PHOTO_DATADATE_TABLE;
95    $wa='WHERE';
96    if($id_img!=null){
97        $query .=' '.$wa.' id_img='.$id_img;$wa='AND';
98    }
99    if($id_prop_pho!=null){
100        $query .=' '.$wa.' id_prop_pho='.$id_prop_pho;$wa='AND';
101    }
102$query .= ';';
103return pwg_query($query);
104}
105
106/*Admin*/
107function tab_info_photos($id_prop_pho=NULL){
108$query = '
109    SELECT id_prop_pho,wording,orderprop,active,edit,Typ,dataprop
110    FROM ' . ADD_PROP_PHOTO_TABLE;
111    if($id_prop_pho!=null){
112        $query .= ' WHERE id_prop_pho='.$id_prop_pho;
113    }
114
115$query .= ' ORDER BY orderprop ASC
116    ;';
117return pwg_query($query);
118}
119
120?>
Note: See TracBrowser for help on using the repository browser.