diff --git a/etc/config.php b/etc/config.php index 2dba73c..4f1e441 100644 --- a/etc/config.php +++ b/etc/config.php @@ -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 diff --git a/opt/display.php b/opt/display.php index 5c25934..243a24f 100644 --- a/opt/display.php +++ b/opt/display.php @@ -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 = "" + . "" . "$title" . "$address" . "$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 .= "$sub/post:$post_id/"; - $rss_string .= ""; - -// if ( $post_id != $org_id ) { -// $rss_string .= "answer to post $org_id/"; -// } + $rss_string .= "" + . "<$name:sub>$sub"; + + if ( $post_id != $org_id ) { + $rss_string .= "<$name:answer>answer to $org_id"; + } -// if ( !empty($timestamp) && -// $settings['enable_timestamps'] ) { -// $rss_string .= "$timestamp"; -// } + if ( !empty($timestamp) && + $settings['enable_timestamps'] ) { + $rss_string .= "<$name:timestamp>$timestamp"; + } -// if ( empty($name) ) { -// $name = "anonymous"; -// } + if ( empty($user_name) ) { + $user_name = "anonymous"; + } -// $rss_string .= "$name"; + $rss_string .= "<$name:author>$user_name"; -// if ( !empty($move_message) ) { -// $rss_string .= "$move_message/"; -// } + if ( !empty($move_message) ) { + $rss_string .= "<$name:moved>$move_message"; + } -// if ( !empty($edit_message) ) { -// $rss_string .= "$edit_message/"; -// } + if ( !empty($edit_message) ) { + $rss_string .= "<$name:edited>$edit_message"; + } $rss_string .= "$text" -// . "$address/r/$sub/$org_id" . "$address/r/$sub/$org_id"; } - $rss_string .= ""; + $rss_string .= ""; echo $rss_string; }