Page 1 of 1

OPML export ordering and cleanup

Posted: 12 Mar 2012, 21:56
by gmargo
I noticed that the OPML export result does not preserve the user's preferred category and feed ordering.
(I'm not leaving, I just wanted to try something in "liferea".)

I set out to add ordering to the opml export function, which was relatively easy,
but then I started fiddling with the output format to get a prettier output.
Plus a few other edits, so I submit this opml export cleanup for your consideration.

All of the following changes are contained in the attached patch to opml.php.
I could lay them out as several sequential patches for each individual change if you prefer.

1. Category and Feed ordering are now preserved.
2. Pretty Printing. Added indentation and lots of newlines. Output looks quite nice now.
3. Sort preference settings by name.
4. Source code indentation: spaces to tabs.
Seven lines of code were indented with spaces instead of tabs.
(Of those 7, four matched tabstop=8 and three matched tabstop=4.)
One line of code had a leading space.
5. Vim syntax: made a purely cosmetic change so the vim syntax highlighter wouldn't get confused.
In the xml declaration I separated a "?>" into two separate strings "?".">" so vim would not think it was malformed PHP.

Edit: Oops... missed a spot. Uploading new patch in a minute.... Done. Version 2 uploaded.

Re: OPML export ordering and cleanup

Posted: 12 Mar 2012, 23:09
by fox
Thanks, you are really working a lot on this. :) I'll take a look tomorrow.

This vim breakage has been annoying me for a while, btw, I didn't figure out how to fix it.

Re: OPML export ordering and cleanup

Posted: 19 Mar 2012, 23:13
by gmargo
I've updated the method of "pretty printing" the OPML output. The patch above did the indentation manually because at the time I could not get "saveXML()" to do what I wanted. I've managed that now, so the indentation code is less obtrusive.

Give me a day to get it cleaned up and I'll submit some new patches.

Re: OPML export ordering and cleanup

Posted: 21 Mar 2012, 22:00
by gmargo
Here are the new patches for opml.php. I've split the changes into five patches so they are easier to review.
They should be applied in numerical order since a few lines were affected by multiple patches.

Oops, I just found out that only 3 attachments are allowed, so I will post patches 4 and 5 in the next entry.

Re: OPML export ordering and cleanup

Posted: 21 Mar 2012, 22:01
by gmargo
The rest of the patches...