added custom tags to rss
parent
9f022d46db
commit
3983498b4b
|
@ -14,6 +14,7 @@ $settings = array(
|
|||
// if you lost your password). Capped to 50 characters.
|
||||
"web_address" => 'http://change.me', // the address of your page
|
||||
"RSS_message" => 'my RSS feed', // the message that is displayed in the rss feed
|
||||
"site_name" => 'mysite', // the name of the site, used in the RSS feed to namespace the custom tags
|
||||
"default_css" => 'flowersmono', // skull,kali,santamuerte,dirtpath,forest,unstyled,flowersmono,trip,flowers. Leave out the file extension.
|
||||
"enable_admin_panel" => TRUE, // set to true to enable access to the admin panel. Set to false if you are paranoid.
|
||||
"enable_mod_panel" => TRUE, // set to true to enable access to the moderators panel. Set to false if you are really paranoid
|
||||
|
|
|
@ -831,6 +831,7 @@ function print_rss_all($db, $settings, $page)
|
|||
$title = $settings['title'];
|
||||
$address = $settings['web_address'];
|
||||
$description = $settings['RSS_message'];
|
||||
$name = $settings['site_name'];
|
||||
|
||||
$out = '';
|
||||
|
||||
|
@ -846,7 +847,7 @@ function print_rss_all($db, $settings, $page)
|
|||
|
||||
}
|
||||
|
||||
$statement = $db->prepare("SELECT post_id, original, org_id,
|
||||
$statement = $db->prepare("SELECT post_id, org_id,
|
||||
sub, text, timestamp, name,
|
||||
move_message, edit_message
|
||||
FROM threads
|
||||
|
@ -859,6 +860,7 @@ function print_rss_all($db, $settings, $page)
|
|||
header( "Content-type: text/xml" );
|
||||
|
||||
$rss_string = "<?xml version='1.0' encoding='UTF-8'?><rss version='2.0'>"
|
||||
. "<x xmlns:$name='$address'>"
|
||||
. "<channel><title>$title</title>"
|
||||
. "<link>$address</link>"
|
||||
. "<description>$description</description>"
|
||||
|
@ -866,49 +868,46 @@ function print_rss_all($db, $settings, $page)
|
|||
|
||||
while ($row = $result->fetchArray(SQLITE3_NUM)) {
|
||||
$post_id = "{$row[0]}";
|
||||
// $original = "{$row[1]}";
|
||||
$org_id = "{$row[2]}";
|
||||
$sub = "{$row[3]}";
|
||||
$text = "{$row[4]}";
|
||||
$org_id = "{$row[1]}";
|
||||
$sub = "{$row[2]}";
|
||||
$text = "{$row[3]}";
|
||||
$text = htmlspecialchars($text);
|
||||
// $timestamp = "{$row[5]}";
|
||||
// $name = "{$row[6]}";
|
||||
// $move_message = "{$row[7]}";
|
||||
// $edit_message = "{$row[8]}";
|
||||
$timestamp = "{$row[4]}";
|
||||
$user_name = "{$row[5]}";
|
||||
$move_message = "{$row[6]}";
|
||||
$edit_message = "{$row[7]}";
|
||||
|
||||
// $rss_string .= "<item>$sub/post:$post_id/";
|
||||
$rss_string .= "<item>";
|
||||
|
||||
// if ( $post_id != $org_id ) {
|
||||
// $rss_string .= "answer to post $org_id/";
|
||||
// }
|
||||
$rss_string .= "<item>"
|
||||
. "<$name:sub>$sub</$name:sub>";
|
||||
|
||||
if ( $post_id != $org_id ) {
|
||||
$rss_string .= "<$name:answer>answer to $org_id</$name:answer>";
|
||||
}
|
||||
|
||||
// if ( !empty($timestamp) &&
|
||||
// $settings['enable_timestamps'] ) {
|
||||
// $rss_string .= "<pubDate>$timestamp</pubDate>";
|
||||
// }
|
||||
if ( !empty($timestamp) &&
|
||||
$settings['enable_timestamps'] ) {
|
||||
$rss_string .= "<$name:timestamp>$timestamp</$name:timestamp>";
|
||||
}
|
||||
|
||||
// if ( empty($name) ) {
|
||||
// $name = "anonymous";
|
||||
// }
|
||||
if ( empty($user_name) ) {
|
||||
$user_name = "anonymous";
|
||||
}
|
||||
|
||||
// $rss_string .= "<author>$name</author>";
|
||||
$rss_string .= "<$name:author>$user_name</$name:author>";
|
||||
|
||||
// if ( !empty($move_message) ) {
|
||||
// $rss_string .= "$move_message/";
|
||||
// }
|
||||
if ( !empty($move_message) ) {
|
||||
$rss_string .= "<$name:moved>$move_message</$name:moved>";
|
||||
}
|
||||
|
||||
// if ( !empty($edit_message) ) {
|
||||
// $rss_string .= "$edit_message/";
|
||||
// }
|
||||
if ( !empty($edit_message) ) {
|
||||
$rss_string .= "<$name:edited>$edit_message</$name:edited>";
|
||||
}
|
||||
|
||||
$rss_string .= "<description>$text</description>"
|
||||
// . "<guid isPermaLink=\"true\""
|
||||
// . ">$address/r/$sub/$org_id</guid>"
|
||||
. "<link>$address/r/$sub/$org_id</link></item>";
|
||||
}
|
||||
|
||||
$rss_string .= "</channel></rss>";
|
||||
$rss_string .= "</channel></x></rss>";
|
||||
echo $rss_string;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue