addToMenu($_POST['pg_title']); } elseif ($_POST['menu_tab'] == 'false') { delFromMenu($_POST['pg_title']); } xmlWrite($_POST, $locatn); ?> <div> Page Successfully Created!!! <!-- <a href="../pages/page.php?page=pg_name">Visit page</a> --> </div> <?php } else { $locatn = $global_site['folder'] . 'pages/data'; $page_list = getPageList($locatn); ?> <table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table"> <tr> <th class="table-header-repeat line-left" style="width:50%;">Page Title</th> <th class="table-header-repeat line-left" style="width:25%;">Edit</th> <th class="table-header-repeat line-left" style="width:25%;">Delete</th> </tr> <?php $i = 0; foreach ($page_list as $value) { if ($i % 2 == 0) { echo '<tr>';
} scraperwiki::save_sqlite(array("card"), array("Card" => trim($name), "Image" => $imgURL, "Mana" => trim($mana), "CMC" => trim($cmc), "Type" => trim($type), "Card Text" => trim($text), "Flavor Text" => trim($flavor), "Artist" => trim($artist), "Card Number" => trim($cardNumber), "Rarity" => trim($rarity), "Expansion" => trim($set))); } ?> <?php require 'scraperwiki/simple_html_dom.php'; /* $pages_array = array("Alara%20Reborn","Alliances","Antiquities","Apocalypse","Arabian%20Nights","Archenemy","Avacyn%20Restored","Betrayers%20of%20Kamigawa","Champions%20of%20Kamigawa","Chronicles","Classic%20Sixth%20Edition","Coldsnap","Commander%27s%20Arsenal","Conflux","Dark%20Ascension","Darksteel","Dissension","Eighth%20Edition","Eventide","Exodus","Fallen%20Empires","Fifth%20Dawn","Fifth%20Edition","Fourth%20Edition","Future%20Sight","Gatecrash","Guildpact","Homelands","Ice%20Age","Innistrad","Invasion","Judgment","Legends","Legions","Limited%20Edition%20Alpha","Limited%20Edition%20Beta","Lorwyn","Magic%202010","Magic%202011","Magic%202012","Magic%202013","Magic%3a%20The%20Gathering-Commander","Mercadian%20Masques","Mirage","Mirrodin","Mirrodin%20Besieged","Morningtide","Nemesis","New%20Phyrexia","Ninth%20Edition","Odyssey","Onslaught","Planar%20Chaos","Planeshift","Portal","Portal%20Second%20Age","Portal%20Three%20Kingdoms","Prophecy","Ravnica%3a%20City%20of%20Guilds","Return%20to%20Ravnica","Revised%20Edition","Rise%20of%20the%20Eldrazi","Saviors%20of%20Kamigawa","Scars%20of%20Mirrodin","Scourge","Seventh%20Edition","Shadowmoor","Shards%20of%20Alara","Stronghold","Tempest","Tenth%20Edition","The%20Dark","Time%20Spiral","Torment","Unglued","Unhinged","Unlimited%20Edition","Urza%27s%20Destiny","Urza%27s%20Legacy","Urza%27s%20Saga","Vanguard","Visions","Weatherlight","Worldwake","Zendikar"); */ $pages_array = array("Seventh%20Edition", "Shadowmoor", "Shards%20of%20Alara", "Stronghold", "Tempest", "Tenth%20Edition", "The%20Dark", "Time%20Spiral", "Torment", "Unglued", "Unhinged", "Unlimited%20Edition", "Urza%27s%20Destiny", "Urza%27s%20Legacy", "Urza%27s%20Saga", "Vanguard", "Visions", "Weatherlight", "Worldwake", "Zendikar"); foreach ($pages_array as $page) { $html = scraperWiki::scrape('http://gatherer.wizards.com/Pages/Search/Default.aspx?output=checklist&set=%5b%22' . $page . '%22%5d'); $dom = new simple_html_dom(); $dom->load($html); getPageList($dom); } function getPageList($dom) { foreach ($dom->find('a.nameLink') as $item) { getCardInfo('http://gatherer.wizards.com/Pages/Card/' . $item->href); } } function getCardInfo($url) { $baseURL = 'http://gatherer.wizards.com/Pages/Card/'; $html = scraperWiki::scrape($url); $dom = new simple_html_dom(); $dom->load($html); $cardImage = $dom->find('img[id=ctl00_ctl00_ctl00_MainContent_SubContent_SubContent_cardImage]', 0)->src; $cardImage = str_replace("amp;", "", $cardImage);
<?php require 'queries/pageQueries.php'; $PAGE->id = 'pagelistGet'; //setup for query $stmt = getPageList($DB); if (!$stmt->execute()) { return errorHandler("failed to get this list {$stmt->errno}: {$stmt->error}"); } //format results $data = array(); $stmt->bind_result($data['pageId'], $data['menuOrder'], $data['menuName'], $data['title'], $data['desc']); /* fetch values */ $listResults = array(); while ($stmt->fetch()) { $row = arrayCopy($data); array_push($listResults, $row); } echo json_encode($listResults); function arrayCopy(array $array) { $result = array(); foreach ($array as $key => $val) { if (is_array($val)) { $result[$key] = arrayCopy($val); } elseif (is_object($val)) { $result[$key] = clone $val; } else { $result[$key] = $val; } }