Exemplo n.º 1
0
     $reformat_find = array("/((http|ftp):\\/\\/[^ \n,]*)/S", "/([^<>\"\\/])((www|ftp)\\.[a-zA-Z]*\\....?)([^<>\"\\/])/S", "/^- /m", "/\n\\s*?[-=]+\\s*\n/", "/^\\*/m", "/^\\+/m", "/\r+\n?@(.*?)@\r+\n?\r?\n?/", "/\n/", "/(\\\$\\d+([,.]\\d+)?k?)/S", "/(f40|f50|ferrari|ferarri)/i");
     $reformat_replace = array("<a href=\"\\1\">\\1</a>", "\\1<a href=\"http://\\2\">\\2</a>\\4", "<span class=\"against\">-</span> ", "<hr />", "<span class=\"done\">*</span>", "<span class=\"fix\">+</span>", "<h4>\\1</h4>", "<br />\n", "<span class=\"money\">\\1</span>", "<span class=\"ferrari\">\\1</span>");
     // FORMAT
     $data_plan = preg_replace($reformat_find, $reformat_replace, $data_plan);
     // Put the code tags back in
     for ($i = 0; $i < count($replace_anchors); $i++) {
         $data_plan = str_replace($replace_anchors[$i]["anchor_index"], $replace_anchors[$i]["replacement"], $data_plan);
     }
     if ($box_highlight) {
         $h = " class=\"plan_alternate\"";
     } else {
         $h = " class=\"plan\"";
     }
     $box_highlight ^= 1;
     // add_to_timeline( $timestamp, $type, $title, $url )
     add_to_timeline($date_from_file, "Plan", $timeline_title, $conf->user . "_plan_{$key}.html#{$hash}");
     $body .= "<h3><a href=\"#{$hash}\"><img src=\"dot.png\" alt=\"\" /></a><a id=\"{$hash}\"></a>{$entry_title}</h3>\n<div{$h}>\n" . $data_plan . "</div>\n";
     // Make a list of titles by month
     $month = substr($hash, 5, 2);
     $titles_by_month[$month][] = array("hash" => $hash, "title" => $title);
 }
 $body .= "<p style=\"padding: 5px\"></p>";
 // Build title list
 $titles = "<h2>Topics</h2>";
 ksort($titles_by_month);
 foreach ($titles_by_month as $month => $title_list) {
     $entries = count($title_list);
     $entry_txt = "{$entries} entr";
     if ($entries == 1) {
         $entry_txt .= "y";
     } else {
Exemplo n.º 2
0
fclose($fp);
$output_file = "../slashdot.html";
$fp = fopen($output_file, "w");
$head = preg_replace(array("/@keywords/", "/@title/"), array($conf->keywords . ", slashdot", "{$conf->title} - Slashdot archive"), $conf->header);
$head .= read_file("template/slashdot.html");
$titles = "<h2>Article List</h2>\n<ul>\n";
ksort($sids);
foreach ($sids as $sid_key => $sid_info) {
    $titles .= "\t<li>" . sidkey_to_date($sid_key) . " - <a href=\"#s{$sid_key}\">{$sid_info['title']}</a></li>\n";
}
$titles .= "</ul>\n\n";
$body = "<h2>Comments</h2>\n";
ksort($sids);
foreach ($sids as $sid_key => $sid_info) {
    $body .= "\t<h3><a href=\"#s{$sid_key}\"><img src=\"dot.png\" alt=\"\" /></a><a id=\"s{$sid_key}\"></a> <a href=\"{$sid_info['url']}\">{$sid_info['title']}</a></h3>\n\n\t<div class=\"highlight_block\">\n";
    ksort($posts[$sid_key]);
    foreach ($posts[$sid_key] as $date => $post_list) {
        foreach ($post_list as $idx => $post_info) {
            add_to_timeline(substr($date, 0, 8), "Slashdot", "{$post_info['article']} - {$post_info['title']}", "slashdot.html#s{$sid_key}");
            $body .= "\t\t<h4>" . date_to_string($date) . " - <a href=\"{$post_info['url']}\">{$post_info['title']}</a></h4><div>{$post_info['post']}</div>\n";
        }
    }
    $body .= "\t</div>\n";
}
$body .= "<p></p>";
fputs($fp, $head);
fputs($fp, $titles);
fputs($fp, $body);
fputs($fp, $conf->footer);
fclose($fp);
chmod($output_file, 0666);
Exemplo n.º 3
0
 /*
 	MAIN PAGE
 */
 /*
 if ( $box_alternate == 0 ) {
 	$cl = " class=\"li_alternate\"";
 } else {
 	$cl = "";
 }
 */
 $cl = "";
 $box_alternate ^= 1;
 $output_file = $conf->user . "_interview_" . substr($date_key, 0, 4) . "_" . $clean_title_in . ".html";
 $output_path = "../{$output_file}";
 // add_to_timeline( $timestamp, $type, $title, $url )
 add_to_timeline(substr($date_key, 0, 8), "Interview", $title_in, $output_file);
 $titles .= "<li{$cl}><span class=\"strong\">" . date_to_string($date_key) . "</span> - {$organization_in} - <a href=\"{$output_file}\"> {$title_in} </a> - \n{$synopsis_in}</li> \n";
 /*
 	SUB PAGE
 */
 $fp_out = fopen($output_path, "w");
 $head_out = preg_replace(array("/@keywords/", "/@title/"), array($conf->keywords . ", interview", "{$conf->title} - {$title_in} (" . date_to_string($date_key) . ")"), $conf->header);
 $head_out .= "<h1>{$title_in}</h1><p></p>\r\n<h2>Overview</h2>\r\n<p>\r\n\t<span class=\"strong\">Date: </span> " . date_to_string($date_key) . " <br />\r\n\t<span class=\"strong\">Original URL: </span> <a href=\"{$url_in}\">{$url_in}</a> <br />\r\n\t<span class=\"strong\">Synopsis: </span> {$synopsis_in} <br />\r\n</p>";
 $body_out = "<h2>Questions</h2>";
 $sections_out = "";
 $sections_cnt = 0;
 $questions_cnt = 0;
 preg_match_all("/<(.+?)( .+?)?>(.+?)<\\/\\1>\r/s", $text_in, $tags_out, PREG_SET_ORDER);
 for ($i = 0; $i < count($tags_out); $i++) {
     $tag = $tags_out[$i][1];
     $tag_args = $tags_out[$i][2];
Exemplo n.º 4
0
include "slash2html.php";
include "interview2html.php";
include "plan2html.php";
// add_to_timeline( $timestamp, $type, $title, $url )
// artificial for audio
add_to_timeline("19980723", "Audio", "John Carmack at CPL 1998", "http://www.archive.org/details/john_carmack_cpl_1998");
add_to_timeline("20020815", "Audio", "John Carmack at QuakeCon 2002", "http://www.archive.org/details/john_carmack_quakecon_2002");
add_to_timeline("20040812", "Audio", "John Carmack at QuakeCon 2004", "http://www.archive.org/details/john_carmack_quakecon_2004");
add_to_timeline("20050811", "Audio", "John Carmack at QuakeCon 2005", "http://www.archive.org/details/john_carmack_quakecon_2005");
add_to_timeline("20060804", "Audio", "John Carmack at QuakeCon 2006", "http://www.archive.org/details/john_carmack_quakecon_2006");
add_to_timeline("20070803", "Audio", "John Carmack at QuakeCon 2007", "http://www.archive.org/details/JohnCarmackAtQuakecon2007");
add_to_timeline("20080801", "Audio", "John Carmack at QuakeCon 2008 (Keynote Up!)", "http://www.archive.org/details/JohnCarmackAtQuakecon2008");
add_to_timeline("20090813", "Audio", "John Carmack at QuakeCon 2009", "http://www.archive.org/details/JohnCarmackAtQuakecon2009");
add_to_timeline("20100815", "Audio", "John Carmack at QuakeCon 2010", "http://www.archive.org/details/JohnCarmackAtQuakecon2010");
add_to_timeline("20110806", "Audio", "John Carmack interview by pcper.com at QuakeCon 2011", "http://www.archive.org/details/JohnCarmackAtQuakecon2011");
add_to_timeline("20110807", "Audio", "John Carmack at QuakeCon 2011", "http://www.archive.org/details/JohnCarmackAtQuakecon2011");
write_template("audio.html", ", audio, mp3, speech, keynote", " - Audio files");
write_template("plan.html", ", blog, log, plan", " - plan Archive");
write_template("pdfs.html", ", pdf", " - .pdf Archive");
// build latest postings for index
krsort($timeline);
$text = "<h2>Recent Items</h2>\n<ul>";
$items = 0;
foreach ($timeline as $timestamp => $link_array) {
    $cnt = count($link_array);
    for ($i = $cnt - 1; $i >= 0; $i--) {
        if ($items++ > 20) {
            break;
        }
        $link_info = $link_array[$i];
        $text .= "<li><span class=\"strong\">" . date_to_string($timestamp) . "</span> - ({$link_info['type']}) <a href=\"{$link_info['url']}\">{$link_info['title']}</a></li>\n";