muito util e ja vi alguns usuarios pedindo isso! muito bom ajudará muitos
- Forums
- OTServ
- Tutoriais
- Tutoriais de Websites
- [Tutorial] Vendendo Storage (Shop System Gesior)
[Tutorial] Vendendo Storage (Shop System Gesior)
By athermillard, 17 de jan. de 2012 in Tutoriais de Websites
info
Group: Herói
Joined: 23/12/08
Posts: 2.4k
Reputation: +359
Gender: Masculino
Tibia Character: Gordo Warlike

info
Group: Lenda
Joined: 03/10/06
Posts: 2.6k
Reputation: +309
Gender: Masculino
Tibia Character: Knight Orion

Pode modificar o tópico colorindo o texto?
Coloque uma cor no "Procure: ", uma cor no "Substitua: ", etc
info
Group: Herói
Joined: 22/04/11
Posts: 2.5k
Reputation: +293
Gender: Masculino
Tibia Character: Thyn Zare

Aprovado, Parabéns, Continue Assim!
Mostrou um bom conteúdo, que, com certeza, deverá ajudar muita gente.
Movido para a Seção Correta!
info
Group: Campones
Joined: 11/03/12
Posts: 37
Reputation: +1
Tibia Character: Doldorn

aqui nao funciona da varios ero
davibrunelli@hotmail.com
add ai e da uma ajudinha pf
info
Group: Artesão
Joined: 30/12/07
Posts: 132
Reputation: +5
Gender: Masculino
Tibia Character: Hannibol

eh com o value?
Uh, amigo, agora quando eu faço uma venda em Adicionar offert, eu recebo tudo, faz até mesmo me adicionado, mas quando vou para a loja, Esta página fica em branco sem qualquer oferta, eu segui todos os passos como você explicar isso para você em sua mensagem, você pode me ajudar?
Edited Junho 26 by lopez65
info
Group: Cavaleiro
Joined: 14/04/15
Posts: 191
Reputation: +2

Eo o script que pohe no globalevents poderia desponibilizar.






info
Group: Campones
Joined: 07/12/11
Posts: 8
Reputation: +17
Tibia Character: Taylor Brasil
Através desse sistema você poderá vender storages em seu "shop system".
Noob say: Mais pra q isso?
Bem, com esse sistema você poderá por exemplo criar uma nova área em seu mapa e fazer com que somente entrem pessoas que tiverem essa "storage" assim sendo obtida através de uma compra do seu site "Gesior"
Vá em htdocs/shopsystem.php e logo depois procure por essa linha:
elseif ($data['offer_type'] == 'changename')
{
$offer['id'] = $data['id'];
$offer['type'] = $data['offer_type'];
$offer['points'] = $data['points'];
$offer['description'] = $data['offer_description'];
$offer['name'] = $data['offer_name'];
}
Substitua-a por essa:
elseif ($data['offer_type'] == 'changename')
{
$offer['id'] = $data['id'];
$offer['type'] = $data['offer_type'];
$offer['points'] = $data['points'];
$offer['description'] = $data['offer_description'];
$offer['name'] = $data['offer_name'];
}
elseif ($data['offer_type'] == 'storage')
{
$offer['id'] = $data['id'];
$offer['type'] = $data['offer_type'];
$offer['item_id'] = $data['itemid1'];
$offer['points'] = $data['points'];
$offer['description'] = $data['offer_description'];
$offer['name'] = $data['offer_name'];
}
Agora procure essa outra:
$i_changename = 0;
Substitua por esta:
$i_changename = 0;
$i_storage = 0;
Procure essa:
elseif ($data['offer_type'] == 'changename')
{
$offer_array['changename'][$i_changename]['id'] = $data['id'];
$offer_array['changename'][$i_changename]['points'] = $data['points'];
$offer_array['changename'][$i_changename]['description'] = $data['offer_description'];
$offer_array['changename'][$i_changename]['name'] = $data['offer_name'];
$i_changename++;
}
Substitua:
elseif ($data['offer_type'] == 'changename')
{
$offer_array['changename'][$i_changename]['id'] = $data['id'];
$offer_array['changename'][$i_changename]['points'] = $data['points'];
$offer_array['changename'][$i_changename]['description'] = $data['offer_description'];
$offer_array['changename'][$i_changename]['name'] = $data['offer_name'];
$i_changename++;
}
elseif ($data['offer_type'] == 'storage')
{
$offer_array['storage'][$i_storage]['id'] = $data['id'];
$offer_array['storage'][$i_storage]['points'] = $data['points'];
$offer_array['storage'][$i_storage]['item_id'] = $data['itemid1'];
$offer_array['storage'][$i_storage]['description'] = $data['offer_description'];
$offer_array['storage'][$i_storage]['name'] = $data['offer_name'];
$i_storage++;
}
Procure:
0 or count($offer_list['unban']) > 0
Substitua:
0 or count($offer_list['unban']) > 0 or count($offer_list['storage']) > 0
Procure:
$main_content .= '<form action="index.php?subtopic=shopsystem&action=select_player" method=POST><input type="hidden" name="buy_id" value="'.$changename['id'].'"><input type="submit" value="Buy '.$changename['name'].'"><br><b>for '.$changename['points'].' points</b></form>';
}
Substitua:
$main_content .= '<form action="index.php?subtopic=shopsystem&action=select_player" method=POST><input type="hidden" name="buy_id" value="'.$changename['id'].'"><input type="submit" value="Buy '.$changename['name'].'"><br><b>for '.$changename['points'].' points</b></form>';
}
//Storage by: Ather
if(count($offer_list['storage']) > 0)
foreach($offer_list['storage'] as $storage) {
$main_content .= '<tr bgcolor="gray"><td align="center">Storage</td><td><b>'.$storage['name'].'</b> ('.$storage['points'].' points)<br />'.$storage['description'].'</td><td align="center">';
if(!$logged) $main_content .= '<b>Entre Primeiro</b>'; else
$main_content .= '<form action="index.php?subtopic=shopsystem&action=select_player" method=POST><input type="hidden" name="buy_id" value="'.$storage['id'].'"><input type="submit" value="Buy '.$storage['name'].'"><br><b>for '.$storage['points'].' points</b></form>';
}
Procure:
$main_content .= '<center><b>You don\'t have any bans in your account!</b><br><br><a href="index.php?subtopic=shopsystem">Go back</a><br>';
}
}
Substitua:
$main_content .= '<center><b>You don\'t have any bans in your account!</b><br><br><a href="index.php?subtopic=shopsystem">Go back</a><br>';
}
}
//Storage by: Ather
elseif($buy_offer['type'] == 'storage') {
$my_acc_id = $buy_player->getCustomField('id');
$datadata = $SQL->query('SELECT * FROM '.$SQL->tableName('player_storage').' WHERE player_id = '.$my_acc_id.';')->fetch();
if($datadata['player_id'] == $my_acc_id) {
if($SQL->query('UPDATE player_storage SET value=1 WHERE `key` = '.$SQL->quote($buy_offer['item_id']).' AND player_id='.$my_acc_id.';')) {
} else {
$SQL->query('UPDATE player_storage SET value=1 WHERE `key` = '.$SQL->quote($buy_offer['item_id']).' AND player_id='.$my_acc_id.';');
}
$account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
$user_premium_points = $user_premium_points - $buy_offer['points'];
$main_content .= '<center><h2>Storage enviada!</h2><b>Você recebeu sua storage por '.$buy_offer['points'].' pontos</b> da sua account.
<br>Agora você possui <b>'.$user_premium_points.' pontos</b>.<br><br><a href="index.php?subtopic=shopsystem">Voltar para o Shop</a><br>';
} else {
$main_content .= '<center><b>Erro</b><br><br><a href="index.php?subtopic=shopsystem">Go back</a><br>';
}
}
Pronto agora vamos ao painel de adiministração:
em htdocs/shopadmin procure:
<td><font color="white">Changename</td>
Substitua:
<td><font color="white">Changename</td><td><font color="white">Storage</td>
Procure:
<td align="center"><input type="radio" name="offer_type" value="changename" onClick="this.form.submit()"></td>
Substitua:
<td align="center"><input type="radio" name="offer_type" value="changename" onClick="this.form.submit()"></td>
<td align="center"><input type="radio" name="offer_type" value="storage" onClick="this.form.submit()"></td>
Procure:
<td><input type="text" name="shop_count1" maxlenght="7" style="width: 70px" ></td></tr>';
}
Substitua:
<td><input type="text" name="shop_count1" maxlenght="7" style="width: 70px" ></td></tr>';
}
//Storage by: Ather
if($_REQUEST['offer_type'] == 'storage'){
$main_content .= '<tr><td align="center"><b>Storage:</b></td>
<td><input type="text" name="shop_itemid1" maxlenght="7" style="width: 70px" ></td></tr>';
}
//Fim
Procure:
<tr><td align="center" ><b>Count Item:</b></td>
<td>'.$shop_count1.'</td></tr><br>';
}
Substitua:
<tr><td align="center" ><b>Count Item:</b></td>
<td>'.$shop_count1.'</td></tr><br>';
}
if ($shop_offer_type == 'storage'){
$main_content .= '<tr><td align="center" ><b>Storage:</b></td>
<td>'.$shop_itemid1.'</td></tr><br>';
}
Procure:
<td><input type="text" name="shop_count1" maxlenght="7" value="'.$shop['count1'].'" style="width: 70px" ></td></tr>';
}
Substitua:
<td><input type="text" name="shop_count1" maxlenght="7" value="'.$shop['count1'].'" style="width: 70px" ></td></tr>';
}
// Storage by: Ather
if($shop['offer_type'] == 'storage'){
$main_content .= '<tr><td align="center"><b>Storage:</b></td>
<td><input type="text" name="shop_itemid1" maxlenght="7" value="'.$shop['itemid1'].'" style="width: 70px" ></td></tr>';
}
//fim
Ufa acabou
Espero que funcione ^^ com vocês também!
Tá com duvidas? Pergunte