Map markers with a sledrun page in the wiki argument get the sledrun photo now.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sun, 3 Nov 2013 22:22:29 +0000 (22:22 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sun, 3 Nov 2013 22:22:29 +0000 (22:22 +0000)
git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/mediawiki_extensions/wrmap/trunk@1789 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wrmap.body.php

index 0cadc82e7c6164ac20ecec92bbf5d801e597bf4d..766b1881d0c4d2d230435949c977957b016828cc 100644 (file)
@@ -86,7 +86,11 @@ class WrBaseMap {
                        $key_sledrun = $wgContLang->getNSText(NS_CATEGORY) . ':Rodelbahn';
                        if (array_key_exists($key_sledrun, $categories)) {
                                // for sledrun titles use the image from the rodelbahnbox
                        $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)) {
                        }
                        $key_inn = $wgContLang->getNSText(NS_CATEGORY) . ':Gasthaus';
                        if (array_key_exists($key_inn, $categories)) {