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

Last change on this file since 31976 was 31409, checked in by ddtddt, 8 years ago

[extensions] - manage_properties_photos

File size: 3.5 KB
Line 
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*/
24function 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
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
54    FROM ' . ADD_PROP_PHOTO_TABLE . '
55    WHERE active = 0
56    AND edit = 1
57    ORDER BY orderprop ASC
58    ;';
59return pwg_query($query);
60}
61
62
63/*initpicture*/
64function 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    ;';
71return pwg_query($query);
72}
73
74/*initpicture et admin*/
75function 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 .= ';';
87return pwg_query($query);
88}
89
90/*Admin*/
91function 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    ;';
101return pwg_query($query);
102}
103
104?>
Note: See TracBrowser for help on using the repository browser.