function adminPagePlugins() { global $debugMode, $optionValue, $config, $lang, $authors, $authorsEmail; global $theme_main, $SHP; $theme_main['content'] = ""; $theme_main['content'] .= '<h3>' . $lang['pagePlugins'] . '</h3>'; $theme_main['content'] .= adminPageTabs(); if (isset($_SESSION['logged_in']) && $_SESSION['logged_in'] && isset($_SESSION['isAdmin']) && $_SESSION['isAdmin']) { $msgclass = "hide"; $msgtext = ""; if (isset($_POST['notfirst'])) { $msgtext = $lang['msgConfigSaved']; $msgclass = "success"; } $theme_main['content'] .= "<div class='{$msgclass}'>{$msgtext}</div>"; $theme_main['content'] .= '<br><form method="post" action="' . $config['blogPath'] . $config['cleanIndex'] . '/adminPluginsSubmit">'; $theme_main['content'] .= '<table>'; $theme_main['content'] .= '<tr><th>Active</th><th>Plugin</th><th>Author</th><th>Description</th></tr>'; $plugin_folder = './plugins/'; list_plugins($plugin_folder); $theme_main['content'] .= '</table>'; $theme_main['content'] .= '<input type="hidden" id="notfirst" name="notfirst" value="notfirst">'; $theme_main['content'] .= '<br><input type="submit" id="submit" name="submit" value="' . $lang['pageAdvancedConfigSubmit'] . '">'; $theme_main['content'] .= '</form>'; } else { $theme_main['content'] .= $lang['errorPasswordIncorrect'] . ' .. <br/>'; } }
} if (!file_exists("plugins") && !is_dir("plugins")) { echo "<h1><center>PLUGINS folder not found ! </center></h1>"; die; } echo "<form method=POST>"; if (!isset($_REQUEST['lyrics'])) { ?> <br><center> <h1> Lyrics Finder </h1> <br> <b>Engine = </b> <select name=plugins> <?php foreach (list_plugins() as $option) { $rename = rename_plugins($option); // rename to replace plugins name with another character echo "<option value=\"" . $rename . "\">" . $rename . "</option>"; } ?> </select> </center> <?php } // If admin/user enable curl, so this section will show if (isset($curl) && $curl == "TRUE" && !isset($_REQUEST['lyrics']) && !isset($_POST['lagu'])) { echo "<br><center><b> Curl Status : </b><font color='red'>" . curl_status($curl) . "</font></center>"; } // If user select his lyrics from list in search, this section will start if (isset($_REQUEST['lyrics']) && !empty($_REQUEST['lyrics'])) {
} } $out = ob_get_contents(); ob_end_clean(); if (!empty($out)) { print $out; print "[m"; } } function is_git_url($url) { return substr($url, -4) == ".git" || substr($url, 4) == 'git@'; } switch ($cmd) { case 'list': list_plugins(); break; case 'clean': clean(); break; case 'reload': reload(); break; case 'install': install($argv[2]); break; case 'uninstall': uninstall($argv[2]); break; case 'enable': enable($argv[2]);
function plugin_install() { if (ps('theplugin')) { include $_FILES['theplugin']['tmp_name']; } else { $plugin = ps('plugin'); } if (isset($plugin)) { if ($plugin = @unserialize(@base64_decode($plugin))) { if (is_array($plugin)) { extract(doSlash($plugin)); $exists = fetch('name', 'txp_plugin', 'name', $name); if ($exists) { $rs = safe_update("txp_plugin", "status = 0,\n\t\t\t\t\t\t\tauthor = '{$author}',\n\t\t\t\t\t\t\tauthor_uri = '{$author_uri}',\n\t\t\t\t\t\t\tversion = '{$version}',\n\t\t\t\t\t\t\tdescription = '{$description}',\n\t\t\t\t\t\t\thelp = '{$help}',\n\t\t\t\t\t\t\tcode = '{$code}',\n\t\t\t\t\t\t\tcode_restore = '{$code}',\n\t\t\t\t\t\t\tcode_md5 = '{$md5}'", "name = '{$name}'"); } else { $rs = safe_insert("txp_plugin", "name = '{$name}',\n\t\t\t\t\t\t\tstatus = 0,\n\t\t\t\t\t\t\tauthor = '{$author}',\n\t\t\t\t\t\t\tauthor_uri = '{$author_uri}',\n\t\t\t\t\t\t\tversion = '{$version}',\n\t\t\t\t\t\t\tdescription = '{$description}',\n\t\t\t\t\t\t\thelp = '{$help}',\n\t\t\t\t\t\t\tcode = '{$code}',\n\t\t\t\t\t\t\tcode_restore = '{$code}',\n\t\t\t\t\t\t\tcode_md5 = '{$md5}'"); } if ($rs and $code) { list_plugins(messenger('plugin', $name, 'installed')); } else { list_plugins('plugin install failed'); } } } else { list_plugins(gTxt('bad_plugin_code')); } } }