• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    Como quitar el privilegio de loguear para ver contenido en mi web

    Compartir:

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 1.)

    zephiro

    zephiro
    Miembro
    Miembro
    Hola amigos de Tibia Face, hoy acudo a su apoyo para resolver este dilema...

    quisiera poder entrar a la sección de "buy char", de mi página sin tener que loguear. Fui al archivo de BuyChar.php y está el siguiente código, pero no logro quitar la liga de "if loggued" sinq ue me de error.

    El código es el siguiente, espero me pueda apoyar. Saludos!

    Código:
    <?PHP
    if($logged) {

    if ($action == '') {

    $main_content .= '<center>Here is the list of the current characters that are in the shop!</center>';
    $main_content .= '<BR>';
    $main_content .= '<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD CLASS=white width="64px"><CENTER><B>Name</B></CENTER></TD><TD CLASS=white width="64px"><CENTER><B>Vocation</B></CENTER></TD><TD CLASS=white width="64px"><CENTER><B>Level</B></CENTER></TD><TD CLASS=white width="64px"><CENTER><B>Price</B></CENTER></TD><TD CLASS=white width="64px"><CENTER><B>Buy it</B></CENTER></TD></TR>';
    $getall = $SQL->query('SELECT `id`, `name`, `price`, `status` FROM `sellchar` ORDER BY `id`')or die(mysql_error());
    foreach ($getall as $tt) {
    $namer = $tt['name'];
    $queryt = $SQL->query("SELECT `name`, `vocation`, `level` FROM `players` WHERE `name` = '$namer'");
    foreach ($queryt as $ty) {
    if ($ty['vocation'] == 1) {
    $tu = 'Sorcerer';
    } else if ($ty['vocation'] == 2) {
    $tu = 'Druid';
    } else if ($ty['vocation'] == 3) {
    $tu = 'Paladin';
    } else if ($ty['vocation'] == 4) {
    $tu = 'Knight';
    } else if ($ty['vocation'] == 5) {
    $tu = 'Sorcerer';
    } else if ($ty['vocation'] == 6) {
    $tu = 'Druid';
    } else if ($ty['vocation'] == 7) {
    $tu = 'Paladin';
    } else if ($ty['vocation'] == 8) {
    $tu = 'Knight';
    }
    $ee = $tt['name'];
    $ii = $tt['price'];
    $main_content .= '<TR BGCOLOR='.$config['site']['darkborder'].'><TD CLASS=black width="64px"><CENTER><B><a href="index.php?subtopic=characters&name='.$tt['name'].'">'.$tt['name'].'</a></B></CENTER></TD><TD CLASS=black width="64px"><CENTER><B>'.$tu.'</B></CENTER></TD><TD CLASS=black width="64px"><CENTER><B>'.$ty['level'].'</B></CENTER></TD><TD CLASS=black width="64px"><CENTER><B>'.$tt['price'].'</B></CENTER></TD><TD CLASS=black width="64px"><CENTER><B>
    <form action="?subtopic=buychar&action=buy" method="POST">
    <input type="hidden" name="char" value="'.$ee.'">
    <input type="hidden" name="price" value="'.$ii.'">
    <input type="submit" name="submit" value="Buy it"></B></CENTER></TD></TR></form>';
    }
    }
    $main_content .= '</TABLE>';

    }

    if ($action == 'buy') {

    $name = $_POST['char'];
    $price = $_POST['price'];
    $ceh = $SQL->query("SELECT `name` FROM `sellchar` WHERE `name` = '$name'");

    if ($ceh) {

    if ($name == '') {

    $main_content .= '<b><center>Select a character to buy first/b>';

    } else {

    $user_premium_points = $account_logged->getCustomField('premium_points');
    $user_id = $account_logged->getCustomField('id');

    if ($user_premium_points >= $price) {

    $check = $SQL->query("SELECT * FROM `sellchar` WHERE `name` = '$name'") or die(mysql_error());
    $check1 = $SQL->query("SELECT * FROM `players` WHERE `name` = '$name'") or die(mysql_error());
    $check2 = $SQL->query("SELECT `oldid` FROM `sellchar` WHERE `name` = '$name'");
    foreach ($check as $result) {
    foreach($check1 as $res) {
    foreach($check2 as $ress) {

    $oid = $ress['oldid'];
    $main_content .= '<center>You bought<b> '.$name.' ( '.$res['level'].' ) </b>for <b>'.$result['price'].' points.</b><br></center>';
    $main_content .= '<br>';
    $main_content .= '<center><b>The character is in your account, have fun!</b></center>';
    $execute1 = $SQL->query("UPDATE `accounts` SET `premium_points` = `premium_points` - '$price' WHERE `id` = '$user_id'");
    $execute2 = $SQL->query("UPDATE `players` SET `account_id` = '$user_id' WHERE `name` = '$name'");
    $execute2 = $SQL->query("UPDATE `accounts` SET `premium_points` = `premium_points` + '$price' WHERE `id` = '$oid'");
    $execute3 = $SQL->query("DELETE FROM `sellchar` WHERE `name` = '$name'");

    }
    }
    }

    } else {

    $main_content .= '<center><b>You dont have enought premium points</b></center>';

    }

    }

    } else {
    $main_content .= '<center><b>Character cannot be buyed</b></center>';
    }
    }

    } else {

    $main_content .= '<center>Please log in first!</center>';
    }
    ?>

    2 participantes
    https://www.youtube.com/channel/UCN7LXy4Jk7x8qiYA4ohvIeg?view_as

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    prueba

    Código:

    <?PHP


    if ($action == '') {

    $main_content .= '<center>Here is the list of the current characters that are in the shop!</center>';
    $main_content .= '<BR>';
    $main_content .= '<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD CLASS=white width="64px"><CENTER><B>Name</B></CENTER></TD><TD CLASS=white width="64px"><CENTER><B>Vocation</B></CENTER></TD><TD CLASS=white width="64px"><CENTER><B>Level</B></CENTER></TD><TD CLASS=white width="64px"><CENTER><B>Price</B></CENTER></TD><TD CLASS=white width="64px"><CENTER><B>Buy it</B></CENTER></TD></TR>';
    $getall = $SQL->query('SELECT `id`, `name`, `price`, `status` FROM `sellchar` ORDER BY `id`')or die(mysql_error());
    foreach ($getall as $tt) {
    $namer = $tt['name'];
    $queryt = $SQL->query("SELECT `name`, `vocation`, `level` FROM `players` WHERE `name` = '$namer'");
    foreach ($queryt as $ty) {
    if ($ty['vocation'] == 1) {
    $tu = 'Sorcerer';
    } else if ($ty['vocation'] == 2) {
    $tu = 'Druid';
    } else if ($ty['vocation'] == 3) {
    $tu = 'Paladin';
    } else if ($ty['vocation'] == 4) {
    $tu = 'Knight';
    } else if ($ty['vocation'] == 5) {
    $tu = 'Sorcerer';
    } else if ($ty['vocation'] == 6) {
    $tu = 'Druid';
    } else if ($ty['vocation'] == 7) {
    $tu = 'Paladin';
    } else if ($ty['vocation'] == 8) {
    $tu = 'Knight';
    }
    $ee = $tt['name'];
    $ii = $tt['price'];
    $main_content .= '<TR BGCOLOR='.$config['site']['darkborder'].'><TD CLASS=black width="64px"><CENTER><B><a href="index.php?subtopic=characters&name='.$tt['name'].'">'.$tt['name'].'</a></B></CENTER></TD><TD CLASS=black width="64px"><CENTER><B>'.$tu.'</B></CENTER></TD><TD CLASS=black width="64px"><CENTER><B>'.$ty['level'].'</B></CENTER></TD><TD CLASS=black width="64px"><CENTER><B>'.$tt['price'].'</B></CENTER></TD><TD CLASS=black width="64px"><CENTER><B>
    <form action="?subtopic=buychar&action=buy" method="POST">
    <input type="hidden" name="char" value="'.$ee.'">
    <input type="hidden" name="price" value="'.$ii.'">
    <input type="submit" name="submit" value="Buy it"></B></CENTER></TD></TR></form>';
    }
    }
    $main_content .= '</TABLE>';

    }

    if ($action == 'buy') {

    $name = $_POST['char'];
    $price = $_POST['price'];
    $ceh = $SQL->query("SELECT `name` FROM `sellchar` WHERE `name` = '$name'");

    if ($ceh) {

    if ($name == '') {

    $main_content .= '<b><center>Select a character to buy first/b>';

    } else {

    $user_premium_points = $account_logged->getCustomField('premium_points');
    $user_id = $account_logged->getCustomField('id');

    if ($user_premium_points >= $price) {

    $check = $SQL->query("SELECT * FROM `sellchar` WHERE `name` = '$name'") or die(mysql_error());
    $check1 = $SQL->query("SELECT * FROM `players` WHERE `name` = '$name'") or die(mysql_error());
    $check2 = $SQL->query("SELECT `oldid` FROM `sellchar` WHERE `name` = '$name'");
    foreach ($check as $result) {
    foreach($check1 as $res) {
    foreach($check2 as $ress) {

    $oid = $ress['oldid'];
    $main_content .= '<center>You bought<b> '.$name.' ( '.$res['level'].' ) </b>for <b>'.$result['price'].' points.</b><br></center>';
    $main_content .= '<br>';
    $main_content .= '<center><b>The character is in your account, have fun!</b></center>';
    $execute1 = $SQL->query("UPDATE `accounts` SET `premium_points` = `premium_points` - '$price' WHERE `id` = '$user_id'");
    $execute2 = $SQL->query("UPDATE `players` SET `account_id` = '$user_id' WHERE `name` = '$name'");
    $execute2 = $SQL->query("UPDATE `accounts` SET `premium_points` = `premium_points` + '$price' WHERE `id` = '$oid'");
    $execute3 = $SQL->query("DELETE FROM `sellchar` WHERE `name` = '$name'");

    }
    }
    }

    } else {

    $main_content .= '<center><b>You dont have enought premium points</b></center>';

    }

    }

    } else {
    $main_content .= '<center><b>Character cannot be buyed</b></center>';
    }
    }


    ?>



    Como quitar el privilegio de loguear para ver contenido en mi web YNU5B25
    2 participantes
    http://www.tibiaface.com

    zephiro

    zephiro
    Miembro
    Miembro
    Very Happy Resuelto Gracias Very Happy

    2 participantes
    https://www.youtube.com/channel/UCN7LXy4Jk7x8qiYA4ohvIeg?view_as

    Contenido patrocinado


    2 participantes

    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 1.)

    Permisos de este foro:
    No puedes responder a temas en este foro.

     

    BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).