Raised This Month: $32 Target: $400
 8% 

[TF2] Item Logger (With Web Panel)


Post New Thread Reply   
 
Thread Tools Display Modes
PolyQuad
Member
Join Date: Oct 2011
Old 10-16-2012 , 16:51   Re: [TF2] Item Logger (With Web Panel)
Reply With Quote #241

I reran the update.php to update to the latest items and now every drop that the plugin logs is unique?

Crafted: Unique Slot Token - Primary

Everything being logged is getting item quality 6 inserted into my database? is this a bug in the latest plugin? Is there a link to the 2.02 plugin somewhere?
PolyQuad is offline
Horsedick
AlliedModders Donor
Join Date: Sep 2011
Old 10-16-2012 , 18:27   Re: [TF2] Item Logger (With Web Panel)
Reply With Quote #242

Quote:
Originally Posted by PolyQuad View Post
I reran the update.php to update to the latest items and now every drop that the plugin logs is unique?

Crafted: Unique Slot Token - Primary

Everything being logged is getting item quality 6 inserted into my database? is this a bug in the latest plugin? Is there a link to the 2.02 plugin somewhere?
This is just how Valve see's them.. all regular items are "Unique" like vintage is "Vintage" etc etc.
Horsedick is offline
shindoux
New Member
Join Date: Mar 2011
Old 02-12-2013 , 13:15   Re: [TF2] Item Logger (With Web Panel)
Reply With Quote #243

hi, I have a problem when installing I get these errors on the page, who can help me?.

[IMG]http://img28.**************/img28/6288/errorgj.jpg[/IMG]

Thank you.
shindoux is offline
SpideyFusion
SourceMod Donor
Join Date: Oct 2010
Old 02-16-2013 , 06:32   Re: [TF2] Item Logger (With Web Panel)
Reply With Quote #244

Quote:
Originally Posted by shindoux View Post
hi, I have a problem when installing I get these errors on the page, who can help me?.

[IMG]http://img28.**************/img28/6288/errorgj.jpg[/IMG]

Thank you.
Your PHP configuration doesn't allow short tags:

http://www.php.net/manual/en/ini.cor...short-open-tag
SpideyFusion is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 03-05-2013 , 21:33   Re: [TF2] Item Logger (With Web Panel)
Reply With Quote #245

Any instructions on removing the "Player Count" field from the web panel? I don't want to full-out remove the Player Count from the plugin, the database and the site itself, I'd prefer to just use "<!--" and "-->" to comment out the Player Count field. Possible? Not possible?

Oh, and while I'm here, I went and updated the quality colors because they haven't been updated yet, and it's been ages since the Haunted quality color was changed, and I believe the Rarity2/Rarity3 colors were missing, as well as Completed or Tobor_a. So I went in and manually added in the missing stuff. I kept Completed & Tobor_a's colors as pure white, because they don't actually have a color....plus you're never going to have them show up in the logger anyway....but I'm a perfectionist....so here's how you can update it yourself!

Firstly, if you're a perfectionist like me, you'll want to update the drop methods. I outlined this a number of pages ago in this thread, but here it is again. On your web hosting, go to the "system" folder, then the "includes" folder, and edit "config.php". You're looking for the "$item_methods" array. It's missing a method or two. Simply highlight it and replace it with this:

Code:
$item_methods = array(
    -1  => "Found: ",
    1   => "Crafted: ",
    2   => "Traded for: ",
    3   => "Purchased: ",
    4   => "Unboxed: ",
    5   => "Gifted: ",
    8   => "Earned: ",
    9   => "Refunded: ",
    10   => "Wrapped: ",
);


You'll probably never have Refunded or Wrapped show up, but I added them in for the hell of it.


Next, the item quality colors. Go back to the start and go to the "assets" folder, then the "css" folder, and edit "main.css". Scroll down to the very bottom, that's where the item quality color classes are located. Highlight everything and replace it with the following:


Code:
.quality_normal {color: #B2B2B2; font-family:TF2Build, Arial, sans-serif;} // Normal (Stock)
.quality_unique {color: #FFD700; font-family:TF2Build, Arial, sans-serif;} // Unique
.quality_vintage {color: #476291; font-family:TF2Build, Arial, sans-serif;} // Vintage
.quality_genuine {color: #4D7455; font-family:TF2Build, Arial, sans-serif;} // Genuine
.quality_rarity1 {color: #4D7455; font-family:TF2Build, Arial, sans-serif;} // Rarity1 (Genuine)
.quality_strange {color: #CF6A32; font-family:TF2Build, Arial, sans-serif;} // Strange
.quality_unusual {color: #8650AC; font-family:TF2Build, Arial, sans-serif;} // Unusual
.quality_rarity4 {color: #8650AC; font-family:TF2Build, Arial, sans-serif;} // Rarity4 (Unusual)
.quality_haunted {color: #38F3AB; font-family:TF2Build, Arial, sans-serif;} // Haunted
.quality_community {color: #70B04A; font-family:TF2Build, Arial, sans-serif;} // Community
.quality_selfmade {color: #70B04A; font-family:TF2Build, Arial, sans-serif;} // Self-Made
.quality_valve {color: #A50F79; font-family:TF2Build, Arial, sans-serif;} // Valve (also known as "Developer")
.quality_customized {color: #476291; font-family:TF2Build, Arial, sans-serif;} // Unused: Customized
.quality_completed {color: #FFFFFF; font-family:TF2Build, Arial, sans-serif;} // Unused: Completed
.quality_tobor_a {color: #FFFFFF; font-family:TF2Build, Arial, sans-serif;} // Unused: Tobor_a
.quality_rarity2 {color: #8D834B; font-family:TF2Build, Arial, sans-serif;} // Unused: Rarity2
.quality_rarity3 {color: #70550F; font-family:TF2Build, Arial, sans-serif;} // Unused: Rarity3
As for why there's "rarity4"/"unusual" and "rarity1"/"genuine"...I don't know. If I remember correctly, by default the CSS has those duplicate classes. I just kept them in there for the heck of it.


Quote:
Originally Posted by Horsedick View Post
Quote:
Originally Posted by PolyQuad View Post
I reran the update.php to update to the latest items and now every drop that the plugin logs is unique?

Crafted: Unique Slot Token - Primary

Everything being logged is getting item quality 6 inserted into my database? is this a bug in the latest plugin? Is there a link to the 2.02 plugin somewhere?
This is just how Valve see's them.. all regular items are "Unique" like vintage is "Vintage" etc etc.
I think there's a way around it. I think someone actually modified a file for me a few pages back to fix the naming. Let me look into that and I'll see if I can make this thing not add the "Unique" prefix to everything.

Last edited by 404UserNotFound; 03-05-2013 at 21:36.
404UserNotFound is offline
Geit
Senior Member
Join Date: Oct 2009
Location: Home
Old 03-21-2013 , 15:09   Re: [TF2] Item Logger (With Web Panel)
Reply With Quote #246

Quote:
Originally Posted by abrandnewday View Post
Firstly, if you're a perfectionist like me, you'll want to update the drop methods. I outlined this a number of pages ago in this thread, but here it is again. On your web hosting, go to the "system" folder, then the "includes" folder, and edit "config.php". You're looking for the "$item_methods" array. It's missing a method or two. Simply highlight it and replace it with this:

Code:
$item_methods = array(
    -1  => "Found: ",
    1   => "Crafted: ",
    2   => "Traded for: ",
    3   => "Purchased: ",
    4   => "Unboxed: ",
    5   => "Gifted: ",
    8   => "Earned: ",
    9   => "Refunded: ",
    10   => "Wrapped: ",
);


You'll probably never have Refunded or Wrapped show up, but I added them in for the hell of it.

Update on this, because the pages will break if you get any of the newer ones:

PHP Code:
$item_methods = array(    
     -
=> "Found: ",
     
=> "Crafted: ",
     
=> "Traded for: ",
     
=> "Purchased: ",
     
=> "Unboxed: ",
     
=> "Gifted: ",
     
=> "Customer Support: ",
     
=> "Store Promotion: ",
     
=> "Earned: ",
     
=> "Refunded: ",
     
10 => "Gift Wrapped: ",
     
11 => "NewItemMethod_Foreign: ",
     
12 => "NewItemMethod_CollectionReward: ",
     
13 => "Trialing Item: ",
     
14 => "Purchased: ",
     
15 => "Earned: ",
     
16 => "Earned Loot: ",
     
17 => "Squad Surplus: ",
     
18 => "Holiday Gift: ",
     
19 => "Purchased (community): "
); 
EDIT: Fixed, thanks abrandnewday

Last edited by Geit; 03-22-2013 at 06:46.
Geit is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 03-21-2013 , 16:23   Re: [TF2] Item Logger (With Web Panel)
Reply With Quote #247

Quote:
Originally Posted by Geit View Post
Update on this, because the pages will break if you get any of the newer ones:

PHP Code:
$item_methods = array(    
    -
=> ""// Found
    
01 => "Crafted: ",
    
02 => "Traded: ",
    
03 => "Purchased: ",
    
04 => "Unboxed: ",
    
05 => "Gifted: ",
    
06 => "Customer Support: ",
    
07 => "Store Promotion: ",
    
08 => "Earned: ",
    
09 => "Refunded: ",
    
10 => "Gift Wrapped: ",
    
11 => "NewItemMethod_Foreign: ",
    
12 => "NewItemMethod_CollectionReward: ",
    
13 => "Trialing Item: ",
    
14 => "Purchased: "// Purchased Trialed item
    
15 => "Earned: "// NewItemMethod_PeriodicScoreReward
    
16 => "Earned Loot: "// NewItemMethod_MvMBadgeCompletionReward
    
17 => "Squad Surplus: "// #NewItemMethod_MvMSquadSurplusReward
    
18 => "Holiday Gift: ",
    
19 => "Purchased (community): "
); 
Oooh, wonderful! I shall add those immediately! You are the man, Geit

EDIT: It's acting all weird, labelling everything as "Refunded". I had to do some modifications:

EDIT: Fixed it. Use this, it's not horribly broken.

PHP Code:
$item_methods = array(    
     -
=> "Found: ",
     
=> "Crafted: ",
     
=> "Traded for: ",
     
=> "Purchased: ",
     
=> "Unboxed: ",
     
=> "Gifted: ",
     
=> "Customer Support: ",
     
=> "Store Promotion: ",
     
=> "Earned: ",
     
=> "Refunded: ",
     
10 => "Gift Wrapped: ",
     
11 => "NewItemMethod_Foreign: ",
     
12 => "NewItemMethod_CollectionReward: ",
     
13 => "Trialing Item: ",
     
14 => "Purchased: ",
     
15 => "Earned: ",
     
16 => "Earned Loot: ",
     
17 => "Squad Surplus: ",
     
18 => "Holiday Gift: ",
     
19 => "Purchased (community): "
); 
Oddly enough, some "Method" listings in my databases under the itemlogger2_finds table are showing not only "-1" (Found, but also "0" which is unlisted. Without anything in the above code, it just defaults to "Found:". However, upon adding a definition for "0", it changes some instances of "Traded for:" over to "Found" for no apparent reason.

Very strange.

EDIT 2: Also, any instances of Australium Gold in the logger will have the wrong paintcan image:


I'm currently going through all the paints and making sure they've got the right icons. I see why though, good example can be seen here on the TF2Items schema entry.

Last edited by 404UserNotFound; 03-21-2013 at 17:06.
404UserNotFound is offline
ltgenkd
AlliedModders Donor
Join Date: Sep 2008
Old 03-21-2013 , 22:56   Re: [TF2] Item Logger (With Web Panel)
Reply With Quote #248

Just ran the update.php and got this error. I haven't had any errors running the update until now.

Code:
Warning: Invalid argument supplied for foreach() in /home/XXXXXX/public_html/drops/update.php on line 14
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
update.php:
foreach($TFItems_440->result->items->item as $item_info) //<--- THIS IS LINE 14 IN NOTEPAD ++


PHP Code:
<?php  
define
('ALLOW_INCLUDE'1);
require 
'system/includes/config.php';
 
$TFItems_440 json_decode(file_get_contents('http://api.steampowered.com/ITFItems_440/GetSchema/v0001/?key='.$settings['steam']['api_key'].'&format=json&language='.$settings['generic']['language']));
//Update the items table.
mysql_query('TRUNCATE `itemlogger2_items`') or die(mysql_error());
$items_query 'INSERT IGNORE INTO itemlogger2_items (`id`, `item_name`, `proper_name`, `item_slot`, `image_url`, `material_type`)';
$i 0;
foreach(
$TFItems_440->result->items->item as $item_info)  //<--- THIS IS LINE 14 IN NOTEPAD ++
{
    if(
$i == 0)
    {
        
$items_query .= " VALUES ($item_info->defindex, '$item_info->item_name', " . (int)$item_info->proper_name ", '$item_info->item_slot', '$item_info->image_url', '$item_info->craft_material_type')";    
        
$i++;
    }
    else
    {
        
$items_query .= ", ($item_info->defindex, '" mysql_real_escape_string($item_info->item_name) . "', " . (int)$item_info->proper_name ", '" mysql_real_escape_string($item_info->item_slot) . "', '" mysql_real_escape_string($item_info->image_url) . "', '" mysql_real_escape_string($item_info->craft_material_type) . "')";        
    }
}
mysql_query($items_query) or die(mysql_error());
unset(
$items_query);
 
//Update the qualities table.
mysql_query('TRUNCATE `itemlogger2_qualities`') or die(mysql_error());
$qualities_query 'INSERT IGNORE INTO itemlogger2_qualities (`id`, `name`, `raw_name`)';
$i 0;
foreach(
$TFItems_440->result->qualities as $quality_key=>$quality_info)
{
    if(
$i == 0)
    {
        
$qualities_query .= " VALUES ('"mysql_real_escape_string($quality_info) ."', '"mysql_real_escape_string($TFItems_440->result->qualityNames->{$quality_key}) ."', '"mysql_real_escape_string($quality_key) ."')";    
        
$i++;                            
    }
    else
    {
        
$qualities_query .= ", ('"mysql_real_escape_string($quality_info) ."', '"mysql_real_escape_string($TFItems_440->result->qualityNames->{$quality_key}) ."', '"mysql_real_escape_string($quality_key) ."')";        
    }
}
mysql_query($qualities_query) or die(mysql_error());
unset(
$qualities_query);
ltgenkd is offline
Geit
Senior Member
Join Date: Oct 2009
Location: Home
Old 03-22-2013 , 07:55   Re: [TF2] Item Logger (With Web Panel)
Reply With Quote #249

Quote:
Originally Posted by abrandnewday View Post
Oooh, wonderful! I shall add those immediately! You are the man, Geit

EDIT: It's acting all weird, labelling everything as "Refunded". I had to do some modifications:

EDIT: Fixed it. Use this, it's not horribly broken.

Oddly enough, some "Method" listings in my databases under the itemlogger2_finds table are showing not only "-1" (Found, but also "0" which is unlisted. Without anything in the above code, it just defaults to "Found:". However, upon adding a definition for "0", it changes some instances of "Traded for:" over to "Found" for no apparent reason.

Very strange.

EDIT 2: Also, any instances of Australium Gold in the logger will have the wrong paintcan image:

I'm currently going through all the paints and making sure they've got the right icons. I see why though, good example can be seen here on the TF2Items schema entry.

Sorry, I didn't actually test the new IDs! -- Just wrote them down because somebody on steam asked for them (#19 has started appearing in some logs), didn't realise that PHP wouldn't like me padding the left of the indicies with 0s!

It would appear that Valve has changed a bunch of stuff in the March 19th patch, I have a feeling that all drops post-update are logged as 0 instead of -1, or at least this is what the database I'm using appears to show...

The owner of the database I'm basing these assumptions off is also reporting that some drops are going completely missing since the March 19th update (not being logged), to which I am completely dumbfounded... unless Valve have started using method indices with a value higher than 20, which are ignored by the plugin.

If this is the case, I'll spend some time this weekend cleaning it all up and testing it, and release an update. If anyone has anything more they'd like to add, please drop me a line on steam: http://steamcommunity.com/id/geity

@ltgenkd :- That error suggests that the WebAPI didn't respond with valid JSON, which could be a temporary issue, do be sure to try again and poke me on steam if it still doesn't work.

Last edited by Geit; 03-22-2013 at 07:59.
Geit is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 03-22-2013 , 13:17   Re: [TF2] Item Logger (With Web Panel)
Reply With Quote #250

Quote:
Originally Posted by Geit View Post
Sorry, I didn't actually test the new IDs! -- Just wrote them down because somebody on steam asked for them (#19 has started appearing in some logs), didn't realise that PHP wouldn't like me padding the left of the indicies with 0s!

It would appear that Valve has changed a bunch of stuff in the March 19th patch, I have a feeling that all drops post-update are logged as 0 instead of -1, or at least this is what the database I'm using appears to show...

The owner of the database I'm basing these assumptions off is also reporting that some drops are going completely missing since the March 19th update (not being logged), to which I am completely dumbfounded... unless Valve have started using method indices with a value higher than 20, which are ignored by the plugin.

If this is the case, I'll spend some time this weekend cleaning it all up and testing it, and release an update. If anyone has anything more they'd like to add, please drop me a line on steam: http://steamcommunity.com/id/geity
What's even weirder is that my database is still logging new finds as either "0" or "-1".

If I knew where to find a current list of drop methods (if that info is present in the game files), I'd look for it myself and grab the correct method indices. Unfortunately, I don't know where to find such a thing.

And yes, I think #19 is "Purchased (community):" because I did find that one of the drops listed on my drop logger is showing up as "Purchased (community):", however I've been unable to get in touch with the player in question and ask how he/she obtained the item, just to verify the correct description for that indice.

As for the paint can image issue, as I said above, it seems that all the images of the paint cans use the brown paint can image. I'm not sure if the update.php file will revert changes I make to the "image" link, but I'd love to personally go through and update each and every paint can image URL in my database.

I know that with my current setup, using some of the "fixes" that were provided to me on previous pages of this thread, running update.php does mess with one of the item qualities' "raw" names, changing it from "unique" to "Unique", which causes any "Unique" items to show up with no rarity color on the logger, until I manually go in and change the raw name back to "unique".

Again, not something you can fix, because I'm using some custom files that were provided to me in the previous couple pages, mainly to get rid of the "The" in the names of items that are not "Unique" quality, such as "Vintage Dead Ringer" showing up, instead of "The Vintage Dead Ringer" or "Vintage The Dead Ringer".

I'll end on a good note. Aside from the little issues that we've discovered with the method indices, this is still a wonderful plugin. Great work

Last edited by 404UserNotFound; 03-22-2013 at 13:18.
404UserNotFound is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:59.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode