Example #1
0
            $match_flip = $matches_flip[1];
            // 0 is french version
            $text = mv2txt($match_flip['text']);
            if (count($matches_pt) > 1) {
                // Multiple P/T found, first is day, other are night
                $text = $matches_pt[1]['pow'] . '/' . $matches_pt[1]['tou'] . "\n" . $text;
            }
            $card->flip($match_flip['name'], $match_flip['type'], $text);
        }
        // Face down
        $nbmoon = preg_match_all($reg_moon, $html, $matches_moon, PREG_SET_ORDER);
        if ($nbmoon > 0) {
            $match_moon = $matches_moon[1];
            // 0 is french version
            $nbcolor = preg_match_all('#<img  height=10 src=graph/manas/l(?<color>.).gif>#', $match_moon['colors'], $matches_colors, PREG_SET_ORDER);
            $ci = '';
            if ($nbcolor > 0) {
                foreach ($matches_colors as $color) {
                    $ci .= $color['color'];
                }
            } else {
                echo 'Color not found<br>';
            }
            $text = mv2txt($match_moon['text']);
            if (isset($matches_moon[1]['pt'])) {
                $text = $matches_moon[1]['pow'] . '/' . $matches_moon[1]['tou'] . "\n" . $text;
            }
            $card->transform(card_name_sanitize($match_moon['name']), $ci, $match_moon['type'], $text, card_image_url($mv_ext_name . '/' . $mv_card_id . 'f'));
        }
    }
}
Example #2
0
     $lastcard->addurl($card_url);
     // On MCI, all seconparts are managed in a second page, inform importer even if useless for now
 } else {
     // "normal" cards (1 line on mci) or first part of split card
     $rarity = substr($match['rarity'], 0, 1);
     if (preg_match('/\\(Color Indicator: (?<color>.{1,100})\\)/', $html, $colors_matches)) {
         // Cards with no casting cost (Ancestral Vision)
         $text = $name . ' is ' . strtolower(implode(' and ', explode(' ', $colors_matches['color']))) . ".\n" . $text;
     }
     $lastcard = $importer->addcard($card_url, $rarity, $name, $cost, $types, $text, card_image_url($match), $card_matches['multiverseid']);
 }
 // Lang
 $nb = preg_match_all($lang_regex, $html, $matches_lang, PREG_SET_ORDER);
 foreach ($matches_lang as $lang) {
     $code = $lang['code'];
     $url = card_image_url($match, $code);
     if (array_search($lang['code'], array('de', 'fr', 'it', 'es', 'pt')) !== false) {
         // Expected charset
         $lname = $lang['name'];
         get_split($lname);
         if (!$secondpart) {
             $lastcard->setlang($code, $lname, $url);
         } else {
             if (!$doubleface) {
                 $url = null;
             }
             if ($split) {
                 $lastcard->addlang($code, $lname, $url);
             } else {
                 $lastcard->addlangimg($code, $url);
             }