-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopml.php
More file actions
executable file
·76 lines (67 loc) · 2.23 KB
/
opml.php
File metadata and controls
executable file
·76 lines (67 loc) · 2.23 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/*
* This file is part of Monkeychow - http://shokk.wordpress.com/tag/monkeychow/
*
* ompl.php - exports subscription list as OPML
*
*
* Copyright (C) 2006 Ernie Oporto
* ernieoporto@yahoo.com - http://shokk.wordpress.com
*
* Copyright (C) 2004 Stephen Minutillo
* steve@minutillo.com - http://minutillo.com/steve/
*
* Distributed under the GPL - see LICENSE
*
*/
header("Content-Type: text/xml; charset=utf-8");
include_once("fof-main.php");
include_once("init.php");
include_once("config.php");
$tags = ereg_replace("[^A-Za-z0-9 ]", "", $tags);
$tags = strip_tags($_REQUEST['tags']);
echo '<?xml version="1.0"?>';
$result = fof_do_query("SELECT date_added FROM `$FOF_FEED_TABLE` ORDER BY `date_added` DESC LIMIT 1");
$row = mysql_fetch_array($result);
$date_modified=htmlspecialchars($row['date_added']);
$result = fof_do_query("SELECT date_added FROM `$FOF_FEED_TABLE` ORDER BY `date_added` ASC LIMIT 1");
$row = mysql_fetch_array($result);
$date_created=htmlspecialchars($row['date_added']);
?>
<opml version="1.0">
<head>
<title><?php echo REPUBLISH_CHANNEL_TITLE; ?></title>
<dateCreated><?php echo $date_created; ?></dateCreated>
<ownerName><?php echo FULLNAME; ?></ownerName>
<ownerEmail><?php echo EMAIL; ?></ownerEmail>
<dateModified><?php echo $date_modified; ?></dateModified>
</head>
<body>
<?php
$sql = "select url, title, link, description, date_added from `$FOF_FEED_TABLE`,`$FOF_SUBSCRIPTION_TABLE` WHERE `$FOF_SUBSCRIPTION_TABLE`.`user_id`=" . current_user() . " AND `$FOF_FEED_TABLE`.`id`=`$FOF_SUBSCRIPTION_TABLE`.`feed_id` AND private=0";
if (isset($tags) && ($tags != "") && ($tags != _("All tags")) && ($tags != _("No tags")) )
{
$sql .= " and tags LIKE '%$tags%'";
}
$sql .= " order by title";
echo "SQL:: " . $sql . " ::SQL";
$result = fof_do_query($sql);
while($row = mysql_fetch_array($result))
{
$url = htmlspecialchars($row['url']);
$title = htmlspecialchars($row['title']);
$link = htmlspecialchars($row['link']);
$description = htmlspecialchars($row['description']);
echo <<<HEYO
<outline description="$description"
type="rss"
htmlUrl="$link"
title="$title"
text="$title"
xmlUrl="$url"
/>
HEYO;
}
?>
</body>
</opml>