|
Revision 1251, 1.6 kB
(checked in by diegoramirez, 1 year ago)
|
Moved from units to mod:
- groups
- invite
- newsclient
- search
- xml
Updated htaccess rewrite rules
Some bug fixes to the blog plugin
|
- Property svn:mime-type set to
text/plain
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
require_once(dirname(dirname(__FILE__))."/../includes.php"); |
|---|
| 4 |
|
|---|
| 5 |
$username = trim(optional_param('profile_name','')); |
|---|
| 6 |
$user_id = user_info_username("ident", $username); |
|---|
| 7 |
|
|---|
| 8 |
$date = date("r"); |
|---|
| 9 |
$output = ''; |
|---|
| 10 |
|
|---|
| 11 |
if ($user_id) { |
|---|
| 12 |
|
|---|
| 13 |
$owner = $CFG->wwwroot . $username . '/'; |
|---|
| 14 |
$niceusername = run("profile:display:name", $user_id); |
|---|
| 15 |
|
|---|
| 16 |
$descr = sprintf(__gettext("Feed subscriptions for %s"), $niceusername); |
|---|
| 17 |
|
|---|
| 18 |
$output .= <<< END |
|---|
| 19 |
<opml version="1.1"> |
|---|
| 20 |
<head> |
|---|
| 21 |
<title>$descr</title> |
|---|
| 22 |
<dateCreated>$date</dateCreated> |
|---|
| 23 |
<ownerName>$owner</ownerName> |
|---|
| 24 |
</head> |
|---|
| 25 |
<body> |
|---|
| 26 |
|
|---|
| 27 |
END; |
|---|
| 28 |
|
|---|
| 29 |
if ($subscriptions_var = newsclient_get_subscriptions_user($user_id, true)) { |
|---|
| 30 |
foreach ($subscriptions_var as $afeed) { |
|---|
| 31 |
//var_dump($afeed); |
|---|
| 32 |
$output .= '<outline type="rss" title="' . htmlspecialchars($afeed->name) . '" htmlUrl="' . htmlspecialchars($afeed->siteurl) . '" xmlUrl="' . htmlspecialchars($afeed->url) . '" text="' . htmlspecialchars($afeed->name) . '" />' . "\n"; |
|---|
| 33 |
} |
|---|
| 34 |
} else { |
|---|
| 35 |
$output .= '<outline text="' . __gettext("No subscriptions found") . '" />' . "\n"; |
|---|
| 36 |
} |
|---|
| 37 |
|
|---|
| 38 |
$output .= <<< END |
|---|
| 39 |
|
|---|
| 40 |
</body> |
|---|
| 41 |
</opml> |
|---|
| 42 |
END; |
|---|
| 43 |
|
|---|
| 44 |
} else { |
|---|
| 45 |
|
|---|
| 46 |
$descr = sprintf(__gettext("Username not found: %s"), $username); |
|---|
| 47 |
|
|---|
| 48 |
$output .= <<< END |
|---|
| 49 |
<?xml version="1.0" encoding="UTF-8"?> |
|---|
| 50 |
<opml version="1.1"> |
|---|
| 51 |
<head> |
|---|
| 52 |
<title>$descr</title> |
|---|
| 53 |
<dateCreated>$date</dateCreated> |
|---|
| 54 |
</head> |
|---|
| 55 |
</opml> |
|---|
| 56 |
END; |
|---|
| 57 |
|
|---|
| 58 |
} |
|---|
| 59 |
|
|---|
| 60 |
//header("Content-Type: text/plain"); |
|---|
| 61 |
header("Content-Type: text/xml"); |
|---|
| 62 |
|
|---|
| 63 |
//echo 'yo ' .$profile_id; |
|---|
| 64 |
//echo nl2br(htmlspecialchars($output)); |
|---|
| 65 |
echo $output; |
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
?> |
|---|