source: extensions/vkbutton/maintain.inc.php @ 21726

Last change on this file since 21726 was 21069, checked in by EvilKant, 11 years ago
File size: 1.3 KB
Line 
1<?php
2// Chech whether we are indeed included by Piwigo.
3if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
4
5function plugin_activate()
6{
7        global $conf;
8       
9        $config = array(
10                'show_main_button' => 'on',
11                'main_button_type' => 'button',
12                'record_title' => 'Title',
13                'record_text' => 'Description',
14                'record_img' => '',
15                'show_pic_button' => 'on',
16                'pic_button_type' => 'button'
17        );
18       
19if (empty($conf['vkbutton']))
20  {
21        pwg_query('INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
22                VALUES ("vkbutton" , "'.pwg_db_real_escape_string(serialize($config)).'" , "vkbutton configuration");');
23    }
24}
25function plugin_install()
26{
27        global $conf;
28       
29        $config = array(
30                'show_main_button' => 'on',
31                'main_button_type' => 'button',
32                'record_title' => 'Title',
33                'record_text' => 'Description',
34                'record_img' => '',
35                'show_pic_button' => 'on',
36                'pic_button_type' => 'button'
37        );
38       
39if (empty($conf['vkbutton']))
40  {
41        pwg_query('INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
42                VALUES ("vkbutton" , "'.pwg_db_real_escape_string(serialize($config)).'" , "vkbutton configuration");');
43    }
44}
45
46function plugin_uninstall()
47{
48  pwg_query('DELETE FROM ' . CONFIG_TABLE . ' WHERE '.CONFIG_TABLE.'.param="vkbutton" LIMIT 1;');
49  unset($conf['vkbutton']);
50}
Note: See TracBrowser for help on using the repository browser.