Monday, November 08, 2010 at 12:00 AM.


on saveStylesheet (username, flforce=false) {
		<<6/6/10; 6:47:57 AM by DW
			<<Save the user's stylesheet if it's changed, unless flforce is true.
	local (adrdata = scripting2suite.inituser (username), flsave = flforce);
	local (adrstylesheet = @adrdata^.prefs.stylesheet);
	if timemodified (adrstylesheet) > adrdata^.stats.whenLastStylesheetSave {
		flsave = true};
	if flsave {
		local (path = "stylesheet.css", t);
		new (tabletype, @t); = ();
		local (s = string.multiplereplaceall (string (adrstylesheet^), @t, false, "<%", "%>"));
		adrdata^.stats.urlStylesheet = scripting2Suite.writeStaticFile (username, path, s);
		adrdata^.stats.whenLastStylesheetSave =;
	return (adrdata^.stats.urlStylesheet)};
bundle { //test code
	saveStylesheet ("davewiner")}

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.