video_template.php 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. function content_start($ppub, $path, $video) {
  3. $metadata = $ppub->metadata;
  4. ?>
  5. <!DOCTYPE html>
  6. <html lang="<?php echo($metadata["language"] ?? SITE_LANGUAGE);?>">
  7. <head>
  8. <meta charset="utf-8">
  9. <title><?php echo(htmlentities($metadata["title"]));?> - <?php echo(SITE_NAME);?></title>
  10. <meta name="description" content="<?php echo(htmlentities($metadata["description"]));?>">
  11. <meta name="author" content="<?php echo(htmlentities($metadata["author"]));?>">
  12. <link rel="stylesheet" href="<?php echo(SITE_URL);?>/vanilla.css">
  13. <link rel="alternate" type="application/x-ppub" title="<?php echo(htmlentities($metadata["title"]));?> (as PPUB)" href="?download=true" />
  14. <style type="text/css">
  15. .player {
  16. position: relative;
  17. height: 0;
  18. padding-bottom: 56.25%;
  19. background: #2d2d2d;
  20. }
  21. .player iframe{
  22. position: absolute;
  23. top: 0; left: 0;
  24. width: 100%;
  25. height: 100%;
  26. }
  27. </style>
  28. </head>
  29. <body>
  30. <header>
  31. <h1>
  32. <a style="color: var(--text-color); text-decoration: none; display: inline-block;" href="<?php echo(SITE_URL);?>"><?php echo(SITE_NAME);?></a>
  33. <!-- <small style="font-weight: light; margin: 0px 5px 0px 5px;" aria-label="<?php echo(PUBLICATION_NAME);?> title:">/</small> -->
  34. <!-- <small><a style="color: var(--text-color); text-decoration: none; display: inline-block;" href="<?php echo(SITE_URL);?>/<?php echo($path);?>"><?php echo(htmlentities($metadata["title"]));?></a></small> -->
  35. </h1>
  36. </header>
  37. <?php
  38. include("video_player.php");
  39. generate_embed($path, $video);
  40. }
  41. function content_html($content) {
  42. echo $content;
  43. }
  44. function content_end($ppub) {
  45. ?>
  46. <footer>
  47. <hr>
  48. <p><strong><?php echo(htmlentities($ppub->metadata["title"]));?></strong>
  49. <?php if($ppub->metadata["author"] != null) {
  50. preg_match("/^([^<]*(?= *<|$))<*([^>]*)>*/", $ppub->metadata["author"], $author);
  51. ?>
  52. <br/><?php echo(PUBLICATION_NAME);?> authored by <?php
  53. if(isset($author[2]) && $author[2] != '') {
  54. echo("<a href=\"mailto:".$author[2]."\">");
  55. echo(htmlentities(trim($author[1])));
  56. echo("</a>");
  57. } else {
  58. echo(htmlentities($ppub->metadata["author"]));
  59. }
  60. ?>.
  61. <?php } if ($ppub->metadata["tags"] != null and USE_PPIX) { ?>
  62. <br/>Tagged with:
  63. <?php
  64. foreach(explode(" ", $ppub->metadata["tags"]) as $tag) {
  65. ?>
  66. <a href="<?php echo(SITE_URL);?>/?tag=<?php echo(urlencode($tag));?>"><?php echo(htmlentities($tag));?></a>
  67. <?php
  68. }
  69. ?>
  70. <?php } if ($ppub->metadata["date"] != null) { ?>
  71. <br/>Last updated on <?php echo(htmlentities((new DateTime($ppub->metadata["date"]))->format(DATE_FORMAT)));?>.
  72. <br/><?php } if ($ppub->metadata["copyright"] != null) { ?>
  73. <?php echo($ppub->metadata["copyright"]);?>
  74. <?php } if ($ppub->metadata["licence"] != null) { ?>
  75. <a href="<?php echo($ppub->metadata["licence"]);?>">See Licence</a>
  76. <?php } ?></p>
  77. <p><a href="<?php echo(SITE_URL);?>/">Return to <?php echo(PUBLICATION_NAME);?> Index</a> | <a href="<?php echo(SITE_URL);?>/feed.rss">Subscribe to <?php echo(SITE_NAME);?> RSS</a> | <a href="?download=true">Download <?php echo(PUBLICATION_NAME);?> PPUB</a>
  78. <br/><small>Powered by <a href="https://github.com/Tilo15/php-ppub">php-ppub</a> and <a href="https://parsedown.org">Parsedown</a>, styled with <a href="https://vanillacss.com/">Vanilla CSS</a>.</small></p>
  79. </footer>
  80. </body>
  81. </html>
  82. <?php
  83. }