TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,913
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 459
  • Total: 459

[Block] EQDKP Recent Drops

Started by Inny, May 06, 2009, 11:54:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Inny

#30
yeha $$$ is the name.

Item_cache table is created when you have Itemstats.

I will check the code in my T7 database, intentionally left Itemstats on T8 behind.

EDIT:

On my database with itemstats i get this error:
Table './&&&/item_cache' is marked as crashed and should be repaired

So i guess itemstats tables are installed differently on EQDKP plus, while they dont exist in normal un-modded installations of EQDKP.

If you make it work for normal EQDKP installations will be perfect :P

MrDuck

I see,well itemstats are pretty much needed to get the item name and such, or else i'd basically have to write them anyway. The name could be dynamically obtained from wowhead i guess, but it may require unneccessary load on wowhead servers and eventually be pretty slow, though i didn't play with that at all yet.

However, the error you posted points more likely to some database corruption, did you try the repair table thing in phpmyadmin?

Inny

on to the next error after fixing.

Error:
Unknown column 'eqdkp_items.game_itemid' in 'field list'

Checked the item_cache, item id is under item_id and not game_itemid

In eqdkp_items the item id is located under item_ctrt_wowitemid (for me at least)

MrDuck

Quote from: Inny on May 27, 2009, 04:15:29 PM
on to the next error after fixing.

Error:
Unknown column 'eqdkp_items.game_itemid' in 'field list'

Checked the item_cache, item id is under item_id and not game_itemid

In eqdkp_items the item id is located under item_ctrt_wowitemid (for me at least)
I see, well i'm using the game_itemid (that's not the item_cache table btw, it's in eqdkp_items) 'cause i've noticed i have 2 items in database with empty item_ctrt_wowitemid, while these with game_itemid are all 100% correct. I'll still try to set up the basic eqdkp and see if there are any differences so i could determine which dkp system is running and automatically pick the correct table structure, or i'll just make it configurable. I'll try to have it done today, lets see how it works out, i'll let you know asap.

MrDuck

Ok,try this. The second query should work in both versions (honestly i didn't bother installing itemstats in the simple eqdkp, so it's untested there, but seeing the DB structure,it should work), first seems more solid to me (i prefer matching int over a string, even though it's probably not needed). So, i think it's clear, in the initial section, set PLUS definition to 0 for EQDKP normal, 1 for EQDKP+, 0 works in both cases but i don't like it that much :P Report back how it works or what error it gives, if any, please :-) Thanks for feedback btw :P


if (!ini_get('display_errors')) { // Debug part
    ini_set('display_errors', 1);
    //echo "PHP Display Errors Enabled<br />\n";
}

require "./eqdkp/config.php";

define("DBHOST", $dbhost);
define("DBNAME", $dbname);
define("DBUSER", $dbuser);
define("DBPASS", $dbpass);
define("ITEMS", 7);           //How many items will we list?
define("PLUS" , 0);            //Is it EQDKP or EQDKP+? (1 for plus, 0 for the basic version)
$link = mysql_connect(DBHOST, DBUSER, DBPASS);
if (!$link) {
    die('Could not connect to EQDKP database: ' . mysql_error());
}

if(PLUS) {
  $sql = "SELECT
  eqdkp_items.item_date AS date, eqdkp_items.item_buyer AS looter, eqdkp_items.game_itemid AS itemid, eqdkp_items.item_value AS cost,
  item_cache.item_name AS name, item_cache.item_color AS  quality, item_cache.item_icon AS icon,
  eqdkp_members.member_class_id AS class
  FROM eqdkp_items, eqdkp_members, item_cache
  WHERE eqdkp_items.game_itemid = item_cache.item_id
  AND eqdkp_items.item_buyer = eqdkp_members.member_name
  ORDER BY date DESC LIMIT " . ITEMS . "
  ;";
}else{
  $sql = "SELECT
  eqdkp_items.item_date AS date, eqdkp_items.item_buyer AS looter, eqdkp_items.game_itemid AS itemid, eqdkp_items.item_value AS cost,
  item_cache.item_name AS name, item_cache.item_color AS  quality, item_cache.item_icon AS icon,
  eqdkp_members.member_class_id AS class
  FROM eqdkp_items, eqdkp_members, item_cache
  WHERE eqdkp_items.item_name = item_cache.item_name
  AND eqdkp_items.item_buyer = eqdkp_members.member_name
  ORDER BY date DESC LIMIT " . ITEMS . "
  ;";

}
// date, looter, itemid, cost, name, quality, icon, class

$result = mysql_db_query(DBNAME, $sql, $link) or die("Error in the MySQL query: <br />".$sql."<br /><br /><br />".mysql_error());

$i=0;
while($row = mysql_fetch_assoc($result)) {
  switch ($row['quality']) {    //item color
    case 'orangename':
      $q = "ff8000";
      break;
    case 'purplename':
      $q = "a335ee";
      break;
    default:
      $q = "000";
  }
  switch ($row['class']) {      //player class color
    case 7: //druid FF7C0A
      $c = "FF7C0A";
      break;
    case 10: //warlock 9382C9
      $c = "9382C9";
      break;
    case 4: //hunter AAD372
      $c = "AAD372";
      break;
    case 12: //warrior C69B6D
      $c = "C69B6D";
      break;
    case 13: //paladin F48CBA
      $c = "E47CAA";
      break;
    case 11: //mage 68CCEF
      $c = "68CCEF";
      break;
    case 6: //priest AAAAAA
      $c = "AAAAAA";
      break;
    case 9: //shaman 1A3CAA
      $c = "1A3CAA";
      break;
    case 2: //rogue FFF468
      $c = "DFD418";
      break;
    case 20: //deathknight C41F3B
      $c = "C41F3B";
      break;
    default:
      $c = "000";
  }
  if ($i > 0)
    echo "<hr style=\"height: 1px; margin: 0px; border: none; background-color: " . $q . "; color: " . $q . "\" />";
  else $i++;
  echo "<img src=\"http://static.wowhead.com/images/icons/small/" . $row['icon'] . ".jpg\" style=\"vertical-align: middle; padding: 0 -2px 0 -2px;\" />";
  echo "<span style=\"color: #" . $c . "; vertical-align: middle; font-weight: bold;\">&nbsp;" . utf8_encode($row['looter']) . "</span>&nbsp;[" . $row['cost'] . "]<br />\n";
  echo "<a href=\"http://wowhead.com/?item=" . $row['itemid'] . "\" target=\"_blank\" style=\"color: #" . $q . "; text-decoration: none;\">";
  echo "[" . $row['name'] . "]</a>";
}

mysql_free_result($result);
mysql_close($link);


Inny

You have an item_cache table in frech EQDKP Install? What version you installed?

Now getting:
Table '$$$_$$$.item_cache' doesn't exist

MrDuck

#36
Quote from: Inny on May 27, 2009, 10:30:38 PM
You have an item_cache table in frech EQDKP Install? What version you installed?

Now getting:
Table '$$$_$$$.item_cache' doesn't exist
Well no not in fresh install, i thought that itemstats thing adds the table? thinking about it now, it may not be even needed, but i'm not sure if there's any other way to figure out the item quality without itemstats.


EDIT: on a side note, that item_cache is in fresh install of EQDKP+, but i think these itemstats for basic EQDKP are pretty much needed for a script like this to work. Could be done without, but some similar thing to itemstats would've been needed to be implemented or something like that to store information about these items.

Tyrock

great work..!!!!  :up:

but i have an Error, can someone help?


Parse error: syntax error, unexpected '&' in /mnt/web3/41/72/52098672/htdocs/Sources/Load.php(1745) : eval()'d code(48) : eval()'d code on line 6


SMF v1.1.9
TinyPortal v1.0 beta 3

plx plx plx :)

MrDuck

Quote from: Tyrock on June 02, 2009, 02:13:48 PM
great work..!!!!  :up:

but i have an Error, can someone help?


Parse error: syntax error, unexpected '&' in /mnt/web3/41/72/52098672/htdocs/Sources/Load.php(1745) : eval()'d code(48) : eval()'d code on line 6


SMF v1.1.9
TinyPortal v1.0 beta 3

plx plx plx :)
Well that seems quite weird, looking at the Load.php, but i can't seem to find any clue about what's going on there, though i have some modified version of the file (through mods ya know), so could you send me your line 1745 of Load.php? I don't think it'll help me much, but at least something to start with.

xthelocustx

Quote from: MrDuck on June 03, 2009, 11:01:10 PM
Quote from: Tyrock on June 02, 2009, 02:13:48 PM
great work..!!!!  :up:

but i have an Error, can someone help?


Parse error: syntax error, unexpected '&' in /mnt/web3/41/72/52098672/htdocs/Sources/Load.php(1745) : eval()'d code(48) : eval()'d code on line 6


SMF v1.1.9
TinyPortal v1.0 beta 3

plx plx plx :)
Well that seems quite weird, looking at the Load.php, but i can't seem to find any clue about what's going on there, though i have some modified version of the file (through mods ya know), so could you send me your line 1745 of Load.php? I don't think it'll help me much, but at least something to start with.


I get this same exact error.

Line:1745
$file_found = file_exists($filename) && eval('?' . '>' . rtrim(file_get_contents($filename))) !== false;

This website is proudly hosted on Crocweb Cloud Website Hosting.