source: extensions/download_counter/maintain.inc.php @ 27153

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

add install/uninstall functions

File size: 632 bytes
Line 
1<?php
2defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
3
4if (!defined("DLCOUNT_PATH"))
5{
6  define('DLCOUNT_PATH', PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)));
7}
8
9include_once(DLCOUNT_PATH.'/include/install.inc.php');
10
11function plugin_install()
12{
13  dlcount_install();
14  define('dlcount_installed', true);
15}
16
17function plugin_uninstall()
18{
19  global $prefixeTable;
20 
21  $query = 'ALTER TABLE '.$prefixeTable.'images drop column download_counter;';
22  pwg_query($query);
23}
24
25function plugin_activate()
26{
27  if (!defined('dlcount_installed')) // a plugin is activated just after its installation
28  {
29    dlcount_install();
30  }
31}
32?>
Note: See TracBrowser for help on using the repository browser.