]> git.wh0rd.org Git - tt-rss.git/commitdiff
add date suffixes to opml & import_export generated files
authorAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Mon, 21 Sep 2015 09:45:25 +0000 (12:45 +0300)
committerAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Mon, 21 Sep 2015 09:45:25 +0000 (12:45 +0300)
classes/pref/feeds.php
plugins/import_export/init.php

index a29b2accab59c36c301a935301cc6cf00cefc486..e839af34e5f64a0db25497a114fa489962710095 100644 (file)
@@ -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\"
index e61b62b675377b4c18a2fbee49f7e6e8a06ddfc6..b6693f05c0316b67dc8c5bf1dd6c942466b9e2a3 100644 (file)
@@ -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 {