Hello!
I present you simple script by me.
As you can see in the picture is a script that shows the three most popular items in the sms shop.
Open yours shopsystem.php and find
and below this
paste
Now find (~167 line)
and paste this
For end add this query to database:
If you have any suggestions as to the script - WRITE!
Thanks, REP ++!
I present you simple script by me.
As you can see in the picture is a script that shows the three most popular items in the sms shop.
Open yours shopsystem.php and find
PHP:
elseif($buy_offer['type'] == 'item') {
PHP:
$SQL->query($save_transaction);
PHP:
$bought = 'UPDATE `z_shop_offer` SET `bought` = bought + 1 WHERE `id` ='.$buy_offer['id'].';';
$SQL->query($bought);
PHP:
unset($_SESSION['viewed_confirmation_page']);
$main_content .= '<h2><center>Welcome to '.$config['server']['serverName'].' Shop.</center></h2>';
PHP:
$query = $SQL->query("SELECT * FROM `z_shop_offer`WHERE `offer_type` NOT LIKE 'container' AND `offer_type` NOT LIKE 'changename' ORDER BY `bought` DESC LIMIT 3");
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="images/items/'.$rows['id'].'.gif"> <br /><br />
Offer Name: <b>'.$rows['offer_name'].'</b><br />
Points: <b>'.$rows['points'].'</b><br />
<form action="index.php?subtopic=shopsystem&action=select_player" method=POST>
<input type="hidden" name="buy_id" value="'.$rows['id'].'">
<input type="submit" value="Buy '.$rows['offer_name'].'">
</form>
</center>
</td>';
}
$main_content .= "<table border=\"0\" cellspacing=\"1\" cellpadding=\"4\" width=\"100%\"><tr bgcolor=".$config['site']['vdarkborder']."><td class=\"white\" colspan=\"3\"><center><strong>The most popular items in SMS Shop!</strong></center></td></tr><tr bgcolor=".$config['site']['vdarkborder']."><td class=\"white\" width=\"33%\"><b><center>#1</center></b></td><td class=\"white\" width=\"33%\"><b><center>#2</center></b></td><td class=\"white\" widht=\"33%\"><b><center>#3</center></b></td></tr>".$result."</table> <br />";
For end add this query to database:
PHP:
ALTER TABLE `z_shop_offer` ADD `bought` INT( 11 ) NOT NULL DEFAULT '0';
If you have any suggestions as to the script - WRITE!
Thanks, REP ++!
Last edited: