disclaimers - PLEASE READ

1. I have no idea what I'm doing. I have no formal training in php. This is me taking a stab at modifications to etcg that I thought would make my tcg game stronger.
2. I currently use etcg v1.1.0 (as we say in the discord chat, new etcg). You can find what version you have by looking in the top left of your etcg page. I do NOT recommend using these on the old etcg version unless you know what you're doing!!
3. I have low patience and I'm terrible at explaining things. Proceed with caution.
4. If I forgot to give credit where it's due, or if you don't feel comfortable with something you worked on being here, please reach out and I will remove immediately. My goal is not to undermine anyone's work, and it is truly not intentional.
5. This is geared towards idolise, as I don't play other tcgs. I will try to call out if you'll run into trouble with other tcgs, but keep this in mind when reading.
6. - THE MOST IMPORTANT RULE Back up everything before you change stuff. Especially logs.

change log

180105 -

section 1 - time savers in etcg

sort mastered decks within etcg

The Problem: Mini mastery badges, although beautiful love you caitlin, are a different size than normal masteries on idolise. It makes the badges on your /etcg/mastered.php page misalign. Gross.
The Solution: Change the display sorting to sort by count then mastereddate, opposed to just masterreddate. Note: this is irrelevant if you opt to display your masteries as text.
Caveats: This is sorting based on card count of the deck. For other tcgs, it may not apply. To use only on idolise, you can make an if statement along the lines of if ($id == 'youridoliseid'), use the mod result and else use the default result.

(click for code)

display masteries as text instead of badges in etcg

The Problem: this is SUCH a minor thing but i hate not being able to ctrl+F for decks in my mastered page on etcg, especially now that i'm constantly changing what era numbers I put in
The Solution: i made mine just a plain boring list. sharing in case anyone else has this peeve
Caveats: i use new etcg and i mod the fuck out of etcg so i hope this code is the same in yours. if you're going to add the "expose which decks lack badges" after, skip this and just do that one since it's included.

(click for code)

expose which decks lack badges if showing etcg masteries as text

The Problem: i get lazy and don't upload badges right after i master, so if i display masteries as text, idk which badges i need to upload.
The Solution: find a way to yell @ myself to upload badges for decks that need it on the mastered.php page
Caveats: s/o to kriss for the idea of using multiple columns to show this, in this scenario the "DON'T BE A LAZY DOYOUNG" is me yelling at myself to upload a badge you can change this to whatever you want but doyoung is the laziest

(click for code)

auto count cards traded in your logs

The Problem: ok counting total trades on your post is great but how about making it so you don't have to count in logs to make it super easy to copy and paste into that damn trader rewards form.
The Solution: use same counting logic to display trade count in trades as they're added to your log. flag every time you hit a stampcard. bam. lazy slytherin solution for when you've made +1,800 card trades in a < 2 month timeframe.
Caveats: oh boy.
1. this one is most effected by new vs old tcg version. talk to cross if you want to talk old tcg version.
2. THIS IS IDOLISE SPECIFIC. I'm assuming a 20-card stampcard every. time. You can edit this by 1) adding an if statement for if the tcg id is for idolise, or 2) finding a way to change the stampcard amount based on tcgid. Not my tcg, not my problem.
3. Builds of previous scripts --- so the caveats above apply: This script works by counting "Traded" and commas in your trade log. You cannot have commas in the date format (you can swap out by going to your TCG settings and changing format, and by finding and replacing your existing log). Assumes your trade log is called 'tradelog' in etcg. Cannot be using archived logs (you can edit this to work around that).
4. Because this counts commas, this assumes a 2-sided card trade. If you traded member cards, you must put member cards on both sides of the trade. Does not work for gifting.
5. It will start counting based on what's already in your log. It may not match your amount because us humans can't read and count correctly all of the time. Don't freak out. People make mistakes. Just use it moving forward or audit your log or do whatever you want.
6. I put "NEEDTOSUBMIT" in my logs when i hit a stampcard, then take out when I submit the stampcard. I also have a mod for myself that shows how many stampcards I need to submit based on this. You can remove this if you don't like that.

(click for code)

section 2 - time savers in trading/collecting

not an mod - easier trade binging

The Problem: I hate having 4 windows/tabs open when on a trade binge. trade form, the cards you need (either in a notepad, excel, or written down irl), your trading pile, and the other person's trade post. I want to condense and eliminate having to jump windows all the time. I'm just lazy and don't always use my second monitor.
The Solution: Combine a bunch of different functionalities already out there. Trade form already exists in your etcg, your trade pile already has a card search (AND IF IT DOESNT WHAT ARE YOU DOING WITH YOUR LIFE), and there's a mod already out there for cards needed. Just combine it into one!
Caveats: I take no credit for any of these things. I'm just putting them on one page and its super easy, and also explaining to people who don't know that there's a show needed cards function

(click for code)

how many cards of each deck do you have in your trade pile?

The Problem: sometimes you just want to go for the lowest hanging fruit and move a deck you have 15 cards of in your trade pile to your keeping. we've all been there. but it's annoying af to count those cards. you think i ever visit my trade pile page?
The Solution: ... make a function to show how many cards from each deck you have in your trade pile. bet you didn't see that one coming.
Caveats: i have no idea if this existed already so sorry if it did, i use new etcg, etc. this is HEAVILY taken from the show_needed mod, so I really didn't do much. I don't take credit for the heavy lifting. does not take into account doubles (which is good, it only shows unique cards in a deck).

(click for code)

show doubles as text + doubles count + first 20 doubles

The Problem: i want a way to easily copy and paste my laundry list of doubles into the doubles exchange form.
The Solution: display your doubles as text. bonus for only showing the first 20 to easily copy and paste into that exchange form.
Caveats: apparently someone already did this and i didn't know. there are going to be some optional sections here so just read through and take out what you want/don't want

(click for code)

section 3 - displaying cool things

count masteries

The Problem: I don't want to manually count every time i want to see how many masteries I have (for dick measuring contests of course).
The Solution: Automate it ofc. I don't think this existed before? But please correct me if I'm wrong bc i'm sure another code out there is better.
Caveats: there is literally no practical use for this. It's mainly because I counted masteries one day to compare with Dhee and Mio and thought k lets not manually count again. Also, counts mini masteries.

(click for code)

count cards traded

The Problem: Humans are not superior to robots like Taeyong. We must invent these robots to do things more efficiently and counter our human error. Counting trades and stampcards is one of those areas where we're likely to exhibit this human side of ourselves.
The Solution: Automatically count cards traded. Completely optional. Not necessary. You still need to separate out logs to submit stampcards.
Caveats: This script works by counting "Traded" and commas in your trade log. You cannot have commas in the date format (you can swap out by going to yoru TCG settings and changing format, and by finding and replacing your existing log). Assumes your trade log is called 'tradelog' in etcg. Cannot be using archived logs (you can edit this to work around that).

(click for code)

count stampcards

The Problem: Humans are not superior to robots like Taeyong. We must invent these robots to do things more efficiently and counter our human error. Counting trades and stampcards is one of those areas where we're likely to exhibit this human side of ourselves.
The Solution: Automatically calculate stampcards earned based on cards traded in your logs. A build on the previous function (but the previous function is not needed)
Caveats: Main caveat - this assumes a 20 card stampcard. Since I only play idolise, it works for me. You can edit to make the count different for other tcgs, but I'm not spinning my wheels on it.
Same caveats as above as well - This script works by counting "Traded" and commas in your trade log. You cannot have commas in the date format (you can swap out by going to your TCG settings and changing format, and by finding and replacing your existing log). Assumes your trade log is called 'tradelog' in etcg and archive log is called whatever the default is (ttradelogarch i think).
Idolise-specific caveat: take Boo out of your trade logs. It says to put Boo trades in your activity log anyway, but just reminding you to read. Don't cheat.

(click for code)

display trades toward next stampcard

The Problem: Sometimes you want to see how many trades you need until the next stampcard. Why would you count manually?
The Solution: You can see how many trades you've made out of 20 toward your next stampcard. A build on the previous function (but the previous function is not needed)
Caveats: Main caveat - this assumes a 20 card stampcard. Since I only play idolise, it works for me. You can edit to make the count different for other tcgs, but I'm not spinning my wheels on it.
Same caveats as above as well - This script works by counting "Traded" and commas in your trade log. You cannot have commas in the date format (you can swap out by going to your TCG settings and changing format, and by finding and replacing your existing log). Assumes your trade log is called 'tradelog' in etcg. Cannot be using archived logs (you can edit this to work around that).
Idolise-specific caveat: take Boo out of your trade logs. It says to put Boo trades in your activity log anyway, but just reminding you to read. Don't cheat.

(click for code)

not a mod - make sure your card search results are lowercase

The Problem: uppercase is pretty sometimes, especially for links. but some of us are lazy fucks and like to copy & paste from the card search results. however etcg is case-sensitive to cards, so if the card search results show up as uppercase we can't be lazy fucks and copy & paste.\.
The Solution: completely optional, no one is telling you that you must do this, but you can make sure your card search is all lowercase despite your other super pretty uppercase links. Caveats: none. this is just a peeve that has come up multiple times in the discord, so here's the solution. in case anyone cares to actually do this.

(click for code)

make new priority

The Problem: this is really just a danni and rose problem. we have all these pretty cards that NO ONE should touch. do not touch my pretty cards. do not try and take my pretty cards. but how do i MAKE SURE no one can make a trade for these pretty cards, and that they don't pull into my collecting every time i remaster blackonblackjaehyun?
The Solution: edit every single file in etcg to make this new category. this one is a lot, so i really don't recommend it unless you're desperate.
Caveats: it's a lot. you're tampering with a lot of things you probably shouldn't. that's about it.

(click for code)