function content() { global $pagenum, $selected, $message, $menu, $set, $langmessage, $LNEversion, $out, $prefix; if ($message != "") { $out .= "<div class=\"LNE_message\">" . $message . "</div>\n"; } if ($_SESSION['adminlevel'] > 3) { $out .= adminmenu(); } switch ($_GET['do']) { case "search": $out .= "<h2 class=\"LNE_title\">{$langmessage['66']}</h2>\n"; $out .= search(); break; case "register": if ($set['gzip']) { $out .= register(); } break; case "addons": $out .= addons(); break; case "create": $out .= create_page(); break; case "database": $out .= query(); break; case "delete": delete_page(); break; case "edit": print $out; $out = ""; editpage(); break; case "editextra": print $out; $out = ""; extras(); break; case "editmenu": $out .= editmenu(); break; case "login": $out .= loginform(); break; case "plugins": $out .= plugins(); break; case "profile": if ($_SESSION[$set['password']] == "1") { $out .= profile(); } break; case "query": $out .= query(); break; case "settings": $out .= settings(); break; case "setup": $out .= setup(); break; case "sitemap": $out .= showsitemap($langmessage, 0); break; case "users": $out .= users(); break; default: $addons = fetch_all(dbquery("SELECT * FROM " . $prefix . "addons WHERE active=1")); $found = false; foreach ($addons as $addon) { if ($_GET['do'] == $addon['name'] && $_SESSION['adminlevel'] >= $addon['adminlevel']) { require_once "addons/" . $addon['name'] . "/admin.php"; $out .= $addon['aname'](); $found = true; break; } } if (!$found) { $result = dbquery("SELECT * FROM " . $prefix . "paginas WHERE page=\"" . $pagenum . "\""); if ($row = fetch_array($result)) { if ($row['restricted'] != 0 && $row['restricted'] > $_SESSION['adminlevel']) { $out .= restrictedpage($row['restricted']); } else { $contnt = html_entity_decode(stripslashes($row['content'])); showcontent($contnt); } } else { $result = dbquery("SELECT * FROM " . $prefix . "paginas WHERE page=\"index\""); if ($row = fetch_array($result)) { $contnt = html_entity_decode(stripslashes($row['content'])); showcontent($contnt); } else { $out .= "<h2>{$langmessage['116']}</h2>\n"; } } foreach ($addons as $addon) { if (strpos($contnt, "%!\$" . $addon['name']) && $addon['header'] == 1) { require_once "addons/" . $addon['name'] . "/header.php"; } } } } }
$nameline = `grep ";name" ../nyquist/{$file}`; if (preg_match(';name "*([0-9a-zA-Z ]*);', $nameline, $matches)) { $name = $matches[1]; print "<b>{$name}</b> | \n"; print "<a href=\"../nyquist/{$base}.ny\">" . "View {$base}.ny" . "</a> | "; print "<a href=\"../nyquist/{$base}.zip\">" . "Download {$base}.zip" . "</a>\n"; print "<p>\n"; if (file_exists("../nyquist/{$base}1.mp3")) { print "Example audio clips: "; for ($i = 1; $i <= 9; $i++) { if (file_exists("../nyquist/{$base}{$i}.mp3")) { print "<a href=\"../nyquist/{$base}{$i}.mp3\">[MP3 Clip {$i}]</a>"; print " "; } } print "<p>\n"; } system("cat ../nyquist/{$base}.html"); print "<p><hr><p>\n"; } else { print "<li>No name from {$nameline}\n"; } } } } } } plugins(0); print "<p>\n"; plugins(1); include "../include/footer.inc.php";
/** * main function. checks for authorization and renders the * required admin section. */ function admin_main($authorised) { echo "\n<div id=\"channel_admin\" class=\"frame\">"; if ($authorised) { admin_menu(); if (array_key_exists(CST_ADMIN_DOMAIN, $_REQUEST)) { switch ($_REQUEST[CST_ADMIN_DOMAIN]) { case CST_ADMIN_DOMAIN_FOLDER: $show = folder_admin(); break; case CST_ADMIN_DOMAIN_CHANNEL: $show = channel_admin(); break; case CST_ADMIN_DOMAIN_CONFIG: $show = config_admin(); break; case CST_ADMIN_DOMAIN_ITEM: $show = item_admin(); break; case CST_ADMIN_DOMAIN_PLUGINS: $show = plugins_admin(); break; case CST_ADMIN_DOMAIN_THEMES: $show = themes_admin(); break; case CST_ADMIN_DOMAIN_TAGS: $show = tags_admin(); break; case CST_ADMIN_DOMAIN_PLUGIN_OPTIONS: $show = plugin_options_admin(); break; case CST_ADMIN_DOMAIN_THEME_OPTIONS: $show = theme_options_admin(); break; default: break; } } if (array_key_exists(CST_ADMIN_VIEW, $_REQUEST) || isset($show)) { if (!isset($show)) { $show = $_REQUEST[CST_ADMIN_VIEW]; } switch ($show) { case CST_ADMIN_DOMAIN_CONFIG: config(); break; case CST_ADMIN_DOMAIN_CHANNEL: channels(); break; case CST_ADMIN_DOMAIN_FOLDER: folders(); break; case CST_ADMIN_DOMAIN_OPML: opml(); break; case CST_ADMIN_DOMAIN_NONE: break; case CST_ADMIN_DOMAIN_ITEM: items(); break; case CST_ADMIN_DOMAIN_SYSINFO: sysinfo(); break; case CST_ADMIN_DOMAIN_DASHBOARD: dashboard(); break; case CST_ADMIN_DOMAIN_PLUGINS: plugins(); break; case CST_ADMIN_DOMAIN_THEMES: themes(); break; case CST_ADMIN_DOMAIN_TAGS: tags(); break; case CST_ADMIN_DOMAIN_PLUGIN_OPTIONS: plugin_options(); break; case CST_ADMIN_DOMAIN_THEME_OPTIONS: theme_options(); break; default: } } else { if (true == getConfig('rss.config.defaultdashboard')) { dashboard(); } else { channels(); } } echo "\n<div class=\"clearer\"></div>\n"; } else { rss_error(sprintf(__('<h1>Not Authorized!</h1>You are not authorized to access the administration interface. Please follow <a href="%s">this link</a> back to the main page. Have a nice day!'), getPath()), RSS_ERROR_ERROR, true); } echo "</div>\n"; }
$lang = language($config['language']); if (!is_array($lang)) { // Default language $lang = language('en'); } } else { $lang = language('en'); } // Functions to include $functions = array('common', 'validation', 'hooks', 'user', 'forum', 'admin'); // Include the functions foreach ($functions as $file) { include "include/functions/{$file}.php"; } // Fetch plugins $plugins = plugins(); // Fetch loaded plugins $result = mysql_query("SELECT * FROM `plugins`"); // Load plugins if (mysql_num_rows($result) >= 1) { while ($loading = mysql_fetch_array($result)) { foreach ($plugins as $plugin) { // don't even think of loading error'd plugins if ($plugin['error']) { continue; } if (!isset($plugin['name'])) { continue; } if ($loading['name'] == $plugin['plugin']) { // Load the plugin
include txpath . '/publish/taghandlers.php'; include txpath . '/publish/log.php'; include txpath . '/publish/comment.php'; ob_start(); // start the clock for runtime $microstart = getmicrotime(); // check the size of the url request bombShelter(); // get all prefs as an array $prefs = get_prefs(); $prefs['path_from_root'] = !$prefs['path_from_root'] ? '/' : $prefs['path_from_root']; // add prefs to globals extract($prefs); if ($txpac['use_plugins']) { // get plugins, write to a temp file, include, then destroy plugins(); } define("LANG", $language); $textarray = load_lang('en-gb'); $s = empty($s) ? '' : $s; $pretext = pretext($s, $prefs); extract($pretext); if (gps('parentid') && gps('submit')) { saveComment(); } elseif (gps('parentid') and $comments_mode == 1) { // popup comments? exit(popComments(gps('parentid'))); } if (!isset($nolog)) { if ($logging == 'all') { logit();
function plugin_options() { if (!array_key_exists('plugin_name', $_REQUEST) || array_key_exists('admin_plugin_options_cancel_changes', $_REQUEST)) { plugins(); return; } // TBD $plugin_filename = $_REQUEST['plugin_name']; $plugin_filename = str_replace("%2F", "/", $plugin_filename); $plugin_output = ""; if (preg_match('/([a-zA-Z0-9_\\/\\-]+).php/', $plugin_filename, $matches)) { $plugin_filename = $matches[1] . ".php"; // sanitize input $plugin_info = getPluginInfo($plugin_filename); if ($plugin_info && array_key_exists('configuration', $plugin_info)) { $plugin_config_func = $plugin_info['configuration']; ob_start(); rss_load_plugin($plugin_filename); if (function_exists($plugin_config_func)) { call_user_func($plugin_config_func); // Are you happy now? $plugin_output = ob_get_contents(); } ob_end_clean(); rss_invalidate_cache(); } if ($plugin_output) { // Let us set up a form echo "<h2\n class=\"trigger\">" . __('Plugin Options') . " " . TITLE_SEP . " " . $plugin_info['name'] . "</h2>\n" . "<div id=\"admin_plugin_options\">\n"; echo "<form method=\"post\" action=\"" . $_SERVER['PHP_SELF'] . "\">\n"; echo "<p><input type=\"hidden\" name=\"" . CST_ADMIN_DOMAIN . "\" value=\"" . CST_ADMIN_DOMAIN_PLUGIN_OPTIONS . "\" /></p>\n"; echo $plugin_output; echo "<p><input type=\"hidden\" name=\"plugin_name\" value=\"" . $plugin_filename . "\"/>\n"; echo "<p><input type=\"hidden\" name=\"" . CST_ADMIN_METAACTION . "\" value=\"ACT_ADMIN_SUBMIT_CHANGES\"/>\n"; echo "<input type=\"submit\" name=\"admin_plugin_options_submit_changes\" value=\"" . __('Submit Changes') . "\" />\n"; echo "<input type=\"submit\" name=\"admin_plugin_options_cancel_changes\"\n value=\"" . __('Cancel') . "\" /></p></form>\n"; echo "</div>"; } else { plugins(); } } }