コード例 #1
0
// get current versions
define('_VERSION', @trim(getDataFromFile(_FILE_VERSION)));
// Array of 'page ids' => 'page titles'
$defaultTitle = "Home Page - A BitTorrent and Internet Transfer Web Control Application";
$pages = array("requirements" => "Installation and Configuration Requirements", "features" => "Features List", "news" => "News and Updates", "about" => "Authors, History and Contributors", "changelog" => "Changelog", "screenshots" => "Screenshots", "home" => $defaultTitle);
// init page-var
if (isset($_REQUEST["s"]) && !empty($_REQUEST["s"])) {
    $page = $_REQUEST["s"];
    // Check we have the requested page:
    if (!array_key_exists($page, $pages)) {
        $page = "home";
    }
} else {
    $page = "home";
}
printPageHead($page);
// Evaluate the page function to be exec'ed - ie 'printPageHome();' etc:
eval("printPage" . ucfirst($page) . "();");
printPageFoot();
// exit
exit;
// -----------------------------------------------------------------------------
// content
// -----------------------------------------------------------------------------
/**
 * prints page-head
 * @var $page - current page requested
 */
function printPageHead($page)
{
    global $pages, $css;
コード例 #2
0
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 GNU General Public License for more details.

 To read the license please visit http://www.gnu.org/copyleft/gpl.html

*******************************************************************************/
// functions
require_once '../functions.php';
// -----------------------------------------------------------------------------
// Main
// -----------------------------------------------------------------------------
// print page head
printPageHead();
// proxy-stats
echo "<h2>superadmin</h2>";
require_once 'dbconf.php';
$db = mysql_connect($db_host, $db_user, $db_pass) or die('connect failed: ' . mysql_error());
if (!isset($db)) {
    echo '<font color="red">Error connecting to database.</font>';
} else {
    mysql_select_db($db_name, $db) or die('select db failed: ' . mysql_error());
    echo '<table border="1">';
    // torrentflux-b4rt
    $result = mysql_query("SELECT SUM(ct) FROM tfb4rt_proxystats WHERE ua LIKE '%torrentflux-b4rt%'", $db);
    $row = mysql_fetch_row($result);
    $ct = $row[0];
    mysql_free_result($result);
    echo "<tr><td>torrentflux-b4rt</td><td>" . $ct . "</td></tr>";