public function complete()
 {
     $step = session('step');
     if (!$step) {
         $this->redirect('index');
     } elseif ($step != 3) {
         $this->redirect("Install/step{$step}");
     }
     //创建入口文件
     write_index();
     file_put_contents(MODULE_PATH . 'Data/install.lock', '');
     session('step', null);
     session('error', null);
     $this->display();
 }
示例#2
0
文件: help.php 项目: apcsa/glossary
    }
}
include_once "header.php";
?>
<div id="helpHeader">
   <img src="static/art/graphics/helpicon22.png">
   <div id="course">
      Level-Up Computer Science: Advanced Placement Computer Science A
   </div>
   <div id="title">
      Help Guide
   </div>
</div>
<div id="help_index">
   <?php 
write_index();
?>
</div>
<div class="topic">
   <?php 
write_topic_header();
?>
</div>
<div class="definition">
   <?php 
write_topic_definition();
?>
</div>
<?php 
include_once "footer.php";
function write_index()
示例#3
0
文件: genhtml.php 项目: it114/witness
}
copy('./glass.png', "{$out_path}/glass.png");
copy('./witness.css', "{$out_path}/witness.css");
$db = new SQLite3($db_path, SQLITE3_OPEN_READONLY);
$globals = array();
$results = $db->query('select * from globals;');
while ($row = $results->fetchArray()) {
    $globals[$row['name']] = $row['value'];
}
$global_urls = array();
$results = $db->query('select * from globals;');
while ($row = $results->fetchArray()) {
    $global_urls[$row['name']] = write_var($out_path, $row, 'g');
}
$error = false;
if (write_index($out_path) === false) {
    echo "write index error\n";
}
echo "OK\n";
function write_index($path)
{
    global $db;
    $rows = array();
    $results = $db->query('select * from calls order by call desc;');
    while ($row = $results->fetchArray()) {
        $func_id = $row['func'];
        $res = $db->querySingle("select * from funcs where func = {$func_id};", true);
        $res['call'] = $row['call'];
        $res['prev'] = $row['prev'];
        $res['cur'] = $row['line'];
        $rows[] = write_src($path, $res);
示例#4
0
/**
 * The screen that's shown when we rebuild the search index.
 *
 */
function build_search()
{
    global $Cfg, $filtered_words, $Pivot_Vars;
    PageHeader(lang('adminbar', 'buildsearchindex'), 1);
    PageAnkeiler(lang('adminbar', 'buildsearchindex') . ' &raquo; ' . lang('adminbar', 'buildsearchindex_title'));
    /* JM - Bob said was 300, and was lowered to 200 because of a user
    			with large entries going over PHP's 8Mb variables limit... wow!
    			Is there a more elegant/flexible solution? he asks.
    	*/
    // initialise the threshold.. Initially it's set to 10 * the rebuild_threshold,
    // roughly assuming we index 10 entries per second.
    if (isset($Cfg['rebuild_threshold']) && $Cfg['rebuild_threshold'] > 4) {
        $chunksize = 10 * $Cfg['rebuild_threshold'];
    } else {
        $chunksize = 280;
    }
    @set_time_limit(0);
    echo "<p><strong>" . lang('adminbar', 'buildsearchindex_start') . "</strong><br /><br />\n";
    flush();
    makedir("db/search");
    include_once "modules/module_search.php";
    $start = isset($Pivot_Vars['start']) ? $Pivot_Vars['start'] : 0;
    $stop = $start + $chunksize;
    $time = isset($Pivot_Vars['time']) ? $Pivot_Vars['time'] : 0;
    if ($start == 0) {
        clear_index();
    }
    $continue = start_index($start, $stop, $time);
    write_index(FALSE);
    $time = isset($Pivot_Vars['time']) ? $Pivot_Vars['time'] : 0;
    $time += timetaken('int');
    if ($continue) {
        $myurl = sprintf("index.php?session=%s&menu=admin&func=admin&do=build_search&start=%s&time=%s", $Pivot_Vars['session'], $stop, $time);
        printf('<script> self.location = "%s"; </script>', $myurl);
        //printf('<a href="%s">%s</a>',$myurl,$myurl);
    } else {
        echo "<br /><br />\n\n<p><b>" . str_replace("%num%", $time, lang('adminbar', 'buildindex_finished')) . "</b><br /><br /></p>\n";
    }
    // stuff stops here..
    PageFooter();
}
示例#5
0
function make_entry_indexline($write = 1)
{
    global $row;
    if (strlen($row['title']) > 2) {
        $title = $row['title'];
    } else {
        $title = substr($row['introduction'], 0, 300);
        $title = strip_tags($title);
        $title = str_replace("\n", "", $title);
        $title = str_replace("\r", "", $title);
        $title = substr($title, 0, 60);
    }
    $size = strlen($row['introduction']) + strlen($row['body']);
    $filename = str_replace("blog-", "entry", add_code_padding($row['code']) . ".php");
    $index_line = sprintf('"%d","%s","%s","%s","%s"', $row['id'], add_code_padding($row['code']), addslashes($row['date']), addslashes($row['user']), addslashes($title));
    $index_line .= sprintf(',"%s"', $filename);
    $index_line .= sprintf(',"%s"', $row['template']);
    $index_line .= sprintf(',"%s"', $size);
    if (isset($row['comments'])) {
        for ($i = 0; $i < count($row['comments']); $i++) {
            $comment_names[] = $row['comments'][$i]['name'];
        }
    }
    if (isset($comment_names)) {
        $comment_names = implode("|", $comment_names);
    }
    if (isset($row['comments'])) {
        $index_line .= sprintf(',"%s","%s"', count($row['comments']), $comment_names);
    } else {
        $index_line .= sprintf(',"0",""');
    }
    //debug($index_line);
    add_to_index($index_line);
    if ($write == 1) {
        write_index();
        //debug("write index");
    }
}