Wednesday, January 23, 2002


Categorizing existing posts (in an attempt to split public and private weblogs) has been a day-long endeavor. So far I have had to do the following:
  • Create a category for my private weblog
  • Copy my general postings archive into this new category
  • Add a #category directive to each day's archive file (I wrote a little script to do that)
  • Add the new private category name to all posts in weblogdata.posts (another script made this pretty simple)
  • Rebuild the private category's storyList (weblogdata.categories.["catname"].storyList) so the calendar draws correctly - yet another short script.
  • Turn off upstreaming in the root
  • Enable upstreaming, via ftp, in the private category
  • Wipe out user.radio.settings.files to force it to rebuild
  • Publish all of the category archive pages (using
  • Radio/Publish/All Category Archive Pages menu)

Not sure if I left anything out or not. Here are the scripts, in case you want to attempt something similar. The first I used to zip through all of the archive files in the category, inserting a #category directive (I am unsure of whether I really needed to do this) step, but it did not hurt.

on categorizePosts (catName) {
	«Specifies a category for existings posts
		«Specify the display name for the category
		«1/23/02; 2:51:27 PM by MW
	local (adrblog = radio.weblog.init ());
	local (htmlfolder = radio.file.getAbsolutePath 
(adrblog^.prefs.htmlCategoryFolderPath));
	local (folder = htmlfolder + weblogdata.categories.
[catName].fileName + "\\");
	local(f, s, y, search = "#flArchivePage true");
	for y in {2001, 2002} {
		local(folderYear = folder + y + "\\");
		fileloop(f in folderYear, infinity) {
			s = file.readWholeFile(f);
			s = string.replace(s, search, search + cr + 
lf + "#categoryName " + catName);
			file.writeWholeFile(f, s)}}};
bundle { // testing
	categorizePosts("ICT")}

Next up, a script to mark each posting as belonging to the desired category. Note, only use this if you want every posting to belong to the category. If not, you'll need to perform this step manually (by editing posts using the Home Page, I guess). This one is not fancy. Exchange "ICT" for your categories display name.

local (adrblog = radio.weblog.init ());
local(i);
for i = 1 to sizeOf(adrblog^.posts) {
	if not defined(adrblog^.posts[i].categories) {
		new(tableType, @adrblog^.posts[i].categories)};
	adrblog^.posts[i].categories.["ICT"] = true}

The prior two get all of the category archive pages published, but the calendar comes out wrong. I found that the drawCalendar routine uses a bit of a shortcut for categories. Each category has a list of the stories that have been marked as belonging to it. I wrote a quick script to rebuild the list. I cheated; I knew I wanted all entries to be part of my private category. If you are selecting only some posts for your category, then you will want to tweak this a bit by examining the categories attribute on each post to see if the desired one is present or not before adding it to the list.

local (adrblog = radio.weblog.init ());
local(i, list);
list = adrblog^.categories.["ICT"].storyList;
list = {};
for i = 1 to sizeOf(adrblog^.posts) {
	list = list + number(nameOf(adrblog^.posts[i]))};
adrblog^.categories.["ICT"].storyList = list

I hope this helps somebody. None of it is too hard; it is just a matter of making sure everything is taken care of.
5:14:56 PM  [Macro error: The file "D:\Program Files\Radio UserLand\www\#prefs.txt" wasn't found.]     


I think I have recategorized all of my prior posts to show up on my internal ICT website. Let's see if they now appear. Not quite. Maybe now? Nope. This time for sure!!!
3:51:58 PM  [Macro error: The file "" wasn't found.]     

I am in the process of blog-splitting. The public stuff has been fine. How shall I insert #category tags into every non-public posting? (LIGHTBULB) Hey, I will write a little Radio script to do the work for me.
11:35:26 AM  [Macro error: The file "" wasn't found.]     

Seems to be an extraneous <p> tag showing up in the middle of a table causing my headline graphics to look bad. Fixed. Working on some bad links...
11:19:45 AM  [Macro error: The file "" wasn't found.]     

Starting a new category for ICT-only items. I think I'll need to shove a #category directive into all of the ICT postings...
8:53:36 AM  [Macro error: The file "" wasn't found.]     

It appears others have hit, and solved, the multiple categories to multiple websites problem before me. The quick answer: "eliminate" the main blog. Use categories for everything to control whether a post goes to my internal website, my external website, or both.

Solution details
8:40:04 AM  [Macro error: The file "" wasn't found.]     


I am off to Eprise class today. After using Radio (and Frontier) for a couple of years I have some very high expectations of Eprise. Somehow I feel certain that they will not be met!

Gee, while looking up the URL for Eprise I found that they were just acquired by divine. Lowering the bar.

And their home page points to a "newsworthy" item: customers are reporting implementation times of less than 90 days! I'll stick to Radio for most of my content management needs, thank you very much.
8:11:35 AM  [Macro error: The file "" wasn't found.]