· 10 years ago · Jan 09, 2016, 05:15 AM
1###############################################
2# Greymatter 1.3.1 #
3# Build 208 #
4# Main Library #
5# Copyright (c)2000-2005, The Greymatter team #
6# http://www.greymatterforums.com/ #
7###############################################
8
9$cookiename = "gm_password";
10
11# *** Your possession of this software indicates that you agree to the terms ***
12# *** specified under the "Copyright & Usage" heading in the "manual.html" file. ***
13
14# Patch for weekdayshort and monthwordshort variables
15# provided by Rae (rae@tnir.org)
16# c&p'ed in by domesticat
17# (gmstuff@domesticat.net)
18
19# -----------------
20# program variables
21# -----------------
22
23$gmversion = "1.3.1";
24
25$gmfonttag = qq(<FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE=2>);
26
27$gmheadtag = qq#<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
28<HTML>
29<HEAD>
30<TITLE>Greymatter</TITLE>
31<meta name="Generator" content="Greymatter $gmversion" />
32<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1" />
33<style>
34.copynotice {
35 text-decoration: none;
36 font-family: verdana, arial, helvetica;
37 font-size: 7pt;
38 color: \#000;
39}
40.copynotice:hover {
41 color: \#FFFFFF;
42}
43.button {
44 font-family: verdana, arial, helvetica;
45 font-size: 13px;
46 background: \#FFFFD0;
47 border: 1px solid \#000;
48 width: 240px;
49 height: 26px;
50}
51.button_big_green {
52 background: \#D0FFD0;
53 width: 500px;
54 font-family: verdana, arial, helvetica;
55 font-size: 13px;
56 border: 1px solid \#000;
57 height: 26px;
58}
59.button_green {
60 background: \#D0FFD0;
61 width: 100px;
62 font-family: verdana, arial, helvetica;
63 font-size: 13px;
64 border: 1px solid \#000;
65 height: 26px;
66}
67.textinput {
68 font-family: verdana, arial, helvetica;
69 font-size: 13px;
70 background-color: \#EEEEFF;
71 border: 1px solid \#000;
72 width: 200px;
73}
74.textinput_config {
75 font-family: verdana, arial, helvetica;
76 font-size: 13px;
77 background-color: \#EEEEFF;
78 border: 1px solid \#000;
79 width: 400px;
80}
81.textinput_long {
82 font-family: verdana, arial, helvetica;
83 font-size: 13px;
84 background-color: \#EEEEFF;
85 border: 1px solid \#000;
86 width: 500px;
87}
88.selectlist {
89 font-family: verdana, arial, helvetica;
90 font-size: 13px;
91 background-color: \#EEEEFF;
92 border-color: \#000;
93}
94.top_logo {
95 font-family: verdana, arial, helvetica;
96 font-size: 13px;
97 color: \#000;
98 font-weight: bold;
99}
100.login {
101 color: \#000;
102 font-weight: bold;
103}
104.regular_text {
105 color: \#000;
106 font-weight: bold;
107}
108div.front_page {
109 width: 520px;
110 padding-top: 10px;
111 padding-bottom: 10px;
112}
113div.float_left {
114 width: 255px;
115 float: left;
116}
117div.float_right {
118 width: 255px;
119 float: right;
120}
121div.text_right {
122 text-align: right;
123}
124div.text_left {
125 text-align: left;
126}
127.text_red {
128 color: \#f00;
129 font-weight: bold;
130}
131body {
132 background: \#8c8c7b;
133}
134input {
135 font-family: verdana, arial, helvetica;
136 font-size: 13px;
137}
138textarea {
139 font-size: 13px;
140 font-family: verdana, arial, helvetica;
141 background-color: \#eef;
142 border-color: 1px solid \#000;
143}
144.mainmenu {
145 font-family: verdana, arial, helvetica;
146 color: \#000;
147 font-size: 13px;
148}
149table.mainmenu {
150 background: \#fff;
151 border: 1px solid \#000;
152}
153div.main_menu {
154 width: 520px;
155 background: \#fff;
156 text-align: center;
157}
158.menu_small {
159 font-family: verdana, arial, helvetica;
160 color: \#000;
161 font-size: 7pt;
162}
163div.main {
164 text-align: center;
165 vertical-align: middle;
166 width: 100%;
167 height: 100%;
168}
169</style>
170<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
171<!--//
172
173// Copyright (c) 1996-1997 Athenia Associates.
174// http://www.webreference.com/js/
175// License is granted if and only if this entire
176// copyright notice is included. By Tomer Shiran.
177
178function setCookie(name, value, expires, path, domain, secure) {
179var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "");
180document.cookie = curCookie;
181}
182
183function getCookie(name) {
184var prefix = name + "=";
185var nullstring = "";
186var cookieStartIndex = document.cookie.indexOf(prefix);
187if (cookieStartIndex == -1)
188return nullstring;
189var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);
190if (cookieEndIndex == -1)
191cookieEndIndex = document.cookie.length;
192return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex));
193}
194
195function deleteCookie(name, path, domain) {
196if (getCookie(name)) {
197document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"
198};
199}
200
201function fixDate(date) {
202var base = new Date(0);
203var skew = base.getTime();
204if (skew > 0)
205date.setTime(date.getTime() - skew);
206}
207//-->
208</SCRIPT>
209#;
210
211$gmheadtagtwo = $gmheadtag;
212
213$gmheadtag .= qq#
214</HEAD>
215
216<body>#;
217
218$gmheadtagtwo .= qq#
219</HEAD>
220
221<body>#;
222
223$gmframetop = qq(<table border=0 cellpadding=0 cellspacing=0 width=100% height=100%><tr><td valign=middle align=center><table border=0 cellpadding=0 cellspacing=0><tr><td><p align=left>$gmfonttag<font color=#000 size=2><b>greymatter $gmversion</b></font></font></p><table border=0 cellpadding=1 cellspacing=0 bgcolor="#000000"><tr><td><table border=0 cellpadding=10 cellspacing=0 bgcolor="#ffffff"><tr><td valign=\"middle\" align=\"center\">$gmfonttag);
224$gmframetoptwo = qq(<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100% HEIGHT=100%><TR><TD VALIGN=MIDDLE ALIGN=CENTER><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><TABLE BORDER=0 cellpadding=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=10 CELLSPACING=0 BGCOLOR="#FFFFFF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag);
225$gmframebottom = qq(</font></TD></TR></TABLE></TD></TR></TABLE><P ALIGN=RIGHT><FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE=1><A HREF="http://www.greymatterforums.com" CLASS="copynotice" TARGET="_blank">v$gmversion · ©2000-2003 The Greymatter Team</A></font></P></TD></TR></TABLE></TD></TR></TABLE></TD></TR></TABLE>);
226$gmframebottomtwo = qq(</font></TD></TR></TABLE></TD></TR></TABLE></TD></TR></TABLE></TD></TR></TABLE></TD></TR></TABLE>);
227$statusnote = "";
228# ------------------
229# emoticons subroutine
230# ------------------
231# added by flipped cracker 9/17/2003
232# version 1.3
233
234sub gm_emoticons {
235&gm_readconfig;
236$_ = shift;
237if( (($emoticonsallowed eq "both") || ($emoticonsallowed eq $returnto)) && ($thisentryemoticonsallowed eq "yes") ) {
238 s/\:\)/<img src=\"$emoticonspath\/smile.gif\" alt=\"smile\" \/>/g;
239 s/\:O/<img src=\"$emoticonspath\/shocked.gif\" alt=\"shocked\" \/>/g;
240 s/\:\(/<img src=\"$emoticonspath\/sad.gif\" alt="\sad\" \/>/g;
241 s/\:D/<img src=\"$emoticonspath\/biggrin.gif\" alt=\"big grin\" \/>/g;
242 s/\:P/<img src=\"$emoticonspath\/tongue.gif\" alt=\"razz\" \/>/g;
243 s/\;\)/<img src=\"$emoticonspath\/wink.gif\" alt=\"wink\" \/>/g;
244 s/\:angry:/<img src=\"$emoticonspath\/angry.gif\" alt=\"angry, grr\" \/>/g;
245 s/\:blush:/<img src=\"$emoticonspath\/blush.gif\" alt=\"blush\" \/>/g;
246 s/\:confused:/<img src=\"$emoticonspath\/confused.gif\" alt=\"confused\" \/>/g;
247 s/\:cool:/<img src=\"$emoticonspath\/cool.gif\" alt=\"cool eh?\" \/>/g;
248 s/\:crazy:/<img src=\"$emoticonspath\/crazy.gif\" alt=\"crazy\" \/>/g;
249 s/\:cry:/<img src=\"$emoticonspath\/cry.gif\" alt=\"crying\" \/>/g;
250 s/\:doze:/<img src=\"$emoticonspath\/doze.gif\" alt=\"sleepy\" \/>/g;
251 s/\:hehe:/<img src=\"$emoticonspath\/hehe.gif\" alt=\"hehe\" \/>/g;
252 s/\:laugh:/<img src=\"$emoticonspath\/laugh.gif\" alt=\"LOL\" \/>/g;
253 s/\:plain:/<img src=\"$emoticonspath\/plain.gif\" alt=\"plain\" \/>/g;
254 s/\:rolleyes:/<img src=\"$emoticonspath\/rolleyes.gif\" alt=\"rolls eyes\" \/>/g;
255 s/\:satisfied:/<img src=\"$emoticonspath\/satisfied.gif\" alt=\"satisfied\" \/>/g;
256}
257return($_);
258
259}
260# merged in version 1.3
261
262# ------------------
263# emoticons code display subroutine
264# ------------------
265# added by flipped cracker 9/17/2003
266# version 1.3
267
268sub gm_emoticons_code {
269
270&gm_readconfig;
271$emoticonsmaincode = "";
272if( ($emoticonsallowed eq "both") || ($emoticonsallowed eq "entries") ) {
273$emoticonsmaincode = "<td>
274 <table>
275 <tr>
276 <td><img alt=\":)\" onclick=\"commentEmoticonMain(':)')\" src=\"$emoticonspath/smile.gif\" title=\":)\" width=\"19\" height=\"14\" /></td>
277 <td><img alt=\":O\" onclick=\"commentEmoticonMain(':O')\" src=\"$emoticonspath/shocked.gif\" title=\":O\" width=\"19\" height=\"14\" /></td>
278 <td><img alt=\":(\" onclick=\"commentEmoticonMain(':(')\" src=\"$emoticonspath/sad.gif\" title=\":(\" width=\"19\" height=\"14\" /></td>
279 </tr>
280 <tr>
281 <td><img alt=\":D\" onclick=\"commentEmoticonMain(':D')\" src=\"$emoticonspath/biggrin.gif\" title=\":D\" width=\"19\" height=\"14\" /></td>
282 <td><img alt=\":P\" onclick=\"commentEmoticonMain(':P')\" src=\"$emoticonspath/tongue.gif\" title=\":P\" width=\"19\" height=\"14\" /></td>
283 <td><img alt=\";)\" onclick=\"commentEmoticonMain(';)')\" src=\"$emoticonspath/wink.gif\" title=\";)\" width=\"19\" height=\"14\" /></td>
284 </tr>
285 <tr>
286 <td><img alt=\":angry:\" onclick=\"commentEmoticonMain(':angry:')\" src=\"$emoticonspath/angry.gif\" title=\":angry:\" width=\"19\" height=\"14\" /></td>
287 <td><img alt=\":blush:\" onclick=\"commentEmoticonMain(':blush:')\" src=\"$emoticonspath/blush.gif\" title=\":blush:\" width=\"19\" height=\"14\" /></td>
288 <td><img alt=\":confused:\" onclick=\"commentEmoticonMain(':confused:')\" src=\"$emoticonspath/confused.gif\" title=\":confused:\" width=\"19\" height=\"14\" /></td>
289 </tr>
290 <tr>
291 <td><img alt=\":cool:\" onclick=\"commentEmoticonMain(':cool:')\" src=\"$emoticonspath/cool.gif\" title=\":cool:\" width=\"19\" height=\"14\" /></td>
292 <td><img alt=\":crazy:\" onclick=\"commentEmoticonMain(':crazy:')\" src=\"$emoticonspath/crazy.gif\" title=\":crazy:\" width=\"19\" height=\"14\" /></td>
293 <td><img alt=\":cry:\" onclick=\"commentEmoticonMain(':cry:')\" src=\"$emoticonspath/cry.gif\" title=\":cry:\" width=\"19\" height=\"14\" /></td>
294 </tr>
295 <tr>
296 <td><img alt=\":doze:\" onclick=\"commentEmoticonMain(':doze:')\" src=\"$emoticonspath/doze.gif\" title=\":doze:\" width=\"19\" height=\"14\" /></td>
297 <td><img alt=\":hehe:\" onclick=\"commentEmoticonMain(':hehe:')\" src=\"$emoticonspath/hehe.gif\" title=\":hehe:\" width=\"19\" height=\"14\" /></td>
298 <td><img alt=\":laugh:\" onclick=\"commentEmoticonMain(':laugh:')\" src=\"$emoticonspath/laugh.gif\" title=\":laugh:\" width=\"19\" height=\"14\" /></td>
299 </tr>
300 <tr>
301 <td><img alt=\":plain:\" onclick=\"commentEmoticonMain(':plain:')\" src=\"$emoticonspath/plain.gif\" title=\":plain:\" width=\"19\" height=\"14\" /></td>
302 <td><img alt=\":rolleyes:\" onclick=\"commentEmoticonMain(':rolleyes:')\" src=\"$emoticonspath/rolleyes.gif\" title=\":rollseyes:\" width=\"19\" height=\"14\" /></td>
303 <td><img alt=\":satisfied:\" onclick=\"commentEmoticonMain(':satisfied:')\" src=\"$emoticonspath/satisfied.gif\" title=\":satisfied:\" width=\"19\" height=\"14\" /></td>
304 </tr>
305 </table>
306 </td>";
307
308$emoticonsmorecode = "<td>
309 <table>
310 <tr>
311 <td><img alt=\":)\" onclick=\"commentEmoticonMore(':)')\" src=\"$emoticonspath/smile.gif\" title=\"s:)\" width=\"19\" height=\"14\" /></td>
312 <td><img alt=\":O\" onclick=\"commentEmoticonMore(':O')\" src=\"$emoticonspath/shocked.gif\" title=\":O\" width=\"19\" height=\"14\" /></td>
313 <td><img alt=\":(\" onclick=\"commentEmoticonMore(':(')\" src=\"$emoticonspath/sad.gif\" title=\":(\" width=\"19\" height=\"14\" /></td>
314 </tr>
315 <tr>
316 <td><img alt=\":D\" onclick=\"commentEmoticonMore(':D')\" src=\"$emoticonspath/biggrin.gif\" title=\":D\" width=\"19\" height=\"14\" /></td>
317 <td><img alt=\":P\" onclick=\"commentEmoticonMore(':P')\" src=\"$emoticonspath/tongue.gif\" title=\":P\" width=\"19\" height=\"14\" /></td>
318 <td><img alt=\";)\" onclick=\"commentEmoticonMore(';)')\" src=\"$emoticonspath/wink.gif\" title=\";)\" width=\"19\" height=\"14\" /></td>
319 </tr>
320 <tr>
321 <td><img alt=\":angry:\" onclick=\"commentEmoticonMore(':angry:')\" src=\"$emoticonspath/angry.gif\" title=\":angry:\" width=\"19\" height=\"14\" /></td>
322 <td><img alt=\":blush:\" onclick=\"commentEmoticonMore(':blush:')\" src=\"$emoticonspath/blush.gif\" title=\":blush:\" width=\"19\" height=\"14\" /></td>
323 <td><img alt=\":confused:\" onclick=\"commentEmoticonMore(':confused:')\" src=\"$emoticonspath/confused.gif\" title=\":confused:\" width=\"19\" height=\"14\" /></td>
324 </tr>
325 <tr>
326 <td><img alt=\":cool:\" onclick=\"commentEmoticonMore(':cool:')\" src=\"$emoticonspath/cool.gif\" title=\":cool:\" width=\"19\" height=\"14\" /></td>
327 <td><img alt=\":crazy:\" onclick=\"commentEmoticonMore(':crazy:')\" src=\"$emoticonspath/crazy.gif\" title=\":crazy:\" width=\"19\" height=\"14\" /></td>
328 <td><img alt=\":cry:\" onclick=\"commentEmoticonMore(':cry:')\" src=\"$emoticonspath/cry.gif\" title=\":cry:\" width=\"19\" height=\"14\" /></td>
329 </tr>
330 <tr>
331 <td><img alt=\":doze:\" onclick=\"commentEmoticonMore(':doze:')\" src=\"$emoticonspath/doze.gif\" title=\":doze:\" width=\"19\" height=\"14\" /></td>
332 <td><img alt=\":hehe:\" onclick=\"commentEmoticonMore(':hehe:')\" src=\"$emoticonspath/hehe.gif\" title=\":hehe:\" width=\"19\" height=\"14\" /></td>
333 <td><img alt=\":laugh:\" onclick=\"commentEmoticonMore(':laugh:')\" src=\"$emoticonspath/laugh.gif\" title=\":laugh:\" width=\"19\" height=\"14\" /></td>
334 </tr>
335 <tr>
336 <td><img alt=\":plain:\" onclick=\"commentEmoticonMore(':plain:')\" src=\"$emoticonspath/plain.gif\" title=\":plain:\" width=\"19\" height=\"14\" /></td>
337 <td><img alt=\":rolleyes:\" onclick=\"commentEmoticonMore(':rolleyes:')\" src=\"$emoticonspath/rolleyes.gif\" title=\":rollseyes:\" width=\"19\" height=\"14\" /></td>
338 <td><img alt=\":satisfied:\" onclick=\"commentEmoticonMore(':satisfied:')\" src=\"$emoticonspath/satisfied.gif\" title=\"satisfied:\" width=\"19\" height=\"14\" /></td>
339 </tr>
340 </table>
341 </td>";
342 }
343}
344# merged in version 1.3
345
346# ---------------
347# date subroutine
348# ---------------
349
350sub date {
351
352$adjustTime = time() + ($serveroffset * 3600);
353
354($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime($adjustTime);
355
356$mon++;
357
358@months = ("null", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
359@weekdays = ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
360
361$fullmonth = $months[$mon];
362$fullweekday = $weekdays[$wday];
363
364$JSYear = $year + 1900;
365$shortyear = substr($JSYear, -2, 2);
366
367$mintwo = sprintf ("%2d", $min);
368$mintwo =~ tr/ /0/;
369$sectwo = sprintf ("%2d", $sec);
370$sectwo =~ tr/ /0/;
371
372$militaryhour = $hour;
373
374if ($hour < 12) {
375 $AMPM = "AM";
376 $AMPMDOT = "A.M.";
377}
378
379if ($hour > 12) {
380 $hour = $hour - 12;
381 $AMPM = "PM";
382 $AMPMDOT = "P.M.";
383 $militaryhour = $militaryhour + 12;
384}
385
386if ($hour == 12) {
387 $AMPM = "PM";
388 $AMPMDOT = "P.M.";
389}
390
391if ($hour == 0) {
392 $hour = "12";
393}
394
395$hourtwo = sprintf ("%2d", $hour);
396$hourtwo =~ tr/ /0/;
397$mintwo = sprintf ("%2d", $min);
398$mintwo =~ tr/ /0/;
399$montwo = sprintf ("%2d", $mon);
400$montwo =~ tr/ /0/;
401$mdaytwo = sprintf ("%2d", $mday);
402$mdaytwo =~ tr/ /0/;
403
404if (($hour eq "12") && ($AMPM eq "AM")) { $militaryhour = "0"; }
405
406$militaryhourtwo = sprintf ("%2d", $hour);
407$militaryhourtwo =~ tr/ /0/;
408
409$basedate = "$montwo\/$mdaytwo\/$shortyear $hourtwo\:$mintwo $AMPM";
410
411}
412
413# -------------------------
414# delouse for textarea edit
415# -------------------------
416
417sub delouse {
418$_ = shift;
419$_ =~ s/\|\*\|/\n/g;
420$_ =~ s/&([A-Za-z0-9\#]+);/\|AMP\|$1;/g;
421$_ =~ s/</\</g;
422$_ =~ s/>/\>/g;
423$_ =~ s/"/\"/g;
424return($_);
425}
426
427# ---------------------------
428# relouse after textarea edit
429# ---------------------------
430
431sub relouse {
432$_ = shift;
433$_ =~ s/\n/\|\*\|/g;
434$_ =~ s/\r//g;
435$_ =~ s/\</</g;
436$_ =~ s/\>/>/g;
437$_ =~ s/\"/"/g;
438$_ =~ s/\|AMP\|([A-Za-z0-9\#]+);/&$1;/g;
439return($_);
440}
441
442# ---------------------
443# configuration delouse
444# ---------------------
445
446sub configdelouse {
447$_ = shift;
448$_ =~ s/\|//g;
449$_ =~ s/\n//g;
450$_ =~ s/\r//g;
451$_ =~ s/^\s+//;
452$_ =~ s/\s+$//;
453return($_);
454}
455
456# ----------------
457# read the counter
458# ----------------
459
460sub gm_readcounter {
461
462open (FUNNYFEETKRACK, "./gm-counter.cgi") || &gm_dangermouse("Can't read the counter file. Please make sure that gm-counter.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.");
463@entrycounters = <FUNNYFEETKRACK>;
464close (FUNNYFEETKRACK);
465
466$newentrynumber = $entrycounters[0];
467$newarchivenumber = $entrycounters[1];
468$newstayattopnumber = $entrycounters[2];
469$newalltimepktotalnumber = $entrycounters[3];
470$newalltimenktotalnumber = $entrycounters[4];
471$newalltimecommentstotalnumber = $entrycounters[5];
472$newalltimeopenentriesnumber = $entrycounters[6];
473$newalltimeclosedentriesnumber = $entrycounters[7];
474
475chomp ($newentrynumber);
476chomp ($newarchivenumber);
477chomp ($newstayattopnumber);
478chomp ($newalltimepktotalnumber);
479chomp ($newalltimenktotalnumber);
480chomp ($newalltimecommentstotalnumber);
481chomp ($newalltimeopenentriesnumber);
482chomp ($newalltimeclosedentriesnumber);
483
484if ($newentrynumber eq "") { $newentrynumber = 0; }
485if ($newarchivenumber eq "") { $newarchivenumber = 0; }
486if ($newstayattopnumber eq "") { $newstayattopnumber = 0; }
487if ($newalltimepktotalnumber eq "") { $newalltimepktotalnumber = 0; }
488if ($newalltimenktotalnumber eq "") { $newalltimenktotalnumber = 0; }
489if ($newalltimeopenentriesnumber eq "") { $newalltimeopenentriesnumber = 0; }
490if ($newalltimeclosedentriesnumber eq "") { $newalltimeclosedentriesnumber = 0; }
491
492}
493
494# -----------------
495# write the counter
496# -----------------
497
498sub gm_writecounter {
499
500if ($newentrynumber eq "") { $newentrynumber = 0; }
501if ($newarchivenumber eq "") { $newarchivenumber = 0; }
502if ($newstayattopnumber eq "") { $newstayattopnumber = 0; }
503if ($newalltimepktotalnumber eq "") { $newalltimepktotalnumber = 0; }
504if ($newalltimenktotalnumber eq "") { $newalltimenktotalnumber = 0; }
505if ($newalltimeopenentriesnumber eq "") { $newalltimeopenentriesnumber = 0; }
506if ($newalltimeclosedentriesnumber eq "") { $newalltimeclosedentriesnumber = 0; }
507
508open (FUNNYFEETAUGH, ">./gm-counter.cgi") || &gm_dangermouse("Can't write to the counter file. Please make sure that gm-counter.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.");
509print FUNNYFEETAUGH "$newentrynumber\n";
510print FUNNYFEETAUGH "$newarchivenumber\n";
511print FUNNYFEETAUGH "$newstayattopnumber\n";
512print FUNNYFEETAUGH "$newalltimepktotalnumber\n";
513print FUNNYFEETAUGH "$newalltimenktotalnumber\n";
514print FUNNYFEETAUGH "$newalltimecommentstotalnumber\n";
515print FUNNYFEETAUGH "$newalltimeopenentriesnumber\n";
516print FUNNYFEETAUGH "$newalltimeclosedentriesnumber\n";
517close (FUNNYFEETAUGH);
518
519}
520
521# ------------------
522# read the templates
523# ------------------
524
525sub gm_readtemplates {
526
527open (FUNNYFEETTAMMY, "./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; also try running Diagnostics & Repair from the Configuration screen.");
528@gmtemplates = <FUNNYFEETTAMMY>;
529close (FUNNYFEETTAMMY);
530
531$gmcounter = 0;
532
533foreach (@gmtemplates) {
534 chomp ($gmtemplates[$gmcounter]);
535 $gmtemplates[$gmcounter] =~ s/\|\*\|/\n/g;
536 $gmcounter++;
537}
538
539$gmindextemplate = $gmtemplates[0];
540$gmentrypagetemplate = $gmtemplates[1];
541$gmarchiveindextemplate = $gmtemplates[2];
542$gmarchiveentrypagetemplate = $gmtemplates[3];
543$gmentrytemplate = $gmtemplates[4];
544$gmarchiveentrytemplate = $gmtemplates[5];
545$gmstayattoptemplate = $gmtemplates[6];
546$gmdatetemplate = $gmtemplates[7];
547$gmcommentstemplate = $gmtemplates[8];
548$gmcommentsformtemplate = $gmtemplates[9];
549$gmparaseparationtemplate = $gmtemplates[10];
550$gmkarmaformtemplate = $gmtemplates[11];
551# new templates {{target}} and dategrouping footer take the place of the long-deprecated ones: linear 9/18/2003
552# new in 1.3
553$gmlinktargettemplate = $gmtemplates[12];
554$gmdategroupingfootertemplate = $gmtemplates[13];
555# merged 9/18/2003
556$gmkarmalinktemplate = $gmtemplates[14];
557$gmcommentslinktemplate = $gmtemplates[15];
558$gmcommentauthoremailtemplate = $gmtemplates[16];
559$gmcommentauthorhomepagetemplate = $gmtemplates[17];
560$gmcommentdividertemplate = $gmtemplates[18];
561$gmmoreentrytemplate = $gmtemplates[19];
562$gmmoreentrypagetemplate = $gmtemplates[20];
563$gmmorearchiveentrypagetemplate = $gmtemplates[21];
564$gmpreviouslinktemplate = $gmtemplates[22];
565$gmnextlinktemplate = $gmtemplates[23];
566$gmpreviousmorelinktemplate = $gmtemplates[24];
567$gmnextmorelinktemplate = $gmtemplates[25];
568$gmarchivemasterindextemplate = $gmtemplates[26];
569$gmlogarchiveslinktemplate = $gmtemplates[27];
570$gmentrypagelinktemplate = $gmtemplates[28];
571$gmmoreentrypagelinktemplate = $gmtemplates[29];
572$gmlogarchiveslinkseparatortemplate = $gmtemplates[30];
573$gmentrypagelinkseparatortemplate = $gmtemplates[31];
574$gmentrypagelinkmonthseparatortemplate = $gmtemplates[32];
575$gmentrypagelinkdayseparatortemplate = $gmtemplates[33];
576$gmentrypagelinkyearseparatortemplate = $gmtemplates[34];
577$gmheadertemplate = $gmtemplates[35];
578$gmfootertemplate = $gmtemplates[36];
579$gmsidebartemplate = $gmtemplates[37];
580$gmcustomlinktemplate = $gmtemplates[38];
581$gmentryseparatortemplate = $gmtemplates[39];
582$gmarchiveentryseparatortemplate = $gmtemplates[40];
583$gmmorearchiveentrytemplate = $gmtemplates[41];
584$gmdatearchivetemplate = $gmtemplates[42];
585$gmlogarchiveslinkweeklytemplate = $gmtemplates[43];
586$gmcustomonetemplate = $gmtemplates[44];
587$gmcustomtwotemplate = $gmtemplates[45];
588$gmcustomthreetemplate = $gmtemplates[46];
589$gmcustomfourtemplate = $gmtemplates[47];
590$gmcustomfivetemplate = $gmtemplates[48];
591$gmcustomsixtemplate = $gmtemplates[49];
592$gmcustomseventemplate = $gmtemplates[50];
593$gmcustomeighttemplate = $gmtemplates[51];
594$gmcustomninetemplate = $gmtemplates[52];
595$gmcustomtentemplate = $gmtemplates[53];
596$gmpopuppagetemplate = $gmtemplates[54];
597$gmpopupcodetemplate = $gmtemplates[55];
598$gmsearchformtemplate = $gmtemplates[56];
599$gmsearchresultspagetemplate = $gmtemplates[57];
600$gmsearchresultsentrytemplate = $gmtemplates[58];
601$gmcalendartablebeginningtemplate = $gmtemplates[59];
602$gmcalendartableendingtemplate = $gmtemplates[60];
603$gmcalendarblankcelltemplate = $gmtemplates[61];
604$gmcalendarfullcelltemplate = $gmtemplates[62];
605$gmcalendarfullcelllinktemplate = $gmtemplates[63];
606$gmcalendarweekblankdaytemplate = $gmtemplates[64];
607$gmcalendarweekfulldaytemplate = $gmtemplates[65];
608$gmcalendarweekfulldaylinktemplate = $gmtemplates[66];
609$gmcommentpreviewdividertemplate = $gmtemplates[67];
610$gmcommentpreviewformtemplate = $gmtemplates[68];
611$gmsmartlinknocommentstemplate = $gmtemplates[69];
612$gmsmartlinkonecommenttemplate = $gmtemplates[70];
613$gmsmartlinkmanycommentstemplate = $gmtemplates[71];
614$gmlinebreaktemplate = $gmtemplates[72];
615$gmcommentlinktargettemplate = $gmtemplates[73];
616$gmsmartentrymoodtemplate = $gmtemplates[74];
617$gmsmartentrymusictemplate = $gmtemplates[75];
618$gmdategroupingfooterarchivetemplate = $gmtemplates[76];
619$gmsmartemoticonscodetemplate = $gmtemplates[77];
620$gmcookiescodetemplate = $gmtemplates[78];
621}
622
623# ---------------------
624# delouse all templates
625# ---------------------
626
627sub gm_delousealltemplates {
628
629$gmindextemplate = &delouse($gmindextemplate);
630$gmentrypagetemplate = &delouse($gmentrypagetemplate);
631$gmarchiveindextemplate = &delouse($gmarchiveindextemplate);
632$gmarchiveentrypagetemplate = &delouse($gmarchiveentrypagetemplate);
633$gmentrytemplate = &delouse($gmentrytemplate);
634$gmarchiveentrytemplate = &delouse($gmarchiveentrytemplate);
635$gmstayattoptemplate = &delouse($gmstayattoptemplate);
636$gmdatetemplate = &delouse($gmdatetemplate);
637$gmcommentstemplate = &delouse($gmcommentstemplate);
638$gmcommentsformtemplate = &delouse($gmcommentsformtemplate);
639$gmparaseparationtemplate = &delouse($gmparaseparationtemplate);
640$gmkarmaformtemplate = &delouse($gmkarmaformtemplate);
641# new templates {{target}} and dategrouping footer take the place of the long-deprecated ones: linear 9/18/2003
642# new in 1.3
643$gmlinktargettemplate = &delouse($gmlinktargettemplate);
644$gmdategroupingfootertemplate = &delouse($gmdategroupingfootertemplate);
645# merged 9/18/2003
646$gmkarmalinktemplate = &delouse($gmkarmalinktemplate);
647$gmcommentslinktemplate = &delouse($gmcommentslinktemplate);
648$gmcommentauthoremailtemplate = &delouse($gmcommentauthoremailtemplate);
649$gmcommentauthorhomepagetemplate = &delouse($gmcommentauthorhomepagetemplate);
650$gmcommentdividertemplate = &delouse($gmcommentdividertemplate);
651$gmmoreentrytemplate = &delouse($gmmoreentrytemplate);
652$gmmoreentrypagetemplate = &delouse($gmmoreentrypagetemplate);
653$gmmorearchiveentrypagetemplate = &delouse($gmmorearchiveentrypagetemplate);
654$gmpreviouslinktemplate = &delouse($gmpreviouslinktemplate);
655$gmnextlinktemplate = &delouse($gmnextlinktemplate);
656$gmpreviousmorelinktemplate = &delouse($gmpreviousmorelinktemplate);
657$gmnextmorelinktemplate = &delouse($gmnextmorelinktemplate);
658$gmarchivemasterindextemplate = &delouse($gmarchivemasterindextemplate);
659$gmlogarchiveslinktemplate = &delouse($gmlogarchiveslinktemplate);
660$gmentrypagelinktemplate = &delouse($gmentrypagelinktemplate);
661$gmmoreentrypagelinktemplate = &delouse($gmmoreentrypagelinktemplate);
662$gmlogarchiveslinkseparatortemplate = &delouse($gmlogarchiveslinkseparatortemplate);
663$gmentrypagelinkseparatortemplate = &delouse($gmentrypagelinkseparatortemplate);
664$gmentrypagelinkmonthseparatortemplate = &delouse($gmentrypagelinkmonthseparatortemplate);
665$gmentrypagelinkdayseparatortemplate = &delouse($gmentrypagelinkdayseparatortemplate);
666$gmentrypagelinkyearseparatortemplate = &delouse($gmentrypagelinkyearseparatortemplate);
667$gmheadertemplate = &delouse($gmheadertemplate);
668$gmfootertemplate = &delouse($gmfootertemplate);
669$gmsidebartemplate = &delouse($gmsidebartemplate);
670$gmcustomlinktemplate = "";
671$gmentryseparatortemplate = &delouse($gmentryseparatortemplate);
672$gmarchiveentryseparatortemplate = &delouse($gmarchiveentryseparatortemplate);
673$gmmorearchiveentrytemplate = &delouse($gmmorearchiveentrytemplate);
674$gmdatearchivetemplate = &delouse($gmdatearchivetemplate);
675$gmlogarchiveslinkweeklytemplate = &delouse($gmlogarchiveslinkweeklytemplate);
676$gmcustomonetemplate = &delouse($gmcustomonetemplate);
677$gmcustomtwotemplate = &delouse($gmcustomtwotemplate);
678$gmcustomthreetemplate = &delouse($gmcustomthreetemplate);
679$gmcustomfourtemplate = &delouse($gmcustomfourtemplate);
680$gmcustomfivetemplate = &delouse($gmcustomfivetemplate);
681$gmcustomsixtemplate = &delouse($gmcustomsixtemplate);
682$gmcustomseventemplate = &delouse($gmcustomseventemplate);
683$gmcustomeighttemplate = &delouse($gmcustomeighttemplate);
684$gmcustomninetemplate = &delouse($gmcustomninetemplate);
685$gmcustomtentemplate = &delouse($gmcustomtentemplate);
686$gmpopuppagetemplate = &delouse($gmpopuppagetemplate);
687$gmpopupcodetemplate = &delouse($gmpopupcodetemplate);
688$gmsearchformtemplate = &delouse($gmsearchformtemplate);
689$gmsearchresultspagetemplate = &delouse($gmsearchresultspagetemplate);
690$gmsearchresultsentrytemplate = &delouse($gmsearchresultsentrytemplate);
691$gmcalendartablebeginningtemplate = &delouse($gmcalendartablebeginningtemplate);
692$gmcalendartableendingtemplate = &delouse($gmcalendartableendingtemplate);
693$gmcalendarblankcelltemplate = &delouse($gmcalendarblankcelltemplate);
694$gmcalendarfullcelltemplate = &delouse($gmcalendarfullcelltemplate);
695$gmcalendarfullcelllinktemplate = &delouse($gmcalendarfullcelllinktemplate);
696$gmcalendarweekblankdaytemplate = "";
697$gmcalendarweekfulldaytemplate = &delouse($gmcalendarweekfulldaytemplate);
698$gmcalendarweekfulldaylinktemplate = &delouse($gmcalendarweekfulldaylinktemplate);
699$gmcommentpreviewdividertemplate = &delouse($gmcommentpreviewdividertemplate);
700$gmcommentpreviewformtemplate = &delouse($gmcommentpreviewformtemplate);
701$gmsmartlinknocommentstemplate = &delouse($gmsmartlinknocommentstemplate);
702$gmsmartlinkonecommenttemplate = &delouse($gmsmartlinkonecommenttemplate);
703$gmsmartlinkmanycommentstemplate = &delouse($gmsmartlinkmanycommentstemplate);
704$gmlinebreaktemplate = &delouse($gmlinebreaktemplate);
705$gmcommentlinktargettemplate = &delouse($gmcommentlinktargettemplate);
706$gmsmartentrymoodtemplate = &delouse($gmsmartentrymoodtemplate);
707$gmsmartentrymusictemplate = &delouse($gmsmartentrymusictemplate);
708$gmdategroupingfooterarchivetemplate = &delouse($gmdategroupingfooterarchivetemplate);
709$gmsmartemoticonscodetemplate = &delouse($gmsmartemoticonscodetemplate);
710$gmcookiescodetemplate = &delouse($gmcookiescodetemplate);
711}
712
713# --------------------
714# read the config file
715# --------------------
716
717sub gm_readconfig {
718
719open (FUNNYFEETCOCO, "./gm-config.cgi") || &gm_dangermouse("Can't read 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.");
720@gmconfig = <FUNNYFEETCOCO>;
721close (FUNNYFEETCOCO);
722
723$gmcounter = 0;
724
725foreach (@gmconfig) {
726 chomp ($gmconfig[$gmcounter]);
727 $gmcounter++;
728}
729
730$LogPath = $gmconfig[0];
731$EntriesPath = $gmconfig[1];
732$LogWebPath = $gmconfig[2];
733$EntriesWebPath = $gmconfig[3];
734$NotifyEmail = $gmconfig[4];
735$indexfilename = $gmconfig[5];
736$entrysuffix = $gmconfig[6];
737$indexdays = $gmconfig[7];
738$serveroffset = $gmconfig[8];
739$timezone = $gmconfig[9];
740$keeplog = $gmconfig[10];
741$posttoarchives = $gmconfig[11];
742$allowkarmadefault = $gmconfig[12];
743$allowcommentsdefault = $gmconfig[13];
744$commentsorder = $gmconfig[14];
745$generateentrypages = $gmconfig[15];
746$allowhtmlincomments = $gmconfig[16];
747$logkarmaandcomments = $gmconfig[17];
748$mailprog = $gmconfig[18];
749$NotifyForStatus = $gmconfig[19];
750$autolinkurls = $gmconfig[20];
751$striplinesfromcomments = $gmconfig[21];
752$allowmultiplekarmavotes = $gmconfig[22];
753$versionsetup = $gmconfig[23];
754$cgilocalpath = $gmconfig[24];
755$cgiwebpath = $gmconfig[25];
756$concurrentmainandarchives = $gmconfig[26];
757$keeparchivemasterindex = $gmconfig[27];
758$entrylistsortorder = $gmconfig[28];
759$allowkarmaorcomments = $gmconfig[29];
760$entrylistcountnumber = $gmconfig[30];
761$cookiesallowed = $gmconfig[31];
762$logarchivesuffix = $gmconfig[32];
763$censorlist = $gmconfig[33];
764$censorenabled = $gmconfig[34];
765$keepmonthlyarchives = $gmconfig[35];
766$defaultentrylistview = $gmconfig[36];
767$linktocalendarentries = $gmconfig[37];
768$automaticrebuilddefault = $gmconfig[38];
769$commententrylistonlyifokay = $gmconfig[39];
770$otherfilelist = $gmconfig[40];
771$otherfilelistentryrebuild = $gmconfig[41];
772$archiveformat = $gmconfig[42];
773$inlineformatting = $gmconfig[43];
774$uploadfilesallowed = $gmconfig[44];
775$uploadfilesizelimit = $gmconfig[45];
776$emoticonspath = $gmconfig[46];
777$keepphphacklog = $gmconfig[47];
778$mailhacknotice = $gmconfig[48];
779$emoticonsallowed = $gmconfig[49];
780}
781
782# ---------------------
783# write the config file
784# ---------------------
785
786sub gm_writeconfig {
787
788if ($versionsetup eq "") { $versionsetup = $gmversion; }
789
790open (FUNNYFEETCONNIE, ">./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.");
791print FUNNYFEETCONNIE "$LogPath\n";
792print FUNNYFEETCONNIE "$EntriesPath\n";
793print FUNNYFEETCONNIE "$LogWebPath\n";
794print FUNNYFEETCONNIE "$EntriesWebPath\n";
795print FUNNYFEETCONNIE "$NotifyEmail\n";
796print FUNNYFEETCONNIE "$indexfilename\n";
797print FUNNYFEETCONNIE "$entrysuffix\n";
798print FUNNYFEETCONNIE "$indexdays\n";
799print FUNNYFEETCONNIE "$serveroffset\n";
800print FUNNYFEETCONNIE "$timezone\n";
801print FUNNYFEETCONNIE "$keeplog\n";
802print FUNNYFEETCONNIE "$posttoarchives\n";
803print FUNNYFEETCONNIE "$allowkarmadefault\n";
804print FUNNYFEETCONNIE "$allowcommentsdefault\n";
805print FUNNYFEETCONNIE "$commentsorder\n";
806print FUNNYFEETCONNIE "$generateentrypages\n";
807print FUNNYFEETCONNIE "$allowhtmlincomments\n";
808print FUNNYFEETCONNIE "$logkarmaandcomments\n";
809print FUNNYFEETCONNIE "$mailprog\n";
810print FUNNYFEETCONNIE "$NotifyForStatus\n";
811print FUNNYFEETCONNIE "$autolinkurls\n";
812print FUNNYFEETCONNIE "$striplinesfromcomments\n";
813print FUNNYFEETCONNIE "$allowmultiplekarmavotes\n";
814print FUNNYFEETCONNIE "$versionsetup\n";
815print FUNNYFEETCONNIE "$cgilocalpath\n";
816print FUNNYFEETCONNIE "$cgiwebpath\n";
817print FUNNYFEETCONNIE "$concurrentmainandarchives\n";
818print FUNNYFEETCONNIE "$keeparchivemasterindex\n";
819print FUNNYFEETCONNIE "$entrylistsortorder\n";
820print FUNNYFEETCONNIE "$allowkarmaorcomments\n";
821print FUNNYFEETCONNIE "$entrylistcountnumber\n";
822print FUNNYFEETCONNIE "$cookiesallowed\n";
823print FUNNYFEETCONNIE "$logarchivesuffix\n";
824print FUNNYFEETCONNIE "$censorlist\n";
825print FUNNYFEETCONNIE "$censorenabled\n";
826print FUNNYFEETCONNIE "$keepmonthlyarchives\n";
827print FUNNYFEETCONNIE "$defaultentrylistview\n";
828print FUNNYFEETCONNIE "$linktocalendarentries\n";
829print FUNNYFEETCONNIE "$automaticrebuilddefault\n";
830print FUNNYFEETCONNIE "$commententrylistonlyifokay\n";
831print FUNNYFEETCONNIE "$otherfilelist\n";
832print FUNNYFEETCONNIE "$otherfilelistentryrebuild\n";
833print FUNNYFEETCONNIE "$archiveformat\n";
834print FUNNYFEETCONNIE "$inlineformatting\n";
835print FUNNYFEETCONNIE "$uploadfilesallowed\n";
836print FUNNYFEETCONNIE "$uploadfilesizelimit\n";
837print FUNNYFEETCONNIE "$emoticonspath\n";
838print FUNNYFEETCONNIE "$keepphphacklog\n";
839print FUNNYFEETCONNIE "$mailhacknotice\n";
840print FUNNYFEETCONNIE "$emoticonsallowed\n";
841close (FUNNYFEETCONNIE);
842
843}
844
845# ---------------------------------
846# gather ye all thy entry variables
847# ---------------------------------
848
849sub gm_getentryvariables {
850
851my $thisentrygetmynumber = shift;
852
853&gm_readconfig;
854&gm_readtemplates;
855&gm_readcounter;
856
857$thisentrynumberpadded = sprintf ("%8d", $thisentrygetmynumber);
858$thisentrynumberpadded =~ tr/ /0/;
859
860open (FUNNYFEETENTRY, "$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, or try running Diagnostics & Repair in the Configuration screen.");
861@entrylines = <FUNNYFEETENTRY>;
862close (FUNNYFEETENTRY);
863
864$gmcounter = 0;
865
866foreach (@entrylines) {
867 chomp ($entrylines[$gmcounter]);
868 $entrylines[$gmcounter] =~ s/\|\*\|/\n/g;
869 $gmcounter++;
870}
871
872($thisentrynumber, $thisentryauthor, $thisentrysubject, $thisentryweekdaynumber, $thisentrymonth, $thisentryday, $thisentryyearyear, $thisentryhour, $thisentryminute, $thisentrysecond, $thisentryampm, $thisentrypositivekarma, $thisentrynegativekarma, $thisentrycommentsnumber, $thisentryallowkarma, $thisentryallowcomments, $thisentryopenstatus, $thisentrymusic, $thisentrymood, $thisentryemoticonsallowed) = split (/\|/, $entrylines[0]);
873
874chomp ($thisentryemoticonsallowed);
875
876$thisentryisanarchive = "no";
877if ($thisentrynumber <= $newarchivenumber) { $thisentryisanarchive = "yes"; }
878
879if ($generateentrypages eq "no") { $thisentryallowcomments = "no"; }
880
881$thisentryyear = substr($thisentryyearyear, -2, 2);
882
883@months = ("null", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
884@weekdays = ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
885
886$thisentryweekday = $weekdays[$thisentryweekdaynumber];
887$thisentrymonthword = $months[$thisentrymonth];
888$thisentryweekdayshort = substr($thisentryweekday, 0, 3);
889$thisentrymonthwordshort = substr($thisentrymonthword, 0, 3);
890$thisentryweekdayupper = uc($thisentryweekday);
891$thisentrymonthwordupper = uc($thisentrymonthword);
892$thisentryweekdaylower = lc($thisentryweekday);
893$thisentrymonthwordlower = lc($thisentrymonthword);
894$thisentryweekdayuppershort = uc($thisentryweekdayshort);
895$thisentrymonthworduppershort = uc($thisentrymonthwordshort);
896$thisentryweekdaylowershort = lc($thisentryweekdayshort);
897$thisentrymonthwordlowershort = lc($thisentrymonthwordshort);
898
899$thisentrymonthmonth = sprintf ("%2d", $thisentrymonth);
900$thisentrydayday = sprintf ("%2d", $thisentryday);
901$thisentryhourhour = sprintf ("%2d", $thisentryhour);
902$thisentryminuteminute = sprintf ("%2d", $thisentryminute);
903$thisentrysecondsecond = sprintf ("%2d", $thisentrysecond);
904$thisentrymonthmonth =~ tr/ /0/;
905$thisentrydayday =~ tr/ /0/;
906$thisentryhourhour =~ tr/ /0/;
907$thisentryminuteminute =~ tr/ /0/;
908$thisentrysecondsecond =~ tr/ /0/;
909
910$thisentryampmdot = "A.M.";
911$thisentrymilitaryhour = $thisentryhour;
912if ($thisentryampm eq "PM") {
913 $thisentryampmdot = "P.M.";
914 if ($thisentryhour ne "12") { $thisentrymilitaryhour = $thisentryhour + 12; }
915}
916
917$thisentrymilitaryhour = sprintf ("%2d", $thisentrymilitaryhour);
918$thisentrymilitaryhour =~ tr/ /0/;
919$thisentryampmlower = lc($thisentryampm);
920$thisentryampmdotlower = lc($thisentryampmdot);
921
922if (($thisentryhour eq "12") && ($thisentryampm eq "AM")) {
923 $thisentrymilitaryhour = "00";
924}
925
926$leapyearcheck = $thisentryyearyear % 4;
927
928$thisentrymaxdaysinthismonth = 31;
929if (($thisentrymonthword eq "September") || ($thisentrymonthword eq "April") || ($thisentrymonthword eq "June") || ($thisentrymonthword eq "November")) { $thisentrymaxdaysinthismonth = 30; }
930if ($thisentrymonthword eq "February") {
931 $thisentrymaxdaysinthismonth = 28;
932 if ($leapyearcheck eq "0") { $thisentrymaxdaysinthismonth = 29; }
933}
934$thisentrymaxdaysinpreviousmonth = 31;
935if (($thisentrymonthword eq "October") || ($thisentrymonthword eq "May") || ($thisentrymonthword eq "July") || ($thisentrymonthword eq "December")) { $thisentrymaxdaysinpreviousmonth = 30; }
936if ($thisentrymonthword eq "March") {
937 $thisentrymaxdaysinpreviousmonth = 28;
938 if ($leapyearcheck eq "0") { $thisentrymaxdaysinpreviousmonth = 29; }
939}
940
941$thisentryweekbeginningmonth = $thisentrymonth;
942$thisentryweekbeginningyearyear = $thisentryyearyear;
943$thisentryweekendingmonth = $thisentrymonth;
944$thisentryweekendingyearyear = $thisentryyearyear;
945
946$thisentryweekbeginningday = $thisentryday - $thisentryweekdaynumber;
947$thisentryweekendingday = $thisentryweekbeginningday + 6;
948
949if ($thisentryweekbeginningday < 1) {
950 $thisentryweekbeginningday = $thisentryweekbeginningday + $thisentrymaxdaysinpreviousmonth;
951 if ($thisentryweekbeginningday > $thisentryday) { $thisentryweekbeginningmonth--; }
952 if ($thisentryweekbeginningmonth < 1) {
953 $thisentryweekbeginningmonth = 12;
954 $thisentryweekbeginningyearyear--;
955 }
956}
957
958if ($thisentryweekendingday > $thisentrymaxdaysinthismonth) {
959 $thisentryweekendingday = $thisentryweekendingday - $thisentrymaxdaysinthismonth;
960 if ($thisentryweekendingday < $thisentryday) { $thisentryweekendingmonth++; }
961 if ($thisentryweekendingmonth > 12) {
962 $thisentryweekendingmonth = 1;
963 $thisentryweekendingyearyear++;
964 }
965}
966
967$thisentryweekbeginningyear = substr($thisentryweekbeginningyearyear, -2, 2);
968$thisentryweekendingyear = substr($thisentryweekendingyearyear, -2, 2);
969
970$thisentryweekbeginningdayday = sprintf ("%2d", $thisentryweekbeginningday);
971$thisentryweekbeginningdayday =~ tr/ /0/;
972$thisentryweekendingdayday = sprintf ("%2d", $thisentryweekendingday);
973$thisentryweekendingdayday =~ tr/ /0/;
974$thisentryweekbeginningmonthmonth = sprintf ("%2d", $thisentryweekbeginningmonth);
975$thisentryweekbeginningmonthmonth =~ tr/ /0/;
976$thisentryweekendingmonthmonth = sprintf ("%2d", $thisentryweekendingmonth);
977$thisentryweekendingmonthmonth =~ tr/ /0/;
978
979$thisentryweekbeginningweekday = "Sunday";
980$thisentryweekbeginningmonthword = $months[$thisentryweekbeginningmonth];
981$thisentryweekbeginningweekdayshort = substr($thisentryweekbeginningweekday, 0, 3);
982$thisentryweekbeginningmonthwordshort = substr($thisentryweekbeginningmonthword, 0, 3);
983$thisentryweekbeginningweekdayupper = uc($thisentryweekbeginningweekday);
984$thisentryweekbeginningmonthwordupper = uc($thisentryweekbeginningmonthword);
985$thisentryweekbeginningweekdaylower = lc($thisentryweekbeginningweekday);
986$thisentryweekbeginningmonthwordlower = lc($thisentryweekbeginningmonthword);
987$thisentryweekbeginningweekdayuppershort = uc($thisentryweekbeginningweekdayshort);
988$thisentryweekbeginningmonthworduppershort = uc($thisentryweekbeginningmonthwordshort);
989$thisentryweekbeginningweekdaylowershort = lc($thisentryweekbeginningweekdayshort);
990$thisentryweekbeginningmonthwordlowershort = lc($thisentryweekbeginningmonthwordshort);
991
992$thisentryweekendingweekday = "Saturday";
993$thisentryweekendingmonthword = $months[$thisentryweekendingmonth];
994$thisentryweekendingweekdayshort = substr($thisentryweekendingweekday, 0, 3);
995$thisentryweekendingmonthwordshort = substr($thisentryweekendingmonthword, 0, 3);
996$thisentryweekendingweekdayupper = uc($thisentryweekendingweekday);
997$thisentryweekendingmonthwordupper = uc($thisentryweekendingmonthword);
998$thisentryweekendingweekdaylower = lc($thisentryweekendingweekday);
999$thisentryweekendingmonthwordlower = lc($thisentryweekendingmonthword);
1000$thisentryweekendingweekdayuppershort = uc($thisentryweekendingweekdayshort);
1001$thisentryweekendingmonthworduppershort = uc($thisentryweekendingmonthwordshort);
1002$thisentryweekendingweekdaylowershort = lc($thisentryweekendingweekdayshort);
1003$thisentryweekendingmonthwordlowershort = lc($thisentryweekendingmonthwordshort);
1004
1005open (FUNNYFEETVISHNU, "./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.");
1006@gettheauthordata = <FUNNYFEETVISHNU>;
1007close (FUNNYFEETVISHNU);
1008
1009$thisentryauthoremail = "";
1010$thisentryauthorhomepage = "";
1011$thisentryauthorentrycount = "";
1012
1013foreach $gettheauthordataline (@gettheauthordata) {
1014 chomp ($gettheauthordataline);
1015 @gettheauthorinfo = split (/\|/, $gettheauthordataline);
1016 if ($gettheauthorinfo[0] eq $thisentryauthor) {
1017 $thisentryauthoremail = $gettheauthorinfo[2];
1018 $thisentryauthorhomepage = $gettheauthorinfo[3];
1019 $thisentryauthorentrycount = $gettheauthorinfo[5];
1020 }
1021}
1022
1023$thisentryauthorsmartlink = $thisentryauthor;
1024if ($thisentryauthoremail ne "") { $thisentryauthorsmartlink = "<a href=\"mailto:$thisentryauthoremail\">$thisentryauthor</a>"; }
1025if ($thisentryauthorhomepage ne "") { $thisentryauthorsmartlink = "<a href=\"$thisentryauthorhomepage\" $gmlinktargettemplate>$thisentryauthor</a>"; }
1026
1027$thisentryfilename = "$EntriesWebPath\/$thisentrynumberpadded\.$entrysuffix";
1028
1029$thisentrycommentspostlink = "$thisentryfilename\#comments";
1030
1031$thisentrycommentstatussmart = $gmsmartlinkmanycommentstemplate;
1032
1033if ($thisentrycommentsnumber eq "0") { $thisentrycommentstatussmart = $gmsmartlinknocommentstemplate; }
1034if ($thisentrycommentsnumber eq "1") { $thisentrycommentstatussmart = $gmsmartlinkonecommenttemplate; }
1035
1036$thisentrycommentstatussmartupper = uc($thisentrycommentstatussmart);
1037$thisentrycommentstatussmartlower = lc($thisentrycommentstatussmart);
1038
1039$thisentrypagelink = $thisentryfilename;
1040
1041$indexfilenamesmartcheck = "/$indexfilename";
1042$indexfilenameprefix = substr($indexfilename, 0, 6);
1043
1044if ($indexfilenameprefix eq "index.") { $indexfilenamesmartcheck = "/"; }
1045
1046$thisentrypageindexlink = "$LogWebPath$indexfilenamesmartcheck";
1047$thisentrypagearchiveindexlink = "$EntriesWebPath$indexfilenamesmartcheck";
1048
1049if ($keepmonthlyarchives eq "no") {
1050 $thisentrypagearchivelogindexlink = $thisentrypageindexlink;
1051} else {
1052 if ($archiveformat eq "week") {
1053 $thisentrypagearchivelogindexlink = "$EntriesWebPath/archive-$thisentryweekbeginningmonthmonth$thisentryweekbeginningdayday$thisentryweekbeginningyearyear-$thisentryweekendingmonthmonth$thisentryweekendingdayday$thisentryweekendingyearyear\.$logarchivesuffix";
1054 } else {
1055 $thisentrypagearchivelogindexlink = "$EntriesWebPath/archive-$thisentrymonthmonth$thisentryyearyear\.$logarchivesuffix";
1056 }
1057}
1058
1059$thisentrypagesmartindexlink = $thisentrypageindexlink;
1060
1061if (($thisentrynumber <= $newarchivenumber) && ($keepmonthlyarchives ne "no")) {
1062 $thisentrypagesmartindexlink = $thisentrypagearchivelogindexlink;
1063}
1064
1065$thisentrycommentslink = "";
1066$thisentrycommentsform = "";
1067if ($thisentryallowcomments eq "yes") {
1068 if (($allowkarmaorcomments eq "comments") || ($allowkarmaorcomments eq "both")) {
1069 $thisentrycommentslink = $gmcommentslinktemplate;
1070 $thisentrycommentsform = $gmcommentsformtemplate;
1071 }
1072}
1073
1074if (($emoticonsallowed eq "both") || ($emoticonsallowed eq "comments")) {
1075 $thisentrycommentsform =~ s/{{smartemoticonscode}}/$gmsmartemoticonscodetemplate/;
1076} else {
1077 $thisentrycommentsform =~ s/{{smartemoticonscode}}//;
1078}
1079
1080$thisentrykarmalink = "";
1081$thisentrykarmaform = "";
1082if ($thisentryallowkarma eq "yes") {
1083 if (($allowkarmaorcomments eq "karma") || ($allowkarmaorcomments eq "both")) {
1084 $thisentrykarmalink = $gmkarmalinktemplate;
1085 $thisentrykarmaform = $gmkarmaformtemplate;
1086 }
1087}
1088
1089if (($thisentryisanarchive eq "yes") && ($posttoarchives eq "no")) {
1090 $thisentrykarmalink = "";
1091 $thisentrykarmaform = "";
1092 $thisentrycommentslink = "";
1093 $thisentrycommentsform = "";
1094}
1095
1096$thisentrysearchform = $gmsearchformtemplate;
1097
1098if ($generateentrypages eq "no") {
1099 $thisentrycommentslink = "";
1100 $thisentrycommentsform = "";
1101 $thisentrysearchform = "";
1102}
1103
1104$thisentrypositivekarmalink = "$cgiwebpath/gm-karma.cgi?vote=positive&entry=$thisentrynumberpadded";
1105$thisentrynegativekarmalink = "$cgiwebpath/gm-karma.cgi?vote=negative&entry=$thisentrynumberpadded";
1106
1107$thisentrytotalkarma = $thisentrypositivekarma - $thisentrynegativekarma;
1108
1109@thisentrykarmavoters = split (/\|/, $entrylines[1]);
1110
1111$thisentrymainbody = $entrylines[2];
1112$thisentrymorebody = $entrylines[3];
1113
1114if (($thisentrymainbody =~ /\|\*\|\|\*\|/) || ($thisentrymorebody =~ /\|\*\|\|\*\|/)) {
1115 $thisentrymainbody =~ s/\|\*\|\|\*\|/<PARABREAK>/g;
1116 $thisentrymorebody =~ s/\|\*\|\|\*\|/<PARABREAK>/g;
1117}
1118if (($thisentrymainbody =~ /\n\n/) || ($thisentrymorebody =~ /\n\n/)) {
1119 $thisentrymainbody =~ s/\n\n/<PARABREAK>/g;
1120 $thisentrymorebody =~ s/\n\n/<PARABREAK>/g;
1121}
1122if (($thisentrymainbody =~ /\|\*\|/) || ($thisentrymorebody =~ /\|\*\|/)) {
1123 $thisentrymainbody =~ s/\|\*\|/$gmlinebreaktemplate/g;
1124 $thisentrymorebody =~ s/\|\*\|/$gmlinebreaktemplate/g;
1125}
1126if (($thisentrymainbody =~ /\n/) || ($thisentrymorebody =~ /\n/)) {
1127 $thisentrymainbody =~ s/\n/$gmlinebreaktemplate/g;
1128 $thisentrymorebody =~ s/\n/$gmlinebreaktemplate/g;
1129}
1130if (($thisentrymainbody =~ /<PARABREAK>/) || ($thisentrymorebody =~ /<PARABREAK>/)) {
1131 $thisentrymainbody =~ s/<PARABREAK>/$gmparaseparationtemplate/g;
1132 $thisentrymorebody =~ s/<PARABREAK>/$gmparaseparationtemplate/g;
1133}
1134
1135if (($censorenabled eq "both") || ($censorenabled eq "entries")) {
1136 unless ($censorlist eq "") {
1137 @censoredterms = split(/\|\*\|/, $censorlist);
1138 foreach $thisterm (@censoredterms) {
1139 unless ($thisterm eq "") {
1140 if ((substr($thisterm, 0, 1) eq "[") && (substr($thisterm, -1, 1) eq "]")) {
1141 $thisrealterm = $thisterm;
1142 $thisrealterm =~ s/\[//g;
1143 $thisrealterm =~ s/\]//g;
1144 $thisrealtermlength = length($thisrealterm);
1145 $thisrealtermreplace = "*" x $thisrealtermlength;
1146 $thisrealtermreplacedash = "-" x $thisrealtermlength;
1147 if ($thisentrysubject =~ m/$thisrealterm/i) {
1148 $thisentrysubject =~ s/\b$thisrealterm\b/$thisrealtermreplacedash/isg;
1149 }
1150 if ($thisentrymainbody =~ m/$thisrealterm/i) {
1151 $thisentrymainbody =~ s/\b$thisrealterm\b/$thisrealtermreplace/isg;
1152 }
1153 if ($thisentrymorebody =~ m/$thisrealterm/i) {
1154 $thisentrymorebody =~ s/\b$thisrealterm\b/$thisrealtermreplace/isg;
1155 }
1156 } else {
1157 $thisrealtermlength = length($thisterm);
1158 $thisrealtermreplace = "*" x $thisrealtermlength;
1159 $thisrealtermreplacedash = "-" x $thisrealtermlength;
1160 if ($thisentrysubject =~ m/$thisterm/i) {
1161 $thisentrysubject =~ s/\b$thisterm\b/$thisrealtermreplacedash/isg;
1162 }
1163 if ($thisentrymainbody =~ m/$thisterm/i) {
1164 $thisentrymainbody =~ s/\b$thisterm\b/$thisrealtermreplace/isg;
1165 }
1166 if ($thisentrymorebody =~ m/$thisterm/i) {
1167 $thisentrymorebody =~ s/\b$thisterm\b/$thisrealtermreplace/isg;
1168 }
1169 }
1170 }
1171 }
1172 }
1173}
1174
1175$thisentrymorepreface = "";
1176$thisentrymorelink = "";
1177if (($thisentrymorebody ne "") && ($generateentrypages ne "no")) {
1178 $thisentrymorepreface = $gmmoreprefacetemplate;
1179 $thisentrymorelink = $gmmorelinktemplate;
1180}
1181
1182$thisentrycommentdivider = "";
1183if ($thisentrycommentsnumber ne "0") { $thisentrycommentdivider = $gmcommentdividertemplate; }
1184
1185$thisentrycomments = "";
1186
1187# changed deprecated <b>, <i>, and <u> tags to corresponding css properties: flipped cracker 9/15/2003
1188# removed code for entrysubject : 1.3.1
1189# flipped cracker 6/29/2004
1190if (($inlineformatting eq "entries") || ($inlineformatting eq "both")) {
1191 if (($thisentrymainbody =~ /\*\*(.*?)\*\*/) || ($thisentrymainbody =~ /\\\\(.*?)\\\\/) || ($thisentrymainbody =~ /__(.*?)__/)) {
1192 $thisentrymainbody =~ s/\*\*(.*?)\*\*/<span style="font-weight: bold;">$1<\/span>/isg;
1193 $thisentrymainbody =~ s/\\\\(.*?)\\\\/<span style="font-style: italic;">$1<\/span>/isg;
1194 $thisentrymainbody =~ s/__(.*?)__/<span style="text-decoration: underline;">$1<\/span>/isg;
1195 }
1196 if (($thisentrymorebody =~ /\*\*(.*?)\*\*/) || ($thisentrymorebody =~ /\\\\(.*?)\\\\/) || ($thisentrymorebody =~ /__(.*?)__/)) {
1197 $thisentrymorebody =~ s/\*\*(.*?)\*\*/<span style="font-weight: bold;">$1<\/span>/isg;
1198 $thisentrymorebody =~ s/\\\\(.*?)\\\\/<span style="font-style: italic;">$1<\/span>/isg;
1199 $thisentrymorebody =~ s/__(.*?)__/<span style="text-decoration: underline;">$1<\/span>/isg;
1200 }
1201}
1202# changed 9/15/2003
1203
1204# emoticons hack revised by flipped cracker 9/17/2003
1205# merged in version 1.3
1206$returnto = "entries";
1207$thisentrymainbody = &gm_emoticons($thisentrymainbody);
1208$thisentrymorebody = &gm_emoticons($thisentrymorebody);
1209# merged 9/17/2003
1210
1211if (($thisentrycommentsnumber ne "0") && ($generateentrypages ne "no")) {
1212 $thisisaspellcheck = "no";
1213 &gm_collatecomments;
1214 $thisentrycomments =~ s/\"/"/g;
1215}
1216
1217}
1218
1219# -----------------
1220# comment collating
1221# -----------------
1222
1223sub gm_collatecomments {
1224
1225$commentcounter = 4;
1226if ($commentsorder eq "ascending") { $commentcounter = $thisentrycommentsnumber + 3; }
1227
1228$commentcountermax = $thisentrycommentsnumber + 3;
1229$commentcountercurrent = $thisentrycommentsnumber;
1230
1231do {
1232
1233$thiscommentordernumber = $commentcounter - 3;
1234
1235($thiscommentauthor, $thiscommentauthorip, $thiscommentauthoremailabsolute, $thiscommentauthorhomepageabsolute, $thiscommentweekdaynumber, $thiscommentmonth, $thiscommentday, $thiscommentyearyear, $thiscommenthour, $thiscommentminute, $thiscommentsecond, $thiscommentampm, $thiscommenttext) = split (/\|/, $entrylines[$commentcounter]);
1236
1237$thiscommentyear = substr($thiscommentyearyear, -2, 2);
1238
1239@months = ("null", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
1240@weekdays = ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
1241
1242$thiscommentweekday = $weekdays[$thiscommentweekdaynumber];
1243$thiscommentmonthword = $months[$thiscommentmonth];
1244$thiscommentweekdayshort = substr($thiscommentweekday, 0, 3);
1245$thiscommentmonthwordshort = substr($thiscommentmonthword, 0, 3);
1246$thiscommentweekdayupper = uc($thiscommentweekday);
1247$thiscommentmonthwordupper = uc($thiscommentmonthword);
1248$thiscommentweekdaylower = lc($thiscommentweekday);
1249$thiscommentmonthwordlower = lc($thiscommentmonthword);
1250$thiscommentweekdayuppershort = uc($thiscommentweekdayshort);
1251$thiscommentmonthworduppershort = uc($thiscommentmonthwordshort);
1252$thiscommentweekdaylowershort = lc($thiscommentweekdayshort);
1253$thiscommentmonthwordlowershort = lc($thiscommentmonthwordshort);
1254
1255$thiscommentmonthmonth = sprintf ("%2d", $thiscommentmonth);
1256$thiscommentdayday = sprintf ("%2d", $thiscommentday);
1257$thiscommenthourhour = sprintf ("%2d", $thiscommenthour);
1258$thiscommentminuteminute = sprintf ("%2d", $thiscommentminute);
1259$thiscommentsecondsecond = sprintf ("%2d", $thiscommentsecond);
1260$thiscommentmonthmonth =~ tr/ /0/;
1261$thiscommentdayday =~ tr/ /0/;
1262$thiscommenthourhour =~ tr/ /0/;
1263$thiscommentminuteminute =~ tr/ /0/;
1264$thiscommentsecondsecond =~ tr/ /0/;
1265
1266$thiscommentampmdot = "A.M.";
1267$thiscommentmilitaryhour = $thiscommenthour;
1268if ($thiscommentampm eq "PM") {
1269 $thiscommentampmdot = "P.M.";
1270 if ($thiscommenthour ne "12") { $thiscommentmilitaryhour = $thiscommenthour + 12; }
1271}
1272$thiscommentmilitaryhour = sprintf ("%2d", $thiscommentmilitaryhour);
1273$thiscommentmilitaryhour =~ tr/ /0/;
1274$thiscommentampmlower = lc($thiscommentampm);
1275$thiscommentampmdotlower = lc($thiscommentampmdot);
1276
1277# new ordinal numbers for {{dayappend}} variable: linear 9/15/2003
1278# merged in 1.3
1279$thiscommentdayappend = &gm_toordinal($thiscommentday);
1280#merged 9/15/2003
1281
1282
1283$thiscommentauthor =~ s/"/\"/g;
1284$thiscommentauthoremailabsolute =~ s/"/\"/g;
1285$thiscommentauthorhomepageabsolute =~ s/"/\"/g;
1286
1287$thiscommentauthoremail = "";
1288$thiscommentauthorhomepage = "";
1289
1290$thiscommentauthorsmartlink = $thiscommentauthor;
1291if ($thiscommentauthoremailabsolute ne "") {
1292 $thiscommentauthoremail = $gmcommentauthoremailtemplate;
1293 $thiscommentauthorsmartlink = "<a href=\"mailto:$thiscommentauthoremailabsolute\">$thiscommentauthor</a>";
1294}
1295if ($thiscommentauthorhomepageabsolute ne "") {
1296 $thiscommentauthorhomepage = $gmcommentauthorhomepagetemplate;
1297 $thiscommentauthorsmartlink = "<a href=\"$thiscommentauthorhomepageabsolute\" $gmcommentlinktargettemplate>$thiscommentauthor</a>";
1298}
1299
1300if (($allowhtmlincomments eq "linkboldital") || ($allowhtmlincomments eq "linkonly")) {
1301 if ($thiscommenttext =~ m/\*/i) { $thiscommenttext =~ s/\*/\|AMP\|/g; }
1302 if (($thiscommenttext =~ m/<a href/i) && ($thiscommenttext =~ m/<\/a>/i)) {
1303 $thiscommenttext =~ s/<a href/\*a href\*/isg;
1304 $thiscommenttext =~ s/<\/a>/\*a\*/isg;
1305 }
1306 if ($allowhtmlincomments eq "linkboldital") {
1307 if (($thiscommenttext =~ m/<b>/i) && ($thiscommenttext =~ m/<\/b>/i)) {
1308 $thiscommenttext =~ s/<b>/\*b\*/isg;
1309 $thiscommenttext =~ s/<\/b>/\*bb\*/isg;
1310 }
1311 if (($thiscommenttext =~ m/<i>/i) && ($thiscommenttext =~ m/<\/i>/i)) {
1312 $thiscommenttext =~ s/<i>/\*i\*/isg;
1313 $thiscommenttext =~ s/<\/i>/\*ii\*/isg;
1314 }
1315 }
1316}
1317
1318# improved tag removal regex: linear 7/9/2003
1319# merged into 1.3
1320unless ($allowhtmlincomments eq "yes") { $thiscommenttext =~ s(<[^>]*>)()gs; }
1321# merged 9/11/2003
1322if ($autolinkurls eq "yes") {
1323# these two lines of code written in part by Neal Coffey (cray@indecisions.org)
1324 $thiscommenttext =~ s#(^|\s)(\w+://)([A-Za-z0-9?=_\-/.%+&'~\#@!\^]+)#$1<a href="$2$3" rel="nofollow">$2$3</a>#isg;
1325 $thiscommenttext =~ s#(^|\s)(www.[A-Za-z0-9?=_\-/.%+&'~\#@!\^]+)#$1<a href="http://$2" rel="nofollow" target="_blank">$2</a>#isg;
1326# thanks, Neal!
1327 $thiscommenttext =~ s/(\w+\@\w+\.\w+)/<a href="mailto:$1">$1<\/a>/isg;
1328}
1329
1330# emoticons hack revised by flipped cracker 9/17/2003
1331# merged in version 1.3
1332$returnto = "comments";
1333$thiscommenttext = &gm_emoticons($thiscommenttext);
1334# merged 9/17/2003
1335
1336if (($allowhtmlincomments eq "linkboldital") || ($allowhtmlincomments eq "linkonly")) {
1337 if (($thiscommenttext =~ m/\*a href\*/i) && ($thiscommenttext =~ m/\*a\*/i)) {
1338 $thiscommenttext =~ s/\*a href\*/<a href/isg;
1339 $thiscommenttext =~ s/\*a\*/<\/a>/isg;
1340 }
1341 # changed deprecated <b>, and <i> to corresponding css properties: flipped cracker 9/15/2003
1342 if ($allowhtmlincomments eq "linkboldital") {
1343 if (($thiscommenttext =~ m/\*b\*/i) && ($thiscommenttext =~ m/\*bb\*/i)) {
1344 $thiscommenttext =~ s/\*b\*/<span style="font-weight:bold;">/isg;
1345 $thiscommenttext =~ s/\*bb\*/<\/span>/isg;
1346 }
1347 if (($thiscommenttext =~ m/\*i\*/i) && ($thiscommenttext =~ m/\*ii\*/i)) {
1348 $thiscommenttext =~ s/\*i\*/<span style="font-style:italic;">/isg;
1349 $thiscommenttext =~ s/\*ii\*/<\/span>/isg;
1350 }
1351 }
1352 # changed 9/15/2003
1353 if ($thiscommenttext =~ m/\|AMP\|/i) { $thiscommenttext =~ s/\|AMP\|/\*/g; }
1354}
1355
1356# changed deprecated <b>, <i>, and <u> to corresponding css properties: flipped cracker 9/15/2003
1357if (($inlineformatting eq "comments") || ($inlineformatting eq "both")) {
1358 if (($thiscommenttext =~ /\*\*(.*?)\*\*/) || ($thiscommenttext =~ /\\\\(.*?)\\\\/) || ($thiscommenttext =~ /__(.*?)__/)) {
1359 $thiscommenttext =~ s/\*\*(.*?)\*\*/<span style="font-weight:bold;">$1<\/span>/isg;
1360 $thiscommenttext =~ s/\\\\(.*?)\\\\/<span style="font-style: italic;">$1<\/span>/isg;
1361 $thiscommenttext =~ s/__(.*?)__/<span style="text-decoration:underline;">$1<\/span>/isg;
1362 }
1363}
1364#changed 9/15/2003
1365
1366if ($striplinesfromcomments eq "yes") {
1367 if (($thiscommenttext =~ /\|\*\|/) || ($thiscommenttext =~ /\n/)) {
1368 $thiscommenttext =~ s/\|\*\|/ /g;
1369 $thiscommenttext =~ s/\n/ /g;
1370 }
1371} else {
1372 if (($thiscommenttext =~ /\|\*\|/) || ($thiscommenttext =~ /\n/)) {
1373 $thiscommenttext =~ s/\|\*\|\|\*\|/<PARABREAK>/g;
1374 $thiscommenttext =~ s/\n\n/<PARABREAK>/g;
1375 $thiscommenttext =~ s/\|\*\|/$gmlinebreaktemplate/g;
1376 $thiscommenttext =~ s/\n/$gmlinebreaktemplate/g;
1377 $thiscommenttext =~ s/<PARABREAK>/$gmparaseparationtemplate/g;
1378 $thiscommenttext =~ s/a href/a rel="nofollow" href/g;
1379 $thiscommenttext =~ s/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w{1,8});)/&/g;
1380 }
1381}
1382
1383if (($censorenabled eq "both") || ($censorenabled eq "comments")) {
1384 unless ($censorlist eq "") {
1385 @censoredterms = split(/\|\*\|/, $censorlist);
1386 foreach $thisterm (@censoredterms) {
1387 unless ($thisterm eq "") {
1388 if ((substr($thisterm, 0, 1) eq "[") && (substr($thisterm, -1, 1) eq "]")) {
1389 $thisrealterm = $thisterm;
1390 $thisrealterm =~ s/\[//g;
1391 $thisrealterm =~ s/\]//g;
1392 $thisrealtermlength = length($thisrealterm);
1393 $thisrealtermreplace = "*" x $thisrealtermlength;
1394 $thisrealtermreplacedash = "-" x $thisrealtermlength;
1395 if ($thiscommenttext =~ m/$thisrealterm/i) {
1396 $thiscommenttext =~ s/\b$thisrealterm\b/$thisrealtermreplace/isg;
1397 }
1398 if ($thiscommentauthor =~ m/$thisrealterm/i) {
1399 $thiscommentauthor =~ s/\b$thisrealterm\b/$thisrealtermreplacedash/isg;
1400 }
1401 } else {
1402 $thisrealtermlength = length($thisterm);
1403 $thisrealtermreplace = "*" x $thisrealtermlength;
1404 $thisrealtermreplacedash = "-" x $thisrealtermlength;
1405 if ($thiscommenttext =~ m/$thisterm/i) {
1406 $thiscommenttext =~ s/\b$thisterm\b/$thisrealtermreplace/isg;
1407 }
1408 if ($thiscommentauthor =~ m/$thisterm/i) {
1409 $thiscommentauthor =~ s/\b$thisterm\b/$thisrealtermreplacedash/isg;
1410 }
1411 }
1412 }
1413 }
1414 }
1415}
1416
1417$thiscommentfullbody = $gmcommentstemplate;
1418
1419if ($thiscommentfullbody =~ m/{{comment/i) {
1420 $thiscommentfullbody =~ s/{{commentbody}}/$thiscommenttext/gi;
1421 $thiscommentfullbody =~ s/{{commentauthoremail}}/$thiscommentauthoremail/gi;
1422 $thiscommentfullbody =~ s/{{commentauthorhomepage}}/$thiscommentauthorhomepage/gi;
1423 $thiscommentfullbody =~ s/{{commentauthor}}/$thiscommentauthor/gi;
1424 $thiscommentfullbody =~ s/{{commentauthoremailabsolute}}/$thiscommentauthoremailabsolute/gi;
1425 $thiscommentfullbody =~ s/{{commentauthorhomepageabsolute}}/$thiscommentauthorhomepageabsolute/gi;
1426 $thiscommentfullbody =~ s/{{commentauthorsmartlink}}/$thiscommentauthorsmartlink/gi;
1427 $thiscommentfullbody =~ s/{{commentauthorip}}/$thiscommentauthorip/gi;
1428 $thiscommentfullbody =~ s/{{commentordernumber}}/$thiscommentordernumber/gi;
1429}
1430
1431$thiscommentfullbody =~ s/{{day}}/$thiscommentday/gi;
1432$thiscommentfullbody =~ s/{{month}}/$thiscommentmonth/gi;
1433$thiscommentfullbody =~ s/{{year}}/$thiscommentyear/gi;
1434$thiscommentfullbody =~ s/{{hour}}/$thiscommenthour/gi;
1435$thiscommentfullbody =~ s/{{minute}}/$thiscommentminute/gi;
1436$thiscommentfullbody =~ s/{{second}}/$thiscommentsecond/gi;
1437$thiscommentfullbody =~ s/{{dayday}}/$thiscommentdayday/gi;
1438$thiscommentfullbody =~ s/{{monthmonth}}/$thiscommentmonthmonth/gi;
1439$thiscommentfullbody =~ s/{{yearyear}}/$thiscommentyearyear/gi;
1440$thiscommentfullbody =~ s/{{hourhour}}/$thiscommenthourhour/gi;
1441$thiscommentfullbody =~ s/{{minuteminute}}/$thiscommentminuteminute/gi;
1442$thiscommentfullbody =~ s/{{secondsecond}}/$thiscommentsecondsecond/gi;
1443$thiscommentfullbody =~ s/{{weekday}}/$thiscommentweekday/gi;
1444$thiscommentfullbody =~ s/{{weekdayshort}}/$thiscommentweekdayshort/gi;
1445$thiscommentfullbody =~ s/{{monthword}}/$thiscommentmonthword/gi;
1446$thiscommentfullbody =~ s/{{monthwordshort}}/$thiscommentmonthwordshort/gi;
1447$thiscommentfullbody =~ s/{{weekdayupper}}/$thiscommentweekdayupper/gi;
1448$thiscommentfullbody =~ s/{{monthwordupper}}/$thiscommentmonthwordupper/gi;
1449$thiscommentfullbody =~ s/{{weekdaylower}}/$thiscommentweekdaylower/gi;
1450$thiscommentfullbody =~ s/{{monthwordlower}}/$thiscommentmonthwordlower/gi;
1451$thiscommentfullbody =~ s/{{weekdayuppershort}}/$thiscommentweekdayuppershort/gi;
1452$thiscommentfullbody =~ s/{{monthworduppershort}}/$thiscommentmonthworduppershort/gi;
1453$thiscommentfullbody =~ s/{{weekdaylowershort}}/$thiscommentweekdaylowershort/gi;
1454$thiscommentfullbody =~ s/{{monthwordlowershort}}/$thiscommentmonthwordlowershort/gi;
1455$thiscommentfullbody =~ s/{{militaryhour}}/$thiscommentmilitaryhour/gi;
1456$thiscommentfullbody =~ s/{{ampm}}/$thiscommentampm/gi;
1457$thiscommentfullbody =~ s/{{ampmdot}}/$thiscommentampmdot/gi;
1458$thiscommentfullbody =~ s/{{ampmlower}}/$thiscommentampmlower/gi;
1459$thiscommentfullbody =~ s/{{ampmdotlower}}/$thiscommentampmdotlower/gi;
1460# new {{dayappend variable}}: linear 9/15/2003
1461# merged in 1.3
1462$thiscommentfullbody =~ s/{{dayappend}}/$thiscommentdayappend/gi;
1463# merged 9/15/2003
1464
1465$thisentrycomments .= $thiscommentfullbody;
1466
1467if ($commentsorder eq "ascending") { $commentcounter--; } else { $commentcounter++; }
1468
1469$commentcountercurrent--;
1470
1471} until $commentcountercurrent eq "0";
1472
1473}
1474
1475# ----------------
1476# format the entry
1477# ----------------
1478
1479sub gm_formatentry {
1480
1481my $entrygetreturn = shift;
1482
1483# added by flipped cracker 09/12/03
1484# version 1.3
1485$domain = $cgiwebpath;
1486$domain =~ s@http://([^\/]+)?.*@$1@;
1487# end additions
1488
1489$entryreturn = $entrygetreturn;
1490
1491# $entryreturn =~ s/\|\*\|/\n/g;
1492
1493if (($entryreturn =~ m/{{header}}/i) || ($entryreturn =~ m/{{footer}}/i) || ($entryreturn =~ m/{{sidebar}}/i)) {
1494 $entryreturn =~ s/{{header}}/$gmheadertemplate/gi;
1495 $entryreturn =~ s/{{footer}}/$gmfootertemplate/gi;
1496 $entryreturn =~ s/{{sidebar}}/$gmsidebartemplate/gi;
1497}
1498
1499if ($entryreturn =~ m/{{custom/i) {
1500 $entryreturn =~ s/{{customone}}/$gmcustomonetemplate/gi;
1501 $entryreturn =~ s/{{customtwo}}/$gmcustomtwotemplate/gi;
1502 $entryreturn =~ s/{{customthree}}/$gmcustomthreetemplate/gi;
1503 $entryreturn =~ s/{{customfour}}/$gmcustomfourtemplate/gi;
1504 $entryreturn =~ s/{{customfive}}/$gmcustomfivetemplate/gi;
1505 $entryreturn =~ s/{{customsix}}/$gmcustomsixtemplate/gi;
1506 $entryreturn =~ s/{{customseven}}/$gmcustomseventemplate/gi;
1507 $entryreturn =~ s/{{customeight}}/$gmcustomeighttemplate/gi;
1508 $entryreturn =~ s/{{customnine}}/$gmcustomninetemplate/gi;
1509 $entryreturn =~ s/{{customten}}/$gmcustomtentemplate/gi;
1510}
1511
1512if ($entryreturn =~ m/{{logarchivelist}}/i) {
1513 if ($keepmonthlyarchives eq "no") {
1514 $entryreturn =~ s/{{logarchivelist}}//gi;
1515 } else {
1516 &gm_generatearchiveloglist;
1517 $entryreturn =~ s/{{logarchivelist}}/$logarchivelistfinal/gi;
1518 }
1519}
1520
1521if ($generateentrypages eq "yes") {
1522 if (($entryreturn =~ m/{{logshortentrylist/i) || ($entryreturn =~ m/{{logmoreentrylist/i) || ($entryreturn =~ m/{{logentrylist/i)) {
1523 &gm_generateentryloglist;
1524 $entryreturn =~ s/{{logshortentrylist}}/$logshortentrylistfinal/gi;
1525 $entryreturn =~ s/{{logmoreentrylist}}/$logmoreentrylistfinal/gi;
1526 $entryreturn =~ s/{{logentrylist}}/$logentrylistfinal/gi;
1527 $entryreturn =~ s/{{logshortentrylist month}}/$logshortentrylistmonthfinal/gi;
1528 $entryreturn =~ s/{{logshortentrylist day}}/$logshortentrylistdayfinal/gi;
1529 $entryreturn =~ s/{{logshortentrylist year}}/$logshortentrylistyearfinal/gi;
1530 $entryreturn =~ s/{{logmoreentrylist month}}/$logmoreentrylistmonthfinal/gi;
1531 $entryreturn =~ s/{{logmoreentrylist day}}/$logmoreentrylistdayfinal/gi;
1532 $entryreturn =~ s/{{logmoreentrylist year}}/$logmoreentrylistyearfinal/gi;
1533 $entryreturn =~ s/{{logentrylist month}}/$logentrylistmonthfinal/gi;
1534 $entryreturn =~ s/{{logentrylist day}}/$logentrylistdayfinal/gi;
1535 $entryreturn =~ s/{{logentrylist year}}/$logentrylistyearfinal/gi;
1536 $entryreturn =~ s/{{logshortentrylist number}}/$logshortentrylistnumberfinal/gi;
1537 $entryreturn =~ s/{{logmoreentrylist number}}/$logmoreentrylistnumberfinal/gi;
1538 $entryreturn =~ s/{{logentrylist number}}/$logentrylistnumberfinal/gi;
1539 $entryreturn =~ s/{{logshortentrylist firsthalf}}/$logshortentrylistfirsthalffinal/gi;
1540 $entryreturn =~ s/{{logshortentrylist secondhalf}}/$logshortentrylistsecondhalffinal/gi;
1541 $entryreturn =~ s/{{logmoreentrylist firsthalf}}/$logmoreentrylistfirsthalffinal/gi;
1542 $entryreturn =~ s/{{logmoreentrylist secondhalf}}/$logmoreentrylistsecondhalffinal/gi;
1543 $entryreturn =~ s/{{logentrylist firsthalf}}/$logentrylistfirsthalffinal/gi;
1544 $entryreturn =~ s/{{logentrylist secondhalf}}/$logentrylistsecondhalffinal/gi;
1545 }
1546 if (($entryreturn =~ m/{{logshortentrylist comments/i) || ($entryreturn =~ m/{{logmoreentrylist comments/i) || ($entryreturn =~ m/{{logentrylist comments/i)) {
1547 &gm_generateentryloglistcomments;
1548 $entryreturn =~ s/{{logshortentrylist comments}}/$logshortentrylistfinal/gi;
1549 $entryreturn =~ s/{{logmoreentrylist comments}}/$logmoreentrylistfinal/gi;
1550 $entryreturn =~ s/{{logentrylist comments}}/$logentrylistfinal/gi;
1551 $entryreturn =~ s/{{logshortentrylist commentsminimum}}/$logshortminimumentrylistfinal/gi;
1552 $entryreturn =~ s/{{logmoreentrylist commentsminimum}}/$logmoreminimumentrylistfinal/gi;
1553 $entryreturn =~ s/{{logentrylist commentsminimum}}/$logminimumentrylistfinal/gi;
1554 $entryreturn =~ s/{{logshortentrylist commentsnumber}}/$logshortnumberentrylistfinal/gi;
1555 $entryreturn =~ s/{{logmoreentrylist commentsnumber}}/$logmorenumberentrylistfinal/gi;
1556 $entryreturn =~ s/{{logentrylist commentsnumber}}/$lognumberentrylistfinal/gi;
1557 }
1558 if (($entryreturn =~ m/{{logshortentrylist /i) || ($entryreturn =~ m/{{logmoreentrylist /i) || ($entryreturn =~ m/{{logentrylist /i)) {
1559 open (FUNNYFEETBRAHMA, "./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.");
1560 @gettheauthordata = <FUNNYFEETBRAHMA>;
1561 close (FUNNYFEETBRAHMA);
1562 foreach $gettheauthordataline (@gettheauthordata) {
1563 chomp ($gettheauthordataline);
1564 @gettheauthorinfo = split (/\|/, $gettheauthordataline);
1565 $thisentryloglistauthor = $gettheauthorinfo[0];
1566 &gm_generateentryloglistauthor;
1567 $entryreturn =~ s/{{logshortentrylist $thisentryloglistauthor}}/$logshortentrylistfinal/gi;
1568 $entryreturn =~ s/{{logmoreentrylist $thisentryloglistauthor}}/$logmoreentrylistfinal/gi;
1569 $entryreturn =~ s/{{logentrylist $thisentryloglistauthor}}/$logentrylistfinal/gi;
1570 }
1571 }
1572}
1573
1574if (($entryreturn =~ m/{{calendar}}/i) || ($entryreturn =~ m/{{calendarweek}}/i)) {
1575 $usethisentryweekdaynumber = $thisentryweekdaynumber;
1576 $usethisentryday = $thisentryday;
1577 $usethisentrymonth = $thisentrymonth;
1578 $usethisentrymonthmonth = $thisentrymonthmonth;
1579 $usethisentrymonthword = $thisentrymonthword;
1580 $usethisentryyear = $thisentryyear;
1581 $usethisentryyearyear = $thisentryyearyear;
1582 &gm_generatecalendar;
1583 $entryreturn =~ s/{{calendar}}/$calendarfull/gi;
1584 $entryreturn =~ s/{{calendarweek}}/$calendarweekfull/gi;
1585}
1586
1587if ($entryreturn =~ m/{{calendar (..)\/(..)}}/i) {
1588
1589 until ($entryreturn !~ m/{{calendar (..)\/(..)}}/ig) {
1590
1591 $usethisentrymonthmonth = $1;
1592 $usethisentryyear = $2;
1593
1594 open (FUNNYFEETKALI, "./gm-entrylist.cgi") || &gm_dangermouse("Can't read the entry list file. Please make sure that gm-entrylist.cgi is in the same directory as all your other Greymatter files and is CHMODed to 666; also, try running Diagnostics & Repair in the Configuration screen.");
1595 @loglistloglines = <FUNNYFEETKALI>;
1596 close (FUNNYFEETKALI);
1597
1598 $gotthecalendarmonth = "no";
1599
1600 foreach $thisloglistline (@loglistloglines) {
1601 ($loglistnumber, $loglistauthor, $loglistsubject, $loglistdate, $loglisttimeampm, $loglistopenstatus, $loglistmorestatus, $loglistentrymusic, $loglistentrymood, $loglistemoticonstatus) = split (/\|/, $thisloglistline);
1602 &gm_getloglistvariables;
1603 if (($loglistmonthmonth eq $usethisentrymonthmonth) && ($loglistyear eq $usethisentryyear) && ($gotthecalendarmonth eq "no")) {
1604 $usethisentryweekdaynumber = $loglistentryweekdaynumber;
1605 $usethisentryday = $loglistday;
1606 $usethisentrymonth = $loglistmonth;
1607 $usethisentrymonthword = $loglistmonthword;
1608 $usethisentryyearyear = $loglistyearyear;
1609 &gm_generatecalendar;
1610 $entryreturn =~ s/{{calendar $usethisentrymonthmonth\/$usethisentryyear}}/$calendarfull/gi;
1611 $gotthecalendarmonth = "yes";
1612 }
1613 }
1614
1615 if ($entryreturn =~ m/{{calendar $usethisentrymonthmonth\/$usethisentryyear}}/i) {
1616 $entryreturn =~ s/{{calendar $usethisentrymonthmonth\/$usethisentryyear}}//gi;
1617 }
1618
1619 }
1620
1621}
1622
1623# emoticons can be off, so we provide {{smartemoticonscode}} to print them only when they are needed/wanted: linear 9/23/2003
1624# merged in 1.3
1625
1626
1627# merged 9/23/2003
1628
1629if (($entryreturn =~ m/{{commentdivider}}/i) || ($entryreturn =~ m/{{entrycommentsform}}/i) || ($entryreturn =~ m/{{entrykarmaform}}/i) || ($entryreturn =~ m/{{searchform}}/i)) {
1630 $entryreturn =~ s/{{commentdivider}}/$thisentrycommentdivider/gi;
1631 $entryreturn =~ s/{{entrycommentsform}}/$thisentrycommentsform/gi;
1632 $entryreturn =~ s/{{entrykarmaform}}/$thisentrykarmaform/gi;
1633 $entryreturn =~ s/{{searchform}}/$thisentrysearchform/gi;
1634}
1635
1636#merged 9/29/2003
1637# added by flipped cracker
1638# version 1.3
1639## autolinkentry functionality removed from 1.3.1. linear 2/19/2004
1640# merged in version 1.3
1641
1642if ($entryreturn =~ m/{{entry/i) {
1643 $entryreturn =~ s/{{entrymainbody}}/$thisentrymainbody/gi;
1644 $entryreturn =~ s/{{entrymorebody}}/$thisentrymorebody/gi;
1645 $entryreturn =~ s/{{entrycomments}}/$thisentrycomments/gi;
1646 if ($entryreturn =~ m/{{entrymainbodyfirstwords (\d+)}}/i) {
1647 until ($entryreturn !~ m/{{entrymainbodyfirstwords (\d+)}}/isg) {
1648 $firstwordscount = $1;
1649 $grabmainbodywords = $thisentrymainbody;
1650 if ($grabmainbodywords =~ m/{{link/i) {
1651 $grabmainbodywords =~ s/({{linkmo) (http|https|ftp)(:\/\/\S+?) (.+?)(\|)(.+?)(}})/$4/isg;
1652 $grabmainbodywords =~ s/({{link) (http|https|ftp)(:\/\/\S+?)(}})/$2$3/isg;
1653 $grabmainbodywords =~ s/({{link) (http|https|ftp)(:\/\/\S+?) (.+?)(}})/$4/isg;
1654###########################################################
1655# 9/2/2001 - CHERYL LAMBERT
1656# ADDED {{linkblank}} TEMPLATE VARIABLE SO THAT I CAN USE target="_blank" TO OPEN NEW WINDOWS
1657 $grabmainbodywords =~ s/({{linkblankmo) (http|https|ftp)(:\/\/\S+?) (.+?)(\|)(.+?)(}})/$4/isg;
1658 $grabmainbodywords =~ s/({{linkblank) (http|https|ftp)(:\/\/\S+?)(}})/$2$3/isg;
1659 $grabmainbodywords =~ s/({{linkblank) (http|https|ftp)(:\/\/\S+?) (.+?)(}})/$4/isg;
1660###########################################################
1661 }
1662 if ($grabmainbodywords =~ m/{{email/i) {
1663 $grabmainbodywords =~ s/({{emailmo) (\S+\@\S+?) (.+?)(\|)(.+?)(}})/$3/isg;
1664 $grabmainbodywords =~ s/({{email) (\S+\@\S+?)(}})/$2/isg;
1665 $grabmainbodywords =~ s/({{email) (\S+\@\S+?) (.+?)(}})/$3/isg;
1666 }
1667 $grabmainbodywords =~ s/<([^>]|\n)*>/ /g;
1668 $grabmainbodywords =~ s/{{(.*?)}}/ /g;
1669 $grabmainbodywords =~ s/\n/ /g;
1670 $grabmainbodywords =~ s/\r/ /g;
1671 $grabmainbodywords =~ s/\|\*\|/ /g;
1672 $grabmainbodywords =~ s/^\s+//;
1673 $grabmainbodywords =~ s/\s+$//;
1674 $grabmainbodywords =~ s/\s{2,}/ /g;
1675 @grabmainbodywordslist = split (/ /, $grabmainbodywords);
1676 $countwordsfromhere = 0;
1677 (@finalmainbodywordslist, @finalmainbodywordslist = ());
1678 if ($firstwordscount < 1) { $firstwordscount = 1; }
1679 do {
1680 $finalmainbodywordslist[$countwordsfromhere] = $grabmainbodywordslist[$countwordsfromhere];
1681 $countwordsfromhere++;
1682 } until $countwordsfromhere eq $firstwordscount;
1683 $finalmainbodyfirstwords = join (" ", @finalmainbodywordslist);
1684 $finalmainbodyfirstwords =~ s/^\s+//;
1685 $finalmainbodyfirstwords =~ s/\s+$//;
1686 $finalmainbodyfirstwords =~ s/\s{2,}//g;
1687 if (substr($finalmainbodyfirstwords, -1) =~ /\W/) { chop($finalmainbodyfirstwords); }
1688 if (substr($finalmainbodyfirstwords, -1) eq / /) { chop($finalmainbodyfirstwords); }
1689 $entryreturn =~ s/{{entrymainbodyfirstwords ($firstwordscount)}}/$finalmainbodyfirstwords/isg;
1690 }
1691 }
1692 if ($entryreturn =~ m/{{entrymorebodyfirstwords (\d+)}}/i) {
1693 until ($entryreturn !~ m/{{entrymorebodyfirstwords (\d+)}}/isg) {
1694 $firstwordscount = $1;
1695 if ($thisentrymorebody eq "") {
1696 $entryreturn =~ s/{{entrymorebodyfirstwords ($firstwordscount)}}//isg;
1697 } else {
1698 $grabmorebodywords = $thisentrymorebody;
1699 if ($grabmorebodywords =~ m/{{link/i) {
1700 $grabmorebodywords =~ s/({{linkmo) (http|https|ftp)(:\/\/\S+?) (.+?)(\|)(.+?)(}})/$4/isg;
1701 $grabmorebodywords =~ s/({{link) (http|https|ftp)(:\/\/\S+?)(}})/$2$3/isg;
1702 $grabmorebodywords =~ s/({{link) (http|https|ftp)(:\/\/\S+?) (.+?)(}})/$4/isg;
1703###########################################################
1704# 9/2/2001 - CHERYL LAMBERT
1705# ADDED {{linkblank}} TEMPLATE VARIABLE SO THAT I CAN USE target="_blank" TO OPEN NEW WINDOWS
1706 $grabmorebodywords =~ s/({{linkblankmo) (http|https|ftp)(:\/\/\S+?) (.+?)(\|)(.+?)(}})/$4/isg;
1707 $grabmorebodywords =~ s/({{linkblank) (http|https|ftp)(:\/\/\S+?)(}})/$2$3/isg;
1708 $grabmorebodywords =~ s/({{linkblank) (http|https|ftp)(:\/\/\S+?) (.+?)(}})/$4/isg;
1709###########################################################
1710 }
1711 if ($grabmorebodywords =~ m/{{email/i) {
1712 $grabmorebodywords =~ s/({{emailmo) (\S+\@\S+?) (.+?)(\|)(.+?)(}})/$3/isg;
1713 $grabmorebodywords =~ s/({{email) (\S+\@\S+?)(}})/$2/isg;
1714 $grabmorebodywords =~ s/({{email) (\S+\@\S+?) (.+?)(}})/$3/isg;
1715 }
1716 $grabmorebodywords =~ s/<([^>]|\n)*>/ /g;
1717 $grabmorebodywords =~ s/{{(.*?)}}/ /g;
1718 $grabmorebodywords =~ s/\n/ /g;
1719 $grabmorebodywords =~ s/\r/ /g;
1720 $grabmorebodywords =~ s/\|\*\|/ /g;
1721 $grabmorebodywords =~ s/^\s+//;
1722 $grabmorebodywords =~ s/\s+$//;
1723 $grabmorebodywords =~ s/\s{2,}/ /g;
1724 @grabmorebodywordslist = split (/ /, $grabmorebodywords);
1725 $countwordsfromhere = 0;
1726 (@finalmorebodywordslist, @finalmorebodywordslist = ());
1727 if ($firstwordscount < 1) { $firstwordscount = 1; }
1728 do {
1729 $finalmorebodywordslist[$countwordsfromhere] = $grabmorebodywordslist[$countwordsfromhere];
1730 $countwordsfromhere++;
1731 } until $countwordsfromhere eq $firstwordscount;
1732 $finalmorebodyfirstwords = join (" ", @finalmorebodywordslist);
1733 $finalmorebodyfirstwords =~ s/^\s+//;
1734 $finalmorebodyfirstwords =~ s/\s+$//;
1735 $finalmorebodyfirstwords =~ s/\s{2,}//g;
1736 if (substr($finalmorebodyfirstwords, -1) =~ /\W/) { chop($finalmorebodyfirstwords); }
1737 if (substr($finalmorebodyfirstwords, -1) eq / /) { chop($finalmorebodyfirstwords); }
1738 $entryreturn =~ s/{{entrymorebodyfirstwords ($firstwordscount)}}/$finalmorebodyfirstwords/isg;
1739 }
1740 }
1741 }
1742}
1743
1744
1745if (($entryreturn =~ m/link}}/i) || ($entryreturn =~ m/{{morepreface}}/i)) {
1746 $entryreturn =~ s/{{morepreface}}/$thisentrymorepreface/gi;
1747 $entryreturn =~ s/{{morelink}}/$thisentrymorelink/gi;
1748 $entryreturn =~ s/{{karmalink}}/$thisentrykarmalink/gi;
1749 $entryreturn =~ s/{{commentslink}}/$thisentrycommentslink/gi;
1750 $entryreturn =~ s/{{pagelink}}/$thisentrypagelink/gi;
1751 $entryreturn =~ s/{{pageindexlink}}/$thisentrypageindexlink/gi;
1752 $entryreturn =~ s/{{pagearchiveindexlink}}/$thisentrypagearchiveindexlink/gi;
1753 $entryreturn =~ s/{{pagearchivelogindexlink}}/$thisentrypagearchivelogindexlink/gi;
1754 $entryreturn =~ s/{{pagesmartindexlink}}/$thisentrypagesmartindexlink/gi;
1755 $entryreturn =~ s/{{commentspostlink}}/$thisentrycommentspostlink/gi;
1756 $entryreturn =~ s/{{authorsmartlink}}/$thisentryauthorsmartlink/gi;
1757}
1758
1759if (($entryreturn =~ m/karma}}/i) || ($entryreturn =~ m/karmalink}}/i)) {
1760 $entryreturn =~ s/{{positivekarmalink}}/$thisentrypositivekarmalink/gi;
1761 $entryreturn =~ s/{{negativekarmalink}}/$thisentrynegativekarmalink/gi;
1762 $entryreturn =~ s/{{positivekarma}}/$thisentrypositivekarma/gi;
1763 $entryreturn =~ s/{{negativekarma}}/$thisentrynegativekarma/gi;
1764 $entryreturn =~ s/{{totalkarma}}/$thisentrytotalkarma/gi;
1765}
1766
1767# added in 1.3.1 : flipped cracker 1/18/2005
1768if ($entryreturn =~ m/{{smart/i) {
1769 # smartentrymusic and smartentrymood templates: linear 9/20/2003
1770 # merged in 1.3
1771 if ($thisentrymusic ne "") {
1772 $entryreturn =~ s/{{smartentrymusic}}/$gmsmartentrymusictemplate/gi;
1773 } else {
1774 $entryreturn =~ s/{{smartentrymusic}}//gi;
1775 }
1776 if ($thisentrymood ne "") {
1777 $entryreturn =~ s/{{smartentrymood}}/$gmsmartentrymoodtemplate/gi;
1778 } else {
1779 $entryreturn =~ s/{{smartentrymood}}//gi;
1780 }
1781 # merged 9/20/2003
1782}
1783# added 1/18/2005
1784if ($entryreturn =~ m/{{entry/i) {
1785 $entryreturn =~ s/{{entrysubject}}/$thisentrysubject/gi;
1786 ###########################################################
1787 # 9/3/2001 - CHERYL LAMBERT
1788 # ADDED 1 TEMPLATE VARIABLE SO THAT I CAN STRIP THE HTML CODE FROM THE ENTRYSUBJECT
1789 # WHEN IT IS USED IN THE <TITLE> TAG
1790 my $thisentrysubjectstripped = $thisentrysubject;
1791 $thisentrysubjectstripped =~ s/<.*?>//gi;
1792 $thisentrysubjectstripped =~ s/<\/.*?>//gi;
1793 $entryreturn =~ s/{{entrysubjectstripped}}/$thisentrysubjectstripped/gi;
1794 ###########################################################
1795 $entryreturn =~ s/{{entrynumber}}/$thisentrynumber/gi;
1796 $entryreturn =~ s/{{entrynumberpadded}}/$thisentrynumberpadded/gi;
1797
1798 # added by flipped cracker 09/12/03
1799 # version 1.3
1800 $entryreturn =~ s/{{entrymusic}}/$thisentrymusic/gi;
1801 $thisentrymood = &gm_emoticons($thisentrymood);
1802 $entryreturn =~ s/{{entrymood}}/$thisentrymood/gi;
1803 # end additions
1804}
1805if ($entryreturn =~ m/{{author/i) {
1806 $entryreturn =~ s/{{author}}/$thisentryauthor/gi;
1807 $entryreturn =~ s/{{authoremail}}/$thisentryauthoremail/gi;
1808 $entryreturn =~ s/{{authorhomepage}}/$thisentryauthorhomepage/gi;
1809 $entryreturn =~ s/{{authorentrycount}}/$thisentryauthorentrycount/gi;
1810}
1811
1812if (($entryreturn =~ m/{{authoremail /i) || ($entryreturn =~ m/{{authorhomepage /i) || ($entryreturn =~ m/{{authorentrycount /i) || ($entryreturn =~ m/{{authoremaillink /i) || ($entryreturn =~ m/{{authorhomepagelink /i) || ($entryreturn =~ m/{{authorsmartlink /i)) {
1813 &gm_generateexternalauthorvariables;
1814}
1815
1816if ($entryreturn =~ m/{{comments/i) {
1817 $entryreturn =~ s/{{commentstatussmart}}/$thisentrycommentstatussmart/gi;
1818 $entryreturn =~ s/{{commentstatussmartupper}}/$thisentrycommentstatussmartupper/gi;
1819 $entryreturn =~ s/{{commentstatussmartlower}}/$thisentrycommentstatussmartlower/gi;
1820 $entryreturn =~ s/{{commentsnumber}}/$thisentrycommentsnumber/gi;
1821}
1822
1823if (($entryreturn =~ m/{{day/i) || ($entryreturn =~ m/{{month/i) || ($entryreturn =~ m/{{year/i) || ($entryreturn =~ m/{{hour/i) || ($entryreturn =~ m/{{minute/i) || ($entryreturn =~ m/{{second/i) || ($entryreturn =~ m/{{weekday/i) || ($entryreturn =~ m/{{militaryhour}}/i) || ($entryreturn =~ m/{{ampm/i) || ($entryreturn =~ m/{{timezone}}/i)) {
1824 $entryreturn =~ s/{{day}}/$thisentryday/gi;
1825 $entryreturn =~ s/{{month}}/$thisentrymonth/gi;
1826 $entryreturn =~ s/{{year}}/$thisentryyear/gi;
1827 $entryreturn =~ s/{{hour}}/$thisentryhour/gi;
1828 $entryreturn =~ s/{{minute}}/$thisentryminute/gi;
1829 $entryreturn =~ s/{{second}}/$thisentrysecond/gi;
1830 $entryreturn =~ s/{{dayday}}/$thisentrydayday/gi;
1831 $entryreturn =~ s/{{monthmonth}}/$thisentrymonthmonth/gi;
1832 $entryreturn =~ s/{{yearyear}}/$thisentryyearyear/gi;
1833 $entryreturn =~ s/{{hourhour}}/$thisentryhourhour/gi;
1834 $entryreturn =~ s/{{minuteminute}}/$thisentryminuteminute/gi;
1835 $entryreturn =~ s/{{secondsecond}}/$thisentrysecondsecond/gi;
1836 $entryreturn =~ s/{{weekday}}/$thisentryweekday/gi;
1837 $entryreturn =~ s/{{weekdayshort}}/$thisentryweekdayshort/gi;
1838 $entryreturn =~ s/{{monthword}}/$thisentrymonthword/gi;
1839 $entryreturn =~ s/{{monthwordshort}}/$thisentrymonthwordshort/gi;
1840 $entryreturn =~ s/{{weekdayupper}}/$thisentryweekdayupper/gi;
1841 $entryreturn =~ s/{{monthwordupper}}/$thisentrymonthwordupper/gi;
1842 $entryreturn =~ s/{{weekdaylower}}/$thisentryweekdaylower/gi;
1843 $entryreturn =~ s/{{monthwordlower}}/$thisentrymonthwordlower/gi;
1844 $entryreturn =~ s/{{weekdayuppershort}}/$thisentryweekdayuppershort/gi;
1845 $entryreturn =~ s/{{monthworduppershort}}/$thisentrymonthworduppershort/gi;
1846 $entryreturn =~ s/{{weekdaylowershort}}/$thisentryweekdaylowershort/gi;
1847 $entryreturn =~ s/{{monthwordlowershort}}/$thisentrymonthwordlowershort/gi;
1848 $entryreturn =~ s/{{militaryhour}}/$thisentrymilitaryhour/gi;
1849 $entryreturn =~ s/{{ampm}}/$thisentryampm/gi;
1850 $entryreturn =~ s/{{ampmdot}}/$thisentryampmdot/gi;
1851 $entryreturn =~ s/{{ampmlower}}/$thisentryampmlower/gi;
1852 $entryreturn =~ s/{{ampmdotlower}}/$thisentryampmdotlower/gi;
1853 $entryreturn =~ s/{{timezone}}/$timezone/gi;
1854 # new ordinal numbers for {{dayappend}} variable: linear 9/15/2003
1855 # merged in 1.3
1856 $thisentrydayappend = &gm_toordinal($thisentryday);
1857 #merged 9/15/2003
1858 # new {{dayappend}} variable:: linear 9/15/2003
1859 # merged in 1.3
1860 $thisentrydayappend = &gm_toordinal($thisentryday);
1861 $entryreturn =~ s/{{dayappend}}/$thisentrydayappend/gi;
1862 # merged 9/15/2003
1863}
1864
1865if (($entryreturn =~ m/{{weekbeginning/i) || ($entryreturn =~ m/{{weekending/i)) {
1866 $entryreturn =~ s/{{weekbeginningday}}/$thisentryweekbeginningday/gi;
1867 $entryreturn =~ s/{{weekbeginningdayday}}/$thisentryweekbeginningdayday/gi;
1868 $entryreturn =~ s/{{weekbeginningmonth}}/$thisentryweekbeginningmonth/gi;
1869 $entryreturn =~ s/{{weekbeginningmonthmonth}}/$thisentryweekbeginningmonthmonth/gi;
1870 $entryreturn =~ s/{{weekbeginningyear}}/$thisentryweekbeginningyear/gi;
1871 $entryreturn =~ s/{{weekbeginningyearyear}}/$thisentryweekbeginningyearyear/gi;
1872 $entryreturn =~ s/{{weekbeginningweekday}}/$thisentryweekbeginningweekday/gi;
1873 $entryreturn =~ s/{{weekbeginningweekdayshort}}/$thisentryweekbeginningweekdayshort/gi;
1874 $entryreturn =~ s/{{weekbeginningmonthword}}/$thisentryweekbeginningmonthword/gi;
1875 $entryreturn =~ s/{{weekbeginningmonthwordshort}}/$thisentryweekbeginningmonthwordshort/gi;
1876 $entryreturn =~ s/{{weekbeginningweekdayupper}}/$thisentryweekbeginningweekdayupper/gi;
1877 $entryreturn =~ s/{{weekbeginningmonthwordupper}}/$thisentryweekbeginningmonthwordupper/gi;
1878 $entryreturn =~ s/{{weekbeginningweekdaylower}}/$thisentryweekbeginningweekdaylower/gi;
1879 $entryreturn =~ s/{{weekbeginningmonthwordlower}}/$thisentryweekbeginningmonthwordlower/gi;
1880 $entryreturn =~ s/{{weekbeginningweekdayuppershort}}/$thisentryweekbeginningweekdayuppershort/gi;
1881 $entryreturn =~ s/{{weekbeginningmonthworduppershort}}/$thisentryweekbeginningmonthworduppershort/gi;
1882 $entryreturn =~ s/{{weekbeginningweekdaylowershort}}/$thisentryweekbeginningweekdaylowershort/gi;
1883 $entryreturn =~ s/{{weekbeginningmonthwordlowershort}}/$thisentryweekbeginningmonthwordlowershort/gi;
1884 $entryreturn =~ s/{{weekendingday}}/$thisentryweekendingday/gi;
1885 $entryreturn =~ s/{{weekendingdayday}}/$thisentryweekendingdayday/gi;
1886 $entryreturn =~ s/{{weekendingmonth}}/$thisentryweekendingmonth/gi;
1887 $entryreturn =~ s/{{weekendingmonthmonth}}/$thisentryweekendingmonthmonth/gi;
1888 $entryreturn =~ s/{{weekendingyear}}/$thisentryweekendingyear/gi;
1889 $entryreturn =~ s/{{weekendingyearyear}}/$thisentryweekendingyearyear/gi;
1890 $entryreturn =~ s/{{weekendingweekday}}/$thisentryweekendingweekday/gi;
1891 $entryreturn =~ s/{{weekendingweekdayshort}}/$thisentryweekendingweekdayshort/gi;
1892 $entryreturn =~ s/{{weekendingmonthword}}/$thisentryweekendingmonthword/gi;
1893 $entryreturn =~ s/{{weekendingmonthwordshort}}/$thisentryweekendingmonthwordshort/gi;
1894 $entryreturn =~ s/{{weekendingweekdayupper}}/$thisentryweekendingweekdayupper/gi;
1895 $entryreturn =~ s/{{weekendingmonthwordupper}}/$thisentryweekendingmonthwordupper/gi;
1896 $entryreturn =~ s/{{weekendingweekdaylower}}/$thisentryweekendingweekdaylower/gi;
1897 $entryreturn =~ s/{{weekendingmonthwordlower}}/$thisentryweekendingmonthwordlower/gi;
1898 $entryreturn =~ s/{{weekendingweekdayuppershort}}/$thisentryweekendingweekdayuppershort/gi;
1899 $entryreturn =~ s/{{weekendingmonthworduppershort}}/$thisentryweekendingmonthworduppershort/gi;
1900 $entryreturn =~ s/{{weekendingweekdaylowershort}}/$thisentryweekendingweekdaylowershort/gi;
1901 $entryreturn =~ s/{{weekendingmonthwordlowershort}}/$thisentryweekendingmonthwordlowershort/gi;
1902}
1903
1904if ($entryreturn =~ m/{{link/i) {
1905 $entryreturn =~ s/({{linkmo) (http|https|ftp)(:\/\/\S+?) (.+?)(\|)(.+?)(}})/<a href="$2$3" onmouseover="window.status='$6';return true" onmouseout="window.status='';return true">$4<\/a>/isg;
1906 $entryreturn =~ s/({{link) (http|https|ftp)(:\/\/\S+?)(}})/<a href="$2$3">$2$3<\/a>/isg;
1907 $entryreturn =~ s/({{link) (http|https|ftp)(:\/\/\S+?) (.+?)(}})/<a href="$2$3">$4<\/a>/isg;
1908 ###########################################################
1909 # 9/2/2001 - CHERYL LAMBERT
1910 # ADDED {{linkblank}} TEMPLATE VARIABLE SO THAT I CAN USE target="_blank" TO OPEN NEW WINDOWS
1911 $entryreturn =~ s/({{linkblankmo) (http|https|ftp)(:\/\/\S+?) (.+?)(\|)(.+?)(}})/<A HREF="$2$3" onMouseOver="window.status='$6';return true" onMouseOut="window.status='';return true" target="_blank">$4<\/A>/isg;
1912 $entryreturn =~ s/({{linkblank) (http|https|ftp)(:\/\/\S+?)(}})/<A HREF="$2$3" target="_blank">$2$3<\/A>/isg;
1913 $entryreturn =~ s/({{linkblank) (http|https|ftp)(:\/\/\S+?) (.+?)(}})/<A HREF="$2$3" target="_blank">$4<\/A>/isg;
1914 ###########################################################
1915}
1916
1917if ($entryreturn =~ m/{{email/i) {
1918 $entryreturn =~ s/({{emailmo) (\S+\@\S+?) (.+?)(\|)(.+?)(}})/<a href="mailto:$2" onmouseover="window.status='$5';return true" onmouseout="window.status='';return true">$3<\/>/isg;
1919 $entryreturn =~ s/({{email) (\S+\@\S+?)(}})/<a href="mailto:$2">$2<\/a>/isg;
1920 $entryreturn =~ s/({{email) (\S+\@\S+?) (.+?)(}})/<a href="mailto:$2">$3<\/a>/isg;
1921}
1922
1923if ($entryreturn =~ m/{{popup (\S+) (.+?) (\d+)x(\d+)}}/i) {
1924 until ($entryreturn !~ m/{{popup (\S+) (.+?) (\d+)x(\d+)}}/isg) {
1925
1926 $popupfile = $1;
1927 $popuptitle = $2;
1928 $popupwidth = $3;
1929 $popupheight = $4;
1930 $popuphtmlfile = $1;
1931 $popuphtmlfile =~ s/\.(\S+)$//;
1932 $popuphtmlfile .= ".$entrysuffix";
1933 $popuppage = $gmpopuppagetemplate;
1934 $popupcode = $gmpopupcodetemplate;
1935 $popuppage =~ s/{{popupfile}}/$popupfile/gi;
1936 $popuppage =~ s/{{popuphtmlfile}}/$popuphtmlfile/gi;
1937 $popuppage =~ s/{{popuptitle}}/$popuptitle/gi;
1938 $popuppage =~ s/{{popupwidth}}/$popupwidth/gi;
1939 $popuppage =~ s/{{popupheight}}/$popupheight/gi;
1940 $popupcode =~ s/{{popupfile}}/$popupfile/gi;
1941 $popupcode =~ s/{{popuphtmlfile}}/$popuphtmlfile/gi;
1942 $popupcode =~ s/{{popuptitle}}/$popuptitle/gi;
1943 $popupcode =~ s/{{popupwidth}}/$popupwidth/gi;
1944 $popupcode =~ s/{{popupheight}}/$popupheight/gi;
1945 $popuppage =~ s/{{cgiwebpath}}/$cgiwebpath/gi;
1946 $popuppage =~ s/{{entrieswebpath}}/$EntriesWebPath/gi;
1947 $popuppage =~ s/{{logwebpath}}/$LogWebPath/gi;
1948 $popuppage =~ s/{{emoticonspath}}/$emoticonspath/gi;
1949
1950 open (FUNNYFEETWAGS, "./gm-entrylist.cgi") || &gm_dangermouse("Can't read the entry list file. Please make sure that gm-entrylist.cgi is in the same directory as all your other Greymatter files and is CHMODed to 666; also, try running Diagnostics & Repair in the Configuration screen.");
1951 @loglistloglines = <FUNNYFEETWAGS>;
1952 close (FUNNYFEETWAGS);
1953
1954 $foundpopupmatch = "no";
1955
1956 foreach $thisloglistline (@loglistloglines) {
1957 chomp ($thisloglistline);
1958 ($loglistnumber, $loglistauthor, $loglistsubject, $loglistdate, $loglisttimeampm, $loglistopenstatus, $loglistmorestatus) = split (/\|/, $thisloglistline);
1959 if (($thisentrynumber eq $loglistnumber) && ($foundpopupmatch eq "no")) {
1960 &gm_getloglistvariables;
1961 $foundpopupmatch = "yes";
1962 }
1963 }
1964
1965 $listsubsub = $popuppage;
1966 &entrylistsubsub;
1967
1968 open (POPUPVIDEO, ">$EntriesPath/$popuphtmlfile") || &gm_dangermouse("Can't write to $EntriesPath/$popuphtmlfile. Please make sure your entries/archives directory is correctly set and is CHMODed to 777; also, try running Diagnostics & Repair in the Configuration screen.");
1969 print POPUPVIDEO $listsubsub;
1970 close (POPUPVIDEO);
1971
1972 $listsubsub = $popupcode;
1973 &entrylistsubsub;
1974
1975 $entryreturn =~ s/{{popup $popupfile $popuptitle ($popupwidth)x($popupheight)}}/$listsubsub/isg;
1976
1977 }
1978}
1979
1980if (($entryreturn =~ m/{{previous/i) || ($entryreturn =~ m/{{next/i)) {
1981
1982 open (FUNNYFEETSCRATCH, "./gm-entrylist.cgi") || &gm_dangermouse("Can't read the entry list file. Please make sure that gm-entrylist.cgi is in the same directory as all your other Greymatter files and is CHMODed to 666; also, try running Diagnostics & Repair in the Configuration screen.");
1983 @checkingloglistloglines = <FUNNYFEETSCRATCH>;
1984 close (FUNNYFEETSCRATCH);
1985
1986 $entryreturn =~ s/{{previousmore/{{moreprevious/isg;
1987 $entryreturn =~ s/{{nextmore/{{morenext/isg;
1988
1989 if ($thisentrynumber ne "1") {
1990 $thispreviousentrynumber = $thisentrynumber - 1;
1991 $foundregular = "no";
1992 $foundmore = "no";
1993 $foundboth = "no";
1994 do {
1995
1996 foreach $thisloglistline (@checkingloglistloglines) {
1997 chomp ($thisloglistline);
1998 ($loglistnumber, $loglistauthor, $loglistsubject, $loglistdate, $loglisttimeampm, $loglistopenstatus, $loglistmorestatus) = split (/\|/, $thisloglistline);
1999 if (($thispreviousentrynumber eq $loglistnumber) && ($loglistnumber < $thisentrynumber) && ($foundregular eq "no") && ($loglistopenstatus ne "C")) {
2000 $entryreturn =~ s/{{previouslink}}/$gmpreviouslinktemplate/isg;
2001 &gm_getloglistvariables;
2002 $listsubsub = $entryreturn;
2003 $listsubsub =~ s/{{previous/{{/isg;
2004 &entrylistsubsub;
2005 $entryreturn = $listsubsub;
2006 $foundregular = "yes";
2007 }
2008 if (($thispreviousentrynumber eq $loglistnumber) && ($loglistmorestatus eq "Y") && ($loglistnumber < $thisentrynumber) && ($foundmore eq "no") && ($loglistopenstatus ne "C")) {
2009 $entryreturn =~ s/{{morepreviouslink}}/$gmpreviousmorelinktemplate/isg;
2010 $entryreturn =~ s/{{previousmore/{{moreprevious/isg;
2011 &gm_getloglistvariables;
2012 $listsubsub = $entryreturn;
2013 $listsubsub =~ s/{{moreprevious/{{/isg;
2014 &entrylistsubsub;
2015 $entryreturn = $listsubsub;
2016 $foundmore = "yes";
2017 }
2018 }
2019
2020 if (($foundregular eq "yes") && ($foundmore eq "yes")) { $foundboth = "yes"; }
2021 if ($thispreviousentrynumber eq "1") { $foundboth = "yes"; }
2022 $thispreviousentrynumber--;
2023
2024 } until $foundboth eq "yes";
2025 }
2026
2027 if ($thisentrynumber ne $newentrynumber) {
2028 @checkingloglistloglines = reverse @checkingloglistloglines;
2029 $thisnextentrynumber = $thisentrynumber + 1;
2030 $foundregular = "no";
2031 $foundmore = "no";
2032 $foundboth = "no";
2033 do {
2034
2035 foreach $thisloglistline (@checkingloglistloglines) {
2036 chomp ($thisloglistline);
2037 ($loglistnumber, $loglistauthor, $loglistsubject, $loglistdate, $loglisttimeampm, $loglistopenstatus, $loglistmorestatus) = split (/\|/, $thisloglistline);
2038 if (($thisnextentrynumber eq $loglistnumber) && ($loglistnumber > $thisentrynumber) && ($foundregular eq "no") && ($loglistopenstatus ne "C")) {
2039 $entryreturn =~ s/{{nextlink}}/$gmnextlinktemplate/isg;
2040 &gm_getloglistvariables;
2041 $listsubsub = $entryreturn;
2042 $listsubsub =~ s/{{next/{{/isg;
2043 &entrylistsubsub;
2044 $entryreturn = $listsubsub;
2045 $foundregular = "yes";
2046 }
2047 if (($thisnextentrynumber eq $loglistnumber) && ($loglistmorestatus eq "Y") && ($loglistnumber > $thisentrynumber) && ($foundmore eq "no") && ($loglistopenstatus ne "C")) {
2048 $entryreturn =~ s/{{morenextlink}}/$gmnextmorelinktemplate/isg;
2049 $entryreturn =~ s/{{nextmore/{{morenext/isg;
2050 &gm_getloglistvariables;
2051 $listsubsub = $entryreturn;
2052 $listsubsub =~ s/{{morenext/{{/isg;
2053 &entrylistsubsub;
2054 $entryreturn = $listsubsub;
2055 $foundmore = "yes";
2056 }
2057 }
2058
2059 if (($foundregular eq "yes") && ($foundmore eq "yes")) { $foundboth = "yes"; }
2060 if ($thisnextentrynumber eq $newentrynumber) { $foundboth = "yes"; }
2061 $thisnextentrynumber++;
2062
2063 } until $foundboth eq "yes";
2064 }
2065
2066 $entryreturn =~ s/{{previouspagelink}}/$thisentrypagesmartindexlink/isg;
2067 $entryreturn =~ s/{{nextpagelink}}/$thisentrypagesmartindexlink/isg;
2068 $entryreturn =~ s/{{previousmorepagelink}}/$thisentrypagesmartindexlink/isg;
2069 $entryreturn =~ s/{{nextmorepagelink}}/$thisentrypagesmartindexlink/isg;
2070 $entryreturn =~ s/{{morepreviouspagelink}}/$thisentrypagesmartindexlink/isg;
2071 $entryreturn =~ s/{{morenextpagelink}}/$thisentrypagesmartindexlink/isg;
2072 $entryreturn =~ s/{{previouslink}}//isg;
2073 $entryreturn =~ s/{{nextlink}}//isg;
2074
2075 if (($entryreturn =~ m/{{previous/i) || ($entryreturn =~ m/{{next/i)) {
2076 foreach $thisloglistline (@checkingloglistloglines) {
2077 chomp ($thisloglistline);
2078 ($loglistnumber, $loglistauthor, $loglistsubject, $loglistdate, $loglisttimeampm, $loglistopenstatus, $loglistmorestatus) = split (/\|/, $thisloglistline);
2079 if ($loglistnumber eq $thisentrynumber) {
2080 &gm_getloglistvariables;
2081 $listsubsub = $entryreturn;
2082 $listsubsub =~ s/{{previous/{{/isg;
2083 $listsubsub =~ s/{{next/{{/isg;
2084 &entrylistsubsub;
2085 $entryreturn = $listsubsub;
2086 }
2087 }
2088 }
2089
2090 $entryreturn =~ s/{{morepagelink}}/$thisentrypagesmartindexlink/isg;
2091
2092}
2093
2094
2095# enhanced escaping of metacharacters: linear 8/25/2003
2096# merged in 1.3
2097if ($entryreturn =~ m/window.status='(.*?)';/i) {
2098 $entryreturn =~ s/\(/GMLEFTPARENTHESES/g;
2099 $entryreturn =~ s/\)/GMRIGHTPARENTHESES/g;
2100 $entryreturn =~ s/\?/GMQUESTIONMARK/g;
2101 $entryreturn =~ s/\+/GMPLUS/g;
2102 $entryreturn =~ s/\[/GMLEFTSQUAREBRACKET/g;
2103 $entryreturn =~ s/\]/GMRIGHTSQUAREBRACKET/g;
2104 $entryreturn =~ s/\$/GMDOLLAR/g;
2105 $entryreturn =~ s/\^/GMCARET/g;
2106 $entryreturn =~ s/\|/GMPIPE/g;
2107 $entryreturn =~ s/\*/GMSPLAT/g;
2108 until ($entryreturn !~ m/window.status='(.*?)';/ig) {
2109 $windowstatusorigstring = $1;
2110 $windowstatusmiddlenew = $1;
2111 $windowstatusmiddlenew =~ s#'#\\'#isg;
2112 $windowstatusmiddlenew =~ s#"#\\'#isg;
2113 $entryreturn =~ s/window.status='$windowstatusorigstring';/WSPLACEHOLDER='$windowstatusmiddlenew';/isg;
2114 }
2115 $entryreturn =~ s/WSPLACEHOLDER=/window.status=/isg;
2116 $entryreturn =~ s/GMLEFTPARENTHESES/\(/g;
2117 $entryreturn =~ s/GMRIGHTPARENTHESES/\)/g;
2118 $entryreturn =~ s/GMQUESTIONMARK/\?/g;
2119 $entryreturn =~ s/GMPLUS/\+/g;
2120 $entryreturn =~ s/GMLEFTSQUAREBRACKET/\[/g;
2121 $entryreturn =~ s/GMRIGHTSQUAREBRACKET/\]/g;
2122 $entryreturn =~ s/GMDOLLAR/\$/g;
2123 $entryreturn =~ s/GMCARET/\^/g;
2124 $entryreturn =~ s/GMPIPE/\|/g;
2125 $entryreturn =~ s/GMSPLAT/\*/g;
2126
2127}
2128# merged 9/11/2003
2129
2130if ($entryreturn =~ m/{{randomnumber (\d+)-(\d+)}}/i) {
2131 until ($entryreturn !~ m/{{randomnumber (\d+)-(\d+)}}/isg) {
2132 $minrand = $1;
2133 $maxrand = $2;
2134 $maxtemprand = $maxrand - $minrand;
2135 $maxtemprand++;
2136 $randresult = int(rand $maxtemprand) + $minrand;
2137 $entryreturn =~ s/{{randomnumber ($minrand)-($maxrand)}}/$randresult/i;
2138 }
2139}
2140
2141if (($entryreturn =~ m/{{cgiwebpath}}/i) || ($entryreturn =~ m/{{entrieswebpath}}/i) || ($entryreturn =~ m/{{logwebpath}}/i) || ($entryreturn =~ m/{{emoticonspath}}/i)) {
2142 $entryreturn =~ s/{{cgiwebpath}}/$cgiwebpath/gi;
2143 $entryreturn =~ s/{{entrieswebpath}}/$EntriesWebPath/gi;
2144 $entryreturn =~ s/{{logwebpath}}/$LogWebPath/gi;
2145 $entryreturn =~ s/{{emoticonspath}}/$emoticonspath/gi;
2146}
2147
2148if (($entryreturn =~ m/{{gmversion}}/i) || ($entryreturn =~ m/{{gmicon}}/i)) {
2149 $entryreturn =~ s/{{gmversion}}/$gmversion/gi;
2150 $entryreturn =~ s/{{gmicon}}/<a href="http:\/\/www.greymatterforums.com\/" target="_top"><img border="0" src="$LogWebPath\/gm-icon.gif" alt="Powered By Greymatter" \/><\/a>/gi;
2151}
2152# new {{cookiescode}} template to facilitate setting cookies on commenters: linear 9/23/2003
2153# merged in 1.3
2154$entryreturn =~ s/{{cookiescode}}/$gmcookiescodetemplate/gi;
2155# merged 9/23/2003
2156# added by flipped cracker 09/12/03
2157# version 1.3
2158$entryreturn =~ s/{{emoticonspath}}/$emoticonspath/gi;
2159$entryreturn =~ s/{{entrysuffix}}/$entrysuffix/gi;
2160$entryreturn =~ s/{{archivesuffix}}/$logarchivesuffix/gi;
2161$entryreturn =~ s/{{domain}}/$domain/gi;
2162# end additions
2163
2164# added by flipped cracker 1/26/05
2165# version 1.3.1
2166$entryreturn =~ s/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w{1,8});)/&/g;
2167# end additions
2168}
2169
2170# ----------------------------
2171# generate the main index file
2172# ----------------------------
2173
2174sub gm_generatemainindex {
2175
2176&gm_readconfig;
2177&gm_readcounter;
2178&gm_readtemplates;
2179
2180$indexlogbody = "";
2181$indexentrycounter = $newentrynumber;
2182$indexcurrentdatemarker = "erewhon";
2183$indexcurrentdatescounted = 0;
2184
2185if ($newstayattopnumber ne "0") {
2186 &gm_getentryvariables($newstayattopnumber);
2187 if ($thisentryopenstatus eq "open") {
2188 &gm_formatentry($gmstayattoptemplate);
2189 $indexlogbody .= $entryreturn;
2190 }
2191}
2192
2193do {
2194
2195&gm_getentryvariables($indexentrycounter);
2196
2197$datemark = "$thisentrymonth $thisentryday $thisentryyearyear";
2198
2199if (($datemark ne $indexcurrentdatemarker) && ($thisentryopenstatus eq "open") && ($indexentrycounter ne $newstayattopnumber)) {
2200 $indexcurrentdatescounted++;
2201 if ($gmdatetemplate ne "") {
2202 $currentdatehead = $gmdatetemplate;
2203 $currentdatehead =~ s/{{day}}/$thisentryday/gi;
2204 $currentdatehead =~ s/{{dayday}}/$thisentrydayday/gi;
2205 $currentdatehead =~ s/{{year}}/$thisentryyear/gi;
2206 $currentdatehead =~ s/{{yearyear}}/$thisentryyearyear/gi;
2207 $currentdatehead =~ s/{{month}}/$thisentrymonth/gi;
2208 $currentdatehead =~ s/{{monthmonth}}/$thisentrymonthmonth/gi;
2209 $currentdatehead =~ s/{{weekday}}/$thisentryweekday/gi;
2210 $currentdatehead =~ s/{{weekdayshort}}/$thisentryweekdayshort/gi;
2211 $currentdatehead =~ s/{{monthword}}/$thisentrymonthword/gi;
2212 $currentdatehead =~ s/{{monthwordshort}}/$thisentrymonthwordshort/gi;
2213 $currentdatehead =~ s/{{weekdayupper}}/$thisentryweekdayupper/gi;
2214 $currentdatehead =~ s/{{monthwordupper}}/$thisentrymonthwordupper/gi;
2215 $currentdatehead =~ s/{{weekdaylower}}/$thisentryweekdaylower/gi;
2216 $currentdatehead =~ s/{{monthwordlower}}/$thisentrymonthwordlower/gi;
2217 $currentdatehead =~ s/{{weekdayuppershort}}/$thisentryweekdayuppershort/gi;
2218 $currentdatehead =~ s/{{monthworduppershort}}/$thisentrymonthworduppershort/gi;
2219 $currentdatehead =~ s/{{weekdaylowershort}}/$thisentryweekdaylowershort/gi;
2220 $currentdatehead =~ s/{{monthwordlowershort}}/$thisentrymonthwordlowershort/gi;
2221 # new {{dayappend}} variable: linear 9/15/2003
2222 # merged in 1.3
2223 $thisentrydayappend = &gm_toordinal($thisentryday);
2224 $currentdatehead =~ s/{{dayappend}}/$thisentrydayappend/gi;
2225 # merged 9/15/2003
2226 unless ($indexcurrentdatescounted > $indexdays)
2227 {
2228 $indexlogbody .= $currentdatehead;
2229 # added new $dategrouping flag : 1.3.1
2230 # flipped cracker 6/29/2004
2231 $dategrouping = "open";
2232 }
2233 }
2234 $indexcurrentdatemarker = "$thisentrymonth $thisentryday $thisentryyearyear";
2235} else {
2236 if (($indexentrycounter ne $newstayattopnumber) && ($thisentryopenstatus eq "open") && ($indexcurrentdatescounted <= $indexdays) && ($gmentryseparatortemplate ne "")) {
2237 $indexlogbody .= $gmentryseparatortemplate;
2238 }
2239}
2240
2241if (($indexentrycounter ne $newstayattopnumber) && ($thisentryopenstatus eq "open") && ($indexcurrentdatescounted <= $indexdays)) {
2242 if ($thisentrymorebody ne "") {
2243 &gm_formatentry($gmmoreentrytemplate);
2244 } else {
2245 &gm_formatentry($gmentrytemplate);
2246 }
2247 $indexlogbody .= $entryreturn;
2248}
2249
2250# new date grouping footer template in 1.3: linear 9/18/2003
2251# merged in 1.3
2252if ($indexentrycounter > 1) {
2253 &gm_getentryvariables($indexentrycounter - 1); # look at the last open entry
2254 $nextdatemark = "$thisentrymonth $thisentryday $thisentryyearyear";
2255 $nextentryopenstatus = $thisentryopenstatus;
2256 &gm_getentryvariables($indexentrycounter); # look at the current entry again
2257# this logic was in error, fixed in 1.3.1 linear 2/19/2004
2258# also fixed by flipped cracker 6/29/2004
2259# added $dategrouping flag checking
2260# merged in 1.3.1
2261#
2262 if (($nextdatemark ne $indexcurrentdatemarker) && ($dategrouping eq "open") && ($nextentryopenstatus eq "open") && ($indexentrycounter ne $newstayattopnumber)) {
2263# if (($nextdatemark ne $indexcurrentdatemarker) && ($thisentryopenstatus eq "open") && ($indexentrycounter ne $newstayattopnumber)) {
2264# merged 2/19/2004
2265 if ($gmdategroupingfootertemplate ne "") {
2266 $currentdatefoot = $gmdategroupingfootertemplate;
2267 $currentdatefoot =~ s/{{day}}/$thisentryday/gi;
2268 $currentdatefoot =~ s/{{dayday}}/$thisentrydayday/gi;
2269 $currentdatefoot =~ s/{{year}}/$thisentryyear/gi;
2270 $currentdatefoot =~ s/{{yearyear}}/$thisentryyearyear/gi;
2271 $currentdatefoot =~ s/{{month}}/$thisentrymonth/gi;
2272 $currentdatefoot =~ s/{{monthmonth}}/$thisentrymonthmonth/gi;
2273 $currentdatefoot =~ s/{{weekday}}/$thisentryweekday/gi;
2274 $currentdatefoot =~ s/{{weekdayshort}}/$thisentryweekdayshort/gi;
2275 $currentdatefoot =~ s/{{monthword}}/$thisentrymonthword/gi;
2276 $currentdatefoot =~ s/{{monthwordshort}}/$thisentrymonthwordshort/gi;
2277 $currentdatefoot =~ s/{{weekdayupper}}/$thisentryweekdayupper/gi;
2278 $currentdatefoot =~ s/{{monthwordupper}}/$thisentrymonthwordupper/gi;
2279 $currentdatefoot =~ s/{{weekdaylower}}/$thisentryweekdaylower/gi;
2280 $currentdatefoot =~ s/{{monthwordlower}}/$thisentrymonthwordlower/gi;
2281 $currentdatefoot =~ s/{{weekdayuppershort}}/$thisentryweekdayuppershort/gi;
2282 $currentdatefoot =~ s/{{monthworduppershort}}/$thisentrymonthworduppershort/gi;
2283 $currentdatefoot =~ s/{{weekdaylowershort}}/$thisentryweekdaylowershort/gi;
2284 $currentdatefoot =~ s/{{monthwordlowershort}}/$thisentrymonthwordlowershort/gi;
2285 # new {{dayappend}} variable: linear 9/15/2003
2286 # merged in 1.3
2287 $thisentrydayappend = &gm_toordinal($thisentryday);
2288 $currentdatefoot =~ s/{{dayappend}}/$thisentrydayappend/gi;
2289 # merged 9/15/2003
2290 unless ($indexcurrentdatescounted > $indexdays)
2291 {
2292 $indexlogbody .= $currentdatefoot;
2293 # added $dategrouping flag : 1.3.1
2294 # flipped cracker 6/29/2004
2295 $dategrouping = "closed";
2296 }
2297 }
2298 }
2299}
2300# merged 9/18/2003
2301$indexentrycounter--;
2302
2303if ($indexentrycounter eq "0") {
2304 if ($indexcurrentdatescounted > $indexdays) { $indexentrycounter++; }
2305 $indexcurrentdatescounted = $indexdays + 1;
2306}
2307
2308if (($newstayattopnumber eq "1") && ($newentrynumber eq "1")) { $indexcurrentdatescounted = $indexdays + 1; }
2309
2310if ($indexcurrentdatescounted > $indexdays) {
2311 if ($indexentrycounter < 0) { $indexentrycounter = 0; }
2312 unless ($indexentrycounter eq "0") { $indexentrycounter = $thisentrynumber; }
2313}
2314
2315} until $indexcurrentdatescounted > $indexdays;
2316
2317# added $dategrouping flag checking : 1.3.1
2318# flipped cracker 6/29/2004
2319if ( ($gmdategroupingfootertemplate ne "") && ($dategrouping eq "open") ) {
2320 $currentdatefoot = $gmdategroupingfootertemplate;
2321 $currentdatefoot =~ s/{{day}}/$thisentryday/gi;
2322 $currentdatefoot =~ s/{{dayday}}/$thisentrydayday/gi;
2323 $currentdatefoot =~ s/{{year}}/$thisentryyear/gi;
2324 $currentdatefoot =~ s/{{yearyear}}/$thisentryyearyear/gi;
2325 $currentdatefoot =~ s/{{month}}/$thisentrymonth/gi;
2326 $currentdatefoot =~ s/{{monthmonth}}/$thisentrymonthmonth/gi;
2327 $currentdatefoot =~ s/{{weekday}}/$thisentryweekday/gi;
2328 $currentdatefoot =~ s/{{weekdayshort}}/$thisentryweekdayshort/gi;
2329 $currentdatefoot =~ s/{{monthword}}/$thisentrymonthword/gi;
2330 $currentdatefoot =~ s/{{monthwordshort}}/$thisentrymonthwordshort/gi;
2331 $currentdatefoot =~ s/{{weekdayupper}}/$thisentryweekdayupper/gi;
2332 $currentdatefoot =~ s/{{monthwordupper}}/$thisentrymonthwordupper/gi;
2333 $currentdatefoot =~ s/{{weekdaylower}}/$thisentryweekdaylower/gi;
2334 $currentdatefoot =~ s/{{monthwordlower}}/$thisentrymonthwordlower/gi;
2335 $currentdatefoot =~ s/{{weekdayuppershort}}/$thisentryweekdayuppershort/gi;
2336 $currentdatefoot =~ s/{{monthworduppershort}}/$thisentrymonthworduppershort/gi;
2337 $currentdatefoot =~ s/{{weekdaylowershort}}/$thisentryweekdaylowershort/gi;
2338 $currentdatefoot =~ s/{{monthwordlowershort}}/$thisentrymonthwordlowershort/gi;
2339 # new {{dayappend}} variable: linear 9/15/2003
2340 # merged in 1.3
2341 $thisentrydayappend = &gm_toordinal($thisentryday);
2342 $currentdatefoot =~ s/{{dayappend}}/$thisentrydayappend/gi;
2343 # merged 9/15/2003
2344 $indexlogbody .= $currentdatefoot;
2345 # added $dategrouping flag : 1.3.1
2346 # flipped cracker 6/29/2004
2347 $dategrouping = "closed";
2348}
2349
2350$newindexfile = $gmindextemplate;
2351$newindexfile =~ s/{{logbody}}/$indexlogbody/gi;
2352
2353&gm_getentryvariables($newentrynumber);
2354&gm_formatentry($newindexfile);
2355
2356open (THISFILECLAWS, ">$LogPath/$indexfilename") || &gm_dangermouse("Can't write to $LogPath/$indexfilename. Please make sure your paths are configured correctly and that $indexfilename is CHMODed to 666; also try running Diagnostics & Repair from the Configuration screen.");
2357print THISFILECLAWS $entryreturn;
2358close (THISFILECLAWS);
2359
2360$newarchivenumber = $indexentrycounter;
2361
2362&gm_writecounter;
2363
2364}
2365
2366# ---------------------
2367# generate archive file
2368# ---------------------
2369
2370sub gm_generatearchive {
2371
2372my $getstartnumber = shift;
2373
2374$startnumber = $getstartnumber;
2375
2376&gm_readconfig;
2377&gm_readcounter;
2378&gm_readtemplates;
2379
2380$indexarchivebody = "";
2381$indexentrycounter = $startnumber;
2382$indexcurrentdatemarker = "erewhon";
2383$indexcurrentdatescounted = 0;
2384&gm_getentryvariables($startnumber);
2385$indexcurrentmonthcounter = $thisentrymonth;
2386$indexcurrentweekcounter = "$thisentryweekbeginningdayday$thisentryweekendingdayday";
2387
2388do {
2389
2390&gm_getentryvariables($indexentrycounter);
2391
2392$thisentryweek = "$thisentryweekbeginningdayday$thisentryweekendingdayday";
2393
2394if (($generateentrypages eq "yes") && ($indexentrycounter eq $newarchivenumber)) {
2395 if ($thisentryopenstatus eq "open") {
2396 &gm_formatentry($gmarchiveentrypagetemplate);
2397 open (THISFILE, ">$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.");
2398 print THISFILE $entryreturn;
2399 close (THISFILE);
2400 } else {
2401 unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix");
2402 }
2403}
2404
2405$datemark = "$thisentrymonth $thisentryday $thisentryyearyear";
2406
2407if (($datemark ne $indexcurrentdatemarker) && ($thisentryopenstatus eq "open") && ($indexentrycounter ne $newstayattopnumber)) {
2408 $indexcurrentdatescounted++;
2409 if ($gmdatearchivetemplate ne "") {
2410 $currentdatehead = $gmdatearchivetemplate;
2411 $currentdatehead =~ s/{{day}}/$thisentryday/gi;
2412 $currentdatehead =~ s/{{dayday}}/$thisentrydayday/gi;
2413 $currentdatehead =~ s/{{year}}/$thisentryyear/gi;
2414 $currentdatehead =~ s/{{yearyear}}/$thisentryyearyear/gi;
2415 $currentdatehead =~ s/{{month}}/$thisentrymonth/gi;
2416 $currentdatehead =~ s/{{monthmonth}}/$thisentrymonthmonth/gi;
2417 $currentdatehead =~ s/{{weekday}}/$thisentryweekday/gi;
2418 $currentdatehead =~ s/{{weekdayshort}}/$thisentryweekdayshort/gi;
2419 $currentdatehead =~ s/{{monthword}}/$thisentrymonthword/gi;
2420 $currentdatehead =~ s/{{monthwordshort}}/$thisentrymonthwordshort/gi;
2421 $currentdatehead =~ s/{{weekdayupper}}/$thisentryweekdayupper/gi;
2422 $currentdatehead =~ s/{{monthwordupper}}/$thisentrymonthwordupper/gi;
2423 $currentdatehead =~ s/{{weekdaylower}}/$thisentryweekdaylower/gi;
2424 $currentdatehead =~ s/{{monthwordlower}}/$thisentrymonthwordlower/gi;
2425 $currentdatehead =~ s/{{weekdayuppershort}}/$thisentryweekdayuppershort/gi;
2426 $currentdatehead =~ s/{{monthworduppershort}}/$thisentrymonthworduppershort/gi;
2427 $currentdatehead =~ s/{{weekdaylowershort}}/$thisentryweekdaylowershort/gi;
2428 $currentdatehead =~ s/{{monthwordlowershort}}/$thisentrymonthwordlowershort/gi;
2429 # new {{dayappend}} variable: linear 9/15/2003
2430 # merged in 1.3
2431 $thisentrydayappend = &gm_toordinal($thisentryday);
2432 $currentdatehead =~ s/{{dayappend}}/$thisentrydayappend/gi;
2433 # merged 9/15/2003
2434 if ($archiveformat eq "week") {
2435 unless ($thisentryweek ne $indexcurrentweekcounter) {
2436 $indexarchivebody .= $currentdatehead;
2437 # added $dategrouping flag : 1.3.1
2438 # flipped cracker 6/29/2004
2439 $dategrouping = "open";
2440 }
2441 } else {
2442 unless ($thisentrymonth ne $indexcurrentmonthcounter) {
2443 $indexarchivebody .= $currentdatehead;
2444 # added $dategrouping flag : 1.3.1
2445 # flipped cracker 6/29/2004
2446 $dategrouping = "open";
2447 }
2448 }
2449 }
2450 $indexcurrentdatemarker = "$thisentrymonth $thisentryday $thisentryyearyear";
2451} else {
2452 if ($archiveformat eq "week") {
2453 if (($thisentryopenstatus eq "open") && ($thisentryweek eq $indexcurrentweekcounter) && ($gmarchiveentryseparatortemplate ne "")) {
2454 $indexarchivebody .= $gmarchiveentryseparatortemplate;
2455 }
2456 } else {
2457 if (($thisentryopenstatus eq "open") && ($thisentrymonth eq $indexcurrentmonthcounter) && ($gmarchiveentryseparatortemplate ne "")) {
2458 $indexarchivebody .= $gmarchiveentryseparatortemplate;
2459 }
2460 }
2461}
2462
2463if ($archiveformat eq "week") {
2464 if (($thisentryopenstatus eq "open") && ($thisentryweek eq $indexcurrentweekcounter)) {
2465 if ($thisentrymorebody ne "") {
2466 &gm_formatentry($gmmorearchiveentrytemplate);
2467 } else {
2468 &gm_formatentry($gmarchiveentrytemplate);
2469 }
2470 $indexarchivebody .= $entryreturn;
2471 }
2472} else {
2473 if (($thisentryopenstatus eq "open") && ($thisentrymonth eq $indexcurrentmonthcounter)) {
2474 if ($thisentrymorebody ne "") {
2475 &gm_formatentry($gmmorearchiveentrytemplate);
2476 } else {
2477 &gm_formatentry($gmarchiveentrytemplate);
2478 }
2479 $indexarchivebody .= $entryreturn;
2480 }
2481}
2482# new date grouping footer template in 1.3: linear 9/18/2003
2483# merged in 1.3
2484if ($indexentrycounter > 1) {
2485 &gm_getentryvariables($indexentrycounter - 1); # look at the previous entry
2486 $nextdatemark = "$thisentrymonth $thisentryday $thisentryyearyear";
2487 $nextentryopenstatus = $thisentryopenstatus;
2488 &gm_getentryvariables($indexentrycounter); # look at the current entry again
2489 # added $dategrouping flag checking : 1.3.1
2490 # flipped cracker 6/29/2004
2491 if (($nextdatemark ne $indexcurrentdatemarker) && ($dategouping eq " open") && ($thisentryopenstatus eq "open") && ($indexentrycounter ne $newstayattopnumber)) {
2492 if ($gmdategroupingfooterarchivetemplate ne "") {
2493 $currentdatefoot = $gmdategroupingfooterarchivetemplate;
2494 $currentdatefoot =~ s/{{day}}/$thisentryday/gi;
2495 $currentdatefoot =~ s/{{dayday}}/$thisentrydayday/gi;
2496 $currentdatefoot =~ s/{{year}}/$thisentryyear/gi;
2497 $currentdatefoot =~ s/{{yearyear}}/$thisentryyearyear/gi;
2498 $currentdatefoot =~ s/{{month}}/$thisentrymonth/gi;
2499 $currentdatefoot =~ s/{{monthmonth}}/$thisentrymonthmonth/gi;
2500 $currentdatefoot =~ s/{{weekday}}/$thisentryweekday/gi;
2501 $currentdatefoot =~ s/{{weekdayshort}}/$thisentryweekdayshort/gi;
2502 $currentdatefoot =~ s/{{monthword}}/$thisentrymonthword/gi;
2503 $currentdatefoot =~ s/{{monthwordshort}}/$thisentrymonthwordshort/gi;
2504 $currentdatefoot =~ s/{{weekdayupper}}/$thisentryweekdayupper/gi;
2505 $currentdatefoot =~ s/{{monthwordupper}}/$thisentrymonthwordupper/gi;
2506 $currentdatefoot =~ s/{{weekdaylower}}/$thisentryweekdaylower/gi;
2507 $currentdatefoot =~ s/{{monthwordlower}}/$thisentrymonthwordlower/gi;
2508 $currentdatefoot =~ s/{{weekdayuppershort}}/$thisentryweekdayuppershort/gi;
2509 $currentdatefoot =~ s/{{monthworduppershort}}/$thisentrymonthworduppershort/gi;
2510 $currentdatefoot =~ s/{{weekdaylowershort}}/$thisentryweekdaylowershort/gi;
2511 $currentdatefoot =~ s/{{monthwordlowershort}}/$thisentrymonthwordlowershort/gi;
2512 # new {{dayappend}} variable: linear 9/15/2003
2513 # merged in 1.3
2514 $thisentrydayappend = &gm_toordinal($thisentryday);
2515 $currentdatehead =~ s/{{dayappend}}/$thisentrydayappend/gi;
2516 # merged 9/15/2003
2517 $indexarchivebody .= $currentdatefoot;
2518 # added $dategrouping flag : 1.3.1
2519 # flipped cracker 6/29/2004
2520 $dategrouping = "closed";
2521 }
2522 }
2523}
2524# merged 9/18/2003
2525$indexentrycounter--;
2526
2527if ($archiveformat eq "week") {
2528 if ($thisentryweek ne $indexcurrentweekcounter) {
2529 $indexcurrentmonthcounter = "finis";
2530 } else {
2531 $indexcurrentmonthcounter = $thisentrymonth;
2532 }
2533}
2534
2535if ($indexentrycounter eq "0") { $indexcurrentmonthcounter = "finis"; }
2536
2537} until $thisentrymonth ne $indexcurrentmonthcounter;
2538
2539# added $dategrouping flag checking : 1.3.1
2540# flipped cracker 6/29/2004
2541if ( ($gmdategroupingfootertemplate ne "") && ($dategrouping eq "open") ) {
2542 $currentdatefoot = $gmdategroupingfooterarchivetemplate;
2543 $currentdatefoot =~ s/{{day}}/$thisentryday/gi;
2544 $currentdatefoot =~ s/{{dayday}}/$thisentrydayday/gi;
2545 $currentdatefoot =~ s/{{year}}/$thisentryyear/gi;
2546 $currentdatefoot =~ s/{{yearyear}}/$thisentryyearyear/gi;
2547 $currentdatefoot =~ s/{{month}}/$thisentrymonth/gi;
2548 $currentdatefoot =~ s/{{monthmonth}}/$thisentrymonthmonth/gi;
2549 $currentdatefoot =~ s/{{weekday}}/$thisentryweekday/gi;
2550 $currentdatefoot =~ s/{{weekdayshort}}/$thisentryweekdayshort/gi;
2551 $currentdatefoot =~ s/{{monthword}}/$thisentrymonthword/gi;
2552 $currentdatefoot =~ s/{{monthwordshort}}/$thisentrymonthwordshort/gi;
2553 $currentdatefoot =~ s/{{weekdayupper}}/$thisentryweekdayupper/gi;
2554 $currentdatefoot =~ s/{{monthwordupper}}/$thisentrymonthwordupper/gi;
2555 $currentdatefoot =~ s/{{weekdaylower}}/$thisentryweekdaylower/gi;
2556 $currentdatefoot =~ s/{{monthwordlower}}/$thisentrymonthwordlower/gi;
2557 $currentdatefoot =~ s/{{weekdayuppershort}}/$thisentryweekdayuppershort/gi;
2558 $currentdatefoot =~ s/{{monthworduppershort}}/$thisentrymonthworduppershort/gi;
2559 $currentdatefoot =~ s/{{weekdaylowershort}}/$thisentryweekdaylowershort/gi;
2560 $currentdatefoot =~ s/{{monthwordlowershort}}/$thisentrymonthwordlowershort/gi;
2561 # new {{dayappend}} variable: linear 9/15/2003
2562 # merged in 1.3
2563 $thisentrydayappend = &gm_toordinal($thisentryday);
2564 $currentdatehead =~ s/{{dayappend}}/$thisentrydayappend/gi;
2565 # merged 9/15/2003
2566 $indexarchivebody .= $currentdatefoot;
2567 # added $dategrouping flag : 1.3.1
2568 # flipped cracker 6/29/2004
2569 $dategrouping = "closed";
2570}
2571
2572$stoppednumber = $thisentrynumber;
2573
2574&gm_getentryvariables($startnumber);
2575
2576if ($archiveformat eq "week") {
2577 $usethisarchivefilename = "$EntriesPath/archive-$thisentryweekbeginningmonthmonth$thisentryweekbeginningdayday$thisentryweekbeginningyearyear-$thisentryweekendingmonthmonth$thisentryweekendingdayday$thisentryweekendingyearyear\.$logarchivesuffix";
2578} else {
2579 $usethisarchivefilename = "$EntriesPath/archive-$thisentrymonthmonth$thisentryyearyear\.$logarchivesuffix";
2580}
2581
2582$newarchivefile = $gmarchiveindextemplate;
2583$newarchivefile =~ s/{{year}}/$thisentryyear/gi;
2584$newarchivefile =~ s/{{yearyear}}/$thisentryyearyear/gi;
2585$newarchivefile =~ s/{{month}}/$thisentrymonth/gi;
2586$newarchivefile =~ s/{{monthmonth}}/$thisentrymonthmonth/gi;
2587$newarchivefile =~ s/{{monthword}}/$thisentrymonthword/gi;
2588$newarchivefile =~ s/{{monthwordshort}}/$thisentrymonthwordshort/gi;
2589$newarchivefile =~ s/{{monthwordupper}}/$thisentrymonthwordupper/gi;
2590$newarchivefile =~ s/{{monthwordlower}}/$thisentrymonthwordlower/gi;
2591$newarchivefile =~ s/{{monthworduppershort}}/$thisentrymonthworduppershort/gi;
2592$newarchivefile =~ s/{{monthwordlowershort}}/$thisentrymonthwordlowershort/gi;
2593$newarchivefile =~ s/{{archivebody}}/$indexarchivebody/gi;
2594$newarchivefile =~ s/{{logbody}}/$indexarchivebody/gi;
2595
2596&gm_formatentry($newarchivefile);
2597
2598##if ($archiveformat eq "week") {
2599## $usethisarchivefilename = "$EntriesPath/archive-$thisentryweekbeginningmonthmonth$thisentryweekbeginningdayday$thisentryweekbeginningyearyear-$thisentryweekendingmonthmonth$thisentryweekendingdayday$thisentryweekendingyearyear\.$logarchivesuffix";
2600##} else {
2601## $usethisarchivefilename = "$EntriesPath/archive-$thisentrymonthmonth$thisentryyearyear\.$logarchivesuffix";
2602##}
2603
2604open (THISFILEPAWS, ">$usethisarchivefilename") || &gm_dangermouse("Can't write to $usethisarchivefilename. 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.");
2605print THISFILEPAWS $entryreturn;
2606close (THISFILEPAWS);
2607
2608chmod (0666, "$usethisarchivefilename");
2609
2610}
2611
2612# -----------------------
2613# rebuild connected files
2614# -----------------------
2615
2616sub gm_rebuildconnectedfiles {
2617
2618@connectedfilelist = split (/\|\*\|/, $otherfilelist);
2619
2620@variabledatabase = ("{{header}}", "{{footer}}", "{{sidebar}}", "{{log", "{{calendar", "{{comment", "{{entry", "link}}", "karma}}", "{{author", "{{day", "{{month", "{{year", "{{hour", "{{minute", "{{second", "{{weekday", "{{militaryhour}}", "{{ampm", "{{timezone}}", "{{link", "{{email", "{{previous", "{{next", "webpath}}", "{{gm", "{{emoticonspath}}");
2621
2622&gm_getentryvariables($newentrynumber);
2623
2624$connectedfilesdone = "no";
2625$connectstartfromhere = $IN{'connectednumber'};
2626if ($connectstartfromhere eq "") { $connectstartfromhere = 0; }
2627$connectendhere = $connectstartfromhere + 9;
2628if (($connectendhere > $#connectedfilelist) || ($connectendhere eq $#connectedfilelist)) {
2629 $connectendhere = $#connectedfilelist;
2630 $connectedfilesdone = "yes";
2631}
2632$IN{'connectednumber'} = $connectendhere + 1;
2633
2634$connectcounter = 0;
2635
2636foreach $usethisfilename (@connectedfilelist) {
2637unless (($connectcounter < $connectstartfromhere) || ($connectcounter > $connectendhere)) {
2638
2639 $usethisfilenamestripped = $usethisfilename;
2640 $usethisfilenamestripped =~ s/\//BACKSLASH/g;
2641 $usethisfilenamestripped =~ s/\W//g;
2642 $usethisfilenamestripped =~ s/BACKSLASH/-/g;
2643
2644 $thereisapattern = "no";
2645
2646 open (OTHERORIGFILE, "$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.");
2647 @otherorigfilelines = <OTHERORIGFILE>;
2648 close (OTHERORIGFILE);
2649
2650 unless (!(open(CHECKTHISFILE,"$EntriesPath/$usethisfilenamestripped.cgi"))) {
2651 open (OTHERPATTERNFILE, "$EntriesPath/$usethisfilenamestripped.cgi") || &gm_dangermouse("Can't open $EntriesPath/$usethisfilenamestripped.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.");
2652 @otherpatternfilelines = <OTHERPATTERNFILE>;
2653 close (OTHERPATTERNFILE);
2654 $thereisapattern = "yes";
2655 }
2656 close(CHECKTHISFILE);
2657
2658 $gmcounter = 0;
2659
2660 foreach (@otherorigfilelines) {
2661 chomp ($otherorigfilelines[$gmcounter]);
2662 $gmcounter++;
2663 }
2664
2665 $otherorigfilebody = join ("|*|", @otherorigfilelines);
2666
2667 foreach $thisvariablecheck (@variabledatabase) {
2668 if ($otherorigfilebody =~ m/$thisvariablecheck/i) { $thereisapattern = "no"; }
2669 }
2670
2671 unless ($thereisapattern eq "no") {
2672 $gmcounter = 0;
2673 foreach (@otherpatternfilelines) {
2674 chomp ($otherpatternfilelines[$gmcounter]);
2675 $gmcounter++;
2676 }
2677 $otherpatternfilebody = join ("|*|", @otherpatternfilelines);
2678 $otherfilebody = $otherpatternfilebody;
2679 } else {
2680 $otherfilebody = $otherorigfilebody;
2681 }
2682
2683 $newfilebodypattern = $otherfilebody;
2684
2685 &gm_formatentry($otherfilebody);
2686
2687 $entryreturn =~ s/\|\*\|/\n/g;
2688 $newfilebodypattern =~ s/\|\*\|/\n/g;
2689
2690 chmod (0666, "$usethisfilename");
2691
2692 open (OTHERFILEONE, ">$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.");
2693 print OTHERFILEONE $entryreturn;
2694 close (OTHERFILEONE);
2695
2696 open (OTHERFILETWO, ">$EntriesPath/$usethisfilenamestripped.cgi") || &gm_dangermouse("Can't write to $EntriesPath/$usethisfilenamestripped.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.");
2697 print OTHERFILETWO $newfilebodypattern;
2698 close (OTHERFILETWO);
2699
2700 chmod (0666, "$EntriesPath/$usethisfilenamestripped.cgi");
2701
2702}
2703$connectcounter++;
2704}
2705
2706}
2707
2708# -------------------------
2709# generate log archive list
2710# -------------------------
2711
2712sub gm_generatearchiveloglist {
2713
2714&gm_readcounter;
2715
2716###########################################################
2717# 9/3/2001 - CHERYL LAMBERT
2718# Problem: If the last archived entry is a different month/year from the current month/year, the
2719# {{calendar}} on the Archive Master Index page displays the month/year of the last archived
2720# entry instead of the current month/year. For example, my last archived entry was 8/21/2001
2721# but the current date was 9/3/2001 when I discovered this problem. The {{calendar}} displayed
2722# on the Archive Master Index page was for August 2001 not for September 2001.
2723# The following section of code corrects this problem by getting the current date and using
2724# the current date instead of the last archived date to create the {{calendar}} on the
2725# Archive Master Index page.
2726 my ($tsec,$tmin,$thour,$tmday,$tmon,$tyear,$twday,$tyday,$tisdst) = localtime(time);
2727 $tmon += 1;
2728 $tyear += 1900;
2729 if (($tmon != $thisentrymonth) || ($tyear != $thisentryyearyear)) {
2730 $thisentrymonth = $tmon;
2731 $thisentryday = $tmday;
2732 $thisentryhour = $thour;
2733 $thisentryminute = $tmin;
2734 $thisentrysecond = $tsec;
2735 $thisentryweekdaynumber = $twday;
2736 $thisentryweekday = $weekdays[$twday];
2737 $thisentrymonthword = $months[$thisentrymonth];
2738 $thisentrymonthmonth = sprintf ("%2d", $thisentrymonth);
2739 $thisentrydayday = sprintf ("%2d", $thisentryday);
2740 $thisentryhourhour = sprintf ("%2d", $thisentryhour);
2741 $thisentryminuteminute = sprintf ("%2d", $thisentryminute);
2742 $thisentrysecondsecond = sprintf ("%2d", $thisentrysecond);
2743 $thisentrymonthmonth =~ tr/ /0/; $thisentrydayday =~ tr/ /0/;
2744 $thisentryhourhour =~ tr/ /0/; $thisentryminuteminute =~ tr/ /0/;
2745 $thisentrysecondsecond =~ tr/ /0/;
2746 }
2747###########################################################
2748
2749open (FUNNYFEETMIDNIGHT, "./gm-entrylist.cgi") || &gm_dangermouse("Can't read the entry list file. Please make sure that gm-entrylist.cgi is in the same directory as all your other Greymatter files and is CHMODed to 666; also, try running Diagnostics & Repair in the Configuration screen.");
2750@loglistloglines = <FUNNYFEETMIDNIGHT>;
2751close (FUNNYFEETMIDNIGHT);
2752
2753$listcountmonthyear = "begin";
2754$listcountweek = "begin";
2755
2756$logarchivelistfinal = "";
2757
2758foreach $loglistline (@loglistloglines) {
2759
2760 chomp ($loglistline);
2761 ($loglistnumber, $loglistauthor, $loglistsubject, $loglistdate, $loglisttimeampm, $loglistopenstatus, $loglistmorestatus) = split (/\|/, $loglistline);
2762 &gm_getloglistvariables;
2763
2764 unless ($loglistopenstatus eq "C") {
2765
2766 $thisloglistmonthyear = "$loglistmonthmonth $loglistyearyear";
2767 $thisloglistweek = "$loglistweekbeginningdayday$loglistweekendingdayday";
2768
2769 if ($archiveformat eq "week") {
2770 if ($thisloglistweek ne $listcountweek) {
2771 $listsubsub = $gmlogarchiveslinkweeklytemplate;
2772 &entrylistsubsub;
2773 $listsubsub .= "|*|";
2774 $logarchivelistfinal .= $listsubsub;
2775 $listcountweek = $thisloglistweek;
2776 }
2777 } else {
2778 if ($thisloglistmonthyear ne $listcountmonthyear) {
2779 $listsubsub = $gmlogarchiveslinktemplate;
2780 &entrylistsubsub;
2781 $listsubsub .= "|*|";
2782 $logarchivelistfinal .= $listsubsub;
2783 $listcountmonthyear = $thisloglistmonthyear;
2784 }
2785 }
2786
2787 }
2788
2789}
2790
2791@loglistfinalcollection = split (/\|\*\|/, $logarchivelistfinal);
2792
2793if ($entrylistsortorder eq "descending") { @loglistfinalcollection = reverse @loglistfinalcollection; }
2794
2795$logarchivelistfinal = join ("$gmlogarchiveslinkseparatortemplate", @loglistfinalcollection);
2796
2797}
2798
2799# -----------------------
2800# generate log entry list
2801# -----------------------
2802
2803sub gm_generateentryloglist {
2804
2805$logshortentrylistfinal = "";
2806$logmoreentrylistfinal = "";
2807$logentrylistfinal = "";
2808$logshortentrylistmonthfinal = "";
2809$logshortentrylistdayfinal = "";
2810$logshortentrylistyearfinal = "";
2811$logmoreentrylistmonthfinal = "";
2812$logmoreentrylistdayfinal = "";
2813$logmoreentrylistyearfinal = "";
2814$logentrylistmonthfinal = "";
2815$logentrylistdayfinal = "";
2816$logentrylistyearfinal = "";
2817$logshortentrylistnumberfinal = "";
2818$logmoreentrylistnumberfinal = "";
2819$logentrylistnumberfinal = "";
2820$logshortentrylistfirsthalffinal = "";
2821$logshortentrylistsecondhalffinal = "";
2822$logmoreentrylistfirsthalffinal = "";
2823$logmoreentrylistsecondhalffinal = "";
2824$logentrylistfirsthalffinal = "";
2825$logentrylistsecondhalffinal = "";
2826
2827open (FUNNYFEETSPOT, "./gm-entrylist.cgi") || &gm_dangermouse("Can't read the entry list file. Please make sure that gm-entrylist.cgi is in the same directory as all your other Greymatter files and is CHMODed to 666; also, try running Diagnostics & Repair in the Configuration screen.");
2828@loglistloglines = <FUNNYFEETSPOT>;
2829close (FUNNYFEETSPOT);
2830
2831if ($entrylistsortorder eq "descending") { @loglistloglines = reverse @loglistloglines; }
2832
2833($toploglistnumber, $toploglistauthor, $toploglistsubject, $toploglistdate, $toploglisttimeampm, $toploglistopenstatus, $toploglistmorestatus) = split (/\|/, $loglistloglines[0]);
2834($toploglistmonthmonth, $toploglistdayday, $toploglistyear) = split (/\//, $toploglistdate);
2835
2836$shortentrycounter = 0;
2837$moreentrycounter = 0;
2838$allentrycounter = 0;
2839
2840$shorttotalentrycounter = 0;
2841$moretotalentrycounter = 0;
2842$alltotalentrycounter = 0;
2843
2844foreach $loglistcounterline (@loglistloglines) {
2845 chomp ($loglistcounterline);
2846 ($loglistcounternumber, $loglistcounterauthor, $loglistcountersubject, $loglistcounterdate, $loglistcountertimeampm, $loglistcounteropenstatus, $loglistcountermorestatus) = split (/\|/, $loglistcounterline);
2847 unless ($loglistcounteropenstatus eq "C") {
2848 $alltotalentrycounter++;
2849 if ($loglistcountermorestatus eq "Y") { $moretotalentrycounter++; } else { $shorttotalentrycounter++; }
2850 }
2851}
2852
2853$shorttotalentryhalfcounter = sprintf("%.0f", ($shorttotalentrycounter / 2));
2854$moretotalentryhalfcounter = sprintf("%.0f", ($moretotalentrycounter / 2));
2855$alltotalentryhalfcounter = sprintf("%.0f", ($alltotalentrycounter / 2));
2856
2857$listdaymarker = "tommy";
2858$listmonthmarker = "tommy";
2859$listyearmarker = "tommy";
2860
2861foreach $loglistline (@loglistloglines) {
2862
2863 chomp ($loglistline);
2864 ($loglistnumber, $loglistauthor, $loglistsubject, $loglistdate, $loglisttimeampm, $loglistopenstatus, $loglistmorestatus) = split (/\|/, $loglistline);
2865
2866 unless ($loglistopenstatus eq "C") {
2867
2868 &gm_getloglistvariables;
2869
2870 $usethismorelinktemplate = $gmmoreentrypagelinktemplate;
2871 $usethislinktemplate = $gmentrypagelinktemplate;
2872
2873 if (($gmentrypagelinkdayseparatortemplate ne "") && ($listdaymarker ne $loglistday)) {
2874 $usethismorelinktemplate = "$gmentrypagelinkdayseparatortemplate|*|$usethismorelinktemplate";
2875 $usethislinktemplate = "$gmentrypagelinkdayseparatortemplate|*|$usethislinktemplate";
2876 }
2877
2878 if (($gmentrypagelinkmonthseparatortemplate ne "") && ($listmonthmarker ne $loglistmonth)) {
2879 $usethismorelinktemplate = "$gmentrypagelinkmonthseparatortemplate|*|$usethismorelinktemplate";
2880 $usethislinktemplate = "$gmentrypagelinkmonthseparatortemplate|*|$usethislinktemplate";
2881 }
2882
2883 if (($gmentrypagelinkyearseparatortemplate ne "") && ($listyearmarker ne $loglistyear)) {
2884 $usethismorelinktemplate = "$gmentrypagelinkyearseparatortemplate|*|$usethismorelinktemplate";
2885 $usethislinktemplate = "$gmentrypagelinkyearseparatortemplate|*|$usethislinktemplate";
2886 }
2887
2888 if ($loglistmorestatus eq "Y") {
2889 $moreentrycounter++;
2890 $listsubsub = $usethismorelinktemplate;
2891 &entrylistsubsub;
2892 $listsubsub .= "|*|";
2893 $logmoreentrylistfinal .= $listsubsub;
2894 if ($loglistmonthmonth eq $toploglistmonthmonth) { $logmoreentrylistmonthfinal .= $listsubsub; }
2895 if ($loglistdayday eq $toploglistdayday) { $logmoreentrylistdayfinal .= $listsubsub; }
2896 if ($loglistyear eq $toploglistyear) { $logmoreentrylistyearfinal .= $listsubsub; }
2897 unless ($moreentrycounter > $entrylistcountnumber) { $logmoreentrylistnumberfinal .= $listsubsub; }
2898 if ($moreentrycounter <= $moretotalentryhalfcounter) {
2899 $logmoreentrylistfirsthalffinal .= $listsubsub;
2900 } else {
2901 $logmoreentrylistsecondhalffinal .= $listsubsub;
2902 }
2903 } else {
2904 $shortentrycounter++;
2905 $listsubsub = $usethislinktemplate;
2906 &entrylistsubsub;
2907 $listsubsub .= "|*|";
2908 $logshortentrylistfinal .= $listsubsub;
2909 if ($loglistmonthmonth eq $toploglistmonthmonth) { $logshortentrylistmonthfinal .= $listsubsub; }
2910 if ($loglistdayday eq $toploglistdayday) { $logshortentrylistdayfinal .= $listsubsub; }
2911 if ($loglistyear eq $toploglistyear) { $logshortentrylistyearfinal .= $listsubsub; }
2912 unless ($shortentrycounter > $entrylistcountnumber) { $logshortentrylistnumberfinal .= $listsubsub; }
2913 if ($shortentrycounter <= $shorttotalentryhalfcounter) {
2914 $logshortentrylistfirsthalffinal .= $listsubsub;
2915 } else {
2916 $logshortentrylistsecondhalffinal .= $listsubsub;
2917 }
2918 }
2919
2920 $allentrycounter++;
2921 $logentrylistfinal .= $listsubsub;
2922 if ($loglistmonthmonth eq $toploglistmonthmonth) { $logentrylistmonthfinal .= $listsubsub; }
2923 if ($loglistdayday eq $toploglistdayday) { $logentrylistdayfinal .= $listsubsub; }
2924 if ($loglistyear eq $toploglistyear) { $logentrylistyearfinal .= $listsubsub; }
2925 unless ($allentrycounter > $entrylistcountnumber) { $logentrylistnumberfinal .= $listsubsub; }
2926 if ($allentrycounter <= $alltotalentryhalfcounter) {
2927 $logentrylistfirsthalffinal .= $listsubsub;
2928 } else {
2929 $logentrylistsecondhalffinal .= $listsubsub;
2930 }
2931
2932 $listdaymarker = $loglistday;
2933 $listmonthmarker = $loglistmonth;
2934 $listyearmarker = $loglistyear;
2935
2936 }
2937
2938}
2939
2940@logshortentrylistfinalcollection = split (/\|\*\|/, $logshortentrylistfinal);
2941@logmoreentrylistfinalcollection = split (/\|\*\|/, $logmoreentrylistfinal);
2942@logentrylistfinalcollection = split (/\|\*\|/, $logentrylistfinal);
2943@logshortentrylistmonthfinalcollection = split (/\|\*\|/, $logshortentrylistmonthfinal);
2944@logshortentrylistdayfinalcollection = split (/\|\*\|/, $logshortentrylistdayfinal);
2945@logshortentrylistyearfinalcollection = split (/\|\*\|/, $logshortentrylistyearfinal);
2946@logmoreentrylistmonthfinalcollection = split (/\|\*\|/, $logmoreentrylistmonthfinal);
2947@logmoreentrylistdayfinalcollection = split (/\|\*\|/, $logmoreentrylistdayfinal);
2948@logmoreentrylistyearfinalcollection = split (/\|\*\|/, $logmoreentrylistyearfinal);
2949@logentrylistmonthfinalcollection = split (/\|\*\|/, $logentrylistmonthfinal);
2950@logentrylistdayfinalcollection = split (/\|\*\|/, $logentrylistdayfinal);
2951@logentrylistyearfinalcollection = split (/\|\*\|/, $logentrylistyearfinal);
2952@logshortentrylistnumberfinalcollection = split (/\|\*\|/, $logshortentrylistnumberfinal);
2953@logmoreentrylistnumberfinalcollection = split (/\|\*\|/, $logmoreentrylistnumberfinal);
2954@logentrylistnumberfinalcollection = split (/\|\*\|/, $logentrylistnumberfinal);
2955@logshortentrylistfirsthalffinalcollection = split (/\|\*\|/, $logshortentrylistfirsthalffinal);
2956@logshortentrylistsecondhalffinalcollection = split (/\|\*\|/, $logshortentrylistsecondhalffinal);
2957@logmoreentrylistfirsthalffinalcollection = split (/\|\*\|/, $logmoreentrylistfirsthalffinal);
2958@logmoreentrylistsecondhalffinalcollection = split (/\|\*\|/, $logmoreentrylistsecondhalffinal);
2959@logentrylistfirsthalffinalcollection = split (/\|\*\|/, $logentrylistfirsthalffinal);
2960@logentrylistsecondhalffinalcollection = split (/\|\*\|/, $logentrylistsecondhalffinal);
2961
2962$logshortentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logshortentrylistfinalcollection);
2963$logmoreentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logmoreentrylistfinalcollection);
2964$logentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logentrylistfinalcollection);
2965$logshortentrylistmonthfinal = join ("$gmentrypagelinkseparatortemplate", @logshortentrylistmonthfinalcollection);
2966$logshortentrylistdayfinal = join ("$gmentrypagelinkseparatortemplate", @logshortentrylistdayfinalcollection);
2967$logshortentrylistyearfinal = join ("$gmentrypagelinkseparatortemplate", @logshortentrylistyearfinalcollection);
2968$logmoreentrylistmonthfinal = join ("$gmentrypagelinkseparatortemplate", @logmoreentrylistmonthfinalcollection);
2969$logmoreentrylistdayfinal = join ("$gmentrypagelinkseparatortemplate", @logmoreentrylistdayfinalcollection);
2970$logmoreentrylistyearfinal = join ("$gmentrypagelinkseparatortemplate", @logmoreentrylistyearfinalcollection);
2971$logentrylistmonthfinal = join ("$gmentrypagelinkseparatortemplate", @logentrylistmonthfinalcollection);
2972$logentrylistdayfinal = join ("$gmentrypagelinkseparatortemplate", @logentrylistdayfinalcollection);
2973$logentrylistyearfinal = join ("$gmentrypagelinkseparatortemplate", @logentrylistyearfinalcollection);
2974$logshortentrylistnumberfinal = join ("$gmentrypagelinkseparatortemplate", @logshortentrylistnumberfinalcollection);
2975$logmoreentrylistnumberfinal = join ("$gmentrypagelinkseparatortemplate", @logmoreentrylistnumberfinalcollection);
2976$logentrylistnumberfinal = join ("$gmentrypagelinkseparatortemplate", @logentrylistnumberfinalcollection);
2977$logshortentrylistfirsthalffinal = join ("$gmentrypagelinkseparatortemplate", @logshortentrylistfirsthalffinalcollection);
2978$logshortentrylistsecondhalffinal = join ("$gmentrypagelinkseparatortemplate", @logshortentrylistsecondhalffinalcollection);
2979$logmoreentrylistfirsthalffinal = join ("$gmentrypagelinkseparatortemplate", @logmoreentrylistfirsthalffinalcollection);
2980$logmoreentrylistsecondhalffinal = join ("$gmentrypagelinkseparatortemplate", @logmoreentrylistsecondhalffinalcollection);
2981$logentrylistfirsthalffinal = join ("$gmentrypagelinkseparatortemplate", @logentrylistfirsthalffinalcollection);
2982$logentrylistsecondhalffinal = join ("$gmentrypagelinkseparatortemplate", @logentrylistsecondhalffinalcollection);
2983
2984}
2985
2986# ----------------------------------------------
2987# generate log entry list for individual authors
2988# ----------------------------------------------
2989
2990sub gm_generateentryloglistauthor {
2991
2992$logshortentrylistfinal = "";
2993$logmoreentrylistfinal = "";
2994$logentrylistfinal = "";
2995
2996open (FUNNYFEETINDY, "./gm-entrylist.cgi") || &gm_dangermouse("Can't read the entry list file. Please make sure that gm-entrylist.cgi is in the same directory as all your other Greymatter files and is CHMODed to 666; also, try running Diagnostics & Repair in the Configuration screen.");
2997@loglistloglines = <FUNNYFEETINDY>;
2998close (FUNNYFEETINDY);
2999
3000if ($entrylistsortorder eq "descending") { @loglistloglines = reverse @loglistloglines; }
3001
3002($toploglistnumber, $toploglistauthor, $toploglistsubject, $toploglistdate, $toploglisttimeampm, $toploglistopenstatus, $toploglistmorestatus) = split (/\|/, $loglistloglines[0]);
3003($toploglistmonthmonth, $toploglistdayday, $toploglistyear) = split (/\//, $toploglistdate);
3004
3005$shortentrycounter = 0;
3006$moreentrycounter = 0;
3007$allentrycounter = 0;
3008
3009$listdaymarker = "tommy";
3010$listmonthmarker = "tommy";
3011$listyearmarker = "tommy";
3012
3013foreach $loglistline (@loglistloglines) {
3014
3015 chomp ($loglistline);
3016 ($loglistnumber, $loglistauthor, $loglistsubject, $loglistdate, $loglisttimeampm, $loglistopenstatus, $loglistmorestatus) = split (/\|/, $loglistline);
3017
3018 unless (($loglistopenstatus eq "C") || ($thisentryloglistauthor ne $loglistauthor)) {
3019
3020 &gm_getloglistvariables;
3021
3022 $usethismorelinktemplate = $gmmoreentrypagelinktemplate;
3023 $usethislinktemplate = $gmentrypagelinktemplate;
3024
3025 if (($gmentrypagelinkdayseparatortemplate ne "") && ($listdaymarker ne $loglistday)) {
3026 $usethismorelinktemplate = "$gmentrypagelinkdayseparatortemplate|*|$usethismorelinktemplate";
3027 $usethislinktemplate = "$gmentrypagelinkdayseparatortemplate|*|$usethislinktemplate";
3028 }
3029
3030 if (($gmentrypagelinkmonthseparatortemplate ne "") && ($listmonthmarker ne $loglistmonth)) {
3031 $usethismorelinktemplate = "$gmentrypagelinkmonthseparatortemplate|*|$usethismorelinktemplate";
3032 $usethislinktemplate = "$gmentrypagelinkmonthseparatortemplate|*|$usethislinktemplate";
3033 }
3034
3035 if (($gmentrypagelinkyearseparatortemplate ne "") && ($listyearmarker ne $loglistyear)) {
3036 $usethismorelinktemplate = "$gmentrypagelinkyearseparatortemplate|*|$usethismorelinktemplate";
3037 $usethislinktemplate = "$gmentrypagelinkyearseparatortemplate|*|$usethislinktemplate";
3038 }
3039
3040 if ($loglistmorestatus eq "Y") {
3041 $moreentrycounter++;
3042 $listsubsub = $usethismorelinktemplate;
3043 &entrylistsubsub;
3044 $listsubsub .= "|*|";
3045 $logmoreentrylistfinal .= $listsubsub;
3046 } else {
3047 $shortentrycounter++;
3048 $listsubsub = $usethislinktemplate;
3049 &entrylistsubsub;
3050 $listsubsub .= "|*|";
3051 $logshortentrylistfinal .= $listsubsub;
3052 }
3053
3054 $allentrycounter++;
3055 $logentrylistfinal .= $listsubsub;
3056
3057 $listdaymarker = $loglistday;
3058 $listmonthmarker = $loglistmonth;
3059 $listyearmarker = $loglistyear;
3060
3061 }
3062
3063}
3064
3065@logshortentrylistfinalcollection = split (/\|\*\|/, $logshortentrylistfinal);
3066@logmoreentrylistfinalcollection = split (/\|\*\|/, $logmoreentrylistfinal);
3067@logentrylistfinalcollection = split (/\|\*\|/, $logentrylistfinal);
3068
3069$logshortentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logshortentrylistfinalcollection);
3070$logmoreentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logmoreentrylistfinalcollection);
3071$logentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logentrylistfinalcollection);
3072
3073}
3074
3075# -------------------------------------------
3076# generate log entry list for comment sorting
3077# -------------------------------------------
3078
3079sub gm_generateentryloglistcomments {
3080
3081$logshortentrylistfinal = "";
3082$logmoreentrylistfinal = "";
3083$logentrylistfinal = "";
3084$logshortminimumentrylistfinal = "";
3085$logmoreminimumentrylistfinal = "";
3086$logminimumentrylistfinal = "";
3087$logshortnumberentrylistfinal = "";
3088$logmorenumberentrylistfinal = "";
3089$lognumberentrylistfinal = "";
3090
3091$countfromhere = 1;
3092
3093do {
3094
3095 $countfromherenumberpadded = sprintf ("%8d", $countfromhere);
3096 $countfromherenumberpadded =~ tr/ /0/;
3097 open (FUNNYFEETCOMMIE, "$EntriesPath/$countfromherenumberpadded.cgi") || &gm_dangermouse("Can't read $EntriesPath/$countfromherenumberpadded.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.");
3098 @countfromhereentrylines = <FUNNYFEETCOMMIE>;
3099 close (FUNNYFEETCOMMIE);
3100
3101 chomp ($countfromhereentrylines[0]);
3102
3103 ($countfromhereentrynumber, $countfromhereentryauthor, $countfromhereentrysubject, $countfromhereentryweekdaynumber, $countfromhereentrymonth, $countfromhereentryday, $countfromhereentryyearyear, $countfromhereentryhour, $countfromhereentryminute, $countfromhereentrysecond, $countfromhereentryampm, $countfromhereentrypositivekarma, $countfromhereentrynegativekarma, $countfromhereentrycommentsnumber, $countfromhereentryallowkarma, $countfromhereentryallowcomments, $countfromhereentryopenstatus, $countfromhereentrymusic, $countfromhereentrymood, $countfromhereentryemoticonsallowed) = split (/\|/, $countfromhereentrylines[0]);
3104
3105 $countfromcanpost = "Y";
3106
3107 if ($countfromhereentryallowcomments eq "no") { $countfromcanpost = "N"; }
3108 if (($posttoarchives eq "no") && ($countfromhereentrynumber <= $newarchivenumber)) { $countfromcanpost = "N"; }
3109
3110 unless ($countfromhereentryopenstatus eq "closed") {
3111 $countslot = $countfromhere - 1;
3112 $countfromherelist[$countslot] = "$countfromhereentrycommentsnumber|$countfromhereentrynumber|$countfromcanpost";
3113 }
3114
3115 $countfromhere++;
3116
3117} until $countfromhere > $newentrynumber;
3118
3119sub numerically { $a <=> $b }
3120@countfromherelist = sort numerically @countfromherelist;
3121
3122unless ($entrylistsortorder eq "descending") { @countfromherelist = reverse @countfromherelist; }
3123
3124# trim this list before we loop over it
3125@countfromherelisttrimmed = @countfromherelist[0..$entrylistcountnumber-1];
3126
3127open (FUNNYFEETBLECH, "./gm-entrylist.cgi") || &gm_dangermouse("Can't read the entry list file. Please make sure that gm-entrylist.cgi is in the same directory as all your other Greymatter files and is CHMODed to 666; also, try running Diagnostics & Repair in the Configuration screen.");
3128@loglistloglines = <FUNNYFEETBLECH>;
3129close (FUNNYFEETBLECH);
3130
3131$shortentrycounter = 0;
3132$moreentrycounter = 0;
3133$allentrycounter = 0;
3134
3135$listdaymarker = "tommy";
3136$listmonthmarker = "tommy";
3137$listyearmarker = "tommy";
3138
3139foreach $countfromhereline (@countfromherelist) {
3140
3141 ($countfromherecommentsnumber, $countfromhereentrynumber, $countfromherecanpost) = split (/\|/, $countfromhereline);
3142
3143SCAN: foreach $loglistline (@loglistloglines) {
3144
3145 chomp ($loglistline);
3146 ($loglistnumber, $loglistauthor, $loglistsubject, $loglistdate, $loglisttimeampm, $loglistopenstatus, $loglistmorestatus) = split (/\|/, $loglistline);
3147 if ($loglistnumber eq $countfromhereentrynumber) {
3148 unless (($countfromherecanpost eq "N") && ($commententrylistonlyifokay eq "yes")) {
3149
3150 &gm_getloglistvariables;
3151
3152 $usethismorelinktemplate = $gmmoreentrypagelinktemplate;
3153 $usethislinktemplate = $gmentrypagelinktemplate;
3154
3155 if (($gmentrypagelinkdayseparatortemplate ne "") && ($listdaymarker ne $loglistday)) {
3156 $usethismorelinktemplate = "$gmentrypagelinkdayseparatortemplate|*|$usethismorelinktemplate";
3157 $usethislinktemplate = "$gmentrypagelinkdayseparatortemplate|*|$usethislinktemplate";
3158 }
3159
3160 if (($gmentrypagelinkmonthseparatortemplate ne "") && ($listmonthmarker ne $loglistmonth)) {
3161 $usethismorelinktemplate = "$gmentrypagelinkmonthseparatortemplate|*|$usethismorelinktemplate";
3162 $usethislinktemplate = "$gmentrypagelinkmonthseparatortemplate|*|$usethislinktemplate";
3163 }
3164
3165 if (($gmentrypagelinkyearseparatortemplate ne "") && ($listyearmarker ne $loglistyear)) {
3166 $usethismorelinktemplate = "$gmentrypagelinkyearseparatortemplate|*|$usethismorelinktemplate";
3167 $usethislinktemplate = "$gmentrypagelinkyearseparatortemplate|*|$usethislinktemplate";
3168 }
3169
3170 if ($loglistmorestatus eq "Y") {
3171 $moreentrycounter++;
3172 $listsubsub = $usethismorelinktemplate;
3173 &entrylistsubsub;
3174 $listsubsub .= "|*|";
3175 $logmoreentrylistfinal .= $listsubsub;
3176 unless ($countfromherecommentsnumber < 1) { $logmoreminimumentrylistfinal .= $listsubsub; }
3177 unless ($moreentrycounter > $entrylistcountnumber) { $logmorenumberentrylistfinal .= $listsubsub; }
3178 } else {
3179 $shortentrycounter++;
3180 $listsubsub = $usethislinktemplate;
3181 &entrylistsubsub;
3182 $listsubsub .= "|*|";
3183 $logshortentrylistfinal .= $listsubsub;
3184 unless ($countfromherecommentsnumber < 1) { $logshortminimumentrylistfinal .= $listsubsub; }
3185 unless ($shortentrycounter > $entrylistcountnumber) { $logshortnumberentrylistfinal .= $listsubsub; }
3186 }
3187
3188 $allentrycounter++;
3189 $logentrylistfinal .= $listsubsub;
3190 unless ($countfromherecommentsnumber < 1) { $logminimumentrylistfinal .= $listsubsub; }
3191 unless ($allentrycounter > $entrylistcountnumber) { $lognumberentrylistfinal .= $listsubsub; }
3192
3193 $listdaymarker = $loglistday;
3194 $listmonthmarker = $loglistmonth;
3195 $listyearmarker = $loglistyear;
3196 # we found a match, let's bail
3197 last SCAN;
3198 }
3199 }
3200 }
3201}
3202
3203@logshortentrylistfinalcollection = split (/\|\*\|/, $logshortentrylistfinal);
3204@logmoreentrylistfinalcollection = split (/\|\*\|/, $logmoreentrylistfinal);
3205@logentrylistfinalcollection = split (/\|\*\|/, $logentrylistfinal);
3206@logshortminimumentrylistfinalcollection = split (/\|\*\|/, $logshortminimumentrylistfinal);
3207@logmoreminimumentrylistfinalcollection = split (/\|\*\|/, $logmoreminimumentrylistfinal);
3208@logminimumentrylistfinalcollection = split (/\|\*\|/, $logminimumentrylistfinal);
3209@logshortnumberentrylistfinalcollection = split (/\|\*\|/, $logshortnumberentrylistfinal);
3210@logmorenumberentrylistfinalcollection = split (/\|\*\|/, $logmorenumberentrylistfinal);
3211@lognumberentrylistfinalcollection = split (/\|\*\|/, $lognumberentrylistfinal);
3212
3213$logshortentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logshortentrylistfinalcollection);
3214$logmoreentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logmoreentrylistfinalcollection);
3215$logentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logentrylistfinalcollection);
3216$logshortminimumentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logshortminimumentrylistfinalcollection);
3217$logmoreminimumentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logmoreminimumentrylistfinalcollection);
3218$logminimumentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logminimumentrylistfinalcollection);
3219$logshortnumberentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logshortnumberentrylistfinalcollection);
3220$logmorenumberentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logmorenumberentrylistfinalcollection);
3221$lognumberentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @lognumberentrylistfinalcollection);
3222
3223}
3224
3225
3226# ----------------------
3227# get log list variables
3228# ----------------------
3229
3230sub gm_getloglistvariables {
3231
3232$loglistnumberpadded = sprintf ("%8d", $loglistnumber);
3233$loglistnumberpadded =~ tr/ /0/;
3234
3235($loglistmonthmonth, $loglistdayday, $loglistyear) = split (/\//, $loglistdate);
3236
3237if ((substr($loglistmonthmonth, 0, 1)) eq "0") {
3238 $loglistmonth = substr($loglistmonthmonth, -1, 1);
3239} else {
3240 $loglistmonth = $loglistmonthmonth;
3241}
3242
3243if ((substr($loglistdayday, 0, 1)) eq "0") {
3244 $loglistday = substr($loglistdayday, -1, 1);
3245} else {
3246 $loglistday = $loglistdayday;
3247}
3248
3249if ($loglistyear > 80) {
3250 $loglistyearyear = "19$loglistyear";
3251} else {
3252 $loglistyearyear = "20$loglistyear";
3253}
3254
3255($loglisttime, $loglistampm) = split (/ /, $loglisttimeampm);
3256($loglisthourhour, $loglistminuteminute) = split (/:/, $loglisttime);
3257
3258if ((substr($loglisthourhour, 0, 1)) eq "0") {
3259 $loglisthour = substr($loglisthourhour, -1, 1);
3260} else {
3261 $loglisthour = $loglisthourhour;
3262}
3263
3264if ((substr($loglistminuteminute, 0, 1)) eq "0") {
3265 $loglistminute = substr($loglistminuteminute, -1, 1);
3266} else {
3267 $loglistminute = $loglistminuteminute;
3268}
3269
3270$loglistmilitaryhour = $loglisthour;
3271
3272if ($loglistampm eq "AM") {
3273 $loglistampmdot = "A.M.";
3274 $loglistampmlower = "am";
3275 $loglistampmdotlower = "a.m.";
3276} else {
3277 $loglistampmdot = "P.M.";
3278 $loglistampmlower = "pm";
3279 $loglistampmdotlower = "p.m.";
3280 $loglistmilitaryhour = $loglistmilitaryhour + 12;
3281}
3282
3283$loglistmilitaryhour = sprintf ("%2d", $loglistmilitaryhour);
3284$loglistmilitaryhour =~ tr/ /0/;
3285
3286@months = ("null", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
3287
3288$loglistmonthword = $months[$loglistmonth];
3289$loglistmonthwordshort = substr($loglistmonthword, 0, 3);
3290$loglistmonthwordupper = uc($loglistmonthword);
3291$loglistmonthwordlower = lc($loglistmonthword);
3292$loglistmonthworduppershort = uc($loglistmonthwordshort);
3293$loglistmonthwordlowershort = lc($loglistmonthwordshort);
3294
3295open (FUNNYFEETLOGME, "$EntriesPath/$loglistnumberpadded.cgi") || &gm_dangermouse("Can't read $EntriesPath/$loglistnumberpadded.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.");
3296@loglistentrylines = <FUNNYFEETLOGME>;
3297close (FUNNYFEETLOGME);
3298
3299$gmcounter = 0;
3300
3301foreach (@loglistentrylines) {
3302 chomp ($loglistentrylines[$gmcounter]);
3303 $gmcounter++;
3304}
3305
3306($loglistentrynumber, $loglistentryauthor, $loglistentrysubject, $loglistentryweekdaynumber, $loglistentrymonth, $loglistentryday, $loglistentryyearyear, $loglistentryhour, $loglistentryminute, $loglistentrysecond, $loglistentryampm, $loglistentrypositivekarma, $loglistentrynegativekarma, $loglistentrycommentsnumber, $loglistentryallowkarma, $loglistentryallowcomments, $loglistentryopenstatus, $loglistentrymusic, $loglistentrymood, $loglistentryemoticonsallowed) = split (/\|/, $loglistentrylines[0]);
3307
3308$loglistentrytotalkarma = $loglistentrypositivekarma - $loglistentrynegativekarma;
3309
3310$loglistentrypositivekarmalink = "$cgiwebpath/gm-karma.cgi?vote=positive&entry=$loglistnumberpadded";
3311$loglistentrynegativekarmalink = "$cgiwebpath/gm-karma.cgi?vote=negative&entry=$loglistnumberpadded";
3312
3313open (FUNNYFEETAUTHTWO, "./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.");
3314@gettheauthordata = <FUNNYFEETAUTHTWO>;
3315close (FUNNYFEETAUTHTWO);
3316
3317$loglistentryauthoremail = "";
3318$loglistentryauthorhomepage = "";
3319$loglistentryauthorentrycount = "";
3320
3321foreach $gettheauthordataline (@gettheauthordata) {
3322 chomp ($gettheauthordataline);
3323 @gettheauthorinfo = split (/\|/, $gettheauthordataline);
3324 if ($gettheauthorinfo[0] eq $loglistentryauthor) {
3325 $loglistentryauthoremail = $gettheauthorinfo[2];
3326 $loglistentryauthorhomepage = $gettheauthorinfo[3];
3327 $loglistentryauthorentrycount = $gettheauthorinfo[5];
3328 }
3329}
3330
3331$loglistentryauthorsmartlink = $loglistentryauthor;
3332if ($loglistentryauthoremail ne "") { $loglistentryauthorsmartlink = "<A HREF=\"mailto:$loglistentryauthoremail\">$loglistentryauthor</A>"; }
3333if ($loglistentryauthorhomepage ne "") { $loglistentryauthorsmartlink = "<A HREF=\"$loglistentryauthorhomepage\">$loglistentryauthor</A>"; }
3334
3335$loglistentryfilename = "$EntriesWebPath\/$loglistnumberpadded\.$entrysuffix";
3336
3337$loglistentrycommentspostlink = "$loglistentryfilename\#comments";
3338
3339$loglistentrycommentstatussmart = $gmsmartlinkmanycommentstemplate;
3340
3341if ($loglistentrycommentsnumber eq "0") { $loglistentrycommentstatussmart = $gmsmartlinknocommentstemplate; }
3342if ($loglistentrycommentsnumber eq "1") { $loglistentrycommentstatussmart = $gmsmartlinkonecommenttemplate; }
3343
3344$loglistentrycommentstatussmartupper = uc($loglistentrycommentstatussmart);
3345$loglistentrycommentstatussmartlower = lc($loglistentrycommentstatussmart);
3346
3347$leapyearcheck = $loglistyearyear % 4;
3348
3349$loglistmaxdaysinthismonth = 31;
3350if (($loglistmonthword eq "September") || ($loglistmonthword eq "April") || ($loglistmonthword eq "June") || ($loglistmonthword eq "November")) { $loglistmaxdaysinthismonth = 30; }
3351if ($loglistmonthword eq "February") {
3352 $loglistmaxdaysinthismonth = 28;
3353 if ($leapyearcheck eq "0") { $loglistmaxdaysinthismonth = 29; }
3354}
3355$loglistmaxdaysinpreviousmonth = 31;
3356if (($loglistmonthword eq "October") || ($loglistmonthword eq "May") || ($loglistmonthword eq "July") || ($loglistmonthword eq "December")) { $loglistmaxdaysinpreviousmonth = 30; }
3357if ($loglistmonthword eq "March") {
3358 $loglistmaxdaysinpreviousmonth = 28;
3359 if ($leapyearcheck eq "0") { $loglistmaxdaysinpreviousmonth = 29; }
3360}
3361
3362$loglistweekbeginningmonth = $loglistmonth;
3363$loglistweekbeginningyearyear = $loglistyearyear;
3364$loglistweekendingmonth = $loglistmonth;
3365$loglistweekendingyearyear = $loglistyearyear;
3366
3367$loglistweekbeginningday = $loglistday - $loglistentryweekdaynumber;
3368$loglistweekendingday = $loglistweekbeginningday + 6;
3369
3370if ($loglistweekbeginningday < 1) {
3371 $loglistweekbeginningday = $loglistweekbeginningday + $loglistmaxdaysinpreviousmonth;
3372 if ($loglistweekbeginningday > $loglistday) { $loglistweekbeginningmonth--; }
3373 if ($loglistweekbeginningmonth < 1) {
3374 $loglistweekbeginningmonth = 12;
3375 $loglistweekbeginningyearyear--;
3376 }
3377}
3378
3379if ($loglistweekendingday > $loglistmaxdaysinthismonth) {
3380 $loglistweekendingday = $loglistweekendingday - $loglistmaxdaysinthismonth;
3381 if ($loglistweekendingday < $loglistday) { $loglistweekendingmonth++; }
3382 if ($loglistweekendingmonth > 12) {
3383 $loglistweekendingmonth = 1;
3384 $loglistweekendingyearyear++;
3385 }
3386}
3387
3388$loglistweekbeginningyear = substr($loglistweekbeginningyearyear, -2, 2);
3389$loglistweekendingyear = substr($loglistweekendingyearyear, -2, 2);
3390
3391$loglistweekbeginningdayday = sprintf ("%2d", $loglistweekbeginningday);
3392$loglistweekbeginningdayday =~ tr/ /0/;
3393$loglistweekendingdayday = sprintf ("%2d", $loglistweekendingday);
3394$loglistweekendingdayday =~ tr/ /0/;
3395$loglistweekbeginningmonthmonth = sprintf ("%2d", $loglistweekbeginningmonth);
3396$loglistweekbeginningmonthmonth =~ tr/ /0/;
3397$loglistweekendingmonthmonth = sprintf ("%2d", $loglistweekendingmonth);
3398$loglistweekendingmonthmonth =~ tr/ /0/;
3399
3400$loglistweekbeginningweekday = "Sunday";
3401$loglistweekbeginningmonthword = $months[$loglistweekbeginningmonth];
3402$loglistweekbeginningweekdayshort = substr($loglistweekbeginningweekday, 0, 3);
3403$loglistweekbeginningmonthwordshort = substr($loglistweekbeginningmonthword, 0, 3);
3404$loglistweekbeginningweekdayupper = uc($loglistweekbeginningweekday);
3405$loglistweekbeginningmonthwordupper = uc($loglistweekbeginningmonthword);
3406$loglistweekbeginningweekdaylower = lc($loglistweekbeginningweekday);
3407$loglistweekbeginningmonthwordlower = lc($loglistweekbeginningmonthword);
3408$loglistweekbeginningweekdayuppershort = uc($loglistweekbeginningweekdayshort);
3409$loglistweekbeginningmonthworduppershort = uc($loglistweekbeginningmonthwordshort);
3410$loglistweekbeginningweekdaylowershort = lc($loglistweekbeginningweekdayshort);
3411$loglistweekbeginningmonthwordlowershort = lc($loglistweekbeginningmonthwordshort);
3412
3413$loglistweekendingweekday = "Saturday";
3414$loglistweekendingmonthword = $months[$loglistweekendingmonth];
3415$loglistweekendingweekdayshort = substr($loglistweekendingweekday, 0, 3);
3416$loglistweekendingmonthwordshort = substr($loglistweekendingmonthword, 0, 3);
3417$loglistweekendingweekdayupper = uc($loglistweekendingweekday);
3418$loglistweekendingmonthwordupper = uc($loglistweekendingmonthword);
3419$loglistweekendingweekdaylower = lc($loglistweekendingweekday);
3420$loglistweekendingmonthwordlower = lc($loglistweekendingmonthword);
3421$loglistweekendingweekdayuppershort = uc($loglistweekendingweekdayshort);
3422$loglistweekendingmonthworduppershort = uc($loglistweekendingmonthwordshort);
3423$loglistweekendingweekdaylowershort = lc($loglistweekendingweekdayshort);
3424$loglistweekendingmonthwordlowershort = lc($loglistweekendingmonthwordshort);
3425
3426$loglistpagelink = "$EntriesWebPath\/$loglistnumberpadded\.$entrysuffix";
3427
3428if ($keepmonthlyarchives eq "no") {
3429 $loglistpagearchivelogindexlink = "{{pageindexlink}}";
3430} else {
3431 if ($archiveformat eq "week") {
3432 $loglistpagearchivelogindexlink = "$EntriesWebPath/archive-$loglistweekbeginningmonthmonth$loglistweekbeginningdayday$loglistweekbeginningyearyear-$loglistweekendingmonthmonth$loglistweekendingdayday$loglistweekendingyearyear\.$logarchivesuffix";
3433 } else {
3434 $loglistpagearchivelogindexlink = "$EntriesWebPath/archive-$loglistmonthmonth$loglistyearyear\.$logarchivesuffix";
3435 }
3436}
3437
3438$loglistmainbody = $loglistentrylines[2];
3439$loglistmorebody = $loglistentrylines[3];
3440
3441if (($loglistmainbody =~ /\|\*\|/) || ($loglistmorebody =~ /\|\*\|/)) {
3442 $loglistmainbody =~ s/\|\*\|/<BR>/g;
3443 $loglistmorebody =~ s/\|\*\|/<BR>/g;
3444}
3445if (($loglistmainbody =~ /\n/) || ($loglistmorebody =~ /\n/)) {
3446 $loglistmainbody =~ s/\n/<BR>/g;
3447 $loglistmorebody =~ s/\n/<BR>/g;
3448}
3449if (($loglistmainbody =~ /<BR><BR>/) || ($loglistmorebody =~ /<BR><BR>/)) {
3450 $loglistmainbody =~ s/<BR><BR>/$gmparaseparationtemplate/g;
3451 $loglistmorebody =~ s/<BR><BR>/$gmparaseparationtemplate/g;
3452}
3453
3454if (($censorenabled eq "both") || ($censorenabled eq "entries")) {
3455 unless ($censorlist eq "") {
3456 @censoredterms = split(/\|\*\|/, $censorlist);
3457 foreach $thisterm (@censoredterms) {
3458 unless ($thisterm eq "") {
3459 if ((substr($thisterm, 0, 1) eq "[") && (substr($thisterm, -1, 1) eq "]")) {
3460 $thisrealterm = $thisterm;
3461 $thisrealterm =~ s/\[//g;
3462 $thisrealterm =~ s/\]//g;
3463 $thisrealtermlength = length($thisrealterm);
3464 $thisrealtermreplace = "*" x $thisrealtermlength;
3465 $thisrealtermreplacedash = "-" x $thisrealtermlength;
3466 if ($loglistsubject =~ m/$thisrealterm/i) {
3467 $loglistsubject =~ s/\b$thisrealterm\b/$thisrealtermreplacedash/isg;
3468 }
3469 if ($loglistmainbody =~ m/$thisrealterm/i) {
3470 $loglistmainbody =~ s/\b$thisrealterm\b/$thisrealtermreplace/isg;
3471 }
3472 if ($loglistmorebody =~ m/$thisrealterm/i) {
3473 $loglistmorebody =~ s/\b$thisrealterm\b/$thisrealtermreplace/isg;
3474 }
3475 } else {
3476 $thisrealtermlength = length($thisterm);
3477 $thisrealtermreplace = "*" x $thisrealtermlength;
3478 $thisrealtermreplacedash = "-" x $thisrealtermlength;
3479 if ($loglistsubject =~ m/$thisterm/i) {
3480 $loglistsubject =~ s/\b$thisterm\b/$thisrealtermreplacedash/isg;
3481 }
3482 if ($loglistmainbody =~ m/$thisterm/i) {
3483 $loglistmainbody =~ s/\b$thisterm\b/$thisrealtermreplace/isg;
3484 }
3485 if ($loglistmorebody =~ m/$thisterm/i) {
3486 $loglistmorebody =~ s/\b$thisterm\b/$thisrealtermreplace/isg;
3487 }
3488 }
3489 }
3490 }
3491 }
3492}
3493
3494# changed deprecated <b>, <i>, and <u> to corresponding css properties: flipped cracker 9/15/2003
3495# removed code for entry subject : 1.3.1
3496# flipped cracker 6/29/2004
3497if (($inlineformatting eq "entries") || ($inlineformatting eq "both")) {
3498 if (($loglistmainbody =~ /\*\*(.*?)\*\*/) || ($loglistmainbody =~ /\\\\(.*?)\\\\/) || ($loglistmainbody =~ /__(.*?)__/)) {
3499 $loglistmainbody =~ s/\*\*(.*?)\*\*/<span style="font-weight:bold;">$1<\/span>/isg;
3500 $loglistmainbody =~ s/\\\\(.*?)\\\\/<span style="font-style:italic;">$1<\/span>/isg;
3501 $loglistmainbody =~ s/__(.*?)__/<span style="text-decoration:underline;">$1<\/span>/isg;
3502 }
3503 if (($loglistmorebody =~ /\*\*(.*?)\*\*/) || ($loglistmorebody =~ /\\\\(.*?)\\\\/) || ($loglistmorebody =~ /__(.*?)__/)) {
3504 $loglistmorebody =~ s/\*\*(.*?)\*\*/<span style="font-weight:bold;">$1<\/span>/isg;
3505 $loglistmorebody =~ s/\\\\(.*?)\\\\/<span style="font-style:italic;">$1<\/span>/isg;
3506 $loglistmorebody =~ s/__(.*?)__/<span style="text-decoration:underline;">$1<\/span>/isg;
3507 }
3508}
3509#changed 9/15/2003
3510
3511}
3512
3513# --------------------------
3514# entry list sub-sub routine
3515# --------------------------
3516
3517sub entrylistsubsub {
3518
3519$listsubsub =~ s/{{year}}/$loglistyear/gi;
3520$listsubsub =~ s/{{yearyear}}/$loglistyearyear/gi;
3521$listsubsub =~ s/{{month}}/$loglistmonth/gi;
3522$listsubsub =~ s/{{monthmonth}}/$loglistmonthmonth/gi;
3523$listsubsub =~ s/{{monthword}}/$loglistmonthword/gi;
3524$listsubsub =~ s/{{monthwordshort}}/$loglistmonthwordshort/gi;
3525$listsubsub =~ s/{{monthwordupper}}/$loglistmonthwordupper/gi;
3526$listsubsub =~ s/{{monthwordlower}}/$loglistmonthwordlower/gi;
3527$listsubsub =~ s/{{monthworduppershort}}/$loglistmonthworduppershort/gi;
3528$listsubsub =~ s/{{monthwordlowershort}}/$loglistmonthwordlowershort/gi;
3529$listsubsub =~ s/{{day}}/$loglistday/gi;
3530$listsubsub =~ s/{{dayday}}/$loglistdayday/gi;
3531$listsubsub =~ s/{{hour}}/$loglisthour/gi;
3532$listsubsub =~ s/{{hourhour}}/$loglisthourhour/gi;
3533$listsubsub =~ s/{{militaryhour}}/$loglistmilitaryhour/gi;
3534$listsubsub =~ s/{{minute}}/$loglistminute/gi;
3535$listsubsub =~ s/{{minuteminute}}/$loglistminuteminute/gi;
3536$listsubsub =~ s/{{ampm}}/$loglistampm/gi;
3537$listsubsub =~ s/{{ampmlower}}/$loglistampm/gi;
3538$listsubsub =~ s/{{ampmdot}}/$loglistampmdot/gi;
3539$listsubsub =~ s/{{ampmdotlower}}/$loglistampmdotlower/gi;
3540$listsubsub =~ s/{{author}}/$loglistauthor/gi;
3541$listsubsub =~ s/{{entrysubject}}/$loglistsubject/gi;
3542$listsubsub =~ s/{{entrynumber}}/$loglistnumber/gi;
3543$listsubsub =~ s/{{entrynumberpadded}}/$loglistnumberpadded/gi;
3544$listsubsub =~ s/{{pagelink}}/$loglistpagelink/gi;
3545$listsubsub =~ s/{{pagearchivelogindexlink}}/$loglistpagearchivelogindexlink/gi;
3546
3547### add {{entrymusic}} and {{entrymood}} to {{logentrylist}} and {{calendar}}
3548### merged 1.3.1
3549### added 1/21/05 flipped cracker
3550$listsubsub =~ s/{{entrymusic}}/$loglistentrymusic/gi;
3551$listsubsub =~ s/{{entrymood}}/$loglistentrymood/gi;
3552### END additions
3553
3554if ($listsubsub =~ m/{{author/i) {
3555 $listsubsub =~ s/{{author}}/$loglistentryauthor/gi;
3556 $listsubsub =~ s/{{authoremail}}/$loglistentryauthoremail/gi;
3557 $listsubsub =~ s/{{authorhomepage}}/$loglistentryauthorhomepage/gi;
3558 $listsubsub =~ s/{{authorentrycount}}/$loglistentryauthorentrycount/gi;
3559}
3560
3561if (($listsubsub =~ m/{{weekbeginning/i) || ($listsubsub =~ m/{{weekending/i)) {
3562 $listsubsub =~ s/{{weekbeginningday}}/$loglistweekbeginningday/gi;
3563 $listsubsub =~ s/{{weekbeginningdayday}}/$loglistweekbeginningdayday/gi;
3564 $listsubsub =~ s/{{weekbeginningmonth}}/$loglistweekbeginningmonth/gi;
3565 $listsubsub =~ s/{{weekbeginningmonthmonth}}/$loglistweekbeginningmonthmonth/gi;
3566 $listsubsub =~ s/{{weekbeginningyear}}/$loglistweekbeginningyear/gi;
3567 $listsubsub =~ s/{{weekbeginningyearyear}}/$loglistweekbeginningyearyear/gi;
3568 $listsubsub =~ s/{{weekbeginningweekday}}/$loglistweekbeginningweekday/gi;
3569 $listsubsub =~ s/{{weekbeginningweekdayshort}}/$loglistweekbeginningweekdayshort/gi;
3570 $listsubsub =~ s/{{weekbeginningmonthword}}/$loglistweekbeginningmonthword/gi;
3571 $listsubsub =~ s/{{weekbeginningmonthwordshort}}/$loglistweekbeginningmonthwordshort/gi;
3572 $listsubsub =~ s/{{weekbeginningweekdayupper}}/$loglistweekbeginningweekdayupper/gi;
3573 $listsubsub =~ s/{{weekbeginningmonthwordupper}}/$loglistweekbeginningmonthwordupper/gi;
3574 $listsubsub =~ s/{{weekbeginningweekdaylower}}/$loglistweekbeginningweekdaylower/gi;
3575 $listsubsub =~ s/{{weekbeginningmonthwordlower}}/$loglistweekbeginningmonthwordlower/gi;
3576 $listsubsub =~ s/{{weekbeginningweekdayuppershort}}/$loglistweekbeginningweekdayuppershort/gi;
3577 $listsubsub =~ s/{{weekbeginningmonthworduppershort}}/$loglistweekbeginningmonthworduppershort/gi;
3578 $listsubsub =~ s/{{weekbeginningweekdaylowershort}}/$loglistweekbeginningweekdaylowershort/gi;
3579 $listsubsub =~ s/{{weekbeginningmonthwordlowershort}}/$loglistweekbeginningmonthwordlowershort/gi;
3580 $listsubsub =~ s/{{weekendingday}}/$loglistweekendingday/gi;
3581 $listsubsub =~ s/{{weekendingdayday}}/$loglistweekendingdayday/gi;
3582 $listsubsub =~ s/{{weekendingmonth}}/$loglistweekendingmonth/gi;
3583 $listsubsub =~ s/{{weekendingmonthmonth}}/$loglistweekendingmonthmonth/gi;
3584 $listsubsub =~ s/{{weekendingyear}}/$loglistweekendingyear/gi;
3585 $listsubsub =~ s/{{weekendingyearyear}}/$loglistweekendingyearyear/gi;
3586 $listsubsub =~ s/{{weekendingweekday}}/$loglistweekendingweekday/gi;
3587 $listsubsub =~ s/{{weekendingweekdayshort}}/$loglistweekendingweekdayshort/gi;
3588 $listsubsub =~ s/{{weekendingmonthword}}/$loglistweekendingmonthword/gi;
3589 $listsubsub =~ s/{{weekendingmonthwordshort}}/$loglistweekendingmonthwordshort/gi;
3590 $listsubsub =~ s/{{weekendingweekdayupper}}/$loglistweekendingweekdayupper/gi;
3591 $listsubsub =~ s/{{weekendingmonthwordupper}}/$loglistweekendingmonthwordupper/gi;
3592 $listsubsub =~ s/{{weekendingweekdaylower}}/$loglistweekendingweekdaylower/gi;
3593 $listsubsub =~ s/{{weekendingmonthwordlower}}/$loglistweekendingmonthwordlower/gi;
3594 $listsubsub =~ s/{{weekendingweekdayuppershort}}/$loglistweekendingweekdayuppershort/gi;
3595 $listsubsub =~ s/{{weekendingmonthworduppershort}}/$loglistweekendingmonthworduppershort/gi;
3596 $listsubsub =~ s/{{weekendingweekdaylowershort}}/$loglistweekendingweekdaylowershort/gi;
3597 $listsubsub =~ s/{{weekendingmonthwordlowershort}}/$loglistweekendingmonthwordlowershort/gi;
3598}
3599
3600if (($listsubsub =~ m/karma}}/i) || ($listsubsub =~ m/karmalink}}/i)) {
3601 $listsubsub =~ s/{{positivekarmalink}}/$loglistentrypositivekarmalink/gi;
3602 $listsubsub =~ s/{{negativekarmalink}}/$loglistentrynegativekarmalink/gi;
3603 $listsubsub =~ s/{{positivekarma}}/$loglistentrypositivekarma/gi;
3604 $listsubsub =~ s/{{negativekarma}}/$loglistentrynegativekarma/gi;
3605 $listsubsub =~ s/{{totalkarma}}/$loglistentrytotalkarma/gi;
3606}
3607
3608if ($listsubsub =~ m/{{comments/i) {
3609 $listsubsub =~ s/{{commentsnumber}}/$loglistentrycommentsnumber/gi;
3610 $listsubsub =~ s/{{commentstatussmart}}/$loglistentrycommentstatussmart/gi;
3611 $listsubsub =~ s/{{commentstatussmartupper}}/$loglistentrycommentstatussmartupper/gi;
3612 $listsubsub =~ s/{{commentstatussmartlower}}/$loglistentrycommentstatussmartlower/gi;
3613}
3614
3615if ($listsubsub =~ m/{{entry/i) {
3616 $listsubsub =~ s/{{entrymainbody}}/$loglistmainbody/gi;
3617 $listsubsub =~ s/{{entrymorebody}}/$loglistmorebody/gi;
3618 $listsubsub =~ s/{{entrycomments}}/$loglistcomments/gi;
3619 if ($listsubsub =~ m/{{entrymainbodyfirstwords (\d+)}}/i) {
3620 until ($listsubsub !~ m/{{entrymainbodyfirstwords (\d+)}}/isg) {
3621 $firstwordscount = $1;
3622 $grabmainbodywords = $loglistmainbody;
3623 if ($grabmainbodywords =~ m/{{link/i) {
3624 $grabmainbodywords =~ s/({{linkmo) (http|https|ftp)(:\/\/\S+?) (.+?)(\|)(.+?)(}})/$4/isg;
3625 $grabmainbodywords =~ s/({{link) (http|https|ftp)(:\/\/\S+?)(}})/$2$3/isg;
3626 $grabmainbodywords =~ s/({{link) (http|https|ftp)(:\/\/\S+?) (.+?)(}})/$4/isg;
3627###########################################################
3628# 9/2/2001 - CHERYL LAMBERT
3629# ADDED {{linkblank}} TEMPLATE VARIABLE SO THAT I CAN USE target="_blank" TO OPEN NEW WINDOWS
3630 $grabmainbodywords =~ s/({{linkblankmo) (http|https|ftp)(:\/\/\S+?) (.+?)(\|)(.+?)(}})/$4/isg;
3631 $grabmainbodywords =~ s/({{linkblank) (http|https|ftp)(:\/\/\S+?)(}})/$2$3/isg;
3632 $grabmainbodywords =~ s/({{linkblank) (http|https|ftp)(:\/\/\S+?) (.+?)(}})/$4/isg;
3633###########################################################
3634 }
3635 if ($grabmainbodywords =~ m/{{email/i) {
3636 $grabmainbodywords =~ s/({{emailmo) (\S+\@\S+?) (.+?)(\|)(.+?)(}})/$3/isg;
3637 $grabmainbodywords =~ s/({{email) (\S+\@\S+?)(}})/$2/isg;
3638 $grabmainbodywords =~ s/({{email) (\S+\@\S+?) (.+?)(}})/$3/isg;
3639 }
3640 $grabmainbodywords =~ s/<([^>]|\n)*>/ /g;
3641 $grabmainbodywords =~ s/{{(.*?)}}/ /g;
3642 $grabmainbodywords =~ s/\n/ /g;
3643 $grabmainbodywords =~ s/\r/ /g;
3644 $grabmainbodywords =~ s/\|\*\|/ /g;
3645 $grabmainbodywords =~ s/^\s+//;
3646 $grabmainbodywords =~ s/\s+$//;
3647 $grabmainbodywords =~ s/\s{2,}/ /g;
3648 @grabmainbodywordslist = split (/ /, $grabmainbodywords);
3649 $countwordsfromhere = 0;
3650 (@finalmainbodywordslist, @finalmainbodywordslist = ());
3651 if ($firstwordscount < 1) { $firstwordscount = 1; }
3652 do {
3653 $finalmainbodywordslist[$countwordsfromhere] = $grabmainbodywordslist[$countwordsfromhere];
3654 $countwordsfromhere++;
3655 } until $countwordsfromhere eq $firstwordscount;
3656 $finalmainbodyfirstwords = join (" ", @finalmainbodywordslist);
3657 $finalmainbodyfirstwords =~ s/^\s+//;
3658 $finalmainbodyfirstwords =~ s/\s+$//;
3659 $finalmainbodyfirstwords =~ s/\s{2,}//g;
3660 if (substr($finalmainbodyfirstwords, -1) =~ /\W/) { chop($finalmainbodyfirstwords); }
3661 if (substr($finalmainbodyfirstwords, -1) eq / /) { chop($finalmainbodyfirstwords); }
3662 $listsubsub =~ s/{{entrymainbodyfirstwords ($firstwordscount)}}/$finalmainbodyfirstwords/isg;
3663 }
3664 }
3665 if ($listsubsub =~ m/{{entrymorebodyfirstwords (\d+)}}/i) {
3666 until ($listsubsub !~ m/{{entrymorebodyfirstwords (\d+)}}/isg) {
3667 $firstwordscount = $1;
3668 if ($loglistmorebody eq "") {
3669 $listsubsub =~ s/{{entrymorebodyfirstwords ($firstwordscount)}}//isg;
3670 } else {
3671 $grabmorebodywords = $loglistmorebody;
3672 if ($grabmorebodywords =~ m/{{link/i) {
3673 $grabmorebodywords =~ s/({{linkmo) (http|https|ftp)(:\/\/\S+?) (.+?)(\|)(.+?)(}})/$4/isg;
3674 $grabmorebodywords =~ s/({{link) (http|https|ftp)(:\/\/\S+?)(}})/$2$3/isg;
3675 $grabmorebodywords =~ s/({{link) (http|https|ftp)(:\/\/\S+?) (.+?)(}})/$4/isg;
3676###########################################################
3677# 9/2/2001 - CHERYL LAMBERT
3678# ADDED {{linkblank}} TEMPLATE VARIABLE SO THAT I CAN USE target="_blank" TO OPEN NEW WINDOWS
3679 $grabmorebodywords =~ s/({{linkblankmo) (http|https|ftp)(:\/\/\S+?) (.+?)(\|)(.+?)(}})/$4/isg;
3680 $grabmorebodywords =~ s/({{linkblank) (http|https|ftp)(:\/\/\S+?)(}})/$2$3/isg;
3681 $grabmorebodywords =~ s/({{linkblank) (http|https|ftp)(:\/\/\S+?) (.+?)(}})/$4/isg;
3682###########################################################
3683 }
3684 if ($grabmorebodywords =~ m/{{email/i) {
3685 $grabmorebodywords =~ s/({{emailmo) (\S+\@\S+?) (.+?)(\|)(.+?)(}})/$3/isg;
3686 $grabmorebodywords =~ s/({{email) (\S+\@\S+?)(}})/$2/isg;
3687 $grabmorebodywords =~ s/({{email) (\S+\@\S+?) (.+?)(}})/$3/isg;
3688 }
3689 $grabmorebodywords =~ s/<([^>]|\n)*>/ /g;
3690 $grabmorebodywords =~ s/{{(.*?)}}/ /g;
3691 $grabmorebodywords =~ s/\n/ /g;
3692 $grabmorebodywords =~ s/\r/ /g;
3693 $grabmorebodywords =~ s/\|\*\|/ /g;
3694 $grabmorebodywords =~ s/^\s+//;
3695 $grabmorebodywords =~ s/\s+$//;
3696 $grabmorebodywords =~ s/\s{2,}/ /g;
3697 @grabmorebodywordslist = split (/ /, $grabmorebodywords);
3698 $countwordsfromhere = 0;
3699 (@finalmorebodywordslist, @finalmorebodywordslist = ());
3700 if ($firstwordscount < 1) { $firstwordscount = 1; }
3701 do {
3702 $finalmorebodywordslist[$countwordsfromhere] = $grabmorebodywordslist[$countwordsfromhere];
3703 $countwordsfromhere++;
3704 } until $countwordsfromhere eq $firstwordscount;
3705 $finalmorebodyfirstwords = join (" ", @finalmorebodywordslist);
3706 $finalmorebodyfirstwords =~ s/^\s+//;
3707 $finalmorebodyfirstwords =~ s/\s+$//;
3708 $finalmorebodyfirstwords =~ s/\s{2,}//g;
3709 if (substr($finalmorebodyfirstwords, -1) =~ /\W/) { chop($finalmorebodyfirstwords); }
3710 if (substr($finalmorebodyfirstwords, -1) eq / /) { chop($finalmorebodyfirstwords); }
3711 $listsubsub =~ s/{{entrymorebodyfirstwords ($firstwordscount)}}/$finalmorebodyfirstwords/isg;
3712 }
3713 }
3714 }
3715}
3716
3717}
3718
3719# ----------------------------------
3720# generate external author variables
3721# ----------------------------------
3722
3723sub gm_generateexternalauthorvariables {
3724
3725open (FUNNYFEETAUTHORS, "./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.");
3726@gettheexternalauthordata = <FUNNYFEETAUTHORS>;
3727close (FUNNYFEETAUTHORS);
3728
3729foreach $gettheexternalauthordataline (@gettheexternalauthordata) {
3730 chomp ($gettheexternalauthordataline);
3731 @gettheexternalauthorinfo = split (/\|/, $gettheexternalauthordataline);
3732 $thisexternalauthor = $gettheexternalauthorinfo[0];
3733 $thisexternalauthoremail = $gettheexternalauthorinfo[2];
3734 $thisexternalauthorhomepage = $gettheexternalauthorinfo[3];
3735 $thisexternalauthorentrycount = $gettheexternalauthorinfo[5];
3736
3737 $thisexternalauthorsmartlink = $thisexternalauthor;
3738 if ($thisexternalauthoremail ne "") { $thisexternalauthorsmartlink = "<A HREF=\"mailto:$thisentryauthoremail\">$thisentryauthor</A>"; }
3739 if ($thisexternalauthorhomepage ne "") { $thisexternalauthorsmartlink = "<A HREF=\"$thisentryauthorhomepage\">$thisentryauthor</A>"; }
3740
3741 $entryreturn =~ s/{{authoremail $thisexternalauthor}}/$thisexternalauthoremail/isg;
3742 $entryreturn =~ s/{{authorhomepage $thisexternalauthor}}/$thisexternalauthorhomepage/isg;
3743 $entryreturn =~ s/{{authorsmartlink $thisexternalauthor}}/$thisexternalauthorsmartlink/isg;
3744 $entryreturn =~ s/{{authorentrycount $thisexternalauthor}}/$thisexternalauthorentrycount/isg;
3745}
3746
3747}
3748
3749# -----------------
3750# generate calendar
3751# -----------------
3752
3753sub gm_generatecalendar {
3754
3755$usethisentrydayday = sprintf ("%2d", $usethisentryday);
3756$usethisentrydayday =~ tr/ /0/;
3757$usethisentrymonthmonth = sprintf ("%2d", $usethisentrymonth);
3758$usethisentrymonthmonth =~ tr/ /0/;
3759$usethisentryyear = substr($usethisentryyearyear, -2, 2);
3760$usethisentrymonthwordupper = uc($usethisentrymonthword);
3761$usethisentrymonthwordlower = lc($usethisentrymonthword);
3762$usethisentrymonthwordshort = substr($usethisentrymonthword, 0, 3);
3763$usethisentrymonthworduppershort = uc($usethisentrymonthwordshort);
3764$usethisentrymonthwordlowershort = lc($usethisentrymonthwordshort);
3765
3766$leapyearcheck = $usethisentryyearyear % 4;
3767
3768$maxdaysinthismonth = 31;
3769if (($usethisentrymonthword eq "September") || ($usethisentrymonthword eq "April") || ($usethisentrymonthword eq "June") || ($usethisentrymonthword eq "November")) { $maxdaysinthismonth = 30; }
3770if ($usethisentrymonthword eq "February") {
3771 $maxdaysinthismonth = 28;
3772 if ($leapyearcheck eq "0") { $maxdaysinthismonth = 29; }
3773}
3774
3775$maxdaysinpreviousmonth = 31;
3776if (($usethisentrymonthword eq "October") || ($usethisentrymonthword eq "May") || ($usethisentrymonthword eq "July") || ($usethisentrymonthword eq "December")) { $maxdaysinpreviousmonth = 30; }
3777if ($usethisentrymonthword eq "March") {
3778 $maxdaysinpreviousmonth = 28;
3779 if ($leapyearcheck eq "0") { $maxdaysinpreviousmonth = 29; }
3780}
3781
3782$calendarweekday[$usethisentryweekdaynumber] = $usethisentryday;
3783$weekcountfrom = $usethisentryweekdaynumber;
3784$weekcountfromday = $usethisentryday;
3785$weekcountspecial = "none";
3786
3787unless ($weekcountfrom eq "0") {
3788 do {
3789 $weekcountfrom--;
3790 $weekcountfromday--;
3791 if ($weekcountfromday eq 0) {
3792 $weekcountfromday = $maxdaysinpreviousmonth;
3793 $weekcountspecial = "gotolastmonth";
3794 }
3795 unless ($weekcountfrom < 0) { $calendarweekday[$weekcountfrom] = $weekcountfromday; }
3796 } until $weekcountfrom eq "0";
3797}
3798
3799$weekcountfrom = $usethisentryweekdaynumber;
3800$weekcountfromday = $usethisentryday;
3801
3802unless ($weekcountfrom eq "6") {
3803 do {
3804 $weekcountfrom++;
3805 $weekcountfromday++;
3806 if ($weekcountfromday > $maxdaysinthismonth) {
3807 $weekcountfromday = 1;
3808 $weekcountspecial = "gotonextmonth";
3809 }
3810 unless ($weekcountfrom > 6) { $calendarweekday[$weekcountfrom] = $weekcountfromday; }
3811 } until $weekcountfrom eq "6";
3812}
3813
3814$countfromhere = $usethisentryday;
3815$calendardataday[$usethisentryday] = $usethisentryweekdaynumber;
3816
3817unless ($countfromhere eq "1") {
3818 do {
3819 $thistempday = $calendardataday[$countfromhere];
3820 $thistempday--;
3821 $countfromhere--;
3822 if ($thistempday < 0) { $thistempday = 6; }
3823 $calendardataday[$countfromhere] = $thistempday;
3824 } until $countfromhere eq "1";
3825}
3826
3827$weekcountfromday = $usethisentryday;
3828$countfromhere = $usethisentryday;
3829
3830unless ($countfromhere eq $maxdaysinthismonth) {
3831 do {
3832 $thistempday = $calendardataday[$countfromhere];
3833 $thistempday++;
3834 $countfromhere++;
3835 if ($thistempday > 6) { $thistempday = 0; }
3836 $calendardataday[$countfromhere] = $thistempday;
3837 } until $countfromhere eq $maxdaysinthismonth;
3838}
3839
3840$calendarfull = $gmcalendartablebeginningtemplate;
3841
3842$calendarfull .= "$gmcalendarblankcelltemplate" x $calendardataday[1];
3843
3844open (FUNNYFEETLIST, "./gm-entrylist.cgi") || &gm_dangermouse("Can't read the entry list file. Please make sure that gm-entrylist.cgi is in the same directory as all your other Greymatter files and is CHMODed to 666; also, try running Diagnostics & Repair in the Configuration screen.");
3845@loglistloglines = <FUNNYFEETLIST>;
3846close (FUNNYFEETLIST);
3847
3848$loglistdates = "";
3849
3850foreach $thisloglistline (@loglistloglines) {
3851 ($thisloglistnumber, $thisloglistauthor, $thisloglistsubject, $thisloglistdate, $thisloglisttimeampm, $thisloglistopenstatus, $thisloglistmorestatus, $thisloglistentrymusic, $thisloglistentrymood, $thisloglistemoticonstatus) = split (/\|/, $thisloglistline);
3852 unless ($thisloglistopenstatus eq "C") { $loglistdates .= "$thisloglistdate "; }
3853}
3854
3855$weekcountfrom = 0;
3856$calendarweekfull = "";
3857
3858do {
3859 $currentcountday = $calendarweekday[$weekcountfrom];
3860 $currentcountmonth = $usethisentrymonth;
3861 $currentcountyearyear = $usethisentryyearyear;
3862 if (($currentcountday > 20) && ($weekcountspecial eq "gotolastmonth")) {
3863 $currentcountmonth--;
3864 if ($currentcountmonth < 1) {
3865 $currentcountmonth = 12;
3866 $currentcountyearyear--;
3867 }
3868 }
3869 if (($currentcountday < 10) && ($weekcountspecial eq "gotonextmonth")) {
3870 $currentcountmonth++;
3871 if ($currentcountmonth > 12) {
3872 $currentcountmonth = 1;
3873 $currentcountyearyear++;
3874 }
3875 }
3876 $currentcountdayday = sprintf ("%2d", $currentcountday);
3877 $currentcountdayday =~ tr/ /0/;
3878 $currentcountmonthmonth = sprintf ("%2d", $currentcountmonth);
3879 $currentcountmonthmonth =~ tr/ /0/;
3880 $currentcountyear = substr($currentcountyearyear, -2, 2);
3881 $thisweeklistdate = "$currentcountmonthmonth\/$currentcountdayday\/$currentcountyear";
3882 if ($loglistdates =~ /$thisweeklistdate/) {
3883 if ($generateentrypages eq "no") {
3884 foreach $thisloglistline (@loglistloglines) {
3885 chomp ($thisloglistline);
3886 ($loglistnumber, $loglistauthor, $loglistsubject, $loglistdate, $loglisttimeampm, $loglistopenstatus, $loglistmorestatus) = split (/\|/, $thisloglistline);
3887 if ($loglistdate eq $thisweeklistdate) {
3888 &gm_getloglistvariables;
3889 $listsubsub = $gmcalendarweekfulldaytemplate;
3890 &entrylistsubsub;
3891 $calendarweekfull .= $listsubsub;
3892 }
3893 }
3894 } else {
3895 $thiscalendarweeklink = "";
3896 foreach $thisloglistline (@loglistloglines) {
3897 chomp ($thisloglistline);
3898 ($loglistnumber, $loglistauthor, $loglistsubject, $loglistdate, $loglisttimeampm, $loglistopenstatus, $loglistmorestatus) = split (/\|/, $thisloglistline);
3899 if (($loglistdate eq $thisweeklistdate) && ($thiscalendarweeklink eq "")) {
3900 unless (($thisloglistmorestatus eq "N") && ($linktocalendarentries eq "more")) {
3901 $thiscalendarweeklink = "yes";
3902 }
3903 }
3904 }
3905 if ($thiscalendarweeklink eq "") {
3906 $listsubsub = $gmcalendarweekfulldaytemplate;
3907 $listsubsub =~ s/{{day}}/$currentcountday/g;
3908 $listsubsub =~ s/{{day}}/$currentcountday/g;
3909 $listsubsub =~ s/{{month}}/$currentcountmonth/g;
3910 $listsubsub =~ s/{{monthmonth}}/$currentcountmonthmonth/g;
3911 $listsubsub =~ s/{{year}}/$currentcountyear/g;
3912 $listsubsub =~ s/{{yearyear}}/$currentcountyearyear/g;
3913 $calendarweekfull .= $listsubsub;
3914 } else {
3915 foreach $thisloglistline (@loglistloglines) {
3916 chomp ($thisloglistline);
3917 ($loglistnumber, $loglistauthor, $loglistsubject, $loglistdate, $loglisttimeampm, $loglistopenstatus, $loglistmorestatus) = split (/\|/, $thisloglistline);
3918 if (($loglistdate eq $thisweeklistdate) && ($thiscalendarweeklink eq "yes") && ($loglistopenstatus ne "C")) {
3919 &gm_getloglistvariables;
3920 $listsubsub = $gmcalendarweekfulldaylinktemplate;
3921 &entrylistsubsub;
3922 $calendarweekfull .= $listsubsub;
3923 $thiscalendarweeklink = "";
3924 }
3925 }
3926 }
3927 }
3928 } else {
3929 $listsubsub = $gmcalendarweekfulldaytemplate;
3930 $listsubsub =~ s/{{day}}/$currentcountday/g;
3931 $listsubsub =~ s/{{day}}/$currentcountday/g;
3932 $listsubsub =~ s/{{month}}/$currentcountmonth/g;
3933 $listsubsub =~ s/{{monthmonth}}/$currentcountmonthmonth/g;
3934 $listsubsub =~ s/{{year}}/$currentcountyear/g;
3935 $listsubsub =~ s/{{yearyear}}/$currentcountyearyear/g;
3936 $calendarweekfull .= $listsubsub;
3937 }
3938 $weekcountfrom++;
3939} until $weekcountfrom eq "7";
3940
3941$countfromhere = 1;
3942
3943do {
3944 $countfromherepadded = sprintf ("%2d", $countfromhere);
3945 $countfromherepadded =~ tr/ /0/;
3946 $thislistdate = "$usethisentrymonthmonth\/$countfromherepadded\/$usethisentryyear";
3947 if ($loglistdates =~ /$thislistdate/) {
3948 if ($generateentrypages eq "no") {
3949 foreach $thisloglistline (@loglistloglines) {
3950 chomp ($thisloglistline);
3951 ($loglistnumber, $loglistauthor, $loglistsubject, $loglistdate, $loglisttimeampm, $loglistopenstatus, $loglistmorestatus) = split (/\|/, $thisloglistline);
3952 if ($loglistdate eq $thislistdate) {
3953 &gm_getloglistvariables;
3954 $listsubsub = $gmcalendarfullcelltemplate;
3955 &entrylistsubsub;
3956 $calendarfull .= $listsubsub;
3957 }
3958 }
3959 } else {
3960 $thiscalendarlink = "";
3961 foreach $thisloglistline (@loglistloglines) {
3962 chomp ($thisloglistline);
3963 ($loglistnumber, $loglistauthor, $loglistsubject, $loglistdate, $loglisttimeampm, $loglistopenstatus, $loglistmorestatus) = split (/\|/, $thisloglistline);
3964 if (($loglistdate eq $thislistdate) && ($thiscalendarlink eq "")) {
3965 unless (($loglistmorestatus eq "N") && ($linktocalendarentries eq "more")) {
3966 $thiscalendarlink = "yes";
3967 }
3968 }
3969 }
3970 if ($thiscalendarlink eq "") {
3971 $listsubsub = $gmcalendarfullcelltemplate;
3972 $listsubsub =~ s/{{day}}/$countfromhere/g;
3973 $listsubsub =~ s/{{day}}/$countfromherepadded/g;
3974 $calendarfull .= $listsubsub;
3975 } else {
3976 foreach $thisloglistline (@loglistloglines) {
3977 chomp ($thisloglistline);
3978 ($loglistnumber, $loglistauthor, $loglistsubject, $loglistdate, $loglisttimeampm, $loglistopenstatus, $loglistmorestatus) = split (/\|/, $thisloglistline);
3979 if (($loglistdate eq $thislistdate) && ($thiscalendarlink eq "yes") && ($loglistopenstatus ne "C")) {
3980 &gm_getloglistvariables;
3981 $listsubsub = $gmcalendarfullcelllinktemplate;
3982 &entrylistsubsub;
3983 $calendarfull .= $listsubsub;
3984 $thiscalendarlink = "";
3985 }
3986 }
3987 }
3988 }
3989 } else {
3990 $listsubsub = $gmcalendarfullcelltemplate;
3991 $listsubsub =~ s/{{day}}/$countfromhere/g;
3992 $listsubsub =~ s/{{day}}/$countfromherepadded/g;
3993 $calendarfull .= $listsubsub;
3994 }
3995## calendar fix addressing when last day of month falls on Saturday: linear 1/8/2004
3996## merged in 1.3.1
3997 if ( ($calendardataday[$countfromhere] eq "6") && ($countfromhere ne $maxdaysinthismonth) ) { $calendarfull .= "</tr>\n<tr>"; }
3998## merged 2/3/2004
3999 $countfromhere++;
4000} until $countfromhere > $maxdaysinthismonth;
4001
4002$endofcaldisplay = 6 - $calendardataday[$maxdaysinthismonth];
4003$calendarfull .= "$gmcalendarblankcelltemplate" x $endofcaldisplay;
4004$calendarfull .= $gmcalendartableendingtemplate;
4005
4006$calendarfull =~ s/{{month}}/$usethisentrymonth/g;
4007$calendarfull =~ s/{{monthmonth}}/$usethisentrymonthmonth/g;
4008$calendarfull =~ s/{{year}}/$usethisentryyear/g;
4009$calendarfull =~ s/{{yearyear}}/$usethisentryyearyear/g;
4010$calendarfull =~ s/{{monthword}}/$usethisentrymonthword/g;
4011$calendarfull =~ s/{{monthwordupper}}/$usethisentrymonthwordupper/g;
4012$calendarfull =~ s/{{monthwordlower}}/$usethisentrymonthwordlower/g;
4013$calendarfull =~ s/{{monthwordshort}}/$usethisentrymonthwordshort/g;
4014$calendarfull =~ s/{{monthworduppershort}}/$usethisentrymonthworduppershort/g;
4015$calendarfull =~ s/{{monthwordlowershort}}/$usethisentrymonthwordlowershort/g;
4016
4017}
4018
4019# -----------------
4020# log the author in
4021# -----------------
4022
4023sub gm_login {
4024
4025if (!(open(CHECKMATE,"./gm-counter.cgi"))) {
4026 &gm_dangermouse("gm-counter.cgi is missing. Please upload this file to the same directory as all the other Greymatter cgi files, and make sure you CHMOD it to 666.");
4027}
4028close(CHECKMATE);
4029
4030if (!(open(CHECKMATE,"./gm-karma.cgi"))) {
4031 &gm_dangermouse("gm-karma.cgi is missing. Please upload this file to the same directory as all the other Greymatter cgi files, and make sure you CHMOD it to 755.");
4032}
4033close(CHECKMATE);
4034
4035if (!(open(CHECKMATE,"./gm-comments.cgi"))) {
4036 &gm_dangermouse("gm-comments.cgi is missing. Please upload this file to the same directory as all the other Greymatter cgi files, and make sure you CHMOD it to 755.");
4037}
4038close(CHECKMATE);
4039
4040if (!(open(CHECKMATE,"./gm-upload.cgi"))) {
4041 &gm_dangermouse("gm-upload.cgi is missing. Please upload this file to the same directory as all the other Greymatter cgi files, and make sure you CHMOD it to 755.");
4042}
4043close(CHECKMATE);
4044
4045if (!(open(CHECKMATE,"./gm-entrylist.cgi"))) {
4046 &gm_dangermouse("gm-entrylist.cgi is missing. Please upload this file to the same directory as all the other Greymatter cgi files, and make sure you CHMOD it to 666.");
4047}
4048close(CHECKMATE);
4049
4050if (!(open(CHECKMATE,"./gm-cplog.cgi"))) {
4051 &gm_dangermouse("gm-cplog.cgi is missing. Please upload this file to the same directory as all the other Greymatter cgi files, and make sure you CHMOD it to 666.");
4052}
4053close(CHECKMATE);
4054
4055if (!(open(CHECKMATE,"./gm-authors.cgi"))) {
4056 &gm_dangermouse("gm-authors.cgi is missing. Please upload this file to the same directory as all the other Greymatter cgi files, and make sure you CHMOD it to 666.");
4057}
4058close(CHECKMATE);
4059
4060if (!(open(CHECKMATE,"./gm-templates.cgi"))) {
4061 &gm_dangermouse("gm-templates.cgi is missing. Please upload this file to the same directory as all the other Greymatter cgi files, and make sure you CHMOD it to 666.");
4062}
4063close(CHECKMATE);
4064
4065if (!(open(CHECKMATE,"./gm-banlist.cgi"))) {
4066 &gm_dangermouse("gm-banlist.cgi is missing. Please upload this file to the same directory as all the other Greymatter cgi files, and make sure you CHMOD it to 666.");
4067}
4068close(CHECKMATE);
4069
4070if ($loginnotice eq "") { $loginnotice = qq(<B><FONT COLOR="#000000">Login Prompt</font></B><P>); }
4071
4072&gm_readconfig;
4073
4074if ($cookiesallowed eq "no") {
4075 $getnameandpwcookie = "";
4076} else {
4077 $getnameandpwcookie = "<SCRIPT TYPE=\"text/javascript\" LANGUAGE=\"JavaScript\">\n<!--//\ndocument.gmloginform.authorname.value = getCookie(\"gmcookiename\");\ndocument.gmloginform.authorpassword.value = getCookie(\"$cookiename\");\ndocument.gmloginform.authorname.focus();\n//-->\n</SCRIPT>";
4078}
4079
4080print<<GMLOGIN;
4081
4082$gmheadtag
4083
4084$gmframetop
4085$loginnotice
4086
4087<FORM ACTION="gm.cgi" METHOD=POST NAME="gmloginform"><TABLE BORDER=0 CELLPADDING=3 CELLSPACING=0><TR><TD ALIGN=RIGHT>$gmfonttag Author:</font></TD><TD ALIGN=LEFT></font><INPUT TYPE=TEXT CLASS="textinput" SIZE=20 NAME="authorname" STYLE="width: 200">$gmfonttag</TD></TR><TR><TD ALIGN=RIGHT>$gmfonttag Password:</font></TD><TD ALIGN=LEFT></font><INPUT TYPE=PASSWORD CLASS="textinput" SIZE=20 NAME="authorpassword" STYLE="width: 200">$gmfonttag</TD></TR></TABLE><P><INPUT TYPE=SUBMIT CLASS="button" VALUE="Enter" STYLE="background: #D0FFD0; width: 75"><INPUT TYPE=HIDDEN NAME="thomas" VALUE="login"></FORM><P><font size=\"1\">"Not knowing when the dawn will come, I open every door."—Emily Dickinson</font>
4088$getnameandpwcookie
4089$gmframebottom
4090
4091</BODY>
4092</HTML>
4093
4094GMLOGIN
4095
4096exit;
4097
4098}
4099
4100# ------------------
4101# validate the login
4102# ------------------
4103
4104sub gm_validate {
4105
4106&gm_bancheck;
4107&gm_readconfig;
4108
4109$gmvalidated = "no";
4110$gmentryaccess = "no";
4111$gmentryeditaccess = "no";
4112$gmconfigurationaccess = "no";
4113$gmtemplateaccess = "no";
4114$gmauthoraccess = "no";
4115$gmcplogaccess = "no";
4116$gmrebuildaccess = "no";
4117$gmbookmarkletaccess = "no";
4118$gmuploadaccess = "no";
4119$gmloginaccess = "no";
4120
4121$IN{'authorname'} =~ s/\|//g;
4122$IN{'authorpassword'} =~ s/\|//g;
4123$IN{'authorname'} =~ s/^\s+//;
4124$IN{'authorname'} =~ s/\s+$//;
4125$IN{'authorpassword'} =~ s/^\s+//;
4126$IN{'authorpassword'} =~ s/\s+$//;
4127
4128########################################################################
4129## gm_validate extension to allow a rebuild operation without a password
4130## by passing a token reference instead. added by linear 9/3/2003
4131########################################################################
4132# merged in 1.3
4133
4134if (($IN{'authorname'} eq "") || ($IN{'authorpassword'} eq "")) {
4135 unless($IN{'gmtoken'}) {
4136 $loginnotice = qq(<B><FONT COLOR="#0000FF">You left one or more of the fields blank. Please try again.</font></B><P>);
4137 &gm_writetocplog("<B><FONT COLOR=\"#FF0000\">Invalid login attempt:</font></B> One or more fields left blank ($IN{'authorname'} $IN{'authorpassword'})");
4138 &gm_login;
4139 }
4140}
4141
4142if ($IN{'gmtoken'} && $IN{'rebuilding'}) {
4143 # read the token from the file where we persisted it
4144 open (TOKENPLEASE, "$EntriesPath/gm-token.cgi") || &gm_dangermouse("Can't read the token file.");
4145 @gmtoken = <TOKENPLEASE>;
4146 $gmtoken = $gmtoken[0];
4147 chomp ($gmtoken);
4148 $gmtokenauthor = $gmtoken[1];
4149 chomp ($gmtokenauthor);
4150 $gmtokenpass = $gmtoken[2];
4151 chomp ($gmtokenpass);
4152 close (TOKENPLEASE);
4153
4154 # examine the token for validity
4155 if ($IN{'gmtoken'} eq $gmtoken) {
4156 $IN{'authorname'} = $gmtokenauthor;
4157 $IN{'authorpassword'} = $gmtokenpass;
4158 }
4159}
4160# merged 9/11/2003
4161
4162open (FUNNYFEETVALLERY, "./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.");
4163@gmauthordata = <FUNNYFEETVALLERY>;
4164close (FUNNYFEETVALLERY);
4165
4166foreach $gmauthordataline (@gmauthordata) {
4167 chomp ($gmauthordataline);
4168 @gmauthorinfo = split (/\|/, $gmauthordataline);
4169 if ($gmauthorinfo[0] eq $IN{'authorname'}) {
4170 $gmvalidated = "foundname";
4171 my $crypted = crypt($IN{'authorpassword'}, $gmauthorinfo[1]);
4172 if ( ($gmauthorinfo[1] eq $crypted) || ($gmauthorinfo[1] eq $IN{'authorpassword'}) ) {
4173 $gmvalidated = "yes";
4174 if ($gmauthorinfo[6] eq "Y") { $gmentryaccess = "yes"; }
4175 if ($gmauthorinfo[7] eq "Y") { $gmentryeditaccess = "yes"; }
4176 if ($gmauthorinfo[7] eq "O") { $gmentryeditaccess = "mineonly"; }
4177 if ($gmauthorinfo[8] eq "Y") { $gmconfigurationaccess = "yes"; }
4178 if ($gmauthorinfo[9] eq "Y") { $gmtemplateaccess = "yes"; }
4179 if ($gmauthorinfo[9] eq "O") { $gmtemplateaccess = "hfsonly"; }
4180 if ($gmauthorinfo[10] eq "Y") { $gmauthoraccess = "yes"; }
4181 if ($gmauthorinfo[11] eq "Y") { $gmrebuildaccess = "yes"; }
4182 if ($gmauthorinfo[12] eq "Y") { $gmcplogaccess = "yes"; }
4183 if ($gmauthorinfo[13] eq "Y") { $gmbookmarkletaccess = "yes"; }
4184 if ($gmauthorinfo[14] eq "Y") { $gmuploadaccess = "yes"; }
4185 if ($gmauthorinfo[15] eq "Y") { $gmloginaccess = "yes"; }
4186 }
4187 }
4188}
4189
4190if ($gmvalidated eq "foundname") {
4191 $loginnotice = qq(<B><FONT COLOR="#0000FF">The password you entered for that author is incorrect. Please try again.</font></B><P>);
4192 &gm_writetocplog("<B><FONT COLOR=\"#FF0000\">Invalid login attempt:</font></B> Incorrect password ($IN{'authorpassword'}) for $IN{'authorname'}");
4193 &gm_login;
4194}
4195
4196if ($gmvalidated ne "yes") {
4197 $loginnotice = qq(<B><FONT COLOR="#0000FF">No such author is registered. Please try again.</font></B><P>);
4198 &gm_writetocplog("<B><FONT COLOR=\"#FF0000\">Invalid login attempt:</font></B> No such author as $IN{'authorname'} ($IN{'authorpassword'}) registered");
4199 &gm_login;
4200}
4201
4202}
4203
4204# --------------------------
4205# check if this IP is banned
4206# --------------------------
4207
4208sub gm_bancheck {
4209
4210open (FUNNYFEETBABY, "./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.");
4211@gmbanlist = <FUNNYFEETBABY>;
4212close (FUNNYFEETBABY);
4213
4214$currentip = $ENV{'REMOTE_ADDR'};
4215
4216if ($gmbanlist[0] ne "") {
4217 foreach $gmbanlistline (@gmbanlist) {
4218 chomp ($gmbanlistline);
4219 ($checkthisip, $checkthisiphost, $checkthisperson) = split (/\|/, $gmbanlistline);
4220 if (($currentip =~ /$checkthisip/) && ($checkthisip ne "")) {
4221
4222 if ($keeplog eq "yes") {
4223 &date;
4224 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.");
4225 print FUNNYFEET "<font size=\"1\">[$basedate] [$currentip]</font> <font color=\"#FF0000\"><b>A banned IP ($checkthisip";
4226 if ($checkthisperson ne "") { print FUNNYFEET ", \"$checkthisperson\""; }
4227 print FUNNYFEET ") attempted to access this program</b></font>\n";
4228 close (FUNNYFEET);
4229 }
4230
4231print<<GMBANNEDNOTICE;
4232
4233$gmheadtag
4234
4235$gmframetop
4236You have been banned from accessing this program.<br />(IP: $currentip)
4237$gmframebottom
4238
4239</body>
4240</html>
4241
4242GMBANNEDNOTICE
4243
4244exit;
4245
4246 }
4247 }
4248}
4249
4250}
4251
4252# ---------------
4253# write to cp log
4254# ---------------
4255
4256sub gm_writetocplog {
4257
4258my $writetologtext = shift;
4259
4260if ($keeplog eq "yes") {
4261 &date;
4262 if ($writetologtext =~ /<\?|<script|<%|<iframe/ ) {$writetologtext = "[Aborted log - Hack Attempt]";}
4263
4264 open (ITSLOGITSLOG, ">>./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.");
4265 print ITSLOGITSLOG "<font size=\"1\">[$basedate] [$authorIP]</font> $writetologtext\n";
4266 close (ITSLOGITSLOG);
4267}
4268
4269}
4270
4271# ----------------------
4272# create ordinal numbers
4273# ----------------------
4274
4275sub gm_toordinal {
4276 # new in 1.3 linear 9/16/2003
4277 $_ = shift;
4278 s/^([23]?1)$/$1st/;
4279 s/^11$/11th/;
4280 s/^(2?2)$/$1nd/;
4281 s/^12$/12th/;
4282 s/^(2?3)$/$1rd/;
4283 s/^13$/13th/;
4284 s/([04-9])$/$1th/;
4285 return($_);
4286}
4287
4288
4289# -----------------------------
4290# danger will robinson, danger!
4291# -----------------------------
4292
4293sub gm_dangermouse {
4294
4295my $dangerwarning = shift;
4296
4297print<<GMDANGER;
4298
4299$gmheadtag
4300
4301$gmframetop<b><font color=\"#FF0000\">Error Notice</font></b><p>$dangerwarning$gmframebottom</p>
4302
4303</body>
4304</body>
4305
4306GMDANGER
4307
4308exit;
4309
4310}
4311
43121;
4313
4314
4315
4316# ------------------------
4317# front page - log options
4318# ------------------------
4319
4320sub gm_frontpage {
4321
4322&gm_readconfig;
4323
4324if (($cgilocalpath eq "") || ($cgiwebpath eq "") || ($LogPath eq "") || ($EntriesPath eq "") || ($LogWebPath eq "") || ($EntriesWebPath eq "")) {
4325
4326 if (($cgilocalpath eq "") && ($LogPath ne "")) { $cgilocalpath = $LogPath; }
4327 if (($cgiwebpath eq "") && ($LogWebPath ne "")) { $cgiwebpath = $LogWebPath; }
4328
4329 if ($cgilocalpath eq "") {
4330 if ($ENV{'SCRIPT_FILENAME'}) { $cgilocalpath = $ENV{'SCRIPT_FILENAME'}; }
4331 elsif ($ENV{'PATH_TRANSLATED'}) {
4332 $cgilocalpath = $ENV{'PATH_TRANSLATED'};
4333 $cgilocalpath =~ s/\\/\//g;
4334 }
4335 @cgilocalpathtemp = split(/\//, $cgilocalpath);
4336 pop(@cgilocalpathtemp);
4337 $cgilocalpath = join("\/", @cgilocalpathtemp);
4338 # added 1.3.1 - 1/20/05 flipped cracker
4339 $loglocalpath = $cgilocalpath;
4340 $loglocalpath =~ s/\/cgi-bin//g;
4341 # end additions
4342 }
4343
4344 @cgipath = split(/\//, $cgilocalpath);
4345 $cgiwebpathextension = pop(@cgipath);
4346 # added 1.3.1 - 1/20/05 flipped cracker
4347 @logpath = split(/\//, $loglocalpath);
4348 $logwebpathextension = pop(@logpath);
4349 if ($logwebpathextension eq "public_html") { $logwebpathextensionnew = ""; }
4350 else {
4351 $logwebpathextensionnew = "/";
4352 $logwebpathextensionnew .= $logwebpathextension;
4353 }
4354 # end additions
4355
4356 if ($cgiwebpath eq "") { $cgiwebpath = "http://$ENV{'HTTP_HOST'}/$cgiwebpathextension"; }
4357
4358 if ($LogPath eq "") { $LogPath = $loglocalpath; }
4359 if ($EntriesPath eq "") { $EntriesPath = ("$loglocalpath" . "/archives"); }
4360 if ($LogWebPath eq "") { $LogWebPath = "http://$ENV{'HTTP_HOST'}$logwebpathextensionnew"; }
4361 if ($EntriesWebPath eq "") { $EntriesWebPath = "http://$ENV{'HTTP_HOST'}$logwebpathextensionnew/archives"; }
4362
4363 &gm_writeconfig;
4364
4365}
4366
4367&gm_validate;
4368
4369if ($gmloginaccess ne "yes") {
4370 &gm_writetocplog("$IN{'authorname'} attempted to log in without authorization");
4371 $loginnotice = qq(<B><FONT COLOR="#FF0000">You don't have access to log in.</FONT></B><P>);
4372 &gm_login;
4373}
4374
4375if ($statusnote eq "") { $statusnote = qq(<B><FONT COLOR="#000000">Main Menu</FONT></B><P>); }
4376
4377if (($IN{'authorname'} eq "Alice") && ($IN{'authorpassword'} eq "wonderland")) {
4378 $setnameandpwcookie = "";
4379} else {
4380 $setnameandpwcookie = "<SCRIPT TYPE=\"text/javascript\" LANGUAGE=\"JavaScript\">\n<!--//\nvar now = new Date();\nfixDate(now);\nnow.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);\nsetCookie(\"gmcookiename\", \"$IN{'authorname'}\", now);\nsetCookie(\"$cookiename\", \"$IN{'authorpassword'}\", now);\n//-->\n</SCRIPT>";
4381}
4382
4383if ($cookiesallowed eq "no") {
4384 $setnameandpwcookie = "";
4385}
4386
4387$visityoursitelink = "";
4388
4389unless (!(open(CHECKMATE,"$LogPath/$indexfilename"))) {
4390 &gm_readcounter;
4391 unless ($newentrynumber eq "0") {
4392 $indexfilenamesmartcheck = "/$indexfilename";
4393 $indexfilenameprefix = substr($indexfilename, 0, 6);
4394 if ($indexfilenameprefix eq "index.") { $indexfilenamesmartcheck = "/"; }
4395 $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>);
4396 }
4397}
4398close(CHECKMATE);
4399
4400print<<GMFRONTPAGE;
4401
4402$gmheadtag
4403
4404$gmframetop
4405$statusnote
4406$setnameandpwcookie
4407<FORM ACTION="gm.cgi" METHOD=POST>
4408<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
4409<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
4410<TABLE BORDER=0 CELLPADDING=10 CELLSPACING=0 WIDTH=520>
4411<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>
4412
4413<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 entries and edit/delete comments.</FONT></FONT></TD></TR>
4414
4415<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>
4416
4417<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>
4418
4419<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>
4420
4421<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>
4422
4423</FORM>
4424
4425$visityoursitelink
4426
4427</TABLE>
4428<P>
4429<FONT SIZE=1>"Our life is what our thoughts make it."—Marcus Aurelius</FONT>
4430$gmframebottom
4431
4432</BODY>
4433</HTML>
4434
4435GMFRONTPAGE
4436
4437$statusnote = "";
4438
4439exit;
4440
4441}
4442
4443# ----------------
4444# templates editor
4445# ----------------
4446
4447sub gm_edittemplates {
4448
4449&gm_validate;
4450
4451if ($gmtemplateaccess eq "no") {
4452 &gm_writetocplog("$IN{'authorname'} attempted to edit the templates without authorization");
4453 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the templates.</FONT></B><P>);
4454 &gm_frontpage;
4455}
4456
4457if ($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>); }
4458
4459if ($gmtemplateaccess eq "hfsonly") {
4460 $statusnote .= "<B>You only have access to edit the header, footer & sidebar templates.</B><P>";
4461}
4462
4463print<<GMEDITTEMPLATESMENU;
4464
4465$gmheadtag
4466
4467$gmframetop
4468$statusnote
4469<FORM ACTION="gm.cgi" METHOD=POST>
4470<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
4471<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
4472<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Edit Main Index-Related Templates" STYLE="width: 320">
4473<P>
4474<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Edit Archive-Related Templates" STYLE="width: 320">
4475<P>
4476<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Edit Entry Page-Related Templates" STYLE="width: 320">
4477<P>
4478<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Edit Karma & Comments-Related Templates" STYLE="width: 320">
4479<P>
4480<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Edit Header, Footer & Sidebar Templates" STYLE="width: 320">
4481<P>
4482<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Edit Miscellaneous Templates" STYLE="width: 320">
4483<P>
4484<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="width: 320; background: #C0C0C0">
4485</FORM>
4486<P>
4487<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>
4488$gmframebottom
4489
4490</BODY>
4491</HTML>
4492
4493GMEDITTEMPLATESMENU
4494
4495$statusnote = "";
4496
4497exit;
4498
4499}
4500
4501# -------------------------------
4502# edit template group: main index
4503# -------------------------------
4504
4505sub gm_editmainindextemplates {
4506
4507&gm_validate;
4508
4509if (($gmtemplateaccess eq "no") || ($gmtemplateaccess eq "hfsonly")) {
4510 &gm_writetocplog("$IN{'authorname'} attempted to edit the main index templates without authorization");
4511 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the main index templates.</FONT></B><P>);
4512 &gm_frontpage;
4513}
4514
4515&gm_readtemplates;
4516
4517&gm_delousealltemplates;
4518
4519if ($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>); }
4520
4521if ($gmrebuildaccess eq "yes") {
4522 if ($automaticrebuilddefault eq "yes") {
4523 $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>);
4524 } else {
4525 $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>);
4526 }
4527}
4528
4529&gm_readcounter;
4530if ($newentrynumber eq "0") { $autorebuildcheckbox = ""; }
4531
4532print<<GMEDITMAININDEXTEMPLATES;
4533
4534$gmheadtag
4535
4536$gmframetop
4537$statusnote
4538<FORM ACTION="gm.cgi" METHOD=POST>
4539<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
4540<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
4541<INPUT TYPE=HIDDEN NAME="modifiedtemplategroup" VALUE="main index">
4542<INPUT TYPE=HIDDEN NAME="newentrypagetemplate" VALUE="$gmentrypagetemplate">
4543<INPUT TYPE=HIDDEN NAME="newarchiveindextemplate" VALUE="$gmarchiveindextemplate">
4544<INPUT TYPE=HIDDEN NAME="newarchiveentrypagetemplate" VALUE="$gmarchiveentrypagetemplate">
4545<INPUT TYPE=HIDDEN NAME="newarchiveentrytemplate" VALUE="$gmarchiveentrytemplate">
4546<INPUT TYPE=HIDDEN NAME="newcommentstemplate" VALUE="$gmcommentstemplate">
4547<INPUT TYPE=HIDDEN NAME="newcommentsformtemplate" VALUE="$gmcommentsformtemplate">
4548<INPUT TYPE=HIDDEN NAME="newparaseparationtemplate" VALUE="$gmparaseparationtemplate">
4549<INPUT TYPE=HIDDEN NAME="newkarmaformtemplate" VALUE="$gmkarmaformtemplate">
4550<INPUT TYPE=HIDDEN NAME="newlinktargettemplate" VALUE="$gmlinktargettemplate">
4551<INPUT TYPE=HIDDEN NAME="newkarmalinktemplate" VALUE="$gmkarmalinktemplate">
4552<INPUT TYPE=HIDDEN NAME="newcommentslinktemplate" VALUE="$gmcommentslinktemplate">
4553<INPUT TYPE=HIDDEN NAME="newcommentauthoremailtemplate" VALUE="$gmcommentauthoremailtemplate">
4554<INPUT TYPE=HIDDEN NAME="newcommentauthorhomepagetemplate" VALUE="$gmcommentauthorhomepagetemplate">
4555<INPUT TYPE=HIDDEN NAME="newcommentdividertemplate" VALUE="$gmcommentdividertemplate">
4556<INPUT TYPE=HIDDEN NAME="newmoreentrypagetemplate" VALUE="$gmmoreentrypagetemplate">
4557<INPUT TYPE=HIDDEN NAME="newmorearchiveentrypagetemplate" VALUE="$gmmorearchiveentrypagetemplate">
4558<INPUT TYPE=HIDDEN NAME="newpreviouslinktemplate" VALUE="$gmpreviouslinktemplate">
4559<INPUT TYPE=HIDDEN NAME="newnextlinktemplate" VALUE="$gmnextlinktemplate">
4560<INPUT TYPE=HIDDEN NAME="newpreviousmorelinktemplate" VALUE="$gmpreviousmorelinktemplate">
4561<INPUT TYPE=HIDDEN NAME="newnextmorelinktemplate" VALUE="$gmnextmorelinktemplate">
4562<INPUT TYPE=HIDDEN NAME="newarchivemasterindextemplate" VALUE="$gmarchivemasterindextemplate">
4563<INPUT TYPE=HIDDEN NAME="newlogarchiveslinktemplate" VALUE="$gmlogarchiveslinktemplate">
4564<INPUT TYPE=HIDDEN NAME="newentrypagelinktemplate" VALUE="$gmentrypagelinktemplate">
4565<INPUT TYPE=HIDDEN NAME="newmoreentrypagelinktemplate" VALUE="$gmmoreentrypagelinktemplate">
4566<INPUT TYPE=HIDDEN NAME="newlogarchiveslinkseparatortemplate" VALUE="$gmlogarchiveslinkseparatortemplate">
4567<INPUT TYPE=HIDDEN NAME="newentrypagelinkseparatortemplate" VALUE="$gmentrypagelinkseparatortemplate">
4568<INPUT TYPE=HIDDEN NAME="newentrypagelinkmonthseparatortemplate" VALUE="$gmentrypagelinkmonthseparatortemplate">
4569<INPUT TYPE=HIDDEN NAME="newentrypagelinkdayseparatortemplate" VALUE="$gmentrypagelinkdayseparatortemplate">
4570<INPUT TYPE=HIDDEN NAME="newentrypagelinkyearseparatortemplate" VALUE="$gmentrypagelinkyearseparatortemplate">
4571<INPUT TYPE=HIDDEN NAME="newheadertemplate" VALUE="$gmheadertemplate">
4572<INPUT TYPE=HIDDEN NAME="newfootertemplate" VALUE="$gmfootertemplate">
4573<INPUT TYPE=HIDDEN NAME="newsidebartemplate" VALUE="$gmsidebartemplate">
4574<INPUT TYPE=HIDDEN NAME="newarchiveentryseparatortemplate" VALUE="$gmarchiveentryseparatortemplate">
4575<INPUT TYPE=HIDDEN NAME="newmorearchiveentrytemplate" VALUE="$gmmorearchiveentrytemplate">
4576<INPUT TYPE=HIDDEN NAME="newdatearchivetemplate" VALUE="$gmdatearchivetemplate">
4577<INPUT TYPE=HIDDEN NAME="newlogarchiveslinkweeklytemplate" VALUE="$gmlogarchiveslinkweeklytemplate">
4578<INPUT TYPE=HIDDEN NAME="newcustomonetemplate" VALUE="$gmcustomonetemplate">
4579<INPUT TYPE=HIDDEN NAME="newcustomtwotemplate" VALUE="$gmcustomtwotemplate">
4580<INPUT TYPE=HIDDEN NAME="newcustomthreetemplate" VALUE="$gmcustomthreetemplate">
4581<INPUT TYPE=HIDDEN NAME="newcustomfourtemplate" VALUE="$gmcustomfourtemplate">
4582<INPUT TYPE=HIDDEN NAME="newcustomfivetemplate" VALUE="$gmcustomfivetemplate">
4583<INPUT TYPE=HIDDEN NAME="newcustomsixtemplate" VALUE="$gmcustomsixtemplate">
4584<INPUT TYPE=HIDDEN NAME="newcustomseventemplate" VALUE="$gmcustomseventemplate">
4585<INPUT TYPE=HIDDEN NAME="newcustomeighttemplate" VALUE="$gmcustomeighttemplate">
4586<INPUT TYPE=HIDDEN NAME="newcustomninetemplate" VALUE="$gmcustomninetemplate">
4587<INPUT TYPE=HIDDEN NAME="newcustomtentemplate" VALUE="$gmcustomtentemplate">
4588<INPUT TYPE=HIDDEN NAME="newpopuppagetemplate" VALUE="$gmpopuppagetemplate">
4589<INPUT TYPE=HIDDEN NAME="newpopupcodetemplate" VALUE="$gmpopupcodetemplate">
4590<INPUT TYPE=HIDDEN NAME="newsearchformtemplate" VALUE="$gmsearchformtemplate">
4591<INPUT TYPE=HIDDEN NAME="newsearchresultspagetemplate" VALUE="$gmsearchresultspagetemplate">
4592<INPUT TYPE=HIDDEN NAME="newsearchresultsentrytemplate" VALUE="$gmsearchresultsentrytemplate">
4593<INPUT TYPE=HIDDEN NAME="newcalendartablebeginningtemplate" VALUE="$gmcalendartablebeginningtemplate">
4594<INPUT TYPE=HIDDEN NAME="newcalendartableendingtemplate" VALUE="$gmcalendartableendingtemplate">
4595<INPUT TYPE=HIDDEN NAME="newcalendarblankcelltemplate" VALUE="$gmcalendarblankcelltemplate">
4596<INPUT TYPE=HIDDEN NAME="newcalendarfullcelltemplate" VALUE="$gmcalendarfullcelltemplate">
4597<INPUT TYPE=HIDDEN NAME="newcalendarfullcelllinktemplate" VALUE="$gmcalendarfullcelllinktemplate">
4598<INPUT TYPE=HIDDEN NAME="newcalendarweekfulldaytemplate" VALUE="$gmcalendarweekfulldaytemplate">
4599<INPUT TYPE=HIDDEN NAME="newcalendarweekfulldaylinktemplate" VALUE="$gmcalendarweekfulldaylinktemplate">
4600<INPUT TYPE=HIDDEN NAME="newcommentpreviewdividertemplate" VALUE="$gmcommentpreviewdividertemplate">
4601<INPUT TYPE=HIDDEN NAME="newcommentpreviewformtemplate" VALUE="$gmcommentpreviewformtemplate">
4602<INPUT TYPE=HIDDEN NAME="newsmartlinknocommentstemplate" VALUE="$gmsmartlinknocommentstemplate">
4603<INPUT TYPE=HIDDEN NAME="newsmartlinkonecommenttemplate" VALUE="$gmsmartlinkonecommenttemplate">
4604<INPUT TYPE=HIDDEN NAME="newsmartlinkmanycommentstemplate" VALUE="$gmsmartlinkmanycommentstemplate">
4605<INPUT TYPE=HIDDEN NAME="newlinebreaktemplate" VALUE="$gmlinebreaktemplate">
4606<INPUT TYPE=HIDDEN NAME="newcommentlinktargettemplate" VALUE="$gmcommentlinktargettemplate">
4607<INPUT TYPE=HIDDEN NAME="newsmartentrymoodtemplate" VALUE="$gmsmartentrymoodtemplate">
4608<INPUT TYPE=HIDDEN NAME="newsmartentrymusictemplate" VALUE="$gmsmartentrymusictemplate">
4609<INPUT TYPE=HIDDEN NAME="newdategroupingfooterarchivetemplate" VALUE="$gmdategroupingfooterarchivetemplate">
4610<INPUT TYPE=HIDDEN NAME="newcookiescodetemplate" VALUE="$gmcookiescodetemplate">
4611<INPUT TYPE=HIDDEN NAME="newsmartemoticonscodetemplate" VALUE="$gmsmartemoticonscodetemplate">
4612
4613
4614<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=720>
4615
4616<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2>$gmfonttag<TABLE BORDER=0 cellpadding=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>Main Index Template</B><BR><FONT SIZE=1>The overall template for your main index page—typically the first page that people will see on your weblog/journal. The {{logbody}} variable is the placeholder that tells Greymatter where you want the body of your log to be inserted, so it must be included somewhere in this template. The format of the log body is controlled through the templates below.</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>
4617
4618<TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR>
4619
4620<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><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=1 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=1 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>
4621
4622<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#C0C0C0"><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>
4623
4624<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#C0C0C0"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Date Grouping Header 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. DO NOT put {{entry*}}, {{comment*}}, or {{time*}} variables here.<BR> </FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 cellpadding=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#C0C0C0"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Date Grouping Footer Template</B><BR><FONT SIZE=1>This is the complement to the Date Grouping Template. if you open a tag in the Date Grouping Template (such as a div or td) you can place the closing tag here. That allows you to contain a date grouping inside an element. All date variables that are supported in the Date Grouping Header Template are supported here as well.</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="newdategroupingfootertemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmdategroupingfootertemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR></TABLE></TD></TR>
4625
4626<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#C0C0C0"><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. Works only between multiple entries on a single day.<BR> </FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><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>
4627
4628</TABLE>
4629$autorebuildcheckbox
4630<P>
4631<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">
4632<P>
4633<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Templates Menu">
4634<P>
4635<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0">
4636</FORM>
4637<P>
4638<FONT SIZE=1>"The face is the index of a feeling mind."—George Crabbe</FONT>
4639$gmframebottom
4640
4641</BODY>
4642</HTML>
4643
4644GMEDITMAININDEXTEMPLATES
4645
4646$statusnote = "";
4647
4648exit;
4649
4650}
4651
4652# -----------------------------
4653# edit template group: archives
4654# -----------------------------
4655
4656sub gm_editarchivetemplates {
4657
4658&gm_validate;
4659
4660if (($gmtemplateaccess eq "no") || ($gmtemplateaccess eq "hfsonly")) {
4661 &gm_writetocplog("$IN{'authorname'} attempted to edit the archive templates without authorization");
4662 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the archive templates.</FONT></B><P>);
4663 &gm_frontpage;
4664}
4665
4666&gm_readtemplates;
4667
4668&gm_delousealltemplates;
4669
4670if ($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>); }
4671
4672$autorebuildcheckbox = "";
4673
4674if ($gmrebuildaccess eq "yes") {
4675 if ($automaticrebuilddefault eq "yes") {
4676 $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>);
4677 } else {
4678 $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>);
4679 }
4680}
4681
4682&gm_readcounter;
4683if ($newentrynumber eq "0") { $autorebuildcheckbox = ""; }
4684
4685print<<GMEDITARCHIVETEMPLATES;
4686
4687$gmheadtag
4688
4689$gmframetop
4690$statusnote
4691<FORM ACTION="gm.cgi" METHOD=POST>
4692<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
4693<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
4694<INPUT TYPE=HIDDEN NAME="modifiedtemplategroup" VALUE="archive">
4695<INPUT TYPE=HIDDEN NAME="newindextemplate" VALUE="$gmindextemplate">
4696<INPUT TYPE=HIDDEN NAME="newentrypagetemplate" VALUE="$gmentrypagetemplate">
4697<INPUT TYPE=HIDDEN NAME="newarchiveentrypagetemplate" VALUE="$gmarchiveentrypagetemplate">
4698<INPUT TYPE=HIDDEN NAME="newentrytemplate" VALUE="$gmentrytemplate">
4699<INPUT TYPE=HIDDEN NAME="newstayattoptemplate" VALUE="$gmstayattoptemplate">
4700<INPUT TYPE=HIDDEN NAME="newdatetemplate" VALUE="$gmdatetemplate">
4701<INPUT TYPE=HIDDEN NAME="newcommentstemplate" VALUE="$gmcommentstemplate">
4702<INPUT TYPE=HIDDEN NAME="newcommentsformtemplate" VALUE="$gmcommentsformtemplate">
4703<INPUT TYPE=HIDDEN NAME="newparaseparationtemplate" VALUE="$gmparaseparationtemplate">
4704<INPUT TYPE=HIDDEN NAME="newkarmaformtemplate" VALUE="$gmkarmaformtemplate">
4705<INPUT TYPE=HIDDEN NAME="newlinktargettemplate" VALUE="$gmlinktargettemplate">
4706<INPUT TYPE=HIDDEN NAME="newdategroupingfootertemplate" VALUE="$gmdategroupingfootertemplate">
4707<INPUT TYPE=HIDDEN NAME="newkarmalinktemplate" VALUE="$gmkarmalinktemplate">
4708<INPUT TYPE=HIDDEN NAME="newcommentslinktemplate" VALUE="$gmcommentslinktemplate">
4709<INPUT TYPE=HIDDEN NAME="newcommentauthoremailtemplate" VALUE="$gmcommentauthoremailtemplate">
4710<INPUT TYPE=HIDDEN NAME="newcommentauthorhomepagetemplate" VALUE="$gmcommentauthorhomepagetemplate">
4711<INPUT TYPE=HIDDEN NAME="newcommentdividertemplate" VALUE="$gmcommentdividertemplate">
4712<INPUT TYPE=HIDDEN NAME="newmoreentrytemplate" VALUE="$gmmoreentrytemplate">
4713<INPUT TYPE=HIDDEN NAME="newmoreentrypagetemplate" VALUE="$gmmoreentrypagetemplate">
4714<INPUT TYPE=HIDDEN NAME="newmorearchiveentrypagetemplate" VALUE="$gmmorearchiveentrypagetemplate">
4715<INPUT TYPE=HIDDEN NAME="newpreviouslinktemplate" VALUE="$gmpreviouslinktemplate">
4716<INPUT TYPE=HIDDEN NAME="newnextlinktemplate" VALUE="$gmnextlinktemplate">
4717<INPUT TYPE=HIDDEN NAME="newpreviousmorelinktemplate" VALUE="$gmpreviousmorelinktemplate">
4718<INPUT TYPE=HIDDEN NAME="newnextmorelinktemplate" VALUE="$gmnextmorelinktemplate">
4719<INPUT TYPE=HIDDEN NAME="newlogarchiveslinktemplate" VALUE="$gmlogarchiveslinktemplate">
4720<INPUT TYPE=HIDDEN NAME="newentrypagelinktemplate" VALUE="$gmentrypagelinktemplate">
4721<INPUT TYPE=HIDDEN NAME="newmoreentrypagelinktemplate" VALUE="$gmmoreentrypagelinktemplate">
4722<INPUT TYPE=HIDDEN NAME="newlogarchiveslinkseparatortemplate" VALUE="$gmlogarchiveslinkseparatortemplate">
4723<INPUT TYPE=HIDDEN NAME="newentrypagelinkseparatortemplate" VALUE="$gmentrypagelinkseparatortemplate">
4724<INPUT TYPE=HIDDEN NAME="newentrypagelinkmonthseparatortemplate" VALUE="$gmentrypagelinkmonthseparatortemplate">
4725<INPUT TYPE=HIDDEN NAME="newentrypagelinkdayseparatortemplate" VALUE="$gmentrypagelinkdayseparatortemplate">
4726<INPUT TYPE=HIDDEN NAME="newentrypagelinkyearseparatortemplate" VALUE="$gmentrypagelinkyearseparatortemplate">
4727<INPUT TYPE=HIDDEN NAME="newheadertemplate" VALUE="$gmheadertemplate">
4728<INPUT TYPE=HIDDEN NAME="newfootertemplate" VALUE="$gmfootertemplate">
4729<INPUT TYPE=HIDDEN NAME="newsidebartemplate" VALUE="$gmsidebartemplate">
4730<INPUT TYPE=HIDDEN NAME="newentryseparatortemplate" VALUE="$gmentryseparatortemplate">
4731<INPUT TYPE=HIDDEN NAME="newlogarchiveslinkweeklytemplate" VALUE="$gmlogarchiveslinkweeklytemplate">
4732<INPUT TYPE=HIDDEN NAME="newcustomonetemplate" VALUE="$gmcustomonetemplate">
4733<INPUT TYPE=HIDDEN NAME="newcustomtwotemplate" VALUE="$gmcustomtwotemplate">
4734<INPUT TYPE=HIDDEN NAME="newcustomthreetemplate" VALUE="$gmcustomthreetemplate">
4735<INPUT TYPE=HIDDEN NAME="newcustomfourtemplate" VALUE="$gmcustomfourtemplate">
4736<INPUT TYPE=HIDDEN NAME="newcustomfivetemplate" VALUE="$gmcustomfivetemplate">
4737<INPUT TYPE=HIDDEN NAME="newcustomsixtemplate" VALUE="$gmcustomsixtemplate">
4738<INPUT TYPE=HIDDEN NAME="newcustomseventemplate" VALUE="$gmcustomseventemplate">
4739<INPUT TYPE=HIDDEN NAME="newcustomeighttemplate" VALUE="$gmcustomeighttemplate">
4740<INPUT TYPE=HIDDEN NAME="newcustomninetemplate" VALUE="$gmcustomninetemplate">
4741<INPUT TYPE=HIDDEN NAME="newcustomtentemplate" VALUE="$gmcustomtentemplate">
4742<INPUT TYPE=HIDDEN NAME="newpopuppagetemplate" VALUE="$gmpopuppagetemplate">
4743<INPUT TYPE=HIDDEN NAME="newpopupcodetemplate" VALUE="$gmpopupcodetemplate">
4744<INPUT TYPE=HIDDEN NAME="newsearchformtemplate" VALUE="$gmsearchformtemplate">
4745<INPUT TYPE=HIDDEN NAME="newsearchresultspagetemplate" VALUE="$gmsearchresultspagetemplate">
4746<INPUT TYPE=HIDDEN NAME="newsearchresultsentrytemplate" VALUE="$gmsearchresultsentrytemplate">
4747<INPUT TYPE=HIDDEN NAME="newcalendartablebeginningtemplate" VALUE="$gmcalendartablebeginningtemplate">
4748<INPUT TYPE=HIDDEN NAME="newcalendartableendingtemplate" VALUE="$gmcalendartableendingtemplate">
4749<INPUT TYPE=HIDDEN NAME="newcalendarblankcelltemplate" VALUE="$gmcalendarblankcelltemplate">
4750<INPUT TYPE=HIDDEN NAME="newcalendarfullcelltemplate" VALUE="$gmcalendarfullcelltemplate">
4751<INPUT TYPE=HIDDEN NAME="newcalendarfullcelllinktemplate" VALUE="$gmcalendarfullcelllinktemplate">
4752<INPUT TYPE=HIDDEN NAME="newcalendarweekfulldaytemplate" VALUE="$gmcalendarweekfulldaytemplate">
4753<INPUT TYPE=HIDDEN NAME="newcalendarweekfulldaylinktemplate" VALUE="$gmcalendarweekfulldaylinktemplate">
4754<INPUT TYPE=HIDDEN NAME="newcommentpreviewdividertemplate" VALUE="$gmcommentpreviewdividertemplate">
4755<INPUT TYPE=HIDDEN NAME="newcommentpreviewformtemplate" VALUE="$gmcommentpreviewformtemplate">
4756<INPUT TYPE=HIDDEN NAME="newsmartlinknocommentstemplate" VALUE="$gmsmartlinknocommentstemplate">
4757<INPUT TYPE=HIDDEN NAME="newsmartlinkonecommenttemplate" VALUE="$gmsmartlinkonecommenttemplate">
4758<INPUT TYPE=HIDDEN NAME="newsmartlinkmanycommentstemplate" VALUE="$gmsmartlinkmanycommentstemplate">
4759<INPUT TYPE=HIDDEN NAME="newlinebreaktemplate" VALUE="$gmlinebreaktemplate">
4760<INPUT TYPE=HIDDEN NAME="newcommentlinktargettemplate" VALUE="$gmcommentlinktargettemplate">
4761<INPUT TYPE=HIDDEN NAME="newsmartentrymoodtemplate" VALUE="$gmsmartentrymoodtemplate">
4762<INPUT TYPE=HIDDEN NAME="newsmartentrymusictemplate" VALUE="$gmsmartentrymusictemplate">
4763<INPUT TYPE=HIDDEN NAME="newcookiescodetemplate" VALUE="$gmcookiescodetemplate">
4764<INPUT TYPE=HIDDEN NAME="newsmartemoticonscodetemplate" VALUE="$gmsmartemoticonscodetemplate">
4765
4766
4767<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=720>
4768
4769<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2>$gmfonttag<TABLE BORDER=0 cellpadding=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><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 archives—an index page in your entries/archives directory intended for linking to all the archives (both the monthly/weekly logs and the individual entry pages) of your site. You can use variables such as {{logarchivelist}} and {{logentrylist}} here (or anywhere) to generate those list links; check the <a href="http://www.greymatterforums.com/info/manual.html" title="read the manual" target="_blank">manual</a> 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>
4770
4771<TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR>
4772
4773<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2>$gmfonttag<TABLE BORDER=0 cellpadding=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><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>
4774
4775<TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR>
4776
4777<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><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=1 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=1 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>
4778
4779<TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR>
4780
4781<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#C0C0C0"><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.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><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>
4782
4783<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#C0C0C0"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Archive Date Grouping Header 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.<BR> <BR> </FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 cellpadding=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#C0C0C0"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>Archive Date Grouping Footer Template</B><BR><FONT SIZE=1>This is the complement to the Date Grouping Template. if you open a tag in the Date Grouping Template (such as a div or td) you can place the closing tag here. That allows you to contain a date grouping inside an element. All date variables that are supported in the Date Grouping Header Template are supported here as well. This works the same as it does on the main index, except this is how the date header will appear in your log archives.</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="newdategroupingfooterarchivetemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmdategroupingfooterarchivetemplate</TEXTAREA>$gmfonttag</FONT><br>$gmfonttag<FONT SIZE=1><INPUT TYPE=CHECKBOX NAME="archivedatefootercheck" VALUE="yes"> Make this the same as the main index version</FONT></FONT></TD></FONT></FONT></TD></TR></TABLE></TD></TR>
4784
4785
4786</TABLE>
4787$autorebuildcheckbox
4788<P>
4789<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">
4790<P>
4791<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Templates Menu">
4792<P>
4793<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0">
4794</FORM>
4795<P>
4796<FONT SIZE=1>"History never looks like history when you're living through it."—John Gardner</FONT>
4797$gmframebottom
4798
4799</BODY>
4800</HTML>
4801
4802GMEDITARCHIVETEMPLATES
4803
4804$statusnote = "";
4805
4806exit;
4807
4808}
4809
4810# --------------------------------
4811# edit template group: entry pages
4812# --------------------------------
4813
4814sub gm_editentrypagetemplates {
4815
4816&gm_validate;
4817
4818if (($gmtemplateaccess eq "no") || ($gmtemplateaccess eq "hfsonly")) {
4819 &gm_writetocplog("$IN{'authorname'} attempted to edit the entry page templates without authorization");
4820 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the entry page templates.</FONT></B><P>);
4821 &gm_frontpage;
4822}
4823
4824&gm_readtemplates;
4825
4826&gm_delousealltemplates;
4827
4828if ($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>); }
4829
4830$autorebuildcheckbox = "";
4831
4832if ($gmrebuildaccess eq "yes") {
4833 if ($automaticrebuilddefault eq "yes") {
4834 $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>);
4835 } else {
4836 $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>);
4837 }
4838}
4839
4840&gm_readcounter;
4841if ($newentrynumber eq "0") { $autorebuildcheckbox = ""; }
4842
4843print<<GMEDITENTRYPAGETEMPLATES;
4844
4845$gmheadtag
4846
4847$gmframetop
4848$statusnote
4849<FORM ACTION="gm.cgi" METHOD=POST>
4850<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
4851<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
4852<INPUT TYPE=HIDDEN NAME="modifiedtemplategroup" VALUE="entry page">
4853<INPUT TYPE=HIDDEN NAME="newindextemplate" VALUE="$gmindextemplate">
4854<INPUT TYPE=HIDDEN NAME="newarchiveindextemplate" VALUE="$gmarchiveindextemplate">
4855<INPUT TYPE=HIDDEN NAME="newentrytemplate" VALUE="$gmentrytemplate">
4856<INPUT TYPE=HIDDEN NAME="newarchiveentrytemplate" VALUE="$gmarchiveentrytemplate">
4857<INPUT TYPE=HIDDEN NAME="newstayattoptemplate" VALUE="$gmstayattoptemplate">
4858<INPUT TYPE=HIDDEN NAME="newdatetemplate" VALUE="$gmdatetemplate">
4859<INPUT TYPE=HIDDEN NAME="newcommentstemplate" VALUE="$gmcommentstemplate">
4860<INPUT TYPE=HIDDEN NAME="newcommentsformtemplate" VALUE="$gmcommentsformtemplate">
4861<INPUT TYPE=HIDDEN NAME="newparaseparationtemplate" VALUE="$gmparaseparationtemplate">
4862<INPUT TYPE=HIDDEN NAME="newkarmaformtemplate" VALUE="$gmkarmaformtemplate">
4863<INPUT TYPE=HIDDEN NAME="newlinktargettemplate" VALUE="$gmlinktargettemplate">
4864<INPUT TYPE=HIDDEN NAME="newdategroupingfootertemplate" VALUE="$gmdategroupingfootertemplate">
4865<INPUT TYPE=HIDDEN NAME="newkarmalinktemplate" VALUE="$gmkarmalinktemplate">
4866<INPUT TYPE=HIDDEN NAME="newcommentslinktemplate" VALUE="$gmcommentslinktemplate">
4867<INPUT TYPE=HIDDEN NAME="newcommentauthoremailtemplate" VALUE="$gmcommentauthoremailtemplate">
4868<INPUT TYPE=HIDDEN NAME="newcommentauthorhomepagetemplate" VALUE="$gmcommentauthorhomepagetemplate">
4869<INPUT TYPE=HIDDEN NAME="newcommentdividertemplate" VALUE="$gmcommentdividertemplate">
4870<INPUT TYPE=HIDDEN NAME="newmoreentrytemplate" VALUE="$gmmoreentrytemplate">
4871<INPUT TYPE=HIDDEN NAME="newpreviouslinktemplate" VALUE="$gmpreviouslinktemplate">
4872<INPUT TYPE=HIDDEN NAME="newnextlinktemplate" VALUE="$gmnextlinktemplate">
4873<INPUT TYPE=HIDDEN NAME="newpreviousmorelinktemplate" VALUE="$gmpreviousmorelinktemplate">
4874<INPUT TYPE=HIDDEN NAME="newnextmorelinktemplate" VALUE="$gmnextmorelinktemplate">
4875<INPUT TYPE=HIDDEN NAME="newarchivemasterindextemplate" VALUE="$gmarchivemasterindextemplate">
4876<INPUT TYPE=HIDDEN NAME="newlogarchiveslinktemplate" VALUE="$gmlogarchiveslinktemplate">
4877<INPUT TYPE=HIDDEN NAME="newentrypagelinktemplate" VALUE="$gmentrypagelinktemplate">
4878<INPUT TYPE=HIDDEN NAME="newmoreentrypagelinktemplate" VALUE="$gmmoreentrypagelinktemplate">
4879<INPUT TYPE=HIDDEN NAME="newlogarchiveslinkseparatortemplate" VALUE="$gmlogarchiveslinkseparatortemplate">
4880<INPUT TYPE=HIDDEN NAME="newentrypagelinkseparatortemplate" VALUE="$gmentrypagelinkseparatortemplate">
4881<INPUT TYPE=HIDDEN NAME="newentrypagelinkmonthseparatortemplate" VALUE="$gmentrypagelinkmonthseparatortemplate">
4882<INPUT TYPE=HIDDEN NAME="newentrypagelinkdayseparatortemplate" VALUE="$gmentrypagelinkdayseparatortemplate">
4883<INPUT TYPE=HIDDEN NAME="newentrypagelinkyearseparatortemplate" VALUE="$gmentrypagelinkyearseparatortemplate">
4884<INPUT TYPE=HIDDEN NAME="newheadertemplate" VALUE="$gmheadertemplate">
4885<INPUT TYPE=HIDDEN NAME="newfootertemplate" VALUE="$gmfootertemplate">
4886<INPUT TYPE=HIDDEN NAME="newsidebartemplate" VALUE="$gmsidebartemplate">
4887<INPUT TYPE=HIDDEN NAME="newentryseparatortemplate" VALUE="$gmentryseparatortemplate">
4888<INPUT TYPE=HIDDEN NAME="newarchiveentryseparatortemplate" VALUE="$gmarchiveentryseparatortemplate">
4889<INPUT TYPE=HIDDEN NAME="newmorearchiveentrytemplate" VALUE="$gmmorearchiveentrytemplate">
4890<INPUT TYPE=HIDDEN NAME="newdatearchivetemplate" VALUE="$gmdatearchivetemplate">
4891<INPUT TYPE=HIDDEN NAME="newlogarchiveslinkweeklytemplate" VALUE="$gmlogarchiveslinkweeklytemplate">
4892<INPUT TYPE=HIDDEN NAME="newcustomonetemplate" VALUE="$gmcustomonetemplate">
4893<INPUT TYPE=HIDDEN NAME="newcustomtwotemplate" VALUE="$gmcustomtwotemplate">
4894<INPUT TYPE=HIDDEN NAME="newcustomthreetemplate" VALUE="$gmcustomthreetemplate">
4895<INPUT TYPE=HIDDEN NAME="newcustomfourtemplate" VALUE="$gmcustomfourtemplate">
4896<INPUT TYPE=HIDDEN NAME="newcustomfivetemplate" VALUE="$gmcustomfivetemplate">
4897<INPUT TYPE=HIDDEN NAME="newcustomsixtemplate" VALUE="$gmcustomsixtemplate">
4898<INPUT TYPE=HIDDEN NAME="newcustomseventemplate" VALUE="$gmcustomseventemplate">
4899<INPUT TYPE=HIDDEN NAME="newcustomeighttemplate" VALUE="$gmcustomeighttemplate">
4900<INPUT TYPE=HIDDEN NAME="newcustomninetemplate" VALUE="$gmcustomninetemplate">
4901<INPUT TYPE=HIDDEN NAME="newcustomtentemplate" VALUE="$gmcustomtentemplate">
4902<INPUT TYPE=HIDDEN NAME="newpopuppagetemplate" VALUE="$gmpopuppagetemplate">
4903<INPUT TYPE=HIDDEN NAME="newpopupcodetemplate" VALUE="$gmpopupcodetemplate">
4904<INPUT TYPE=HIDDEN NAME="newsearchformtemplate" VALUE="$gmsearchformtemplate">
4905<INPUT TYPE=HIDDEN NAME="newsearchresultspagetemplate" VALUE="$gmsearchresultspagetemplate">
4906<INPUT TYPE=HIDDEN NAME="newsearchresultsentrytemplate" VALUE="$gmsearchresultsentrytemplate">
4907<INPUT TYPE=HIDDEN NAME="newcalendartablebeginningtemplate" VALUE="$gmcalendartablebeginningtemplate">
4908<INPUT TYPE=HIDDEN NAME="newcalendartableendingtemplate" VALUE="$gmcalendartableendingtemplate">
4909<INPUT TYPE=HIDDEN NAME="newcalendarblankcelltemplate" VALUE="$gmcalendarblankcelltemplate">
4910<INPUT TYPE=HIDDEN NAME="newcalendarfullcelltemplate" VALUE="$gmcalendarfullcelltemplate">
4911<INPUT TYPE=HIDDEN NAME="newcalendarfullcelllinktemplate" VALUE="$gmcalendarfullcelllinktemplate">
4912<INPUT TYPE=HIDDEN NAME="newcalendarweekfulldaytemplate" VALUE="$gmcalendarweekfulldaytemplate">
4913<INPUT TYPE=HIDDEN NAME="newcalendarweekfulldaylinktemplate" VALUE="$gmcalendarweekfulldaylinktemplate">
4914<INPUT TYPE=HIDDEN NAME="newcommentpreviewdividertemplate" VALUE="$gmcommentpreviewdividertemplate">
4915<INPUT TYPE=HIDDEN NAME="newcommentpreviewformtemplate" VALUE="$gmcommentpreviewformtemplate">
4916<INPUT TYPE=HIDDEN NAME="newsmartlinknocommentstemplate" VALUE="$gmsmartlinknocommentstemplate">
4917<INPUT TYPE=HIDDEN NAME="newsmartlinkonecommenttemplate" VALUE="$gmsmartlinkonecommenttemplate">
4918<INPUT TYPE=HIDDEN NAME="newsmartlinkmanycommentstemplate" VALUE="$gmsmartlinkmanycommentstemplate">
4919<INPUT TYPE=HIDDEN NAME="newlinebreaktemplate" VALUE="$gmlinebreaktemplate">
4920<INPUT TYPE=HIDDEN NAME="newcommentlinktargettemplate" VALUE="$gmcommentlinktargettemplate">
4921<INPUT TYPE=HIDDEN NAME="newsmartentrymoodtemplate" VALUE="$gmsmartentrymoodtemplate">
4922<INPUT TYPE=HIDDEN NAME="newsmartentrymusictemplate" VALUE="$gmsmartentrymusictemplate">
4923<INPUT TYPE=HIDDEN NAME="newdategroupingfooterarchivetemplate" VALUE="$gmdategroupingfooterarchivetemplate">
4924<INPUT TYPE=HIDDEN NAME="newcookiescodetemplate" VALUE="$gmcookiescodetemplate">
4925<INPUT TYPE=HIDDEN NAME="newsmartemoticonscodetemplate" VALUE="$gmsmartemoticonscodetemplate">
4926
4927<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=720>
4928
4929<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2>$gmfonttag<TABLE BORDER=0 cellpadding=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><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>
4930
4931<TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR>
4932
4933<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2>$gmfonttag<TABLE BORDER=0 cellpadding=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><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>
4934
4935<TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR>
4936
4937<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2>$gmfonttag<TABLE BORDER=0 cellpadding=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><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>
4938
4939<TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR>
4940
4941<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2>$gmfonttag<TABLE BORDER=0 cellpadding=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><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>
4942
4943</TABLE>
4944$autorebuildcheckbox
4945<P>
4946<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">
4947<P>
4948<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Templates Menu">
4949<P>
4950<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0">
4951</FORM>
4952<P>
4953<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>
4954$gmframebottom
4955
4956</BODY>
4957</HTML>
4958
4959GMEDITENTRYPAGETEMPLATES
4960
4961$statusnote = "";
4962
4963exit;
4964
4965}
4966
4967# -------------------------------------
4968# edit template group: karma & comments
4969# -------------------------------------
4970
4971sub gm_editkarmacommentstemplates {
4972
4973&gm_validate;
4974
4975if (($gmtemplateaccess eq "no") || ($gmtemplateaccess eq "hfsonly")) {
4976 &gm_writetocplog("$IN{'authorname'} attempted to edit the karma & comments templates without authorization");
4977 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the karma & comments templates.</FONT></B><P>);
4978 &gm_frontpage;
4979}
4980
4981&gm_readtemplates;
4982
4983&gm_delousealltemplates;
4984
4985if ($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>); }
4986
4987$autorebuildcheckbox = "";
4988
4989if ($gmrebuildaccess eq "yes") {
4990 if ($automaticrebuilddefault eq "yes") {
4991 $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>);
4992 } else {
4993 $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>);
4994 }
4995}
4996
4997&gm_readcounter;
4998if ($newentrynumber eq "0") { $autorebuildcheckbox = ""; }
4999
5000print<<GMEDITKARMACOMMENTSTEMPLATES;
5001
5002$gmheadtag
5003
5004$gmframetop
5005$statusnote
5006<FORM ACTION="gm.cgi" METHOD=POST>
5007<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
5008<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
5009<INPUT TYPE=HIDDEN NAME="modifiedtemplategroup" VALUE="karma & comments">
5010<INPUT TYPE=HIDDEN NAME="newindextemplate" VALUE="$gmindextemplate">
5011<INPUT TYPE=HIDDEN NAME="newentrypagetemplate" VALUE="$gmentrypagetemplate">
5012<INPUT TYPE=HIDDEN NAME="newarchiveindextemplate" VALUE="$gmarchiveindextemplate">
5013<INPUT TYPE=HIDDEN NAME="newarchiveentrypagetemplate" VALUE="$gmarchiveentrypagetemplate">
5014<INPUT TYPE=HIDDEN NAME="newentrytemplate" VALUE="$gmentrytemplate">
5015<INPUT TYPE=HIDDEN NAME="newarchiveentrytemplate" VALUE="$gmarchiveentrytemplate">
5016<INPUT TYPE=HIDDEN NAME="newstayattoptemplate" VALUE="$gmstayattoptemplate">
5017<INPUT TYPE=HIDDEN NAME="newdatetemplate" VALUE="$gmdatetemplate">
5018<INPUT TYPE=HIDDEN NAME="newparaseparationtemplate" VALUE="$gmparaseparationtemplate">
5019<INPUT TYPE=HIDDEN NAME="newlinktargettemplate" VALUE="$gmlinktargettemplate">
5020<INPUT TYPE=HIDDEN NAME="newdategroupingfootertemplate" VALUE="$gmdategroupingfootertemplate">
5021<INPUT TYPE=HIDDEN NAME="newmoreentrytemplate" VALUE="$gmmoreentrytemplate">
5022<INPUT TYPE=HIDDEN NAME="newmoreentrypagetemplate" VALUE="$gmmoreentrypagetemplate">
5023<INPUT TYPE=HIDDEN NAME="newmorearchiveentrypagetemplate" VALUE="$gmmorearchiveentrypagetemplate">
5024<INPUT TYPE=HIDDEN NAME="newpreviouslinktemplate" VALUE="$gmpreviouslinktemplate">
5025<INPUT TYPE=HIDDEN NAME="newnextlinktemplate" VALUE="$gmnextlinktemplate">
5026<INPUT TYPE=HIDDEN NAME="newpreviousmorelinktemplate" VALUE="$gmpreviousmorelinktemplate">
5027<INPUT TYPE=HIDDEN NAME="newnextmorelinktemplate" VALUE="$gmnextmorelinktemplate">
5028<INPUT TYPE=HIDDEN NAME="newarchivemasterindextemplate" VALUE="$gmarchivemasterindextemplate">
5029<INPUT TYPE=HIDDEN NAME="newlogarchiveslinktemplate" VALUE="$gmlogarchiveslinktemplate">
5030<INPUT TYPE=HIDDEN NAME="newentrypagelinktemplate" VALUE="$gmentrypagelinktemplate">
5031<INPUT TYPE=HIDDEN NAME="newmoreentrypagelinktemplate" VALUE="$gmmoreentrypagelinktemplate">
5032<INPUT TYPE=HIDDEN NAME="newlogarchiveslinkseparatortemplate" VALUE="$gmlogarchiveslinkseparatortemplate">
5033<INPUT TYPE=HIDDEN NAME="newentrypagelinkseparatortemplate" VALUE="$gmentrypagelinkseparatortemplate">
5034<INPUT TYPE=HIDDEN NAME="newentrypagelinkmonthseparatortemplate" VALUE="$gmentrypagelinkmonthseparatortemplate">
5035<INPUT TYPE=HIDDEN NAME="newentrypagelinkdayseparatortemplate" VALUE="$gmentrypagelinkdayseparatortemplate">
5036<INPUT TYPE=HIDDEN NAME="newentrypagelinkyearseparatortemplate" VALUE="$gmentrypagelinkyearseparatortemplate">
5037<INPUT TYPE=HIDDEN NAME="newheadertemplate" VALUE="$gmheadertemplate">
5038<INPUT TYPE=HIDDEN NAME="newfootertemplate" VALUE="$gmfootertemplate">
5039<INPUT TYPE=HIDDEN NAME="newsidebartemplate" VALUE="$gmsidebartemplate">
5040<INPUT TYPE=HIDDEN NAME="newentryseparatortemplate" VALUE="$gmentryseparatortemplate">
5041<INPUT TYPE=HIDDEN NAME="newarchiveentryseparatortemplate" VALUE="$gmarchiveentryseparatortemplate">
5042<INPUT TYPE=HIDDEN NAME="newmorearchiveentrytemplate" VALUE="$gmmorearchiveentrytemplate">
5043<INPUT TYPE=HIDDEN NAME="newdatearchivetemplate" VALUE="$gmdatearchivetemplate">
5044<INPUT TYPE=HIDDEN NAME="newlogarchiveslinkweeklytemplate" VALUE="$gmlogarchiveslinkweeklytemplate">
5045<INPUT TYPE=HIDDEN NAME="newcustomonetemplate" VALUE="$gmcustomonetemplate">
5046<INPUT TYPE=HIDDEN NAME="newcustomtwotemplate" VALUE="$gmcustomtwotemplate">
5047<INPUT TYPE=HIDDEN NAME="newcustomthreetemplate" VALUE="$gmcustomthreetemplate">
5048<INPUT TYPE=HIDDEN NAME="newcustomfourtemplate" VALUE="$gmcustomfourtemplate">
5049<INPUT TYPE=HIDDEN NAME="newcustomfivetemplate" VALUE="$gmcustomfivetemplate">
5050<INPUT TYPE=HIDDEN NAME="newcustomsixtemplate" VALUE="$gmcustomsixtemplate">
5051<INPUT TYPE=HIDDEN NAME="newcustomseventemplate" VALUE="$gmcustomseventemplate">
5052<INPUT TYPE=HIDDEN NAME="newcustomeighttemplate" VALUE="$gmcustomeighttemplate">
5053<INPUT TYPE=HIDDEN NAME="newcustomninetemplate" VALUE="$gmcustomninetemplate">
5054<INPUT TYPE=HIDDEN NAME="newcustomtentemplate" VALUE="$gmcustomtentemplate">
5055<INPUT TYPE=HIDDEN NAME="newpopuppagetemplate" VALUE="$gmpopuppagetemplate">
5056<INPUT TYPE=HIDDEN NAME="newpopupcodetemplate" VALUE="$gmpopupcodetemplate">
5057<INPUT TYPE=HIDDEN NAME="newsearchformtemplate" VALUE="$gmsearchformtemplate">
5058<INPUT TYPE=HIDDEN NAME="newsearchresultspagetemplate" VALUE="$gmsearchresultspagetemplate">
5059<INPUT TYPE=HIDDEN NAME="newsearchresultsentrytemplate" VALUE="$gmsearchresultsentrytemplate">
5060<INPUT TYPE=HIDDEN NAME="newcalendartablebeginningtemplate" VALUE="$gmcalendartablebeginningtemplate">
5061<INPUT TYPE=HIDDEN NAME="newcalendartableendingtemplate" VALUE="$gmcalendartableendingtemplate">
5062<INPUT TYPE=HIDDEN NAME="newcalendarblankcelltemplate" VALUE="$gmcalendarblankcelltemplate">
5063<INPUT TYPE=HIDDEN NAME="newcalendarfullcelltemplate" VALUE="$gmcalendarfullcelltemplate">
5064<INPUT TYPE=HIDDEN NAME="newcalendarfullcelllinktemplate" VALUE="$gmcalendarfullcelllinktemplate">
5065<INPUT TYPE=HIDDEN NAME="newcalendarweekfulldaytemplate" VALUE="$gmcalendarweekfulldaytemplate">
5066<INPUT TYPE=HIDDEN NAME="newcalendarweekfulldaylinktemplate" VALUE="$gmcalendarweekfulldaylinktemplate">
5067<INPUT TYPE=HIDDEN NAME="newlinebreaktemplate" VALUE="$gmlinebreaktemplate">
5068<INPUT TYPE=HIDDEN NAME="newcommentlinktargettemplate" VALUE="$gmcommentlinktargettemplate">
5069<INPUT TYPE=HIDDEN NAME="newsmartentrymoodtemplate" VALUE="$gmsmartentrymoodtemplate">
5070<INPUT TYPE=HIDDEN NAME="newsmartentrymusictemplate" VALUE="$gmsmartentrymusictemplate">
5071<INPUT TYPE=HIDDEN NAME="newdategroupingfooterarchivetemplate" VALUE="$gmdategroupingfooterarchivetemplate">
5072
5073
5074<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=720>
5075
5076<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><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=1 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=1 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>
5077
5078<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#C0C0C0"><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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#C0C0C0"><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>
5079
5080<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#C0C0C0"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>{{smartemoticonscode}} Template</B><BR><FONT SIZE=1>The {{smartemoticonscode}} template (whatever you set below) will only appear if you have allowed emoticons to be posted in comments in your config settings.<BR> </FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 cellpadding=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#C0C0C0"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<B>{{cookiescode}} Template</B><BR><FONT SIZE=1>The {{cookiescode}} template allows you to define a Javascript that allows setting cookies on your commenters--this supports remembering the details that commenters provide on your site.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newsmartemoticonscodetemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmsmartemoticonscodetemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcookiescodetemplate" COLS=41 ROWS=10 WRAP=VIRTUAL STYLE="width: 355">$gmcookiescodetemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR></TABLE></TD></TR>
5081
5082<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#C0C0C0"><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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=351 BGCOLOR="#C0C0C0"><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>
5083
5084<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><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=1 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=1 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>
5085
5086<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><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=1 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=1 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=1 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>
5087
5088<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><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=1 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=1 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>
5089
5090</TABLE>
5091$autorebuildcheckbox
5092<P>
5093<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">
5094<P>
5095<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Templates Menu">
5096<P>
5097<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0">
5098</FORM>
5099<P>
5100<FONT SIZE=1>"We all shine on, like the moon and the stars and the sun."—John Lennon, "Instant Karma!"</FONT>
5101$gmframebottom
5102
5103</BODY>
5104</HTML>
5105
5106GMEDITKARMACOMMENTSTEMPLATES
5107
5108$statusnote = "";
5109
5110exit;
5111
5112}
5113
5114# ---------------------------------------------
5115# edit template group: header, footer & sidebar
5116# ---------------------------------------------
5117
5118sub gm_editheaderfootertemplates {
5119
5120&gm_validate;
5121
5122if ($gmtemplateaccess eq "no") {
5123 &gm_writetocplog("$IN{'authorname'} attempted to edit the header, footer & sidebar templates without authorization");
5124 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the header, footer & sidebar templates.</FONT></B><P>);
5125 &gm_frontpage;
5126}
5127
5128&gm_readtemplates;
5129
5130&gm_delousealltemplates;
5131
5132if ($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 something—certain text, graphics, formatting, etc.—that appears across all your pages, but you don't want to have to modify all the templates each time you change them, simply use the Header, Footer and Sidebar templates below, or any of the ten custom templates. Their contents will be inserted wherever the respective variables appear in your templates.</FONT></TD></TR></TABLE><P>); }
5133
5134$autorebuildcheckbox = "";
5135
5136if ($gmrebuildaccess eq "yes") {
5137 if ($automaticrebuilddefault eq "yes") {
5138 $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>);
5139 } else {
5140 $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>);
5141 }
5142}
5143
5144&gm_readcounter;
5145if ($newentrynumber eq "0") { $autorebuildcheckbox = ""; }
5146
5147print<<GMEDITHEADERFOOTERTEMPLATES;
5148
5149$gmheadtag
5150
5151$gmframetop
5152$statusnote
5153<FORM ACTION="gm.cgi" METHOD=POST>
5154<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
5155<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
5156<INPUT TYPE=HIDDEN NAME="modifiedtemplategroup" VALUE="header, footer & sidebar">
5157<INPUT TYPE=HIDDEN NAME="newindextemplate" VALUE="$gmindextemplate">
5158<INPUT TYPE=HIDDEN NAME="newentrypagetemplate" VALUE="$gmentrypagetemplate">
5159<INPUT TYPE=HIDDEN NAME="newarchiveindextemplate" VALUE="$gmarchiveindextemplate">
5160<INPUT TYPE=HIDDEN NAME="newarchiveentrypagetemplate" VALUE="$gmarchiveentrypagetemplate">
5161<INPUT TYPE=HIDDEN NAME="newentrytemplate" VALUE="$gmentrytemplate">
5162<INPUT TYPE=HIDDEN NAME="newarchiveentrytemplate" VALUE="$gmarchiveentrytemplate">
5163<INPUT TYPE=HIDDEN NAME="newstayattoptemplate" VALUE="$gmstayattoptemplate">
5164<INPUT TYPE=HIDDEN NAME="newdatetemplate" VALUE="$gmdatetemplate">
5165<INPUT TYPE=HIDDEN NAME="newcommentstemplate" VALUE="$gmcommentstemplate">
5166<INPUT TYPE=HIDDEN NAME="newcommentsformtemplate" VALUE="$gmcommentsformtemplate">
5167<INPUT TYPE=HIDDEN NAME="newparaseparationtemplate" VALUE="$gmparaseparationtemplate">
5168<INPUT TYPE=HIDDEN NAME="newkarmaformtemplate" VALUE="$gmkarmaformtemplate">
5169<INPUT TYPE=HIDDEN NAME="newlinktargettemplate" VALUE="$gmlinktargettemplate">
5170<INPUT TYPE=HIDDEN NAME="newdategroupingfootertemplate" VALUE="$gmdategroupingfootertemplate">
5171<INPUT TYPE=HIDDEN NAME="newkarmalinktemplate" VALUE="$gmkarmalinktemplate">
5172<INPUT TYPE=HIDDEN NAME="newcommentslinktemplate" VALUE="$gmcommentslinktemplate">
5173<INPUT TYPE=HIDDEN NAME="newcommentauthoremailtemplate" VALUE="$gmcommentauthoremailtemplate">
5174<INPUT TYPE=HIDDEN NAME="newcommentauthorhomepagetemplate" VALUE="$gmcommentauthorhomepagetemplate">
5175<INPUT TYPE=HIDDEN NAME="newcommentdividertemplate" VALUE="$gmcommentdividertemplate">
5176<INPUT TYPE=HIDDEN NAME="newmoreentrytemplate" VALUE="$gmmoreentrytemplate">
5177<INPUT TYPE=HIDDEN NAME="newmoreentrypagetemplate" VALUE="$gmmoreentrypagetemplate">
5178<INPUT TYPE=HIDDEN NAME="newmorearchiveentrypagetemplate" VALUE="$gmmorearchiveentrypagetemplate">
5179<INPUT TYPE=HIDDEN NAME="newpreviouslinktemplate" VALUE="$gmpreviouslinktemplate">
5180<INPUT TYPE=HIDDEN NAME="newnextlinktemplate" VALUE="$gmnextlinktemplate">
5181<INPUT TYPE=HIDDEN NAME="newpreviousmorelinktemplate" VALUE="$gmpreviousmorelinktemplate">
5182<INPUT TYPE=HIDDEN NAME="newnextmorelinktemplate" VALUE="$gmnextmorelinktemplate">
5183<INPUT TYPE=HIDDEN NAME="newarchivemasterindextemplate" VALUE="$gmarchivemasterindextemplate">
5184<INPUT TYPE=HIDDEN NAME="newlogarchiveslinktemplate" VALUE="$gmlogarchiveslinktemplate">
5185<INPUT TYPE=HIDDEN NAME="newentrypagelinktemplate" VALUE="$gmentrypagelinktemplate">
5186<INPUT TYPE=HIDDEN NAME="newmoreentrypagelinktemplate" VALUE="$gmmoreentrypagelinktemplate">
5187<INPUT TYPE=HIDDEN NAME="newlogarchiveslinkseparatortemplate" VALUE="$gmlogarchiveslinkseparatortemplate">
5188<INPUT TYPE=HIDDEN NAME="newentrypagelinkseparatortemplate" VALUE="$gmentrypagelinkseparatortemplate">
5189<INPUT TYPE=HIDDEN NAME="newentrypagelinkmonthseparatortemplate" VALUE="$gmentrypagelinkmonthseparatortemplate">
5190<INPUT TYPE=HIDDEN NAME="newentrypagelinkdayseparatortemplate" VALUE="$gmentrypagelinkdayseparatortemplate">
5191<INPUT TYPE=HIDDEN NAME="newentrypagelinkyearseparatortemplate" VALUE="$gmentrypagelinkyearseparatortemplate">
5192<INPUT TYPE=HIDDEN NAME="newentryseparatortemplate" VALUE="$gmentryseparatortemplate">
5193<INPUT TYPE=HIDDEN NAME="newarchiveentryseparatortemplate" VALUE="$gmarchiveentryseparatortemplate">
5194<INPUT TYPE=HIDDEN NAME="newmorearchiveentrytemplate" VALUE="$gmmorearchiveentrytemplate">
5195<INPUT TYPE=HIDDEN NAME="newdatearchivetemplate" VALUE="$gmdatearchivetemplate">
5196<INPUT TYPE=HIDDEN NAME="newlogarchiveslinkweeklytemplate" VALUE="$gmlogarchiveslinkweeklytemplate">
5197<INPUT TYPE=HIDDEN NAME="newpopuppagetemplate" VALUE="$gmpopuppagetemplate">
5198<INPUT TYPE=HIDDEN NAME="newpopupcodetemplate" VALUE="$gmpopupcodetemplate">
5199<INPUT TYPE=HIDDEN NAME="newsearchformtemplate" VALUE="$gmsearchformtemplate">
5200<INPUT TYPE=HIDDEN NAME="newsearchresultspagetemplate" VALUE="$gmsearchresultspagetemplate">
5201<INPUT TYPE=HIDDEN NAME="newsearchresultsentrytemplate" VALUE="$gmsearchresultsentrytemplate">
5202<INPUT TYPE=HIDDEN NAME="newcalendartablebeginningtemplate" VALUE="$gmcalendartablebeginningtemplate">
5203<INPUT TYPE=HIDDEN NAME="newcalendartableendingtemplate" VALUE="$gmcalendartableendingtemplate">
5204<INPUT TYPE=HIDDEN NAME="newcalendarblankcelltemplate" VALUE="$gmcalendarblankcelltemplate">
5205<INPUT TYPE=HIDDEN NAME="newcalendarfullcelltemplate" VALUE="$gmcalendarfullcelltemplate">
5206<INPUT TYPE=HIDDEN NAME="newcalendarfullcelllinktemplate" VALUE="$gmcalendarfullcelllinktemplate">
5207<INPUT TYPE=HIDDEN NAME="newcalendarweekfulldaytemplate" VALUE="$gmcalendarweekfulldaytemplate">
5208<INPUT TYPE=HIDDEN NAME="newcalendarweekfulldaylinktemplate" VALUE="$gmcalendarweekfulldaylinktemplate">
5209<INPUT TYPE=HIDDEN NAME="newcommentpreviewdividertemplate" VALUE="$gmcommentpreviewdividertemplate">
5210<INPUT TYPE=HIDDEN NAME="newcommentpreviewformtemplate" VALUE="$gmcommentpreviewformtemplate">
5211<INPUT TYPE=HIDDEN NAME="newsmartlinknocommentstemplate" VALUE="$gmsmartlinknocommentstemplate">
5212<INPUT TYPE=HIDDEN NAME="newsmartlinkonecommenttemplate" VALUE="$gmsmartlinkonecommenttemplate">
5213<INPUT TYPE=HIDDEN NAME="newsmartlinkmanycommentstemplate" VALUE="$gmsmartlinkmanycommentstemplate">
5214<INPUT TYPE=HIDDEN NAME="newlinebreaktemplate" VALUE="$gmlinebreaktemplate">
5215<INPUT TYPE=HIDDEN NAME="newcommentlinktargettemplate" VALUE="$gmcommentlinktargettemplate">
5216<INPUT TYPE=HIDDEN NAME="newsmartentrymoodtemplate" VALUE="$gmsmartentrymoodtemplate">
5217<INPUT TYPE=HIDDEN NAME="newsmartentrymusictemplate" VALUE="$gmsmartentrymusictemplate">
5218<INPUT TYPE=HIDDEN NAME="newdategroupingfooterarchivetemplate" VALUE="$gmdategroupingfooterarchivetemplate">
5219<INPUT TYPE=HIDDEN NAME="newcookiescodetemplate" VALUE="$gmcookiescodetemplate">
5220<INPUT TYPE=HIDDEN NAME="newsmartemoticonscodetemplate" VALUE="$gmsmartemoticonscodetemplate">
5221
5222
5223<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=720>
5224
5225<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2>$gmfonttag<TABLE BORDER=0 cellpadding=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><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>
5226
5227<TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR>
5228
5229<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2>$gmfonttag<TABLE BORDER=0 cellpadding=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><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>
5230
5231<TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR>
5232
5233<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2>$gmfonttag<TABLE BORDER=0 cellpadding=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><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>
5234
5235<TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR>
5236
5237<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>Miscellaneous Custom Templates</B><BR><FONT SIZE=1>Whatever you put in any of the templates below will appear wherever their respective variables are used.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 cellpadding=1 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>{{customone}} Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 cellpadding=1 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>{{customtwo}} Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcustomonetemplate" COLS=41 ROWS=20 WRAP=VIRTUAL STYLE="width: 355">$gmcustomonetemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcustomtwotemplate" COLS=41 ROWS=20 WRAP=VIRTUAL STYLE="width: 355">$gmcustomtwotemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 cellpadding=1 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>{{customthree}} Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 cellpadding=1 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>{{customfour}} Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcustomthreetemplate" COLS=41 ROWS=20 WRAP=VIRTUAL STYLE="width: 355">$gmcustomthreetemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcustomfourtemplate" COLS=41 ROWS=20 WRAP=VIRTUAL STYLE="width: 355">$gmcustomfourtemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 cellpadding=1 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>{{customfive}} Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 cellpadding=1 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>{{customsix}} Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcustomfivetemplate" COLS=41 ROWS=20 WRAP=VIRTUAL STYLE="width: 355">$gmcustomfivetemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcustomsixtemplate" COLS=41 ROWS=20 WRAP=VIRTUAL STYLE="width: 355">$gmcustomsixtemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 cellpadding=1 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>{{customseven}} Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 cellpadding=1 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>{{customeight}} Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcustomseventemplate" COLS=41 ROWS=20 WRAP=VIRTUAL STYLE="width: 355">$gmcustomseventemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcustomeighttemplate" COLS=41 ROWS=20 WRAP=VIRTUAL STYLE="width: 355">$gmcustomeighttemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 cellpadding=1 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>{{customnine}} Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 cellpadding=1 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>{{customten}} Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcustomninetemplate" COLS=41 ROWS=20 WRAP=VIRTUAL STYLE="width: 355">$gmcustomninetemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcustomtentemplate" COLS=41 ROWS=20 WRAP=VIRTUAL STYLE="width: 355">$gmcustomtentemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR></TABLE></TD></TR>
5238
5239</TABLE>
5240$autorebuildcheckbox
5241<P>
5242<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">
5243<P>
5244<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Templates Menu">
5245<P>
5246<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0">
5247</FORM>
5248<P>
5249<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>
5250$gmframebottom
5251
5252</BODY>
5253</HTML>
5254
5255GMEDITHEADERFOOTERTEMPLATES
5256
5257$statusnote = "";
5258
5259exit;
5260
5261}
5262
5263# ----------------------------------
5264# edit template group: miscellaneous
5265# ----------------------------------
5266
5267sub gm_editmisctemplates {
5268
5269&gm_validate;
5270
5271if (($gmtemplateaccess eq "no") || ($gmtemplateaccess eq "hfsonly")) {
5272 &gm_writetocplog("$IN{'authorname'} attempted to edit the miscellaneous templates without authorization");
5273 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the miscellaneous templates.</FONT></B><P>);
5274 &gm_frontpage;
5275}
5276
5277&gm_readtemplates;
5278
5279&gm_delousealltemplates;
5280
5281if ($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>); }
5282
5283$autorebuildcheckbox = "";
5284
5285if ($gmrebuildaccess eq "yes") {
5286 if ($automaticrebuilddefault eq "yes") {
5287 $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>);
5288 } else {
5289 $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>);
5290 }
5291}
5292
5293&gm_readcounter;
5294if ($newentrynumber eq "0") { $autorebuildcheckbox = ""; }
5295
5296print<<GMEDITMISCTEMPLATES;
5297
5298$gmheadtag
5299
5300$gmframetop
5301$statusnote
5302<FORM ACTION="gm.cgi" METHOD=POST>
5303<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
5304<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
5305<INPUT TYPE=HIDDEN NAME="modifiedtemplategroup" VALUE="miscellaneous">
5306<INPUT TYPE=HIDDEN NAME="newindextemplate" VALUE="$gmindextemplate">
5307<INPUT TYPE=HIDDEN NAME="newentrypagetemplate" VALUE="$gmentrypagetemplate">
5308<INPUT TYPE=HIDDEN NAME="newarchiveindextemplate" VALUE="$gmarchiveindextemplate">
5309<INPUT TYPE=HIDDEN NAME="newarchiveentrypagetemplate" VALUE="$gmarchiveentrypagetemplate">
5310<INPUT TYPE=HIDDEN NAME="newentrytemplate" VALUE="$gmentrytemplate">
5311<INPUT TYPE=HIDDEN NAME="newarchiveentrytemplate" VALUE="$gmarchiveentrytemplate">
5312<INPUT TYPE=HIDDEN NAME="newstayattoptemplate" VALUE="$gmstayattoptemplate">
5313<INPUT TYPE=HIDDEN NAME="newdatetemplate" VALUE="$gmdatetemplate">
5314<INPUT TYPE=HIDDEN NAME="newcommentstemplate" VALUE="$gmcommentstemplate">
5315<INPUT TYPE=HIDDEN NAME="newcommentsformtemplate" VALUE="$gmcommentsformtemplate">
5316<INPUT TYPE=HIDDEN NAME="newkarmaformtemplate" VALUE="$gmkarmaformtemplate">
5317<INPUT TYPE=HIDDEN NAME="newlinktargettemplate" VALUE="$gmlinktargettemplate">
5318<INPUT TYPE=HIDDEN NAME="newdategroupingfootertemplate" VALUE="$gmdategroupingfootertemplate">
5319<INPUT TYPE=HIDDEN NAME="newkarmalinktemplate" VALUE="$gmkarmalinktemplate">
5320<INPUT TYPE=HIDDEN NAME="newcommentslinktemplate" VALUE="$gmcommentslinktemplate">
5321<INPUT TYPE=HIDDEN NAME="newcommentauthoremailtemplate" VALUE="$gmcommentauthoremailtemplate">
5322<INPUT TYPE=HIDDEN NAME="newcommentauthorhomepagetemplate" VALUE="$gmcommentauthorhomepagetemplate">
5323<INPUT TYPE=HIDDEN NAME="newcommentdividertemplate" VALUE="$gmcommentdividertemplate">
5324<INPUT TYPE=HIDDEN NAME="newmoreentrytemplate" VALUE="$gmmoreentrytemplate">
5325<INPUT TYPE=HIDDEN NAME="newmoreentrypagetemplate" VALUE="$gmmoreentrypagetemplate">
5326<INPUT TYPE=HIDDEN NAME="newmorearchiveentrypagetemplate" VALUE="$gmmorearchiveentrypagetemplate">
5327<INPUT TYPE=HIDDEN NAME="newarchivemasterindextemplate" VALUE="$gmarchivemasterindextemplate">
5328<INPUT TYPE=HIDDEN NAME="newheadertemplate" VALUE="$gmheadertemplate">
5329<INPUT TYPE=HIDDEN NAME="newfootertemplate" VALUE="$gmfootertemplate">
5330<INPUT TYPE=HIDDEN NAME="newsidebartemplate" VALUE="$gmsidebartemplate">
5331<INPUT TYPE=HIDDEN NAME="newentryseparatortemplate" VALUE="$gmentryseparatortemplate">
5332<INPUT TYPE=HIDDEN NAME="newarchiveentryseparatortemplate" VALUE="$gmarchiveentryseparatortemplate">
5333<INPUT TYPE=HIDDEN NAME="newmorearchiveentrytemplate" VALUE="$gmmorearchiveentrytemplate">
5334<INPUT TYPE=HIDDEN NAME="newdatearchivetemplate" VALUE="$gmdatearchivetemplate">
5335<INPUT TYPE=HIDDEN NAME="newcustomonetemplate" VALUE="$gmcustomonetemplate">
5336<INPUT TYPE=HIDDEN NAME="newcustomtwotemplate" VALUE="$gmcustomtwotemplate">
5337<INPUT TYPE=HIDDEN NAME="newcustomthreetemplate" VALUE="$gmcustomthreetemplate">
5338<INPUT TYPE=HIDDEN NAME="newcustomfourtemplate" VALUE="$gmcustomfourtemplate">
5339<INPUT TYPE=HIDDEN NAME="newcustomfivetemplate" VALUE="$gmcustomfivetemplate">
5340<INPUT TYPE=HIDDEN NAME="newcustomsixtemplate" VALUE="$gmcustomsixtemplate">
5341<INPUT TYPE=HIDDEN NAME="newcustomseventemplate" VALUE="$gmcustomseventemplate">
5342<INPUT TYPE=HIDDEN NAME="newcustomeighttemplate" VALUE="$gmcustomeighttemplate">
5343<INPUT TYPE=HIDDEN NAME="newcustomninetemplate" VALUE="$gmcustomninetemplate">
5344<INPUT TYPE=HIDDEN NAME="newcustomtentemplate" VALUE="$gmcustomtentemplate">
5345<INPUT TYPE=HIDDEN NAME="newcommentpreviewdividertemplate" VALUE="$gmcommentpreviewdividertemplate">
5346<INPUT TYPE=HIDDEN NAME="newcommentpreviewformtemplate" VALUE="$gmcommentpreviewformtemplate">
5347<INPUT TYPE=HIDDEN NAME="newsmartlinknocommentstemplate" VALUE="$gmsmartlinknocommentstemplate">
5348<INPUT TYPE=HIDDEN NAME="newsmartlinkonecommenttemplate" VALUE="$gmsmartlinkonecommenttemplate">
5349<INPUT TYPE=HIDDEN NAME="newsmartlinkmanycommentstemplate" VALUE="$gmsmartlinkmanycommentstemplate">
5350<INPUT TYPE=HIDDEN NAME="newdategroupingfooterarchivetemplate" VALUE="$gmdategroupingfooterarchivetemplate">
5351<INPUT TYPE=HIDDEN NAME="newcookiescodetemplate" VALUE="$gmcookiescodetemplate">
5352<INPUT TYPE=HIDDEN NAME="newsmartemoticonscodetemplate" VALUE="$gmsmartemoticonscodetemplate">
5353
5354<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=720>
5355
5356<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><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=1 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=1 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=1 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=1 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>
5357
5358<TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR>
5359
5360<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><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 <a href="http://www.greymatterforums.com/info/manual.html" title="read the manual" target="_blank">manual</a> for more information) are used for automatically generating lists of links—whether on your archive master index, or anywhere else—to your log archives and your individual entry pages; these templates set the formatting of those links. The first two templates apply to the {{logentrylist}} variable and its variants, formatting the links to standard and extended entries respectively; the Log Archive Links Templates apply to the {{logarchivelist}} variable, which generates links to the monthly/weekly log archive files (whichever of the two is used depends on whether you have weekly or monthly archiving enabled).</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 cellpadding=1 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=1 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=1 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=1 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>
5361
5362<TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR>
5363
5364<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><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=1 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=1 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>
5365
5366<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=33%><TABLE BORDER=0 cellpadding=1 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>Entry List:<BR>Day Separator</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=34%><TABLE BORDER=0 cellpadding=1 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>Entry List:<BR>Month Separator</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=33%><TABLE BORDER=0 cellpadding=1 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>Entry List:<BR>Year Separator</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newentrypagelinkdayseparatortemplate" COLS=26 ROWS=5 WRAP=VIRTUAL STYLE="width: 233">$gmentrypagelinkdayseparatortemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newentrypagelinkmonthseparatortemplate" COLS=26 ROWS=5 WRAP=VIRTUAL STYLE="width: 233">$gmentrypagelinkmonthseparatortemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newentrypagelinkyearseparatortemplate" COLS=26 ROWS=5 WRAP=VIRTUAL STYLE="width: 233">$gmentrypagelinkyearseparatortemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR></TABLE></TD></TR>
5367
5368<TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR>
5369
5370<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><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=1 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=1 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=1 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>
5371
5372<TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR>
5373
5374<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><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=1 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=1 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>
5375
5376<TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=33%><TABLE BORDER=0 cellpadding=1 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>{{calendar}}:<BR>Blank cell</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=34%><TABLE BORDER=0 cellpadding=1 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>{{calendar}}:<BR>Day cell without link</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=33%><TABLE BORDER=0 cellpadding=1 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>{{calendar}}:<BR>Day cell with link</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcalendarblankcelltemplate" COLS=26 ROWS=5 WRAP=VIRTUAL STYLE="width: 233">$gmcalendarblankcelltemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcalendarfullcelltemplate" COLS=26 ROWS=5 WRAP=VIRTUAL STYLE="width: 233">$gmcalendarfullcelltemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcalendarfullcelllinktemplate" COLS=26 ROWS=5 WRAP=VIRTUAL STYLE="width: 233">$gmcalendarfullcelllinktemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR></TABLE></TD></TR>
5377
5378<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=1 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>{{calendarweek}}: Day without link</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 cellpadding=1 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>{{calendarweek}}: Day with link</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcalendarweekfulldaytemplate" COLS=41 ROWS=5 WRAP=VIRTUAL STYLE="width: 355">$gmcalendarweekfulldaytemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcalendarweekfulldaylinktemplate" COLS=41 ROWS=5 WRAP=VIRTUAL STYLE="width: 355">$gmcalendarweekfulldaylinktemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR></TABLE></TD></TR>
5379
5380<TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR>
5381
5382<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><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=1 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=1 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>
5383
5384<TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR>
5385
5386<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><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=1 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=1 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>
5387
5388<TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR>
5389
5390<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>{{smartentrymood}} and {{smartentrymusic}} templates</B><BR><FONT SIZE=1>These templates allow you to define your own labels for the entry mood and entry music fields. If you leave music or mood field blank for an entry, this label will not be displayed.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 cellpadding=1 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>{{smartentrymood}} Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 cellpadding=1 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>{{smartentrymusic}} Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newsmartentrymoodtemplate" COLS=41 ROWS=3 WRAP=VIRTUAL STYLE="width: 355">$gmsmartentrymoodtemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newsmartentrymusictemplate" COLS=41 ROWS=3 WRAP=VIRTUAL STYLE="width: 355">$gmsmartentrymusictemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR></TABLE></TD></TR>
5391
5392<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=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#C0C0C0"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B>{{authorsmartlink}} target and {{commentauthorsmartlink}} target</B><BR><FONT SIZE=1>if you'd like commenter's homepages to open in a new window, you can set a target="_blank" in these templates, or you can use these to target those links into one of your other named frames.</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 cellpadding=1 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>Author Smartlink Target Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%><TABLE BORDER=0 cellpadding=1 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>Comment Smartlink Target Template</B></FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newlinktargettemplate" COLS=41 ROWS=3 WRAP=VIRTUAL STYLE="width: 355">$gmlinktargettemplate</TEXTAREA>$gmfonttag</FONT></TD><TD VALIGN=TOP ALIGN=CENTER></FONT><TEXTAREA NAME="newcommentlinktargettemplate" COLS=41 ROWS=3 WRAP=VIRTUAL STYLE="width: 355">$gmcommentlinktargettemplate</TEXTAREA>$gmfonttag</FONT></FONT></TD></TR></TABLE></TD></TR>
5393
5394</TABLE>
5395$autorebuildcheckbox
5396<P>
5397<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">
5398<P>
5399<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Templates Menu">
5400<P>
5401<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0">
5402</FORM>
5403<P>
5404<FONT SIZE=1>"God does not play dice with the universe."—Albert Einstein</FONT>
5405$gmframebottom
5406
5407</BODY>
5408</HTML>
5409
5410GMEDITMISCTEMPLATES
5411
5412$statusnote = "";
5413
5414exit;
5415
5416}
5417
5418# -------------------------
5419# save the template changes
5420# -------------------------
5421
5422sub gm_savetemplatechanges {
5423
5424&gm_validate;
5425
5426if ($gmtemplateaccess eq "no") {
5427 &gm_writetocplog("$IN{'authorname'} attempted to edit the templates without authorization");
5428 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the templates.</FONT></B><P>);
5429 &gm_frontpage;
5430}
5431
5432$IN{'newindextemplate'} = &relouse($IN{'newindextemplate'});
5433$IN{'newentrypagetemplate'} = &relouse($IN{'newentrypagetemplate'});
5434$IN{'newarchiveindextemplate'} = &relouse($IN{'newarchiveindextemplate'});
5435$IN{'newarchiveentrypagetemplate'} = &relouse($IN{'newarchiveentrypagetemplate'});
5436$IN{'newentrytemplate'} = &relouse($IN{'newentrytemplate'});
5437$IN{'newarchiveentrytemplate'} = &relouse($IN{'newarchiveentrytemplate'});
5438$IN{'newstayattoptemplate'} = &relouse($IN{'newstayattoptemplate'});
5439$IN{'newdatetemplate'} = &relouse($IN{'newdatetemplate'});
5440$IN{'newcommentstemplate'} = &relouse($IN{'newcommentstemplate'});
5441$IN{'newcommentsformtemplate'} = &relouse($IN{'newcommentsformtemplate'});
5442$IN{'newparaseparationtemplate'} = &relouse($IN{'newparaseparationtemplate'});
5443$IN{'newkarmaformtemplate'} = &relouse($IN{'newkarmaformtemplate'});
5444# new templates {{target}} and dategrouping footer take the place of the long-deprecated ones: linear 9/18/2003
5445# new in 1.3
5446$IN{'newlinktargettemplate'} = &relouse($IN{'newlinktargettemplate'});
5447$IN{'newdategroupingfootertemplate'} = &relouse($IN{'newdategroupingfootertemplate'});
5448# merged 9/18/2003
5449$IN{'newkarmalinktemplate'} = &relouse($IN{'newkarmalinktemplate'});
5450$IN{'newcommentslinktemplate'} = &relouse($IN{'newcommentslinktemplate'});
5451$IN{'newcommentauthoremailtemplate'} = &relouse($IN{'newcommentauthoremailtemplate'});
5452$IN{'newcommentauthorhomepagetemplate'} = &relouse($IN{'newcommentauthorhomepagetemplate'});
5453$IN{'newcommentdividertemplate'} = &relouse($IN{'newcommentdividertemplate'});
5454$IN{'newmoreentrytemplate'} = &relouse($IN{'newmoreentrytemplate'});
5455$IN{'newmoreentrypagetemplate'} = &relouse($IN{'newmoreentrypagetemplate'});
5456$IN{'newmorearchiveentrypagetemplate'} = &relouse($IN{'newmorearchiveentrypagetemplate'});
5457$IN{'newpreviouslinktemplate'} = &relouse($IN{'newpreviouslinktemplate'});
5458$IN{'newnextlinktemplate'} = &relouse($IN{'newnextlinktemplate'});
5459$IN{'newpreviousmorelinktemplate'} = &relouse($IN{'newpreviousmorelinktemplate'});
5460$IN{'newnextmorelinktemplate'} = &relouse($IN{'newnextmorelinktemplate'});
5461$IN{'newarchivemasterindextemplate'} = &relouse($IN{'newarchivemasterindextemplate'});
5462$IN{'newlogarchiveslinktemplate'} = &relouse($IN{'newlogarchiveslinktemplate'});
5463$IN{'newentrypagelinktemplate'} = &relouse($IN{'newentrypagelinktemplate'});
5464$IN{'newmoreentrypagelinktemplate'} = &relouse($IN{'newmoreentrypagelinktemplate'});
5465$IN{'newlogarchiveslinkseparatortemplate'} = &relouse($IN{'newlogarchiveslinkseparatortemplate'});
5466$IN{'newentrypagelinkseparatortemplate'} = &relouse($IN{'newentrypagelinkseparatortemplate'});
5467$IN{'newentrypagelinkmonthseparatortemplate'} = &relouse($IN{'newentrypagelinkmonthseparatortemplate'});
5468$IN{'newentrypagelinkdayseparatortemplate'} = &relouse($IN{'newentrypagelinkdayseparatortemplate'});
5469$IN{'newentrypagelinkyearseparatortemplate'} = &relouse($IN{'newentrypagelinkyearseparatortemplate'});
5470$IN{'newheadertemplate'} = &relouse($IN{'newheadertemplate'});
5471$IN{'newfootertemplate'} = &relouse($IN{'newfootertemplate'});
5472$IN{'newsidebartemplate'} = &relouse($IN{'newsidebartemplate'});
5473$IN{'newcustomlinktemplate'} = "";
5474$IN{'newentryseparatortemplate'} = &relouse($IN{'newentryseparatortemplate'});
5475$IN{'newarchiveentryseparatortemplate'} = &relouse($IN{'newarchiveentryseparatortemplate'});
5476$IN{'newmorearchiveentrytemplate'} = &relouse($IN{'newmorearchiveentrytemplate'});
5477$IN{'newdatearchivetemplate'} = &relouse($IN{'newdatearchivetemplate'});
5478
5479$IN{'newlogarchiveslinkweeklytemplate'} = &relouse($IN{'newlogarchiveslinkweeklytemplate'});
5480$IN{'newcustomonetemplate'} = &relouse($IN{'newcustomonetemplate'});
5481$IN{'newcustomtwotemplate'} = &relouse($IN{'newcustomtwotemplate'});
5482$IN{'newcustomthreetemplate'} = &relouse($IN{'newcustomthreetemplate'});
5483$IN{'newcustomfourtemplate'} = &relouse($IN{'newcustomfourtemplate'});
5484$IN{'newcustomfivetemplate'} = &relouse($IN{'newcustomfivetemplate'});
5485$IN{'newcustomsixtemplate'} = &relouse($IN{'newcustomsixtemplate'});
5486$IN{'newcustomseventemplate'} = &relouse($IN{'newcustomseventemplate'});
5487$IN{'newcustomeighttemplate'} = &relouse($IN{'newcustomeighttemplate'});
5488$IN{'newcustomninetemplate'} = &relouse($IN{'newcustomninetemplate'});
5489$IN{'newcustomtentemplate'} = &relouse($IN{'newcustomtentemplate'});
5490$IN{'newpopuppagetemplate'} = &relouse($IN{'newpopuppagetemplate'});
5491$IN{'newpopupcodetemplate'} = &relouse($IN{'newpopupcodetemplate'});
5492$IN{'newsearchformtemplate'} = &relouse($IN{'newsearchformtemplate'});
5493$IN{'newsearchresultspagetemplate'} = &relouse($IN{'newsearchresultspagetemplate'});
5494$IN{'newsearchresultsentrytemplate'} = &relouse($IN{'newsearchresultsentrytemplate'});
5495$IN{'newcalendartablebeginningtemplate'} = &relouse($IN{'newcalendartablebeginningtemplate'});
5496$IN{'newcalendartableendingtemplate'} = &relouse($IN{'newcalendartableendingtemplate'});
5497$IN{'newcalendarblankcelltemplate'} = &relouse($IN{'newcalendarblankcelltemplate'});
5498$IN{'newcalendarfullcelltemplate'} = &relouse($IN{'newcalendarfullcelltemplate'});
5499$IN{'newcalendarfullcelllinktemplate'} = &relouse($IN{'newcalendarfullcelllinktemplate'});
5500$IN{'newcalendarweekblankdaytemplate'} = "";
5501$IN{'newcalendarweekfulldaytemplate'} = &relouse($IN{'newcalendarweekfulldaytemplate'});
5502$IN{'newcalendarweekfulldaylinktemplate'} = &relouse($IN{'newcalendarweekfulldaylinktemplate'});
5503$IN{'newcommentpreviewdividertemplate'} = &relouse($IN{'newcommentpreviewdividertemplate'});
5504$IN{'newcommentpreviewformtemplate'} = &relouse($IN{'newcommentpreviewformtemplate'});
5505$IN{'newsmartlinknocommentstemplate'} = &relouse($IN{'newsmartlinknocommentstemplate'});
5506$IN{'newsmartlinkonecommenttemplate'} = &relouse($IN{'newsmartlinkonecommenttemplate'});
5507$IN{'newsmartlinkmanycommentstemplate'} = &relouse($IN{'newsmartlinkmanycommentstemplate'});
5508$IN{'newlinebreaktemplate'} = &relouse($IN{'newlinebreaktemplate'});
5509$IN{'newcommentlinktargettemplate'} = &relouse($IN{'newcommentlinktargettemplate'});
5510$IN{'newsmartentrymoodtemplate'} = &relouse($IN{'newsmartentrymoodtemplate'});
5511$IN{'newsmartentrymusictemplate'} = &relouse($IN{'newsmartentrymusictemplate'});
5512$IN{'newdategroupingfooterarchivetemplate'} = &relouse($IN{'newdategroupingfooterarchivetemplate'});
5513$IN{'newcookiescodetemplate'} = &relouse($IN{'newcookiescodetemplate'});
5514$IN{'newsmartemoticonscodetemplate'} = &relouse($IN{'newsmartemoticonscodetemplate'});
5515
5516if (($IN{'newcustomlinktemplate'} ne "") && ((substr($IN{'newcustomlinktemplate'}, 0, 1)) ne " ")) {
5517 $IN{'newcustomlinktemplate'} = " $IN{'newcustomlinktemplate'}";
5518}
5519
5520if ($IN{'entrylistingmorecheck'} eq "yes") { $IN{'newmoreentrytemplate'} = $IN{'newentrytemplate'}; }
5521if ($IN{'entrylistingstayattopcheck'} eq "yes") { $IN{'newstayattoptemplate'} = $IN{'newentrytemplate'}; }
5522if ($IN{'archivelogindexcheck'} eq "yes") { $IN{'newarchiveindextemplate'} = $IN{'newindextemplate'}; }
5523if ($IN{'archiveentrylistingcheck'} eq "yes") { $IN{'newarchiveentrytemplate'} = $IN{'newentrytemplate'}; }
5524if ($IN{'archiveentrylistingmorecheck'} eq "yes") { $IN{'newmorearchiveentrytemplate'} = $IN{'newmoreentrytemplate'}; }
5525if ($IN{'archivedateheadercheck'} eq "yes") { $IN{'newdatearchivetemplate'} = $IN{'newdatetemplate'}; }
5526if ($IN{'archivedatefootercheck'} eq "yes") { $IN{'newdategroupingfooterarchivetemplate'} = $IN{'newdategroupingfootertemplate'}; }
5527if ($IN{'archiveentryseparatorcheck'} eq "yes") { $IN{'newarchiveentryseparatortemplate'} = $IN{'newentryseparatortemplate'}; }
5528if ($IN{'entrymorepagecheck'} eq "yes") { $IN{'newmoreentrypagetemplate'} = $IN{'newentrypagetemplate'}; }
5529if ($IN{'entryarchivepagecheck'} eq "yes") { $IN{'newarchiveentrypagetemplate'} = $IN{'newentrypagetemplate'}; }
5530if ($IN{'entrymorearchivepagecheck'} eq "yes") { $IN{'newmorearchiveentrypagetemplate'} = $IN{'newarchiveentrypagetemplate'}; }
5531if ($IN{'previousmorelinkcheck'} eq "yes") { $IN{'newpreviousmorelinktemplate'} = $IN{'newpreviouslinktemplate'}; }
5532if ($IN{'nextmorelinkcheck'} eq "yes") { $IN{'newnextmorelinktemplate'} = $IN{'newnextlinktemplate'}; }
5533if ($IN{'moreentrylistlinkcheck'} eq "yes") { $IN{'newmoreentrypagelinktemplate'} = $IN{'newentrypagelinktemplate'}; }
5534
5535open (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.");
5536print FUNNYFEETRELEASE "$IN{'newindextemplate'}\n";
5537print FUNNYFEETRELEASE "$IN{'newentrypagetemplate'}\n";
5538print FUNNYFEETRELEASE "$IN{'newarchiveindextemplate'}\n";
5539print FUNNYFEETRELEASE "$IN{'newarchiveentrypagetemplate'}\n";
5540print FUNNYFEETRELEASE "$IN{'newentrytemplate'}\n";
5541print FUNNYFEETRELEASE "$IN{'newarchiveentrytemplate'}\n";
5542print FUNNYFEETRELEASE "$IN{'newstayattoptemplate'}\n";
5543print FUNNYFEETRELEASE "$IN{'newdatetemplate'}\n";
5544print FUNNYFEETRELEASE "$IN{'newcommentstemplate'}\n";
5545print FUNNYFEETRELEASE "$IN{'newcommentsformtemplate'}\n";
5546print FUNNYFEETRELEASE "$IN{'newparaseparationtemplate'}\n";
5547print FUNNYFEETRELEASE "$IN{'newkarmaformtemplate'}\n";
5548# new templates {{target}} and dategrouping footer take the place of the long-deprecated ones: linear 9/18/2003
5549# new in 1.3
5550print FUNNYFEETRELEASE "$IN{'newlinktargettemplate'}\n";
5551print FUNNYFEETRELEASE "$IN{'newdategroupingfootertemplate'}\n";
5552# merged 9/18/2003
5553print FUNNYFEETRELEASE "$IN{'newkarmalinktemplate'}\n";
5554print FUNNYFEETRELEASE "$IN{'newcommentslinktemplate'}\n";
5555print FUNNYFEETRELEASE "$IN{'newcommentauthoremailtemplate'}\n";
5556print FUNNYFEETRELEASE "$IN{'newcommentauthorhomepagetemplate'}\n";
5557print FUNNYFEETRELEASE "$IN{'newcommentdividertemplate'}\n";
5558print FUNNYFEETRELEASE "$IN{'newmoreentrytemplate'}\n";
5559print FUNNYFEETRELEASE "$IN{'newmoreentrypagetemplate'}\n";
5560print FUNNYFEETRELEASE "$IN{'newmorearchiveentrypagetemplate'}\n";
5561print FUNNYFEETRELEASE "$IN{'newpreviouslinktemplate'}\n";
5562print FUNNYFEETRELEASE "$IN{'newnextlinktemplate'}\n";
5563print FUNNYFEETRELEASE "$IN{'newpreviousmorelinktemplate'}\n";
5564print FUNNYFEETRELEASE "$IN{'newnextmorelinktemplate'}\n";
5565print FUNNYFEETRELEASE "$IN{'newarchivemasterindextemplate'}\n";
5566print FUNNYFEETRELEASE "$IN{'newlogarchiveslinktemplate'}\n";
5567print FUNNYFEETRELEASE "$IN{'newentrypagelinktemplate'}\n";
5568print FUNNYFEETRELEASE "$IN{'newmoreentrypagelinktemplate'}\n";
5569print FUNNYFEETRELEASE "$IN{'newlogarchiveslinkseparatortemplate'}\n";
5570print FUNNYFEETRELEASE "$IN{'newentrypagelinkseparatortemplate'}\n";
5571print FUNNYFEETRELEASE "$IN{'newentrypagelinkmonthseparatortemplate'}\n";
5572print FUNNYFEETRELEASE "$IN{'newentrypagelinkdayseparatortemplate'}\n";
5573print FUNNYFEETRELEASE "$IN{'newentrypagelinkyearseparatortemplate'}\n";
5574print FUNNYFEETRELEASE "$IN{'newheadertemplate'}\n";
5575print FUNNYFEETRELEASE "$IN{'newfootertemplate'}\n";
5576print FUNNYFEETRELEASE "$IN{'newsidebartemplate'}\n";
5577print FUNNYFEETRELEASE "$IN{'newcustomlinktemplate'}\n";
5578print FUNNYFEETRELEASE "$IN{'newentryseparatortemplate'}\n";
5579print FUNNYFEETRELEASE "$IN{'newarchiveentryseparatortemplate'}\n";
5580print FUNNYFEETRELEASE "$IN{'newmorearchiveentrytemplate'}\n";
5581print FUNNYFEETRELEASE "$IN{'newdatearchivetemplate'}\n";
5582print FUNNYFEETRELEASE "$IN{'newlogarchiveslinkweeklytemplate'}\n";
5583print FUNNYFEETRELEASE "$IN{'newcustomonetemplate'}\n";
5584print FUNNYFEETRELEASE "$IN{'newcustomtwotemplate'}\n";
5585print FUNNYFEETRELEASE "$IN{'newcustomthreetemplate'}\n";
5586print FUNNYFEETRELEASE "$IN{'newcustomfourtemplate'}\n";
5587print FUNNYFEETRELEASE "$IN{'newcustomfivetemplate'}\n";
5588print FUNNYFEETRELEASE "$IN{'newcustomsixtemplate'}\n";
5589print FUNNYFEETRELEASE "$IN{'newcustomseventemplate'}\n";
5590print FUNNYFEETRELEASE "$IN{'newcustomeighttemplate'}\n";
5591print FUNNYFEETRELEASE "$IN{'newcustomninetemplate'}\n";
5592print FUNNYFEETRELEASE "$IN{'newcustomtentemplate'}\n";
5593print FUNNYFEETRELEASE "$IN{'newpopuppagetemplate'}\n";
5594print FUNNYFEETRELEASE "$IN{'newpopupcodetemplate'}\n";
5595print FUNNYFEETRELEASE "$IN{'newsearchformtemplate'}\n";
5596print FUNNYFEETRELEASE "$IN{'newsearchresultspagetemplate'}\n";
5597print FUNNYFEETRELEASE "$IN{'newsearchresultsentrytemplate'}\n";
5598print FUNNYFEETRELEASE "$IN{'newcalendartablebeginningtemplate'}\n";
5599print FUNNYFEETRELEASE "$IN{'newcalendartableendingtemplate'}\n";
5600print FUNNYFEETRELEASE "$IN{'newcalendarblankcelltemplate'}\n";
5601print FUNNYFEETRELEASE "$IN{'newcalendarfullcelltemplate'}\n";
5602print FUNNYFEETRELEASE "$IN{'newcalendarfullcelllinktemplate'}\n";
5603print FUNNYFEETRELEASE "$IN{'newcalendarweekblankdaytemplate'}\n";
5604print FUNNYFEETRELEASE "$IN{'newcalendarweekfulldaytemplate'}\n";
5605print FUNNYFEETRELEASE "$IN{'newcalendarweekfulldaylinktemplate'}\n";
5606print FUNNYFEETRELEASE "$IN{'newcommentpreviewdividertemplate'}\n";
5607print FUNNYFEETRELEASE "$IN{'newcommentpreviewformtemplate'}\n";
5608print FUNNYFEETRELEASE "$IN{'newsmartlinknocommentstemplate'}\n";
5609print FUNNYFEETRELEASE "$IN{'newsmartlinkonecommenttemplate'}\n";
5610print FUNNYFEETRELEASE "$IN{'newsmartlinkmanycommentstemplate'}\n";
5611print FUNNYFEETRELEASE "$IN{'newlinebreaktemplate'}\n";
5612print FUNNYFEETRELEASE "$IN{'newcommentlinktargettemplate'}\n";
5613print FUNNYFEETRELEASE "$IN{'newsmartentrymoodtemplate'}\n";
5614print FUNNYFEETRELEASE "$IN{'newsmartentrymusictemplate'}\n";
5615print FUNNYFEETRELEASE "$IN{'newdategroupingfooterarchivetemplate'}\n";
5616print FUNNYFEETRELEASE "$IN{'newsmartemoticonscodetemplate'}\n";
5617print FUNNYFEETRELEASE "$IN{'newcookiescodetemplate'}\n";
5618close (FUNNYFEETRELEASE);
5619
5620$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>);
5621
5622&gm_writetocplog("$IN{'authorname'} modified the $IN{'modifiedtemplategroup'} templates");
5623
5624if ($IN{'autorebuild'} eq "index") { &gm_rebuildmainindexfile; }
5625if ($IN{'autorebuild'} eq "archiveindexes") { &gm_rebuildarchivelogindexes; }
5626if ($IN{'autorebuild'} eq "entrypages") { &gm_rebuildallentrypages; }
5627if ($IN{'autorebuild'} eq "everything") { &gm_rebuildeverything; }
5628
5629&gm_edittemplates;
5630
5631}
5632
5633# ---------------------------
5634# view the greymatter logfile
5635# ---------------------------
5636
5637sub gm_viewcplog {
5638
5639&gm_validate;
5640
5641if ($gmcplogaccess ne "yes") {
5642 &gm_writetocplog("$IN{'authorname'} attempted to view the control panel log without authorization");
5643 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to view the control panel log.</FONT></B><P>);
5644 &gm_frontpage;
5645}
5646
5647if ($statusnote eq "") { $statusnote = qq(<B><FONT COLOR="#000000">Control Panel Log</FONT></B><P>); }
5648
5649print<<GMVIEWLOGTOP;
5650
5651$gmheadtag
5652
5653$gmframetop
5654$statusnote
5655<P ALIGN=LEFT>
5656GMVIEWLOGTOP
5657
5658open (FUNNYFEET, "gm-cplog.cgi");
5659@gmlogfile = <FUNNYFEET>;
5660close (FUNNYFEET);
5661
5662foreach $gmlogfileline (@gmlogfile) {
5663 chomp ($gmlogfileline);
5664 print "$gmlogfileline<BR>";
5665}
5666
5667&date;
5668&gm_readcounter;
5669
5670if ($newentrynumber ne "0") {
5671 $newalltimetotalkarmanumber = $newalltimepktotalnumber - $newalltimenktotalnumber;
5672 $newalltimetotalkarmavotes = $newalltimepktotalnumber + $newalltimenktotalnumber;
5673 $entriesonmainnumber = $newentrynumber - $newarchivenumber;
5674 $karmavotesonaverage = sprintf("%.1f", ($newalltimetotalkarmavotes / $newentrynumber));
5675 $commentspostedonaverage = sprintf("%.1f", ($newalltimecommentstotalnumber / $newentrynumber));
5676} else {
5677 $newalltimetotalkarmanumber = 0;
5678 $newalltimetotalkarmavotes = 0;
5679 $entriesonmainnumber = 0;
5680 $karmavotesonaverage = 0;
5681 $commentspostedonaverage = 0;
5682}
5683
5684print<<GMVIEWLOGBOTTOM;
5685</P>
5686<TABLE BORDER=0 cellpadding=1 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>
5687<FORM ACTION="gm.cgi" METHOD=POST>
5688<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
5689<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
5690<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #FFD0D0" VALUE="Reset The Control Panel Log">
5691<P>
5692<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0">
5693</FORM>
5694<P>
5695<FONT SIZE=1>"When stepping into the stream of consciousness, don't slip on the rocks."<BR>—Siddharta Gautama (the Buddha)</FONT>
5696$gmframebottom
5697GMVIEWLOGBOTTOM
5698
5699exit;
5700
5701}
5702
5703# ----------------------------
5704# clear the greymatter logfile
5705# ----------------------------
5706
5707sub gm_resetcplog {
5708
5709&gm_validate;
5710
5711if ($gmcplogaccess ne "yes") {
5712 &gm_writetocplog("$IN{'authorname'} attempted to clear the control panel log without authorization");
5713 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to clear the control panel log.</FONT></B><P>);
5714 &gm_frontpage;
5715}
5716
5717open (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.");
5718print FUNNYFEET "";
5719close (FUNNYFEET);
5720
5721&gm_writetocplog("$IN{'authorname'} cleared this control panel log");
5722
5723$statusnote = qq(<B><FONT COLOR="#0000FF">The control panel log has been cleared.</FONT></B><P>);
5724
5725&gm_frontpage;
5726
5727}
5728
5729# --------------
5730# authors editor
5731# --------------
5732
5733sub gm_editauthors {
5734
5735&gm_validate;
5736
5737if ($gmauthoraccess ne "yes") {
5738 &gm_writetocplog("$IN{'authorname'} attempted to edit the authors without authorization");
5739 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the authors.</FONT></B><P>);
5740 &gm_frontpage;
5741}
5742
5743if ($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>); }
5744
5745open (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.");
5746@gmauthordata = <FUNNYFEET>;
5747close (FUNNYFEET);
5748
5749print<<GMEDITAUTHORBEGINNING;
5750
5751$gmheadtag
5752
5753$gmframetop
5754$statusnote
5755<FORM ACTION="gm.cgi" METHOD=POST>
5756<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
5757<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
5758<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 WIDTH=100% BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%>
5759<TR><TD VALIGN=BOTTOM ALIGN=CENTER BGCOLOR="#B0B0D0">$gmfonttag <FONT SIZE=1><B>Select</B></FONT></FONT></TD><TD VALIGN=BOTTOM ALIGN=CENTER BGCOLOR="#B0B0D0">$gmfonttag<FONT SIZE=1><B>Author<BR>Name</B></FONT></FONT></TD><TD VALIGN=BOTTOM ALIGN=CENTER BGCOLOR="#B0B0D0">$gmfonttag<FONT SIZE=1><B>Can<BR>post?</B></FONT></FONT></TD><TD VALIGN=BOTTOM ALIGN=CENTER BGCOLOR="#B0B0D0">$gmfonttag<FONT SIZE=1><B>Can<BR>edit?</B></FONT></FONT></TD><TD VALIGN=BOTTOM ALIGN=CENTER BGCOLOR="#B0B0D0">$gmfonttag<FONT SIZE=1><B>Can<BR>config?</B></FONT></FONT></TD><TD VALIGN=BOTTOM ALIGN=CENTER BGCOLOR="#B0B0D0">$gmfonttag<FONT SIZE=1><B>Edit<BR>temp's?</B></FONT></FONT></TD><TD VALIGN=BOTTOM ALIGN=CENTER BGCOLOR="#B0B0D0">$gmfonttag<FONT SIZE=1><B>Edit<BR>auth's?</B></FONT></FONT></TD><TD VALIGN=BOTTOM ALIGN=CENTER BGCOLOR="#B0B0D0">$gmfonttag<FONT SIZE=1><B>Can<BR>reb'ld?</B></FONT></FONT></TD><TD VALIGN=BOTTOM ALIGN=CENTER BGCOLOR="#B0B0D0">$gmfonttag<FONT SIZE=1><B>View<BR>CP log?</B></FONT></FONT></TD><TD VALIGN=BOTTOM ALIGN=CENTER BGCOLOR="#B0B0D0">$gmfonttag<FONT SIZE=1><B>Use<BR>b'lets?</B></FONT></FONT></TD><TD VALIGN=BOTTOM ALIGN=CENTER BGCOLOR="#B0B0D0">$gmfonttag<FONT SIZE=1><B>Upload<BR>files?</B></FONT></FONT></TD><TD VALIGN=BOTTOM ALIGN=CENTER BGCOLOR="#B0B0D0">$gmfonttag<FONT SIZE=1><B>Can<BR>login?</B></FONT></FONT></TD></TR>
5760
5761GMEDITAUTHORBEGINNING
5762
5763$alicewarning = "";
5764$alternateauthorrowone = "#EEF8FF";
5765$alternateauthorrowtwo = "#F8F8FF";
5766$alternateauthorrow = $alternateauthorrowone;
5767
5768foreach $gmauthordataline (@gmauthordata) {
5769 if ($alternateauthorrow eq $alternateauthorrowone) {
5770 $alternateauthorrow = $alternateauthorrowtwo;
5771 } else {
5772 $alternateauthorrow = $alternateauthorrowone;
5773 }
5774 chomp ($gmauthordataline);
5775 @gmauthorinfo = split (/\|/, $gmauthordataline);
5776 if (($gmauthorinfo[0] eq "Alice") && ($gmauthorinfo[1] eq "wonderland")) {
5777 $alicewarning = "<P><B>Be sure to create your own author and delete Alice!</B>"
5778 }
5779 print qq(<TR><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP><INPUT TYPE=RADIO NAME="selectedauthor" VALUE="$gmauthorinfo[0]"></TD><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag$gmauthorinfo[0]</FONT></TD>);
5780 if ($gmauthorinfo[6] eq "Y") {
5781 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag Yes</FONT></TD>);
5782 } else {
5783 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag No</FONT></TD>);
5784 }
5785 if ($gmauthorinfo[7] eq "Y") {
5786 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag Yes</FONT></TD>);
5787 } elsif ($gmauthorinfo[7] eq "O") {
5788 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag Own</FONT></TD>);
5789 } else {
5790 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag No</FONT></TD>);
5791 }
5792 if ($gmauthorinfo[8] eq "Y") {
5793 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag Yes</FONT></TD>);
5794 } else {
5795 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag No</FONT></TD>);
5796 }
5797 if ($gmauthorinfo[9] eq "Y") {
5798 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag Yes</FONT></TD>);
5799 } elsif ($gmauthorinfo[9] eq "O") {
5800 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag HFS</FONT></TD>);
5801 } else {
5802 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag No</FONT></TD>);
5803 }
5804 if ($gmauthorinfo[10] eq "Y") {
5805 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag Yes</FONT></TD>);
5806 } else {
5807 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag No</FONT></TD>);
5808 }
5809 if ($gmauthorinfo[11] eq "Y") {
5810 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag Yes</FONT></TD>);
5811 } else {
5812 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag No</FONT></TD>);
5813 }
5814 if ($gmauthorinfo[12] eq "Y") {
5815 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag Yes</FONT></TD>);
5816 } else {
5817 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag No</FONT></TD>);
5818 }
5819 if ($gmauthorinfo[13] eq "Y") {
5820 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag Yes</FONT></TD>);
5821 } else {
5822 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag No</FONT></TD>);
5823 }
5824 if ($gmauthorinfo[14] eq "Y") {
5825 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag Yes</FONT></TD>);
5826 } else {
5827 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag No</FONT></TD>);
5828 }
5829 if ($gmauthorinfo[15] eq "Y") {
5830 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag Yes</FONT></TD>);
5831 } else {
5832 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag No</FONT></TD>);
5833 }
5834 print "</TR>\n";
5835}
5836
5837print<<GMEDITAUTHORSBOTTOM;
5838
5839</TABLE></TD></TR></TABLE>
5840<P>
5841<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">
5842$alicewarning
5843<P>
5844<TABLE BORDER=0 cellpadding=1 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>
5845Create 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>
5846<P>
5847<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0">
5848</FORM>
5849<P>
5850<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>
5851$gmframebottom
5852
5853</BODY>
5854</HTML>
5855
5856GMEDITAUTHORSBOTTOM
5857
5858$statusnote = "";
5859
5860exit;
5861
5862}
5863
5864# -------------------
5865# create a new author
5866# -------------------
5867
5868sub gm_createnewauthor {
5869
5870&gm_validate;
5871
5872if ($gmauthoraccess ne "yes") {
5873 &gm_writetocplog("$IN{'authorname'} attempted to create a new author without authorization");
5874 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to create a new author.</FONT></B><P>);
5875 &gm_frontpage;
5876}
5877
5878if (($IN{'newauthorname'} eq "") || ($IN{'newauthorpassword'} eq "")) {
5879 $statusnote = qq(<B><FONT COLOR="#FF0000">You left either the name or password fields blank. Please try again.</FONT></B><P>);
5880 &gm_editauthors;
5881}
5882
5883if (($IN{'newauthorname'} =~ /^\s+/) || ($IN{'newauthorpassword'} =~ /^\s+/) || ($IN{'newauthorname'} =~ /\s+$/) || ($IN{'newauthorpassword'} =~ /\s+$/)) {
5884 $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>);
5885 &gm_editauthors;
5886}
5887
5888$IN{'newauthorname'} =~ s/ /THISISASPACE/g;
5889$IN{'newauthorpassword'} =~ s/ /THISISASPACE/g;
5890
5891if (($IN{'newauthorname'} =~ /\W/) || ($IN{'newauthorpassword'} =~ /\W/)) {
5892 $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>);
5893 &gm_editauthors;
5894}
5895
5896$IN{'newauthorname'} =~ s/THISISASPACE/ /g;
5897$IN{'newauthorpassword'} =~ s/THISISASPACE/ /g;
5898
5899$IN{'newauthoremail'} =~ s/^\s+//;
5900$IN{'newauthoremail'} =~ s/\s+$//;
5901$IN{'newauthorhomepage'} =~ s/^\s+//;
5902$IN{'newauthorhomepage'} =~ s/\s+$//;
5903
5904if ($IN{'newauthorhomepage'} eq "http://") { $IN{'newauthorhomepage'} = ""; }
5905
5906open (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.");
5907@gmauthordata = <FUNNYFEET>;
5908close (FUNNYFEET);
5909
5910foreach $gmauthordataline (@gmauthordata) {
5911 chomp ($gmauthordataline);
5912 @gmauthorinfo = split (/\|/, $gmauthordataline);
5913 if ($IN{'newauthorname'} eq $gmauthorinfo[0]) {
5914 &gm_writetocplog("$IN{'authorname'} attempted to add an author that is already registered ($IN{'newauthorname'})");
5915 $statusnote = qq(<B><FONT COLOR="#FF0000">That author is already registered.</FONT></B><P>);
5916 &gm_editauthors;
5917 }
5918}
5919
5920$temphomepageprefix = substr($IN{'newauthorhomepage'}, 0, 7);
5921if ($temphomepageprefix ne "http://") { $IN{'newauthorhomepage'} = "http://$IN{'newauthorhomepage'}"; }
5922
5923if ($IN{'newauthorhomepage'} eq "http://") { $IN{'newauthorhomepage'} = ""; }
5924
5925&date;
5926
5927
5928$IN{'newauthorpassword'} = crypt($IN{'newauthorpassword'},$IN{'newauthorpassword'});
5929
5930if ($IN{'newauthoraccess'} eq "all") {
5931 $newauthorline = "$IN{'newauthorname'}|$IN{'newauthorpassword'}|$IN{'newauthoremail'}|$IN{'newauthorhomepage'}|$montwo\/$mdaytwo\/$JSYear|0|Y|Y|Y|Y|Y|Y|Y|Y|Y|Y";
5932} elsif ($IN{'newauthoraccess'} eq "postedit") {
5933 $newauthorline = "$IN{'newauthorname'}|$IN{'newauthorpassword'}|$IN{'newauthoremail'}|$IN{'newauthorhomepage'}|$montwo\/$mdaytwo\/$JSYear|0|Y|O|N|N|N|N|N|Y|N|Y";
5934} else {
5935 $newauthorline = "$IN{'newauthorname'}|$IN{'newauthorpassword'}|$IN{'newauthoremail'}|$IN{'newauthorhomepage'}|$montwo\/$mdaytwo\/$JSYear|0|N|N|N|N|N|N|N|N|N|N";
5936}
5937
5938open (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.");
5939print FUNNYFEET "$newauthorline\n";
5940close (FUNNYFEET);
5941
5942open (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.");
5943@gmauthordata = <FUNNYFEET>;
5944close (FUNNYFEET);
5945
5946@gmauthordatasorted = sort { lc($a) cmp lc ($b) } @gmauthordata;
5947
5948open (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.");
5949foreach $gmauthordataline (@gmauthordatasorted) {
5950 chomp ($gmauthordataline);
5951 print FUNNYFEET "$gmauthordataline\n";
5952}
5953close (FUNNYFEET);
5954
5955&gm_writetocplog("$IN{'authorname'} registered a new author ($IN{'newauthorname'})");
5956
5957$statusnote = qq(<B><FONT COLOR="#0000FF">$IN{'newauthorname'} has been added to the author database.</FONT></B><P>);
5958
5959&gm_editauthors;
5960
5961}
5962
5963# ----------------
5964# delete an author
5965# ----------------
5966
5967sub gm_deleteselectedauthor {
5968
5969&gm_validate;
5970
5971if ($gmauthoraccess ne "yes") {
5972 &gm_writetocplog("$IN{'authorname'} attempted to delete an author ($IN{'selectedauthor'}) without authorization");
5973 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to delete authors.</FONT></B><P>);
5974 &gm_frontpage;
5975}
5976
5977open (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.");
5978@gmauthordata = <FUNNYFEET>;
5979close (FUNNYFEET);
5980
5981$authorfound = "no";
5982
5983foreach $gmauthordataline (@gmauthordata) {
5984 chomp ($gmauthordataline);
5985 @gmauthorinfo = split (/\|/, $gmauthordataline);
5986 if ($IN{'selectedauthor'} eq $gmauthorinfo[0]) { $authorfound = "yes"; }
5987}
5988
5989if ($authorfound ne "yes") {
5990 $statusnote = qq(<B><FONT COLOR="#FF0000">You must select an author first.</FONT></B><P>);
5991 &gm_editauthors;
5992}
5993
5994$authoramount = scalar(@gmauthordata);
5995
5996if ($authoramount eq "1") {
5997 $statusnote = qq(<B><FONT COLOR="#FF0000">You can't delete the only remaining author!</FONT></B><P>);
5998 &gm_editauthors;
5999}
6000
6001open (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.");
6002foreach $gmauthordataline (@gmauthordata) {
6003 chomp ($gmauthordataline);
6004 @gmauthorinfo = split (/\|/, $gmauthordataline);
6005 if ($IN{'selectedauthor'} ne $gmauthorinfo[0]) { print FUNNYFEET "$gmauthordataline\n"; }
6006}
6007close (FUNNYFEET);
6008
6009if ($IN{'selectedauthor'} eq $IN{'authorname'}) {
6010 &gm_writetocplog("$IN{'authorname'} deleted himself/herself in a sudden fit of existentialism");
6011} else {
6012 &gm_writetocplog("$IN{'authorname'} deleted an author ($IN{'selectedauthor'})");
6013}
6014
6015if ($IN{'selectedauthor'} eq $IN{'authorname'}) {
6016 $loginnotice = qq(<B><FONT COLOR="#0000FF">Please re-enter under your new author name and password.</FONT></B><P>);
6017 &gm_login;
6018 } else {
6019 $statusnote = qq(<B><FONT COLOR="#0000FF">$IN{'selectedauthor'} has been deleted.</FONT></B><P>);
6020 &gm_editauthors;
6021}
6022
6023}
6024
6025# -----------------
6026# editing an author
6027# -----------------
6028
6029sub gm_editselectedauthor {
6030
6031&gm_validate;
6032
6033if ($gmauthoraccess ne "yes") {
6034 &gm_writetocplog("$IN{'authorname'} attempted to edit the authors without authorization");
6035 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the authors.</FONT></B><P>);
6036 &gm_frontpage;
6037}
6038
6039open (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.");
6040@gmauthordata = <FUNNYFEET>;
6041close (FUNNYFEET);
6042
6043$authorfound = "no";
6044
6045$gmcounter = 0;
6046$gmauthordatanumber = 0;
6047
6048foreach $gmauthordataline (@gmauthordata) {
6049 chomp ($gmauthordataline);
6050 @gmauthorinfo = split (/\|/, $gmauthordataline);
6051 if ($IN{'selectedauthor'} eq $gmauthorinfo[0]) {
6052 $gmauthordatanumber = $gmcounter;
6053 $authorfound = "yes";
6054 }
6055 $gmcounter++;
6056}
6057
6058if ($authorfound ne "yes") {
6059 $statusnote = qq(<B><FONT COLOR="#FF0000">You must select an author first.</FONT></B><P>);
6060 &gm_editauthors;
6061}
6062
6063@gmselectedauthorinfo = split (/\|/, $gmauthordata[$gmauthordatanumber]);
6064
6065if ($gmselectedauthorinfo[3] eq "") { $gmselectedauthorinfo[3] = "http://"; }
6066
6067if ($statusnote eq "") { $statusnote = qq(<B><FONT COLOR="#000000">Editing $gmselectedauthorinfo[0]'s Info & Access</FONT></B><P>); }
6068
6069print<<GMEDITSELECTEDAUTHORTOP;
6070
6071$gmheadtag
6072
6073$gmframetop
6074$statusnote
6075<FORM ACTION="gm.cgi" METHOD=POST>
6076<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
6077<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
6078<INPUT TYPE=HIDDEN NAME="authororiginalname" VALUE="$gmselectedauthorinfo[0]">
6079<INPUT TYPE=HIDDEN NAME="authororiginalpassword" VALUE="$gmselectedauthorinfo[1]">
6080<INPUT TYPE=HIDDEN NAME="authororiginaldate" VALUE="$gmselectedauthorinfo[4]">
6081<INPUT TYPE=HIDDEN NAME="authororiginalentries" VALUE="$gmselectedauthorinfo[5]">
6082<INPUT TYPE=HIDDEN NAME="editedauthornumber" VALUE="$gmauthordatanumber">
6083<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=1>
6084<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Name:</FONT></TD><TD VALIGN=MIDDLE ALIGN=LEFT BGCOLOR="#FFFFFF"><INPUT TYPE=TEXT CLASS="textinput" NAME="editedname" VALUE="$gmselectedauthorinfo[0]" SIZE=20></TD></TR>
6085<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Password:</FONT></TD><TD VALIGN=MIDDLE ALIGN=LEFT BGCOLOR="#FFFFFF"><INPUT TYPE=PASSWORD CLASS="textinput" NAME="editedpassword" VALUE="$gmselectedauthorinfo[1]" SIZE=20></TD></TR>
6086<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag E-Mail:</FONT></TD><TD VALIGN=MIDDLE ALIGN=LEFT BGCOLOR="#FFFFFF"><INPUT TYPE=TEXT CLASS="textinput" NAME="editedemail" VALUE="$gmselectedauthorinfo[2]" SIZE=20></TD></TR>
6087<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Homepage:</FONT></TD><TD VALIGN=MIDDLE ALIGN=LEFT BGCOLOR="#FFFFFF"><INPUT TYPE=TEXT CLASS="textinput" NAME="editedhomepage" VALUE="$gmselectedauthorinfo[3]" SIZE=20></TD></TR>
6088
6089GMEDITSELECTEDAUTHORTOP
6090
6091print qq(<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Can post new entries?:</FONT></TD>);
6092
6093if ($gmselectedauthorinfo[6] eq "Y") {
6094 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFFF">$gmfonttag<INPUT TYPE=RADIO NAME="editedentryaccess" VALUE="Y" CHECKED> Yes <INPUT TYPE=RADIO NAME="editedentryaccess" VALUE="N"> No</FONT></TD></TR>\n);
6095} else {
6096 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFFF">$gmfonttag<INPUT TYPE=RADIO NAME="editedentryaccess" VALUE="Y"> Yes <INPUT TYPE=RADIO NAME="editedentryaccess" VALUE="N" CHECKED> No</FONT></TD></TR>\n);
6097}
6098
6099print qq(<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Can edit entries?:</FONT></TD>);
6100
6101if ($gmselectedauthorinfo[7] eq "Y") {
6102 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFFF">$gmfonttag<INPUT TYPE=RADIO NAME="editedentryeditaccess" VALUE="Y" CHECKED> Yes <INPUT TYPE=RADIO NAME="editedentryeditaccess" VALUE="N"> No<BR><INPUT TYPE=RADIO NAME="editedentryeditaccess" VALUE="O"> Only their own entries</FONT></TD></TR>\n);
6103} elsif ($gmselectedauthorinfo[7] eq "O") {
6104 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFFF">$gmfonttag<INPUT TYPE=RADIO NAME="editedentryeditaccess" VALUE="Y"> Yes <INPUT TYPE=RADIO NAME="editedentryeditaccess" VALUE="N"> No<BR><INPUT TYPE=RADIO NAME="editedentryeditaccess" VALUE="O" CHECKED> Only their own entries</FONT></TD></TR>\n);
6105} else {
6106 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFFF">$gmfonttag<INPUT TYPE=RADIO NAME="editedentryeditaccess" VALUE="Y"> Yes <INPUT TYPE=RADIO NAME="editedentryeditaccess" VALUE="N" CHECKED> No<BR><INPUT TYPE=RADIO NAME="editedentryeditaccess" VALUE="O"> Only their own entries</FONT></TD></TR>\n);
6107}
6108
6109print qq(<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Can configure?:</FONT></TD>);
6110
6111if ($gmselectedauthorinfo[8] eq "Y") {
6112 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFFF">$gmfonttag<INPUT TYPE=RADIO NAME="editedconfigureaccess" VALUE="Y" CHECKED> Yes <INPUT TYPE=RADIO NAME="editedconfigureaccess" VALUE="N"> No</FONT></TD></TR>\n);
6113} else {
6114 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFFF">$gmfonttag<INPUT TYPE=RADIO NAME="editedconfigureaccess" VALUE="Y"> Yes <INPUT TYPE=RADIO NAME="editedconfigureaccess" VALUE="N" CHECKED> No</FONT></TD></TR>\n);
6115}
6116
6117print qq(<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Can edit templates?:</FONT></TD>);
6118
6119if ($gmselectedauthorinfo[9] eq "Y") {
6120 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFFF">$gmfonttag<INPUT TYPE=RADIO NAME="editedtemplateaccess" VALUE="Y" CHECKED> Yes <INPUT TYPE=RADIO NAME="editedtemplateaccess" VALUE="N"> No<BR><INPUT TYPE=RADIO NAME="editedtemplateaccess" VALUE="O"> Only header/footer/sidebar</FONT></TD></TR>\n);
6121} elsif ($gmselectedauthorinfo[9] eq "O") {
6122 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFFF">$gmfonttag<INPUT TYPE=RADIO NAME="editedtemplateaccess" VALUE="Y"> Yes <INPUT TYPE=RADIO NAME="editedtemplateaccess" VALUE="N"> No<BR><INPUT TYPE=RADIO NAME="editedtemplateaccess" VALUE="O" CHECKED> Only header/footer/sidebar</FONT></TD></TR>\n);
6123} else {
6124 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFFF">$gmfonttag<INPUT TYPE=RADIO NAME="editedtemplateaccess" VALUE="Y"> Yes <INPUT TYPE=RADIO NAME="editedtemplateaccess" VALUE="N" CHECKED> No<BR><INPUT TYPE=RADIO NAME="editedtemplateaccess" VALUE="O"> Only header/footer/sidebar</FONT></TD></TR>\n);
6125}
6126
6127print qq(<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Can edit authors?:</FONT></TD>);
6128
6129if ($gmselectedauthorinfo[10] eq "Y") {
6130 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFFF">$gmfonttag<INPUT TYPE=RADIO NAME="editedauthoraccess" VALUE="Y" CHECKED> Yes <INPUT TYPE=RADIO NAME="editedauthoraccess" VALUE="N"> No</FONT></TD></TR>\n);
6131} else {
6132 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFFF">$gmfonttag<INPUT TYPE=RADIO NAME="editedauthoraccess" VALUE="Y"> Yes <INPUT TYPE=RADIO NAME="editedauthoraccess" VALUE="N" CHECKED> No</FONT></TD></TR>\n);
6133}
6134
6135print qq(<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Can rebuild files?:</FONT></TD>);
6136
6137if ($gmselectedauthorinfo[11] eq "Y") {
6138 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFFF">$gmfonttag<INPUT TYPE=RADIO NAME="editedrebuildaccess" VALUE="Y" CHECKED> Yes <INPUT TYPE=RADIO NAME="editedrebuildaccess" VALUE="N"> No</FONT></TD></TR>\n);
6139} else {
6140 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFFF">$gmfonttag<INPUT TYPE=RADIO NAME="editedrebuildaccess" VALUE="Y"> Yes <INPUT TYPE=RADIO NAME="editedrebuildaccess" VALUE="N" CHECKED> No</FONT></TD></TR>\n);
6141}
6142
6143print qq(<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Can view CP log?:</FONT></TD>);
6144
6145if ($gmselectedauthorinfo[12] eq "Y") {
6146 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFFF">$gmfonttag<INPUT TYPE=RADIO NAME="editedcplogaccess" VALUE="Y" CHECKED> Yes <INPUT TYPE=RADIO NAME="editedcplogaccess" VALUE="N"> No</FONT></TD></TR>\n);
6147} else {
6148 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFFF">$gmfonttag<INPUT TYPE=RADIO NAME="editedcplogaccess" VALUE="Y"> Yes <INPUT TYPE=RADIO NAME="editedcplogaccess" VALUE="N" CHECKED> No</FONT></TD></TR>\n);
6149}
6150
6151print qq(<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Can use bookmarklets?:</FONT></TD>);
6152
6153if ($gmselectedauthorinfo[13] eq "Y") {
6154 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFFF">$gmfonttag<INPUT TYPE=RADIO NAME="editedbookmarkletaccess" VALUE="Y" CHECKED> Yes <INPUT TYPE=RADIO NAME="editedbookmarkletaccess" VALUE="N"> No</FONT></TD></TR>\n);
6155} else {
6156 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFFF">$gmfonttag<INPUT TYPE=RADIO NAME="editedbookmarkletaccess" VALUE="Y"> Yes <INPUT TYPE=RADIO NAME="editedbookmarkletaccess" VALUE="N" CHECKED> No</FONT></TD></TR>\n);
6157}
6158
6159print qq(<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Can upload files?:</FONT></TD>);
6160
6161if ($gmselectedauthorinfo[14] eq "Y") {
6162 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFFF">$gmfonttag<INPUT TYPE=RADIO NAME="editeduploadaccess" VALUE="Y" CHECKED> Yes <INPUT TYPE=RADIO NAME="editeduploadaccess" VALUE="N"> No</FONT></TD></TR>\n);
6163} else {
6164 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFFF">$gmfonttag<INPUT TYPE=RADIO NAME="editeduploadaccess" VALUE="Y"> Yes <INPUT TYPE=RADIO NAME="editeduploadaccess" VALUE="N" CHECKED> No</FONT></TD></TR>\n);
6165}
6166
6167print qq(<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Can login to gm.cgi?:</FONT></TD>);
6168
6169if ($gmselectedauthorinfo[15] eq "Y") {
6170 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFFF">$gmfonttag<INPUT TYPE=RADIO NAME="editedloginaccess" VALUE="Y" CHECKED> Yes <INPUT TYPE=RADIO NAME="editedloginaccess" VALUE="N"> No</FONT></TD></TR>\n);
6171} else {
6172 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#FFFFFF">$gmfonttag<INPUT TYPE=RADIO NAME="editedloginaccess" VALUE="Y"> Yes <INPUT TYPE=RADIO NAME="editedloginaccess" VALUE="N" CHECKED> No</FONT></TD></TR>\n);
6173}
6174
6175print<<GMEDITSELECTEDAUTHORBOTTOM;
6176
6177</TABLE></TD></TR></TABLE>
6178<P>
6179<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">
6180<P>
6181<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Author Panel">
6182<P>
6183<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0">
6184</FORM>
6185<P>
6186<FONT SIZE=1>"I always wanted to be somebody, but I should have been more specific."—Lily Tomlin</FONT>
6187$gmframebottom
6188
6189</BODY>
6190</HTML>
6191
6192GMEDITSELECTEDAUTHORBOTTOM
6193
6194exit;
6195
6196}
6197
6198# -------------------------
6199# save changes to an author
6200# -------------------------
6201
6202sub gm_saveauthorchanges {
6203
6204&gm_validate;
6205
6206if ($gmauthoraccess ne "yes") {
6207 &gm_writetocplog("$IN{'authorname'} attempted to modify an author ($IN{'authororiginalname'}) without authorization");
6208 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to delete authors.</FONT></B><P>);
6209 &gm_frontpage;
6210}
6211
6212$IN{'editedname'} =~ s/\|//g;
6213$IN{'editedpassword'} =~ s/\|//g;
6214$IN{'editedemail'} =~ s/\|//g;
6215$IN{'editedhomepage'} =~ s/\|//g;
6216
6217$IN{'editedname'} =~ s/^\s+//;
6218$IN{'editedname'} =~ s/\s+$//;
6219$IN{'editedpassword'} =~ s/^\s+//;
6220$IN{'editedpassword'} =~ s/\s+$//;
6221
6222if (($IN{'editedname'} eq "") || ($IN{'editedpassword'} eq "")) {
6223 $statusnote = qq(<B><FONT COLOR="#FF0000">You left either the name or password fields blank. Please try again.</FONT></B><P>);
6224 &gm_editauthors;
6225}
6226
6227open (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.");
6228@gmauthordata = <FUNNYFEET>;
6229close (FUNNYFEET);
6230
6231$gmnamesduplicate = "no";
6232
6233foreach $gmauthordataline (@gmauthordata) {
6234 @gmauthordatainfo = split (/\|/, $gmauthordataline);
6235 if (($IN{'authororiginalname'} ne $IN{'editedname'}) && ($gmauthordatainfo[0] eq $IN{'editedname'})) {
6236 &gm_writetocplog("$IN{'authorname'} attempted to add a duplicate of $IN{'editedname'} via $IN{'authororiginalname'}");
6237 $statusnote = qq(<B><FONT COLOR="#FF0000">You can't add a duplicate of another author.</FONT></B><P>);
6238 &gm_editauthors;
6239 }
6240}
6241
6242if (($IN{'editedname'} ne $IN{'authororiginalname'}) && ($keeplog eq "yes")) {
6243 if ($IN{'authorname'} eq $IN{'authororiginalname'}) {
6244 &gm_writetocplog("$IN{'authorname'} changed his/her own name to $IN{'editedname'}");
6245 } else {
6246 &gm_writetocplog("$IN{'authorname'} changed $IN{'authororiginalname'}'s name to $IN{'editedname'}");
6247 }
6248}
6249
6250$temphomepageprefix = substr($IN{'editedhomepage'}, 0, 7);
6251if ($temphomepageprefix ne "http://") { $IN{'editedhomepage'} = "http://$IN{'editedhomepage'}"; }
6252
6253if ($IN{'editedhomepage'} eq "http://") { $IN{'editedhomepage'} = ""; }
6254
6255open (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.");
6256foreach $gmauthordataline (@gmauthordata) {
6257 chomp ($gmauthordataline);
6258 @gmauthorinfo = split (/\|/, $gmauthordataline);
6259
6260 # Encrypt password if it has been changed before writing to the file
6261 # this was supported in 1.21c, but removed in 1.21d, now replaced in 1.3: linear
6262 # Added in 1.3.1 : Stex
6263 $cryptedpassword = $IN{'editedpassword'};
6264 # merged in 1.3.1
6265 unless ($IN{'editedpassword'} eq $IN{'authororiginalpassword'}) {
6266 $cryptedpassword = crypt($IN{'editedpassword'},$IN{'editedpassword'});
6267 }
6268 # merged 9/16/2003
6269
6270 if ($IN{'authororiginalname'} ne $gmauthorinfo[0]) {
6271 print FUNNYFEET "$gmauthordataline\n";
6272 } else {
6273 print FUNNYFEET "$IN{'editedname'}|$cryptedpassword|$IN{'editedemail'}|$IN{'editedhomepage'}|$IN{'authororiginaldate'}|$IN{'authororiginalentries'}|$IN{'editedentryaccess'}|$IN{'editedentryeditaccess'}|$IN{'editedconfigureaccess'}|$IN{'editedtemplateaccess'}|$IN{'editedauthoraccess'}|$IN{'editedrebuildaccess'}|$IN{'editedcplogaccess'}|$IN{'editedbookmarkletaccess'}|$IN{'editeduploadaccess'}|$IN{'editedloginaccess'}\n";
6274 }
6275}
6276close (FUNNYFEET);
6277
6278if ($IN{'authororiginalname'} eq $IN{'authorname'}) {
6279 $IN{'authorname'} = $IN{'editedname'};
6280 $IN{'authorpassword'} = $IN{'editedpassword'};
6281}
6282
6283if ($IN{'authorname'} eq $IN{'editedname'}) {
6284 &gm_writetocplog("$IN{'authorname'} edited his/her own info/access");
6285} else {
6286 &gm_writetocplog("$IN{'authorname'} edited $IN{'editedname'}'s info/access");
6287}
6288
6289$statusnote = qq(<B><FONT COLOR="#0000FF">$IN{'editedname'}'s info/access has been edited.</FONT></B><P>);
6290&gm_editauthors;
6291
6292}
6293
6294# ------------------
6295# configuration menu
6296# ------------------
6297
6298sub gm_configuration {
6299
6300&gm_validate;
6301
6302if ($gmconfigurationaccess ne "yes") {
6303 &gm_writetocplog("$IN{'authorname'} attempted to configure this program without authorization");
6304 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to configure this program.</FONT></B><P>);
6305 &gm_frontpage;
6306}
6307
6308&gm_readconfig;
6309
6310&date;
6311
6312$censorlist = &delouse($censorlist);
6313$otherfilelist = &delouse($otherfilelist);
6314
6315if ($statusnote eq "") { $statusnote = qq(<B><FONT COLOR="#000000">Configuration Options</FONT></B><P>); }
6316
6317print<<GMCONFIGMENUTOP;
6318
6319$gmheadtag
6320
6321$gmframetop
6322$statusnote
6323<FORM ACTION="gm.cgi" METHOD=POST>
6324<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
6325<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
6326<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=1 WIDTH=700>
6327
6328<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 <a href="http://www.greymatterforums.com/info/manual.html" title="read the manual" target="_blank">manual</a> for more information. It's a good idea to run "Diagnostics & Repair" after saving changes to your paths.</FONT></FONT></TD></TR>
6329
6330<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>
6331
6332<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>
6333
6334<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>
6335
6336<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>
6337
6338<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>
6339
6340<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>
6341
6342<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT>$gmfonttag<B>Emoticons Path:</B><BR><FONT SIZE=1>The path for the emoticon images. either a website path (like http://) or a local path (like /emoticons). no slash ("/") at the end.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedemoticonspath" VALUE="$emoticonspath" SIZE=30 STYLE="width: 400">$gmfonttag</TD></TR>
6343
6344</TABLE></TD></TR></TABLE>
6345
6346<P>
6347
6348<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=1 WIDTH=700>
6349
6350<TR><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#C0C0C0" 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>
6351
6352<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>
6353
6354<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>
6355
6356<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>
6357
6358<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>
6359
6360GMCONFIGMENUTOP
6361
6362print 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>);
6363
6364if ($generateentrypages eq "yes") {
6365 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedgenerateentrypages" VALUE="yes" CHECKED> Yes   <INPUT TYPE=RADIO NAME="editedgenerateentrypages" VALUE="no"> No</FONT></TD></TR>\n);
6366} else {
6367 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedgenerateentrypages" VALUE="yes"> Yes   <INPUT TYPE=RADIO NAME="editedgenerateentrypages" VALUE="no" CHECKED> No</FONT></TD></TR>\n);
6368}
6369
6370print 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>);
6371
6372if ($keeparchivemasterindex eq "yes") {
6373 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedkeeparchivemasterindex" VALUE="yes" CHECKED> Yes   <INPUT TYPE=RADIO NAME="editedkeeparchivemasterindex" VALUE="no"> No</FONT></TD></TR>\n);
6374} else {
6375 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedkeeparchivemasterindex" VALUE="yes"> Yes   <INPUT TYPE=RADIO NAME="editedkeeparchivemasterindex" VALUE="no" CHECKED> No</FONT></TD></TR>\n);
6376}
6377
6378print 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>);
6379
6380if ($keepmonthlyarchives eq "yes") {
6381 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedkeepmonthlyarchives" VALUE="yes" CHECKED> Yes   <INPUT TYPE=RADIO NAME="editedkeepmonthlyarchives" VALUE="no"> No</FONT></TD></TR>\n);
6382} else {
6383 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedkeepmonthlyarchives" VALUE="yes"> Yes   <INPUT TYPE=RADIO NAME="editedkeepmonthlyarchives" VALUE="no" CHECKED> No</FONT></TD></TR>\n);
6384}
6385
6386print 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>);
6387
6388if ($concurrentmainandarchives eq "yes") {
6389 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedconcurrentmainandarchives" VALUE="yes" CHECKED> Yes   <INPUT TYPE=RADIO NAME="editedconcurrentmainandarchives" VALUE="no"> No</FONT></TD></TR>\n);
6390} else {
6391 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedconcurrentmainandarchives" VALUE="yes"> Yes   <INPUT TYPE=RADIO NAME="editedconcurrentmainandarchives" VALUE="no" CHECKED> No</FONT></TD></TR>\n);
6392}
6393
6394print 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>);
6395
6396if ($archiveformat eq "week") {
6397 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedarchiveformat" VALUE="month"> Monthly   <INPUT TYPE=RADIO NAME="editedarchiveformat" VALUE="week" CHECKED> Weekly</FONT></TD></TR>\n);
6398} else {
6399 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedarchiveformat" VALUE="month" CHECKED> Monthly   <INPUT TYPE=RADIO NAME="editedarchiveformat" VALUE="week"> Weekly</FONT></TD></TR>\n);
6400}
6401
6402print qq(</TABLE></TD></TR></TABLE>
6403
6404<P>
6405
6406<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=1 WIDTH=700>
6407
6408<TR><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#C0C0C0" 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>
6409
6410<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>
6411
6412<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>
6413
6414<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>);
6415
6416if ($NotifyForStatus eq "karma") {
6417 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);
6418} elsif ($NotifyForStatus eq "comments") {
6419 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);
6420} elsif ($NotifyForStatus eq "both") {
6421 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);
6422} else {
6423 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);
6424}
6425
6426print qq(</TABLE></TD></TR></TABLE>
6427
6428<P>
6429
6430<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=1 WIDTH=700>
6431
6432<TR><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#C0C0C0" COLSPAN=2>$gmfonttag<B>Emoticon Options</B><BR><FONT SIZE=1>Options relating to using emoticons in entries and comments.</FONT></FONT></TD></TR>
6433
6434<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Allow emoticons?</B><BR><FONT SIZE=1>Specifies if you want to allow emoticons in the entries and/or the comments.</FONT></FONT></TD>);
6435
6436if ($emoticonsallowed eq "entries") {
6437 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedemoticonsallowed" VALUE="entries" CHECKED> Entries only   <INPUT TYPE=RADIO NAME="editedemoticonsallowed" VALUE="comments"> Comments only<BR><INPUT TYPE=RADIO NAME="editedemoticonsallowed" VALUE="both"> Both   <INPUT TYPE=RADIO NAME="editedemoticonsallowed" VALUE="neither"> Neither</FONT></TD></TR>\n);
6438} elsif ($emoticonsallowed eq "comments") {
6439 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedemoticonsallowed" VALUE="entries"> Entries only   <INPUT TYPE=RADIO NAME="editedemoticonsallowed" VALUE="comments" CHECKED> Comments only<BR><INPUT TYPE=RADIO NAME="editedemoticonsallowed" VALUE="both"> Both   <INPUT TYPE=RADIO NAME="editedemoticonsallowed" VALUE="neither"> Neither</FONT></TD></TR>\n);
6440} elsif ($emoticonsallowed eq "both") {
6441 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedemoticonsallowed" VALUE="entries"> Entries only <INPUT TYPE=RADIO NAME="editedemoticonsallowed" VALUE="comments"> Comments only<BR><INPUT TYPE=RADIO NAME="editedemoticonsallowed" VALUE="both" CHECKED> Both <INPUT TYPE=RADIO NAME="editedemoticonsallowed" VALUE="neither"> Neither</FONT></TD></TR>\n);
6442} else {
6443 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedemoticonsallowed" VALUE="entries"> Entries only   <INPUT TYPE=RADIO NAME="editedemoticonsallowed" VALUE="comments"> Comments only<BR><INPUT TYPE=RADIO NAME="editedemoticonsallowed" VALUE="both"> Both   <INPUT TYPE=RADIO NAME="editedemoticonsallowed" VALUE="neither" CHECKED> Neither</FONT></TD></TR>\n);
6444}
6445print qq(</TABLE></TD></TR></TABLE>
6446
6447<P>
6448
6449<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=1 WIDTH=700>
6450
6451<TR><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#C0C0C0" 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>
6452
6453<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>);
6454
6455if ($allowkarmaorcomments eq "karma") {
6456 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedallowkarmaorcomments" VALUE="karma" CHECKED> Karma only   <INPUT TYPE=RADIO NAME="editedallowkarmaorcomments" VALUE="comments"> Comments only<BR><INPUT TYPE=RADIO NAME="editedallowkarmaorcomments" VALUE="both"> Both   <INPUT TYPE=RADIO NAME="editedallowkarmaorcomments" VALUE="neither"> Neither</FONT></TD></TR>\n);
6457} elsif ($allowkarmaorcomments eq "comments") {
6458 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedallowkarmaorcomments" VALUE="karma"> Karma only   <INPUT TYPE=RADIO NAME="editedallowkarmaorcomments" VALUE="comments" CHECKED> Comments only<BR><INPUT TYPE=RADIO NAME="editedallowkarmaorcomments" VALUE="both"> Both   <INPUT TYPE=RADIO NAME="editedallowkarmaorcomments" VALUE="neither"> Neither</FONT></TD></TR>\n);
6459} elsif ($allowkarmaorcomments eq "both") {
6460 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedallowkarmaorcomments" VALUE="karma"> Karma only <INPUT TYPE=RADIO NAME="editedallowkarmaorcomments" VALUE="comments"> Comments only<BR><INPUT TYPE=RADIO NAME="editedallowkarmaorcomments" VALUE="both" CHECKED> Both <INPUT TYPE=RADIO NAME="editedallowkarmaorcomments" VALUE="neither"> Neither</FONT></TD></TR>\n);
6461} else {
6462 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedallowkarmaorcomments" VALUE="karma"> Karma only   <INPUT TYPE=RADIO NAME="editedallowkarmaorcomments" VALUE="comments"> Comments only<BR><INPUT TYPE=RADIO NAME="editedallowkarmaorcomments" VALUE="both"> Both   <INPUT TYPE=RADIO NAME="editedallowkarmaorcomments" VALUE="neither" CHECKED> Neither</FONT></TD></TR>\n);
6463}
6464
6465print 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>);
6466
6467if ($commentsorder eq "ascending") {
6468 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedcommentsorder" VALUE="ascending" CHECKED> Ascending   <INPUT TYPE=RADIO NAME="editedcommentsorder" VALUE="descending"> Descending</FONT></TD></TR>\n);
6469} else {
6470 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedcommentsorder" VALUE="ascending"> Ascending   <INPUT TYPE=RADIO NAME="editedcommentsorder" VALUE="descending" CHECKED> Descending</FONT></TD></TR>\n);
6471}
6472
6473print 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>);
6474
6475if ($posttoarchives eq "yes") {
6476 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedposttoarchives" VALUE="yes" CHECKED> Yes   <INPUT TYPE=RADIO NAME="editedposttoarchives" VALUE="no"> No</FONT></TD></TR>\n);
6477} else {
6478 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedposttoarchives" VALUE="yes"> Yes   <INPUT TYPE=RADIO NAME="editedposttoarchives" VALUE="no" CHECKED> No</FONT></TD></TR>\n);
6479}
6480
6481print 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>);
6482
6483if ($allowkarmadefault eq "yes") {
6484 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedallowkarmadefault" VALUE="yes" CHECKED> Yes   <INPUT TYPE=RADIO NAME="editedallowkarmadefault" VALUE="no"> No</FONT></TD></TR>\n);
6485} else {
6486 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedallowkarmadefault" VALUE="yes"> Yes   <INPUT TYPE=RADIO NAME="editedallowkarmadefault" VALUE="no" CHECKED> No</FONT></TD></TR>\n);
6487}
6488
6489print 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>);
6490
6491if ($allowcommentsdefault eq "yes") {
6492 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedallowcommentsdefault" VALUE="yes" CHECKED> Yes   <INPUT TYPE=RADIO NAME="editedallowcommentsdefault" VALUE="no"> No</FONT></TD></TR>\n);
6493} else {
6494 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedallowcommentsdefault" VALUE="yes"> Yes   <INPUT TYPE=RADIO NAME="editedallowcommentsdefault" VALUE="no" CHECKED> No</FONT></TD></TR>\n);
6495}
6496
6497print 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>);
6498
6499if ($allowhtmlincomments eq "yes") {
6500 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);
6501} elsif ($allowhtmlincomments eq "linkboldital") {
6502 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);
6503} elsif ($allowhtmlincomments eq "linkonly") {
6504 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);
6505} else {
6506 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);
6507}
6508
6509print 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>);
6510
6511if ($autolinkurls eq "yes") {
6512 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedautolinkurls" VALUE="yes" CHECKED> Yes   <INPUT TYPE=RADIO NAME="editedautolinkurls" VALUE="no"> No</FONT></TD></TR>\n);
6513} else {
6514 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedautolinkurls" VALUE="yes"> Yes   <INPUT TYPE=RADIO NAME="editedautolinkurls" VALUE="no" CHECKED> No</FONT></TD></TR>\n);
6515}
6516
6517print 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>);
6518
6519if ($striplinesfromcomments eq "yes") {
6520 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedstriplinesfromcomments" VALUE="yes" CHECKED> Yes   <INPUT TYPE=RADIO NAME="editedstriplinesfromcomments" VALUE="no"> No</FONT></TD></TR>\n);
6521} else {
6522 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedstriplinesfromcomments" VALUE="yes"> Yes   <INPUT TYPE=RADIO NAME="editedstriplinesfromcomments" VALUE="no" CHECKED> No</FONT></TD></TR>\n);
6523}
6524
6525print 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>);
6526
6527if ($allowmultiplekarmavotes eq "yes") {
6528 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedallowmultiplekarmavotes" VALUE="yes" CHECKED> Yes   <INPUT TYPE=RADIO NAME="editedallowmultiplekarmavotes" VALUE="no"> No</FONT></TD></TR>\n);
6529} else {
6530 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedallowmultiplekarmavotes" VALUE="yes"> Yes   <INPUT TYPE=RADIO NAME="editedallowmultiplekarmavotes" VALUE="no" CHECKED> No</FONT></TD></TR>\n);
6531}
6532
6533print 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>);
6534
6535if ($logkarmaandcomments eq "yes") {
6536 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedlogkarmaandcomments" VALUE="yes" CHECKED> Yes   <INPUT TYPE=RADIO NAME="editedlogkarmaandcomments" VALUE="no"> No</FONT></TD></TR>\n);
6537} else {
6538 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedlogkarmaandcomments" VALUE="yes"> Yes   <INPUT TYPE=RADIO NAME="editedlogkarmaandcomments" VALUE="no" CHECKED> No</FONT></TD></TR>\n);
6539}
6540
6541# new config entries for $keepphphacklog and $mailhacknotice: linear 9/12/2003
6542# merged into 1.3
6543print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Mention it in the control panel log when<BR>PHP hack attempts are detected?</B><BR><FONT SIZE=1>Enable this if you want Greymatter to log all attempts at hacking in the control panel log. Particularly useful for those who have set their file .suffix to .php</FONT></FONT></TD>);
6544
6545
6546if ($keepphphacklog eq "yes") {
6547 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedkeepphphacklog" VALUE="yes" CHECKED> Yes   <INPUT TYPE=RADIO NAME="editedkeepphphacklog" VALUE="no"> No</FONT></TD></TR>\n);
6548} else {
6549 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedkeepphphacklog" VALUE="yes"> Yes   <INPUT TYPE=RADIO NAME="editedkeepphphacklog" VALUE="no" CHECKED> No</FONT></TD></TR>\n);
6550}
6551
6552
6553print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Send e-mail notifications when<BR>PHP hack attempts are detected?</B><BR><FONT SIZE=1>Enable this if you want to receive mail when PHP hack attempts are logged. Particularly useful for those who have set their file .suffix to .php</FONT></FONT></TD>);
6554
6555
6556if ($mailhacknotice eq "yes") {
6557 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedmailhacknotice" VALUE="yes" CHECKED> Yes   <INPUT TYPE=RADIO NAME="editedmailhacknotice" VALUE="no"> No</FONT></TD></TR>\n);
6558} else {
6559 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedmailhacknotice" VALUE="yes"> Yes   <INPUT TYPE=RADIO NAME="editedmailhacknotice" VALUE="no" CHECKED> No</FONT></TD></TR>\n);
6560}
6561# merged 9/12/2003
6562
6563print qq(</TABLE></TD></TR></TABLE>
6564
6565<P>
6566
6567<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=1 WIDTH=700>
6568
6569<TR><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#C0C0C0" 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>
6570
6571<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=5>$gmfonttag</TD></TR>
6572
6573<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>
6574
6575</TABLE></TD></TR></TABLE>
6576
6577<P>
6578
6579<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=1 WIDTH=700>
6580
6581<TR><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#C0C0C0" COLSPAN=2>$gmfonttag<B>File Uploading Options</B><BR><FONT SIZE=1>Options relating to uploading files from within Greymatter.</FONT></FONT></TD></TR>
6582
6583<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>
6584
6585<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>
6586
6587</TABLE></TD></TR></TABLE>
6588
6589<P>
6590
6591<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=1 WIDTH=700>
6592
6593<TR><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#C0C0C0" 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>
6594
6595<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>);
6596
6597if ($censorenabled eq "entries") {
6598 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedcensorenabled" VALUE="entries" CHECKED> Entries only   <INPUT TYPE=RADIO NAME="editedcensorenabled" VALUE="comments"> Comments only<BR><INPUT TYPE=RADIO NAME="editedcensorenabled" VALUE="both"> Both   <INPUT TYPE=RADIO NAME="editedcensorenabled" VALUE="neither"> Neither</FONT></TD></TR>\n);
6599} elsif ($censorenabled eq "comments") {
6600 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedcensorenabled" VALUE="entries"> Entries only   <INPUT TYPE=RADIO NAME="editedcensorenabled" VALUE="comments" CHECKED> Comments only<BR><INPUT TYPE=RADIO NAME="editedcensorenabled" VALUE="both"> Both   <INPUT TYPE=RADIO NAME="editedcensorenabled" VALUE="neither"> Neither</FONT></TD></TR>\n);
6601} elsif ($censorenabled eq "both") {
6602 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedcensorenabled" VALUE="entries"> Entries only   <INPUT TYPE=RADIO NAME="editedcensorenabled" VALUE="comments"> Comments only<BR><INPUT TYPE=RADIO NAME="editedcensorenabled" VALUE="both" CHECKED> Both   <INPUT TYPE=RADIO NAME="editedcensorenabled" VALUE="neither"> Neither</FONT></TD></TR>\n);
6603} else {
6604 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedcensorenabled" VALUE="entries"> Entries only   <INPUT TYPE=RADIO NAME="editedcensorenabled" VALUE="comments"> Comments only<BR><INPUT TYPE=RADIO NAME="editedcensorenabled" VALUE="both"> Both   <INPUT TYPE=RADIO NAME="editedcensorenabled" VALUE="neither" CHECKED> Neither</FONT></TD></TR>\n);
6605}
6606
6607print 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>
6608
6609</TABLE></TD></TR></TABLE>
6610
6611<P>
6612
6613<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=1 WIDTH=700>
6614
6615<TR><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#C0C0C0" 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>
6616
6617<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 wish—and enter its filename on the right; place each filename on separate lines. If the file isn't in the same directory as gm.cgi, then use virtual paths relative to where it's running from. For example, if you want to connect "test.htm" and it's in the directory above gm.cgi, you'd use ../test.htm; or, if you run gm.cgi from /here/cgi-bin and test.htm was in /there/log, you'd use ../../there/log ("../" means to go up one directory). Greymatter will automatically create a "pattern" file in your entries directory for each filename, and whenever you reupload a changed file, Greymatter will automatically update its stored pattern for that file.</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>
6618
6619<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>);
6620
6621if ($otherfilelistentryrebuild eq "yes") {
6622 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedotherfilelistentryrebuild" VALUE="yes" CHECKED> Yes   <INPUT TYPE=RADIO NAME="editedotherfilelistentryrebuild" VALUE="no"> No</FONT></TD></TR>\n);
6623} else {
6624 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedotherfilelistentryrebuild" VALUE="yes"> Yes   <INPUT TYPE=RADIO NAME="editedotherfilelistentryrebuild" VALUE="no" CHECKED> No</FONT></TD></TR>\n);
6625}
6626
6627print qq(</TABLE></TD></TR></TABLE>
6628
6629<P>
6630
6631<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=1 WIDTH=700>
6632
6633<TR><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#C0C0C0" COLSPAN=2>$gmfonttag<B>Miscellaneous Options</B></FONT></TD></TR>
6634
6635<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Enable/Disable cookies?</B><BR><FONT SIZE=1>By default, Greymatter doesn't keep a cookie on your browser to remember your name and password. To enable Greymatter's cookies, select "Yes".</FONT></FONT></TD>);
6636
6637if ($cookiesallowed eq "yes") {
6638 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedcookiesallowed" VALUE="yes" CHECKED> Yes   <INPUT TYPE=RADIO NAME="editedcookiesallowed" VALUE="no"> No);
6639} else {
6640 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedcookiesallowed" VALUE="yes"> Yes   <INPUT TYPE=RADIO NAME="editedcookiesallowed" VALUE="no" CHECKED> No);
6641}
6642
6643print 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>);
6644
6645if ($keeplog eq "yes") {
6646 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedkeeplog" VALUE="yes" CHECKED> Yes   <INPUT TYPE=RADIO NAME="editedkeeplog" VALUE="no"> No</FONT></TD></TR>\n);
6647} else {
6648 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedkeeplog" VALUE="yes"> Yes   <INPUT TYPE=RADIO NAME="editedkeeplog" VALUE="no" CHECKED> No</FONT></TD></TR>\n);
6649}
6650
6651print 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>);
6652
6653if ($inlineformatting eq "entries") {
6654 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedinlineformatting" VALUE="entries" CHECKED> Entries only   <INPUT TYPE=RADIO NAME="editedinlineformatting" VALUE="comments"> Comments only<BR><INPUT TYPE=RADIO NAME="editedinlineformatting" VALUE="both"> Both   <INPUT TYPE=RADIO NAME="editedinlineformatting" VALUE="neither"> Neither</FONT></TD></TR>\n);
6655} elsif ($inlineformatting eq "comments") {
6656 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedinlineformatting" VALUE="entries"> Entries only   <INPUT TYPE=RADIO NAME="editedinlineformatting" VALUE="comments" CHECKED> Comments only<BR><INPUT TYPE=RADIO NAME="editedinlineformatting" VALUE="both"> Both   <INPUT TYPE=RADIO NAME="editedinlineformatting" VALUE="neither"> Neither</FONT></TD></TR>\n);
6657} elsif ($inlineformatting eq "both") {
6658 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedinlineformatting" VALUE="entries"> Entries only   <INPUT TYPE=RADIO NAME="editedinlineformatting" VALUE="comments"> Comments only<BR><INPUT TYPE=RADIO NAME="editedinlineformatting" VALUE="both" CHECKED> Both   <INPUT TYPE=RADIO NAME="editedinlineformatting" VALUE="neither"> Neither</FONT></TD></TR>\n);
6659} else {
6660 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedinlineformatting" VALUE="entries"> Entries only   <INPUT TYPE=RADIO NAME="editedinlineformatting" VALUE="comments"> Comments only<BR><INPUT TYPE=RADIO NAME="editedinlineformatting" VALUE="both"> Both   <INPUT TYPE=RADIO NAME="editedinlineformatting" VALUE="neither" CHECKED> Neither</FONT></TD></TR>\n);
6661}
6662
6663print 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);
6664
6665if ($defaultentrylistview eq "main") {
6666 if ($indexdays eq "1") {
6667 print qq(<OPTION VALUE="main" SELECTED> Current entries \($indexdays day\)\n);
6668 } else {
6669 print qq(<OPTION VALUE="main" SELECTED> Current entries \($indexdays days\)\n);
6670 }
6671} else {
6672 if ($indexdays eq "1") {
6673 print qq(<OPTION VALUE="main"> Current entries \($indexdays day\)\n);
6674 } else {
6675 print qq(<OPTION VALUE="main"> Current entries \($indexdays days\)\n);
6676 }
6677}
6678
6679if ($defaultentrylistview eq "onlyyou") {
6680 print qq(<OPTION VALUE="onlyyou" SELECTED> All entries by you\n);
6681} else {
6682 print qq(<OPTION VALUE="onlyyou"> All entries by you\n);
6683}
6684
6685if ($defaultentrylistview eq "more") {
6686 print qq(<OPTION VALUE="more" SELECTED> All extended entries\n);
6687} else {
6688 print qq(<OPTION VALUE="more"> All extended entries\n);
6689}
6690
6691if ($defaultentrylistview eq "open") {
6692 print qq(<OPTION VALUE="open" SELECTED> All open entries\n);
6693} else {
6694 print qq(<OPTION VALUE="open"> All open entries\n);
6695}
6696
6697if ($defaultentrylistview eq "closed") {
6698 print qq(<OPTION VALUE="closed" SELECTED> All closed entries\n);
6699} else {
6700 print qq(<OPTION VALUE="closed"> All closed entries\n);
6701}
6702
6703if ($defaultentrylistview eq "all") {
6704 print qq(<OPTION VALUE="all" SELECTED> All entries\n);
6705} else {
6706 print qq(<OPTION VALUE="all"> All entries\n);
6707}
6708
6709print 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 variables—check the manual for more information on those. If "ascending", the links will be listed from newest to oldest, with the newest entry at the top; if "descending", from first to last, with the first entry at the top.</FONT></FONT></TD>);
6710
6711if ($entrylistsortorder eq "ascending") {
6712 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedentrylistsortorder" VALUE="ascending" CHECKED> Ascending   <INPUT TYPE=RADIO NAME="editedentrylistsortorder" VALUE="descending"> Descending</FONT></TD></TR>\n);
6713} else {
6714 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedentrylistsortorder" VALUE="ascending"> Ascending   <INPUT TYPE=RADIO NAME="editedentrylistsortorder" VALUE="descending" CHECKED> Descending</FONT></TD></TR>\n);
6715}
6716
6717print 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 <a href="http://www.greymatterforums.com/info/manual.html" title="read the manual" target="_blank">manual</a> 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);
6718
6719print 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 <a href="http://www.greymatterforums.com/info/manual.html" title="read the manual" target="_blank">manual</a> for more information), this specifies whether to list only entries to which comments can still be posted.</FONT></FONT></TD>);
6720
6721if ($commententrylistonlyifokay eq "yes") {
6722 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedcommententrylistonlyifokay" VALUE="yes" CHECKED> Yes   <INPUT TYPE=RADIO NAME="editedcommententrylistonlyifokay" VALUE="no"> No</FONT></TD></TR>\n);
6723} else {
6724 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedcommententrylistonlyifokay" VALUE="yes"> Yes   <INPUT TYPE=RADIO NAME="editedcommententrylistonlyifokay" VALUE="no" CHECKED> No</FONT></TD></TR>\n);
6725}
6726
6727print 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>);
6728
6729if ($linktocalendarentries eq "all") {
6730 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);
6731} else {
6732 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);
6733}
6734
6735print 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>);
6736
6737if ($automaticrebuilddefault eq "yes") {
6738 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedautomaticrebuilddefault" VALUE="yes" CHECKED> Yes   <INPUT TYPE=RADIO NAME="editedautomaticrebuilddefault" VALUE="no"> No</FONT></TD></TR>\n);
6739} else {
6740 print qq(<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<INPUT TYPE=RADIO NAME="editedautomaticrebuilddefault" VALUE="yes"> Yes   <INPUT TYPE=RADIO NAME="editedautomaticrebuilddefault" VALUE="no" CHECKED> No</FONT></TD></TR>\n);
6741}
6742
6743print<<GMCONFIGMENUBOTTOM;
6744
6745</TABLE></TD></TR></TABLE>
6746<P>
6747<TABLE BORDER=0 cellpadding=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=10 CELLSPACING=0 BGCOLOR="#FFD0D0"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Diagnostics & Repair"></TD></TR></TABLE></TD></TR></TABLE>
6748<P>
6749<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">
6750<P>
6751<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0">
6752
6753</FORM>
6754<P>
6755<FONT SIZE=1>"It's better to change your shoes than to carpet the world."—Stuart Smalley</FONT>
6756$gmframebottom
6757
6758</BODY>
6759</HTML>
6760
6761GMCONFIGMENUBOTTOM
6762
6763$statusnote = "";
6764
6765exit;
6766
6767}
6768
6769# ----------------
6770# save config file
6771# ----------------
6772
6773sub gm_saveconfiguration {
6774
6775&gm_validate;
6776
6777if ($gmconfigurationaccess ne "yes") {
6778 &gm_writetocplog("$IN{'authorname'} attempted to save changes to the config file without authorization");
6779 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to change the config file.</FONT></B><P>);
6780 &gm_frontpage;
6781}
6782
6783chomp ($IN{'editedcensorlist'});
6784$IN{'editedcensorlist'} = &relouse($IN{'editedcensorlist'});
6785chomp ($IN{'editedotherfilelist'});
6786$IN{'editedotherfilelist'} = &relouse($IN{'editedotherfilelist'});
6787
6788$IN{'editedlogpath'} = &configdelouse($IN{'editedlogpath'});
6789$IN{'editedentriespath'} = &configdelouse($IN{'editedentriespath'});
6790$IN{'editedlogwebpath'} = &configdelouse($IN{'editedlogwebpath'});
6791$IN{'editedentrieswebpath'} = &configdelouse($IN{'editedentrieswebpath'});
6792$IN{'editednotifyemail'} = &configdelouse($IN{'editednotifyemail'});
6793$IN{'editedindexfilename'} = &configdelouse($IN{'editedindexfilename'});
6794$IN{'editedentrysuffix'} = &configdelouse($IN{'editedentrysuffix'});
6795$IN{'editedindexdays'} = &configdelouse($IN{'editedindexdays'});
6796$IN{'editedoffsettime'} = &configdelouse($IN{'editedoffsettime'});
6797$IN{'editedtimezone'} = &configdelouse($IN{'editedtimezone'});
6798$IN{'editedmailprog'} = &configdelouse($IN{'editedmailprog'});
6799$IN{'editedcgilocalpath'} = &configdelouse($IN{'editedcgilocalpath'});
6800$IN{'editedcgiwebpath'} = &configdelouse($IN{'editedcgiwebpath'});
6801$IN{'editedemoticonspath'} = &configdelouse($IN{'editedemoticonspath'});
6802$IN{'editedentrylistcountnumber'} = &configdelouse($IN{'editedentrylistcountnumber'});
6803$IN{'editedlogarchivesuffix'} = &configdelouse($IN{'editedlogarchivesuffix'});
6804
6805$IN{'editedcensorlist'} =~ s/^\s+//;
6806$IN{'editedcensorlist'} =~ s/\s+$//;
6807$IN{'editedotherfilelist'} =~ s/^\s+//;
6808$IN{'editedotherfilelist'} =~ s/^\s+//;
6809
6810$IN{'editedentrysuffix'} =~ s/\.//g;
6811$IN{'editednotifyemail'} =~ s/ //g;
6812$IN{'editedlogarchivesuffix'} =~ s/\.//g;
6813
6814if (($IN{'editedlogpath'} eq "") || ($IN{'editedentriespath'} eq "") || ($IN{'editedlogwebpath'} eq "") || ($IN{'editedentrieswebpath'} eq "") || ($IN{'editedindexfilename'} eq "") || ($IN{'editedentrysuffix'} eq "") || ($IN{'editedindexdays'} eq "") || ($IN{'editedoffsettime'} eq "") || ($IN{'editedtimezone'} eq "") || ($IN{'editedcgilocalpath'} eq "") || ($IN{'editedcgiwebpath'} eq "") || ($IN{'editedentrylistcountnumber'} eq "") || ($IN{'editedlogarchivesuffix'} eq "")) {
6815 $statusnote = qq(<B><FONT COLOR="#FF0000">You left one or more of the required fields blank. Please try again.</FONT></B><P>);
6816 &gm_configuration;
6817}
6818
6819if ($IN{'editedindexdays'} =~ /\D/) {
6820 $statusnote = qq(<B><FONT COLOR="#FF0000">"Days to keep on main index" must be a number.</FONT></B><P>);
6821 &gm_configuration;
6822}
6823
6824if ($IN{'editedoffsettime'} =~ /[^0-9.-]/) {
6825 $statusnote = qq(<B><FONT COLOR="#FF0000">"Server Offset Time" must be a number.</FONT></B><P>);
6826 &gm_configuration;
6827}
6828
6829if ($IN{'editeduploadfilesizelimit'} eq "") { $IN{'editeduploadfilesizelimit'} = 0; }
6830
6831if ($IN{'editeduploadfilesizelimit'} =~ /\D/) {
6832 $statusnote = qq(<B><FONT COLOR="#FF0000">"Maximum Filesize Allowed" must be a number.</FONT></B><P>);
6833 &gm_configuration;
6834}
6835
6836if (($IN{'editednotifyemail'} ne "") && ($IN{'editedmailprog'} eq "")) {
6837 $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>);
6838 &gm_configuration;
6839}
6840
6841if (($IN{'editednotifyemail'} eq "") && ($IN{'editednotifyforstatus'} ne "neither")) {
6842 $statusnote = qq(<B><FONT COLOR="#FF0000">You must give an e-mail address to receive e-mail notifications.</FONT></B><P>);
6843 &gm_configuration;
6844}
6845
6846if ($IN{'editedentrylistcountnumber'} =~ /\D/) {
6847 $statusnote = qq(<B><FONT COLOR="#FF0000">"Log entry list variable number" must be a number.</FONT></B><P>);
6848 &gm_configuration;
6849}
6850
6851$IN{'editeduploadfilesallowed'} =~ s/;/SEMICOLON/g;
6852
6853if ($IN{'editeduploadfilesallowed'} =~ /\W/) {
6854 $statusnote = qq(<B><FONT COLOR="#FF0000">"Allowed File Types" must only contain alphanumeric characters (besides semicolons).</FONT></B><P>);
6855 &gm_configuration;
6856}
6857
6858$IN{'editeduploadfilesallowed'} =~ s/SEMICOLON/;/g;
6859
6860if ($IN{'editedindexdays'} < 1) {
6861 $statusnote = qq(<B><FONT COLOR="#FF0000">"Days to keep on main index" must be set to at least one!</FONT></B><P>);
6862 &gm_configuration;
6863}
6864
6865if (substr($IN{'editedlogpath'}, -1) eq "/") { chop ($IN{'editedlogpath'}) };
6866if (substr($IN{'editedentriespath'}, -1) eq "/") { chop ($IN{'editedentriespath'}) };
6867if (substr($IN{'editedcgilocalpath'}, -1) eq "/") { chop ($IN{'editedcgilocalpath'}) };
6868if (substr($IN{'editedlogwebpath'}, -1) eq "/") { chop ($IN{'editedlogwebpath'}) };
6869if (substr($IN{'editedentrieswebpath'}, -1) eq "/") { chop ($IN{'editedentrieswebpath'}) };
6870if (substr($IN{'editedcgiwebpath'}, -1) eq "/") { chop ($IN{'editedcgiwebpath'}) };
6871if (substr($IN{'editedemoticonspath'}, -1) eq "/") { chop ($IN{'editedemoticonspath'}) };
6872
6873open (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.");
6874print FUNNYFEET "$IN{'editedlogpath'}\n";
6875print FUNNYFEET "$IN{'editedentriespath'}\n";
6876print FUNNYFEET "$IN{'editedlogwebpath'}\n";
6877print FUNNYFEET "$IN{'editedentrieswebpath'}\n";
6878print FUNNYFEET "$IN{'editednotifyemail'}\n";
6879print FUNNYFEET "$IN{'editedindexfilename'}\n";
6880print FUNNYFEET "$IN{'editedentrysuffix'}\n";
6881print FUNNYFEET "$IN{'editedindexdays'}\n";
6882print FUNNYFEET "$IN{'editedoffsettime'}\n";
6883print FUNNYFEET "$IN{'editedtimezone'}\n";
6884print FUNNYFEET "$IN{'editedkeeplog'}\n";
6885print FUNNYFEET "$IN{'editedposttoarchives'}\n";
6886print FUNNYFEET "$IN{'editedallowkarmadefault'}\n";
6887print FUNNYFEET "$IN{'editedallowcommentsdefault'}\n";
6888print FUNNYFEET "$IN{'editedcommentsorder'}\n";
6889print FUNNYFEET "$IN{'editedgenerateentrypages'}\n";
6890print FUNNYFEET "$IN{'editedallowhtmlincomments'}\n";
6891print FUNNYFEET "$IN{'editedlogkarmaandcomments'}\n";
6892print FUNNYFEET "$IN{'editedmailprog'}\n";
6893print FUNNYFEET "$IN{'editednotifyforstatus'}\n";
6894print FUNNYFEET "$IN{'editedautolinkurls'}\n";
6895print FUNNYFEET "$IN{'editedstriplinesfromcomments'}\n";
6896print FUNNYFEET "$IN{'editedallowmultiplekarmavotes'}\n";
6897print FUNNYFEET "$gmversion\n";
6898print FUNNYFEET "$IN{'editedcgilocalpath'}\n";
6899print FUNNYFEET "$IN{'editedcgiwebpath'}\n";
6900print FUNNYFEET "$IN{'editedconcurrentmainandarchives'}\n";
6901print FUNNYFEET "$IN{'editedkeeparchivemasterindex'}\n";
6902print FUNNYFEET "$IN{'editedentrylistsortorder'}\n";
6903print FUNNYFEET "$IN{'editedallowkarmaorcomments'}\n";
6904print FUNNYFEET "$IN{'editedentrylistcountnumber'}\n";
6905print FUNNYFEET "$IN{'editedcookiesallowed'}\n";
6906print FUNNYFEET "$IN{'editedlogarchivesuffix'}\n";
6907print FUNNYFEET "$IN{'editedcensorlist'}\n";
6908print FUNNYFEET "$IN{'editedcensorenabled'}\n";
6909print FUNNYFEET "$IN{'editedkeepmonthlyarchives'}\n";
6910print FUNNYFEET "$IN{'editeddefaultentrylistview'}\n";
6911print FUNNYFEET "$IN{'editedlinktocalendarentries'}\n";
6912print FUNNYFEET "$IN{'editedautomaticrebuilddefault'}\n";
6913print FUNNYFEET "$IN{'editedcommententrylistonlyifokay'}\n";
6914print FUNNYFEET "$IN{'editedotherfilelist'}\n";
6915print FUNNYFEET "$IN{'editedotherfilelistentryrebuild'}\n";
6916print FUNNYFEET "$IN{'editedarchiveformat'}\n";
6917print FUNNYFEET "$IN{'editedinlineformatting'}\n";
6918print FUNNYFEET "$IN{'editeduploadfilesallowed'}\n";
6919print FUNNYFEET "$IN{'editeduploadfilesizelimit'}\n";
6920print FUNNYFEET "$IN{'editedemoticonspath'}\n";
6921print FUNNYFEET "$IN{'editedkeepphphacklog'}\n";
6922print FUNNYFEET "$IN{'editedmailhacknotice'}\n";
6923print FUNNYFEET "$IN{'editedemoticonsallowed'}\n";
6924close (FUNNYFEET);
6925
6926if (($keeplog eq "no") && ($IN{'editedkeeplog'} eq "yes")) {
6927 &date;
6928 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.");
6929 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";
6930 close (FUNNYFEET);
6931}
6932
6933if ($IN{'editedkeeplog'} eq "no") {
6934 &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");
6935} else {
6936 &gm_writetocplog("$IN{'authorname'} edited the config file");
6937}
6938
6939$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>);
6940
6941if ($IN{'editeddeletecookies'} eq "yes") {
6942 $statusnote .= "\n<SCRIPT TYPE=\"text/javascript\" LANGUAGE=\"JavaScript\">\n<!--//\ndeleteCookie(\"gmcookiename\");\ndeleteCookie(\"gmcookiepw\");\n//-->\n</SCRIPT>";
6943}
6944
6945&gm_frontpage;
6946
6947}
6948
6949# -------------------
6950# edit banned ip list
6951# -------------------
6952
6953sub gm_editbanlist {
6954
6955&gm_validate;
6956
6957if ($gmconfigurationaccess ne "yes") {
6958 &gm_writetocplog("$IN{'authorname'} attempted to edit the ban list without authorization");
6959 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the ban list.</FONT></B><P>);
6960 &gm_frontpage;
6961}
6962
6963if ($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>); }
6964
6965print<<GMBANLISTMENUTOP;
6966
6967$gmheadtag
6968
6969$gmframetop
6970$statusnote
6971<FORM ACTION="gm.cgi" METHOD=POST>
6972<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
6973<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
6974<SELECT CLASS="selectlist" NAME="editedbanlist" SIZE=10>
6975
6976GMBANLISTMENUTOP
6977
6978open (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.");
6979@gmbanlist = <FUNNYFEET>;
6980close (FUNNYFEET);
6981
6982foreach $gmbanlistline (@gmbanlist) {
6983 chomp ($gmbanlistline);
6984 $gmbanlistline =~ s/</\</g;
6985 $gmbanlistline =~ s/>/\>/g;
6986 $gmbanlistline =~ s/"/\"/g;
6987 ($gmbannedip, $gmbannediphost, $gmbannedperson) = split (/\|/, $gmbanlistline);
6988 print qq(<OPTION VALUE="$gmbanlistline">$gmbannedip/$gmbannediphost);
6989 if ($gmbannedperson ne "") { print " ($gmbannedperson)"; }
6990 print "\n";
6991}
6992
6993print<<GMBANLISTMENUBOTTOM;
6994
6995</SELECT>
6996<P>
6997New IP to ban: <INPUT TYPE=TEXT CLASS="textinput" MAXLENGTH=15 NAME="editednewbannedip" SIZE=15>
6998<BR>
6999Banned person's name (optional): <INPUT TYPE=TEXT CLASS="textinput" NAME="editednewbannedperson" SIZE=15>
7000<P>
7001<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">
7002<P>
7003<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0">
7004</FORM>
7005<P>
7006<FONT SIZE=1>
7007"Why have those banish'd and forbidden legs dared once
7008<BR>
7009to touch a dust of England's ground?"—Shakespeare
7010</FONT>
7011$gmframebottom
7012
7013</BODY>
7014</HTML>
7015
7016GMBANLISTMENUBOTTOM
7017
7018$statusnote = "";
7019
7020exit;
7021
7022}
7023
7024# -------------------------
7025# add an ip to the ban list
7026# -------------------------
7027
7028sub gm_addbannedip {
7029
7030&gm_validate;
7031
7032if ($gmconfigurationaccess ne "yes") {
7033 &gm_writetocplog("$IN{'authorname'} attempted to add an IP ($IN{'editednewbannedip'}) to the ban list without authorization");
7034 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to add an IP to the ban list.</FONT></B><P>);
7035 &gm_frontpage;
7036}
7037
7038$IN{'editednewbannedip'} =~ s/\n//g;
7039$IN{'editednewbannedip'} =~ s/\|//g;
7040$IN{'editednewbannedperson'} =~ s/\n//g;
7041$IN{'editednewbannedperson'} =~ s/\|//g;
7042
7043if ($IN{'editednewbannedip'} eq "") {
7044 $statusnote = qq(<B><FONT COLOR="#FF0000">You must enter the IP you want to add to the ban list.</FONT></B><P>);
7045 &gm_editbanlist;
7046}
7047
7048open (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.");
7049@gmbanlist = <FUNNYFEET>;
7050close (FUNNYFEET);
7051
7052$gmcounter = 0;
7053
7054foreach (@gmbanlist) {
7055 chomp ($gmbanlist[$gmcounter]);
7056 ($checkthisip, $checkthisiphost, $checkthisperson) = split (/\|/, $gmbanlist[$gmcounter]);
7057 if ($checkthisip eq $IN{'editednewbannedip'}) {
7058 $statusnote = qq(<B><FONT COLOR="#FF0000">That IP is already in the ban list.</FONT></B><P>);
7059 &gm_editbanlist;
7060 }
7061 $gmcounter++;
7062}
7063
7064$newbannediphost = $IN{'editednewbannedip'};
7065
7066$gmbanlist[$gmcounter] = "$IN{'editednewbannedip'}|$newbannediphost|$IN{'editednewbannedperson'}";
7067
7068@gmbanlistsorted = sort { $a <=> $b } @gmbanlist;
7069
7070open (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.");
7071foreach $gmnewbanlistline (@gmbanlistsorted) { print FUNNYFEET "$gmnewbanlistline\n"; }
7072close (FUNNYFEET);
7073
7074if ($keeplog eq "yes") {
7075 &date;
7076 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.");
7077 print FUNNYFEET "<FONT SIZE=1>[$basedate] [$authorIP]</FONT> $IN{'authorname'} added an IP ($IN{'editednewbannedip'}";
7078 if ($IN{'editednewbannedperson'} ne "") { print FUNNYFEET ", \"$IN{'editednewbannedperson'}\""; }
7079 print FUNNYFEET ") to the ban list\n";
7080 close (FUNNYFEET);
7081}
7082
7083$statusnote = qq(<B><FONT COLOR="#0000FF">$IN{'editednewbannedip'} has been added to the ban list.</FONT></B><P>);
7084&gm_editbanlist;
7085
7086}
7087
7088# ------------------------------
7089# delete an ip from the ban list
7090# ------------------------------
7091
7092sub gm_deletebannedip {
7093
7094&gm_validate;
7095
7096if ($gmconfigurationaccess ne "yes") {
7097 &gm_writetocplog("$IN{'authorname'} attempted to delete an IP ($IN{'editedbanlist'}) to the ban list without authorization");
7098 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to delete an IP from the ban list.</FONT></B><P>);
7099 &gm_frontpage;
7100}
7101
7102chomp($IN{'editedbanlist'});
7103
7104if ($IN{'editedbanlist'} eq "") {
7105 $statusnote = qq(<B><FONT COLOR="#FF0000">You must select the IP you want to delete from the ban list.</FONT></B><P>);
7106 &gm_editbanlist;
7107}
7108
7109open (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.");
7110@gmbanlist = <FUNNYFEET>;
7111close (FUNNYFEET);
7112
7113$deletedthisbannedip = "";
7114$deletedthisbannediphost = "";
7115$deletedthisbannedperson = "";
7116
7117open (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.");
7118foreach $gmbanlistline (@gmbanlist) {
7119 chomp($gmbanlistline);
7120 if ($gmbanlistline eq $IN{'editedbanlist'}) {
7121 ($checkthisip, $checkthisiphost, $checkthisperson) = split (/\|/, $gmbanlistline);
7122 $deletedthisbannedip = $checkthisip;
7123 $deletedthisbannediphost = $checkthisiphost;
7124 $deletedthisbannedperson = $checkthisperson;
7125 }
7126 if ($gmbanlistline ne $IN{'editedbanlist'}) { print FUNNYFEET "$gmbanlistline\n"; }
7127}
7128close (FUNNYFEET);
7129
7130if ($keeplog eq "yes") {
7131 &date;
7132 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.");
7133 print FUNNYFEET "<FONT SIZE=1>[$basedate] [$authorIP]</FONT> $IN{'authorname'} deleted an IP ($deletedthisbannedip";
7134 if ($deletedthisbannedperson ne "") { print FUNNYFEET ", \"$deletedthisbannedperson\""; }
7135 print FUNNYFEET ") from the ban list\n";
7136 close (FUNNYFEET);
7137}
7138
7139$statusnote = qq(<B><FONT COLOR="#0000FF">$deletedthisbannedip has been deleted from the ban list.</FONT></B><P>);
7140&gm_editbanlist;
7141
7142}
7143
7144# ---------------
7145# add a new entry
7146# ---------------
7147
7148sub gm_addentry {
7149
7150&gm_validate;
7151
7152if ($gmentryaccess ne "yes") {
7153 &gm_writetocplog("$IN{'authorname'} attempted to add an entry without authorization");
7154 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to add entries.</FONT></B><P>);
7155 &gm_frontpage;
7156}
7157
7158&gm_readcounter;
7159
7160if ($newentrynumber eq "0") {
7161 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.");
7162 @cploglines = <FUNNYFEET>;
7163 close (FUNNYFEET);
7164 $cplogtext = join (" ", @cploglines);
7165 unless ($cplogtext =~ /successfully performed diagnostics/) {
7166 $statusnote = qq(<B><FONT COLOR="#FF0000">Please run "Diagnostics & Repair" in the Configuration screen before posting your first entry.</FONT></B><P>);
7167 &gm_frontpage;
7168 }
7169}
7170
7171if ($statusnote eq "") {
7172 $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>);
7173}
7174
7175if ($IN{'newentrysubject'} ne "") { $IN{'newentrysubject'} = &delouse($IN{'newentrysubject'}); }
7176if ($IN{'newentrymaintext'} ne "") { $IN{'newentrymaintext'} = &delouse($IN{'newentrymaintext'}); }
7177if ($IN{'newentrymoretext'} ne "") { $IN{'newentrymoretext'} = &delouse($IN{'newentrymoretext'}); }
7178
7179# emoticons code display added by flipped cracker 9/17/2003
7180# merged into version 1.3
7181&gm_emoticons_code;
7182# merged 9/17/2003
7183
7184print<<GMADDENTRYTOP;
7185
7186$gmheadtagtwo
7187
7188$gmframetop
7189$statusnote
7190<script language="JavaScript">
7191function commentEmoticonMain(code)
7192{
7193 var cache = document.entryadd.newentrymaintext.value;
7194
7195 document.entryadd.newentrymaintext.value = cache + " " + code;
7196 document.entryadd.newentrymaintext.focus();
7197}
7198function commentEmoticonMore(code)
7199{
7200 var cache = document.entryadd.newentrymoretext.value;
7201
7202 document.entryadd.newentrymoretext.value = cache + " " + code;
7203 document.entryadd.newentrymoretext.focus();
7204}
7205</script>
7206<FORM ACTION="gm.cgi" METHOD=POST name="entryadd">
7207<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
7208<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
7209<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0><TR><TD ALIGN=RIGHT>$gmfonttag<b>Subject:</b></FONT></TD><TD ALIGN=LEFT></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="newentrysubject" VALUE="$IN{'newentrysubject'}" SIZE=50 STYLE="width: 550">$gmfonttag</TD></TR></TABLE>
7210<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0><TR><TD ALIGN=RIGHT>$gmfonttag<b>Music:</b></FONT></TD><TD ALIGN=LEFT></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="newentrymusic" VALUE="$IN{'newentrymusic'}" SIZE=45 STYLE="width: 550">$gmfonttag</TD></TR></TABLE>
7211<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0><TR><TD ALIGN=RIGHT>$gmfonttag<b>Mood:</b></FONT></TD><TD ALIGN=LEFT></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="newentrymood" VALUE="$IN{'newentrymood'}" SIZE=45 STYLE="width: 550">$gmfonttag</TD></TR></TABLE>
7212<P>
7213<b>Main Entry Text</b>
7214<BR>
7215</FONT>
7216<table>
7217<tr valign="top">
7218$emoticonsmaincode
7219 <td><TEXTAREA NAME="newentrymaintext" COLS=86 ROWS=15 WRAP=VIRTUAL STYLE="width: 720">$IN{'newentrymaintext'}</TEXTAREA></td>
7220</tr>
7221</table>
7222$gmfonttag<P>
7223<b>Extended ("More") Entry Text—Optional</b>
7224<BR>
7225</FONT>
7226<table>
7227<tr valign="top">
7228 $emoticonsmorecode
7229 <td><TEXTAREA NAME="newentrymoretext" COLS=86 ROWS=15 WRAP=VIRTUAL STYLE="width: 720">$IN{'newentrymoretext'}</TEXTAREA>
7230 </td>
7231</tr>
7232</table>
7233$gmfonttag<P>
7234<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
7235<!--//
7236if ((parseInt(navigator.appVersion) >= 4) && (navigator.appName == "Microsoft Internet Explorer")) {
7237 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>");
7238}
7239//-->
7240</SCRIPT>
7241<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>
7242<P>
7243
7244GMADDENTRYTOP
7245
7246if (($allowkarmaorcomments eq "karma") || ($allowkarmaorcomments eq "both")) {
7247 print qq(Allow karma voting on this entry: );
7248 if ($allowkarmadefault eq "yes") {
7249 print qq(<INPUT TYPE=RADIO NAME="newentryallowkarma" VALUE="yes" CHECKED> Yes <INPUT TYPE=RADIO NAME="newentryallowkarma" VALUE="no"> No\n);
7250 } else {
7251 print qq(<INPUT TYPE=RADIO NAME="newentryallowkarma" VALUE="yes"> Yes <INPUT TYPE=RADIO NAME="newentryallowkarma" VALUE="no" CHECKED> No\n);
7252 }
7253} else {
7254 print qq(<INPUT TYPE=HIDDEN NAME="newentryallowkarma" VALUE="no">\n);
7255}
7256
7257if ($allowkarmaorcomments eq "both") { print "<BR>\n"; }
7258
7259# emoticons options added by flipped cracker 9/17/2003
7260# merged in version 1.3
7261if (($emoticonsallowed eq "entries") || ($emoticonsallowed eq "both")) {
7262 print qq(Allow emoticons to be used in this entry: <INPUT TYPE=RADIO NAME="newentryemoticonsallowed" VALUE="yes" CHECKED> Yes <INPUT TYPE=RADIO NAME="newentryemoticonsallowed" VALUE="no"> No\n<BR>\n);
7263} else {
7264 print qq(<INPUT TYPE=HIDDEN NAME="newentryemoticonsallowed" VALUE="no">\n);
7265}
7266#merged 9/17/2003
7267
7268if (($allowkarmaorcomments eq "comments") || ($allowkarmaorcomments eq "both")) {
7269 print qq(Allow comments to be posted to this entry: );
7270 if ($allowcommentsdefault eq "yes") {
7271 print qq(<INPUT TYPE=RADIO NAME="newentryallowcomments" VALUE="yes" CHECKED> Yes <INPUT TYPE=RADIO NAME="newentryallowcomments" VALUE="no"> No\n);
7272 } else {
7273 print qq(<INPUT TYPE=RADIO NAME="newentryallowcomments" VALUE="yes"> Yes <INPUT TYPE=RADIO NAME="newentryallowcomments" VALUE="no" CHECKED> No\n);
7274 }
7275} else {
7276 print qq(<INPUT TYPE=HIDDEN NAME="newentryallowcomments" VALUE="no">\n);
7277}
7278
7279print<<GMADDENTRYBOTTOM;
7280
7281<BR>
7282Keep 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
7283<P>
7284<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">
7285<P>
7286<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0">
7287</FORM>
7288<P>
7289<FONT SIZE=1>"You must have chaos in your soul to give birth to a dancing star."—Friedrich Nietzsche</FONT>
7290$gmframebottom
7291
7292</BODY>
7293</HTML>
7294
7295GMADDENTRYBOTTOM
7296
7297exit;
7298
7299}
7300
7301# -------------------------------
7302# add a new entry - popup version
7303# -------------------------------
7304
7305sub gm_addentrypopup {
7306
7307&gm_validate;
7308
7309if (($gmentryaccess ne "yes") || ($gmbookmarkletaccess ne "yes")) {
7310 &gm_writetocplog("$IN{'authorname'} attempted to add an entry via popup without authorization");
7311 $statusnote = qq(<b><font color="#FF0000">You don't have access to add entries via the popup window.</FONT></b><P>);
7312 &gm_frontpage;
7313}
7314
7315&gm_readcounter;
7316
7317if ($newentrynumber eq "0") {
7318 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.");
7319 @cploglines = <FUNNYFEET>;
7320 close (FUNNYFEET);
7321 $cplogtext = join (" ", @cploglines);
7322 unless ($cplogtext =~ /successfully performed diagnostics/) {
7323 $statusnote = qq(<b><font color="#FF0000">Please run "Diagnostics & Repair" in the Configuration screen before posting your first entry.</FONT></b><P>);
7324 &gm_frontpage;
7325 }
7326}
7327
7328if ($statusnote eq "") {
7329 $statusnote = qq(<b><font color="#000000">Greymatter Pop-Up Posting Window</FONT></b><P>);
7330}
7331
7332$popupincludetext = qq(<A HREF="$IN{'loglink'}">$IN{'loglinktitle'}</A>);
7333
7334if ($IN{'logtext'} ne "") { $popupincludetext .= "\n\n$IN{'logtext'}"; }
7335
7336if ($IN{'newentrysubject'} ne "") { $IN{'newentrysubject'} = &delouse($IN{'newentrysubject'}); }
7337if ($IN{'newentrymaintext'} ne "") {
7338 $IN{'newentrymaintext'} = &delouse($IN{'newentrymaintext'});
7339} else {
7340 $IN{'newentrymaintext'} = $popupincludetext;
7341}
7342if ($IN{'newentrymoretext'} ne "") { $IN{'newentrymoretext'} = &delouse($IN{'newentrymoretext'}); }
7343
7344
7345# emoticons code display added by flipped cracker 9/17/2003
7346# merged into version 1.3
7347&gm_emoticons_code;
7348# merged 9/17/2003
7349
7350print<<GMADDENTRYPOPUPTOP;
7351
7352$gmheadtagtwo
7353$gmframetoptwo
7354$statusnote
7355<script language="JavaScript">
7356function commentEmoticonMain(code)
7357{
7358 var cache = document.entryadd.newentrymaintext.value;
7359
7360 document.entryadd.newentrymaintext.value = cache + " " + code;
7361 document.entryadd.newentrymaintext.focus();
7362}
7363function commentEmoticonMore(code)
7364{
7365 var cache = document.entryadd.newentrymoretext.value;
7366
7367 document.entryadd.newentrymoretext.value = cache + " " + code;
7368 document.entryadd.newentrymoretext.focus();
7369}
7370</script>
7371<FORM ACTION="gm.cgi" METHOD=POST name="entryadd">
7372<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
7373<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
7374<INPUT TYPE=HIDDEN NAME="gmbmspecial" VALUE="popupblog">
7375<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0><TR><TD ALIGN=RIGHT>$gmfonttag<b>Subject:</b></FONT></TD><TD ALIGN=LEFT></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="newentrysubject" VALUE="$IN{'newentrysubject'}" SIZE=25 STYLE="width: 450">$gmfonttag</TD></TR></TABLE>
7376<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0><TR><TD ALIGN=RIGHT>$gmfonttag<b>Music:</b></FONT></TD><TD ALIGN=LEFT></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="newentrymusic" VALUE="$IN{'newentrymusic'}" SIZE=45 STYLE="width: 450">$gmfonttag</TD></TR></TABLE>
7377<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0><TR><TD ALIGN=RIGHT>$gmfonttag<b>Mood:</b></FONT></TD><TD ALIGN=LEFT></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="newentrymood" VALUE="$IN{'newentrymood'}" SIZE=45 STYLE="width: 450">$gmfonttag</TD></TR></TABLE>
7378<P>
7379<b>Main Entry Text</b>
7380<BR>
7381</FONT>
7382<table>
7383<tr valign="top">
7384$emoticonsmaincode
7385 <td><TEXTAREA NAME="newentrymaintext" COLS=50 ROWS=12 WRAP=VIRTUAL STYLE="width: 590">$IN{'newentrymaintext'}</TEXTAREA></td>
7386</tr>
7387</table>
7388$gmfonttag<P>
7389<b>Extended ("More") Entry Text—Optional</b>
7390<BR>
7391</FONT>
7392<table>
7393<tr valign="top">
7394 $emoticonsmorecode
7395 <td><TEXTAREA NAME="newentrymoretext" COLS=50 ROWS=12 WRAP=VIRTUAL STYLE="width: 590">$IN{'newentrymoretext'}</TEXTAREA>
7396 </td>
7397</tr>
7398</table>
7399<P>
7400<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
7401<!--//
7402if ((parseInt(navigator.appVersion) >= 4) && (navigator.appName == "Microsoft Internet Explorer")) {
7403 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>");
7404}
7405//-->
7406</SCRIPT>
7407<P>
7408
7409GMADDENTRYPOPUPTOP
7410
7411if (($allowkarmaorcomments eq "karma") || ($allowkarmaorcomments eq "both")) {
7412 print qq(Allow karma voting on this entry: );
7413 if ($allowkarmadefault eq "yes") {
7414 print qq(<INPUT TYPE=RADIO NAME="newentryallowkarma" VALUE="yes" CHECKED> Yes <INPUT TYPE=RADIO NAME="newentryallowkarma" VALUE="no"> No\n);
7415 } else {
7416 print qq(<INPUT TYPE=RADIO NAME="newentryallowkarma" VALUE="yes"> Yes <INPUT TYPE=RADIO NAME="newentryallowkarma" VALUE="no" CHECKED> No\n);
7417 }
7418} else {
7419 print qq(<INPUT TYPE=HIDDEN NAME="newentryallowkarma" VALUE="no">\n);
7420}
7421
7422if ($allowkarmaorcomments eq "both") { print "<BR>\n"; }
7423
7424# emoticons options added by flipped cracker 9/17/2003
7425# merged in version 1.3
7426if (($emoticonsallowed eq "entries") || ($emoticonsallowed eq "both")) {
7427 print qq(Allow emoticons to be used in this entry: <INPUT TYPE=RADIO NAME="newentryemoticonsallowed" VALUE="yes" CHECKED> Yes <INPUT TYPE=RADIO NAME="newentryemoticonsallowed" VALUE="no"> No\n<BR>\n);
7428} else {
7429 print qq(<INPUT TYPE=HIDDEN NAME="newentryemoticonsallowed" VALUE="no">\n);
7430}
7431# merged 9/17/2003
7432
7433if (($allowkarmaorcomments eq "comments") || ($allowkarmaorcomments eq "both")) {
7434 print qq(Allow comments to be posted to this entry: );
7435 if ($allowcommentsdefault eq "yes") {
7436 print qq(<INPUT TYPE=RADIO NAME="newentryallowcomments" VALUE="yes" CHECKED> Yes <INPUT TYPE=RADIO NAME="newentryallowcomments" VALUE="no"> No\n);
7437 } else {
7438 print qq(<INPUT TYPE=RADIO NAME="newentryallowcomments" VALUE="yes"> Yes <INPUT TYPE=RADIO NAME="newentryallowcomments" VALUE="no" CHECKED> No\n);
7439 }
7440} else {
7441 print qq(<INPUT TYPE=HIDDEN NAME="newentryallowcomments" VALUE="no">\n);
7442}
7443
7444print<<GMADDENTRYPOPUPBOTTOM;
7445
7446<BR>
7447Keep 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
7448<P>
7449<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">
7450</FORM>
7451$gmframebottomtwo
7452
7453</BODY>
7454</HTML>
7455
7456GMADDENTRYPOPUPBOTTOM
7457
7458exit;
7459
7460}
7461
7462# ----------------------------
7463# preview entry before posting
7464# ----------------------------
7465
7466sub gm_previewentry {
7467
7468&gm_validate;
7469
7470if ($gmentryaccess ne "yes") {
7471 &gm_writetocplog("$IN{'authorname'} attempted to add an entry without authorization");
7472 $statusnote = qq(<b><font color="#FF0000">You don't have access to add entries.</FONT></b><P>);
7473 &gm_frontpage;
7474}
7475
7476$newentrysubject = &relouse($IN{'newentrysubject'});
7477$newentrymaintext = &relouse($IN{'newentrymaintext'});
7478$newentrymoretext = &relouse($IN{'newentrymoretext'});
7479$newentrymusic = &relouse($IN{'newentrymusic'});
7480$newentrymood = &relouse($IN{'newentrymood'});
7481
7482$newentrysubjectdeloused = &delouse($newentrysubject);
7483$newentrymaintextdeloused = &delouse($newentrymaintext);
7484$newentrymoretextdeloused = &delouse($newentrymoretext);
7485$newentrymusicdeloused = &delouse($newentrymusic);
7486$newentrymooddeloused = &delouse($newentrymood);
7487
7488$newentrysubjectdeloused =~ s/\n/\|\*\|/g;
7489$newentrymaintextdeloused =~ s/\n/\|\*\|/g;
7490$newentrymoretextdeloused =~ s/\n/\|\*\|/g;
7491$newentrymusicdeloused =~ s/\n/\|\*\|/g;
7492$newentrymooddeloused =~ s/\n/\|\*\|/g;
7493
7494$newentrymaintext =~ s/\|\*\|/<BR>/g;
7495$newentrymoretext =~ s/\|\*\|/<BR>/g;
7496$newentrymaintext =~ s/\n/<BR>/g;
7497$newentrymoretext =~ s/\n/<BR>/g;
7498$newentrymaintext =~ s/<BR><BR>/<\/P><P ALIGN=JUSTIFY>/g;
7499$newentrymoretext =~ s/<BR><BR>/<\/P><P ALIGN=JUSTIFY>/g;
7500
7501&gm_readcounter;
7502
7503unless ($newentrynumber < 1) {
7504 &gm_getentryvariables($newentrynumber);
7505 &gm_formatentry($newentrymaintext);
7506 $newentrymaintext = $entryreturn;
7507 unless ($newentrymoretext eq "") {
7508 &gm_formatentry($newentrymoretext);
7509 $newentrymoretext = $entryreturn;
7510 }
7511}
7512
7513$showmoretext = "";
7514if ($newentrymoretext ne "") { $showmoretext = "</P><P ALIGN=CENTER><CENTER>\n<B>[extended text]</B>\n</CENTER></P><P ALIGN=JUSTIFY>\n$newentrymoretext\n"; }
7515
7516if ($statusnote eq "") {
7517 if ($newentrysubject ne "") {
7518 $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>);
7519 } else {
7520 $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>);
7521 }
7522}
7523
7524print<<GMPREVIEWENTRY;
7525
7526$gmheadtag
7527
7528$gmframetop
7529$statusnote
7530<P ALIGN=JUSTIFY>
7531$newentrymaintext
7532$showmoretext
7533</P><P ALIGN=CENTER><CENTER>
7534<FORM ACTION="gm.cgi" METHOD=POST>
7535<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
7536<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
7537<INPUT TYPE=HIDDEN NAME="newentrysubject" VALUE="$newentrysubjectdeloused">
7538<INPUT TYPE=HIDDEN NAME="newentrymaintext" VALUE="$newentrymaintextdeloused">
7539<INPUT TYPE=HIDDEN NAME="newentrymoretext" VALUE="$newentrymoretextdeloused">
7540<INPUT TYPE=HIDDEN NAME="newentryallowkarma" VALUE="$IN{'newentryallowkarma'}">
7541<INPUT TYPE=HIDDEN NAME="newentryallowcomments" VALUE="$IN{'newentryallowcomments'}">
7542<INPUT TYPE=HIDDEN NAME="newentryemoticonsallowed" VALUE="$IN{'newentryemoticonsallowed'}">
7543<INPUT TYPE=HIDDEN NAME="newentrystayattop" VALUE="$IN{'newentrystayattop'}">
7544<INPUT TYPE=HIDDEN NAME="newentrymusic" VALUE="$IN{'newentrymusic'}">
7545<INPUT TYPE=HIDDEN NAME="newentrymood" VALUE="$IN{'newentrymood'}">
7546<INPUT TYPE=HIDDEN NAME="gmbmspecial" VALUE="$IN{'gmbmspecial'}">
7547<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Re-Edit This Entry"> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Add This Entry">
7548<P>
7549<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0">
7550</FORM>
7551<FONT SIZE=1>"The future is not something we enter. The future is something we create."—Leonard Sweet</FONT>
7552</CENTER></P>
7553$gmframebottom
7554
7555</BODY>
7556</HTML>
7557
7558GMPREVIEWENTRY
7559
7560exit;
7561
7562}
7563
7564# ------------------
7565# save the new entry
7566# ------------------
7567
7568sub gm_savenewentry {
7569
7570&gm_validate;
7571
7572if ($gmentryaccess ne "yes") {
7573 &gm_writetocplog("$IN{'authorname'} attempted to add an entry without authorization");
7574 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to add entries.</FONT></B><P>);
7575 &gm_frontpage;
7576}
7577
7578$IN{'newentrysubject'} = &relouse($IN{'newentrysubject'});
7579$IN{'newentrysubject'} = &configdelouse($IN{'newentrysubject'});
7580$IN{'newentrymaintext'} = &relouse($IN{'newentrymaintext'});
7581$IN{'newentrymoretext'} = &relouse($IN{'newentrymoretext'});
7582$IN{'newentrymusic'} = &relouse($IN{'newentrymusic'});
7583$IN{'newentrymood'} = &relouse($IN{'newentrymood'});
7584
7585if ($IN{'newentrymaintext'} eq "") {
7586 $statusnote = qq(<B><FONT COLOR="#FF0000">You left the main text field blank. Please try again.</FONT></B><P>);
7587 if ($IN{'gmbmspecial'} eq "popupblog") { &gm_addentrypopup; } else { &gm_addentry; }
7588}
7589
7590&gm_readcounter;
7591
7592$newentrynumber++;
7593
7594$newentrynumberpadded = sprintf ("%8d", $newentrynumber);
7595$newentrynumberpadded =~ tr/ /0/;
7596
7597&gm_readconfig;
7598&date;
7599
7600$basedate = "$montwo\/$mdaytwo\/$shortyear $hourtwo\:$mintwo $AMPM";
7601
7602open (CHECKIT, "$EntriesPath/$newentrynumberpadded.cgi") || ($numbercheck="good");
7603@gmchecklistor = <CHECKIT>;
7604if(@gmchecklistor[0] =~ /\|/) {$numbercheck="bugger";}
7605close (CHECKIT);
7606
7607if($numbercheck eq "bugger") {gm_dangermouse("Fatal Error, gm-counter likely to be disrupted. Please run a Diagnostics & Repair."); exit;} else {unlink ("$EntriesPath/$newentrynumberpadded.cgi");}
7608
7609open (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.");
7610print FUNNYFEET "$newentrynumber|$IN{'authorname'}|$IN{'newentrysubject'}|$wday|$mon|$mday|$JSYear|$hour|$min|$sec|$AMPM|0|0|0|$IN{'newentryallowkarma'}|$IN{'newentryallowcomments'}|open|$IN{'newentrymusic'}|$IN{'newentrymood'}|$IN{'newentryemoticonsallowed'}\n";
7611print FUNNYFEET "0.0.0.0|I\n";
7612print FUNNYFEET "$IN{'newentrymaintext'}\n";
7613print FUNNYFEET "$IN{'newentrymoretext'}\n";
7614close (FUNNYFEET);
7615
7616chmod (0666, "$EntriesPath/$newentrynumberpadded.cgi");
7617
7618open (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.");
7619@originalentrylist = <FUNNYFEET>;
7620close (FUNNYFEET);
7621
7622$newentrytempmorestatus = "N";
7623if ($IN{'newentrymoretext'} ne "") { $newentrytempmorestatus = "Y"; }
7624
7625open (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.");
7626print FUNNYFEET "$newentrynumber|$IN{'authorname'}|$IN{'newentrysubject'}|$montwo\/$mdaytwo\/$shortyear|$hourtwo\:$mintwo $AMPM|O|$newentrytempmorestatus|$IN{'newentrymusic'}|$IN{'newentrymood'}|$IN{'newentryemoticonsallowed'}\n";
7627foreach $originalentrylistline (@originalentrylist) {
7628 chomp ($originalentrylistline);
7629 print FUNNYFEET "$originalentrylistline\n";
7630}
7631close (FUNNYFEET);
7632
7633if ($IN{'newentrystayattop'} eq "yes") { $newstayattopnumber = $newentrynumber; }
7634
7635$newalltimeopenentriesnumber++;
7636
7637&gm_writecounter;
7638
7639if ($generateentrypages eq "yes") {
7640
7641 &gm_readconfig;
7642 &gm_getentryvariables($newentrynumber);
7643
7644 if ($thisentryopenstatus eq "open") {
7645 if ($thisentrymorebody ne "") {
7646 &gm_formatentry($gmmoreentrypagetemplate);
7647 } else {
7648 &gm_formatentry($gmentrypagetemplate);
7649 }
7650 open (THISFILE, ">$EntriesPath/$thisentrynumberpadded.$entrysuffix") || &gm_dangermouse("Can't write file to $EntriesPath/$thisentrynumberpadded.$entrysuffix - please run Diagnostics & Repair in the Configuration screen.");
7651 print THISFILE $entryreturn;
7652 close (THISFILE);
7653 chmod (0666, "$EntriesPath/$newentrynumberpadded.$entrysuffix");
7654 } else {
7655 unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix");
7656 }
7657
7658 if ($newentrynumber ne "1") {
7659 $updatepreviousnumber = $newentrynumber - 1;
7660 &gm_getentryvariables($updatepreviousnumber);
7661 if ($thisentryopenstatus eq "open") {
7662 if ($updatepreviousnumber <= $newarchivenumber) {
7663 if ($thisentrymorebody ne "") {
7664 &gm_formatentry($gmmorearchiveentrypagetemplate);
7665 } else {
7666 &gm_formatentry($gmarchiveentrypagetemplate);
7667 }
7668 } else {
7669 if ($thisentrymorebody ne "") {
7670 &gm_formatentry($gmmoreentrypagetemplate);
7671 } else {
7672 &gm_formatentry($gmentrypagetemplate);
7673 }
7674 }
7675 open (THISFILE, ">$EntriesPath/$thisentrynumberpadded.$entrysuffix") || &gm_dangermouse("Can't write file to $EntriesPath/$thisentrynumberpadded.$entrysuffix - please run Diagnostics & Repair in the Configuration screen.");
7676 print THISFILE $entryreturn;
7677 close (THISFILE);
7678 chmod (0666, "$EntriesPath/$newentrynumberpadded.$entrysuffix");
7679 } else {
7680 unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix");
7681 }
7682 }
7683
7684}
7685
7686&gm_generatemainindex;
7687
7688&gm_readcounter;
7689
7690if (($newarchivenumber ne "0") || ($concurrentmainandarchives eq "yes")) {
7691
7692 if (($generateentrypages eq "yes") && ($newarchivenumber ne "0")) {
7693 &gm_getentryvariables($newarchivenumber);
7694 $originaldaymarker = "$thisentryday $thisentrymonth";
7695 $currentdaymarker = $originaldaymarker;
7696 $markercount = $newarchivenumber;
7697 do {
7698 if ($thisentryopenstatus eq "open") {
7699 if ($thisentrymorebody ne "") {
7700 &gm_formatentry($gmmorearchiveentrypagetemplate);
7701 } else {
7702 &gm_formatentry($gmarchiveentrypagetemplate);
7703 }
7704 open (THISFILE, ">$EntriesPath/$thisentrynumberpadded.$entrysuffix") || &gm_dangermouse("Can't write file to $EntriesPath/$thisentrynumberpadded.$entrysuffix - please run Diagnostics & Repair in the Configuration screen.");
7705 print THISFILE $entryreturn;
7706 close (THISFILE);
7707 chmod (0666, "$EntriesPath/$newentrynumberpadded.$entrysuffix");
7708 } else {
7709 unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix");
7710 }
7711 $markercount--;
7712 if ($markercount eq "0") {
7713 $currentdaymarker = "finis";
7714 } else {
7715 &gm_getentryvariables($markercount);
7716 $currentdaymarker = "$thisentryday $thisentrymonth";
7717 }
7718 } until $currentdaymarker ne $originaldaymarker;
7719 }
7720
7721 if ($concurrentmainandarchives eq "yes") { $newarchivenumber = $newentrynumber; }
7722 unless ($keepmonthlyarchives eq "no") { &gm_generatearchive($newarchivenumber); }
7723 &gm_readcounter;
7724
7725}
7726
7727if ($keeparchivemasterindex eq "yes") {
7728 if ($newarchivenumber ne "0") {
7729 &gm_getentryvariables($newarchivenumber);
7730 } else {
7731 &gm_getentryvariables($newentrynumber);
7732 }
7733 &gm_formatentry($gmarchivemasterindextemplate);
7734 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.");
7735 print THISFILE $entryreturn;
7736 close (THISFILE);
7737 chmod (0666, "$EntriesPath/$indexfilename");
7738}
7739
7740open (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.");
7741@gmauthordata = <FUNNYFEET>;
7742close (FUNNYFEET);
7743
7744open (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.");
7745foreach $gmauthordataline (@gmauthordata) {
7746 chomp ($gmauthordataline);
7747 ($checkthisname, $checkthispassword, $checkthisemail, $checkthishomepage, $checkthisoriginaldate, $checkthisentrycount, $checkthisentryaccess, $checkthisentryeditaccess, $checkthisconfigureaccess, $checkthistemplateaccess, $checkthisauthoraccess, $checkthisrebuildaccess, $checkthiscplogaccess, $checkthisbookmarkletaccess, $checkthisuploadaccess, $checkthisloginaccess) = split (/\|/, $gmauthordataline);
7748 if ($checkthisname eq $IN{'authorname'}) { $checkthisentrycount++; }
7749 print FUNNYFEET "$checkthisname|$checkthispassword|$checkthisemail|$checkthishomepage|$checkthisoriginaldate|$checkthisentrycount|$checkthisentryaccess|$checkthisentryeditaccess|$checkthisconfigureaccess|$checkthistemplateaccess|$checkthisauthoraccess|$checkthisrebuildaccess|$checkthiscplogaccess|$checkthisbookmarkletaccess|$checkthisuploadaccess|$checkthisloginaccess\n";
7750}
7751close (FUNNYFEET);
7752
7753$recordentrysubject = $IN{'newentrysubject'};
7754if ($recordentrysubject eq "") { $recordentrysubject = "[no subject]"; }
7755
7756if ($IN{'gmbmspecial'} eq "popupblog") {
7757 &gm_writetocplog("$IN{'authorname'} added a new entry (#$newentrynumber\: $recordentrysubject) via popup");
7758} else {
7759 &gm_writetocplog("$IN{'authorname'} added a new entry (#$newentrynumber\: $recordentrysubject)");
7760}
7761
7762if (($otherfilelist ne "") && ($otherfilelistentryrebuild eq "yes") && ($IN{'gmbmspecial'} ne "popupblog")) {
7763 $IN{'rebuilding'} = "connectedaftersave";
7764 $IN{'rebuildfrom'} = "connected";
7765 &gm_rebuildupdate;
7766}
7767
7768if ($IN{'gmbmspecial'} eq "popupblog") {
7769
7770$indexfilenamesmartcheck = "/$indexfilename";
7771$indexfilenameprefix = substr($indexfilename, 0, 6);
7772if ($indexfilenameprefix eq "index.") { $indexfilenamesmartcheck = "/"; }
7773
7774print<<GMPOPUPNOTICE;
7775
7776$gmheadtag
7777
7778$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
7779
7780</BODY>
7781</HTML>
7782
7783GMPOPUPNOTICE
7784
7785exit;
7786
7787}
7788
7789$statusnote = qq(<B><FONT COLOR="#0000FF">Your new entry has been added.</FONT></B><P>);
7790&gm_frontpage;
7791
7792}
7793
7794# ------------------
7795# rebuild files menu
7796# ------------------
7797
7798sub gm_rebuildfilesmenu {
7799
7800&gm_validate;
7801
7802if ($gmrebuildaccess ne "yes") {
7803 &gm_writetocplog("$IN{'authorname'} attempted to rebuild the files without authorization");
7804 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to rebuild the files.</FONT></B><P>);
7805 &gm_frontpage;
7806}
7807
7808&gm_readcounter;
7809
7810if ($newentrynumber eq "0") {
7811 $statusnote = qq(<B><FONT COLOR="#FF0000">There are no entries yet!</FONT></B><P>);
7812 &gm_frontpage;
7813}
7814
7815if ($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 visible—note that whenever you add a new entry, Greymatter automatically updates the relevant files.</FONT></TD></TR></TABLE><P>); }
7816
7817$rebuildconnectedfilesbutton = "";
7818
7819if ($otherfilelist ne "") {
7820 $rebuildconnectedfilesbutton = qq(<P>\n<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Rebuild Connected Files" STYLE="width: 320">);
7821}
7822
7823print<<GMREBUILDMENU;
7824
7825$gmheadtag
7826
7827$gmframetop
7828$statusnote
7829<FORM ACTION="gm.cgi" METHOD=POST>
7830<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
7831<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
7832<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Rebuild Last Entry Page Only" STYLE="width: 320">
7833<P>
7834<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Rebuild Main Index File" STYLE="width: 320">
7835<P>
7836<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Rebuild Main Entry Pages" STYLE="width: 320">
7837<P>
7838<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Rebuild Archive Master Index" STYLE="width: 320">
7839<P>
7840<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Rebuild Archive Log Indexes" STYLE="width: 320">
7841<P>
7842<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Rebuild Archive Entry Pages" STYLE="width: 320">
7843<P>
7844<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Rebuild All Entry Pages" STYLE="width: 320">
7845$rebuildconnectedfilesbutton
7846<P>
7847<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Rebuild Everything" STYLE="width: 320">
7848<P>
7849<FONT SIZE=1>
7850After 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.
7851</FONT>
7852<P>
7853<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0">
7854</FORM>
7855<P>
7856<FONT SIZE=1>
7857"The most merciful thing in the world is the inability of the
7858<BR>
7859human mind to correlate all its contents."—H.P. Lovecraft
7860</FONT>
7861$gmframebottom
7862
7863</BODY>
7864</HTML>
7865
7866GMREBUILDMENU
7867
7868$statusnote = "";
7869
7870exit;
7871
7872}
7873
7874# ---------------------------
7875# rebuild the main index file
7876# ---------------------------
7877
7878sub gm_rebuildmainindexfile {
7879
7880&gm_validate;
7881
7882if ($gmrebuildaccess ne "yes") {
7883 &gm_writetocplog("$IN{'authorname'} attempted to rebuild the main index file without authorization");
7884 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to rebuild the main index file.</FONT></B><P>);
7885 &gm_frontpage;
7886}
7887
7888&gm_readcounter;
7889
7890if ($newentrynumber eq "0") {
7891 $statusnote = qq(<B><FONT COLOR="#FF0000">There are no entries yet.</FONT></B><P>);
7892 &gm_frontpage;
7893}
7894
7895&gm_generatemainindex;
7896
7897&gm_writetocplog("$IN{'authorname'} rebuilt the main index file");
7898
7899if ($IN{'autorebuild'} eq "index") {
7900 $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>);
7901 &gm_edittemplates;
7902} else {
7903 $statusnote = qq(<B><FONT COLOR="#0000FF">The main index file has been rebuilt.</FONT></B><P>);
7904 &gm_frontpage;
7905}
7906
7907}
7908
7909# ----------------------------
7910# rebuild last entry page only
7911# ----------------------------
7912
7913sub gm_rebuildlastentrypageonly {
7914
7915&gm_validate;
7916
7917if ($gmrebuildaccess ne "yes") {
7918 &gm_writetocplog("$IN{'authorname'} attempted to rebuild the last entry page without authorization");
7919 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to rebuild the last entry page.</FONT></B><P>);
7920 &gm_frontpage;
7921}
7922
7923&gm_readconfig;
7924
7925if ($generateentrypages ne "yes") {
7926 $statusnote = qq(<B><FONT COLOR="#FF0000">Entry page generation is currently disabled.</FONT></B><P>);
7927 &gm_rebuildfilesmenu;
7928}
7929
7930&gm_readcounter;
7931&gm_readtemplates;
7932
7933if ($newentrynumber eq "0") {
7934 $statusnote = qq(<B><FONT COLOR="#FF0000">There are no entries yet.</FONT></B><P>);
7935 &gm_frontpage;
7936}
7937
7938&gm_getentryvariables($newentrynumber);
7939
7940if ($thisentryopenstatus eq "open") {
7941 if ($thisentrymorebody ne "") {
7942 &gm_formatentry($gmmoreentrypagetemplate);
7943 } else {
7944 &gm_formatentry($gmentrypagetemplate);
7945 }
7946 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.");
7947 print THISFILE $entryreturn;
7948 close (THISFILE);
7949 chmod (0666, "$EntriesPath/$thisentrynumberpadded.$entrysuffix");
7950} else {
7951 unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix");
7952}
7953
7954&gm_writetocplog("$IN{'authorname'} rebuilt the last entry page");
7955
7956$statusnote = qq(<B><FONT COLOR="#0000FF">The last entry page has been rebuilt.</FONT></B><P>);
7957&gm_frontpage;
7958
7959}
7960
7961# ------------------------
7962# rebuild main entry files
7963# ------------------------
7964
7965sub gm_rebuildmainentrypages {
7966
7967&gm_validate;
7968
7969if ($gmrebuildaccess ne "yes") {
7970 &gm_writetocplog("$IN{'authorname'} attempted to rebuild the main entry pages without authorization");
7971 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to rebuild the main entry pages.</FONT></B><P>);
7972 &gm_frontpage;
7973}
7974
7975&gm_readconfig;
7976
7977if ($generateentrypages ne "yes") {
7978 $statusnote = qq(<B><FONT COLOR="#FF0000">Entry page generation is currently disabled.</FONT></B><P>);
7979 &gm_rebuildfilesmenu;
7980}
7981
7982&gm_readcounter;
7983&gm_readtemplates;
7984
7985if ($newentrynumber eq "0") {
7986 $statusnote = qq(<B><FONT COLOR="#FF0000">There are no entries yet.</FONT></B><P>);
7987 &gm_frontpage;
7988}
7989
7990$IN{'rebuilding'} = "mainentries";
7991$IN{'rebuildfrom'} = $newarchivenumber + 1;
7992
7993&gm_rebuildupdate;
7994
7995}
7996
7997# ----------------------------
7998# rebuild archive master index
7999# ----------------------------
8000
8001sub gm_rebuildarchivemasterindex {
8002
8003&gm_validate;
8004
8005if ($gmrebuildaccess ne "yes") {
8006 &gm_writetocplog("$IN{'authorname'} attempted to rebuild the archive master index without authorization");
8007 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to rebuild the archive master index.</FONT></B><P>);
8008 &gm_frontpage;
8009}
8010
8011&gm_readconfig;
8012&gm_readcounter;
8013&gm_readtemplates;
8014
8015if ($keeparchivemasterindex eq "no") {
8016 $statusnote = qq(<B><FONT COLOR="#FF0000">"Keep archive master index" is currently disabled.</FONT></B><P>);
8017 &gm_frontpage;
8018}
8019
8020if ($newarchivenumber ne "0") {
8021 &gm_getentryvariables($newarchivenumber);
8022} else {
8023 &gm_getentryvariables($newentrynumber);
8024}
8025
8026&gm_formatentry($gmarchivemasterindextemplate);
8027
8028open (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.");
8029print THISFILE $entryreturn;
8030close (THISFILE);
8031
8032chmod (0666, "$EntriesPath/$indexfilename");
8033
8034&gm_writetocplog("$IN{'authorname'} rebuilt the archive master index");
8035
8036$statusnote = qq(<B><FONT COLOR="#0000FF">The archive master index has been rebuilt.</FONT></B><P>);
8037&gm_frontpage;
8038
8039}
8040
8041# ---------------------------
8042# rebuild archive log indexes
8043# ---------------------------
8044
8045sub gm_rebuildarchivelogindexes {
8046
8047&gm_validate;
8048
8049if ($gmrebuildaccess ne "yes") {
8050 &gm_writetocplog("$IN{'authorname'} attempted to rebuild the archive log indexes without authorization");
8051 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to rebuild the archive log indexes.</FONT></B><P>);
8052 &gm_frontpage;
8053}
8054
8055&gm_readconfig;
8056&gm_readcounter;
8057&gm_readtemplates;
8058
8059if (($IN{'autorebuild'} eq "archiveindexes") && ($keeparchivemasterindex ne "no")) {
8060 if ($newarchivenumber ne "0") {
8061 &gm_getentryvariables($newarchivenumber);
8062 } else {
8063 &gm_getentryvariables($newentrynumber);
8064 }
8065 &gm_formatentry($gmarchivemasterindextemplate);
8066 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.");
8067 print THISFILE $entryreturn;
8068 close (THISFILE);
8069}
8070
8071if ($keepmonthlyarchives eq "no") {
8072 $statusnote = qq(<B><FONT COLOR="#FF0000">Log archives are currently disabled.</FONT></B><P>);
8073 if ($IN{'autorebuild'} eq "archiveindexes") {
8074 $statusnote = qq(<B><FONT COLOR="#FF0000">The $IN{'modifiedtemplategroup'} templates have been modified.</FONT></B><P>);
8075 }
8076 &gm_frontpage;
8077}
8078
8079if (($newarchivenumber eq "0") && ($concurrentmainandarchives ne "yes")) {
8080 $statusnote = qq(<B><FONT COLOR="#FF0000">There are no archive log indexes yet.</FONT></B><P>);
8081 if ($IN{'autorebuild'} eq "archiveindexes") {
8082 $statusnote = qq(<B><FONT COLOR="#FF0000">The $IN{'modifiedtemplategroup'} templates have been modified.</FONT></B><P>);
8083 }
8084 &gm_frontpage;
8085}
8086
8087unlink glob("$EntriesPath/archive-*.$entrysuffix");
8088unlink glob("$EntriesPath/archive-*.$logarchivesuffix");
8089
8090if ($concurrentmainandarchives eq "yes") { $newarchivenumber = $newentrynumber; }
8091
8092$stoppednumber = $newarchivenumber;
8093do { &gm_generatearchive($stoppednumber); } until $stoppednumber <= 1;
8094
8095&gm_writetocplog("$IN{'authorname'} rebuilt the archive log indexes");
8096
8097if ($IN{'autorebuild'} eq "archiveindexes") {
8098 $statusnote = qq(<B><FONT COLOR="#0000FF">The $IN{'modifiedtemplategroup'} templates have been<BR>modified and the archive indexes have been rebuilt.</FONT></B><P>);
8099 &gm_edittemplates;
8100} else {
8101 $statusnote = qq(<B><FONT COLOR="#0000FF">The archive log indexes have been rebuilt.</FONT></B><P>);
8102 &gm_frontpage;
8103}
8104
8105}
8106
8107# ---------------------------
8108# rebuild archive entry pages
8109# ---------------------------
8110
8111sub gm_rebuildarchiveentrypages {
8112
8113&gm_validate;
8114
8115if ($gmrebuildaccess ne "yes") {
8116 &gm_writetocplog("$IN{'authorname'} attempted to rebuild the archive entry pages without authorization");
8117 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to rebuild the archive entry pages.</FONT></B><P>);
8118 &gm_frontpage;
8119}
8120
8121&gm_readconfig;
8122&gm_readcounter;
8123&gm_readtemplates;
8124
8125if ($newarchivenumber eq "0") {
8126 $statusnote = qq(<B><FONT COLOR="#FF0000">There are no archives yet.</FONT></B><P>);
8127 &gm_frontpage;
8128}
8129
8130if ($generateentrypages eq "no") {
8131 $statusnote = qq(<B><FONT COLOR="#FF0000">Entry page generation is currently disabled.</FONT></B><P>);
8132 &gm_rebuildfilesmenu;
8133}
8134
8135$IN{'rebuilding'} = "archivefiles";
8136$IN{'rebuildfrom'} = "1";
8137
8138&gm_rebuildupdate;
8139
8140}
8141
8142# -----------------------
8143# rebuild all entry pages
8144# -----------------------
8145
8146sub gm_rebuildallentrypages {
8147
8148&gm_validate;
8149
8150if ($gmrebuildaccess ne "yes") {
8151 &gm_writetocplog("$IN{'authorname'} attempted to rebuild the entry pages without authorization");
8152 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to rebuild the entry pages.</FONT></B><P>);
8153 &gm_frontpage;
8154}
8155
8156&gm_readconfig;
8157
8158if ($generateentrypages ne "yes") {
8159 $statusnote = qq(<B><FONT COLOR="#FF0000">Entry page generation is currently disabled.</FONT></B><P>);
8160 &gm_rebuildfilesmenu;
8161}
8162
8163&gm_readcounter;
8164&gm_readtemplates;
8165
8166if ($newentrynumber eq "0") {
8167 $statusnote = qq(<B><FONT COLOR="#FF0000">There are no entries yet.</FONT></B><P>);
8168 &gm_frontpage;
8169}
8170
8171unlink glob("$EntriesPath/archive-*.$entrysuffix");
8172
8173$IN{'rebuilding'} = "entryfiles";
8174$IN{'rebuildfrom'} = "1";
8175
8176&gm_rebuildupdate;
8177
8178}
8179
8180# -------------------------------
8181# rebuild connected files - check
8182# -------------------------------
8183
8184sub gm_rebuildconnectedfilescheck {
8185
8186&gm_validate;
8187
8188if ($gmrebuildaccess ne "yes") {
8189 &gm_writetocplog("$IN{'authorname'} attempted to rebuild the connected files without authorization");
8190 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to rebuild the connected files.</FONT></B><P>);
8191 &gm_frontpage;
8192}
8193
8194if ($otherfilelist eq "") {
8195 $statusnote = qq(<B><FONT COLOR="#FF0000">There are no connected files to rebuild.</FONT></B><P>);
8196 &gm_frontpage;
8197}
8198
8199&gm_readconfig;
8200&gm_readcounter;
8201&gm_readtemplates;
8202
8203$IN{'rebuilding'} = "connected";
8204$IN{'rebuildfrom'} = "connected";
8205
8206&gm_rebuildupdate;
8207
8208}
8209
8210# ------------------
8211# rebuild everything
8212# ------------------
8213
8214sub gm_rebuildeverything {
8215
8216&gm_validate;
8217
8218if ($gmrebuildaccess ne "yes") {
8219 &gm_writetocplog("$IN{'authorname'} attempted to rebuild all the files without authorization");
8220 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to rebuild all the files.</FONT></B><P>);
8221 &gm_frontpage;
8222}
8223
8224unlink glob("$EntriesPath/*.reg");
8225unlink glob("$EntriesPath/archive-*.$entrysuffix");
8226unlink glob("$EntriesPath/archive-*.$logarchivesuffix");
8227
8228$IN{'rebuilding'} = "everything";
8229$IN{'rebuildfrom'} = "index";
8230
8231&gm_rebuildupdate;
8232
8233}
8234
8235# ------------------------------
8236# edit an entry - selection menu
8237# ------------------------------
8238
8239sub gm_editentryselection {
8240
8241&gm_validate;
8242
8243if ($gmentryeditaccess eq "no") {
8244 &gm_writetocplog("$IN{'authorname'} attempted to edit entries without authorization");
8245 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit entries.</FONT></B><P>);
8246 &gm_frontpage;
8247}
8248
8249&gm_readcounter;
8250
8251if ($newentrynumber eq "0") {
8252 $statusnote = qq(<B><FONT COLOR="#FF0000">There are no entries yet!</FONT></B><P>);
8253 &gm_frontpage;
8254}
8255
8256if ($IN{'entryselectionview'} eq "") { $IN{'entryselectionview'} = $defaultentrylistview; }
8257
8258$searchingfortext = "";
8259
8260if ($IN{'entrysearch'} ne "") {
8261 $searchingfortext = qq(<P>\n<FONT COLOR="#0000FF"><B>All entries containing "$IN{'entrysearch'}"</B></FONT>\n<P>\n);
8262 $IN{'entryselectionview'} = "searchresults";
8263 $IN{'entrysearch'} = &relouse($IN{'entrysearch'});
8264}
8265
8266if ($statusnote eq "") {
8267 $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>);
8268}
8269
8270if ($gmentryeditaccess eq "mineonly") {
8271 $statusnote .= qq(<B>You only have access to edit your own entries.</B><P>);
8272}
8273
8274open (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.");
8275@gmentrylist = <FUNNYFEET>;
8276close (FUNNYFEET);
8277
8278if ($IN{'sortby'} eq "subject") {
8279 @gmentrylist = sort {
8280 @a_fields = split /\|/, $a;
8281 @b_fields = split /\|/, $b;
8282 lc($a_fields[2]) cmp lc($b_fields[2]) || $b_fields[0] <=> $a_fields[0];
8283 } @gmentrylist;
8284}
8285
8286if ($IN{'sortby'} eq "author") {
8287 @gmentrylist = sort {
8288 @a_fields = split /\|/, $a;
8289 @b_fields = split /\|/, $b;
8290 lc($a_fields[1]) cmp lc($b_fields[1]) || $b_fields[0] <=> $a_fields[0];
8291 } @gmentrylist;
8292}
8293
8294print<<GMEDITENTRYSELECTIONMENUTOP;
8295
8296$gmheadtag
8297
8298$gmframetop
8299$statusnote
8300$searchingfortext
8301<FORM ACTION="gm.cgi" METHOD=POST>
8302<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
8303<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
8304<INPUT TYPE=HIDDEN NAME="thomas" VALUE="Edit An Entry">
8305<SELECT CLASS="selectlist" NAME="entryselectionlist" SIZE=15>
8306
8307GMEDITENTRYSELECTIONMENUTOP
8308
8309$gmentrydatemarker = "nyet";
8310$liststayattopnotice = "";
8311$listclosedentrynotice = "";
8312$listmoreentrynotice = "";
8313$listsecondblank = "yes";
8314
8315foreach $gmentrylistline (@gmentrylist) {
8316 chomp ($gmentrylistline);
8317 ($listentrynumber, $listentryauthor, $listentrysubject, $listentrydate, $listentrytime, $listentryopenstatus, $listentrymorestatus) = split (/\|/, $gmentrylistline);
8318
8319 if ($IN{'entryselectionview'} eq "searchresults") {
8320 $containsearch = "no";
8321 if ($listofaffectedentries ne "") {
8322 foreach $checkforthisentry (@affectedentrylist) {
8323 if ($checkforthisentry eq $listentrynumber) { $containsearch = "yes"; }
8324 }
8325 } else {
8326 &gm_getentryvariables($listentrynumber);
8327 if (($thisentryauthor =~ m/$IN{'entrysearch'}/i) || ($thisentrysubject =~ m/$IN{'entrysearch'}/i) || ($thisentrymainbody =~ m/$IN{'entrysearch'}/i) || ($thisentrymorebody =~ m/$IN{'entrysearch'}/i) || ($thisentrycomments =~ m/$IN{'entrysearch'}/i)) {
8328 $containsearch = "yes";
8329 }
8330 }
8331 }
8332
8333 if ($listentrysubject eq "") { $listentrysubject = "(no subject)"; }
8334
8335 if (($listentrynumber eq $newstayattopnumber) && ($listentryopenstatus eq "C") && ($listentrymorestatus eq "Y")) {
8336 unless (($listentryauthor ne $IN{'authorname'}) && ($IN{'entryselectionview'} eq "onlyyou")) {
8337 unless (($IN{'entryselectionview'} eq "searchresults") && ($containsearch eq "no")) {
8338 print qq(<OPTION VALUE="$listentrynumber">‡ † * [$listentrydate $listentrytime] $listentrynumber\: $listentrysubject \($listentryauthor\)\n);
8339 $liststayattopnotice = "‡ = Entry currently marked to stay at the top of the main index.";
8340 $listclosedentrynotice = "† = Closed entry.";
8341 $listmoreentrynotice = "* = Extended entry (contains \"more\" text).";
8342 $listsecondblank = "no";
8343 }
8344 }
8345 } elsif (($listentrynumber eq $newstayattopnumber) && ($listentryopenstatus eq "C")) {
8346 unless (($listentryauthor ne $IN{'authorname'}) && ($IN{'entryselectionview'} eq "onlyyou")) {
8347 unless (($IN{'entryselectionview'} eq "searchresults") && ($containsearch eq "no")) {
8348 print qq(<OPTION VALUE="$listentrynumber">‡ † [$listentrydate $listentrytime] $listentrynumber\: $listentrysubject \($listentryauthor\)\n);
8349 $liststayattopnotice = "‡ = Entry currently marked to stay at the top of the main index.";
8350 $listclosedentrynotice = "† = Closed entry.";
8351 $listsecondblank = "no";
8352 }
8353 }
8354 } elsif (($listentrynumber eq $newstayattopnumber) && ($listentrymorestatus eq "Y")) {
8355 unless (($listentryauthor ne $IN{'authorname'}) && ($IN{'entryselectionview'} eq "onlyyou")) {
8356 unless (($IN{'entryselectionview'} eq "searchresults") && ($containsearch eq "no")) {
8357 print qq(<OPTION VALUE="$listentrynumber">‡ * [$listentrydate $listentrytime] $listentrynumber\: $listentrysubject \($listentryauthor\)\n);
8358 $liststayattopnotice = "‡ = Entry currently marked to stay at the top of the main index.";
8359 $listmoreentrynotice = "* = Extended entry (contains \"more\" text).";
8360 $listsecondblank = "no";
8361 }
8362 }
8363 } elsif ($listentrynumber eq $newstayattopnumber) {
8364 unless (($listentryauthor ne $IN{'authorname'}) && ($IN{'entryselectionview'} eq "onlyyou")) {
8365 unless (($IN{'entryselectionview'} eq "searchresults") && ($containsearch eq "no")) {
8366 print qq(<OPTION VALUE="$listentrynumber">‡ [$listentrydate $listentrytime] $listentrynumber\: $listentrysubject \($listentryauthor\)\n);
8367 $liststayattopnotice = "‡ = Entry currently marked to stay at the top of the main index.";
8368 $listsecondblank = "no";
8369 }
8370 }
8371 } elsif (($listentrymorestatus eq "Y") && ($listentryopenstatus eq "C")) {
8372 unless (($listentryauthor ne $IN{'authorname'}) && ($IN{'entryselectionview'} eq "onlyyou")) {
8373 unless (($IN{'entryselectionview'} eq "searchresults") && ($containsearch eq "no")) {
8374 if (($IN{'entryselectionview'} eq "searchresults") || ($IN{'entryselectionview'} eq "onlyyou") || ($IN{'entryselectionview'} eq "more") || ($IN{'entryselectionview'} eq "closed") || ($IN{'entryselectionview'} eq "all") || ($IN{'entryselectionview'} eq "main")) {
8375 unless (($listentrynumber <= $newarchivenumber) && ($IN{'entryselectionview'} eq "main")) {
8376 print qq(<OPTION VALUE="$listentrynumber">† * [$listentrydate $listentrytime] $listentrynumber\: $listentrysubject \($listentryauthor\)\n);
8377 $listclosedentrynotice = "† = Closed entry.";
8378 $listmoreentrynotice = "* = Extended entry (contains \"more\" text).";
8379 $listsecondblank = "no";
8380 }
8381 }
8382 }
8383 }
8384 } elsif ($listentrymorestatus eq "Y") {
8385 unless (($listentryauthor ne $IN{'authorname'}) && ($IN{'entryselectionview'} eq "onlyyou")) {
8386 unless (($IN{'entryselectionview'} eq "searchresults") && ($containsearch eq "no")) {
8387 if (($IN{'entryselectionview'} eq "searchresults") || ($IN{'entryselectionview'} eq "onlyyou") || ($IN{'entryselectionview'} eq "more") || ($IN{'entryselectionview'} eq "open") || ($IN{'entryselectionview'} eq "all") || ($IN{'entryselectionview'} eq "main")) {
8388 unless (($listentrynumber <= $newarchivenumber) && ($IN{'entryselectionview'} eq "main")) {
8389 print qq(<OPTION VALUE="$listentrynumber">* [$listentrydate $listentrytime] $listentrynumber\: $listentrysubject \($listentryauthor\)\n);
8390 $listmoreentrynotice = "* = Extended entry (contains \"more\" text).";
8391 $listsecondblank = "no";
8392 }
8393 }
8394 }
8395 }
8396 } elsif ($listentryopenstatus eq "C") {
8397 unless (($listentryauthor ne $IN{'authorname'}) && ($IN{'entryselectionview'} eq "onlyyou")) {
8398 unless (($IN{'entryselectionview'} eq "searchresults") && ($containsearch eq "no")) {
8399 if (($IN{'entryselectionview'} eq "searchresults") || ($IN{'entryselectionview'} eq "onlyyou") || ($IN{'entryselectionview'} eq "closed") || ($IN{'entryselectionview'} eq "all") || ($IN{'entryselectionview'} eq "main")) {
8400 unless (($listentrynumber <= $newarchivenumber) && ($IN{'entryselectionview'} eq "main")) {
8401 print qq(<OPTION VALUE="$listentrynumber">† [$listentrydate $listentrytime] $listentrynumber\: $listentrysubject \($listentryauthor\)\n);
8402 $listclosedentrynotice = "† = Closed entry.";
8403 $listsecondblank = "no";
8404 }
8405 }
8406 }
8407 }
8408 } else {
8409 unless (($listentryauthor ne $IN{'authorname'}) && ($IN{'entryselectionview'} eq "onlyyou")) {
8410 unless (($IN{'entryselectionview'} eq "searchresults") && ($containsearch eq "no")) {
8411 if (($IN{'entryselectionview'} eq "searchresults") || ($IN{'entryselectionview'} eq "onlyyou") || ($IN{'entryselectionview'} eq "open") || ($IN{'entryselectionview'} eq "all") || ($IN{'entryselectionview'} eq "main")) {
8412 unless (($listentrynumber <= $newarchivenumber) && ($IN{'entryselectionview'} eq "main")) {
8413 print qq(<OPTION VALUE="$listentrynumber">[$listentrydate $listentrytime] $listentrynumber\: $listentrysubject \($listentryauthor\)\n);
8414 $listsecondblank = "no";
8415 }
8416 }
8417 }
8418 }
8419 }
8420
8421}
8422
8423print qq(</SELECT>\n<P>\n<INPUT TYPE=TEXT NAME="entrysearch" CLASS="textinput" SIZE=25 STYLE="width: 350"> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Search" STYLE="width: 70; height: 22">\n<P>List: <SELECT NAME="entryselectionview" CLASS="selectlist">\n);
8424
8425if ($IN{'entryselectionview'} eq "searchresults") {
8426 print qq(<OPTION VALUE="$defaultentrylistview" SELECTED> \(Search results\)\n);
8427}
8428
8429if ($IN{'entryselectionview'} eq "main") {
8430 if ($indexdays eq "1") {
8431 print qq(<OPTION VALUE="main" SELECTED> Current entries \($indexdays day\)\n);
8432 } else {
8433 print qq(<OPTION VALUE="main" SELECTED> Current entries \($indexdays days\)\n);
8434 }
8435} else {
8436 if ($indexdays eq "1") {
8437 print qq(<OPTION VALUE="main"> Current entries \($indexdays day\)\n);
8438 } else {
8439 print qq(<OPTION VALUE="main"> Current entries \($indexdays days\)\n);
8440 }
8441}
8442
8443if ($IN{'entryselectionview'} eq "onlyyou") {
8444 print qq(<OPTION VALUE="onlyyou" SELECTED> All entries by you\n);
8445} else {
8446 print qq(<OPTION VALUE="onlyyou"> All entries by you\n);
8447}
8448
8449if ($IN{'entryselectionview'} eq "more") {
8450 print qq(<OPTION VALUE="more" SELECTED> All extended entries\n);
8451} else {
8452 print qq(<OPTION VALUE="more"> All extended entries\n);
8453}
8454
8455if ($IN{'entryselectionview'} eq "open") {
8456 print qq(<OPTION VALUE="open" SELECTED> All open entries\n);
8457} else {
8458 print qq(<OPTION VALUE="open"> All open entries\n);
8459}
8460
8461if ($IN{'entryselectionview'} eq "closed") {
8462 print qq(<OPTION VALUE="closed" SELECTED> All closed entries\n);
8463} else {
8464 print qq(<OPTION VALUE="closed"> All closed entries\n);
8465}
8466
8467if ($IN{'entryselectionview'} eq "all") {
8468 print qq(<OPTION VALUE="all" SELECTED> All entries\n);
8469} else {
8470 print qq(<OPTION VALUE="all"> All entries\n);
8471}
8472
8473
8474$listnotice = "";
8475
8476if (($liststayattopnotice ne "") && ($listmoreentrynotice ne "") && ($listclosedentrynotice ne "")) {
8477 $listnotice = "<FONT SIZE=1>$liststayattopnotice\n<BR>\n$listmoreentrynotice\n<BR>\n$listclosedentrynotice</FONT>\n<P>";
8478} elsif (($liststayattopnotice ne "") && ($listmoreentrynotice ne "")) {
8479 $listnotice = "<FONT SIZE=1>$liststayattopnotice\n<BR>\n$listmoreentrynotice</FONT>\n<P>";
8480} elsif (($liststayattopnotice ne "") && ($listclosedentrynotice ne "")) {
8481 $listnotice = "<FONT SIZE=1>$liststayattopnotice\n<BR>\n$listclosedentrynotice</FONT>\n<P>";
8482} elsif ($liststayattopnotice ne "") {
8483 $listnotice = "<FONT SIZE=1>$liststayattopnotice</FONT>\n<P>";
8484} elsif (($listmoreentrynotice ne "") && ($listclosedentrynotice ne "")) {
8485 $listnotice = "<FONT SIZE=1>$listmoreentrynotice\n<BR>\n$listclosedentrynotice</FONT>\n<P>";
8486} elsif ($listmoreentrynotice ne "") {
8487 $listnotice = "<FONT SIZE=1>$listmoreentrynotice</FONT>\n<P>";
8488} elsif ($listclosedentrynotice ne "") {
8489 $listnotice = "<FONT SIZE=1>$listclosedentrynotice</FONT>\n<P>";
8490}
8491
8492print qq(</SELECT>   <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Change View" STYLE="width: 100; height: 22">\n<P>Sort by: );
8493
8494if ($IN{'sortby'} eq "subject") {
8495 print qq(<INPUT TYPE=RADIO NAME="sortby" VALUE="date"> Date   <INPUT TYPE=RADIO NAME="sortby" VALUE="subject" CHECKED> Subject   <INPUT TYPE=RADIO NAME="sortby" VALUE="author"> Author);
8496} elsif ($IN{'sortby'} eq "author") {
8497 print qq(<INPUT TYPE=RADIO NAME="sortby" VALUE="date"> Date   <INPUT TYPE=RADIO NAME="sortby" VALUE="subject"> Subject   <INPUT TYPE=RADIO NAME="sortby" VALUE="author" CHECKED> Author);
8498} else {
8499 print qq(<INPUT TYPE=RADIO NAME="sortby" VALUE="date" CHECKED> Date   <INPUT TYPE=RADIO NAME="sortby" VALUE="subject"> Subject   <INPUT TYPE=RADIO NAME="sortby" VALUE="author"> Author);
8500}
8501
8502print<<GMEDITENTRYSELECTIONMENUBOTTOM;
8503
8504<P>
8505$listnotice
8506<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">
8507<P>
8508<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0; width: 485" VALUE="Search And Replace Across All Entries">
8509<P>
8510<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0">
8511</FORM>
8512<P>
8513<FONT SIZE=1>
8514"We must be the change we wish to see in the world."—Gandhi
8515</FONT>
8516</CENTER>
8517$gmframebottom
8518
8519</BODY>
8520</HTML>
8521
8522GMEDITENTRYSELECTIONMENUBOTTOM
8523
8524$statusnote = "";
8525
8526exit;
8527
8528}
8529
8530# ------------------------------------
8531# editing entries - search and replace
8532# ------------------------------------
8533
8534sub gm_editentrysearchandreplace {
8535
8536&gm_validate;
8537
8538if ($gmentryeditaccess eq "no") {
8539 &gm_writetocplog("$IN{'authorname'} attempted to perform a search-and-replace without authorization");
8540 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to perform a search-and-replace.</FONT></B><P>);
8541 &gm_frontpage;
8542}
8543
8544if ($gmentryeditaccess eq "mineonly") {
8545 $statusnote = qq(<B><FONT COLOR="#FF0000">You must have access to edit all entries to do this.</FONT></B><P>);
8546 &gm_editentryselection;
8547}
8548
8549if ($statusnote eq "") {
8550 $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>);
8551}
8552
8553print<<GMEDITENTRYSEARCHREPLACE;
8554
8555$gmheadtag
8556
8557$gmframetop
8558$statusnote
8559<CENTER>
8560<FORM ACTION="gm.cgi" METHOD=POST>
8561<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
8562<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
8563<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0><TR><TD VALIGN=MIDDLE ALIGN=RIGHT>$gmfonttag<B>Search For:</B></FONT></TD><TD VALIGN=MIDDLE ALIGN=LEFT></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="srsearchterm" SIZE=40 STYLE="width: 400">$gmfonttag</TD></TR><TR><TD VALIGN=MIDDLE ALIGN=RIGHT>$gmfonttag<B>Replace With:</B></FONT></TD><TD VALIGN=MIDDLE ALIGN=LEFT></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="srreplaceterm" SIZE=40 STYLE="width: 400">$gmfonttag</TD></TR></TABLE>
8564<P>
8565<INPUT TYPE=CHECKBOX NAME="srcaseinsensitive" VALUE="yes"> Make "Search For" term case-insensitive?
8566<P>
8567<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0; width: 485" VALUE="Perform Search And Replace">
8568<P>
8569<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: #C0C0C0">
8570</FORM>
8571<P>
8572<FONT SIZE=1>
8573"Search others for their virtues, thyself for thy vices."—Benjamin Franklin
8574</FONT>
8575</CENTER>
8576$gmframebottom
8577
8578</BODY>
8579</HTML>
8580
8581GMEDITENTRYSEARCHREPLACE
8582
8583$statusnote = "";
8584
8585exit;
8586
8587}
8588
8589# --------------------------
8590# perform search and replace
8591# --------------------------
8592
8593sub gm_performsearchandreplace {
8594
8595&gm_validate;
8596
8597if ($gmentryeditaccess eq "no") {
8598 &gm_writetocplog("$IN{'authorname'} attempted to perform a search-and-replace without authorization");
8599 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to perform a search-and-replace.</FONT></B><P>);
8600 &gm_frontpage;
8601}
8602
8603if ($gmentryeditaccess eq "mineonly") {
8604 $statusnote = qq(<B><FONT COLOR="#FF0000">You must have access to edit all entries to do this.</FONT></B><P>);
8605 &gm_editentryselection;
8606}
8607
8608&gm_readcounter;
8609
8610$currententrycounter = $newentrynumber;
8611$entriesaffected = 0;
8612$listofaffectedentries = "";
8613$rebuildentrylist = "no";
8614
8615do {
8616
8617 $currententrycounterpadded = sprintf ("%8d", $currententrycounter);
8618 $currententrycounterpadded =~ tr/ /0/;
8619
8620 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.");
8621 @entrylines = <FUNNYFEET>;
8622 close (FUNNYFEET);
8623
8624 $gmcounter = 0;
8625 $resaveentry = "no";
8626
8627 chomp ($entrylines[0]);
8628 ($thisentrynumber, $thisentryauthor, $thisentrysubject, $thisentryweekdaynumber, $thisentrymonth, $thisentryday, $thisentryyearyear, $thisentryhour, $thisentryminute, $thisentrysecond, $thisentryampm, $thisentrypositivekarma, $thisentrynegativekarma, $thisentrycommentsnumber, $thisentryallowkarma, $thisentryallowcomments, $thisentryopenstatus, $thisentrymusic, $thisentrymood, $thisentryemoticonsallowed) = split (/\|/, $entrylines[0]);
8629
8630 if ($IN{'srcaseinsensitive'} eq "yes") {
8631 if ($thisentrysubject =~ m/$IN{'srsearchterm'}/i) {
8632 $thisentrysubject =~ s/$IN{'srsearchterm'}/$IN{'srreplaceterm'}/ig;
8633 $entrylines[0] = "$thisentrynumber|$thisentryauthor|$thisentrysubject|$thisentryweekdaynumber|$thisentrymonth|$thisentryday|$thisentryyearyear|$thisentryhour|$thisentryminute|$thisentrysecond|$thisentryampm|$thisentrypositivekarma|$thisentrynegativekarma|$thisentrycommentsnumber|$thisentryallowkarma|$thisentryallowcomments|$thisentryopenstatus|$thisentrymusic|$thisentrymood|$thisentryemoticonsallowed";
8634 $resaveentry = "yes";
8635 $rebuildentrylist = "yes";
8636 }
8637 } else {
8638 if ($thisentrysubject =~ m/$IN{'srsearchterm'}/) {
8639 $thisentrysubject =~ s/$IN{'srsearchterm'}/$IN{'srreplaceterm'}/g;
8640 $entrylines[0] = "$thisentrynumber|$thisentryauthor|$thisentrysubject|$thisentryweekdaynumber|$thisentrymonth|$thisentryday|$thisentryyearyear|$thisentryhour|$thisentryminute|$thisentrysecond|$thisentryampm|$thisentrypositivekarma|$thisentrynegativekarma|$thisentrycommentsnumber|$thisentryallowkarma|$thisentryallowcomments|$thisentryopenstatus|$thisentrymusic|$thisentrymood|$thisentryemoticonsallowed";
8641 $resaveentry = "yes";
8642 $rebuildentrylist = "yes";
8643 }
8644 }
8645
8646 foreach (@entrylines) {
8647 chomp ($entrylines[$gmcounter]);
8648 unless (($gmcounter eq "0") || ($gmcounter eq "1")) {
8649 if ($IN{'srcaseinsensitive'} eq "yes") {
8650 if ($entrylines[$gmcounter] =~ m/$IN{'srsearchterm'}/i) {
8651 $entrylines[$gmcounter] =~ s/$IN{'srsearchterm'}/$IN{'srreplaceterm'}/ig;
8652 $resaveentry = "yes";
8653 }
8654 } else {
8655 if ($entrylines[$gmcounter] =~ m/$IN{'srsearchterm'}/) {
8656 $entrylines[$gmcounter] =~ s/$IN{'srsearchterm'}/$IN{'srreplaceterm'}/g;
8657 $resaveentry = "yes";
8658 }
8659 }
8660 }
8661 $gmcounter++;
8662 }
8663
8664 if ($resaveentry eq "yes") {
8665 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.");
8666 foreach $thisistheline (@entrylines) {
8667 print FUNNYFEET "$thisistheline\n";
8668 }
8669 close (FUNNYFEET);
8670 $entriesaffected++;
8671 $listofaffectedentries .= "$currententrycounter|";
8672 }
8673
8674 $currententrycounter--;
8675
8676} until $currententrycounter eq "0";
8677
8678if ($rebuildentrylist eq "yes") {
8679 $checkentrycounter = $newentrynumber;
8680 $rebuiltentrylist = "";
8681 do {
8682 $checkentrycounterpadded = sprintf ("%8d", $checkentrycounter);
8683 $checkentrycounterpadded =~ tr/ /0/;
8684 &gm_getentryvariables($checkentrycounter);
8685 $checkentryopenstatus = "O";
8686 $checkentrymorestatus = "N";
8687 if ($thisentryopenstatus eq "closed") { $checkentryopenstatus = "C"; }
8688 if ($thisentrymorebody ne "") { $checkentrymorestatus = "Y"; }
8689 $rebuiltentrylist .= "$thisentrynumber|$thisentryauthor|$thisentrysubject|$thisentrymonthmonth\/$thisentrydayday\/$thisentryyear|$thisentryhourhour\:$thisentryminuteminute $thisentryampm|$checkentryopenstatus|$checkentrymorestatus|$thisentrymusic|$thisentrymood|$thisentryemoticonsallowed\n";
8690 $checkentrycounter--;
8691 } until $checkentrycounter eq "0";
8692 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.");
8693 print FUNNYFEET $rebuiltentrylist;
8694 close (FUNNYFEET);
8695}
8696
8697if ($listofaffectedentries ne "") {
8698 chop ($listofaffectedentries);
8699 @affectedentrylist = split (/\|/, $listofaffectedentries);
8700}
8701
8702if ($entriesaffected eq "0") {
8703 &gm_writetocplog("$IN{'authorname'} searched all entries for \"$IN{'srsearchterm'}\" and replaced it with \"$IN{'srreplaceterm'}\" (no entries affected)");
8704 $statusnote = qq(<B><FONT COLOR="#FF0000">The search term was not found.</FONT></B><P>);
8705 $IN{'entryselectionview'} = "searchresults";
8706 &gm_editentryselection;
8707} elsif ($entriesaffected eq "1") {
8708 &gm_writetocplog("$IN{'authorname'} searched all entries for \"$IN{'srsearchterm'}\" and replaced it with \"$IN{'srreplaceterm'}\" (1 entry affected)");
8709 $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>);
8710 $IN{'entryselectionview'} = "searchresults";
8711 &gm_editentryselection;
8712} else {
8713 &gm_writetocplog("$IN{'authorname'} searched all entries for \"$IN{'srsearchterm'}\" and replaced it with \"$IN{'srreplaceterm'}\" ($entriesaffected entries affected)");
8714 $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>);
8715 $IN{'entryselectionview'} = "searchresults";
8716 &gm_editentryselection;
8717}
8718
8719}
8720
8721# -----------------------------------
8722# edit an entry - main editing screen
8723# -----------------------------------
8724
8725sub gm_editthisentry {
8726
8727&gm_validate;
8728
8729if ($gmentryeditaccess eq "no") {
8730 &gm_writetocplog("$IN{'authorname'} attempted to edit entry #$IN{'entryselectionlist'} without authorization");
8731 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit entries.</FONT></B><P>);
8732 &gm_frontpage;
8733}
8734
8735if ($IN{'entryselectionlist'} eq "") {
8736 $statusnote = qq(<B><FONT COLOR="#FF0000">You must select an entry to edit.</FONT></B><P>);
8737 &gm_editentryselection;
8738}
8739
8740&gm_readconfig;
8741&gm_readtemplates;
8742&gm_readcounter;
8743
8744$thisentrynumberpadded = sprintf ("%8d", $IN{'entryselectionlist'});
8745$thisentrynumberpadded =~ tr/ /0/;
8746
8747open (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.");
8748@entrylines = <FUNNYFEET>;
8749close (FUNNYFEET);
8750
8751$gmcounter = 0;
8752
8753foreach (@entrylines) {
8754 chomp ($entrylines[$gmcounter]);
8755 $gmcounter++;
8756}
8757
8758($thisentrynumber, $thisentryauthor, $thisentrysubject, $thisentryweekdaynumber, $thisentrymonth, $thisentryday, $thisentryyearyear, $thisentryhour, $thisentryminute, $thisentrysecond, $thisentryampm, $thisentrypositivekarma, $thisentrynegativekarma, $thisentrycommentsnumber, $thisentryallowkarma, $thisentryallowcomments, $thisentryopenstatus, $thisentrymusic, $thisentrymood, $thisentryemoticonsallowed) = split (/\|/, $entrylines[0]);
8759
8760if (($IN{'authorname'} ne $thisentryauthor) && ($gmentryeditaccess eq "mineonly")) {
8761 &gm_writetocplog("$IN{'authorname'} attempted to edit entry #$IN{'entryselectionlist'} (by $thisentryauthor) without authorization");
8762 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit entries you didn't create.</FONT></B><P>);
8763 &gm_editentryselection;
8764}
8765
8766# chomp ($thisentryopenstatus);
8767
8768$thisentrymonthmonth = sprintf ("%2d", $thisentrymonth);
8769$thisentrydayday = sprintf ("%2d", $thisentryday);
8770$thisentryhourhour = sprintf ("%2d", $thisentryhour);
8771$thisentryminuteminute = sprintf ("%2d", $thisentryminute);
8772$thisentrysecondsecond = sprintf ("%2d", $thisentrysecond);
8773$thisentrymonthmonth =~ tr/ /0/;
8774$thisentrydayday =~ tr/ /0/;
8775$thisentryhourhour =~ tr/ /0/;
8776$thisentryminuteminute =~ tr/ /0/;
8777$thisentrysecondsecond =~ tr/ /0/;
8778
8779$thisentrymainbody = $entrylines[2];
8780$thisentrymorebody = $entrylines[3];
8781$thisentrymainbody = &delouse($thisentrymainbody);
8782$thisentrymorebody = &delouse($thisentrymorebody);
8783$thisentrysubject = &delouse($thisentrysubject);
8784$thisentrymusic = &delouse($thisentrymusic);
8785$thisentrymood = &delouse($thisentrymood);
8786
8787if ($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>); }
8788
8789$autorebuildcheckbox = "";
8790
8791if ($gmrebuildaccess eq "yes") {
8792 if ($automaticrebuilddefault eq "yes") {
8793 $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>);
8794 } else {
8795 $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>);
8796 }
8797}
8798
8799# emoticons code display added by flipped cracker 9/17/2003
8800# merged into version 1.3
8801&gm_emoticons_code;
8802# merged 9/17/2003
8803
8804print<<GMENTRYEDITTOP;
8805
8806$gmheadtagtwo
8807
8808$gmframetop
8809$statusnote
8810<script language="JavaScript">
8811function commentEmoticonMain(code)
8812{
8813 var cache = document.editentry.revisedentrymaintext.value;
8814
8815 document.editentry.revisedentrymaintext.value = cache + " " + code;
8816 document.editentry.revisedentrymaintext.focus();
8817}
8818function commentEmoticonMore(code)
8819{
8820 var cache = document.editentry.revisedentrymoretext.value;
8821
8822 document.editentry.revisedentrymoretext.value = cache + " " + code;
8823 document.editentry.revisedentrymoretext.focus();
8824}
8825</script>
8826<FORM ACTION="gm.cgi" METHOD=POST name="editentry">
8827<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
8828<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
8829<INPUT TYPE=HIDDEN NAME="revisedentrynumber" VALUE="$thisentrynumber">
8830<INPUT TYPE=HIDDEN NAME="revisedentryauthor" VALUE="$thisentryauthor">
8831<INPUT TYPE=HIDDEN NAME="entryselectionview" VALUE="$IN{'entryselectionview'}">
8832<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0><TR><TD ALIGN=RIGHT>$gmfonttag<b>Subject:</b></FONT></TD><TD ALIGN=LEFT></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="revisedentrysubject" VALUE="$thisentrysubject" SIZE=45 STYLE="width: 550">$gmfonttag</TD></TR></TABLE>
8833<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0><TR><TD ALIGN=RIGHT>$gmfonttag<b>Music:</b></FONT></TD><TD ALIGN=LEFT></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="revisedentrymusic" VALUE="$thisentrymusic" SIZE=45 STYLE="width: 550">$gmfonttag</TD></TR></TABLE>
8834<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0><TR><TD ALIGN=RIGHT>$gmfonttag<b>Mood:</b></FONT></TD><TD ALIGN=LEFT></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="revisedentrymood" VALUE="$thisentrymood" SIZE=45 STYLE="width: 550">$gmfonttag</TD></TR></TABLE>
8835<P>
8836<b>Main Entry Text</b>
8837<BR>
8838</FONT>
8839<table>
8840<tr valign="top">
8841$emoticonsmaincode
8842 <td><TEXTAREA NAME="revisedentrymaintext" COLS=86 ROWS=15 WRAP=VIRTUAL STYLE="width: 720">$thisentrymainbody</TEXTAREA></td>
8843</tr>
8844</table>
8845$gmfonttag<P>
8846<b>Extended ("More") Entry Text—Optional</b>
8847<BR>
8848</FONT>
8849<table>
8850<tr valign="top">
8851 $emoticonsmorecode
8852 <td><TEXTAREA NAME="revisedentrymoretext" COLS=86 ROWS=15 WRAP=VIRTUAL STYLE="width: 720">$thisentrymorebody</TEXTAREA>
8853 </td>
8854</tr>
8855</table>$gmfonttag
8856<P>
8857<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
8858<!--//
8859if ((parseInt(navigator.appVersion) >= 4) && (navigator.appName == "Microsoft Internet Explorer")) {
8860 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>");
8861}
8862//-->
8863</SCRIPT>
8864
8865GMENTRYEDITTOP
8866
8867if ($thisentrycommentsnumber ne "0") {
8868
8869print qq(<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=1 WIDTH=720><TR><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#B0B0D0">$gmfonttag <b><font size=1>Select</FONT></b></TD><TD VALIGN=MIDDLE ALIGN=LEFT BGCOLOR="#B0B0D0" WIDTH=100%>$gmfonttag <b><font size=1>Comment</FONT></b></TD></TR>);
8870
8871$commentcounter = 4;
8872$commentcountermax = $thisentrycommentsnumber + 3;
8873
8874$alternatecommentrowone = "#EEF8FF";
8875$alternatecommentrowtwo = "#F8F8FF";
8876$alternatecommentrow = $alternatecommentrowone;
8877
8878do {
8879
8880if ($alternatecommentrow eq $alternatecommentrowone) {
8881 $alternatecommentrow = $alternatecommentrowtwo;
8882} else {
8883 $alternatecommentrow = $alternatecommentrowone;
8884}
8885
8886$thiscommentnumber = $commentcounter - 3;
8887
8888($thiscommentauthor, $thiscommentauthorip, $thiscommentauthoremailabsolute, $thiscommentauthorhomepageabsolute, $thiscommentweekdaynumber, $thiscommentmonth, $thiscommentday, $thiscommentyearyear, $thiscommenthour, $thiscommentminute, $thiscommentsecond, $thiscommentampm, $thiscommenttext) = split (/\|/, $entrylines[$commentcounter]);
8889
8890$thiscommentmonthmonth = sprintf ("%2d", $thiscommentmonth);
8891$thiscommentdayday = sprintf ("%2d", $thiscommentday);
8892$thiscommenthourhour = sprintf ("%2d", $thiscommenthour);
8893$thiscommentminuteminute = sprintf ("%2d", $thiscommentminute);
8894$thiscommentsecondsecond = sprintf ("%2d", $thiscommentsecond);
8895$thiscommentmonthmonth =~ tr/ /0/;
8896$thiscommentdayday =~ tr/ /0/;
8897$thiscommenthourhour =~ tr/ /0/;
8898$thiscommentminuteminute =~ tr/ /0/;
8899$thiscommentsecondsecond =~ tr/ /0/;
8900
8901$thiscommenttext =~ s/</\</g;
8902$thiscommenttext =~ s/>/\>/g;
8903$thiscommenttext =~ s/\|\*\|/\n/g;
8904$thiscommenttext =~ s/\n/<BR>/g;
8905$thiscommenttext =~ s/<BR><BR>/<P>/g;
8906# $thiscommenttext =~ s/ /  /g;
8907
8908print qq(<TR><TD VALIGN=TOP ALIGN=CENTER BGCOLOR="$alternatecommentrow"><INPUT TYPE=RADIO NAME="revisedentrycommentselection" VALUE="$thiscommentnumber"></TD><TD VALIGN=MIDDLE ALIGN=LEFT BGCOLOR="$alternatecommentrow">
8909$gmfonttag\<b>#$thiscommentnumber\: Posted by $thiscommentauthor ($thiscommentauthorip) @ $thiscommentmonthmonth/$thiscommentdayday/$thiscommentyearyear $thiscommenthourhour\:$thiscommentminuteminute\:$thiscommentsecondsecond $thiscommentampm</b><P>$thiscommenttext);
8910
8911if (($thiscommentauthoremailabsolute ne "") && ($thiscommentauthorhomepageabsolute ne "")) {
8912 print qq(<P>----------<BR>E-Mail: <A HREF="mailto:$thiscommentauthoremailabsolute">$thiscommentauthoremailabsolute</A><BR>Homepage: <A HREF="$thiscommentauthorhomepageabsolute">$thiscommentauthorhomepageabsolute</A>);
8913} else {
8914 if ($thiscommentauthoremailabsolute ne "") {
8915 print qq(<P>----------<BR>E-Mail: <A HREF="mailto:$thiscommentauthoremailabsolute">$thiscommentauthoremailabsolute</A>);
8916 }
8917 if ($thiscommentauthorhomepageabsolute ne "") {
8918 print qq(<P>----------<BR>Homepage: <A HREF="$thiscommentauthorhomepageabsolute">$thiscommentauthorhomepageabsolute</A>);
8919 }
8920}
8921
8922print qq(</FONT></TD></TR>);
8923
8924$commentcounter++;
8925
8926} until $commentcounter > $commentcountermax;
8927
8928print qq(</TABLE></TD></TR></TABLE>\n<P><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Edit Selected Comment"> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #FFD0D0" VALUE="Delete Selected Comment">\n<P>\n);
8929
8930}
8931
8932if ($thisentrypositivekarma ne "0") {
8933 print qq(<TABLE BORDER=0 cellpadding=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=0 BGCOLOR="#C0C0C0" WIDTH=658><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag Positive karma votes from (IPs): );
8934
8935 $karmatempipline = "";
8936 @karmatempiptally = split (/\|/, $entrylines[1]);
8937
8938 $gmcounter = 0;
8939
8940 foreach (@karmatempiptally) {
8941 if ($karmatempiptally[$gmcounter] eq "P") { $karmatempipline .= "$karmatempiptally[$gmcounter - 1], "; }
8942 $gmcounter++;
8943 }
8944
8945 substr($karmatempipline, -2, 2) = "";
8946
8947 print qq($karmatempipline \($thisentrypositivekarma total\)</FONT></TD></TR></TABLE></TD></TR></TABLE>\n<P>\n);
8948}
8949
8950if ($thisentrynegativekarma ne "0") {
8951 print qq(<TABLE BORDER=0 cellpadding=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=0 BGCOLOR="#D0D0D0" WIDTH=658><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag Negative karma votes from (IPs): );
8952
8953 $karmatempipline = "";
8954 @karmatempiptally = split (/\|/, $entrylines[1]);
8955
8956 $gmcounter = 0;
8957
8958 foreach (@karmatempiptally) {
8959 if ($karmatempiptally[$gmcounter] eq "N") { $karmatempipline .= "$karmatempiptally[$gmcounter - 1], "; }
8960 $gmcounter++;
8961 }
8962
8963 substr($karmatempipline, -2, 2) = "";
8964
8965 print qq($karmatempipline \($thisentrynegativekarma total\)</FONT></TD></TR></TABLE></TD></TR></TABLE>\n<P>\n);
8966}
8967
8968if (($allowkarmaorcomments eq "karma") || ($allowkarmaorcomments eq "both")) {
8969 if ($thisentryallowkarma eq "yes") {
8970 print qq(Allow karma voting on this entry: <INPUT TYPE=RADIO NAME="revisedentryallowkarma" VALUE="yes" CHECKED> Yes <INPUT TYPE=RADIO NAME="revisedentryallowkarma" VALUE="no"> No\n);
8971 } else {
8972 print qq(Allow karma voting on this entry: <INPUT TYPE=RADIO NAME="revisedentryallowkarma" VALUE="yes"> Yes <INPUT TYPE=RADIO NAME="revisedentryallowkarma" VALUE="no" CHECKED> No\n);
8973 }
8974} else {
8975 print qq(<INPUT TYPE=HIDDEN NAME="revisedentryallowkarma" VALUE="no">\n);
8976}
8977
8978if ($allowkarmaorcomments eq "both") { print "<BR>\n"; }
8979
8980if (($allowkarmaorcomments eq "comments") || ($allowkarmaorcomments eq "both")) {
8981 if ($thisentryallowcomments eq "yes") {
8982 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);
8983 } else {
8984 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);
8985 }
8986} else {
8987 print qq(<INPUT TYPE=HIDDEN NAME="revisedentryallowkarma" VALUE="no">\n);
8988}
8989
8990if (($emoticonsallowed eq "entries") || ($emoticonsallowed eq "both")) {
8991 if ($thisentryemoticonsallowed eq "yes") {
8992 print qq(Allow emoticons to be used in this entry: <INPUT TYPE=RADIO NAME="revisedentryemoticonsallowed" VALUE="yes" CHECKED> Yes <INPUT TYPE=RADIO NAME="revisedentryemoticonsallowed" VALUE="no"> No\n<BR>\n);
8993 } else {
8994 print qq(Allow emoticons to be used in this entry: <INPUT TYPE=RADIO NAME="revisedentryemoticonsallowed" VALUE="yes"> Yes <INPUT TYPE=RADIO NAME="revisedentryemoticonsallowed" VALUE="no" CHECKED> No\n<BR>\n);
8995 }
8996} else {
8997 print qq(<INPUT TYPE=HIDDEN NAME="revisedentryemoticonsallowed" VALUE="no">\n);
8998}
8999
9000
9001if ($newstayattopnumber eq $thisentrynumber) {
9002 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);
9003} else {
9004 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);
9005}
9006
9007if ($thisentryopenstatus eq "open") {
9008 print qq(This entry is: <INPUT TYPE=RADIO NAME="revisedentryopenstatus" VALUE="open" CHECKED> Open <INPUT TYPE=RADIO NAME="revisedentryopenstatus" VALUE="closed"> Closed\n);
9009} else {
9010 print qq(This entry is: <INPUT TYPE=RADIO NAME="revisedentryopenstatus" VALUE="open"> Open <INPUT TYPE=RADIO NAME="revisedentryopenstatus" VALUE="closed" CHECKED> Closed\n);
9011}
9012
9013print<<GMENTRYEDITBOTTOM;
9014
9015$autorebuildcheckbox
9016<P>
9017<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">
9018<P>
9019<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Select Another Entry">
9020<P>
9021<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0">
9022</FORM>
9023<P>
9024<FONT SIZE=1>
9025"Always changing; everything for good, nothing for nothing."—Flying Hawk, Sioux Chief
9026</FONT>
9027$gmframebottom
9028
9029</BODY>
9030</HTML>
9031
9032GMENTRYEDITBOTTOM
9033
9034exit;
9035
9036}
9037
9038# ----------------------------
9039# save changes to edited entry
9040# ----------------------------
9041
9042sub gm_saveentrychanges {
9043
9044&gm_validate;
9045
9046if ($gmentryeditaccess eq "no") {
9047 &gm_writetocplog("$IN{'authorname'} attempted to edit entry #$IN{'revisedentrynumber'} without authorization");
9048 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit entries.</FONT></B><P>);
9049 &gm_frontpage;
9050}
9051
9052if (($IN{'authorname'} ne $IN{'revisedentryauthor'}) && ($gmentryeditaccess eq "mineonly")) {
9053 &gm_writetocplog("$IN{'authorname'} attempted to edit entry #$IN{'entryselectionlist'} (by $IN{'revisedentryauthor'}) without authorization");
9054 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit entries you didn't create.</FONT></B><P>);
9055 &gm_editentryselection;
9056}
9057$IN{'revisedentrysubject'} = &relouse($IN{'revisedentrysubject'});
9058$IN{'revisedentrysubject'} = &configdelouse($IN{'revisedentrysubject'});
9059
9060if ($IN{'revisedentrymaintext'} eq "") {
9061 $statusnote = qq(<B><FONT COLOR="#FF0000">You left the main text field blank. Please try again.</FONT></B><P>);
9062 $IN{'entryselectionlist'} = $IN{'revisedentrynumber'};
9063 &gm_editthisentry;
9064}
9065
9066&gm_readconfig;
9067&gm_readtemplates;
9068&gm_readcounter;
9069
9070$thisentrynumberpadded = sprintf ("%8d", $IN{'revisedentrynumber'});
9071$thisentrynumberpadded =~ tr/ /0/;
9072
9073open (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.");
9074@entrylines = <FUNNYFEET>;
9075close (FUNNYFEET);
9076
9077$gmcounter = 0;
9078
9079foreach (@entrylines) {
9080 chomp ($entrylines[$gmcounter]);
9081 $gmcounter++;
9082}
9083
9084($thisentrynumber, $thisentryauthor, $thisentrysubject, $thisentryweekdaynumber, $thisentrymonth, $thisentryday, $thisentryyearyear, $thisentryhour, $thisentryminute, $thisentrysecond, $thisentryampm, $thisentrypositivekarma, $thisentrynegativekarma, $thisentrycommentsnumber, $thisentryallowkarma, $thisentryallowcomments, $thisentryopenstatus, $thisentrymusic, $thisentrymood, $thisentryemoticonsallowed) = split (/\|/, $entrylines[0]);
9085
9086chomp ($thisentryemoticonsallowed);
9087
9088if (($thisentryopenstatus eq "open") && ($IN{'revisedentryopenstatus'} eq "closed")) {
9089 $newalltimeopenentriesnumber--;
9090 $newalltimeclosedentriesnumber++;
9091}
9092
9093if (($thisentryopenstatus eq "closed") && ($IN{'revisedentryopenstatus'} eq "open")) {
9094 $newalltimeopenentriesnumber++;
9095 $newalltimeclosedentriesnumber--;
9096}
9097
9098$thisentryyear = substr($thisentryyearyear, -2, 2);
9099
9100@months = ("null", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
9101@weekdays = ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
9102
9103$thisentryweekday = $weekdays[$thisentryweekdaynumber];
9104$thisentrymonthword = $months[$thisentrymonth];
9105
9106$thisentrymonthmonth = sprintf ("%2d", $thisentrymonth);
9107$thisentrydayday = sprintf ("%2d", $thisentryday);
9108$thisentryhourhour = sprintf ("%2d", $thisentryhour);
9109$thisentryminuteminute = sprintf ("%2d", $thisentryminute);
9110$thisentrysecondsecond = sprintf ("%2d", $thisentrysecond);
9111$thisentrymonthmonth =~ tr/ /0/;
9112$thisentrydayday =~ tr/ /0/;
9113$thisentryhourhour =~ tr/ /0/;
9114$thisentryminuteminute =~ tr/ /0/;
9115$thisentrysecondsecond =~ tr/ /0/;
9116
9117$IN{'revisedentrysubject'} = &relouse($IN{'revisedentrysubject'});
9118$IN{'revisedentrysubject'} = &configdelouse($IN{'revisedentrysubject'});
9119$IN{'revisedentrymaintext'} = &relouse($IN{'revisedentrymaintext'});
9120$IN{'revisedentrymoretext'} = &relouse($IN{'revisedentrymoretext'});
9121$IN{'revisedentrymusic'} = &relouse($IN{'revisedentrymusic'});
9122$IN{'revisedentrymood'} = &relouse($IN{'revisedentrymood'});
9123
9124open (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.");
9125print FUNNYFEET "$thisentrynumber|$thisentryauthor|$IN{'revisedentrysubject'}|$thisentryweekdaynumber|$thisentrymonth|$thisentryday|$thisentryyearyear|$thisentryhour|$thisentryminute|$thisentrysecond|$thisentryampm|$thisentrypositivekarma|$thisentrynegativekarma|$thisentrycommentsnumber|$IN{'revisedentryallowkarma'}|$IN{'revisedentryallowcomments'}|$IN{'revisedentryopenstatus'}|$IN{'revisedentrymusic'}|$IN{'revisedentrymood'}|$IN{'revisedentryemoticonsallowed'}\n";
9126print FUNNYFEET "$entrylines[1]\n";
9127print FUNNYFEET "$IN{'revisedentrymaintext'}\n";
9128print FUNNYFEET "$IN{'revisedentrymoretext'}\n";
9129
9130if ($thisentrycommentsnumber ne "0") {
9131
9132 $commentcounter = 4;
9133 $commentcountermax = $thisentrycommentsnumber + 3;
9134
9135 do {
9136
9137 unless ($entrylines[$commentcounter] eq "") { print FUNNYFEET "$entrylines[$commentcounter]\n"; }
9138
9139 $commentcounter++;
9140
9141 } until $commentcounter > $commentcountermax;
9142
9143}
9144
9145close (FUNNYFEET);
9146
9147open (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.");
9148@originalentrylist = <FUNNYFEET>;
9149close (FUNNYFEET);
9150
9151$revisedentrymorestatus = "N";
9152if ($IN{'revisedentrymoretext'} ne "") { $revisedentrymorestatus = "Y"; }
9153$revisedentrymarkopen = "O";
9154if ($IN{'revisedentryopenstatus'} eq "closed") { $revisedentrymarkopen = "C"; }
9155
9156open (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.");
9157foreach $thisentrylistline (@originalentrylist) {
9158 chomp ($thisentrylistline);
9159 ($thisentrylistnumber, $thisentrylistauthor, $thisentrylistsubject, $thisentrylistdate, $thisentrylisttime, $thisentrylistopenstatus, $thisentrylistmorestatus, $thisentrymusic, $thisentrymood, $thisentryemoticonsallowed) = split (/\|/, $thisentrylistline);
9160 if ($thisentrylistnumber eq $IN{'revisedentrynumber'}) {
9161 print FUNNYFEET "$IN{'revisedentrynumber'}|$thisentrylistauthor|$IN{'revisedentrysubject'}|$thisentrylistdate|$thisentrylisttime|$revisedentrymarkopen|$revisedentrymorestatus|$IN{'revisedentrymusic'}|$IN{'revisedentrymood'}|$IN{'revisedentryemoticonsallowed'}\n";
9162 } else {
9163 print FUNNYFEET "$thisentrylistline\n";
9164 }
9165}
9166close (FUNNYFEET);
9167
9168if (($IN{'revisedentrystayattop'} eq "no") && ($newstayattopnumber eq $thisentrynumber)) { $newstayattopnumber = 0; }
9169
9170if ($IN{'revisedentrystayattop'} eq "yes") { $newstayattopnumber = $thisentrynumber; }
9171
9172&gm_writecounter;
9173
9174$recordentrysubject = $IN{'revisedentrysubject'};
9175if ($recordentrysubject eq "") { $recordentrysubject = "[no subject]"; }
9176
9177&gm_writetocplog("$IN{'authorname'} edited an entry (#$IN{'revisedentrynumber'}: $recordentrysubject)");
9178
9179if ($IN{'autorebuild'} eq "indexandentry") {
9180 &gm_readconfig;
9181 &gm_readcounter;
9182 &gm_readtemplates;
9183 &gm_generatemainindex;
9184 &gm_getentryvariables($IN{'revisedentrynumber'});
9185 if (($thisentryopenstatus eq "open") && ($generateentrypages eq "yes")) {
9186 if ($thisentrymorebody ne "") {
9187 &gm_formatentry($gmmoreentrypagetemplate);
9188 } else {
9189 &gm_formatentry($gmentrypagetemplate);
9190 }
9191 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.");
9192 print THISFILE $entryreturn;
9193 close (THISFILE);
9194 chmod (0666, "$EntriesPath/$thisentrynumberpadded.$entrysuffix");
9195 } else {
9196 unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix");
9197 }
9198 $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>);
9199} else {
9200 $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>);
9201}
9202
9203&gm_frontpage;
9204
9205}
9206
9207# ------------------------
9208# change entry open status
9209# ------------------------
9210
9211sub gm_changeentryopenstatus {
9212
9213&gm_validate;
9214
9215if ($gmentryeditaccess eq "no") {
9216 &gm_writetocplog("$IN{'authorname'} attempted to change the open/closed status on entry #$IN{'revisedentrynumber'} without authorization");
9217 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to open/close entries.</FONT></B><P>);
9218 &gm_frontpage;
9219}
9220
9221if ($IN{'entryselectionlist'} eq "") {
9222 $statusnote = qq(<B><FONT COLOR="#FF0000">You must select an entry to open or close.</FONT></B><P>);
9223 &gm_editentryselection;
9224}
9225
9226&gm_readconfig;
9227&gm_readtemplates;
9228&gm_readcounter;
9229
9230$thisentrynumberpadded = sprintf ("%8d", $IN{'entryselectionlist'});
9231$thisentrynumberpadded =~ tr/ /0/;
9232
9233open (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.");
9234@entrylines = <FUNNYFEET>;
9235close (FUNNYFEET);
9236
9237$gmcounter = 0;
9238
9239foreach (@entrylines) {
9240 chomp ($entrylines[$gmcounter]);
9241 $gmcounter++;
9242}
9243
9244($thisentrynumber, $thisentryauthor, $thisentrysubject, $thisentryweekdaynumber, $thisentrymonth, $thisentryday, $thisentryyearyear, $thisentryhour, $thisentryminute, $thisentrysecond, $thisentryampm, $thisentrypositivekarma, $thisentrynegativekarma, $thisentrycommentsnumber, $thisentryallowkarma, $thisentryallowcomments, $thisentryopenstatus, $thisentrymusic, $thisentrymood, $thisentryemoticonsallowed) = split (/\|/, $entrylines[0]);
9245
9246if (($IN{'authorname'} ne $thisentryauthor) && ($gmentryeditaccess eq "mineonly")) {
9247 &gm_writetocplog("$IN{'authorname'} attempted to change the open/closed status on entry #$IN{'entryselectionlist'} (by $thisentryauthor) without authorization");
9248 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to open/close entries you didn't create.</FONT></B><P>);
9249 &gm_editentryselection;
9250}
9251
9252if ($thisentryopenstatus eq "open") {
9253 $newalltimeopenentriesnumber--;
9254 $newalltimeclosedentriesnumber++;
9255 $thisentryopenstatus = "closed";
9256} else {
9257 $newalltimeopenentriesnumber++;
9258 $newalltimeclosedentriesnumber--;
9259 $thisentryopenstatus = "open";
9260}
9261
9262$gmcounter = 0;
9263
9264&gm_writecounter;
9265
9266open (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.");
9267print FUNNYFEET "$thisentrynumber|$thisentryauthor|$thisentrysubject|$thisentryweekdaynumber|$thisentrymonth|$thisentryday|$thisentryyearyear|$thisentryhour|$thisentryminute|$thisentrysecond|$thisentryampm|$thisentrypositivekarma|$thisentrynegativekarma|$thisentrycommentsnumber|$thisentryallowkarma|$thisentryallowcomments|$thisentryopenstatus|$thisentrymusic|$thisentrymood|$thisentryemoticonsallowed\n";
9268foreach (@entrylines) {
9269 unless ($gmcounter eq "0") { print FUNNYFEET "$entrylines[$gmcounter]\n"; }
9270 $gmcounter++;
9271}
9272close (FUNNYFEET);
9273
9274open (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.");
9275@originalentrylist = <FUNNYFEET>;
9276close (FUNNYFEET);
9277
9278open (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.");
9279foreach $thisentrylistline (@originalentrylist) {
9280 chomp ($thisentrylistline);
9281 ($thisentrylistnumber, $thisentrylistauthor, $thisentrylistsubject, $thisentrylistdate, $thisentrylisttime, $thisentrylistopenstatus, $thisentrylistmorestatus, $thisentrymusic, $thisentrymood, $thisentryemoticonsallowed) = split (/\|/, $thisentrylistline);
9282 if ($thisentrylistnumber eq $thisentrynumber) {
9283 if ($thisentrylistopenstatus eq "O") {
9284 $thisentrylistopenstatus = "C";
9285 } else {
9286 $thisentrylistopenstatus = "O";
9287 }
9288 print FUNNYFEET "$thisentrylistnumber|$thisentrylistauthor|$thisentrylistsubject|$thisentrylistdate|$thisentrylisttime|$thisentrylistopenstatus|$thisentrylistmorestatus|$thisentrymusic|$thisentrymood|$thisentryemoticonsallowed\n";
9289 } else {
9290 print FUNNYFEET "$thisentrylistline\n";
9291 }
9292}
9293close (FUNNYFEET);
9294
9295if ($thisentryopenstatus eq "open") {
9296 &gm_writetocplog("$IN{'authorname'} reopened an entry (#$thisentrynumber: $thisentrysubject)");
9297} else {
9298 &gm_writetocplog("$IN{'authorname'} closed an entry (#$thisentrynumber: $thisentrysubject)");
9299}
9300
9301if ($thisentryopenstatus eq "open") {
9302 $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>);
9303} else {
9304 $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>);
9305}
9306
9307&gm_editentryselection;
9308
9309}
9310
9311# -----------------------
9312# delete selected comment
9313# -----------------------
9314
9315sub gm_deleteselectedcomment {
9316
9317&gm_validate;
9318
9319if ($gmentryeditaccess eq "no") {
9320 &gm_writetocplog("$IN{'authorname'} attempted to delete a comment from entry #$IN{'revisedentrynumber'} ($IN{'revisedentrysubject'}) without authorization");
9321 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to delete comments.</FONT></B><P>);
9322 &gm_frontpage;
9323}
9324
9325if ($IN{'revisedentrycommentselection'} eq "") {
9326 $statusnote = qq(<B><FONT COLOR="#FF0000">You must select a comment to be deleted.</FONT></B><P>);
9327 &gm_editthisentry;
9328}
9329
9330if (($IN{'authorname'} ne $IN{'revisedentryauthor'}) && ($gmentryeditaccess eq "mineonly")) {
9331 &gm_writetocplog("$IN{'authorname'} attempted to delete a comment from entry #$IN{'entryselectionlist'} (by $IN{'revisedentryauthor'}) without authorization");
9332 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to delete comments from entries you didn't create.</FONT></B><P>);
9333 &gm_editentryselection;
9334}
9335
9336$deleteme = $IN{'revisedentrycommentselection'} + 3;
9337
9338$thisentrynumberpadded = sprintf ("%8d", $IN{'revisedentrynumber'});
9339$thisentrynumberpadded =~ tr/ /0/;
9340
9341open (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.");
9342@entrylines = <FUNNYFEET>;
9343close (FUNNYFEET);
9344
9345($thisentrynumber, $thisentryauthor, $thisentrysubject, $thisentryweekdaynumber, $thisentrymonth, $thisentryday, $thisentryyearyear, $thisentryhour, $thisentryminute, $thisentrysecond, $thisentryampm, $thisentrypositivekarma, $thisentrynegativekarma, $thisentrycommentsnumber, $thisentryallowkarma, $thisentryallowcomments, $thisentryopenstatus, $thisentrymusic, $thisentrymood, $thisentryemoticonsallowed) = split (/\|/, $entrylines[0]);
9346
9347if (($IN{'authorname'} ne $IN{'revisedentryauthor'} ) && ($gmentryeditaccess eq "mineonly")) {
9348 &gm_writetocplog("$IN{'authorname'} attempted to delete entry #$IN{'entryselectionlist'} (by $IN{'revisedentryauthor'}) without authorization");
9349 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to delete entries you didn't create.</FONT></B><P>);
9350 &gm_editentryselection;
9351}
9352
9353$thisentrycommentsnumber--;
9354
9355$entrylines[0] = "$thisentrynumber|$thisentryauthor|$thisentrysubject|$thisentryweekdaynumber|$thisentrymonth|$thisentryday|$thisentryyearyear|$thisentryhour|$thisentryminute|$thisentrysecond|$thisentryampm|$thisentrypositivekarma|$thisentrynegativekarma|$thisentrycommentsnumber|$thisentryallowkarma|$thisentryallowcomments|$thisentryopenstatus|$thisentrymusic|$thisentrymood|$thisentryemoticonsallowed";
9356
9357$entrylines[$deleteme] = "*DELETED*";
9358
9359open (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.");
9360foreach $revisedentryline (@entrylines) {
9361 chomp ($revisedentryline);
9362 unless ($revisedentryline eq "*DELETED*") { print FUNNYFEET "$revisedentryline\n"; }
9363}
9364close (FUNNYFEET);
9365
9366&gm_readcounter;
9367
9368$newalltimecommentstotalnumber--;
9369
9370&gm_writecounter;
9371
9372&gm_writetocplog("$IN{'authorname'} deleted a comment from entry #$IN{'revisedentrynumber'} ($IN{'revisedentrysubject'})");
9373
9374$statusnote = qq(<B><FONT COLOR="#0000FF">The comment has been deleted.</FONT></B><P>);
9375
9376$IN{'entryselectionlist'} = $IN{'revisedentrynumber'};
9377
9378&gm_editthisentry;
9379
9380}
9381
9382# ---------------------
9383# edit selected comment
9384# ---------------------
9385
9386sub gm_editselectedcomment {
9387
9388&gm_validate;
9389
9390if ($gmentryeditaccess eq "no") {
9391 &gm_writetocplog("$IN{'authorname'} attempted to edit comment #$IN{'revisedentrycommentselection'} in entry #$IN{'revisedentrynumber'} ($IN{'revisedentrysubject'}) without authorization");
9392 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit comments.</FONT></B><P>);
9393 &gm_frontpage;
9394}
9395
9396if ($IN{'revisedentrycommentselection'} eq "") {
9397 $statusnote = qq(<B><FONT COLOR="#FF0000">You must select a comment to be edited.</FONT></B><P>);
9398 $IN{'entryselectionlist'} = $IN{'revisedentrynumber'};
9399 &gm_editthisentry;
9400}
9401
9402if (($IN{'authorname'} ne $IN{'revisedentryauthor'}) && ($gmentryeditaccess eq "mineonly")) {
9403 &gm_writetocplog("$IN{'authorname'} attempted to edit a comment in entry #$IN{'entryselectionlist'} (by $IN{'revisedentryauthor'}) without authorization");
9404 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit comments in entries you didn't create.</FONT></B><P>);
9405 &gm_editentryselection;
9406}
9407
9408$thisentrynumberpadded = sprintf ("%8d", $IN{'revisedentrynumber'});
9409$thisentrynumberpadded =~ tr/ /0/;
9410
9411$editme = $IN{'revisedentrycommentselection'} + 3;
9412
9413open (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.");
9414@entrylines = <FUNNYFEET>;
9415close (FUNNYFEET);
9416
9417chomp ($entrylines[$editme]);
9418
9419$entrylines[$editme] =~ s/\|\*\|/\n/g;
9420
9421($thiscommentauthor, $thiscommentauthorip, $thiscommentauthoremailabsolute, $thiscommentauthorhomepageabsolute, $thiscommentweekdaynumber, $thiscommentmonth, $thiscommentday, $thiscommentyearyear, $thiscommenthour, $thiscommentminute, $thiscommentsecond, $thiscommentampm, $thiscommenttext) = split (/\|/, $entrylines[$editme]);
9422
9423$thiscommentmonthmonth = sprintf ("%2d", $thiscommentmonth);
9424$thiscommentdayday = sprintf ("%2d", $thiscommentday);
9425$thiscommenthourhour = sprintf ("%2d", $thiscommenthour);
9426$thiscommentminuteminute = sprintf ("%2d", $thiscommentminute);
9427$thiscommentsecondsecond = sprintf ("%2d", $thiscommentsecond);
9428$thiscommentmonthmonth =~ tr/ /0/;
9429$thiscommentdayday =~ tr/ /0/;
9430$thiscommenthourhour =~ tr/ /0/;
9431$thiscommentminuteminute =~ tr/ /0/;
9432$thiscommentsecondsecond =~ tr/ /0/;
9433$thiscommenttext = &delouse($thiscommenttext);
9434
9435if ($statusnote eq "") { $statusnote = qq(<B><FONT COLOR="#000000">Editing Comment #$IN{'revisedentrycommentselection'} In Entry #$IN{'revisedentrynumber'} ($IN{'revisedentrysubject'})</FONT></B>\n<BR>\nPosted @ $thiscommentmonthmonth/$thiscommentdayday/$thiscommentyearyear $thiscommenthourhour\:$thiscommentminuteminute\:$thiscommentsecondsecond $thiscommentampm<P>); }
9436
9437print<<GMEDITCOMMENT;
9438
9439$gmheadtag
9440
9441$gmframetop
9442$statusnote
9443<FORM ACTION="gm.cgi" METHOD=POST>
9444<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
9445<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
9446<INPUT TYPE=HIDDEN NAME="revisedentryauthor" VALUE="$IN{'revisedentryauthor'}">
9447<INPUT TYPE=HIDDEN NAME="revisedentrynumber" VALUE="$IN{'revisedentrynumber'}">
9448<INPUT TYPE=HIDDEN NAME="revisedentrysubject" VALUE="$IN{'revisedentrysubject'}">
9449<INPUT TYPE=HIDDEN NAME="entryselectionlist" VALUE="$IN{'revisedentrynumber'}">
9450<INPUT TYPE=HIDDEN NAME="revisedentrycommentselection" VALUE="$IN{'revisedentrycommentselection'}">
9451<TABLE BORDER=0 CELLPADDING=3 CELLSPACING=0><TR><TD VALIGN=MIDDLE ALIGN=RIGHT>$gmfonttag<B>Author:</B></FONT></TD><TD VALIGN=MIDDLE ALIGN=LEFT></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="revisedentrycommentauthor" VALUE="$thiscommentauthor" SIZE=45 STYLE="width: 550">$gmfonttag</TD></TR><TR><TD VALIGN=MIDDLE ALIGN=RIGHT>$gmfonttag<B>E-Mail:</B></FONT></TD><TD VALIGN=MIDDLE ALIGN=LEFT></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="revisedentrycommentauthoremail" VALUE="$thiscommentauthoremailabsolute" SIZE=45 STYLE="width: 550">$gmfonttag</TD></TR><TR><TD VALIGN=MIDDLE ALIGN=RIGHT>$gmfonttag<B>Homepage:</B></FONT></TD><TD VALIGN=MIDDLE ALIGN=LEFT></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="revisedentrycommentauthorhomepage" VALUE="$thiscommentauthorhomepageabsolute" SIZE=45 STYLE="width: 550">$gmfonttag</TD></TR></TABLE>
9452<P>
9453<B>Comment Text</B>
9454<BR>
9455</FONT><TEXTAREA NAME="revisedentrycommenttext" COLS=86 ROWS=15 WRAP=VIRTUAL STYLE="width: 720">$thiscommenttext</TEXTAREA>$gmfonttag
9456<P>
9457<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">
9458<P>
9459<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Entry Editing">
9460<P>
9461<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0">
9462</FORM>
9463<P>
9464<FONT SIZE=1>
9465"All good men are happy when they choose to be their own authors. Those who choose to have
9466<BR>
9467others edit their pathways, must live on the edge of another man's sword."—Julie Arabi
9468</FONT>
9469$gmframebottom
9470
9471</BODY>
9472</HTML>
9473
9474GMEDITCOMMENT
9475
9476exit;
9477
9478}
9479
9480# --------------------
9481# save comment changes
9482# --------------------
9483
9484sub gm_savecommentchanges {
9485
9486&gm_validate;
9487
9488if ($gmentryeditaccess eq "no") {
9489 &gm_writetocplog("$IN{'authorname'} attempted to edit comment #$IN{'revisedentrycommentselection'} in entry #$IN{'revisedentrynumber'} ($IN{'revisedentrysubject'}) without authorization");
9490 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit comments.</FONT></B><P>);
9491 &gm_frontpage;
9492}
9493
9494if (($IN{'authorname'} ne $IN{'revisedentryauthor'}) && ($gmentryeditaccess eq "mineonly")) {
9495 &gm_writetocplog("$IN{'authorname'} attempted to edit comment #$IN{'revisedentrycommentselection'} in entry #$IN{'entryselectionlist'} (by $IN{'revisedentryauthor'}) without authorization");
9496 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit comments in entries you didn't create.</FONT></B><P>);
9497 &gm_editentryselection;
9498}
9499
9500$IN{'entryselectionlist'} = $IN{'revisedentrynumber'};
9501
9502$IN{'revisedentrycommentauthor'} = &configdelouse($IN{'revisedentrycommentauthor'});
9503$IN{'revisedentrycommentauthoremail'} = &configdelouse($IN{'revisedentrycommentauthoremail'});
9504$IN{'revisedentrycommentauthorhomepage'} = &configdelouse($IN{'revisedentrycommentauthorhomepage'});
9505$IN{'revisedentrycommenttext'} = &relouse($IN{'revisedentrycommenttext'});
9506
9507if (($IN{'revisedentrycommentauthor'} eq "") || ($IN{'revisedentrycommenttext'} eq "")) {
9508 $statusnote = qq(<B><FONT COLOR="#FF0000">You left either the comment author or text blank. Please try again.</FONT></B><P>);
9509 &gm_editselectedcomment;
9510}
9511
9512$thisentrynumberpadded = sprintf ("%8d", $IN{'revisedentrynumber'});
9513$thisentrynumberpadded =~ tr/ /0/;
9514
9515open (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.");
9516@entrylines = <FUNNYFEET>;
9517close (FUNNYFEET);
9518
9519$editme = $IN{'revisedentrycommentselection'} + 3;
9520
9521chomp ($entrylines[$editme]);
9522
9523($thiscommentauthor, $thiscommentauthorip, $thiscommentauthoremailabsolute, $thiscommentauthorhomepageabsolute, $thiscommentweekdaynumber, $thiscommentmonth, $thiscommentday, $thiscommentyearyear, $thiscommenthour, $thiscommentminute, $thiscommentsecond, $thiscommentampm, $thiscommenttext) = split (/\|/, $entrylines[$editme]);
9524
9525$entrylines[$editme] = "$IN{'revisedentrycommentauthor'}|$thiscommentauthorip|$IN{'revisedentrycommentauthoremail'}|$IN{'revisedentrycommentauthorhomepage'}|$thiscommentweekdaynumber|$thiscommentmonth|$thiscommentday|$thiscommentyearyear|$thiscommenthour|$thiscommentminute|$thiscommentsecond|$thiscommentampm|$IN{'revisedentrycommenttext'}";
9526
9527$gmcounter = 0;
9528
9529open (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.");
9530foreach (@entrylines) {
9531 chomp ($entrylines[$gmcounter]);
9532 print FUNNYFEET "$entrylines[$gmcounter]\n";
9533 $gmcounter++;
9534}
9535close (FUNNYFEET);
9536
9537&gm_writetocplog("$IN{'authorname'} edited comment #$IN{'revisedentrycommentselection'} in entry #$IN{'revisedentrynumber'} ($IN{'revisedentrysubject'})");
9538
9539$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>);
9540
9541&gm_editthisentry;
9542
9543}
9544
9545# ------------------------
9546# save config file for D&R
9547# ------------------------
9548
9549sub gm_saveconfigurationdr {
9550
9551&gm_validate;
9552
9553if ($gmconfigurationaccess ne "yes") {
9554 &gm_writetocplog("$IN{'authorname'} attempted to save changes to the config file without authorization");
9555 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to change the config file.</FONT></B><P>);
9556 &gm_frontpage;
9557}
9558
9559chomp ($IN{'editedcensorlist'});
9560$IN{'editedcensorlist'} = &relouse($IN{'editedcensorlist'});
9561chomp ($IN{'editedotherfilelist'});
9562$IN{'editedotherfilelist'} = &relouse($IN{'editedotherfilelist'});
9563
9564$IN{'editedlogpath'} = &configdelouse($IN{'editedlogpath'});
9565$IN{'editedentriespath'} = &configdelouse($IN{'editedentriespath'});
9566$IN{'editedlogwebpath'} = &configdelouse($IN{'editedlogwebpath'});
9567$IN{'editedentrieswebpath'} = &configdelouse($IN{'editedentrieswebpath'});
9568$IN{'editednotifyemail'} = &configdelouse($IN{'editednotifyemail'});
9569$IN{'editedindexfilename'} = &configdelouse($IN{'editedindexfilename'});
9570$IN{'editedentrysuffix'} = &configdelouse($IN{'editedentrysuffix'});
9571$IN{'editedindexdays'} = &configdelouse($IN{'editedindexdays'});
9572$IN{'editedoffsettime'} = &configdelouse($IN{'editedoffsettime'});
9573$IN{'editedtimezone'} = &configdelouse($IN{'editedtimezone'});
9574$IN{'editedmailprog'} = &configdelouse($IN{'editedmailprog'});
9575$IN{'editedcgilocalpath'} = &configdelouse($IN{'editedcgilocalpath'});
9576$IN{'editedcgiwebpath'} = &configdelouse($IN{'editedcgiwebpath'});
9577$IN{'editedemoticonspath'} = &configdelouse($IN{'editedemoticonspath'});
9578$IN{'editedentrylistcountnumber'} = &configdelouse($IN{'editedentrylistcountnumber'});
9579$IN{'editedlogarchivesuffix'} = &configdelouse($IN{'editedlogarchivesuffix'});
9580
9581$IN{'editedcensorlist'} =~ s/^\s+//;
9582$IN{'editedcensorlist'} =~ s/\s+$//;
9583$IN{'editedotherfilelist'} =~ s/^\s+//;
9584$IN{'editedotherfilelist'} =~ s/^\s+//;
9585
9586$IN{'editedentrysuffix'} =~ s/\.//g;
9587$IN{'editednotifyemail'} =~ s/ //g;
9588$IN{'editedlogarchivesuffix'} =~ s/\.//g;
9589
9590if (($IN{'editedlogpath'} eq "") || ($IN{'editedentriespath'} eq "") || ($IN{'editedlogwebpath'} eq "") || ($IN{'editedentrieswebpath'} eq "") || ($IN{'editedindexfilename'} eq "") || ($IN{'editedentrysuffix'} eq "") || ($IN{'editedindexdays'} eq "") || ($IN{'editedoffsettime'} eq "") || ($IN{'editedtimezone'} eq "") || ($IN{'editedcgilocalpath'} eq "") || ($IN{'editedcgiwebpath'} eq "") || ($IN{'editedentrylistcountnumber'} eq "") || ($IN{'editedlogarchivesuffix'} eq "")) {
9591 $statusnote = qq(<B><FONT COLOR="#FF0000">You left one or more of the required fields blank. Please try again.</FONT></B><P>);
9592 &gm_configuration;
9593}
9594
9595if ($IN{'editedindexdays'} =~ /\D/) {
9596 $statusnote = qq(<B><FONT COLOR="#FF0000">"Days to keep on main index" must be a number.</FONT></B><P>);
9597 &gm_configuration;
9598}
9599
9600if ($IN{'editedoffsettime'} =~ /\D/) {
9601 unless ($IN{'editedoffsettime'} =~ /-/) {
9602 $statusnote = qq(<B><FONT COLOR="#FF0000">"Server Offset Time" must be a number.</FONT></B><P>);
9603 &gm_configuration;
9604 }
9605}
9606
9607if ($IN{'editeduploadfilesizelimit'} eq "") { $IN{'editeduploadfilesizelimit'} = 0; }
9608
9609if ($IN{'editeduploadfilesizelimit'} =~ /\D/) {
9610 $statusnote = qq(<B><FONT COLOR="#FF0000">"Maximum Filesize Allowed" must be a number.</FONT></B><P>);
9611 &gm_configuration;
9612}
9613
9614if (($IN{'editednotifyemail'} ne "") && ($IN{'editedmailprog'} eq "")) {
9615 $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>);
9616 &gm_configuration;
9617}
9618
9619if (($IN{'editednotifyemail'} eq "") && ($IN{'editednotifyforstatus'} ne "neither")) {
9620 $statusnote = qq(<B><FONT COLOR="#FF0000">You must give an e-mail address to receive e-mail notifications.</FONT></B><P>);
9621 &gm_configuration;
9622}
9623
9624if ($IN{'editedentrylistcountnumber'} =~ /\D/) {
9625 $statusnote = qq(<B><FONT COLOR="#FF0000">"Log entry list variable number" must be a number.</FONT></B><P>);
9626 &gm_configuration;
9627}
9628
9629$IN{'editeduploadfilesallowed'} =~ s/;/SEMICOLON/g;
9630
9631if ($IN{'editeduploadfilesallowed'} =~ /\W/) {
9632 $statusnote = qq(<B><FONT COLOR="#FF0000">"Allowed File Types" must only contain alphanumeric characters (besides semicolons).</FONT></B><P>);
9633 &gm_configuration;
9634}
9635
9636$IN{'editeduploadfilesallowed'} =~ s/SEMICOLON/;/g;
9637
9638if ($IN{'editedindexdays'} < 1) {
9639 $statusnote = qq(<B><FONT COLOR="#FF0000">"Days to keep on main index" must be set to at least one!</FONT></B><P>);
9640 &gm_configuration;
9641}
9642
9643if (substr($IN{'editedlogpath'}, -1) eq "/") { chop ($IN{'editedlogpath'}) };
9644if (substr($IN{'editedentriespath'}, -1) eq "/") { chop ($IN{'editedentriespath'}) };
9645if (substr($IN{'editedcgilocalpath'}, -1) eq "/") { chop ($IN{'editedcgilocalpath'}) };
9646if (substr($IN{'editedlogwebpath'}, -1) eq "/") { chop ($IN{'editedlogwebpath'}) };
9647if (substr($IN{'editedentrieswebpath'}, -1) eq "/") { chop ($IN{'editedentrieswebpath'}) };
9648if (substr($IN{'editedcgiwebpath'}, -1) eq "/") { chop ($IN{'editedcgiwebpath'}) };
9649if (substr($IN{'editedemoticonspath'}, -1) eq "/") { chop ($IN{'editedemoticonspath'}) };
9650
9651open (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.");
9652print FUNNYFEET "$IN{'editedlogpath'}\n";
9653print FUNNYFEET "$IN{'editedentriespath'}\n";
9654print FUNNYFEET "$IN{'editedlogwebpath'}\n";
9655print FUNNYFEET "$IN{'editedentrieswebpath'}\n";
9656print FUNNYFEET "$IN{'editednotifyemail'}\n";
9657print FUNNYFEET "$IN{'editedindexfilename'}\n";
9658print FUNNYFEET "$IN{'editedentrysuffix'}\n";
9659print FUNNYFEET "$IN{'editedindexdays'}\n";
9660print FUNNYFEET "$IN{'editedoffsettime'}\n";
9661print FUNNYFEET "$IN{'editedtimezone'}\n";
9662print FUNNYFEET "$IN{'editedkeeplog'}\n";
9663print FUNNYFEET "$IN{'editedposttoarchives'}\n";
9664print FUNNYFEET "$IN{'editedallowkarmadefault'}\n";
9665print FUNNYFEET "$IN{'editedallowcommentsdefault'}\n";
9666print FUNNYFEET "$IN{'editedcommentsorder'}\n";
9667print FUNNYFEET "$IN{'editedgenerateentrypages'}\n";
9668print FUNNYFEET "$IN{'editedallowhtmlincomments'}\n";
9669print FUNNYFEET "$IN{'editedlogkarmaandcomments'}\n";
9670print FUNNYFEET "$IN{'editedmailprog'}\n";
9671print FUNNYFEET "$IN{'editednotifyforstatus'}\n";
9672print FUNNYFEET "$IN{'editedautolinkurls'}\n";
9673print FUNNYFEET "$IN{'editedstriplinesfromcomments'}\n";
9674print FUNNYFEET "$IN{'editedallowmultiplekarmavotes'}\n";
9675print FUNNYFEET "$gmversion\n";
9676print FUNNYFEET "$IN{'editedcgilocalpath'}\n";
9677print FUNNYFEET "$IN{'editedcgiwebpath'}\n";
9678print FUNNYFEET "$IN{'editedconcurrentmainandarchives'}\n";
9679print FUNNYFEET "$IN{'editedkeeparchivemasterindex'}\n";
9680print FUNNYFEET "$IN{'editedentrylistsortorder'}\n";
9681print FUNNYFEET "$IN{'editedallowkarmaorcomments'}\n";
9682print FUNNYFEET "$IN{'editedentrylistcountnumber'}\n";
9683print FUNNYFEET "$IN{'editedcookiesallowed'}\n";
9684print FUNNYFEET "$IN{'editedlogarchivesuffix'}\n";
9685print FUNNYFEET "$IN{'editedcensorlist'}\n";
9686print FUNNYFEET "$IN{'editedcensorenabled'}\n";
9687print FUNNYFEET "$IN{'editedkeepmonthlyarchives'}\n";
9688print FUNNYFEET "$IN{'editeddefaultentrylistview'}\n";
9689print FUNNYFEET "$IN{'editedlinktocalendarentries'}\n";
9690print FUNNYFEET "$IN{'editedautomaticrebuilddefault'}\n";
9691print FUNNYFEET "$IN{'editedcommententrylistonlyifokay'}\n";
9692print FUNNYFEET "$IN{'editedotherfilelist'}\n";
9693print FUNNYFEET "$IN{'editedotherfilelistentryrebuild'}\n";
9694print FUNNYFEET "$IN{'editedarchiveformat'}\n";
9695print FUNNYFEET "$IN{'editedinlineformatting'}\n";
9696print FUNNYFEET "$IN{'editeduploadfilesallowed'}\n";
9697print FUNNYFEET "$IN{'editeduploadfilesizelimit'}\n";
9698print FUNNYFEET "$IN{'editedemoticonspath'}\n";
9699print FUNNYFEET "$IN{'editedkeepphphacklog'}\n";
9700print FUNNYFEET "$IN{'editedmailhacknotice'}\n";
9701print FUNNYFEET "$IN{'editedemoticonsallowed'}\n";
9702close (FUNNYFEET);
9703
9704if (($keeplog eq "no") && ($IN{'editedkeeplog'} eq "yes")) {
9705 &date;
9706 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.");
9707 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";
9708 close (FUNNYFEET);
9709}
9710
9711if ($IN{'editedkeeplog'} eq "no") {
9712 &gm_writetocplog("$IN{'authorname'} edited the config file for D&R\n<FONT SIZE=1>[$basedate] [$authorIP]</FONT> $IN{'authorname'} decided to stop this log from getting down with its bad-ass self");
9713} else {
9714 &gm_writetocplog("$IN{'authorname'} edited the config file for D&R");
9715}
9716
9717}
9718
9719# ----------------------------
9720# diagnostics & repair - check
9721# ----------------------------
9722
9723sub gm_diagnosticscheck {
9724
9725&gm_saveconfigurationdr;
9726&gm_validate;
9727
9728if ($gmconfigurationaccess ne "yes") {
9729 &gm_writetocplog("$IN{'authorname'} attempted to perform diagnostics & repair without authorization");
9730 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to perform diagnostics & repair.</FONT></B><P>);
9731 &gm_frontpage;
9732}
9733
9734print<<GMDIAGNOSTICSCHECK;
9735
9736$gmheadtag
9737$gmframetop
9738<B>Diagnostics & Repair</B>
9739<P>
9740This 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=1 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: #C0C0C0"></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>
9741$gmframebottom
9742
9743</BODY>
9744</HTML>
9745
9746GMDIAGNOSTICSCHECK
9747
9748exit;
9749
9750}
9751
9752# ------------------------------
9753# diagnostics & repair - perform
9754# ------------------------------
9755
9756sub gm_diagnosticsperform {
9757
9758&gm_validate;
9759
9760if ($gmconfigurationaccess ne "yes") {
9761 &gm_writetocplog("$IN{'authorname'} attempted to perform diagnostics & repair without authorization");
9762 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to perform diagnostics & repair.</FONT></B><P>);
9763 &gm_frontpage;
9764}
9765
9766$docreport = "<UL>\n";
9767
9768open (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.");
9769@nowherefile = <NOWHEREMAN>;
9770close (NOWHEREMAN);
9771
9772chmod (0666, "gm-authors.cgi");
9773
9774open (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.");
9775print NOWHEREMAN @nowherefile;
9776close (NOWHEREMAN);
9777
9778open (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.");
9779@nowherefile = <NOWHEREMAN>;
9780close (NOWHEREMAN);
9781
9782chmod (0666, "gm-banlist.cgi");
9783
9784open (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.");
9785print NOWHEREMAN @nowherefile;
9786close (NOWHEREMAN);
9787
9788open (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.");
9789@nowherefile = <NOWHEREMAN>;
9790close (NOWHEREMAN);
9791
9792chmod (0666, "gm-config.cgi");
9793
9794open (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.");
9795print NOWHEREMAN @nowherefile;
9796close (NOWHEREMAN);
9797
9798open (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.");
9799@nowherefile = <NOWHEREMAN>;
9800close (NOWHEREMAN);
9801
9802chmod (0666, "gm-counter.cgi");
9803
9804open (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.");
9805print NOWHEREMAN @nowherefile;
9806close (NOWHEREMAN);
9807
9808open (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.");
9809@nowherefile = <NOWHEREMAN>;
9810close (NOWHEREMAN);
9811
9812chmod (0666, "gm-cplog.cgi");
9813
9814open (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.");
9815print NOWHEREMAN @nowherefile;
9816close (NOWHEREMAN);
9817
9818open (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.");
9819@nowherefile = <NOWHEREMAN>;
9820close (NOWHEREMAN);
9821
9822chmod (0666, "gm-entrylist.cgi");
9823
9824open (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.");
9825print NOWHEREMAN @nowherefile;
9826close (NOWHEREMAN);
9827
9828open (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.");
9829@nowherefile = <NOWHEREMAN>;
9830close (NOWHEREMAN);
9831
9832chmod (0666, "gm-templates.cgi");
9833
9834open (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.");
9835print NOWHEREMAN @nowherefile;
9836close (NOWHEREMAN);
9837
9838$docreport .= "<LI> All config files are readable/writeable and are CHMODed correctly\n";
9839
9840if (!(open(NOWHEREMAN,"$cgilocalpath/gm-karma.cgi"))) {
9841 &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.");
9842}
9843close(NOWHEREMAN);
9844
9845if (!(open(NOWHEREMAN,"$cgilocalpath/gm-comments.cgi"))) {
9846 &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.");
9847}
9848close(NOWHEREMAN);
9849
9850if (!(open(NOWHEREMAN,"$cgilocalpath/gm-upload.cgi"))) {
9851 &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.");
9852}
9853close(NOWHEREMAN);
9854
9855if (!(open(NOWHEREMAN,"$cgilocalpath/gm-library.cgi"))) {
9856 &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.");
9857}
9858close(NOWHEREMAN);
9859
9860$docreport .= "<LI> The local CGI path is correctly configured and all essential files are there\n";
9861
9862open (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.");
9863print NOWHEREMAN "test";
9864close (NOWHEREMAN);
9865
9866unlink ("$EntriesPath/gm-testfile.txt") || &gm_dangermouse("Can't delete the gm-testfile.txt file created in $EntriesPath. Your server may not support this operation.");
9867
9868$docreport .= "<LI> The entries/archives path is readable/writeable and is CHMODed correctly\n";
9869
9870chmod (0666, "$EntriesPath/$indexfilename");
9871
9872unless (!(open(NOWHERETEMP,"$EntriesPath/$indexfilename"))) {
9873
9874 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.");
9875 @nowhereland = <NOWHEREMAN>;
9876 close (NOWHEREMAN);
9877
9878 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.");
9879 print NOWHEREMAN @nowhereland;
9880 close (NOWHEREMAN);
9881
9882$docreport .= "<LI> The archive index file is readable/writeable and is CHMODed correctly\n";
9883
9884}
9885
9886close(NOWHERETEMP);
9887
9888&gm_readcounter;
9889
9890$oldentrynumbercount = $newentrynumber;
9891$countentriesfromhere = 5000;
9892$foundtopentry = "no";
9893
9894# 00000000.cgi can't be read fix: linear 9/3/2003
9895# merged into 1.3
9896do {
9897 $countentriesfromherepadded = sprintf ("%8d", $countentriesfromhere);
9898 $countentriesfromherepadded =~ tr/ /0/;
9899 if ($countentriesfromhere eq "0") {
9900 $newentrynumber = "0";
9901 $foundtopentry = "yes";
9902 }
9903 if (-e "$EntriesPath/$countentriesfromherepadded.cgi") {
9904 $newentrynumber = $countentriesfromhere;
9905 $foundtopentry = "yes";
9906 }
9907 $countentriesfromhere--;
9908} until $foundtopentry eq "yes";
9909# merged 9/11/2003
9910
9911&gm_writecounter;
9912
9913if ($oldentrynumbercount ne $newentrynumber) {
9914 $docreport .= "<LI> The counter was successfully repaired\n";
9915 &gm_generatemainindex;
9916}
9917
9918if ($newentrynumber ne "0") {
9919 $checkentrycounter = $newentrynumber;
9920 $docreportentryappend = "no";
9921 do {
9922 $checkentrycounterpadded = sprintf ("%8d", $checkentrycounter);
9923 $checkentrycounterpadded =~ tr/ /0/;
9924 $makedummyentry = "no";
9925 if (!(open(ENTRYCHECK,"$EntriesPath/$checkentrycounterpadded.cgi"))) { $makedummyentry = "yes"; }
9926 close(ENTRYCHECK);
9927 if (($makedummyentry eq "yes") && ($checkentrycounter ne "0")) {
9928 &date;
9929 $thisnewwday = $wday;
9930 $thisnewmon = $mon;
9931 $thisnewmday = $mday;
9932 $thisnewyear = $JSYear;
9933 $thisnewhour = $hour;
9934 $thisnewmin = $min;
9935 $thisnewsec = $sec;
9936 $thisnewampm = $AMPM;
9937 if ($checkentrycounter ne $newentrynumber) {
9938 $nextentrynumber = $thisentrynumber + 1;
9939 $nextentrynumberpadded = sprintf ("%8d", $nextentrynumber);
9940 $nextentrynumberpadded =~ tr/ /0/;
9941 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.");
9942 @nextentrylines = <FUNNYFEET>;
9943 close (FUNNYFEET);
9944 ($nextentrynumber, $nextentryauthor, $nextentrysubject, $nextentryweekdaynumber, $nextentrymonth, $nextentryday, $nextentryyearyear, $nextentryhour, $nextentryminute, $nextentrysecond, $nextentryampm, $nextentrypositivekarma, $nextentrynegativekarma, $nextentrycommentsnumber, $nextentryallowkarma, $nextentryallowcomments, $nextentryopenstatus, $nextentrymusic, $nextentrymood, $nextentryemoticonsallowed) = split (/\|/, $nextentrylines[0]);
9945 $thisnewwday = $nextentryweekdaynumber;
9946 $thisnewmon = $nextentrymonth;
9947 $thisnewmday = $nextentryday;
9948 $thisnewyear = $nextentryyearyear;
9949 $thisnewhour = $nextentryhour;
9950 $thisnewmin = $nextentryminute;
9951 $thisnewsec = $nextentrysecond;
9952 $thisnewampm = $nextentryampm;
9953 } elsif ($checkentrycounter ne "1") {
9954 $previousentrynumber = $thisentrynumber - 1;
9955 $previousentrynumberpadded = sprintf ("%8d", $previousentrynumber);
9956 $previousentrynumberpadded =~ tr/ /0/;
9957 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.");
9958 @previousentrylines = <FUNNYFEET>;
9959 close (FUNNYFEET);
9960 ($previousentrynumber, $previousentryauthor, $previousentrysubject, $previousentryweekdaynumber, $previousentrymonth, $previousentryday, $previousentryyearyear, $previousentryhour, $previousentryminute, $previousentrysecond, $previousentryampm, $previousentrypositivekarma, $previousentrynegativekarma, $previousentrycommentsnumber, $previousentryallowkarma, $previousentryallowcomments, $previousentryopenstatus, $previousentrymusic, $previousentrymood, $previousentryemoticonsallowed) = split (/\|/, $previousentrylines[0]);
9961 $thisnewwday = $previousentryweekdaynumber;
9962 $thisnewmon = $previousentrymonth;
9963 $thisnewmday = $previousentryday;
9964 $thisnewyear = $previousentryyearyear;
9965 $thisnewhour = $previousentryhour;
9966 $thisnewmin = $previousentryminute;
9967 $thisnewsec = $previousentrysecond;
9968 $thisnewampm = $previousentryampm;
9969 }
9970 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.");
9971 print FUNNYFEET "$checkentrycounter|Greymatter|*Repaired*|$thisnewwday|$thisnewmon|$thisnewmday|$thisnewyear|$thisnewhour|$thisnewmin|$thisnewsec|$thisnewampm|0|0|0|no|no|closed\n";
9972 print FUNNYFEET "0.0.0.0|I\n";
9973 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";
9974 print FUNNYFEET "\n";
9975 close (FUNNYFEET);
9976 $docreportentryappend = "yes";
9977 $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";
9978 }
9979 chmod (0666, "$EntriesPath/$checkentrycounterpadded.cgi");
9980 $checkentrycounter--;
9981 } until $checkentrycounter eq "0";
9982 $docreport .= "<LI> All entry files are working correctly\n";
9983}
9984
9985if ($newentrynumber ne "0") {
9986 $checkentrycounter = $newentrynumber;
9987 $rebuiltentrylist = "";
9988 do {
9989 $checkentrycounterpadded = sprintf ("%8d", $checkentrycounter);
9990 $checkentrycounterpadded =~ tr/ /0/;
9991 &gm_getentryvariables($checkentrycounter);
9992 $checkentryopenstatus = "O";
9993 $checkentrymorestatus = "N";
9994 if ($thisentryopenstatus eq "closed") { $checkentryopenstatus = "C"; }
9995 if ($thisentrymorebody ne "") { $checkentrymorestatus = "Y"; }
9996 $rebuiltentrylist .= "$thisentrynumber|$thisentryauthor|$thisentrysubject|$thisentrymonthmonth\/$thisentrydayday\/$thisentryyear|$thisentryhourhour\:$thisentryminuteminute $thisentryampm|$checkentryopenstatus|$checkentrymorestatus|$thisentrymusic|$thisentrymood|$thisentryemoticonsallowed\n";
9997 $checkentrycounter--;
9998 } until $checkentrycounter eq "0";
9999 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.");
10000 print FUNNYFEET $rebuiltentrylist;
10001 close (FUNNYFEET);
10002 $docreport .= "<LI> The entry list was successfully rebuilt\n"
10003}
10004
10005open (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.");
10006@nowhereland = <NOWHEREMAN>;
10007close (NOWHEREMAN);
10008
10009chmod (0666, "$LogPath/$indexfilename");
10010
10011open (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.");
10012print NOWHEREMAN @nowhereland;
10013close (NOWHEREMAN);
10014
10015$docreport .= "<LI> The main index file is readable/writeable and is CHMODed correctly\n";
10016
10017if ($otherfilelist ne "") {
10018 @connectedfilelist = split (/\|\*\|/, $otherfilelist);
10019 foreach $usethisfilename (@connectedfilelist) {
10020 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.");
10021 @connectedfilelines = <NOWHEREMAN>;
10022 close (NOWHEREMAN);
10023 chmod (0666, "$usethisfilename");
10024 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.");
10025 print NOWHEREMAN @connectedfilelines;
10026 close (NOWHEREMAN);
10027 }
10028 $docreport .= "<LI> All connected files are readable/writeable and are CHMODed correctly\n";
10029}
10030
10031&date;
10032open (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.");
10033print FUNNYFEET "<FONT SIZE=1>[$basedate] [$authorIP]</FONT> $IN{'authorname'} successfully performed diagnostics & repair\n";
10034close (FUNNYFEET);
10035
10036print<<GMDIAGNOSTICSFINISHED;
10037
10038$gmheadtag
10039$gmframetop
10040<FONT COLOR="#0000FF"><B>Diagnostics & Repair Complete</B></FONT>
10041<P>
10042All operations were completed successfully. Greymatter successfully checked and/or performed the following:
10043<P>
10044<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD ALIGN=LEFT>$gmfonttag$docreport</FONT></TD></TR></TABLE>
10045<P>
10046<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: #C0C0C0"></FORM></P><P ALIGN=CENTER><FONT SIZE=1>"Old houses mended, cost little less than new before they're ended."—Colley Cibber</FONT>
10047$gmframebottom
10048
10049</BODY>
10050</HTML>
10051
10052GMDIAGNOSTICSFINISHED
10053
10054exit;
10055
10056}
10057
10058# ----------------
10059# add bookmarklets
10060# ----------------
10061
10062sub gm_addbookmarklets {
10063
10064&gm_validate;
10065
10066if ($gmbookmarkletaccess ne "yes") {
10067 &gm_writetocplog("$IN{'authorname'} attempted to add bookmarklets without authorization");
10068 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to use bookmarklets.</FONT></B><P>);
10069 &gm_frontpage;
10070}
10071
10072&gm_readcounter;
10073
10074if ($newentrynumber eq "0") {
10075 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.");
10076 @cploglines = <FUNNYFEET>;
10077 close (FUNNYFEET);
10078 $cplogtext = join (" ", @cploglines);
10079 unless ($cplogtext =~ /successfully performed diagnostics/) {
10080 $statusnote = qq(<B><FONT COLOR="#FF0000">Please run "Diagnostics & Repair" in the Configuration screen before adding bookmarklets.</FONT></B><P>);
10081 &gm_frontpage;
10082 }
10083}
10084
10085if (($IN{'authorname'} eq "Alice") && ($IN{'authorpassword'} eq "wonderland")) {
10086 $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>);
10087 &gm_frontpage;
10088}
10089
10090$gmbookmarkletline = "@=\"javascript:doc=external.menuArguments.document;lt=escape(doc.selection.createRange().text);loglink=escape(doc.location.href);loglinktitle=escape(doc.title);wingm=window.open('";
10091$gmbookmarkletline .= $cgiwebpath;
10092$gmbookmarkletline .= "/gm.cgi?thomas=gmbmpost&authorname=";
10093$gmbookmarkletline .= $IN{'authorname'};
10094$gmbookmarkletline .= "&authorpassword=";
10095$gmbookmarkletline .= $IN{'authorpassword'};
10096$gmbookmarkletline .= "&logtext='+lt+'&loglink='+loglink+'&loglinktitle='+loglinktitle,'gmwindow','scrollbars=yes,width=750,height=460,left=75,top=75,status=yes,resizable=yes');wingm.focus();\"";
10097
10098$usethisauthorname = int(rand 999999) + 1;
10099
10100open (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.");
10101print FUNNYFEET "REGEDIT4\n";
10102print FUNNYFEET "[HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\MenuExt\\Post To &Greymatter]\n";
10103print FUNNYFEET "$gmbookmarkletline\n";
10104print FUNNYFEET "\"contexts\"=hex:31";
10105close (FUNNYFEET);
10106
10107if ($statusnote eq "") { $statusnote = qq(<B><FONT COLOR="#000000">Add Bookmarklets (Internet Explorer 5+ Only)</FONT></B><P>); }
10108
10109&gm_readconfig;
10110
10111&gm_writetocplog("$IN{'authorname'} added a bookmarklet");
10112
10113print<<GMADDBOOKMARKLETS;
10114
10115$gmheadtag
10116
10117$gmframetop
10118$statusnote
10119<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
10120<!--
10121function installrightclickposting() {
10122 if (confirm("This will update your Windows registry. Are you sure?")) location.href="$EntriesWebPath/gmrightclick-$usethisauthorname.reg"
10123}
10124-->
10125</SCRIPT>
10126<P ALIGN=JUSTIFY>
10127Installing 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.)
10128</P><P ALIGN=JUSTIFY>
10129To install the standard bookmarklet, just drag the following link to your browser's menu or toolbar:
10130</P><P ALIGN=CENTER><CENTER>
10131<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=750,height=460,left=75,top=75,resizable=yes,status=yes'));gmwindow.focus();">Post To Greymatter</A></B>
10132</CENTER></P><P ALIGN=JUSTIFY>
10133Even 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.
10134</P><P ALIGN=CENTER><CENTER>
10135<B><A HREF="javascript:installrightclickposting()">Install Right-Click Menu Access</A></B>
10136</CENTER></P><P ALIGN=JUSTIFY>
10137Finally, 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 registry—you can mess up your computer if you do this wrong.)
10138</P><P ALIGN=JUSTIFY>
10139And 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. =)
10140</P><P ALIGN=CENTER><CENTER>
10141<FORM ACTION="gm.cgi" METHOD=POST>
10142<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
10143<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
10144<INPUT TYPE=HIDDEN NAME="usethisauthorname" VALUE="$usethisauthorname">
10145<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Clear And Exit">
10146</FORM>
10147<FONT SIZE=1>"We aim above the mark to hit the mark."—R.W. Emerson</FONT>
10148</CENTER></P>
10149$gmframebottom
10150
10151</BODY>
10152</HTML>
10153
10154GMADDBOOKMARKLETS
10155
10156exit;
10157
10158}
10159
10160# ------------
10161# upload files
10162# ------------
10163
10164sub gm_uploadfiles {
10165
10166&gm_validate;
10167
10168if ($gmuploadaccess ne "yes") {
10169 &gm_writetocplog("$IN{'authorname'} attempted to upload files without authorization");
10170 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to upload files.</FONT></B><P>);
10171 &gm_frontpage;
10172}
10173
10174&gm_readcounter;
10175
10176if ($newentrynumber eq "0") {
10177 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.");
10178 @cploglines = <FUNNYFEET>;
10179 close (FUNNYFEET);
10180 $cplogtext = join (" ", @cploglines);
10181 unless ($cplogtext =~ /successfully performed diagnostics/) {
10182 $statusnote = qq(<B><FONT COLOR="#FF0000">Please run "Diagnostics & Repair" in the Configuration screen before uploading files.</FONT></B><P>);
10183 &gm_frontpage;
10184 }
10185}
10186
10187if ($uploadfilesallowed ne "") {
10188 $howmanyfiletypes = 0;
10189 @uploadfiletypesallowed = split (/;/, $uploadfilesallowed);
10190 foreach $thisfiletype (@uploadfiletypesallowed) {
10191 $allowthesefiletypes .= ".$thisfiletype, ";
10192 }
10193 $allowthesefiletypes =~ s/, .(\w+), $/ and .$1/;
10194 $allowthesefiletypes =~ s/, $//;
10195}
10196
10197if (($uploadfilesallowed ne "") && ($uploadfilesizelimit ne "0")) {
10198 $specialuploadtext = "Only $allowthesefiletypes files may currently be uploaded,<BR>and no file larger than $uploadfilesizelimit\k may be uploaded.<P>";
10199} elsif ($uploadfilesallowed ne "") {
10200 $specialuploadtext = "Only $allowthesefiletypes files may currently be uploaded.<P>";
10201} elsif ($uploadfilesizelimit ne "0") {
10202 $specialuploadtext = "No file larger than $uploadfilesizelimit\k may currently be uploaded.<P>";
10203} else {
10204 $specialuploadtext = "";
10205}
10206
10207if ($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); }
10208
10209&gm_readconfig;
10210
10211$insertauthorname = $IN{'authorname'};
10212$insertauthorpassword = $IN{'authorpassword'};
10213
10214print<<GMUPLOADFILES;
10215
10216$gmheadtag
10217
10218$gmframetop
10219$statusnote
10220<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript1.2">
10221<!--//
10222document.write('<FORM ENCTYPE="multipart/form-data" ACTION="gm-upload.cgi" METHOD=POST><INPUT TYPE=HIDDEN NAME="authorname" VALUE="$insertauthorname"><INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$insertauthorpassword"><INPUT TYPE=FILE CLASS="textinput" NAME="uploadfile-01" SIZE="40"><P><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Upload This File"></FORM><P>');
10223//-->
10224</SCRIPT>
10225<FORM ACTION="gm.cgi" METHOD=POST>
10226<INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}">
10227<INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}">
10228<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0">
10229</FORM>
10230<FONT SIZE=1>"Our life is composed greatly from dreams, from the unconscious, and they must be brought<BR>into connection with action. They must be woven together."—Anaïs Nin</FONT>
10231$gmframebottom
10232</BODY>
10233</HTML>
10234
10235GMUPLOADFILES
10236
10237exit;
10238
10239}
10240
10241# ----------------
10242# version checking
10243# ----------------
10244
10245sub gm_versioncheck {
10246
10247if ($versionsetup ne $gmversion) {
10248
10249print<<GMVERSIONCHECKTOP;
10250
10251$gmheadtag
10252$gmframetop
10253
10254GMVERSIONCHECKTOP
10255
10256if ($versionsetup eq "one point zero") {
10257 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>);
10258} elsif ($versionsetup eq "1.1") {
10259 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>);
10260} elsif ($versionsetup eq "1.2") {
10261 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>);
10262} elsif ($versionsetup eq "1.21") {
10263 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>);
10264} elsif ($versionsetup eq "1.21a") {
10265 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>);
10266} elsif ($versionsetup eq "1.21b") {
10267 print qq(Greymatter has detected that you are upgrading from version 1.21b. Version 1.3.1 is a minor release with several new variables. A few new config options are also available.<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>);
10268} elsif ($versionsetup eq "1.21c") {
10269 print qq(Greymatter has detected that you are upgrading from version 1.21c. Version 1.3.1 is a minor release with several new variables. A few new config options are also available.<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>);
10270} elsif ($versionsetup eq "1.21d") {
10271 print qq(Greymatter has detected that you are upgrading from version 1.21d. Version 1.3.1 is a minor release with several new variables. A few new config options are also available.<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>);
10272} elsif ($versionsetup eq "1.21e") {
10273 print qq(Greymatter has detected that you are upgrading from version 1.21e. Version 1.3.1 is a minor release with several new variables. A few new config options are also available.<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>);
10274} elsif ($versionsetup eq "1.3") {
10275 print qq(Greymatter has detected that you are upgrading from version 1.3. Version 1.3.1 is a minor release with several new variables. A few new config options are also available.<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>);
10276} elsif ($versionsetup eq "1.3a") {
10277 print qq(Greymatter has detected that you are upgrading from version 1.3a. Version 1.3.1 is a minor release with several new variables. A few new config options are also available.<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>);
10278} else {
10279 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.);
10280}
10281
10282print<<GMVERSIONCHECKBOTTOM;
10283
10284$gmframebottom
10285
10286</BODY>
10287</HTML>
10288
10289GMVERSIONCHECKBOTTOM
10290
10291exit;
10292
10293}
10294
10295}
10296
10297# -----------------
10298# version upgrading
10299# -----------------
10300
10301sub gm_versionupgrading {
10302
10303if ($IN{'oldsetupversion'} eq "one point zero") {
10304 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.");
10305 @tempnewentrylist = <FUNNYFEET>;
10306 close (FUNNYFEET);
10307 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.");
10308 foreach $tempnewentrylistline (@tempnewentrylist) {
10309 chomp ($tempnewentrylistline);
10310 ($templistnumber, $templistauthorname, $templistsubject, $templistdate, $templisttime, $templistopenstatus) = split (/\|/, $tempnewentrylistline);
10311 $templistopenstatus = "O";
10312 if ($templistopenstatus eq "closed") { $templistopenstatus = "C"; }
10313 $templistmorestatus = "N";
10314 &gm_getentryvariables($templistnumber);
10315 if ($thisentrymorebody ne "") { $templistmorestatus = "Y"; }
10316 print FUNNYFEETWO "$templistnumber|$templistauthorname|$templistsubject|$templistdate|$templisttime|$templistopenstatus|$templistmorestatus\n";
10317 }
10318 close (FUNNYFEETWO);
10319 &gm_readtemplates;
10320 $gmentrytemplate =~ s/\n/\|\*\|/g;
10321 $gmentrypagetemplate =~ s/\n/\|\*\|/g;
10322 $gmarchiveentrypagetemplate =~ s/\n/\|\*\|/g;
10323 $gmarchiveentrytemplate =~ s/\n/\|\*\|/g;
10324 $gmdatetemplate =~ s/\n/\|\*\|/g;
10325 open (FUNNYFEETHREE, ">>gm-templates.cgi");
10326 print FUNNYFEETHREE "$gmentrytemplate\n";
10327 print FUNNYFEETHREE "$gmentrypagetemplate\n";
10328 print FUNNYFEETHREE "$gmarchiveentrypagetemplate\n";
10329 print FUNNYFEETHREE qq([{{pagepreviouslink}}Previous entry: "{{previousentrysubject}}"</A>]\n);
10330 print FUNNYFEETHREE qq([{{pagenextlink}}Next entry: "{{nextentrysubject}}"</A>]\n);
10331 print FUNNYFEETHREE qq([{{pagemorepreviouslink}}Previous extended entry: "{{previousmoreentrysubject}}"</A>]\n);
10332 print FUNNYFEETHREE qq([{{pagemorenextlink}}Next extended entry: "{{nextmoreentrysubject}}"</A>]\n);
10333 print FUNNYFEETHREE qq(<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">|*|<HTML>|*|<HEAD>|*|<TITLE>My Archives</TITLE>|*|<META NAME="Generator" CONTENT="Greymatter 1.1">|*|</HEAD>|*||*|<BODY BGCOLOR="#FFFFFF">|*||*|<P ALIGN=CENTER>|*|{{header}}|*|</P><P ALIGN=CENTER>|*|<FONT SIZE=4><B>My Archives</B></FONT>|*|</P>|*||*|<P ALIGN=CENTER>|*|<B>Log Archives</B>|*|</P><P ALIGN=CENTER>|*|{{logarchivelist}}|*|</P><P ALIGN=CENTER>|*|<B>Entries</B>|*|</P><P ALIGN=CENTER>|*|{{logentrylist}}|*|</P>|*||*|<P ALIGN=CENTER>|*|[{{pageindexlink}}Main Index</A>]|*|</P><P ALIGN=CENTER>|*|{{gmicon}}|*|</P><P ALIGN=CENTER>|*|{{footer}}|*|</P>|*||*|</BODY>|*|</HTML>\n);
10334 print FUNNYFEETHREE qq({{pagearchivelogindexlink}}Log Archives: {{monthword}} {{yearyear}}</A>\n);
10335 print FUNNYFEETHREE qq({{pagelink}}{{monthmonth}}/{{dayday}}/{{yearyear}}: {{entrysubject}}</A>\n);
10336 print FUNNYFEETHREE qq(<B>{{pagelink}}{{monthmonth}}/{{dayday}}/{{yearyear}}: {{entrysubject}}</A></B>\n);
10337 print FUNNYFEETHREE qq( / \n);
10338 print FUNNYFEETHREE qq(<BR>\n);
10339 print FUNNYFEETHREE "<P>\n";
10340 print FUNNYFEETHREE "<br />\n";
10341 print FUNNYFEETHREE "<P>\n";
10342 print FUNNYFEETHREE "\n";
10343 print FUNNYFEETHREE "\n";
10344 print FUNNYFEETHREE "\n";
10345 print FUNNYFEETHREE qq( onMouseOver="window.status='{{monthmonth}}/{{dayday}}/{{yearyear}}: {{entrysubject}}';return true" onMouseOut="window.status='';return true"\n);
10346 print FUNNYFEETHREE "\n";
10347 print FUNNYFEETHREE "\n";
10348 print FUNNYFEETHREE "$gmarchiveentrytemplate\n";
10349 print FUNNYFEETHREE "$gmdatetemplate\n";
10350 close (FUNNYFEETHREE);
10351 open (FUNNYFEETFOUR, ">>gm-config.cgi");
10352 print FUNNYFEETFOUR "yes\n";
10353 print FUNNYFEETFOUR "ascending\n";
10354 print FUNNYFEETFOUR "both\n";
10355 print FUNNYFEETFOUR "10\n";
10356 close (FUNNYFEETFOUR);
10357 &gm_readconfig;
10358 $versionsetup = $gmversion;
10359 &gm_writeconfig;
10360}
10361
10362if (($IN{'oldsetupversion'} eq "one point zero") || ($IN{'oldsetupversion'} eq "1.1")) {
10363 &gm_readtemplates;
10364 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.");
10365 @gmtemplateline = <LAUGHINGFEET>;
10366 close (LAUGHINGFEET);
10367 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.");
10368 foreach $thistemplateline (@gmtemplateline) {
10369 chomp ($thistemplateline);
10370 unless ($thistemplateline eq "") {
10371 $authoremaillinkreplacement = qq(<A HREF="mailto:{{authoremail}}">);
10372 $authorhomepagelinkreplacement = qq(<A HREF="mailto:{{authorhomepage}}">);
10373 $commentauthoremaillinkreplacement = qq(<A HREF="mailto:{{commentauthoremailabsolute}}">);
10374 $commentauthorhomepagelinkreplacement = qq(<A HREF="mailto:{{commentauthorhomepageabsolute}}">);
10375 $commentspostlinkreplacement = qq(<A HREF="{{commentspostlink}}"$gmcustomlinktemplate>);
10376 $pagelinkreplacement = qq(<A HREF="{{pagelink}}"$gmcustomlinktemplate>);
10377 $pageindexlinkreplacement = qq(<A HREF="{{pageindexlink}}">);
10378 $pagearchiveindexlinkreplacement = qq(<A HREF="{{pagearchiveindexlink}}">);
10379 $pagearchivelogindexlinkreplacement = qq(<A HREF="{{pagearchivelogindexlink}}">);
10380 $pagenextlinkreplacement = qq(<A HREF="{{nextpagelink}}" onMouseOver="window.status='{{nextmonthmonth}}/{{nextdayday}}/{{nextyear}}: {{nextentrysubject}}';return true" onMouseOut="window.status='';return true">);
10381 $pagenextmorelinkreplacement = qq(<A HREF="{{nextmorepagelink}}" onMouseOver="window.status='{{nextmoremonthmonth}}/{{nextmoredayday}}/{{nextmoreyear}}: {{nextmoreentrysubject}}';return true" onMouseOut="window.status='';return true">);
10382 $pagepreviouslinkreplacement = qq(<A HREF="{{previouspagelink}}" onMouseOver="window.status='{{previousmonthmonth}}/{{previousdayday}}/{{previousyear}}: {{previousentrysubject}}';return true" onMouseOut="window.status='';return true">);
10383 $pagepreviousmorelinkreplacement = qq(<A HREF="{{previousmorepagelink}}" onMouseOver="window.status='{{previousmoremonthmonth}}/{{previousmoredayday}}/{{previousmoreyear}}: {{previousmoreentrysubject}}';return true" onMouseOut="window.status='';return true">);
10384 $pagesmartindexlinkreplacement = qq(<A HREF="{{pagesmartindexlink}}">);
10385 $pagepositivekarmalinkreplacement = qq(<A HREF="{{positivekarmalink}}" onMouseOver="window.status='Cast a positive vote on this entry';return true" onMouseOut="window.status='';return true">);
10386 $pagenegativekarmalinkreplacement = qq(<A HREF="{{negativekarmalink}}" onMouseOver="window.status='Cast a negative vote on this entry';return true" onMouseOut="window.status='';return true">);
10387 $thistemplateline =~ s/{{authoremaillink}}/$authoremaillinkreplacement/ig;
10388 $thistemplateline =~ s/{{authorhomepagelink}}/$authorhomepagelinkreplacement/ig;
10389 $thistemplateline =~ s/{{commentauthoremaillink}}/$commentauthoremaillinkreplacement/ig;
10390 $thistemplateline =~ s/{{commentauthorhomepagelink}}/$commentauthorhomepagelinkreplacement/ig;
10391 $thistemplateline =~ s/{{commentspostlink}}/$commentspostlinkreplacement/ig;
10392 $thistemplateline =~ s/{{pagelink}}/$pagelinkreplacement/ig;
10393 $thistemplateline =~ s/{{pageindexlink}}/$pageindexlinkreplacement/ig;
10394 $thistemplateline =~ s/{{pagearchiveindexlink}}/$pagearchiveindexlinkreplacement/ig;
10395 $thistemplateline =~ s/{{pagearchivelogindexlink}}/$pagearchivelogindexlinkreplacement/ig;
10396 $thistemplateline =~ s/{{pagenextlink}}/$pagenextlinkreplacement/ig;
10397 $thistemplateline =~ s/{{pagenextmorelink}}/$pagenextmorelinkreplacement/ig;
10398 $thistemplateline =~ s/{{pagepreviouslink}}/$pagepreviouslinkreplacement/ig;
10399 $thistemplateline =~ s/{{pagepreviousmorelink}}/$pagepreviousmorelinkreplacement/ig;
10400 $thistemplateline =~ s/{{pagemorepreviouslink}}/$pagepreviousmorelinkreplacement/ig;
10401 $thistemplateline =~ s/{{pagemorenextlink}}/$pagepreviousmorelinkreplacement/ig;
10402 $thistemplateline =~ s/{{pagesmartindexlink}}/$pagesmartindexlinkreplacement/ig;
10403 $thistemplateline =~ s/{{positivekarmalink}}/$pagepositivekarmalinkreplacement/ig;
10404 $thistemplateline =~ s/{{negativekarmalink}}/$pagenegativekarmalinkreplacement/ig;
10405 }
10406 print LAUGHINGFEETONE "$thistemplateline\n";
10407 }
10408 close (LAUGHINGFEETONE);
10409 &gm_readtemplates;
10410 $gmindextemplate = &relouse($gmindextemplate);
10411 $gmentrypagetemplate = &relouse($gmentrypagetemplate);
10412 $gmarchiveindextemplate = &relouse($gmarchiveindextemplate);
10413 $gmarchiveentrypagetemplate = &relouse($gmarchiveentrypagetemplate);
10414 $gmentrytemplate = &relouse($gmentrytemplate);
10415 $gmarchiveentrytemplate = &relouse($gmarchiveentrytemplate);
10416 $gmstayattoptemplate = &relouse($gmstayattoptemplate);
10417 $gmdatetemplate = &relouse($gmdatetemplate);
10418 $gmcommentstemplate = &relouse($gmcommentstemplate);
10419 $gmcommentsformtemplate = &relouse($gmcommentsformtemplate);
10420 $gmparaseparationtemplate = &relouse($gmparaseparationtemplate);
10421 $gmkarmaformtemplate = &relouse($gmkarmaformtemplate);
10422 # new templates {{target}} and dategrouping footer take the place of the long-deprecated ones: linear 9/18/2003
10423 # new in 1.3
10424 $gmlinktargettemplate = &relouse($gmlinktargettemplate);
10425 $gmdategroupingfootertemplate = &relouse($gmdategroupingfootertemplate);
10426 # merged 9/18/2003
10427 $gmkarmalinktemplate = &relouse($gmkarmalinktemplate);
10428 $gmcommentslinktemplate = &relouse($gmcommentslinktemplate);
10429 $gmcommentauthoremailtemplate = &relouse($gmcommentauthoremailtemplate);
10430 $gmcommentauthorhomepagetemplate = &relouse($gmcommentauthorhomepagetemplate);
10431 $gmcommentdividertemplate = &relouse($gmcommentdividertemplate);
10432 $gmmoreentrytemplate = &relouse($gmmoreentrytemplate);
10433 $gmmoreentrypagetemplate = &relouse($gmmoreentrypagetemplate);
10434 $gmmorearchiveentrypagetemplate = &relouse($gmmorearchiveentrypagetemplate);
10435 $gmpreviouslinktemplate = &relouse($gmpreviouslinktemplate);
10436 $gmnextlinktemplate = &relouse($gmnextlinktemplate);
10437 $gmpreviousmorelinktemplate = &relouse($gmpreviousmorelinktemplate);
10438 $gmnextmorelinktemplate = &relouse($gmnextmorelinktemplate);
10439 $gmarchivemasterindextemplate = &relouse($gmarchivemasterindextemplate);
10440 $gmlogarchiveslinktemplate = &relouse($gmlogarchiveslinktemplate);
10441 $gmentrypagelinktemplate = &relouse($gmentrypagelinktemplate);
10442 $gmmoreentrypagelinktemplate = &relouse($gmmoreentrypagelinktemplate);
10443 $gmlogarchiveslinkseparatortemplate = &relouse($gmlogarchiveslinkseparatortemplate);
10444 $gmentrypagelinkseparatortemplate = &relouse($gmentrypagelinkseparatortemplate);
10445 $gmentrypagelinkmonthseparatortemplate = "";
10446 $gmentrypagelinkdayseparatortemplate = "";
10447 $gmentrypagelinkyearseparatortemplate = "";
10448 $gmheadertemplate = &relouse($gmheadertemplate);
10449 $gmfootertemplate = &relouse($gmfootertemplate);
10450 $gmsidebartemplate = &relouse($gmsidebartemplate);
10451 $gmcustomlinktemplate = "";
10452 $gmentryseparatortemplate = &relouse($gmentryseparatortemplate);
10453 $gmarchiveentryseparatortemplate = &relouse($gmarchiveentryseparatortemplate);
10454 $gmmorearchiveentrytemplate = &relouse($gmmorearchiveentrytemplate);
10455 $gmdatearchivetemplate = &relouse($gmdatearchivetemplate);
10456 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.");
10457 print LAUGHINGFEETTWO "$gmindextemplate\n";
10458 print LAUGHINGFEETTWO "$gmentrypagetemplate\n";
10459 print LAUGHINGFEETTWO "$gmarchiveindextemplate\n";
10460 print LAUGHINGFEETTWO "$gmarchiveentrypagetemplate\n";
10461 print LAUGHINGFEETTWO "$gmentrytemplate\n";
10462 print LAUGHINGFEETTWO "$gmarchiveentrytemplate\n";
10463 print LAUGHINGFEETTWO "$gmstayattoptemplate\n";
10464 print LAUGHINGFEETTWO "$gmdatetemplate\n";
10465 print LAUGHINGFEETTWO "$gmcommentstemplate\n";
10466 print LAUGHINGFEETTWO "$gmcommentsformtemplate\n";
10467 print LAUGHINGFEETTWO "$gmparaseparationtemplate\n";
10468 print LAUGHINGFEETTWO "$gmkarmaformtemplate\n";
10469 # new templates {{target}} and dategrouping footer take the place of the long-deprecated ones: linear 9/18/2003
10470 # new in 1.3
10471 print LAUGHINGFEETTWO "$gmlinktargettemplate\n";
10472 print LAUGHINGFEETTWO "$gmdategroupingfootertemplate\n";
10473 # merged 9/18/2003
10474 print LAUGHINGFEETTWO "$gmkarmalinktemplate\n";
10475 print LAUGHINGFEETTWO "$gmcommentslinktemplate\n";
10476 print LAUGHINGFEETTWO "$gmcommentauthoremailtemplate\n";
10477 print LAUGHINGFEETTWO "$gmcommentauthorhomepagetemplate\n";
10478 print LAUGHINGFEETTWO "$gmcommentdividertemplate\n";
10479 print LAUGHINGFEETTWO "$gmmoreentrytemplate\n";
10480 print LAUGHINGFEETTWO "$gmmoreentrypagetemplate\n";
10481 print LAUGHINGFEETTWO "$gmmorearchiveentrypagetemplate\n";
10482 print LAUGHINGFEETTWO "$gmpreviouslinktemplate\n";
10483 print LAUGHINGFEETTWO "$gmnextlinktemplate\n";
10484 print LAUGHINGFEETTWO "$gmpreviousmorelinktemplate\n";
10485 print LAUGHINGFEETTWO "$gmnextmorelinktemplate\n";
10486 print LAUGHINGFEETTWO "$gmarchivemasterindextemplate\n";
10487 print LAUGHINGFEETTWO "$gmlogarchiveslinktemplate\n";
10488 print LAUGHINGFEETTWO "$gmentrypagelinktemplate\n";
10489 print LAUGHINGFEETTWO "$gmmoreentrypagelinktemplate\n";
10490 print LAUGHINGFEETTWO "$gmlogarchiveslinkseparatortemplate\n";
10491 print LAUGHINGFEETTWO "$gmentrypagelinkseparatortemplate\n";
10492 print LAUGHINGFEETTWO "\n";
10493 print LAUGHINGFEETTWO "\n";
10494 print LAUGHINGFEETTWO "\n";
10495 print LAUGHINGFEETTWO "$gmheadertemplate\n";
10496 print LAUGHINGFEETTWO "$gmfootertemplate\n";
10497 print LAUGHINGFEETTWO "$gmsidebartemplate\n";
10498 print LAUGHINGFEETTWO "\n";
10499 print LAUGHINGFEETTWO "$gmentryseparatortemplate\n";
10500 print LAUGHINGFEETTWO "$gmarchiveentryseparatortemplate\n";
10501 print LAUGHINGFEETTWO "$gmmorearchiveentrytemplate\n";
10502 print LAUGHINGFEETTWO "$gmdatearchivetemplate\n";
10503 print LAUGHINGFEETTWO qq(<A HREF="{{pagearchivelogindexlink}}">{{weekbeginningmonthmonth}}/{{weekbeginningdayday}}/{{weekbeginningyearyear}} to {{weekendingmonthmonth}}/{{weekendingdayday}}/{{weekendingyearyear}}</A>\n);
10504 print LAUGHINGFEETTWO qq(\n);
10505 print LAUGHINGFEETTWO qq(\n);
10506 print LAUGHINGFEETTWO qq(\n);
10507 print LAUGHINGFEETTWO qq(\n);
10508 print LAUGHINGFEETTWO qq(\n);
10509 print LAUGHINGFEETTWO qq(\n);
10510 print LAUGHINGFEETTWO qq(\n);
10511 print LAUGHINGFEETTWO qq(\n);
10512 print LAUGHINGFEETTWO qq(\n);
10513 print LAUGHINGFEETTWO qq(\n);
10514 print LAUGHINGFEETTWO qq(<html>|*|<head>|*|<title>{{monthmonth}}/{{dayday}}/{{year}}: {{popuptitle}}</TITLE>|*|<META NAME="Generator" CONTENT="Greymatter {{gmversion}}">|*|</HEAD>|*||*|<BODY BGCOLOR="#000000" TOPMARGIN=0 LEFTMARGIN=0 MARGINHEIGHT=0 MARGINWIDTH=0 onBlur="window.close\(\)">|*||*|<IMG BORDER=0 SRC="{{entrieswebpath}}/{{popupfile}}" ALT="{{popuptitle}}" HEIGHT={{popupheight}} WIDTH={{popupwidth}}>|*||*|</BODY>|*|</HTML>\n);
10515 print LAUGHINGFEETTWO qq(<a href="#" onMouseOver="window.status='{{monthmonth}}/{{dayday}}/{{year}}: {{popuptitle}} \(opens popup window\)';return true" onMouseOut="window.status='';return true" onClick="window.open\('{{entrieswebpath}}/{{popuphtmlfile}}','{{randomnumber 1111-9999}}','width={{popupwidth}},height={{popupheight}},directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no,left=0,top=0,screenx=50,screeny=50'\);return false">\n);
10516 print LAUGHINGFEETTWO qq(<form action="{{cgiwebpath}}/gm-comments.cgi" METHOD=POST><INPUT TYPE=TEXT NAME="gmsearch" SIZE=20> <INPUT TYPE=SUBMIT VALUE="Search"></FORM>\n);
10517 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);
10518 print LAUGHINGFEETTWO qq(<P ALIGN=JUSTIFY>|*|<A HREF="{{pagelink}}">{{monthmonth}}/{{dayday}}/{{yearyear}}: {{entrysubject}}</A>|*|<P ALIGN=JUSTIFY><I>|*|{{entrymainbodyfirstwords 10}}...|*|</I></BLOCKQUOTE></P>|*|</BLOCKQUOTE></P>\n);
10519 print LAUGHINGFEETTWO qq(<TABLE BORDER=2 CELLPADDING=5 CELLSPACING=0><TR><TD ALIGN=CENTER COLSPAN=7>{{monthword}} {{yearyear}}</TD></TR><TR><TD ALIGN=CENTER>S</TD><TD ALIGN=CENTER>M</TD><TD ALIGN=CENTER>T</TD><TD ALIGN=CENTER>W</TD><TD ALIGN=CENTER>T</TD><TD ALIGN=CENTER>F</TD><TD ALIGN=CENTER>S</TD></TR>\n);
10520 print LAUGHINGFEETTWO qq(</TABLE>\n);
10521 print LAUGHINGFEETTWO qq(<TD ALIGN=CENTER> </TD>\n);
10522 print LAUGHINGFEETTWO qq(<TD ALIGN=CENTER>{{day}}</TD>\n);
10523 print LAUGHINGFEETTWO qq(<TD ALIGN=CENTER><A HREF="{{pagelink}}">{{day}}</A></TD>\n);
10524 print LAUGHINGFEETTWO qq(\n);
10525 print LAUGHINGFEETTWO qq( [{{day}}] \n);
10526 print LAUGHINGFEETTWO qq( [<A HREF="{{pagelink}}">{{day}}</A>] \n);
10527 print LAUGHINGFEETTWO qq(<A NAME="comments">|*||*|<P ALIGN=CENTER>|*|<B>Previewing Your Comment</B>|*|</P>|*|\n);
10528 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);
10529 print LAUGHINGFEETTWO qq(No Comments\n);
10530 print LAUGHINGFEETTWO qq(1 Comment\n);
10531 print LAUGHINGFEETTWO qq({{commentsnumber}} comments\n);
10532 print LAUGHINGFEETTWO qq(<BR>\n);
10533 close (LAUGHINGFEETTWO);
10534 &gm_readconfig;
10535 $versionsetup = $gmversion;
10536 $cookiesallowed = "no";
10537 $logarchivesuffix = $entrysuffix;
10538 $censorlist = "";
10539 $censorenabled = "neither";
10540 $keepmonthlyarchives = "yes";
10541 $defaultentrylistview = "main";
10542 $linktocalendarentries = "all";
10543 $automaticrebuilddefault = "yes";
10544 $commententrylistonlyifokay = "yes";
10545 $otherfilelist = "";
10546 $otherfilelistentryrebuild = "no";
10547 $archiveformat = "month";
10548 $inlineformatting = "entries";
10549 $uploadfilesallowed = "";
10550 $uploadfilesizelimit = "0";
10551 &gm_writeconfig;
10552 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.");
10553 @gmauthorupgradedata = <LAUGHINGFEETTHREE>;
10554 close (LAUGHINGFEETTHREE);
10555 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.");
10556 foreach $thisupgradeauthorline (@gmauthorupgradedata) {
10557 chomp ($thisupgradeauthorline);
10558 unless ($thisupgradeauthorline eq "") {
10559 ($thisupgradeauthorname, $thisupgradeauthorpassword, $thisupgradeauthoremail, $thisupgradeauthorhomepage, $thisupgradeauthordate, $thisupgradeauthorposts, $thisupgradeauthorentryaccess, $thisupgradeauthorentryeditaccess, $thisupgradeauthorconfigurationaccess, $thisupgradeauthortemplateaccess, $thisupgradeauthorauthoraccess, $thisupgradeauthorrebuildaccess, $thisupgradeauthorcplogaccess) = split (/\|/, $thisupgradeauthorline);
10560 $thisupgradeauthorbookmarkletaccess = "N";
10561 $thusupgradeauthoruploadaccess = "N";
10562 $thisupgradeauthorloginaccess = "Y";
10563 if ($thisupgradeauthorentryaccess eq "Y") { $thisupgradeauthorbookmarkletaccess = "Y"; }
10564 if ($thisupgradeauthorconfigurationaccess eq "Y") { $thisupgradeauthoruploadaccess = "Y"; }
10565 print LAUGHINGFEETFOUR "$thisupgradeauthorname|$thisupgradeauthorpassword|$thisupgradeauthoremail|$thisupgradeauthorhomepage|$thisupgradeauthordate|$thisupgradeauthorposts|$thisupgradeauthorentryaccess|$thisupgradeauthorentryeditaccess|$thisupgradeauthorconfigurationaccess|$thisupgradeauthortemplateaccess|$thisupgradeauthorauthoraccess|$thisupgradeauthorrebuildaccess|$thisupgradeauthorcplogaccess|$thisupgradeauthorbookmarkletaccess|$thisupgradeauthoruploadaccess|$thisupgradeauthorloginaccess\n";
10566 }
10567 }
10568 close (LAUGHINGFEETFOUR);
10569}
10570
10571&gm_readconfig;
10572$versionsetup = $gmversion;
10573&gm_writeconfig;
10574
10575# clean up the deprecated templates: linear 10/2/2003
10576# merged in 1.3
10577&gm_readtemplates;
10578$gmtemplates[12] = "";
10579$gmtemplates[13] = "";
10580open (LAUGHINGFEETFOUR, ">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.");
10581foreach $thistemplate (@gmtemplates) {
10582 $thistemplate =~ s(\n)(\|\*\|)g;
10583 print LAUGHINGFEETFOUR "$thistemplate\n";
10584}
10585close (LAUGHINGFEETFOUR);
10586
10587
10588# merged 10/2/2003
10589
10590&gm_writetocplog("<B><FONT COLOR=\"#0000FF\">$IN{'authorname'} upgraded Greymatter from an older version ($IN{'oldsetupversion'}) to a newer version ($gmversion)</FONT></B>");
10591
10592$statusnote = qq(<B><FONT COLOR="#0000FF">Upgrade complete! Welcome back, $IN{'authorname'}.<BR>Check out the new config options in 1.3.1: the emoticons path,<BR>emoticons options, and the PHP hack logging and notification options.</FONT></B><P>);
10593
10594&gm_configuration;
10595}
10596
10597# ----------------------
10598# rebuild update process
10599# ----------------------
10600
10601sub gm_rebuildupdate {
10602
10603&gm_validate;
10604
10605if ($gmrebuildaccess ne "yes") {
10606 &gm_writetocplog("$IN{'authorname'} attempted to rebuild files without authorization");
10607 $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to rebuild files.</FONT></B><P>);
10608 &gm_frontpage;
10609}
10610
10611$usethisauthorname = $IN{'authorname'};
10612$usethisauthorpassword = $IN{'authorpassword'};
10613$usethisauthorname =~ s/ /\+/g;
10614$usethisauthorpassword =~ s/ /\+/g;
10615
10616$nowrebuild = "";
10617$whatimdoing = "Error";
10618
10619&gm_readconfig;
10620&gm_readcounter;
10621&gm_readtemplates;
10622
10623if ($IN{'rebuildfrom'} eq "index") {
10624
10625 &gm_generatemainindex;
10626 $whatimdoing = "Rebuilt main index. Now rebuilding log archives...";
10627 $nowrebuild = "logarchives";
10628
10629} elsif ($IN{'rebuildfrom'} eq "logarchives") {
10630
10631 if (($newarchivenumber ne "0") || ($concurrentmainandarchives eq "yes")) {
10632 if ($keepmonthlyarchives ne "no") {
10633 if ($concurrentmainandarchives eq "yes") { $newarchivenumber = $newentrynumber; }
10634 $stoppednumber = $newarchivenumber;
10635 do { &gm_generatearchive($stoppednumber); } until $stoppednumber <= 1;
10636 &gm_readcounter;
10637 }
10638 }
10639 $whatimdoing = "Rebuilt log archives. Now rebuilding archive master index...";
10640 $nowrebuild = "masterindex";
10641
10642} elsif ($IN{'rebuildfrom'} eq "masterindex") {
10643
10644 if (($keeparchivemasterindex eq "yes") && ($newentrynumber ne "0")) {
10645 if ($newarchivenumber ne "0") {
10646 &gm_getentryvariables($newarchivenumber);
10647 } else {
10648 &gm_getentryvariables($newentrynumber);
10649 }
10650 &gm_formatentry($gmarchivemasterindextemplate);
10651 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.");
10652 print THISARCHIVEFILE $entryreturn;
10653 close (THISARCHIVEFILE);
10654 chmod (0666, "$EntriesPath/$indexfilename");
10655 }
10656 if ($otherfilelist ne "") {
10657 $whatimdoing = "Rebuilt archive master index. Now rebuilding connected files...";
10658 $nowrebuild = "connected";
10659 } else {
10660 $whatimdoing = "Rebuilt archive master index. Now rebuilding entry files...";
10661 $nowrebuild = "1";
10662 }
10663
10664} elsif ($IN{'rebuildfrom'} eq "connected") {
10665
10666 if ($otherfilelist ne "") {
10667 &gm_rebuildconnectedfiles;
10668 if ($connectedfilesdone eq "yes") {
10669 $whatimdoing = "Rebuilt connected files. Now rebuilding entry files...";
10670 $nowrebuild = "1";
10671 if (($IN{'rebuilding'} eq "connected") || ($IN{'rebuilding'} eq "connectedaftersave")) {
10672 $nowrebuild = "done";
10673 }
10674 } else {
10675 $connectpercentdone = int( ($IN{'connectednumber'} / $#connectedfilelist) * 100 );
10676 $whatimdoing = "Rebuilding connected files ($connectpercentdone% done)...";
10677 $nowrebuild = "connected";
10678 }
10679 } else {
10680 $whatimdoing = "Now rebuilding entry files...";
10681 $nowrebuild = "1";
10682 }
10683
10684} else {
10685
10686 unless (($IN{'rebuilding'} eq "connected") || ($IN{'rebuilding'} eq "connectedaftersave")) {
10687 if (($generateentrypages eq "yes") && ($newentrynumber ne "0")) {
10688 $currentcount = $IN{'rebuildfrom'};
10689 $counttohere = $currentcount + 9;
10690 if ($IN{'rebuildfrom'} eq "archivefiles") {
10691 if ($counttohere > $newarchivenumber) { $counttohere = $newarchivenumber; }
10692 } else {
10693 if ($counttohere > $newentrynumber) { $counttohere = $newentrynumber; }
10694 }
10695 do {
10696 &gm_getentryvariables($currentcount);
10697 if ($thisentryopenstatus eq "open") {
10698 if ($currentcount <= $newarchivenumber) {
10699 if ($thisentrymorebody ne "") {
10700 &gm_formatentry($gmmorearchiveentrypagetemplate);
10701 } else {
10702 &gm_formatentry($gmarchiveentrypagetemplate);
10703 }
10704 } else {
10705 if ($thisentrymorebody ne "") {
10706 &gm_formatentry($gmmoreentrypagetemplate);
10707 } else {
10708 &gm_formatentry($gmentrypagetemplate);
10709 }
10710 }
10711 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.");
10712 print THISENTRYFILE $entryreturn;
10713 close (THISENTRYFILE);
10714 chmod (0666, "$EntriesPath/$thisentrynumberpadded.$entrysuffix");
10715 } else {
10716 unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix");
10717 }
10718 unless ($currentcount eq $counttohere) { $currentcount++; }
10719 } until $currentcount eq $counttohere;
10720 $percentdone = int( ($counttohere / $newentrynumber) * 100 );
10721 $whatimdoing = "Rebuilt entry pages: $IN{'rebuildfrom'} to $counttohere ($percentdone% done)...";
10722 if ($counttohere eq $newentrynumber) {
10723 &gm_getentryvariables($newentrynumber);
10724 if ($thisentryopenstatus eq "open") {
10725 if ($thisentrymorebody ne "") {
10726 &gm_formatentry($gmmoreentrypagetemplate);
10727 } else {
10728 &gm_formatentry($gmentrypagetemplate);
10729 }
10730 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.");
10731 print THISFILE $entryreturn;
10732 close (THISFILE);
10733 chmod (0666, "$EntriesPath/$thisentrynumberpadded.$entrysuffix");
10734 } else {
10735 unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix");
10736 }
10737 $nowrebuild = "done";
10738 } else {
10739 $nowrebuild = $counttohere;
10740 }
10741 } else {
10742 $nowrebuild = "done";
10743 }
10744 }
10745
10746}
10747
10748# create a token, and persist it to a file called gm-token.cgi: linear 9/3/2003
10749# merged into 1.3
10750$now = time();
10751$usethistoken = "gm" . $now;
10752
10753open (HAVEATOKEN, ">$EntriesPath/gm-token.cgi") || &gm_dangermouse("Can't persist the token. Please make sure that your archive directory is CHMODed 777.");
10754print HAVEATOKEN "$usethistoken\n";
10755print HAVEATOKEN "$IN{'authorname'}\n";
10756print HAVEATOKEN "$IN{'authorpassword'}\n";
10757close (HAVEATOKEN);
10758
10759
10760$metarefreshtag = qq(<META http-equiv="REFRESH" content="1; URL=gm.cgi?gmtoken=$usethistoken&thomas=rebuildupdate&rebuilding=$IN{'rebuilding'}&rebuildfrom=$nowrebuild&connectednumber=$IN{'connectednumber'}">);
10761#merged 9/11/2003
10762
10763if (($nowrebuild eq "") || ($nowrebuild eq "done")) {
10764 if ($IN{'rebuilding'} eq "everything") {
10765 $statusnote = qq(<B><FONT COLOR="#0000FF">All the files have been rebuilt.</FONT></B>);
10766 ## clean up the token file we created: linear 9/3/2003
10767 # merged into 1.3
10768 unlink ("$EntriesPath/gm-token.cgi");
10769 # merged 9/11/2003
10770 &gm_writetocplog("$IN{'authorname'} rebuilt all the files");
10771 } elsif ($IN{'rebuilding'} eq "entryfiles") {
10772 $statusnote = qq(<B><FONT COLOR="#0000FF">All the entry pages have been rebuilt.</FONT></B>);
10773 &gm_writetocplog("$IN{'authorname'} rebuilt all the entry pages");
10774 } elsif ($IN{'rebuilding'} eq "archivefiles") {
10775 $statusnote = qq(<B><FONT COLOR="#0000FF">All the archive entry pages have been rebuilt.</FONT></B>);
10776 &gm_writetocplog("$IN{'authorname'} rebuilt all the archive entry pages");
10777 } elsif ($IN{'rebuilding'} eq "mainentries") {
10778 $statusnote = qq(<B><FONT COLOR="#0000FF">All the main entry pages have been rebuilt.</FONT></B>);
10779 &gm_writetocplog("$IN{'authorname'} rebuilt all the main entry pages");
10780 } elsif ($IN{'rebuilding'} eq "connected") {
10781 $statusnote = qq(<B><FONT COLOR="#0000FF">All the connected files have been rebuilt.</FONT></B>);
10782 &gm_writetocplog("$IN{'authorname'} rebuilt all the connected files");
10783 } elsif ($IN{'rebuilding'} eq "connectedaftersave") {
10784 $statusnote = qq(<B><FONT COLOR="#0000FF">Your new entry has been added.</FONT></B>);
10785 } else {
10786 $statusnote = qq(<B><FONT COLOR="#0000FF">All relevant files have been rebuilt.</FONT></B>);
10787 &gm_writetocplog("$IN{'authorname'} rebuilt unknown files");
10788 }
10789 $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="Edit Templates" STYLE="background: #C0C0C0"><br><br><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0"></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>);
10790 $metarefreshtag = "";
10791}
10792
10793if ($IN{'rebuilding'} eq "everything") {
10794 $statusnote = qq(<B><FONT COLOR="#000000">Rebuilding Everything</FONT></B><P>);
10795} elsif ($IN{'rebuilding'} eq "entryfiles") {
10796 $statusnote = qq(<B><FONT COLOR="#000000">Rebuilding Entry Pages</FONT></B><P>);
10797} elsif ($IN{'rebuilding'} eq "archivefiles") {
10798 $statusnote = qq(<B><FONT COLOR="#000000">Rebuilding Archive Entry Pages</FONT></B><P>);
10799} elsif ($IN{'rebuilding'} eq "mainentries") {
10800 $statusnote = qq(<B><FONT COLOR="#000000">Rebuilding Main Entry Pages</FONT></B><P>);
10801} elsif ($IN{'rebuilding'} eq "connected") {
10802 $statusnote = qq(<B><FONT COLOR="#000000">Rebuilding Connected Files</FONT></B><P>);
10803} elsif ($IN{'rebuilding'} eq "connectedaftersave") {
10804 $statusnote = qq(<B><FONT COLOR="#000000">Rebuilding Connected Files</FONT></B><P>);
10805} else {
10806 $statusnote = qq(<B><FONT COLOR="#000000">Rebuilding Files</FONT></B><P>);
10807}
10808
10809$gmrebuildheadtag = qq#<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
10810<HTML>
10811<HEAD>
10812<TITLE>Greymatter</TITLE>
10813$metarefreshtag
10814<style>
10815.copynotice {
10816 text-decoration: none;
10817 font-family: verdana, arial, helvetica;
10818 font-size: 7pt;
10819 color: \#000;
10820}
10821.copynotice:hover {
10822 color: \#FFFFFF;
10823}
10824.button {
10825 font-family: verdana, arial, helvetica;
10826 font-size: 13px;
10827 background: \#FFFFD0;
10828 border: 1px solid \#000;
10829 width: 240px;
10830 height: 26px;
10831}
10832.button_big_green {
10833 background: \#D0FFD0;
10834 width: 500px;
10835 font-family: verdana, arial, helvetica;
10836 font-size: 13px;
10837 border: 1px solid \#000;
10838 height: 26px;
10839}
10840.button_green {
10841 background: \#D0FFD0;
10842 width: 100px;
10843 font-family: verdana, arial, helvetica;
10844 font-size: 13px;
10845 border: 1px solid \#000;
10846 height: 26px;
10847}
10848.textinput {
10849 font-family: verdana, arial, helvetica;
10850 font-size: 13px;
10851 background-color: \#EEEEFF;
10852 border: 1px solid \#000;
10853 width: 200px;
10854}
10855.textinput_config {
10856 font-family: verdana, arial, helvetica;
10857 font-size: 13px;
10858 background-color: \#EEEEFF;
10859 border: 1px solid \#000;
10860 width: 400px;
10861}
10862.textinput_long {
10863 font-family: verdana, arial, helvetica;
10864 font-size: 13px;
10865 background-color: \#EEEEFF;
10866 border: 1px solid \#000;
10867 width: 500px;
10868}
10869.selectlist {
10870 font-family: verdana, arial, helvetica;
10871 font-size: 13px;
10872 background-color: \#EEEEFF;
10873 border-color: \#000;
10874}
10875.top_logo {
10876 font-family: verdana, arial, helvetica;
10877 font-size: 13px;
10878 color: \#000;
10879 font-weight: bold;
10880}
10881.login {
10882 color: \#000;
10883 font-weight: bold;
10884}
10885.regular_text {
10886 color: \#000;
10887 font-weight: bold;
10888}
10889div.front_page {
10890 width: 520px;
10891 padding-top: 10px;
10892 padding-bottom: 10px;
10893}
10894div.float_left {
10895 width: 255px;
10896 float: left;
10897}
10898div.float_right {
10899 width: 255px;
10900 float: right;
10901}
10902div.text_right {
10903 text-align: right;
10904}
10905div.text_left {
10906 text-align: left;
10907}
10908.text_red {
10909 color: \#f00;
10910 font-weight: bold;
10911}
10912body {
10913 background: \#8c8c7b;
10914}
10915input {
10916 font-family: verdana, arial, helvetica;
10917 font-size: 13px;
10918}
10919textarea {
10920 font-size: 13px;
10921 font-family: verdana, arial, helvetica;
10922 background-color: \#eef;
10923 border-color: 1px solid \#000;
10924}
10925.mainmenu {
10926 font-family: verdana, arial, helvetica;
10927 color: \#000;
10928 font-size: 13px;
10929}
10930table.mainmenu {
10931 background: \#fff;
10932 border: 1px solid \#000;
10933}
10934div.main_menu {
10935 width: 520px;
10936 background: \#fff;
10937 text-align: center;
10938}
10939.menu_small {
10940 font-family: verdana, arial, helvetica;
10941 color: \#000;
10942 font-size: 7pt;
10943}
10944div.main {
10945 text-align: center;
10946 vertical-align: middle;
10947 width: 100%;
10948 height: 100%;
10949}
10950</style>
10951</HEAD>
10952
10953<body>#;
10954
10955print<<GMREBUILDUPDATE;
10956
10957$gmrebuildheadtag
10958$gmframetop
10959$statusnote
10960$whatimdoing
10961$gmframebottom
10962
10963</BODY>
10964</HTML>
10965
10966GMREBUILDUPDATE
10967
10968exit;
10969
10970}
10971