function listCompetitions() { #---------------------------------------------------------------------- global $chosenEventId, $chosenYears, $chosenRegionId, $chosenPatternHtml; global $chosenList, $chosenMap; global $chosenCompetitions; $chosenCompetitions = getCompetitions($chosenList); tableBegin('results', 5); tableCaption(false, spaced(array(eventName($chosenEventId), chosenRegionName(), $chosenYears, $chosenPatternHtml ? "\"{$chosenPatternHtml}\"" : ''))); if ($chosenList) { tableHeader(explode('|', 'Year|Date|Name|Country, City|Venue'), array(4 => 'class="f"')); foreach ($chosenCompetitions as $competition) { extract($competition); if (isset($previousYear) && $year != $previousYear) { tableRowEmpty(); } $previousYear = $year; $isPast = wcaDate('Ymd') > 10000 * $year + 100 * $month + $day; tableRow(array($year, competitionDate($competition), $isPast ? competitionLink($id, $cellName) : ($showPreregForm || $showPreregList ? competitionLinkClassed('rg', $id, $cellName) : competitionLinkClassed('fc', $id, $cellName)), "<b>{$countryName}</b>, {$cityName}", processLinks($venue))); } } tableEnd(); if ($chosenMap) { // create map markers $markers = array(); foreach ($chosenCompetitions as $comp) { $markers[$comp['id']] = array(); $markers[$comp['id']]['latitude'] = $comp['latitude']; $markers[$comp['id']]['longitude'] = $comp['longitude']; $markers[$comp['id']]['info'] = "<a href='c.php?i=" . $comp['id'] . "'>" . o($comp['cellName']) . "</a><br />" . date("M j, Y", mktime(0, 0, 0, $comp['month'], $comp['day'], $comp['year'])) . " - " . o($comp['cityName']); } displayMap($markers); } }
function processParserGIF_RSS($conn, $row, $time) { libxml_use_internal_errors(true); $feed = simplexml_load_file($row["SITE"]); if (!$feed) { foreach (libxml_get_errors() as $error) { echo $row["ID_SITE"] . " - " . $row["SITE"] . " <span style='color:red'>ERRO: " . $error->message . " </span><br />\n"; } libxml_clear_errors(); return; } $imgIndex = 0; foreach ($feed->channel->item as $story) { preg_match('/\\<img src=\\"http(s?):\\/\\/[a-zA-Z0-9\\.\\/_]*.gif\\"(\\s[\\w\\=\\"\\-]*)*\\/\\>/', $story->description, $matches); if (count($matches) == 0) { continue; } preg_match('/http(s?):\\/\\/[a-zA-Z0-9\\.\\/_]*.gif/', $matches[0], $matches); $imgLink = $matches[0]; $href = strip_tags($story->link->asXML()); $title = strip_tags($feed->channel->title->asXML()); processLinks($conn, $row, $href, $imgLink, $title, $time, $imgIndex, false, true, false); } }
function getMoreNodes($params, $nodes = [], $links = []) { if (!isset($params["node_id"]) || !$params["node_id"]) { echo "node_id must be passed"; exit; } $node_id = $params["node_id"]; //First we need to find links that are related to our already known node. //This node can be in 'from' field or in 'to' field, so we need to check //both of them: //from: $rel_links_1 = getRelatedLinks(array_merge($params, ["target" => "from", "node_id" => $node_id])); //to: $rel_links_2 = getRelatedLinks(array_merge($params, ["target" => "to", "node_id" => $node_id])); //Both returned links must be formatted for NetChart and added to 'links' array $links = processLinks($links, $rel_links_1, $node_id); $links = processLinks($links, $rel_links_2, $node_id); return [$nodes, $links]; }
function processPage($pageHtml) { $pageDom = changeLayout($pageHtml); processImages($pageDom); processLinks($pageDom); removeNoscript($pageDom); removeNavigation($pageDom); removeComingSoon($pageDom); return $pageDom->saveHTML(); }