Ir para conteúdo
  • Cadastre-se

(Resolvido)[ERRO] Gesior não entrega Item comprado no SHOP


Ir para solução Resolvido por alissonfgp,

Posts Recomendados

Estou com o seguinte problema:
- Eu compro algum item no SHOP do Gesior e não recebo no meu char.
 
Informações:
Servidor: TFS 1.0 versão 10.37
Site: Gesior 2015 1.0 do Victor Raful > LINK
 
Encontrei uma possível solução em um tópico do TibiaKing:
- Adicionar um script SHOP no GlobalEvents.
 
Fiz, isso, e obtive o seguinte erro no Distro:
SKNgIO9i.png
 
O script que eu adicionei foi: (globalevents/scripts/shop.lua)

-- ### CONFIG ###
-- message send to player by script "type" (types you can check in "global.lua")
SHOP_MSG_TYPE = 19
-- time (in seconds) between connections to SQL database by shop script
SQL_interval = 30
-- ### END OF CONFIG ###
function onThink(interval, lastExecution)
local result_plr = db.getResult("SELECT * FROM z_ots_comunication WHERE `type` = 'login';")
if(result_plr:getID() ~= -1) then
while(true) do
id = tonumber(result_plr:getDataInt("id"))
action = tostring(result_plr:getDataString("action"))
delete = tonumber(result_plr:getDataInt("delete_it"))
cid = getCreatureByName(tostring(result_plr:getDataString("name")))
if isPlayer(cid) == TRUE then
local itemtogive_id = tonumber(result_plr:getDataInt("param1"))
local itemtogive_count = tonumber(result_plr:getDataInt("param2"))
local container_id = tonumber(result_plr:getDataInt("param3"))
local container_count = tonumber(result_plr:getDataInt("param4"))
local add_item_type = tostring(result_plr:getDataString("param5"))
local add_item_name = tostring(result_plr:getDataString("param6"))
local received_item = 0
local full_weight = 0
if add_item_type == 'container' then
container_weight = getItemWeightById(container_id, 1)
if isItemRune(itemtogive_id) == TRUE then
items_weight = container_count * getItemWeightById(itemtogive_id, 1)
else
items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count)
end
full_weight = items_weight + container_weight
else
full_weight = getItemWeightById(itemtogive_id, itemtogive_count)
if isItemRune(itemtogive_id) == TRUE then
full_weight = getItemWeightById(itemtogive_id, 1)
else
full_weight = getItemWeightById(itemtogive_id, itemtogive_count)
end
end
local free_cap = getPlayerFreeCap(cid)
if full_weight <= free_cap then
if add_item_type == 'container' then
local new_container = doCreateItemEx(container_id, 1)
local iter = 0
while iter ~= container_count do
doAddContainerItem(new_container, itemtogive_id, itemtogive_count)
iter = iter + 1
end
received_item = doPlayerAddItemEx(cid, new_container)
else
local new_item = doCreateItemEx(itemtogive_id, itemtogive_count)
received_item = doPlayerAddItemEx(cid, new_item)
end
if received_item == RETURNVALUE_NOERROR then
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop.')
db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";")
else
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.')
end
else
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.')
end
end
if not(result_plr:next()) then
break
end
end
result_plr:free()
end
return TRUE
end

E no globalevents.xml :

<globalevent name="shop" interval="30" script="shop.lua"/>

ALGUÉM PODE ME AJUDAR?

Link para o post
Compartilhar em outros sites

pow tentei colocar aqui no meu modern acc para testar mais deu erro no mysql. sera que alguem pode me passar a tabela para adicionar  no sql?

Link para o post
Compartilhar em outros sites
  • 1 month later...
  • 5 months later...

Fiz essa alteração e meus itens continuam não chegando.

 

Estou tendo esse erro:

7BxyDhh.jpg

 

 

shop.lua

-- ### CONFIG ###
-- message send to player by script "type" (types you can check in "global.lua")
SHOP_MSG_TYPE = 19
-- time (in seconds) between connections to SQL database by shop script
SQL_interval = 30
-- ### END OF CONFIG ###
function onThink(interval, lastExecution)
    local result_plr = db.storeQuery("SELECT * FROM z_ots_comunication")
    if(result_plr ~= false) then
        repeat
            local id = tonumber(result.getDataInt(result_plr, "id"))
            local action = tostring(result.getDataString(result_plr, "action"))
            local delete = tonumber(result.getDataInt(result_plr, "delete_it"))
            local cid = getPlayerByName(tostring(result.getDataString(result_plr, "name")))
            if(cid) then
                local itemtogive_id = tonumber(result.getDataInt(result_plr, "param1"))
                local itemtogive_count = tonumber(result.getDataInt(result_plr, "param2"))
                local container_id = tonumber(result.getDataInt(result_plr, "param3"))
                local container_count = tonumber(result.getDataInt(result_plr, "param4"))
                local add_item_type = tostring(result.getDataString(result_plr, "param5"))
                local add_item_name = tostring(result.getDataString(result_plr, "param6"))
                local received_item = 0
                local full_weight = 0
                if(add_item_type == 'container') then
                    container_weight = getItemWeight(container_id, 1)
                    if(isItemRune(itemtogive_id)) then
                        items_weight = container_count * getItemWeight(itemtogive_id, 1)
                    else
                        items_weight = container_count * getItemWeight(itemtogive_id, itemtogive_count)
                    end
                    full_weight = items_weight + container_weight
                else
                    full_weight = getItemWeight(itemtogive_id, itemtogive_count)
                    if(isItemRune(itemtogive_id)) then
                        full_weight = getItemWeight(itemtogive_id, 1)
                    else
                        full_weight = getItemWeight(itemtogive_id, itemtogive_count)
                    end
                end
                local free_cap = getPlayerFreeCap(cid)
                if(full_weight <= free_cap) then
                    if(add_item_type == 'container') then
                        local new_container = doCreateItemEx(container_id, 1)
                        local iter = 0
                        while(iter ~= container_count) do
                            doAddContainerItem(new_container, itemtogive_id, itemtogive_count)
                            iter = iter + 1
                        end
                        received_item = doPlayerAddItemEx(cid, new_container)
                    else
                        local new_item = doCreateItemEx(itemtogive_id, itemtogive_count)
                        received_item = doPlayerAddItemEx(cid, new_item)
                    end
                    if(type(received_item) == "number" and received_item == RETURNVALUE_NOERROR) then
                        doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop.')
                        db.query("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
                        db.query("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";")
                    else
                        doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.')
                    end
                else
                    doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.')
                end
            end
        until not result.next(result_plr)
        result.free(result_plr)
    end
    return true
end
Editado por skeltgt (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Veja se o item que você colocou a venda no Gesior está cadastrado no seu Item.xml, pois, o erro está dizendo que o item não foi encontrado no seu server.

Eu te Ajudei? Então solta aquele REP+ !!

Meus Tutoriais [Tutorial] Bug "Temple position is wrong" (MySql)

Outros:    [Meu Show OFF | Mapa próprio 8.6] 

Link para o post
Compartilhar em outros sites

Veja se o item que você colocou a venda no Gesior está cadastrado no seu Item.xml, pois, o erro está dizendo que o item não foi encontrado no seu server.

 

Na verdade o erro tá dizendo é que não tá achando o peso do item ou algo assim (luaGetItemWeight), o erro tá se formando mais precisamente na linha 41 do código. 

 

acredito que tenha a ver com essa parte:

                local free_cap = getPlayerFreeCap(cid)
                if(full_weight <= free_cap) then
                    if(add_item_type == 'container') then
                        local new_container = doCreateItemEx(container_id, 1)
                        local iter = 0
                        while(iter ~= container_count) do
                            doAddContainerItem(new_container, itemtogive_id, itemtogive_count)
                            iter = iter + 1
                        end
Link para o post
Compartilhar em outros sites

Substitui o que tem dentro de seu Shop.lua pro esse arquivo aqui:

 

 

local SHOP_MSG_TYPE = MESSAGE_EVENT_ORANGE
local SQL_interval = 30
 
function onThink(interval, lastExecution)
local result_plr = db.getResult("SELECT * FROM z_ots_comunication WHERE `type` = 'login';")
if(result_plr:getID() ~= -1) then
while(true) do
local id = tonumber(result_plr:getDataInt("id"))
local action = tostring(result_plr:getDataString("action"))
local delete = tonumber(result_plr:getDataInt("delete_it"))
local cid = getCreatureByName(tostring(result_plr:getDataString("name")))
if isPlayer(cid) then
local itemtogive_id = tonumber(result_plr:getDataInt("param1"))
local itemtogive_count = tonumber(result_plr:getDataInt("param2"))
local container_id = tonumber(result_plr:getDataInt("param3"))
local container_count = tonumber(result_plr:getDataInt("param4"))
local add_item_type = tostring(result_plr:getDataString("param5"))
local add_item_name = tostring(result_plr:getDataString("param6"))
local received_item = 0
local full_weight = 0
if add_item_type == 'container' then
container_weight = getItemWeightById(container_id, 1)
if isItemRune(itemtogive_id) == TRUE then
items_weight = container_count * getItemWeightById(itemtogive_id, 1)
else
items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count)
end
full_weight = items_weight + container_weight
else
full_weight = getItemWeightById(itemtogive_id, itemtogive_count)
if isItemRune(itemtogive_id) == TRUE then
full_weight = getItemWeightById(itemtogive_id, 1)
else
full_weight = getItemWeightById(itemtogive_id, itemtogive_count)
end
end
local free_cap = getPlayerFreeCap(cid)
if full_weight <= free_cap then
if add_item_type == 'container' then
local new_container = doCreateItemEx(container_id, 1)
local iter = 0
while iter ~= container_count do
doAddContainerItem(new_container, itemtogive_id, itemtogive_count)
iter = iter + 1
end
received_item = doPlayerAddItemEx(cid, new_container)
else
local new_item = doCreateItemEx(itemtogive_id, itemtogive_count)
doItemSetAttribute(new_item, "description", "This item can only be used by the player ".. getPlayerName(cid) .."!")
doItemSetAttribute(new_item, "aid", getPlayerGUID(cid)+10000)
received_item = doPlayerAddItemEx(cid, new_item)
end
if received_item == RETURNVALUE_NOERROR then
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'Voce recebeu >> '.. add_item_name ..' << do Dramonio Shop.Obrigado pela compra, volte sempre!')
db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";")
else
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.')
end
else
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.')
end
end
if not(result_plr:next()) then
break
end
end
result_plr:free()
end
return true
end
 

 
Editado por olokomeu (veja o histórico de edições)

Eu te Ajudei? Então solta aquele REP+ !!

Meus Tutoriais [Tutorial] Bug "Temple position is wrong" (MySql)

Outros:    [Meu Show OFF | Mapa próprio 8.6] 

Link para o post
Compartilhar em outros sites

Aeeeee!!!! Valeu @olokomeu, deu certinho!

 

Resolvido :)

:)! Nds rapaz, precisando to ai 

Eu te Ajudei? Então solta aquele REP+ !!

Meus Tutoriais [Tutorial] Bug "Temple position is wrong" (MySql)

Outros:    [Meu Show OFF | Mapa próprio 8.6] 

Link para o post
Compartilhar em outros sites
  • 9 months later...

isso funciona com modern acc eu uso modern acc soqe o item nao chega

NTO PANZER SERVIDOR 24H 

1554689_1.png

http://narutopanzer.blogspot.com.br/

RATE  EXP 999

 

DBO SERVIDOR 24H 

1549171_1.png

http://dbowtf.ddns.net/

RATE EXP 400

 

 

Link para o post
Compartilhar em outros sites
  • 2 months later...
  • 10 months later...

desculpa por reviver o topico assim mais esse topico foi util pra caramba poderiam colocar ele como tutorial estava com esse problema a um tempão seguindo todos os comentarios aqui consegui fazer funcionar ! obrigado rep +

Link para o post
Compartilhar em outros sites
  • 1 month later...
Em 22/06/2014 ás 01:13, alissonfgp disse:

 

 


-- ### CONFIG ###
-- message send to player by script "type" (types you can check in "global.lua")
SHOP_MSG_TYPE = 19
-- time (in seconds) between connections to SQL database by shop script
SQL_interval = 30
-- ### END OF CONFIG ###
function onThink(interval, lastExecution)
    local result_plr = db.storeQuery("SELECT * FROM z_ots_comunication")
    if(result_plr ~= false) then
        repeat
            local id = tonumber(result.getDataInt(result_plr, "id"))
            local action = tostring(result.getDataString(result_plr, "action"))
            local delete = tonumber(result.getDataInt(result_plr, "delete_it"))
            local cid = getPlayerByName(tostring(result.getDataString(result_plr, "name")))
            if(cid) then
                local itemtogive_id = tonumber(result.getDataInt(result_plr, "param1"))
                local itemtogive_count = tonumber(result.getDataInt(result_plr, "param2"))
                local container_id = tonumber(result.getDataInt(result_plr, "param3"))
                local container_count = tonumber(result.getDataInt(result_plr, "param4"))
                local add_item_type = tostring(result.getDataString(result_plr, "param5"))
                local add_item_name = tostring(result.getDataString(result_plr, "param6"))
                local received_item = 0
                local full_weight = 0
                if(add_item_type == 'container') then
                    container_weight = getItemWeight(container_id, 1)
                    if(isItemRune(itemtogive_id)) then
                        items_weight = container_count * getItemWeight(itemtogive_id, 1)
                    else
                        items_weight = container_count * getItemWeight(itemtogive_id, itemtogive_count)
                    end
                    full_weight = items_weight + container_weight
                else
                    full_weight = getItemWeight(itemtogive_id, itemtogive_count)
                    if(isItemRune(itemtogive_id)) then
                        full_weight = getItemWeight(itemtogive_id, 1)
                    else
                        full_weight = getItemWeight(itemtogive_id, itemtogive_count)
                    end
                end
                local free_cap = getPlayerFreeCap(cid)
                if(full_weight <= free_cap) then
                    if(add_item_type == 'container') then
                        local new_container = doCreateItemEx(container_id, 1)
                        local iter = 0
                        while(iter ~= container_count) do
                            doAddContainerItem(new_container, itemtogive_id, itemtogive_count)
                            iter = iter + 1
                        end
                        received_item = doPlayerAddItemEx(cid, new_container)
                    else
                        local new_item = doCreateItemEx(itemtogive_id, itemtogive_count)
                        received_item = doPlayerAddItemEx(cid, new_item)
                    end
                    if(type(received_item) == "number" and received_item == RETURNVALUE_NOERROR) then
                        doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop.')
                        db.query("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
                        db.query("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";")
                    else
                        doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.')
                    end
                else
                    doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.')
                end
            end
        until not result.next(result_plr)
        result.free(result_plr)
    end
    return true
end

e como se muda numero do deport ?

 

 

5a510dabc5375_20228663_336082076822153_8453189641140183581_n-Cpia-Cpia.jpg.ae93894455bf828fc6901b29d7395cd9.jpg

https://www.facebook.com/groups/659018184245665/

5a510e4f9a582_20228663_336082076822153_8453189641140183581_n-Cpia-Cpia.jpg.fa86c37be79982f1cc8ff619015ddd1b.jpg

https://www.facebook.com/profile.php?id=133706320308745

 

Link para o post
Compartilhar em outros sites
  • 2 months later...
5 minutos atrás, Biinhows disse:

porcura por " shop " 

 

 

20j4bxw.png

O erro que está acontecendo aqui é esse.

Testei em um char e o item não chegou no char

Depois testei em outro e agora não para de vi mais bota.. vem toda hora a cada 30 segundos

 

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por Bagon
      Bom, hoje venho trazer á vocês um sistema de Pet System DIFERENCIADO de alguns presentes no fórum. Este sistema tem diversos comandos diferenciados, como: 
       
      !pet nomedopet este comando irá sumonar o pet. 
      !remove irá remover o pet.
      !fale eu sou lindo o pet falará "eu sou lindo"
      !conversar o pet irá conversar com vc. 
       
      Então sem mais delongas vamos ao script.
       
      OBS: SCRIPT TESTADO SOMENTE EM TFS 0.4/0.3, e este script foi feito com a intenção de ser vendido no site do ot ou em poderá usar como quest usando o item selecionado como premio. fique ao seu critério.
       
      Primeiro vá até a pasta talkaction/script e crie um arquivo chamado petsystem.lua, depois coloque o seguinte script:
       
       
      Agora em talkactions/talkactions.xml adicione a seguinte tag:
       
      <talkaction words="!pet;!remove;!fale;!conversar" event="script" value="petsystem.lua" />  
      EXPLICAÇÂO:
      As partes em Negrito, são os pets. Você pode alterar ou criar monstros para fazer eles como pets. (Recomendo criar um monstro para que seja somente pet.)
       
      Exemplo: ["dog"]= {stor=78552},      
       
       
      Lembrando que é necessário mudar esta parte no script do monstro colocado a cima.
       
      <flag attackable="1" /> para :
       
      <flag attackable="0" />  
      agora vá em action/script e crie um arquivo chamado pet com o seguinte script:
       
       
      e vá em action.xml e adiciona a seguinte tag:
       
      <action itemid="10063" script="pet.lua"/> Explicação: Na tag da action o itemid é o item que deverá ser usado para ganhar a storage 78552, e assim podera sumonar o monstro com esta storage.
       
                                              
                                                         CRIE UMA ACTION COM A TAG A CIMA PARA CADA MONSTRO COLOCADO NA TALKACTION,
                                                         BASTA VC ALTERAR A STORAGE DO SCRIPT DA ACTION
                                                         EXEMPLO: em action altere as storage que estão em vermelho, como mostra abaixo
       
                                                              if getPlayerStorageValue(cid, 78552) < 1 then
                                                              setPlayerStorageValue(cid, 78552, 1)
       
                                                         aonde tem 78552 altere para 78553 que no caso é a storage do cyclops escolhido lá no script da talkaction
                                                         e assim susecivelmente.
       
       
       
      CREDITOS:
      Mulizeu
      Smartbox
      Bagon 
       
    • Por Imperius
      Olá, pessoal! Acabei encontrando um script que tinha feito a um tempo atrás. Estou compartilhando aqui para quem quiser usar ou melhorar.
       
      É bem parecido com os outros sistemas de roleta, igual deste tópico: https://tibiaking.com/forums/topic/101557-action-cassino-roleta-de-items/
       
      Como funciona?
       
      O "Treasure Chest" é um item custom, onde o jogador têm a possibilidade de ganhar itens raros ou bem meia boca. Tudo dependerá da sorte.
       
      O jogador precisa tacar o treasure chest na bancada e acionar a alavanca. O treasure chest irá se transformar em vários itens de forma randômica no qual o jogador poderá ou não ganhar. No final, apenas um item é entregue ao jogador.
       
      Para entender melhor o seu funcionamento, segue o GIF abaixo:
       

       
       
      em data > actions > actions.xml
       
       
      em data > actions > scripts > crie um arquivo chamado leverTreasureChest.lua
       
       
      no banco de dados do servidor, adicione o seguinte código em "SQL":
       
       
       

      Também estou disponibilizando uma página PHP, para quem quiser usar no site do servidor. Na página tem informações sobre o funcionamento, quais são os possíveis prêmios e a lista de jogadores que ganharam os itens raros.
       

       
       
      Espero ter ajudado de alguma forma! : )
       
      treasure_chest.php
    • Por 4Marsupilami
      I present my newest beautiful and tasty layout called Silver brown cake. If you are interested in a unique layout, write to me on discord.
       
      • E-mail: [email protected]
      • Discord: 4Marsupilami#1243
       
       


    • Por 4Marsupilami
      I present my newest beautiful and tasty layout called Glacial. If you are interested in a unique layout, write to me on discord.

      • E-mail: [email protected]
      • Discord: 4Marsupilami#1243
       
       


    • Por luanluciano93
      Olá pessoal, hoje vou ensinar como deixar as urls limpas (amigáveis) no Gesior.

      Mas Luan, oque é URL?
      URL vem de Uniform Resource Locator, em português Localizador-Padrão de Recursos, é o vulgo endereço de uma rede, seja internet, ou até mesmo uma intranet. Resumindo é o endereço que você coloca no seu browser.

      exemplo: URL para entrar no TK: http://www.tibiaking.com/forum/

      Como podem ver no exemplo, a estrutura de uma URL é basicamente esse:
      protocolo://dominio-ou-ip/caminho
       
      Mas Luan, para que vou querer limpar as urls do meu site?
      Seguinte, existe um termo que se chama 'boas praticas', que a maioria (não todos)dos desenvolvedores web procuram seguir. A verdade é que a única coisa que altera é o visual, você vai ver as urls, e com elas limpas qualquer leigo consegue entender onde está em um site.

      Mas Luan, oque é realmente uma URL limpa (amigável)?
      Bom, vou usar o próprio site do tibia.com (que é o mesmo jeito do Gesior) como exemplo ... 

      tibia.com/index.php?subtopic=latestnews
      tibia.com/index.php?subtopic=archives
      tibia.com/index.php?subtopic=rules

      E etc ... o tibia.com ainda não fica tão feio, mas existem sites que ficam muito ruim mesmo.

      E se colocássemos um arquivo simples no gesior que alterasse as urls escondendo uma parte delas ... 

      Por exemplo, nos exemplos acima, temos algo em comum depois do domínio, que seria o index.php?subtopic=, e se escondêssemos essa parte? Não ficaria muito melhor?
      tibia.com/latestnews
      tibia.com/archives
      tibia.com/rules

      Apenas olhando no endereço da internet qualquer leigo entenderia onde está facilmente, e é isso que este arquivo faz. bem básico.

      Luan, como eu instalo esse arquivo?
      Usamos o arquivo .htaccess e determinado código nele.

      Basta coloca esse arquivo no diretório do site (pasta www ou htdocs) com o código.

      Para funcionar você terá um pequeno trabalho de alterar todos os 'caminhos' que existem no layout e nas pastas do ot, mas é simples, vá em cada arquivo e aperta Ctrl+F e procure por subtopic e muda o caminho, no caso se tiver o index.php?subtopic=, é só apagar tudo e deixar só que esta depois do =, se não tiver o index.php, só tiver ?subtopic=, apaga essa parte e deixa só o que ta depois do =, simples e fácil, só fazer isso na layout.php e em todas as páginas que tiver no seu site.

      Se você já tem o arquivo .htaccess no diretório do seu site, coloque esse código dentro:
      RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?subtopic=$1 Caso não tenha o arquivo, provavelmente existe um arquivo .htaccess na pasta config do seu site, copie ele e cole no diretório do site, apague o código e coloque o código que eu passei.

      É isso pessoal, espero que tenham gostado. Até a próxima, abração!
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo