source: extensions/user_custom_fields/main.inc.php

Last change on this file was 32698, checked in by ddtddt, 2 years ago

[user_custom_fields] compatybilité piwigo 12

File size: 2.7 KB
Line 
1<?php
2/*
3Plugin Name: User Custom Fields
4Version: auto
5Description: Add User Custom Fields
6Plugin URI: http://piwigo.org/ext/extension_view.php?eid=833
7Author: ddtddt
8Author URI: http://temmii.com/piwigo/
9Has Settings: true
10*/
11
12// +-----------------------------------------------------------------------+
13// | User Custom Fields plugin for Piwigo by TEMMII                        |
14// +-----------------------------------------------------------------------+
15// | Copyright(C) 2016-2022 ddtddt               http://temmii.com/piwigo/ |
16// +-----------------------------------------------------------------------+
17// | This program is free software; you can redistribute it and/or modify  |
18// | it under the terms of the GNU General Public License as published by  |
19// | the Free Software Foundation                                          |
20// |                                                                       |
21// | This program is distributed in the hope that it will be useful, but   |
22// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
23// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
24// | General Public License for more details.                              |
25// |                                                                       |
26// | You should have received a copy of the GNU General Public License     |
27// | along with this program; if not, write to the Free Software           |
28// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
29// | USA.                                                                  |
30// +-----------------------------------------------------------------------+
31
32
33if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
34
35global $prefixeTable;
36
37define('UCF_DIR' , basename(dirname(__FILE__)));
38define('UCF_PATH' , PHPWG_PLUGINS_PATH . UCF_DIR . '/');
39if (!defined('UCF_TABLE')) define('UCF_TABLE', $prefixeTable.'user_custom_fields');
40if (!defined('UCFD_TABLE')) define('UCFD_TABLE', $prefixeTable.'user_custom_fields_data');
41define('UCF_ADMIN',get_root_url().'admin.php?page=plugin-'.UCF_DIR);
42
43include_once(UCF_PATH . 'include/function.inc.php');
44
45add_event_handler('init', 'user_custom_fields_loading_lang');     
46function user_custom_fields_loading_lang(){
47  load_language('plugin.lang', UCF_PATH);
48  global $template;
49  $template->assign(
50    array(
51         'UCF_PATH2'=> UCF_PATH,
52         'UCF_ADMIN2'=> UCF_ADMIN,
53    )
54  );
55}
56
57 //plugin on register
58if (script_basename() == 'register')
59{ 
60 include_once(dirname(__FILE__).'/initregister.php');
61}
62// Plugin on profile page
63if (script_basename() == 'profile') 
64{ 
65 include_once(dirname(__FILE__).'/initprofile.php');
66}
67
68  // Plugin for admin
69if (script_basename() == 'admin')   
70{
71  include_once(dirname(__FILE__).'/initadmin.php');
72}
73
74?>
Note: See TracBrowser for help on using the repository browser.