function init()
{
    global $site;
    global $connection;
    require_once dirname(dirname(__FILE__)) . '/siteinfo.php';
    $site = new siteinfo();
    $connection = $site->connect_to_db();
}
Exemple #2
0
<?php

// this is plain text!
header('Content-Type: text/plain');
require realpath('../CMS/siteinfo.php');
$site = new siteinfo();
$connection = $site->connect_to_db();
// display teams
$query = 'SELECT `teams`.`id`,`teams`.`name` FROM `teams`,`teams_overview`' . ' WHERE `teams_overview`.`teamid`=`teams`.`id` AND `teams_overview`.`deleted`<>' . sqlSafeStringQuotes(2);
if (!($result = @$site->execute_silent_query('teams,teams_overview', $query, $connection))) {
    $site->dieAndEndPage('It seems like the team profile can not be accessed for an unknown reason.');
}
while ($row = mysql_fetch_array($result)) {
    echo 'TE: ' . $row['id'] . ', ' . htmlent_decode($row['name']) . "\n";
}
mysql_free_result($result);
$query = 'SELECT `id`,`teamid`,`name` FROM `users`' . ' WHERE `users`.`status`=' . sqlSafeStringQuotes('active');
if (!($result = @$site->execute_silent_query('users', $query, $connection))) {
    $site->dieAndEndPage('It seems like the player profile can not be accessed for an unknown reason.');
}
while ($row = mysql_fetch_array($result)) {
    echo 'PL: ' . $row['teamid'] . ', ' . $row['id'] . ', ' . htmlent_decode($row['name']) . "\n";
}
mysql_free_result($result);
// done with outputting stats
<?php

set_time_limit(0);
ini_set('session.use_trans_sid', 0);
ini_set('session.name', 'SID');
ini_set('session.gc_maxlifetime', '7200');
@session_start();
$display_page_title = 'BBCode libary updater';
require_once dirname(dirname(__FILE__)) . '/web/CMS/index.inc';
if (!isset($site)) {
    require_once dirname(dirname(__FILE__)) . '/web/CMS/siteinfo.php';
    $site = new siteinfo();
}
if (!isset($connection)) {
    $connection = $site->connect_to_db();
}
$randomkey_name = 'randomkey_user';
$viewerid = intval(getUserID());
if ($viewerid < 1) {
    echo '<p class="first_p">You need to be logged in to update the old bbcode entries.</p>';
    $site->dieAndEndPage();
}
if (!isset($_SESSION['IsAdmin']) || !$_SESSION['IsAdmin']) {
    $site->dieAndEndPage('User with id ' . sqlSafeStringQuotes($viewerid) . ' tried to run the bbcode library updater script without permissions.');
}
$db_from = new db_import();
$db_to_be_imported = $db_from->db_import_name();
// this script will update all entries in the database that are including any fields that could be created by using a bbcode library
// it does not detect if the old entries were created by using raw (X)HTML, instead it will just output these entries using the bbcode lib
// the strong recommendation is to always use a bbcode library
// players
<?php

set_time_limit(0);
ini_set('session.use_trans_sid', 0);
ini_set('session.name', 'SID');
ini_set('session.gc_maxlifetime', '7200');
@session_start();
$display_page_title = 'Webleague DB importer';
require_once dirname(dirname(__FILE__)) . '/web/CMS/index.inc';
if (!isset($site)) {
    require_once dirname(dirname(__FILE__)) . '/web/CMS/siteinfo.php';
    $site = new siteinfo();
}
$connection = $site->connect_to_db();
$randomkey_name = 'randomkey_user';
$viewerid = (int) getUserID();
if ($viewerid < 1) {
    if (!(php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR']))) {
        echo '<p class="first_p">You need to be logged in to update the old bbcode entries.</p>';
        $site->dieAndEndPage();
    }
} elseif (!isset($_SESSION['IsAdmin']) || !$_SESSION['IsAdmin']) {
    $site->dieAndEndPage('User with id ' . sqlSafeStringQuotes($viewerid) . ' tried to run the webleague importer script without permissions.');
}
$db_from = new db_import();
$db_to_be_imported = $db_from->db_import_name();
//	this code does not work because the order of statements in the dump
//	cause the relations in the final database being violated
//	$file = dirname(__FILE__) . '/ts-CMS_structure.sql';
//	if (file_exists($file) && is_readable($file))
//	{
Exemple #5
0
<?php

ini_set('session.use_trans_sid', 0);
ini_set('session.name', 'SID');
ini_set('session.gc_maxlifetime', '7200');
@session_start();
$display_page_title = 'Visits log';
require_once dirname(dirname(__FILE__)) . '/CMS/index.inc';
$site = new siteinfo();
$connection = $site->connect_to_db();
$randomkey_name = 'randomkey_user';
$viewerid = (int) getUserID();
$allow_view_user_visits = false;
if (isset($_SESSION['allow_view_user_visits'])) {
    if ($_SESSION['allow_view_user_visits'] === true) {
        $allow_view_user_visits = true;
    }
}
// in any case you need to be logged in to view the visits log
if ($viewerid === 0) {
    echo '<p class="first_p">You need to login in order to view the visits log!</p>';
    $site->dieAndEndPageNoBox();
}
// only allow looking when having the permission
if ($allow_view_user_visits === false) {
    $site->dieAndEndPageNoBox('You (id=' . sqlSafeString($viewerid) . ') have no permissions to view the visits log!');
}
// form letting search for ip-address, host or name
// this form is considered not to be dangerous, thus no key checking at all and also using the get method
echo "\n" . '<form enctype="application/x-www-form-urlencoded" method="get" action="./" class="search_bar">' . "\n";
// input string
Exemple #6
0
<?php

ini_set('session.use_trans_sid', 0);
ini_set('session.name', 'SID');
ini_set('allow_url_fopen', 0);
ini_set('session.gc_maxlifetime', '7200');
session_start();
require_once '../CMS/siteinfo.php';
$site = new siteinfo();
$display_page_title = 'Official match servers';
require '../CMS/index.inc';
echo '<div class="static_page_box">' . "\n";
if (!($logged_in && isset($_SESSION['allow_watch_servertracker']) && $_SESSION['allow_watch_servertracker'])) {
    echo '<p>You need to be logged in in order to view this page.</p>' . "\n";
    $site->dieAndEndPage();
}
$use_internal_db = true;
require 'list.php';
$connection = $site->loudless_pconnect_to_db();
if (isset($_GET['server'])) {
    echo '<a class="button" href="./">overview</a>' . "\n";
    $server = urldecode($_GET['server']);
    formatbzfquery_last($server, $connection);
} else {
    formatbzfquery("bzbattleground.com:5157", $connection);
    formatbzfquery("bzbattleground.com:5158", $connection);
    formatbzfquery("bzf.guleague.org:5154", $connection);
    formatbzfquery("bzf.guleague.org:5155", $connection);
    formatbzfquery("bzf.guleague.org:5156", $connection);
    formatbzfquery("bzf.guleague.org:5160", $connection);
    formatbzfquery("bzf.guleague.org:5161", $connection);
Exemple #7
0
{
    echo '<li>';
    if (!$current) {
        echo '<a href="' . (BASEPATH . $folder) . '">';
    } elseif (count($_GET) > 0) {
        echo '<a class="current_nav_entry" href="' . (BASEPATH . $folder) . '">';
    }
    echo $title;
    if (!$current || count($_GET) > 0) {
        echo '</a>';
    }
    echo '</li>' . "\n";
}
if (!isset($site)) {
    require_once 'CMS/siteinfo.php';
    $site = new siteinfo();
}
function useTemplate($file)
{
    echo $file;
    echo ' use!';
}
// use the template
// we're done if a template is used
$stylePath = dirname(dirname(__FILE__)) . '/themes/' . $site->getStyle();
if (file_exists($stylePath . $site->base_name())) {
    useTemplate($stylePath . $site->base_name());
    die;
} elseif (file_exists($stylePath . '/html.template')) {
    useTemplate($stylePath . '/html.template');
    die;
Exemple #8
0
ini_set('session.gc_maxlifetime', '7200');
@session_start();
$path = pathinfo(realpath('./'));
$name = $path['basename'];
$display_page_title = $name;
require_once dirname(dirname(__FILE__)) . '/CMS/index.inc';
function show_overview_and_profile_button()
{
    global $profile;
    echo '<a class="button" href="./">overview</a>' . "\n";
    if (!isset($_GET['profile'])) {
        echo '<a class="button" href="./?profile=' . strval($profile) . '">back to user profile</a>' . "\n";
    }
}
if (!isset($site)) {
    $site = new siteinfo();
}
$connection = $site->connect_to_db();
$randomkey_name = 'randomkey_user';
$viewerid = (int) getUserID();
$allow_edit_any_user_profile = false;
if (isset($_GET['profile']) || isset($_GET['edit']) || isset($_GET['invite'])) {
    if (isset($_SESSION['allow_edit_any_user_profile'])) {
        if ($_SESSION['allow_edit_any_user_profile'] === true) {
            $allow_edit_any_user_profile = true;
        }
    }
}
$allow_add_admin_comments_to_user_profile = false;
if (isset($_GET['profile']) || isset($_GET['edit'])) {
    if (isset($_SESSION['allow_add_admin_comments_to_user_profile'])) {