XS

[Gesior Acc] Top 5 Itens Mais Vendidos

Por xsankebrx, 09 de jul. de 2011 em Tutoriais de Websites

script
2
2.1k
xsankebrxX
09 de julho de 2011 às 11:59

Itens mais vendidos no seu site



(meu primeiro tópico aqui.)

 

Preview:

 

34hchmb.jpg



Tutorial:

 

1° Passo: Abra seu shopsystem.php e procure

 

elseif($buy_offer['type'] == 'item') {  



 

e abaixo disso

 

$SQL->query($save_transaction);  



 

Cole isso:

 

$bought = 'UPDATE `z_shop_offer` SET `bought` = bought + 1 WHERE `id` ='.$buy_offer['id'].';'; 
$SQL->query($bought);  



 

 

2° Passo: Abra seu latestnews.php e procure

 

<?PHP
$time = time();



 

e abaixo disso cole:

 


$query = $SQL->query("SELECT * FROM `z_shop_offer`WHERE `offer_type` NOT LIKE 'container' AND `offer_type` NOT LIKE 'changename' AND `offer_type` NOT LIKE 'vipdays' AND `offer_type` NOT LIKE 'redskull' AND `offer_type` NOT LIKE 'unban' ORDER BY `bought` DESC LIMIT 5");
foreach($query as $rows) {
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; }
$number_of_rows++;
$result .= '
<td bgcolor='.$bgcolor.'>
<center>
<img src="item_images/'.$rows['itemid1'].'.gif"> <br /><br />
Item:</br> <b>'.$rows['offer_name'].'</b><br />
Points: <b>'.$rows['points'].'</b>
</center>
</td>';
}
$main_content .= "<table border=\"0\" cellspacing=\"1\" cellpadding=\"4\" width=\"100%\"><tr bgcolor=".$config['site']['vdarkborder']."><td class=\"white\" colspan=\"5\"><center><strong>Últimos itens vendidos no Shopping</strong></center></td></tr><tr bgcolor=".$config['site']['vdarkborder']."><td class=\"white\" width=\"20%\"><b><center>#1</center></b></td><td class=\"white\" width=\"20%\"><b><center>#2</center></b></td>

<td class=\"white\" width=\"20%\"><b><center>#3</center></b></td>
<td class=\"white\" width=\"20%\"><b><center>#4</center></b></td>
<td class=\"white\" width=\"20%\"><b><center>#5</center></b></td>




</tr>".$result."</table> <br />";



 

2° Passo: Para finalizar execute essa query em seu phpMyAdmin

 

ALTER TABLE `z_shop_offer` ADD `bought` INT( 11 ) NOT NULL DEFAULT '0';  



 

Prontinho, script irá funcionar 100% se seguir passa-a-passo corretamente, dúvidas?

Poste aqui!

 

Script original by: Aleh

Script 100% Editado by: Ruivo

 

Obrigado, REP ++!

Editado Julho 9 por Sanke

1 mês depois...
Piabeta KunP
08 de agosto de 2011 às 08:43

como niguem comentou vim fazer isso, gostei e estou usando no meu website, poderia ser melhor mais ja suporta o q foi feito para fazer!

 

+rep proce!

 

EDIT

 

eskeci de avisar q ele esta feito para sites q usam vip system em vipdays, ou seja procure por "vipdays" e mude para pacc no script caso usem premium account system, ou outro, caso ao contrario ia mostrar tbm as premium times vendidas!

 

 

Bem amigo axu melhor voce anexar isso em seu topico!

Editado Agosto 8 por PiabetaMan01