source: extensions/birthdate/include/install.inc.php @ 19773

Last change on this file since 19773 was 19773, checked in by plg, 11 years ago

new plugin birthdate to calculate age of people on each photo

File size: 808 bytes
Line 
1<?php
2defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
3
4/**
5 * The installation function is called by main.inc.php and maintain.inc.php
6 * in order to install and/or update the plugin.
7 *
8 * That's why all operations must be conditionned :
9 *    - use "if empty" for configuration vars
10 *    - use "IF NOT EXISTS" for table creation
11 *
12 * Unlike the functions in maintain.inc.php, the name of this function must be unique
13 * and not enter in conflict with other plugins.
14 */
15
16function birthdate_install() 
17{
18  global $conf, $prefixeTable;
19 
20  // add a new column to existing table
21  $result = pwg_query('SHOW COLUMNS FROM `'.TAGS_TABLE.'` LIKE "birthdate";');
22  if (!pwg_db_num_rows($result))
23  {     
24    pwg_query('ALTER TABLE `' . TAGS_TABLE . '` ADD `birthdate` datetime default NULL;');
25  }
26}
27?>
Note: See TracBrowser for help on using the repository browser.