$key_sledrun = $wgContLang->getNSText(NS_CATEGORY) . ':Rodelbahn';
if (array_key_exists($key_sledrun, $categories)) {
// for sledrun titles use the image from the rodelbahnbox
- // TODO
+ $dbr = wfGetDB(DB_SLAVE);
+ $res = $dbr->select('wrsledruncache', 'image', array('page_id' => $title->getArticleID()), __METHOD__);
+ $image = $dbr->fetchRow($res);
+ if ($image && !is_null($image['image'])) $file = wfFindFile($image['image']);
+ $dbr->freeResult($res);
}
$key_inn = $wgContLang->getNSText(NS_CATEGORY) . ':Gasthaus';
if (array_key_exists($key_inn, $categories)) {
$properties = array('type' => 'sledrun', 'name' => $title->getText(), 'wiki' => $title->getLocalUrl());
if (!is_null($sledrun['date_report'])) $properties['date_report'] = $sledrun['date_report'];
if (!is_null($sledrun['condition'])) $properties['condition'] = intval($sledrun['condition']);
+ $image_url = WrBaseMap::wikipage_to_image($title, 150);
+ if (!is_null($image_url)) $properties['thumb_url'] = $image_url;
$json_feature = array(
'type' => 'feature',
'geometry' => array(