Tuesday, August 18, 2009 at 7:35 PM.
photoFanSuite.addToLog
on addToLog (eventType, htmltext, startticks, imghtml=" ", adrdata=nil) { <<Changes <<1/20/08; 7:41:57 AM by DW <<Convert to calendar-based structure. <<11/21/07; 6:01:54 AM by DW <<Add an optional parameter for image html. <<11/20/07; 12:01:40 PM by DW <<Fixed a mistake in formatting the duration string. <<11/19/07; 7:29:24 PM by DW <<Created. if user.photoFan.prefs.flLog { local (secs); bundle { //set secs local (s = string (double (clock.ticks () - startticks) / 60)); local (lod = string.nthfield (s, ".", 1)); local (rod = string.nthfield (s, ".", 2) + "00"); if sizeof (rod) > 3 { rod = string.mid (rod, 1, 3)}; secs = lod + "." + rod}; <<local (adrtable = log.addToGuestDatabase (photoFanSuite.data.logName, flHourlyRoll:true)) local (adrcal = @user.photofan.calendar); local (adrtable = mainresponder.calendar.getdayaddress (adrcal, clock.now (), true)); adrtable = xml.addtable (adrtable, string (clock.now ())); adrtable^.eventType = eventType; adrtable^.htmltext = htmltext; adrtable^.imghtml = imghtml; adrtable^.secs = secs; if adrdata != nil { adrtable^.data = adrdata^}; bundle { //clear the cache if defined (system.temp.photoFan.cache.viewEventsLog) { delete (@system.temp.photoFan.cache.viewEventsLog)}}}}; bundle { //test code local (i, startticks, ctloops = 10); for i = 1 to ctloops { msg (i); startticks = clock.ticks (); clock.waitsixtieths (ctloops - i + 1); addToLog ("Test code", i + ". I am just testing this mofo. " + states.nthstate (random (1, 50)) + ".", startticks)}}
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.