index.php (1461B)
1 <?php
2
3 /* SPDX-License-Identifier: AGPL-3.0-or-later
4 * SPDX-FileCopyrightText: 2025 JayVii <jayvii+kontra[AT]posteo[DOT]de>
5 */
6
7 /* Loading configuration */
8 $config = json_decode(
9 file_get_contents("./news-sources.json"),
10 true
11 );
12
13 /* Load libraries */
14 foreach (glob("./lib/*.php") as $lib) {
15 include($lib);
16 }
17
18 /* Custom Actions ------------------------------------------------------- */
19
20 /* Check for user input */
21 if (!is_null($_POST["action"])) {
22
23 /* Generate OPML */
24 if ($_POST["action"] === "gen_opml") {
25 gen_opml($config);
26 die();
27 } // if-action
28
29 /* Preview feeds */
30 if ($_POST["action"] === "preview") {
31 gen_preview($config);
32 die();
33 }
34 } // if-input
35
36 ?>
37
38 <!doctype html>
39 <html>
40
41 <!-- Head -->
42 <?php gen_html_head(); ?>
43
44 <!-- Body -->
45 <body>
46
47 <!-- Header / Navigation -->
48 <?php gen_html_navigation(); ?>
49
50 <!-- Description -->
51 <?php gen_html_description(); ?>
52
53 <!-- Usage -->
54 <?php gen_html_usage($config); ?>
55
56 <!-- Categories List -->
57 <?php gen_html_categories($config); ?>
58
59 <!-- Sources List -->
60 <?php gen_html_feeds($config); ?>
61
62 <!-- FAQs / About-Section -->
63 <?php gen_html_faqs($config); ?>
64
65 <!-- Footer -->
66 <?php gen_html_footer($config); ?>
67
68 </body>
69
70 </html>