Wednesday, February 16, 2011 at 12:00 AM.
river2Suite.static.bindReadingListToUser
on bindReadingListToUser (adruser) {
<<Changes
<<11/7/10; 4:01:36 PM by DW
<<Created.
local (adrdata = river2suite.init ());
river2suite.inituser (adruser);
local (url = adruser^.prefs.urlReadingList);
if sizeof (url) > 0 { //it's been set
local (adrlist = @adrdata^.lists.[url]);
bundle { //mark all the user's feeds as not present
local (adruserfeed);
for adruserfeed in @adruser^.feeds {
adruserfeed^.flpresentinlist = false}};
bundle { //add new feeds to the user's feed table
local (adrfeed, urlfeed, adruserfeed);
for adrfeed in @adrlist^.feeds {
urlfeed = nameof (adrfeed^);
adruserfeed = @adruser^.feeds.[urlfeed];
if not defined (adruserfeed^) {
new (tabletype, adruserfeed)};
adruserfeed^.flpresentinlist = true}};
bundle { //delete tables of feeds that are not present
local (i, adruserfeed);
for i = sizeof (adruser^.feeds) downto 1 {
adruserfeed = @adruser^.feeds [i];
if not adruserfeed^.flpresentinlist {
delete (adruserfeed)}
else {
delete (@adruserfeed^.flpresentinlist)}}};
river2suite.inituser (adruser)}};
bundle { //test code
bindReadingListToUser (@config.river2.users.wikiriver)}
This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.