Showing doubles

  1. 2 years ago

    sujini

    7 Jun 2015 http://hello-love.org/

    I'm currently using the syntax

    <?php show_cards('TCG NAME','CATEGORY NAME', 1); ?>

    and it used to work fine for my TCGs in the past but I'm not sure why it doesn't seem to work at the moment.
    it shows for me:
    link text (under "keeping" category)

    Seems to be a bug! Try this to fix it...

    Find this line in 'func.php':

    if ( $unique == 1 ) { $cards = array_unique($cards); }

    and add this line right before it:

    $cards = array_map(trim, $cards);

    So completed, it should look like this:

    $cards = array_map(trim, $cards);
    if ( $unique == 1 ) { $cards = array_unique($cards); }
  2. Bloo

    8 Jun 2015 Administrator kablooey.net

    @sujini Could you share the contents of your "keeping" category from within eTCG?

    Also, which version of eTCG are you running?

    Thanks!

  3. sujini

    8 Jun 2015 http://hello-love.org/

    @Bloo @sujini Could you share the contents of your "keeping" category from within eTCG?

    Also, which version of eTCG are you running?

    Thanks!

    okay this is most puzzling because all my pages for different TCGs share the same code. it's working fine for this page (the doubles can be found here )

    I'm currently using V.1.0.1.

    contents of keeping category: s1-emmaswan02, s1-emmaswan02, s2-emmaswan14, s4-anna12, s4-anna17

  4. Bloo

    8 Jun 2015 Administrator Answer kablooey.net

    Seems to be a bug! Try this to fix it...

    Find this line in 'func.php':

    if ( $unique == 1 ) { $cards = array_unique($cards); }

    and add this line right before it:

    $cards = array_map(trim, $cards);

    So completed, it should look like this:

    $cards = array_map(trim, $cards);
    if ( $unique == 1 ) { $cards = array_unique($cards); }
  5. sujini

    9 Jun 2015 http://hello-love.org/
    Edited 2 years ago by sujini

    hi bloo! that worked on my keeping category but it doesn't show up as a double :x

    keeping and double

  6. Bloo

    9 Jun 2015 Administrator kablooey.net

    I believe it's the same problem as before, just needs to be fixed in the show_doubles() method. Look for this line:

    $doubles = array_diff_assoc($cards, array_unique($cards));

    And place this code before it:

    $cards = array_map(trim, $cards);
  7. sujini

    9 Jun 2015 http://hello-love.org/

    thanks bloo! it worked! should I keep the code in front of

    if ( $unique == 1 ) { $cards = array_unique($cards); }

    or can I remove it if it's redundant?

  8. Bloo

    9 Jun 2015 Administrator kablooey.net

    Nope, leave it - it should be in both places! :)

or Sign Up to reply!