// Query database
$dbr = wfGetDB(DB_SLAVE);
- $res = $dbr->select('wrsledruncache', array('page_title', 'position_latitude', 'position_longitude'), array('show_in_overview', 'not under_construction'));
+ $res = $dbr->select(array('wrsledruncache', 'wrreportcache'), array('wrsledruncache.page_title', 'position_latitude', 'position_longitude', 'date_report', '`condition`'), array('show_in_overview', 'not under_construction'), __METHOD__, array(), array('wrreportcache' => array('left outer join', 'wrsledruncache.page_id=wrreportcache.page_id')));
$sledruns = array();
while ($sledrun = $dbr->fetchRow($res)) $sledruns[] = $sledrun;
$dbr->freeResult($res);
$lon = $sledrun['position_longitude'];
if (!$lat || !$lon) continue;
$title = Title::newFromText($sledrun['page_title']);
- $output .= "<p data-lon=\"$lon\" data-lat=\"$lat\" data-title=\"{$title->getText()}\" data-url=\"{$title->getLocalUrl()}\" />\n";
+ $title_text = htmlspecialchars($title->getText());
+ $title_url = htmlspecialchars($title->getLocalUrl());
+ $output .= "<p data-lon=\"$lon\" data-lat=\"$lat\" data-title=\"$title_text\" data-url=\"$title_url\" ";
+ if (!is_null($sledrun['date_report'])) $output .= "data-date_report=\"{$sledrun['date_report']}\" ";
+ if (!is_null($sledrun['condition'])) $output .= "data-condition=\"{$sledrun['condition']}\" ";
+ $output .= "/>\n";
}
$output .= "</div>\n";