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 = <FUNNYFEET>;
close (FUNNYFEET);
$cplogtext = join (" ", @cploglines);
unless ($cplogtext =~ /successfully performed diagnostics/) {
$statusnote = qq(<B><FONT COLOR="#0000FF">Welcome to Greymatter! Please enter Configuration first, check your paths,<BR>and run Diagnostics & Repair to validate your installation.</FONT></B><P>);
}
}
&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 ($indexfilenameprefix eq "index.") { $indexfilenamesmartcheck = "/"; }
$visityoursitelink = qq(<FORM ACTION="$LogWebPath$indexfilenamesmartcheck" TARGET="NEW">\n<TR><TD VALIGN=TOP ALIGN=CENTER COLSPAN=2>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" VALUE="Visit Your Site" STYLE="background: #D0FFD0; width: 500"><BR>Open your weblog/journal in a new browser window.</FONT></FONT></TD></TR>\n</FORM>);
<TR><TD VALIGN=TOP ALIGN=CENTER COLSPAN=2>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Add A New Entry" STYLE="background: #D0FFD0; width: 500"><BR>Post a new entry to your weblog/journal.</FONT></FONT></TD></TR>
<TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Configuration"><BR>Your site's settings and options.</FONT></FONT></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Edit An Entry"><BR>Edit and delete entries or comments.</FONT></FONT></TD></TR>
<TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Edit Templates"><BR>Change your site's layout and appearance.</FONT></FONT></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Edit Authors"><BR>Edit or add authors to post to your site.</FONT></FONT></TD></TR>
<TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Rebuild Files"><BR>Regenerate part or all of your site.</FONT></FONT></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="View Control Panel Log"><BR>A record of how your site's been used.</FONT></FONT></TD></TR>
<TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Add Bookmarklets"><BR>Post entries with one click (IE 5+ only).</FONT></FONT></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Upload Files"><BR>Upload images or other files to your site.</FONT></FONT></TD></TR>
<TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Edit Banned IP List"><BR>Ban someone from using your site.</FONT></FONT></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Re-Login"><BR>Re-enter as another author.</FONT></FONT></TD></TR>
</FORM>
$visityoursitelink
</TABLE>
<P>
<FONT SIZE=1>"Our life is what our thoughts make it."Marcus Aurelius</FONT>
$gmframebottom
</BODY>
</HTML>
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(<B><FONT COLOR="#FF0000">You don't have access to edit the templates.</FONT></B><P>);
&gm_frontpage;
}
if ($statusnote eq "") { $statusnote = qq(<B><FONT COLOR="#000000">Edit Templates</FONT></B><BR><FONT SIZE=1>Select a group of templates to edit. Templates control<BR>the layout & format of every aspect of your weblog/journal.</FONT><P>); }
if ($gmtemplateaccess eq "hfsonly") {
$statusnote .= "<B>You only have access to edit the header, footer & sidebar templates.</B><P>";
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="width: 320; background: #D0D0FF">
</FORM>
<P>
<FONT SIZE=1>"Art is the imposing of a pattern on experience, and our aesthetic<BR>enjoyment is recognition of the pattern."A.N. Whitehead</FONT>
$gmframebottom
</BODY>
</HTML>
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(<B><FONT COLOR="#FF0000">You don't have access to edit the main index templates.</FONT></B><P>);
&gm_frontpage;
}
&gm_readtemplates;
&gm_delousealltemplates;
if ($statusnote eq "") { $statusnote = qq(<B><FONT COLOR="#000000">Editing Main Index-Related Templates</FONT></B><BR><FONT SIZE=1>These are the templates that affect the layout and appearance of your main index.</FONT><P>); }
if ($gmrebuildaccess eq "yes") {
if ($automaticrebuilddefault eq "yes") {
$autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="index" CHECKED> Automatically rebuild main index after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>);
} else {
$autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="index"> Automatically rebuild main index after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>);
}
}
&gm_readcounter;
if ($newentrynumber eq "0") { $autorebuildcheckbox = ""; }
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2>$gmfonttag<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>Main Index Template</B><BR><FONT SIZE=1>The overall template for your main index pagetypically 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.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE><P></FONT><TEXTAREA NAME="newindextemplate" COLS=86 ROWS=30 WRAP=VIRTUAL STYLE="width: 720">$gmindextemplate</TEXTAREA>$gmfonttag</FONT></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>Index Entry Templates</B><BR><FONT SIZE=1>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).</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Index Entry Template: Standard Entries</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Index Entry Template: Extended Entries</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newentrytemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmentrytemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newmoreentrytemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmmoreentrytemplate</TEXTAREA>$gmfonttag</FONT><BR>$gmfonttag<FONT SIZE=1><INPUT TYPE=CHECKBOX NAME="entrylistingmorecheck" VALUE="yes"> Make this the same as the template on the left</FONT></FONT></TD></TR></TABLE></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#D0D0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Date Grouping Template</B><BR><FONT SIZE=1>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.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#D0D0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Entry Separator Template</B><BR><FONT SIZE=1>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.<BR> </FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newdatetemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmdatetemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newentryseparatortemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmentryseparatortemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR></TABLE></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD VALIGN=TOP ALIGN=CENTER><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#D0D0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>"Stay At Top" Index Entry Template</B><BR><FONT SIZE=1>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.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newstayattoptemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmstayattoptemplate</TEXTAREA>$gmfonttag</FONT><BR>$gmfonttag<FONT SIZE=1><INPUT TYPE=CHECKBOX NAME="entrylistingstayattopcheck" VALUE="yes"> Make this the same as the standard index entry template</FONT></TD></TR></TABLE></TD></TR>
</TABLE>
$autorebuildcheckbox
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Save Template Changes"> <INPUT TYPE=RESET CLASS="button" STYLE="background: #FFD0D0" VALUE="Undo Changes Since Last Save">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Templates Menu">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #D0D0FF">
</FORM>
<P>
<FONT SIZE=1>"The face is the index of a feeling mind."George Crabbe</FONT>
$gmframebottom
</BODY>
</HTML>
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(<B><FONT COLOR="#FF0000">You don't have access to edit the archive templates.</FONT></B><P>);
&gm_frontpage;
}
&gm_readtemplates;
&gm_delousealltemplates;
if ($statusnote eq "") { $statusnote = qq(<B><FONT COLOR="#000000">Editing Archive-Related Templates</FONT></B><BR><FONT SIZE=1>These are the templates that affect the layout and appearance of your archives.</FONT><P>); }
$autorebuildcheckbox = "";
if ($gmrebuildaccess eq "yes") {
if ($automaticrebuilddefault eq "yes") {
$autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="archiveindexes" CHECKED> Automatically rebuild archive master index and log indexes after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>);
} else {
$autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="archiveindexes"> Automatically rebuild archive master index and log indexes after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>);
}
}
&gm_readcounter;
if ($newentrynumber eq "0") { $autorebuildcheckbox = ""; }
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2>$gmfonttag<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>Archive Master Index Template</B><BR><FONT SIZE=1>If you wish, you can keep a master index of your archivesan 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.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE><P></FONT><TEXTAREA NAME="newarchivemasterindextemplate" COLS=86 ROWS=30 WRAP=VIRTUAL STYLE="width: 720">$gmarchivemasterindextemplate</TEXTAREA>$gmfonttag</FONT></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2>$gmfonttag<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>Archive Log Index Template</B><BR><FONT SIZE=1>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.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE><P></FONT><TEXTAREA NAME="newarchiveindextemplate" COLS=86 ROWS=30 WRAP=VIRTUAL STYLE="width: 720">$gmarchiveindextemplate</TEXTAREA>$gmfonttag</FONT><BR>$gmfonttag<FONT SIZE=1><INPUT TYPE=CHECKBOX NAME="archivelogindexcheck" VALUE="yes"> Make this the same as the main index template</FONT></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>Log Archive Entry Templates</B><BR><FONT SIZE=1>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).</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Archive Entry Template: Standard Entries</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Archive Entry Template: Extended Entries</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newarchiveentrytemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmarchiveentrytemplate</TEXTAREA>$gmfonttag</FONT><BR>$gmfonttag<FONT SIZE=1><INPUT TYPE=CHECKBOX NAME="archiveentrylistingcheck" VALUE="yes"> Make this the same as the main index version</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newmorearchiveentrytemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmmorearchiveentrytemplate</TEXTAREA>$gmfonttag</FONT><BR>$gmfonttag<FONT SIZE=1><INPUT TYPE=CHECKBOX NAME="archiveentrylistingmorecheck" VALUE="yes"> Make this the same as the main index version</FONT></FONT></TD></TR></TABLE></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#D0D0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Archive Date Grouping Template</B><BR><FONT SIZE=1>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.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#D0D0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Archive Entry Separator Template</B><BR><FONT SIZE=1>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.<BR> </FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newdatearchivetemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmdatearchivetemplate</TEXTAREA>$gmfonttag</FONT><BR>$gmfonttag<FONT SIZE=1><INPUT TYPE=CHECKBOX NAME="archivedateheadercheck" VALUE="yes"> Make this the same as the main index version</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newarchiveentryseparatortemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmarchiveentryseparatortemplate</TEXTAREA>$gmfonttag</FONT><BR>$gmfonttag<FONT SIZE=1><INPUT TYPE=CHECKBOX NAME="archiveentryseparatorcheck" VALUE="yes"> Make this the same as the main index version</FONT></FONT></TD></TR></TABLE></TD></TR>
</TABLE>
$autorebuildcheckbox
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Save Template Changes"> <INPUT TYPE=RESET CLASS="button" STYLE="background: #FFD0D0" VALUE="Undo Changes Since Last Save">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Templates Menu">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #D0D0FF">
</FORM>
<P>
<FONT SIZE=1>"History never looks like history when you're living through it."John Gardner</FONT>
$gmframebottom
</BODY>
</HTML>
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(<B><FONT COLOR="#FF0000">You don't have access to edit the entry page templates.</FONT></B><P>);
&gm_frontpage;
}
&gm_readtemplates;
&gm_delousealltemplates;
if ($statusnote eq "") { $statusnote = qq(<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=720><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B><FONT COLOR="#000000">Editing Entry Page-Related Templates</FONT></B><BR><FONT SIZE=1>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.</FONT></TD></TR></TABLE><P>); }
$autorebuildcheckbox = "";
if ($gmrebuildaccess eq "yes") {
if ($automaticrebuilddefault eq "yes") {
$autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="entrypages" CHECKED> Automatically rebuild all entry pages after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>);
} else {
$autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="entrypages"> Automatically rebuild all entry pages after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>);
}
}
&gm_readcounter;
if ($newentrynumber eq "0") { $autorebuildcheckbox = ""; }
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2>$gmfonttag<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>Entry Page Template: Current Standard Entries</B><BR><FONT SIZE=1>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.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE><P></FONT><TEXTAREA NAME="newentrypagetemplate" COLS=86 ROWS=30 WRAP=VIRTUAL STYLE="width: 720">$gmentrypagetemplate</TEXTAREA>$gmfonttag</FONT></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2>$gmfonttag<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>Entry Page Template: Current Extended Entries</B><BR><FONT SIZE=1>Like the above, except this applies to current extended entries (non-archived entries *with* "more" text).</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE><P></FONT><TEXTAREA NAME="newmoreentrypagetemplate" COLS=86 ROWS=30 WRAP=VIRTUAL STYLE="width: 720">$gmmoreentrypagetemplate</TEXTAREA>$gmfonttag</FONT><BR>$gmfonttag<FONT SIZE=1><INPUT TYPE=CHECKBOX NAME="entrymorepagecheck" VALUE="yes"> Make this the same as the above template (current standard entries)</FONT></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2>$gmfonttag<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>Entry Page Template: Archived Standard Entries</B><BR><FONT SIZE=1>Like the above, except this applies to archived entries (entries too old to be listed on the main log) without "more" text.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE><P></FONT><TEXTAREA NAME="newarchiveentrypagetemplate" COLS=86 ROWS=30 WRAP=VIRTUAL STYLE="width: 720">$gmarchiveentrypagetemplate</TEXTAREA>$gmfonttag</FONT><BR>$gmfonttag<FONT SIZE=1><INPUT TYPE=CHECKBOX NAME="entryarchivepagecheck" VALUE="yes"> Make this the same as the top template (current standard entries)</FONT></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2>$gmfonttag<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>Entry Page Template: Archived Extended Entries</B><BR><FONT SIZE=1>Like the above, except this applies to archived entries (entries too old to be listed on the main log) *with* "more" text.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE><P></FONT><TEXTAREA NAME="newmorearchiveentrypagetemplate" COLS=86 ROWS=30 WRAP=VIRTUAL STYLE="width: 720">$gmmorearchiveentrypagetemplate</TEXTAREA>$gmfonttag</FONT><BR>$gmfonttag<FONT SIZE=1><INPUT TYPE=CHECKBOX NAME="entrymorearchivepagecheck" VALUE="yes"> Make this the same as the previous template (archived standard entries)</FONT></TD></TR>
</TABLE>
$autorebuildcheckbox
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Save Template Changes"> <INPUT TYPE=RESET CLASS="button" STYLE="background: #FFD0D0" VALUE="Undo Changes Since Last Save">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Templates Menu">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #D0D0FF">
</FORM>
<P>
<FONT SIZE=1>"One of the few remaining freedoms we have is the blank page; no one can prescribe how we should fill it."James Kelman</FONT>
$gmframebottom
</BODY>
</HTML>
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(<B><FONT COLOR="#FF0000">You don't have access to edit the karma & comments templates.</FONT></B><P>);
&gm_frontpage;
}
&gm_readtemplates;
&gm_delousealltemplates;
if ($statusnote eq "") { $statusnote = qq(<B><FONT COLOR="#000000">Editing Karma & Comments-Related Templates</FONT></B><BR><FONT SIZE=1>These are the templates that affect all elements relating to karma voting and comment posting; if you have<BR>either or both of those disabled, you can ignore the templates relating to them. All these templates<BR>affect things that will not appear on entries for which karma voting and/or comment posting is disabled.</FONT><P>); }
$autorebuildcheckbox = "";
if ($gmrebuildaccess eq "yes") {
if ($automaticrebuilddefault eq "yes") {
$autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="everything" CHECKED> Automatically rebuild all files after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>);
} else {
$autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="everything"> Automatically rebuild all files after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>);
}
}
&gm_readcounter;
if ($newentrynumber eq "0") { $autorebuildcheckbox = ""; }
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>{{karmalink}} and {{commentslink}} Templates</B><BR><FONT SIZE=1>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.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>{{karmalink}} Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>{{commentslink}} Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newkarmalinktemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmkarmalinktemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcommentslinktemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmcommentslinktemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR></TABLE></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#D0D0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Comment Appearance Template</B><BR><FONT SIZE=1>Whenever comments are added to your entries, this is the template which the comments will be formatted by.<BR> <BR> </FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#D0D0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>{{entrycommentsform}} Posting Form</B><BR><FONT SIZE=1>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.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcommentstemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmcommentstemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcommentsformtemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmcommentsformtemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR></TABLE></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#D0D0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>{{commentdivider}} Template</B><BR><FONT SIZE=1>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.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#D0D0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>{{karmaform}} Template</B><BR><FONT SIZE=1>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.<BR> <BR> </FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcommentdividertemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmcommentdividertemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newkarmaformtemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmkarmaformtemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR></TABLE></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>Comment Previewing Templates</B><BR><FONT SIZE=1>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.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Preview Divider Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Confirmation Form Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcommentpreviewdividertemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmcommentpreviewdividertemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcommentpreviewformtemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmcommentpreviewformtemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR></TABLE></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=3><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>{{commentstatussmart}} Templates</B><BR><FONT SIZE=1>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.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=33%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=229 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Output for<BR>no comments</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=34%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=229 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Output for<BR>one comment</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=33%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=229 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Output for two<BR>or more comments</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newsmartlinknocommentstemplate" COLS=26 ROWS=5 WRAP=VIRTUAL STYLE="width: 233">$gmsmartlinknocommentstemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newsmartlinkonecommenttemplate" COLS=26 ROWS=5 WRAP=VIRTUAL STYLE="width: 233">$gmsmartlinkonecommenttemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newsmartlinkmanycommentstemplate" COLS=26 ROWS=5 WRAP=VIRTUAL STYLE="width: 233">$gmsmartlinkmanycommentstemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR></TABLE></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>{{commentauthoremail}} and {{commentauthorhomepage}} Templates</B><BR><FONT SIZE=1>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.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>{{commentauthoremail}} Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>{{commentauthorhomepage}} Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcommentauthoremailtemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmcommentauthoremailtemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcommentauthorhomepagetemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmcommentauthorhomepagetemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR></TABLE></TD></TR>
</TABLE>
$autorebuildcheckbox
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Save Template Changes"> <INPUT TYPE=RESET CLASS="button" STYLE="background: #FFD0D0" VALUE="Undo Changes Since Last Save">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Templates Menu">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #D0D0FF">
</FORM>
<P>
<FONT SIZE=1>"We all shine on, like the moon and the stars and the sun."John Lennon, "Instant Karma!"</FONT>
$gmframebottom
</BODY>
</HTML>
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(<B><FONT COLOR="#FF0000">You don't have access to edit the header, footer & sidebar templates.</FONT></B><P>);
&gm_frontpage;
}
&gm_readtemplates;
&gm_delousealltemplates;
if ($statusnote eq "") { $statusnote = qq(<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=720><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B><FONT COLOR="#000000">Editing Header, Footer & Sidebar (& Custom) Templates</FONT></B><BR><FONT SIZE=1>If you want to have somethingcertain 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.</FONT></TD></TR></TABLE><P>); }
$autorebuildcheckbox = "";
if ($gmrebuildaccess eq "yes") {
if ($automaticrebuilddefault eq "yes") {
$autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="everything" CHECKED> Automatically rebuild all files after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>);
} else {
$autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="everything"> Automatically rebuild all files after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>);
}
}
&gm_readcounter;
if ($newentrynumber eq "0") { $autorebuildcheckbox = ""; }
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2>$gmfonttag<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>Header Template</B><BR><FONT SIZE=1>Whatever you put here will appear wherever {{header}} is used in your other templates.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE><P></FONT><TEXTAREA NAME="newheadertemplate" COLS=86 ROWS=30 WRAP=VIRTUAL STYLE="width: 720">$gmheadertemplate</TEXTAREA>$gmfonttag</FONT></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2>$gmfonttag<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>Footer Template</B><BR><FONT SIZE=1>Whatever you put here will appear wherever {{footer}} is used in your other templates.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE><P></FONT><TEXTAREA NAME="newfootertemplate" COLS=86 ROWS=30 WRAP=VIRTUAL STYLE="width: 720">$gmfootertemplate</TEXTAREA>$gmfonttag</FONT></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2>$gmfonttag<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>Sidebar Template</B><BR><FONT SIZE=1>Whatever you put here will appear wherever {{sidebar}} is used in your other templates.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE><P></FONT><TEXTAREA NAME="newsidebartemplate" COLS=86 ROWS=30 WRAP=VIRTUAL STYLE="width: 720">$gmsidebartemplate</TEXTAREA>$gmfonttag</FONT></TD></TR>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Save Template Changes"> <INPUT TYPE=RESET CLASS="button" STYLE="background: #FFD0D0" VALUE="Undo Changes Since Last Save">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Templates Menu">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #D0D0FF">
</FORM>
<P>
<FONT SIZE=1>"When you make eyes in place of an eye, a hand in place of a hand, a foot in place of a foot,<BR>an image in place of an image, then you will enter the kingdom."Gospel of Thomas 22:38</FONT>
$gmframebottom
</BODY>
</HTML>
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(<B><FONT COLOR="#FF0000">You don't have access to edit the miscellaneous templates.</FONT></B><P>);
&gm_frontpage;
}
&gm_readtemplates;
&gm_delousealltemplates;
if ($statusnote eq "") { $statusnote = qq(<B><FONT COLOR="#000000">Editing Miscellaneous Templates</FONT></B><BR><FONT SIZE=1>All the templates affecting things that didn't fit into the other categories.</FONT><P>); }
$autorebuildcheckbox = "";
if ($gmrebuildaccess eq "yes") {
if ($automaticrebuilddefault eq "yes") {
$autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="everything" CHECKED> Automatically rebuild all files after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>);
} else {
$autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="everything"> Automatically rebuild all files after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>);
}
}
&gm_readcounter;
if ($newentrynumber eq "0") { $autorebuildcheckbox = ""; }
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>{{previouslink}} And {{nextlink}} Templates</B><BR><FONT SIZE=1>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).</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>{{previouslink}} Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>{{nextlink}} Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newpreviouslinktemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmpreviouslinktemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newnextlinktemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmnextlinktemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>{{previousmorelink}} Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>{{nextmorelink}} Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newpreviousmorelinktemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmpreviousmorelinktemplate</TEXTAREA>$gmfonttag</FONT><BR>$gmfonttag<FONT SIZE=1><INPUT TYPE=CHECKBOX NAME="previousmorelinkcheck" VALUE="yes"> Make this the same as the {{previouslink}} template</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newnextmorelinktemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmnextmorelinktemplate</TEXTAREA>$gmfonttag</FONT><BR>$gmfonttag<FONT SIZE=1><INPUT TYPE=CHECKBOX NAME="nextmorelinkcheck" VALUE="yes"> Make this the same as the {{nextlink}} template</FONT></FONT></TD></TR></TABLE></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>List Variable Templates</B><BR><FONT SIZE=1>The variables {{logarchivelist}} and {{logentrylist}} (and the variants thereof; check the manual for more information) are used for automatically generating lists of linkswhether on your archive master index, or anywhere elseto 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).</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Log Archives Link Template: Weekly</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Log Archives Link Template: Monthly</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newlogarchiveslinkweeklytemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmlogarchiveslinkweeklytemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newlogarchiveslinktemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmlogarchiveslinktemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Entry List Link Template: Standard</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Entry List Link Template: Extended</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newentrypagelinktemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmentrypagelinktemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newmoreentrypagelinktemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmmoreentrypagelinktemplate</TEXTAREA>$gmfonttag</FONT><BR>$gmfonttag<FONT SIZE=1><INPUT TYPE=CHECKBOX NAME="moreentrylistlinkcheck" VALUE="yes"> Make this the same as the template on the left</FONT></FONT></TD></TR></TABLE></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>List Variable Templates: Link Separators</B><BR><FONT SIZE=1>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.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Entry List Link Separator</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Log Archives Link Separator</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newentrypagelinkseparatortemplate" COLS=41 ROWS=5 WRAP=VIRTUAL STYLE="width: 355">$gmentrypagelinkseparatortemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newlogarchiveslinkseparatortemplate" COLS=41 ROWS=5 WRAP=VIRTUAL STYLE="width: 355">$gmlogarchiveslinkseparatortemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR></TABLE></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>Search Templates</B><BR><FONT SIZE=1>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.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Search Form Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Search Item Results Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newsearchformtemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmsearchformtemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newsearchresultsentrytemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmsearchresultsentrytemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD COLSPAN=2><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Search Results Page Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER COLSPAN=2></FONT><TEXTAREA NAME="newsearchresultspagetemplate" COLS=86 ROWS=15 WRAP=VIRTUAL STYLE="width: 720">$gmsearchresultspagetemplate</TEXTAREA>$gmfonttag</FONT></TD></TR></TABLE></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>Calendar Templates</B><BR><FONT SIZE=1>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.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>{{calendar}}: Beginning of table</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>{{calendar}}: Ending of table</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcalendartablebeginningtemplate" COLS=41 ROWS=5 WRAP=VIRTUAL STYLE="width: 355">$gmcalendartablebeginningtemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcalendartableendingtemplate" COLS=41 ROWS=5 WRAP=VIRTUAL STYLE="width: 355">$gmcalendartableendingtemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR></TABLE></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>{{popup}} Templates</B><BR><FONT SIZE=1>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.)</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Popup Code Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Popup Window Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newpopupcodetemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmpopupcodetemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newpopuppagetemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmpopuppagetemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR></TABLE></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#D0D0FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>Line & Paragraph Separators</B><BR><FONT SIZE=1>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.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Line Separator</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Paragraph Separator</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newlinebreaktemplate" COLS=41 ROWS=3 WRAP=VIRTUAL STYLE="width: 355">$gmlinebreaktemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newparaseparationtemplate" COLS=41 ROWS=3 WRAP=VIRTUAL STYLE="width: 355">$gmparaseparationtemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR></TABLE></TD></TR>
<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#FFD0D0"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>{{morepreface}} And {{morelink}} Templates (no longer recommended)</B><BR><FONT SIZE=1>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).</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>{{morepreface}} Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#E0F0FF"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>{{morelink}} Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newmoreprefacetemplate" COLS=41 ROWS=3 WRAP=VIRTUAL STYLE="width: 355">$gmmoreprefacetemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newmorelinktemplate" COLS=41 ROWS=3 WRAP=VIRTUAL STYLE="width: 355">$gmmorelinktemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR></TABLE></TD></TR>
</TABLE>
$autorebuildcheckbox
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Save Template Changes"> <INPUT TYPE=RESET CLASS="button" STYLE="background: #FFD0D0" VALUE="Undo Changes Since Last Save">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Templates Menu">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #D0D0FF">
</FORM>
<P>
<FONT SIZE=1>"God does not play dice with the universe."Albert Einstein</FONT>
$gmframebottom
</BODY>
</HTML>
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(<B><FONT COLOR="#FF0000">You don't have access to edit the templates.</FONT></B><P>);
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.");
$statusnote = qq(<B><FONT COLOR="#0000FF">The $IN{'modifiedtemplategroup'} templates have been modified. Be sure to rebuild<BR>your files to make these changes take effect throughout your site.</FONT></B><P>);
&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(<B><FONT COLOR="#FF0000">You don't have access to view the control panel log.</FONT></B><P>);
<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=0 BGCOLOR="#EEF8FF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag <B>Site Stats as of $basedate</B><P><FONT SIZE=1>$newentrynumber entries currently online ($newalltimeopenentriesnumber open and $newalltimeclosedentriesnumber closed) with $newarchivenumber archived and $entriesonmainnumber marked as current<BR>$newalltimetotalkarmavotes karma votes cast ($karmavotesonaverage on average per entry) with $newalltimepktotalnumber positive and $newalltimenktotalnumber negative for a total karma rating of $newalltimetotalkarmanumber<BR>$newalltimecommentstotalnumber total comments posted ($commentspostedonaverage on average per entry)</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #FFD0D0" VALUE="Reset The Control Panel Log">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #D0D0FF">
</FORM>
<P>
<FONT SIZE=1>"When stepping into the stream of consciousness, don't slip on the rocks."<BR>Siddharta Gautama (the Buddha)</FONT>
$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(<B><FONT COLOR="#FF0000">You don't have access to clear the control panel log.</FONT></B><P>);
&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(<B><FONT COLOR="#0000FF">The control panel log has been cleared.</FONT></B><P>);
&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(<B><FONT COLOR="#FF0000">You don't have access to edit the authors.</FONT></B><P>);
&gm_frontpage;
}
if ($statusnote eq "") { $statusnote = qq(<B><FONT COLOR="#000000">Author Panel</FONT></B><BR><FONT SIZE=1>Select an author to edit their information and/or access, or to delete them altogether.</FONT><P>); }
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.");
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Edit Selected Author"> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #FFD0D0" VALUE="Delete Selected Author">
$alicewarning
<P>
<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=10 CELLSPACING=0 BGCOLOR="#D0E0FF" WIDTH=680><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>Register A New Author</B><BR><FONT SIZE=1>
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.</FONT><P>Name: <INPUT TYPE=TEXT CLASS="textinput" SIZE=25 NAME="newauthorname"> Password: <INPUT TYPE=PASSWORD CLASS="textinput" SIZE=25 NAME="newauthorpassword"><P>E-Mail: <INPUT TYPE=TEXT CLASS="textinput" SIZE=30 NAME="newauthoremail"> Homepage: <INPUT TYPE=TEXT CLASS="textinput" SIZE=30 NAME="newauthorhomepage" VALUE="http://"><P><B>Default Author Access</B><BR><INPUT TYPE=RADIO NAME="newauthoraccess" VALUE="all" CHECKED> All access <INPUT TYPE=RADIO NAME="newauthoraccess" VALUE="none"> No access<BR><INPUT TYPE=RADIO NAME="newauthoraccess" VALUE="postedit"> Post & edit their own entries only<P><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Create New Author"></FONT></TD></TR></TABLE></TD></TR></TABLE>
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #D0D0FF">
</FORM>
<P>
<FONT SIZE=1>"All the world is queer save me and thee; and sometimes I think thee is a little queer."old Quaker saying</FONT>
$gmframebottom
</BODY>
</HTML>
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(<B><FONT COLOR="#FF0000">You don't have access to create a new author.</FONT></B><P>);
&gm_frontpage;
}
if (($IN{'newauthorname'} eq "") || ($IN{'newauthorpassword'} eq "")) {
$statusnote = qq(<B><FONT COLOR="#FF0000">You left either the name or password fields blank. Please try again.</FONT></B><P>);
$statusnote = qq(<B><FONT COLOR="#FF0000">You cannot have a space at the beginning or end<BR>of the author name or password. Please try again.</FONT></B><P>);
&gm_editauthors;
}
$IN{'newauthorname'} =~ s/ /THISISASPACE/g;
$IN{'newauthorpassword'} =~ s/ /THISISASPACE/g;
if (($IN{'newauthorname'} =~ /\W/) || ($IN{'newauthorpassword'} =~ /\W/)) {
$statusnote = qq(<B><FONT COLOR="#FF0000">The author name or password cannot contain non-alphanumeric characters<BR>(characters other than letters, numbers or spaces). Please try again.</FONT></B><P>);
&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 = <FUNNYFEET>;
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(<B><FONT COLOR="#FF0000">That author is already registered.</FONT></B><P>);
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.");
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(<B><FONT COLOR="#0000FF">$IN{'newauthorname'} has been added to the author database.</FONT></B><P>);
&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(<B><FONT COLOR="#FF0000">You don't have access to delete authors.</FONT></B><P>);
&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 = <FUNNYFEET>;
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(<B><FONT COLOR="#FF0000">You must select an author first.</FONT></B><P>);
&gm_editauthors;
}
$authoramount = scalar(@gmauthordata);
if ($authoramount eq "1") {
$statusnote = qq(<B><FONT COLOR="#FF0000">You can't delete the only remaining author!</FONT></B><P>);
&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(<B><FONT COLOR="#0000FF">Please re-enter under your new author name and password.</FONT></B><P>);
&gm_login;
} else {
$statusnote = qq(<B><FONT COLOR="#0000FF">$IN{'selectedauthor'} has been deleted.</FONT></B><P>);
&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(<B><FONT COLOR="#FF0000">You don't have access to edit the authors.</FONT></B><P>);
&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 = <FUNNYFEET>;
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(<B><FONT COLOR="#FF0000">You must select an author first.</FONT></B><P>);
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Save Changes To This Author"> <INPUT TYPE=RESET CLASS="button" STYLE="background: #FFD0D0" VALUE="Undo Changes Since Last Save">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Author Panel">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #D0D0FF">
</FORM>
<P>
<FONT SIZE=1>"I always wanted to be somebody, but I should have been more specific."Lily Tomlin</FONT>
$gmframebottom
</BODY>
</HTML>
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(<B><FONT COLOR="#FF0000">You don't have access to delete authors.</FONT></B><P>);
&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(<B><FONT COLOR="#FF0000">You left either the name or password fields blank. Please try again.</FONT></B><P>);
&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.");
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);
if ($IN{'authororiginalname'} ne $gmauthorinfo[0]) {
<TR><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFD0" COLSPAN=2>$gmfonttag<B>Path Configuration</B><BR><FONT SIZE=1>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.</FONT></FONT></TD></TR>
<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=100%>$gmfonttag<B>Local Log Path:</B><BR><FONT SIZE=1>The main weblog/journal directory on your account, where your main index file is.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedlogpath" VALUE="$LogPath" SIZE=30 STYLE="width: 400">$gmfonttag</TD></TR>
<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=100%>$gmfonttag<B>Local Entries/Archives Path:</B><BR><FONT SIZE=1>The directory on your account where your entry files (current and archived) are to be stored.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedentriespath" VALUE="$EntriesPath" SIZE=30 STYLE="width: 400">$gmfonttag</TD></TR>
<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=100%>$gmfonttag<B>Local CGI Path:</B><BR><FONT SIZE=1>The place on your account where you keep all your Greymatter CGI files ("gm*.cgi").</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedcgilocalpath" VALUE="$cgilocalpath" SIZE=30 STYLE="width: 400">$gmfonttag</TD></TR>
<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=100%>$gmfonttag<B>Website Log Path:</B><BR><FONT SIZE=1>The website address of the directory where your main index file is.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedlogwebpath" VALUE="$LogWebPath" SIZE=30 STYLE="width: 400">$gmfonttag</TD></TR>
<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=100%>$gmfonttag<B>Website Entries Path:</B><BR><FONT SIZE=1>The website address of the directory where all your entries are to be stored.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedentrieswebpath" VALUE="$EntriesWebPath" SIZE=30 STYLE="width: 400" WIDTH=100%>$gmfonttag</TD></TR>
<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT>$gmfonttag<B>Website CGI Path:</B><BR><FONT SIZE=1>The website address of the directory where all your Greymatter CGI files are kept.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedcgiwebpath" VALUE="$cgiwebpath" SIZE=30 STYLE="width: 400">$gmfonttag</TD></TR>
<TR><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#D0D0FF" COLSPAN=2>$gmfonttag<B>Index & Archive Options</B><BR><FONT SIZE=1>Options relating to your main index and your archives.</FONT></FONT></TD></TR>
<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Index filename:</B><BR><FONT SIZE=1>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.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=350></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedindexfilename" VALUE="$indexfilename" SIZE=15 STYLE="width: 200">$gmfonttag</TD></TR>
<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>.suffix to entry files:</B><BR><FONT SIZE=1>If you have "Generate pages for individual entries" enabled, this is the suffix those pages will have.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedentrysuffix" VALUE="$entrysuffix" SIZE=15 STYLE="width: 200">$gmfonttag</TD></TR>
<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>.suffix to log archives:</B><BR><FONT SIZE=1>If you have "Keep monthly/weekly log archives" enabled, this is the suffix those log archive files will have.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedlogarchivesuffix" VALUE="$logarchivesuffix" SIZE=15 STYLE="width: 200">$gmfonttag</TD></TR>
<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Days to keep on main index:</B><BR><FONT SIZE=1>The number of days' worth of entries Greymatter will list on your main index before scrolling them off.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedindexdays" VALUE="$indexdays" SIZE=5 MAXLENGTH=5>$gmfonttag</TD></TR>
GMCONFIGMENUTOP
print qq(<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Generate pages for individual entries?</B><BR><FONT SIZE=1>Specifies whether you want individual entries to have their own pages. Comments are disabled if this is turned off.</FONT></FONT></TD>);
print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Keep archive master index?</B><BR><FONT SIZE=1>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.</FONT></FONT></TD>);
print qq(<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Keep monthly/weekly log archives?</B><BR><FONT SIZE=1>If enabled, Greymatter will keep archive files of your log in monthly or weekly installments in your entries/archives directory.</FONT></FONT></TD>);
print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Keep main index and archive log<BR>indexes concurrent with each other?</B><BR><FONT SIZE=1>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.</FONT></FONT></TD>);
print qq(<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Archive by month or week?</B><BR><FONT SIZE=1>If "Keep monthly/weekly log archives" is enabled, this specifies whether the log archives will be generated by the month or by the week.</FONT></FONT></TD>);
<TR><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#D0D0FF" COLSPAN=2>$gmfonttag<B>E-Mail Options</B><BR><FONT SIZE=1>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.</FONT></FONT></TD></TR>
<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=100%>$gmfonttag<B>E-Mail Program Location:</B><BR><FONT SIZE=1>The pointer to the mail program (usually Sendmail) on your account.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedmailprog" VALUE="$mailprog" SIZE=30 STYLE="width: 400">$gmfonttag</TD></TR>
<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=100%>$gmfonttag<B>E-Mail(s) to send notices to:</B><BR><FONT SIZE=1>The e-mail addresses you want all notifications (if any) to be sent to. Separate multiple e-mail addresses with semicolons.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=LEFT></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editednotifyemail" VALUE="$NotifyEmail" SIZE=30 STYLE="width: 400">$gmfonttag</TD></TR>
<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=100%>$gmfonttag<B>Send e-mail notifications for:</B><BR><FONT SIZE=1>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.</FONT></FONT></TD>);
if ($NotifyForStatus eq "karma") {
print qq(<TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<INPUT TYPE=RADIO NAME="editednotifyforstatus" VALUE="karma" CHECKED> New karma votes <INPUT TYPE=RADIO NAME="editednotifyforstatus" VALUE="comments"> New comments<BR><INPUT TYPE=RADIO NAME="editednotifyforstatus" VALUE="both"> Both <INPUT TYPE=RADIO NAME="editednotifyforstatus" VALUE="neither"> Neither</FONT></TD></TR>\n);
} elsif ($NotifyForStatus eq "comments") {
print qq(<TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<INPUT TYPE=RADIO NAME="editednotifyforstatus" VALUE="karma"> New karma votes <INPUT TYPE=RADIO NAME="editednotifyforstatus" VALUE="comments" CHECKED> New comments<BR><INPUT TYPE=RADIO NAME="editednotifyforstatus" VALUE="both"> Both <INPUT TYPE=RADIO NAME="editednotifyforstatus" VALUE="neither"> Neither</FONT></TD></TR>\n);
} elsif ($NotifyForStatus eq "both") {
print qq(<TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<INPUT TYPE=RADIO NAME="editednotifyforstatus" VALUE="karma"> New karma votes <INPUT TYPE=RADIO NAME="editednotifyforstatus" VALUE="comments"> New comments<BR><INPUT TYPE=RADIO NAME="editednotifyforstatus" VALUE="both" CHECKED> Both <INPUT TYPE=RADIO NAME="editednotifyforstatus" VALUE="neither"> Neither</FONT></TD></TR>\n);
} else {
print qq(<TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<INPUT TYPE=RADIO NAME="editednotifyforstatus" VALUE="karma"> New karma votes <INPUT TYPE=RADIO NAME="editednotifyforstatus" VALUE="comments"> New comments<BR><INPUT TYPE=RADIO NAME="editednotifyforstatus" VALUE="both"> Both <INPUT TYPE=RADIO NAME="editednotifyforstatus" VALUE="neither" CHECKED> Neither</FONT></TD></TR>\n);
<TR><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#D0D0FF" COLSPAN=2>$gmfonttag<B>Karma & Comments Options</B><BR><FONT SIZE=1>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).</FONT></FONT></TD></TR>
<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Allow karma voting and/or comment posting?</B><BR><FONT SIZE=1>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.</FONT></FONT></TD>);
print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Order of comments on entry pages:</B><BR><FONT SIZE=1>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.</FONT></FONT></TD>);
print qq(<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Can post comments and vote on karma in archives?</B><BR><FONT SIZE=1>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.</FONT></FONT></TD>);
print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Karma voting on by default?</B><BR><FONT SIZE=1>Specifies whether "Allow karma voting on this entry" is preselected to "Yes" or "No" by default on the "Add a new entry" screen.</FONT></FONT></TD>);
print qq(<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Comment posting on by default?</B><BR><FONT SIZE=1>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.</FONT></FONT></TD>);
print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>HTML allowed in comments?</B><BR><FONT SIZE=1>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.</FONT></FONT></TD>);
if ($allowhtmlincomments eq "yes") {
print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedallowhtmlincomments" VALUE="yes" CHECKED> All HTML allowed <INPUT TYPE=RADIO NAME="editedallowhtmlincomments" VALUE="no"> No HTML allowed<BR><INPUT TYPE=RADIO NAME="editedallowhtmlincomments" VALUE="linkboldital"> Linking, Bold & Italic code only<BR><INPUT TYPE=RADIO NAME="editedallowhtmlincomments" VALUE="linkonly"> Linking code only</FONT></TD></TR>\n);
print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedallowhtmlincomments" VALUE="yes"> All HTML allowed <INPUT TYPE=RADIO NAME="editedallowhtmlincomments" VALUE="no"> No HTML allowed<BR><INPUT TYPE=RADIO NAME="editedallowhtmlincomments" VALUE="linkboldital" CHECKED> Linking, Bold & Italic code only<BR><INPUT TYPE=RADIO NAME="editedallowhtmlincomments" VALUE="linkonly"> Linking code only</FONT></TD></TR>\n);
} elsif ($allowhtmlincomments eq "linkonly") {
print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedallowhtmlincomments" VALUE="yes"> All HTML allowed <INPUT TYPE=RADIO NAME="editedallowhtmlincomments" VALUE="no"> No HTML allowed<BR><INPUT TYPE=RADIO NAME="editedallowhtmlincomments" VALUE="linkboldital"> Linking, Bold & Italic code only<BR><INPUT TYPE=RADIO NAME="editedallowhtmlincomments" VALUE="linkonly" CHECKED> Linking code only</FONT></TD></TR>\n);
} else {
print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedallowhtmlincomments" VALUE="yes"> All HTML allowed <INPUT TYPE=RADIO NAME="editedallowhtmlincomments" VALUE="no" CHECKED> No HTML allowed<BR><INPUT TYPE=RADIO NAME="editedallowhtmlincomments" VALUE="linkboldital"> Linking, Bold & Italic code only<BR><INPUT TYPE=RADIO NAME="editedallowhtmlincomments" VALUE="linkonly"> Linking code only</FONT></TD></TR>\n);
}
print qq(<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Auto-link URLs in comments?</B><BR><FONT SIZE=1>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).</FONT></FONT></TD>);
print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Strip new lines from comments?</B><BR><FONT SIZE=1>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.</FONT></FONT></TD>);
print qq(<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Allow multiple karma votes from same IP?</B><BR><FONT SIZE=1>If enabled, the same visitor could cast multiple karma votes on the same entry; if disabled, only one vote per visitor is allowed.</FONT></FONT></TD>);
print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Mention it in the control panel log when<BR>comments and karma votes are added?</B><BR><FONT SIZE=1>Enable this if you want Greymatter to mention all new comments and karma votes in the control panel log.</FONT></FONT></TD>);
<TR><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#D0D0FF" COLSPAN=2>$gmfonttag<B>Date & Time Options</B><BR><FONT SIZE=1>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.</FONT></FONT></TD></TR>
<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Server Offset Time:</B><BR><FONT SIZE=1>As of this moment, Greymatter reads your time as <B>$hour\:$mintwo $AMPM</B>. 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).</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedoffsettime" VALUE="$serveroffset" SIZE=5 MAXLENGTH=3>$gmfonttag</TD></TR>
<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Your Time Zone:</B><BR><FONT SIZE=1>The time zone you live in. This is what will appear wherever you use the {{timezone}} variable in your templates.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedtimezone" VALUE="$timezone" SIZE=5 MAXLENGTH=5>$gmfonttag</TD></TR>
<TR><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#D0D0FF" COLSPAN=2>$gmfonttag<B>File Uploading Options</B><BR><FONT SIZE=1>Options relating to uploading files from within Greymatter.</FONT></FONT></TD></TR>
<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Allowed File Types:</B><BR><FONT SIZE=1>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.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editeduploadfilesallowed" VALUE="$uploadfilesallowed" SIZE=20 STYLE="width: 320">$gmfonttag</TD></TR>
<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Maximum Filesize Allowed:</B><BR><FONT SIZE=1>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.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editeduploadfilesizelimit" VALUE="$uploadfilesizelimit" SIZE=5 MAXLENGTH=5>$gmfonttag KB</TD></TR>
<TR><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#D0D0FF" COLSPAN=2>$gmfonttag<B>Censoring Options</B><BR><FONT SIZE=1>Words or phrases you want to censor on your site (if any), and where to censor them.<BR>Censored terms will be turned into "*" asterisks.</FONT></FONT></TD></TR>
<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Enable censoring?</B><BR><FONT SIZE=1>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.</FONT></FONT></TD>);
print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Censor List</B><BR><FONT SIZE=1>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.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%></FONT><TEXTAREA NAME="editedcensorlist" COLS=25 ROWS=6 WRAP=VIRTUAL STYLE="width: 320">$censorlist</TEXTAREA>$gmfonttag</FONT></TD></TR>
<TR><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#D0D0FF" COLSPAN=2>$gmfonttag<B>Connect Other Files (Advanced Users Only)</B><BR><FONT SIZE=1>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 <B>only recommended for advanced users</B> that are already comfortable using Greymatter.</FONT></FONT></TD></TR>
<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Filename List</B><BR><FONT SIZE=1>To connect a file to Greymatter, <B>CHMOD it to 666</B>making sure it contains whatever Greymatter variables you wishand 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.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%></FONT><TEXTAREA NAME="editedotherfilelist" COLS=25 ROWS=10 WRAP=VIRTUAL STYLE="width: 320">$otherfilelist</TEXTAREA>$gmfonttag</FONT></TD></TR>
<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Update them when adding entries?</B><BR><FONT SIZE=1>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).</FONT></FONT></TD>);
<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Enable cookies?</B><BR><FONT SIZE=1>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.</FONT></FONT></TD>);
print qq(<BR><INPUT TYPE=CHECKBOX NAME="editeddeletecookies" VALUE="yes"> Delete cookies set by Greymatter?</FONT></TD></TR>\n<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Keep control panel log?</B><BR><FONT SIZE=1>Specifies whether you want Greymatter to keep its internal log of all activity; disable this if you want to shut it off.</FONT></FONT></TD>);
print qq(<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Allow "easy formatting"?</B><BR><FONT SIZE=1>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.</FONT></FONT></TD>);
print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Default entry list view:</B><BR><FONT SIZE=1>This specifies which view will be the default when you go to the Edit An Entry selection menu.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<SELECT NAME="editeddefaultentrylistview" CLASS="selectlist">\n);
if ($defaultentrylistview eq "main") {
if ($indexdays eq "1") {
print qq(<OPTION VALUE="main" SELECTED> Current entries \($indexdays day\)\n);
} else {
print qq(<OPTION VALUE="main" SELECTED> Current entries \($indexdays days\)\n);
}
} else {
if ($indexdays eq "1") {
print qq(<OPTION VALUE="main"> Current entries \($indexdays day\)\n);
} else {
print qq(<OPTION VALUE="main"> Current entries \($indexdays days\)\n);
}
}
if ($defaultentrylistview eq "onlyyou") {
print qq(<OPTION VALUE="onlyyou" SELECTED> All entries by you\n);
} else {
print qq(<OPTION VALUE="onlyyou"> All entries by you\n);
}
if ($defaultentrylistview eq "more") {
print qq(<OPTION VALUE="more" SELECTED> All extended entries\n);
} else {
print qq(<OPTION VALUE="more"> All extended entries\n);
}
if ($defaultentrylistview eq "open") {
print qq(<OPTION VALUE="open" SELECTED> All open entries\n);
} else {
print qq(<OPTION VALUE="open"> All open entries\n);
}
if ($defaultentrylistview eq "closed") {
print qq(<OPTION VALUE="closed" SELECTED> All closed entries\n);
} else {
print qq(<OPTION VALUE="closed"> All closed entries\n);
}
if ($defaultentrylistview eq "all") {
print qq(<OPTION VALUE="all" SELECTED> All entries\n);
} else {
print qq(<OPTION VALUE="all"> All entries\n);
}
print qq(</SELECT></FONT></TD></TR>\n<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Order of list links:</B><BR><FONT SIZE=1>The order in which you want links to be displayed in log list variablescheck 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.</FONT></FONT></TD>);
print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Log entry list variable number:</B><BR><FONT SIZE=1>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.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedentrylistcountnumber" VALUE="$entrylistcountnumber" SIZE=5 MAXLENGTH=5>$gmfonttag</TD></TR>\n);
print qq(<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Link to entries in {{logentrylist comments}} only if comments are active?</B><BR><FONT SIZE=1>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.</FONT></FONT></TD>);
print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Entries to link to in {{calendar}}:</B><BR><FONT SIZE=1>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.)</FONT></FONT></TD>);
if ($linktocalendarentries eq "all") {
print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedlinktocalendarentries" VALUE="all" CHECKED> Always link to entry for that calendar day<BR><INPUT TYPE=RADIO NAME="editedlinktocalendarentries" VALUE="more"> Link only to extended entries</FONT></TD></TR>\n);
} else {
print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedlinktocalendarentries" VALUE="all"> Always link to entry for that calendar day<BR><INPUT TYPE=RADIO NAME="editedlinktocalendarentries" VALUE="more" CHECKED> Link only to extended entries</FONT></TD></TR>\n);
}
print qq(<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>"Automatically rebuild" selected by default?</B><BR><FONT SIZE=1>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.)</FONT></FONT></TD>);
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Save Configuration"> <INPUT TYPE=RESET CLASS="button" STYLE="background: #FFD0D0" VALUE="Undo Changes Since Last Save">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #D0D0FF">
</FORM>
<P>
<FONT SIZE=1>"It's better to change your shoes than to carpet the world."Stuart Smalley</FONT>
$gmframebottom
</BODY>
</HTML>
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(<B><FONT COLOR="#FF0000">You don't have access to change the config file.</FONT></B><P>);
$statusnote = qq(<B><FONT COLOR="#FF0000">You left one or more of the required fields blank. Please try again.</FONT></B><P>);
&gm_configuration;
}
if ($IN{'editedindexdays'} =~ /\D/) {
$statusnote = qq(<B><FONT COLOR="#FF0000">"Days to keep on main index" must be a number.</FONT></B><P>);
&gm_configuration;
}
if ($IN{'editedoffsettime'} =~ /\D/) {
unless ($IN{'editedoffsettime'} =~ /-/) {
$statusnote = qq(<B><FONT COLOR="#FF0000">"Server Offset Time" must be a number.</FONT></B><P>);
&gm_configuration;
}
}
if ($IN{'editeduploadfilesizelimit'} eq "") { $IN{'editeduploadfilesizelimit'} = 0; }
if ($IN{'editeduploadfilesizelimit'} =~ /\D/) {
$statusnote = qq(<B><FONT COLOR="#FF0000">"Maximum Filesize Allowed" must be a number.</FONT></B><P>);
&gm_configuration;
}
if (($IN{'editednotifyemail'} ne "") && ($IN{'editedmailprog'} eq "")) {
$statusnote = qq(<B><FONT COLOR="#FF0000">You must give your server's e-mail program location<BR>if you're going to have e-mail notification enabled.</FONT></B><P>);
&gm_configuration;
}
if (($IN{'editednotifyemail'} eq "") && ($IN{'editednotifyforstatus'} ne "neither")) {
$statusnote = qq(<B><FONT COLOR="#FF0000">You must give an e-mail address to receive e-mail notifications.</FONT></B><P>);
&gm_configuration;
}
if ($IN{'editedentrylistcountnumber'} =~ /\D/) {
$statusnote = qq(<B><FONT COLOR="#FF0000">"Log entry list variable number" must be a number.</FONT></B><P>);
$statusnote = qq(<B><FONT COLOR="#FF0000">"Days to keep on main index" must be set to at least one!</FONT></B><P>);
&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.");
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 "<FONT SIZE=1>[$basedate] [$authorIP]</FONT> $IN{'authorname'} let this log get its groove back\n<FONT SIZE=1>[$basedate] [$authorIP]</FONT> $IN{'authorname'} edited the config file\n";
close (FUNNYFEET);
}
if ($IN{'editedkeeplog'} eq "no") {
&gm_writetocplog("$IN{'authorname'} edited the config file\n<FONT SIZE=1>[$basedate] [$authorIP]</FONT> $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(<B><FONT COLOR="#0000FF">The config file has been updated. Be sure to rebuild your files<BR>for the changes to take effect on your site, if appropriate.</FONT></B><P>);
&gm_writetocplog("$IN{'authorname'} attempted to edit the ban list without authorization");
$statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the ban list.</FONT></B><P>);
&gm_frontpage;
}
if ($statusnote eq "") { $statusnote = qq(<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=460><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B><FONT COLOR="#000000">Edit Banned IP List</FONT></B><BR><FONT SIZE=1>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).</FONT></TD></TR></TABLE><P>); }
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.");
if ($gmbannedperson ne "") { print " ($gmbannedperson)"; }
print "\n";
}
print<<GMBANLISTMENUBOTTOM;
</SELECT>
<P>
New IP to ban: <INPUT TYPE=TEXT CLASS="textinput" MAXLENGTH=15 NAME="editednewbannedip" SIZE=15>
<BR>
Banned person's name (optional): <INPUT TYPE=TEXT CLASS="textinput" NAME="editednewbannedperson" SIZE=15>
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Add New IP"> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #FFD0D0" VALUE="Delete Selected IP">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #D0D0FF">
</FORM>
<P>
<FONT SIZE=1>
"Why have those banish'd and forbidden legs dared once
<BR>
to touch a dust of England's ground?"Shakespeare
</FONT>
$gmframebottom
</BODY>
</HTML>
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(<B><FONT COLOR="#FF0000">You don't have access to add an IP to the ban list.</FONT></B><P>);
&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(<B><FONT COLOR="#FF0000">You must enter the IP you want to add to the ban list.</FONT></B><P>);
&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.");
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.");
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 "<FONT SIZE=1>[$basedate] [$authorIP]</FONT> $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(<B><FONT COLOR="#0000FF">$IN{'editednewbannedip'} has been added to the ban list.</FONT></B><P>);
&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(<B><FONT COLOR="#FF0000">You don't have access to delete an IP from the ban list.</FONT></B><P>);
&gm_frontpage;
}
chomp($IN{'editedbanlist'});
if ($IN{'editedbanlist'} eq "") {
$statusnote = qq(<B><FONT COLOR="#FF0000">You must select the IP you want to delete from the ban list.</FONT></B><P>);
&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 = <FUNNYFEET>;
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.");
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 "<FONT SIZE=1>[$basedate] [$authorIP]</FONT> $IN{'authorname'} deleted an IP ($deletedthisbannedip";
if ($deletedthisbannedperson ne "") { print FUNNYFEET ", \"$deletedthisbannedperson\""; }
print FUNNYFEET ") from the ban list\n";
close (FUNNYFEET);
}
$statusnote = qq(<B><FONT COLOR="#0000FF">$deletedthisbannedip has been deleted from the ban list.</FONT></B><P>);
&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(<B><FONT COLOR="#FF0000">You don't have access to add entries.</FONT></B><P>);
&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 = <FUNNYFEET>;
close (FUNNYFEET);
$cplogtext = join (" ", @cploglines);
unless ($cplogtext =~ /successfully performed diagnostics/) {
$statusnote = qq(<B><FONT COLOR="#FF0000">Please run "Diagnostics & Repair" in the Configuration screen before posting your first entry.</FONT></B><P>);
&gm_frontpage;
}
}
if ($statusnote eq "") {
$statusnote = qq(<B><FONT COLOR="#000000">Add A New Entry</FONT></B><BR><FONT SIZE=1>This is the form by which you add new entries to your weblog/journal. You can make this either a standard or extended entry;<BR>standard entries contain only main text (the first box), while extended entries also have "more" text (the second box).<BR>Standard & extended entries can be handled and formatted in distinct ways via your templates.</FONT><P>);
}
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'}); }
if ((parseInt(navigator.appVersion) >= 4) && (navigator.appName == "Microsoft Internet Explorer")) {
document.write("<FONT SIZE=1>Shortcut keys: CTRL-SHIFT-A to add a link, CTRL-SHIFT-B to bold selected text,<BR>CTRL-SHIFT-I to italicise, CTRL-SHIFT-U to underline</FONT><P>");
}
//-->
</SCRIPT>
<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#FFFFD0"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Entry Options</B><BR><FONT SIZE=1>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).</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE>
<P>
GMADDENTRYTOP
if (($allowkarmaorcomments eq "karma") || ($allowkarmaorcomments eq "both")) {
Keep this entry at the top of the main log: <INPUT TYPE=RADIO NAME="newentrystayattop" VALUE="yes"> Yes <INPUT TYPE=RADIO NAME="newentrystayattop" VALUE="no" CHECKED> No
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Preview Before Posting"> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Add This Entry">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #D0D0FF">
</FORM>
<P>
<FONT SIZE=1>"You must have chaos in your soul to give birth to a dancing star."Friedrich Nietzsche</FONT>
$gmframebottom
</BODY>
</HTML>
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(<B><FONT COLOR="#FF0000">You don't have access to add entries via the popup window.</FONT></B><P>);
&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 = <FUNNYFEET>;
close (FUNNYFEET);
$cplogtext = join (" ", @cploglines);
unless ($cplogtext =~ /successfully performed diagnostics/) {
$statusnote = qq(<B><FONT COLOR="#FF0000">Please run "Diagnostics & Repair" in the Configuration screen before posting your first entry.</FONT></B><P>);
if ((parseInt(navigator.appVersion) >= 4) && (navigator.appName == "Microsoft Internet Explorer")) {
document.write("<FONT SIZE=1>Shortcut keys: CTRL-SHIFT-A to add a link, CTRL-SHIFT-B to bold selected text,<BR>CTRL-SHIFT-I to italicise, CTRL-SHIFT-U to underline</FONT><P>");
}
//-->
</SCRIPT>
<P>
GMADDENTRYPOPUPTOP
if (($allowkarmaorcomments eq "karma") || ($allowkarmaorcomments eq "both")) {
Keep this entry at the top of the main log: <INPUT TYPE=RADIO NAME="newentrystayattop" VALUE="yes"> Yes <INPUT TYPE=RADIO NAME="newentrystayattop" VALUE="no" CHECKED> No
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Preview Before Posting"> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Add This Entry">
</FORM>
$gmframebottomtwo
</BODY>
</HTML>
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(<B><FONT COLOR="#FF0000">You don't have access to add entries.</FONT></B><P>);
if ($newentrymoretext ne "") { $showmoretext = "</P><P ALIGN=CENTER><CENTER>\n<B>[extended text]</B>\n</CENTER></P><P ALIGN=JUSTIFY>\n$newentrymoretext\n"; }
if ($statusnote eq "") {
if ($newentrysubject ne "") {
$statusnote = qq(<B><FONT COLOR="#000000">Previewing "$newentrysubject"</FONT></B><BR><FONT SIZE=1>Click "Add This Entry" below to add this entry to your site, or click "Re-Edit This Entry" to re-edit it.</FONT><P>);
} else {
$statusnote = qq(<B><FONT COLOR="#000000">Previewing New Entry</FONT></B><BR><FONT SIZE=1>Click "Add This Entry" below to add this entry to your site, or click "Re-Edit This Entry" to re-edit it.</FONT><P>);
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.");
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 = <FUNNYFEET>;
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.");
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.");
open (THISFILE, ">$EntriesPath/$thisentrynumberpadded.$entrysuffix") || &gm_dangermouse("Can't write file to $EntriesPath/$thisentrynumberpadded.$entrysuffix - please run Diagnostics & Repair in the Configuration screen.");
open (THISFILE, ">$EntriesPath/$thisentrynumberpadded.$entrysuffix") || &gm_dangermouse("Can't write file to $EntriesPath/$thisentrynumberpadded.$entrysuffix - please run Diagnostics & Repair in the Configuration screen.");
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 = <FUNNYFEET>;
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.");
if ($indexfilenameprefix eq "index.") { $indexfilenamesmartcheck = "/"; }
print<<GMPOPUPNOTICE;
$gmheadtag
$gmframetoptwo<B><FONT COLOR="#0000FF">Your new entry has been added to <A HREF="$LogWebPath$indexfilenamesmartcheck" TARGET="NEW"><FONT COLOR="#0000FF">your site</FONT></A>.</FONT></B><P><A HREF="javascript:window.close();">Click here to close this window.</A>$gmframebottomtwo
</BODY>
</HTML>
GMPOPUPNOTICE
exit;
}
$statusnote = qq(<B><FONT COLOR="#0000FF">Your new entry has been added.</FONT></B><P>);
&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(<B><FONT COLOR="#FF0000">You don't have access to rebuild the files.</FONT></B><P>);
&gm_frontpage;
}
&gm_readcounter;
if ($newentrynumber eq "0") {
$statusnote = qq(<B><FONT COLOR="#FF0000">There are no entries yet!</FONT></B><P>);
&gm_frontpage;
}
if ($statusnote eq "") { $statusnote = qq(<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=380><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B><FONT COLOR="#000000">Rebuild Files</FONT></B><BR><FONT SIZE=1>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 visiblenote that whenever you add a new entry, Greymatter automatically updates the relevant files.</FONT></TD></TR></TABLE><P>); }
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Rebuild All Entry Pages" STYLE="width: 320">
$rebuildconnectedfilesbutton
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Rebuild Everything" STYLE="width: 320">
<P>
<FONT SIZE=1>
After clicking, expect a wait of up to several minutes, depending<BR>on how much is being rebuilt. <B>DO NOT INTERRUPT GREYMATTER</B><BR>while it's rebuilding, or you could damage your files.
</FONT>
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #D0D0FF">
</FORM>
<P>
<FONT SIZE=1>
"The most merciful thing in the world is the inability of the
<BR>
human mind to correlate all its contents."H.P. Lovecraft
</FONT>
$gmframebottom
</BODY>
</HTML>
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(<B><FONT COLOR="#FF0000">You don't have access to rebuild the main index file.</FONT></B><P>);
&gm_frontpage;
}
&gm_readcounter;
if ($newentrynumber eq "0") {
$statusnote = qq(<B><FONT COLOR="#FF0000">There are no entries yet.</FONT></B><P>);
&gm_frontpage;
}
&gm_generatemainindex;
&gm_writetocplog("$IN{'authorname'} rebuilt the main index file");
if ($IN{'autorebuild'} eq "index") {
$statusnote = qq(<B><FONT COLOR="#0000FF">The $IN{'modifiedtemplategroup'} templates have been<BR>modified and the main index file has been rebuilt.</FONT></B><P>);
&gm_edittemplates;
} else {
$statusnote = qq(<B><FONT COLOR="#0000FF">The main index file has been rebuilt.</FONT></B><P>);
&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(<B><FONT COLOR="#FF0000">You don't have access to rebuild the last entry page.</FONT></B><P>);
&gm_frontpage;
}
&gm_readconfig;
if ($generateentrypages ne "yes") {
$statusnote = qq(<B><FONT COLOR="#FF0000">Entry page generation is currently disabled.</FONT></B><P>);
&gm_rebuildfilesmenu;
}
&gm_readcounter;
&gm_readtemplates;
if ($newentrynumber eq "0") {
$statusnote = qq(<B><FONT COLOR="#FF0000">There are no entries yet.</FONT></B><P>);
&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.");
&gm_writetocplog("$IN{'authorname'} rebuilt the last entry page");
$statusnote = qq(<B><FONT COLOR="#0000FF">The last entry page has been rebuilt.</FONT></B><P>);
&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(<B><FONT COLOR="#FF0000">You don't have access to rebuild the main entry pages.</FONT></B><P>);
&gm_frontpage;
}
&gm_readconfig;
if ($generateentrypages ne "yes") {
$statusnote = qq(<B><FONT COLOR="#FF0000">Entry page generation is currently disabled.</FONT></B><P>);
&gm_rebuildfilesmenu;
}
&gm_readcounter;
&gm_readtemplates;
if ($newentrynumber eq "0") {
$statusnote = qq(<B><FONT COLOR="#FF0000">There are no entries yet.</FONT></B><P>);
&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(<B><FONT COLOR="#FF0000">You don't have access to rebuild the archive master index.</FONT></B><P>);
&gm_frontpage;
}
&gm_readconfig;
&gm_readcounter;
&gm_readtemplates;
if ($keeparchivemasterindex eq "no") {
$statusnote = qq(<B><FONT COLOR="#FF0000">"Keep archive master index" is currently disabled.</FONT></B><P>);
&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(<B><FONT COLOR="#0000FF">The archive master index has been rebuilt.</FONT></B><P>);
&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(<B><FONT COLOR="#FF0000">You don't have access to rebuild the archive log indexes.</FONT></B><P>);
&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(<B><FONT COLOR="#FF0000">Log archives are currently disabled.</FONT></B><P>);
if ($IN{'autorebuild'} eq "archiveindexes") {
$statusnote = qq(<B><FONT COLOR="#FF0000">The $IN{'modifiedtemplategroup'} templates have been modified.</FONT></B><P>);
}
&gm_frontpage;
}
if (($newarchivenumber eq "0") && ($concurrentmainandarchives ne "yes")) {
$statusnote = qq(<B><FONT COLOR="#FF0000">There are no archive log indexes yet.</FONT></B><P>);
if ($IN{'autorebuild'} eq "archiveindexes") {
$statusnote = qq(<B><FONT COLOR="#FF0000">The $IN{'modifiedtemplategroup'} templates have been modified.</FONT></B><P>);
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(<B><FONT COLOR="#0000FF">The $IN{'modifiedtemplategroup'} templates have been<BR>modified and the archive indexes have been rebuilt.</FONT></B><P>);
&gm_edittemplates;
} else {
$statusnote = qq(<B><FONT COLOR="#0000FF">The archive log indexes have been rebuilt.</FONT></B><P>);
&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(<B><FONT COLOR="#FF0000">You don't have access to rebuild the archive entry pages.</FONT></B><P>);
&gm_frontpage;
}
&gm_readconfig;
&gm_readcounter;
&gm_readtemplates;
if ($newarchivenumber eq "0") {
$statusnote = qq(<B><FONT COLOR="#FF0000">There are no archives yet.</FONT></B><P>);
&gm_frontpage;
}
if ($generateentrypages eq "no") {
$statusnote = qq(<B><FONT COLOR="#FF0000">Entry page generation is currently disabled.</FONT></B><P>);
&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(<B><FONT COLOR="#FF0000">You don't have access to rebuild the entry pages.</FONT></B><P>);
&gm_frontpage;
}
&gm_readconfig;
if ($generateentrypages ne "yes") {
$statusnote = qq(<B><FONT COLOR="#FF0000">Entry page generation is currently disabled.</FONT></B><P>);
&gm_rebuildfilesmenu;
}
&gm_readcounter;
&gm_readtemplates;
if ($newentrynumber eq "0") {
$statusnote = qq(<B><FONT COLOR="#FF0000">There are no entries yet.</FONT></B><P>);
$statusnote = qq(<B><FONT COLOR="#000000">Entry Selection</FONT></B><BR><FONT SIZE=1>Select an entry to edit or review. "Closed" entries are considered deleted<BR>and are no longer visible on your site, but can be reopened at any time.</FONT><P>);
}
if ($gmentryeditaccess eq "mineonly") {
$statusnote .= qq(<B>You only have access to edit your own entries.</B><P>);
}
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.");
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Edit Selected Entry"> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #FFD0D0" VALUE="Open/Close Selected Entry">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0; width: 485" VALUE="Search And Replace Across All Entries">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #D0D0FF">
</FORM>
<P>
<FONT SIZE=1>
"We must be the change we wish to see in the world."Gandhi
</FONT>
</CENTER>
$gmframebottom
</BODY>
</HTML>
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(<B><FONT COLOR="#FF0000">You don't have access to perform a search-and-replace.</FONT></B><P>);
&gm_frontpage;
}
if ($gmentryeditaccess eq "mineonly") {
$statusnote = qq(<B><FONT COLOR="#FF0000">You must have access to edit all entries to do this.</FONT></B><P>);
&gm_editentryselection;
}
if ($statusnote eq "") {
$statusnote = qq(<B><FONT COLOR="#000000">Search And Replace</FONT></B><BR><FONT SIZE=1>Enter whatever exact text or other information you wish to search across entries for in the<BR>first box, and whatever you wish to replace it with in the second box (leave the Replace<BR>box blank to delete all instances of your search term). Keep in mind that a search-and-replace<BR>will make permanent changes to the contents of ALL entries that contain your search term.</FONT><P>);
<INPUT TYPE=CHECKBOX NAME="srcaseinsensitive" VALUE="yes"> Make "Search For" term case-insensitive?
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0; width: 485" VALUE="Perform Search And Replace">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Entry Selection"> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #D0D0FF">
</FORM>
<P>
<FONT SIZE=1>
"Search others for their virtues, thyself for thy vices."Benjamin Franklin
</FONT>
</CENTER>
$gmframebottom
</BODY>
</HTML>
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(<B><FONT COLOR="#FF0000">You don't have access to perform a search-and-replace.</FONT></B><P>);
&gm_frontpage;
}
if ($gmentryeditaccess eq "mineonly") {
$statusnote = qq(<B><FONT COLOR="#FF0000">You must have access to edit all entries to do this.</FONT></B><P>);
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.");
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.");
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.");
&gm_writetocplog("$IN{'authorname'} searched all entries for \"$IN{'srsearchterm'}\" and replaced it with \"$IN{'srreplaceterm'}\" (no entries affected)");
$statusnote = qq(<B><FONT COLOR="#FF0000">The search term was not found.</FONT></B><P>);
$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(<B><FONT COLOR="#0000FF">The search-and-replace was completed successfully \(1 entry affected\).<BR>The affected entry is listed below.</FONT></B><P>);
$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(<B><FONT COLOR="#0000FF">The search-and-replace was completed successfully \($entriesaffected entries affected\).<BR>All affected entries are listed below.</FONT></B><P>);
$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(<B><FONT COLOR="#FF0000">You don't have access to edit entries.</FONT></B><P>);
&gm_frontpage;
}
if ($IN{'entryselectionlist'} eq "") {
$statusnote = qq(<B><FONT COLOR="#FF0000">You must select an entry to edit.</FONT></B><P>);
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.");
if ($statusnote eq "") { $statusnote = qq(<B><FONT COLOR="#000000"><B>Editing Entry #$thisentrynumber: Posted by $thisentryauthor @ $thisentrymonthmonth/$thisentrydayday/$thisentryyearyear $thisentryhourhour\:$thisentryminuteminute\:$thisentrysecondsecond $thisentryampm</B></FONT></B><P>); }
$autorebuildcheckbox = "";
if ($gmrebuildaccess eq "yes") {
if ($automaticrebuilddefault eq "yes") {
$autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="indexandentry" CHECKED> Automatically rebuild main index and this entry's page after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>);
} else {
$autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="indexandentry"> Automatically rebuild main index and this entry's page after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>);
if ((parseInt(navigator.appVersion) >= 4) && (navigator.appName == "Microsoft Internet Explorer")) {
document.write("<FONT SIZE=1>Shortcut keys: CTRL-SHIFT-A to add a link, CTRL-SHIFT-B to bold selected text,<BR>CTRL-SHIFT-I to italicise, CTRL-SHIFT-U to underline</FONT><P>");
if ($allowkarmaorcomments eq "both") { print "<BR>\n"; }
if (($allowkarmaorcomments eq "comments") || ($allowkarmaorcomments eq "both")) {
if ($thisentryallowcomments eq "yes") {
print qq(Allow comments to be posted to this entry: <INPUT TYPE=RADIO NAME="revisedentryallowcomments" VALUE="yes" CHECKED> Yes <INPUT TYPE=RADIO NAME="revisedentryallowcomments" VALUE="no"> No\n<BR>\n);
} else {
print qq(Allow comments to be posted to this entry: <INPUT TYPE=RADIO NAME="revisedentryallowcomments" VALUE="yes"> Yes <INPUT TYPE=RADIO NAME="revisedentryallowcomments" VALUE="no" CHECKED> No\n<BR>\n);
print qq(Keep this entry at the top of the main page: <INPUT TYPE=RADIO NAME="revisedentrystayattop" VALUE="yes" CHECKED> Yes <INPUT TYPE=RADIO NAME="revisedentrystayattop" VALUE="no"> No\n<BR>\n);
} else {
print qq(Keep this entry at the top of the main page: <INPUT TYPE=RADIO NAME="revisedentrystayattop" VALUE="yes"> Yes <INPUT TYPE=RADIO NAME="revisedentrystayattop" VALUE="no" CHECKED> No\n<BR>\n);
}
if ($thisentryopenstatus eq "open") {
print qq(This entry is: <INPUT TYPE=RADIO NAME="revisedentryopenstatus" VALUE="open" CHECKED> Open <INPUT TYPE=RADIO NAME="revisedentryopenstatus" VALUE="closed"> Closed\n);
} else {
print qq(This entry is: <INPUT TYPE=RADIO NAME="revisedentryopenstatus" VALUE="open"> Open <INPUT TYPE=RADIO NAME="revisedentryopenstatus" VALUE="closed" CHECKED> Closed\n);
}
print<<GMENTRYEDITBOTTOM;
$autorebuildcheckbox
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Save Changes To This Entry"> <INPUT TYPE=RESET CLASS="button" STYLE="background: #FFD0D0" VALUE="Undo Changes Since Last Save">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Select Another Entry">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #D0D0FF">
</FORM>
<P>
<FONT SIZE=1>
"Always changing; everything for good, nothing for nothing."Flying Hawk, Sioux Chief
</FONT>
$gmframebottom
</BODY>
</HTML>
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(<B><FONT COLOR="#FF0000">You don't have access to edit entries.</FONT></B><P>);
&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(<B><FONT COLOR="#FF0000">You don't have access to edit entries you didn't create.</FONT></B><P>);
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.");
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.");
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 = <FUNNYFEET>;
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.");
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.");
$statusnote = qq(<B><FONT COLOR="#0000FF">Entry #$IN{'revisedentrynumber'} ($recordentrysubject) has been edited<BR>and the main index & this entry's page have been rebuilt.</FONT></B><P>);
} else {
$statusnote = qq(<B><FONT COLOR="#0000FF">Entry #$IN{'revisedentrynumber'} ($recordentrysubject) has been edited.<BR>Be sure to rebuild your files for the changes to be visible on your site.</FONT></B><P>);
}
&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(<B><FONT COLOR="#FF0000">You don't have access to open/close entries.</FONT></B><P>);
&gm_frontpage;
}
if ($IN{'entryselectionlist'} eq "") {
$statusnote = qq(<B><FONT COLOR="#FF0000">You must select an entry to open or close.</FONT></B><P>);
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.");
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(<B><FONT COLOR="#FF0000">You don't have access to open/close entries you didn't create.</FONT></B><P>);
&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.");
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 = <FUNNYFEET>;
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.");
&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(<B><FONT COLOR="#0000FF">Entry #$thisentrynumber ($thisentrysubject) has been reopened.<BR>Be sure to rebuild your files for the changes to be visible on your site.</FONT></B><P>);
} else {
$statusnote = qq(<B><FONT COLOR="#0000FF">Entry #$thisentrynumber ($thisentrysubject) has been closed.<BR>Be sure to rebuild your files for the changes to be visible on your site.</FONT></B><P>);
}
&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(<B><FONT COLOR="#FF0000">You don't have access to delete comments.</FONT></B><P>);
&gm_frontpage;
}
if ($IN{'revisedentrycommentselection'} eq "") {
$statusnote = qq(<B><FONT COLOR="#FF0000">You must select a comment to be deleted.</FONT></B><P>);
&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(<B><FONT COLOR="#FF0000">You don't have access to delete comments from entries you didn't create.</FONT></B><P>);
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.");
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.");
&gm_writetocplog("$IN{'authorname'} attempted to edit comment #$IN{'revisedentrycommentselection'} in entry #$IN{'revisedentrynumber'} ($IN{'revisedentrysubject'}) without authorization");
$statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit comments.</FONT></B><P>);
&gm_frontpage;
}
if ($IN{'revisedentrycommentselection'} eq "") {
$statusnote = qq(<B><FONT COLOR="#FF0000">You must select a comment to be edited.</FONT></B><P>);
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(<B><FONT COLOR="#FF0000">You don't have access to edit comments in entries you didn't create.</FONT></B><P>);
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.");
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Save Changes To This Comment"> <INPUT TYPE=RESET CLASS="button" STYLE="background: #FFD0D0" VALUE="Undo Changes Since Last Save">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Entry Editing">
<P>
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #D0D0FF">
</FORM>
<P>
<FONT SIZE=1>
"All good men are happy when they choose to be their own authors. Those who choose to have
<BR>
others edit their pathways, must live on the edge of another man's sword."Julie Arabi
</FONT>
$gmframebottom
</BODY>
</HTML>
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(<B><FONT COLOR="#FF0000">You don't have access to edit comments.</FONT></B><P>);
&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(<B><FONT COLOR="#FF0000">You don't have access to edit comments in entries you didn't create.</FONT></B><P>);
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.");
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(<B><FONT COLOR="#0000FF">Comment #$IN{'revisedentrycommentselection'} has been edited. Be sure to rebuild your files<BR>to make the changes visible on that entry's page.</FONT></B><P>);
&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(<B><FONT COLOR="#FF0000">You don't have access to perform diagnostics & repair.</FONT></B><P>);
&gm_frontpage;
}
print<<GMDIAGNOSTICSCHECK;
$gmheadtag
$gmframetop
<B>Diagnostics & Repair</B>
<P>
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. <B>Note:</B> This will verify your Local paths, but it cannot verify your Website paths.<P>Please wait for several moments after clicking (or even minutes if you have a large number of entries).<BR><B>DO NOT interrupt this procedure once started!</B><P><FORM ACTION="gm.cgi" METHOD=POST><INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}"><INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}"><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=10 CELLSPACING=0 BGCOLOR="#FFD0D0"><TR><TD VALIGN=MIDDLE ALIGN=CENTER><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Perform Diagnostics & Repair"></FONT></TD></TR></TABLE></TD></TR></TABLE><P><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Configuration"> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #D0D0FF"></FORM><P><FONT SIZE=1>"The body must be repaired and supported, if we would preserve the mind in all its vigor."Pliny the Younger</FONT>
$gmframebottom
</BODY>
</HTML>
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(<B><FONT COLOR="#FF0000">You don't have access to perform diagnostics & repair.</FONT></B><P>);
&gm_frontpage;
}
$docreport = "<UL>\n";
open (NOWHEREMAN, "$cgilocalpath/gm-authors.cgi") || &gm_dangermouse("Can't read $cgilocalpath/gm-authors.cgi. Make sure this file is in the same directory as all your Greymatter CGI files and is CHMODed to 666, and that your Local CGI Path is pointing to the correct place.");
@nowherefile = <NOWHEREMAN>;
close (NOWHEREMAN);
chmod (0666, "gm-authors.cgi");
open (NOWHEREMAN, ">$cgilocalpath/gm-authors.cgi") || &gm_dangermouse("Can't write to $cgilocalpath/gm-authors.cgi. Make sure this file is in the same directory as all your Greymatter CGI files and is CHMODed to 666, and that your Local CGI Path is pointing to the correct place.");
print NOWHEREMAN @nowherefile;
close (NOWHEREMAN);
open (NOWHEREMAN, "$cgilocalpath/gm-banlist.cgi") || &gm_dangermouse("Can't read $cgilocalpath/gm-banlist.cgi. Make sure this file is in the same directory as all your Greymatter CGI files and is CHMODed to 666, and that your Local CGI Path is pointing to the correct place.");
@nowherefile = <NOWHEREMAN>;
close (NOWHEREMAN);
chmod (0666, "gm-banlist.cgi");
open (NOWHEREMAN, ">$cgilocalpath/gm-banlist.cgi") || &gm_dangermouse("Can't write to $cgilocalpath/gm-banlist.cgi. Make sure this file is in the same directory as all your Greymatter CGI files and is CHMODed to 666, and that your Local CGI Path is pointing to the correct place.");
print NOWHEREMAN @nowherefile;
close (NOWHEREMAN);
open (NOWHEREMAN, "$cgilocalpath/gm-config.cgi") || &gm_dangermouse("Can't read $cgilocalpath/gm-config.cgi. Make sure this file is in the same directory as all your Greymatter CGI files and is CHMODed to 666, and that your Local CGI Path is pointing to the correct place.");
@nowherefile = <NOWHEREMAN>;
close (NOWHEREMAN);
chmod (0666, "gm-config.cgi");
open (NOWHEREMAN, ">$cgilocalpath/gm-config.cgi") || &gm_dangermouse("Can't write to $cgilocalpath/gm-config.cgi. Make sure this file is in the same directory as all your Greymatter CGI files and is CHMODed to 666, and that your Local CGI Path is pointing to the correct place.");
print NOWHEREMAN @nowherefile;
close (NOWHEREMAN);
open (NOWHEREMAN, "$cgilocalpath/gm-counter.cgi") || &gm_dangermouse("Can't read $cgilocalpath/gm-counter.cgi. Make sure this file is in the same directory as all your Greymatter CGI files and is CHMODed to 666, and that your Local CGI Path is pointing to the correct place.");
@nowherefile = <NOWHEREMAN>;
close (NOWHEREMAN);
chmod (0666, "gm-counter.cgi");
open (NOWHEREMAN, ">$cgilocalpath/gm-counter.cgi") || &gm_dangermouse("Can't write to $cgilocalpath/gm-counter.cgi. Make sure this file is in the same directory as all your Greymatter CGI files and is CHMODed to 666, and that your Local CGI Path is pointing to the correct place.");
print NOWHEREMAN @nowherefile;
close (NOWHEREMAN);
open (NOWHEREMAN, "$cgilocalpath/gm-cplog.cgi") || &gm_dangermouse("Can't read $cgilocalpath/gm-cplog.cgi. Make sure this file is in the same directory as all your Greymatter CGI files and is CHMODed to 666, and that your Local CGI Path is pointing to the correct place.");
@nowherefile = <NOWHEREMAN>;
close (NOWHEREMAN);
chmod (0666, "gm-cplog.cgi");
open (NOWHEREMAN, ">$cgilocalpath/gm-cplog.cgi") || &gm_dangermouse("Can't write to $cgilocalpath/gm-cplog.cgi. Make sure this file is in the same directory as all your Greymatter CGI files and is CHMODed to 666, and that your Local CGI Path is pointing to the correct place.");
print NOWHEREMAN @nowherefile;
close (NOWHEREMAN);
open (NOWHEREMAN, "$cgilocalpath/gm-entrylist.cgi") || &gm_dangermouse("Can't read $cgilocalpath/gm-entrylist.cgi. Make sure this file is in the same directory as all your Greymatter CGI files and is CHMODed to 666, and that your Local CGI Path is pointing to the correct place.");
@nowherefile = <NOWHEREMAN>;
close (NOWHEREMAN);
chmod (0666, "gm-entrylist.cgi");
open (NOWHEREMAN, ">$cgilocalpath/gm-entrylist.cgi") || &gm_dangermouse("Can't write to $cgilocalpath/gm-entrylist.cgi. Make sure this file is in the same directory as all your Greymatter CGI files and is CHMODed to 666, and that your Local CGI Path is pointing to the correct place.");
print NOWHEREMAN @nowherefile;
close (NOWHEREMAN);
open (NOWHEREMAN, "$cgilocalpath/gm-templates.cgi") || &gm_dangermouse("Can't read $cgilocalpath/gm-templates.cgi. Make sure this file is in the same directory as all your Greymatter CGI files and is CHMODed to 666, and that your Local CGI Path is pointing to the correct place.");
@nowherefile = <NOWHEREMAN>;
close (NOWHEREMAN);
chmod (0666, "gm-templates.cgi");
open (NOWHEREMAN, ">$cgilocalpath/gm-templates.cgi") || &gm_dangermouse("Can't write to $cgilocalpath/gm-templates.cgi. Make sure this file is in the same directory as all your Greymatter CGI files and is CHMODed to 666, and that your Local CGI Path is pointing to the correct place.");
print NOWHEREMAN @nowherefile;
close (NOWHEREMAN);
$docreport .= "<LI> All config files are readable/writeable and are CHMODed correctly\n";
if (!(open(NOWHEREMAN,"$cgilocalpath/gm-karma.cgi"))) {
&gm_dangermouse("Can't find $cgilocalpath/gm-karma.cgi. Make sure this file is in the same directory as all your Greymatter CGI files and is CHMODed to 755, and that your Local CGI Path is pointing to the correct place.");
}
close(NOWHEREMAN);
if (!(open(NOWHEREMAN,"$cgilocalpath/gm-comments.cgi"))) {
&gm_dangermouse("Can't find $cgilocalpath/gm-comments.cgi. Make sure this file is in the same directory as all your Greymatter CGI files and is CHMODed to 755, and that your Local CGI Path is pointing to the correct place.");
}
close(NOWHEREMAN);
if (!(open(NOWHEREMAN,"$cgilocalpath/gm-upload.cgi"))) {
&gm_dangermouse("Can't find $cgilocalpath/gm-upload.cgi. Make sure this file is in the same directory as all your Greymatter CGI files and is CHMODed to 755, and that your Local CGI Path is pointing to the correct place.");
}
close(NOWHEREMAN);
if (!(open(NOWHEREMAN,"$cgilocalpath/gm-library.cgi"))) {
&gm_dangermouse("Can't find $cgilocalpath/gm-library.cgi. Make sure this file is in the same directory as all your Greymatter CGI files and is CHMODed to 666, and that your Local CGI Path is pointing to the correct place.");
}
close(NOWHEREMAN);
$docreport .= "<LI> The local CGI path is correctly configured and all essential files are there\n";
open (NOWHEREMAN, ">$EntriesPath/gm-testfile.txt") || &gm_dangermouse("Can't create files in $EntriesPath. Make sure the entries/archives path is correctly configured and that this directory is CHMODed to 777.");
print NOWHEREMAN "test";
close (NOWHEREMAN);
unlink ("$EntriesPath/gm-testfile.txt") || &gm_dangermouse("Can't delete the gm-testfile.txt file created in $EntriesPath. Your server may not support this operation.");
$docreport .= "<LI> The entries/archives path is readable/writeable and is CHMODed correctly\n";
open (NOWHEREMAN, "$EntriesPath/$indexfilename") || &gm_dangermouse("Can't read $EntriesPath/$indexfilename. Make sure the entries/archives path is correctly configured and CHMODed to 777, the index filename is correctly specified under Configuration, and that this file is CHMODed to 666.");
@nowhereland = <NOWHEREMAN>;
close (NOWHEREMAN);
open (NOWHEREMAN, ">$EntriesPath/$indexfilename") || &gm_dangermouse("Can't write to $EntriesPath/$indexfilename. Make sure the entries/archives path is correctly configured and CHMODed to 777, the index filename is correctly specified under Configuration, and that this file is CHMODed to 666.");
print NOWHEREMAN @nowhereland;
close (NOWHEREMAN);
$docreport .= "<LI> The archive index file is readable/writeable and is CHMODed correctly\n";
open (FUNNYFEET, "$EntriesPath/$nextentrynumberpadded.cgi") || &gm_dangermouse("Can't open $EntriesPath/$nextentrynumberpadded.cgi - this file may be missing or corrupt, especially if you've tried to add new entries or start using Greymatter with an incorrect installation. Please run Diagnostics & Repair in the Configuration screen.");
open (FUNNYFEET, "$EntriesPath/$previousentrynumberpadded.cgi") || &gm_dangermouse("Can't open $EntriesPath/$previousentrynumberpadded.cgi - this file may be missing or corrupt, especially if you've tried to add new entries or start using Greymatter with an incorrect installation. Please run Diagnostics & Repair in the Configuration screen.");
open (FUNNYFEET, ">$EntriesPath/$checkentrycounterpadded.cgi") || &gm_dangermouse("Can't write to $EntriesPath/$checkentrycounterpadded.cgi. Please make sure that your entries/archives directory is correctly configured and is CHMODed to 777.");
print FUNNYFEET "This entry was detected by Greymatter during Diagnostics & Repair as being missing or corrupt. This is a dummy entry only. DO NOT reopen this entry.\n";
print FUNNYFEET "\n";
close (FUNNYFEET);
$docreportentryappend = "yes";
$docreport .= "<LI> Entry #$checkentrycounter was detected as being missing or corrupt and was successfully replaced (it is recommended that you go to the Rebuild Files screen now and click \"Rebuild Everything\")\n";
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);
$docreport .= "<LI> The entry list was successfully rebuilt\n"
}
open (NOWHEREMAN, "$LogPath/$indexfilename") || &gm_dangermouse("Can't read $LogPath/$indexfilename. Make sure the log path is correctly configured, the index filename is correctly specified under Configuration, and that this file is CHMODed to 666.");
@nowhereland = <NOWHEREMAN>;
close (NOWHEREMAN);
chmod (0666, "$LogPath/$indexfilename");
open (NOWHEREMAN, ">$LogPath/$indexfilename") || &gm_dangermouse("Can't write to $LogPath/$indexfilename. Make sure the log path is correctly configured, the index filename is correctly specified under Configuration, and that this file is CHMODed to 666.");
print NOWHEREMAN @nowhereland;
close (NOWHEREMAN);
$docreport .= "<LI> The main index file is readable/writeable and is CHMODed correctly\n";
open (NOWHEREMAN, "$usethisfilename") || &gm_dangermouse("Can't open $usethisfilename. Please make sure that this file exists and is CHMODed to 666, or else remove it from your list of connected files in configuration.");
@connectedfilelines = <NOWHEREMAN>;
close (NOWHEREMAN);
chmod (0666, "$usethisfilename");
open (NOWHEREMAN, ">$usethisfilename") || &gm_dangermouse("Can't write to $usethisfilename. Please make sure that this file exists and is CHMODed to 666, or else remove it from your list of connected files in configuration.");
print NOWHEREMAN @connectedfilelines;
close (NOWHEREMAN);
}
$docreport .= "<LI> All connected files are readable/writeable and are CHMODed correctly\n";
}
&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.");
<FORM ACTION="gm.cgi" METHOD=POST><INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}"><INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}"><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Configuration"> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #D0D0FF"></FORM></P><P ALIGN=CENTER><FONT SIZE=1>"Old houses mended, cost little less than new before they're ended."Colley Cibber</FONT>
$gmframebottom
</BODY>
</HTML>
GMDIAGNOSTICSFINISHED
exit;
}
# ----------------
# add bookmarklets
# ----------------
sub gm_addbookmarklets {
&gm_validate;
if ($gmbookmarkletaccess ne "yes") {
&gm_writetocplog("$IN{'authorname'} attempted to add bookmarklets without authorization");
$statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to use bookmarklets.</FONT></B><P>);
&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 = <FUNNYFEET>;
close (FUNNYFEET);
$cplogtext = join (" ", @cploglines);
unless ($cplogtext =~ /successfully performed diagnostics/) {
$statusnote = qq(<B><FONT COLOR="#FF0000">Please run "Diagnostics & Repair" in the Configuration screen before adding bookmarklets.</FONT></B><P>);
&gm_frontpage;
}
}
if (($IN{'authorname'} eq "Alice") && ($IN{'authorpassword'} eq "wonderland")) {
$statusnote = qq(<B><FONT COLOR="#FF0000">You can't add bookmarklets under the default account.<BR>Create a new author account for yourself first.</FONT></B><P>);
open (FUNNYFEET, ">$EntriesPath/gmrightclick-$usethisauthorname.reg") || &gm_dangermouse("Can't write to $EntriesPath/gmrightclick.reg. 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.");
print FUNNYFEET "REGEDIT4\n";
print FUNNYFEET "[HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\MenuExt\\Post To &Greymatter]\n";
print FUNNYFEET "$gmbookmarkletline\n";
print FUNNYFEET "\"contexts\"=hex:31";
close (FUNNYFEET);
if ($statusnote eq "") { $statusnote = qq(<B><FONT COLOR="#000000">Add Bookmarklets (Internet Explorer 5+ Only)</FONT></B><P>); }
&gm_readconfig;
&gm_writetocplog("$IN{'authorname'} added a bookmarklet");
if (confirm("This will update your Windows registry. Are you sure?")) location.href="$EntriesWebPath/gmrightclick-$usethisauthorname.reg"
}
-->
</SCRIPT>
<P ALIGN=JUSTIFY>
Installing bookmarklets makes for the quickest and most convenient way to "blog" new items, allowing you to post new entries to Greymatter with one mouse-click while surfing anywhere on the web. After installing a bookmarklet, clicking the new "Post To Greymatter" menu or toolbar button in your browser will load Greymatter in a pop-up window containing a link to the website you're currently visiting all ready to go in your new entry, plus any text from the website that you may have highlighted. (These bookmarklets are currently only verified to work on Internet Explorer 5 or higher. Also, since bookmarklets contain your Greymatter name and password, you may wish to be careful about installing these if you share your computer with others.)
</P><P ALIGN=JUSTIFY>
To install the standard bookmarklet, just drag the following link to your browser's menu or toolbar:
</P><P ALIGN=CENTER><CENTER>
<B><A HREF="javascript:lt=document.selection.createRange().text;void(gmwindow=window.open('$cgiwebpath/gm.cgi?thomas=gmbmpost&authorname=$IN{'authorname'}&authorpassword=$IN{'authorpassword'}&logtext='+escape(lt)+'&loglink='+escape(location.href)+'&loglinktitle='+escape(document.title),'gmwindow','scrollbars=yes,width=660,height=460,left=75,top=75,resizable=yes,status=yes'));gmwindow.focus();">Post To Greymatter</A></B>
</CENTER></P><P ALIGN=JUSTIFY>
Even more conveniently, you can also install it to your right-click menu (IE Windows users only). To do this, click on the link below to update your Windows registry with the new menu option. After clicking OK, select "Open this file from its current location" to install.
</P><P ALIGN=CENTER><CENTER>
<B><A HREF="javascript:installrightclickposting()">Install Right-Click Menu Access</A></B>
</CENTER></P><P ALIGN=JUSTIFY>
Finally, click Clear And Exit, and shut down Internet Explorer; you should see the new option in your right-click menu once you restart IE. (Should you wish to uninstall this later, you'll need to edit your Windows registry. To do this, select "Run..." from the start menu, type in "regedit", expand the directories until you reach "\\HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\MenuExt", right click the "Post To &Greymatter" option, and click Delete. As always, be careful about editing the registryyou can mess up your computer if you do this wrong.)
</P><P ALIGN=JUSTIFY>
And that's that! You should now have the bookmarklets installed and working correctly, allowing one-click automatic logging to Greymatter from anywhere on the web. Enjoy. =)
<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Clear And Exit">
</FORM>
<FONT SIZE=1>"We aim above the mark to hit the mark."R.W. Emerson</FONT>
</CENTER></P>
$gmframebottom
</BODY>
</HTML>
GMADDBOOKMARKLETS
exit;
}
# ------------
# upload files
# ------------
sub gm_uploadfiles {
&gm_validate;
if ($gmuploadaccess ne "yes") {
&gm_writetocplog("$IN{'authorname'} attempted to upload files without authorization");
$statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to upload files.</FONT></B><P>);
&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 = <FUNNYFEET>;
close (FUNNYFEET);
$cplogtext = join (" ", @cploglines);
unless ($cplogtext =~ /successfully performed diagnostics/) {
$statusnote = qq(<B><FONT COLOR="#FF0000">Please run "Diagnostics & Repair" in the Configuration screen before uploading files.</FONT></B><P>);
if (($uploadfilesallowed ne "") && ($uploadfilesizelimit ne "0")) {
$specialuploadtext = "Only $allowthesefiletypes files may currently be uploaded,<BR>and no file larger than $uploadfilesizelimit\k may be uploaded.<P>";
} elsif ($uploadfilesallowed ne "") {
$specialuploadtext = "Only $allowthesefiletypes files may currently be uploaded.<P>";
} elsif ($uploadfilesizelimit ne "0") {
$specialuploadtext = "No file larger than $uploadfilesizelimit\k may currently be uploaded.<P>";
} else {
$specialuploadtext = "";
}
if ($statusnote eq "") { $statusnote = qq(<B><FONT COLOR="#000000">Upload Files</FONT></B><P>Use the prompt below to browse your computer for a file to upload directly to your account.<BR>(If you don't see the prompt, then your browser doesn't support this feature.) All files<BR>will be uploaded to your entries/archives directory; after uploading, you can then have<BR>a link to download the file or display the image in a new entry if you wish.<P>$specialuploadtext); }
print qq(Greymatter has detected that you are upgrading from version 1.0. Some of your files will need to be updated now. After Greymatter is done updating, you might want to review your configuration and customize the templates; many new templates are included which could affect your site.<P><B>Important notes:</B> If you have an index page in your archives directory, Greymatter will, by default, overwrite it with its new archive index, so you may want to <B>make a backup of that file</B> first; you'll also need to make sure that file is CHMODed to 666, or simply delete that file instead. There is also a new gm-upload.cgi file that you'll have to upload with your other Greymatter CGI files and CHMOD to 755, if you haven't already.<P><FORM ACTION="gm.cgi" METHOD=POST><INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}"><INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}"><INPUT TYPE=HIDDEN NAME="oldsetupversion" VALUE="$versionsetup"><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Update Now"></FORM><P><FONT SIZE=1>"We must always change, renew, rejuvenate ourselves."Goethe</FONT>);
} elsif ($versionsetup eq "1.1") {
print qq(Greymatter has detected that you are upgrading from version 1.1. Some of your files will need to be updated now. After Greymatter is done updating, you might want to review the new configuration and template options; it's also <I>strongly recommended</I> that you "Rebuild Everything" right after it finishes updating. Finally, be sure to upload the new gm-upload.cgi with your other Greymatter CGI files and CHMOD it to 755, if you haven't already.<P><FORM ACTION="gm.cgi" METHOD=POST><INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}"><INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}"><INPUT TYPE=HIDDEN NAME="oldsetupversion" VALUE="$versionsetup"><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Update Now"></FORM><P><FONT SIZE=1>"We must always change, renew, rejuvenate ourselves."Goethe</FONT>);
} elsif ($versionsetup eq "1.2") {
print qq(Greymatter has detected that you are upgrading from version 1.2. This is a minor upgrade release and no changes will be made to your files.<P><FORM ACTION="gm.cgi" METHOD=POST><INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}"><INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}"><INPUT TYPE=HIDDEN NAME="oldsetupversion" VALUE="$versionsetup"><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Update Now"></FORM><P><FONT SIZE=1>"We must always change, renew, rejuvenate ourselves."Goethe</FONT>);
} elsif ($versionsetup eq "1.21") {
print qq(Greymatter has detected that you are upgrading from version 1.21. This is a minor upgrade release and no changes will be made to your files.<P><FORM ACTION="gm.cgi" METHOD=POST><INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}"><INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}"><INPUT TYPE=HIDDEN NAME="oldsetupversion" VALUE="$versionsetup"><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Update Now"></FORM><P><FONT SIZE=1>"We must always change, renew, rejuvenate ourselves."Goethe</FONT>);
} elsif ($versionsetup eq "1.21a") {
print qq(Greymatter has detected that you are upgrading from version 1.21a. This is a minor upgrade release and no changes will be made to your files.<P><FORM ACTION="gm.cgi" METHOD=POST><INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}"><INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}"><INPUT TYPE=HIDDEN NAME="oldsetupversion" VALUE="$versionsetup"><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Update Now"></FORM><P><FONT SIZE=1>"We must always change, renew, rejuvenate ourselves."Goethe</FONT>);
} elsif ($versionsetup eq "1.21b") {
print qq(Greymatter has detected that you are upgrading from version 1.21b. This is a bugfix release, with a few new variables. No changes will be made to your files.<P><FORM ACTION="gm.cgi" METHOD=POST><INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}"><INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}"><INPUT TYPE=HIDDEN NAME="oldsetupversion" VALUE="$versionsetup"><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Update Now"></FORM><P><FONT SIZE=1>"We must always change, renew, rejuvenate ourselves."Goethe</FONT>);
} else {
print qq(<B>ERROR:</B> Greymatter could not determine the version setup. Please make sure that Greymatter is installed correctly. Try reuploading the gm-config.cgi file that came with Greymatter and try logging in again; you'll need to reconfigure your Configuration settings.);
}
print<<GMVERSIONCHECKBOTTOM;
$gmframebottom
</BODY>
</HTML>
GMVERSIONCHECKBOTTOM
exit;
}
}
# -----------------
# version upgrading
# -----------------
sub gm_versionupgrading {
if ($IN{'oldsetupversion'} eq "one point zero") {
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.");
@tempnewentrylist = <FUNNYFEET>;
close (FUNNYFEET);
open (FUNNYFEETWO, ">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.");
if (($IN{'oldsetupversion'} eq "one point zero") || ($IN{'oldsetupversion'} eq "1.1")) {
&gm_readtemplates;
open (LAUGHINGFEET, "gm-templates.cgi") || &gm_dangermouse("Can't read 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.");
@gmtemplateline = <LAUGHINGFEET>;
close (LAUGHINGFEET);
open (LAUGHINGFEETONE, ">gm-templates.cgi") || &gm_dangermouse("Can't write to 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.");
$pagepositivekarmalinkreplacement = qq(<A HREF="{{positivekarmalink}}" onMouseOver="window.status='Cast a positive vote on this entry';return true" onMouseOut="window.status='';return true">);
$pagenegativekarmalinkreplacement = qq(<A HREF="{{negativekarmalink}}" onMouseOver="window.status='Cast a negative vote on this entry';return true" onMouseOut="window.status='';return true">);
open (LAUGHINGFEETTWO, ">gm-templates.cgi") || &gm_dangermouse("Can't write to 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.");
print LAUGHINGFEETTWO qq(<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">|*|<HTML>|*|<HEAD>|*|<TITLE>Search Results</TITLE>|*|<META NAME="Generator" CONTENT="Greymatter {{gmversion}}">|*|</HEAD>|*||*|<BODY BGCOLOR="#FFFFFF">|*||*|<P ALIGN=CENTER>|*|<B>Search results for "{{searchterm}}" \({{searchmatches}} matches\)</B>|*|</P>|*||*|{{searchresults}}|*||*|<P ALIGN=CENTER>|*|[<A HREF="{{pageindexlink}}">Return To Main Index</A>]|*|</P><P ALIGN=CENTER>|*|{{gmicon}}|*|</P>|*||*|</BODY>|*|</HTML>\n);
print LAUGHINGFEETTWO qq(<A NAME="comments">|*||*|<P ALIGN=CENTER>|*|<B>Previewing Your Comment</B>|*|</P>|*|\n);
print LAUGHINGFEETTWO qq(<P ALIGN=CENTER>|*|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.|*|</P><P ALIGN=CENTER><CENTER>|*|<FORM ACTION="{{cgiwebpath}}/gm-comments.cgi" METHOD=POST>|*|<INPUT TYPE=HIDDEN NAME="newcommententrynumber" VALUE="{{entrynumber}}">|*|<INPUT TYPE=HIDDEN NAME="newcommentauthor" VALUE="{{previewcommentauthor}}">|*|<INPUT TYPE=HIDDEN NAME="newcommentemail" VALUE="{{previewcommentemail}}">|*|<INPUT TYPE=HIDDEN NAME="newcommenthomepage" VALUE="{{previewcommenthomepage}}">|*|<INPUT TYPE=HIDDEN NAME="newcommentbody" VALUE="{{previewcommentbody}}">|*|<INPUT TYPE=SUBMIT VALUE="Post This Comment">|*|</FORM>|*|</CENTER></P>\n);
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 = <LAUGHINGFEETTHREE>;
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.");
&gm_writetocplog("<B><FONT COLOR=\"#0000FF\">$IN{'authorname'} upgraded Greymatter from an older version ($IN{'oldsetupversion'}) to a newer version ($gmversion)</FONT></B>");
&gm_writetocplog("$IN{'authorname'} attempted to rebuild files without authorization");
$statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to rebuild files.</FONT></B><P>);
&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")) {
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.");
$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.");
$whatimdoing = qq($statusnote<P><FORM ACTION="gm.cgi" METHOD=POST><INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}"><INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}"><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #D0D0FF"></FORM><P><FONT SIZE=1>"Man must not demolish, but build; he must raise temples where mankind<BR>may come and partake of the purest pleasure."Goethe</FONT>);