/** * Install the plugins * * Uses pluginhandler to perform this task * */ function installplugins() { include_once LOQ_APP_ROOT . 'includes/pluginhandler.class.php'; define('T_PLUGINS', $_SESSION['config']['table_prefix'] . 'plugins'); define('TBL_PREFIX', $_SESSION['config']['table_prefix']); define('BLOGURL', $_SESSION['config']['blog_url']); $ph = new pluginhandler($this->db); $ph->scan_for_plugins(LOQ_APP_ROOT . 'plugins'); }
/** * this is supposed to be a GUI for plugins, * need some help with some sort of api, * in the mean time we'll put them in an array. */ include_once LOQ_APP_ROOT . 'includes/pluginhandler.class.php'; $ph = new pluginhandler($loq->_adb); $show_plugin_menu = TRUE; $plugin_ar = array(); function identify_admin_plugins() { return array('name' => 'plugins', 'type' => 'builtin', 'nicename' => 'Plugins', 'description' => 'Display information about, and run plugins', 'authors' => 'Eaden McKee', 'licence' => 'GPL', 'help' => ''); } // PLUGINS : if (isset($_POST['scan'])) { $np = $ph->scan_for_plugins(dirname(__FILE__)); } if (isset($_POST['scan_refresh'])) { $np = $ph->scan_for_plugins(dirname(__FILE__)); $loq->assign('np', "<b style='color: red;'>{$np} new plugins found and installed.</b><br />"); } $rs = $loq->_adb->Execute("select * from " . T_PLUGINS . " order by type"); if ($rs !== false && !$rs->EOF) { while ($plugin = $rs->FetchRow()) { $plugins[$plugin['type']][$plugin['name']] = array("name" => $plugin['name'], "id" => $plugin['id'], "type" => $plugin['type'], "displayname" => $plugin['nicename'], "description" => $plugin['description'], "file" => $plugin['type'] . "." . $plugin['name'] . ".php", "template" => $plugin['template'], "author" => $plugin['authors'], "licence" => $plugin['licence'], "help" => $plugin['help']); $plugin_ar[] = $plugins[$plugin['type']][$plugin['name']]; } } // other plugin : $p = FALSE; if ($_GET['p']) {