Пример #1
0
/**
 * The screen that's shown when you click 'rebuild frontpage'
 *
 */
function buildfrontpage()
{
    global $Weblogs;
    PageHeader(lang('adminbar', 'buildfrontpage'), 1);
    PageAnkeiler(lang('adminbar', 'buildfrontpage'));
    echo "<p>";
    buildfrontpage_function();
    // Ensure that frontpages for all weblogs are built.
    foreach ($Weblogs as $name => $weblog) {
        generate_frontpage($name);
    }
    print_timers();
    echo "</p><p><b>" . lang('general', 'done') . "</b></p>";
}
Пример #2
0
function timedpublishcheck()
{
    global $serialize_cache, $Cfg, $Paths;
    $temp_db = new db();
    if (isset($Cfg['check_for_timed_publish']) && $Cfg['check_for_timed_publish'] > 0) {
        $amount = $Cfg['check_for_timed_publish'];
    } else {
        $amount = 10;
    }
    $entries = $temp_db->getlist(-$amount, 0, "", "", false, "date");
    $date = date("Y-m-d-H-i", get_current_date());
    $regen = false;
    foreach ($entries as $entry) {
        if ($entry['status'] == "timed") {
            $entry = $temp_db->read_entry($entry['code']);
            if ($entry['publish_date'] <= $date) {
                debug("toggle");
                $entry['date'] = $entry['publish_date'];
                $entry['status'] = "publish";
                $temp_db->set_entry($entry);
                $temp_db->save_entry(TRUE);
                notify_new('entry', $entry);
                $regen = TRUE;
                // 2004/10/17 =*=*= JM
                // can only do this if we know Cfg['search_index'] status...
                if (isset($Cfg)) {
                    // if the global index as they are made var is set - can continue
                    // the rest is copied from 'entrysubmit_screen()' in pv_core.php
                    if ('1' == $Cfg['search_index'] && can_search_cats(cfg_cat_nosearchindex(), $entry['category'])) {
                        include_once 'modules/module_search.php';
                        update_index($temp_db->entry);
                        debug('update search index: ' . $temp_db->entry['code']);
                    }
                }
            }
        }
    }
    if ($regen) {
        buildfrontpage_function();
        return TRUE;
    } else {
        return FALSE;
    }
}