I am trying to make something similar to Everquests Magelo website but am running into problems.
If you visit EQ Magelo
Hover over an item it pops up a window that shows the 'stats' of that item. If you look at the bottom of that page it shows slot 1, Type 8, then a name, and a link to an 'Augmentation'. This is what I am trying to do.
I have gotten it so it it shows the name of the Augmentation I want it to, but I can not seem to get it to link to the the augmentation.
Another issue is combining the 'stats' of the two items. So it shows the stats of the inital item PLUS the augmentation in the items widow.
Here is the code I have so far.
}
$augObj = getaugIDs($row['id'], $charid, $wearLoc);
if($row['augslot1type']>0){
$itemStats[$wearLoc] .= 'Slot 1, type ' . $row['augslot1type'] . ": ";
if( $augObj['augslot1']['id'] != 0 )
$itemStats[$wearLoc] .= "{$augObj['augslot1']['name']}<br>";
else $itemStats[$wearLoc] .= "empty<br>";
}
if($row['augslot2type']>0){
$itemStats[$wearLoc] .= 'Slot 2, type ' . $row['augslot2type'] . ": ";
if( $augObj['augslot2']['id'] != 0 )
$itemStats[$wearLoc] .= "{$augObj['augslot2']['name']}<br>";
else $itemStats[$wearLoc] .= "empty<br>";
}
if($row['augslot3type']>0){
$itemStats[$wearLoc] .= 'Slot 3, type ' . $row['augslot3type'] . ": ";
if( $augObj['augslot3']['id'] != 0 )
$itemStats[$wearLoc] .= "{$augObj['augslot3']['name']}<br>";
else $itemStats[$wearLoc] .= "empty<br>";
}
if($row['augslot4type']>0){
$itemStats[$wearLoc] .= 'Slot 4, type ' . $row['augslot4type'] . ": ";
if( $augObj['augslot4']['id'] != 0 )
$itemStats[$wearLoc] .= "{$augObj['augslot4']['name']}<br>";
else $itemStats[$wearLoc] .= "empty<br>";
}
if($row['augslot5type']>0){
$itemStats[$wearLoc] .= 'Slot 5, type ' . $row['augslot5type'] . ": ";
if( $augObj['augslot5']['id'] != 0 )
$itemStats[$wearLoc] .= "{$augObj['augslot5']['name']}<br>";
else $itemStats[$wearLoc] .= "empty<br>";
}
}
function getaugIDs($itemid, $charid, $slotid){
$returnObj = array();
// First see if the item has any augs to process
$augSlotsQuery = "select augslot1, augslot2, augslot3, augslot4, augslot5 from inventory where charid = $charid AND slotid = $slotid AND itemid = $itemid limit 1";
$results = mysql_query($augSlotsQuery);
if(! $results )
return $returnObj;
$rtn = mysql_fetch_assoc($results);
$returnObj['augslot1']['id'] = $rtn['augslot1'];
$returnObj['augslot2']['id'] = $rtn['augslot2'];
$returnObj['augslot3']['id'] = $rtn['augslot3'];
$returnObj['augslot4']['id'] = $rtn['augslot4'];
$returnObj['augslot5']['id'] = $rtn['augslot5'];
mysql_free_result($results);
$itemInfoQuery = "select Name from items where id = {$returnObj['augslot1']['id']}";
for($i = 0; $i <= 5; $i++){
$res = mysql_query($itemInfoQuery);
if( mysql_error() ) continue;
$tmp = mysql_fetch_assoc($res);
$slot = "augslot" . $i;
$returnObj[$slot]['name'] = $tmp['Name'];
mysql_free_result($res);
unset($tmp);
unset($slot);
}
return $returnObj;
}
Any help is greatly appreciated!
Thank you in advance!