source: extensions/meta_og/maintain.class.php @ 32516

Last change on this file since 32516 was 32408, checked in by ddtddt, 4 years ago

[meta_og] piwigo 11

File size: 3.0 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | Meta Open Graph plugin for Piwigo by TEMMII                           |
4// +-----------------------------------------------------------------------+
5// | Copyright(C) 2020-2021 ddtddt               http://temmii.com/piwigo/ |
6// +-----------------------------------------------------------------------+
7// | This program is free software; you can redistribute it and/or modify  |
8// | it under the terms of the GNU General Public License as published by  |
9// | the Free Software Foundation                                          |
10// |                                                                       |
11// | This program is distributed in the hope that it will be useful, but   |
12// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
13// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
14// | General Public License for more details.                              |
15// |                                                                       |
16// | You should have received a copy of the GNU General Public License     |
17// | along with this program; if not, write to the Free Software           |
18// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
19// | USA.                                                                  |
20// +-----------------------------------------------------------------------+
21
22if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
23
24class meta_og_maintain extends PluginMaintain
25{
26  function install($plugin_version, &$errors=array())
27  {
28 global $conf, $prefixeTable, $user;
29    $q = 'CREATE TABLE ' . $prefixeTable . 'metaog(
30id SMALLINT( 5 ) UNSIGNED NOT NULL AUTO_INCREMENT,
31type SMALLINT( 5 ) UNSIGNED NOT NULL,
32idobj SMALLINT( 5 ) UNSIGNED NOT NULL default "0",
33page VARCHAR( 255 ) ,
34metaogtitle VARCHAR( 255 ) NOT NULL ,
35metaogdescription lONGTEXT NOT NULL ,
36metaogimage lONGTEXT NOT NULL ,
37PRIMARY KEY (id))DEFAULT CHARSET=utf8;';
38    pwg_query($q);
39   
40   if ($user['theme'] == 'bootstrapdefault'||$user['theme'] == 'bootstrap_darkroom'){
41                  conf_update_param('mogsize','cu');
42   }else if ($user['theme'] == 'modus'){
43                  conf_update_param('mogsize','2s');           
44   }else{
45                  conf_update_param('mogsize','th');
46                }
47   
48   conf_update_param('fb:app_id','');
49   conf_update_param('moglocal','');
50   conf_update_param('mogsitename','');
51   conf_update_param('mogtwcard','');
52   conf_update_param('mogtwsite','');
53   conf_update_param('mogtwcreator','');
54   conf_update_param('mogshowpa','1'); 
55   }
56
57  function uninstall()
58  {
59
60    global $prefixeTable;
61
62    $q = 'DROP TABLE ' . $prefixeTable . 'metaog;';
63    pwg_query($q);
64
65    conf_delete_param('mogsize');
66        conf_delete_param('fb:app_id');
67        conf_delete_param('moglocal');
68        conf_delete_param('mogsitename');
69        conf_delete_param('mogtwcard','');
70        conf_delete_param('mogtwsite','');
71        conf_delete_param('mogtwcreator',''); 
72        conf_delete_param('mogshowpa','');
73        conf_delete_param('moglista','');
74  }
75}
Note: See TracBrowser for help on using the repository browser.