Title: Blog Configuration Plugin: Starburst-Blog Something went wrong. my $action = $query->{action} || 'index'; # Load the blog config. $root->{blogcfg} = &readConfig('blog.conf') unless exists $root->{blogcfg}; if (not $root->{auth}) { $root->{content} = "

Access Denied

\n\n" . "You must be logged in to access this page!\n\n" . ""; return 1; } # Are we authorized? my $level = &getBlogPermissions(); if ($level ne 'authors') { $root->{content} = "

Access Denied

\n\n" . "Only authors can access this page."; return 1; } if ($action eq 'index') { my $bb = $root->{blogcfg}->{blog}; my $bv = $root->{blogcfg}->{vocab}; my $bg = $root->{blogcfg}->{groups}; my $bc = $root->{blogcfg}->{comments}; my $ckPrivate = $bb->{defprivacy} eq 'private' ? ' checked' : ''; my $ckPublic = $bb->{defprivacy} eq 'public' ? ' checked' : ''; my $ckMembers = $bb->{defprivacy} eq 'members' ? ' checked' : ''; my $ckEmote = $bb->{emoticons} ? ' checked' : ''; my $ckGuests = $bc->{allowguests} ? ' checked' : ''; $root->{content} = "

Blog Configuration

\n\n" . "
\n" . "\n" . "\n" . "

Display Settings

\n\n" . "Default Category:
\n" . "{defcategory}\">

\n\n" . "Default Privacy:
\n" . "The default privacy setting on new posts.
\n" . " " . "
\n" . " " . "
\n" . " " . "

\n\n" . "Posts Per Page:
\n" . "{postsperpage}\">

\n\n" . "Posts Per Feed:
\n" . "This is the number of posts to return in the RSS feed.
\n" . "{postsperfeed}\">

\n\n" . "Timestamp Format:
\n" . "See Time::Format for help.
\n" . "{timestamp}\">

\n\n" . "Options:
\n" . " " . "

\n\n" . "Emoticon Set:
\n" . "This should be the name of a public folder containing a smilies.conf (e.g. " . "sb-public/default/smilies.conf)
\n" . "{smilies}\">\n\n" . "

Vocabulary

\n\n" . "Comment Strings:
\n" . "Use a # in place for the number of comments.
\n" . "1 Comment:
\n" . "{single}\">
\n" . "n Comments:
\n" . "{multiple}\">

\n\n" . "Leave a Comment:
\n" . "{comment}\">

\n\n" . "Permalink:
\n" . "{permalink}\">

\n\n" . "Tags/Categories:
\n" . "{tags}\">\n\n" . "

Blog Groups

\n\n" . "The blog plugin is isolated from the rest of the CMS. As such, " . "only the global Administrator can post blog entries. You'll need " . "to create new user groups and assign the other users to those " . "groups, and then put those groups in here. For example, if you create " . "a user group called \"publishers\" and use that as the Publishers Group " . "below, all users in the publishers group will have Publisher privileges " . "on the blog software.

\n\n" . "Authors Group:
\n" . "Authors have full control. They can write, edit, and delete any and all posts.
\n" . "{authors}\">

\n\n" . "Publishers Group:
\n" . "Publishers are allowed to write, edit, and delete only posts that they have written.
\n" . "{publishers}\">

\n\n" . "Readers Group:
\n" . "Readers are allowed to leave comments on blog posts. 'everybody' is a good option " . "for this.
\n" . "{readers}\">\n\n" . "

Comment Settings

\n\n" . "Allow Guests to Leave Comments:
\n" . "This option negates the Readers Group and will also allow all registered " . "users to leave comments as well.
\n" . " " . "

\n\n" . "\n" . "

"; } elsif ($action eq 'save') { # Translate checkboxes back. $query->{'blog-emoticons'} = $query->{'blog-emoticons'} eq 'checked' ? 1 : 0; $query->{'comments-allowguests'} = $query->{'comments-allowguests'} eq 'checked' ? 1 : 0; my $changed = {}; # Copy all the config fields. foreach my $key (keys %{$query}) { if ($key =~ /\-/) { my ($section,$var) = split(/\-/, $key, 2); next unless $section =~ /^(blog|groups|comments|vocab)$/; $root->{blogcfg}->{$section}->{$var} = $query->{$key}; if (!exists $changed->{$section}) { $changed->{$section} = []; } push (@{$changed->{$section}}, "$var=$query->{$key}"); } } # Write the configuration. &writeConfig('blog.conf',$root->{blogcfg}); $root->{content} = "

Configuration Saved

\n\n" . "The site configuration has been updated successfully. Details:

\n\n" . "

Wrote: $root->{base}/conf/blog.conf\n\n"
			. "Fields Changed/Written:\n";

		foreach my $section (sort { $a cmp $b } keys %{$changed}) {
			$root->{content} .= "\n[$section]\n"
				. (join("\n", sort { $a cmp $b } @{$changed->{$section}}))
				. "\n";
		}

		$root->{content} .= "
\n"; }