Пример #1
0
function list_get()
{
    global $DB, $Core, $_title_;
    // Container for XML data
    $xmldata = '';
    $Query = new BoardQuery();
    $List = new BoardList();
    $List->type(LIST_THREAD);
    $_title_ = TITLE_BOARD;
    if (FUNDRAISER_ID != -1) {
        $goal = $Core->fundraiser_goal();
        $total = $Core->fundraiser_total();
        $remaining = number_format(str_replace(array("\$", ","), "", $goal) - str_replace(array("\$", ","), "", $total), 2);
        $days = round((strtotime("2011-02-01") - time()) / 86400) + round(substr($total, 1) / 6.53);
        //    $_title_ .=  " <span class=\"smaller\">&raquo; $$remaining left to raise ($days days until bco shuts down)</span>";
        $_title_ .= " <span class=\"smaller\">&raquo; \${$remaining} left to raise</span>";
    }
    $List->title($_title_);
    $List->header();
    // stickies
    $DB->query($Query->list_thread(true, false, false));
    $List->data($DB->load_all());
    if (get('xml')) {
        $xmldata .= $List->thread_xml(true);
    } else {
        $List->thread(true);
    }
    // the rest
    $DB->query($Query->list_thread(false, cmd(2, true), cmd(3, true)));
    $List->data($DB->load_all());
    if (get('xml')) {
        $xmldata .= $List->thread_xml();
    } else {
        $List->thread();
    }
    // Build XML output
    if (get('xml')) {
        header("Content-type: text/xml");
        print "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
        print "<threads>\n";
        print $xmldata;
        print "</threads>";
    }
    $List->footer();
}