-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathatom.php
More file actions
28 lines (23 loc) · 918 Bytes
/
Copy pathatom.php
File metadata and controls
28 lines (23 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
/**
* atom.php
*
* Atom feed generator - accessible at /atom.php
* Browsers auto-detect Atom feeds via link tag in header
*
* @category atom.php file to write atom feeds
* @author M.Noermoehammad
* @license https://opensource.org/licenses/MIT MIT License
* @version 1.0
*
*/
require __DIR__ . '/lib/main.php';
header('Content-Type: application/atom+xml; charset=UTF-8');
$app_title = isset(app_info()['site_name']) ? app_info()['site_name'] : "";
$app_link = isset(app_info()['app_url']) ? app_info()['app_url'] : "";
$app_description = isset(app_info()['site_description']) ? app_info()['site_description'] : "";
$feed_link = current_load_url() . 'atom.php';
$atom_feed = class_exists('AtomWriter') ? new AtomWriter() : "";
if (method_exists($atom_feed, 'generateAtomFeed')) {
print $atom_feed->generateAtomFeed($app_title, $app_link, $feed_link, app_reading_setting()['post_per_rss']);
}