[21069] | 1 | <?php |
---|
| 2 | // Chech whether we are indeed included by Piwigo. |
---|
| 3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 4 | |
---|
| 5 | function 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 | |
---|
| 19 | if (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 | } |
---|
| 25 | function 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 | |
---|
| 39 | if (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 | |
---|
| 46 | function plugin_uninstall() |
---|
| 47 | { |
---|
| 48 | pwg_query('DELETE FROM ' . CONFIG_TABLE . ' WHERE '.CONFIG_TABLE.'.param="vkbutton" LIMIT 1;'); |
---|
| 49 | unset($conf['vkbutton']); |
---|
| 50 | } |
---|