* @copyright 2017 MyAAC * @version 0.1.2 * @link http://my-aac.org */ defined('MYAAC') or die('Direct access not allowed!'); $title = 'Plugin manager'; require(SYSTEM . 'hooks.php'); ?>
Install plugin:


open($targetzip); // open the zip file to extract if ($x === true) { if($zip->extractTo($targetdir)) { // place in the directory with same name $string = file_get_contents(BASE . 'plugins/' . $name[0] . '.json'); $plugin = json_decode($string, true); if($plugin == NULL) { warning('Cannot load ' . BASE . 'plugins/' . $name[0] . '.json. File might be not valid json code.'); } if(isset($plugin['install'])) { if(file_exists(BASE . $plugin['install'])) require(BASE . $plugin['install']); else warning('Cannot load install script. Your plugin might be not working correctly.'); } if(isset($plugin['hooks'])) { foreach($plugin['hooks'] as $_name => $info) { if(isset($hook_types[$info['type']])) { $query = $db->query('SELECT `id` FROM `' . TABLE_PREFIX . 'hooks` WHERE `name` = ' . $db->quote($_name) . ';'); if($query->rowCount() == 1) { // found something $query = $query->fetch(); $db->query('UPDATE `' . TABLE_PREFIX . 'hooks` SET `type` = ' . $hook_types[$info['type']] . ', `file` = ' . $db->quote($info['file']) . ' WHERE `id` = ' . (int)$query['id'] . ';'); } else { $db->query('INSERT INTO `' . TABLE_PREFIX . 'hooks` (`id`, `name`, `type`, `file`) VALUES (NULL, ' . $db->quote($_name) . ', ' . $hook_types[$info['type']] . ', ' . $db->quote($info['file']) . ');'); } } else warning('Unknown event type: ' . $info['type']); } } success('' . $plugin['name'] . ' plugin has been successfully installed.'); } else { error('There was a problem with extracting zip archive.'); } $zip->close(); unlink($targetzip); // delete the Zipped file } else { error('There was a problem with opening zip archive.'); } } else error('There was a problem with the upload. Please try again.'); } else { error('The file you are trying to upload is not a .zip file. Please try again.'); } } else { error('Error uploading file - unknown error.'); } } } echo $message; ?> Installed plugins: '; } ?>
Plugin name (Description on hover) Filename Version Author Contact
' . $plugin_info['name'] . '
' . $file . ' ' . $plugin_info['version'] . ' ' . $plugin_info['author'] . ' ' . $plugin_info['contact'] . '