Beispiel #1
0
 function getRelatedWikiHowsWidget($title)
 {
     global $wgUser, $wgOut;
     wfLoadExtensionMessages('ImageHelper');
     $articles = ImageHelper::getLinkedArticles($title);
     $relatedArticles = array();
     foreach ($articles as $t) {
         $related = ImageHelper::setRelatedWikiHows($t);
         foreach ($related as $titleString) {
             $relatedArticles[$titleString] = $titleString;
         }
     }
     $section = '';
     $count = 0;
     $images = '';
     foreach ($relatedArticles as $titleString) {
         $t = Title::newFromText($titleString);
         if ($t && $t->exists()) {
             $sk = $wgUser->getSkin();
             $images .= $sk->getArticleThumb($t, 127, 140);
             if (++$count == 6) {
                 break;
             }
         }
     }
     if ($count > 0) {
         $section .= "<h3>" . wfMsg('ih_relatedArticles') . "</h3>\n\t\t\t\t\t\t<div class='other_articles_side'>\n\t\t\t\t\t\t{$images}\n\t\t\t\t\t\t<div class='clearall'></div>\n\t\t\t\t\t\t</div>";
     }
     return $section;
 }