function getPlugins() { $handle = opendir(ROOT . './plugins/'); $plugins = $new_plugins = $installed = array(); $query = DB::query('SELECT name FROM plugin'); while ($row = DB::fetch($query)) { $installed[] = $row['name']; } while (1) { $folder = readdir($handle); if (!$folder) { break; } if ($folder == '.' || $folder == '..') { continue; } $classfile = ROOT . './plugins/' . $folder . '/plugin.class.php'; if (!file_exists($classfile)) { continue; } require_once $classfile; $classname = "plugin_{$folder}"; if (!class_exists("plugin_{$folder}", false)) { continue; } $obj = new $classname(); $arr = array('id' => $folder, 'description' => $obj->description, 'config' => method_exists($obj, 'on_config'), 'enabled' => is_plugin_enabled($folder), 'version' => getPluginVersion($folder), 'installed' => in_array($folder, $installed)); if ($arr['installed']) { $plugins[] = $arr; } else { $new_plugins[] = $arr; } } return array_merge($plugins, $new_plugins); }
$metaTitle = 'PWD - Plugins'; $id = getRequest('id'); if (is_numeric($id) === FALSE) { redirectInterne('./'); } if (isset($gSettings['sites']['site'][$id]) === FALSE) { redirectInterne('./'); } $blog = $gSettings['sites']['site'][$id]; if ($blog['version_url'] == '-') { redirectInterne('./'); } $blogInfos = getInfoBlog($blog['url'], $blog['version_url'], $blog['version_pass']); $plugins = array(); foreach ($blogInfos['plugins']['plugin'] as $key => $ePlugin) { $pluginsInfos = getPluginVersion($ePlugin['slug']); $plugins[$key] = $ePlugin; $plugins[$key]['infos'] = $pluginsInfos; } include 'includes/header.inc.php'; include 'includes/navigation.inc.php'; ?> <div id="page-wrapper"> <div class="row"> <div class="col-lg-12"> <h1 class="page-header"><?php echo $blog['name']; ?> - Extensions</h1> </div> <!-- /.col-lg-12 -->
open_flash_chart_object('800', 350, $oGraph->getUrl()); ?> <div style="text-align: center; margin: 8px 0; padding: 4px 32px; border-top: 1px solid #cccccc; border-bottom: 1px solid #cccccc;"> <?php echo getButtons($oGraph->getLinks()); ?> </div> <div style="margin: 4px"> <script type='text/javascript'><!--//<![CDATA[ var m3_u = (location.protocol=='https:'?'https://servedby.reviveservers.com/ajs.php':'http://servedby.reviveservers.com/ajs.php'); var m3_r = Math.floor(Math.random()*99999999999); if (!document.MAX_used) document.MAX_used = ','; document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u); document.write ("?zoneid=684&version=<?php echo urlencode(getPluginVersion()); ?> "); document.write ('&cb=' + m3_r); if (document.MAX_used != ',') document.write ("&exclude=" + document.MAX_used); document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : '')); document.write ("&loc=" + escape(window.location)); if (document.referrer) document.write ("&referer=" + escape(document.referrer)); if (document.context) document.write ("&context=" + escape(document.context)); if (document.mmm_fo) document.write ("&mmm_fo=1"); document.write ("'><\/scr"+"ipt>"); //]]>--></script> </div> </div>
$listePlugins = array(); foreach ($gSettings['sites']['site'] as $key => $eBlog) { if ($eBlog['version_url'] == '-') { continue; } $blogInfos = getInfoBlog($eBlog['url'], $eBlog['version_url'], $eBlog['version_pass']); $plugins = array(); foreach ($blogInfos['plugins']['plugin'] as $key => $ePlugin) { if (isset($listePlugins[$ePlugin['slug']]) === TRUE) { $listePlugins[$ePlugin['slug']]['use']++; $listePlugins[$ePlugin['slug']]['blogs'] .= $eBlog['name'] . '<br />'; } else { $listePlugins[$ePlugin['slug']] = $ePlugin; $listePlugins[$ePlugin['slug']]['use'] = 1; $listePlugins[$ePlugin['slug']]['blogs'] = $eBlog['name'] . '<br />'; $listePlugins[$ePlugin['slug']]['infos'] = getPluginVersion($ePlugin['slug']); } } } usort($listePlugins, 'sortByUse'); include 'includes/header.inc.php'; include 'includes/navigation.inc.php'; ?> <div id="page-wrapper"> <div class="row"> <div class="col-lg-12"> <h1 class="page-header">Liste des extensions utilisées</h1> </div> <!-- /.col-lg-12 --> </div> <!-- /.row -->