本文整理汇总了PHP中ImageHelper::setRelatedWikiHows方法的典型用法代码示例。如果您正苦于以下问题:PHP ImageHelper::setRelatedWikiHows方法的具体用法?PHP ImageHelper::setRelatedWikiHows怎么用?PHP ImageHelper::setRelatedWikiHows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageHelper
的用法示例。
在下文中一共展示了ImageHelper::setRelatedWikiHows方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRelatedWikiHowsWidget
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;
}