function b_waiting_waiting_show($options) { global $xoopsUser, $xoopsConfig; $userlang = $xoopsConfig['language']; $sql_cache_min = empty($options[1]) ? 0 : intval($options[1]); $sql_cache_file = XOOPS_CACHE_PATH . '/waiting_touch'; // SQL cache check (you have to use this cache with block's cache by system) if (file_exists($sql_cache_file)) { $sql_cache_mtime = filemtime($sql_cache_file); if (time() < $sql_cache_mtime + $sql_cache_min * 60) { return array(); } else { unlink($sql_cache_file); } } require_once dirname(dirname(__FILE__)) . '/include/functions.php'; // read language files for plugins $lang_dir = XOOPS_ROOT_PATH . "/modules/waiting/language"; if (file_exists("{$lang_dir}/{$userlang}/plugins.php")) { include_once "{$lang_dir}/{$userlang}/plugins.php"; } else { if (file_exists("{$lang_dir}/english/plugins.php")) { include_once "{$lang_dir}/english/plugins.php"; } } $plugins_path = XOOPS_ROOT_PATH . "/modules/waiting/plugins"; $xoopsDB =& Database::getInstance(); $module_handler =& xoops_gethandler('module'); $block = array(); // get module's list installed $mod_lists = $module_handler->getList(new Criteria(1, 1), true); foreach ($mod_lists as $dirname => $name) { $plugin_info = waiting_get_plugin_info($dirname, $xoopsConfig['language']); if (empty($plugin_info) || empty($plugin_info['plugin_path'])) { continue; } if (!empty($plugin_info['langfile_path'])) { include_once $plugin_info['langfile_path']; } include_once $plugin_info['plugin_path']; // call the plugin if (function_exists(@$plugin_info['func'])) { // get the list of waitings $_tmp = call_user_func($plugin_info['func'], $dirname); if (isset($_tmp["lang_linkname"])) { if (@$_tmp["pendingnum"] > 0 || $options[0] > 0) { $block["modules"][$dirname]["pending"][] = $_tmp; } unset($_tmp); } else { // Judging the plugin returns multiple items // if lang_linkname does not exist foreach ($_tmp as $_one) { if (@$_one["pendingnum"] > 0 || $options[0] > 0) { $block["modules"][$dirname]["pending"][] = $_one; } } } } // for older compatibilities // Hacked by GIJOE $i = 0; while (1) { $function_name = "b_waiting_{$dirname}_{$i}"; if (function_exists($function_name)) { $_tmp = call_user_func($function_name); ++$i; if ($_tmp["pendingnum"] > 0 || $options[0] > 0) { $block["modules"][$dirname]["pending"][] = $_tmp; } unset($_tmp); } else { break; } } // End of Hack // if(count($block["modules"][$dirname]) > 0){ if (!empty($block["modules"][$dirname])) { $block["modules"][$dirname]["name"] = $name; } } //print_r($block); // SQL cache touch (you have to use this cache with block's cache by system) if (empty($block) && $sql_cache_min > 0) { $fp = fopen($sql_cache_file, "w"); fclose($fp); } return $block; }
<?php // $Id: index.php,v 1.2 2005/04/06 09:49:05 gij Exp $ // FILE :: index.php // AUTHOR :: Ryuji AMANO <*****@*****.**> // WEB :: Ryu's Planning <http://ryus.co.jp/> // require_once "../../../include/cp_header.php"; require_once dirname(dirname(__FILE__)) . '/include/functions.php'; xoops_cp_header(); $plugins_path = XOOPS_ROOT_PATH . "/modules/waiting/plugins"; $module_handler =& xoops_gethandler('module'); $block = array(); //インストールされているモジュールリストを得る。 $mod_lists = $module_handler->getList(new Criteria(1, 1), true); echo "<h4>" . _AM_WAITING_PLUGINLIST . "</h4>"; echo "<table class='outer'>"; echo "<th>" . _AM_WAITING_MODNAME . "</th><th>dirname</th><th>" . _AM_WAITING_STATUS . "</th>"; foreach ($mod_lists as $dirname => $name) { $style = @$style == "odd" ? "even" : "odd"; $plugin_info = waiting_get_plugin_info($dirname); printf("<tr class='%s'><td>%s</td><td>%s</td><td>%s</td></tr>", $style, htmlspecialchars($name), htmlspecialchars($dirname), @$plugin_info['type']); } echo "</table>"; echo _AM_WAITING_PLUGINLIST_DESC; xoops_cp_footer();