Jump to content

Recommended Posts

I have a game build around a phpbb forum and ive just done some changes to how the item information is stored but know the page wont load atall ive no idea why when you try to open there just a blank page. could you try help me figure out whats wrong or atleast give me an idea of how i could find whats wrong.

 

Heres the code for the part i think that the errors on

adr_template_file('adr_inventory_body.tpl');
$template->assign_block_vars('main',array());

$sql = "SELECT s.*, i.* , q.item_quality_lang , t.item_type_lang , c.class_name FROM " . ADR_USER_ITEMS . " i
		LEFT JOIN " . ADR_SHOPS_ITEMS_TABLE . " s ON ( i.item_id = s.item_id )
		LEFT JOIN " . ADR_SHOPS_ITEMS_QUALITY_TABLE . " q ON ( s.item_quality = q.item_quality_id )
		LEFT JOIN " . ADR_SHOPS_ITEMS_TYPE_TABLE . " t ON ( s.item_type_use = t.item_type_id )
		LEFT JOIN " . ADR_CLASSES_TABLE . " c ON ( s.item_class_limit = c.class_id )
	WHERE i.item_user_id = $searchid
	AND i.item_in_shop = 0
	AND i.item_in_auction = 0
	AND i.item_in_guild = 0
	AND i.item_in_trade = 0
	AND i.item_in_warehouse = 0
	AND i.item_duration > 0
	AND i.item_auth = 0 
	AND i.item_monster_thief = 0 
	$cat_sql
	ORDER BY $order_by";
if( !($result = $db->sql_query($sql)) )
{
	adr_previous("Could not query user items", adr_character_inventory, '');
	//message_die(GENERAL_ERROR, 'Could not query users items', '', __LINE__, __FILE__, $sql);
}

if ( $row = $db->sql_fetchrow($result) )
{
	$i = 0;
	do
	{
		$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
		//
		// If item is usable, print link
		//
		$item_useable = ( file_exists('./adr/item_scripts/'. adr_get_lang($row['item_name']) .".$phpEx") ) ? '('. $lang['Adr_items_useable'] .')' : '';

		if ( $row['item_classes_list'] == 0 ) 
		{
			$listing_classes_print= $lang['Adr_items_type_all']; 
		}
		else 
		{
			$listing_classes_print = "";
			$listing_classes = explode(',',$row['item_classes_list']);
			for ($a = 0; $a < count($listing_classes); $a++)
			{
				$sql2 = "SELECT * FROM " . ADR_CLASSES_TABLE ."
						WHERE class_id = '".$listing_classes[$a]."'
						";
				$result2 = $db->sql_query($sql2); 
				if( !($result2 = $db->sql_query($sql2)) ) 
				{ 
					message_die(GENERAL_ERROR, 'Could not obtain classes information', "", __LINE__, __FILE__, $sql2); 
				} 
				$classes = mysql_fetch_array($result2);
				$listing_classes_print .= $classes['class_name'].", ";
			}
		}			

		//check for additional desciption info
		$extra_desc = '';
		if($row['item_extra_desc'] !== 0 || $row['item_extra_desc'] !== ""){
			$extra_desc = "<br>".$row['item_extra_desc'];
		}

		$template->assign_block_vars('main.items', array(
			"ROW_CLASS" => $row_class,
			"ITEM_NAME" => adr_get_lang($row['item_name']),
			"ITEM_DESC" => adr_get_lang($row['item_desc']).$extra_desc,
			"ITEM_IMG" => $row['item_icon'],
			"ITEM_QUALITY" => $lang[$row['item_quality_lang']],
			"ITEM_TYPE" => $lang[$row['item_type_lang']],
			"ITEM_LIMIT" => $listing_classes_print,
			"ITEM_DURATION" => $row['item_duration'],
			"ITEM_DURATION_MAX" => $row['item_duration_max'],
			"ITEM_POWER" => $row['item_power'],
			"ITEM_WEIGHT" => $row['item_weight'],
			"ITEM_PRICE" => $row['item_price'],
			"ITEM_ID" => $row['item_number'],
			"U_ITEM_GIVE" => append_sid("adr_character_inventory.$phpEx?mode=give&item_id=".$row['item_id']),
			"U_ITEM_SELL" => append_sid("adr_character_inventory.$phpEx?mode=sell&item_id=".$row['item_id']),
			"U_ITEM_EDIT" => append_sid("adr_character_inventory.$phpEx?mode=edit&item_id=".$row['item_id']),
			"U_ITEM_SHOP" => append_sid("adr_character_inventory.$phpEx?mode=shop&item_id=".$row['item_id']),
			"ITEM_USE" => $item_useable,
			"U_ITEM_INFO" => append_sid("adr_character_inventory.$phpEx?mode=view_item&item_owner_id=".$row['item_owner_id']."&item_id=".$row['item_id'].""),
		));

		if ( $user_id == $searchid )
		{
			$template->assign_block_vars("main.items.owner", array());
		}

		$i++;
	}
	while ( $row = $db->sql_fetchrow($result) );

}

		// Check if user has any Item Quests
		$sql = " SELECT * FROM " . ADR_QUEST_LOG_TABLE . "
	   		WHERE user_id = '$user_id'
	   		";
		$result = $db->sql_query($sql);
		if( !($result = $db->sql_query($sql)) )
	   		message_die(GENERAL_ERROR, 'Could not obtain required quest information', "", __LINE__, __FILE__, $sql);
		if ( $quest_log = $db->sql_fetchrow($result) )
		{
			//Update the Item Quest of the player
			do
			{
				$sql2 = " SELECT s.item_name FROM " . ADR_SHOPS_ITEMS_TABLE . " s, " . ADR_USER_ITEMS . " i
	   			WHERE i.item_user_id = '$user_id'
				AND s.item_name = '".$quest_log['quest_item_need']."'
	   			";
				$result2 = $db->sql_query($sql2);
				if( !($result2 = $db->sql_query($sql2)) )
	   				message_die(GENERAL_ERROR, 'No items found', "", __LINE__, __FILE__, $sql2);
				if ( $quest_log2 = $db->sql_fetchrow($result2) )
				{
					$sql3 = "UPDATE " . ADR_QUEST_LOG_TABLE . "
					set quest_item_have = quest_item_need 
					WHERE quest_item_need = '".$quest_log2['item_name']."' 
					AND user_id = '$user_id'
					";
					$result3 = $db->sql_query($sql3);
					if( !($result3 = $db->sql_query($sql3))  )
						message_die(GENERAL_ERROR, "Couldn't update quest", "", __LINE__, __FILE__, $sql3);
				}
				else
				{

					//delete the item in the quest database since either the user sold it, traded it or whatever
					$sql4 = "UPDATE " . ADR_QUEST_LOG_TABLE . "
					set quest_item_have = '' 
					WHERE quest_item_need = '".$quest_log['quest_item_need']."' 
					AND user_id = '$user_id'
					";
					$result4 = $db->sql_query($sql4);
					if( !($result4 = $db->sql_query($sql4)) )
						message_die(GENERAL_ERROR, "Couldn't update quest", "", __LINE__, __FILE__, $sql4);
				}
			}
			while($quest_log = $db->sql_fetchrow($result)) ;
		}

if ( $user_id == $searchid )
{
	$colspan = 9;
	$template->assign_block_vars("main.owner", array());

	// Delete broken items from users inventory
	$sql = " DELETE FROM " . ADR_USER_ITEMS . "
		WHERE item_duration < 1 
		AND item_user_id = $user_id ";
	if( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not delete broken items', '', __LINE__, __FILE__, $sql);
	}
}

$cat_sql = ( $cat ) ? 'AND s.item_type_use = '.$cat : '';
$sql = "SELECT count(*) AS total FROM " . ADR_USER_ITEMS ." i, " . ADR_SHOPS_ITEMS_TABLE . " s 
	WHERE i.item_user_id = $searchid
	AND i.item_in_shop = 0
	AND i.item_in_auction = 0
	AND i.item_in_guild = 0
	AND i.item_in_trade = 0
	AND i.item_duration > 0
	AND i.item_in_warehouse < 1
	AND s.item_monster_thief = 0  
	AND i.item_auth = 0 
	$cat_sql ";
if ( !($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, 'Error getting total users', '', __LINE__, __FILE__, $sql);
}
if ( $total = $db->sql_fetchrow($result) )
{
	$total_items = $total['total'];
	$pagination = generate_pagination("adr_character_inventory.$phpEx?".POST_USERS_URL."=$searchid&mode2=$mode2&order=$sort_order&cat=$cat", $total_items, $board_config['topics_per_page'], $start). ' ';	
}

$action_select = '<select name="mode">';
$action_select .= '<option value = "">' . $lang['Adr_items_select_action'] . '</option>';
$action_select .= '<option value = "give">' . $lang['Adr_items_give'] . '</option>';
$action_select .= '<option value = "use">' . $lang['Adr_items_use'] . '</option>';
$action_select .= '<option value = "sell">' . $lang['Adr_items_sell'] . '</option>';
$action_select .= '<option value = "delete">' . $lang['Dispose'] . '</option>';
$action_select .= '<option value = "warehouse">' . $lang['Adr_items_into_warehouse'] . '</option>';
$action_select .= '<option value = "shop">' . $lang['Adr_items_into_shop'] . '</option>';
$action_select .= '</select>';
$colspan=$colspan + 1;

// Check if power limit is enabled
if ( $adr_general['item_power_level'] == 1 )
{
	$lang_power = $lang['Adr_items_level'];
}
else
{
	$lang_power = $lang['Adr_items_power'];
}

$template->assign_vars(array(
	"COLSPAN" => $colspan,
	"ACTION_LIST" => $action_select,
	'SELECT_CAT' => $select_category,
	'PAGINATION' => $pagination,
	'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $total_items / $board_config['topics_per_page'] )), 
	"L_ITEM_NAME" => $lang['Adr_shops_categories_item_name'],
	"L_ITEM_DESC" => $lang['Adr_shops_categories_item_desc'],
	"L_ITEM_QUALITY" => $lang['Adr_items_quality'],
	"L_ITEM_POWER" => $lang_power,
	"L_ITEM_WEIGHT" => $lang['Adr_character_weight'],
	"L_ITEM_DURATION" => $lang['Adr_items_duration'],
	"L_ACTION" => $lang['Adr_items_action'],
	"L_SELECT_CAT" => $lang['Adr_items_select'],
	"L_ITEM_IMG" => $lang['Adr_races_image'],
	"L_ITEM_PRICE" => $lang['Adr_items_price'],
	"L_ITEM_TYPE" => $lang['Adr_items_type_use'],
	"L_ITEM_LIMIT" => $lang['Adr_items_class_limit'],
	'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'],
	'L_ORDER' => $lang['Order'],
	'L_SORT' => $lang['Sort'],
	'L_GOTO_PAGE' => $lang['Goto_page'],
	'L_SUBMIT' => $lang['Submit'],
	'L_CHECK_ALL' => $lang['Adr_check_all'],
	'L_UNCHECK_ALL' => $lang['Adr_uncheck_all'],
	'S_MODE_SELECT' => $select_sort_mode,
	'S_ORDER_SELECT' => $select_sort_order,
	"S_ITEMS_ACTION" => append_sid("adr_character_inventory.$phpEx?".POST_USERS_URL."=$searchid&mode2=$mode2&order=$sort_order&cat=$cat"),
	"S_HIDDEN_FIELDS" => $s_hidden_fields, 
));

 

ive stuck the entire file as an attachment if thatll be any help.

 

well thanks in advance for any help.

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/54098-solved-phpbb-help/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.