/**
     * Show the special page
     *
     * @param $par Mixed: parameter passed to the page or null
     */
    public function execute($par)
    {
        global $wgOut, $wgRequest, $wgSupressPageTitle;
        $wgSupressPageTitle = true;
        // Add CSS & JS
        $wgOut->addModules('ext.linkFilter');
        $per_page = 20;
        $page = $wgRequest->getInt('page', 1);
        $link_type = $wgRequest->getInt('link_type');
        if ($link_type) {
            $type_name = Link::$link_types[$link_type];
            $pageTitle = wfMsg('linkfilter-home-title', $type_name);
        } else {
            $type_name = 'All';
            $pageTitle = wfMsg('linkfilter-home-title-all');
        }
        $wgOut->setPageTitle($pageTitle);
        $output = '<div class="links-home-left">' . "\n\t";
        $output .= '<h1 class="page-title">' . $pageTitle . '</h1>' . "\n\t";
        $output .= '<div class="link-home-navigation">
		<a href="' . Link::getSubmitLinkURL() . '">' . wfMsg('linkfilter-submit-title') . '</a>' . "\n";
        if (Link::canAdmin()) {
            $output .= "\t\t" . '<a href="' . Link::getLinkAdminURL() . '">' . wfMsg('linkfilter-approve-links') . '</a>' . "\n";
        }
        $output .= "\t\t" . '<div class="cleared"></div>
		</div>' . "\n";
        $l = new LinkList();
        $type = 0;
        // FIXME lazy hack --Jack on July 2, 2009
        $total = $l->getLinkListCount(LINK_APPROVED_STATUS, $type);
        $links = $l->getLinkList(LINK_APPROVED_STATUS, $type, $per_page, $page, 'link_approved_date');
        $linkRedirect = SpecialPage::getTitleFor('LinkRedirect');
        $output .= '<div class="links-home-container">';
        $link_count = count($links);
        $x = 1;
        // No links at all? Oh dear...show a message to the user about that!
        if ($link_count <= 0) {
            $wgOut->addWikiMsg('linkfilter-no-links-at-all');
        }
        // Create RSS feed icon for special page
        $wgOut->setSyndicated(true);
        // Make feed (RSS/Atom) if requested
        $feedType = $wgRequest->getVal('feed');
        if ($feedType != '') {
            return $this->makeFeed($feedType, $links);
        }
        foreach ($links as $link) {
            $border_fix = '';
            if ($link_count == $x) {
                $border_fix = 'border-fix';
            }
            $border_fix2 = '';
            wfSuppressWarnings();
            $date = date('l, F j, Y', $link['approved_timestamp']);
            if ($date != $last_date) {
                $border_fix2 = ' border-top-fix';
                $output .= "<div class=\"links-home-date\">{$date}</div>";
                #global $wgLang;
                #$unix = wfTimestamp( TS_MW, $link['approved_timestamp'] );
                #$weekday = $wgLang->getWeekdayName( gmdate( 'w', $unix ) + 1 );
                #$output .= '<div class="links-home-date">' . $weekday .
                #	wfMsg( 'word-separator' ) . $wgLang->date( $unix, true ) .
                #	'</div>';
            }
            wfRestoreWarnings();
            // okay, so suppressing E_NOTICEs is kinda bad practise, but... -Jack, January 21, 2010
            $last_date = $date;
            $output .= "<div class=\"link-item-container{$border_fix2}\">\n\t\t\t\t\t<div class=\"link-item-type\">\n\t\t\t\t\t\t{$link['type_name']}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"link-item\">\n\t\t\t\t\t\t<div class=\"link-item-url\">\n\t\t\t\t\t\t\t<a href=\"" . $linkRedirect->escapeFullURL(array('link' => 'true', 'url' => $link['url'])) . '" target="new">' . $link['title'] . '</a>
						</div>
						<div class="link-item-desc">' . $link['description'] . '</div>
					</div>
					<div class="link-item-page">
						<a href="' . $link['wiki_page'] . '">(' . wfMsgExt('linkfilter-comments', 'parsemag', $link['comments']) . ')</a>
					</div>
					<div class="cleared"></div>';
            $output .= '</div>';
            $x++;
        }
        $output .= '</div>';
        /**
         * Build next/prev nav
         */
        $numofpages = $total / $per_page;
        $pageLink = $this->getTitle();
        if ($numofpages > 1) {
            $output .= '<div class="page-nav">';
            if ($page > 1) {
                $output .= '<a href="' . $pageLink->escapeFullURL('page=' . ($page - 1)) . '">' . wfMsg('linkfilter-previous') . '</a> ';
            }
            if ($total % $per_page != 0) {
                $numofpages++;
            }
            if ($numofpages >= 9 && $page < $total) {
                $numofpages = 9 + $page;
            }
            if ($numofpages > $total / $per_page) {
                $numofpages = $total / $per_page + 1;
            }
            for ($i = 1; $i <= $numofpages; $i++) {
                if ($i == $page) {
                    $output .= $i . ' ';
                } else {
                    $output .= '<a href="' . $pageLink->escapeFullURL('page=' . $i) . "\">{$i}</a> ";
                }
            }
            if ($total - $per_page * $page > 0) {
                $output .= ' <a href="' . $pageLink->escapeFullURL('page=' . ($page + 1)) . '">' . wfMsg('linkfilter-next') . '</a>';
            }
            $output .= '</div>';
        }
        $output .= '</div>' . "\n";
        // .links-home-left
        global $wgLinkPageDisplay;
        if ($wgLinkPageDisplay['rightcolumn']) {
            $output .= '<div class="links-home-right">';
            $output .= '<div class="links-home-unit-container">';
            $output .= $this->getPopularArticles();
            $output .= $this->getInTheNews();
            $output .= '</div>';
            $output .= $this->getAdUnit();
            $output .= '</div>';
        }
        $output .= '<div class="cleared"></div>' . "\n";
        $wgOut->addHTML($output);
    }