source: extensions/user_custom_fields/include/function.inc.php @ 31534

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

[extensions] - user_custom_fields - save works copy - register/admin gest custom fields

File size: 2.0 KB
Line 
1<?php 
2
3// +-----------------------------------------------------------------------+
4// | User Custom Fields plugin for Piwigo                                  |
5// +-----------------------------------------------------------------------+
6// | Copyright(C) 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/*public*/
24function tab_user_custom_fields_register(){
25  $query = 'SELECT id_ucf,wording,order_ucf,active,edit,adminonly,obligatory FROM ' . UCF_TABLE.' WHERE adminonly=0 AND active=1 ORDER BY order_ucf ASC;';
26  return pwg_query($query);
27}
28
29/*Admin*/
30function tab_user_custom_fields($id_ucf=NULL){
31  $query = '
32    SELECT id_ucf,wording,order_ucf,active,edit,adminonly,obligatory
33    FROM ' . UCF_TABLE;
34    if($id_ucf!=null){
35      $query .= ' WHERE id_ucf='.$id_ucf;
36    }
37  $query .= ' ORDER BY order_ucf ASC
38  ;';
39  return pwg_query($query);
40}
41
42?>
Note: See TracBrowser for help on using the repository browser.