#!/usr/local/bin/perl # ============================= # GREYMATTER - Main Program # Weblog/Journal Software # version one point two # Copyright (c)2000 Noah Grey # http://noahgrey.com/greysoft/ # ============================= # *** Your possession of this software indicates that you agree to the terms *** # *** specified under the "Copyright & Usage" heading in the "manual.txt" file. *** eval { ($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); ($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); }; use CGI::Carp qw(fatalsToBrowser); require "gm-library.cgi"; # ---------------------------------------- # gathering the input & checking for login # ---------------------------------------- print "Content-type: text/html\n\n"; $authorIP = $ENV{'REMOTE_ADDR'}; $logindeletednotice = ""; if ($ENV{'REQUEST_METHOD'} eq "GET") { $getin = $ENV{'QUERY_STRING'}; } else { read(STDIN, $getin, $ENV{'CONTENT_LENGTH'}); } @pairs = split(/&/, $getin); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $name =~ tr/+/ /; $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; unless (($name eq "logtext") || ($name eq "loglink")) { $value =~ tr/+/ /; } $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $IN{$name} = $value; } &gm_bancheck; &gm_readconfig; if ($IN{'thomas'} eq "") { &gm_login; } if ($IN{'thomas'} eq "Re-Login") { &gm_login; } &gm_validate; if ($IN{'thomas'} eq "login") { &gm_writetocplog("$IN{'authorname'} logged in"); &gm_versioncheck; &gm_readcounter; $statusnote = qq(Welcome, $IN{'authorname'}.

); if ($newentrynumber eq "0") { open (FUNNYFEET, "gm-cplog.cgi") || &gm_dangermouse("Can't read the control panel log. Please make sure that gm-cplog.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); @cploglines = ; close (FUNNYFEET); $cplogtext = join (" ", @cploglines); unless ($cplogtext =~ /successfully performed diagnostics/) { $statusnote = qq(Welcome to Greymatter! Please enter Configuration first, check your paths,
and run Diagnostics & Repair to validate your installation.

); } } &gm_frontpage; } if ($IN{'thomas'} eq "rebuildupdate") { &gm_rebuildupdate; } if ($IN{'thomas'} eq "Update Now") { &gm_versionupgrading; } if ($IN{'thomas'} eq "gmbmpost") { &gm_addentrypopup; } if ($IN{'thomas'} eq "Return To Main Menu") { &gm_frontpage; } if ($IN{'thomas'} eq "Add A New Entry") { &gm_addentry; } if ($IN{'thomas'} eq "Edit An Entry") { &gm_editentryselection; } if ($IN{'thomas'} eq "Configuration") { &gm_configuration; } if ($IN{'thomas'} eq "Edit Templates") { &gm_edittemplates; } if ($IN{'thomas'} eq "Edit Authors") { &gm_editauthors; } if ($IN{'thomas'} eq "Edit Banned IP List") { &gm_editbanlist; } if ($IN{'thomas'} eq "Add Bookmarklets") { &gm_addbookmarklets; } if ($IN{'thomas'} eq "Upload Files") { &gm_uploadfiles; } if ($IN{'thomas'} eq "Rebuild Files") { &gm_rebuildfilesmenu; } if ($IN{'thomas'} eq "View Control Panel Log") { &gm_viewcplog; } if ($IN{'thomas'} eq "Add This Entry") { &gm_savenewentry; } if ($IN{'thomas'} eq "Preview Before Posting") { &gm_previewentry; } if ($IN{'thomas'} eq "Re-Edit This Entry") { if ($IN{'gmbmspecial'} eq "popupblog") { &gm_addentrypopup; } else { &gm_addentry; } } if ($IN{'thomas'} eq "Change View") { &gm_editentryselection; } if ($IN{'thomas'} eq "Search") { &gm_editentryselection; } if ($IN{'thomas'} eq "Edit Selected Entry") { &gm_editthisentry; } if ($IN{'thomas'} eq "Open/Close Selected Entry") { &gm_changeentryopenstatus; } if ($IN{'thomas'} eq "Search And Replace Across All Entries") { &gm_editentrysearchandreplace; } if ($IN{'thomas'} eq "Edit Selected Comment") { &gm_editselectedcomment; } if ($IN{'thomas'} eq "Delete Selected Comment") { &gm_deleteselectedcomment; } if ($IN{'thomas'} eq "Save Changes To This Entry") { &gm_saveentrychanges; } if ($IN{'thomas'} eq "Select Another Entry") { &gm_editentryselection; } if ($IN{'thomas'} eq "Return To Entry Selection") { &gm_editentryselection; } if ($IN{'thomas'} eq "Perform Search And Replace") { &gm_performsearchandreplace; } if ($IN{'thomas'} eq "Save Changes To This Comment") { &gm_savecommentchanges; } if ($IN{'thomas'} eq "Return To Entry Editing") { &gm_editthisentry; } if ($IN{'thomas'} eq "Add New IP") { &gm_addbannedip; } if ($IN{'thomas'} eq "Delete Selected IP") { &gm_deletebannedip; } if ($IN{'thomas'} eq "Diagnostics & Repair") { &gm_diagnosticscheck; } if ($IN{'thomas'} eq "Save Configuration") { &gm_saveconfiguration; } if ($IN{'thomas'} eq "Perform Diagnostics & Repair") { &gm_diagnosticsperform; } if ($IN{'thomas'} eq "Return To Configuration") { &gm_configuration; } if ($IN{'thomas'} eq "Edit Main Index-Related Templates") { &gm_editmainindextemplates; } if ($IN{'thomas'} eq "Edit Archive-Related Templates") { &gm_editarchivetemplates; } if ($IN{'thomas'} eq "Edit Entry Page-Related Templates") { &gm_editentrypagetemplates; } if ($IN{'thomas'} eq "Edit Karma & Comments-Related Templates") { &gm_editkarmacommentstemplates; } if ($IN{'thomas'} eq "Edit Header, Footer & Sidebar Templates") { &gm_editheaderfootertemplates; } if ($IN{'thomas'} eq "Edit Miscellaneous Templates") { &gm_editmisctemplates; } if ($IN{'thomas'} eq "Return To Templates Menu") { &gm_edittemplates; } if ($IN{'thomas'} eq "Save Template Changes") { &gm_savetemplatechanges; } if ($IN{'thomas'} eq "Edit Selected Author") { &gm_editselectedauthor; } if ($IN{'thomas'} eq "Delete Selected Author") { &gm_deleteselectedauthor; } if ($IN{'thomas'} eq "Create New Author") { &gm_createnewauthor; } if ($IN{'thomas'} eq "Save Changes To This Author") { &gm_saveauthorchanges; } if ($IN{'thomas'} eq "Return To Author Panel") { &gm_editauthors; } if ($IN{'thomas'} eq "Upload This File") { &gm_processupload; } if ($IN{'thomas'} eq "Rebuild Last Entry Page Only") { &gm_rebuildlastentrypageonly; } if ($IN{'thomas'} eq "Rebuild Main Index File") { &gm_rebuildmainindexfile; } if ($IN{'thomas'} eq "Rebuild Main Entry Pages") { &gm_rebuildmainentrypages; } if ($IN{'thomas'} eq "Rebuild Archive Master Index") { &gm_rebuildarchivemasterindex; } if ($IN{'thomas'} eq "Rebuild Archive Log Indexes") { &gm_rebuildarchivelogindexes; } if ($IN{'thomas'} eq "Rebuild Archive Entry Pages") { &gm_rebuildarchiveentrypages; } if ($IN{'thomas'} eq "Rebuild All Entry Pages") { &gm_rebuildallentrypages; } if ($IN{'thomas'} eq "Rebuild Connected Files") { &gm_rebuildconnectedfilescheck; } if ($IN{'thomas'} eq "Rebuild Everything") { &gm_rebuildeverything; } if ($IN{'thomas'} eq "Clear And Exit") { unlink ("$EntriesPath/gmrightclick-$IN{'usethisauthorname'}.reg"); &gm_frontpage; } if ($IN{'thomas'} eq "Reset The Control Panel Log") { &gm_resetcplog; } if ($IN{'thomas'} eq "Include This Image In A New Entry") { &gm_addentry; } if ($IN{'thomas'} eq "Include In Entry As A Popup Window") { $IN{'newentrymaintext'} = $IN{'newentrypopuptext'}; &gm_addentry; } if ($IN{'thomas'} eq "Include This Link In A New Entry") { &gm_addentry; } exit; # ------------------------ # front page - log options # ------------------------ sub gm_frontpage { &gm_readconfig; if (($cgilocalpath eq "") || ($cgiwebpath eq "") || ($LogPath eq "") || ($EntriesPath eq "") || ($LogWebPath eq "") || ($EntriesWebPath eq "")) { if (($cgilocalpath eq "") && ($LogPath ne "")) { $cgilocalpath = $LogPath; } if (($cgiwebpath eq "") && ($LogWebPath ne "")) { $cgiwebpath = $LogWebPath; } if ($cgilocalpath eq "") { if ($ENV{'SCRIPT_FILENAME'}) { $cgilocalpath = $ENV{'SCRIPT_FILENAME'}; } elsif ($ENV{'PATH_TRANSLATED'}) { $cgilocalpath = $ENV{'PATH_TRANSLATED'}; $cgilocalpath =~ s/\\/\//g; } @cgilocalpathtemp = split(/\//, $cgilocalpath); pop(@cgilocalpathtemp); $cgilocalpath = join("\/", @cgilocalpathtemp); } @cgipath = split(/\//, $cgilocalpath); $cgiwebpathextension = pop(@cgipath); if ($cgiwebpath eq "") { $cgiwebpath = "http://$ENV{'HTTP_HOST'}/$cgiwebpathextension"; } if ($LogPath eq "") { $LogPath = $cgilocalpath; } if ($EntriesPath eq "") { $EntriesPath = ("$cgilocalpath" . "/archives"); } if ($LogWebPath eq "") { $LogWebPath = "http://$ENV{'HTTP_HOST'}/$cgiwebpathextension"; } if ($EntriesWebPath eq "") { $EntriesWebPath = "http://$ENV{'HTTP_HOST'}/$cgiwebpathextension/archives"; } &gm_writeconfig; } &gm_validate; if ($gmloginaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to log in without authorization"); $loginnotice = qq(You don't have access to log in.

); &gm_login; } if ($statusnote eq "") { $statusnote = qq(Main Menu

); } if (($IN{'authorname'} eq "Alice") && ($IN{'authorpassword'} eq "woCCASD0Wk0IA")) { $setnameandpwcookie = ""; } else { $setnameandpwcookie = ""; } if ($cookiesallowed eq "no") { $setnameandpwcookie = ""; } $visityoursitelink = ""; unless (!(open(CHECKMATE,"$LogPath/$indexfilename"))) { &gm_readcounter; unless ($newentrynumber eq "0") { $indexfilenamesmartcheck = "/$indexfilename"; $indexfilenameprefix = substr($indexfilename, 0, 6); if ($indexfilenameprefix eq "index.") { $indexfilenamesmartcheck = "/"; } $visityoursitelink = qq(

\n$gmfonttag
Open your weblog/journal in a new browser window.
\n
); } } close(CHECKMATE); print< $visityoursitelink
$gmfonttag
Post a new entry to your weblog/journal.
$gmfonttag
Your site's settings and options.
$gmfonttag
Edit and delete entries or comments.
$gmfonttag
Change your site's layout and appearance.
$gmfonttag
Edit or add authors to post to your site.
$gmfonttag
Regenerate part or all of your site.
$gmfonttag
A record of how your site's been used.
$gmfonttag
Post entries with one click (IE 5+ only).
$gmfonttag
Upload images or other files to your site.
$gmfonttag
Ban someone from using your site.
$gmfonttag
Re-enter as another author.

"Our life is what our thoughts make it."—Marcus Aurelius $gmframebottom GMFRONTPAGE $statusnote = ""; exit; } # ---------------- # templates editor # ---------------- sub gm_edittemplates { &gm_validate; if ($gmtemplateaccess eq "no") { &gm_writetocplog("$IN{'authorname'} attempted to edit the templates without authorization"); $statusnote = qq(You don't have access to edit the templates.

); &gm_frontpage; } if ($statusnote eq "") { $statusnote = qq(Edit Templates
Select a group of templates to edit. Templates control
the layout & format of every aspect of your weblog/journal.

); } if ($gmtemplateaccess eq "hfsonly") { $statusnote .= "You only have access to edit the header, footer & sidebar templates.

"; } print<

"Art is the imposing of a pattern on experience, and our aesthetic
enjoyment is recognition of the pattern."—A.N. Whitehead
$gmframebottom GMEDITTEMPLATESMENU $statusnote = ""; exit; } # ------------------------------- # edit template group: main index # ------------------------------- sub gm_editmainindextemplates { &gm_validate; if (($gmtemplateaccess eq "no") || ($gmtemplateaccess eq "hfsonly")) { &gm_writetocplog("$IN{'authorname'} attempted to edit the main index templates without authorization"); $statusnote = qq(You don't have access to edit the main index templates.

); &gm_frontpage; } &gm_readtemplates; &gm_delousealltemplates; if ($statusnote eq "") { $statusnote = qq(Editing Main Index-Related Templates
These are the templates that affect the layout and appearance of your main index.

); } if ($gmrebuildaccess eq "yes") { if ($automaticrebuilddefault eq "yes") { $autorebuildcheckbox = qq(

\n Automatically rebuild main index after saving\n
\nAfter clicking Save, expect a wait of up to several minutes if leaving this box checked.
DO NOT interrupt Greymatter while it's rebuilding!
); } else { $autorebuildcheckbox = qq(

\n Automatically rebuild main index after saving\n
\nAfter clicking Save, expect a wait of up to several minutes if leaving this box checked.
DO NOT interrupt Greymatter while it's rebuilding!
); } } &gm_readcounter; if ($newentrynumber eq "0") { $autorebuildcheckbox = ""; } print<
$gmfonttag
$gmfonttagMain Index Template
The overall template for your main index page—typically the first page that people will see on your weblog/journal. The {{logbody}} variable is the placeholder that tells Greymatter where you want the body of your log to be inserted, so it must be included somewhere in this template. The format of the log body is controlled through the templates below.

$gmfonttag

 
$gmfonttagIndex Entry Templates
These templates control how individual entries are listed in the body of your log. The left template is the format of standard entry listings, and the right template is the format of extended entry listings (entries that contain "more" text).
$gmfonttagIndex Entry Template: Standard Entries
$gmfonttagIndex Entry Template: Extended Entries
$gmfonttag$gmfonttag
$gmfonttag Make this the same as the template on the left
$gmfonttagDate Grouping Template
When your log is generated, the entry listings for each day are prefaced with a date header; this controls how that date header appears. Leave this blank if you don't want to group your entry listings in this way.
$gmfonttagEntry Separator Template
If you wish, you can have your entry listings divided with a special separator when your log is generated. Leave this blank if you don't want to include a separator.
 
$gmfonttag$gmfonttag
$gmfonttag"Stay At Top" Index Entry Template
Like the index entry templates above, except this will apply to any entry you've marked to stay at the top of your main log (only one entry at a time can be marked as such); use this for any way you might wish to set that apart.
$gmfonttag
$gmfonttag Make this the same as the standard index entry template
$autorebuildcheckbox

"The face is the index of a feeling mind."—George Crabbe $gmframebottom GMEDITMAININDEXTEMPLATES $statusnote = ""; exit; } # ----------------------------- # edit template group: archives # ----------------------------- sub gm_editarchivetemplates { &gm_validate; if (($gmtemplateaccess eq "no") || ($gmtemplateaccess eq "hfsonly")) { &gm_writetocplog("$IN{'authorname'} attempted to edit the archive templates without authorization"); $statusnote = qq(You don't have access to edit the archive templates.

); &gm_frontpage; } &gm_readtemplates; &gm_delousealltemplates; if ($statusnote eq "") { $statusnote = qq(Editing Archive-Related Templates
These are the templates that affect the layout and appearance of your archives.

); } $autorebuildcheckbox = ""; if ($gmrebuildaccess eq "yes") { if ($automaticrebuilddefault eq "yes") { $autorebuildcheckbox = qq(

\n Automatically rebuild archive master index and log indexes after saving\n
\nAfter clicking Save, expect a wait of up to several minutes if leaving this box checked.
DO NOT interrupt Greymatter while it's rebuilding!
); } else { $autorebuildcheckbox = qq(

\n Automatically rebuild archive master index and log indexes after saving\n
\nAfter clicking Save, expect a wait of up to several minutes if leaving this box checked.
DO NOT interrupt Greymatter while it's rebuilding!
); } } &gm_readcounter; if ($newentrynumber eq "0") { $autorebuildcheckbox = ""; } print<
$gmfonttag
$gmfonttagArchive Master Index Template
If you wish, you can keep a master index of your archives—an index page in your entries/archives directory intended for linking to all the archives (both the monthly/weekly logs and the individual entry pages) of your site. You can use variables such as {{logarchivelist}} and {{logentrylist}} here (or anywhere) to generate those list links; check the manual for more information about those variables. If you don't wish to keep an archive master index, you can disable it in Configuration.

$gmfonttag

 
$gmfonttag
$gmfonttagArchive Log Index Template
Archive log index files are the archives of your log; this is like the main index except that the log archives are generated in monthly or weekly installments, each installment showing the full log for that given month or week. As with the main index, {{logbody}} (or {{archivebody}}) is the placeholder that tells Greymatter where to put the body of your log.

$gmfonttag
$gmfonttag Make this the same as the main index template

 
$gmfonttagLog Archive Entry Templates
These templates control how individual entries are listed in the body of your log; these work the same as the main index versions, except this controls how they appear in the log archives instead. The left template is the format of standard entry listings, and the right template is the format of extended entry listings (entries that contain "more" text).
$gmfonttagArchive Entry Template: Standard Entries
$gmfonttagArchive Entry Template: Extended Entries
$gmfonttag
$gmfonttag Make this the same as the main index version
$gmfonttag
$gmfonttag Make this the same as the main index version
 
$gmfonttagArchive Date Grouping Template
When your log is generated, the entry listings for each day are prefaced with a date header; this controls how that date header appears. This works the same as it does on the main index, except this is how the date header will appear in your log archives. Leave this blank if you don't want to group your entry listings in this way.
$gmfonttagArchive Entry Separator Template
If you wish, you can have your entry listings divided with a special separator when your log is generated. This works the same as it does on the main index, except this is the separator for entries in your log archives. Leave this blank if you don't want to include a separator.
 
$gmfonttag
$gmfonttag Make this the same as the main index version
$gmfonttag
$gmfonttag Make this the same as the main index version
$autorebuildcheckbox

"History never looks like history when you're living through it."—John Gardner $gmframebottom GMEDITARCHIVETEMPLATES $statusnote = ""; exit; } # -------------------------------- # edit template group: entry pages # -------------------------------- sub gm_editentrypagetemplates { &gm_validate; if (($gmtemplateaccess eq "no") || ($gmtemplateaccess eq "hfsonly")) { &gm_writetocplog("$IN{'authorname'} attempted to edit the entry page templates without authorization"); $statusnote = qq(You don't have access to edit the entry page templates.

); &gm_frontpage; } &gm_readtemplates; &gm_delousealltemplates; if ($statusnote eq "") { $statusnote = qq(
$gmfonttagEditing Entry Page-Related Templates
These are the templates that affect the layout and appearance of the pages for your individual entries (as opposed to the Index Entry templates, in the Main Index and Archive template groups, which customise how entries appear in the body of your log). If you have "Generate pages for individual entries" disabled in Configuration, you can ignore these templates.

); } $autorebuildcheckbox = ""; if ($gmrebuildaccess eq "yes") { if ($automaticrebuilddefault eq "yes") { $autorebuildcheckbox = qq(

\n Automatically rebuild all entry pages after saving\n
\nAfter clicking Save, expect a wait of up to several minutes if leaving this box checked.
DO NOT interrupt Greymatter while it's rebuilding!
); } else { $autorebuildcheckbox = qq(

\n Automatically rebuild all entry pages after saving\n
\nAfter clicking Save, expect a wait of up to several minutes if leaving this box checked.
DO NOT interrupt Greymatter while it's rebuilding!
); } } &gm_readcounter; if ($newentrynumber eq "0") { $autorebuildcheckbox = ""; } print<
$gmfonttag
$gmfonttagEntry Page Template: Current Standard Entries
This template controls how the individual pages for your current regular entries (non-archived entries without "more" text) will be formatted. The {{entrymainbody}} and {{entrymorebody}} variables specify where the body of your standard and extended text (if any) will respectively appear.

$gmfonttag

 
$gmfonttag
$gmfonttagEntry Page Template: Current Extended Entries
Like the above, except this applies to current extended entries (non-archived entries *with* "more" text).

$gmfonttag
$gmfonttag Make this the same as the above template (current standard entries)

 
$gmfonttag
$gmfonttagEntry Page Template: Archived Standard Entries
Like the above, except this applies to archived entries (entries too old to be listed on the main log) without "more" text.

$gmfonttag
$gmfonttag Make this the same as the top template (current standard entries)

 
$gmfonttag
$gmfonttagEntry Page Template: Archived Extended Entries
Like the above, except this applies to archived entries (entries too old to be listed on the main log) *with* "more" text.

$gmfonttag
$gmfonttag Make this the same as the previous template (archived standard entries)

$autorebuildcheckbox

"One of the few remaining freedoms we have is the blank page; no one can prescribe how we should fill it."—James Kelman $gmframebottom GMEDITENTRYPAGETEMPLATES $statusnote = ""; exit; } # ------------------------------------- # edit template group: karma & comments # ------------------------------------- sub gm_editkarmacommentstemplates { &gm_validate; if (($gmtemplateaccess eq "no") || ($gmtemplateaccess eq "hfsonly")) { &gm_writetocplog("$IN{'authorname'} attempted to edit the karma & comments templates without authorization"); $statusnote = qq(You don't have access to edit the karma & comments templates.

); &gm_frontpage; } &gm_readtemplates; &gm_delousealltemplates; if ($statusnote eq "") { $statusnote = qq(Editing Karma & Comments-Related Templates
These are the templates that affect all elements relating to karma voting and comment posting; if you have
either or both of those disabled, you can ignore the templates relating to them. All these templates
affect things that will not appear on entries for which karma voting and/or comment posting is disabled.

); } $autorebuildcheckbox = ""; if ($gmrebuildaccess eq "yes") { if ($automaticrebuilddefault eq "yes") { $autorebuildcheckbox = qq(

\n Automatically rebuild all files after saving\n
\nAfter clicking Save, expect a wait of up to several minutes if leaving this box checked.
DO NOT interrupt Greymatter while it's rebuilding!
); } else { $autorebuildcheckbox = qq(

\n Automatically rebuild all files after saving\n
\nAfter clicking Save, expect a wait of up to several minutes if leaving this box checked.
DO NOT interrupt Greymatter while it's rebuilding!
); } } &gm_readcounter; if ($newentrynumber eq "0") { $autorebuildcheckbox = ""; } print<
$gmfonttag{{karmalink}} and {{commentslink}} Templates
These templates are what will appear wherever the {{karmalink}} and {{commentslink}} are used, but only when called for; the contents of {{commentslink}} will only appear on entries for which comments can be posted to, and the same with {{karmalink}}. The default approach is to use {{karmalink}} to contain the links for voting on karma and {{commentslink}} for a link to your entry's comments, but you can use these templates to set anything that will appear, wherever you insert their respective variables, only for entries with karma or comments enabled respectively.
$gmfonttag{{karmalink}} Template
$gmfonttag{{commentslink}} Template
$gmfonttag$gmfonttag
$gmfonttagComment Appearance Template
Whenever comments are added to your entries, this is the template which the comments will be formatted by.
 
 
$gmfonttag{{entrycommentsform}} Posting Form
This is the form by which visitors can add comments (appearing whereever {{entrycommentsform}} is used). You can change the form's design, but the "NAME", "VALUE" and "ACTION" values must remain the same.
$gmfonttag$gmfonttag
$gmfonttag{{commentdivider}} Template
The {{commentdivider}} variable (whatever you set below) will only appear if at least one comment has been posted to that entry; for example, if you want to have something that says "This entry has received X comments" in an entry, but don't want that to appear if there haven't been any comments posted to it yet.
$gmfonttag{{karmaform}} Template
Just like {{karmalink}} above, this will only appear on karma-enabled entries; this is intended to allow a handling of karma voting on individual entry pages distinct from the main log, if you wish to do that.
 
 
$gmfonttag$gmfonttag
$gmfonttagComment Previewing Templates
If you allow visitors to preview their comments before posting them (to enable this, add a <INPUT TYPE=SUBMIT NAME="gmpostpreview" VALUE="Preview Your Comment"> button [the "value" text can be changed to whatever you wish, as long as you keep the NAME="gmpostpreview" part] to your entry comments form, if it's not there already), these templates control what special information will appear (the comment is shown to the user as it would appear in your entry's page). The Preview Divider is what will appear in the preview where {{commentdivider}} (see above) is, and the Confirmation Form takes the place of {{entrycommentsform}} above.
$gmfonttagPreview Divider Template
$gmfonttagConfirmation Form Template
$gmfonttag$gmfonttag
$gmfonttag{{commentstatussmart}} Templates
If you wish, you can customise the text or other output that {{commentstatussmart}} generates when there are no comments, only one comment, or more than one comment, respectively.
$gmfonttagOutput for
no comments
$gmfonttagOutput for
one comment
$gmfonttagOutput for two
or more comments
$gmfonttag$gmfonttag$gmfonttag
$gmfonttag{{commentauthoremail}} and {{commentauthorhomepage}} Templates
When used in the Comment Appearance template, these varibles are what will appear whenever an e-mail or homepage address, respectively, has been given by that author of that comment; this is useful, for example, if you want to set up little icons or somesuch that will appear with someone's comment when they give their e-mail or homepage address. The simplest approach, though, is to ignore these altogether and use {{commentauthorsmartlink}} instead.
$gmfonttag{{commentauthoremail}} Template
$gmfonttag{{commentauthorhomepage}} Template
$gmfonttag$gmfonttag
$autorebuildcheckbox

"We all shine on, like the moon and the stars and the sun."—John Lennon, "Instant Karma!" $gmframebottom GMEDITKARMACOMMENTSTEMPLATES $statusnote = ""; exit; } # --------------------------------------------- # edit template group: header, footer & sidebar # --------------------------------------------- sub gm_editheaderfootertemplates { &gm_validate; if ($gmtemplateaccess eq "no") { &gm_writetocplog("$IN{'authorname'} attempted to edit the header, footer & sidebar templates without authorization"); $statusnote = qq(You don't have access to edit the header, footer & sidebar templates.

); &gm_frontpage; } &gm_readtemplates; &gm_delousealltemplates; if ($statusnote eq "") { $statusnote = qq(
$gmfonttagEditing Header, Footer & Sidebar (& Custom) Templates
If you want to have something—certain text, graphics, formatting, etc.—that appears across all your pages, but you don't want to have to modify all the templates each time you change them, simply use the Header, Footer and Sidebar templates below, or any of the ten custom templates. Their contents will be inserted wherever the respective variables appear in your templates.

); } $autorebuildcheckbox = ""; if ($gmrebuildaccess eq "yes") { if ($automaticrebuilddefault eq "yes") { $autorebuildcheckbox = qq(

\n Automatically rebuild all files after saving\n
\nAfter clicking Save, expect a wait of up to several minutes if leaving this box checked.
DO NOT interrupt Greymatter while it's rebuilding!
); } else { $autorebuildcheckbox = qq(

\n Automatically rebuild all files after saving\n
\nAfter clicking Save, expect a wait of up to several minutes if leaving this box checked.
DO NOT interrupt Greymatter while it's rebuilding!
); } } &gm_readcounter; if ($newentrynumber eq "0") { $autorebuildcheckbox = ""; } print<
$gmfonttag
$gmfonttagHeader Template
Whatever you put here will appear wherever {{header}} is used in your other templates.

$gmfonttag

 
$gmfonttag
$gmfonttagFooter Template
Whatever you put here will appear wherever {{footer}} is used in your other templates.

$gmfonttag

 
$gmfonttag
$gmfonttagSidebar Template
Whatever you put here will appear wherever {{sidebar}} is used in your other templates.

$gmfonttag

 
$gmfonttagMiscellaneous Custom Templates
Whatever you put in any of the templates below will appear wherever their respective variables are used.
$gmfonttag{{customone}} Template
$gmfonttag{{customtwo}} Template
$gmfonttag$gmfonttag
$gmfonttag{{customthree}} Template
$gmfonttag{{customfour}} Template
$gmfonttag$gmfonttag
$gmfonttag{{customfive}} Template
$gmfonttag{{customsix}} Template
$gmfonttag$gmfonttag
$gmfonttag{{customseven}} Template
$gmfonttag{{customeight}} Template
$gmfonttag$gmfonttag
$gmfonttag{{customnine}} Template
$gmfonttag{{customten}} Template
$gmfonttag$gmfonttag
$autorebuildcheckbox

"When you make eyes in place of an eye, a hand in place of a hand, a foot in place of a foot,
an image in place of an image, then you will enter the kingdom."—Gospel of Thomas 22:38
$gmframebottom GMEDITHEADERFOOTERTEMPLATES $statusnote = ""; exit; } # ---------------------------------- # edit template group: miscellaneous # ---------------------------------- sub gm_editmisctemplates { &gm_validate; if (($gmtemplateaccess eq "no") || ($gmtemplateaccess eq "hfsonly")) { &gm_writetocplog("$IN{'authorname'} attempted to edit the miscellaneous templates without authorization"); $statusnote = qq(You don't have access to edit the miscellaneous templates.

); &gm_frontpage; } &gm_readtemplates; &gm_delousealltemplates; if ($statusnote eq "") { $statusnote = qq(Editing Miscellaneous Templates
All the templates affecting things that didn't fit into the other categories.

); } $autorebuildcheckbox = ""; if ($gmrebuildaccess eq "yes") { if ($automaticrebuilddefault eq "yes") { $autorebuildcheckbox = qq(

\n Automatically rebuild all files after saving\n
\nAfter clicking Save, expect a wait of up to several minutes if leaving this box checked.
DO NOT interrupt Greymatter while it's rebuilding!
); } else { $autorebuildcheckbox = qq(

\n Automatically rebuild all files after saving\n
\nAfter clicking Save, expect a wait of up to several minutes if leaving this box checked.
DO NOT interrupt Greymatter while it's rebuilding!
); } } &gm_readcounter; if ($newentrynumber eq "0") { $autorebuildcheckbox = ""; } print<
$gmfonttag{{previouslink}} And {{nextlink}} Templates
If there is a previous or next entry (ignoring closed entries, of course) preceding or following the given entry, these will appear; these variables are intended for use in the entry page templates, for including links to the previous or next entry (if applicable). {{previousmorelink}} and {{nextmorelink}} work the same way, except that they link only to the previous or next extended entry (entries with "more" text).
$gmfonttag{{previouslink}} Template
$gmfonttag{{nextlink}} Template
$gmfonttag$gmfonttag
$gmfonttag{{previousmorelink}} Template
$gmfonttag{{nextmorelink}} Template
$gmfonttag
$gmfonttag Make this the same as the {{previouslink}} template
$gmfonttag
$gmfonttag Make this the same as the {{nextlink}} template
 
$gmfonttagList Variable Templates
The variables {{logarchivelist}} and {{logentrylist}} (and the variants thereof; check the manual for more information) are used for automatically generating lists of links—whether on your archive master index, or anywhere else—to your log archives and your individual entry pages; these templates set the formatting of those links. The first two templates apply to the {{logentrylist}} variable and its variants, formatting the links to standard and extended entries respectively; the Log Archive Links Templates apply to the {{logarchivelist}} variable, which generates links to the monthly/weekly log archive files (whichever of the two is used depends on whether you have weekly or monthly archiving enabled).
$gmfonttagLog Archives Link Template: Weekly
$gmfonttagLog Archives Link Template: Monthly
$gmfonttag$gmfonttag
$gmfonttagEntry List Link Template: Standard
$gmfonttagEntry List Link Template: Extended
$gmfonttag$gmfonttag
$gmfonttag Make this the same as the template on the left
 
$gmfonttagList Variable Templates: Link Separators
Going along with the list variable templates above, these specify how the links are to be separated when the lists are built for their respective variables. Use the day, month, and year separators for entry lists if you wish to separate the listings for each individual day, month, or year; leave them blank to keep the entry lists continuous.
$gmfonttagEntry List Link Separator
$gmfonttagLog Archives Link Separator
$gmfonttag$gmfonttag
$gmfonttagEntry List:
Day Separator
$gmfonttagEntry List:
Month Separator
$gmfonttagEntry List:
Year Separator
$gmfonttag$gmfonttag$gmfonttag
 
$gmfonttagSearch Templates
These templates control the built-in ability for visitors to search through your site entries (just add {{searchform}} to a template to insert the search form there). The Search Form template is the form by which visitors can perform the search; the Search Item Results template formats the appearance of each item returned by the search result; and finally, the Search Results Page template is for the full page that your visitors will see displaying all the search results.
$gmfonttagSearch Form Template
$gmfonttagSearch Item Results Template
$gmfonttag$gmfonttag
$gmfonttagSearch Results Page Template
$gmfonttag
 
$gmfonttagCalendar Templates
These control the layout and appearance of monthly or weekly calendars made with the {{calendar}} or {{calendarweek}} variables respectively. The first five are for monthly calendars (with {{calendar}}); you can specify the formatting of the beginning and end of the table, and how each kind of cell (cells without a day, cells with an unlinked day, and cells with a linked day) will appear. The last two are for weekly calendars ({{calendarweek}}) and their linked or unlinked days.
$gmfonttag{{calendar}}: Beginning of table
$gmfonttag{{calendar}}: Ending of table
$gmfonttag$gmfonttag
$gmfonttag{{calendar}}:
Blank cell
$gmfonttag{{calendar}}:
Day cell without link
$gmfonttag{{calendar}}:
Day cell with link
$gmfonttag$gmfonttag$gmfonttag
$gmfonttag{{calendarweek}}: Day without link
$gmfonttag{{calendarweek}}: Day with link
$gmfonttag$gmfonttag
 
$gmfonttag{{popup}} Templates
These templates control the code associated with the {{popup}} variable for making popup windows; the Popup Code template is for the code that calls the window, and the Popup Window template is for the HTML file to be generated for the window. (The popup-related variables—{{popuptitle}} etc.—will only work in these two templates.)
$gmfonttagPopup Code Template
$gmfonttagPopup Window Template
$gmfonttag$gmfonttag
 
$gmfonttagLine & Paragraph Separators
The line separator is whatever will be inserted whenever there's a line break in the body of an entry's text; the paragraph separator is used for a double-line break (a paragraph break). These apply both to entries and to comments.
$gmfonttagLine Separator
$gmfonttagParagraph Separator
$gmfonttag$gmfonttag
 
$gmfonttag{{morepreface}} And {{morelink}} Templates (no longer recommended)
Meant for use in the Index and Log Archive Entry templates, to specify links or other text/code to appear only for extended entries. These are no longer recommended for use; it's simpler and more flexible now to distinguish standard and extended entries with their separate templates, so these are no longer necessary (but are kept here for compatibility purposes).
$gmfonttag{{morepreface}} Template
$gmfonttag{{morelink}} Template
$gmfonttag$gmfonttag
$autorebuildcheckbox

"God does not play dice with the universe."—Albert Einstein $gmframebottom GMEDITMISCTEMPLATES $statusnote = ""; exit; } # ------------------------- # save the template changes # ------------------------- sub gm_savetemplatechanges { &gm_validate; if ($gmtemplateaccess eq "no") { &gm_writetocplog("$IN{'authorname'} attempted to edit the templates without authorization"); $statusnote = qq(You don't have access to edit the templates.

); &gm_frontpage; } $IN{'newindextemplate'} = &relouse($IN{'newindextemplate'}); $IN{'newentrypagetemplate'} = &relouse($IN{'newentrypagetemplate'}); $IN{'newarchiveindextemplate'} = &relouse($IN{'newarchiveindextemplate'}); $IN{'newarchiveentrypagetemplate'} = &relouse($IN{'newarchiveentrypagetemplate'}); $IN{'newentrytemplate'} = &relouse($IN{'newentrytemplate'}); $IN{'newarchiveentrytemplate'} = &relouse($IN{'newarchiveentrytemplate'}); $IN{'newstayattoptemplate'} = &relouse($IN{'newstayattoptemplate'}); $IN{'newdatetemplate'} = &relouse($IN{'newdatetemplate'}); $IN{'newcommentstemplate'} = &relouse($IN{'newcommentstemplate'}); $IN{'newcommentsformtemplate'} = &relouse($IN{'newcommentsformtemplate'}); $IN{'newparaseparationtemplate'} = &relouse($IN{'newparaseparationtemplate'}); $IN{'newkarmaformtemplate'} = &relouse($IN{'newkarmaformtemplate'}); $IN{'newmoreprefacetemplate'} = &relouse($IN{'newmoreprefacetemplate'}); $IN{'newmorelinktemplate'} = &relouse($IN{'newmorelinktemplate'}); $IN{'newkarmalinktemplate'} = &relouse($IN{'newkarmalinktemplate'}); $IN{'newcommentslinktemplate'} = &relouse($IN{'newcommentslinktemplate'}); $IN{'newcommentauthoremailtemplate'} = &relouse($IN{'newcommentauthoremailtemplate'}); $IN{'newcommentauthorhomepagetemplate'} = &relouse($IN{'newcommentauthorhomepagetemplate'}); $IN{'newcommentdividertemplate'} = &relouse($IN{'newcommentdividertemplate'}); $IN{'newmoreentrytemplate'} = &relouse($IN{'newmoreentrytemplate'}); $IN{'newmoreentrypagetemplate'} = &relouse($IN{'newmoreentrypagetemplate'}); $IN{'newmorearchiveentrypagetemplate'} = &relouse($IN{'newmorearchiveentrypagetemplate'}); $IN{'newpreviouslinktemplate'} = &relouse($IN{'newpreviouslinktemplate'}); $IN{'newnextlinktemplate'} = &relouse($IN{'newnextlinktemplate'}); $IN{'newpreviousmorelinktemplate'} = &relouse($IN{'newpreviousmorelinktemplate'}); $IN{'newnextmorelinktemplate'} = &relouse($IN{'newnextmorelinktemplate'}); $IN{'newarchivemasterindextemplate'} = &relouse($IN{'newarchivemasterindextemplate'}); $IN{'newlogarchiveslinktemplate'} = &relouse($IN{'newlogarchiveslinktemplate'}); $IN{'newentrypagelinktemplate'} = &relouse($IN{'newentrypagelinktemplate'}); $IN{'newmoreentrypagelinktemplate'} = &relouse($IN{'newmoreentrypagelinktemplate'}); $IN{'newlogarchiveslinkseparatortemplate'} = &relouse($IN{'newlogarchiveslinkseparatortemplate'}); $IN{'newentrypagelinkseparatortemplate'} = &relouse($IN{'newentrypagelinkseparatortemplate'}); $IN{'newentrypagelinkmonthseparatortemplate'} = &relouse($IN{'newentrypagelinkmonthseparatortemplate'}); $IN{'newentrypagelinkdayseparatortemplate'} = &relouse($IN{'newentrypagelinkdayseparatortemplate'}); $IN{'newentrypagelinkyearseparatortemplate'} = &relouse($IN{'newentrypagelinkyearseparatortemplate'}); $IN{'newheadertemplate'} = &relouse($IN{'newheadertemplate'}); $IN{'newfootertemplate'} = &relouse($IN{'newfootertemplate'}); $IN{'newsidebartemplate'} = &relouse($IN{'newsidebartemplate'}); $IN{'newcustomlinktemplate'} = ""; $IN{'newentryseparatortemplate'} = &relouse($IN{'newentryseparatortemplate'}); $IN{'newarchiveentryseparatortemplate'} = &relouse($IN{'newarchiveentryseparatortemplate'}); $IN{'newmorearchiveentrytemplate'} = &relouse($IN{'newmorearchiveentrytemplate'}); $IN{'newdatearchivetemplate'} = &relouse($IN{'newdatearchivetemplate'}); $IN{'newlogarchiveslinkweeklytemplate'} = &relouse($IN{'newlogarchiveslinkweeklytemplate'}); $IN{'newcustomonetemplate'} = &relouse($IN{'newcustomonetemplate'}); $IN{'newcustomtwotemplate'} = &relouse($IN{'newcustomtwotemplate'}); $IN{'newcustomthreetemplate'} = &relouse($IN{'newcustomthreetemplate'}); $IN{'newcustomfourtemplate'} = &relouse($IN{'newcustomfourtemplate'}); $IN{'newcustomfivetemplate'} = &relouse($IN{'newcustomfivetemplate'}); $IN{'newcustomsixtemplate'} = &relouse($IN{'newcustomsixtemplate'}); $IN{'newcustomseventemplate'} = &relouse($IN{'newcustomseventemplate'}); $IN{'newcustomeighttemplate'} = &relouse($IN{'newcustomeighttemplate'}); $IN{'newcustomninetemplate'} = &relouse($IN{'newcustomninetemplate'}); $IN{'newcustomtentemplate'} = &relouse($IN{'newcustomtentemplate'}); $IN{'newpopuppagetemplate'} = &relouse($IN{'newpopuppagetemplate'}); $IN{'newpopupcodetemplate'} = &relouse($IN{'newpopupcodetemplate'}); $IN{'newsearchformtemplate'} = &relouse($IN{'newsearchformtemplate'}); $IN{'newsearchresultspagetemplate'} = &relouse($IN{'newsearchresultspagetemplate'}); $IN{'newsearchresultsentrytemplate'} = &relouse($IN{'newsearchresultsentrytemplate'}); $IN{'newcalendartablebeginningtemplate'} = &relouse($IN{'newcalendartablebeginningtemplate'}); $IN{'newcalendartableendingtemplate'} = &relouse($IN{'newcalendartableendingtemplate'}); $IN{'newcalendarblankcelltemplate'} = &relouse($IN{'newcalendarblankcelltemplate'}); $IN{'newcalendarfullcelltemplate'} = &relouse($IN{'newcalendarfullcelltemplate'}); $IN{'newcalendarfullcelllinktemplate'} = &relouse($IN{'newcalendarfullcelllinktemplate'}); $IN{'newcalendarweekblankdaytemplate'} = ""; $IN{'newcalendarweekfulldaytemplate'} = &relouse($IN{'newcalendarweekfulldaytemplate'}); $IN{'newcalendarweekfulldaylinktemplate'} = &relouse($IN{'newcalendarweekfulldaylinktemplate'}); $IN{'newcommentpreviewdividertemplate'} = &relouse($IN{'newcommentpreviewdividertemplate'}); $IN{'newcommentpreviewformtemplate'} = &relouse($IN{'newcommentpreviewformtemplate'}); $IN{'newsmartlinknocommentstemplate'} = &relouse($IN{'newsmartlinknocommentstemplate'}); $IN{'newsmartlinkonecommenttemplate'} = &relouse($IN{'newsmartlinkonecommenttemplate'}); $IN{'newsmartlinkmanycommentstemplate'} = &relouse($IN{'newsmartlinkmanycommentstemplate'}); $IN{'newlinebreaktemplate'} = &relouse($IN{'newlinebreaktemplate'}); if (($IN{'newcustomlinktemplate'} ne "") && ((substr($IN{'newcustomlinktemplate'}, 0, 1)) ne " ")) { $IN{'newcustomlinktemplate'} = " $IN{'newcustomlinktemplate'}"; } if ($IN{'entrylistingmorecheck'} eq "yes") { $IN{'newmoreentrytemplate'} = $IN{'newentrytemplate'}; } if ($IN{'entrylistingstayattopcheck'} eq "yes") { $IN{'newstayattoptemplate'} = $IN{'newentrytemplate'}; } if ($IN{'archivelogindexcheck'} eq "yes") { $IN{'newarchiveindextemplate'} = $IN{'newindextemplate'}; } if ($IN{'archiveentrylistingcheck'} eq "yes") { $IN{'newarchiveentrytemplate'} = $IN{'newentrytemplate'}; } if ($IN{'archiveentrylistingmorecheck'} eq "yes") { $IN{'newmorearchiveentrytemplate'} = $IN{'newmoreentrytemplate'}; } if ($IN{'archivedateheadercheck'} eq "yes") { $IN{'newdatearchivetemplate'} = $IN{'newdatetemplate'}; } if ($IN{'archiveentryseparatorcheck'} eq "yes") { $IN{'newarchiveentryseparatortemplate'} = $IN{'newentryseparatortemplate'}; } if ($IN{'entrymorepagecheck'} eq "yes") { $IN{'newmoreentrypagetemplate'} = $IN{'newentrypagetemplate'}; } if ($IN{'entryarchivepagecheck'} eq "yes") { $IN{'newarchiveentrypagetemplate'} = $IN{'newentrypagetemplate'}; } if ($IN{'entrymorearchivepagecheck'} eq "yes") { $IN{'newmorearchiveentrypagetemplate'} = $IN{'newarchiveentrypagetemplate'}; } if ($IN{'previousmorelinkcheck'} eq "yes") { $IN{'newpreviousmorelinktemplate'} = $IN{'newpreviouslinktemplate'}; } if ($IN{'nextmorelinkcheck'} eq "yes") { $IN{'newnextmorelinktemplate'} = $IN{'newnextlinktemplate'}; } if ($IN{'moreentrylistlinkcheck'} eq "yes") { $IN{'newmoreentrypagelinktemplate'} = $IN{'newentrypagelinktemplate'}; } open (FUNNYFEETRELEASE, ">gm-templates.cgi") || &gm_dangermouse("Can't write the templates file. Please make sure that gm-templates.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); print FUNNYFEETRELEASE "$IN{'newindextemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newentrypagetemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newarchiveindextemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newarchiveentrypagetemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newentrytemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newarchiveentrytemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newstayattoptemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newdatetemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcommentstemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcommentsformtemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newparaseparationtemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newkarmaformtemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newmoreprefacetemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newmorelinktemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newkarmalinktemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcommentslinktemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcommentauthoremailtemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcommentauthorhomepagetemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcommentdividertemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newmoreentrytemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newmoreentrypagetemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newmorearchiveentrypagetemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newpreviouslinktemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newnextlinktemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newpreviousmorelinktemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newnextmorelinktemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newarchivemasterindextemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newlogarchiveslinktemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newentrypagelinktemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newmoreentrypagelinktemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newlogarchiveslinkseparatortemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newentrypagelinkseparatortemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newentrypagelinkmonthseparatortemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newentrypagelinkdayseparatortemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newentrypagelinkyearseparatortemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newheadertemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newfootertemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newsidebartemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcustomlinktemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newentryseparatortemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newarchiveentryseparatortemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newmorearchiveentrytemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newdatearchivetemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newlogarchiveslinkweeklytemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcustomonetemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcustomtwotemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcustomthreetemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcustomfourtemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcustomfivetemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcustomsixtemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcustomseventemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcustomeighttemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcustomninetemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcustomtentemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newpopuppagetemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newpopupcodetemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newsearchformtemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newsearchresultspagetemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newsearchresultsentrytemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcalendartablebeginningtemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcalendartableendingtemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcalendarblankcelltemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcalendarfullcelltemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcalendarfullcelllinktemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcalendarweekblankdaytemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcalendarweekfulldaytemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcalendarweekfulldaylinktemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcommentpreviewdividertemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newcommentpreviewformtemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newsmartlinknocommentstemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newsmartlinkonecommenttemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newsmartlinkmanycommentstemplate'}\n"; print FUNNYFEETRELEASE "$IN{'newlinebreaktemplate'}\n"; close (FUNNYFEETRELEASE); $statusnote = qq(The $IN{'modifiedtemplategroup'} templates have been modified. Be sure to rebuild
your files to make these changes take effect throughout your site.

); &gm_writetocplog("$IN{'authorname'} modified the $IN{'modifiedtemplategroup'} templates"); if ($IN{'autorebuild'} eq "index") { &gm_rebuildmainindexfile; } if ($IN{'autorebuild'} eq "archiveindexes") { &gm_rebuildarchivelogindexes; } if ($IN{'autorebuild'} eq "entrypages") { &gm_rebuildallentrypages; } if ($IN{'autorebuild'} eq "everything") { &gm_rebuildeverything; } &gm_edittemplates; } # --------------------------- # view the greymatter logfile # --------------------------- sub gm_viewcplog { &gm_validate; if ($gmcplogaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to view the control panel log without authorization"); $statusnote = qq(You don't have access to view the control panel log.

); &gm_frontpage; } if ($statusnote eq "") { $statusnote = qq(Control Panel Log

); } print< GMVIEWLOGTOP open (FUNNYFEET, "gm-cplog.cgi"); @gmlogfile = ; close (FUNNYFEET); foreach $gmlogfileline (@gmlogfile) { chomp ($gmlogfileline); print "$gmlogfileline
"; } &date; &gm_readcounter; if ($newentrynumber ne "0") { $newalltimetotalkarmanumber = $newalltimepktotalnumber - $newalltimenktotalnumber; $newalltimetotalkarmavotes = $newalltimepktotalnumber + $newalltimenktotalnumber; $entriesonmainnumber = $newentrynumber - $newarchivenumber; $karmavotesonaverage = sprintf("%.1f", ($newalltimetotalkarmavotes / $newentrynumber)); $commentspostedonaverage = sprintf("%.1f", ($newalltimecommentstotalnumber / $newentrynumber)); } else { $newalltimetotalkarmanumber = 0; $newalltimetotalkarmavotes = 0; $entriesonmainnumber = 0; $karmavotesonaverage = 0; $commentspostedonaverage = 0; } print<
$gmfonttag Site Stats as of $basedate

$newentrynumber entries currently online ($newalltimeopenentriesnumber open and $newalltimeclosedentriesnumber closed) with $newarchivenumber archived and $entriesonmainnumber marked as current
$newalltimetotalkarmavotes karma votes cast ($karmavotesonaverage on average per entry) with $newalltimepktotalnumber positive and $newalltimenktotalnumber negative for a total karma rating of $newalltimetotalkarmanumber
$newalltimecommentstotalnumber total comments posted ($commentspostedonaverage on average per entry)

"When stepping into the stream of consciousness, don't slip on the rocks."
—Siddharta Gautama (the Buddha)
$gmframebottom GMVIEWLOGBOTTOM exit; } # ---------------------------- # clear the greymatter logfile # ---------------------------- sub gm_resetcplog { &gm_validate; if ($gmcplogaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to clear the control panel log without authorization"); $statusnote = qq(You don't have access to clear the control panel log.

); &gm_frontpage; } open (FUNNYFEET, ">gm-cplog.cgi") || &gm_dangermouse("Can't write to the control panel log. Please make sure that gm-cplog.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); print FUNNYFEET ""; close (FUNNYFEET); &gm_writetocplog("$IN{'authorname'} cleared this control panel log"); $statusnote = qq(The control panel log has been cleared.

); &gm_frontpage; } # -------------- # authors editor # -------------- sub gm_editauthors { &gm_validate; if ($gmauthoraccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to edit the authors without authorization"); $statusnote = qq(You don't have access to edit the authors.

); &gm_frontpage; } if ($statusnote eq "") { $statusnote = qq(Author Panel
Select an author to edit their information and/or access, or to delete them altogether.

); } open (FUNNYFEET, "gm-authors.cgi") || &gm_dangermouse("Can't read the authors file. Please make sure that gm-authors.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); @gmauthordata = ; close (FUNNYFEET); print<
GMEDITAUTHORBEGINNING $alicewarning = ""; $alternateauthorrowone = "#EEF8FF"; $alternateauthorrowtwo = "#F8F8FF"; $alternateauthorrow = $alternateauthorrowone; foreach $gmauthordataline (@gmauthordata) { if ($alternateauthorrow eq $alternateauthorrowone) { $alternateauthorrow = $alternateauthorrowtwo; } else { $alternateauthorrow = $alternateauthorrowone; } chomp ($gmauthordataline); @gmauthorinfo = split (/\|/, $gmauthordataline); if (($gmauthorinfo[0] eq "Alice") && ($gmauthorinfo[1] eq "woCCASD0Wk0IA")) { $alicewarning = "

Be sure to create your own author and delete Alice!" } print qq(

); if ($gmauthorinfo[6] eq "Y") { print qq(); } else { print qq(); } if ($gmauthorinfo[7] eq "Y") { print qq(); } elsif ($gmauthorinfo[7] eq "O") { print qq(); } else { print qq(); } if ($gmauthorinfo[8] eq "Y") { print qq(); } else { print qq(); } if ($gmauthorinfo[9] eq "Y") { print qq(); } elsif ($gmauthorinfo[9] eq "O") { print qq(); } else { print qq(); } if ($gmauthorinfo[10] eq "Y") { print qq(); } else { print qq(); } if ($gmauthorinfo[11] eq "Y") { print qq(); } else { print qq(); } if ($gmauthorinfo[12] eq "Y") { print qq(); } else { print qq(); } if ($gmauthorinfo[13] eq "Y") { print qq(); } else { print qq(); } if ($gmauthorinfo[14] eq "Y") { print qq(); } else { print qq(); } if ($gmauthorinfo[15] eq "Y") { print qq(); } else { print qq(); } print "\n"; } print<
$gmfonttag Select$gmfonttagAuthor
Name
$gmfonttagCan
post?
$gmfonttagCan
edit?
$gmfonttagCan
config?
$gmfonttagEdit
temp's?
$gmfonttagEdit
auth's?
$gmfonttagCan
reb'ld?
$gmfonttagView
CP log?
$gmfonttagUse
b'lets?
$gmfonttagUpload
files?
$gmfonttagCan
login?
$gmfonttag$gmauthorinfo[0]$gmfonttag Yes$gmfonttag No$gmfonttag Yes$gmfonttag Own$gmfonttag No$gmfonttag Yes$gmfonttag No$gmfonttag Yes$gmfonttag HFS$gmfonttag No$gmfonttag Yes$gmfonttag No$gmfonttag Yes$gmfonttag No$gmfonttag Yes$gmfonttag No$gmfonttag Yes$gmfonttag No$gmfonttag Yes$gmfonttag No$gmfonttag Yes$gmfonttag No

$alicewarning

$gmfonttagRegister A New Author
Create a new account for someone to have access to Greymatter with (giving an e-mail or homepage is optional). You can specify whether the author is created having access to everything, to nothing, or to post & edit their own entries only; you can then customise their access further by editing their account above after it's been created.

Name:     Password:

E-Mail:     Homepage:

Default Author Access
All access   No access
Post & edit their own entries only

"All the world is queer save me and thee; and sometimes I think thee is a little queer."—old Quaker saying $gmframebottom GMEDITAUTHORSBOTTOM $statusnote = ""; exit; } # ------------------- # create a new author # ------------------- sub gm_createnewauthor { &gm_validate; if ($gmauthoraccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to create a new author without authorization"); $statusnote = qq(You don't have access to create a new author.

); &gm_frontpage; } if (($IN{'newauthorname'} eq "") || ($IN{'newauthorpassword'} eq "")) { $statusnote = qq(You left either the name or password fields blank. Please try again.

); &gm_editauthors; } if (($IN{'newauthorname'} =~ /^\s+/) || ($IN{'newauthorpassword'} =~ /^\s+/) || ($IN{'newauthorname'} =~ /\s+$/) || ($IN{'newauthorpassword'} =~ /\s+$/)) { $statusnote = qq(You cannot have a space at the beginning or end
of the author name or password. Please try again.

); &gm_editauthors; } $IN{'newauthorname'} =~ s/ /THISISASPACE/g; $IN{'newauthorpassword'} =~ s/ /THISISASPACE/g; if (($IN{'newauthorname'} =~ /\W/) || ($IN{'newauthorpassword'} =~ /\W/)) { $statusnote = qq(The author name or password cannot contain non-alphanumeric characters
(characters other than letters, numbers or spaces). Please try again.

); &gm_editauthors; } $IN{'newauthorname'} =~ s/THISISASPACE/ /g; $IN{'newauthorpassword'} =~ s/THISISASPACE/ /g; $IN{'newauthoremail'} =~ s/^\s+//; $IN{'newauthoremail'} =~ s/\s+$//; $IN{'newauthorhomepage'} =~ s/^\s+//; $IN{'newauthorhomepage'} =~ s/\s+$//; if ($IN{'newauthorhomepage'} eq "http://") { $IN{'newauthorhomepage'} = ""; } open (FUNNYFEET, "gm-authors.cgi") || &gm_dangermouse("Can't read the authors file. Please make sure that gm-authors.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); @gmauthordata = ; close (FUNNYFEET); foreach $gmauthordataline (@gmauthordata) { chomp ($gmauthordataline); @gmauthorinfo = split (/\|/, $gmauthordataline); if ($IN{'newauthorname'} eq $gmauthorinfo[0]) { &gm_writetocplog("$IN{'authorname'} attempted to add an author that is already registered ($IN{'newauthorname'})"); $statusnote = qq(That author is already registered.

); &gm_editauthors; } } $temphomepageprefix = substr($IN{'newauthorhomepage'}, 0, 7); if ($temphomepageprefix ne "http://") { $IN{'newauthorhomepage'} = "http://$IN{'newauthorhomepage'}"; } if ($IN{'newauthorhomepage'} eq "http://") { $IN{'newauthorhomepage'} = ""; } &date; # Encrypt the password before writing it to the gm-authors.cgi file $IN{'newauthorpassword'} = crypt($IN{'newauthorpassword'},$IN{'newauthorpassword'}); if ($IN{'newauthoraccess'} eq "all") { $newauthorline = "$IN{'newauthorname'}|$IN{'newauthorpassword'}|$IN{'newauthoremail'}|$IN{'newauthorhomepage'}|$montwo\/$mdaytwo\/$JSYear|0|Y|Y|Y|Y|Y|Y|Y|Y|Y|Y"; } elsif ($IN{'newauthoraccess'} eq "postedit") { $newauthorline = "$IN{'newauthorname'}|$IN{'newauthorpassword'}|$IN{'newauthoremail'}|$IN{'newauthorhomepage'}|$montwo\/$mdaytwo\/$JSYear|0|Y|O|N|N|N|N|N|Y|N|Y"; } else { $newauthorline = "$IN{'newauthorname'}|$IN{'newauthorpassword'}|$IN{'newauthoremail'}|$IN{'newauthorhomepage'}|$montwo\/$mdaytwo\/$JSYear|0|N|N|N|N|N|N|N|N|N|N"; } open (FUNNYFEET, ">>gm-authors.cgi") || &gm_dangermouse("Can't write to the authors file. Please make sure that gm-authors.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); print FUNNYFEET "$newauthorline\n"; close (FUNNYFEET); open (FUNNYFEET, "gm-authors.cgi") || &gm_dangermouse("Can't read the authors file. Please make sure that gm-authors.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); @gmauthordata = ; close (FUNNYFEET); @gmauthordatasorted = sort { lc($a) cmp lc ($b) } @gmauthordata; open (FUNNYFEET, ">gm-authors.cgi") || &gm_dangermouse("Can't write to the authors file. Please make sure that gm-authors.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); foreach $gmauthordataline (@gmauthordatasorted) { chomp ($gmauthordataline); print FUNNYFEET "$gmauthordataline\n"; } close (FUNNYFEET); &gm_writetocplog("$IN{'authorname'} registered a new author ($IN{'newauthorname'})"); $statusnote = qq($IN{'newauthorname'} has been added to the author database.

); &gm_editauthors; } # ---------------- # delete an author # ---------------- sub gm_deleteselectedauthor { &gm_validate; if ($gmauthoraccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to delete an author ($IN{'selectedauthor'}) without authorization"); $statusnote = qq(You don't have access to delete authors.

); &gm_frontpage; } open (FUNNYFEET, "gm-authors.cgi") || &gm_dangermouse("Can't read the authors file. Please make sure that gm-authors.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); @gmauthordata = ; close (FUNNYFEET); $authorfound = "no"; foreach $gmauthordataline (@gmauthordata) { chomp ($gmauthordataline); @gmauthorinfo = split (/\|/, $gmauthordataline); if ($IN{'selectedauthor'} eq $gmauthorinfo[0]) { $authorfound = "yes"; } } if ($authorfound ne "yes") { $statusnote = qq(You must select an author first.

); &gm_editauthors; } $authoramount = scalar(@gmauthordata); if ($authoramount eq "1") { $statusnote = qq(You can't delete the only remaining author!

); &gm_editauthors; } open (FUNNYFEET, ">gm-authors.cgi") || &gm_dangermouse("Can't write to the authors file. Please make sure that gm-authors.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); foreach $gmauthordataline (@gmauthordata) { chomp ($gmauthordataline); @gmauthorinfo = split (/\|/, $gmauthordataline); if ($IN{'selectedauthor'} ne $gmauthorinfo[0]) { print FUNNYFEET "$gmauthordataline\n"; } } close (FUNNYFEET); if ($IN{'selectedauthor'} eq $IN{'authorname'}) { &gm_writetocplog("$IN{'authorname'} deleted himself/herself in a sudden fit of existentialism"); } else { &gm_writetocplog("$IN{'authorname'} deleted an author ($IN{'selectedauthor'})"); } if ($IN{'selectedauthor'} eq $IN{'authorname'}) { $loginnotice = qq(Please re-enter under your new author name and password.

); &gm_login; } else { $statusnote = qq($IN{'selectedauthor'} has been deleted.

); &gm_editauthors; } } # ----------------- # editing an author # ----------------- sub gm_editselectedauthor { &gm_validate; if ($gmauthoraccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to edit the authors without authorization"); $statusnote = qq(You don't have access to edit the authors.

); &gm_frontpage; } open (FUNNYFEET, "gm-authors.cgi") || &gm_dangermouse("Can't read the authors file. Please make sure that gm-authors.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); @gmauthordata = ; close (FUNNYFEET); $authorfound = "no"; $gmcounter = 0; $gmauthordatanumber = 0; foreach $gmauthordataline (@gmauthordata) { chomp ($gmauthordataline); @gmauthorinfo = split (/\|/, $gmauthordataline); if ($IN{'selectedauthor'} eq $gmauthorinfo[0]) { $gmauthordatanumber = $gmcounter; $authorfound = "yes"; } $gmcounter++; } if ($authorfound ne "yes") { $statusnote = qq(You must select an author first.

); &gm_editauthors; } @gmselectedauthorinfo = split (/\|/, $gmauthordata[$gmauthordatanumber]); if ($gmselectedauthorinfo[3] eq "") { $gmselectedauthorinfo[3] = "http://"; } if ($statusnote eq "") { $statusnote = qq(Editing $gmselectedauthorinfo[0]'s Info & Access

); } print<
GMEDITSELECTEDAUTHORTOP print qq(); if ($gmselectedauthorinfo[6] eq "Y") { print qq(\n); } else { print qq(\n); } print qq(); if ($gmselectedauthorinfo[7] eq "Y") { print qq(\n); } elsif ($gmselectedauthorinfo[7] eq "O") { print qq(\n); } else { print qq(\n); } print qq(); if ($gmselectedauthorinfo[8] eq "Y") { print qq(\n); } else { print qq(\n); } print qq(); if ($gmselectedauthorinfo[9] eq "Y") { print qq(\n); } elsif ($gmselectedauthorinfo[9] eq "O") { print qq(\n); } else { print qq(\n); } print qq(); if ($gmselectedauthorinfo[10] eq "Y") { print qq(\n); } else { print qq(\n); } print qq(); if ($gmselectedauthorinfo[11] eq "Y") { print qq(\n); } else { print qq(\n); } print qq(); if ($gmselectedauthorinfo[12] eq "Y") { print qq(\n); } else { print qq(\n); } print qq(); if ($gmselectedauthorinfo[13] eq "Y") { print qq(\n); } else { print qq(\n); } print qq(); if ($gmselectedauthorinfo[14] eq "Y") { print qq(\n); } else { print qq(\n); } print qq(); if ($gmselectedauthorinfo[15] eq "Y") { print qq(\n); } else { print qq(\n); } print<
$gmfonttag Name:
$gmfonttag Password:
$gmfonttag E-Mail:
$gmfonttag Homepage:
$gmfonttag Can post new entries?:$gmfonttag Yes No
$gmfonttag Yes No
$gmfonttag Can edit entries?:$gmfonttag Yes No
Only their own entries
$gmfonttag Yes No
Only their own entries
$gmfonttag Yes No
Only their own entries
$gmfonttag Can configure?:$gmfonttag Yes No
$gmfonttag Yes No
$gmfonttag Can edit templates?:$gmfonttag Yes No
Only header/footer/sidebar
$gmfonttag Yes No
Only header/footer/sidebar
$gmfonttag Yes No
Only header/footer/sidebar
$gmfonttag Can edit authors?:$gmfonttag Yes No
$gmfonttag Yes No
$gmfonttag Can rebuild files?:$gmfonttag Yes No
$gmfonttag Yes No
$gmfonttag Can view CP log?:$gmfonttag Yes No
$gmfonttag Yes No
$gmfonttag Can use bookmarklets?:$gmfonttag Yes No
$gmfonttag Yes No
$gmfonttag Can upload files?:$gmfonttag Yes No
$gmfonttag Yes No
$gmfonttag Can login to gm.cgi?:$gmfonttag Yes No
$gmfonttag Yes No

"I always wanted to be somebody, but I should have been more specific."—Lily Tomlin $gmframebottom GMEDITSELECTEDAUTHORBOTTOM exit; } # ------------------------- # save changes to an author # ------------------------- sub gm_saveauthorchanges { &gm_validate; if ($gmauthoraccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to modify an author ($IN{'authororiginalname'}) without authorization"); $statusnote = qq(You don't have access to delete authors.

); &gm_frontpage; } $IN{'editedname'} =~ s/\|//g; $IN{'editedpassword'} =~ s/\|//g; $IN{'editedemail'} =~ s/\|//g; $IN{'editedhomepage'} =~ s/\|//g; $IN{'editedname'} =~ s/^\s+//; $IN{'editedname'} =~ s/\s+$//; $IN{'editedpassword'} =~ s/^\s+//; $IN{'editedpassword'} =~ s/\s+$//; if (($IN{'editedname'} eq "") || ($IN{'editedpassword'} eq "")) { $statusnote = qq(You left either the name or password fields blank. Please try again.

); &gm_editauthors; } open (FUNNYFEET, "gm-authors.cgi") || &gm_dangermouse("Can't read the authors file. Please make sure that gm-authors.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); @gmauthordata = ; close (FUNNYFEET); $gmnamesduplicate = "no"; foreach $gmauthordataline (@gmauthordata) { @gmauthordatainfo = split (/\|/, $gmauthordataline); if (($IN{'authororiginalname'} ne $IN{'editedname'}) && ($gmauthordatainfo[0] eq $IN{'editedname'})) { &gm_writetocplog("$IN{'authorname'} attempted to add a duplicate of $IN{'editedname'} via $IN{'authororiginalname'}"); $statusnote = qq(You can't add a duplicate of another author.

); &gm_editauthors; } } if (($IN{'editedname'} ne $IN{'authororiginalname'}) && ($keeplog eq "yes")) { if ($IN{'authorname'} eq $IN{'authororiginalname'}) { &gm_writetocplog("$IN{'authorname'} changed his/her own name to $IN{'editedname'}"); } else { &gm_writetocplog("$IN{'authorname'} changed $IN{'authororiginalname'}'s name to $IN{'editedname'}"); } } $temphomepageprefix = substr($IN{'editedhomepage'}, 0, 7); if ($temphomepageprefix ne "http://") { $IN{'editedhomepage'} = "http://$IN{'editedhomepage'}"; } if ($IN{'editedhomepage'} eq "http://") { $IN{'editedhomepage'} = ""; } open (FUNNYFEET, ">gm-authors.cgi") || &gm_dangermouse("Can't write to the authors file. Please make sure that gm-authors.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); foreach $gmauthordataline (@gmauthordata) { chomp ($gmauthordataline); @gmauthorinfo = split (/\|/, $gmauthordataline); # Encrypt password if it has been changed before writing to the file unless ($IN{'editedpassword'} eq $IN{'authororiginalpassword'}) { $IN{'editedpassword'} = crypt($IN{'editedpassword'},$IN{'editedpassword'}); } if ($IN{'authororiginalname'} ne $gmauthorinfo[0]) { print FUNNYFEET "$gmauthordataline\n"; } else { print FUNNYFEET "$IN{'editedname'}|$IN{'editedpassword'}|$IN{'editedemail'}|$IN{'editedhomepage'}|$IN{'authororiginaldate'}|$IN{'authororiginalentries'}|$IN{'editedentryaccess'}|$IN{'editedentryeditaccess'}|$IN{'editedconfigureaccess'}|$IN{'editedtemplateaccess'}|$IN{'editedauthoraccess'}|$IN{'editedrebuildaccess'}|$IN{'editedcplogaccess'}|$IN{'editedbookmarkletaccess'}|$IN{'editeduploadaccess'}|$IN{'editedloginaccess'}\n"; } } close (FUNNYFEET); if ($IN{'authororiginalname'} eq $IN{'authorname'}) { $IN{'authorname'} = $IN{'editedname'}; $IN{'authorpassword'} = $IN{'editedpassword'}; } if ($IN{'authorname'} eq $IN{'editedname'}) { &gm_writetocplog("$IN{'authorname'} edited his/her own info/access"); } else { &gm_writetocplog("$IN{'authorname'} edited $IN{'editedname'}'s info/access"); } $statusnote = qq($IN{'editedname'}'s info/access has been edited.

); &gm_editauthors; } # ------------------ # configuration menu # ------------------ sub gm_configuration { &gm_validate; if ($gmconfigurationaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to configure this program without authorization"); $statusnote = qq(You don't have access to configure this program.

); &gm_frontpage; } &gm_readconfig; &date; $censorlist = &delouse($censorlist); $otherfilelist = &delouse($otherfilelist); if ($statusnote eq "") { $statusnote = qq(Configuration Options

); } print<
$gmfonttagPath Configuration
Your paths tell Greymatter where to look for things on your site; local paths are relative to your server, and the website paths are their respective pointers on the web. Each of these paths MUST be correctly set for Greymatter to work correctly; if you can't seem to set them right, use virtual paths (with "." and "../") instead; read the Troubleshooting section of the manual for more information. It's a good idea to run "Diagnostics & Repair" after saving changes to your paths.
$gmfonttagLocal Log Path:
The main weblog/journal directory on your account, where your main index file is.
$gmfonttag
$gmfonttagLocal Entries/Archives Path:
The directory on your account where your entry files (current and archived) are to be stored.
$gmfonttag
$gmfonttagLocal CGI Path:
The place on your account where you keep all your Greymatter CGI files ("gm*.cgi").
$gmfonttag
$gmfonttagWebsite Log Path:
The website address of the directory where your main index file is.
$gmfonttag
$gmfonttagWebsite Entries Path:
The website address of the directory where all your entries are to be stored.
$gmfonttag
$gmfonttagWebsite CGI Path:
The website address of the directory where all your Greymatter CGI files are kept.
$gmfonttag

GMCONFIGMENUTOP print qq(); if ($generateentrypages eq "yes") { print qq(\n); } else { print qq(\n); } print qq(); if ($keeparchivemasterindex eq "yes") { print qq(\n); } else { print qq(\n); } print qq(); if ($keepmonthlyarchives eq "yes") { print qq(\n); } else { print qq(\n); } print qq(); if ($concurrentmainandarchives eq "yes") { print qq(\n); } else { print qq(\n); } print qq(); if ($archiveformat eq "week") { print qq(\n); } else { print qq(\n); } print qq(
$gmfonttagIndex & Archive Options
Options relating to your main index and your archives.
$gmfonttagIndex filename:
The filename of your log/journal's main index. If you enable "Keep archive master index", Greymatter will create that file in the archives directory with the same filename.
$gmfonttag
$gmfonttag.suffix to entry files:
If you have "Generate pages for individual entries" enabled, this is the suffix those pages will have.
$gmfonttag
$gmfonttag.suffix to log archives:
If you have "Keep monthly/weekly log archives" enabled, this is the suffix those log archive files will have.
$gmfonttag
$gmfonttagDays to keep on main index:
The number of days' worth of entries Greymatter will list on your main index before scrolling them off.
$gmfonttag
$gmfonttagGenerate pages for individual entries?
Specifies whether you want individual entries to have their own pages. Comments are disabled if this is turned off.
$gmfonttag Yes   No
$gmfonttag Yes   No
$gmfonttagKeep archive master index?
If enabled, Greymatter will keep an index (with the same filename as above) in your entries/archives directory, intended to be an overview of all your archives.
$gmfonttag Yes   No
$gmfonttag Yes   No
$gmfonttagKeep monthly/weekly log archives?
If enabled, Greymatter will keep archive files of your log in monthly or weekly installments in your entries/archives directory.
$gmfonttag Yes   No
$gmfonttag Yes   No
$gmfonttagKeep main index and archive log
indexes concurrent with each other?

If enabled, both new and archived entries will be listed in the monthly/weekly archives; if disabled, Greymatter won't list entries there until they've scrolled off the main index. For simplicity's sake, it's a good idea leave this on.
$gmfonttag Yes   No
$gmfonttag Yes   No
$gmfonttagArchive by month or week?
If "Keep monthly/weekly log archives" is enabled, this specifies whether the log archives will be generated by the month or by the week.
$gmfonttag Monthly   Weekly
$gmfonttag Monthly   Weekly

); if ($NotifyForStatus eq "karma") { print qq(\n); } elsif ($NotifyForStatus eq "comments") { print qq(\n); } elsif ($NotifyForStatus eq "both") { print qq(\n); } else { print qq(\n); } print qq(
$gmfonttagE-Mail Options
Options relating to e-mail setup and notification. If you don't plan to have Greymatter send you e-mails, you can safely ignore the "E-Mail Program Location" and "E-Mail(s) to send notices to" fields.
$gmfonttagE-Mail Program Location:
The pointer to the mail program (usually Sendmail) on your account.
$gmfonttag
$gmfonttagE-Mail(s) to send notices to:
The e-mail addresses you want all notifications (if any) to be sent to. Separate multiple e-mail addresses with semicolons.
$gmfonttag
$gmfonttagSend e-mail notifications for:
Indicates whether you want Greymatter to send e-mails notifying you of new karma votes, new comment postings, both karma and comments, or to disable e-mail notification altogether.
$gmfonttag New karma votes   New comments
Both   Neither
$gmfonttag New karma votes   New comments
Both   Neither
$gmfonttag New karma votes   New comments
Both   Neither
$gmfonttag New karma votes   New comments
Both   Neither

); if ($allowkarmaorcomments eq "karma") { print qq(\n); } elsif ($allowkarmaorcomments eq "comments") { print qq(\n); } elsif ($allowkarmaorcomments eq "both") { print qq(\n); } else { print qq(\n); } print qq(); if ($commentsorder eq "ascending") { print qq(\n); } else { print qq(\n); } print qq(); if ($posttoarchives eq "yes") { print qq(\n); } else { print qq(\n); } print qq(); if ($allowkarmadefault eq "yes") { print qq(\n); } else { print qq(\n); } print qq(); if ($allowcommentsdefault eq "yes") { print qq(\n); } else { print qq(\n); } print qq(); if ($allowhtmlincomments eq "yes") { print qq(\n); } elsif ($allowhtmlincomments eq "linkboldital") { print qq(\n); } elsif ($allowhtmlincomments eq "linkonly") { print qq(\n); } else { print qq(\n); } print qq(); if ($autolinkurls eq "yes") { print qq(\n); } else { print qq(\n); } print qq(); if ($striplinesfromcomments eq "yes") { print qq(\n); } else { print qq(\n); } print qq(); if ($allowmultiplekarmavotes eq "yes") { print qq(\n); } else { print qq(\n); } print qq(); if ($logkarmaandcomments eq "yes") { print qq(\n); } else { print qq(\n); } print qq(
$gmfonttagKarma & Comments Options
Options relating to karma voting and comment posting. Obviously, certain options can be ignored if you have their respective functions disabled (for example, if you disable comments or have "Generate pages for individual entries" turned off, none of the options relating to comments will have any effect).
$gmfonttagAllow karma voting and/or comment posting?
Specifies whether you want to permit voting on karma, posting comments, both, or neither, on your site. You can leave them enabled and still turn karma or comments on or off for individual entries; to disable either or both will override that for ALL entries.
$gmfonttag Karma only   Comments only
Both   Neither
$gmfonttag Karma only   Comments only
Both   Neither
$gmfonttag Karma only Comments only
Both Neither
$gmfonttag Karma only   Comments only
Both   Neither
$gmfonttagOrder of comments on entry pages:
The order in which you want comments displayed. If "ascending", they'll be listed from newest to oldest, with the newest comment at the top; if "descending", from first to last, with the first comment at the top.
$gmfonttag Ascending   Descending
$gmfonttag Ascending   Descending
$gmfonttagCan post comments and vote on karma in archives?
If enabled, visitors can cast karma votes or post comments (if applicable) on entries no longer listed on the main index. Enabling this may slow down your site over time.
$gmfonttag Yes   No
$gmfonttag Yes   No
$gmfonttagKarma voting on by default?
Specifies whether "Allow karma voting on this entry" is preselected to "Yes" or "No" by default on the "Add a new entry" screen.
$gmfonttag Yes   No
$gmfonttag Yes   No
$gmfonttagComment posting on by default?
Specifies whether "Allow comments to be posted to this entry" is preselected to "Yes" or "No" by default on the "Add a new entry" screen.
$gmfonttag Yes   No
$gmfonttag Yes   No
$gmfonttagHTML allowed in comments?
Indicates whether you want to allow visitors to include HTML codes in their comments, or to have Greymatter strip them out. You can also specify whether only the codes for links, bold and italics can be included, or just the codes for links.
$gmfonttag All HTML allowed   No HTML allowed
Linking, Bold & Italic code only
Linking code only
$gmfonttag All HTML allowed   No HTML allowed
Linking, Bold & Italic code only
Linking code only
$gmfonttag All HTML allowed   No HTML allowed
Linking, Bold & Italic code only
Linking code only
$gmfonttag All HTML allowed   No HTML allowed
Linking, Bold & Italic code only
Linking code only
$gmfonttagAuto-link URLs in comments?
If enabled, Greymatter will automatically link to any website or e-mail addresses that users post in their comments (unless you've enabled linking above and they've already linked the website/e-mail address themselves).
$gmfonttag Yes   No
$gmfonttag Yes   No
$gmfonttagStrip new lines from comments?
If enabled, all line and paragraph breaks are stripped when displaying visitors' comments, turning them into unbroken blocks of text; if disabled, Greymatter preserves the visitors' original formatting.
$gmfonttag Yes   No
$gmfonttag Yes   No
$gmfonttagAllow multiple karma votes from same IP?
If enabled, the same visitor could cast multiple karma votes on the same entry; if disabled, only one vote per visitor is allowed.
$gmfonttag Yes   No
$gmfonttag Yes   No
$gmfonttagMention it in the control panel log when
comments and karma votes are added?

Enable this if you want Greymatter to mention all new comments and karma votes in the control panel log.
$gmfonttag Yes   No
$gmfonttag Yes   No

$gmfonttagDate & Time Options
Miscellaneous options regarding to dates & times. Use the wide variety date and time variables in your templates to fine-tune how you want the date and time to appear on your site.
$gmfonttagServer Offset Time:
As of this moment, Greymatter reads your time as $hour\:$mintwo $AMPM. If this is incorrect, specify the number of hours to add or subtract from this time (to subtract, make it a negative number, with a minus in front of it).
$gmfonttag
$gmfonttagYour Time Zone:
The time zone you live in. This is what will appear wherever you use the {{timezone}} variable in your templates.
$gmfonttag

$gmfonttagFile Uploading Options
Options relating to uploading files from within Greymatter.
$gmfonttagAllowed File Types:
If you only wish to allow certain types of files to be uploaded, enter their file suffixes here. Separate allowed file types by semicolons (for example, "jpg;gif;zip"). Leave this blank to allow any type of file to be uploaded.
$gmfonttag
$gmfonttagMaximum Filesize Allowed:
If you don't wish to allow files larger than a certain size to be uploaded, specify that limit here (in KB/kilobytes). Leave this on "0" to allow files of any size to be uploaded.
$gmfonttag KB

); if ($censorenabled eq "entries") { print qq(\n); } elsif ($censorenabled eq "comments") { print qq(\n); } elsif ($censorenabled eq "both") { print qq(\n); } else { print qq(\n); } print qq(
$gmfonttagCensoring Options
Words or phrases you want to censor on your site (if any), and where to censor them.
Censored terms will be turned into "*" asterisks.
$gmfonttagEnable censoring?
Specifies whether you want any words or phrases in your censor list to appear censored for entries, comments, or both. Leave it on "Neither" to disable censorship.
$gmfonttag Entries only   Comments only
Both   Neither
$gmfonttag Entries only   Comments only
Both   Neither
$gmfonttag Entries only   Comments only
Both   Neither
$gmfonttag Entries only   Comments only
Both   Neither
$gmfonttagCensor List
Enter any words or phrases you want to censor, separated by lines (press return after each word/phrase). Use [brackets] around words/phrases to censor the term only if it's not part of another word/phrase; for example, censoring the word hell would render hell as **** and shell as s****, but censoring [hell] would only turn hell by itself into asterisks, and leave the word shell alone.
$gmfonttag

); if ($otherfilelistentryrebuild eq "yes") { print qq(\n); } else { print qq(\n); } print qq(
$gmfonttagConnect Other Files (Advanced Users Only)
If you wish, you can connect other files on your account to Greymatter, and have them treated as if they were one of Greymatter's regular index files; for example, using {{header}} or {{footer}} in another file to insert your Greymatter header or footer into that file. (You'll need to edit & upload these files to your account outside Greymatter.) This is only recommended for advanced users that are already comfortable using Greymatter.
$gmfonttagFilename List
To connect a file to Greymatter, CHMOD it to 666—making sure it contains whatever Greymatter variables you wish—and enter its filename on the right; place each filename on separate lines. If the file isn't in the same directory as gm.cgi, then use virtual paths relative to where it's running from. For example, if you want to connect "test.htm" and it's in the directory above gm.cgi, you'd use ../test.htm; or, if you run gm.cgi from /here/cgi-bin and test.htm was in /there/log, you'd use ../../there/log ("../" means to go up one directory). Greymatter will automatically create a "pattern" file in your entries directory for each filename, and whenever you reupload a changed file, Greymatter will automatically update its stored pattern for that file.
$gmfonttag
$gmfonttagUpdate them when adding entries?
If "Yes", then Greymatter will automatically update any of the connected files above when new entries are added; if not, they'll only be updated whenever you rebuild them (either specifically, or by rebuilding everything).
$gmfonttag Yes   No
$gmfonttag Yes   No

\n); print LAUGHINGFEETTWO qq(\n); print LAUGHINGFEETTWO qq(\n); print LAUGHINGFEETTWO qq(\n); print LAUGHINGFEETTWO qq( [{{day}}] \n); print LAUGHINGFEETTWO qq( [{{day}}] \n); print LAUGHINGFEETTWO qq(|*||*|

|*|Previewing Your Comment|*|

|*|\n); print LAUGHINGFEETTWO qq(

|*|A preview of your new comment is shown above as it will appear on this page. Click "Post This Comment" below to post it, or click the back button on your browser to re-edit it.|*|

|*|
|*||*||*||*||*||*||*||*|

\n); print LAUGHINGFEETTWO qq(No Comments\n); print LAUGHINGFEETTWO qq(1 Comment\n); print LAUGHINGFEETTWO qq({{commentsnumber}} comments\n); print LAUGHINGFEETTWO qq(
\n); close (LAUGHINGFEETTWO); &gm_readconfig; $versionsetup = $gmversion; $cookiesallowed = "yes"; $logarchivesuffix = $entrysuffix; $censorlist = ""; $censorenabled = "neither"; $keepmonthlyarchives = "yes"; $defaultentrylistview = "main"; $linktocalendarentries = "all"; $automaticrebuilddefault = "yes"; $commententrylistonlyifokay = "yes"; $otherfilelist = ""; $otherfilelistentryrebuild = "no"; $archiveformat = "month"; $inlineformatting = "entries"; $uploadfilesallowed = ""; $uploadfilesizelimit = "0"; &gm_writeconfig; open (LAUGHINGFEETTHREE, "gm-authors.cgi") || &gm_dangermouse("Can't read the authors file. Please make sure that gm-authors.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files."); @gmauthorupgradedata = ; close (LAUGHINGFEETTHREE); open (LAUGHINGFEETFOUR, ">gm-authors.cgi") || &gm_dangermouse("Can't write to the authors file. Please make sure that gm-authors.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files."); foreach $thisupgradeauthorline (@gmauthorupgradedata) { chomp ($thisupgradeauthorline); unless ($thisupgradeauthorline eq "") { ($thisupgradeauthorname, $thisupgradeauthorpassword, $thisupgradeauthoremail, $thisupgradeauthorhomepage, $thisupgradeauthordate, $thisupgradeauthorposts, $thisupgradeauthorentryaccess, $thisupgradeauthorentryeditaccess, $thisupgradeauthorconfigurationaccess, $thisupgradeauthortemplateaccess, $thisupgradeauthorauthoraccess, $thisupgradeauthorrebuildaccess, $thisupgradeauthorcplogaccess) = split (/\|/, $thisupgradeauthorline); $thisupgradeauthorbookmarkletaccess = "N"; $thusupgradeauthoruploadaccess = "N"; $thisupgradeauthorloginaccess = "Y"; if ($thisupgradeauthorentryaccess eq "Y") { $thisupgradeauthorbookmarkletaccess = "Y"; } if ($thisupgradeauthorconfigurationaccess eq "Y") { $thisupgradeauthoruploadaccess = "Y"; } print LAUGHINGFEETFOUR "$thisupgradeauthorname|$thisupgradeauthorpassword|$thisupgradeauthoremail|$thisupgradeauthorhomepage|$thisupgradeauthordate|$thisupgradeauthorposts|$thisupgradeauthorentryaccess|$thisupgradeauthorentryeditaccess|$thisupgradeauthorconfigurationaccess|$thisupgradeauthortemplateaccess|$thisupgradeauthorauthoraccess|$thisupgradeauthorrebuildaccess|$thisupgradeauthorcplogaccess|$thisupgradeauthorbookmarkletaccess|$thisupgradeauthoruploadaccess|$thisupgradeauthorloginaccess\n"; } } close (LAUGHINGFEETFOUR); } &gm_readconfig; $versionsetup = $gmversion; &gm_writeconfig; &gm_writetocplog("$IN{'authorname'} upgraded Greymatter from an older version ($IN{'oldsetupversion'}) to a newer version ($gmversion)"); $statusnote = qq(Upgrade complete! Welcome back, $IN{'authorname'}.

); &gm_frontpage; } # ---------------------- # rebuild update process # ---------------------- sub gm_rebuildupdate { &gm_validate; if ($gmrebuildaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to rebuild files without authorization"); $statusnote = qq(You don't have access to rebuild files.

); &gm_frontpage; } $usethisauthorname = $IN{'authorname'}; $usethisauthorpassword = $IN{'authorpassword'}; $usethisauthorname =~ s/ /\+/g; $usethisauthorpassword =~ s/ /\+/g; $nowrebuild = ""; $whatimdoing = "Error"; &gm_readconfig; &gm_readcounter; &gm_readtemplates; if ($IN{'rebuildfrom'} eq "index") { &gm_generatemainindex; $whatimdoing = "Rebuilt main index. Now rebuilding log archives..."; $nowrebuild = "logarchives"; } elsif ($IN{'rebuildfrom'} eq "logarchives") { if (($newarchivenumber ne "0") || ($concurrentmainandarchives eq "yes")) { if ($keepmonthlyarchives ne "no") { if ($concurrentmainandarchives eq "yes") { $newarchivenumber = $newentrynumber; } $stoppednumber = $newarchivenumber; do { &gm_generatearchive($stoppednumber); } until $stoppednumber <= 1; &gm_readcounter; } } $whatimdoing = "Rebuilt log archives. Now rebuilding archive master index..."; $nowrebuild = "masterindex"; } elsif ($IN{'rebuildfrom'} eq "masterindex") { if (($keeparchivemasterindex eq "yes") && ($newentrynumber ne "0")) { if ($newarchivenumber ne "0") { &gm_getentryvariables($newarchivenumber); } else { &gm_getentryvariables($newentrynumber); } &gm_formatentry($gmarchivemasterindextemplate); open (THISARCHIVEFILE, ">$EntriesPath/$indexfilename") || &gm_dangermouse("Can't write to $EntriesPath/$indexfilename. Please make sure your paths are configured correctly, that the entries/archives directory is CHMODed to 777, and that $EntriesPath/$indexfilename is CHMODed to 666; also try running Diagnostics & Repair from the Configuration screen."); print THISARCHIVEFILE $entryreturn; close (THISARCHIVEFILE); chmod (0666, "$EntriesPath/$indexfilename"); } if ($otherfilelist ne "") { $whatimdoing = "Rebuilt archive master index. Now rebuilding connected files..."; $nowrebuild = "connected"; } else { $whatimdoing = "Rebuilt archive master index. Now rebuilding entry files..."; $nowrebuild = "1"; } } elsif ($IN{'rebuildfrom'} eq "connected") { if ($otherfilelist ne "") { &gm_rebuildconnectedfiles; if ($connectedfilesdone eq "yes") { $whatimdoing = "Rebuilt connected files. Now rebuilding entry files..."; $nowrebuild = "1"; if (($IN{'rebuilding'} eq "connected") || ($IN{'rebuilding'} eq "connectedaftersave")) { $nowrebuild = "done"; } } else { $connectpercentdone = int( ($IN{'connectednumber'} / $#connectedfilelist) * 100 ); $whatimdoing = "Rebuilding connected files ($connectpercentdone% done)..."; $nowrebuild = "connected"; } } else { $whatimdoing = "Now rebuilding entry files..."; $nowrebuild = "1"; } } else { unless (($IN{'rebuilding'} eq "connected") || ($IN{'rebuilding'} eq "connectedaftersave")) { if (($generateentrypages eq "yes") && ($newentrynumber ne "0")) { $currentcount = $IN{'rebuildfrom'}; $counttohere = $currentcount + 19; if ($IN{'rebuildfrom'} eq "archivefiles") { if ($counttohere > $newarchivenumber) { $counttohere = $newarchivenumber; } } else { if ($counttohere > $newentrynumber) { $counttohere = $newentrynumber; } } do { &gm_getentryvariables($currentcount); if ($thisentryopenstatus eq "open") { if ($currentcount <= $newarchivenumber) { if ($thisentrymorebody ne "") { &gm_formatentry($gmmorearchiveentrypagetemplate); } else { &gm_formatentry($gmarchiveentrypagetemplate); } } else { if ($thisentrymorebody ne "") { &gm_formatentry($gmmoreentrypagetemplate); } else { &gm_formatentry($gmentrypagetemplate); } } open (THISENTRYFILE, ">$EntriesPath/$thisentrynumberpadded.$entrysuffix") || &gm_dangermouse("Can't write to $EntriesPath/$thisentrynumberpadded.$entrysuffix. Please make sure that your entries/archives directory is correctly configured and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); print THISENTRYFILE $entryreturn; close (THISENTRYFILE); chmod (0666, "$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } else { unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } unless ($currentcount eq $counttohere) { $currentcount++; } } until $currentcount eq $counttohere; $percentdone = int( ($counttohere / $newentrynumber) * 100 ); $whatimdoing = "Rebuilt entry pages: $IN{'rebuildfrom'} to $counttohere ($percentdone% done)..."; if ($counttohere eq $newentrynumber) { &gm_getentryvariables($newentrynumber); if ($thisentryopenstatus eq "open") { if ($thisentrymorebody ne "") { &gm_formatentry($gmmoreentrypagetemplate); } else { &gm_formatentry($gmentrypagetemplate); } open (THISFILE, ">$EntriesPath/$thisentrynumberpadded.$entrysuffix") || &gm_dangermouse("Can't write to $EntriesPath/$thisentrynumberpadded.$entrysuffix. Please make sure that your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); print THISFILE $entryreturn; close (THISFILE); chmod (0666, "$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } else { unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } $nowrebuild = "done"; } else { $nowrebuild = $counttohere; } } else { $nowrebuild = "done"; } } } $metarefreshtag = qq(); if (($nowrebuild eq "") || ($nowrebuild eq "done")) { if ($IN{'rebuilding'} eq "everything") { $statusnote = qq(All the files have been rebuilt.); &gm_writetocplog("$IN{'authorname'} rebuilt all the files"); } elsif ($IN{'rebuilding'} eq "entryfiles") { $statusnote = qq(All the entry pages have been rebuilt.); &gm_writetocplog("$IN{'authorname'} rebuilt all the entry pages"); } elsif ($IN{'rebuilding'} eq "archivefiles") { $statusnote = qq(All the archive entry pages have been rebuilt.); &gm_writetocplog("$IN{'authorname'} rebuilt all the archive entry pages"); } elsif ($IN{'rebuilding'} eq "mainentries") { $statusnote = qq(All the main entry pages have been rebuilt.); &gm_writetocplog("$IN{'authorname'} rebuilt all the main entry pages"); } elsif ($IN{'rebuilding'} eq "connected") { $statusnote = qq(All the connected files have been rebuilt.); &gm_writetocplog("$IN{'authorname'} rebuilt all the connected files"); } elsif ($IN{'rebuilding'} eq "connectedaftersave") { $statusnote = qq(Your new entry has been added.); } else { $statusnote = qq(All relevant files have been rebuilt.); &gm_writetocplog("$IN{'authorname'} rebuilt unknown files"); } $whatimdoing = qq($statusnote

"Man must not demolish, but build; he must raise temples where mankind
may come and partake of the purest pleasure."—Goethe
); $metarefreshtag = ""; } if ($IN{'rebuilding'} eq "everything") { $statusnote = qq(Rebuilding Everything

); } elsif ($IN{'rebuilding'} eq "entryfiles") { $statusnote = qq(Rebuilding Entry Pages

); } elsif ($IN{'rebuilding'} eq "archivefiles") { $statusnote = qq(Rebuilding Archive Entry Pages

); } elsif ($IN{'rebuilding'} eq "mainentries") { $statusnote = qq(Rebuilding Main Entry Pages

); } elsif ($IN{'rebuilding'} eq "connected") { $statusnote = qq(Rebuilding Connected Files

); } elsif ($IN{'rebuilding'} eq "connectedaftersave") { $statusnote = qq(Rebuilding Connected Files

); } else { $statusnote = qq(Rebuilding Files

); } $gmrebuildheadtag = qq# VOX $metarefreshtag #; print< GMREBUILDUPDATE exit; }

); if ($cookiesallowed eq "yes") { print qq(\n); if ($keeplog eq "yes") { print qq(\n); } else { print qq(\n); } print qq(); if ($inlineformatting eq "entries") { print qq(\n); } elsif ($inlineformatting eq "comments") { print qq(\n); } elsif ($inlineformatting eq "both") { print qq(\n); } else { print qq(\n); } print qq(\n); if ($entrylistsortorder eq "ascending") { print qq(\n); } else { print qq(\n); } print qq(\n); print qq(); if ($commententrylistonlyifokay eq "yes") { print qq(\n); } else { print qq(\n); } print qq(); if ($linktocalendarentries eq "all") { print qq(\n); } else { print qq(\n); } print qq(); if ($automaticrebuilddefault eq "yes") { print qq(\n); } else { print qq(\n); } print<
$gmfonttagMiscellaneous Options
$gmfonttagEnable cookies?
By default, Greymatter keeps a cookie on your browser that remembers your name and password, so you don't have to type them in each time you log on. To disable and delete Greymatter's cookies, select "No" and check the checkbox.
$gmfonttag Yes   No); } else { print qq($gmfonttag Yes   No); } print qq(
Delete cookies set by Greymatter?
$gmfonttagKeep control panel log?
Specifies whether you want Greymatter to keep its internal log of all activity; disable this if you want to shut it off.
$gmfonttag Yes   No
$gmfonttag Yes   No
$gmfonttagAllow "easy formatting"?
With "easy formatting", bold text, italics & underlining can be done easily by bracketing text with two **asterisks**, \\\\backslashes\\\\ or __underlines__ respectively. You can specify whether this is enabled in entries, comments, or both; if disabled, the characters won't be converted.
$gmfonttag Entries only   Comments only
Both   Neither
$gmfonttag Entries only   Comments only
Both   Neither
$gmfonttag Entries only   Comments only
Both   Neither
$gmfonttag Entries only   Comments only
Both   Neither
$gmfonttagDefault entry list view:
This specifies which view will be the default when you go to the Edit An Entry selection menu.
$gmfonttag
$gmfonttagOrder of list links:
The order in which you want links to be displayed in log list variables—check the manual for more information on those. If "ascending", the links will be listed from newest to oldest, with the newest entry at the top; if "descending", from first to last, with the first entry at the top.
$gmfonttag Ascending   Descending
$gmfonttag Ascending   Descending
$gmfonttagLog entry list variable number:
The number of entries to link to, starting from the most recent, whenever the "number" variant of the log entrylist variables (for example, if this is set to 5, using {{logmoreentrylist number}} would generate a list of links to the five most recent extended entries). Check the manual for more information on those variables.
$gmfonttag
$gmfonttagLink to entries in {{logentrylist comments}} only if comments are active?
If you use {{logentrylist comments}} and its related variables (see the manual for more information), this specifies whether to list only entries to which comments can still be posted.
$gmfonttag Yes   No
$gmfonttag Yes   No
$gmfonttagEntries to link to in {{calendar}}:
Whenever you use {{calendar}} or {{calendarweek}} to generate tables linking to your entries, this specifies whether you want to link to the most recent entry for that day, or to link only to extended entries. (It won't generate links at all if "Generate pages for individual entries" is turned off.)
$gmfonttag Always link to entry for that calendar day
Link only to extended entries
$gmfonttag Always link to entry for that calendar day
Link only to extended entries
$gmfonttag"Automatically rebuild" selected by default?
Selects whether the option to automatically rebuild files after saving changes to templates or entries is prechecked by default. (Authors without access to rebuilding files won't see this option.)
$gmfonttag Yes   No
$gmfonttag Yes   No

$gmfonttag

"It's better to change your shoes than to carpet the world."—Stuart Smalley $gmframebottom GMCONFIGMENUBOTTOM $statusnote = ""; exit; } # ---------------- # save config file # ---------------- sub gm_saveconfiguration { &gm_validate; if ($gmconfigurationaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to save changes to the config file without authorization"); $statusnote = qq(You don't have access to change the config file.

); &gm_frontpage; } chomp ($IN{'editedcensorlist'}); $IN{'editedcensorlist'} = &relouse($IN{'editedcensorlist'}); chomp ($IN{'editedotherfilelist'}); $IN{'editedotherfilelist'} = &relouse($IN{'editedotherfilelist'}); $IN{'editedlogpath'} = &configdelouse($IN{'editedlogpath'}); $IN{'editedentriespath'} = &configdelouse($IN{'editedentriespath'}); $IN{'editedlogwebpath'} = &configdelouse($IN{'editedlogwebpath'}); $IN{'editedentrieswebpath'} = &configdelouse($IN{'editedentrieswebpath'}); $IN{'editednotifyemail'} = &configdelouse($IN{'editednotifyemail'}); $IN{'editedindexfilename'} = &configdelouse($IN{'editedindexfilename'}); $IN{'editedentrysuffix'} = &configdelouse($IN{'editedentrysuffix'}); $IN{'editedindexdays'} = &configdelouse($IN{'editedindexdays'}); $IN{'editedoffsettime'} = &configdelouse($IN{'editedoffsettime'}); $IN{'editedtimezone'} = &configdelouse($IN{'editedtimezone'}); $IN{'editedmailprog'} = &configdelouse($IN{'editedmailprog'}); $IN{'editedcgilocalpath'} = &configdelouse($IN{'editedcgilocalpath'}); $IN{'editedcgiwebpath'} = &configdelouse($IN{'editedcgiwebpath'}); $IN{'editedentrylistcountnumber'} = &configdelouse($IN{'editedentrylistcountnumber'}); $IN{'editedlogarchivesuffix'} = &configdelouse($IN{'editedlogarchivesuffix'}); $IN{'editedcensorlist'} =~ s/^\s+//; $IN{'editedcensorlist'} =~ s/\s+$//; $IN{'editedotherfilelist'} =~ s/^\s+//; $IN{'editedotherfilelist'} =~ s/^\s+//; $IN{'editedentrysuffix'} =~ s/\.//g; $IN{'editednotifyemail'} =~ s/ //g; $IN{'editedlogarchivesuffix'} =~ s/\.//g; if (($IN{'editedlogpath'} eq "") || ($IN{'editedentriespath'} eq "") || ($IN{'editedlogwebpath'} eq "") || ($IN{'editedentrieswebpath'} eq "") || ($IN{'editedindexfilename'} eq "") || ($IN{'editedentrysuffix'} eq "") || ($IN{'editedindexdays'} eq "") || ($IN{'editedoffsettime'} eq "") || ($IN{'editedtimezone'} eq "") || ($IN{'editedcgilocalpath'} eq "") || ($IN{'editedcgiwebpath'} eq "") || ($IN{'editedentrylistcountnumber'} eq "") || ($IN{'editedlogarchivesuffix'} eq "")) { $statusnote = qq(You left one or more of the required fields blank. Please try again.

); &gm_configuration; } if ($IN{'editedindexdays'} =~ /\D/) { $statusnote = qq("Days to keep on main index" must be a number.

); &gm_configuration; } if ($IN{'editedoffsettime'} =~ /\D/) { unless ($IN{'editedoffsettime'} =~ /-/) { $statusnote = qq("Server Offset Time" must be a number.

); &gm_configuration; } } if ($IN{'editeduploadfilesizelimit'} eq "") { $IN{'editeduploadfilesizelimit'} = 0; } if ($IN{'editeduploadfilesizelimit'} =~ /\D/) { $statusnote = qq("Maximum Filesize Allowed" must be a number.

); &gm_configuration; } if (($IN{'editednotifyemail'} ne "") && ($IN{'editedmailprog'} eq "")) { $statusnote = qq(You must give your server's e-mail program location
if you're going to have e-mail notification enabled.

); &gm_configuration; } if (($IN{'editednotifyemail'} eq "") && ($IN{'editednotifyforstatus'} ne "neither")) { $statusnote = qq(You must give an e-mail address to receive e-mail notifications.

); &gm_configuration; } if ($IN{'editedentrylistcountnumber'} =~ /\D/) { $statusnote = qq("Log entry list variable number" must be a number.

); &gm_configuration; } $IN{'editeduploadfilesallowed'} =~ s/;/SEMICOLON/g; if ($IN{'editeduploadfilesallowed'} =~ /\W/) { $statusnote = qq("Allowed File Types" must only contain alphanumeric characters (besides semicolons).

); &gm_configuration; } $IN{'editeduploadfilesallowed'} =~ s/SEMICOLON/;/g; if ($IN{'editedindexdays'} < 1) { $statusnote = qq("Days to keep on main index" must be set to at least one!

); &gm_configuration; } if (substr($IN{'editedlogpath'}, -1) eq "/") { chop ($IN{'editedlogpath'}) }; if (substr($IN{'editedentriespath'}, -1) eq "/") { chop ($IN{'editedentriespath'}) }; if (substr($IN{'editedcgilocalpath'}, -1) eq "/") { chop ($IN{'editedcgilocalpath'}) }; if (substr($IN{'editedlogwebpath'}, -1) eq "/") { chop ($IN{'editedlogwebpath'}) }; if (substr($IN{'editedentrieswebpath'}, -1) eq "/") { chop ($IN{'editedentrieswebpath'}) }; if (substr($IN{'editedcgiwebpath'}, -1) eq "/") { chop ($IN{'editedcgiwebpath'}) }; open (FUNNYFEET, ">gm-config.cgi") || &gm_dangermouse("Can't write to the configuration file. Please make sure that gm-config.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); print FUNNYFEET "$IN{'editedlogpath'}\n"; print FUNNYFEET "$IN{'editedentriespath'}\n"; print FUNNYFEET "$IN{'editedlogwebpath'}\n"; print FUNNYFEET "$IN{'editedentrieswebpath'}\n"; print FUNNYFEET "$IN{'editednotifyemail'}\n"; print FUNNYFEET "$IN{'editedindexfilename'}\n"; print FUNNYFEET "$IN{'editedentrysuffix'}\n"; print FUNNYFEET "$IN{'editedindexdays'}\n"; print FUNNYFEET "$IN{'editedoffsettime'}\n"; print FUNNYFEET "$IN{'editedtimezone'}\n"; print FUNNYFEET "$IN{'editedkeeplog'}\n"; print FUNNYFEET "$IN{'editedposttoarchives'}\n"; print FUNNYFEET "$IN{'editedallowkarmadefault'}\n"; print FUNNYFEET "$IN{'editedallowcommentsdefault'}\n"; print FUNNYFEET "$IN{'editedcommentsorder'}\n"; print FUNNYFEET "$IN{'editedgenerateentrypages'}\n"; print FUNNYFEET "$IN{'editedallowhtmlincomments'}\n"; print FUNNYFEET "$IN{'editedlogkarmaandcomments'}\n"; print FUNNYFEET "$IN{'editedmailprog'}\n"; print FUNNYFEET "$IN{'editednotifyforstatus'}\n"; print FUNNYFEET "$IN{'editedautolinkurls'}\n"; print FUNNYFEET "$IN{'editedstriplinesfromcomments'}\n"; print FUNNYFEET "$IN{'editedallowmultiplekarmavotes'}\n"; print FUNNYFEET "$gmversion\n"; print FUNNYFEET "$IN{'editedcgilocalpath'}\n"; print FUNNYFEET "$IN{'editedcgiwebpath'}\n"; print FUNNYFEET "$IN{'editedconcurrentmainandarchives'}\n"; print FUNNYFEET "$IN{'editedkeeparchivemasterindex'}\n"; print FUNNYFEET "$IN{'editedentrylistsortorder'}\n"; print FUNNYFEET "$IN{'editedallowkarmaorcomments'}\n"; print FUNNYFEET "$IN{'editedentrylistcountnumber'}\n"; print FUNNYFEET "$IN{'editedcookiesallowed'}\n"; print FUNNYFEET "$IN{'editedlogarchivesuffix'}\n"; print FUNNYFEET "$IN{'editedcensorlist'}\n"; print FUNNYFEET "$IN{'editedcensorenabled'}\n"; print FUNNYFEET "$IN{'editedkeepmonthlyarchives'}\n"; print FUNNYFEET "$IN{'editeddefaultentrylistview'}\n"; print FUNNYFEET "$IN{'editedlinktocalendarentries'}\n"; print FUNNYFEET "$IN{'editedautomaticrebuilddefault'}\n"; print FUNNYFEET "$IN{'editedcommententrylistonlyifokay'}\n"; print FUNNYFEET "$IN{'editedotherfilelist'}\n"; print FUNNYFEET "$IN{'editedotherfilelistentryrebuild'}\n"; print FUNNYFEET "$IN{'editedarchiveformat'}\n"; print FUNNYFEET "$IN{'editedinlineformatting'}\n"; print FUNNYFEET "$IN{'editeduploadfilesallowed'}\n"; print FUNNYFEET "$IN{'editeduploadfilesizelimit'}\n"; close (FUNNYFEET); if (($keeplog eq "no") && ($IN{'editedkeeplog'} eq "yes")) { &date; open (FUNNYFEET, ">>gm-cplog.cgi") || &gm_dangermouse("Can't write to the control panel log. Please make sure that gm-cplog.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); print FUNNYFEET "[$basedate] [$authorIP] $IN{'authorname'} let this log get its groove back\n[$basedate] [$authorIP] $IN{'authorname'} edited the config file\n"; close (FUNNYFEET); } if ($IN{'editedkeeplog'} eq "no") { &gm_writetocplog("$IN{'authorname'} edited the config file\n[$basedate] [$authorIP] $IN{'authorname'} decided to stop this log from getting down with its bad-ass self"); } else { &gm_writetocplog("$IN{'authorname'} edited the config file"); } $statusnote = qq(The config file has been updated. Be sure to rebuild your files
for the changes to take effect on your site, if appropriate.

); if ($IN{'editeddeletecookies'} eq "yes") { $statusnote .= "\n"; } &gm_frontpage; } # ------------------- # edit banned ip list # ------------------- sub gm_editbanlist { &gm_validate; if ($gmconfigurationaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to edit the ban list without authorization"); $statusnote = qq(You don't have access to edit the ban list.

); &gm_frontpage; } if ($statusnote eq "") { $statusnote = qq(
$gmfonttagEdit Banned IP List
Anyone matching an IP address that you have listed here will be unable to vote or post comments on your site; you can optionally add names to them to help you remember who you've banned. You can also ban partial IPs (for example, banning 12.34.56 would ban someone at 12.34.56.78 as well as 12.34.56.89).

); } print<
Banned person's name (optional):

"Why have those banish'd and forbidden legs dared once
to touch a dust of England's ground?"—Shakespeare
$gmframebottom GMBANLISTMENUBOTTOM $statusnote = ""; exit; } # ------------------------- # add an ip to the ban list # ------------------------- sub gm_addbannedip { &gm_validate; if ($gmconfigurationaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to add an IP ($IN{'editednewbannedip'}) to the ban list without authorization"); $statusnote = qq(You don't have access to add an IP to the ban list.

); &gm_frontpage; } $IN{'editednewbannedip'} =~ s/\n//g; $IN{'editednewbannedip'} =~ s/\|//g; $IN{'editednewbannedperson'} =~ s/\n//g; $IN{'editednewbannedperson'} =~ s/\|//g; if ($IN{'editednewbannedip'} eq "") { $statusnote = qq(You must enter the IP you want to add to the ban list.

); &gm_editbanlist; } open (FUNNYFEET, "gm-banlist.cgi") || &gm_dangermouse("Can't read the banlist file. Please make sure that gm-banlist.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); @gmbanlist = ; close (FUNNYFEET); $gmcounter = 0; foreach (@gmbanlist) { chomp ($gmbanlist[$gmcounter]); ($checkthisip, $checkthisiphost, $checkthisperson) = split (/\|/, $gmbanlist[$gmcounter]); if ($checkthisip eq $IN{'editednewbannedip'}) { $statusnote = qq(That IP is already in the ban list.

); &gm_editbanlist; } $gmcounter++; } $newbannediphost = $IN{'editednewbannedip'}; $gmbanlist[$gmcounter] = "$IN{'editednewbannedip'}|$newbannediphost|$IN{'editednewbannedperson'}"; @gmbanlistsorted = sort { $a <=> $b } @gmbanlist; open (FUNNYFEET, ">gm-banlist.cgi") || &gm_dangermouse("Can't write to the banlist file. Please make sure that gm-banlist.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); foreach $gmnewbanlistline (@gmbanlistsorted) { print FUNNYFEET "$gmnewbanlistline\n"; } close (FUNNYFEET); if ($keeplog eq "yes") { &date; open (FUNNYFEET, ">>gm-cplog.cgi") || &gm_dangermouse("Can't write to the control panel log. Please make sure that gm-cplog.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); print FUNNYFEET "[$basedate] [$authorIP] $IN{'authorname'} added an IP ($IN{'editednewbannedip'}"; if ($IN{'editednewbannedperson'} ne "") { print FUNNYFEET ", \"$IN{'editednewbannedperson'}\""; } print FUNNYFEET ") to the ban list\n"; close (FUNNYFEET); } $statusnote = qq($IN{'editednewbannedip'} has been added to the ban list.

); &gm_editbanlist; } # ------------------------------ # delete an ip from the ban list # ------------------------------ sub gm_deletebannedip { &gm_validate; if ($gmconfigurationaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to delete an IP ($IN{'editedbanlist'}) to the ban list without authorization"); $statusnote = qq(You don't have access to delete an IP from the ban list.

); &gm_frontpage; } chomp($IN{'editedbanlist'}); if ($IN{'editedbanlist'} eq "") { $statusnote = qq(You must select the IP you want to delete from the ban list.

); &gm_editbanlist; } open (FUNNYFEET, "gm-banlist.cgi") || &gm_dangermouse("Can't read the banlist file. Please make sure that gm-banlist.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); @gmbanlist = ; close (FUNNYFEET); $deletedthisbannedip = ""; $deletedthisbannediphost = ""; $deletedthisbannedperson = ""; open (FUNNYFEET, ">gm-banlist.cgi") || &gm_dangermouse("Can't write to the banlist file. Please make sure that gm-banlist.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); foreach $gmbanlistline (@gmbanlist) { chomp($gmbanlistline); if ($gmbanlistline eq $IN{'editedbanlist'}) { ($checkthisip, $checkthisiphost, $checkthisperson) = split (/\|/, $gmbanlistline); $deletedthisbannedip = $checkthisip; $deletedthisbannediphost = $checkthisiphost; $deletedthisbannedperson = $checkthisperson; } if ($gmbanlistline ne $IN{'editedbanlist'}) { print FUNNYFEET "$gmbanlistline\n"; } } close (FUNNYFEET); if ($keeplog eq "yes") { &date; open (FUNNYFEET, ">>gm-cplog.cgi") || &gm_dangermouse("Can't write to the control panel log. Please make sure that gm-cplog.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); print FUNNYFEET "[$basedate] [$authorIP] $IN{'authorname'} deleted an IP ($deletedthisbannedip"; if ($deletedthisbannedperson ne "") { print FUNNYFEET ", \"$deletedthisbannedperson\""; } print FUNNYFEET ") from the ban list\n"; close (FUNNYFEET); } $statusnote = qq($deletedthisbannedip has been deleted from the ban list.

); &gm_editbanlist; } # --------------- # add a new entry # --------------- sub gm_addentry { &gm_validate; if ($gmentryaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to add an entry without authorization"); $statusnote = qq(You don't have access to add entries.

); &gm_frontpage; } &gm_readcounter; if ($newentrynumber eq "0") { open (FUNNYFEET, "gm-cplog.cgi") || &gm_dangermouse("Can't read the control panel log. Please make sure that gm-cplog.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); @cploglines = ; close (FUNNYFEET); $cplogtext = join (" ", @cploglines); unless ($cplogtext =~ /successfully performed diagnostics/) { $statusnote = qq(Please run "Diagnostics & Repair" in the Configuration screen before posting your first entry.

); &gm_frontpage; } } if ($statusnote eq "") { $statusnote = qq(Add A New Entry
This is the form by which you add new entries to your weblog/journal. You can make this either a standard or extended entry;
standard entries contain only main text (the first box), while extended entries also have "more" text (the second box).
Standard & extended entries can be handled and formatted in distinct ways via your templates.

); } if ($IN{'newentrysubject'} ne "") { $IN{'newentrysubject'} = &delouse($IN{'newentrysubject'}); } if ($IN{'newentrymaintext'} ne "") { $IN{'newentrymaintext'} = &delouse($IN{'newentrymaintext'}); } if ($IN{'newentrymoretext'} ne "") { $IN{'newentrymoretext'} = &delouse($IN{'newentrymoretext'}); } print<
$gmfonttagSubject:$gmfonttag

Main Entry Text
$gmfonttag

Extended ("More") Entry Text—Optional
$gmfonttag

$gmfonttagEntry Options
If you wish to enable or disable karma voting and/or comment posting for this entry, you can specify it below (use Configuration to set whether those are on or off by default), unless you've disabled karma or comments altogether. You can also specify whether to keep an entry permanently at the top of your main log (you can edit the entry later to turn that off).

GMADDENTRYTOP if (($allowkarmaorcomments eq "karma") || ($allowkarmaorcomments eq "both")) { print qq(Allow karma voting on this entry: ); if ($allowkarmadefault eq "yes") { print qq( Yes No\n); } else { print qq( Yes No\n); } } else { print qq(\n); } if ($allowkarmaorcomments eq "both") { print "
\n"; } if (($allowkarmaorcomments eq "comments") || ($allowkarmaorcomments eq "both")) { print qq(Allow comments to be posted to this entry: ); if ($allowcommentsdefault eq "yes") { print qq( Yes No\n); } else { print qq( Yes No\n); } } else { print qq(\n); } print< Keep this entry at the top of the main log: Yes No

"You must have chaos in your soul to give birth to a dancing star."—Friedrich Nietzsche $gmframebottom GMADDENTRYBOTTOM exit; } # ------------------------------- # add a new entry - popup version # ------------------------------- sub gm_addentrypopup { &gm_validate; if (($gmentryaccess ne "yes") || ($gmbookmarkletaccess ne "yes")) { &gm_writetocplog("$IN{'authorname'} attempted to add an entry via popup without authorization"); $statusnote = qq(You don't have access to add entries via the popup window.

); &gm_frontpage; } &gm_readcounter; if ($newentrynumber eq "0") { open (FUNNYFEET, "gm-cplog.cgi") || &gm_dangermouse("Can't read the control panel log. Please make sure that gm-cplog.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); @cploglines = ; close (FUNNYFEET); $cplogtext = join (" ", @cploglines); unless ($cplogtext =~ /successfully performed diagnostics/) { $statusnote = qq(Please run "Diagnostics & Repair" in the Configuration screen before posting your first entry.

); &gm_frontpage; } } if ($statusnote eq "") { $statusnote = qq(Greymatter Pop-Up Posting Window

); } $popupincludetext = qq($IN{'loglinktitle'}); if ($IN{'logtext'} ne "") { $popupincludetext .= "\n\n$IN{'logtext'}"; } if ($IN{'newentrysubject'} ne "") { $IN{'newentrysubject'} = &delouse($IN{'newentrysubject'}); } if ($IN{'newentrymaintext'} ne "") { $IN{'newentrymaintext'} = &delouse($IN{'newentrymaintext'}); } else { $IN{'newentrymaintext'} = $popupincludetext; } if ($IN{'newentrymoretext'} ne "") { $IN{'newentrymoretext'} = &delouse($IN{'newentrymoretext'}); } print<
$gmfonttagSubject:$gmfonttag

Main Entry Text
$gmfonttag

Extended ("More") Entry Text—Optional
$gmfonttag

GMADDENTRYPOPUPTOP if (($allowkarmaorcomments eq "karma") || ($allowkarmaorcomments eq "both")) { print qq(Allow karma voting on this entry: ); if ($allowkarmadefault eq "yes") { print qq( Yes No\n); } else { print qq( Yes No\n); } } else { print qq(\n); } if ($allowkarmaorcomments eq "both") { print "
\n"; } if (($allowkarmaorcomments eq "comments") || ($allowkarmaorcomments eq "both")) { print qq(Allow comments to be posted to this entry: ); if ($allowcommentsdefault eq "yes") { print qq( Yes No\n); } else { print qq( Yes No\n); } } else { print qq(\n); } print< Keep this entry at the top of the main log: Yes No

$gmframebottomtwo GMADDENTRYPOPUPBOTTOM exit; } # ---------------------------- # preview entry before posting # ---------------------------- sub gm_previewentry { &gm_validate; if ($gmentryaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to add an entry without authorization"); $statusnote = qq(You don't have access to add entries.

); &gm_frontpage; } $newentrysubject = &relouse($IN{'newentrysubject'}); $newentrymaintext = &relouse($IN{'newentrymaintext'}); $newentrymoretext = &relouse($IN{'newentrymoretext'}); $newentrysubjectdeloused = &delouse($newentrysubject); $newentrymaintextdeloused = &delouse($newentrymaintext); $newentrymoretextdeloused = &delouse($newentrymoretext); $newentrysubjectdeloused =~ s/\n/\|\*\|/g; $newentrymaintextdeloused =~ s/\n/\|\*\|/g; $newentrymoretextdeloused =~ s/\n/\|\*\|/g; $newentrymaintext =~ s/\|\*\|/
/g; $newentrymoretext =~ s/\|\*\|/
/g; $newentrymaintext =~ s/\n/
/g; $newentrymoretext =~ s/\n/
/g; $newentrymaintext =~ s/

/<\/P>

/g; $newentrymoretext =~ s/

/<\/P>

/g; &gm_readcounter; unless ($newentrynumber < 1) { &gm_getentryvariables($newentrynumber); &gm_formatentry($newentrymaintext); $newentrymaintext = $entryreturn; unless ($newentrymoretext eq "") { &gm_formatentry($newentrymoretext); $newentrymoretext = $entryreturn; } } $showmoretext = ""; if ($newentrymoretext ne "") { $showmoretext = "

\n[extended text]\n

\n$newentrymoretext\n"; } if ($statusnote eq "") { if ($newentrysubject ne "") { $statusnote = qq(Previewing "$newentrysubject"
Click "Add This Entry" below to add this entry to your site, or click "Re-Edit This Entry" to re-edit it.

); } else { $statusnote = qq(Previewing New Entry
Click "Add This Entry" below to add this entry to your site, or click "Re-Edit This Entry" to re-edit it.

); } } print< $newentrymaintext $showmoretext

"The future is not something we enter. The future is something we create."—Leonard Sweet

$gmframebottom GMPREVIEWENTRY exit; } # ------------------ # save the new entry # ------------------ sub gm_savenewentry { &gm_validate; if ($gmentryaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to add an entry without authorization"); $statusnote = qq(You don't have access to add entries.

); &gm_frontpage; } $IN{'newentrysubject'} = &configdelouse($IN{'newentrysubject'}); $IN{'newentrysubject'} = &relouse($IN{'newentrysubject'}); $IN{'newentrymaintext'} = &relouse($IN{'newentrymaintext'}); $IN{'newentrymoretext'} = &relouse($IN{'newentrymoretext'}); if ($IN{'newentrymaintext'} eq "") { $statusnote = qq(You left the main text field blank. Please try again.

); if ($IN{'gmbmspecial'} eq "popupblog") { &gm_addentrypopup; } else { &gm_addentry; } } &gm_readcounter; $newentrynumber++; $newentrynumberpadded = sprintf ("%8d", $newentrynumber); $newentrynumberpadded =~ tr/ /0/; &gm_readconfig; &date; $basedate = "$montwo\/$mdaytwo\/$shortyear $hourtwo\:$mintwo $AMPM"; open (FUNNYFEET, ">$EntriesPath/$newentrynumberpadded.cgi") || &gm_dangermouse("Can't write to $EntriesPath/$newentrynumberpadded.cgi. Please make sure that your entries/archives directory is correctly configured and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); print FUNNYFEET "$newentrynumber|$IN{'authorname'}|$IN{'newentrysubject'}|$wday|$mon|$mday|$JSYear|$hour|$min|$sec|$AMPM|0|0|0|$IN{'newentryallowkarma'}|$IN{'newentryallowcomments'}|open\n"; print FUNNYFEET "0.0.0.0|I\n"; print FUNNYFEET "$IN{'newentrymaintext'}\n"; print FUNNYFEET "$IN{'newentrymoretext'}\n"; close (FUNNYFEET); chmod (0666, "$EntriesPath/$newentrynumberpadded.cgi"); open (FUNNYFEET, "gm-entrylist.cgi") || &gm_dangermouse("Can't read the entrylist file. Please make sure that gm-entrylist.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); @originalentrylist = ; close (FUNNYFEET); $newentrytempmorestatus = "N"; if ($IN{'newentrymoretext'} ne "") { $newentrytempmorestatus = "Y"; } open (FUNNYFEET, ">gm-entrylist.cgi") || &gm_dangermouse("Can't write to the entrylist file. Please make sure that gm-entrylist.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); print FUNNYFEET "$newentrynumber|$IN{'authorname'}|$IN{'newentrysubject'}|$montwo\/$mdaytwo\/$shortyear|$hourtwo\:$mintwo $AMPM|O|$newentrytempmorestatus\n"; foreach $originalentrylistline (@originalentrylist) { chomp ($originalentrylistline); print FUNNYFEET "$originalentrylistline\n"; } close (FUNNYFEET); if ($IN{'newentrystayattop'} eq "yes") { $newstayattopnumber = $newentrynumber; } $newalltimeopenentriesnumber++; &gm_writecounter; if ($generateentrypages eq "yes") { &gm_readconfig; &gm_getentryvariables($newentrynumber); if ($thisentryopenstatus eq "open") { if ($thisentrymorebody ne "") { &gm_formatentry($gmmoreentrypagetemplate); } else { &gm_formatentry($gmentrypagetemplate); } open (THISFILE, ">$EntriesPath/$thisentrynumberpadded.$entrysuffix") || &gm_dangermouse("Can't write file to $EntriesPath/$thisentrynumberpadded.$entrysuffix - please run Diagnostics & Repair in the Configuration screen."); print THISFILE $entryreturn; close (THISFILE); chmod (0666, "$EntriesPath/$newentrynumberpadded.$entrysuffix"); } else { unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } if ($newentrynumber ne "1") { $updatepreviousnumber = $newentrynumber - 1; &gm_getentryvariables($updatepreviousnumber); if ($thisentryopenstatus eq "open") { if ($updatepreviousnumber <= $newarchivenumber) { if ($thisentrymorebody ne "") { &gm_formatentry($gmmorearchiveentrypagetemplate); } else { &gm_formatentry($gmarchiveentrypagetemplate); } } else { if ($thisentrymorebody ne "") { &gm_formatentry($gmmoreentrypagetemplate); } else { &gm_formatentry($gmentrypagetemplate); } } open (THISFILE, ">$EntriesPath/$thisentrynumberpadded.$entrysuffix") || &gm_dangermouse("Can't write file to $EntriesPath/$thisentrynumberpadded.$entrysuffix - please run Diagnostics & Repair in the Configuration screen."); print THISFILE $entryreturn; close (THISFILE); chmod (0666, "$EntriesPath/$newentrynumberpadded.$entrysuffix"); } else { unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } } } &gm_generatemainindex; &gm_readcounter; if (($newarchivenumber ne "0") || ($concurrentmainandarchives eq "yes")) { if (($generateentrypages eq "yes") && ($newarchivenumber ne "0")) { &gm_getentryvariables($newarchivenumber); $originaldaymarker = "$thisentryday $thisentrymonth"; $currentdaymarker = $originaldaymarker; $markercount = $newarchivenumber; do { if ($thisentryopenstatus eq "open") { if ($thisentrymorebody ne "") { &gm_formatentry($gmmorearchiveentrypagetemplate); } else { &gm_formatentry($gmarchiveentrypagetemplate); } open (THISFILE, ">$EntriesPath/$thisentrynumberpadded.$entrysuffix") || &gm_dangermouse("Can't write file to $EntriesPath/$thisentrynumberpadded.$entrysuffix - please run Diagnostics & Repair in the Configuration screen."); print THISFILE $entryreturn; close (THISFILE); chmod (0666, "$EntriesPath/$newentrynumberpadded.$entrysuffix"); } else { unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } $markercount--; if ($markercount eq "0") { $currentdaymarker = "finis"; } else { &gm_getentryvariables($markercount); $currentdaymarker = "$thisentryday $thisentrymonth"; } } until $currentdaymarker ne $originaldaymarker; } if ($concurrentmainandarchives eq "yes") { $newarchivenumber = $newentrynumber; } unless ($keepmonthlyarchives eq "no") { &gm_generatearchive($newarchivenumber); } &gm_readcounter; } if ($keeparchivemasterindex eq "yes") { if ($newarchivenumber ne "0") { &gm_getentryvariables($newarchivenumber); } else { &gm_getentryvariables($newentrynumber); } &gm_formatentry($gmarchivemasterindextemplate); open (THISFILE, ">$EntriesPath/$indexfilename") || &gm_dangermouse("Can't write to $EntriesPath/$indexfilename. Please make sure your paths are configured correctly, that the entries/archives directory is CHMODed to 777, and that $EntriesPath/$indexfilename is CHMODed to 666; also try running Diagnostics & Repair from the Configuration screen."); print THISFILE $entryreturn; close (THISFILE); chmod (0666, "$EntriesPath/$indexfilename"); } open (FUNNYFEET, "gm-authors.cgi") || &gm_dangermouse("Can't read the authors file. Please make sure that gm-authors.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); @gmauthordata = ; close (FUNNYFEET); open (FUNNYFEET, ">gm-authors.cgi") || &gm_dangermouse("Can't write to the authors file. Please make sure that gm-authors.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); foreach $gmauthordataline (@gmauthordata) { chomp ($gmauthordataline); ($checkthisname, $checkthispassword, $checkthisemail, $checkthishomepage, $checkthisoriginaldate, $checkthisentrycount, $checkthisentryaccess, $checkthisentryeditaccess, $checkthisconfigureaccess, $checkthistemplateaccess, $checkthisauthoraccess, $checkthisrebuildaccess, $checkthiscplogaccess, $checkthisbookmarkletaccess, $checkthisuploadaccess, $checkthisloginaccess) = split (/\|/, $gmauthordataline); if ($checkthisname eq $IN{'authorname'}) { $checkthisentrycount++; } print FUNNYFEET "$checkthisname|$checkthispassword|$checkthisemail|$checkthishomepage|$checkthisoriginaldate|$checkthisentrycount|$checkthisentryaccess|$checkthisentryeditaccess|$checkthisconfigureaccess|$checkthistemplateaccess|$checkthisauthoraccess|$checkthisrebuildaccess|$checkthiscplogaccess|$checkthisbookmarkletaccess|$checkthisuploadaccess|$checkthisloginaccess\n"; } close (FUNNYFEET); $recordentrysubject = $IN{'newentrysubject'}; if ($recordentrysubject eq "") { $recordentrysubject = "[no subject]"; } if ($IN{'gmbmspecial'} eq "popupblog") { &gm_writetocplog("$IN{'authorname'} added a new entry (#$newentrynumber\: $recordentrysubject) via popup"); } else { &gm_writetocplog("$IN{'authorname'} added a new entry (#$newentrynumber\: $recordentrysubject)"); } if (($otherfilelist ne "") && ($otherfilelistentryrebuild eq "yes") && ($IN{'gmbmspecial'} ne "popupblog")) { $IN{'rebuilding'} = "connectedaftersave"; $IN{'rebuildfrom'} = "connected"; &gm_rebuildupdate; } if ($IN{'gmbmspecial'} eq "popupblog") { $indexfilenamesmartcheck = "/$indexfilename"; $indexfilenameprefix = substr($indexfilename, 0, 6); if ($indexfilenameprefix eq "index.") { $indexfilenamesmartcheck = "/"; } print<Your new entry has been added to your site.

Click here to close this window.$gmframebottomtwo GMPOPUPNOTICE exit; } $statusnote = qq(Your new entry has been added.

); &gm_frontpage; } # ------------------ # rebuild files menu # ------------------ sub gm_rebuildfilesmenu { &gm_validate; if ($gmrebuildaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to rebuild the files without authorization"); $statusnote = qq(You don't have access to rebuild the files.

); &gm_frontpage; } &gm_readcounter; if ($newentrynumber eq "0") { $statusnote = qq(There are no entries yet!

); &gm_frontpage; } if ($statusnote eq "") { $statusnote = qq(
$gmfonttagRebuild Files
If you've made any changes that will have a visible impact on your site (such as changing the templates, closing/reopening an entry, etc), you may want to rebuild the relevant files so that the changes will be immediately visible—note that whenever you add a new entry, Greymatter automatically updates the relevant files.

); } $rebuildconnectedfilesbutton = ""; if ($otherfilelist ne "") { $rebuildconnectedfilesbutton = qq(

\n); } print<

$rebuildconnectedfilesbutton

After clicking, expect a wait of up to several minutes, depending
on how much is being rebuilt. DO NOT INTERRUPT GREYMATTER
while it's rebuilding, or you could damage your files.

"The most merciful thing in the world is the inability of the
human mind to correlate all its contents."—H.P. Lovecraft
$gmframebottom GMREBUILDMENU $statusnote = ""; exit; } # --------------------------- # rebuild the main index file # --------------------------- sub gm_rebuildmainindexfile { &gm_validate; if ($gmrebuildaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to rebuild the main index file without authorization"); $statusnote = qq(You don't have access to rebuild the main index file.

); &gm_frontpage; } &gm_readcounter; if ($newentrynumber eq "0") { $statusnote = qq(There are no entries yet.

); &gm_frontpage; } &gm_generatemainindex; &gm_writetocplog("$IN{'authorname'} rebuilt the main index file"); if ($IN{'autorebuild'} eq "index") { $statusnote = qq(The $IN{'modifiedtemplategroup'} templates have been
modified and the main index file has been rebuilt.

); &gm_edittemplates; } else { $statusnote = qq(The main index file has been rebuilt.

); &gm_frontpage; } } # ---------------------------- # rebuild last entry page only # ---------------------------- sub gm_rebuildlastentrypageonly { &gm_validate; if ($gmrebuildaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to rebuild the last entry page without authorization"); $statusnote = qq(You don't have access to rebuild the last entry page.

); &gm_frontpage; } &gm_readconfig; if ($generateentrypages ne "yes") { $statusnote = qq(Entry page generation is currently disabled.

); &gm_rebuildfilesmenu; } &gm_readcounter; &gm_readtemplates; if ($newentrynumber eq "0") { $statusnote = qq(There are no entries yet.

); &gm_frontpage; } &gm_getentryvariables($newentrynumber); if ($thisentryopenstatus eq "open") { if ($thisentrymorebody ne "") { &gm_formatentry($gmmoreentrypagetemplate); } else { &gm_formatentry($gmentrypagetemplate); } open (THISFILE, ">$EntriesPath/$thisentrynumberpadded.$entrysuffix") || &gm_dangermouse("Can't write to $EntriesPath/$thisentrynumberpadded.$entrysuffix. Please make sure that your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); print THISFILE $entryreturn; close (THISFILE); chmod (0666, "$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } else { unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } &gm_writetocplog("$IN{'authorname'} rebuilt the last entry page"); $statusnote = qq(The last entry page has been rebuilt.

); &gm_frontpage; } # ------------------------ # rebuild main entry files # ------------------------ sub gm_rebuildmainentrypages { &gm_validate; if ($gmrebuildaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to rebuild the main entry pages without authorization"); $statusnote = qq(You don't have access to rebuild the main entry pages.

); &gm_frontpage; } &gm_readconfig; if ($generateentrypages ne "yes") { $statusnote = qq(Entry page generation is currently disabled.

); &gm_rebuildfilesmenu; } &gm_readcounter; &gm_readtemplates; if ($newentrynumber eq "0") { $statusnote = qq(There are no entries yet.

); &gm_frontpage; } $IN{'rebuilding'} = "mainentries"; $IN{'rebuildfrom'} = $newarchivenumber + 1; &gm_rebuildupdate; } # ---------------------------- # rebuild archive master index # ---------------------------- sub gm_rebuildarchivemasterindex { &gm_validate; if ($gmrebuildaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to rebuild the archive master index without authorization"); $statusnote = qq(You don't have access to rebuild the archive master index.

); &gm_frontpage; } &gm_readconfig; &gm_readcounter; &gm_readtemplates; if ($keeparchivemasterindex eq "no") { $statusnote = qq("Keep archive master index" is currently disabled.

); &gm_frontpage; } if ($newarchivenumber ne "0") { &gm_getentryvariables($newarchivenumber); } else { &gm_getentryvariables($newentrynumber); } &gm_formatentry($gmarchivemasterindextemplate); open (THISFILE, ">$EntriesPath/$indexfilename") || &gm_dangermouse("Can't write to $EntriesPath/$indexfilename. Please make sure your paths are configured correctly, that the entries/archives directory is CHMODed to 777, and that $EntriesPath/$indexfilename is CHMODed to 666; also try running Diagnostics & Repair from the Configuration screen."); print THISFILE $entryreturn; close (THISFILE); chmod (0666, "$EntriesPath/$indexfilename"); &gm_writetocplog("$IN{'authorname'} rebuilt the archive master index"); $statusnote = qq(The archive master index has been rebuilt.

); &gm_frontpage; } # --------------------------- # rebuild archive log indexes # --------------------------- sub gm_rebuildarchivelogindexes { &gm_validate; if ($gmrebuildaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to rebuild the archive log indexes without authorization"); $statusnote = qq(You don't have access to rebuild the archive log indexes.

); &gm_frontpage; } &gm_readconfig; &gm_readcounter; &gm_readtemplates; if (($IN{'autorebuild'} eq "archiveindexes") && ($keeparchivemasterindex ne "no")) { if ($newarchivenumber ne "0") { &gm_getentryvariables($newarchivenumber); } else { &gm_getentryvariables($newentrynumber); } &gm_formatentry($gmarchivemasterindextemplate); open (THISFILE, ">$EntriesPath/$indexfilename") || &gm_dangermouse("Can't write to $EntriesPath/$indexfilename. Please make sure your paths are configured correctly, that the entries/archives directory is CHMODed to 777, and that $EntriesPath/$indexfilename is CHMODed to 666; also try running Diagnostics & Repair from the Configuration screen."); print THISFILE $entryreturn; close (THISFILE); } if ($keepmonthlyarchives eq "no") { $statusnote = qq(Log archives are currently disabled.

); if ($IN{'autorebuild'} eq "archiveindexes") { $statusnote = qq(The $IN{'modifiedtemplategroup'} templates have been modified.

); } &gm_frontpage; } if (($newarchivenumber eq "0") && ($concurrentmainandarchives ne "yes")) { $statusnote = qq(There are no archive log indexes yet.

); if ($IN{'autorebuild'} eq "archiveindexes") { $statusnote = qq(The $IN{'modifiedtemplategroup'} templates have been modified.

); } &gm_frontpage; } unlink glob("$EntriesPath/archive-*.$entrysuffix"); unlink glob("$EntriesPath/archive-*.$logarchivesuffix"); if ($concurrentmainandarchives eq "yes") { $newarchivenumber = $newentrynumber; } $stoppednumber = $newarchivenumber; do { &gm_generatearchive($stoppednumber); } until $stoppednumber <= 1; &gm_writetocplog("$IN{'authorname'} rebuilt the archive log indexes"); if ($IN{'autorebuild'} eq "archiveindexes") { $statusnote = qq(The $IN{'modifiedtemplategroup'} templates have been
modified and the archive indexes have been rebuilt.

); &gm_edittemplates; } else { $statusnote = qq(The archive log indexes have been rebuilt.

); &gm_frontpage; } } # --------------------------- # rebuild archive entry pages # --------------------------- sub gm_rebuildarchiveentrypages { &gm_validate; if ($gmrebuildaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to rebuild the archive entry pages without authorization"); $statusnote = qq(You don't have access to rebuild the archive entry pages.

); &gm_frontpage; } &gm_readconfig; &gm_readcounter; &gm_readtemplates; if ($newarchivenumber eq "0") { $statusnote = qq(There are no archives yet.

); &gm_frontpage; } if ($generateentrypages eq "no") { $statusnote = qq(Entry page generation is currently disabled.

); &gm_rebuildfilesmenu; } $IN{'rebuilding'} = "archivefiles"; $IN{'rebuildfrom'} = "1"; &gm_rebuildupdate; } # ----------------------- # rebuild all entry pages # ----------------------- sub gm_rebuildallentrypages { &gm_validate; if ($gmrebuildaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to rebuild the entry pages without authorization"); $statusnote = qq(You don't have access to rebuild the entry pages.

); &gm_frontpage; } &gm_readconfig; if ($generateentrypages ne "yes") { $statusnote = qq(Entry page generation is currently disabled.

); &gm_rebuildfilesmenu; } &gm_readcounter; &gm_readtemplates; if ($newentrynumber eq "0") { $statusnote = qq(There are no entries yet.

); &gm_frontpage; } unlink glob("$EntriesPath/archive-*.$entrysuffix"); $IN{'rebuilding'} = "entryfiles"; $IN{'rebuildfrom'} = "1"; &gm_rebuildupdate; } # ------------------------------- # rebuild connected files - check # ------------------------------- sub gm_rebuildconnectedfilescheck { &gm_validate; if ($gmrebuildaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to rebuild the connected files without authorization"); $statusnote = qq(You don't have access to rebuild the connected files.

); &gm_frontpage; } if ($otherfilelist eq "") { $statusnote = qq(There are no connected files to rebuild.

); &gm_frontpage; } &gm_readconfig; &gm_readcounter; &gm_readtemplates; $IN{'rebuilding'} = "connected"; $IN{'rebuildfrom'} = "connected"; &gm_rebuildupdate; } # ------------------ # rebuild everything # ------------------ sub gm_rebuildeverything { &gm_validate; if ($gmrebuildaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to rebuild all the files without authorization"); $statusnote = qq(You don't have access to rebuild all the files.

); &gm_frontpage; } unlink glob("$EntriesPath/*.reg"); unlink glob("$EntriesPath/archive-*.$entrysuffix"); unlink glob("$EntriesPath/archive-*.$logarchivesuffix"); $IN{'rebuilding'} = "everything"; $IN{'rebuildfrom'} = "index"; &gm_rebuildupdate; } # ------------------------------ # edit an entry - selection menu # ------------------------------ sub gm_editentryselection { &gm_validate; if ($gmentryeditaccess eq "no") { &gm_writetocplog("$IN{'authorname'} attempted to edit entries without authorization"); $statusnote = qq(You don't have access to edit entries.

); &gm_frontpage; } &gm_readcounter; if ($newentrynumber eq "0") { $statusnote = qq(There are no entries yet!

); &gm_frontpage; } if ($IN{'entryselectionview'} eq "") { $IN{'entryselectionview'} = $defaultentrylistview; } $searchingfortext = ""; if ($IN{'entrysearch'} ne "") { $searchingfortext = qq(

\nAll entries containing "$IN{'entrysearch'}"\n

\n); $IN{'entryselectionview'} = "searchresults"; $IN{'entrysearch'} = &relouse($IN{'entrysearch'}); } if ($statusnote eq "") { $statusnote = qq(Entry Selection
Select an entry to edit or review. "Closed" entries are considered deleted
and are no longer visible on your site, but can be reopened at any time.

); } if ($gmentryeditaccess eq "mineonly") { $statusnote .= qq(You only have access to edit your own entries.

); } open (FUNNYFEET, "gm-entrylist.cgi") || &gm_dangermouse("Can't read the entrylist file. Please make sure that gm-entrylist.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); @gmentrylist = ; close (FUNNYFEET); if ($IN{'sortby'} eq "subject") { @gmentrylist = sort { @a_fields = split /\|/, $a; @b_fields = split /\|/, $b; lc($a_fields[2]) cmp lc($b_fields[2]) || $b_fields[0] <=> $a_fields[0]; } @gmentrylist; } if ($IN{'sortby'} eq "author") { @gmentrylist = sort { @a_fields = split /\|/, $a; @b_fields = split /\|/, $b; lc($a_fields[1]) cmp lc($b_fields[1]) || $b_fields[0] <=> $a_fields[0]; } @gmentrylist; } print< \n

\n \n

List:   \n

Sort by: ); if ($IN{'sortby'} eq "subject") { print qq( Date   Subject   Author); } elsif ($IN{'sortby'} eq "author") { print qq( Date   Subject   Author); } else { print qq( Date   Subject   Author); } print< $listnotice

"We must be the change we wish to see in the world."—Gandhi $gmframebottom GMEDITENTRYSELECTIONMENUBOTTOM $statusnote = ""; exit; } # ------------------------------------ # editing entries - search and replace # ------------------------------------ sub gm_editentrysearchandreplace { &gm_validate; if ($gmentryeditaccess eq "no") { &gm_writetocplog("$IN{'authorname'} attempted to perform a search-and-replace without authorization"); $statusnote = qq(You don't have access to perform a search-and-replace.

); &gm_frontpage; } if ($gmentryeditaccess eq "mineonly") { $statusnote = qq(You must have access to edit all entries to do this.

); &gm_editentryselection; } if ($statusnote eq "") { $statusnote = qq(Search And Replace
Enter whatever exact text or other information you wish to search across entries for in the
first box, and whatever you wish to replace it with in the second box (leave the Replace
box blank to delete all instances of your search term). Keep in mind that a search-and-replace
will make permanent changes to the contents of ALL entries that contain your search term.

); } print<

$gmfonttagSearch For:$gmfonttag
$gmfonttagReplace With:$gmfonttag

Make "Search For" term case-insensitive?

"Search others for their virtues, thyself for thy vices."—Benjamin Franklin $gmframebottom GMEDITENTRYSEARCHREPLACE $statusnote = ""; exit; } # -------------------------- # perform search and replace # -------------------------- sub gm_performsearchandreplace { &gm_validate; if ($gmentryeditaccess eq "no") { &gm_writetocplog("$IN{'authorname'} attempted to perform a search-and-replace without authorization"); $statusnote = qq(You don't have access to perform a search-and-replace.

); &gm_frontpage; } if ($gmentryeditaccess eq "mineonly") { $statusnote = qq(You must have access to edit all entries to do this.

); &gm_editentryselection; } &gm_readcounter; $currententrycounter = $newentrynumber; $entriesaffected = 0; $listofaffectedentries = ""; $rebuildentrylist = "no"; do { $currententrycounterpadded = sprintf ("%8d", $currententrycounter); $currententrycounterpadded =~ tr/ /0/; open (FUNNYFEET, "$EntriesPath/$currententrycounterpadded.cgi") || &gm_dangermouse("Can't read $EntriesPath/$currententrycounterpadded.cgi. Please make sure that your entries/archives directory is correctly configured and is CHMODed to 777, or try running Diagnostics & Repair in the Configuration screen."); @entrylines = ; close (FUNNYFEET); $gmcounter = 0; $resaveentry = "no"; chomp ($entrylines[0]); ($thisentrynumber, $thisentryauthor, $thisentrysubject, $thisentryweekdaynumber, $thisentrymonth, $thisentryday, $thisentryyearyear, $thisentryhour, $thisentryminute, $thisentrysecond, $thisentryampm, $thisentrypositivekarma, $thisentrynegativekarma, $thisentrycommentsnumber, $thisentryallowkarma, $thisentryallowcomments, $thisentryopenstatus) = split (/\|/, $entrylines[0]); if ($IN{'srcaseinsensitive'} eq "yes") { if ($thisentrysubject =~ m/$IN{'srsearchterm'}/i) { $thisentrysubject =~ s/$IN{'srsearchterm'}/$IN{'srreplaceterm'}/ig; $entrylines[0] = "$thisentrynumber|$thisentryauthor|$thisentrysubject|$thisentryweekdaynumber|$thisentrymonth|$thisentryday|$thisentryyearyear|$thisentryhour|$thisentryminute|$thisentrysecond|$thisentryampm|$thisentrypositivekarma|$thisentrynegativekarma|$thisentrycommentsnumber|$thisentryallowkarma|$thisentryallowcomments|$thisentryopenstatus"; $resaveentry = "yes"; $rebuildentrylist = "yes"; } } else { if ($thisentrysubject =~ m/$IN{'srsearchterm'}/) { $thisentrysubject =~ s/$IN{'srsearchterm'}/$IN{'srreplaceterm'}/g; $entrylines[0] = "$thisentrynumber|$thisentryauthor|$thisentrysubject|$thisentryweekdaynumber|$thisentrymonth|$thisentryday|$thisentryyearyear|$thisentryhour|$thisentryminute|$thisentrysecond|$thisentryampm|$thisentrypositivekarma|$thisentrynegativekarma|$thisentrycommentsnumber|$thisentryallowkarma|$thisentryallowcomments|$thisentryopenstatus"; $resaveentry = "yes"; $rebuildentrylist = "yes"; } } foreach (@entrylines) { chomp ($entrylines[$gmcounter]); unless (($gmcounter eq "0") || ($gmcounter eq "1")) { if ($IN{'srcaseinsensitive'} eq "yes") { if ($entrylines[$gmcounter] =~ m/$IN{'srsearchterm'}/i) { $entrylines[$gmcounter] =~ s/$IN{'srsearchterm'}/$IN{'srreplaceterm'}/ig; $resaveentry = "yes"; } } else { if ($entrylines[$gmcounter] =~ m/$IN{'srsearchterm'}/) { $entrylines[$gmcounter] =~ s/$IN{'srsearchterm'}/$IN{'srreplaceterm'}/g; $resaveentry = "yes"; } } } $gmcounter++; } if ($resaveentry eq "yes") { open (FUNNYFEET, ">$EntriesPath/$currententrycounterpadded.cgi") || &gm_dangermouse("Can't write to $EntriesPath/$currententrycounterpadded.cgi. Please make sure that your entries/archives directory is correctly configured and is CHMODed to 777, or try running Diagnostics & Repair in the Configuration screen."); foreach $thisistheline (@entrylines) { print FUNNYFEET "$thisistheline\n"; } close (FUNNYFEET); $entriesaffected++; $listofaffectedentries .= "$currententrycounter|"; } $currententrycounter--; } until $currententrycounter eq "0"; if ($rebuildentrylist eq "yes") { $checkentrycounter = $newentrynumber; $rebuiltentrylist = ""; do { $checkentrycounterpadded = sprintf ("%8d", $checkentrycounter); $checkentrycounterpadded =~ tr/ /0/; &gm_getentryvariables($checkentrycounter); $checkentryopenstatus = "O"; $checkentrymorestatus = "N"; if ($thisentryopenstatus eq "closed") { $checkentryopenstatus = "C"; } if ($thisentrymorebody ne "") { $checkentrymorestatus = "Y"; } $rebuiltentrylist .= "$thisentrynumber|$thisentryauthor|$thisentrysubject|$thisentrymonthmonth\/$thisentrydayday\/$thisentryyear|$thisentryhourhour\:$thisentryminuteminute $thisentryampm|$checkentryopenstatus|$checkentrymorestatus\n"; $checkentrycounter--; } until $checkentrycounter eq "0"; open (FUNNYFEET, ">gm-entrylist.cgi") || &gm_dangermouse("Can't write to gm-entrylist.cgi. Make sure this file is in the same directory as all your Greymatter CGI files and is CHMODed to 666."); print FUNNYFEET $rebuiltentrylist; close (FUNNYFEET); } if ($listofaffectedentries ne "") { chop ($listofaffectedentries); @affectedentrylist = split (/\|/, $listofaffectedentries); } if ($entriesaffected eq "0") { &gm_writetocplog("$IN{'authorname'} searched all entries for \"$IN{'srsearchterm'}\" and replaced it with \"$IN{'srreplaceterm'}\" (no entries affected)"); $statusnote = qq(The search term was not found.

); $IN{'entryselectionview'} = "searchresults"; &gm_editentryselection; } elsif ($entriesaffected eq "1") { &gm_writetocplog("$IN{'authorname'} searched all entries for \"$IN{'srsearchterm'}\" and replaced it with \"$IN{'srreplaceterm'}\" (1 entry affected)"); $statusnote = qq(The search-and-replace was completed successfully \(1 entry affected\).
The affected entry is listed below.

); $IN{'entryselectionview'} = "searchresults"; &gm_editentryselection; } else { &gm_writetocplog("$IN{'authorname'} searched all entries for \"$IN{'srsearchterm'}\" and replaced it with \"$IN{'srreplaceterm'}\" ($entriesaffected entries affected)"); $statusnote = qq(The search-and-replace was completed successfully \($entriesaffected entries affected\).
All affected entries are listed below.

); $IN{'entryselectionview'} = "searchresults"; &gm_editentryselection; } } # ----------------------------------- # edit an entry - main editing screen # ----------------------------------- sub gm_editthisentry { &gm_validate; if ($gmentryeditaccess eq "no") { &gm_writetocplog("$IN{'authorname'} attempted to edit entry #$IN{'entryselectionlist'} without authorization"); $statusnote = qq(You don't have access to edit entries.

); &gm_frontpage; } if ($IN{'entryselectionlist'} eq "") { $statusnote = qq(You must select an entry to edit.

); &gm_editentryselection; } &gm_readconfig; &gm_readtemplates; &gm_readcounter; $thisentrynumberpadded = sprintf ("%8d", $IN{'entryselectionlist'}); $thisentrynumberpadded =~ tr/ /0/; open (FUNNYFEET, "$EntriesPath/$thisentrynumberpadded.cgi") || &gm_dangermouse("Can't read $EntriesPath/$thisentrynumberpadded.cgi. Please make sure that your entries/archives directory is correctly configured and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); @entrylines = ; close (FUNNYFEET); $gmcounter = 0; foreach (@entrylines) { chomp ($entrylines[$gmcounter]); $entrylines[$gmcounter] =~ s/\|\*\|/\n/g; $gmcounter++; } ($thisentrynumber, $thisentryauthor, $thisentrysubject, $thisentryweekdaynumber, $thisentrymonth, $thisentryday, $thisentryyearyear, $thisentryhour, $thisentryminute, $thisentrysecond, $thisentryampm, $thisentrypositivekarma, $thisentrynegativekarma, $thisentrycommentsnumber, $thisentryallowkarma, $thisentryallowcomments, $thisentryopenstatus) = split (/\|/, $entrylines[0]); if (($IN{'authorname'} ne $thisentryauthor) && ($gmentryeditaccess eq "mineonly")) { &gm_writetocplog("$IN{'authorname'} attempted to edit entry #$IN{'entryselectionlist'} (by $thisentryauthor) without authorization"); $statusnote = qq(You don't have access to edit entries you didn't create.

); &gm_editentryselection; } # chomp ($thisentryopenstatus); $thisentrymonthmonth = sprintf ("%2d", $thisentrymonth); $thisentrydayday = sprintf ("%2d", $thisentryday); $thisentryhourhour = sprintf ("%2d", $thisentryhour); $thisentryminuteminute = sprintf ("%2d", $thisentryminute); $thisentrysecondsecond = sprintf ("%2d", $thisentrysecond); $thisentrymonthmonth =~ tr/ /0/; $thisentrydayday =~ tr/ /0/; $thisentryhourhour =~ tr/ /0/; $thisentryminuteminute =~ tr/ /0/; $thisentrysecondsecond =~ tr/ /0/; $thisentrymainbody = $entrylines[2]; $thisentrymorebody = $entrylines[3]; $thisentrymainbody = &delouse($thisentrymainbody); $thisentrymorebody = &delouse($thisentrymorebody); $thisentrysubject = &delouse($thisentrysubject); if ($statusnote eq "") { $statusnote = qq(Editing Entry #$thisentrynumber: Posted by $thisentryauthor @ $thisentrymonthmonth/$thisentrydayday/$thisentryyearyear $thisentryhourhour\:$thisentryminuteminute\:$thisentrysecondsecond $thisentryampm

); } $autorebuildcheckbox = ""; if ($gmrebuildaccess eq "yes") { if ($automaticrebuilddefault eq "yes") { $autorebuildcheckbox = qq(

\n Automatically rebuild main index and this entry's page after saving\n
\nAfter clicking Save, expect a wait of up to several minutes if leaving this box checked.
DO NOT interrupt Greymatter while it's rebuilding!
); } else { $autorebuildcheckbox = qq(

\n Automatically rebuild main index and this entry's page after saving\n
\nAfter clicking Save, expect a wait of up to several minutes if leaving this box checked.
DO NOT interrupt Greymatter while it's rebuilding!
); } } print<
$gmfonttagSubject:$gmfonttag

Main Entry Text
$gmfonttag

Extended ("More") Entry Text
$gmfonttag

GMENTRYEDITTOP if ($thisentrycommentsnumber ne "0") { print qq(
); $commentcounter = 4; $commentcountermax = $thisentrycommentsnumber + 3; $alternatecommentrowone = "#EEF8FF"; $alternatecommentrowtwo = "#F8F8FF"; $alternatecommentrow = $alternatecommentrowone; do { if ($alternatecommentrow eq $alternatecommentrowone) { $alternatecommentrow = $alternatecommentrowtwo; } else { $alternatecommentrow = $alternatecommentrowone; } $thiscommentnumber = $commentcounter - 3; ($thiscommentauthor, $thiscommentauthorip, $thiscommentauthoremailabsolute, $thiscommentauthorhomepageabsolute, $thiscommentweekdaynumber, $thiscommentmonth, $thiscommentday, $thiscommentyearyear, $thiscommenthour, $thiscommentminute, $thiscommentsecond, $thiscommentampm, $thiscommenttext) = split (/\|/, $entrylines[$commentcounter]); $thiscommentmonthmonth = sprintf ("%2d", $thiscommentmonth); $thiscommentdayday = sprintf ("%2d", $thiscommentday); $thiscommenthourhour = sprintf ("%2d", $thiscommenthour); $thiscommentminuteminute = sprintf ("%2d", $thiscommentminute); $thiscommentsecondsecond = sprintf ("%2d", $thiscommentsecond); $thiscommentmonthmonth =~ tr/ /0/; $thiscommentdayday =~ tr/ /0/; $thiscommenthourhour =~ tr/ /0/; $thiscommentminuteminute =~ tr/ /0/; $thiscommentsecondsecond =~ tr/ /0/; $thiscommenttext =~ s//\>/g; $thiscommenttext =~ s/\|\*\|/\n/g; $thiscommenttext =~ s/\n/
/g; $thiscommenttext =~ s/

/

/g; # $thiscommenttext =~ s/ /  /g; print qq(

); $commentcounter++; } until $commentcounter > $commentcountermax; print qq(
$gmfonttag Select$gmfonttag Comment
$gmfonttag\#$thiscommentnumber\: Posted by $thiscommentauthor ($thiscommentauthorip) @ $thiscommentmonthmonth/$thiscommentdayday/$thiscommentyearyear $thiscommenthourhour\:$thiscommentminuteminute\:$thiscommentsecondsecond $thiscommentampm

$thiscommenttext); if (($thiscommentauthoremailabsolute ne "") && ($thiscommentauthorhomepageabsolute ne "")) { print qq(

----------
E-Mail: $thiscommentauthoremailabsolute
Homepage: $thiscommentauthorhomepageabsolute); } else { if ($thiscommentauthoremailabsolute ne "") { print qq(

----------
E-Mail: $thiscommentauthoremailabsolute); } if ($thiscommentauthorhomepageabsolute ne "") { print qq(

----------
Homepage: $thiscommentauthorhomepageabsolute); } } print qq(

\n

\n

\n); } if ($thisentrypositivekarma ne "0") { print qq(
$gmfonttag Positive karma votes from (IPs): ); $karmatempipline = ""; @karmatempiptally = split (/\|/, $entrylines[1]); $gmcounter = 0; foreach (@karmatempiptally) { if ($karmatempiptally[$gmcounter] eq "P") { $karmatempipline .= "$karmatempiptally[$gmcounter - 1], "; } $gmcounter++; } substr($karmatempipline, -2, 2) = ""; print qq($karmatempipline \($thisentrypositivekarma total\)
\n

\n); } if ($thisentrynegativekarma ne "0") { print qq(
$gmfonttag Negative karma votes from (IPs): ); $karmatempipline = ""; @karmatempiptally = split (/\|/, $entrylines[1]); $gmcounter = 0; foreach (@karmatempiptally) { if ($karmatempiptally[$gmcounter] eq "N") { $karmatempipline .= "$karmatempiptally[$gmcounter - 1], "; } $gmcounter++; } substr($karmatempipline, -2, 2) = ""; print qq($karmatempipline \($thisentrynegativekarma total\)
\n

\n); } if (($allowkarmaorcomments eq "karma") || ($allowkarmaorcomments eq "both")) { if ($thisentryallowkarma eq "yes") { print qq(Allow karma voting on this entry: Yes No\n); } else { print qq(Allow karma voting on this entry: Yes No\n); } } else { print qq(\n); } if ($allowkarmaorcomments eq "both") { print "
\n"; } if (($allowkarmaorcomments eq "comments") || ($allowkarmaorcomments eq "both")) { if ($thisentryallowcomments eq "yes") { print qq(Allow comments to be posted to this entry: Yes No\n
\n); } else { print qq(Allow comments to be posted to this entry: Yes No\n
\n); } } else { print qq(\n); } if ($newstayattopnumber eq $thisentrynumber) { print qq(Keep this entry at the top of the main page: Yes No\n
\n); } else { print qq(Keep this entry at the top of the main page: Yes No\n
\n); } if ($thisentryopenstatus eq "open") { print qq(This entry is: Open Closed\n); } else { print qq(This entry is: Open Closed\n); } print<

"Always changing; everything for good, nothing for nothing."—Flying Hawk, Sioux Chief $gmframebottom GMENTRYEDITBOTTOM exit; } # ---------------------------- # save changes to edited entry # ---------------------------- sub gm_saveentrychanges { &gm_validate; if ($gmentryeditaccess eq "no") { &gm_writetocplog("$IN{'authorname'} attempted to edit entry #$IN{'revisedentrynumber'} without authorization"); $statusnote = qq(You don't have access to edit entries.

); &gm_frontpage; } if (($IN{'authorname'} ne $IN{'revisedentryauthor'}) && ($gmentryeditaccess eq "mineonly")) { &gm_writetocplog("$IN{'authorname'} attempted to edit entry #$IN{'entryselectionlist'} (by $IN{'revisedentryauthor'}) without authorization"); $statusnote = qq(You don't have access to edit entries you didn't create.

); &gm_editentryselection; } $IN{'revisedentrysubject'} = &configdelouse($IN{'revisedentrysubject'}); if ($IN{'revisedentrymaintext'} eq "") { $statusnote = qq(You left the main text field blank. Please try again.

); $IN{'entryselectionlist'} = $IN{'revisedentrynumber'}; &gm_editthisentry; } &gm_readconfig; &gm_readtemplates; &gm_readcounter; $thisentrynumberpadded = sprintf ("%8d", $IN{'revisedentrynumber'}); $thisentrynumberpadded =~ tr/ /0/; open (FUNNYFEET, "$EntriesPath/$thisentrynumberpadded.cgi") || &gm_dangermouse("Can't read $EntriesPath/$thisentrynumberpadded.cgi. Please make sure your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); @entrylines = ; close (FUNNYFEET); $gmcounter = 0; foreach (@entrylines) { chomp ($entrylines[$gmcounter]); $gmcounter++; } ($thisentrynumber, $thisentryauthor, $thisentrysubject, $thisentryweekdaynumber, $thisentrymonth, $thisentryday, $thisentryyearyear, $thisentryhour, $thisentryminute, $thisentrysecond, $thisentryampm, $thisentrypositivekarma, $thisentrynegativekarma, $thisentrycommentsnumber, $thisentryallowkarma, $thisentryallowcomments, $thisentryopenstatus) = split (/\|/, $entrylines[0]); chomp ($thisentryopenstatus); if (($thisentryopenstatus eq "open") && ($IN{'revisedentryopenstatus'} eq "closed")) { $newalltimeopenentriesnumber--; $newalltimeclosedentriesnumber++; } if (($thisentryopenstatus eq "closed") && ($IN{'revisedentryopenstatus'} eq "open")) { $newalltimeopenentriesnumber++; $newalltimeclosedentriesnumber--; } $thisentryyear = substr($thisentryyearyear, -2, 2); @months = ("null", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); @weekdays = ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"); $thisentryweekday = $weekdays[$thisentryweekdaynumber]; $thisentrymonthword = $months[$thisentrymonth]; $thisentrymonthmonth = sprintf ("%2d", $thisentrymonth); $thisentrydayday = sprintf ("%2d", $thisentryday); $thisentryhourhour = sprintf ("%2d", $thisentryhour); $thisentryminuteminute = sprintf ("%2d", $thisentryminute); $thisentrysecondsecond = sprintf ("%2d", $thisentrysecond); $thisentrymonthmonth =~ tr/ /0/; $thisentrydayday =~ tr/ /0/; $thisentryhourhour =~ tr/ /0/; $thisentryminuteminute =~ tr/ /0/; $thisentrysecondsecond =~ tr/ /0/; $IN{'revisedentrysubject'} = &configdelouse($IN{'revisedentrysubject'}); $IN{'revisedentrysubject'} = &relouse($IN{'revisedentrysubject'}); $IN{'revisedentrymaintext'} = &relouse($IN{'revisedentrymaintext'}); $IN{'revisedentrymoretext'} = &relouse($IN{'revisedentrymoretext'}); open (FUNNYFEET, ">$EntriesPath/$thisentrynumberpadded.cgi") || &gm_dangermouse("Can't write to $EntriesPath/$thisentrynumberpadded.cgi. Please make sure your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); print FUNNYFEET "$thisentrynumber|$thisentryauthor|$IN{'revisedentrysubject'}|$thisentryweekdaynumber|$thisentrymonth|$thisentryday|$thisentryyearyear|$thisentryhour|$thisentryminute|$thisentrysecond|$thisentryampm|$thisentrypositivekarma|$thisentrynegativekarma|$thisentrycommentsnumber|$IN{'revisedentryallowkarma'}|$IN{'revisedentryallowcomments'}|$IN{'revisedentryopenstatus'}\n"; print FUNNYFEET "$entrylines[1]\n"; print FUNNYFEET "$IN{'revisedentrymaintext'}\n"; print FUNNYFEET "$IN{'revisedentrymoretext'}\n"; if ($thisentrycommentsnumber ne "0") { $commentcounter = 4; $commentcountermax = $thisentrycommentsnumber + 3; do { unless ($entrylines[$commentcounter] eq "") { print FUNNYFEET "$entrylines[$commentcounter]\n"; } $commentcounter++; } until $commentcounter > $commentcountermax; } close (FUNNYFEET); open (FUNNYFEET, "gm-entrylist.cgi") || &gm_dangermouse("Can't read the entrylist file. Please make sure that gm-entrylist.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); @originalentrylist = ; close (FUNNYFEET); $revisedentrymorestatus = "N"; if ($IN{'revisedentrymoretext'} ne "") { $revisedentrymorestatus = "Y"; } $revisedentrymarkopen = "O"; if ($IN{'revisedentryopenstatus'} eq "closed") { $revisedentrymarkopen = "C"; } open (FUNNYFEET, ">gm-entrylist.cgi") || &gm_dangermouse("Can't write to the entrylist file. Please make sure that gm-entrylist.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); foreach $thisentrylistline (@originalentrylist) { chomp ($thisentrylistline); ($thisentrylistnumber, $thisentrylistauthor, $thisentrylistsubject, $thisentrylistdate, $thisentrylisttime, $thisentrylistopenstatus, $thisentrylistmorestatus) = split (/\|/, $thisentrylistline); if ($thisentrylistnumber eq $IN{'revisedentrynumber'}) { print FUNNYFEET "$IN{'revisedentrynumber'}|$thisentrylistauthor|$IN{'revisedentrysubject'}|$thisentrylistdate|$thisentrylisttime|$revisedentrymarkopen|$revisedentrymorestatus\n"; } else { print FUNNYFEET "$thisentrylistline\n"; } } close (FUNNYFEET); if (($IN{'revisedentrystayattop'} eq "no") && ($newstayattopnumber eq $thisentrynumber)) { $newstayattopnumber = 0; } if ($IN{'revisedentrystayattop'} eq "yes") { $newstayattopnumber = $thisentrynumber; } &gm_writecounter; $recordentrysubject = $IN{'revisedentrysubject'}; if ($recordentrysubject eq "") { $recordentrysubject = "[no subject]"; } &gm_writetocplog("$IN{'authorname'} edited an entry (#$IN{'revisedentrynumber'}: $recordentrysubject)"); if ($IN{'autorebuild'} eq "indexandentry") { &gm_readconfig; &gm_readcounter; &gm_readtemplates; &gm_generatemainindex; &gm_getentryvariables($IN{'revisedentrynumber'}); if (($thisentryopenstatus eq "open") && ($generateentrypages eq "yes")) { if ($thisentrymorebody ne "") { &gm_formatentry($gmmoreentrypagetemplate); } else { &gm_formatentry($gmentrypagetemplate); } open (THISFILE, ">$EntriesPath/$thisentrynumberpadded.$entrysuffix") || &gm_dangermouse("Can't write to $EntriesPath/$thisentrynumberpadded.$entrysuffix. Please make sure that your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); print THISFILE $entryreturn; close (THISFILE); chmod (0666, "$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } else { unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } $statusnote = qq(Entry #$IN{'revisedentrynumber'} ($recordentrysubject) has been edited
and the main index & this entry's page have been rebuilt.

); } else { $statusnote = qq(Entry #$IN{'revisedentrynumber'} ($recordentrysubject) has been edited.
Be sure to rebuild your files for the changes to be visible on your site.

); } &gm_frontpage; } # ------------------------ # change entry open status # ------------------------ sub gm_changeentryopenstatus { &gm_validate; if ($gmentryeditaccess eq "no") { &gm_writetocplog("$IN{'authorname'} attempted to change the open/closed status on entry #$IN{'revisedentrynumber'} without authorization"); $statusnote = qq(You don't have access to open/close entries.

); &gm_frontpage; } if ($IN{'entryselectionlist'} eq "") { $statusnote = qq(You must select an entry to open or close.

); &gm_editentryselection; } &gm_readconfig; &gm_readtemplates; &gm_readcounter; $thisentrynumberpadded = sprintf ("%8d", $IN{'entryselectionlist'}); $thisentrynumberpadded =~ tr/ /0/; open (FUNNYFEET, "$EntriesPath/$thisentrynumberpadded.cgi") || &gm_dangermouse("Can't read $EntriesPath/$thisentrynumberpadded.cgi. Please make sure your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); @entrylines = ; close (FUNNYFEET); $gmcounter = 0; foreach (@entrylines) { chomp ($entrylines[$gmcounter]); $gmcounter++; } ($thisentrynumber, $thisentryauthor, $thisentrysubject, $thisentryweekdaynumber, $thisentrymonth, $thisentryday, $thisentryyearyear, $thisentryhour, $thisentryminute, $thisentrysecond, $thisentryampm, $thisentrypositivekarma, $thisentrynegativekarma, $thisentrycommentsnumber, $thisentryallowkarma, $thisentryallowcomments, $thisentryopenstatus) = split (/\|/, $entrylines[0]); if (($IN{'authorname'} ne $thisentryauthor) && ($gmentryeditaccess eq "mineonly")) { &gm_writetocplog("$IN{'authorname'} attempted to change the open/closed status on entry #$IN{'entryselectionlist'} (by $thisentryauthor) without authorization"); $statusnote = qq(You don't have access to open/close entries you didn't create.

); &gm_editentryselection; } if ($thisentryopenstatus eq "open") { $newalltimeopenentriesnumber--; $newalltimeclosedentriesnumber++; $thisentryopenstatus = "closed"; } else { $newalltimeopenentriesnumber++; $newalltimeclosedentriesnumber--; $thisentryopenstatus = "open"; } $gmcounter = 0; &gm_writecounter; open (FUNNYFEET, ">$EntriesPath/$thisentrynumberpadded.cgi") || &gm_dangermouse("Can't write to $EntriesPath/$thisentrynumberpadded.cgi. Please make sure your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); print FUNNYFEET "$thisentrynumber|$thisentryauthor|$thisentrysubject|$thisentryweekdaynumber|$thisentrymonth|$thisentryday|$thisentryyearyear|$thisentryhour|$thisentryminute|$thisentrysecond|$thisentryampm|$thisentrypositivekarma|$thisentrynegativekarma|$thisentrycommentsnumber|$thisentryallowkarma|$thisentryallowcomments|$thisentryopenstatus\n"; foreach (@entrylines) { unless ($gmcounter eq "0") { print FUNNYFEET "$entrylines[$gmcounter]\n"; } $gmcounter++; } close (FUNNYFEET); open (FUNNYFEET, "gm-entrylist.cgi") || &gm_dangermouse("Can't read the entrylist file. Please make sure that gm-entrylist.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); @originalentrylist = ; close (FUNNYFEET); open (FUNNYFEET, ">gm-entrylist.cgi") || &gm_dangermouse("Can't write to the entrylist file. Please make sure that gm-entrylist.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files; also try running Diagnostics & Repair from the Configuration screen."); foreach $thisentrylistline (@originalentrylist) { chomp ($thisentrylistline); ($thisentrylistnumber, $thisentrylistauthor, $thisentrylistsubject, $thisentrylistdate, $thisentrylisttime, $thisentrylistopenstatus, $thisentrylistmorestatus) = split (/\|/, $thisentrylistline); if ($thisentrylistnumber eq $thisentrynumber) { if ($thisentrylistopenstatus eq "O") { $thisentrylistopenstatus = "C"; } else { $thisentrylistopenstatus = "O"; } print FUNNYFEET "$thisentrylistnumber|$thisentrylistauthor|$thisentrylistsubject|$thisentrylistdate|$thisentrylisttime|$thisentrylistopenstatus|$thisentrylistmorestatus\n"; } else { print FUNNYFEET "$thisentrylistline\n"; } } close (FUNNYFEET); if ($thisentryopenstatus eq "open") { &gm_writetocplog("$IN{'authorname'} reopened an entry (#$thisentrynumber: $thisentrysubject)"); } else { &gm_writetocplog("$IN{'authorname'} closed an entry (#$thisentrynumber: $thisentrysubject)"); } if ($thisentryopenstatus eq "open") { $statusnote = qq(Entry #$thisentrynumber ($thisentrysubject) has been reopened.
Be sure to rebuild your files for the changes to be visible on your site.

); } else { $statusnote = qq(Entry #$thisentrynumber ($thisentrysubject) has been closed.
Be sure to rebuild your files for the changes to be visible on your site.

); } &gm_editentryselection; } # ----------------------- # delete selected comment # ----------------------- sub gm_deleteselectedcomment { &gm_validate; if ($gmentryeditaccess eq "no") { &gm_writetocplog("$IN{'authorname'} attempted to delete a comment from entry #$IN{'revisedentrynumber'} ($IN{'revisedentrysubject'}) without authorization"); $statusnote = qq(You don't have access to delete comments.

); &gm_frontpage; } if ($IN{'revisedentrycommentselection'} eq "") { $statusnote = qq(You must select a comment to be deleted.

); &gm_editthisentry; } if (($IN{'authorname'} ne $IN{'revisedentryauthor'}) && ($gmentryeditaccess eq "mineonly")) { &gm_writetocplog("$IN{'authorname'} attempted to delete a comment from entry #$IN{'entryselectionlist'} (by $IN{'revisedentryauthor'}) without authorization"); $statusnote = qq(You don't have access to delete comments from entries you didn't create.

); &gm_editentryselection; } $deleteme = $IN{'revisedentrycommentselection'} + 3; $thisentrynumberpadded = sprintf ("%8d", $IN{'revisedentrynumber'}); $thisentrynumberpadded =~ tr/ /0/; open (FUNNYFEET, "$EntriesPath/$thisentrynumberpadded.cgi") || &gm_dangermouse("Can't read $EntriesPath/$thisentrynumberpadded.cgi. Please make sure that your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); @entrylines = ; close (FUNNYFEET); ($thisentrynumber, $thisentryauthor, $thisentrysubject, $thisentryweekdaynumber, $thisentrymonth, $thisentryday, $thisentryyearyear, $thisentryhour, $thisentryminute, $thisentrysecond, $thisentryampm, $thisentrypositivekarma, $thisentrynegativekarma, $thisentrycommentsnumber, $thisentryallowkarma, $thisentryallowcomments, $thisentryopenstatus) = split (/\|/, $entrylines[0]); if (($IN{'authorname'} ne $IN{'revisedentryauthor'} ) && ($gmentryeditaccess eq "mineonly")) { &gm_writetocplog("$IN{'authorname'} attempted to delete entry #$IN{'entryselectionlist'} (by $IN{'revisedentryauthor'}) without authorization"); $statusnote = qq(You don't have access to delete entries you didn't create.

); &gm_editentryselection; } $thisentrycommentsnumber--; $entrylines[0] = "$thisentrynumber|$thisentryauthor|$thisentrysubject|$thisentryweekdaynumber|$thisentrymonth|$thisentryday|$thisentryyearyear|$thisentryhour|$thisentryminute|$thisentrysecond|$thisentryampm|$thisentrypositivekarma|$thisentrynegativekarma|$thisentrycommentsnumber|$thisentryallowkarma|$thisentryallowcomments|$thisentryopenstatus"; $entrylines[$deleteme] = "*DELETED*"; open (FUNNYFEET, ">$EntriesPath/$thisentrynumberpadded.cgi") || &gm_dangermouse("Can't write to $EntriesPath/$thisentrynumberpadded.cgi. Please make sure that your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); foreach $revisedentryline (@entrylines) { chomp ($revisedentryline); unless ($revisedentryline eq "*DELETED*") { print FUNNYFEET "$revisedentryline\n"; } } close (FUNNYFEET); &gm_readcounter; $newalltimecommentstotalnumber--; &gm_writecounter; &gm_writetocplog("$IN{'authorname'} deleted a comment from entry #$IN{'revisedentrynumber'} ($IN{'revisedentrysubject'})"); $statusnote = qq(The comment has been deleted.

); $IN{'entryselectionlist'} = $IN{'revisedentrynumber'}; &gm_editthisentry; } # --------------------- # edit selected comment # --------------------- sub gm_editselectedcomment { &gm_validate; if ($gmentryeditaccess eq "no") { &gm_writetocplog("$IN{'authorname'} attempted to edit comment #$IN{'revisedentrycommentselection'} in entry #$IN{'revisedentrynumber'} ($IN{'revisedentrysubject'}) without authorization"); $statusnote = qq(You don't have access to edit comments.

); &gm_frontpage; } if ($IN{'revisedentrycommentselection'} eq "") { $statusnote = qq(You must select a comment to be edited.

); $IN{'entryselectionlist'} = $IN{'revisedentrynumber'}; &gm_editthisentry; } if (($IN{'authorname'} ne $IN{'revisedentryauthor'}) && ($gmentryeditaccess eq "mineonly")) { &gm_writetocplog("$IN{'authorname'} attempted to edit a comment in entry #$IN{'entryselectionlist'} (by $IN{'revisedentryauthor'}) without authorization"); $statusnote = qq(You don't have access to edit comments in entries you didn't create.

); &gm_editentryselection; } $thisentrynumberpadded = sprintf ("%8d", $IN{'revisedentrynumber'}); $thisentrynumberpadded =~ tr/ /0/; $editme = $IN{'revisedentrycommentselection'} + 3; open (FUNNYFEET, "$EntriesPath/$thisentrynumberpadded.cgi") || &gm_dangermouse("Can't read $EntriesPath/$thisentrynumberpadded.cgi. Please make sure that your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); @entrylines = ; close (FUNNYFEET); chomp ($entrylines[$editme]); $entrylines[$editme] =~ s/\|\*\|/\n/g; ($thiscommentauthor, $thiscommentauthorip, $thiscommentauthoremailabsolute, $thiscommentauthorhomepageabsolute, $thiscommentweekdaynumber, $thiscommentmonth, $thiscommentday, $thiscommentyearyear, $thiscommenthour, $thiscommentminute, $thiscommentsecond, $thiscommentampm, $thiscommenttext) = split (/\|/, $entrylines[$editme]); $thiscommentmonthmonth = sprintf ("%2d", $thiscommentmonth); $thiscommentdayday = sprintf ("%2d", $thiscommentday); $thiscommenthourhour = sprintf ("%2d", $thiscommenthour); $thiscommentminuteminute = sprintf ("%2d", $thiscommentminute); $thiscommentsecondsecond = sprintf ("%2d", $thiscommentsecond); $thiscommentmonthmonth =~ tr/ /0/; $thiscommentdayday =~ tr/ /0/; $thiscommenthourhour =~ tr/ /0/; $thiscommentminuteminute =~ tr/ /0/; $thiscommentsecondsecond =~ tr/ /0/; $thiscommenttext = &delouse($thiscommenttext); if ($statusnote eq "") { $statusnote = qq(Editing Comment #$IN{'revisedentrycommentselection'} In Entry #$IN{'revisedentrynumber'} ($IN{'revisedentrysubject'})\n
\nPosted @ $thiscommentmonthmonth/$thiscommentdayday/$thiscommentyearyear $thiscommenthourhour\:$thiscommentminuteminute\:$thiscommentsecondsecond $thiscommentampm

); } print<
$gmfonttagAuthor:$gmfonttag
$gmfonttagE-Mail:$gmfonttag
$gmfonttagHomepage:$gmfonttag

Comment Text
$gmfonttag

"All good men are happy when they choose to be their own authors. Those who choose to have
others edit their pathways, must live on the edge of another man's sword."—Julie Arabi
$gmframebottom GMEDITCOMMENT exit; } # -------------------- # save comment changes # -------------------- sub gm_savecommentchanges { &gm_validate; if ($gmentryeditaccess eq "no") { &gm_writetocplog("$IN{'authorname'} attempted to edit comment #$IN{'revisedentrycommentselection'} in entry #$IN{'revisedentrynumber'} ($IN{'revisedentrysubject'}) without authorization"); $statusnote = qq(You don't have access to edit comments.

); &gm_frontpage; } if (($IN{'authorname'} ne $IN{'revisedentryauthor'}) && ($gmentryeditaccess eq "mineonly")) { &gm_writetocplog("$IN{'authorname'} attempted to edit comment #$IN{'revisedentrycommentselection'} in entry #$IN{'entryselectionlist'} (by $IN{'revisedentryauthor'}) without authorization"); $statusnote = qq(You don't have access to edit comments in entries you didn't create.

); &gm_editentryselection; } $IN{'entryselectionlist'} = $IN{'revisedentrynumber'}; $IN{'revisedentrycommentauthor'} = &configdelouse($IN{'revisedentrycommentauthor'}); $IN{'revisedentrycommentauthoremail'} = &configdelouse($IN{'revisedentrycommentauthoremail'}); $IN{'revisedentrycommentauthorhomepage'} = &configdelouse($IN{'revisedentrycommentauthorhomepage'}); $IN{'revisedentrycommenttext'} = &relouse($IN{'revisedentrycommenttext'}); if (($IN{'revisedentrycommentauthor'} eq "") || ($IN{'revisedentrycommenttext'} eq "")) { $statusnote = qq(You left either the comment author or text blank. Please try again.

); &gm_editselectedcomment; } $thisentrynumberpadded = sprintf ("%8d", $IN{'revisedentrynumber'}); $thisentrynumberpadded =~ tr/ /0/; open (FUNNYFEET, "$EntriesPath/$thisentrynumberpadded.cgi") || &gm_dangermouse("Can't read $EntriesPath/$thisentrynumberpadded.cgi. Please make sure that your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); @entrylines = ; close (FUNNYFEET); $editme = $IN{'revisedentrycommentselection'} + 3; chomp ($entrylines[$editme]); ($thiscommentauthor, $thiscommentauthorip, $thiscommentauthoremailabsolute, $thiscommentauthorhomepageabsolute, $thiscommentweekdaynumber, $thiscommentmonth, $thiscommentday, $thiscommentyearyear, $thiscommenthour, $thiscommentminute, $thiscommentsecond, $thiscommentampm, $thiscommenttext) = split (/\|/, $entrylines[$editme]); $entrylines[$editme] = "$IN{'revisedentrycommentauthor'}|$thiscommentauthorip|$IN{'revisedentrycommentauthoremail'}|$IN{'revisedentrycommentauthorhomepage'}|$thiscommentweekdaynumber|$thiscommentmonth|$thiscommentday|$thiscommentyearyear|$thiscommenthour|$thiscommentminute|$thiscommentsecond|$thiscommentampm|$IN{'revisedentrycommenttext'}"; $gmcounter = 0; open (FUNNYFEET, ">$EntriesPath/$thisentrynumberpadded.cgi") || &gm_dangermouse("Can't write to $EntriesPath/$thisentrynumberpadded.cgi. Please make sure that your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); foreach (@entrylines) { chomp ($entrylines[$gmcounter]); print FUNNYFEET "$entrylines[$gmcounter]\n"; $gmcounter++; } close (FUNNYFEET); &gm_writetocplog("$IN{'authorname'} edited comment #$IN{'revisedentrycommentselection'} in entry #$IN{'revisedentrynumber'} ($IN{'revisedentrysubject'})"); $statusnote = qq(Comment #$IN{'revisedentrycommentselection'} has been edited. Be sure to rebuild your files
to make the changes visible on that entry's page.

); &gm_editthisentry; } # ---------------------------- # diagnostics & repair - check # ---------------------------- sub gm_diagnosticscheck { &gm_validate; if ($gmconfigurationaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to perform diagnostics & repair without authorization"); $statusnote = qq(You don't have access to perform diagnostics & repair.

); &gm_frontpage; } print<Diagnostics & Repair

This will check file access and permissions for your Greymatter installation, correctly CHMOD all files (if it can; you will need to do this manually if Greymatter can't do this automatically), repair any missing entries or corrupt counter files, and rebuild your entry list. If you are installing Greymatter for the first time, if you've changed your path settings and want to verify them, or if you believe an important configuration file might be corrupt, click below to run diagnostics and rebuilding operations on your Greymatter setup. Running this will not alter your files. Note: This will verify your Local paths, but it cannot verify your Website paths.

Please wait for several moments after clicking (or even minutes if you have a large number of entries).
DO NOT interrupt this procedure once started!

"The body must be repaired and supported, if we would preserve the mind in all its vigor."—Pliny the Younger $gmframebottom GMDIAGNOSTICSCHECK exit; } # ------------------------------ # diagnostics & repair - perform # ------------------------------ sub gm_diagnosticsperform { &gm_validate; if ($gmconfigurationaccess ne "yes") { &gm_writetocplog("$IN{'authorname'} attempted to perform diagnostics & repair without authorization"); $statusnote = qq(You don't have access to perform diagnostics & repair.

); &gm_frontpage; } $docreport = "

 {{day}}{{day}}