GM Smilies - Help


** Please don't copy for use on your own site **

## Greymatter common subroutine library # =============================== # GREYMATTER - Subroutine Library # Weblog/Journal Software # version one point two # Copyright (c)2000 Noah Grey # http://noahgrey.com/greysoft/ # =============================== # *** Your possession of this software indicates that you agree to the terms *** # *** specified under the "Copyright & Usage" heading in the "manual.txt" file. *** # ----------------- # program variables # ----------------- $gmversion = "1.21b"; $gmfonttag = qq(<FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE=2>); $gmheadtag = qq#<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Greymatter</TITLE> <META NAME="Generator" CONTENT="Greymatter $gmversion"> <STYLE TYPE="text/css"> <!-- .copynotice { text-decoration: none } .copynotice:hover { color: \#FFFFFF } .button { font-family: verdana, arial, helvetica; font-size: 13px; background: \#FFFFD0; border-color: \#000000 } .textinput { font-family: verdana, arial, helvetica; font-size: 13px; background-color: \#EEEEFF; border-color: \#000000 } .selectlist { font-family: verdana, arial, helvetica; font-size: 13px; background-color: \#EEEEFF; border-color: \#000000 } BODY { scrollbar-face-color: \#A0C0E0; scrollbar-shadow-color: \#000000; scrollbar-highlight-color: \#000000; scrollbar-3dlight-color: \#000000; scrollbar-darkshadow-color: \#000000; scrollbar-track-color: \#000000; scrollbar-arrow-color: \#000000 } input { font-family: verdana, arial, helvetica; font-size: 13px } textarea { font-size: 13px; font-family: verdana, arial, helvetica; background-color: \#EEEEFF; border-color: \#000000 } --> </STYLE> <STYLE TYPE="text/css" MEDIA="all"> <!-- .button { width: 240; height: 26 } --> </STYLE> <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript"> <!--// // Copyright (c) 1996-1997 Athenia Associates. // http://www.webreference.com/js/ // License is granted if and only if this entire // copyright notice is included. By Tomer Shiran. function setCookie(name, value, expires, path, domain, secure) { var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); document.cookie = curCookie; } function getCookie(name) { var prefix = name + "="; var nullstring = ""; var cookieStartIndex = document.cookie.indexOf(prefix); if (cookieStartIndex == -1) return nullstring; var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length); if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length; return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex)); } function deleteCookie(name, path, domain) { if (getCookie(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT" }; } function fixDate(date) { var base = new Date(0); var skew = base.getTime(); if (skew > 0) date.setTime(date.getTime() - skew); } #; $gmheadtagtwo = $gmheadtag; $gmheadtag .= qq# //--> </SCRIPT> </HEAD> <BODY BGCOLOR="\#8080B0" TEXT="\#000000" LINK="\#000000" VLINK="\#000000" ALINK="\#000000" MARGIN=10 TOPMARGIN=10 LEFTMARGIN=10 RIGHTMARGIN=10 BOTTOMMARGIN=10 MARGINHEIGHT=10 MARGINWIDTH=10> <BASE TARGET="_top">#; $gmheadtagtwo .= qq# function gmshortcutkeys() { if ((parseInt(navigator.appVersion) >= 4) && (navigator.appName == "Microsoft Internet Explorer")) { if (event.ctrlKey != true) return; gmselection = document.selection.createRange().text; if (window.event.keyCode == 1) { gminsertlink = prompt("What do you want to link to?", "http://") if (gminsertlink == null) return; document.selection.createRange().text = '<A HREF="' + gminsertlink + '">' + gmselection + '</A>'; return; } if (window.event.keyCode == 2) { document.selection.createRange().text = '<B>' + gmselection + '</B>'; return; } if (window.event.keyCode == 9) { document.selection.createRange().text = '<I>' + gmselection + '</I>'; return; } if (window.event.keyCode == 21) { document.selection.createRange().text = '<U>' + gmselection + '</U>'; return; } } } //--> </SCRIPT> </HEAD> <BODY BGCOLOR="\#8080B0" TEXT="\#000000" LINK="\#000000" VLINK="\#000000" ALINK="\#000000" MARGIN=10 TOPMARGIN=10 LEFTMARGIN=10 RIGHTMARGIN=10 BOTTOMMARGIN=10 MARGINHEIGHT=10 MARGINWIDTH=10 onKeyPress="gmshortcutkeys();"> <BASE TARGET="_top">#; $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="#C0C0E0" SIZE=4><B>Greymatter</B></FONT></FONT></P><TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=10 CELLSPACING=0 BGCOLOR="#FFFFFF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag); $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=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=10 CELLSPACING=0 BGCOLOR="#FFFFFF"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag); $gmframebottom = qq(</FONT></TD></TR></TABLE></TD></TR></TABLE><P ALIGN=RIGHT><FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE=1><A HREF="http://noahgrey.com/greysoft/" CLASS="copynotice" TARGET="NEW">v$gmversion &#183; &copy;2000-2001 Noah Grey</A></FONT></P></TD></TR></TABLE></TD></TR></TABLE></TD></TR></TABLE>); $gmframebottomtwo = qq(</FONT></TD></TR></TABLE></TD></TR></TABLE></TD></TR></TABLE></TD></TR></TABLE></TD></TR></TABLE>); $statusnote = ""; # --------------- # date subroutine # --------------- sub date { $adjustTime = time() + ($serveroffset * 3600); ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime($adjustTime); $mon++; @months = ("null", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); @weekdays = ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"); $fullmonth = $months[$mon]; $fullweekday = $weekdays[$wday]; $JSYear = $year + 1900; $shortyear = substr($JSYear, -2, 2); $mintwo = sprintf ("%2d", $min); $mintwo =~ tr/ /0/; $sectwo = sprintf ("%2d", $sec); $sectwo =~ tr/ /0/; $militaryhour = $hour; if ($hour < 12) { $AMPM = "AM"; $AMPMDOT = "A.M."; } if ($hour > 12) { $hour = $hour - 12; $AMPM = "PM"; $AMPMDOT = "P.M."; $militaryhour = $militaryhour + 12; } if ($hour == 12) { $AMPM = "PM"; $AMPMDOT = "P.M."; } if ($hour == 0) { $hour = "12"; } $hourtwo = sprintf ("%2d", $hour); $hourtwo =~ tr/ /0/; $mintwo = sprintf ("%2d", $min); $mintwo =~ tr/ /0/; $montwo = sprintf ("%2d", $mon); $montwo =~ tr/ /0/; $mdaytwo = sprintf ("%2d", $mday); $mdaytwo =~ tr/ /0/; if (($hour eq "12") && ($AMPM eq "AM")) { $militaryhour = "0"; } $militaryhourtwo = sprintf ("%2d", $hour); $militaryhourtwo =~ tr/ /0/; $basedate = "$montwo\/$mdaytwo\/$shortyear $hourtwo\:$mintwo $AMPM"; } # ------------------------- # delouse for textarea edit # ------------------------- sub delouse { $_ = shift; $_ =~ s/\|\*\|/\n/g; $_ =~ s/&([A-Za-z0-9\#]+);/\|AMP\|$1;/g; $_ =~ s/</\&lt;/g; $_ =~ s/>/\&gt;/g; $_ =~ s/"/\&quot;/g; return($_); } # --------------------------- # relouse after textarea edit # --------------------------- sub relouse { $_ = shift; $_ =~ s/\n/\|\*\|/g; $_ =~ s/\r//g; $_ =~ s/\&lt;/</g; $_ =~ s/\&gt;/>/g; $_ =~ s/\&quot;/"/g; $_ =~ s/\|AMP\|([A-Za-z0-9\#]+);/&$1;/g; return($_); } # --------------------- # configuration delouse # --------------------- sub configdelouse { $_ = shift; $_ =~ s/\|//g; $_ =~ s/\n//g; $_ =~ s/\r//g; $_ =~ s/^\s+//; $_ =~ s/\s+$//; return($_); } # ---------------- # read the counter # ---------------- sub gm_readcounter { open (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."); @entrycounters = <FUNNYFEETKRACK>; close (FUNNYFEETKRACK); $newentrynumber = $entrycounters[0]; $newarchivenumber = $entrycounters[1]; $newstayattopnumber = $entrycounters[2]; $newalltimepktotalnumber = $entrycounters[3]; $newalltimenktotalnumber = $entrycounters[4]; $newalltimecommentstotalnumber = $entrycounters[5]; $newalltimeopenentriesnumber = $entrycounters[6]; $newalltimeclosedentriesnumber = $entrycounters[7]; chomp ($newentrynumber); chomp ($newarchivenumber); chomp ($newstayattopnumber); chomp ($newalltimepktotalnumber); chomp ($newalltimenktotalnumber); chomp ($newalltimecommentstotalnumber); chomp ($newalltimeopenentriesnumber); chomp ($newalltimeclosedentriesnumber); if ($newentrynumber eq "") { $newentrynumber = 0; } if ($newarchivenumber eq "") { $newarchivenumber = 0; } if ($newstayattopnumber eq "") { $newstayattopnumber = 0; } if ($newalltimepktotalnumber eq "") { $newalltimepktotalnumber = 0; } if ($newalltimenktotalnumber eq "") { $newalltimenktotalnumber = 0; } if ($newalltimeopenentriesnumber eq "") { $newalltimeopenentriesnumber = 0; } if ($newalltimeclosedentriesnumber eq "") { $newalltimeclosedentriesnumber = 0; } } # ----------------- # write the counter # ----------------- sub gm_writecounter { if ($newentrynumber eq "") { $newentrynumber = 0; } if ($newarchivenumber eq "") { $newarchivenumber = 0; } if ($newstayattopnumber eq "") { $newstayattopnumber = 0; } if ($newalltimepktotalnumber eq "") { $newalltimepktotalnumber = 0; } if ($newalltimenktotalnumber eq "") { $newalltimenktotalnumber = 0; } if ($newalltimeopenentriesnumber eq "") { $newalltimeopenentriesnumber = 0; } if ($newalltimeclosedentriesnumber eq "") { $newalltimeclosedentriesnumber = 0; } open (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."); print FUNNYFEETAUGH "$newentrynumber\n"; print FUNNYFEETAUGH "$newarchivenumber\n"; print FUNNYFEETAUGH "$newstayattopnumber\n"; print FUNNYFEETAUGH "$newalltimepktotalnumber\n"; print FUNNYFEETAUGH "$newalltimenktotalnumber\n"; print FUNNYFEETAUGH "$newalltimecommentstotalnumber\n"; print FUNNYFEETAUGH "$newalltimeopenentriesnumber\n"; print FUNNYFEETAUGH "$newalltimeclosedentriesnumber\n"; close (FUNNYFEETAUGH); } # ------------------ # read the templates # ------------------ sub gm_readtemplates { open (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."); @gmtemplates = <FUNNYFEETTAMMY>; close (FUNNYFEETTAMMY); $gmcounter = 0; foreach (@gmtemplates) { chomp ($gmtemplates[$gmcounter]); $gmtemplates[$gmcounter] =~ s/\|\*\|/\n/g; $gmcounter++; } $gmindextemplate = $gmtemplates[0]; $gmentrypagetemplate = $gmtemplates[1]; $gmarchiveindextemplate = $gmtemplates[2]; $gmarchiveentrypagetemplate = $gmtemplates[3]; $gmentrytemplate = $gmtemplates[4]; $gmarchiveentrytemplate = $gmtemplates[5]; $gmstayattoptemplate = $gmtemplates[6]; $gmdatetemplate = $gmtemplates[7]; $gmcommentstemplate = $gmtemplates[8]; $gmcommentsformtemplate = $gmtemplates[9]; $gmparaseparationtemplate = $gmtemplates[10]; $gmkarmaformtemplate = $gmtemplates[11]; $gmmoreprefacetemplate = $gmtemplates[12]; $gmmorelinktemplate = $gmtemplates[13]; $gmkarmalinktemplate = $gmtemplates[14]; $gmcommentslinktemplate = $gmtemplates[15]; $gmcommentauthoremailtemplate = $gmtemplates[16]; $gmcommentauthorhomepagetemplate = $gmtemplates[17]; $gmcommentdividertemplate = $gmtemplates[18]; $gmmoreentrytemplate = $gmtemplates[19]; $gmmoreentrypagetemplate = $gmtemplates[20]; $gmmorearchiveentrypagetemplate = $gmtemplates[21]; $gmpreviouslinktemplate = $gmtemplates[22]; $gmnextlinktemplate = $gmtemplates[23]; $gmpreviousmorelinktemplate = $gmtemplates[24]; $gmnextmorelinktemplate = $gmtemplates[25]; $gmarchivemasterindextemplate = $gmtemplates[26]; $gmlogarchiveslinktemplate = $gmtemplates[27]; $gmentrypagelinktemplate = $gmtemplates[28]; $gmmoreentrypagelinktemplate = $gmtemplates[29]; $gmlogarchiveslinkseparatortemplate = $gmtemplates[30]; $gmentrypagelinkseparatortemplate = $gmtemplates[31]; $gmentrypagelinkmonthseparatortemplate = $gmtemplates[32]; $gmentrypagelinkdayseparatortemplate = $gmtemplates[33]; $gmentrypagelinkyearseparatortemplate = $gmtemplates[34]; $gmheadertemplate = $gmtemplates[35]; $gmfootertemplate = $gmtemplates[36]; $gmsidebartemplate = $gmtemplates[37]; $gmcustomlinktemplate = $gmtemplates[38]; $gmentryseparatortemplate = $gmtemplates[39]; $gmarchiveentryseparatortemplate = $gmtemplates[40]; $gmmorearchiveentrytemplate = $gmtemplates[41]; $gmdatearchivetemplate = $gmtemplates[42]; $gmlogarchiveslinkweeklytemplate = $gmtemplates[43]; $gmcustomonetemplate = $gmtemplates[44]; $gmcustomtwotemplate = $gmtemplates[45]; $gmcustomthreetemplate = $gmtemplates[46]; $gmcustomfourtemplate = $gmtemplates[47]; $gmcustomfivetemplate = $gmtemplates[48]; $gmcustomsixtemplate = $gmtemplates[49]; $gmcustomseventemplate = $gmtemplates[50]; $gmcustomeighttemplate = $gmtemplates[51]; $gmcustomninetemplate = $gmtemplates[52]; $gmcustomtentemplate = $gmtemplates[53]; $gmpopuppagetemplate = $gmtemplates[54]; $gmpopupcodetemplate = $gmtemplates[55]; $gmsearchformtemplate = $gmtemplates[56]; $gmsearchresultspagetemplate = $gmtemplates[57]; $gmsearchresultsentrytemplate = $gmtemplates[58]; $gmcalendartablebeginningtemplate = $gmtemplates[59]; $gmcalendartableendingtemplate = $gmtemplates[60]; $gmcalendarblankcelltemplate = $gmtemplates[61]; $gmcalendarfullcelltemplate = $gmtemplates[62]; $gmcalendarfullcelllinktemplate = $gmtemplates[63]; $gmcalendarweekblankdaytemplate = $gmtemplates[64]; $gmcalendarweekfulldaytemplate = $gmtemplates[65]; $gmcalendarweekfulldaylinktemplate = $gmtemplates[66]; $gmcommentpreviewdividertemplate = $gmtemplates[67]; $gmcommentpreviewformtemplate = $gmtemplates[68]; $gmsmartlinknocommentstemplate = $gmtemplates[69]; $gmsmartlinkonecommenttemplate = $gmtemplates[70]; $gmsmartlinkmanycommentstemplate = $gmtemplates[71]; $gmlinebreaktemplate = $gmtemplates[72]; } # --------------------- # delouse all templates # --------------------- sub gm_delousealltemplates { $gmindextemplate = &delouse($gmindextemplate); $gmentrypagetemplate = &delouse($gmentrypagetemplate); $gmarchiveindextemplate = &delouse($gmarchiveindextemplate); $gmarchiveentrypagetemplate = &delouse($gmarchiveentrypagetemplate); $gmentrytemplate = &delouse($gmentrytemplate); $gmarchiveentrytemplate = &delouse($gmarchiveentrytemplate); $gmstayattoptemplate = &delouse($gmstayattoptemplate); $gmdatetemplate = &delouse($gmdatetemplate); $gmcommentstemplate = &delouse($gmcommentstemplate); $gmcommentsformtemplate = &delouse($gmcommentsformtemplate); $gmparaseparationtemplate = &delouse($gmparaseparationtemplate); $gmkarmaformtemplate = &delouse($gmkarmaformtemplate); $gmmoreprefacetemplate = &delouse($gmmoreprefacetemplate); $gmmorelinktemplate = &delouse($gmmorelinktemplate); $gmkarmalinktemplate = &delouse($gmkarmalinktemplate); $gmcommentslinktemplate = &delouse($gmcommentslinktemplate); $gmcommentauthoremailtemplate = &delouse($gmcommentauthoremailtemplate); $gmcommentauthorhomepagetemplate = &delouse($gmcommentauthorhomepagetemplate); $gmcommentdividertemplate = &delouse($gmcommentdividertemplate); $gmmoreentrytemplate = &delouse($gmmoreentrytemplate); $gmmoreentrypagetemplate = &delouse($gmmoreentrypagetemplate); $gmmorearchiveentrypagetemplate = &delouse($gmmorearchiveentrypagetemplate); $gmpreviouslinktemplate = &delouse($gmpreviouslinktemplate); $gmnextlinktemplate = &delouse($gmnextlinktemplate); $gmpreviousmorelinktemplate = &delouse($gmpreviousmorelinktemplate); $gmnextmorelinktemplate = &delouse($gmnextmorelinktemplate); $gmarchivemasterindextemplate = &delouse($gmarchivemasterindextemplate); $gmlogarchiveslinktemplate = &delouse($gmlogarchiveslinktemplate); $gmentrypagelinktemplate = &delouse($gmentrypagelinktemplate); $gmmoreentrypagelinktemplate = &delouse($gmmoreentrypagelinktemplate); $gmlogarchiveslinkseparatortemplate = &delouse($gmlogarchiveslinkseparatortemplate); $gmentrypagelinkseparatortemplate = &delouse($gmentrypagelinkseparatortemplate); $gmentrypagelinkmonthseparatortemplate = &delouse($gmentrypagelinkmonthseparatortemplate); $gmentrypagelinkdayseparatortemplate = &delouse($gmentrypagelinkdayseparatortemplate); $gmentrypagelinkyearseparatortemplate = &delouse($gmentrypagelinkyearseparatortemplate); $gmheadertemplate = &delouse($gmheadertemplate); $gmfootertemplate = &delouse($gmfootertemplate); $gmsidebartemplate = &delouse($gmsidebartemplate); $gmcustomlinktemplate = ""; $gmentryseparatortemplate = &delouse($gmentryseparatortemplate); $gmarchiveentryseparatortemplate = &delouse($gmarchiveentryseparatortemplate); $gmmorearchiveentrytemplate = &delouse($gmmorearchiveentrytemplate); $gmdatearchivetemplate = &delouse($gmdatearchivetemplate); $gmlogarchiveslinkweeklytemplate = &delouse($gmlogarchiveslinkweeklytemplate); $gmcustomonetemplate = &delouse($gmcustomonetemplate); $gmcustomtwotemplate = &delouse($gmcustomtwotemplate); $gmcustomthreetemplate = &delouse($gmcustomthreetemplate); $gmcustomfourtemplate = &delouse($gmcustomfourtemplate); $gmcustomfivetemplate = &delouse($gmcustomfivetemplate); $gmcustomsixtemplate = &delouse($gmcustomsixtemplate); $gmcustomseventemplate = &delouse($gmcustomseventemplate); $gmcustomeighttemplate = &delouse($gmcustomeighttemplate); $gmcustomninetemplate = &delouse($gmcustomninetemplate); $gmcustomtentemplate = &delouse($gmcustomtentemplate); $gmpopuppagetemplate = &delouse($gmpopuppagetemplate); $gmpopupcodetemplate = &delouse($gmpopupcodetemplate); $gmsearchformtemplate = &delouse($gmsearchformtemplate); $gmsearchresultspagetemplate = &delouse($gmsearchresultspagetemplate); $gmsearchresultsentrytemplate = &delouse($gmsearchresultsentrytemplate); $gmcalendartablebeginningtemplate = &delouse($gmcalendartablebeginningtemplate); $gmcalendartableendingtemplate = &delouse($gmcalendartableendingtemplate); $gmcalendarblankcelltemplate = &delouse($gmcalendarblankcelltemplate); $gmcalendarfullcelltemplate = &delouse($gmcalendarfullcelltemplate); $gmcalendarfullcelllinktemplate = &delouse($gmcalendarfullcelllinktemplate); $gmcalendarweekblankdaytemplate = ""; $gmcalendarweekfulldaytemplate = &delouse($gmcalendarweekfulldaytemplate); $gmcalendarweekfulldaylinktemplate = &delouse($gmcalendarweekfulldaylinktemplate); $gmcommentpreviewdividertemplate = &delouse($gmcommentpreviewdividertemplate); $gmcommentpreviewformtemplate = &delouse($gmcommentpreviewformtemplate); $gmsmartlinknocommentstemplate = &delouse($gmsmartlinknocommentstemplate); $gmsmartlinkonecommenttemplate = &delouse($gmsmartlinkonecommenttemplate); $gmsmartlinkmanycommentstemplate = &delouse($gmsmartlinkmanycommentstemplate); $gmlinebreaktemplate = &delouse($gmlinebreaktemplate); } # -------------------- # read the config file # -------------------- sub gm_readconfig { open (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."); @gmconfig = <FUNNYFEETCOCO>; close (FUNNYFEETCOCO); $gmcounter = 0; foreach (@gmconfig) { chomp ($gmconfig[$gmcounter]); $gmcounter++; } $LogPath = $gmconfig[0]; $EntriesPath = $gmconfig[1]; $LogWebPath = $gmconfig[2]; $EntriesWebPath = $gmconfig[3]; $NotifyEmail = $gmconfig[4]; $indexfilename = $gmconfig[5]; $entrysuffix = $gmconfig[6]; $indexdays = $gmconfig[7]; $serveroffset = $gmconfig[8]; $timezone = $gmconfig[9]; $keeplog = $gmconfig[10]; $posttoarchives = $gmconfig[11]; $allowkarmadefault = $gmconfig[12]; $allowcommentsdefault = $gmconfig[13]; $commentsorder = $gmconfig[14]; $generateentrypages = $gmconfig[15]; $allowhtmlincomments = $gmconfig[16]; $logkarmaandcomments = $gmconfig[17]; $mailprog = $gmconfig[18]; $NotifyForStatus = $gmconfig[19]; $autolinkurls = $gmconfig[20]; $striplinesfromcomments = $gmconfig[21]; $allowmultiplekarmavotes = $gmconfig[22]; $versionsetup = $gmconfig[23]; $cgilocalpath = $gmconfig[24]; $cgiwebpath = $gmconfig[25]; $concurrentmainandarchives = $gmconfig[26]; $keeparchivemasterindex = $gmconfig[27]; $entrylistsortorder = $gmconfig[28]; $allowkarmaorcomments = $gmconfig[29]; $entrylistcountnumber = $gmconfig[30]; $cookiesallowed = $gmconfig[31]; $logarchivesuffix = $gmconfig[32]; $censorlist = $gmconfig[33]; $censorenabled = $gmconfig[34]; $keepmonthlyarchives = $gmconfig[35]; $defaultentrylistview = $gmconfig[36]; $linktocalendarentries = $gmconfig[37]; $automaticrebuilddefault = $gmconfig[38]; $commententrylistonlyifokay = $gmconfig[39]; $otherfilelist = $gmconfig[40]; $otherfilelistentryrebuild = $gmconfig[41]; $archiveformat = $gmconfig[42]; $inlineformatting = $gmconfig[43]; $uploadfilesallowed = $gmconfig[44]; $uploadfilesizelimit = $gmconfig[45]; } # --------------------- # write the config file # --------------------- sub gm_writeconfig { if ($versionsetup eq "") { $versionsetup = $gmversion; } open (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."); print FUNNYFEETCONNIE "$LogPath\n"; print FUNNYFEETCONNIE "$EntriesPath\n"; print FUNNYFEETCONNIE "$LogWebPath\n"; print FUNNYFEETCONNIE "$EntriesWebPath\n"; print FUNNYFEETCONNIE "$NotifyEmail\n"; print FUNNYFEETCONNIE "$indexfilename\n"; print FUNNYFEETCONNIE "$entrysuffix\n"; print FUNNYFEETCONNIE "$indexdays\n"; print FUNNYFEETCONNIE "$serveroffset\n"; print FUNNYFEETCONNIE "$timezone\n"; print FUNNYFEETCONNIE "$keeplog\n"; print FUNNYFEETCONNIE "$posttoarchives\n"; print FUNNYFEETCONNIE "$allowkarmadefault\n"; print FUNNYFEETCONNIE "$allowcommentsdefault\n"; print FUNNYFEETCONNIE "$commentsorder\n"; print FUNNYFEETCONNIE "$generateentrypages\n"; print FUNNYFEETCONNIE "$allowhtmlincomments\n"; print FUNNYFEETCONNIE "$logkarmaandcomments\n"; print FUNNYFEETCONNIE "$mailprog\n"; print FUNNYFEETCONNIE "$NotifyForStatus\n"; print FUNNYFEETCONNIE "$autolinkurls\n"; print FUNNYFEETCONNIE "$striplinesfromcomments\n"; print FUNNYFEETCONNIE "$allowmultiplekarmavotes\n"; print FUNNYFEETCONNIE "$versionsetup\n"; print FUNNYFEETCONNIE "$cgilocalpath\n"; print FUNNYFEETCONNIE "$cgiwebpath\n"; print FUNNYFEETCONNIE "$concurrentmainandarchives\n"; print FUNNYFEETCONNIE "$keeparchivemasterindex\n"; print FUNNYFEETCONNIE "$entrylistsortorder\n"; print FUNNYFEETCONNIE "$allowkarmaorcomments\n"; print FUNNYFEETCONNIE "$entrylistcountnumber\n"; print FUNNYFEETCONNIE "$cookiesallowed\n"; print FUNNYFEETCONNIE "$logarchivesuffix\n"; print FUNNYFEETCONNIE "$censorlist\n"; print FUNNYFEETCONNIE "$censorenabled\n"; print FUNNYFEETCONNIE "$keepmonthlyarchives\n"; print FUNNYFEETCONNIE "$defaultentrylistview\n"; print FUNNYFEETCONNIE "$linktocalendarentries\n"; print FUNNYFEETCONNIE "$automaticrebuilddefault\n"; print FUNNYFEETCONNIE "$commententrylistonlyifokay\n"; print FUNNYFEETCONNIE "$otherfilelist\n"; print FUNNYFEETCONNIE "$otherfilelistentryrebuild\n"; print FUNNYFEETCONNIE "$archiveformat\n"; print FUNNYFEETCONNIE "$inlineformatting\n"; print FUNNYFEETCONNIE "$uploadfilesallowed\n"; print FUNNYFEETCONNIE "$uploadfilesizelimit\n"; close (FUNNYFEETCONNIE); } # --------------------------------- # gather ye all thy entry variables # --------------------------------- sub gm_getentryvariables { my $thisentrygetmynumber = shift; &gm_readconfig; &gm_readtemplates; &gm_readcounter; $thisentrynumberpadded = sprintf ("%8d", $thisentrygetmynumber); $thisentrynumberpadded =~ tr/ /0/; open (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."); @entrylines = <FUNNYFEETENTRY>; close (FUNNYFEETENTRY); $gmcounter = 0; foreach (@entrylines) { chomp ($entrylines[$gmcounter]); $entrylines[$gmcounter] =~ s/\|\*\|/\n/g; $gmcounter++; } ($thisentrynumber, $thisentryauthor, $thisentrysubject, $thisentryweekdaynumber, $thisentrymonth, $thisentryday, $thisentryyearyear, $thisentryhour, $thisentryminute, $thisentrysecond, $thisentryampm, $thisentrypositivekarma, $thisentrynegativekarma, $thisentrycommentsnumber, $thisentryallowkarma, $thisentryallowcomments, $thisentryopenstatus) = split (/\|/, $entrylines[0]); chomp ($thisentryopenstatus); $thisentryisanarchive = "no"; if ($thisentrynumber <= $newarchivenumber) { $thisentryisanarchive = "yes"; } if ($generateentrypages eq "no") { $thisentryallowcomments = "no"; } $thisentryyear = substr($thisentryyearyear, -2, 2); @months = ("null", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); @weekdays = ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"); $thisentryweekday = $weekdays[$thisentryweekdaynumber]; $thisentrymonthword = $months[$thisentrymonth]; $thisentryweekdayshort = substr($thisentryweekday, 0, 3); $thisentrymonthwordshort = substr($thisentrymonthword, 0, 3); $thisentryweekdayupper = uc($thisentryweekday); $thisentrymonthwordupper = uc($thisentrymonthword); $thisentryweekdaylower = lc($thisentryweekday); $thisentrymonthwordlower = lc($thisentrymonthword); $thisentryweekdayuppershort = uc($thisentryweekdayshort); $thisentrymonthworduppershort = uc($thisentrymonthwordshort); $thisentryweekdaylowershort = lc($thisentryweekdayshort); $thisentrymonthwordlowershort = lc($thisentrymonthwordshort); $thisentrymonthmonth = sprintf ("%2d", $thisentrymonth); $thisentrydayday = sprintf ("%2d", $thisentryday); $thisentryhourhour = sprintf ("%2d", $thisentryhour); $thisentryminuteminute = sprintf ("%2d", $thisentryminute); $thisentrysecondsecond = sprintf ("%2d", $thisentrysecond); $thisentrymonthmonth =~ tr/ /0/; $thisentrydayday =~ tr/ /0/; $thisentryhourhour =~ tr/ /0/; $thisentryminuteminute =~ tr/ /0/; $thisentrysecondsecond =~ tr/ /0/; $thisentryampmdot = "A.M."; $thisentrymilitaryhour = $thisentryhour; if ($thisentryampm eq "PM") { $thisentryampmdot = "P.M."; if ($thisentryhour ne "12") { $thisentrymilitaryhour = $thisentryhour + 12; } } $thisentrymilitaryhour = sprintf ("%2d", $thisentrymilitaryhour); $thisentrymilitaryhour =~ tr/ /0/; $thisentryampmlower = lc($thisentryampm); $thisentryampmdotlower = lc($thisentryampmdot); if (($thisentryhour eq "12") && ($thisentryampm eq "AM")) { $thisentrymilitaryhour = "00"; } $leapyearcheck = $thisentryyearyear % 4; $thisentrymaxdaysinthismonth = 31; if (($thisentrymonthword eq "September") || ($thisentrymonthword eq "April") || ($thisentrymonthword eq "June") || ($thisentrymonthword eq "November")) { $thisentrymaxdaysinthismonth = 30; } if ($thisentrymonthword eq "February") { $thisentrymaxdaysinthismonth = 28; if ($leapyearcheck eq "0") { $thisentrymaxdaysinthismonth = 29; } } $thisentrymaxdaysinpreviousmonth = 31; if (($thisentrymonthword eq "October") || ($thisentrymonthword eq "May") || ($thisentrymonthword eq "July") || ($thisentrymonthword eq "December")) { $thisentrymaxdaysinpreviousmonth = 30; } if ($thisentrymonthword eq "March") { $thisentrymaxdaysinpreviousmonth = 28; if ($leapyearcheck eq "0") { $thisentrymaxdaysinpreviousmonth = 29; } } $thisentryweekbeginningmonth = $thisentrymonth; $thisentryweekbeginningyearyear = $thisentryyearyear; $thisentryweekendingmonth = $thisentrymonth; $thisentryweekendingyearyear = $thisentryyearyear; $thisentryweekbeginningday = $thisentryday - $thisentryweekdaynumber; $thisentryweekendingday = $thisentryweekbeginningday + 6; if ($thisentryweekbeginningday < 1) { $thisentryweekbeginningday = $thisentryweekbeginningday + $thisentrymaxdaysinpreviousmonth; if ($thisentryweekbeginningday > $thisentryday) { $thisentryweekbeginningmonth--; } if ($thisentryweekbeginningmonth < 1) { $thisentryweekbeginningmonth = 12; $thisentryweekbeginningyearyear--; } } if ($thisentryweekendingday > $thisentrymaxdaysinthismonth) { $thisentryweekendingday = $thisentryweekendingday - $thisentrymaxdaysinthismonth; if ($thisentryweekendingday < $thisentryday) { $thisentryweekendingmonth++; } if ($thisentryweekendingmonth > 12) { $thisentryweekendingmonth = 1; $thisentryweekendingyearyear++; } } $thisentryweekbeginningyear = substr($thisentryweekbeginningyearyear, -2, 2); $thisentryweekendingyear = substr($thisentryweekendingyearyear, -2, 2); $thisentryweekbeginningdayday = sprintf ("%2d", $thisentryweekbeginningday); $thisentryweekbeginningdayday =~ tr/ /0/; $thisentryweekendingdayday = sprintf ("%2d", $thisentryweekendingday); $thisentryweekendingdayday =~ tr/ /0/; $thisentryweekbeginningmonthmonth = sprintf ("%2d", $thisentryweekbeginningmonth); $thisentryweekbeginningmonthmonth =~ tr/ /0/; $thisentryweekendingmonthmonth = sprintf ("%2d", $thisentryweekendingmonth); $thisentryweekendingmonthmonth =~ tr/ /0/; $thisentryweekbeginningweekday = "Sunday"; $thisentryweekbeginningmonthword = $months[$thisentryweekbeginningmonth]; $thisentryweekbeginningweekdayshort = substr($thisentryweekbeginningweekday, 0, 3); $thisentryweekbeginningmonthwordshort = substr($thisentryweekbeginningmonthword, 0, 3); $thisentryweekbeginningweekdayupper = uc($thisentryweekbeginningweekday); $thisentryweekbeginningmonthwordupper = uc($thisentryweekbeginningmonthword); $thisentryweekbeginningweekdaylower = lc($thisentryweekbeginningweekday); $thisentryweekbeginningmonthwordlower = lc($thisentryweekbeginningmonthword); $thisentryweekbeginningweekdayuppershort = uc($thisentryweekbeginningweekdayshort); $thisentryweekbeginningmonthworduppershort = uc($thisentryweekbeginningmonthwordshort); $thisentryweekbeginningweekdaylowershort = lc($thisentryweekbeginningweekdayshort); $thisentryweekbeginningmonthwordlowershort = lc($thisentryweekbeginningmonthwordshort); $thisentryweekendingweekday = "Saturday"; $thisentryweekendingmonthword = $months[$thisentryweekendingmonth]; $thisentryweekendingweekdayshort = substr($thisentryweekendingweekday, 0, 3); $thisentryweekendingmonthwordshort = substr($thisentryweekendingmonthword, 0, 3); $thisentryweekendingweekdayupper = uc($thisentryweekendingweekday); $thisentryweekendingmonthwordupper = uc($thisentryweekendingmonthword); $thisentryweekendingweekdaylower = lc($thisentryweekendingweekday); $thisentryweekendingmonthwordlower = lc($thisentryweekendingmonthword); $thisentryweekendingweekdayuppershort = uc($thisentryweekendingweekdayshort); $thisentryweekendingmonthworduppershort = uc($thisentryweekendingmonthwordshort); $thisentryweekendingweekdaylowershort = lc($thisentryweekendingweekdayshort); $thisentryweekendingmonthwordlowershort = lc($thisentryweekendingmonthwordshort); open (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."); @gettheauthordata = <FUNNYFEETVISHNU>; close (FUNNYFEETVISHNU); $thisentryauthoremail = ""; $thisentryauthorhomepage = ""; $thisentryauthorentrycount = ""; foreach $gettheauthordataline (@gettheauthordata) { chomp ($gettheauthordataline); @gettheauthorinfo = split (/\|/, $gettheauthordataline); if ($gettheauthorinfo[0] eq $thisentryauthor) { $thisentryauthoremail = $gettheauthorinfo[2]; $thisentryauthorhomepage = $gettheauthorinfo[3]; $thisentryauthorentrycount = $gettheauthorinfo[5]; } } $thisentryauthorsmartlink = $thisentryauthor; if ($thisentryauthoremail ne "") { $thisentryauthorsmartlink = "<A HREF=\"mailto:$thisentryauthoremail\">$thisentryauthor</A>"; } if ($thisentryauthorhomepage ne "") { $thisentryauthorsmartlink = "<A HREF=\"$thisentryauthorhomepage\">$thisentryauthor</A>"; } $thisentryfilename = "$EntriesWebPath\/$thisentrynumberpadded\.$entrysuffix"; $thisentrycommentspostlink = "$thisentryfilename\#comments"; $thisentrycommentstatussmart = $gmsmartlinkmanycommentstemplate; if ($thisentrycommentsnumber eq "0") { $thisentrycommentstatussmart = $gmsmartlinknocommentstemplate; } if ($thisentrycommentsnumber eq "1") { $thisentrycommentstatussmart = $gmsmartlinkonecommenttemplate; } $thisentrycommentstatussmartupper = uc($thisentrycommentstatussmart); $thisentrycommentstatussmartlower = lc($thisentrycommentstatussmart); $thisentrypagelink = $thisentryfilename; $indexfilenamesmartcheck = "/$indexfilename"; $indexfilenameprefix = substr($indexfilename, 0, 6); if ($indexfilenameprefix eq "index.") { $indexfilenamesmartcheck = "/"; } $thisentrypageindexlink = "$LogWebPath$indexfilenamesmartcheck"; $thisentrypagearchiveindexlink = "$EntriesWebPath$indexfilenamesmartcheck"; if ($keepmonthlyarchives eq "no") { $thisentrypagearchivelogindexlink = $thisentrypageindexlink; } else { if ($archiveformat eq "week") { $thisentrypagearchivelogindexlink = "$EntriesWebPath/archive-$thisentryweekbeginningmonthmonth$thisentryweekbeginningdayday$thisentryweekbeginningyearyear-$thisentryweekendingmonthmonth$thisentryweekendingdayday$thisentryweekendingyearyear\.$logarchivesuffix"; } else { $thisentrypagearchivelogindexlink = "$EntriesWebPath/archive-$thisentrymonthmonth$thisentryyearyear\.$logarchivesuffix"; } } $thisentrypagesmartindexlink = $thisentrypageindexlink; if (($thisentrynumber <= $newarchivenumber) && ($keepmonthlyarchives ne "no")) { $thisentrypagesmartindexlink = $thisentrypagearchivelogindexlink; } $thisentrycommentslink = ""; $thisentrycommentsform = ""; if ($thisentryallowcomments eq "yes") { if (($allowkarmaorcomments eq "comments") || ($allowkarmaorcomments eq "both")) { $thisentrycommentslink = $gmcommentslinktemplate; $thisentrycommentsform = $gmcommentsformtemplate; } } $thisentrykarmalink = ""; $thisentrykarmaform = ""; if ($thisentryallowkarma eq "yes") { if (($allowkarmaorcomments eq "karma") || ($allowkarmaorcomments eq "both")) { $thisentrykarmalink = $gmkarmalinktemplate; $thisentrykarmaform = $gmkarmaformtemplate; } } if (($thisentryisanarchive eq "yes") && ($posttoarchives eq "no")) { $thisentrykarmalink = ""; $thisentrykarmaform = ""; $thisentrycommentslink = ""; $thisentrycommentsform = ""; } $thisentrysearchform = $gmsearchformtemplate; if ($generateentrypages eq "no") { $thisentrycommentslink = ""; $thisentrycommentsform = ""; $thisentrysearchform = ""; } $thisentrypositivekarmalink = "$cgiwebpath/gm-karma.cgi?vote=positive&entry=$thisentrynumberpadded"; $thisentrynegativekarmalink = "$cgiwebpath/gm-karma.cgi?vote=negative&entry=$thisentrynumberpadded"; $thisentrytotalkarma = $thisentrypositivekarma - $thisentrynegativekarma; @thisentrykarmavoters = split (/\|/, $entrylines[1]); $thisentrymainbody = $entrylines[2]; $thisentrymorebody = $entrylines[3]; if (($thisentrymainbody =~ /\|\*\|\|\*\|/) || ($thisentrymorebody =~ /\|\*\|\|\*\|/)) { $thisentrymainbody =~ s/\|\*\|\|\*\|/<PARABREAK>/g; $thisentrymorebody =~ s/\|\*\|\|\*\|/<PARABREAK>/g; } if (($thisentrymainbody =~ /\n\n/) || ($thisentrymorebody =~ /\n\n/)) { $thisentrymainbody =~ s/\n\n/<PARABREAK>/g; $thisentrymorebody =~ s/\n\n/<PARABREAK>/g; } if (($thisentrymainbody =~ /\|\*\|/) || ($thisentrymorebody =~ /\|\*\|/)) { $thisentrymainbody =~ s/\|\*\|/$gmlinebreaktemplate/g; $thisentrymorebody =~ s/\|\*\|/$gmlinebreaktemplate/g; } if (($thisentrymainbody =~ /\n/) || ($thisentrymorebody =~ /\n/)) { $thisentrymainbody =~ s/\n/$gmlinebreaktemplate/g; $thisentrymorebody =~ s/\n/$gmlinebreaktemplate/g; } if (($thisentrymainbody =~ /<PARABREAK>/) || ($thisentrymorebody =~ /<PARABREAK>/)) { $thisentrymainbody =~ s/<PARABREAK>/$gmparaseparationtemplate/g; $thisentrymorebody =~ s/<PARABREAK>/$gmparaseparationtemplate/g; } if (($censorenabled eq "both") || ($censorenabled eq "entries")) { unless ($censorlist eq "") { @censoredterms = split(/\|\*\|/, $censorlist); foreach $thisterm (@censoredterms) { unless ($thisterm eq "") { if ((substr($thisterm, 0, 1) eq "[") && (substr($thisterm, -1, 1) eq "]")) { $thisrealterm = $thisterm; $thisrealterm =~ s/\[//g; $thisrealterm =~ s/\]//g; $thisrealtermlength = length($thisrealterm); $thisrealtermreplace = "*" x $thisrealtermlength; $thisrealtermreplacedash = "-" x $thisrealtermlength; if ($thisentrysubject =~ m/$thisrealterm/i) { $thisentrysubject =~ s/\b$thisrealterm\b/$thisrealtermreplacedash/isg; } if ($thisentrymainbody =~ m/$thisrealterm/i) { $thisentrymainbody =~ s/\b$thisrealterm\b/$thisrealtermreplace/isg; } if ($thisentrymorebody =~ m/$thisrealterm/i) { $thisentrymorebody =~ s/\b$thisrealterm\b/$thisrealtermreplace/isg; } } else { $thisrealtermlength = length($thisterm); $thisrealtermreplace = "*" x $thisrealtermlength; $thisrealtermreplacedash = "-" x $thisrealtermlength; if ($thisentrysubject =~ m/$thisterm/i) { $thisentrysubject =~ s/\b$thisterm\b/$thisrealtermreplacedash/isg; } if ($thisentrymainbody =~ m/$thisterm/i) { $thisentrymainbody =~ s/\b$thisterm\b/$thisrealtermreplace/isg; } if ($thisentrymorebody =~ m/$thisterm/i) { $thisentrymorebody =~ s/\b$thisterm\b/$thisrealtermreplace/isg; } } } } } } $thisentrymorepreface = ""; $thisentrymorelink = ""; if (($thisentrymorebody ne "") && ($generateentrypages ne "no")) { $thisentrymorepreface = $gmmoreprefacetemplate; $thisentrymorelink = $gmmorelinktemplate; } $thisentrycommentdivider = ""; if ($thisentrycommentsnumber ne "0") { $thisentrycommentdivider = $gmcommentdividertemplate; } $thisentrycomments = ""; if (($inlineformatting eq "entries") || ($inlineformatting eq "both")) { if (($thisentrysubject =~ /\*\*(.*?)\*\*/) || ($thisentrysubject =~ /\\\\(.*?)\\\\/) || ($thisentrysubject =~ /__(.*?)__/)) { $thisentrysubject =~ s/\*\*(.*?)\*\*/<B>$1<\/B>/isg; $thisentrysubject =~ s/\\\\(.*?)\\\\/<I>$1<\/I>/isg; $thisentrysubject =~ s/__(.*?)__/<U>$1<\/U>/isg; } if (($thisentrymainbody =~ /\*\*(.*?)\*\*/) || ($thisentrymainbody =~ /\\\\(.*?)\\\\/) || ($thisentrymainbody =~ /__(.*?)__/)) { $thisentrymainbody =~ s/\*\*(.*?)\*\*/<B>$1<\/B>/isg; $thisentrymainbody =~ s/\\\\(.*?)\\\\/<I>$1<\/I>/isg; $thisentrymainbody =~ s/__(.*?)__/<U>$1<\/U>/isg; } if (($thisentrymorebody =~ /\*\*(.*?)\*\*/) || ($thisentrymorebody =~ /\\\\(.*?)\\\\/) || ($thisentrymorebody =~ /__(.*?)__/)) { $thisentrymorebody =~ s/\*\*(.*?)\*\*/<B>$1<\/B>/isg; $thisentrymorebody =~ s/\\\\(.*?)\\\\/<I>$1<\/I>/isg; $thisentrymorebody =~ s/__(.*?)__/<U>$1<\/U>/isg; } } # Smiley-Hack by Nanzy (this part applies to the mainbody) $thisentrymainbody =~ s/\:determined:/<img src=\"$LogWebPath\/emoticons\/determined.gif\" alt=\"determined\" \/>/g; $thisentrymainbody =~ s/\:angry:/<img src=\"$LogWebPath\/emoticons\/angry.gif\" alt=\"angry, grr\" \/>/g; $thisentrymainbody =~ s/\:annoyed:/<img src=\"$LogWebPath\/emoticons\/annoyed.gif\" alt=\"annoyed\" \/>/g; $thisentrymainbody =~ s/\:artistic:/<img src=\"$LogWebPath\/emoticons\/artistic.gif\" alt=\"artistic\" \/>/g; $thisentrymainbody =~ s/\:blah:/<img src=\"$LogWebPath\/emoticons\/blah.gif\" alt=\"blah\" \/>/g; $thisentrymainbody =~ s/\:blank:/<img src=\"$LogWebPath\/emoticons\/blank.gif\" alt=\"blank\" \/>/g; $thisentrymainbody =~ s/\:bouncy:/<img src=\"$LogWebPath\/emoticons\/bouncy.gif\" alt=\"bouncy\" \/>/g; $thisentrymainbody =~ s/\:confused:/<img src=\"$LogWebPath\/emoticons\/confused.gif\" alt=\"confused\" \/>/g; $thisentrymainbody =~ s/\:discontent:/<img src=\"$LogWebPath\/emoticons\/discontent.gif\" alt=\"discontent\" \/>/g; $thisentrymainbody =~ s/\:devious:/<img src=\"$LogWebPath\/emoticons\/devious.gif\" alt=\"devious\" \/>/g; $thisentrymainbody =~ s/\:dirty:/<img src=\"$LogWebPath\/emoticons\/dirty.gif\" alt=\"dirty\" \/>/g; $thisentrymainbody =~ s/\:blush:/<img src=\"$LogWebPath\/emoticons\/embarrassed.gif\" alt=\"embarrassed\" \/>/g; $thisentrymainbody =~ s/\:enraged:/<img src=\"$LogWebPath\/emoticons\/enraged.gif\" alt=\"enraged\" \/>/g; $thisentrymainbody =~ s/\:P/<img src=\"$LogWebPath\/emoticons\/flirty.gif\" alt=\"flirty\" \/>/g; $thisentrymainbody =~ s/\:geeky:/<img src=\"$LogWebPath\/emoticons\/geeky.gif\" alt=\"geeky\" \/>/g; $thisentrymainbody =~ s/\:D/<img src=\"$LogWebPath\/emoticons\/giggly.gif\" alt=\"giggly\" \/>/g; $thisentrymainbody =~ s/\:high:/<img src=\"$LogWebPath\/emoticons\/high.gif\" alt=\"high\" \/>/g; $thisentrymainbody =~ s/\:hot:/<img src=\"$LogWebPath\/emoticons\/hot.gif\" alt=\"hot\" \/>/g; $thisentrymainbody =~ s/\:hyper:/<img src=\"$LogWebPath\/emoticons\/hyper.gif\" alt=\"hyper\" \/>/g; $thisentrymainbody =~ s/\:jealous:/<img src=\"$LogWebPath\/emoticons\/jealous.gif\" alt=\"jealous\" \/>/g; $thisentrymainbody =~ s/\:moody:/<img src=\"$LogWebPath\/emoticons\/moody.gif\" alt=\"moody\" \/>/g; $thisentrymainbody =~ s/\:okay:/<img src=\"$LogWebPath\/emoticons\/okay.gif\" alt=\"okay\" \/>/g; $thisentrymainbody =~ s/\:\(/<img src=\"$LogWebPath\/emoticons\/sad.gif\" alt=\"sad\" \/>/g; $thisentrymainbody =~ s/\:sick:/<img src=\"$LogWebPath\/emoticons\/sick.gif\" alt=\"sick\" \/>/g; $thisentrymainbody =~ s/\:silly:/<img src=\"$LogWebPath\/emoticons\/silly.gif\" alt=\"silly\" \/>/g; $thisentrymainbody =~ s/\:\)/<img src=\"$LogWebPath\/emoticons\/smile.gif\" alt=\"smile\" \/>/g; $thisentrymainbody =~ s/\:stressed:/<img src=\"$LogWebPath\/emoticons\/stressed.gif\" alt=\"stressed\" \/>/g; $thisentrymainbody =~ s/\:surprised:/<img src=\"$LogWebPath\/emoticons\/surprised.gif\" alt=\"surprised\" \/>/g; $thisentrymainbody =~ s/\:thoughtful:/<img src=\"$LogWebPath\/emoticons\/thoughtful.gif\" alt=\"thoughtful\" \/>/g; $thisentrymainbody =~ s/\:tired:/<img src=\"$LogWebPath\/emoticons\/tired.gif\" alt=\"tired\" \/>/g; $thisentrymainbody =~ s/\:weird:/<img src=\"$LogWebPath\/emoticons\/weird.gif\" alt=\"weird\" \/>/g; $thisentrymainbody =~ s/\;\)/<img src=\"$LogWebPath\/emoticons\/wink.gif\" alt=\"wink\" \/>/g; $thisentrymainbody =~ s/\:working:/<img src=\"$LogWebPath\/emoticons\/working.gif\" alt=\"working\" \/>/g; $thisentrymainbody =~ s/\:worried:/<img src=\"$LogWebPath\/emoticons\/worried.gif\" alt=\"worried\" \/>/g; # Smiley-Hack by Nanzy (this part applies to the morebody) $thisentrymorebody =~ s/\:determined:/<img src=\"$LogWebPath\/emoticons\/determined.gif\" alt=\"determined\" \/>/g; $thisentrymorebody =~ s/\:angry:/<img src=\"$LogWebPath\/emoticons\/angry.gif\" alt=\"angry, grr\" \/>/g; $thisentrymorebody =~ s/\:annoyed:/<img src=\"$LogWebPath\/emoticons\/annoyed.gif\" alt=\"annoyed\" \/>/g; $thisentrymorebody =~ s/\:artistic:/<img src=\"$LogWebPath\/emoticons\/artistic.gif\" alt=\"artistic\" \/>/g; $thisentrymorebody =~ s/\:blah:/<img src=\"$LogWebPath\/emoticons\/blah.gif\" alt=\"blah\" \/>/g; $thisentrymorebody =~ s/\:blank:/<img src=\"$LogWebPath\/emoticons\/blank.gif\" alt=\"blank\" \/>/g; $thisentrymorebody =~ s/\:bouncy:/<img src=\"$LogWebPath\/emoticons\/bouncy.gif\" alt=\"bouncy\" \/>/g; $thisentrymorebody =~ s/\:confused:/<img src=\"$LogWebPath\/emoticons\/confused.gif\" alt=\"confused\" \/>/g; $thisentrymorebody =~ s/\:discontent:/<img src=\"$LogWebPath\/emoticons\/discontent.gif\" alt=\"discontent\" \/>/g; $thisentrymorebody =~ s/\:devious:/<img src=\"$LogWebPath\/emoticons\/devious.gif\" alt=\"devious\" \/>/g; $thisentrymorebody =~ s/\:dirty:/<img src=\"$LogWebPath\/emoticons\/dirty.gif\" alt=\"dirty\" \/>/g; $thisentrymorebody =~ s/\:blush:/<img src=\"$LogWebPath\/emoticons\/embarrassed.gif\" alt=\"embarrassed\" \/>/g; $thisentrymorebody =~ s/\:enraged:/<img src=\"$LogWebPath\/emoticons\/enraged.gif\" alt=\"enraged\" \/>/g; $thisentrymorebody =~ s/\:P/<img src=\"$LogWebPath\/emoticons\/flirty.gif\" alt=\"flirty\" \/>/g; $thisentrymorebody =~ s/\:geeky:/<img src=\"$LogWebPath\/emoticons\/geeky.gif\" alt=\"geeky\" \/>/g; $thisentrymorebody =~ s/\:D/<img src=\"$LogWebPath\/emoticons\/giggly.gif\" alt=\"giggly\" \/>/g; $thisentrymorebody =~ s/\:high:/<img src=\"$LogWebPath\/emoticons\/high.gif\" alt=\"high\" \/>/g; $thisentrymorebody =~ s/\:hot:/<img src=\"$LogWebPath\/emoticons\/hot.gif\" alt=\"hot\" \/>/g; $thisentrymorebody =~ s/\:hyper:/<img src=\"$LogWebPath\/emoticons\/hyper.gif\" alt=\"hyper\" \/>/g; $thisentrymorebody =~ s/\:jealous:/<img src=\"$LogWebPath\/emoticons\/jealous.gif\" alt=\"jealous\" \/>/g; $thisentrymorebody =~ s/\:moody:/<img src=\"$LogWebPath\/emoticons\/moody.gif\" alt=\"moody\" \/>/g; $thisentrymorebody =~ s/\:okay:/<img src=\"$LogWebPath\/emoticons\/okay.gif\" alt=\"okay\" \/>/g; $thisentrymorebody =~ s/\:\(/<img src=\"$LogWebPath\/emoticons\/sad.gif\" alt=\"sad\" \/>/g; $thisentrymorebody =~ s/\:sick:/<img src=\"$LogWebPath\/emoticons\/sick.gif\" alt=\"sick\" \/>/g; $thisentrymorebody =~ s/\:silly:/<img src=\"$LogWebPath\/emoticons\/silly.gif\" alt=\"silly\" \/>/g; $thisentrymorebody =~ s/\:\)/<img src=\"$LogWebPath\/emoticons\/smile.gif\" alt=\"smile\" \/>/g; $thisentrymorebody =~ s/\:stressed:/<img src=\"$LogWebPath\/emoticons\/stressed.gif\" alt=\"stressed\" \/>/g; $thisentrymorebody =~ s/\:surprised:/<img src=\"$LogWebPath\/emoticons\/surprised.gif\" alt=\"surprised\" \/>/g; $thisentrymorebody =~ s/\:thoughtful:/<img src=\"$LogWebPath\/emoticons\/thoughtful.gif\" alt=\"thoughtful\" \/>/g; $thisentrymorebody =~ s/\:tired:/<img src=\"$LogWebPath\/emoticons\/tired.gif\" alt=\"tired\" \/>/g; $thisentrymorebody =~ s/\:weird:/<img src=\"$LogWebPath\/emoticons\/weird.gif\" alt=\"weird\" \/>/g; $thisentrymorebody =~ s/\;\)/<img src=\"$LogWebPath\/emoticons\/wink.gif\" alt=\"wink\" \/>/g; $thisentrymorebody =~ s/\:working:/<img src=\"$LogWebPath\/emoticons\/working.gif\" alt=\"working\" \/>/g; $thisentrymorebody =~ s/\:worried:/<img src=\"$LogWebPath\/emoticons\/worried.gif\" alt=\"worried\" \/>/g; if (($thisentrycommentsnumber ne "0") && ($generateentrypages ne "no")) { $thisisaspellcheck = "no"; &gm_collatecomments; $thisentrycomments =~ s/\&quot;/"/g; } } # ----------------- # comment collating # ----------------- sub gm_collatecomments { $commentcounter = 4; if ($commentsorder eq "ascending") { $commentcounter = $thisentrycommentsnumber + 3; } $commentcountermax = $thisentrycommentsnumber + 3; $commentcountercurrent = $thisentrycommentsnumber; do { $thiscommentordernumber = $commentcounter - 3; ($thiscommentauthor, $thiscommentauthorip, $thiscommentauthoremailabsolute, $thiscommentauthorhomepageabsolute, $thiscommentweekdaynumber, $thiscommentmonth, $thiscommentday, $thiscommentyearyear, $thiscommenthour, $thiscommentminute, $thiscommentsecond, $thiscommentampm, $thiscommenttext) = split (/\|/, $entrylines[$commentcounter]); $thiscommentyear = substr($thiscommentyearyear, -2, 2); @months = ("null", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); @weekdays = ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"); $thiscommentweekday = $weekdays[$thiscommentweekdaynumber]; $thiscommentmonthword = $months[$thiscommentmonth]; $thiscommentweekdayshort = substr($thiscommentweekday, 0, 3); $thiscommentmonthwordshort = substr($thiscommentmonthword, 0, 3); $thiscommentweekdayupper = uc($thiscommentweekday); $thiscommentmonthwordupper = uc($thiscommentmonthword); $thiscommentweekdaylower = lc($thiscommentweekday); $thiscommentmonthwordlower = lc($thiscommentmonthword); $thiscommentweekdayuppershort = uc($thiscommentweekdayshort); $thiscommentmonthworduppershort = uc($thiscommentmonthwordshort); $thiscommentweekdaylowershort = lc($thiscommentweekdayshort); $thiscommentmonthwordlowershort = lc($thiscommentmonthwordshort); $thiscommentmonthmonth = sprintf ("%2d", $thiscommentmonth); $thiscommentdayday = sprintf ("%2d", $thiscommentday); $thiscommenthourhour = sprintf ("%2d", $thiscommenthour); $thiscommentminuteminute = sprintf ("%2d", $thiscommentminute); $thiscommentsecondsecond = sprintf ("%2d", $thiscommentsecond); $thiscommentmonthmonth =~ tr/ /0/; $thiscommentdayday =~ tr/ /0/; $thiscommenthourhour =~ tr/ /0/; $thiscommentminuteminute =~ tr/ /0/; $thiscommentsecondsecond =~ tr/ /0/; $thiscommentampmdot = "A.M."; $thiscommentmilitaryhour = $thiscommenthour; if ($thiscommentampm eq "PM") { $thiscommentampmdot = "P.M."; if ($thiscommenthour ne "12") { $thiscommentmilitaryhour = $thiscommenthour + 12; } } $thiscommentmilitaryhour = sprintf ("%2d", $thiscommentmilitaryhour); $thiscommentmilitaryhour =~ tr/ /0/; $thiscommentampmlower = lc($thiscommentampm); $thiscommentampmdotlower = lc($thiscommentampmdot); $thiscommentauthor =~ s/"/\&quot;/g; $thiscommentauthoremailabsolute =~ s/"/\&quot;/g; $thiscommentauthorhomepageabsolute =~ s/"/\&quot;/g; $thiscommentauthoremail = ""; $thiscommentauthorhomepage = ""; $thiscommentauthorsmartlink = $thiscommentauthor; if ($thiscommentauthoremailabsolute ne "") { $thiscommentauthoremail = $gmcommentauthoremailtemplate; $thiscommentauthorsmartlink = "<A HREF=\"mailto:$thiscommentauthoremailabsolute\">$thiscommentauthor</A>"; } if ($thiscommentauthorhomepageabsolute ne "") { $thiscommentauthorhomepage = $gmcommentauthorhomepagetemplate; $thiscommentauthorsmartlink = "<A HREF=\"$thiscommentauthorhomepageabsolute\">$thiscommentauthor</A>"; } if (($allowhtmlincomments eq "linkboldital") || ($allowhtmlincomments eq "linkonly")) { if ($thiscommenttext =~ m/\*/i) { $thiscommenttext =~ s/\*/\|AMP\|/g; } if (($thiscommenttext =~ m/<A HREF/i) && ($thiscommenttext =~ m/<\/A>/i)) { $thiscommenttext =~ s/<A HREF/\*A HREF\*/isg; $thiscommenttext =~ s/<\/A>/\*A\*/isg; } if ($allowhtmlincomments eq "linkboldital") { if (($thiscommenttext =~ m/<B>/i) && ($thiscommenttext =~ m/<\/B>/i)) { $thiscommenttext =~ s/<B>/\*B\*/isg; $thiscommenttext =~ s/<\/B>/\*BB\*/isg; } if (($thiscommenttext =~ m/<I>/i) && ($thiscommenttext =~ m/<\/I>/i)) { $thiscommenttext =~ s/<I>/\*I\*/isg; $thiscommenttext =~ s/<\/I>/\*II\*/isg; } } } unless ($allowhtmlincomments eq "yes") { $thiscommenttext =~ s/<([^>]|\n)*>//g; } if ($autolinkurls eq "yes") { # these two lines of code written in part by Neal Coffey (cray@indecisions.org) $thiscommenttext =~ s#(^|\s)(\w+://)([A-Za-z0-9?=_\-/.%+&'~\#@!\^]+)#$1<A HREF="$2$3">$2$3</A>#isg; $thiscommenttext =~ s#(^|\s)(www.[A-Za-z0-9?=_\-/.%+&'~\#@!\^]+)#$1<A HREF="http://$2">$2</A>#isg; # thanks, Neal! $thiscommenttext =~ s/(\w+\@\w+\.\w+)/<A HREF="mailto:$1">$1<\/A>/isg; } # Smiley-Hack by Nanzy (this part applies to the comments) $thiscommenttext =~ s/\:determined:/<img src=\"$LogWebPath\/emoticons\/determined.gif\" alt=\"determined\" \/>/g; $thiscommenttext =~ s/\:angry:/<img src=\"$LogWebPath\/emoticons\/angry.gif\" alt=\"angry, grr\" \/>/g; $thiscommenttext =~ s/\:annoyed:/<img src=\"$LogWebPath\/emoticons\/annoyed.gif\" alt=\"annoyed\" \/>/g; $thiscommenttext =~ s/\:artistic:/<img src=\"$LogWebPath\/emoticons\/artistic.gif\" alt=\"artistic\" \/>/g; $thiscommenttext =~ s/\:blah:/<img src=\"$LogWebPath\/emoticons\/blah.gif\" alt=\"blah\" \/>/g; $thiscommenttext =~ s/\:blank:/<img src=\"$LogWebPath\/emoticons\/blank.gif\" alt=\"blank\" \/>/g; $thiscommenttext =~ s/\:bouncy:/<img src=\"$LogWebPath\/emoticons\/bouncy.gif\" alt=\"bouncy\" \/>/g; $thiscommenttext =~ s/\:confused:/<img src=\"$LogWebPath\/emoticons\/confused.gif\" alt=\"confused\" \/>/g; $thiscommenttext =~ s/\:discontent:/<img src=\"$LogWebPath\/emoticons\/discontent.gif\" alt=\"discontent\" \/>/g; $thiscommenttext =~ s/\:devious:/<img src=\"$LogWebPath\/emoticons\/devious.gif\" alt=\"devious\" \/>/g; $thiscommenttext =~ s/\:dirty:/<img src=\"$LogWebPath\/emoticons\/dirty.gif\" alt=\"dirty\" \/>/g; $thiscommenttext =~ s/\:blush:/<img src=\"$LogWebPath\/emoticons\/embarrassed.gif\" alt=\"embarrassed\" \/>/g; $thiscommenttext =~ s/\:enraged:/<img src=\"$LogWebPath\/emoticons\/enraged.gif\" alt=\"enraged\" \/>/g; $thiscommenttext =~ s/\:P/<img src=\"$LogWebPath\/emoticons\/flirty.gif\" alt=\"flirty\" \/>/g; $thiscommenttext =~ s/\:geeky:/<img src=\"$LogWebPath\/emoticons\/geeky.gif\" alt=\"geeky\" \/>/g; $thiscommenttext =~ s/\:D/<img src=\"$LogWebPath\/emoticons\/giggly.gif\" alt=\"giggly\" \/>/g; $thiscommenttext =~ s/\:high:/<img src=\"$LogWebPath\/emoticons\/high.gif\" alt=\"high\" \/>/g; $thiscommenttext =~ s/\:hot:/<img src=\"$LogWebPath\/emoticons\/hot.gif\" alt=\"hot\" \/>/g; $thiscommenttext =~ s/\:hyper:/<img src=\"$LogWebPath\/emoticons\/hyper.gif\" alt=\"hyper\" \/>/g; $thiscommenttext =~ s/\:jealous:/<img src=\"$LogWebPath\/emoticons\/jealous.gif\" alt=\"jealous\" \/>/g; $thiscommenttext =~ s/\:moody:/<img src=\"$LogWebPath\/emoticons\/moody.gif\" alt=\"moody\" \/>/g; $thiscommenttext =~ s/\:okay:/<img src=\"$LogWebPath\/emoticons\/okay.gif\" alt=\"okay\" \/>/g; $thiscommenttext =~ s/\:\(/<img src=\"$LogWebPath\/emoticons\/sad.gif\" alt=\"sad\" \/>/g; $thiscommenttext =~ s/\:sick:/<img src=\"$LogWebPath\/emoticons\/sick.gif\" alt=\"sick\" \/>/g; $thiscommenttext =~ s/\:silly:/<img src=\"$LogWebPath\/emoticons\/silly.gif\" alt=\"silly\" \/>/g; $thiscommenttext =~ s/\:\)/<img src=\"$LogWebPath\/emoticons\/smile.gif\" alt=\"smile\" \/>/g; $thiscommenttext =~ s/\:stressed:/<img src=\"$LogWebPath\/emoticons\/stressed.gif\" alt=\"stressed\" \/>/g; $thiscommenttext =~ s/\:surprised:/<img src=\"$LogWebPath\/emoticons\/surprised.gif\" alt=\"surprised\" \/>/g; $thiscommenttext =~ s/\:thoughtful:/<img src=\"$LogWebPath\/emoticons\/thoughtful.gif\" alt=\"thoughtful\" \/>/g; $thiscommenttext =~ s/\:tired:/<img src=\"$LogWebPath\/emoticons\/tired.gif\" alt=\"tired\" \/>/g; $thiscommenttext =~ s/\:weird:/<img src=\"$LogWebPath\/emoticons\/weird.gif\" alt=\"weird\" \/>/g; $thiscommenttext =~ s/\;\)/<img src=\"$LogWebPath\/emoticons\/wink.gif\" alt=\"wink\" \/>/g; $thiscommenttext =~ s/\:working:/<img src=\"$LogWebPath\/emoticons\/working.gif\" alt=\"working\" \/>/g; $thiscommenttext =~ s/\:worried:/<img src=\"$LogWebPath\/emoticons\/worried.gif\" alt=\"worried\" \/>/g;

** You don't need to edit below this line **