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*/ |
---|
24 | function 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 | |
---|
34 | return pwg_query($query); |
---|
35 | } |
---|
36 | /* |
---|
37 | function 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 | |
---|
47 | return pwg_query($query); |
---|
48 | } |
---|
49 | */ |
---|
50 | /*Admin*/ |
---|
51 | function 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 | ;'; |
---|
60 | return pwg_query($query); |
---|
61 | } |
---|
62 | |
---|
63 | |
---|
64 | /*initpicture*/ |
---|
65 | function 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 | ;'; |
---|
72 | return pwg_query($query); |
---|
73 | } |
---|
74 | |
---|
75 | /*initpicture et admin*/ |
---|
76 | function 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 .= ';'; |
---|
88 | return pwg_query($query); |
---|
89 | } |
---|
90 | |
---|
91 | function 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 .= ';'; |
---|
103 | return pwg_query($query); |
---|
104 | } |
---|
105 | |
---|
106 | /*Admin*/ |
---|
107 | function 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 | ;'; |
---|
117 | return pwg_query($query); |
---|
118 | } |
---|
119 | |
---|
120 | ?> |
---|