1 | <?php |
---|
2 | |
---|
3 | // +-----------------------------------------------------------------------+ |
---|
4 | // | Manage Properties Photos plugin for Piwigo | |
---|
5 | // +-----------------------------------------------------------------------+ |
---|
6 | // | Copyright(C) 2014-2016 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 |
---|
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 |
---|
54 | FROM ' . ADD_PROP_PHOTO_TABLE . ' |
---|
55 | WHERE active = 0 |
---|
56 | AND edit = 1 |
---|
57 | ORDER BY orderprop ASC |
---|
58 | ;'; |
---|
59 | return pwg_query($query); |
---|
60 | } |
---|
61 | |
---|
62 | |
---|
63 | /*initpicture*/ |
---|
64 | function tab_add_info_by_photo_show(){ |
---|
65 | $query = ' |
---|
66 | SELECT id_prop_pho,wording,orderprop |
---|
67 | FROM ' . ADD_PROP_PHOTO_TABLE . ' |
---|
68 | WHERE active = 0 |
---|
69 | ORDER BY orderprop ASC |
---|
70 | ;'; |
---|
71 | return pwg_query($query); |
---|
72 | } |
---|
73 | |
---|
74 | /*initpicture et admin*/ |
---|
75 | function data_info_photos($id_img=null,$id_prop_pho=NULL){ |
---|
76 | $query = ' |
---|
77 | SELECT data |
---|
78 | FROM ' . ADD_PROP_PHOTO_DATA_TABLE; |
---|
79 | $wa='WHERE'; |
---|
80 | if($id_img!=null){ |
---|
81 | $query .=' '.$wa.' id_img='.$id_img;$wa='AND'; |
---|
82 | } |
---|
83 | if($id_prop_pho!=null){ |
---|
84 | $query .=' '.$wa.' id_prop_pho='.$id_prop_pho;$wa='AND'; |
---|
85 | } |
---|
86 | $query .= ';'; |
---|
87 | return pwg_query($query); |
---|
88 | } |
---|
89 | |
---|
90 | /*Admin*/ |
---|
91 | function tab_info_photos($id_prop_pho=NULL){ |
---|
92 | $query = ' |
---|
93 | SELECT id_prop_pho,wording,orderprop,active,edit |
---|
94 | FROM ' . ADD_PROP_PHOTO_TABLE; |
---|
95 | if($id_prop_pho!=null){ |
---|
96 | $query .= ' WHERE id_prop_pho='.$id_prop_pho; |
---|
97 | } |
---|
98 | |
---|
99 | $query .= ' ORDER BY orderprop ASC |
---|
100 | ;'; |
---|
101 | return pwg_query($query); |
---|
102 | } |
---|
103 | |
---|
104 | ?> |
---|