Esempio n. 1
0
function nowa($oUser, $do, $tekst)
{
    $do = ut($do);
    $tekst = ut($tekst);
    $jest = mysql_fetch_array(mysql_query("select user from users where '" . $do . "' = login limit 1"));
    if (empty($jest)) {
        return "<p class='error'>nie ma takiego usera</p>";
    } else {
        mysql_query("\n\t\tinsert into poczta2 (od, do, typ, tresc, data) values\n\t\t(" . $oUser['user'] . "," . $jest['user'] . ", 1, '" . $tekst . "', " . time() . "),\n\t\t(" . $oUser['user'] . "," . $jest['user'] . ", 2, '" . $tekst . "', " . time() . ")\n\t\t");
        return "<p class='note'>wysłano wiadomość</p>";
    }
}
Esempio n. 2
0
function zmien_email($mail, $user)
{
    if ($mail == $user['email']) {
        return "<p class='error'>wpisz nową nazwę</p>";
    }
    $mail = ut($mail);
    mysql_query("update users set email = '" . $mail . "' where user = "******"<p class='note'>zmieniono adres email</p>";
    } else {
        return "<p class='error'>nie zmieniono adresu email, nieokreślony błąd</p>";
    }
}
Esempio n. 3
0
function zmien_email($mail, $gracz)
{
    if ($mail == $gracz['email']) {
        return "<p class='error'>wpisz nową nazwę</p>";
    }
    $mail = ut($mail);
    mysql_query("update gamecms_gracze set email = '" . $mail . "' where gracz = " . $gracz['gracz']);
    if (mysql_affected_rows() == 1) {
        return "<p class='note'>zmieniono adres email</p>";
    } else {
        return "<p class='error'>nie zmieniono adresu email, nieokreślony błąd</p>";
    }
}
Esempio n. 4
0
                        header('location: index.php');
                    }
                }
            }
            $act = "\n\t\t\t<tr>\n\t\t\t\t<th colspan='3' style='text-align:left'>\n\t\t\t\t\t<a href='index.php?del=" . $sekcja['sekcja'] . "' onclick='return confirm(\"na pewno usunąć ten dział?\")'>\n\t\t\t\t\t[ usuń ]\n\t\t\t\t\t</a>\n\t\t\t\t</th>\n\t\t\t</tr>\n\n\t\t\t";
        }
        $sekcja['nazwa'] = htmlspecialchars($sekcja['nazwa']);
        echo "\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t\n\t\t\t\t<h3><a href='sekcja.php?s=" . $sekcja['nazwa'] . "'>\n\t\t\t\t" . $sekcja['nazwa'] . "\n\t\t\t\t</a></h3>\n\t\t\t\t" . $sekcja['opis'] . "\n\t\t\t</td>\n\t\t\t<td class='count'>" . $sekcja['tematow'] . "</td>\n\t\t\t<td class='count'>" . $sekcja['postow'] . "</td>\n\t\t</tr>\n\t\t" . $act . "\n\t\t";
    }
    echo "</table>";
}
echo "</div>";
if ($oGracz[$Trola] == 3) {
    if (!empty($_POST['dzial'])) {
        //jeżeli chcesz dopuścić kod HTML w ustawieniach działu to użyj funkcji at() zamiast ut()
        $nazwa = ut($_POST['dzial']);
        $opis = '';
        if (!empty($_POST['opis'])) {
            $opis = ut($_POST['opis']);
        }
        $kolejka = 1;
        if (!empty($_POST['kolejka'])) {
            $kolejka = (int) $kolejka;
        }
        mysql_query("insert into " . $prefix . "sekcje (nazwa,opis, kolejnosc) value ('" . $nazwa . "','" . $opis . "'," . $kolejka . ")");
        header('location: index.php');
    }
    echo "<hr/>\n\t<div class='forum'>\n\t\n\t<form action='index.php' method='post'>\n\t<p>\n\tNazwa nowego działu: <input type='text' name='dzial' style='width:100%'>\n\t<br/>\n\t<textarea name='opis' style='width:100%; height:50px;'></textarea>\n\tKolejność <input type='text' name='kolejka' value='1'>\n\t<br/>\n\t<input type='submit' value='dodaj dział'/>\n\t</p>\n\t</from>\n\t\n\t</div>";
}
require 'var/footer.php';
ob_end_flush();
Esempio n. 5
0
<?php 
if (!empty($_POST)) {
    if (!empty($_POST['login']) && !empty($_POST['pass']) && !empty($_POST['pass2']) && $_POST['pass'] == $_POST['pass2'] && !empty($_POST['mail'])) {
        $_POST['login'] = ut($_POST['login']);
        $_POST['pass'] = md5($_POST['pass']);
        $_POST['mail'] = ut($_POST['mail']);
        $jest = mysql_num_rows(mysql_query("select * from gamecms_gracze where login = '******'login'] . "' or email =  '" . $_POST['mail'] . "' limit 1"));
        if ($jest > 0) {
            echo "<p class='error'> taki login/email jest już zajęty</p>";
        } else {
            mysql_query("insert into gamecms_gracze(login, haslo, email) value ('" . $_POST['login'] . "','" . $_POST['pass'] . "', '" . $_POST['mail'] . "')");
            $id = mysql_insert_id();
            if (empty($id)) {
                echo '<p class="error">nieoczekiwany błąd, spróbuj ponownie</p>';
            } else {
                echo '<p class="note">zarejestrowano nowego użytkownika</p>';
            }
        }
    } else {
        echo '<p class="error">wypełnij wszystkie pola poprawnie</p>';
    }
}
?>
										
<form action='?a=rejestracja' method='post'>
	<table style='width:500px'>
	<tr>
		<td style='width:100px'>login [5-15]:</td>
		<td><input type='text'  name='login' value='<?php 
echo $_POST['login'];
Esempio n. 6
0
    $msg = $ClanMgr->decline($config, $player, $_GET['decline']);
    echo $msg;
}
if (!empty($_GET['drop'])) {
    require_once 'functions/ClanMgr.php';
    $ClanMgr = new ClanMgr();
    $msg = $ClanMgr->drop($config, $player, $_GET['drop']);
}
if (!empty($_GET['run'])) {
    require_once 'functions/ClanMgr.php';
    $ClanMgr = new ClanMgr();
    $msg = $ClanMgr->run($config, $player);
    echo $msg;
}
if (!empty($_POST['opis']) && $status == 2) {
    $_POST['opis'] = ut($_POST['opis']);
    mysql_query("update clans set opis = '" . $_POST['opis'] . "' where c_id = " . $player->clan_id);
    if (mysql_affected_rows() == 0) {
        $msg = "błąd zmiany opisu, spróbuj ponownie";
    } else {
        $msg = "zmieniono opis";
        $player = getUser($config);
    }
} elseif (!empty($_FILES['avatar']) && $status == 2) {
    if (is_uploaded_file($_FILES['avatar']['tmp_name'])) {
        move_uploaded_file($_FILES['avatar']['tmp_name'], "herb/" . $player->clan_id . ".jpg");
        mysql_query("update clans set herb = 1  where c_id = " . $player->clan_id);
        $msg = "zmieniono herb klanu";
        $player = getUser($config);
    } else {
        $msg = "błąd wgrywania obrazka, prawdopodobnie obrazek jest za duży";
Esempio n. 7
0
<?php

ob_start();
require 'var/ustawienia.php';
require 'var/header.php';
$info = md5($_GET['s']);
$sekcja = mysql_fetch_array(mysql_query("\nselect * from " . $prefix . "sekcje \nwhere md5(nazwa) = '" . $info . "' \nand statusS = 1 \nand rola <= " . $oGracz[$Trola] . " \nlimit 1\n"));
if (empty($sekcja)) {
    header('location: ' . $adres_forum);
}
echo "\n<a href='index.php'>Forum</a> | \n<a href='sekcja.php?s=" . $sekcja['nazwa'] . "'>" . $sekcja['nazwa'] . "</a>\n<hr/>\n";
echo "<div class='forum'>";
if ($sekcja['sekcja'] != -1) {
    if (!empty($_POST['tytul']) && !empty($_POST['tekst'])) {
        $tytul = ut($_POST['tytul']);
        $tekst = ut($_POST['tekst']);
        mysql_query("insert into " . $prefix . "tematy (sekcja_id, tytul) value (" . $sekcja['sekcja'] . ",'" . $tytul . "')");
        $nowy = mysql_insert_id();
        if (empty($nowy)) {
            echo "<h3>nieznany błąd dodania tematu</h3>";
        } else {
            mysql_query("insert into  " . $prefix . "posty (temat_id, tekst, data, kto) value (" . $nowy . ",'" . $tekst . "'," . time() . "," . $Suser . ")");
            $nowy2 = mysql_insert_id();
            if (empty($nowy2)) {
                echo "<h3>nieznany błąd dodania tematu</h3>";
                mysql_query("delete from " . $prefix . "tematy where temat = " . $nowy);
            } else {
                header('location: temat.php?t=' . $tytul);
            }
        }
    }
Esempio n. 8
0
<h3>Gildia najemników</h3><hr/><br/><br/>
Tawerna pełna jest przeróżnych typów, kobiet lekkich obyczajów, awanturników i osób z problemami. Miejsce te najczęściej nazywane jest po prostu Gildią najemników, bo wiadomo, że niezbyt trudno tu kogoś zwerbować.<br/>
Bardzo łatwo przekonasz każdego, by zaczęli pracować dla Ciebie. Każdy jednak wymaga jakiejś opłaty za swe usługi.<br/><br/>
Dawno już przyjęła się nawet pewna stawka, którą wszyscy akceptują.<br/><br/>
<?php 
if (empty($oUser['login'])) {
    header('location: index.php');
}
if (!empty($_POST['nazwa'])) {
    if ($oUser['zloto'] < 1000) {
        echo "<p class='error'>Masz za mało złota</p>";
    } else {
        $_POST['nazwa'] = ut($_POST['nazwa']);
        $_POST['nazwa'] = str_replace(" ", "", $_POST['nazwa']);
        if (empty($_POST['nazwa']) || strlen($_POST['nazwa']) < 5) {
            echo "<p class='error'>Błędna nazwa zabójcy</p>";
        } else {
            $jest = mysql_num_rows(mysql_query("select * from gladiator where md5(nazwa) = '" . md5($_POST['nazwa']) . "' limit 1"));
            if ($jest > 0) {
                echo "<p class='error'>Ten zabójca już dla kogoś pracuje</p>";
            } else {
                $rand = rand(1, 10);
                if ($rand > 2) {
                    mysql_query("update users set zloto = zloto - 1000 where user = "******"insert into gladiator(userID, nazwa) value (" . $oUser['user'] . ",'" . $_POST['nazwa'] . "')");
                    echo "<p class='note'>Zwerbowałeś zabójcę</p>";
                } else {
                    $rand = rand(1, 100);
                    mysql_query("update users set zloto = zloto - {$rand} where user = " . $oUser['user']);
                    $oUser['zloto'] -= $rand;
Esempio n. 9
0
    if (!empty($sesja) && is_numeric($sesja)) {
        $gracz = mysql_fetch_array(mysql_query("select * from gracze where gracz = " . $sesja));
    }
    if (empty($gracz)) {
        $gracz['rola'] = 0;
    }
    return $gracz;
}
/* funkcje pomocnicze koniec */
/* sesja start */
session_start();
$oGracz = gracz($_SESSION['gracz']);
/* sesja koniec */
if (empty($_GET['a'])) {
    $act = 'start';
} else {
    $act = $_GET['a'];
}
$act = ut($act);
$system = mysql_fetch_array(mysql_query("select * from system limit 1"));
$strona = mysql_fetch_array(mysql_query("select * from strony where akcja = '" . $act . "' limit 1"));
if (empty($strona)) {
    $echo = $system['brak_strony'];
} elseif ($strona['rola'] > $oGracz['rola']) {
    $echo = $system['brak_dostepu'];
} else {
    $echo = $strona['kod'];
}
eval($system['header'] . $echo . $system['footer']);
mysql_close();
ob_end_flush();
Esempio n. 10
0
<?php

if (!empty($_POST)) {
    if (!empty($_POST['login']) && !empty($_POST['pass'])) {
        $_POST['login'] = ut($_POST['login']);
        $_POST['pass'] = md5($_POST['pass']);
        $jest = mysql_fetch_assoc(mysql_query("select * from gamecms_gracze where login = '******'login'] . "' and haslo = '" . $_POST['pass'] . "' limit 1"));
        if (empty($jest)) {
            echo '<p class="error">wprowadzono nieprawidłowe dane</p>';
        } elseif ($jest['zbanowany'] == 1) {
            echo '<p class="error">ten gracz został zbanowany przez administrację</p>';
        } else {
            $_SESSION = array();
            $_SESSION['gracz'] = $jest['gracz'];
            header("location: ?a=konto");
        }
    } else {
        echo '<p class="error">wypełnij wszystkie pola poprawnie</p>';
    }
}
?>

	<form action='?a=logowanie' method='post'>
		<table>
		<tr>
			<td>login:</td>
			<td><input type='text'  name='login' /></td>
		</tr>
		<tr>
			<td>hasło:</td>
			<td><input type='password'  name='pass' /></td>