Browse Source

Save in db if addon define "$addon_plugin_admin" function. Add "plugin_admin" column to "addon" table

tags/2.3beta1
fabrixxm 9 years ago
parent
commit
b650183cd4
3 changed files with 13 additions and 5 deletions
  1. +7
    -3
      boot.php
  2. +2
    -1
      database.sql
  3. +4
    -1
      update.php

+ 7
- 3
boot.php View File

@@ -6,7 +6,7 @@ ini_set('pcre.backtrack_limit', 250000);

define ( 'FRIENDIKA_VERSION', '2.2.1015' );
define ( 'DFRN_PROTOCOL_VERSION', '2.21' );
define ( 'DB_UPDATE_VERSION', 1063 );
define ( 'DB_UPDATE_VERSION', 1064 );

define ( 'EOL', "<br />\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
@@ -477,9 +477,13 @@ function install_plugin($plugin){
if(function_exists($plugin . '_install')) {
$func = $plugin . '_install';
$func();
$r = q("INSERT INTO `addon` (`name`, `installed`, `timestamp`) VALUES ( '%s', 1, %d ) ",
$plugin_admin = (function_exists($plugin."_plugin_admin")?1:0);
$r = q("INSERT INTO `addon` (`name`, `installed`, `timestamp`, `plugin_admin`) VALUES ( '%s', 1, %d , %d ) ",
dbesc($plugin),
intval($t)
intval($t),
$plugin_admin
);
}
}}


+ 2
- 1
database.sql View File

@@ -469,7 +469,8 @@ CREATE TABLE IF NOT EXISTS `addon` (
`name` CHAR( 255 ) NOT NULL ,
`version` CHAR( 255 ) NOT NULL ,
`installed` TINYINT( 1 ) NOT NULL DEFAULT '0' ,
`timestamp` BIGINT NOT NULL DEFAULT '0'
`timestamp` BIGINT NOT NULL DEFAULT '0' ,
`plugin_admin` TINYINT( 1 ) NOT NULL DEFAULT '0'
) ENGINE = MYISAM DEFAULT CHARSET=utf8;




+ 4
- 1
update.php View File

@@ -1,6 +1,6 @@
<?php

define( 'UPDATE_VERSION' , 1063 );
define( 'UPDATE_VERSION' , 1064 );

/**
*
@@ -517,4 +517,7 @@ function update_1061() {
function update_1062() {
q("ALTER TABLE `user` ADD `prvnets` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `page-flags` ");
}
function update_1063() {
q("ALTER TABLE `addon` ADD `plugin_admin` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `timestamp` ");
}


Loading…
Cancel
Save