






<?php
/**
*
* @package - phpBB3 UPS Easy Shop
* @version $Id: shop.php 247 2010-08-24 16:16:48Z femu $
* @copyright (c) 2010 Wuerzi - http://spieleresidenz.de and femu - http://die-muellers.org
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/shop/functions_shop.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup(array('mods/shop', 'mods/points'));
// Load shop template
$template->set_filenames(array(
'body' => 'displaycase_body.html')
);
$useridnumber = $user->data['user_id'];
$result = mysql_query ( "SELECT *
FROM phpbb_shop_items_user
WHERE user = $useridnumber"
);
while($row = mysql_fetch_array($result))
{
$itemnumber = $row['item'];
$result2 = mysql_query ( "SELECT *
FROM phpbb_shop_items
WHERE item = $itemnumber"
);
while($row = mysql_fetch_array($result2))
{
$itemimage = '<a href="' . $phpbb_root_path . 'images/shop_icons/' . $row['icon'] . '" onclick=" window.open(this.href); return false" title="' . $user->lang['SHOP_HIGHSLIDE_CLICK'] . '"><img src="' . $phpbb_root_path . 'images/shop_icons/' . $row['icon'] . '" alt="' . $user->lang['SHOP_HIGHSLIDE_CLICK'] . '" /></a>';
$template->assign_block_vars('item_list', array(
'ICON' => $itemimage
));
}
}
// $result = mysql_query("SELECT * FROM phpbb_shop_items_user");
// while($row = mysql_fetch_array($result))
// {
// $itemdisplay = $row
// echo $user->data['user_id'];
page_header($page_title);
page_footer();
?>











<?php
/**
*
* @package - phpBB3 UPS Easy Shop
* @version $Id: shop.php 247 2010-08-24 16:16:48Z femu $
* @copyright (c) 2010 Wuerzi - http://spieleresidenz.de and femu - http://die-muellers.org
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/shop/functions_shop.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup(array('mods/shop', 'mods/points'));
// Load shop template
$template->set_filenames(array(
'body' => 'trophycase_body.html')
);
//Here is where we add the 'trophycase_order' row to the 'phpbb_shop_items' table.
// $query = "SELECT * FROM phpbb_shop_items";
// $result = mysql_query($query) or die(mysql_error());
// $sql = "ALTER TABLE " . $table_prefix . "shop_items
// ADD trophycase_order MEDIUMINT(8) NOT NULL DEFAULT '0'";
// $db->sql_query($sql);
//Finished adding the trophycase row
//Here is where we combine our 'items' and 'items_user' tables together
//and order the items based on the 'trophycase_order'
$useridnumber = $user->data['user_id'];
$alliteminfo= array(); // All rows go in here
$newquery= mysql_query ( "
SELECT phpbb_shop_items_user.user,
phpbb_shop_items_user.item,
phpbb_shop_items.item,
phpbb_shop_items.icon,
phpbb_shop_items.trophycase_order
FROM phpbb_shop_items_user
INNER JOIN phpbb_shop_items
ON phpbb_shop_items_user.item = phpbb_shop_items.item
WHERE phpbb_shop_items_user.user = $useridnumber
ORDER BY trophycase_order ASC
"
); // Execute
while( $row= mysql_fetch_assoc( $newquery ) ) $alliteminfo[$row['trophycase_order']]= $row; // Enumerate
mysql_free_result( $newquery ); // Release
$aForTemplate= array();
for( $iItem= 0; $iItem< 25; $iItem++ )
{
if ($iItem != $alliteminfo[$iItem]['trophycase_order'])
{
$aForTemplate['ICON'. $iItem]= '<a href="'. $phpbb_root_path. 'images/shop_icons/noicon.png'. $alliteminfo[$iItem]['icon']. '" onclick="window.open( this.href ); return false" title="'. $user-> lang['SHOP_HIGHSLIDE_CLICK']. '"><img src="'. $phpbb_root_path. 'images/shop_icons/noicon.png'. $alliteminfo[$iItem]['icon']. '" alt="'. $user-> lang['SHOP_HIGHSLIDE_CLICK']. '" /></a>';
}
else
{
$aForTemplate['ICON'. $iItem]= '<a href="'. $phpbb_root_path. 'images/shop_icons/'. $alliteminfo[$iItem]['icon']. '" onclick="window.open( this.href ); return false" title="'. $user-> lang['SHOP_HIGHSLIDE_CLICK']. '"><img src="'. $phpbb_root_path. 'images/shop_icons/'. $alliteminfo[$iItem]['icon']. '" alt="'. $user-> lang['SHOP_HIGHSLIDE_CLICK']. '" /></a>';
}
}
// Multiple values at once for the block "item_list"
// Keep in mind that you're handing over an array which doesn't need to be built just here in place - it can be rendered earlier already with its keys and values
$template-> assign_block_vars
(
'item_list'
, $aForTemplate
);
page_header($page_title);
page_footer();
?>

Return to phpBB3 Coding Assistance
Users browsing this forum: No registered users and 11 guests