Ten (
adurotum) wrote in
pairings_trade2013-08-07 01:14 pm
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
![[community profile]](https://www.dreamwidth.org/img/silk/identity/community.png)
Entry tags:
MOAR CODE and also trades?!
Sup Pairings!
Ten rolling through again with another batch of code for those using websites to host their cards. I have them held in a folder here, but I'll also link each set of instructions below in case you're looking for something specific! I've also updated some of the code I linked before, so if you installed any code earlier, I would recommend re-installing them and re-reading the guides to make sure you've got the most up-to-date version.
Displaying ships on your collecting page I THINK I added in selecting your ship type and fixed a spacing issue since the last time I posted this code.
Displaying all 60 cards in an OT3 on your collecting page New code, I think! Handy for OT3 collectors who want to see all the cards they need for an OT3 at once.
Displaying ships on your mastery page I literally finished this one just this morning, and unfortunately I don't have a good number of ot3s/repeated mastered decks to properly test this one out. So! If you have repeated mastered decks and/or OT3s mastered, I'd really appreciate it if you gave me feedback on this code and whether or not it runs properly. as another note to mod-types, please ignore the mastery pairing for the ot3, I needed something to test out the display and didn't have any ot3s mastered yet 8( The cards displayed here don't add to my card count and I'll take down this example ot3 in a week.)
EDIT: If you were interested in having quotes displayed with your masteries/collecting decks, I drafted up two mini guides on how to alter your code to allow for quotes.
You can see examples of almost all the code on my site! If any of the code or my guides don't make sense/break your site horribly at any point, feel free to contact me through this post and I'll help clear things up. And because this is the trading comm and all, I am always open to trades! I'm especially looking for any gangsta decks (heels, tags, pallmall) so I can have a for-real ot3 mastery and lucky dog decks (luckydog x5, maddog, smuggle, assault) for... reasons...
Coding-wise, I'm going to take a little break in order to catch up on graphics and other things, but I'll be tackling mass decks next. If there's any other code you'd be interested in having, I'm open to suggestions! Thanks for your time o7

Ten rolling through again with another batch of code for those using websites to host their cards. I have them held in a folder here, but I'll also link each set of instructions below in case you're looking for something specific! I've also updated some of the code I linked before, so if you installed any code earlier, I would recommend re-installing them and re-reading the guides to make sure you've got the most up-to-date version.
Displaying ships on your collecting page I THINK I added in selecting your ship type and fixed a spacing issue since the last time I posted this code.
Displaying all 60 cards in an OT3 on your collecting page New code, I think! Handy for OT3 collectors who want to see all the cards they need for an OT3 at once.
Displaying ships on your mastery page I literally finished this one just this morning, and unfortunately I don't have a good number of ot3s/repeated mastered decks to properly test this one out. So! If you have repeated mastered decks and/or OT3s mastered, I'd really appreciate it if you gave me feedback on this code and whether or not it runs properly. as another note to mod-types, please ignore the mastery pairing for the ot3, I needed something to test out the display and didn't have any ot3s mastered yet 8( The cards displayed here don't add to my card count and I'll take down this example ot3 in a week.)
EDIT: If you were interested in having quotes displayed with your masteries/collecting decks, I drafted up two mini guides on how to alter your code to allow for quotes.
You can see examples of almost all the code on my site! If any of the code or my guides don't make sense/break your site horribly at any point, feel free to contact me through this post and I'll help clear things up. And because this is the trading comm and all, I am always open to trades! I'm especially looking for any gangsta decks (heels, tags, pallmall) so I can have a for-real ot3 mastery and lucky dog decks (luckydog x5, maddog, smuggle, assault) for... reasons...
Coding-wise, I'm going to take a little break in order to catch up on graphics and other things, but I'll be tackling mass decks next. If there's any other code you'd be interested in having, I'm open to suggestions! Thanks for your time o7

no subject
How comfortable are you with coding? If you're okay with it, I can point out exactly where and what to add where, otherwise I can just do a full copy/paste of all the code already edited for you on your own doc with instructions.
no subject
Adding quotes to masteries
First, to add quotes to your masteries, open up pairings.php and scroll down to that giant chunk of code you add in for displaying paired masteries. You'll see two instances of the following code:
if ( $shiptype == 1 ) { $shiptype = '/'; }
else if ( $shiptype == 2 ) { $shiptype = '-'; }
else { $shiptype = '/'; }
Insert the following code after the first instance:
$masteredot3quotes = array(
"DECKID" => "QUOTETEXT",
);
And the next after the second one:
$masteredpairquotes = array(
"DECKID" => "QUOTETEXT",
"DECKID" => "QUOTETEXT",
);
For $masteredot3quotes, deckid should correspond to the 2nd deck you call in the show_masteredot3(blahblahblah) function you want this quote called for. For $masteredpairquotes, it should correspond to the 1st deck you call in show_masteredpair(blahblahblah)! You can use html tags (bold, italics, etc), but I would recommend using an unused header tag, like < h3 > or something so you can customize the look of it in your css file instead of getting all clunky here. Make sure all your quotes for your OT3s go under $masteredot3quotes and your pair quotes go under $masteredpairquotes, I don't think they'll read across each other. Here's a few examples of how your quote declarations can look, minus all the spacing in the html tags of course:
"2" => "< b >Kida Masaomi / Ryuugamine Mikado< / b > < i >Durarara!!< / i >",
"1" => "< h3 >Dino Cavallone / Hibari Kyouya< / h3 >",
"3" => "Kida get out of Mikado's pants.",
Once you've got those in, scroll down again to the following code. There'll be two instances:
echo '< h1 >mastered< / h1 >';
echo '< p align="center" >';
echo '< img src = blahblahblah >';
Insert the following code after the first instance, getting rid of the spaces around the line break (ie br):
echo ''.$masteredot3quotes[$deckid2].'< br >';
And the following code after the second, getting rid of the spaces around the line break:
echo ''.$masteredpairquotes[$deckid1].'< br >';
Now save and reupload the file and this SHOULD be all you have to do to get them to display on your masteries page. The collecting page requires a little more effort, so I'm going to write that out in a new comment.
If you have any questions re: any of these steps, feel free to ask!
Addding quotes to collecting
For adding quotes to your collecting decks, open up your func.php file. You'll need to go to EVERY custom show_collectingetcetc function I wrote, or at least every one you plan on using, and add in a new field ( $quote = '' ) at the end of each function. If you installed every function I wrote across the 3 docs, there should be 7 of them total (remember you're not altering any show_masteredetcetc functions)
For example:
function show_collectingpairalt($tcg, $deckname1 = '', $deckname2 = '', $shiptype = '', $breakpoint = '') {
is changed to:
function show_collectingpairalt($tcg, $deckname1 = '', $deckname2 = '', $shiptype = '', $breakpoint = '', $quote = '') {
This does mean that whenever you want to add a quote to a deck, you'll also have to add in the shiptype and the breakpoint and whatever other fields are in front of it. You could add it in before the shiptype too, if you wanted, I'm just instructing you to put it at the end because that's the easiest.
After you've added that in, scroll down to each function until you see:
< br >
< h2 >< ? php echo $row1['deck']; ? > < ? php echo $shiptype; ? > < ?php echo $row2['deck']; ? > (< ? php echo $count; ? >/< ? php echo $row1['count']+$row2['count']; ? >)< / h2 >
or something similar. The br line followed by the h2 line, essentially.
Right after these two lines, insert this bit of code:
Save and reupload and open up your pairings.php file.
Scroll down to your collecting section. You can now enter the new field into your existing code, like the following:
show_collectingpairalt('Pairings','red','blue','/','10','< b >Have you never heard of personal space< / b >');
Again I would recommend actually using h3 or something of the like instead of doing all the bold font, italics, size etc in that field because it's a lot easier to tweak things the way you want them and I also have no idea what, if any, is the string limit length in php.
After that, you should be done! Again if anything goes wrong or your code explodes because I left out a step in any of my explanations (i... i don't think i did...) drop me a line and I'll help you fix it o7
no subject