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

system.verbs.builtins.radio.weblog.init

<<Changes
	<<9/15/03; 6:04:22 PM by JES
		<<Init adrData^.prefs.flCommentNotificationEnabled to true.
	<<7/20/03; 6:01:51 PM by JES
		<<Init adrdata^.trackback.
	<<11/20/02; 5:40:30 PM by JES
		<<Initialize weblogData.shortcuts.flShortcutForFiles to true.
	<<11/9/02; 7:37:55 AM by DW
		<<Init adrdata^.prefs.flGenerateSkipHours and adrdata^.prefs.ctSkipHours.
	<<9/3/02; 3:20:04 PM by LL
		<<Initialize weblogData.prefs.flArchiveMonthly and weblogData.prefs.flArchiveWeekly.
	<<8/26/02; 11:05:51 PM by LL
		<<Initialize weblogData.prefs.flArchiveWeblog to false.
	<<6/5/02; 12:37:41 PM by DW
		<<Create weblogData.stats.hourlyUpdateCounts if it doesn't exist. 
	<<4/11/02; 9:01:32 AM by DW
		<<Create weblogData.callbacks.rssFilterDescription if it doesn't exist.
	<<4/6/02; 11:57:58 AM by DW
		<<Init stuff for shortcuts.
	<<3/17/02; 8:22:37 AM by DW
		<<Link in the RPC handlers for the MetaWeblog API. 
		<<Instead of linking in the Blogger API handlers here, we call the install script, which now also installs SOAP handlers for the Blogger API. Why not?
	<<3/12/02; 12:42:47 PM by JES
		<<Initialize weblogData.prefs.flAutoGenerateLinks to false.
	<<3/11/02; 8:29:42 AM by DW
		<<Init weblogData.prefs.flTitleAndLinkOnPostForm.
	<<3/3/02; 4:55:13 PM by JES
		<<Don't create initial categories here. This now happens in radio.bootstrap, based on information sent from the community server. If the community server doesn't tell us what categories to create, then radio.bootstrap will create the defaults that used to be created here.
	<<2/23/02; 5:03:07 PM by JES
		<<Added the <%commentCount%> macro to the default value for the commentLinkText pref.
	<<2/20/02; 5:31:54 PM by JES
		<<Init weblogData.prefs.flCommentLinksEnabled.
	<<2/20/02; 4:34:15 PM by JES
		<<Init weblogData.prefs.commentLinkText.
	<<2/18/02; 1:33:51 AM by JES
		<<Initialize weblogData.prefs.commentsPageUrl.
	<<2/12/02; 3:11:01 AM by JES
		<<Initialize adrdata^.stats.unpublishedPosts.
	<<1/29/02; 12:50:52 PM by DW
		<<If radio.weblog.bloggerApi.rpcHandlers.getUserBlogs is defined, delete it.
	<<1/28/02; 7:51:14 PM by DW
		<<Initialize weblogData.prefs.flBloggerApiEnabled, user.betty.rpcHandlers.blogger.
	<<1/24/02; 11:21:17 AM by JES
		<<Initialize prefs: archiveLinkImgTag, itemPermaLinkImgTag, sourceImgTag and enclosureImgTag, based on constants in radio.data.strings.
	<<1/21/02; 5:31:53 PM by DW
		<<Initialize weblogdata.prefs.language.
	<<1/21/02; 9:35:28 AM by DW
		<<Make sure all categories have a flNotifyWeblogsCom item, initialized true. (Notifications only happen if the category is rendered in HTML.)
	<<12/22/01; 4:55:09 PM by JES
		<<Initialize weblogData.prefs.flPublishOnPost to true. This causes the weblog editing form to publish whenever a weblog entry is posted. If false, you get three buttons on the weblog post form -- Post, Publish, and Post and Publish.
	<<12/20/01; 1:45:29 PM by JES
		<<Make the wysiwyg editor the default browser-based editing tool.
	<<12/14/01; 1:18:20 PM by JES
		<<Make sure flRenderHtml is defined for all categories.
	<<12/10/01; 1:02:43 PM by JES
		<<When initializing categories, make sure that flRenderHtml is defined for the category.
	<<12/5/01; 4:49:57 PM by JES
		<<If weblogData.categories is undefined, create the five sample categories: My Friends, My Hobbies, My Interests, My Organization, and My Profession.
	<<11/26/01; 12:46:35 PM by JES
		<<If there's an "item #1" in the posts table, delete it. It was causing macro errors on the desktop website home page.
	<<11/21/01; 2:01:59 AM by JES
		<<Changed default home page file path to index.txt. Changed default category html and rss folder paths to www/categories/. Changed default rss file path to rss.xml.
	<<11/20/01; 2:55:43 PM by JES
		<<Initialize adrblog^.prefs.navigator.itemFormat and adrblog^.prefs.navigator.separatorFormat.
	<<11/5/01; 11:44:20 AM by JES
		<<Fixed a bug with double-slash characters in the homePageFilePath.
	<<11/5/01; 3:00:41 AM by JES
		<<Set the homePageFilePath to www/system/upstream/index.html, insetad of www/system/upstream/weblog/index.html.
	<<10/22/01; 2:17:30 AM by JES
		<<Upgrade file paths from 7.0.1, if necessary. When changing to the new 7.1 file paths, move the files accordingly, so they'll be upstreamed to the right locations.
	<<10/19/01; 6:01:32 PM by DW
		<<Initialize adrdata^.prefs.mailPosting.ctSecondsBetweenChecks.
	<<10/19/01; 3:23:49 AM by JES
		<<Changed the default for prefs.maxOutputItemsPerChannel from 100 to 25.
	<<10/11/01; 3:30:45 AM by JES
		<<When initializing the weblog title, respect the fact that someone's user name may end with an 's', and add only an appostrophy, instead of 's.
	<<9/17/01; 12:12:39 PM by JES
		<<Get default homePathFilePath, rssFilePath, and rssCategoryFolderPath, using a call to radio.file.getRelativePath, on the upstream folder.
		<<All files generated by the weblog subsystem will be upstreamed.
		<<When copying prefs from myUserLandData.root, change the file paths for rendering weblog pages and rss files, to the upstream folder.
	<<9/6/01; 1:42:18 AM by JES
		<<Changed the default homePageFilePath from weblog/index.html to system/upstream/index.html. Likewise with the rssFilePath.
	<<9/5/01; 12:48:07 AM by JES
		<<Don't init magic folders table

on upgradeFileOrFolderPath (relPath) {
	<<10/22/01; 1:16:41 AM by JES
		<<Upgrades a file or folder to a 7.1 path, at the same relative path under the upstream folder, that the file/folder had under the www folder in the 7.0.1 installation.
			<<Move all the files, and set the pref to the new path.
		<<Returns the new relative path, suitable for assignment to a pref.
	if relPath beginsWith "/" { //pop leading slashes
		relPath = string.popLeading (relPath, "/")};
	local (absPath = radio.file.getAbsolutePath (relPath));
	local (upstreamRelPath= radio.file.getRelativePath (user.radio.prefs.upstream.folder));
	local (destRelpath = upstreamRelPath + relPath);
	if file.exists (absPath) { //move the folder to the new location
		local (destAbsPath = radio.file.getAbsolutePath (destRelpath));
		if file.isFolder (absPath) {
			file.sureFilePath (destAbsPath + "xxx");
			fileloop (f in absPath, 1) {
				try {
					file.move (f, destAbsPath)}}}
		else { //upgrade a single file
			file.sureFilePath (destAbsPath);
			try {
				file.move (absPath, file.folderFromPath (destAbsPath))}}};
	return (destRelPath)};

local (adrdata = frontier.opendatafile ("weblogData"));
bundle { //prefs
	local (flUpgradingFrom701 = false);
	if not defined (adrdata^.prefs) {
		if defined (myUserLandData.blogs.default.prefs) {
			adrdata^.prefs = myUserLandData.blogs.default.prefs;
			flUpgradingFrom701 = true}
		else {
			new (tabletype, @adrdata^.prefs)}};
	if not defined (adrdata^.prefs.title) {
		if user.prefs.name endsWith "s" {
			adrdata^.prefs.title = user.prefs.name + "' Radio Weblog"}
		else {
			adrdata^.prefs.title = user.prefs.name + "'s Radio Weblog"}};
	if not defined (adrdata^.prefs.authorname) {
		adrdata^.prefs.authorName = user.prefs.name};
	if not defined (adrdata^.prefs.authormailaddress) {
		adrdata^.prefs.authorMailAddress = user.prefs.mailaddress};
	if not defined (adrdata^.prefs.description) {
		wp.newtextobject ("", @adrdata^.prefs.description)};
	if not defined (adrdata^.prefs.editingToolName) {
		adrdata^.prefs.editingToolName = "wysiwyg"};
	if not defined (adrdata^.prefs.flPublishOnPost) {
		adrdata^.prefs.flPublishOnPost = true};
	if not defined (adrdata^.prefs.flPublicBlog) {
		adrdata^.prefs.flPublicBlog = true};
	if not defined (adrdata^.prefs.flCategoryCheckboxes) {
		adrdata^.prefs.flCategoryCheckboxes = false};
	if not defined (adrdata^.prefs.flEnclosureField) {
		adrdata^.prefs.flEnclosureField = false};
	if not defined (adrdata^.prefs.flTitleAndLinkOnPostForm) {
		adrdata^.prefs.flTitleAndLinkOnPostForm = false};
	if not defined (adrdata^.prefs.flAutoGenerateLinks) {
		adrdata^.prefs.flAutoGenerateLinks = false};
	if not defined (adrdata^.prefs.flArchiveSection) {
		adrdata^.prefs.flArchiveSection = false};
	bundle { //init file/folder path prefs
		if not defined (adrdata^.prefs.homePageFilePath) or flUpgradingFrom701 {
			if defined (myUserLandData.blogs.default.prefs.homePageFilePath) {
				adrdata^.prefs.homePageFilePath = upgradeFileOrFolderPath (myUserLandData.blogs.default.prefs.homePageFilePath)}
			else {
				<<adrdata^.prefs.homePageFilePath = radio.file.getRelativePath (user.radio.prefs.upstream.folder) + radio.data.folderNames.wwwWeblogSubfolderName + "/index.html"
				adrdata^.prefs.homePageFilePath = radio.file.getRelativePath (user.radio.prefs.upstream.folder) + "index.txt"}};
		if not defined (adrdata^.prefs.rssFilePath) or flUpgradingFrom701 {
			if defined (myUserLandData.blogs.default.prefs.rssFilePath) {
				adrdata^.prefs.rssFilePath = upgradeFileOrFolderPath (myUserLandData.blogs.default.prefs.rssFilePath)}
			else {
				<<adrdata^.prefs.rssFilePath = radio.file.getRelativePath (user.radio.prefs.upstream.folder) + radio.data.folderNames.wwwWeblogSubfolderName + "/" + radio.data.filenames.weblogrssfilename
				adrdata^.prefs.rssFilePath = radio.file.getRelativePath (user.radio.prefs.upstream.folder) + radio.data.filenames.weblogrssfilename}};
		if not defined (adrdata^.prefs.htmlCategoryFolderPath) or flUpgradingFrom701 {
			if defined (myUserLandData.blogs.default.prefs.homePageFilePath) {
				adrdata^.prefs.htmlCategoryFolderPath = upgradeFileOrFolderPath (radio.file.getRelativePath (file.folderFromPath (adrdata^.prefs.homePageFilePath)) + radio.data.foldernames.wwwHtmlCategorySubfolderName + "/")}
			else {
				<<adrdata^.prefs.htmlCategoryFolderPath = radio.file.getRelativePath (user.radio.prefs.upstream.folder) + radio.data.folderNames.wwwWeblogSubfolderName + "/" + radio.data.folderNames.wwwHtmlCategorySubfolderName + "/"
				adrdata^.prefs.htmlCategoryFolderPath = radio.file.getRelativePath (user.radio.prefs.upstream.folder) + radio.data.folderNames.wwwHtmlCategorySubfolderName + "/"}};
		if not defined (adrdata^.prefs.rssCategoryFolderPath) or flUpgradingFrom701 {
			<<adrdata^.prefs.rssCategoryFolderPath = upgradeFileOrFolderPath (radio.data.foldernames.wwwRssCategorySubfolderName + "/")
			adrdata^.prefs.rssCategoryFolderPath = radio.file.getRelativePath (user.radio.prefs.upstream.folder) + radio.data.folderNames.wwwHtmlCategorySubfolderName + "/"}};
	if not defined (adrdata^.prefs.ctDaysToDisplay) {
		adrdata^.prefs.ctDaysToDisplay = 7};
	if not defined (adrdata^.prefs.url) {
		adrdata^.prefs.url = ""};
	if not defined (adrdata^.prefs.nextPostNum) {
		adrdata^.prefs.nextPostNum = 1};
	if not defined (adrdata^.prefs.sourceImgTag) {
		if defined (myUserLandData.prefs.ui.sourceImg) {
			adrdata^.prefs.sourceImgTag = myUserLandData.prefs.ui.sourceImg}
		else {
			adrdata^.prefs.sourceImgTag = radio.data.strings.sourceImg}};
	if not defined (adrdata^.prefs.archiveLinkImgTag) {
		adrdata^.prefs.archiveLinkImgTag = radio.data.strings.archiveLinkImg};
	if not defined (adrdata^.prefs.itemPermaLinkImgTag) {
		adrdata^.prefs.itemPermaLinkImgTag = radio.data.strings.itemPermaLinkImg};
	if not defined (adrdata^.prefs.enclosureImgTag) {
		adrdata^.prefs.enclosureImgTag = radio.data.strings.enclosureImg};
	if not defined (adrdata^.prefs.language) {
		adrdata^.prefs.language = "none"};
	bundle { //init adrdata^.prefs.navigator
		if not defined (adrdata^.prefs.navigator) {
			new (tableType, @adrdata^.prefs.navigator)};
		if not defined (adrdata^.prefs.navigator.itemFormat) {
			adrdata^.prefs.navigator.itemFormat = "<div align=\"center\" class=\"small\"><%item%></div>"};
		if not defined (adrdata^.prefs.navigator.separatorFormat) {
			adrdata^.prefs.navigator.separatorFormat = ""}};
	if not defined (adrdata^.prefs.flArchiveMonthly) {
		if defined (adrdata^.prefs.flArchiveWeblog) {
			adrdata^.prefs.flArchiveMonthly = adrdata^.prefs.flArchiveWeblog;
			delete (@adrdata^.prefs.flArchiveWeblog)}
		else {
			adrdata^.prefs.flArchiveMonthly = false}};
	if not defined (adrdata^.prefs.flArchiveWeekly) {
		adrdata^.prefs.flArchiveWeekly = false};
	if not defined (adrdata^.prefs.flGenerateSkipHours) {
		adrdata^.prefs.flGenerateSkipHours = true};
	if not defined (adrdata^.prefs.ctSkipHours) {
		adrdata^.prefs.ctSkipHours = 8};
	
	if not defined (adrdata^.prefs.managingEditor) {
		if defined (myUserLandData.prefs.managingEditor) {
			adrdata^.prefs.managingEditor = myUserLandData.prefs.managingEditor}
		else {
			adrdata^.prefs.managingEditor = user.prefs.mailaddress}};
	if not defined (adrdata^.prefs.webmaster) {
		if defined (myUserLandData.prefs.webmaster) {
			adrdata^.prefs.webmaster = myUserLandData.prefs.webmaster}
		else {
			adrdata^.prefs.webmaster = user.prefs.mailaddress}};
	if not defined (adrdata^.prefs.maxOutputItemsPerChannel) {
		if defined (myUserLandData.prefs.maxOutputItemsPerChannel) {
			adrdata^.prefs.maxOutputItemsPerChannel = myUserLandData.prefs.maxOutputItemsPerChannel}
		else {
			adrdata^.prefs.maxOutputItemsPerChannel = 25}};
	
	if not defined (adrdata^.prefs.viewing) {
		new (tabletype, @adrdata^.prefs.viewing)};
	if not defined (adrdata^.prefs.viewing.ctPosts) {
		adrdata^.prefs.viewing.ctPosts = 10};
	if not defined (adrdata^.prefs.viewing.fromDay) {
		adrdata^.prefs.viewing.fromDay = date (0)};
	if not defined (adrdata^.prefs.viewing.searchString) {
		adrdata^.prefs.viewing.searchString = ""};
	if not defined (adrdata^.prefs.viewing.mode) {
		adrdata^.prefs.viewing.mode = "byPosts"};
	if not defined (adrdata^.prefs.flBloggerApiEnabled) {
		adrdata^.prefs.flBloggerApiEnabled = false};
	
	<<bundle //templates
		<<if not defined (adrdata^.prefs.template)
			<<adrdata^.prefs.template = radio.data.themes.default.template
		<<if not defined (adrdata^.prefs.itemTemplate)
			<<adrdata^.prefs.itemTemplate = radio.data.themes.default.itemtemplate
		<<if not defined (adrdata^.prefs.dayTemplate)
			<<adrdata^.prefs.dayTemplate = radio.data.themes.default.daytemplate
	
	<<bundle //ftp prefs
		<<if not defined (adrdata^.prefs.ftp)
			<<new (tabletype, @adrdata^.prefs.ftp)
		<<if not defined (adrdata^.prefs.ftp.enabled)
			<<adrdata^.prefs.ftp.enabled = false
		<<if not defined (adrdata^.prefs.ftp.password)
			<<adrdata^.prefs.ftp.password = ""
		<<if not defined (adrdata^.prefs.ftp.path)
			<<adrdata^.prefs.ftp.path = "/"
		<<if not defined (adrdata^.prefs.ftp.server)
			<<adrdata^.prefs.ftp.server = ""
		<<if not defined (adrdata^.prefs.ftp.url)
			<<adrdata^.prefs.ftp.url = "http://"
		<<if not defined (adrdata^.prefs.ftp.username)
			<<adrdata^.prefs.ftp.username = ""
	
	if not defined (adrdata^.prefs.mailPosting) {
		new (tabletype, @adrdata^.prefs.mailPosting)};
	if not defined (adrdata^.prefs.mailPosting.enabled) {
		adrdata^.prefs.mailPosting.enabled = false};
	if not defined (adrdata^.prefs.mailPosting.server) {
		adrdata^.prefs.mailPosting.server = user.prefs.mailHost};
	if not defined (adrdata^.prefs.mailPosting.account) {
		adrdata^.prefs.mailPosting.account = ""};
	if not defined (adrdata^.prefs.mailPosting.password) {
		adrdata^.prefs.mailPosting.password = ""};
	if not defined (adrdata^.prefs.mailPosting.secretSubject) {
		adrdata^.prefs.mailPosting.secretSubject = states.nthState (random (1, 50)) + "+" + states.nthState (random (1, 50))};
	if not defined (adrdata^.prefs.mailPosting.ctSecondsBetweenChecks) {
		adrdata^.prefs.mailPosting.ctSecondsBetweenChecks = 60};
	
	if not defined (adrdata^.prefs.commentsPageUrl) {
		adrdata^.prefs.commentsPageUrl = radio.data.cloudUrls.commentsPageUrl};
	if not defined (adrdata^.prefs.commentLinkText) {
		adrdata^.prefs.commentLinkText = "comment [<%commentCount%>]"};
	if not defined (adrdata^.prefs.flCommentLinksEnabled) {
		adrdata^.prefs.flCommentLinksEnabled = true};
	if not defined (adrdata^.prefs.flCommentNotificationEnabled) {
		adrdata^.prefs.flCommentNotificationEnabled = true};
	
	if not defined (adrdata^.prefs.trackback) {
		new (tableType, @adrdata^.prefs.trackback)};
	if not defined (adrdata^.prefs.trackback.flEnabled) {
		adrdata^.prefs.trackback.flEnabled = false};
	if not defined (adrdata^.prefs.trackback.flAddTrackbackLinks) {
		adrdata^.prefs.trackback.flAddTrackbackLinks = true};
	if not defined (adrdata^.prefs.trackback.trackbackLinkText) {
		adrdata^.prefs.trackback.trackbackLinkText = "trackback [<%trackbackCount%>]"};
	if not defined (adrdata^.prefs.trackback.trackbackPageUrl) {
		if defined (radio.data.cloudUrls.trackbackPageUrl) {
			adrdata^.prefs.trackback.trackbackPageUrl = radio.data.cloudUrls.trackbackPageUrl}};
	};
	<<bundle //init magic folder linkage
		<<local (adrmagic = @user.playlist.data.upstream.magicFolders)
		<<if not defined (adrmagic^)
			<<new (tabletype, adrmagic)
		<<local (adrimages = @adrmagic^.["weblog/images/"])
		<<if not defined (adrimages^)
			<<adrimages^ = @radio.weblog.uploadImage
	<<bundle //make sure images folder exists
		<<local (pc = file.getpathchar ())
		<<local (folder = user.radio.prefs.wwwfolder + "weblog" + pc)
		<<file.surefolder (folder)
		<<folder = folder + "images" + pc
		<<file.surefolder (folder)
		<<bundle //PBS 03/23/01: make sure xml.gif and dailyLinkIcon.gif aren't in the folder -- it was a mistake
			<<local (f = folder + "xml.gif") //PBS 02/21/01: write out xml.gif
			<<on deleteFile ()
				<<if file.exists (f)
					<<try {file.delete (f)} //it may be busy
			<<deleteFile ()
			<<f = folder + "dailyLinkIcon.gif"
			<<deleteFile ()
	<<bundle //init Manila mirroring prefs
		<<if not defined (adrdata^.prefs.manila)
			<<new (tableType, @adrdata^.prefs.manila)
			<<adrdata^.prefs.manila.enabled = false
			<<adrdata^.prefs.manila.password = ""
			<<adrdata^.prefs.manila.url = "http://"
			<<adrdata^.prefs.manila.username = user.prefs.mailAddress
bundle { //shortcuts
	if not defined (adrdata^.shortcuts) {
		new (tabletype, @adrdata^.shortcuts)};
	if not defined (adrdata^.shortcuts.prefs) {
		new (tabletype, @adrdata^.shortcuts.prefs)};
	if not defined (adrdata^.shortcuts.prefs.flShortcutForTitledPosts) {
		adrdata^.shortcuts.prefs.flShortcutForTitledPosts = true};
	if not defined (adrdata^.shortcuts.prefs.flShortcutForStories) {
		adrdata^.shortcuts.prefs.flShortcutForStories = true};
	if not defined (adrdata^.shortcuts.prefs.flShortcutForFiles) {
		adrdata^.shortcuts.prefs.flShortcutForFiles = true};
	if not defined (adrdata^.shortcuts.prefs.flUserLandShortcuts) {
		adrdata^.shortcuts.prefs.flUserLandShortcuts = true};
	if not defined (adrdata^.shortcuts.userland) {
		adrdata^.shortcuts.userland = user.html.glossary};
	if not defined (adrdata^.shortcuts.personal) {
		new (tabletype, @adrdata^.shortcuts.personal)}};
bundle { //categories
	if not defined (adrdata^.categories) {
		if defined (myUserLandData.categories) {
			adrdata^.categories = myUserLandData.categories}
		else {
			new (tableType, @adrdata^.categories)}};
		<<else
			<<new (tabletype, @adrdata^.categories)
			<<on initCategory (name)
				<<local (adrcat = @adrdata^.categories.[name])
				<<new (tableType, adrcat)
				<<adrcat^.dateLastUploaded = date (0)
				<<adrcat^.description = "Describe this category here."
				<<adrcat^.displayName = name
				<<adrcat^.filename = string.innerCaseName (name)
				<<adrcat^.flDirty = false
				<<adrcat^.flRenderHtml = false
				<<adrcat^.storyList = {}
			<<initCategory ("My Friends")
			<<initCategory ("My Hobbies")
			<<initCategory ("My Interests")
			<<initCategory ("My Organization")
			<<initCategory ("My Profession")
	bundle { //make sure all the categories have all the new elements
		local (adrcat);
		for adrcat in @adrdata^.categories {
			if not defined (adrcat^.flRenderHtml) {
				adrcat^.flRenderHtml = false};
			if not defined (adrcat^.flNotifyWeblogsCom) {
				adrcat^.flNotifyWeblogsCom = adrcat^.flRenderHtml}}}};
bundle { //stats
	if not defined (adrdata^.stats) {
		new (tabletype, @adrdata^.stats)};
	if not defined (adrdata^.stats.ctMailToBlogChecks) {
		adrdata^.stats.ctMailToBlogChecks = 0};
	if not defined (adrdata^.stats.ctMailToBlogPosts) {
		adrdata^.stats.ctMailToBlogPosts = 0};
	if not defined (adrdata^.stats.unpublishedPosts) {
		new (tableType, @adrdata^.stats.unpublishedPosts)};
	if not defined (adrdata^.stats.hourlyUpdateCounts) {
		local (i);
		new (tableType, @adrdata^.stats.hourlyUpdateCounts);
		for i = 0 to 23 {
			adrdata^.stats.hourlyUpdateCounts.[string.padwithzeros (i, 2)] = 0}}};
bundle { //callbacks
	if not defined (adrdata^.callbacks) {
		new (tabletype, @adrdata^.callbacks)};
	if not defined (adrdata^.callbacks.weblogCheckMail) {
		if defined (myUserLandData.callbacks.blogCheckMail) {
			adrdata^.callbacks.weblogCheckMail = myUserLandData.callbacks.blogCheckMail}
		else {
			new (tabletype, @adrdata^.callbacks.weblogCheckMail)}};
	if not defined (adrdata^.callbacks.rssFilterDescription) {
		new (tabletype, @adrdata^.callbacks.rssFilterDescription)}};
bundle { //trash
	if not defined (adrdata^.trash) {
		new (tabletype, @adrdata^.trash)}};
bundle { //posts
	if not defined (adrdata^.posts) {
		if defined (myUserLandData.blogs.default.posts) {
			adrdata^.posts = myUserLandData.blogs.default.posts}
		else {
			new (tabletype, @adrdata^.posts)}};
	if defined (adrdata^.posts.["item #1"]) {
		delete (@adrdata^.posts.["item #1"])}};
bundle { //rpc handlers
	if not defined (user.betty.rpcHandlers.blogger) {
		radio.weblog.bloggerApi.install ()};
	if not defined (user.betty.rpcHandlers.metaWeblog) {
		radio.weblog.metaWeblogApi.install ()};
	if defined (radio.weblog.bloggerApi.rpcHandlers.getUserBlogs) {
		delete (@radio.weblog.bloggerApi.rpcHandlers.getUserBlogs)}};
return (adrdata)



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.