<?php

error_reporting(E_ALL);
include_once "config.php";
// including conecting info
if (isset($_GET['name'])) {
    include_once "core/class.character.php";
    $pl = new character();
    $pl->name = get_magic_quotes_gpc() ? urldecode($_GET["name"]) : urldecode(mysql_escape_string($_GET["name"]));
    if (!$pl->CharacterExists($pl->name)) {
        exit("Ошибка! Персонаж <b>" . $pl->name . "</b> не найден!");
    }
    /**
     * настраивать под себя
     * переменная $dir настраивается в конфиге
     **/
    $url = urldecode("http://" . $_SERVER['HTTP_HOST'] . $dir . $pl->name . "." . $config['img_type']);
    $urlm = urldecode("http://" . $_SERVER['HTTP_HOST'] . $dir . "mini/" . $pl->name . "." . $config['img_type']);
    $reset = "http://" . $_SERVER['HTTP_HOST'] . $dir;
    ?>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr><td>
<div align="center">
<img src="<?php 
    echo "ub.php?name=" . $pl->name;
    ?>
"><br />
<table>
<tr><td width="140px">Ссылка на бар:</td><td><input type="text" style="width:350px;text-align:center" value="<?php 
    echo $url;
    ?>