Exemplo n.º 1
0
/**
 * Rebuild the linkbar file (in linkbar.php), which
 * spans the top/bottom of pages
 */
function rebuild_linkbars()
{
    $db = new ThornDBI();
    $looper = 1;
    $boards = $db->getvisibleboards();
    $showcount = count($boards);
    $sidelinks = fopen("linkbar.php", "w") or die("Could not open linkbar.php for writing.");
    fwrite($sidelinks, '<table style="width: 100%;"><tr><td style="text-align: left;">[');
    foreach ($boards as $boardentry) {
        if (THuserewrite) {
            fwrite($sidelinks, '<a class="info" href="' . THurl);
        } else {
            fwrite($sidelinks, '<a class="info" href="' . THurl . 'drydock.php?b=');
        }
        fwrite($sidelinks, $boardentry['folder'] . '">' . $boardentry['folder'] . '<span>' . $boardentry['name'] . " - " . $boardentry['about'] . "</span></a>\n");
        //finish it up
        if ($looper < $showcount) {
            fwrite($sidelinks, '/');
        }
        $looper++;
    }
    fwrite($sidelinks, ']</td><td style="text-align: right;">[');
    if (THnewsboard > 0) {
        if (THuserewrite) {
            fwrite($sidelinks, ' <a class=info href="' . THurl);
        } else {
            fwrite($sidelinks, ' <a class=info href="' . THurl . 'drydock.php?b=');
        }
        fwrite($sidelinks, $db->getboardname(THnewsboard) . '">' . $db->getboardname(THnewsboard) . "</a> /\n");
    }
    //uncomment this out if you have the irc stuff installed - we don't ship it ~tyam
    //THuseirc doesn't exist, it's a placeholder for future integration
    /*
    		if (THnewsboard>0 && THuseirc ) { fwrite($sidelinks, '/'); };
    		if irc {
    			fwrite($sidelinks, ' <a class=info href="'.THurl.'irc/">irc</a> /'."\n");
    		}//if irc
    */
    fwrite($sidelinks, ' <a class=info href="' . THurl . '">idx</a> ]</td>');
    fwrite($sidelinks, '</tr></table>');
    fclose($sidelinks);
}