Add top-level keywords, which allows for hierarchial categorization of wiki pages.

This commit is contained in:
Colin Kuskie 2010-04-16 20:46:55 -07:00
parent 1a77fce843
commit 55d2e510d6
8 changed files with 489 additions and 1 deletions

View file

@ -31,6 +31,7 @@ my $quiet; # this line required
my $session = start(); # this line required
reindexSiteForDefaultSynopsis( $session );
addTopLevelWikiKeywords( $session );
finish($session); # this line required
@ -44,6 +45,24 @@ finish($session); # this line required
# print "DONE!\n" unless $quiet;
#}
#----------------------------------------------------------------------------
sub addTopLevelWikiKeywords {
my $session = shift;
print "\tAdding top level keywords page to WikiMaster... " unless $quiet;
my $sth = $session->db->read('DESCRIBE `WikiMaster`');
while (my ($col) = $sth->array) {
if ($col eq 'topLevelKeywords') {
print "Skipped.\n" unless $quiet;
return;
}
}
$session->db->write('ALTER TABLE WikiMaster ADD COLUMN topLevelKeywords LONGTEXT');
print "Done.\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Reindex the site to clear out default synopsis
sub reindexSiteForDefaultSynopsis {