Ir para conteúdo

marley5

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Gostei
    marley5 deu reputação a ADMDestroyer em [Gesior] Retirar :8090 do Site método 100%   
    Bom Galera venho trazer pra vocês meu tutorial com um método infalivel de como tirar o :8090 do seu site,de forma facil e rapida,pois estava em busca e não achei respostas e nen tutoriais que resolvessem meu problema.






    Bom para começarmos você deve configurar seu site para a porta :8090




    Acesse a pasta do XamPP/apache/conf e abra o arquivo httpd com o bloco de notas.


    Procure por :

    Listen 80

    E por :

    ServerName localhost:80

    Substitua todos os 80 por 8090.

    Dentro da pasta conf, abra a pasta extra, e em seguida abra httpd-ssl e procure por :


    Listen 443

    E por:

    <virtualhost _default_:443="">

    Substitua esses 443 por 4499.

    Agora vá; em seu firewall e Adicione a Porta 8090 e Porta 80 e marca a opção TCP.

    Se usar Roteador, desbloqueie as portas no router tambem

    Agora reinicie o xampp e acesse seu Site http://localhost:8090/







    Feito Isso acesse no-ip.com crie sua conta caso não tenha uma




    Depois acesse sua conta e vá em ADD Host







    Agora em Hostname coloque um nome qualquer para que os player acessem seu site




    Ex: meuotserver.servegame.com




    Em Host Type selecione port 80 redirect




    em ip adreess não mecha




    em port coloque 8090




    Selecione a opção Mask URL




    em page title coloque o nome do seu servidor




    Depois desca e clique em create host








    Em seguida aguarde 5 minutos para o host atulizar e voce ja pode acessar seu site pelo hostname que voce criou



    exemplo.servegame.com






    E depois crie outro ip de acesso ao servidor pois voce nao conseguira acessar o servidor,pois vai dar conflito!



    Créditos




    100% ADM Destroyer por descobrir o método e trazer a vocês



    Caso poste em outro forum coloque os devidos crétidos

  2. Gostei
    marley5 deu reputação a Natanael Beckman em Trade OFF - Shop Offline   
    Esse sistema disponibiliza uma negociação offline, onde você oferta um item e esse item é divulgado no site do server e qualquer player pode comprar o item utilizando um comando especificado.
     
    Crie uma arquivo .lua dentro da pasta data/talkactions/scripts com o nome auctionsystem.lua, dentro do mesmo adicione o code:
    local config = {         levelRequiredToAdd = 20,         maxOffersPerPlayer = 5,         SendOffersOnlyInPZ = true,         blocked_items = {2165, 2152, 2148, 2160, 2166, 2167, 2168, 2169, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2343, 2433, 2640, 6132, 6300, 6301, 9932, 9933}         } function onSay(cid, words, param, channel)         if(param == '') then                 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")                 return true         end         local t = string.explode(param, ",")         if(t[1] == "add") then                 if((not t[2]) or (not t[3]) or (not t[4])) then                         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")                         return true                 end                 if(not tonumber(t[3]) or (not tonumber(t[4]))) then                         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't set valid price or items count.")                         return true                 end                 if(string.len(t[3]) > 7 or (string.len(t[4]) > 3)) then                         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This price or item count is too high.")                         return true                 end                 local item = getItemIdByName(t[2])                 if(not item) then                         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.")                         return true                 end                 if(getPlayerLevel(cid) < config.levelRequiredToAdd) then                         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have required (" .. config.levelRequiredToAdd .. ") level.")                         return true                 end                 if(isInArray(config.blocked_items, item)) then                         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This item is blocked.")                         return true                 end                 if(getPlayerItemCount(cid, item) < (tonumber(t[4]))) then                         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you don't have this item(s).")                         return true                 end                 local check = db.getResult("SELECT `id` FROM `auction_system` WHERE `player` = " .. getPlayerGUID(cid) .. ";")                 if(check:getID() == -1) then                 elseif(check:getRows(true) >= config.maxOffersPerPlayer) then                         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't add more offers (max. " .. config.maxOffersPerPlayer .. ")")                         return true                 end                 if(config.SendOffersOnlyInPZ) then                             if(not getTilePzInfo(getPlayerPosition(cid))) then                                 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you add offert to database.")                                 return true                         end                 end                 if(tonumber(t[4]) < 1 or (tonumber(t[3]) < 1)) then                         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to type a number higher than 0.")                         return true                 end                                 local itemcount, costgp = math.floor(t[4]), math.floor(t[3])                 doPlayerRemoveItem(cid, item, itemcount)                 db.executeQuery("INSERT INTO `auction_system` (`player`, `item_name`, `item_id`, `count`, `cost`, `date`) VALUES (" .. getPlayerGUID(cid) .. ", \"" .. t[2] .. "\", " .. getItemIdByName(t[2]) .. ", " .. itemcount .. ", " .. costgp ..", " .. os.time() .. ")")                                 doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You successfully add " .. itemcount .." " .. t[2] .." for " .. costgp .. " gps to offerts database.")         end         if(t[1] == "buy") then                 if(not tonumber(t[2])) then                         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")                         return true                 end                 local buy = db.getResult("SELECT * FROM `auction_system` WHERE `id` = " .. (tonumber(t[2])) .. ";")                 if(buy:getID() ~= -1) then                         if(getPlayerMoney(cid) < buy:getDataInt("cost")) then                                 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have enoguh GP.")                                 buy:free()                                 return true                         end                         if(getPlayerName(cid) == getPlayerNameByGUID(buy:getDataInt("player"))) then                                 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can't buy your own items.")                                 buy:free()                                 return true                         end                         if(getPlayerFreeCap(cid) < getItemWeightById(buy:getDataInt("item_id"), buy:getDataInt("count")))then                                 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You try to buy a " .. buy:getDataString("item_name") .. ". It weight " .. getItemWeightById(buy:getDataInt("item_id"), buy:getDataInt("count")) .. " cap oz. and you have only " .. getPlayerFreeCap(cid) .. " oz. free capacity. Put some items to depot and try again.")                                 buy:free()                                 return true                         end                         if(isItemStackable((buy:getDataString("item_id")))) then                                 doPlayerAddItem(cid, buy:getDataString("item_id"), buy:getDataInt("count"))                         else                                 for i = 1, buy:getDataInt("count") do                                         doPlayerAddItem(cid, buy:getDataString("item_id"), 1)                                 end                         end                         doPlayerRemoveMoney(cid, buy:getDataInt("cost"))                         db.executeQuery("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";")                         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You bought " .. buy:getDataInt("count") .. " ".. buy:getDataString("item_name") .. " for " .. buy:getDataInt("cost") .. " gps!")                         db.executeQuery("UPDATE `players` SET `auction_balance` = `auction_balance` + " .. buy:getDataInt("cost") .. " WHERE `id` = " .. buy:getDataInt("player") .. ";")                         buy:free()                 else                         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")                 end         end         if(t[1] == "remove") then                 if((not tonumber(t[2]))) then                         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")                         return true                 end                                 if(config.SendOffersOnlyInPZ) then                                             if(not getTilePzInfo(getPlayerPosition(cid))) then                                                 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you remove offerts from database.")                                                 return true                                         end                 end                 local delete = db.getResult("SELECT * FROM `auction_system` WHERE `id` = " .. (tonumber(t[2])) .. ";")                         if(delete:getID() ~= -1) then                         if(getPlayerGUID(cid) == delete:getDataInt("player")) then                                 db.executeQuery("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";")                                 if(isItemStackable(delete:getDataString("item_id"))) then                                         doPlayerAddItem(cid, delete:getDataString("item_id"), delete:getDataInt("count"))                                 else                                         for i = 1, delete:getDataInt("count") do                                                 doPlayerAddItem(cid, delete:getDataString("item_id"), 1)                                         end                                 end                                 doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your offert has been deleted from offerts database.")                         else                                 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This is not your offert!")                         end                 delete:free()                 else                         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")                 end         end         if(t[1] == "withdraw") then                 local balance = db.getResult("SELECT `auction_balance` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. ";")                 if(balance:getDataInt("auction_balance") < 1) then                         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have money on your auction balance.")                         balance:free()                         return true                 end                 doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You got " .. balance:getDataInt("auction_balance") .. " gps from auction system!")                 doPlayerAddMoney(cid, balance:getDataInt("auction_balance"))                 db.executeQuery("UPDATE `players` SET `auction_balance` = '0' WHERE `id` = " .. getPlayerGUID(cid) .. ";")                 balance:free()         end         return true end Em seguida em talkactions.xml adicione a tag:
    <talkaction words="!offer" event="script" value="auctionsystem.lua"/> No banco de dados execute as querys:
    CREATE TABLE `auction_system` (   `id` int(11) NOT NULL auto_increment,   `player` int(11),   `item_id` int(11),   `item_name` varchar(255),   `count` int(11),   `cost` int(11),   `date` int(11),   PRIMARY KEY  (`id`) ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; ALTER TABLE `players` ADD `auction_balance` INT( 11 ) NOT NULL DEFAULT '0'; Na pasta do seu site crie um arquivo chamado tradeoff.php, em seguida adicione o code:
    <?PHP $auctions = $SQL->query('SELECT `auction_system`.`player`, `auction_system`.`id`, `auction_system`.`item_name`, `auction_system`.`item_id`, `auction_system`.`count`, `auction_system`.`cost`, `auction_system`.`date`, `players`.`name` FROM `auction_system`, `players` WHERE `players`.`id` = `auction_system`.`player` ORDER BY `auction_system`.`id` DESC')->fetchAll(); $players = 0;             $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b>Instruction<b></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><center><h2>Commands</h2><b>!offer add, itemName, itemPrice, itemCount</b><br /><small>example: !offer add, plate armor, 500, 1</small><br /><br /><B>!offer buy, AuctionID</b><br /><small>example: !offer buy, 1943</small><br /><br /><b>!offer remove, AuctionID</b><br /><small>example: !offer remove, 1943</small><br /><br /><b>!offer withdraw</b><br /><small>Use this command to get money for sold items.</small></center></TR></TD></TABLE><br />';     if(empty($auctions))     {         $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b>Auctions</b></td></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD>Currently is no one active Auction.</TD></TR></TABLE>';         $main_content .= '<br /><p align="right"><small>System created by <a href="http://otland.net/members/vDk/">vDk</a>.</small></p>';     }     else     {     foreach($auctions as $auction) {         $players++;             if(is_int($players / 2))                 $bgcolor = $config['site']['lightborder'];             else                 $bgcolor = $config['site']['darkborder'];         $cost = round($auction['cost']/1000, 2);         $content .= '<TR BGCOLOR='.$bgcolor.'><TD><center>'.$auction['id'].'</center></TD><TD><center><img src="/item_images/'.$auction['item_id'].'.gif"/></center></TD><TD><center>'.$auction['item_name'].'</center></TD><TD><center><a href="?subtopic=characters&name='.urlencode($auction['name']).'">'.$auction['name'].'</a></center></TD><TD><center>'.$auction['count'].'</center></TD><TD><center>'.$cost.'k<br /><small>'.$auction['cost'].'gp</small></center></TD><TD><center>!offer buy, '.$auction['id'].'</center></TR>';     }          $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b><center>ID</center></b></TD><TD class="white"><b><center>#</center></b></TD><TD class="white"><b><center>Item Name</center></b></TD><TD class="white"><b><center>Player</center></b></TD><TD class="white"><b><center>Count</center></b></TD><TD class="white"><b><center>Cost</center></b></td><TD class="white"><b><center>Buy</center></b></td></TR>'.$content.'</TABLE>';     $main_content .= '<br /><p align="right"><small>System created by <a href="http://otland.net/members/vdk.1553/">vDk</a>.</small></p>'; }     ?>  Em layouts.php adcione o code:
                                    <a href="?subtopic=tradeoff">                                         <div id="submenu_tradeoff" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">                                                 <div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>                                                 <div id="ActiveSubmenuItemIcon_tradeoff" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>                                                 <div id="ActiveSubmenuItemLabel_tradeoff" class="SubmenuitemLabel">Trade Off</div>                                                 <div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>                                         </div>                                 </a> Pra finalizar em index.php adicione esse code:
    case "tradeoff";    $topic = "Trade Off";    $subtopic = "tradeoff";    include("tradeoff.php"); break;
    -
    E pronto galera clica em GOSTEI e comenta no tópico.
     
  3. Gostei
    marley5 deu reputação a Feel Strung em Player Compra Os Itens No Mas Não Recebe..   
    @Todo Mundo No Começo de alguma coisa tem suas dificuldades.
    Eu já arrumei o problema e se você não tem argumentos para ajudar, alguém que tenha dulvidas.
    Não precisa nem comentar no post, pode passa direto
  4. Gostei
    marley5 deu reputação a matheusbrito180 em Heeelp Erro no install.php   
    cria um arquivo de texto, e escreve dentro dele 127.0.0.1
     
    e faz a instalação
  5. Gostei
    marley5 deu reputação a Elitondesouza em [8.6] Gesior 2012 versão 2017   
    Olá meus companheiros,
    Estou aqui para dividir com vocês meu projeto Gesior 2012 Editado !!!
    Ele foi utilizado para versão 8.60, com banco de dados dessa versão.
    Porém o Layout pode ser aproveitado em qualquer versão, basta saber utilizar.
     
    Bom, todos sabem o que conseguimos no fórum com sites já prontos, sendo assim irei apenas comentar as novidades da minha versão.
     
    Dei uma boa editada no menu, com um estilo degradê quando colocamos o mouse encima.
    Coloquei um "CASTLE" que se utilizar algum script de Castle 48h, você facilmente consegue rodar um comando para funcionar 100% com o site.
    Coloquei um "NEXT EVENTS" que existe um contador em arquivo javascript, que você pode colocar determinadas horas para os eventos, facilmente editável também.
    Coloquei Outfits que se movimentam no nosso "Top Level".
    Fora as várias melhorias no layout e afins com referências do game "World Of Warcraft".
     
    Segue imagem: 
    Download: Download Link
    Scan: Scan Link
     
    Espero que façam bom uso e aproveitem !!
    Att, Eliton de Souza.
     
     
  6. Gostei
    marley5 deu reputação a luanluciano93 em TFS 0.4 CAST   
    Olá pessoal, tive a iniciativa de criar esse tópico para atualizar e otimizar as sources do TFS 0.4 DEV que é uma das mais usadas no mundo do otserv. Conteúdo totalmente gratuito e pretendemos melhora-lo cada vez mais. 
     
    Qualquer um pode colaborar, postando bugs, erros, otimizando códigos, comentar aqui no tópico, toda ajuda é bem vinda, vamos tornar essa a melhor source disponível. Conto com vocês.
     
    Versão do Tibia: 8.60
     
    Alguns sistema já implementados na source:
    • TFS 0.4 DEV rev 3777 (by TFS Team)
    • Anti-Divulgação (.servegame, .no-ip, .net, .com, .org, .pl, .biz, .br, .sytes, .info)
    • War System
    • Cast System (by Summ)
    • Retirado bugs de anti-push ..
    • Retirado bugs de elfbot ...
    • Retirado erro de não aceitar outros items ...
    • Retirado erro de Malformed File ...
    • Add creatureevent onMoveItem()  ...
    • Add função getCreaturePathTo () ...
    • E vários outros!
     
    Complementos:
    • Add cast System (passo a passo): [AQUI]
    • Pode add o comando na config.lua:
    healthHealingColor = COLOR_GREEN -- [podendo alterar a cor]. manaHealingColor = COLOR_DARKPURPLE -- [podendo alterar a cor]. Downloads:
    • Distro Compilada 32x
    • Distro Compilada 64x
    • Sources 7
     
     
    TESTADO EM WINDOWS, DEBIAN 7.8, UBUNTU 12.04 E 14.05!
     
     
    • Compilar em Linux: 
     
     
     
    • Erros para arrumar: 
     


    Obrigado ao runeraserver pelo incentivo em fixa-la para linux

    E é isso pessoal, espero ter ajudado, abraços
     
  7. Gostei
    marley5 deu reputação a Sociopata em Adicionar PagSeguro em Seu Site(Gesior Acc)   
    Bem esse é um tutorial simples de como add PagSeguro automático no seu site pq essa é uma duvida que tive e possivelmente outros tem, com isso o PagSeguro entrega os points automaticamente sem necessidade de confirmação , bem vamos lá

    No Seu Htdocs va em Config/config.php e coloque isso no final:


    // Sistema automatico Pagseguro by tatu_hunter // Seu email cadastrado no pagseguro $config['pagseguro']['email'] = 'seu e-mail'; // Valor unitario do produto ou seja valor de cada ponto // Exemplo de valores // 100 = R$ 1,00 // 235 = R$ 2,35 // 4254 = R$ 42,54 $config['pagseguro']['produtoValor'] = '100'; // Token gerado no painel do pagseguro $config['pagseguro']['token'] = 'SEU TOKEN PAGSEGURO AQUI'; crie um arquivo chamado retPagseguro.php nas pasta htdocs Dentro adicione isso: <?php include('config-and-functions.php'); define('TOKEN', $config['pagseguro']['token']); // Incluindo o arquivo da biblioteca include('retorno.php'); // Função que captura os dados do retorno function retorno_automatico ( $VendedorEmail, $TransacaoID, $Referencia, $TipoFrete, $ValorFrete, $Anotacao, $DataTransacao, $TipoPagamento, $StatusTransacao, $CliNome, $CliEmail, $CliEndereco, $CliNumero, $CliComplemento, $CliBairro, $CliCidade, $CliEstado, $CliCEP, $CliTelefone, $produtos, $NumItens) { global $config; if(strtolower($StatusTransacao) == 'aprovado') { $account_logged = $ots->createObject('Account'); $account_logged->find($Referencia); if($account_logged->isLoaded()) { $pontos = $account_logged->getCustomField("premium_points"); $account_logged->setCustomField("premium_points", $pontos + $produtos[0]['ProdQuantidade']); $nome = $Referencia.'-'.date('d-m-Y',$_SERVER['REQUEST_TIME']).'.txt'; if(file_exists('logsPagseguro/'.$nome)) $nome = $Referencia.'-2-'.date('d-m-Y',$_SERVER['REQUEST_TIME']).'.txt'; $arquivo = fopen('logsPagseguro/'.$nome, "w+"); $dados = "Conta: ".$Referencia."\n"; $dados = "Email: ".$CliEmail."\n"; $dados .= "Total de Points: ".$produtos[0]['ProdQuantidade']."\n"; $dados .= "Hora da Transação: ". date('d-m-Y H:i:s', $_SERVER['REQUEST_TIME']).""; fwrite($arquivo, $dados); fclose($arquivo); } } } // A partir daqui, é só HTML: ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <h1>Pedido em processamento</h1> <p>Recebemos seu pedido e estamos aguardando pela confirmação do pagamento. Obrigado por comprar conosco.</p> </body> </html> Depois crie um arquivo chamado retorno.php e adicione isso: <?php if (!defined('TOKEN')) define ('TOKEN', ''); /** * RetornoPagSeguro * * Classe de manipulação para o retorno do post do pagseguro * * @package PagSeguro */ class RetornoPagSeguro { /** * _preparaDados * * Prepara os dados vindos do post e converte-os para url, adicionando * o token do usuario quando necessario. * * @internal é usado pela {@see RetornoPAgSeguro::verifica} para gerar os, * dados que serão enviados pelo PagSeguro * * @access private * * @param array $post Array contendo os posts do pagseguro * @param bool $confirmacao Controlando a adicao do token no post * @return string */ function _preparaDados($post, $confirmacao=true) { if ('array' !== gettype($post)) $post=array(); if ($confirmacao) { $post['Comando'] = 'validar'; $post['Token'] = TOKEN; } $retorno=array(); foreach ($post as $key=>$value){ if('string'!==gettype($value)) $post[$key]=''; $value=urlencode(stripslashes($value)); $retorno[]="{$key}={$value}"; } return implode('&', $retorno); } /** * _tipoEnvio * * Checa qual será a conexao de acordo com a versao do PHP * preferencialmente em CURL ou via socket * * em CURL o retorno será: * <code> array ('curl','https://pagseguro.uol.com.br/Security/NPI/Default.aspx') </code> * já em socket o retorno será: * <code> array ('fsocket', '/Security/NPI/Default.aspx', $objeto-de-conexao) </code> * se não encontrar nenhum nem outro: * <code> array ('','') </code> * * @access private * @global string $_retPagSeguroErrNo Numero de erro do pagseguro * @global string $_retPagSeguroErrStr Texto descritivo do erro do pagseguro * @return array Array com as configurações * */ function _tipoEnvio() { //Prefira utilizar a função CURL do PHP //Leia mais sobre CURL em: http://us3.php.net/curl global $_retPagSeguroErrNo, $_retPagSeguroErrStr; if (function_exists('curl_exec')) return array('curl', 'https://pagseguro.uol.com.br/Security/NPI/Default.aspx'); elseif ((PHP_VERSION >= 4.3) && ($fp = @fsockopen('ssl://pagseguro.uol.com.br', 443, $_retPagSeguroErrNo, $_retPagSeguroErrStr, 30))) return array('fsocket', '/Security/NPI/Default.aspx', $fp); elseif ($fp = @fsockopen('pagseguro.uol.com.br', 80, $_retPagSeguroErrNo, $_retPagSeguroErrStr, 30)) return array('fsocket', '/Security/NPI/Default.aspx', $fp); return array ('', ''); } /** * not_null * * Extraido de OScommerce 2.2 com base no original do pagseguro, * Checa se o valor e nulo * * @access public * * @param mixed $value Variável a ser checada se é nula * @return bool */ function not_null($value) { if (is_array($value)) { if (sizeof($value) > 0) { return true; } else { return false; } } else { if (($value != '') && (strtolower($value) != 'null') && (strlen(trim($value)) > 0)) { return true; } else { return false; } } } /** * verifica * * Verifica o tipo de conexão aberta e envia os dados vindos * do post * * @access public * * @use RetornoPagSeguro::_tipoenvio() * @global string $_retPagSeguroErrNo Numero de erro do pagseguro * @global string $_retPagSeguroErrStr Texto descritivo do erro do pagseguro * @param array $post Array contendo os posts do pagseguro * @param bool $tipoEnvio (opcional) Verifica o tipo de envio do post * @return bool */ function verifica($post, $tipoEnvio=false) { global $_retPagSeguroErrNo, $_retPagSeguroErrStr; if ('array' !== gettype($tipoEnvio)) $tipoEnvio = RetornoPagSeguro::_tipoEnvio(); $spost=RetornoPagSeguro::_preparaDados($post); if (!in_array($tipoEnvio[0], array('curl', 'fsocket'))) return false; $confirma = false; if ($tipoEnvio[0] === 'curl') { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $tipoEnvio[1]); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $spost); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $resp = curl_exec($ch); if (!RetornoPagSeguro::not_null($resp)) { curl_setopt($ch, CURLOPT_URL, $tipoEnvio[1]); $resp = curl_exec($ch); } curl_close($ch); $confirma = (strcmp ($resp, 'VERIFICADO') == 0); } elseif ($tipoEnvio[0] === 'fsocket') { if (!$tipoEnvio[2]) { die ("{$_retPagSeguroErrStr} ($_retPagSeguroErrNo)"); } else { $cabecalho = "POST {$tipoEnvio[1]} HTTP/1.0\r\n"; $cabecalho .= "Content-Type: application/x-www-form-urlencoded\r\n"; $cabecalho .= "Content-Length: " . strlen($spost) . "\r\n\r\n"; $resp = ''; fwrite ($tipoEnvio[2], "{$cabecalho}{$spost}"); while (!feof($tipoEnvio[2])) { $resp = fgets ($tipoEnvio[2], 1024); if (strcmp ($resp, 'VERIFICADO') == 0) { $confirma = (strcmp ($resp, 'VERIFICADO') == 0); $confirma=true; break; } } fclose ($tipoEnvio[2]); } } if ($confirma && function_exists('retorno_automatico')) { $itens = array ( 'VendedorEmail', 'TransacaoID', 'Referencia', 'TipoFrete', 'ValorFrete', 'Anotacao', 'DataTransacao', 'TipoPagamento', 'StatusTransacao', 'CliNome', 'CliEmail', 'CliEndereco', 'CliNumero', 'CliComplemento', 'CliBairro', 'CliCidade', 'CliEstado', 'CliCEP', 'CliTelefone', 'NumItens', ); foreach ($itens as $item) { if (!isset($post[$item])) $post[$item] = ''; if ($item=='ValorFrete') $post[$item] = str_replace(',', '.', $post[$item]); } $produtos = array (); for ($i=1;isset($post["ProdID_{$i}"]);$i++) { $produtos[] = array ( 'ProdID' => $post["ProdID_{$i}"], 'ProdDescricao' => $post["ProdDescricao_{$i}"], 'ProdValor' => (double) (str_replace(',', '.', $post["ProdValor_{$i}"])), 'ProdQuantidade' => $post["ProdQuantidade_{$i}"], 'ProdFrete' => (double) (str_replace(',', '.', $post["ProdFrete_{$i}"])), 'ProdExtras' => (double) (str_replace(',', '.', $post["ProdExtras_{$i}"])), ); } retorno_automatico ( $post['VendedorEmail'], $post['TransacaoID'], $post['Referencia'], $post['TipoFrete'], $post['ValorFrete'], $post['Anotacao'], $post['DataTransacao'], $post['TipoPagamento'], $post['StatusTransacao'], $post['CliNome'], $post['CliEmail'], $post['CliEndereco'], $post['CliNumero'], $post['CliComplemento'], $post['CliBairro'], $post['CliCidade'], $post['CliEstado'], $post['CliCEP'], $post['CliTelefone'], $produtos, $post['NumItens'] ); } return $confirma; } } if ($_POST) { RetornoPagSeguro::verifica($_POST); die(); } ?> No seu buypoints.php,basta colocar isso: <?php if(!$logged) if($action == "logout") $main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Logout Successful</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>You have logged out of your '.$config['server']['serverName'].' account. In order to view your account you need to <a href="?subtopic=accountmanagement" >log in</a> again.</td></tr> </table> </div> </table></div></td></tr>'; else $main_content .= 'Please enter your account name and your password.<br/><a href="?subtopic=createaccount" >Create an account</a> if you do not have one yet.<br/><br/><form action="?subtopic=accountmanagement" method="post" ><div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Account Login</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td class="LabelV" ><span >Account Name:</span></td><td style="width:100%;" ><input type="password" name="account_login" SIZE="10" maxlength="10" ></td></tr><tr><td class="LabelV" ><span >Password:</span></td><td><input type="password" name="password_login" size="30" maxlength="29" ></td></tr> </table> </div> </table></div></td></tr><br/><table width="100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=lostaccount" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Account lost?" alt="Account lost?" src="'.$layout_name.'/images/buttons/_sbutton_accountlost.gif" ></div></div></td></tr></form></table></td></tr></table>'; else { $main_content .= ' <form target="pagseguro" method="post" action="https://pagseguro.uol.com.br/checkout/checkout.jhtml"> <input type="hidden" name="email_cobranca" value="'. $config['pagseguro']['email']. '"> <input type="hidden" name="tipo" value="CP"> <input type="hidden" name="moeda" value="BRL"> <input type="hidden" name="item_id_1" value="1"> <input type="hidden" name="item_descr_1" value="Pontos na account de nome: '.$account_logged->getCustomField("name").'"> <input type="hidden" name="item_valor_1" value="'. $config['pagseguro']['produtoValor'] .'"> <input type="hidden" name="item_frete_1" value="0"> <input type="hidden" name="item_peso_1" value="0"> <input type="hidden" name="ref_transacao" value="'.$account_logged->getCustomField("name").'"> <table border="0" cellpadding="4" cellspacing="1" width="100%" id="#estilo"><tbody> <tr bgcolor="#505050" class="white"> <th colspan="2"><strong>Escolha a quantidade de pontos que deseja comprar</strong></th> </tr> <tr> <td width="10%">Sua conta</td> <td><strong>'.$account_logged->getCustomField("name").'</strong></td> </tr> <tr> <td width="10%">Pontos</td> <td> <input name="item_quant_1" type="text" value="1" size="5" maxlength="5"> </td> </tr> <tr> <td colspan="2"> <input type="image" src="https://p.simg.uol.com.br/out/pagseguro/i/botoes/carrinhoproprio/btnFinalizar.jpg" name="submit" alt="Pague com PagSeguro - &eacute; r&aacute;pido, gr&aacute;tis e seguro!" /> </td> </tr> </tbody></table></form>'; } ?> Para finalizar: Adicione no seu phpmyadmin,na parte SQL,a seguinte database: CREATE TABLE `retorno_automatico` ( `TransacaoID` varchar(36) NOT NULL, `VendedorEmail` varchar(200) NOT NULL, `Referencia` varchar(200) default NULL, `TipoFrete` char(2) default NULL, `ValorFrete` decimal(10,2) default NULL, `Extras` decimal(10,2) default NULL, `Anotacao` text, `TipoPagamento` varchar(50) NOT NULL, `StatusTransacao` varchar(50) NOT NULL, `CliNome` varchar(200) NOT NULL, `CliEmail` varchar(200) NOT NULL, `CliEndereco` varchar(200) NOT NULL, `CliNumero` varchar(10) default NULL, `CliComplemento` varchar(100) default NULL, `CliBairro` varchar(100) NOT NULL, `CliCidade` varchar(100) NOT NULL, `CliEstado` char(2) NOT NULL, `CliCEP` varchar(9) NOT NULL, `CliTelefone` varchar(14) default NULL, `NumItens` int(11) NOT NULL, `Data` datetime NOT NULL, `status` tinyint(1) unsigned NOT NULL default '0', UNIQUE KEY `TransacaoID` (`TransacaoID`,`StatusTransacao`), KEY `Referencia` (`Referencia`), KEY `status` (`status`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; E essa outra aqui : CREATE TABLE `PagSeguroTransacoes` ( `TransacaoID` varchar(36) NOT NULL, `VendedorEmail` varchar(200) NOT NULL, `Referencia` varchar(200) default NULL, `TipoFrete` char(2) default NULL, `ValorFrete` decimal(10,2) default NULL, `Extras` decimal(10,2) default NULL, `Anotacao` text, `TipoPagamento` varchar(50) NOT NULL, `StatusTransacao` varchar(50) NOT NULL, `CliNome` varchar(200) NOT NULL, `CliEmail` varchar(200) NOT NULL, `CliEndereco` varchar(200) NOT NULL, `CliNumero` varchar(10) default NULL, `CliComplemento` varchar(100) default NULL, `CliBairro` varchar(100) NOT NULL, `CliCidade` varchar(100) NOT NULL, `CliEstado` char(2) NOT NULL, `CliCEP` varchar(9) NOT NULL, `CliTelefone` varchar(14) default NULL, `NumItens` int(11) NOT NULL, `Data` datetime NOT NULL, `status` tinyint(1) unsigned NOT NULL default '0', UNIQUE KEY `TransacaoID` (`TransacaoID`,`StatusTransacao`), KEY `Referencia` (`Referencia`), KEY `status` (`status`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    CRéDITOS:
    Walef Xavier
    Sociopata

Informação Importante

Confirmação de Termo