This site makes extensive use of JavaScript.
Please enable JavaScript in your browser.
Live
PTR
10.2.7
PTR
10.2.6
Beta
Add Wowhead tooltips to your forums or CMS.
Return to board index
Post by
Lockslap
Items with gems and/or enchants seems to cause a problem. The same problem seen on the test site here: (Note the PHP errors at the top of the page)
http://wowhead.crackpot.us/test/viewtopic.php?f=1&t=8
oh that's not an error, its debugging that i forgot to remove. lol woops
UPDATE
I have uploaded a fixed version of wowhead_item.php (the file causing the error) and you can get it
here
. Just download it, unzip, and upload to the includes folder where your script is located.
Or you can fix it manually by opening wowhead_item.php and look for the line: print_r($args); located somewhere around line 91 (according to my PHP editor). Remove that line, then save the file back to your site.
Post by
Lockslap
HAPPY BIRTHDAY TO THIS SCRIPT
That's right, the script is now one year old!
Post by
330429
This post was from a user who has deleted their account.
Post by
Verderf
For some reason this item shows up as "item not found:("
Rusted-Link Spiked Gauntlets
Post by
Talonos
IDs are not supported when using craft or itemset. Unfortunately, with the way I have to get non-item objects its generally hit or miss, especially when using a language other than English.
On a side note, I have undertaken a new project which will allow you to upload your WoW cache files (more specifically itemcache.wdb) and it will parse it and add all of the items in your cache to this script's MySQL cache. Just the small detail of figuring out if it is even possible with PHP. I have a Windows program that exports your itemcache to an Excel spreadsheet, seems to work well. I currently have 12,799 items in my WoW cache. Now let's find out if I can export it to my MySQL cache.
now this is a very good idea if its at all possible coz like others i've had to transfer providers and they hav remote server transfers DISABLED which in line makes your brilliant script totally useless and me trying to sort list of best gear/glyphs/enchants/gems this is a !@#$% as it makes a simple thing to do VERY hard and the import of your sort of sql database can fix that error
on that note i'd like to know if theres any progress on this project you've now taken on?
Post by
Lockslap
IDs are not supported when using craft or itemset. Unfortunately, with the way I have to get non-item objects its generally hit or miss, especially when using a language other than English.
On a side note, I have undertaken a new project which will allow you to upload your WoW cache files (more specifically itemcache.wdb) and it will parse it and add all of the items in your cache to this script's MySQL cache. Just the small detail of figuring out if it is even possible with PHP. I have a Windows program that exports your itemcache to an Excel spreadsheet, seems to work well. I currently have 12,799 items in my WoW cache. Now let's find out if I can export it to my MySQL cache.
now this is a very good idea if its at all possible coz like others i've had to transfer providers and they hav remote server transfers DISABLED which in line makes your brilliant script totally useless and me trying to sort list of best gear/glyphs/enchants/gems this is a !@#$% as it makes a simple thing to do VERY hard and the import of your sort of sql database can fix that error
on that note i'd like to know if theres any progress on this project you've now taken on?
Unfortunately, it is not feasible to do it this way. The script would most likely take too long to run and timeout (depending on what your specific PHP setting is). I am going to try to work out a way to manage a database that people can download and then run the script to add it to their cache (the script's).
Post by
Talonos
well yea php would proberly time out, possibly theres a program where we could convert it to say csv or something then use a php script to input that into a database actually i'll post php code i use to import from csv to sql if that helps u at all
<?
include "connect.php";
if(isset($_POST))
{
$filename=$_POST;
$handle = fopen("$filename", "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE)
{
$import="INSERT into imba2(name,class,spec,role,normal,best,warnings,warnings2,normal2,best2) values('$data','$data','$data','$data','$data','$data','$data','$data','$data','$data')";
mysql_query($import) or die(mysql_error());
}
fclose($handle);
print "Import done";
}
else
{
print "<form action='alliance.php' method='post'>";
print "Type file name to import:<br>";
print "<input type='text' name='filename' size='20'><br>";
print "<input type='submit' name='submit' value='submit'></form>";
}
?>
i hope this helps coz possibly u might be able to convert to csv already
Post by
Lockslap
well yea php would proberly time out, possibly theres a program where we could convert it to say csv or something then use a php script to input that into a database actually i'll post php code i use to import from csv to sql if that helps u at all
<?
include "connect.php";
if(isset($_POST))
{
$filename=$_POST;
$handle = fopen("$filename", "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE)
{
$import="INSERT into imba2(name,class,spec,role,normal,best,warnings,warnings2,normal2,best2) values('$data','$data','$data','$data','$data','$data','$data','$data','$data','$data')";
mysql_query($import) or die(mysql_error());
}
fclose($handle);
print "Import done";
}
else
{
print "<form action='alliance.php' method='post'>";
print "Type file name to import:<br>";
print "<input type='text' name='filename' size='20'><br>";
print "<input type='submit' name='submit' value='submit'></form>";
}
?>
i hope this helps coz possibly u might be able to convert to csv already
I think there are programs that can do that, I'll look into it. Thanks for the code!
As it turns out, I already had one that can do it. The resulting file is still >6mb (for my cache), so PHP would still most likely timeout. Only problem is that I only need 3 fields from the CSV file (item id, name, and quality) and its going to be a pain to extract only the info I need. My plan is to have the SQL file containing the queries to propagate the SQL table an optional download for anyone wanting to use it. Also included would be a script to add it to SQL using the settings in the script's config.php. I would eventually like to have a database with all of Wow's supported languages.
Post by
Lockslap
A quick update on the itemcache thingie, I have it working and it is able to generate a SQL file that can be used to add the items to your script's cache.
One thing I need is for people who use the non-English WoW client to send me their itemcache.wdb. The file is located in the "cache" folder of your WoW installation. Send the file to tooltips@crackpot.us and I will create a SQL file for it.
Post by
Lockslap
English Item Cache Released!
That's right! This is my item cache from WoW and it currently contains 12,797 items. Please keep in mind that this is only for the English WoW client, and will not work with any other languages. If you want your native client supported then you must send me your "itemcache.wdb", which is located in the "Cache/WDB/{language}" folder, where {language} is your native language. Send it as an attachment to tooltips@crackpot.us and I will get it converted to the proper format.
I would really like to get someone's Russian item cache, so the script will work properly for people using Russian as their primary language. Wowhead's Russian XML feeds are still buggy.
To use this script simply put "cache_parser.php" and "itemcache.sql" into the base directory of your tooltip script (with parse.php and config.php) and then point your browser to "cache_parser.php". From there, select your language, check whether you want your current cache cleared (this is HIGHLY recommended, it doesn't check for duplicates), then click "Add Items". The script will do the rest and report any problems/successes it has.
Let me know how it works for everyone!
--craCkpot
Post by
Talonos
English Item Cache Released!
That's right! This is my item cache from WoW and it currently contains 12,797 items. Please keep in mind that this is only for the English WoW client, and will not work with any other languages. If you want your native client supported then you must send me your "itemcache.wdb", which is located in the "Cache/WDB/{language}" folder, where {language} is your native language. Send it as an attachment to tooltips@crackpot.us and I will get it converted to the proper format.
I would really like to get someone's Russian item cache, so the script will work properly for people using Russian as their primary language. Wowhead's Russian XML feeds are still buggy.
To use this script simply put "cache_parser.php" and "itemcache.sql" into the base directory of your tooltip script (with parse.php and config.php) and then point your browser to "cache_parser.php". From there, select your language, check whether you want your current cache cleared (this is HIGHLY recommended, it doesn't check for duplicates), then click "Add Items". The script will do the rest and report any problems/successes it has.
Let me know how it works for everyone!
--craCkpot
great work on the file mate ALLOT of info in there but i think ima try and streamline it a little for you some how possibly having the sql cmds set as a variable to bring the file size down a bit as allot of people use free providers and they have file size limits to stop them hosting large files (normally 512kb possibly more)
a quick attempt shows i can get it down a little using
INSERT INTO `{cache_table}` VALUES (1, 43285, 'Amulet of the Spell Flinger', 'Amulet of the Spell Flinger', 3, NULL, 'item', 'en', NULL, NULL);
instead of
INSERT INTO `{cache_table}` (`id`,`itemid`,`name`,`search_name`,`quality`,`type`,`lang`) VALUES (NULL, 43285, 'Amulet of the Spell Flinger', 'Amulet of the Spell Flinger', 3, 'item', 'en');
if u wonder why u get the 2 NULL on the end its because the item_cache file doesn't include the icon and icon_size value but thats easerly removed
i hope this helps you m8
i'll have a greater attempt tomorrow
Post by
Talonos
ok i've got that sql filesize down from 2.213mb to 1.677mb, this should be a little more comforting for people using free webhost solutions with filesize limits. atm i not got the time to get it down any lower right now but i know i can get it possibly around the 1mb size if craCkpot is ok with me doing it that way well anyways heres the link to the file:
English Item Cache 0.2
i'm sorry the file is on rapidshare but my host dooesn't allow me to have compressed formats downloadable :(
also the NULL points are left in so that theres no errors upon input to sql database but this does make it possible to adds terms to the files at a later date should that happen
Post by
Lockslap
ok i've got that sql filesize down from 2.213mb to 1.677mb, this should be a little more comforting for people using free webhost solutions with filesize limits. atm i not got the time to get it down any lower right now but i know i can get it possibly around the 1mb size if craCkpot is ok with me doing it that way well anyways heres the link to the file:
English Item Cache 0.2
i'm sorry the file is on rapidshare but my host dooesn't allow me to have compressed formats downloadable :(
also the NULL points are left in so that theres no errors upon input to sql database but this does make it possible to adds terms to the files at a later date should that happen
Get the file as small as you can, that's totally fine with me. Send it to me when you're done and I'll convert my script to make it the same way.
I still need itemcache.wdb from non-English WoW localizations so I can get a DB going for all of WoW's supported languages. Please send them to tooltips@crackpot.us, and don't try any funny business.
Update
After looking over your cache file you have it messed up. The first field should be
NULL
so that it will be automatically assigned an ID, and in the name you have neglected to escape the apostrophe (') to prevent any wrong parsing. Use PHP's function addslashes() to take care of that.
Update #2
I redid the code a little bit to shrink down the filesize of the SQL file. It is now down to ~300kb. The SQL queries are now generated on the fly by the cache_parser.php script. You can download it
here
.
Post by
Talonos
well after your update #2 in ur preivous post, looks like u've beat me to it now :) once again crackpot i got to congradualte you on a superb script and also the great time put into it to make it possibly the most reliable and most versatile wow itemstats mod there is and with the constiance in updates/features i'm proud to say that if you hav some sort of logo i can put on the bottom of my forum i will do so to prove its worthyness and i think allot of people would do the same aslo, heck just to make sure it works 100% ima change my provider today so more future updates/features will work instantly :)
thank you crackpot
Post by
Lockslap
well after your update #2 in ur preivous post, looks like u've beat me to it now :) once again crackpot i got to congradualte you on a superb script and also the great time put into it to make it possibly the most reliable and most versatile wow itemstats mod there is and with the constiance in updates/features i'm proud to say that if you hav some sort of logo i can put on the bottom of my forum i will do so to prove its worthyness and i think allot of people would do the same aslo, heck just to make sure it works 100% ima change my provider today so more future updates/features will work instantly :)
thank you crackpot
I really appreciate your kind words! If you really like the script please consider
donating
so I can get this script a domain of its instead of hosting on my personal site.
And if you're good with photoshop, feel free to make an image...I'm terrible at it.
Finally, I was thinking of naming the script Tipsy...thoughts? Suggestions?
Post by
Talonos
photoshop whats that ?¿? hehehe
tipsy sounds quite good tbh but googling that alone would cause chaos i think it possibly needs a more unique name but atm i can't think of one, wait until i'm tipsy then maube i'll come up with one lol
Post by
60445
This post was from a user who has deleted their account.
Post by
Talonos
'<USERNAME>'@'localhost' (using password: YES)
string(40) "Unable to connect to SQL host: localhost"
that error tell me right away, looks like you havn't setup the sql options in config.php in the root dir of the wowhead script
set up them options and see if it fixed
Post by
Lockslap
Hello crackpot, this is a great tool thanks for sorting this, however i have some problems that i hope you can assist with.
I get this error:
PHP Notice: in file /wowhead/includes/sqlhelper.php on line 30: mysql_connect() : Access denied for user '<USERNAME>'@'localhost' (using password: YES)
string(40) "Unable to connect to SQL host: localhost"
I get that error on the install that I have done. I've editted the info in the config.php file however the above error still displays. Link to the forums here:
http://asgard.darkstargamers.com/forums/viewtopic.php?f=4&t=1951
I have already entered my mysql database info in the config.php file so i'm unsure why it comes up like this.
When i try to run the create_table.php file, i get the following text:
. **/ // we'll need some external files require('config.php'); $sql = mysql_connect(WHP_DB_HOST, WHP_DB_USER, WHP_DB_PASS); mysql_select_db(WHP_DB_NAME); if (!$sql) { die(mysql_error()); } else { // proceed // make sure our sql table query exists if (!file_exists(dirname(__FILE__) . '/table_scheme.sql')) { die("The file 'table_scheme.sql' is missing, please make sure the file is placed in the same directory as this one."); } else { $contents = @file_get_contents(dirname(__FILE__) . '/table_scheme.sql'); $chunks = explode(";", $contents); foreach ($chunks as $query) { if (trim($query) != "") { $query = str_replace("{CACHE_TABLE}", WHP_CACHE_TBL, $query); $query = str_replace("{CRAFT_TABLE}", WHP_CRAFT_TBL, $query); $query = str_replace("{CRAFT_REAGENT_TABLE}", WHP_CRAFT_REAGENT_TBL, $query); $query = str_replace("{CRAFT_SPELL_TABLE}", WHP_CRAFT_SPELL_TBL, $query); $query = str_replace("{ITEMSET_TABLE}", WHP_ITEMSET_TBL, $query); $query = str_replace("{ITEMSET_REAGENT_TABLE}", WHP_ITEMSET_REAGENT_TBL, $query); $query = str_replace("{GEM_TABLE}", WHP_GEM_TBL, $query); $query = str_replace("{ENCHANTS_TABLE}", WHP_ENCHANT_TBL, $query); $q = mysql_query($query . ";", $sql); if (!$q) die(mysql_error()); } } print "The MySQL table was setup successfully. You may delete this file, as well as table_scheme.sql."; } } mysql_close($sql); ?>
The table_scheme.sql is definitely in the same directory as the create_table.php and the rest.
Additionally as you can see the font of the forum grows grotesquely and deforms the resolution the user is using. I saw this originally posted on page 1 of this topic but from what i could read here i couldn't see a fix for that. Any suggestions? Thanks in advance.
the deformation is due because of the errors being reported. you need to double check your SQL settings, that is the reason for the problem. as far as why the script is printing its code, i have no clue.
Post by
60445
This post was from a user who has deleted their account.
Post Reply
This topic is locked. You cannot post a reply.