Exemplo n.º 1
0
    function getFoundInArticles($quiz_name)
    {
        $html = '';
        $dbr = wfGetDB(DB_SLAVE);
        $res = $dbr->select('quiz_links', 'ql_page', array('ql_name' => $quiz_name), __METHOD__);
        foreach ($res as $row) {
            $t = Title::newFromId($row->ql_page);
            if ($t && $t->exists()) {
                global $wgUser;
                $sk = $wgUser->getSkin();
                $img = $sk->getGalleryImage($t, 44, 33);
                if (!self::$firstRelated) {
                    $firstid = ' id="the_article_url"';
                } else {
                    $firstid = '';
                }
                $html .= '<tr>
							<td class="thumb"><a href="../' . $t->getPartialURL() . '"><img src="' . $img . '" alt=""></a></td>
							<td><a href="../' . $t->getPartialURL() . '"' . $firstid . '>' . $t->getText() . '</a></td>
						</tr>';
                //FIRST!
                //save for meta description and related articles
                if (!self::$firstRelated) {
                    self::$firstRelated = ' ' . wfMsg('dv-meta-article-prefix') . ' ' . htmlspecialchars($t->getText());
                    self::$firstRelatedTitle = $t;
                    //also, let's grab the bg image for this quiz from this article
                    self::$quizBG = $sk->getGalleryImage($t, 635, -1);
                }
            }
        }
        return $html;
    }