summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2015-09-21 12:45:25 +0300
committerAndrew Dolgov <[email protected]>2015-09-21 12:45:25 +0300
commit77e8100669fefa0deece04bf0065807f9ce1fded (patch)
tree91a565f6d9817d5d13a32177ab48b1da382e3832
parent73963a21b23d7b463042311a9cd666756b4d9984 (diff)
add date suffixes to opml & import_export generated files
-rw-r--r--classes/pref/feeds.php4
-rw-r--r--plugins/import_export/init.php6
2 files changed, 7 insertions, 3 deletions
diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php
index a29b2acca..e839af34e 100644
--- a/classes/pref/feeds.php
+++ b/classes/pref/feeds.php
@@ -1461,8 +1461,10 @@ class Pref_Feeds extends Handler_Protected {
print "<hr>";
+ $opml_export_filename = "TinyTinyRSS_".date("Y-m-d").".opml";
+
print "<p>" . __('Filename:') .
- " <input type=\"text\" id=\"filename\" value=\"TinyTinyRSS.opml\" />&nbsp;" .
+ " <input type=\"text\" id=\"filename\" value=\"$opml_export_filename\" />&nbsp;" .
__('Include settings') . "<input type=\"checkbox\" id=\"settings\" checked=\"1\"/>";
print "</p><button dojoType=\"dijit.form.Button\"
diff --git a/plugins/import_export/init.php b/plugins/import_export/init.php
index e61b62b67..b6693f05c 100644
--- a/plugins/import_export/init.php
+++ b/plugins/import_export/init.php
@@ -106,11 +106,13 @@ class Import_Export extends Plugin implements IHandler {
if (file_exists($exportname)) {
header("Content-type: text/xml");
+ $timestamp_suffix = date("Y-m-d", filemtime($exportname));
+
if (function_exists('gzencode')) {
- header("Content-Disposition: attachment; filename=TinyTinyRSS_exported.xml.gz");
+ header("Content-Disposition: attachment; filename=TinyTinyRSS_exported_${timestamp_suffix}.xml.gz");
echo gzencode(file_get_contents($exportname));
} else {
- header("Content-Disposition: attachment; filename=TinyTinyRSS_exported.xml");
+ header("Content-Disposition: attachment; filename=TinyTinyRSS_exported_${timestamp_suffix}.xml");
echo file_get_contents($exportname);
}
} else {