• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Requests GESIOR - Website Aplication

Piltrafa

Active Member
Joined
Nov 10, 2010
Messages
654
Reaction score
29
hello

I want the donor system lastitems

That people can see latest items that people bought on website.


LIKE THIS:
PHP:
Last items bought on servername
#
Pic Player Name Item Name Item Price Points Date
PHP:
Most bought items
#
Pic Item Name Purchased
Top 10 Donators
#
Player Name Purchased Items

Thanks,
Repped.
 
Before you do anything, you must first execute these SQL queries:
SQL:
ALTER TABLE `z_shop_history_item` CHANGE `offer_id` `offer_id` VARCHAR( 255 ) NOT NULL;
UPDATE `z_shop_history_item`, `z_shop_offer` SET `z_shop_history_item`.`offer_id` = `z_shop_offer`.`offer_name` WHERE `z_shop_history_item`.`offer_id` = `z_shop_offer`.`id`;
Only items bought after executing the 2 queries will be shown properly.

First script:
PHP:
<?PHP
if($config['site']['shop_system'] == 1) {
	$main_content .= '<center><table border="0" cellpadding="1" cellspacing="1" width="100%"><tr width="100%" bgcolor="#505050"><td colspan="5"><font color="white" size="4"><b>&nbsp;Last items bought on '.$config['server']['serverName'].'</b></font></td></tr><tr bgcolor="#D4C0A1"><td width="10%" align="center"><b>Picture</b></td><td width="25%" align="center"><b>Player Name</b></td><td width="25%" align="center"><b>Item Name</b></td><td width="10%" align="center"><b>Points</b></td><td width="50" align="center"><b>Date</b></td></tr>';

	$offer_list = $SQL->query('SELECT `to_name`, `price`, `offer_id`, `trans_start` FROM `z_shop_history_item` LIMIT 50;');
	while($data = $offer_list->fetch()) {
		$tmp = $SQL->query('SELECT `offer_type` FROM `z_shop_offer` WHERE `offer_name` = \''.$data['offer_id'].'\' LIMIT 1;')->fetch();
		if($tmp['offer_type'] == 'item')
		{
			$id = $SQL->query('SELECT `itemid1` FROM `z_shop_offer` WHERE `offer_name` = \''.$data['offer_id'].'\' LIMIT 1;')->fetch();
			$main_content .= '<tr bgcolor="#F1E0C6"><td align="center"><img src="http://otland.net/images/items/'.$id['itemid1'].'.gif"></td><td align="center"><b>'.$data['to_name'].'</b></td><td align="center">'.$data['offer_id'].'</td><td align="center">'.$data['price'].'</td><td align="center">'.date("j F Y, H:i:s", $data['trans_start']).'</td></tr>';
		}
	}
	$main_content .= '</table><br />';
}
else
	$main_content .= '<br /><center><b>Shop System is currently disabled for this server.Please ask the admin for more information.</b></center>';
?>
Second script:
PHP:
<?PHP
if($config['site']['shop_system'] == 1) {
	$main_content .= '<center><table border="0" cellpadding="1" cellspacing="1" width="100%"><tr width="100%" bgcolor="#505050"><td colspan="5"><font color="white" size="4"><b>&nbsp;Most bought items</b></font></td></tr><tr bgcolor="#D4C0A1"><td width="5%" align="center"><b>Picture</b></td><td width="25%" align="center"><b>Item Name</b></td><td width="5%" align="center"><b>Purchased</b></td></tr>';

	$offer_list = $SQL->query('SELECT `offer_id`, count( offer_id ) AS `total` FROM `z_shop_history_item` GROUP BY `offer_id` ORDER BY `total` DESC;');
	while($data = $offer_list->fetch()) {
		$tmp = $SQL->query('SELECT `offer_type` FROM `z_shop_offer` WHERE `offer_name` = \''.$data['offer_id'].'\' LIMIT 1;')->fetch();
		if($tmp['offer_type'] == 'item')
		{
			$id = $SQL->query('SELECT `itemid1` FROM `z_shop_offer` WHERE `offer_name` = \''.$data['offer_id'].'\' LIMIT 1;')->fetch();
			$main_content .= '<tr bgcolor="#F1E0C6"><td align="center"><img src="http://otland.net/images/items/'.$id['itemid1'].'.gif"></td><td align="center">'.$data['offer_id'].'</td><td align="center">'.$data['total'].'</td></tr>';
		}
	}
	$main_content .= '</table><br />';
}
else
	$main_content .= '<br /><center><b>Shop System is currently disabled for this server.Please ask the admin for more information.</b></center>';
?>
Third script
PHP:
<?PHP
if($config['site']['shop_system'] == 1) {
	$main_content .= '<center><table border="0" cellpadding="1" cellspacing="1" width="100%"><tr width="100%" bgcolor="#505050"><td colspan="5"><font color="white" size="4"><b>&nbsp;Top 10 Donators</b></font></td></tr><tr bgcolor="#D4C0A1"><td width="25%" align="center"><b>Player Name</b></td><td width="5%" align="center"><b>Purchased Items</b></td></tr>';

	$offer_list = $SQL->query('SELECT `to_name`, count(`to_name`) AS `total` FROM `z_shop_history_item` GROUP BY `to_name` ORDER BY `total` DESC LIMIT 10;');
	while($data = $offer_list->fetch()) {
		$id = $SQL->query('SELECT `itemid1` FROM `z_shop_offer` WHERE `offer_name` = \''.$data['offer_id'].'\' LIMIT 1;')->fetch();
		$main_content .= '<tr bgcolor="#F1E0C6"><td align="center"><b>'.$data['to_name'].'</b></td><td align="center">'.$data['total'].'</td></tr>';
	}
	$main_content .= '</table><br />';
}
else
	$main_content .= '<br /><center><b>Shop System is currently disabled for this server.Please ask the admin for more information.</b></center>';
?>
 
Last edited:
First Script:
Table work fine, but when anyone bought any item, none appear there.

Second Script:
Work Fine, but images dind't know why not appear.

Third Script:
Work Perfect!

THANKS.
 
Last edited:
Help Last items

hello, i have problems in the second php last items, in my web no showing details and is empty.. ¿help me?
show in my web: RL Map War - Latest News and seach module
Give rep++
Sorry no speak inglish..^_^
 
Last edited:
Hi, nice.. i have one problem in the second script last items.. the problem is Not showing details and no funtion.. help me.. show in my web for more details, no speack inglish, is RL Map War - Latest News please i give rep++
 
Last edited:
Before you do anything, you must first execute these SQL queries:
SQL:
ALTER TABLE `z_shop_history_item` CHANGE `offer_id` `offer_id` VARCHAR( 255 ) NOT NULL;
UPDATE `z_shop_history_item`, `z_shop_offer` SET `z_shop_history_item`.`offer_id` = `z_shop_offer`.`offer_name` WHERE `z_shop_history_item`.`offer_id` = `z_shop_offer`.`id`;
Only items bought after executing the 2 queries will be shown properly.

First script:
PHP:
<?PHP
if($config['site']['shop_system'] == 1) {
	$main_content .= '<center><table border="0" cellpadding="1" cellspacing="1" width="100%"><tr width="100%" bgcolor="#505050"><td colspan="5"><font color="white" size="4"><b>&nbsp;Last items bought on '.$config['server']['serverName'].'</b></font></td></tr><tr bgcolor="#D4C0A1"><td width="10%" align="center"><b>Picture</b></td><td width="25%" align="center"><b>Player Name</b></td><td width="25%" align="center"><b>Item Name</b></td><td width="10%" align="center"><b>Points</b></td><td width="50" align="center"><b>Date</b></td></tr>';

	$offer_list = $SQL->query('SELECT `to_name`, `price`, `offer_id`, `trans_start` FROM `z_shop_history_item` LIMIT 50;');
	while($data = $offer_list->fetch()) {
		$tmp = $SQL->query('SELECT `offer_type` FROM `z_shop_offer` WHERE `offer_name` = \''.$data['offer_id'].'\' LIMIT 1;')->fetch();
		if($tmp['offer_type'] == 'item')
		{
			$id = $SQL->query('SELECT `itemid1` FROM `z_shop_offer` WHERE `offer_name` = \''.$data['offer_id'].'\' LIMIT 1;')->fetch();
			$main_content .= '<tr bgcolor="#F1E0C6"><td align="center"><img src="http://otland.net/images/items/'.$id['itemid1'].'.gif"></td><td align="center"><b>'.$data['to_name'].'</b></td><td align="center">'.$data['offer_id'].'</td><td align="center">'.$data['price'].'</td><td align="center">'.date("j F Y, H:i:s", $data['trans_start']).'</td></tr>';
		}
	}
	$main_content .= '</table><br />';
}
else
	$main_content .= '<br /><center><b>Shop System is currently disabled for this server.Please ask the admin for more information.</b></center>';
?>
Second script:
PHP:
<?PHP
if($config['site']['shop_system'] == 1) {
	$main_content .= '<center><table border="0" cellpadding="1" cellspacing="1" width="100%"><tr width="100%" bgcolor="#505050"><td colspan="5"><font color="white" size="4"><b>&nbsp;Most bought items</b></font></td></tr><tr bgcolor="#D4C0A1"><td width="5%" align="center"><b>Picture</b></td><td width="25%" align="center"><b>Item Name</b></td><td width="5%" align="center"><b>Purchased</b></td></tr>';

	$offer_list = $SQL->query('SELECT `offer_id`, count( offer_id ) AS `total` FROM `z_shop_history_item` GROUP BY `offer_id` ORDER BY `total` DESC;');
	while($data = $offer_list->fetch()) {
		$tmp = $SQL->query('SELECT `offer_type` FROM `z_shop_offer` WHERE `offer_name` = \''.$data['offer_id'].'\' LIMIT 1;')->fetch();
		if($tmp['offer_type'] == 'item')
		{
			$id = $SQL->query('SELECT `itemid1` FROM `z_shop_offer` WHERE `offer_name` = \''.$data['offer_id'].'\' LIMIT 1;')->fetch();
			$main_content .= '<tr bgcolor="#F1E0C6"><td align="center"><img src="http://otland.net/images/items/'.$id['itemid1'].'.gif"></td><td align="center">'.$data['offer_id'].'</td><td align="center">'.$data['total'].'</td></tr>';
		}
	}
	$main_content .= '</table><br />';
}
else
	$main_content .= '<br /><center><b>Shop System is currently disabled for this server.Please ask the admin for more information.</b></center>';
?>
Third script
PHP:
<?PHP
if($config['site']['shop_system'] == 1) {
	$main_content .= '<center><table border="0" cellpadding="1" cellspacing="1" width="100%"><tr width="100%" bgcolor="#505050"><td colspan="5"><font color="white" size="4"><b>&nbsp;Top 10 Donators</b></font></td></tr><tr bgcolor="#D4C0A1"><td width="25%" align="center"><b>Player Name</b></td><td width="5%" align="center"><b>Purchased Items</b></td></tr>';

	$offer_list = $SQL->query('SELECT `to_name`, count(`to_name`) AS `total` FROM `z_shop_history_item` GROUP BY `to_name` ORDER BY `total` DESC LIMIT 10;');
	while($data = $offer_list->fetch()) {
		$id = $SQL->query('SELECT `itemid1` FROM `z_shop_offer` WHERE `offer_name` = \''.$data['offer_id'].'\' LIMIT 1;')->fetch();
		$main_content .= '<tr bgcolor="#F1E0C6"><td align="center"><b>'.$data['to_name'].'</b></td><td align="center">'.$data['total'].'</td></tr>';
	}
	$main_content .= '</table><br />';
}
else
	$main_content .= '<br /><center><b>Shop System is currently disabled for this server.Please ask the admin for more information.</b></center>';
?>

first script and second anf d thired can u explain where to add them? i make new one in httdocs or in somewhere???
 
first script and second anf d thired can u explain where to add them? i make new one in httdocs or in somewhere???
Make new .php files in htdocs, one for each script!
Find the part where file includes and subtopics are defined in index.php, copy and edit them accordingly!
Also edit layout.php for the new options to show up in navbar.
 
if anyone uses most bought item where it says

this
$main_content .= '<tr bgcolor="#F1E0C6"><td align="center"><img src="http://otland.net/images/items/'.$id['itemid1'].'.gif"></td><td align="center">'.$data['offer_id'].'</td><td align="center">'.$data['total'].'</td></tr>';

use this instead
$main_content .= '<tr bgcolor="#F1E0C6"><td align="center"><img src="http://items.znote.eu/'.$id['itemid1'].'.gif"></td><td align="center">'.$data['offer_id'].'</td><td align="center">'.$data['total'].'</td></tr>';

works 100% :)
 
Back
Top