Last change
on this file since 20407 was
19773,
checked in by plg, 12 years ago
|
new plugin birthdate to calculate age of people on each photo
|
File size:
1.3 KB
|
Line | |
---|
1 | <?php |
---|
2 | defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); |
---|
3 | |
---|
4 | defined('BIRTHDATE_ID') or define('BIRTHDATE_ID', basename(dirname(__FILE__))); |
---|
5 | include_once(PHPWG_PLUGINS_PATH . BIRTHDATE_ID . '/include/install.inc.php'); |
---|
6 | |
---|
7 | /** |
---|
8 | * plugin installation |
---|
9 | * |
---|
10 | * perform here all needed step for the plugin installation |
---|
11 | * such as create default config, add database tables, |
---|
12 | * add fields to existing tables, create local folders... |
---|
13 | */ |
---|
14 | function plugin_install() |
---|
15 | { |
---|
16 | birthdate_install(); |
---|
17 | define('birthdate_installed', true); |
---|
18 | } |
---|
19 | |
---|
20 | /** |
---|
21 | * plugin activation |
---|
22 | * |
---|
23 | * this function is triggered adter installation, by manual activation |
---|
24 | * or after a plugin update |
---|
25 | * for this last case you must manage updates tasks of your plugin in this function |
---|
26 | */ |
---|
27 | function plugin_activate() |
---|
28 | { |
---|
29 | if (!defined('birthdate_installed')) // a plugin is activated just after its installation |
---|
30 | { |
---|
31 | birthdate_install(); |
---|
32 | } |
---|
33 | } |
---|
34 | |
---|
35 | /** |
---|
36 | * plugin unactivation |
---|
37 | * |
---|
38 | * triggered before uninstallation or by manual unactivation |
---|
39 | */ |
---|
40 | function plugin_unactivate() |
---|
41 | { |
---|
42 | } |
---|
43 | |
---|
44 | /** |
---|
45 | * plugin uninstallation |
---|
46 | * |
---|
47 | * perform here all cleaning tasks when the plugin is removed |
---|
48 | * you should revert all changes made by plugin_install() |
---|
49 | */ |
---|
50 | function plugin_uninstall() |
---|
51 | { |
---|
52 | // delete field |
---|
53 | pwg_query('ALTER TABLE `' . TAGS_TABLE . '` DROP COLUMN `birthdate`;'); |
---|
54 | } |
---|
55 | |
---|
56 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.