Undefined offset:

Categorizes items in your guildbank(s)

Moderator: Mathos

Undefined offset:

Postby Bergler » Tue Feb 27, 2007 10:25 pm

Hello,
do someone know the reason of this fealure ?
--> Undefined offset:

Please look here and help me:

http://wow-bonfire.de/roster/addon.php? ... =guildbank

Thank a lot !

Greetings Peter
Bergler
WR.net Apprentice
WR.net Apprentice
 
Posts: 2
Joined: Sat Dec 09, 2006 9:19 pm

Undefined offset:

Postby jkibbles » Tue Feb 27, 2007 10:50 pm

Not sure if it helps, but usually the Undefined offset error is caused by undefined variables.

I don't have a gbank.php file in my install, so I can't check the code. Is this a file you are scripting yourself?
User avatar
jkibbles
WR.net Apprentice
WR.net Apprentice
 
Posts: 20
Joined: Wed Feb 21, 2007 7:05 am

Undefined offset:

Postby Ohlo » Thu Mar 01, 2007 7:15 am

I'm getting that exact same error:

Notice: Undefined offset: 1 in /home/hbwow/public_html/roster/addons/guildbank/gbank.php on line 247

Notice: Undefined offset: 2 in /home/hbwow/public_html/roster/addons/guildbank/gbank.php on line 247


If you find or get an answer, let me know...
Image
User avatar
Ohlo
WR.net Apprentice
WR.net Apprentice
 
Posts: 50
Joined: Tue Nov 28, 2006 8:59 am
Location: Knoxville, TN

Undefined offset:

Postby Bergler » Fri Mar 02, 2007 5:04 pm

No, I didn't greate the code on my side. It's the official guildbank 3rd party addon from the download section of this homepage. I got this failure first at the WOW game update 2.0.
Bergler
WR.net Apprentice
WR.net Apprentice
 
Posts: 2
Joined: Sat Dec 09, 2006 9:19 pm

Undefined offset:

Postby Fangorn » Sat Mar 03, 2007 1:49 pm

Well the script seems to fail on this line:

Code: Select all

$real_itemid = $itemid_array[0].':'.$itemid_array[1].':'.$itemid_array[2];


$itemid_array is built with the item_id values from the items table, so you probably have invalid item ids in your database for your guildbank characters.

Try the following SQL query:

Code: Select all

DELETE FROM roster_items
WHERE item_id NOT LIKE '%:%:%'
;


Does it fix your issue?


- Fang
Last edited by Fangorn on Sat Mar 03, 2007 1:50 pm, edited 1 time in total.
ImageImageImage
User avatar
Fangorn
WR.net Apprentice
WR.net Apprentice
 
Posts: 35
Joined: Mon Jul 24, 2006 4:26 am
Location: Ashburn, Virginia, USA

Re: Undefined offset:

Postby Skeeziks » Thu Mar 15, 2007 3:14 pm

Fangorn wrote:
Code: Select all

DELETE FROM roster_items
WHERE item_id NOT LIKE '%:%:%'
;


Does it fix your issue?


- Fang


I was having the same exact problem and doing this query fixed it. Thanks Fang. =)
Skeeziks
WR.net Apprentice
WR.net Apprentice
 
Posts: 2
Joined: Wed Jan 03, 2007 12:40 pm

Re: Undefined offset:

Postby Thorstone » Mon Mar 26, 2007 5:08 pm

Skeeziks wrote:
Fangorn wrote:
Code: Select all

DELETE FROM roster_items
WHERE item_id NOT LIKE '%:%:%'
;


Does it fix your issue?


- Fang


I was having the same exact problem and doing this query fixed it. Thanks Fang. =)


Well the problem is just fixed one time.
After another uniuploader run. the problem comes back ..

Might be something in character profiler ?
Thorstone
WR.net Apprentice
WR.net Apprentice
 
Posts: 8
Joined: Thu Aug 24, 2006 3:33 am

Re: Undefined offset:

Postby Thorstone » Mon Mar 26, 2007 5:16 pm

Thorstone wrote:
Skeeziks wrote:
Fangorn wrote:
Code: Select all

DELETE FROM roster_items
WHERE item_id NOT LIKE '%:%:%'
;


Does it fix your issue?


- Fang


I was having the same exact problem and doing this query fixed it. Thanks Fang. =)


Well the problem is just fixed one time.
After another uniuploader run. the problem comes back ..

Might be something in character profiler ?


a problematic item is :

Item_name=Bank Contents
item_parent=bags
item_slot=Bank Bag 0
item_id= <empty>

same applies to Keying.
Last edited by Thorstone on Mon Mar 26, 2007 5:30 pm, edited 1 time in total.
Thorstone
WR.net Apprentice
WR.net Apprentice
 
Posts: 8
Joined: Thu Aug 24, 2006 3:33 am

Re: Undefined offset:

Postby Thorstone » Mon Mar 26, 2007 5:47 pm

quick fix:

file gbank.php

after lines 235:
Code: Select all
while($itemArrayRow = $wowdb->getrow($DBitemArray))^M
{

add in line 237:
Code: Select all
 if ($itemArrayRow['item_id']!='') {


and then after line in line 266
Code: Select all
  $itemsarray[$category][$real_itemid]['banker'][$itemArrayRow['member_id']] += $itemArrayRow['item_quantity'];^M
}

add in line 268
Code: Select all
}


This worked for me :)
Thorstone
WR.net Apprentice
WR.net Apprentice
 
Posts: 8
Joined: Thu Aug 24, 2006 3:33 am

Re: Undefined offset:

Postby Shroom » Fri Mar 30, 2007 6:09 pm

That code works great - as long as you remove the ^M :thumright:

I have shown the whole segment from 235 for easy copy paste

Code: Select all
// Process the results of the item-query on the database
$itemsarray = array();
while($itemArrayRow = $wowdb->getrow($DBitemArray))
{
   if ($itemArrayRow['item_id']!='') {
      if ($category = CheckCategory2($itemArrayRow['item_tooltip'], $itemArrayRow['item_id']))
   {
      // The CategoryID check succeeded so this is a Wanted item (probably :)
      // Let's shove it in the array using the following array schema:
      // $items[$catagory][$realitemid] = Array with a Per Banker quantity as well
      // From the Query we get the following:
      //   member_name, member_id, item_name, item_parent, item_slot, item_color, item_id, item_texture, item_quantity, item_tooltip, item_id, real_itemid, total_quantity

//      $real_itemid = $itemArrayRow['real_itemid'];  // Changed to item_id to solve duplicate real_itemid numbers for different items
      $itemid_array = explode(':', $itemArrayRow['item_id']);
      $real_itemid = $itemid_array[0].':'.$itemid_array[1].':'.$itemid_array[2];
      $itemsarray[$category][$real_itemid]['item_name'] = $itemArrayRow['item_name'];
      $itemsarray[$category][$real_itemid]['item_color'] = $itemArrayRow['item_color'];
      $itemsarray[$category][$real_itemid]['item_id'] = $itemArrayRow['item_id'];
      $itemsarray[$category][$real_itemid]['item_texture'] = $itemArrayRow['item_texture'];
      $itemsarray[$category][$real_itemid]['item_tooltip'] = $itemArrayRow['item_tooltip'];
      $itemsarray[$category][$real_itemid]['item_parent'] = $itemArrayRow['item_parent'];
      if (!isset($itemsarray[$category][$real_itemid]['quantity']))
      {
         $itemsarray[$category][$real_itemid]['quantity'] = 0;
      }
      $itemsarray[$category][$real_itemid]['quantity'] += $itemArrayRow['item_quantity'];

      // Adding the Per Banker quantity inside the array
      if (!isset($itemsarray[$category][$real_itemid]['banker'][$itemArrayRow['member_id']]))
      {
         $itemsarray[$category][$real_itemid]['banker'][$itemArrayRow['member_id']] = 0;
      }
  $itemsarray[$category][$real_itemid]['banker'][$itemArrayRow['member_id']] += $itemArrayRow['item_quantity'];
}
}
}


This goes from line 235 to before
Code: Select all
"// Set the color of the Filter and Result table border"
Shroom
WR.net Apprentice
WR.net Apprentice
 
Posts: 1
Joined: Fri Mar 30, 2007 6:04 pm


Return to Categorized Guild Bank

Who is online

Users browsing this forum: No registered users and 1 guest

cron