|
@@ -1,6 +1,7 @@
|
|
<?php
|
|
<?php
|
|
include("config.php");
|
|
include("config.php");
|
|
include("ppub.php");
|
|
include("ppub.php");
|
|
|
|
+include("theme.php");
|
|
|
|
|
|
define("INDEX_TYPE_MAIN", 0);
|
|
define("INDEX_TYPE_MAIN", 0);
|
|
define("INDEX_TYPE_TAG", 1);
|
|
define("INDEX_TYPE_TAG", 1);
|
|
@@ -77,13 +78,20 @@ if($asset == '' and $_SERVER['REQUEST_URI'][-1] != '/') {
|
|
|
|
|
|
|
|
|
|
if($file == "" or $file == "/" or $file == "feed.rss") {
|
|
if($file == "" or $file == "/" or $file == "feed.rss") {
|
|
|
|
+ $start = "index_start";
|
|
|
|
+ $no_content = "index_no_content";
|
|
|
|
+ $listing = "index_listing";
|
|
|
|
+ $end = "index_end";
|
|
|
|
+
|
|
if($file == "feed.rss") {
|
|
if($file == "feed.rss") {
|
|
header("content-type: application/rss+xml");
|
|
header("content-type: application/rss+xml");
|
|
- include("rss_template.php");
|
|
|
|
|
|
+ $start = "rss_start";
|
|
|
|
+ $listing = "rss_listing";
|
|
|
|
+ $no_content = "rss_no_content";
|
|
|
|
+ $end = "rss_end";
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
header("content-type: text/html");
|
|
header("content-type: text/html");
|
|
- include("index_template.php");
|
|
|
|
}
|
|
}
|
|
|
|
|
|
$index_type = INDEX_TYPE_MAIN;
|
|
$index_type = INDEX_TYPE_MAIN;
|
|
@@ -103,20 +111,20 @@ if($file == "" or $file == "/" or $file == "feed.rss") {
|
|
$index_arg = get_tag_list();
|
|
$index_arg = get_tag_list();
|
|
}
|
|
}
|
|
|
|
|
|
- index_start($index_type, $index_arg);
|
|
|
|
|
|
+ $start($index_type, $index_arg);
|
|
$list = get_ppub_file_list();
|
|
$list = get_ppub_file_list();
|
|
|
|
|
|
foreach ($list as $file) {
|
|
foreach ($list as $file) {
|
|
$ppub = new Ppub();
|
|
$ppub = new Ppub();
|
|
$ppub->read_file(PUBLICATION_DIR . "/".$file);
|
|
$ppub->read_file(PUBLICATION_DIR . "/".$file);
|
|
- index_listing($ppub, $file);
|
|
|
|
|
|
+ $listing($ppub, $file);
|
|
}
|
|
}
|
|
|
|
|
|
if(count($list) == 0) {
|
|
if(count($list) == 0) {
|
|
- index_no_content($index_type, $index_arg);
|
|
|
|
|
|
+ $no_content($index_type, $index_arg);
|
|
}
|
|
}
|
|
|
|
|
|
- index_end();
|
|
|
|
|
|
+ $end();
|
|
exit();
|
|
exit();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -160,7 +168,6 @@ header("Cache-Control: public, max-age=604800");
|
|
|
|
|
|
if(strpos($accepts, "text/html") !== false && $asset->mimetype == "text/markdown" && !isset($_GET["raw"])) {
|
|
if(strpos($accepts, "text/html") !== false && $asset->mimetype == "text/markdown" && !isset($_GET["raw"])) {
|
|
header("content-type: text/html");
|
|
header("content-type: text/html");
|
|
- include("content_template.php");
|
|
|
|
include("Parsedown.php");
|
|
include("Parsedown.php");
|
|
$pd = new Parsedown();
|
|
$pd = new Parsedown();
|
|
content_start($ppub, $file_name);
|
|
content_start($ppub, $file_name);
|
|
@@ -175,16 +182,15 @@ else if(strpos($accepts, "text/html") !== false && $asset->mimetype == "applicat
|
|
$video = new Ppvm();
|
|
$video = new Ppvm();
|
|
$video->from_string($ppub->read_asset($asset));
|
|
$video->from_string($ppub->read_asset($asset));
|
|
|
|
|
|
|
|
+ include("video_player.php");
|
|
if(isset($_GET["embed"])) {
|
|
if(isset($_GET["embed"])) {
|
|
- include("video_player.php");
|
|
|
|
ppvm_player($ppub, $file_name, $video);
|
|
ppvm_player($ppub, $file_name, $video);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- include("video_template.php");
|
|
|
|
- content_start($ppub, $file_name, $video);
|
|
|
|
|
|
+ video_start($ppub, $file_name, $video);
|
|
$description = $ppub->asset_index[$video->metadata["description"]];
|
|
$description = $ppub->asset_index[$video->metadata["description"]];
|
|
- content_html($pd->text($ppub->read_asset($description)));
|
|
|
|
- content_end($ppub);
|
|
|
|
|
|
+ video_html($pd->text($ppub->read_asset($description)));
|
|
|
|
+ video_end($ppub);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
else {
|