############################################################################### # Greymatter 1.7.2 # Copyright (c)2000-2007, The Greymatter team # http://greymatterforum.proboards82.com/ # By possessing this software, you agree not to hold the author responsible for # any problems that may arise from your installation or usage of Greymatter # itself, or from any content generated by yourself or others through the use of # this program. You may freely modify and redistribute this program, so # long as every copyright notice (including in this manual and in the Greymatter # code) remains fully intact. Finally, you may not sell or in any way # make a financial profit from this program, either in original or modified form. # Your possession of this software signifies that you agree to these terms; # please delete your copy of this software if you don't agree to these terms. # Original Creators Noah Grey ############################################################################### use lib 'libs'; use Gm_Constants; use Gm_Utils qw( println ); use Gm_Web; use Gm_Storage; # PF use Gm_Trace; ### GLOBAL VARS my $newTemplates = (); # init to empty my $newConfigs = (); # init to empty $cookiename = "gm_password"; # ----------------- # program variables # ----------------- # NOTE that the version is MAJOR NUMBER.YEAR.NO_OF_REL_THAT_YEAR # e.g. a major refactoring is done in 2007 the release would be 2.7.1 # later that year a security fix comes out so release would be 2.7.2 $gmversion = Gm_Constants::GM_VERSION; $gmfonttag = qq(); ## Todo, make this seperate file, doesn't need to be in code to change $gmadmincss = qq# #; $gmheadtag = qq# Greymatter $gmadmincss #; $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 = '' + gmselection + ''; return; } if (window.event.keyCode == 2) { document.selection.createRange().text = '' + gmselection + ''; return; } if (window.event.keyCode == 9) { document.selection.createRange().text = '' + gmselection + ''; return; } if (window.event.keyCode == 21) { document.selection.createRange().text = '' + gmselection + ''; return; } } } //--> #; $gmframetop = qq(

$gmfonttaggreymatter $gmversion

$gmfonttag); $gmframetoptwo = qq(
$gmfonttag); $gmframebottom = qq(

v$gmversion · ©2000-2007 The Greymatter Team

); $gmframebottomtwo = qq(
); $statusnote = Gm_Constants::EMPTY; # ------------------ # emoticons subroutine # ------------------ # added by flipped cracker 9/17/2003 # version 1.3 # DEPRECATED: Gm_Core::translateEmoticons sub gm_emoticons { &gm_readconfig; $_ = shift; if( (($emoticonsallowed eq Gm_Constants::BOTH) || ($emoticonsallowed eq $returnto)) && ($thisentryemoticonsallowed eq Gm_Constants::YES) ) { s/\:\)/\"smile\"/g; s/\:O/\"shocked\"/g; s/\:\(/\sad\/g; s/\:D/\"big/g; s/\:P/\"razz\"/g; s/\;\)/\"wink\"/g; s/\:angry:/\"angry,/g; s/\:blush:/\"blush\"/g; s/\:confused:/\"confused\"/g; s/\:cool:/\"cool/g; s/\:crazy:/\"crazy\"/g; s/\:cry:/\"crying\"/g; s/\:doze:/\"sleepy\"/g; s/\:hehe:/\"hehe\"/g; s/\:laugh:/\"LOL\"/g; s/\:plain:/\"plain\"/g; s/\:rolleyes:/\"rolls/g; s/\:satisfied:/\"satisfied\"/g; } return($_); } # merged in version 1.3 # ------------------ # emoticons code display subroutine # ------------------ # added by flipped cracker 9/17/2003 # version 1.3 sub gm_emoticons_code { &gm_readconfig; $emoticonsmaincode = Gm_Constants::EMPTY; if( ($emoticonsallowed eq Gm_Constants::BOTH) || ($emoticonsallowed eq Gm_Constants::ENTRIES) ) { $emoticonsmaincode = "
\":)\" \":O\" \":(\"
\":D\" \":P\" \";)\"
\":angry:\" \":blush:\" \":confused:\"
\":cool:\" \":crazy:\" \":cry:\"
\":doze:\" \":hehe:\" \":laugh:\"
\":plain:\" \":rolleyes:\" \":satisfied:\"
"; $emoticonsmorecode = "
\":)\" \":O\" \":(\"
\":D\" \":P\" \";)\"
\":angry:\" \":blush:\" \":confused:\"
\":cool:\" \":crazy:\" \":cry:\"
\":doze:\" \":hehe:\" \":laugh:\"
\":plain:\" \":rolleyes:\" \":satisfied:\"
"; } } # --------------- # date subroutine # --------------- # DEPRECATED: Gm_Utils::getStdDate( $serveroffset ); # # ---------------- # read the counter # ---------------- # TODO, DEPRECATE THIS AND USE GETCOUNTERS EVERYWHERE sub gm_readcounter { my $gmcounters = Gm_Storage::getCounters( errHandler=>\&Gm_Web::displayAdminErrorExit ); $newentrynumber = $gmcounters->{'entrytotal'}; $newarchivenumber = $gmcounters->{'archivetotal'}; $newstayattopnumber = $gmcounters->{'stayattopentry'}; $newalltimepktotalnumber = $gmcounters->{'karmapos'}; $newalltimenktotalnumber = $gmcounters->{'karmaneg'}; $newalltimecommentstotalnumber = $gmcounters->{'commenttotal'}; $newalltimeopenentriesnumber = $gmcounters->{'opentotal'}; $newalltimeclosedentriesnumber = $gmcounters->{'closedtotal'}; } # ----------------- # write the counter # ----------------- # TODO, DEPRECATE THIS AND USE SETCOUNTERS EVERYWHERE sub gm_writecounter { my %counters = (); $counters{'entrytotal'} = $newentrynumber; $counters{'archivetotal'} = $newarchivenumber; $counters{'stayattopentry'} = $newstayattopnumber; $counters{'karmapos'} = $newalltimepktotalnumber; $counters{'karmaneg'} = $newalltimenktotalnumber; $counters{'commenttotal'} = $newalltimecommentstotalnumber; $counters{'opentotal'} = $newalltimeopenentriesnumber; $counters{'closedtotal'} = $newalltimeclosedentriesnumber; Gm_Storage::setCounters( list=>\%counters, errHandler=>\&Gm_Web::displayAdminErrorExit ); } # ------------------ # read the templates ## TODO REMOVE ALL REFERENCES TO THIS CALL. REPLACED BY GM_STORAGE FUNCTION ## if leave, access global newTemplates hash reference # ------------------ sub gm_readtemplates { $newTemplates = Gm_Storage::getTemplates( errHandler=>\&Gm_Web::displayAdminErrorExit ); ### TODO, NOW THAT WE ARE USING HASH FOR TEMPLATES, GO THROUGH AND REMOVE REFERENCES TO ## INVIDUAL VARS BELOW, E.G. REPLACE $gmindextemplate WITH $newTemplates->{'gmindextemplate'} $gmindextemplate = $newTemplates->{'gmindextemplate'}; $gmentrypagetemplate = $newTemplates->{'gmentrypagetemplate'}; $gmarchiveindextemplate = $newTemplates->{'gmarchiveindextemplate'}; $gmarchiveentrypagetemplate = $newTemplates->{'gmarchiveentrypagetemplate'}; $gmentrytemplate = $newTemplates->{'gmentrytemplate'}; $gmarchiveentrytemplate = $newTemplates->{'gmarchiveentrytemplate'}; $gmstayattoptemplate = $newTemplates->{'gmstayattoptemplate'}; $gmdatetemplate = $newTemplates->{'gmdatetemplate'}; $gmcommentstemplate = $newTemplates->{'gmcommentstemplate'}; $gmcommentsformtemplate = $newTemplates->{'gmcommentsformtemplate'}; $gmparaseparationtemplate = $newTemplates->{'gmparaseparationtemplate'}; $gmkarmaformtemplate = $newTemplates->{'gmkarmaformtemplate'}; $gmlinktargettemplate = $newTemplates->{'gmlinktargettemplate'}; $gmdategroupingfootertemplate = $newTemplates->{'gmdategroupingfootertemplate'}; $gmkarmalinktemplate = $newTemplates->{'gmkarmalinktemplate'}; $gmcommentslinktemplate = $newTemplates->{'gmcommentslinktemplate'}; $gmcommentauthoremailtemplate = $newTemplates->{'gmcommentauthoremailtemplate'}; $gmcommentauthorhomepagetemplate = $newTemplates->{'gmcommentauthorhomepagetemplate'}; $gmcommentdividertemplate = $newTemplates->{'gmcommentdividertemplate'}; $gmmoreentrytemplate = $newTemplates->{'gmmoreentrytemplate'}; $gmmoreentrypagetemplate = $newTemplates->{'gmmoreentrypagetemplate'}; $gmmorearchiveentrypagetemplate = $newTemplates->{'gmmorearchiveentrypagetemplate'}; $gmpreviouslinktemplate = $newTemplates->{'gmpreviouslinktemplate'}; $gmnextlinktemplate = $newTemplates->{'gmnextlinktemplate'}; $gmpreviousmorelinktemplate = $newTemplates->{'gmpreviousmorelinktemplate'}; $gmnextmorelinktemplate = $newTemplates->{'gmnextmorelinktemplate'}; $gmarchivemasterindextemplate = $newTemplates->{'gmarchivemasterindextemplate'}; $gmlogarchiveslinktemplate = $newTemplates->{'gmlogarchiveslinktemplate'}; $gmentrypagelinktemplate = $newTemplates->{'gmentrypagelinktemplate'}; $gmmoreentrypagelinktemplate = $newTemplates->{'gmmoreentrypagelinktemplate'}; $gmlogarchiveslinkseparatortemplate = $newTemplates->{'gmlogarchiveslinkseparatortemplate'}; $gmentrypagelinkseparatortemplate = $newTemplates->{'gmentrypagelinkseparatortemplate'}; $gmentrypagelinkmonthseparatortemplate = $newTemplates->{'gmentrypagelinkmonthseparatortemplate'}; $gmentrypagelinkdayseparatortemplate = $newTemplates->{'gmentrypagelinkdayseparatortemplate'}; $gmentrypagelinkyearseparatortemplate = $newTemplates->{'gmentrypagelinkyearseparatortemplate'}; $gmheadertemplate = $newTemplates->{'gmheadertemplate'}; $gmfootertemplate = $newTemplates->{'gmfootertemplate'}; $gmsidebartemplate = $newTemplates->{'gmsidebartemplate'}; $gmentryseparatortemplate = $newTemplates->{'gmentryseparatortemplate'}; $gmarchiveentryseparatortemplate = $newTemplates->{'gmarchiveentryseparatortemplate'}; $gmmorearchiveentrytemplate = $newTemplates->{'gmmorearchiveentrytemplate'}; $gmdatearchivetemplate = $newTemplates->{'gmdatearchivetemplate'}; $gmlogarchiveslinkweeklytemplate = $newTemplates->{'gmlogarchiveslinkweeklytemplate'}; $gmcustomonetemplate = $newTemplates->{'gmcustomonetemplate'}; $gmcustomtwotemplate = $newTemplates->{'gmcustomtwotemplate'}; $gmcustomthreetemplate = $newTemplates->{'gmcustomthreetemplate'}; $gmcustomfourtemplate = $newTemplates->{'gmcustomfourtemplate'}; $gmcustomfivetemplate = $newTemplates->{'gmcustomfivetemplate'}; $gmcustomsixtemplate = $newTemplates->{'gmcustomsixtemplate'}; $gmcustomseventemplate = $newTemplates->{'gmcustomseventemplate'}; $gmcustomeighttemplate = $newTemplates->{'gmcustomeighttemplate'}; $gmcustomninetemplate = $newTemplates->{'gmcustomninetemplate'}; $gmcustomtentemplate = $newTemplates->{'gmcustomtentemplate'}; $gmpopuppagetemplate = $newTemplates->{'gmpopuppagetemplate'}; $gmpopupcodetemplate = $newTemplates->{'gmpopupcodetemplate'}; $gmsearchformtemplate = $newTemplates->{'gmsearchformtemplate'}; $gmsearchresultspagetemplate = $newTemplates->{'gmsearchresultspagetemplate'}; $gmsearchresultsentrytemplate = $newTemplates->{'gmsearchresultsentrytemplate'}; $gmcalendartablebeginningtemplate = $newTemplates->{'gmcalendartablebeginningtemplate'}; $gmcalendartableendingtemplate = $newTemplates->{'gmcalendartableendingtemplate'}; $gmcalendarblankcelltemplate = $newTemplates->{'gmcalendarblankcelltemplate'}; $gmcalendarfullcelltemplate = $newTemplates->{'gmcalendarfullcelltemplate'}; $gmcalendarfullcelllinktemplate = $newTemplates->{'gmcalendarfullcelllinktemplate'}; $gmcalendarweekfulldaytemplate = $newTemplates->{'gmcalendarweekfulldaytemplate'}; $gmcalendarweekfulldaylinktemplate = $newTemplates->{'gmcalendarweekfulldaylinktemplate'}; $gmcommentpreviewdividertemplate = $newTemplates->{'gmcommentpreviewdividertemplate'}; $gmcommentpreviewformtemplate = $newTemplates->{'gmcommentpreviewformtemplate'}; $gmsmartlinknocommentstemplate = $newTemplates->{'gmsmartlinknocommentstemplate'}; $gmsmartlinkonecommenttemplate = $newTemplates->{'gmsmartlinkonecommenttemplate'}; $gmsmartlinkmanycommentstemplate = $newTemplates->{'gmsmartlinkmanycommentstemplate'}; $gmlinebreaktemplate = $newTemplates->{'gmlinebreaktemplate'}; $gmcommentlinktargettemplate = $newTemplates->{'gmcommentlinktargettemplate'}; $gmsmartentrymoodtemplate = $newTemplates->{'gmsmartentrymoodtemplate'}; $gmsmartentrymusictemplate = $newTemplates->{'gmsmartentrymusictemplate'}; $gmdategroupingfooterarchivetemplate = $newTemplates->{'gmdategroupingfooterarchivetemplate'}; $gmsmartemoticonscodetemplate = $newTemplates->{'gmsmartemoticonscodetemplate'}; $gmcookiescodetemplate = $newTemplates->{'gmcookiescodetemplate'}; $gmusererrorheadertemplate = $newTemplates->{'gmusererrorheadertemplate'}; $gmusererrorfootertemplate = $newTemplates->{'gmusererrorfootertemplate'}; } # --------------------- # delouse all templates # --------------------- ### TODO JUST LOOP THROUGH THE TEMPLATES HASH ARRAY ONCE ALL THESE REFERENCES ARE REMOVED sub gm_delousealltemplates { $gmindextemplate = Gm_Utils::toWebSafe($gmindextemplate); $gmentrypagetemplate = Gm_Utils::toWebSafe($gmentrypagetemplate); $gmarchiveindextemplate = Gm_Utils::toWebSafe($gmarchiveindextemplate); $gmarchiveentrypagetemplate = Gm_Utils::toWebSafe($gmarchiveentrypagetemplate); $gmentrytemplate = Gm_Utils::toWebSafe($gmentrytemplate); $gmarchiveentrytemplate = Gm_Utils::toWebSafe($gmarchiveentrytemplate); $gmstayattoptemplate = Gm_Utils::toWebSafe($gmstayattoptemplate); $gmdatetemplate = Gm_Utils::toWebSafe($gmdatetemplate); $gmcommentstemplate = Gm_Utils::toWebSafe($gmcommentstemplate); $gmcommentsformtemplate = Gm_Utils::toWebSafe($gmcommentsformtemplate); $gmparaseparationtemplate = Gm_Utils::toWebSafe($gmparaseparationtemplate); $gmkarmaformtemplate = Gm_Utils::toWebSafe($gmkarmaformtemplate); $gmlinktargettemplate = Gm_Utils::toWebSafe($gmlinktargettemplate); $gmdategroupingfootertemplate = Gm_Utils::toWebSafe($gmdategroupingfootertemplate); $gmkarmalinktemplate = Gm_Utils::toWebSafe($gmkarmalinktemplate); $gmcommentslinktemplate = Gm_Utils::toWebSafe($gmcommentslinktemplate); $gmcommentauthoremailtemplate = Gm_Utils::toWebSafe($gmcommentauthoremailtemplate); $gmcommentauthorhomepagetemplate = Gm_Utils::toWebSafe($gmcommentauthorhomepagetemplate); $gmcommentdividertemplate = Gm_Utils::toWebSafe($gmcommentdividertemplate); $gmmoreentrytemplate = Gm_Utils::toWebSafe($gmmoreentrytemplate); $gmmoreentrypagetemplate = Gm_Utils::toWebSafe($gmmoreentrypagetemplate); $gmmorearchiveentrypagetemplate = Gm_Utils::toWebSafe($gmmorearchiveentrypagetemplate); $gmpreviouslinktemplate = Gm_Utils::toWebSafe($gmpreviouslinktemplate); $gmnextlinktemplate = Gm_Utils::toWebSafe($gmnextlinktemplate); $gmpreviousmorelinktemplate = Gm_Utils::toWebSafe($gmpreviousmorelinktemplate); $gmnextmorelinktemplate = Gm_Utils::toWebSafe($gmnextmorelinktemplate); $gmarchivemasterindextemplate = Gm_Utils::toWebSafe($gmarchivemasterindextemplate); $gmlogarchiveslinktemplate = Gm_Utils::toWebSafe($gmlogarchiveslinktemplate); $gmentrypagelinktemplate = Gm_Utils::toWebSafe($gmentrypagelinktemplate); $gmmoreentrypagelinktemplate = Gm_Utils::toWebSafe($gmmoreentrypagelinktemplate); $gmlogarchiveslinkseparatortemplate = Gm_Utils::toWebSafe($gmlogarchiveslinkseparatortemplate); $gmentrypagelinkseparatortemplate = Gm_Utils::toWebSafe($gmentrypagelinkseparatortemplate); $gmentrypagelinkmonthseparatortemplate = Gm_Utils::toWebSafe($gmentrypagelinkmonthseparatortemplate); $gmentrypagelinkdayseparatortemplate = Gm_Utils::toWebSafe($gmentrypagelinkdayseparatortemplate); $gmentrypagelinkyearseparatortemplate = Gm_Utils::toWebSafe($gmentrypagelinkyearseparatortemplate); $gmheadertemplate = Gm_Utils::toWebSafe($gmheadertemplate); $gmfootertemplate = Gm_Utils::toWebSafe($gmfootertemplate); $gmsidebartemplate = Gm_Utils::toWebSafe($gmsidebartemplate); $gmentryseparatortemplate = Gm_Utils::toWebSafe($gmentryseparatortemplate); $gmarchiveentryseparatortemplate = Gm_Utils::toWebSafe($gmarchiveentryseparatortemplate); $gmmorearchiveentrytemplate = Gm_Utils::toWebSafe($gmmorearchiveentrytemplate); $gmdatearchivetemplate = Gm_Utils::toWebSafe($gmdatearchivetemplate); $gmlogarchiveslinkweeklytemplate = Gm_Utils::toWebSafe($gmlogarchiveslinkweeklytemplate); $gmcustomonetemplate = Gm_Utils::toWebSafe($gmcustomonetemplate); $gmcustomtwotemplate = Gm_Utils::toWebSafe($gmcustomtwotemplate); $gmcustomthreetemplate = Gm_Utils::toWebSafe($gmcustomthreetemplate); $gmcustomfourtemplate = Gm_Utils::toWebSafe($gmcustomfourtemplate); $gmcustomfivetemplate = Gm_Utils::toWebSafe($gmcustomfivetemplate); $gmcustomsixtemplate = Gm_Utils::toWebSafe($gmcustomsixtemplate); $gmcustomseventemplate = Gm_Utils::toWebSafe($gmcustomseventemplate); $gmcustomeighttemplate = Gm_Utils::toWebSafe($gmcustomeighttemplate); $gmcustomninetemplate = Gm_Utils::toWebSafe($gmcustomninetemplate); $gmcustomtentemplate = Gm_Utils::toWebSafe($gmcustomtentemplate); $gmpopuppagetemplate = Gm_Utils::toWebSafe($gmpopuppagetemplate); $gmpopupcodetemplate = Gm_Utils::toWebSafe($gmpopupcodetemplate); $gmsearchformtemplate = Gm_Utils::toWebSafe($gmsearchformtemplate); $gmsearchresultspagetemplate = Gm_Utils::toWebSafe($gmsearchresultspagetemplate); $gmsearchresultsentrytemplate = Gm_Utils::toWebSafe($gmsearchresultsentrytemplate); $gmcalendartablebeginningtemplate = Gm_Utils::toWebSafe($gmcalendartablebeginningtemplate); $gmcalendartableendingtemplate = Gm_Utils::toWebSafe($gmcalendartableendingtemplate); $gmcalendarblankcelltemplate = Gm_Utils::toWebSafe($gmcalendarblankcelltemplate); $gmcalendarfullcelltemplate = Gm_Utils::toWebSafe($gmcalendarfullcelltemplate); $gmcalendarfullcelllinktemplate = Gm_Utils::toWebSafe($gmcalendarfullcelllinktemplate); $gmcalendarweekfulldaytemplate = Gm_Utils::toWebSafe($gmcalendarweekfulldaytemplate); $gmcalendarweekfulldaylinktemplate = Gm_Utils::toWebSafe($gmcalendarweekfulldaylinktemplate); $gmcommentpreviewdividertemplate = Gm_Utils::toWebSafe($gmcommentpreviewdividertemplate); $gmcommentpreviewformtemplate = Gm_Utils::toWebSafe($gmcommentpreviewformtemplate); $gmsmartlinknocommentstemplate = Gm_Utils::toWebSafe($gmsmartlinknocommentstemplate); $gmsmartlinkonecommenttemplate = Gm_Utils::toWebSafe($gmsmartlinkonecommenttemplate); $gmsmartlinkmanycommentstemplate = Gm_Utils::toWebSafe($gmsmartlinkmanycommentstemplate); $gmlinebreaktemplate = Gm_Utils::toWebSafe($gmlinebreaktemplate); $gmcommentlinktargettemplate = Gm_Utils::toWebSafe($gmcommentlinktargettemplate); $gmsmartentrymoodtemplate = Gm_Utils::toWebSafe($gmsmartentrymoodtemplate); $gmsmartentrymusictemplate = Gm_Utils::toWebSafe($gmsmartentrymusictemplate); $gmdategroupingfooterarchivetemplate = Gm_Utils::toWebSafe($gmdategroupingfooterarchivetemplate); $gmsmartemoticonscodetemplate = Gm_Utils::toWebSafe($gmsmartemoticonscodetemplate); $gmcookiescodetemplate = Gm_Utils::toWebSafe($gmcookiescodetemplate); $gmusererrorheadertemplate = Gm_Utils::toWebSafe($gmusererrorheadertemplate); $gmusererrorfootertemplate = Gm_Utils::toWebSafe($gmusererrorfootertemplate); } # -------------------- # read the config file ## TODO REMOVE ALL REFERENCES TO THIS CALL. REPLACED BY GM_STORAGE FUNCTION ## if leave, access global newConfigs hash reference # -------------------- sub gm_readconfig { $newConfigs = Gm_Storage::getConfigs( errHandler=>\&Gm_Web::displayAdminErrorExit ); ### TODO, NOW THAT WE ARE USING HASH FOR TEMPLATES, GO THROUGH AND REMOVE REFERENCES TO ## INVIDUAL VARS BELOW, E.G. REPLACE $gmindextemplate WITH $newTemplates->{'gmindextemplate'} $LogPath = $newConfigs->{'gmlogpath'}; $EntriesPath = $newConfigs->{'gmentriespath'}; $LogWebPath = $newConfigs->{'gmlogwebpath'}; $EntriesWebPath = $newConfigs->{'gmentrieswebpath'}; $NotifyEmail = $newConfigs->{'gmnotifyemail'}; $indexfilename = $newConfigs->{'gmindexfilename'}; $entrysuffix = $newConfigs->{'gmentrysuffix'}; $indexdays = $newConfigs->{'gmindexdays'}; $serveroffset = $newConfigs->{'gmserveroffset'}; $timezone = $newConfigs->{'gmtimezone'}; $keeplog = $newConfigs->{'gmkeeplog'}; $posttoarchives = $newConfigs->{'gmposttoarchives'}; $allowkarmadefault = $newConfigs->{'gmallowkarmadefault'}; $allowcommentsdefault = $newConfigs->{'gmallowcommentsdefault'}; $commentsorder = $newConfigs->{'gmcommentsorder'}; $generateentrypages = $newConfigs->{'gmgenerateentrypages'}; $allowhtmlincomments = $newConfigs->{'gmallowhtmlincomments'}; $logkarmaandcomments = $newConfigs->{'gmlogkarmaandcomments'}; $mailprog = $newConfigs->{'gmmailprog'}; $NotifyForStatus = $newConfigs->{'gmnotifyforstatus'}; $autolinkurls = $newConfigs->{'gmautolinkurls'}; $striplinesfromcomments = $newConfigs->{'gmstriplinesfromcomments'}; $allowmultiplekarmavotes = $newConfigs->{'gmallowmultiplekarmavotes'}; $versionsetup = $newConfigs->{'gmversionsetup'}; $cgilocalpath = $newConfigs->{'gmcgilocalpath'}; $cgiwebpath = $newConfigs->{'gmcgiwebpath'}; $concurrentmainandarchives = $newConfigs->{'gmconcurrentmainandarchives'}; $keeparchivemasterindex = $newConfigs->{'gmkeeparchivemasterindex'}; $entrylistsortorder = $newConfigs->{'gmentrylistsortorder'}; $allowkarmaorcomments = $newConfigs->{'gmallowkarmaorcomments'}; $entrylistcountnumber = $newConfigs->{'gmentrylistcountnumber'}; $cookiesallowed = $newConfigs->{'gmcookiesallowed'}; $logarchivesuffix = $newConfigs->{'gmlogarchivesuffix'}; $censorlist = $newConfigs->{'gmcensorlist'}; $censorenabled = $newConfigs->{'gmcensorenabled'}; $keepmonthlyarchives = $newConfigs->{'gmkeepmonthlyarchives'}; $defaultentrylistview = $newConfigs->{'gmdefaultentrylistview'}; $linktocalendarentries = $newConfigs->{'gmlinktocalendarentries'}; $automaticrebuilddefault = $newConfigs->{'gmautomaticrebuilddefault'}; $commententrylistonlyifokay = $newConfigs->{'gmcommententrylistonlyifokay'}; $otherfilelist = $newConfigs->{'gmotherfilelist'}; $otherfilelistentryrebuild = $newConfigs->{'gmotherfilelistentryrebuild'}; $archiveformat = $newConfigs->{'gmarchiveformat'}; $inlineformatting = $newConfigs->{'gminlineformatting'}; $uploadfilesallowed = $newConfigs->{'gmuploadfilesallowed'}; $uploadfilesizelimit = $newConfigs->{'gmuploadfilesizelimit'}; $emoticonspath = $newConfigs->{'gmemoticonspath'}; $keepphphacklog = $newConfigs->{'gmkeepphphacklog'}; $mailhacknotice = $newConfigs->{'gmmailhacknotice'}; $emoticonsallowed = $newConfigs->{'gmemoticonsallowed'}; $protectauthorname = $newConfigs->{'gmprotectauthorname'}; $commentlinklimit = $newConfigs->{'gmcommentlinklimit'}; $commentlinklimitnum = $newConfigs->{'gmcommentlinklimitnum'}; $commentforcepreview = $newConfigs->{'gmcommentforcepreview'}; $commentverify = $newConfigs->{'gmcommentverify'}; $commentverifyphrase = $newConfigs->{'gmcommentverifyphrase'}; } # --------------------- # write the config file # --------------------- sub gm_writeconfig { if ($versionsetup eq Gm_Constants::EMPTY) { $versionsetup = $gmversion; } my %confs = (); $confs{'gmlogpath'} = $LogPath; $confs{'gmentriespath'} = $EntriesPath; $confs{'gmlogwebpath'} = $LogWebPath; $confs{'gmentrieswebpath'} = $EntriesWebPath; $confs{'gmnotifyemail'} = $NotifyEmail; $confs{'gmindexfilename'} = $indexfilename; $confs{'gmentrysuffix'} = $entrysuffix; $confs{'gmindexdays'} = $indexdays; $confs{'gmserveroffset'} = $serveroffset; $confs{'gmtimezone'} = $timezone; $confs{'gmkeeplog'} = $keeplog; $confs{'gmposttoarchives'} = $posttoarchives; $confs{'gmallowkarmadefault'} = $allowkarmadefault; $confs{'gmallowcommentsdefault'} = $allowcommentsdefault; $confs{'gmcommentsorder'} = $commentsorder; $confs{'gmgenerateentrypages'} = $generateentrypages; $confs{'gmallowhtmlincomments'} = $allowhtmlincomments; $confs{'gmlogkarmaandcomments'} = $logkarmaandcomments; $confs{'gmmailprog'} = $mailprog; $confs{'gmnotifyforstatus'} = $NotifyForStatus; $confs{'gmautolinkurls'} = $autolinkurls; $confs{'gmstriplinesfromcomments'} = $striplinesfromcomments; $confs{'gmallowmultiplekarmavotes'} = $allowmultiplekarmavotes; $confs{'gmversionsetup'} = $versionsetup; $confs{'gmversion'} = Gm_Constants::GM_VERSION; $confs{'gmcgilocalpath'} = $cgilocalpath; $confs{'gmcgiwebpath'} = $cgiwebpath; $confs{'gmconcurrentmainandarchives'} = $concurrentmainandarchives; $confs{'gmkeeparchivemasterindex'} = $keeparchivemasterindex; $confs{'gmentrylistsortorder'} = $entrylistsortorder; $confs{'gmallowkarmaorcomments'} = $allowkarmaorcomments; $confs{'gmentrylistcountnumber'} = $entrylistcountnumber; $confs{'gmcookiesallowed'} = $cookiesallowed; $confs{'gmlogarchivesuffix'} = $logarchivesuffix; $confs{'gmcensorlist'} = $censorlist; $confs{'gmcensorenabled'} = $censorenabled; $confs{'gmkeepmonthlyarchives'} = $keepmonthlyarchives; $confs{'gmdefaultentrylistview'} = $defaultentrylistview; $confs{'gmlinktocalendarentries'} = $linktocalendarentries; $confs{'gmautomaticrebuilddefault'} = $automaticrebuilddefault; $confs{'gmcommententrylistonlyifokay'} = $commententrylistonlyifokay; $confs{'gmotherfilelist'} = $otherfilelist; $confs{'gmotherfilelistentryrebuild'} = $otherfilelistentryrebuild; $confs{'gmarchiveformat'} = $archiveformat; $confs{'gminlineformatting'} = $inlineformatting; $confs{'gmuploadfilesallowed'} = $uploadfilesallowed; $confs{'gmuploadfilesizelimit'} = $uploadfilesizelimit; $confs{'gmemoticonspath'} = $emoticonspath; $confs{'gmkeepphphacklog'} = $keepphphacklog; $confs{'gmmailhacknotice'} = $mailhacknotice; $confs{'gmemoticonsallowed'} = $emoticonsallowed; $confs{'gmprotectauthorname'} = $protectauthorname; $confs{'gmcommentlinklimit'} = $commentlinklimit; $confs{'gmcommentlinklimitnum'} = $commentlinklimitnum; $confs{'gmcommentforcepreview'} = $commentforcepreview; $confs{'gmcommentverify'} = $commentverify; $confs{'gmcommentverifyphrase'} = $commentverifyphrase; Gm_Storage::setConfigs( configs=>\%confs, errHandler=>\&Gm_Web::displayAdminErrorExit ); } # --------------------------------- # gather ye all thy entry variables # --------------------------------- # DEPRECATED: Gm_Core::getEntryVariables sub gm_getentryvariables { my $thisentrygetmynumber = shift; &gm_readconfig; &gm_readtemplates; &gm_readcounter; # $thisentrynumberpadded = sprintf ("%8d", $thisentrygetmynumber); # $thisentrynumberpadded =~ tr/ /0/; $thisentrynumberpadded = Gm_Utils::toEntryPadded( $thisentrygetmynumber ); 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 = ; 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, $thisentrymusic, $thisentrymood, $thisentryemoticonsallowed) = split (/\|/, $entrylines[0]); chomp ($thisentryemoticonsallowed); $thisentryisanarchive = Gm_Constants::NO; if ($thisentrynumber <= $newarchivenumber) { $thisentryisanarchive = Gm_Constants::YES; } if ($generateentrypages eq Gm_Constants::NO) { $thisentryallowcomments = Gm_Constants::NO; } ## THIS IS DUPLICATING DATE SEE GM_UTILS $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/; $thisentrymonthmonth = Gm_Utils::toTwoDigit( $thisentrymonth ); $thisentrydayday = Gm_Utils::toTwoDigit( $thisentryday ); $thisentryhourhour = Gm_Utils::toTwoDigit( $thisentryhour ); $thisentryminuteminute = Gm_Utils::toTwoDigit( $thisentryminute ); $thisentrysecondsecond = Gm_Utils::toTwoDigit( $thisentrysecond ); $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/; $thisentrymilitaryhour = Gm_Utils::toTwoDigit( $thisentrymilitaryhour ); $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/; $thisentryweekbeginningdayday = Gm_Utils::toTwoDigit( $thisentryweekbeginningday ); $thisentryweekendingdayday = Gm_Utils::toTwoDigit( $thisentryweekendingday ); $thisentryweekbeginningmonthmonth = Gm_Utils::toTwoDigit( $thisentryweekbeginningmonth ); $thisentryweekendingmonthmonth = Gm_Utils::toTwoDigit( $thisentryweekendingmonth ); $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); my $gmauthors = Gm_Storage::getAuthors( errHandler=>\&Gm_Web::displayAdminErrorExit ); my $selectedauthor; $thisentryauthoremail = Gm_Constants::EMPTY; $thisentryauthorhomepage = Gm_Constants::EMPTY; $thisentryauthorentrycount = Gm_Constants::EMPTY; if( exists( $gmauthors->{$thisentryauthor} )){ $selectedauthor = $gmauthors->{$thisentryauthor}; $thisentryauthoremail = $selectedauthor->{'email'}; $thisentryauthorhomepage = $selectedauthor->{'homepage'}; $thisentryauthorentrycount = $selectedauthor->{'posttotal'}; } $thisentryauthorsmartlink = $thisentryauthor; if ($thisentryauthoremail ne Gm_Constants::EMPTY) { $thisentryauthorsmartlink = "$thisentryauthor"; } if ($thisentryauthorhomepage ne Gm_Constants::EMPTY) { $thisentryauthorsmartlink = "$thisentryauthor"; } $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 Gm_Constants::NO) { $thisentrypagearchivelogindexlink = $thisentrypageindexlink; } else { if ($archiveformat eq Gm_Constants::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 Gm_Constants::NO)) { $thisentrypagesmartindexlink = $thisentrypagearchivelogindexlink; } $thisentrycommentslink = Gm_Constants::EMPTY; $thisentrycommentsform = Gm_Constants::EMPTY; if ($thisentryallowcomments eq Gm_Constants::YES) { if (($allowkarmaorcomments eq Gm_Constants::COMMENTS) || ($allowkarmaorcomments eq Gm_Constants::BOTH)) { $thisentrycommentslink = $gmcommentslinktemplate; $thisentrycommentsform = $gmcommentsformtemplate; } } if (($emoticonsallowed eq Gm_Constants::BOTH) || ($emoticonsallowed eq Gm_Constants::COMMENTS)) { $thisentrycommentsform =~ s/{{smartemoticonscode}}/$gmsmartemoticonscodetemplate/; } else { $thisentrycommentsform =~ s/{{smartemoticonscode}}//; } $thisentrykarmalink = Gm_Constants::EMPTY; $thisentrykarmaform = Gm_Constants::EMPTY; if ($thisentryallowkarma eq Gm_Constants::YES ) { if (($allowkarmaorcomments eq Gm_Constants::KARMA) || ($allowkarmaorcomments eq Gm_Constants::BOTH)) { $thisentrykarmalink = $gmkarmalinktemplate; $thisentrykarmaform = $gmkarmaformtemplate; } } if (($thisentryisanarchive eq Gm_Constants::YES) && ($posttoarchives eq Gm_Constants::NO)) { $thisentrykarmalink = Gm_Constants::EMPTY; $thisentrykarmaform = Gm_Constants::EMPTY; $thisentrycommentslink = Gm_Constants::EMPTY; $thisentrycommentsform = Gm_Constants::EMPTY; } $thisentrysearchform = $gmsearchformtemplate; if ($generateentrypages eq Gm_Constants::NO) { $thisentrycommentslink = Gm_Constants::EMPTY; $thisentrycommentsform = Gm_Constants::EMPTY; $thisentrysearchform = Gm_Constants::EMPTY; } $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/\|\*\|\|\*\|//g; $thisentrymorebody =~ s/\|\*\|\|\*\|//g; } if (($thisentrymainbody =~ /\n\n/) || ($thisentrymorebody =~ /\n\n/)) { $thisentrymainbody =~ s/\n\n//g; $thisentrymorebody =~ s/\n\n//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 =~ //) || ($thisentrymorebody =~ //)) { $thisentrymainbody =~ s//$gmparaseparationtemplate/g; $thisentrymorebody =~ s//$gmparaseparationtemplate/g; } if (($censorenabled eq Gm_Constants::BOTH) || ($censorenabled eq Gm_Constants::ENTRIES)) { unless ($censorlist eq Gm_Constants::EMPTY) { @censoredterms = split(/\n/, $censorlist); foreach $thisterm (@censoredterms) { unless ($thisterm eq Gm_Constants::EMPTY) { 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 = Gm_Constants::EMPTY; $thisentrymorelink = Gm_Constants::EMPTY; if (($thisentrymorebody ne Gm_Constants::EMPTY) && ($generateentrypages ne Gm_Constants::NO)) { $thisentrymorepreface = $gmmoreprefacetemplate; $thisentrymorelink = $gmmorelinktemplate; } $thisentrycommentdivider = Gm_Constants::EMPTY; if ($thisentrycommentsnumber ne "0") { $thisentrycommentdivider = $gmcommentdividertemplate; } $thisentrycomments = Gm_Constants::EMPTY; # changed deprecated , , and tags to corresponding css properties: flipped cracker 9/15/2003 # removed code for entrysubject : 1.3.1 # flipped cracker 6/29/2004 if (($inlineformatting eq Gm_Constants::ENTRIES) || ($inlineformatting eq Gm_Constants::BOTH)) { if (($thisentrymainbody =~ /\*\*(.*?)\*\*/) || ($thisentrymainbody =~ /\\\\(.*?)\\\\/) || ($thisentrymainbody =~ /__(.*?)__/)) { $thisentrymainbody =~ s/\*\*(.*?)\*\*/$1<\/span>/isg; $thisentrymainbody =~ s/\\\\(.*?)\\\\/$1<\/span>/isg; $thisentrymainbody =~ s/__(.*?)__/$1<\/span>/isg; } if (($thisentrymorebody =~ /\*\*(.*?)\*\*/) || ($thisentrymorebody =~ /\\\\(.*?)\\\\/) || ($thisentrymorebody =~ /__(.*?)__/)) { $thisentrymorebody =~ s/\*\*(.*?)\*\*/$1<\/span>/isg; $thisentrymorebody =~ s/\\\\(.*?)\\\\/$1<\/span>/isg; $thisentrymorebody =~ s/__(.*?)__/$1<\/span>/isg; } } # changed 9/15/2003 # emoticons hack revised by flipped cracker 9/17/2003 # merged in version 1.3 $returnto = Gm_Constants::ENTRIES; $thisentrymainbody = &gm_emoticons($thisentrymainbody); $thisentrymorebody = &gm_emoticons($thisentrymorebody); # merged 9/17/2003 if (($thisentrycommentsnumber ne "0") && ($generateentrypages ne Gm_Constants::NO)) { $thisisaspellcheck = Gm_Constants::NO; &gm_collatecomments; ## TODO REFACTOR THIS OUT SINCE ITS DEPRECATED $thisentrycomments =~ s/\"/"/g; } } # ----------------- # comment collating # ----------------- # DEPRECATED: Gm_Core::collateComments( entry=>$gmEntry ); sub gm_collatecomments { $commentcounter = 4; if ($commentsorder eq Gm_Constants::ASCENDING) { $commentcounter = $thisentrycommentsnumber + 3; } $commentcountermax = $thisentrycommentsnumber + 3; $commentcountercurrent = $thisentrycommentsnumber; ## STARTING A LOOP HERE THAT CAN BECOME INFINITE, SINCE IT DOESN'T CHECK IF ITS DEALING WITH A NUMBER 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/; $thiscommentmonthmonth = Gm_Utils::toTwoDigit( $thiscommentmonth ); $thiscommentdayday = Gm_Utils::toTwoDigit( $thiscommentday ); $thiscommenthourhour = Gm_Utils::toTwoDigit( $thiscommenthour ); $thiscommentminuteminute = Gm_Utils::toTwoDigit( $thiscommentminute ); $thiscommentsecondsecond = Gm_Utils::toTwoDigit( $thiscommentsecond ); $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/; $thiscommentmilitaryhour = Gm_Utils::toTwoDigit( $thiscommentmilitaryhour ); $thiscommentampmlower = lc($thiscommentampm); $thiscommentampmdotlower = lc($thiscommentampmdot); # new ordinal numbers for {{dayappend}} variable: linear 9/15/2003 # merged in 1.3 $thiscommentdayappend = Gm_Utils::toOrdinal($thiscommentday); #merged 9/15/2003 $thiscommentauthor =~ s/"/\"/g; $thiscommentauthoremailabsolute =~ s/"/\"/g; $thiscommentauthorhomepageabsolute =~ s/"/\"/g; $thiscommentauthoremail = Gm_Constants::EMPTY; $thiscommentauthorhomepage = Gm_Constants::EMPTY; $thiscommentauthorsmartlink = $thiscommentauthor; if ($thiscommentauthoremailabsolute ne Gm_Constants::EMPTY) { $thiscommentauthoremail = $gmcommentauthoremailtemplate; $thiscommentauthorsmartlink = "$thiscommentauthor"; } if ($thiscommentauthorhomepageabsolute ne Gm_Constants::EMPTY) { $thiscommentauthorhomepage = $gmcommentauthorhomepagetemplate; $thiscommentauthorsmartlink = "$thiscommentauthor"; } if (($allowhtmlincomments eq "linkboldital") || ($allowhtmlincomments eq "linkonly")) { if ($thiscommenttext =~ m/\*/i) { $thiscommenttext =~ s/\*/\|AMP\|/g; } if (($thiscommenttext =~ m//i)) { $thiscommenttext =~ s//\*a\*/isg; } if ($allowhtmlincomments eq "linkboldital") { if (($thiscommenttext =~ m//i) && ($thiscommenttext =~ m/<\/b>/i)) { $thiscommenttext =~ s//\*b\*/isg; $thiscommenttext =~ s/<\/b>/\*bb\*/isg; } if (($thiscommenttext =~ m//i) && ($thiscommenttext =~ m/<\/i>/i)) { $thiscommenttext =~ s//\*i\*/isg; $thiscommenttext =~ s/<\/i>/\*ii\*/isg; } } } # improved tag removal regex: linear 7/9/2003 # merged into 1.3 unless ($allowhtmlincomments eq Gm_Constants::YES) { $thiscommenttext =~ s(<[^>]*>)()gs; } # merged 9/11/2003 if ($autolinkurls eq Gm_Constants::YES) { # these two lines of code written in part by Neal Coffey (cray@indecisions.org) $thiscommenttext =~ s#(^|\s)(\w+://)([A-Za-z0-9?=_\-/.%+&'~\#@!\^]+)#$1$2$3#isg; $thiscommenttext =~ s#(^|\s)(www.[A-Za-z0-9?=_\-/.%+&'~\#@!\^]+)#$1$2#isg; # thanks, Neal! $thiscommenttext =~ s/(\w+\@\w+\.\w+)/$1<\/a>/isg; } # emoticons hack revised by flipped cracker 9/17/2003 # merged in version 1.3 $returnto = Gm_Constants::COMMENTS; $thiscommenttext = &gm_emoticons($thiscommenttext); # merged 9/17/2003 if (($allowhtmlincomments eq "linkboldital") || ($allowhtmlincomments eq "linkonly")) { if (($thiscommenttext =~ m/\*a href\*/i) && ($thiscommenttext =~ m/\*a\*/i)) { $thiscommenttext =~ s/\*a href\*//isg; } # changed deprecated , and to corresponding css properties: flipped cracker 9/15/2003 if ($allowhtmlincomments eq "linkboldital") { if (($thiscommenttext =~ m/\*b\*/i) && ($thiscommenttext =~ m/\*bb\*/i)) { $thiscommenttext =~ s/\*b\*//isg; $thiscommenttext =~ s/\*bb\*/<\/span>/isg; } if (($thiscommenttext =~ m/\*i\*/i) && ($thiscommenttext =~ m/\*ii\*/i)) { $thiscommenttext =~ s/\*i\*//isg; $thiscommenttext =~ s/\*ii\*/<\/span>/isg; } } # changed 9/15/2003 if ($thiscommenttext =~ m/\|AMP\|/i) { $thiscommenttext =~ s/\|AMP\|/\*/g; } } # changed deprecated , , and to corresponding css properties: flipped cracker 9/15/2003 if (($inlineformatting eq Gm_Constants::COMMENTS) || ($inlineformatting eq Gm_Constants::BOTH)) { if (($thiscommenttext =~ /\*\*(.*?)\*\*/) || ($thiscommenttext =~ /\\\\(.*?)\\\\/) || ($thiscommenttext =~ /__(.*?)__/)) { $thiscommenttext =~ s/\*\*(.*?)\*\*/$1<\/span>/isg; $thiscommenttext =~ s/\\\\(.*?)\\\\/$1<\/span>/isg; $thiscommenttext =~ s/__(.*?)__/$1<\/span>/isg; } } #changed 9/15/2003 if ($striplinesfromcomments eq Gm_Constants::YES) { if (($thiscommenttext =~ /\|\*\|/) || ($thiscommenttext =~ /\n/)) { $thiscommenttext =~ s/\|\*\|/ /g; $thiscommenttext =~ s/\n/ /g; } } else { if (($thiscommenttext =~ /\|\*\|/) || ($thiscommenttext =~ /\n/)) { $thiscommenttext =~ s/\|\*\|\|\*\|//g; $thiscommenttext =~ s/\n\n//g; $thiscommenttext =~ s/\|\*\|/$gmlinebreaktemplate/g; $thiscommenttext =~ s/\n/$gmlinebreaktemplate/g; $thiscommenttext =~ s//$gmparaseparationtemplate/g; $thiscommenttext =~ s/a href/a rel="nofollow" href/g; $thiscommenttext =~ s/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w{1,8});)/&/g; } } if (($censorenabled eq Gm_Constants::BOTH) || ($censorenabled eq Gm_Constants::COMMENTS)) { unless ($censorlist eq Gm_Constants::EMPTY) { @censoredterms = split(/\n/, $censorlist); foreach $thisterm (@censoredterms) { unless ($thisterm eq Gm_Constants::EMPTY) { 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 ($thiscommenttext =~ m/$thisrealterm/i) { $thiscommenttext =~ s/\b$thisrealterm\b/$thisrealtermreplace/isg; } if ($thiscommentauthor =~ m/$thisrealterm/i) { $thiscommentauthor =~ s/\b$thisrealterm\b/$thisrealtermreplacedash/isg; } } else { $thisrealtermlength = length($thisterm); $thisrealtermreplace = "*" x $thisrealtermlength; $thisrealtermreplacedash = "-" x $thisrealtermlength; if ($thiscommenttext =~ m/$thisterm/i) { $thiscommenttext =~ s/\b$thisterm\b/$thisrealtermreplace/isg; } if ($thiscommentauthor =~ m/$thisterm/i) { $thiscommentauthor =~ s/\b$thisterm\b/$thisrealtermreplacedash/isg; } } } } } } $thiscommentfullbody = $gmcommentstemplate; if ($thiscommentfullbody =~ m/{{comment/i) { $thiscommentfullbody =~ s/{{commentbody}}/$thiscommenttext/gi; $thiscommentfullbody =~ s/{{commentauthoremail}}/$thiscommentauthoremail/gi; $thiscommentfullbody =~ s/{{commentauthorhomepage}}/$thiscommentauthorhomepage/gi; $thiscommentfullbody =~ s/{{commentauthor}}/$thiscommentauthor/gi; $thiscommentfullbody =~ s/{{commentauthoremailabsolute}}/$thiscommentauthoremailabsolute/gi; $thiscommentfullbody =~ s/{{commentauthorhomepageabsolute}}/$thiscommentauthorhomepageabsolute/gi; $thiscommentfullbody =~ s/{{commentauthorsmartlink}}/$thiscommentauthorsmartlink/gi; $thiscommentfullbody =~ s/{{commentauthorip}}/$thiscommentauthorip/gi; $thiscommentfullbody =~ s/{{commentordernumber}}/$thiscommentordernumber/gi; } $thiscommentfullbody =~ s/{{day}}/$thiscommentday/gi; $thiscommentfullbody =~ s/{{month}}/$thiscommentmonth/gi; $thiscommentfullbody =~ s/{{year}}/$thiscommentyear/gi; $thiscommentfullbody =~ s/{{hour}}/$thiscommenthour/gi; $thiscommentfullbody =~ s/{{minute}}/$thiscommentminute/gi; $thiscommentfullbody =~ s/{{second}}/$thiscommentsecond/gi; $thiscommentfullbody =~ s/{{dayday}}/$thiscommentdayday/gi; $thiscommentfullbody =~ s/{{monthmonth}}/$thiscommentmonthmonth/gi; $thiscommentfullbody =~ s/{{yearyear}}/$thiscommentyearyear/gi; $thiscommentfullbody =~ s/{{hourhour}}/$thiscommenthourhour/gi; $thiscommentfullbody =~ s/{{minuteminute}}/$thiscommentminuteminute/gi; $thiscommentfullbody =~ s/{{secondsecond}}/$thiscommentsecondsecond/gi; $thiscommentfullbody =~ s/{{weekday}}/$thiscommentweekday/gi; $thiscommentfullbody =~ s/{{weekdayshort}}/$thiscommentweekdayshort/gi; $thiscommentfullbody =~ s/{{monthword}}/$thiscommentmonthword/gi; $thiscommentfullbody =~ s/{{monthwordshort}}/$thiscommentmonthwordshort/gi; $thiscommentfullbody =~ s/{{weekdayupper}}/$thiscommentweekdayupper/gi; $thiscommentfullbody =~ s/{{monthwordupper}}/$thiscommentmonthwordupper/gi; $thiscommentfullbody =~ s/{{weekdaylower}}/$thiscommentweekdaylower/gi; $thiscommentfullbody =~ s/{{monthwordlower}}/$thiscommentmonthwordlower/gi; $thiscommentfullbody =~ s/{{weekdayuppershort}}/$thiscommentweekdayuppershort/gi; $thiscommentfullbody =~ s/{{monthworduppershort}}/$thiscommentmonthworduppershort/gi; $thiscommentfullbody =~ s/{{weekdaylowershort}}/$thiscommentweekdaylowershort/gi; $thiscommentfullbody =~ s/{{monthwordlowershort}}/$thiscommentmonthwordlowershort/gi; $thiscommentfullbody =~ s/{{militaryhour}}/$thiscommentmilitaryhour/gi; $thiscommentfullbody =~ s/{{ampm}}/$thiscommentampm/gi; $thiscommentfullbody =~ s/{{ampmdot}}/$thiscommentampmdot/gi; $thiscommentfullbody =~ s/{{ampmlower}}/$thiscommentampmlower/gi; $thiscommentfullbody =~ s/{{ampmdotlower}}/$thiscommentampmdotlower/gi; # new {{dayappend variable}}: linear 9/15/2003 # merged in 1.3 $thiscommentfullbody =~ s/{{dayappend}}/$thiscommentdayappend/gi; # merged 9/15/2003 $thisentrycomments .= $thiscommentfullbody; if ($commentsorder eq Gm_Constants::ASCENDING) { $commentcounter--; } else { $commentcounter++; } $commentcountercurrent--; } until $commentcountercurrent eq "0"; ## TODO: FIX THIS SO THAT IT WON'T LOOP INFINATLY IF # COMMENTCOUNTERCURRENT ISN'T A NUMBER, BAD! } # ---------------- # format the entry # ---------------- # Note: doesn't return string, just modifies it # DEPRECATED: Gm_Core::translateEntryTemplates sub gm_formatentry { my $entrygetreturn = shift; # added by flipped cracker 09/12/03 # version 1.3 $domain = $cgiwebpath; $domain =~ s@http://([^\/]+)?.*@$1@; # end additions $entryreturn = $entrygetreturn; # $entryreturn =~ s/\|\*\|/\n/g; if (($entryreturn =~ m/{{header}}/i) || ($entryreturn =~ m/{{footer}}/i) || ($entryreturn =~ m/{{sidebar}}/i)) { $entryreturn =~ s/{{header}}/$gmheadertemplate/gi; $entryreturn =~ s/{{footer}}/$gmfootertemplate/gi; $entryreturn =~ s/{{sidebar}}/$gmsidebartemplate/gi; } if ($entryreturn =~ m/{{custom/i) { $entryreturn =~ s/{{customone}}/$gmcustomonetemplate/gi; $entryreturn =~ s/{{customtwo}}/$gmcustomtwotemplate/gi; $entryreturn =~ s/{{customthree}}/$gmcustomthreetemplate/gi; $entryreturn =~ s/{{customfour}}/$gmcustomfourtemplate/gi; $entryreturn =~ s/{{customfive}}/$gmcustomfivetemplate/gi; $entryreturn =~ s/{{customsix}}/$gmcustomsixtemplate/gi; $entryreturn =~ s/{{customseven}}/$gmcustomseventemplate/gi; $entryreturn =~ s/{{customeight}}/$gmcustomeighttemplate/gi; $entryreturn =~ s/{{customnine}}/$gmcustomninetemplate/gi; $entryreturn =~ s/{{customten}}/$gmcustomtentemplate/gi; } if ($entryreturn =~ m/{{logarchivelist}}/i) { if ($keepmonthlyarchives eq Gm_Constants::NO) { $entryreturn =~ s/{{logarchivelist}}//gi; } else { &gm_generatearchiveloglist; $entryreturn =~ s/{{logarchivelist}}/$logarchivelistfinal/gi; } } if ($generateentrypages eq Gm_Constants::YES) { if (($entryreturn =~ m/{{logshortentrylist/i) || ($entryreturn =~ m/{{logmoreentrylist/i) || ($entryreturn =~ m/{{logentrylist/i)) { &gm_generateentryloglist; $entryreturn =~ s/{{logshortentrylist}}/$logshortentrylistfinal/gi; $entryreturn =~ s/{{logmoreentrylist}}/$logmoreentrylistfinal/gi; $entryreturn =~ s/{{logentrylist}}/$logentrylistfinal/gi; $entryreturn =~ s/{{logshortentrylist month}}/$logshortentrylistmonthfinal/gi; $entryreturn =~ s/{{logshortentrylist day}}/$logshortentrylistdayfinal/gi; $entryreturn =~ s/{{logshortentrylist year}}/$logshortentrylistyearfinal/gi; $entryreturn =~ s/{{logmoreentrylist month}}/$logmoreentrylistmonthfinal/gi; $entryreturn =~ s/{{logmoreentrylist day}}/$logmoreentrylistdayfinal/gi; $entryreturn =~ s/{{logmoreentrylist year}}/$logmoreentrylistyearfinal/gi; $entryreturn =~ s/{{logentrylist month}}/$logentrylistmonthfinal/gi; $entryreturn =~ s/{{logentrylist day}}/$logentrylistdayfinal/gi; $entryreturn =~ s/{{logentrylist year}}/$logentrylistyearfinal/gi; $entryreturn =~ s/{{logshortentrylist number}}/$logshortentrylistnumberfinal/gi; $entryreturn =~ s/{{logmoreentrylist number}}/$logmoreentrylistnumberfinal/gi; $entryreturn =~ s/{{logentrylist number}}/$logentrylistnumberfinal/gi; $entryreturn =~ s/{{logshortentrylist firsthalf}}/$logshortentrylistfirsthalffinal/gi; $entryreturn =~ s/{{logshortentrylist secondhalf}}/$logshortentrylistsecondhalffinal/gi; $entryreturn =~ s/{{logmoreentrylist firsthalf}}/$logmoreentrylistfirsthalffinal/gi; $entryreturn =~ s/{{logmoreentrylist secondhalf}}/$logmoreentrylistsecondhalffinal/gi; $entryreturn =~ s/{{logentrylist firsthalf}}/$logentrylistfirsthalffinal/gi; $entryreturn =~ s/{{logentrylist secondhalf}}/$logentrylistsecondhalffinal/gi; } if (($entryreturn =~ m/{{logshortentrylist comments/i) || ($entryreturn =~ m/{{logmoreentrylist comments/i) || ($entryreturn =~ m/{{logentrylist comments/i)) { &gm_generateentryloglistcomments; $entryreturn =~ s/{{logshortentrylist comments}}/$logshortentrylistfinal/gi; $entryreturn =~ s/{{logmoreentrylist comments}}/$logmoreentrylistfinal/gi; $entryreturn =~ s/{{logentrylist comments}}/$logentrylistfinal/gi; $entryreturn =~ s/{{logshortentrylist commentsminimum}}/$logshortminimumentrylistfinal/gi; $entryreturn =~ s/{{logmoreentrylist commentsminimum}}/$logmoreminimumentrylistfinal/gi; $entryreturn =~ s/{{logentrylist commentsminimum}}/$logminimumentrylistfinal/gi; $entryreturn =~ s/{{logshortentrylist commentsnumber}}/$logshortnumberentrylistfinal/gi; $entryreturn =~ s/{{logmoreentrylist commentsnumber}}/$logmorenumberentrylistfinal/gi; $entryreturn =~ s/{{logentrylist commentsnumber}}/$lognumberentrylistfinal/gi; } if (($entryreturn =~ m/{{logshortentrylist /i) || ($entryreturn =~ m/{{logmoreentrylist /i) || ($entryreturn =~ m/{{logentrylist /i)) { my $gmauthors = Gm_Storage::getAuthors( errHandler=>\&Gm_Web::displayAdminErrorExit ); foreach my $author ( keys( %$gmauthors ) ) { $thisentryloglistauthor = $gmauthors->{$author}{'author'}; &gm_generateentryloglistauthor; $entryreturn =~ s/{{logshortentrylist $thisentryloglistauthor}}/$logshortentrylistfinal/gi; $entryreturn =~ s/{{logmoreentrylist $thisentryloglistauthor}}/$logmoreentrylistfinal/gi; $entryreturn =~ s/{{logentrylist $thisentryloglistauthor}}/$logentrylistfinal/gi; } } } if (($entryreturn =~ m/{{calendar}}/i) || ($entryreturn =~ m/{{calendarweek}}/i)) { $usethisentryweekdaynumber = $thisentryweekdaynumber; $usethisentryday = $thisentryday; $usethisentrymonth = $thisentrymonth; $usethisentrymonthmonth = $thisentrymonthmonth; $usethisentrymonthword = $thisentrymonthword; $usethisentryyear = $thisentryyear; $usethisentryyearyear = $thisentryyearyear; &gm_generatecalendar; $entryreturn =~ s/{{calendar}}/$calendarfull/gi; $entryreturn =~ s/{{calendarweek}}/$calendarweekfull/gi; } my $gmentrylist = Gm_Storage::getEntrylist( errHandler=>\&Gm_Web::displayAdminErrorExit ); if ($entryreturn =~ m/{{calendar (..)\/(..)}}/i) { until ($entryreturn !~ m/{{calendar (..)\/(..)}}/ig) { $usethisentrymonthmonth = $1; $usethisentryyear = $2; $gotthecalendarmonth = Gm_Constants::NO; foreach my $entry ( sort { $gmentrylist->{$b}{'id'} <=> $gmentrylist->{$a}{'id'} } keys( %$gmentrylist ) ) { $loglistnumber = $gmentrylist->{$entry}{'id'}; $loglistauthor = $gmentrylist->{$entry}{'author'}; $loglistsubject = $gmentrylist->{$entry}{'subject'}; $loglistdate = $gmentrylist->{$entry}{'created'}; $loglisttimeampm = $gmentrylist->{$entry}{'createt'}; $loglistopenstatus = $gmentrylist->{$entry}{'status'}; $loglistmorestatus = $gmentrylist->{$entry}{'extended'}; $loglistentrymusic = $gmentrylist->{$entry}{'music'}; $loglistentrymood = $gmentrylist->{$entry}{'mood'}; $loglistemoticonstatus = $gmentrylist->{$entry}{'emoticons'}; &gm_getloglistvariables; if (($loglistmonthmonth eq $usethisentrymonthmonth) && ($loglistyear eq $usethisentryyear) && ($gotthecalendarmonth eq Gm_Constants::NO)) { $usethisentryweekdaynumber = $loglistentryweekdaynumber; $usethisentryday = $loglistday; $usethisentrymonth = $loglistmonth; $usethisentrymonthword = $loglistmonthword; $usethisentryyearyear = $loglistyearyear; &gm_generatecalendar; $entryreturn =~ s/{{calendar $usethisentrymonthmonth\/$usethisentryyear}}/$calendarfull/gi; $gotthecalendarmonth = Gm_Constants::YES; } } if ($entryreturn =~ m/{{calendar $usethisentrymonthmonth\/$usethisentryyear}}/i) { $entryreturn =~ s/{{calendar $usethisentrymonthmonth\/$usethisentryyear}}//gi; } } } # emoticons can be off, so we provide {{smartemoticonscode}} to print them only when they are needed/wanted: linear 9/23/2003 # merged in 1.3 # merged 9/23/2003 if (($entryreturn =~ m/{{commentdivider}}/i) || ($entryreturn =~ m/{{entrycommentsform}}/i) || ($entryreturn =~ m/{{entrykarmaform}}/i) || ($entryreturn =~ m/{{searchform}}/i)) { $entryreturn =~ s/{{commentdivider}}/$thisentrycommentdivider/gi; $entryreturn =~ s/{{entrycommentsform}}/$thisentrycommentsform/gi; $entryreturn =~ s/{{entrykarmaform}}/$thisentrykarmaform/gi; $entryreturn =~ s/{{searchform}}/$thisentrysearchform/gi; } #merged 9/29/2003 # added by flipped cracker # version 1.3 ## autolinkentry functionality removed from 1.3.1. linear 2/19/2004 # merged in version 1.3 if ($entryreturn =~ m/{{entry/i) { $entryreturn =~ s/{{entrymainbody}}/$thisentrymainbody/gi; $entryreturn =~ s/{{entrymorebody}}/$thisentrymorebody/gi; $entryreturn =~ s/{{entrycomments}}/$thisentrycomments/gi; if ($entryreturn =~ m/{{entrymainbodyfirstwords (\d+)}}/i) { until ($entryreturn !~ m/{{entrymainbodyfirstwords (\d+)}}/isg) { $firstwordscount = $1; $grabmainbodywords = $thisentrymainbody; if ($grabmainbodywords =~ m/{{link/i) { $grabmainbodywords =~ s/({{linkmo) (http|https|ftp)(:\/\/\S+?) (.+?)(\|)(.+?)(}})/$4/isg; $grabmainbodywords =~ s/({{link) (http|https|ftp)(:\/\/\S+?)(}})/$2$3/isg; $grabmainbodywords =~ s/({{link) (http|https|ftp)(:\/\/\S+?) (.+?)(}})/$4/isg; ########################################################### # 9/2/2001 - CHERYL LAMBERT # ADDED {{linkblank}} TEMPLATE VARIABLE SO THAT I CAN USE target="_blank" TO OPEN NEW WINDOWS $grabmainbodywords =~ s/({{linkblankmo) (http|https|ftp)(:\/\/\S+?) (.+?)(\|)(.+?)(}})/$4/isg; $grabmainbodywords =~ s/({{linkblank) (http|https|ftp)(:\/\/\S+?)(}})/$2$3/isg; $grabmainbodywords =~ s/({{linkblank) (http|https|ftp)(:\/\/\S+?) (.+?)(}})/$4/isg; ########################################################### } if ($grabmainbodywords =~ m/{{email/i) { $grabmainbodywords =~ s/({{emailmo) (\S+\@\S+?) (.+?)(\|)(.+?)(}})/$3/isg; $grabmainbodywords =~ s/({{email) (\S+\@\S+?)(}})/$2/isg; $grabmainbodywords =~ s/({{email) (\S+\@\S+?) (.+?)(}})/$3/isg; } $grabmainbodywords =~ s/<([^>]|\n)*>/ /g; $grabmainbodywords =~ s/{{(.*?)}}/ /g; $grabmainbodywords =~ s/\n/ /g; $grabmainbodywords =~ s/\r/ /g; $grabmainbodywords =~ s/\|\*\|/ /g; $grabmainbodywords =~ s/^\s+//; $grabmainbodywords =~ s/\s+$//; $grabmainbodywords =~ s/\s{2,}/ /g; @grabmainbodywordslist = split (/ /, $grabmainbodywords); $countwordsfromhere = 0; (@finalmainbodywordslist, @finalmainbodywordslist = ()); if ($firstwordscount < 1) { $firstwordscount = 1; } do { $finalmainbodywordslist[$countwordsfromhere] = $grabmainbodywordslist[$countwordsfromhere]; $countwordsfromhere++; } until $countwordsfromhere eq $firstwordscount; $finalmainbodyfirstwords = join (" ", @finalmainbodywordslist); $finalmainbodyfirstwords =~ s/^\s+//; $finalmainbodyfirstwords =~ s/\s+$//; $finalmainbodyfirstwords =~ s/\s{2,}//g; if (substr($finalmainbodyfirstwords, -1) =~ /\W/) { chop($finalmainbodyfirstwords); } if (substr($finalmainbodyfirstwords, -1) eq / /) { chop($finalmainbodyfirstwords); } $entryreturn =~ s/{{entrymainbodyfirstwords ($firstwordscount)}}/$finalmainbodyfirstwords/isg; } } if ($entryreturn =~ m/{{entrymorebodyfirstwords (\d+)}}/i) { until ($entryreturn !~ m/{{entrymorebodyfirstwords (\d+)}}/isg) { $firstwordscount = $1; if ($thisentrymorebody eq Gm_Constants::EMPTY) { $entryreturn =~ s/{{entrymorebodyfirstwords ($firstwordscount)}}//isg; } else { $grabmorebodywords = $thisentrymorebody; if ($grabmorebodywords =~ m/{{link/i) { $grabmorebodywords =~ s/({{linkmo) (http|https|ftp)(:\/\/\S+?) (.+?)(\|)(.+?)(}})/$4/isg; $grabmorebodywords =~ s/({{link) (http|https|ftp)(:\/\/\S+?)(}})/$2$3/isg; $grabmorebodywords =~ s/({{link) (http|https|ftp)(:\/\/\S+?) (.+?)(}})/$4/isg; ########################################################### # 9/2/2001 - CHERYL LAMBERT # ADDED {{linkblank}} TEMPLATE VARIABLE SO THAT I CAN USE target="_blank" TO OPEN NEW WINDOWS $grabmorebodywords =~ s/({{linkblankmo) (http|https|ftp)(:\/\/\S+?) (.+?)(\|)(.+?)(}})/$4/isg; $grabmorebodywords =~ s/({{linkblank) (http|https|ftp)(:\/\/\S+?)(}})/$2$3/isg; $grabmorebodywords =~ s/({{linkblank) (http|https|ftp)(:\/\/\S+?) (.+?)(}})/$4/isg; ########################################################### } if ($grabmorebodywords =~ m/{{email/i) { $grabmorebodywords =~ s/({{emailmo) (\S+\@\S+?) (.+?)(\|)(.+?)(}})/$3/isg; $grabmorebodywords =~ s/({{email) (\S+\@\S+?)(}})/$2/isg; $grabmorebodywords =~ s/({{email) (\S+\@\S+?) (.+?)(}})/$3/isg; } $grabmorebodywords =~ s/<([^>]|\n)*>/ /g; $grabmorebodywords =~ s/{{(.*?)}}/ /g; $grabmorebodywords =~ s/\n/ /g; $grabmorebodywords =~ s/\r/ /g; $grabmorebodywords =~ s/\|\*\|/ /g; $grabmorebodywords =~ s/^\s+//; $grabmorebodywords =~ s/\s+$//; $grabmorebodywords =~ s/\s{2,}/ /g; @grabmorebodywordslist = split (/ /, $grabmorebodywords); $countwordsfromhere = 0; (@finalmorebodywordslist, @finalmorebodywordslist = ()); if ($firstwordscount < 1) { $firstwordscount = 1; } do { $finalmorebodywordslist[$countwordsfromhere] = $grabmorebodywordslist[$countwordsfromhere]; $countwordsfromhere++; } until $countwordsfromhere eq $firstwordscount; $finalmorebodyfirstwords = join (" ", @finalmorebodywordslist); $finalmorebodyfirstwords =~ s/^\s+//; $finalmorebodyfirstwords =~ s/\s+$//; $finalmorebodyfirstwords =~ s/\s{2,}//g; if (substr($finalmorebodyfirstwords, -1) =~ /\W/) { chop($finalmorebodyfirstwords); } if (substr($finalmorebodyfirstwords, -1) eq / /) { chop($finalmorebodyfirstwords); } $entryreturn =~ s/{{entrymorebodyfirstwords ($firstwordscount)}}/$finalmorebodyfirstwords/isg; } } } } if (($entryreturn =~ m/link}}/i) || ($entryreturn =~ m/{{morepreface}}/i)) { $entryreturn =~ s/{{morepreface}}/$thisentrymorepreface/gi; $entryreturn =~ s/{{morelink}}/$thisentrymorelink/gi; $entryreturn =~ s/{{karmalink}}/$thisentrykarmalink/gi; $entryreturn =~ s/{{commentslink}}/$thisentrycommentslink/gi; $entryreturn =~ s/{{pagelink}}/$thisentrypagelink/gi; $entryreturn =~ s/{{pageindexlink}}/$thisentrypageindexlink/gi; $entryreturn =~ s/{{pagearchiveindexlink}}/$thisentrypagearchiveindexlink/gi; $entryreturn =~ s/{{pagearchivelogindexlink}}/$thisentrypagearchivelogindexlink/gi; $entryreturn =~ s/{{pagesmartindexlink}}/$thisentrypagesmartindexlink/gi; $entryreturn =~ s/{{commentspostlink}}/$thisentrycommentspostlink/gi; $entryreturn =~ s/{{authorsmartlink}}/$thisentryauthorsmartlink/gi; } if (($entryreturn =~ m/karma}}/i) || ($entryreturn =~ m/karmalink}}/i)) { $entryreturn =~ s/{{positivekarmalink}}/$thisentrypositivekarmalink/gi; $entryreturn =~ s/{{negativekarmalink}}/$thisentrynegativekarmalink/gi; $entryreturn =~ s/{{positivekarma}}/$thisentrypositivekarma/gi; $entryreturn =~ s/{{negativekarma}}/$thisentrynegativekarma/gi; $entryreturn =~ s/{{totalkarma}}/$thisentrytotalkarma/gi; } # added in 1.3.1 : flipped cracker 1/18/2005 if ($entryreturn =~ m/{{smart/i) { # smartentrymusic and smartentrymood templates: linear 9/20/2003 # merged in 1.3 if ($thisentrymusic ne Gm_Constants::EMPTY) { $entryreturn =~ s/{{smartentrymusic}}/$gmsmartentrymusictemplate/gi; } else { $entryreturn =~ s/{{smartentrymusic}}//gi; } if ($thisentrymood ne Gm_Constants::EMPTY) { $entryreturn =~ s/{{smartentrymood}}/$gmsmartentrymoodtemplate/gi; } else { $entryreturn =~ s/{{smartentrymood}}//gi; } # merged 9/20/2003 } # added 1/18/2005 if ($entryreturn =~ m/{{entry/i) { $entryreturn =~ s/{{entrysubject}}/$thisentrysubject/gi; ########################################################### # 9/3/2001 - CHERYL LAMBERT # ADDED 1 TEMPLATE VARIABLE SO THAT I CAN STRIP THE HTML CODE FROM THE ENTRYSUBJECT # WHEN IT IS USED IN THE TAG my $thisentrysubjectstripped = $thisentrysubject; $thisentrysubjectstripped =~ s/<.*?>//gi; $thisentrysubjectstripped =~ s/<\/.*?>//gi; $entryreturn =~ s/{{entrysubjectstripped}}/$thisentrysubjectstripped/gi; ########################################################### $entryreturn =~ s/{{entrynumber}}/$thisentrynumber/gi; $entryreturn =~ s/{{entrynumberpadded}}/$thisentrynumberpadded/gi; # added by flipped cracker 09/12/03 # version 1.3 $entryreturn =~ s/{{entrymusic}}/$thisentrymusic/gi; $thisentrymood = &gm_emoticons($thisentrymood); $entryreturn =~ s/{{entrymood}}/$thisentrymood/gi; # end additions } if ($entryreturn =~ m/{{author/i) { $entryreturn =~ s/{{author}}/$thisentryauthor/gi; $entryreturn =~ s/{{authoremail}}/$thisentryauthoremail/gi; $entryreturn =~ s/{{authorhomepage}}/$thisentryauthorhomepage/gi; $entryreturn =~ s/{{authorentrycount}}/$thisentryauthorentrycount/gi; } if (($entryreturn =~ m/{{authoremail /i) || ($entryreturn =~ m/{{authorhomepage /i) || ($entryreturn =~ m/{{authorentrycount /i) || ($entryreturn =~ m/{{authoremaillink /i) || ($entryreturn =~ m/{{authorhomepagelink /i) || ($entryreturn =~ m/{{authorsmartlink /i)) { &gm_generateexternalauthorvariables; } if ($entryreturn =~ m/{{comments/i) { $entryreturn =~ s/{{commentstatussmart}}/$thisentrycommentstatussmart/gi; $entryreturn =~ s/{{commentstatussmartupper}}/$thisentrycommentstatussmartupper/gi; $entryreturn =~ s/{{commentstatussmartlower}}/$thisentrycommentstatussmartlower/gi; $entryreturn =~ s/{{commentsnumber}}/$thisentrycommentsnumber/gi; } if (($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)) { $entryreturn =~ s/{{day}}/$thisentryday/gi; $entryreturn =~ s/{{month}}/$thisentrymonth/gi; $entryreturn =~ s/{{year}}/$thisentryyear/gi; $entryreturn =~ s/{{hour}}/$thisentryhour/gi; $entryreturn =~ s/{{minute}}/$thisentryminute/gi; $entryreturn =~ s/{{second}}/$thisentrysecond/gi; $entryreturn =~ s/{{dayday}}/$thisentrydayday/gi; $entryreturn =~ s/{{monthmonth}}/$thisentrymonthmonth/gi; $entryreturn =~ s/{{yearyear}}/$thisentryyearyear/gi; $entryreturn =~ s/{{hourhour}}/$thisentryhourhour/gi; $entryreturn =~ s/{{minuteminute}}/$thisentryminuteminute/gi; $entryreturn =~ s/{{secondsecond}}/$thisentrysecondsecond/gi; $entryreturn =~ s/{{weekday}}/$thisentryweekday/gi; $entryreturn =~ s/{{weekdayshort}}/$thisentryweekdayshort/gi; $entryreturn =~ s/{{monthword}}/$thisentrymonthword/gi; $entryreturn =~ s/{{monthwordshort}}/$thisentrymonthwordshort/gi; $entryreturn =~ s/{{weekdayupper}}/$thisentryweekdayupper/gi; $entryreturn =~ s/{{monthwordupper}}/$thisentrymonthwordupper/gi; $entryreturn =~ s/{{weekdaylower}}/$thisentryweekdaylower/gi; $entryreturn =~ s/{{monthwordlower}}/$thisentrymonthwordlower/gi; $entryreturn =~ s/{{weekdayuppershort}}/$thisentryweekdayuppershort/gi; $entryreturn =~ s/{{monthworduppershort}}/$thisentrymonthworduppershort/gi; $entryreturn =~ s/{{weekdaylowershort}}/$thisentryweekdaylowershort/gi; $entryreturn =~ s/{{monthwordlowershort}}/$thisentrymonthwordlowershort/gi; $entryreturn =~ s/{{militaryhour}}/$thisentrymilitaryhour/gi; $entryreturn =~ s/{{ampm}}/$thisentryampm/gi; $entryreturn =~ s/{{ampmdot}}/$thisentryampmdot/gi; $entryreturn =~ s/{{ampmlower}}/$thisentryampmlower/gi; $entryreturn =~ s/{{ampmdotlower}}/$thisentryampmdotlower/gi; $entryreturn =~ s/{{timezone}}/$timezone/gi; # new ordinal numbers for {{dayappend}} variable: linear 9/15/2003 # merged in 1.3 $thisentrydayappend = Gm_Utils::toOrdinal($thisentryday); #merged 9/15/2003 # new {{dayappend}} variable:: linear 9/15/2003 # merged in 1.3 $thisentrydayappend = Gm_Utils::toOrdinal($thisentryday); $entryreturn =~ s/{{dayappend}}/$thisentrydayappend/gi; # merged 9/15/2003 } if (($entryreturn =~ m/{{weekbeginning/i) || ($entryreturn =~ m/{{weekending/i)) { $entryreturn =~ s/{{weekbeginningday}}/$thisentryweekbeginningday/gi; $entryreturn =~ s/{{weekbeginningdayday}}/$thisentryweekbeginningdayday/gi; $entryreturn =~ s/{{weekbeginningmonth}}/$thisentryweekbeginningmonth/gi; $entryreturn =~ s/{{weekbeginningmonthmonth}}/$thisentryweekbeginningmonthmonth/gi; $entryreturn =~ s/{{weekbeginningyear}}/$thisentryweekbeginningyear/gi; $entryreturn =~ s/{{weekbeginningyearyear}}/$thisentryweekbeginningyearyear/gi; $entryreturn =~ s/{{weekbeginningweekday}}/$thisentryweekbeginningweekday/gi; $entryreturn =~ s/{{weekbeginningweekdayshort}}/$thisentryweekbeginningweekdayshort/gi; $entryreturn =~ s/{{weekbeginningmonthword}}/$thisentryweekbeginningmonthword/gi; $entryreturn =~ s/{{weekbeginningmonthwordshort}}/$thisentryweekbeginningmonthwordshort/gi; $entryreturn =~ s/{{weekbeginningweekdayupper}}/$thisentryweekbeginningweekdayupper/gi; $entryreturn =~ s/{{weekbeginningmonthwordupper}}/$thisentryweekbeginningmonthwordupper/gi; $entryreturn =~ s/{{weekbeginningweekdaylower}}/$thisentryweekbeginningweekdaylower/gi; $entryreturn =~ s/{{weekbeginningmonthwordlower}}/$thisentryweekbeginningmonthwordlower/gi; $entryreturn =~ s/{{weekbeginningweekdayuppershort}}/$thisentryweekbeginningweekdayuppershort/gi; $entryreturn =~ s/{{weekbeginningmonthworduppershort}}/$thisentryweekbeginningmonthworduppershort/gi; $entryreturn =~ s/{{weekbeginningweekdaylowershort}}/$thisentryweekbeginningweekdaylowershort/gi; $entryreturn =~ s/{{weekbeginningmonthwordlowershort}}/$thisentryweekbeginningmonthwordlowershort/gi; $entryreturn =~ s/{{weekendingday}}/$thisentryweekendingday/gi; $entryreturn =~ s/{{weekendingdayday}}/$thisentryweekendingdayday/gi; $entryreturn =~ s/{{weekendingmonth}}/$thisentryweekendingmonth/gi; $entryreturn =~ s/{{weekendingmonthmonth}}/$thisentryweekendingmonthmonth/gi; $entryreturn =~ s/{{weekendingyear}}/$thisentryweekendingyear/gi; $entryreturn =~ s/{{weekendingyearyear}}/$thisentryweekendingyearyear/gi; $entryreturn =~ s/{{weekendingweekday}}/$thisentryweekendingweekday/gi; $entryreturn =~ s/{{weekendingweekdayshort}}/$thisentryweekendingweekdayshort/gi; $entryreturn =~ s/{{weekendingmonthword}}/$thisentryweekendingmonthword/gi; $entryreturn =~ s/{{weekendingmonthwordshort}}/$thisentryweekendingmonthwordshort/gi; $entryreturn =~ s/{{weekendingweekdayupper}}/$thisentryweekendingweekdayupper/gi; $entryreturn =~ s/{{weekendingmonthwordupper}}/$thisentryweekendingmonthwordupper/gi; $entryreturn =~ s/{{weekendingweekdaylower}}/$thisentryweekendingweekdaylower/gi; $entryreturn =~ s/{{weekendingmonthwordlower}}/$thisentryweekendingmonthwordlower/gi; $entryreturn =~ s/{{weekendingweekdayuppershort}}/$thisentryweekendingweekdayuppershort/gi; $entryreturn =~ s/{{weekendingmonthworduppershort}}/$thisentryweekendingmonthworduppershort/gi; $entryreturn =~ s/{{weekendingweekdaylowershort}}/$thisentryweekendingweekdaylowershort/gi; $entryreturn =~ s/{{weekendingmonthwordlowershort}}/$thisentryweekendingmonthwordlowershort/gi; } if ($entryreturn =~ m/{{link/i) { $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; $entryreturn =~ s/({{link) (http|https|ftp)(:\/\/\S+?)(}})/<a href="$2$3">$2$3<\/a>/isg; $entryreturn =~ s/({{link) (http|https|ftp)(:\/\/\S+?) (.+?)(}})/<a href="$2$3">$4<\/a>/isg; ########################################################### # 9/2/2001 - CHERYL LAMBERT # ADDED {{linkblank}} TEMPLATE VARIABLE SO THAT I CAN USE target="_blank" TO OPEN NEW WINDOWS $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; $entryreturn =~ s/({{linkblank) (http|https|ftp)(:\/\/\S+?)(}})/<A HREF="$2$3" target="_blank">$2$3<\/A>/isg; $entryreturn =~ s/({{linkblank) (http|https|ftp)(:\/\/\S+?) (.+?)(}})/<A HREF="$2$3" target="_blank">$4<\/A>/isg; ########################################################### } if ($entryreturn =~ m/{{email/i) { $entryreturn =~ s/({{emailmo) (\S+\@\S+?) (.+?)(\|)(.+?)(}})/<a href="mailto:$2" onmouseover="window.status='$5';return true" onmouseout="window.status='';return true">$3<\/>/isg; $entryreturn =~ s/({{email) (\S+\@\S+?)(}})/<a href="mailto:$2">$2<\/a>/isg; $entryreturn =~ s/({{email) (\S+\@\S+?) (.+?)(}})/<a href="mailto:$2">$3<\/a>/isg; } if ($entryreturn =~ m/{{popup (\S+) (.+?) (\d+)x(\d+)}}/i) { until ($entryreturn !~ m/{{popup (\S+) (.+?) (\d+)x(\d+)}}/isg) { $popupfile = $1; $popuptitle = $2; $popupwidth = $3; $popupheight = $4; $popuphtmlfile = $1; $popuphtmlfile =~ s/\.(\S+)$//; $popuphtmlfile .= ".$entrysuffix"; $popuppage = $gmpopuppagetemplate; $popupcode = $gmpopupcodetemplate; $popuppage =~ s/{{popupfile}}/$popupfile/gi; $popuppage =~ s/{{popuphtmlfile}}/$popuphtmlfile/gi; $popuppage =~ s/{{popuptitle}}/$popuptitle/gi; $popuppage =~ s/{{popupwidth}}/$popupwidth/gi; $popuppage =~ s/{{popupheight}}/$popupheight/gi; $popupcode =~ s/{{popupfile}}/$popupfile/gi; $popupcode =~ s/{{popuphtmlfile}}/$popuphtmlfile/gi; $popupcode =~ s/{{popuptitle}}/$popuptitle/gi; $popupcode =~ s/{{popupwidth}}/$popupwidth/gi; $popupcode =~ s/{{popupheight}}/$popupheight/gi; $popuppage =~ s/{{cgiwebpath}}/$cgiwebpath/gi; $popuppage =~ s/{{entrieswebpath}}/$EntriesWebPath/gi; $popuppage =~ s/{{logwebpath}}/$LogWebPath/gi; $popuppage =~ s/{{emoticonspath}}/$emoticonspath/gi; $foundpopupmatch = Gm_Constants::NO; if( exists( $gmentrylist->{$thisentrynumber} ) ) { $loglistnumber = $gmentrylist->{$thisentrynumber}{'id'}; $loglistauthor = $gmentrylist->{$thisentrynumber}{'author'}; $loglistsubject = $gmentrylist->{$thisentrynumber}{'subject'}; $loglistdate = $gmentrylist->{$thisentrynumber}{'created'}; $loglisttimeampm = $gmentrylist->{$thisentrynumber}{'createt'}; $loglistopenstatus = $gmentrylist->{$thisentrynumber}{'status'}; $loglistmorestatus = $gmentrylist->{$thisentrynumber}{'extended'}; &gm_getloglistvariables; $foundpopupmatch = Gm_Constants::YES; } $listsubsub = $popuppage; &entrylistsubsub; 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."); print POPUPVIDEO $listsubsub; close (POPUPVIDEO); $listsubsub = $popupcode; &entrylistsubsub; $entryreturn =~ s/{{popup $popupfile $popuptitle ($popupwidth)x($popupheight)}}/$listsubsub/isg; } } if (($entryreturn =~ m/{{previous/i) || ($entryreturn =~ m/{{next/i)) { $entryreturn =~ s/{{previousmore/{{moreprevious/isg; $entryreturn =~ s/{{nextmore/{{morenext/isg; if ($thisentrynumber ne "1") { $thispreviousentrynumber = $thisentrynumber - 1; $foundregular = Gm_Constants::NO; $foundmore = Gm_Constants::NO; $foundboth = Gm_Constants::NO; do { foreach my $entry ( sort { $gmentrylist->{$b}{'id'} <=> $gmentrylist->{$a}{'id'} } keys( %$gmentrylist ) ) { $loglistnumber = $gmentrylist->{$entry}{'id'}; $loglistauthor = $gmentrylist->{$entry}{'author'}; $loglistsubject = $gmentrylist->{$entry}{'subject'}; $loglistdate = $gmentrylist->{$entry}{'created'}; $loglisttimeampm = $gmentrylist->{$entry}{'createt'}; $loglistopenstatus = $gmentrylist->{$entry}{'status'}; $loglistmorestatus = $gmentrylist->{$entry}{'extended'}; if (($thispreviousentrynumber eq $loglistnumber) && ($loglistnumber < $thisentrynumber) && ($foundregular eq Gm_Constants::NO) && ($loglistopenstatus ne "C")) { $entryreturn =~ s/{{previouslink}}/$gmpreviouslinktemplate/isg; &gm_getloglistvariables; $listsubsub = $entryreturn; $listsubsub =~ s/{{previous/{{/isg; &entrylistsubsub; $entryreturn = $listsubsub; $foundregular = Gm_Constants::YES; } if (($thispreviousentrynumber eq $loglistnumber) && ($loglistmorestatus eq 'Y') && ($loglistnumber < $thisentrynumber) && ($foundmore eq Gm_Constants::NO) && ($loglistopenstatus ne "C")) { $entryreturn =~ s/{{morepreviouslink}}/$gmpreviousmorelinktemplate/isg; $entryreturn =~ s/{{previousmore/{{moreprevious/isg; &gm_getloglistvariables; $listsubsub = $entryreturn; $listsubsub =~ s/{{moreprevious/{{/isg; &entrylistsubsub; $entryreturn = $listsubsub; $foundmore = Gm_Constants::YES; } } if (($foundregular eq Gm_Constants::YES) && ($foundmore eq Gm_Constants::YES)) { $foundboth = Gm_Constants::YES; } if ($thispreviousentrynumber eq "1") { $foundboth = Gm_Constants::YES; } $thispreviousentrynumber--; } until $foundboth eq Gm_Constants::YES; } if ($thisentrynumber ne $newentrynumber) { $thisnextentrynumber = $thisentrynumber + 1; $foundregular = Gm_Constants::NO; $foundmore = Gm_Constants::NO; $foundboth = Gm_Constants::NO; do { foreach my $entry ( sort { $gmentrylist->{$a}{'id'} <=> $gmentrylist->{$b}{'id'} } keys( %$gmentrylist ) ) { $loglistnumber = $gmentrylist->{$entry}{'id'}; $loglistauthor = $gmentrylist->{$entry}{'author'}; $loglistsubject = $gmentrylist->{$entry}{'subject'}; $loglistdate = $gmentrylist->{$entry}{'created'}; $loglisttimeampm = $gmentrylist->{$entry}{'createt'}; $loglistopenstatus = $gmentrylist->{$entry}{'status'}; $loglistmorestatus = $gmentrylist->{$entry}{'extended'}; if (($thisnextentrynumber eq $loglistnumber) && ($loglistnumber > $thisentrynumber) && ($foundregular eq Gm_Constants::NO) && ($loglistopenstatus ne "C")) { $entryreturn =~ s/{{nextlink}}/$gmnextlinktemplate/isg; &gm_getloglistvariables; $listsubsub = $entryreturn; $listsubsub =~ s/{{next/{{/isg; &entrylistsubsub; $entryreturn = $listsubsub; $foundregular = Gm_Constants::YES; } if (($thisnextentrynumber eq $loglistnumber) && ($loglistmorestatus eq 'Y') && ($loglistnumber > $thisentrynumber) && ($foundmore eq Gm_Constants::NO) && ($loglistopenstatus ne "C")) { $entryreturn =~ s/{{morenextlink}}/$gmnextmorelinktemplate/isg; $entryreturn =~ s/{{nextmore/{{morenext/isg; &gm_getloglistvariables; $listsubsub = $entryreturn; $listsubsub =~ s/{{morenext/{{/isg; &entrylistsubsub; $entryreturn = $listsubsub; $foundmore = Gm_Constants::YES; } } if (($foundregular eq Gm_Constants::YES) && ($foundmore eq Gm_Constants::YES)) { $foundboth = Gm_Constants::YES; } if ($thisnextentrynumber eq $newentrynumber) { $foundboth = Gm_Constants::YES; } $thisnextentrynumber++; } until $foundboth eq Gm_Constants::YES; } $entryreturn =~ s/{{previouspagelink}}/$thisentrypagesmartindexlink/isg; $entryreturn =~ s/{{nextpagelink}}/$thisentrypagesmartindexlink/isg; $entryreturn =~ s/{{previousmorepagelink}}/$thisentrypagesmartindexlink/isg; $entryreturn =~ s/{{nextmorepagelink}}/$thisentrypagesmartindexlink/isg; $entryreturn =~ s/{{morepreviouspagelink}}/$thisentrypagesmartindexlink/isg; $entryreturn =~ s/{{morenextpagelink}}/$thisentrypagesmartindexlink/isg; $entryreturn =~ s/{{previouslink}}//isg; $entryreturn =~ s/{{nextlink}}//isg; if (($entryreturn =~ m/{{previous/i) || ($entryreturn =~ m/{{next/i)) { if( exists( $gmentrylist->{$thisentrynumber} ) ) { $loglistnumber = $gmentrylist->{$thisentrynumber}{'id'}; $loglistauthor = $gmentrylist->{$thisentrynumber}{'author'}; $loglistsubject = $gmentrylist->{$thisentrynumber}{'subject'}; $loglistdate = $gmentrylist->{$thisentrynumber}{'created'}; $loglisttimeampm = $gmentrylist->{$thisentrynumber}{'createt'}; $loglistopenstatus = $gmentrylist->{$thisentrynumber}{'status'}; $loglistmorestatus = $gmentrylist->{$thisentrynumber}{'extended'}; &gm_getloglistvariables; $listsubsub = $entryreturn; $listsubsub =~ s/{{previous/{{/isg; $listsubsub =~ s/{{next/{{/isg; &entrylistsubsub; $entryreturn = $listsubsub; } } $entryreturn =~ s/{{morepagelink}}/$thisentrypagesmartindexlink/isg; } # enhanced escaping of metacharacters: linear 8/25/2003 # merged in 1.3 if ($entryreturn =~ m/window.status='(.*?)';/i) { $entryreturn =~ s/\(/GMLEFTPARENTHESES/g; $entryreturn =~ s/\)/GMRIGHTPARENTHESES/g; $entryreturn =~ s/\?/GMQUESTIONMARK/g; $entryreturn =~ s/\+/GMPLUS/g; $entryreturn =~ s/\[/GMLEFTSQUAREBRACKET/g; $entryreturn =~ s/\]/GMRIGHTSQUAREBRACKET/g; $entryreturn =~ s/\$/GMDOLLAR/g; $entryreturn =~ s/\^/GMCARET/g; $entryreturn =~ s/\|/GMPIPE/g; $entryreturn =~ s/\*/GMSPLAT/g; until ($entryreturn !~ m/window.status='(.*?)';/ig) { $windowstatusorigstring = $1; $windowstatusmiddlenew = $1; $windowstatusmiddlenew =~ s#'#\\'#isg; $windowstatusmiddlenew =~ s#"#\\'#isg; $entryreturn =~ s/window.status='$windowstatusorigstring';/WSPLACEHOLDER='$windowstatusmiddlenew';/isg; } $entryreturn =~ s/WSPLACEHOLDER=/window.status=/isg; $entryreturn =~ s/GMLEFTPARENTHESES/\(/g; $entryreturn =~ s/GMRIGHTPARENTHESES/\)/g; $entryreturn =~ s/GMQUESTIONMARK/\?/g; $entryreturn =~ s/GMPLUS/\+/g; $entryreturn =~ s/GMLEFTSQUAREBRACKET/\[/g; $entryreturn =~ s/GMRIGHTSQUAREBRACKET/\]/g; $entryreturn =~ s/GMDOLLAR/\$/g; $entryreturn =~ s/GMCARET/\^/g; $entryreturn =~ s/GMPIPE/\|/g; $entryreturn =~ s/GMSPLAT/\*/g; } if ($entryreturn =~ m/{{randomnumber (\d+)-(\d+)}}/i) { until ($entryreturn !~ m/{{randomnumber (\d+)-(\d+)}}/isg) { $minrand = $1; $maxrand = $2; $maxtemprand = $maxrand - $minrand; $maxtemprand++; $randresult = int(rand $maxtemprand) + $minrand; $entryreturn =~ s/{{randomnumber ($minrand)-($maxrand)}}/$randresult/i; } } if (($entryreturn =~ m/{{cgiwebpath}}/i) || ($entryreturn =~ m/{{entrieswebpath}}/i) || ($entryreturn =~ m/{{logwebpath}}/i) || ($entryreturn =~ m/{{emoticonspath}}/i)) { $entryreturn =~ s/{{cgiwebpath}}/$cgiwebpath/gi; $entryreturn =~ s/{{entrieswebpath}}/$EntriesWebPath/gi; $entryreturn =~ s/{{logwebpath}}/$LogWebPath/gi; $entryreturn =~ s/{{emoticonspath}}/$emoticonspath/gi; } if (($entryreturn =~ m/{{gmversion}}/i) || ($entryreturn =~ m/{{gmicon}}/i)) { $entryreturn =~ s/{{gmversion}}/$gmversion/gi; $entryreturn =~ s/{{gmicon}}/<a href="http:\/\/greymatterforum.proboards82.com\/" target="_top"><img border="0" src="$LogWebPath\/gm-icon.gif" alt="Powered By Greymatter" \/><\/a>/gi; } # new {{cookiescode}} template to facilitate setting cookies on commenters: linear 9/23/2003 # merged in 1.3 $entryreturn =~ s/{{cookiescode}}/$gmcookiescodetemplate/gi; # merged 9/23/2003 # added by flipped cracker 09/12/03 # version 1.3 $entryreturn =~ s/{{emoticonspath}}/$emoticonspath/gi; $entryreturn =~ s/{{entrysuffix}}/$entrysuffix/gi; $entryreturn =~ s/{{archivesuffix}}/$logarchivesuffix/gi; $entryreturn =~ s/{{domain}}/$domain/gi; # end additions # added by flipped cracker 1/26/05 # version 1.3.1 $entryreturn =~ s/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w{1,8});)/&/g; # end additions } # ---------------------------- # generate the main index file # ---------------------------- sub gm_generatemainindex { &gm_readconfig; &gm_readcounter; &gm_readtemplates; $indexlogbody = Gm_Constants::EMPTY; $indexentrycounter = $newentrynumber; $indexcurrentdatemarker = "erewhon"; $indexcurrentdatescounted = 0; if ($newstayattopnumber ne "0") { &gm_getentryvariables($newstayattopnumber); if ($thisentryopenstatus eq Gm_Constants::OPEN) { &gm_formatentry($gmstayattoptemplate); $indexlogbody .= $entryreturn; } } do { &gm_getentryvariables($indexentrycounter); $datemark = "$thisentrymonth $thisentryday $thisentryyearyear"; if (($datemark ne $indexcurrentdatemarker) && ($thisentryopenstatus eq Gm_Constants::OPEN) && ($indexentrycounter ne $newstayattopnumber)) { $indexcurrentdatescounted++; if ($gmdatetemplate ne Gm_Constants::EMPTY) { $currentdatehead = $gmdatetemplate; $currentdatehead =~ s/{{day}}/$thisentryday/gi; $currentdatehead =~ s/{{dayday}}/$thisentrydayday/gi; $currentdatehead =~ s/{{year}}/$thisentryyear/gi; $currentdatehead =~ s/{{yearyear}}/$thisentryyearyear/gi; $currentdatehead =~ s/{{month}}/$thisentrymonth/gi; $currentdatehead =~ s/{{monthmonth}}/$thisentrymonthmonth/gi; $currentdatehead =~ s/{{weekday}}/$thisentryweekday/gi; $currentdatehead =~ s/{{weekdayshort}}/$thisentryweekdayshort/gi; $currentdatehead =~ s/{{monthword}}/$thisentrymonthword/gi; $currentdatehead =~ s/{{monthwordshort}}/$thisentrymonthwordshort/gi; $currentdatehead =~ s/{{weekdayupper}}/$thisentryweekdayupper/gi; $currentdatehead =~ s/{{monthwordupper}}/$thisentrymonthwordupper/gi; $currentdatehead =~ s/{{weekdaylower}}/$thisentryweekdaylower/gi; $currentdatehead =~ s/{{monthwordlower}}/$thisentrymonthwordlower/gi; $currentdatehead =~ s/{{weekdayuppershort}}/$thisentryweekdayuppershort/gi; $currentdatehead =~ s/{{monthworduppershort}}/$thisentrymonthworduppershort/gi; $currentdatehead =~ s/{{weekdaylowershort}}/$thisentryweekdaylowershort/gi; $currentdatehead =~ s/{{monthwordlowershort}}/$thisentrymonthwordlowershort/gi; # new {{dayappend}} variable: linear 9/15/2003 # merged in 1.3 $thisentrydayappend = Gm_Utils::toOrdinal($thisentryday); $currentdatehead =~ s/{{dayappend}}/$thisentrydayappend/gi; # merged 9/15/2003 unless ($indexcurrentdatescounted > $indexdays) { $indexlogbody .= $currentdatehead; # added new $dategrouping flag : 1.3.1 # flipped cracker 6/29/2004 $dategrouping = Gm_Constants::OPEN; } } $indexcurrentdatemarker = "$thisentrymonth $thisentryday $thisentryyearyear"; } else { if (($indexentrycounter ne $newstayattopnumber) && ($thisentryopenstatus eq Gm_Constants::OPEN) && ($indexcurrentdatescounted <= $indexdays) && ($gmentryseparatortemplate ne Gm_Constants::EMPTY)) { $indexlogbody .= $gmentryseparatortemplate; } } if (($indexentrycounter ne $newstayattopnumber) && ($thisentryopenstatus eq Gm_Constants::OPEN) && ($indexcurrentdatescounted <= $indexdays)) { if ($thisentrymorebody ne Gm_Constants::EMPTY) { &gm_formatentry($gmmoreentrytemplate); } else { &gm_formatentry($gmentrytemplate); } $indexlogbody .= $entryreturn; } # new date grouping footer template in 1.3: linear 9/18/2003 # merged in 1.3 if ($indexentrycounter > 1) { &gm_getentryvariables($indexentrycounter - 1); # look at the last open entry $nextdatemark = "$thisentrymonth $thisentryday $thisentryyearyear"; $nextentryopenstatus = $thisentryopenstatus; &gm_getentryvariables($indexentrycounter); # look at the current entry again # this logic was in error, fixed in 1.3.1 linear 2/19/2004 # also fixed by flipped cracker 6/29/2004 # added $dategrouping flag checking # merged in 1.3.1 # if (($nextdatemark ne $indexcurrentdatemarker) && ($dategrouping eq Gm_Constants::OPEN) && ($nextentryopenstatus eq Gm_Constants::OPEN) && ($indexentrycounter ne $newstayattopnumber)) { # if (($nextdatemark ne $indexcurrentdatemarker) && ($thisentryopenstatus eq Gm_Constants::OPEN) && ($indexentrycounter ne $newstayattopnumber)) { # merged 2/19/2004 if ($gmdategroupingfootertemplate ne Gm_Constants::EMPTY) { $currentdatefoot = $gmdategroupingfootertemplate; $currentdatefoot =~ s/{{day}}/$thisentryday/gi; $currentdatefoot =~ s/{{dayday}}/$thisentrydayday/gi; $currentdatefoot =~ s/{{year}}/$thisentryyear/gi; $currentdatefoot =~ s/{{yearyear}}/$thisentryyearyear/gi; $currentdatefoot =~ s/{{month}}/$thisentrymonth/gi; $currentdatefoot =~ s/{{monthmonth}}/$thisentrymonthmonth/gi; $currentdatefoot =~ s/{{weekday}}/$thisentryweekday/gi; $currentdatefoot =~ s/{{weekdayshort}}/$thisentryweekdayshort/gi; $currentdatefoot =~ s/{{monthword}}/$thisentrymonthword/gi; $currentdatefoot =~ s/{{monthwordshort}}/$thisentrymonthwordshort/gi; $currentdatefoot =~ s/{{weekdayupper}}/$thisentryweekdayupper/gi; $currentdatefoot =~ s/{{monthwordupper}}/$thisentrymonthwordupper/gi; $currentdatefoot =~ s/{{weekdaylower}}/$thisentryweekdaylower/gi; $currentdatefoot =~ s/{{monthwordlower}}/$thisentrymonthwordlower/gi; $currentdatefoot =~ s/{{weekdayuppershort}}/$thisentryweekdayuppershort/gi; $currentdatefoot =~ s/{{monthworduppershort}}/$thisentrymonthworduppershort/gi; $currentdatefoot =~ s/{{weekdaylowershort}}/$thisentryweekdaylowershort/gi; $currentdatefoot =~ s/{{monthwordlowershort}}/$thisentrymonthwordlowershort/gi; # new {{dayappend}} variable: linear 9/15/2003 # merged in 1.3 $thisentrydayappend = Gm_Utils::toOrdinal($thisentryday); $currentdatefoot =~ s/{{dayappend}}/$thisentrydayappend/gi; # merged 9/15/2003 unless ($indexcurrentdatescounted > $indexdays) { $indexlogbody .= $currentdatefoot; # added $dategrouping flag : 1.3.1 # flipped cracker 6/29/2004 $dategrouping = Gm_Constants::CLOSED; } } } } $indexentrycounter--; if ($indexentrycounter eq "0") { if ($indexcurrentdatescounted > $indexdays) { $indexentrycounter++; } $indexcurrentdatescounted = $indexdays + 1; } if (($newstayattopnumber eq "1") && ($newentrynumber eq "1")) { $indexcurrentdatescounted = $indexdays + 1; } if ($indexcurrentdatescounted > $indexdays) { if ($indexentrycounter < 0) { $indexentrycounter = 0; } unless ($indexentrycounter eq "0") { $indexentrycounter = $thisentrynumber; } } } until $indexcurrentdatescounted > $indexdays; if ( ($gmdategroupingfootertemplate ne Gm_Constants::EMPTY) && ($dategrouping eq Gm_Constants::OPEN) ) { $currentdatefoot = $gmdategroupingfootertemplate; $currentdatefoot =~ s/{{day}}/$thisentryday/gi; $currentdatefoot =~ s/{{dayday}}/$thisentrydayday/gi; $currentdatefoot =~ s/{{year}}/$thisentryyear/gi; $currentdatefoot =~ s/{{yearyear}}/$thisentryyearyear/gi; $currentdatefoot =~ s/{{month}}/$thisentrymonth/gi; $currentdatefoot =~ s/{{monthmonth}}/$thisentrymonthmonth/gi; $currentdatefoot =~ s/{{weekday}}/$thisentryweekday/gi; $currentdatefoot =~ s/{{weekdayshort}}/$thisentryweekdayshort/gi; $currentdatefoot =~ s/{{monthword}}/$thisentrymonthword/gi; $currentdatefoot =~ s/{{monthwordshort}}/$thisentrymonthwordshort/gi; $currentdatefoot =~ s/{{weekdayupper}}/$thisentryweekdayupper/gi; $currentdatefoot =~ s/{{monthwordupper}}/$thisentrymonthwordupper/gi; $currentdatefoot =~ s/{{weekdaylower}}/$thisentryweekdaylower/gi; $currentdatefoot =~ s/{{monthwordlower}}/$thisentrymonthwordlower/gi; $currentdatefoot =~ s/{{weekdayuppershort}}/$thisentryweekdayuppershort/gi; $currentdatefoot =~ s/{{monthworduppershort}}/$thisentrymonthworduppershort/gi; $currentdatefoot =~ s/{{weekdaylowershort}}/$thisentryweekdaylowershort/gi; $currentdatefoot =~ s/{{monthwordlowershort}}/$thisentrymonthwordlowershort/gi; $thisentrydayappend = Gm_Utils::toOrdinal($thisentryday); $currentdatefoot =~ s/{{dayappend}}/$thisentrydayappend/gi; $indexlogbody .= $currentdatefoot; $dategrouping = Gm_Constants::CLOSED; } $newindexfile = $gmindextemplate; $newindexfile =~ s/{{logbody}}/$indexlogbody/gi; &gm_getentryvariables($newentrynumber); &gm_formatentry($newindexfile); open (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."); print THISFILECLAWS $entryreturn; close (THISFILECLAWS); $newarchivenumber = $indexentrycounter; &gm_writecounter; } # --------------------- # generate archive file # --------------------- sub gm_generatearchive { my $getstartnumber = shift; &Gm_Trace::Trace( level => 2, msg => "Entering gm_generatearchive: getstartnumber=$getstartnumber"); $startnumber = $getstartnumber; &gm_readconfig; &gm_readcounter; &gm_readtemplates; $indexarchivebody = Gm_Constants::EMPTY; $indexentrycounter = $startnumber; $indexcurrentdatemarker = "erewhon"; $indexcurrentdatescounted = 0; &gm_getentryvariables($startnumber); $indexcurrentmonthcounter = $thisentrymonth; $indexcurrentweekcounter = "$thisentryweekbeginningdayday$thisentryweekendingdayday"; do { &gm_getentryvariables($indexentrycounter); $thisentryweek = "$thisentryweekbeginningdayday$thisentryweekendingdayday"; if (($generateentrypages eq Gm_Constants::YES) && ($indexentrycounter eq $newarchivenumber)) { if ($thisentryopenstatus eq Gm_Constants::OPEN) { &gm_formatentry($gmarchiveentrypagetemplate); 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."); print THISFILE $entryreturn; close (THISFILE); } else { unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } } $datemark = "$thisentrymonth $thisentryday $thisentryyearyear"; if (($datemark ne $indexcurrentdatemarker) && ($thisentryopenstatus eq Gm_Constants::OPEN)) { $indexcurrentdatescounted++; if ($gmdatearchivetemplate ne Gm_Constants::EMPTY) { $currentdatehead = $gmdatearchivetemplate; $currentdatehead =~ s/{{day}}/$thisentryday/gi; $currentdatehead =~ s/{{dayday}}/$thisentrydayday/gi; $currentdatehead =~ s/{{year}}/$thisentryyear/gi; $currentdatehead =~ s/{{yearyear}}/$thisentryyearyear/gi; $currentdatehead =~ s/{{month}}/$thisentrymonth/gi; $currentdatehead =~ s/{{monthmonth}}/$thisentrymonthmonth/gi; $currentdatehead =~ s/{{weekday}}/$thisentryweekday/gi; $currentdatehead =~ s/{{weekdayshort}}/$thisentryweekdayshort/gi; $currentdatehead =~ s/{{monthword}}/$thisentrymonthword/gi; $currentdatehead =~ s/{{monthwordshort}}/$thisentrymonthwordshort/gi; $currentdatehead =~ s/{{weekdayupper}}/$thisentryweekdayupper/gi; $currentdatehead =~ s/{{monthwordupper}}/$thisentrymonthwordupper/gi; $currentdatehead =~ s/{{weekdaylower}}/$thisentryweekdaylower/gi; $currentdatehead =~ s/{{monthwordlower}}/$thisentrymonthwordlower/gi; $currentdatehead =~ s/{{weekdayuppershort}}/$thisentryweekdayuppershort/gi; $currentdatehead =~ s/{{monthworduppershort}}/$thisentrymonthworduppershort/gi; $currentdatehead =~ s/{{weekdaylowershort}}/$thisentryweekdaylowershort/gi; $currentdatehead =~ s/{{monthwordlowershort}}/$thisentrymonthwordlowershort/gi; # new {{dayappend}} variable: linear 9/15/2003 # merged in 1.3 $thisentrydayappend = Gm_Utils::toOrdinal($thisentryday); $currentdatehead =~ s/{{dayappend}}/$thisentrydayappend/gi; # merged 9/15/2003 if ($archiveformat eq Gm_Constants::WEEK) { unless ($thisentryweek ne $indexcurrentweekcounter) { $indexarchivebody .= $currentdatehead; # added $dategrouping flag : 1.3.1 # flipped cracker 6/29/2004 $dategrouping = Gm_Constants::OPEN; } } else { unless ($thisentrymonth ne $indexcurrentmonthcounter) { $indexarchivebody .= $currentdatehead; # added $dategrouping flag : 1.3.1 # flipped cracker 6/29/2004 $dategrouping = Gm_Constants::OPEN; } } } $indexcurrentdatemarker = "$thisentrymonth $thisentryday $thisentryyearyear"; } else { if ($archiveformat eq Gm_Constants::WEEK) { if (($thisentryopenstatus eq Gm_Constants::OPEN) && ($thisentryweek eq $indexcurrentweekcounter) && ($gmarchiveentryseparatortemplate ne Gm_Constants::EMPTY)) { $indexarchivebody .= $gmarchiveentryseparatortemplate; } } else { if (($thisentryopenstatus eq Gm_Constants::OPEN) && ($thisentrymonth eq $indexcurrentmonthcounter) && ($gmarchiveentryseparatortemplate ne Gm_Constants::EMPTY)) { $indexarchivebody .= $gmarchiveentryseparatortemplate; } } } if ($archiveformat eq Gm_Constants::WEEK) { if (($thisentryopenstatus eq Gm_Constants::OPEN) && ($thisentryweek eq $indexcurrentweekcounter)) { if ($thisentrymorebody ne Gm_Constants::EMPTY) { &gm_formatentry($gmmorearchiveentrytemplate); } else { &gm_formatentry($gmarchiveentrytemplate); } $indexarchivebody .= $entryreturn; } } else { if (($thisentryopenstatus eq Gm_Constants::OPEN) && ($thisentrymonth eq $indexcurrentmonthcounter)) { if ($thisentrymorebody ne Gm_Constants::EMPTY) { &gm_formatentry($gmmorearchiveentrytemplate); } else { &gm_formatentry($gmarchiveentrytemplate); } $indexarchivebody .= $entryreturn; } } # new date grouping footer template in 1.3: linear 9/18/2003 # merged in 1.3 if ($indexentrycounter > 1) { &gm_getentryvariables($indexentrycounter - 1); # look at the previous entry $nextdatemark = "$thisentrymonth $thisentryday $thisentryyearyear"; $nextentryopenstatus = $thisentryopenstatus; &gm_getentryvariables($indexentrycounter); # look at the current entry again if (($nextdatemark ne $indexcurrentdatemarker) && ($dategrouping eq Gm_Constants::OPEN) && ($thisentryopenstatus eq Gm_Constants::OPEN)) { if ($gmdategroupingfooterarchivetemplate ne Gm_Constants::EMPTY) { $currentdatefoot = $gmdategroupingfooterarchivetemplate; $currentdatefoot =~ s/{{day}}/$thisentryday/gi; $currentdatefoot =~ s/{{dayday}}/$thisentrydayday/gi; $currentdatefoot =~ s/{{year}}/$thisentryyear/gi; $currentdatefoot =~ s/{{yearyear}}/$thisentryyearyear/gi; $currentdatefoot =~ s/{{month}}/$thisentrymonth/gi; $currentdatefoot =~ s/{{monthmonth}}/$thisentrymonthmonth/gi; $currentdatefoot =~ s/{{weekday}}/$thisentryweekday/gi; $currentdatefoot =~ s/{{weekdayshort}}/$thisentryweekdayshort/gi; $currentdatefoot =~ s/{{monthword}}/$thisentrymonthword/gi; $currentdatefoot =~ s/{{monthwordshort}}/$thisentrymonthwordshort/gi; $currentdatefoot =~ s/{{weekdayupper}}/$thisentryweekdayupper/gi; $currentdatefoot =~ s/{{monthwordupper}}/$thisentrymonthwordupper/gi; $currentdatefoot =~ s/{{weekdaylower}}/$thisentryweekdaylower/gi; $currentdatefoot =~ s/{{monthwordlower}}/$thisentrymonthwordlower/gi; $currentdatefoot =~ s/{{weekdayuppershort}}/$thisentryweekdayuppershort/gi; $currentdatefoot =~ s/{{monthworduppershort}}/$thisentrymonthworduppershort/gi; $currentdatefoot =~ s/{{weekdaylowershort}}/$thisentryweekdaylowershort/gi; $currentdatefoot =~ s/{{monthwordlowershort}}/$thisentrymonthwordlowershort/gi; $thisentrydayappend = Gm_Utils::toOrdinal($thisentryday); $currentdatefoot =~ s/{{dayappend}}/$thisentrydayappend/gi; $indexarchivebody .= $currentdatefoot; $dategrouping = Gm_Constants::CLOSED; } } } $indexentrycounter--; if( $indexentrycounter eq "0" && $indexcurrentmonthcounter ne $thisentrymonth ){ $gmneedstogeneratefirstarchive=1; }; if( $indexentrycounter eq "0" && $archiveformat eq Gm_Constants::WEEK && $thisentryweek ne $indexcurrentweekcounter ){ $gmneedstogeneratefirstarchive=1; }; if ($archiveformat eq Gm_Constants::WEEK) { if ($thisentryweek ne $indexcurrentweekcounter) { $indexcurrentmonthcounter = "finis"; } else { $indexcurrentmonthcounter = $thisentrymonth; } } if ($indexentrycounter eq "0") { $indexcurrentmonthcounter = "finis"; } } until $thisentrymonth ne $indexcurrentmonthcounter; if ( ($gmdategroupingfooterarchivetemplate ne Gm_Constants::EMPTY) && ($dategrouping eq Gm_Constants::OPEN) ) { $currentdatefoot = $gmdategroupingfooterarchivetemplate; $currentdatefoot =~ s/{{day}}/$thisentryday/gi; $currentdatefoot =~ s/{{dayday}}/$thisentrydayday/gi; $currentdatefoot =~ s/{{year}}/$thisentryyear/gi; $currentdatefoot =~ s/{{yearyear}}/$thisentryyearyear/gi; $currentdatefoot =~ s/{{month}}/$thisentrymonth/gi; $currentdatefoot =~ s/{{monthmonth}}/$thisentrymonthmonth/gi; $currentdatefoot =~ s/{{weekday}}/$thisentryweekday/gi; $currentdatefoot =~ s/{{weekdayshort}}/$thisentryweekdayshort/gi; $currentdatefoot =~ s/{{monthword}}/$thisentrymonthword/gi; $currentdatefoot =~ s/{{monthwordshort}}/$thisentrymonthwordshort/gi; $currentdatefoot =~ s/{{weekdayupper}}/$thisentryweekdayupper/gi; $currentdatefoot =~ s/{{monthwordupper}}/$thisentrymonthwordupper/gi; $currentdatefoot =~ s/{{weekdaylower}}/$thisentryweekdaylower/gi; $currentdatefoot =~ s/{{monthwordlower}}/$thisentrymonthwordlower/gi; $currentdatefoot =~ s/{{weekdayuppershort}}/$thisentryweekdayuppershort/gi; $currentdatefoot =~ s/{{monthworduppershort}}/$thisentrymonthworduppershort/gi; $currentdatefoot =~ s/{{weekdaylowershort}}/$thisentryweekdaylowershort/gi; $currentdatefoot =~ s/{{monthwordlowershort}}/$thisentrymonthwordlowershort/gi; $thisentrydayappend = Gm_Utils::toOrdinal($thisentryday); $currentdatefoot =~ s/{{dayappend}}/$thisentrydayappend/gi; $indexarchivebody .= $currentdatefoot; $dategrouping = Gm_Constants::CLOSED; } $stoppednumber = $thisentrynumber; &gm_getentryvariables($startnumber); if ($archiveformat eq Gm_Constants::WEEK) { $usethisarchivefilename = "$EntriesPath/archive-$thisentryweekbeginningmonthmonth$thisentryweekbeginningdayday$thisentryweekbeginningyearyear-$thisentryweekendingmonthmonth$thisentryweekendingdayday$thisentryweekendingyearyear\.$logarchivesuffix"; } else { $usethisarchivefilename = "$EntriesPath/archive-$thisentrymonthmonth$thisentryyearyear\.$logarchivesuffix"; } $newarchivefile = $gmarchiveindextemplate; $newarchivefile =~ s/{{year}}/$thisentryyear/gi; $newarchivefile =~ s/{{yearyear}}/$thisentryyearyear/gi; $newarchivefile =~ s/{{month}}/$thisentrymonth/gi; $newarchivefile =~ s/{{monthmonth}}/$thisentrymonthmonth/gi; $newarchivefile =~ s/{{monthword}}/$thisentrymonthword/gi; $newarchivefile =~ s/{{monthwordshort}}/$thisentrymonthwordshort/gi; $newarchivefile =~ s/{{monthwordupper}}/$thisentrymonthwordupper/gi; $newarchivefile =~ s/{{monthwordlower}}/$thisentrymonthwordlower/gi; $newarchivefile =~ s/{{monthworduppershort}}/$thisentrymonthworduppershort/gi; $newarchivefile =~ s/{{monthwordlowershort}}/$thisentrymonthwordlowershort/gi; $newarchivefile =~ s/{{archivebody}}/$indexarchivebody/gi; $newarchivefile =~ s/{{logbody}}/$indexarchivebody/gi; &gm_formatentry($newarchivefile); ##if ($archiveformat eq Gm_Constants::WEEK) { ## $usethisarchivefilename = "$EntriesPath/archive-$thisentryweekbeginningmonthmonth$thisentryweekbeginningdayday$thisentryweekbeginningyearyear-$thisentryweekendingmonthmonth$thisentryweekendingdayday$thisentryweekendingyearyear\.$logarchivesuffix"; ##} else { ## $usethisarchivefilename = "$EntriesPath/archive-$thisentrymonthmonth$thisentryyearyear\.$logarchivesuffix"; ##} open (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."); print THISFILEPAWS $entryreturn; close (THISFILEPAWS); chmod (0666, "$usethisarchivefilename"); &Gm_Trace::Trace( level => 2, msg => "Leaving gm_generatearchive"); } # ----------------------- # rebuild connected files # ----------------------- sub gm_rebuildconnectedfiles { @connectedfilelist = split ('\\n', $otherfilelist); ## TODO: THESE SHOULD BE CONSTANTS @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}}"); &gm_getentryvariables($newentrynumber); $connectedfilesdone = Gm_Constants::NO; $connectstartfromhere = $IN{'connectednumber'}; if ($connectstartfromhere eq Gm_Constants::EMPTY) { $connectstartfromhere = 0; } $connectendhere = $connectstartfromhere + 9; if (($connectendhere > $#connectedfilelist) || ($connectendhere eq $#connectedfilelist)) { $connectendhere = $#connectedfilelist; $connectedfilesdone = Gm_Constants::YES; } $IN{'connectednumber'} = $connectendhere + 1; $connectcounter = 0; foreach $usethisfilename (@connectedfilelist) { unless (($connectcounter < $connectstartfromhere) || ($connectcounter > $connectendhere)) { $usethisfilenamestripped = $usethisfilename; $usethisfilenamestripped =~ s/\//BACKSLASH/g; $usethisfilenamestripped =~ s/\W//g; $usethisfilenamestripped =~ s/BACKSLASH/-/g; $thereisapattern = Gm_Constants::NO; 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."); @otherorigfilelines = <OTHERORIGFILE>; close (OTHERORIGFILE); ## couldn't use the < because it would freak out and not open file unless (!(open(CHECKTHISFILE,"$EntriesPath/$usethisfilenamestripped.cgi"))) { 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."); @otherpatternfilelines = <OTHERPATTERNFILE>; close (OTHERPATTERNFILE); $thereisapattern = Gm_Constants::YES; } close(CHECKTHISFILE); $gmcounter = 0; foreach (@otherorigfilelines) { chomp ($otherorigfilelines[$gmcounter]); $gmcounter++; } $otherorigfilebody = join ("|*|", @otherorigfilelines); foreach $thisvariablecheck (@variabledatabase) { if ($otherorigfilebody =~ m/$thisvariablecheck/i) { $thereisapattern = Gm_Constants::NO; } } unless ($thereisapattern eq Gm_Constants::NO) { $gmcounter = 0; foreach (@otherpatternfilelines) { chomp ($otherpatternfilelines[$gmcounter]); $gmcounter++; } $otherpatternfilebody = join ("|*|", @otherpatternfilelines); $otherfilebody = $otherpatternfilebody; } else { $otherfilebody = $otherorigfilebody; } $newfilebodypattern = $otherfilebody; &gm_formatentry($otherfilebody); $entryreturn =~ s/\|\*\|/\n/g; $newfilebodypattern =~ s/\|\*\|/\n/g; chmod (0666, "$usethisfilename"); 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."); print OTHERFILEONE $entryreturn; close (OTHERFILEONE); 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."); print OTHERFILETWO $newfilebodypattern; close (OTHERFILETWO); chmod (0666, "$EntriesPath/$usethisfilenamestripped.cgi"); } $connectcounter++; } } # ------------------------- # generate log archive list # ------------------------- # DEPRECATED: Gm_Core::generateArchiveLogList() sub gm_generatearchiveloglist { &gm_readcounter; ########################################################### # 9/3/2001 - CHERYL LAMBERT # Problem: If the last archived entry is a different month/year from the current month/year, the # {{calendar}} on the Archive Master Index page displays the month/year of the last archived # entry instead of the current month/year. For example, my last archived entry was 8/21/2001 # but the current date was 9/3/2001 when I discovered this problem. The {{calendar}} displayed # on the Archive Master Index page was for August 2001 not for September 2001. # The following section of code corrects this problem by getting the current date and using # the current date instead of the last archived date to create the {{calendar}} on the # Archive Master Index page. my ($tsec,$tmin,$thour,$tmday,$tmon,$tyear,$twday,$tyday,$tisdst) = localtime(time); $tmon += 1; $tyear += 1900; if (($tmon != $thisentrymonth) || ($tyear != $thisentryyearyear)) { $thisentrymonth = $tmon; $thisentryday = $tmday; $thisentryhour = $thour; $thisentryminute = $tmin; $thisentrysecond = $tsec; $thisentryweekdaynumber = $twday; $thisentryweekday = $weekdays[$twday]; $thisentrymonthword = $months[$thisentrymonth]; # $thisentrymonthmonth = sprintf ("%2d", $thisentrymonth); # $thisentrydayday = sprintf ("%2d", $thisentryday); # $thisentryhourhour = sprintf ("%2d", $thisentryhour); # $thisentryminuteminute = sprintf ("%2d", $thisentryminute); # $thisentrysecondsecond = sprintf ("%2d", $thisentrysecond); # $thisentrymonthmonth =~ tr/ /0/; # $thisentrydayday =~ tr/ /0/; # $thisentryhourhour =~ tr/ /0/; # $thisentryminuteminute =~ tr/ /0/; # $thisentrysecondsecond =~ tr/ /0/; $thisentrymonthmonth = Gm_Utils::toTwoDigit( $thisentrymonth ); $thisentrydayday = Gm_Utils::toTwoDigit( $thisentryday ); $thisentryhourhour = Gm_Utils::toTwoDigit( $thisentryhour ); $thisentryminuteminute = Gm_Utils::toTwoDigit( $thisentryminute ); $thisentrysecondsecond = Gm_Utils::toTwoDigit( $thisentrysecond ); } ########################################################### my $gmentrylist = Gm_Storage::getEntrylist( errHandler=>\&Gm_Web::displayAdminErrorExit ); $listcountmonthyear = 'begin'; $listcountweek = 'begin'; $logarchivelistfinal = Gm_Constants::EMPTY; foreach my $entry ( sort { $gmentrylist->{$b}{'id'} <=> $gmentrylist->{$a}{'id'} } keys( %$gmentrylist ) ) { $loglistnumber = $gmentrylist->{$entry}{'id'}; $loglistauthor = $gmentrylist->{$entry}{'author'}; $loglistsubject = $gmentrylist->{$entry}{'subject'}; $loglistdate = $gmentrylist->{$entry}{'created'}; $loglisttimeampm = $gmentrylist->{$entry}{'createt'}; $loglistopenstatus = $gmentrylist->{$entry}{'status'}; $loglistmorestatus = $gmentrylist->{$entry}{'extended'}; &gm_getloglistvariables; unless ($loglistopenstatus eq "C") { $thisloglistmonthyear = "$loglistmonthmonth $loglistyearyear"; $thisloglistweek = "$loglistweekbeginningdayday$loglistweekendingdayday"; if ($archiveformat eq Gm_Constants::WEEK) { if ($thisloglistweek ne $listcountweek) { $listsubsub = $gmlogarchiveslinkweeklytemplate; &entrylistsubsub; $listsubsub .= "|*|"; $logarchivelistfinal .= $listsubsub; $listcountweek = $thisloglistweek; } } else { if ($thisloglistmonthyear ne $listcountmonthyear) { $listsubsub = $gmlogarchiveslinktemplate; &entrylistsubsub; $listsubsub .= "|*|"; $logarchivelistfinal .= $listsubsub; $listcountmonthyear = $thisloglistmonthyear; } } } } @loglistfinalcollection = split (/\|\*\|/, $logarchivelistfinal); if ($entrylistsortorder eq Gm_Constants::DESCENDING) { @loglistfinalcollection = reverse @loglistfinalcollection; } $logarchivelistfinal = join ("$gmlogarchiveslinkseparatortemplate", @loglistfinalcollection); } # ----------------------- # generate log entry list # ----------------------- # DEPRECATED BY: Gm_Core::generateEntryLogList sub gm_generateentryloglist { $logshortentrylistfinal = Gm_Constants::EMPTY; $logmoreentrylistfinal = Gm_Constants::EMPTY; $logentrylistfinal = Gm_Constants::EMPTY; $logshortentrylistmonthfinal = Gm_Constants::EMPTY; $logshortentrylistdayfinal = Gm_Constants::EMPTY; $logshortentrylistyearfinal = Gm_Constants::EMPTY; $logmoreentrylistmonthfinal = Gm_Constants::EMPTY; $logmoreentrylistdayfinal = Gm_Constants::EMPTY; $logmoreentrylistyearfinal = Gm_Constants::EMPTY; $logentrylistmonthfinal = Gm_Constants::EMPTY; $logentrylistdayfinal = Gm_Constants::EMPTY; $logentrylistyearfinal = Gm_Constants::EMPTY; $logshortentrylistnumberfinal = Gm_Constants::EMPTY; $logmoreentrylistnumberfinal = Gm_Constants::EMPTY; $logentrylistnumberfinal = Gm_Constants::EMPTY; $logshortentrylistfirsthalffinal = Gm_Constants::EMPTY; $logshortentrylistsecondhalffinal = Gm_Constants::EMPTY; $logmoreentrylistfirsthalffinal = Gm_Constants::EMPTY; $logmoreentrylistsecondhalffinal = Gm_Constants::EMPTY; $logentrylistfirsthalffinal = Gm_Constants::EMPTY; $logentrylistsecondhalffinal = Gm_Constants::EMPTY; my $gmentrylist = Gm_Storage::getEntrylist( errHandler=>\&Gm_Web::displayAdminErrorExit ); my @gmsortkeys = keys( %$gmentrylist ); @gmsortkeys = sort { lc($gmentrylist->{$b}{'id'}) <=> lc($gmentrylist->{$a}{'id'}); } @gmsortkeys; # If the order is descending change the order if ($entrylistsortorder eq Gm_Constants::DESCENDING) { @gmsortkeys = reverse @gmsortkeys; } $toploglistnumber = $gmentrylist->{$gmsortkeys[0]}{'id'}; $toploglistauthor = $gmentrylist->{$gmsortkeys[0]}{'author'}; $toploglistsubject = $gmentrylist->{$gmsortkeys[0]}{'subject'}; $toploglistdate = $gmentrylist->{$gmsortkeys[0]}{'created'}; $toploglisttimeampm = $gmentrylist->{$gmsortkeys[0]}{'createt'}; $toploglistopenstatus = $gmentrylist->{$gmsortkeys[0]}{'status'}; $toploglistmorestatus = $gmentrylist->{$gmsortkeys[0]}{'extended'}; ($toploglistmonthmonth, $toploglistdayday, $toploglistyear) = split (/\//, $toploglistdate); $shortentrycounter = 0; $moreentrycounter = 0; $allentrycounter = 0; $shorttotalentrycounter = 0; $moretotalentrycounter = 0; $alltotalentrycounter = 0; foreach my $elkey (@gmsortkeys) { $loglistcounternumber = $gmentrylist->{$elkey}{'id'}; $loglistcounterauthor = $gmentrylist->{$elkey}{'author'}; $loglistcountersubject = $gmentrylist->{$elkey}{'subject'}; $loglistcounterdate = $gmentrylist->{$elkey}{'created'}; $loglistcountertimeampm = $gmentrylist->{$elkey}{'createt'}; $loglistcounteropenstatus = $gmentrylist->{$elkey}{'status'}; $loglistcountermorestatus = $gmentrylist->{$elkey}{'extended'}; unless ($loglistcounteropenstatus eq 'C') { $alltotalentrycounter++; if ($loglistcountermorestatus eq 'Y') { $moretotalentrycounter++; } else { $shorttotalentrycounter++; } } } # $shorttotalentryhalfcounter = sprintf("%.0f", ($shorttotalentrycounter / 2)); # $moretotalentryhalfcounter = sprintf("%.0f", ($moretotalentrycounter / 2)); # $alltotalentryhalfcounter = sprintf("%.0f", ($alltotalentrycounter / 2)); $shorttotalentryhalfcounter = Gm_Utils::toNoDec( ($shorttotalentrycounter / 2)); $moretotalentryhalfcounter = Gm_Utils::toNoDec( ($moretotalentrycounter / 2)); $alltotalentryhalfcounter = Gm_Utils::toNoDec( ($alltotalentrycounter / 2)); $listdaymarker = "tommy"; $listmonthmarker = "tommy"; $listyearmarker = "tommy"; foreach my $elkey (@gmsortkeys) { $loglistnumber = $gmentrylist->{$elkey}{'id'}; $loglistauthor = $gmentrylist->{$elkey}{'author'}; $loglistsubject = $gmentrylist->{$elkey}{'subject'}; $loglistdate = $gmentrylist->{$elkey}{'created'}; $loglisttimeampm = $gmentrylist->{$elkey}{'createt'}; $loglistopenstatus = $gmentrylist->{$elkey}{'status'}; $loglistmorestatus = $gmentrylist->{$elkey}{'extended'}; unless ($loglistopenstatus eq "C") { &gm_getloglistvariables; $usethismorelinktemplate = $gmmoreentrypagelinktemplate; $usethislinktemplate = $gmentrypagelinktemplate; if (($gmentrypagelinkdayseparatortemplate ne Gm_Constants::EMPTY) && ($listdaymarker ne $loglistday)) { $usethismorelinktemplate = "$gmentrypagelinkdayseparatortemplate|*|$usethismorelinktemplate"; $usethislinktemplate = "$gmentrypagelinkdayseparatortemplate|*|$usethislinktemplate"; } if (($gmentrypagelinkmonthseparatortemplate ne Gm_Constants::EMPTY) && ($listmonthmarker ne $loglistmonth)) { $usethismorelinktemplate = "$gmentrypagelinkmonthseparatortemplate|*|$usethismorelinktemplate"; $usethislinktemplate = "$gmentrypagelinkmonthseparatortemplate|*|$usethislinktemplate"; } if (($gmentrypagelinkyearseparatortemplate ne Gm_Constants::EMPTY) && ($listyearmarker ne $loglistyear)) { $usethismorelinktemplate = "$gmentrypagelinkyearseparatortemplate|*|$usethismorelinktemplate"; $usethislinktemplate = "$gmentrypagelinkyearseparatortemplate|*|$usethislinktemplate"; } if ($loglistmorestatus eq 'Y') { $moreentrycounter++; $listsubsub = $usethismorelinktemplate; &entrylistsubsub; $listsubsub .= "|*|"; $logmoreentrylistfinal .= $listsubsub; if ($loglistmonthmonth eq $toploglistmonthmonth) { $logmoreentrylistmonthfinal .= $listsubsub; } if ($loglistdayday eq $toploglistdayday) { $logmoreentrylistdayfinal .= $listsubsub; } if ($loglistyear eq $toploglistyear) { $logmoreentrylistyearfinal .= $listsubsub; } unless ($moreentrycounter > $entrylistcountnumber) { $logmoreentrylistnumberfinal .= $listsubsub; } if ($moreentrycounter <= $moretotalentryhalfcounter) { $logmoreentrylistfirsthalffinal .= $listsubsub; } else { $logmoreentrylistsecondhalffinal .= $listsubsub; } } else { $shortentrycounter++; $listsubsub = $usethislinktemplate; &entrylistsubsub; $listsubsub .= "|*|"; $logshortentrylistfinal .= $listsubsub; if ($loglistmonthmonth eq $toploglistmonthmonth) { $logshortentrylistmonthfinal .= $listsubsub; } if ($loglistdayday eq $toploglistdayday) { $logshortentrylistdayfinal .= $listsubsub; } if ($loglistyear eq $toploglistyear) { $logshortentrylistyearfinal .= $listsubsub; } unless ($shortentrycounter > $entrylistcountnumber) { $logshortentrylistnumberfinal .= $listsubsub; } if ($shortentrycounter <= $shorttotalentryhalfcounter) { $logshortentrylistfirsthalffinal .= $listsubsub; } else { $logshortentrylistsecondhalffinal .= $listsubsub; } } $allentrycounter++; $logentrylistfinal .= $listsubsub; if ($loglistmonthmonth eq $toploglistmonthmonth) { $logentrylistmonthfinal .= $listsubsub; } if ($loglistdayday eq $toploglistdayday) { $logentrylistdayfinal .= $listsubsub; } if ($loglistyear eq $toploglistyear) { $logentrylistyearfinal .= $listsubsub; } unless ($allentrycounter > $entrylistcountnumber) { $logentrylistnumberfinal .= $listsubsub; } if ($allentrycounter <= $alltotalentryhalfcounter) { $logentrylistfirsthalffinal .= $listsubsub; } else { $logentrylistsecondhalffinal .= $listsubsub; } $listdaymarker = $loglistday; $listmonthmarker = $loglistmonth; $listyearmarker = $loglistyear; } } @logshortentrylistfinalcollection = split (/\|\*\|/, $logshortentrylistfinal); @logmoreentrylistfinalcollection = split (/\|\*\|/, $logmoreentrylistfinal); @logentrylistfinalcollection = split (/\|\*\|/, $logentrylistfinal); @logshortentrylistmonthfinalcollection = split (/\|\*\|/, $logshortentrylistmonthfinal); @logshortentrylistdayfinalcollection = split (/\|\*\|/, $logshortentrylistdayfinal); @logshortentrylistyearfinalcollection = split (/\|\*\|/, $logshortentrylistyearfinal); @logmoreentrylistmonthfinalcollection = split (/\|\*\|/, $logmoreentrylistmonthfinal); @logmoreentrylistdayfinalcollection = split (/\|\*\|/, $logmoreentrylistdayfinal); @logmoreentrylistyearfinalcollection = split (/\|\*\|/, $logmoreentrylistyearfinal); @logentrylistmonthfinalcollection = split (/\|\*\|/, $logentrylistmonthfinal); @logentrylistdayfinalcollection = split (/\|\*\|/, $logentrylistdayfinal); @logentrylistyearfinalcollection = split (/\|\*\|/, $logentrylistyearfinal); @logshortentrylistnumberfinalcollection = split (/\|\*\|/, $logshortentrylistnumberfinal); @logmoreentrylistnumberfinalcollection = split (/\|\*\|/, $logmoreentrylistnumberfinal); @logentrylistnumberfinalcollection = split (/\|\*\|/, $logentrylistnumberfinal); @logshortentrylistfirsthalffinalcollection = split (/\|\*\|/, $logshortentrylistfirsthalffinal); @logshortentrylistsecondhalffinalcollection = split (/\|\*\|/, $logshortentrylistsecondhalffinal); @logmoreentrylistfirsthalffinalcollection = split (/\|\*\|/, $logmoreentrylistfirsthalffinal); @logmoreentrylistsecondhalffinalcollection = split (/\|\*\|/, $logmoreentrylistsecondhalffinal); @logentrylistfirsthalffinalcollection = split (/\|\*\|/, $logentrylistfirsthalffinal); @logentrylistsecondhalffinalcollection = split (/\|\*\|/, $logentrylistsecondhalffinal); $logshortentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logshortentrylistfinalcollection); $logmoreentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logmoreentrylistfinalcollection); $logentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logentrylistfinalcollection); $logshortentrylistmonthfinal = join ("$gmentrypagelinkseparatortemplate", @logshortentrylistmonthfinalcollection); $logshortentrylistdayfinal = join ("$gmentrypagelinkseparatortemplate", @logshortentrylistdayfinalcollection); $logshortentrylistyearfinal = join ("$gmentrypagelinkseparatortemplate", @logshortentrylistyearfinalcollection); $logmoreentrylistmonthfinal = join ("$gmentrypagelinkseparatortemplate", @logmoreentrylistmonthfinalcollection); $logmoreentrylistdayfinal = join ("$gmentrypagelinkseparatortemplate", @logmoreentrylistdayfinalcollection); $logmoreentrylistyearfinal = join ("$gmentrypagelinkseparatortemplate", @logmoreentrylistyearfinalcollection); $logentrylistmonthfinal = join ("$gmentrypagelinkseparatortemplate", @logentrylistmonthfinalcollection); $logentrylistdayfinal = join ("$gmentrypagelinkseparatortemplate", @logentrylistdayfinalcollection); $logentrylistyearfinal = join ("$gmentrypagelinkseparatortemplate", @logentrylistyearfinalcollection); $logshortentrylistnumberfinal = join ("$gmentrypagelinkseparatortemplate", @logshortentrylistnumberfinalcollection); $logmoreentrylistnumberfinal = join ("$gmentrypagelinkseparatortemplate", @logmoreentrylistnumberfinalcollection); $logentrylistnumberfinal = join ("$gmentrypagelinkseparatortemplate", @logentrylistnumberfinalcollection); $logshortentrylistfirsthalffinal = join ("$gmentrypagelinkseparatortemplate", @logshortentrylistfirsthalffinalcollection); $logshortentrylistsecondhalffinal = join ("$gmentrypagelinkseparatortemplate", @logshortentrylistsecondhalffinalcollection); $logmoreentrylistfirsthalffinal = join ("$gmentrypagelinkseparatortemplate", @logmoreentrylistfirsthalffinalcollection); $logmoreentrylistsecondhalffinal = join ("$gmentrypagelinkseparatortemplate", @logmoreentrylistsecondhalffinalcollection); $logentrylistfirsthalffinal = join ("$gmentrypagelinkseparatortemplate", @logentrylistfirsthalffinalcollection); $logentrylistsecondhalffinal = join ("$gmentrypagelinkseparatortemplate", @logentrylistsecondhalffinalcollection); } # ---------------------------------------------- # generate log entry list for individual authors # ---------------------------------------------- # DEPRECATED BY: Gm_Core::generateEntryLogListAuthor sub gm_generateentryloglistauthor { $logshortentrylistfinal = Gm_Constants::EMPTY; $logmoreentrylistfinal = Gm_Constants::EMPTY; $logentrylistfinal = Gm_Constants::EMPTY; my $gmentrylist = Gm_Storage::getEntrylist( errHandler=>\&Gm_Web::displayAdminErrorExit ); my @gmsortkeys = keys( %$gmentrylist ); @gmsortkeys = sort { lc($gmentrylist->{$b}{'id'}) <=> lc($gmentrylist->{$a}{'id'}); } @gmsortkeys; # If the order is descending change the order if ($entrylistsortorder eq Gm_Constants::DESCENDING) { @gmsortkeys = reverse @gmsortkeys; } $toploglistnumber = $gmentrylist->{$gmsortkeys[0]}{'id'}; $toploglistauthor = $gmentrylist->{$gmsortkeys[0]}{'author'}; $toploglistsubject = $gmentrylist->{$gmsortkeys[0]}{'subject'}; $toploglistdate = $gmentrylist->{$gmsortkeys[0]}{'created'}; $toploglisttimeampm = $gmentrylist->{$gmsortkeys[0]}{'createt'}; $toploglistopenstatus = $gmentrylist->{$gmsortkeys[0]}{'status'}; $toploglistmorestatus = $gmentrylist->{$gmsortkeys[0]}{'extended'}; ($toploglistmonthmonth, $toploglistdayday, $toploglistyear) = split (/\//, $toploglistdate); $shortentrycounter = 0; $moreentrycounter = 0; $allentrycounter = 0; $listdaymarker = "tommy"; $listmonthmarker = "tommy"; $listyearmarker = "tommy"; foreach my $elkey (@gmsortkeys) { $loglistnumber = $gmentrylist->{$elkey}{'id'}; $loglistauthor = $gmentrylist->{$elkey}{'author'}; $loglistsubject = $gmentrylist->{$elkey}{'subject'}; $loglistdate = $gmentrylist->{$elkey}{'created'}; $loglisttimeampm = $gmentrylist->{$elkey}{'createt'}; $loglistopenstatus = $gmentrylist->{$elkey}{'status'}; $loglistmorestatus = $gmentrylist->{$elkey}{'extended'}; ## TODO THISENTRYLOGLISTAUTHOR SHOULD BE PASSED IN, NOT A GLOBAL VAR unless (($loglistopenstatus eq "C") || ($thisentryloglistauthor ne $loglistauthor)) { &gm_getloglistvariables; $usethismorelinktemplate = $gmmoreentrypagelinktemplate; $usethislinktemplate = $gmentrypagelinktemplate; if (($gmentrypagelinkdayseparatortemplate ne Gm_Constants::EMPTY) && ($listdaymarker ne $loglistday)) { $usethismorelinktemplate = "$gmentrypagelinkdayseparatortemplate|*|$usethismorelinktemplate"; $usethislinktemplate = "$gmentrypagelinkdayseparatortemplate|*|$usethislinktemplate"; } if (($gmentrypagelinkmonthseparatortemplate ne Gm_Constants::EMPTY) && ($listmonthmarker ne $loglistmonth)) { $usethismorelinktemplate = "$gmentrypagelinkmonthseparatortemplate|*|$usethismorelinktemplate"; $usethislinktemplate = "$gmentrypagelinkmonthseparatortemplate|*|$usethislinktemplate"; } if (($gmentrypagelinkyearseparatortemplate ne Gm_Constants::EMPTY) && ($listyearmarker ne $loglistyear)) { $usethismorelinktemplate = "$gmentrypagelinkyearseparatortemplate|*|$usethismorelinktemplate"; $usethislinktemplate = "$gmentrypagelinkyearseparatortemplate|*|$usethislinktemplate"; } if ($loglistmorestatus eq 'Y') { $moreentrycounter++; $listsubsub = $usethismorelinktemplate; &entrylistsubsub; $listsubsub .= "|*|"; $logmoreentrylistfinal .= $listsubsub; } else { $shortentrycounter++; $listsubsub = $usethislinktemplate; &entrylistsubsub; $listsubsub .= "|*|"; $logshortentrylistfinal .= $listsubsub; } $allentrycounter++; $logentrylistfinal .= $listsubsub; $listdaymarker = $loglistday; $listmonthmarker = $loglistmonth; $listyearmarker = $loglistyear; } } @logshortentrylistfinalcollection = split (/\|\*\|/, $logshortentrylistfinal); @logmoreentrylistfinalcollection = split (/\|\*\|/, $logmoreentrylistfinal); @logentrylistfinalcollection = split (/\|\*\|/, $logentrylistfinal); $logshortentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logshortentrylistfinalcollection); $logmoreentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logmoreentrylistfinalcollection); $logentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logentrylistfinalcollection); } # ------------------------------------------- # generate log entry list for comment sorting # ------------------------------------------- # DEPRECATED BY: Gm_Core::generateEntryLogListComments sub gm_generateentryloglistcomments { $logshortentrylistfinal = Gm_Constants::EMPTY; $logmoreentrylistfinal = Gm_Constants::EMPTY; $logentrylistfinal = Gm_Constants::EMPTY; $logshortminimumentrylistfinal = Gm_Constants::EMPTY; $logmoreminimumentrylistfinal = Gm_Constants::EMPTY; $logminimumentrylistfinal = Gm_Constants::EMPTY; $logshortnumberentrylistfinal = Gm_Constants::EMPTY; $logmorenumberentrylistfinal = Gm_Constants::EMPTY; $lognumberentrylistfinal = Gm_Constants::EMPTY; $countfromhere = 1; do { # $countfromherenumberpadded = sprintf ("%8d", $countfromhere); # $countfromherenumberpadded =~ tr/ /0/; $countfromherenumberpadded = Gm_Utils::toEntryPadded( $countfromhere ); 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."); @countfromhereentrylines = <FUNNYFEETCOMMIE>; close (FUNNYFEETCOMMIE); chomp ($countfromhereentrylines[0]); ($countfromhereentrynumber, $countfromhereentryauthor, $countfromhereentrysubject, $countfromhereentryweekdaynumber, $countfromhereentrymonth, $countfromhereentryday, $countfromhereentryyearyear, $countfromhereentryhour, $countfromhereentryminute, $countfromhereentrysecond, $countfromhereentryampm, $countfromhereentrypositivekarma, $countfromhereentrynegativekarma, $countfromhereentrycommentsnumber, $countfromhereentryallowkarma, $countfromhereentryallowcomments, $countfromhereentryopenstatus, $countfromhereentrymusic, $countfromhereentrymood, $countfromhereentryemoticonsallowed) = split (/\|/, $countfromhereentrylines[0]); $countfromcanpost = 'Y'; if ($countfromhereentryallowcomments eq Gm_Constants::NO) { $countfromcanpost = 'N'; } if (($posttoarchives eq Gm_Constants::NO) && ($countfromhereentrynumber <= $newarchivenumber)) { $countfromcanpost = 'N'; } unless ($countfromhereentryopenstatus eq Gm_Constants::CLOSED) { $countslot = $countfromhere - 1; $countfromherelist[$countslot] = "$countfromhereentrycommentsnumber|$countfromhereentrynumber|$countfromcanpost"; } $countfromhere++; } until $countfromhere > $newentrynumber; sub numerically { $a <=> $b } @countfromherelist = sort numerically @countfromherelist; unless ($entrylistsortorder eq Gm_Constants::DESCENDING) { @countfromherelist = reverse @countfromherelist; } # trim this list before we loop over it @countfromherelisttrimmed = @countfromherelist[0..$entrylistcountnumber-1]; my $gmentrylist = Gm_Storage::getEntrylist( errHandler=>\&Gm_Web::displayAdminErrorExit ); $shortentrycounter = 0; $moreentrycounter = 0; $allentrycounter = 0; $listdaymarker = "tommy"; $listmonthmarker = "tommy"; $listyearmarker = "tommy"; foreach $countfromhereline (@countfromherelist) { ($countfromherecommentsnumber, $countfromhereentrynumber, $countfromherecanpost) = split (/\|/, $countfromhereline); SCAN: foreach my $entry ( sort { $gmentrylist->{$b}{'id'} <=> $gmentrylist->{$a}{'id'} } keys( %$gmentrylist ) ) { $loglistnumber = $gmentrylist->{$entry}{'id'}; $loglistauthor = $gmentrylist->{$entry}{'author'}; $loglistsubject = $gmentrylist->{$entry}{'subject'}; $loglistdate = $gmentrylist->{$entry}{'created'}; $loglisttimeampm = $gmentrylist->{$entry}{'createt'}; $loglistopenstatus = $gmentrylist->{$entry}{'status'}; $loglistmorestatus = $gmentrylist->{$entry}{'extended'}; if ($loglistnumber eq $countfromhereentrynumber) { unless (($countfromherecanpost eq 'N') && ($commententrylistonlyifokay eq Gm_Constants::YES)) { &gm_getloglistvariables; $usethismorelinktemplate = $gmmoreentrypagelinktemplate; $usethislinktemplate = $gmentrypagelinktemplate; if (($gmentrypagelinkdayseparatortemplate ne Gm_Constants::EMPTY) && ($listdaymarker ne $loglistday)) { $usethismorelinktemplate = "$gmentrypagelinkdayseparatortemplate|*|$usethismorelinktemplate"; $usethislinktemplate = "$gmentrypagelinkdayseparatortemplate|*|$usethislinktemplate"; } if (($gmentrypagelinkmonthseparatortemplate ne Gm_Constants::EMPTY) && ($listmonthmarker ne $loglistmonth)) { $usethismorelinktemplate = "$gmentrypagelinkmonthseparatortemplate|*|$usethismorelinktemplate"; $usethislinktemplate = "$gmentrypagelinkmonthseparatortemplate|*|$usethislinktemplate"; } if (($gmentrypagelinkyearseparatortemplate ne Gm_Constants::EMPTY) && ($listyearmarker ne $loglistyear)) { $usethismorelinktemplate = "$gmentrypagelinkyearseparatortemplate|*|$usethismorelinktemplate"; $usethislinktemplate = "$gmentrypagelinkyearseparatortemplate|*|$usethislinktemplate"; } if ($loglistmorestatus eq 'Y') { $moreentrycounter++; $listsubsub = $usethismorelinktemplate; &entrylistsubsub; $listsubsub .= "|*|"; $logmoreentrylistfinal .= $listsubsub; unless ($countfromherecommentsnumber < 1) { $logmoreminimumentrylistfinal .= $listsubsub; } unless ($moreentrycounter > $entrylistcountnumber) { $logmorenumberentrylistfinal .= $listsubsub; } } else { $shortentrycounter++; $listsubsub = $usethislinktemplate; &entrylistsubsub; $listsubsub .= "|*|"; $logshortentrylistfinal .= $listsubsub; unless ($countfromherecommentsnumber < 1) { $logshortminimumentrylistfinal .= $listsubsub; } unless ($shortentrycounter > $entrylistcountnumber) { $logshortnumberentrylistfinal .= $listsubsub; } } $allentrycounter++; $logentrylistfinal .= $listsubsub; unless ($countfromherecommentsnumber < 1) { $logminimumentrylistfinal .= $listsubsub; } unless ($allentrycounter > $entrylistcountnumber) { $lognumberentrylistfinal .= $listsubsub; } $listdaymarker = $loglistday; $listmonthmarker = $loglistmonth; $listyearmarker = $loglistyear; # we found a match, let's bail last SCAN; } } } } @logshortentrylistfinalcollection = split (/\|\*\|/, $logshortentrylistfinal); @logmoreentrylistfinalcollection = split (/\|\*\|/, $logmoreentrylistfinal); @logentrylistfinalcollection = split (/\|\*\|/, $logentrylistfinal); @logshortminimumentrylistfinalcollection = split (/\|\*\|/, $logshortminimumentrylistfinal); @logmoreminimumentrylistfinalcollection = split (/\|\*\|/, $logmoreminimumentrylistfinal); @logminimumentrylistfinalcollection = split (/\|\*\|/, $logminimumentrylistfinal); @logshortnumberentrylistfinalcollection = split (/\|\*\|/, $logshortnumberentrylistfinal); @logmorenumberentrylistfinalcollection = split (/\|\*\|/, $logmorenumberentrylistfinal); @lognumberentrylistfinalcollection = split (/\|\*\|/, $lognumberentrylistfinal); $logshortentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logshortentrylistfinalcollection); $logmoreentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logmoreentrylistfinalcollection); $logentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logentrylistfinalcollection); $logshortminimumentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logshortminimumentrylistfinalcollection); $logmoreminimumentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logmoreminimumentrylistfinalcollection); $logminimumentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logminimumentrylistfinalcollection); $logshortnumberentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logshortnumberentrylistfinalcollection); $logmorenumberentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @logmorenumberentrylistfinalcollection); $lognumberentrylistfinal = join ("$gmentrypagelinkseparatortemplate", @lognumberentrylistfinalcollection); } # ---------------------- # get log list variables # ---------------------- # DEPRECATED by Gm_Core::getArchiveVariables sub gm_getloglistvariables { # $loglistnumberpadded = sprintf ("%8d", $loglistnumber); # $loglistnumberpadded =~ tr/ /0/; $loglistnumberpadded = Gm_Utils::toEntryPadded( $loglistnumber ); ($loglistmonthmonth, $loglistdayday, $loglistyear) = split (/\//, $loglistdate); if ((substr($loglistmonthmonth, 0, 1)) eq "0") { $loglistmonth = substr($loglistmonthmonth, -1, 1); } else { $loglistmonth = $loglistmonthmonth; } if ((substr($loglistdayday, 0, 1)) eq "0") { $loglistday = substr($loglistdayday, -1, 1); } else { $loglistday = $loglistdayday; } if ($loglistyear > 80) { $loglistyearyear = "19$loglistyear"; } else { $loglistyearyear = "20$loglistyear"; } ($loglisttime, $loglistampm) = split (/ /, $loglisttimeampm); ($loglisthourhour, $loglistminuteminute) = split (/:/, $loglisttime); if ((substr($loglisthourhour, 0, 1)) eq "0") { $loglisthour = substr($loglisthourhour, -1, 1); } else { $loglisthour = $loglisthourhour; } if ((substr($loglistminuteminute, 0, 1)) eq "0") { $loglistminute = substr($loglistminuteminute, -1, 1); } else { $loglistminute = $loglistminuteminute; } $loglistmilitaryhour = $loglisthour; if ($loglistampm eq "AM") { $loglistampmdot = "A.M."; $loglistampmlower = "am"; $loglistampmdotlower = "a.m."; } else { $loglistampmdot = "P.M."; $loglistampmlower = "pm"; $loglistampmdotlower = "p.m."; $loglistmilitaryhour = $loglistmilitaryhour + 12; } # $loglistmilitaryhour = sprintf ("%2d", $loglistmilitaryhour); # $loglistmilitaryhour =~ tr/ /0/; $loglistmilitaryhour = Gm_Utils::toTwoDigit( $loglistmilitaryhour ); @months = ("null", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); $loglistmonthword = $months[$loglistmonth]; $loglistmonthwordshort = substr($loglistmonthword, 0, 3); $loglistmonthwordupper = uc($loglistmonthword); $loglistmonthwordlower = lc($loglistmonthword); $loglistmonthworduppershort = uc($loglistmonthwordshort); $loglistmonthwordlowershort = lc($loglistmonthwordshort); open (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."); @loglistentrylines = <FUNNYFEETLOGME>; close (FUNNYFEETLOGME); $gmcounter = 0; foreach (@loglistentrylines) { chomp ($loglistentrylines[$gmcounter]); $gmcounter++; } ($loglistentrynumber, $loglistentryauthor, $loglistentrysubject, $loglistentryweekdaynumber, $loglistentrymonth, $loglistentryday, $loglistentryyearyear, $loglistentryhour, $loglistentryminute, $loglistentrysecond, $loglistentryampm, $loglistentrypositivekarma, $loglistentrynegativekarma, $loglistentrycommentsnumber, $loglistentryallowkarma, $loglistentryallowcomments, $loglistentryopenstatus, $loglistentrymusic, $loglistentrymood, $loglistentryemoticonsallowed) = split (/\|/, $loglistentrylines[0]); $loglistentrytotalkarma = $loglistentrypositivekarma - $loglistentrynegativekarma; $loglistentrypositivekarmalink = "$cgiwebpath/gm-karma.cgi?vote=positive&entry=$loglistnumberpadded"; $loglistentrynegativekarmalink = "$cgiwebpath/gm-karma.cgi?vote=negative&entry=$loglistnumberpadded"; my $gmauthors = Gm_Storage::getAuthors( errHandler=>\&Gm_Web::displayAdminErrorExit ); $loglistentryauthoremail = Gm_Constants::EMPTY; $loglistentryauthorhomepage = Gm_Constants::EMPTY; $loglistentryauthorentrycount = Gm_Constants::EMPTY; if( exists( $gmauthors->{$thisentryauthor} )){ $selectedauthor = $gmauthors->{$thisentryauthor}; $loglistentryauthoremail = $selectedauthor->{'email'}; $loglistentryauthorhomepage = $selectedauthor->{'homepage'}; $loglistentryauthorentrycount = $selectedauthor->{'posttotal'}; } $loglistentryauthorsmartlink = $loglistentryauthor; if ($loglistentryauthoremail ne Gm_Constants::EMPTY) { $loglistentryauthorsmartlink = "<A HREF=\"mailto:$loglistentryauthoremail\">$loglistentryauthor</A>"; } if ($loglistentryauthorhomepage ne Gm_Constants::EMPTY) { $loglistentryauthorsmartlink = "<A HREF=\"$loglistentryauthorhomepage\">$loglistentryauthor</A>"; } $loglistentryfilename = "$EntriesWebPath\/$loglistnumberpadded\.$entrysuffix"; $loglistentrycommentspostlink = "$loglistentryfilename\#comments"; $loglistentrycommentstatussmart = $gmsmartlinkmanycommentstemplate; if ($loglistentrycommentsnumber eq "0") { $loglistentrycommentstatussmart = $gmsmartlinknocommentstemplate; } if ($loglistentrycommentsnumber eq "1") { $loglistentrycommentstatussmart = $gmsmartlinkonecommenttemplate; } $loglistentrycommentstatussmartupper = uc($loglistentrycommentstatussmart); $loglistentrycommentstatussmartlower = lc($loglistentrycommentstatussmart); $leapyearcheck = $loglistyearyear % 4; $loglistmaxdaysinthismonth = 31; if (($loglistmonthword eq "September") || ($loglistmonthword eq "April") || ($loglistmonthword eq "June") || ($loglistmonthword eq "November")) { $loglistmaxdaysinthismonth = 30; } if ($loglistmonthword eq "February") { $loglistmaxdaysinthismonth = 28; if ($leapyearcheck eq "0") { $loglistmaxdaysinthismonth = 29; } } $loglistmaxdaysinpreviousmonth = 31; if (($loglistmonthword eq "October") || ($loglistmonthword eq "May") || ($loglistmonthword eq "July") || ($loglistmonthword eq "December")) { $loglistmaxdaysinpreviousmonth = 30; } if ($loglistmonthword eq "March") { $loglistmaxdaysinpreviousmonth = 28; if ($leapyearcheck eq "0") { $loglistmaxdaysinpreviousmonth = 29; } } $loglistweekbeginningmonth = $loglistmonth; $loglistweekbeginningyearyear = $loglistyearyear; $loglistweekendingmonth = $loglistmonth; $loglistweekendingyearyear = $loglistyearyear; $loglistweekbeginningday = $loglistday - $loglistentryweekdaynumber; $loglistweekendingday = $loglistweekbeginningday + 6; if ($loglistweekbeginningday < 1) { $loglistweekbeginningday = $loglistweekbeginningday + $loglistmaxdaysinpreviousmonth; if ($loglistweekbeginningday > $loglistday) { $loglistweekbeginningmonth--; } if ($loglistweekbeginningmonth < 1) { $loglistweekbeginningmonth = 12; $loglistweekbeginningyearyear--; } } if ($loglistweekendingday > $loglistmaxdaysinthismonth) { $loglistweekendingday = $loglistweekendingday - $loglistmaxdaysinthismonth; if ($loglistweekendingday < $loglistday) { $loglistweekendingmonth++; } if ($loglistweekendingmonth > 12) { $loglistweekendingmonth = 1; $loglistweekendingyearyear++; } } $loglistweekbeginningyear = substr($loglistweekbeginningyearyear, -2, 2); $loglistweekendingyear = substr($loglistweekendingyearyear, -2, 2); # $loglistweekbeginningdayday = sprintf ("%2d", $loglistweekbeginningday); # $loglistweekbeginningdayday =~ tr/ /0/; # $loglistweekendingdayday = sprintf ("%2d", $loglistweekendingday); # $loglistweekendingdayday =~ tr/ /0/; # $loglistweekbeginningmonthmonth = sprintf ("%2d", $loglistweekbeginningmonth); # $loglistweekbeginningmonthmonth =~ tr/ /0/; # $loglistweekendingmonthmonth = sprintf ("%2d", $loglistweekendingmonth); # $loglistweekendingmonthmonth =~ tr/ /0/; $loglistweekbeginningdayday = Gm_Utils::toTwoDigit( $loglistweekbeginningday ); $loglistweekendingdayday = Gm_Utils::toTwoDigit( $loglistweekendingday ); $loglistweekbeginningmonthmonth = Gm_Utils::toTwoDigit( $loglistweekbeginningmonth ); $loglistweekendingmonthmonth = Gm_Utils::toTwoDigit( $loglistweekendingmonth ); $loglistweekbeginningweekday = "Sunday"; $loglistweekbeginningmonthword = $months[$loglistweekbeginningmonth]; $loglistweekbeginningweekdayshort = substr($loglistweekbeginningweekday, 0, 3); $loglistweekbeginningmonthwordshort = substr($loglistweekbeginningmonthword, 0, 3); $loglistweekbeginningweekdayupper = uc($loglistweekbeginningweekday); $loglistweekbeginningmonthwordupper = uc($loglistweekbeginningmonthword); $loglistweekbeginningweekdaylower = lc($loglistweekbeginningweekday); $loglistweekbeginningmonthwordlower = lc($loglistweekbeginningmonthword); $loglistweekbeginningweekdayuppershort = uc($loglistweekbeginningweekdayshort); $loglistweekbeginningmonthworduppershort = uc($loglistweekbeginningmonthwordshort); $loglistweekbeginningweekdaylowershort = lc($loglistweekbeginningweekdayshort); $loglistweekbeginningmonthwordlowershort = lc($loglistweekbeginningmonthwordshort); $loglistweekendingweekday = "Saturday"; $loglistweekendingmonthword = $months[$loglistweekendingmonth]; $loglistweekendingweekdayshort = substr($loglistweekendingweekday, 0, 3); $loglistweekendingmonthwordshort = substr($loglistweekendingmonthword, 0, 3); $loglistweekendingweekdayupper = uc($loglistweekendingweekday); $loglistweekendingmonthwordupper = uc($loglistweekendingmonthword); $loglistweekendingweekdaylower = lc($loglistweekendingweekday); $loglistweekendingmonthwordlower = lc($loglistweekendingmonthword); $loglistweekendingweekdayuppershort = uc($loglistweekendingweekdayshort); $loglistweekendingmonthworduppershort = uc($loglistweekendingmonthwordshort); $loglistweekendingweekdaylowershort = lc($loglistweekendingweekdayshort); $loglistweekendingmonthwordlowershort = lc($loglistweekendingmonthwordshort); $loglistpagelink = "$EntriesWebPath\/$loglistnumberpadded\.$entrysuffix"; if ($keepmonthlyarchives eq Gm_Constants::NO) { $loglistpagearchivelogindexlink = "{{pageindexlink}}"; } else { if ($archiveformat eq Gm_Constants::WEEK) { $loglistpagearchivelogindexlink = "$EntriesWebPath/archive-$loglistweekbeginningmonthmonth$loglistweekbeginningdayday$loglistweekbeginningyearyear-$loglistweekendingmonthmonth$loglistweekendingdayday$loglistweekendingyearyear\.$logarchivesuffix"; } else { $loglistpagearchivelogindexlink = "$EntriesWebPath/archive-$loglistmonthmonth$loglistyearyear\.$logarchivesuffix"; } } $loglistmainbody = $loglistentrylines[2]; $loglistmorebody = $loglistentrylines[3]; if (($loglistmainbody =~ /\|\*\|/) || ($loglistmorebody =~ /\|\*\|/)) { $loglistmainbody =~ s/\|\*\|/<BR>/g; $loglistmorebody =~ s/\|\*\|/<BR>/g; } if (($loglistmainbody =~ /\n/) || ($loglistmorebody =~ /\n/)) { $loglistmainbody =~ s/\n/<BR>/g; $loglistmorebody =~ s/\n/<BR>/g; } if (($loglistmainbody =~ /<BR><BR>/) || ($loglistmorebody =~ /<BR><BR>/)) { $loglistmainbody =~ s/<BR><BR>/$gmparaseparationtemplate/g; $loglistmorebody =~ s/<BR><BR>/$gmparaseparationtemplate/g; } if (($censorenabled eq Gm_Constants::BOTH) || ($censorenabled eq Gm_Constants::ENTRIES)) { unless ($censorlist eq Gm_Constants::EMPTY) { @censoredterms = split(/\n/, $censorlist); foreach $thisterm (@censoredterms) { unless ($thisterm eq Gm_Constants::EMPTY) { 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 ($loglistsubject =~ m/$thisrealterm/i) { $loglistsubject =~ s/\b$thisrealterm\b/$thisrealtermreplacedash/isg; } if ($loglistmainbody =~ m/$thisrealterm/i) { $loglistmainbody =~ s/\b$thisrealterm\b/$thisrealtermreplace/isg; } if ($loglistmorebody =~ m/$thisrealterm/i) { $loglistmorebody =~ s/\b$thisrealterm\b/$thisrealtermreplace/isg; } } else { $thisrealtermlength = length($thisterm); $thisrealtermreplace = "*" x $thisrealtermlength; $thisrealtermreplacedash = "-" x $thisrealtermlength; if ($loglistsubject =~ m/$thisterm/i) { $loglistsubject =~ s/\b$thisterm\b/$thisrealtermreplacedash/isg; } if ($loglistmainbody =~ m/$thisterm/i) { $loglistmainbody =~ s/\b$thisterm\b/$thisrealtermreplace/isg; } if ($loglistmorebody =~ m/$thisterm/i) { $loglistmorebody =~ s/\b$thisterm\b/$thisrealtermreplace/isg; } } } } } } # changed deprecated <b>, <i>, and <u> to corresponding css properties: flipped cracker 9/15/2003 # removed code for entry subject : 1.3.1 # flipped cracker 6/29/2004 if (($inlineformatting eq Gm_Constants::ENTRIES) || ($inlineformatting eq Gm_Constants::BOTH)) { if (($loglistmainbody =~ /\*\*(.*?)\*\*/) || ($loglistmainbody =~ /\\\\(.*?)\\\\/) || ($loglistmainbody =~ /__(.*?)__/)) { $loglistmainbody =~ s/\*\*(.*?)\*\*/<span style="font-weight:bold;">$1<\/span>/isg; $loglistmainbody =~ s/\\\\(.*?)\\\\/<span style="font-style:italic;">$1<\/span>/isg; $loglistmainbody =~ s/__(.*?)__/<span style="text-decoration:underline;">$1<\/span>/isg; } if (($loglistmorebody =~ /\*\*(.*?)\*\*/) || ($loglistmorebody =~ /\\\\(.*?)\\\\/) || ($loglistmorebody =~ /__(.*?)__/)) { $loglistmorebody =~ s/\*\*(.*?)\*\*/<span style="font-weight:bold;">$1<\/span>/isg; $loglistmorebody =~ s/\\\\(.*?)\\\\/<span style="font-style:italic;">$1<\/span>/isg; $loglistmorebody =~ s/__(.*?)__/<span style="text-decoration:underline;">$1<\/span>/isg; } } #changed 9/15/2003 } # -------------------------- # entry list sub-sub routine # -------------------------- ## DEPRECATED BY: translateArchiveTemplates sub entrylistsubsub { $listsubsub =~ s/{{year}}/$loglistyear/gi; $listsubsub =~ s/{{yearyear}}/$loglistyearyear/gi; $listsubsub =~ s/{{month}}/$loglistmonth/gi; $listsubsub =~ s/{{monthmonth}}/$loglistmonthmonth/gi; $listsubsub =~ s/{{monthword}}/$loglistmonthword/gi; $listsubsub =~ s/{{monthwordshort}}/$loglistmonthwordshort/gi; $listsubsub =~ s/{{monthwordupper}}/$loglistmonthwordupper/gi; $listsubsub =~ s/{{monthwordlower}}/$loglistmonthwordlower/gi; $listsubsub =~ s/{{monthworduppershort}}/$loglistmonthworduppershort/gi; $listsubsub =~ s/{{monthwordlowershort}}/$loglistmonthwordlowershort/gi; $listsubsub =~ s/{{day}}/$loglistday/gi; $listsubsub =~ s/{{dayday}}/$loglistdayday/gi; $listsubsub =~ s/{{hour}}/$loglisthour/gi; $listsubsub =~ s/{{hourhour}}/$loglisthourhour/gi; $listsubsub =~ s/{{militaryhour}}/$loglistmilitaryhour/gi; $listsubsub =~ s/{{minute}}/$loglistminute/gi; $listsubsub =~ s/{{minuteminute}}/$loglistminuteminute/gi; $listsubsub =~ s/{{ampm}}/$loglistampm/gi; $listsubsub =~ s/{{ampmlower}}/$loglistampm/gi; $listsubsub =~ s/{{ampmdot}}/$loglistampmdot/gi; $listsubsub =~ s/{{ampmdotlower}}/$loglistampmdotlower/gi; $listsubsub =~ s/{{author}}/$loglistauthor/gi; $listsubsub =~ s/{{entrysubject}}/$loglistsubject/gi; $listsubsub =~ s/{{entrynumber}}/$loglistnumber/gi; $listsubsub =~ s/{{entrynumberpadded}}/$loglistnumberpadded/gi; $listsubsub =~ s/{{pagelink}}/$loglistpagelink/gi; $listsubsub =~ s/{{pagearchivelogindexlink}}/$loglistpagearchivelogindexlink/gi; ### add {{entrymusic}} and {{entrymood}} to {{logentrylist}} and {{calendar}} ### merged 1.3.1 ### added 1/21/05 flipped cracker $listsubsub =~ s/{{entrymusic}}/$loglistentrymusic/gi; $listsubsub =~ s/{{entrymood}}/$loglistentrymood/gi; ### END additions if ($listsubsub =~ m/{{author/i) { $listsubsub =~ s/{{author}}/$loglistentryauthor/gi; $listsubsub =~ s/{{authoremail}}/$loglistentryauthoremail/gi; $listsubsub =~ s/{{authorhomepage}}/$loglistentryauthorhomepage/gi; $listsubsub =~ s/{{authorentrycount}}/$loglistentryauthorentrycount/gi; } if (($listsubsub =~ m/{{weekbeginning/i) || ($listsubsub =~ m/{{weekending/i)) { $listsubsub =~ s/{{weekbeginningday}}/$loglistweekbeginningday/gi; $listsubsub =~ s/{{weekbeginningdayday}}/$loglistweekbeginningdayday/gi; $listsubsub =~ s/{{weekbeginningmonth}}/$loglistweekbeginningmonth/gi; $listsubsub =~ s/{{weekbeginningmonthmonth}}/$loglistweekbeginningmonthmonth/gi; $listsubsub =~ s/{{weekbeginningyear}}/$loglistweekbeginningyear/gi; $listsubsub =~ s/{{weekbeginningyearyear}}/$loglistweekbeginningyearyear/gi; $listsubsub =~ s/{{weekbeginningweekday}}/$loglistweekbeginningweekday/gi; $listsubsub =~ s/{{weekbeginningweekdayshort}}/$loglistweekbeginningweekdayshort/gi; $listsubsub =~ s/{{weekbeginningmonthword}}/$loglistweekbeginningmonthword/gi; $listsubsub =~ s/{{weekbeginningmonthwordshort}}/$loglistweekbeginningmonthwordshort/gi; $listsubsub =~ s/{{weekbeginningweekdayupper}}/$loglistweekbeginningweekdayupper/gi; $listsubsub =~ s/{{weekbeginningmonthwordupper}}/$loglistweekbeginningmonthwordupper/gi; $listsubsub =~ s/{{weekbeginningweekdaylower}}/$loglistweekbeginningweekdaylower/gi; $listsubsub =~ s/{{weekbeginningmonthwordlower}}/$loglistweekbeginningmonthwordlower/gi; $listsubsub =~ s/{{weekbeginningweekdayuppershort}}/$loglistweekbeginningweekdayuppershort/gi; $listsubsub =~ s/{{weekbeginningmonthworduppershort}}/$loglistweekbeginningmonthworduppershort/gi; $listsubsub =~ s/{{weekbeginningweekdaylowershort}}/$loglistweekbeginningweekdaylowershort/gi; $listsubsub =~ s/{{weekbeginningmonthwordlowershort}}/$loglistweekbeginningmonthwordlowershort/gi; $listsubsub =~ s/{{weekendingday}}/$loglistweekendingday/gi; $listsubsub =~ s/{{weekendingdayday}}/$loglistweekendingdayday/gi; $listsubsub =~ s/{{weekendingmonth}}/$loglistweekendingmonth/gi; $listsubsub =~ s/{{weekendingmonthmonth}}/$loglistweekendingmonthmonth/gi; $listsubsub =~ s/{{weekendingyear}}/$loglistweekendingyear/gi; $listsubsub =~ s/{{weekendingyearyear}}/$loglistweekendingyearyear/gi; $listsubsub =~ s/{{weekendingweekday}}/$loglistweekendingweekday/gi; $listsubsub =~ s/{{weekendingweekdayshort}}/$loglistweekendingweekdayshort/gi; $listsubsub =~ s/{{weekendingmonthword}}/$loglistweekendingmonthword/gi; $listsubsub =~ s/{{weekendingmonthwordshort}}/$loglistweekendingmonthwordshort/gi; $listsubsub =~ s/{{weekendingweekdayupper}}/$loglistweekendingweekdayupper/gi; $listsubsub =~ s/{{weekendingmonthwordupper}}/$loglistweekendingmonthwordupper/gi; $listsubsub =~ s/{{weekendingweekdaylower}}/$loglistweekendingweekdaylower/gi; $listsubsub =~ s/{{weekendingmonthwordlower}}/$loglistweekendingmonthwordlower/gi; $listsubsub =~ s/{{weekendingweekdayuppershort}}/$loglistweekendingweekdayuppershort/gi; $listsubsub =~ s/{{weekendingmonthworduppershort}}/$loglistweekendingmonthworduppershort/gi; $listsubsub =~ s/{{weekendingweekdaylowershort}}/$loglistweekendingweekdaylowershort/gi; $listsubsub =~ s/{{weekendingmonthwordlowershort}}/$loglistweekendingmonthwordlowershort/gi; } if (($listsubsub =~ m/karma}}/i) || ($listsubsub =~ m/karmalink}}/i)) { $listsubsub =~ s/{{positivekarmalink}}/$loglistentrypositivekarmalink/gi; $listsubsub =~ s/{{negativekarmalink}}/$loglistentrynegativekarmalink/gi; $listsubsub =~ s/{{positivekarma}}/$loglistentrypositivekarma/gi; $listsubsub =~ s/{{negativekarma}}/$loglistentrynegativekarma/gi; $listsubsub =~ s/{{totalkarma}}/$loglistentrytotalkarma/gi; } if ($listsubsub =~ m/{{comments/i) { $listsubsub =~ s/{{commentsnumber}}/$loglistentrycommentsnumber/gi; $listsubsub =~ s/{{commentstatussmart}}/$loglistentrycommentstatussmart/gi; $listsubsub =~ s/{{commentstatussmartupper}}/$loglistentrycommentstatussmartupper/gi; $listsubsub =~ s/{{commentstatussmartlower}}/$loglistentrycommentstatussmartlower/gi; } if ($listsubsub =~ m/{{entry/i) { $listsubsub =~ s/{{entrymainbody}}/$loglistmainbody/gi; $listsubsub =~ s/{{entrymorebody}}/$loglistmorebody/gi; $listsubsub =~ s/{{entrycomments}}/$loglistcomments/gi; if ($listsubsub =~ m/{{entrymainbodyfirstwords (\d+)}}/i) { until ($listsubsub !~ m/{{entrymainbodyfirstwords (\d+)}}/isg) { $firstwordscount = $1; $grabmainbodywords = $loglistmainbody; if ($grabmainbodywords =~ m/{{link/i) { $grabmainbodywords =~ s/({{linkmo) (http|https|ftp)(:\/\/\S+?) (.+?)(\|)(.+?)(}})/$4/isg; $grabmainbodywords =~ s/({{link) (http|https|ftp)(:\/\/\S+?)(}})/$2$3/isg; $grabmainbodywords =~ s/({{link) (http|https|ftp)(:\/\/\S+?) (.+?)(}})/$4/isg; ########################################################### # 9/2/2001 - CHERYL LAMBERT # ADDED {{linkblank}} TEMPLATE VARIABLE SO THAT I CAN USE target="_blank" TO OPEN NEW WINDOWS $grabmainbodywords =~ s/({{linkblankmo) (http|https|ftp)(:\/\/\S+?) (.+?)(\|)(.+?)(}})/$4/isg; $grabmainbodywords =~ s/({{linkblank) (http|https|ftp)(:\/\/\S+?)(}})/$2$3/isg; $grabmainbodywords =~ s/({{linkblank) (http|https|ftp)(:\/\/\S+?) (.+?)(}})/$4/isg; ########################################################### } if ($grabmainbodywords =~ m/{{email/i) { $grabmainbodywords =~ s/({{emailmo) (\S+\@\S+?) (.+?)(\|)(.+?)(}})/$3/isg; $grabmainbodywords =~ s/({{email) (\S+\@\S+?)(}})/$2/isg; $grabmainbodywords =~ s/({{email) (\S+\@\S+?) (.+?)(}})/$3/isg; } $grabmainbodywords =~ s/<([^>]|\n)*>/ /g; $grabmainbodywords =~ s/{{(.*?)}}/ /g; $grabmainbodywords =~ s/\n/ /g; $grabmainbodywords =~ s/\r/ /g; $grabmainbodywords =~ s/\|\*\|/ /g; $grabmainbodywords =~ s/^\s+//; $grabmainbodywords =~ s/\s+$//; $grabmainbodywords =~ s/\s{2,}/ /g; @grabmainbodywordslist = split (/ /, $grabmainbodywords); $countwordsfromhere = 0; (@finalmainbodywordslist, @finalmainbodywordslist = ()); if ($firstwordscount < 1) { $firstwordscount = 1; } do { $finalmainbodywordslist[$countwordsfromhere] = $grabmainbodywordslist[$countwordsfromhere]; $countwordsfromhere++; } until $countwordsfromhere eq $firstwordscount; $finalmainbodyfirstwords = join (" ", @finalmainbodywordslist); $finalmainbodyfirstwords =~ s/^\s+//; $finalmainbodyfirstwords =~ s/\s+$//; $finalmainbodyfirstwords =~ s/\s{2,}//g; if (substr($finalmainbodyfirstwords, -1) =~ /\W/) { chop($finalmainbodyfirstwords); } if (substr($finalmainbodyfirstwords, -1) eq / /) { chop($finalmainbodyfirstwords); } $listsubsub =~ s/{{entrymainbodyfirstwords ($firstwordscount)}}/$finalmainbodyfirstwords/isg; } } if ($listsubsub =~ m/{{entrymorebodyfirstwords (\d+)}}/i) { until ($listsubsub !~ m/{{entrymorebodyfirstwords (\d+)}}/isg) { $firstwordscount = $1; if ($loglistmorebody eq Gm_Constants::EMPTY) { $listsubsub =~ s/{{entrymorebodyfirstwords ($firstwordscount)}}//isg; } else { $grabmorebodywords = $loglistmorebody; if ($grabmorebodywords =~ m/{{link/i) { $grabmorebodywords =~ s/({{linkmo) (http|https|ftp)(:\/\/\S+?) (.+?)(\|)(.+?)(}})/$4/isg; $grabmorebodywords =~ s/({{link) (http|https|ftp)(:\/\/\S+?)(}})/$2$3/isg; $grabmorebodywords =~ s/({{link) (http|https|ftp)(:\/\/\S+?) (.+?)(}})/$4/isg; ########################################################### # 9/2/2001 - CHERYL LAMBERT # ADDED {{linkblank}} TEMPLATE VARIABLE SO THAT I CAN USE target="_blank" TO OPEN NEW WINDOWS $grabmorebodywords =~ s/({{linkblankmo) (http|https|ftp)(:\/\/\S+?) (.+?)(\|)(.+?)(}})/$4/isg; $grabmorebodywords =~ s/({{linkblank) (http|https|ftp)(:\/\/\S+?)(}})/$2$3/isg; $grabmorebodywords =~ s/({{linkblank) (http|https|ftp)(:\/\/\S+?) (.+?)(}})/$4/isg; ########################################################### } if ($grabmorebodywords =~ m/{{email/i) { $grabmorebodywords =~ s/({{emailmo) (\S+\@\S+?) (.+?)(\|)(.+?)(}})/$3/isg; $grabmorebodywords =~ s/({{email) (\S+\@\S+?)(}})/$2/isg; $grabmorebodywords =~ s/({{email) (\S+\@\S+?) (.+?)(}})/$3/isg; } $grabmorebodywords =~ s/<([^>]|\n)*>/ /g; $grabmorebodywords =~ s/{{(.*?)}}/ /g; $grabmorebodywords =~ s/\n/ /g; $grabmorebodywords =~ s/\r/ /g; $grabmorebodywords =~ s/\|\*\|/ /g; $grabmorebodywords =~ s/^\s+//; $grabmorebodywords =~ s/\s+$//; $grabmorebodywords =~ s/\s{2,}/ /g; @grabmorebodywordslist = split (/ /, $grabmorebodywords); $countwordsfromhere = 0; (@finalmorebodywordslist, @finalmorebodywordslist = ()); if ($firstwordscount < 1) { $firstwordscount = 1; } do { $finalmorebodywordslist[$countwordsfromhere] = $grabmorebodywordslist[$countwordsfromhere]; $countwordsfromhere++; } until $countwordsfromhere eq $firstwordscount; $finalmorebodyfirstwords = join (" ", @finalmorebodywordslist); $finalmorebodyfirstwords =~ s/^\s+//; $finalmorebodyfirstwords =~ s/\s+$//; $finalmorebodyfirstwords =~ s/\s{2,}//g; if (substr($finalmorebodyfirstwords, -1) =~ /\W/) { chop($finalmorebodyfirstwords); } if (substr($finalmorebodyfirstwords, -1) eq / /) { chop($finalmorebodyfirstwords); } $listsubsub =~ s/{{entrymorebodyfirstwords ($firstwordscount)}}/$finalmorebodyfirstwords/isg; } } } } } # ---------------------------------- # generate external author variables # ---------------------------------- ## WTF does this do? ## TODO GOOD CANDIDATE TO REMOVE TO CORE, CAREFULL OF ENTRYRETURN, GLOBAL VAR? ## DEPRECATED BY: Gm_Core::translateExternalAuthorVariables sub gm_generateexternalauthorvariables { my $gmauthors = Gm_Storage::getAuthors( errHandler=>\&Gm_Web::displayAdminErrorExit ); foreach my $author ( keys( %$gmauthors ) ) { $thisexternalauthor = $gmauthors->{$author}{'author'}; $thisexternalauthoremail = $gmauthors->{$author}{'email'}; $thisexternalauthorhomepage = $gmauthors->{$author}{'homepage'}; $thisexternalauthorentrycount = $gmauthors->{$author}{'posttotal'};; $thisexternalauthorsmartlink = $thisexternalauthor; if ($thisexternalauthoremail ne Gm_Constants::EMPTY) { $thisexternalauthorsmartlink = "<A HREF=\"mailto:$thisentryauthoremail\">$thisentryauthor</A>"; } if ($thisexternalauthorhomepage ne Gm_Constants::EMPTY) { $thisexternalauthorsmartlink = "<A HREF=\"$thisentryauthorhomepage\">$thisentryauthor</A>"; } $entryreturn =~ s/{{authoremail $thisexternalauthor}}/$thisexternalauthoremail/isg; $entryreturn =~ s/{{authorhomepage $thisexternalauthor}}/$thisexternalauthorhomepage/isg; $entryreturn =~ s/{{authorsmartlink $thisexternalauthor}}/$thisexternalauthorsmartlink/isg; $entryreturn =~ s/{{authorentrycount $thisexternalauthor}}/$thisexternalauthorentrycount/isg; } } # ----------------- # generate calendar # ----------------- # DEPRECATED BY: Gm_Core::generateCalendar sub gm_generatecalendar { # $usethisentrydayday = sprintf ("%2d", $usethisentryday); # $usethisentrydayday =~ tr/ /0/; # $usethisentrymonthmonth = sprintf ("%2d", $usethisentrymonth); # $usethisentrymonthmonth =~ tr/ /0/; $usethisentrydayday = Gm_Utils::toTwoDigit( $usethisentryday ); $usethisentrymonthmonth = Gm_Utils::toTwoDigit( $usethisentrymonth ); $usethisentryyear = substr($usethisentryyearyear, -2, 2); $usethisentrymonthwordupper = uc($usethisentrymonthword); $usethisentrymonthwordlower = lc($usethisentrymonthword); $usethisentrymonthwordshort = substr($usethisentrymonthword, 0, 3); $usethisentrymonthworduppershort = uc($usethisentrymonthwordshort); $usethisentrymonthwordlowershort = lc($usethisentrymonthwordshort); $leapyearcheck = $usethisentryyearyear % 4; $maxdaysinthismonth = 31; if (($usethisentrymonthword eq "September") || ($usethisentrymonthword eq "April") || ($usethisentrymonthword eq "June") || ($usethisentrymonthword eq "November")) { $maxdaysinthismonth = 30; } if ($usethisentrymonthword eq "February") { $maxdaysinthismonth = 28; if ($leapyearcheck eq "0") { $maxdaysinthismonth = 29; } } $maxdaysinpreviousmonth = 31; if (($usethisentrymonthword eq "October") || ($usethisentrymonthword eq "May") || ($usethisentrymonthword eq "July") || ($usethisentrymonthword eq "December")) { $maxdaysinpreviousmonth = 30; } if ($usethisentrymonthword eq "March") { $maxdaysinpreviousmonth = 28; if ($leapyearcheck eq "0") { $maxdaysinpreviousmonth = 29; } } $calendarweekday[$usethisentryweekdaynumber] = $usethisentryday; $weekcountfrom = $usethisentryweekdaynumber; $weekcountfromday = $usethisentryday; $weekcountspecial = Gm_Constants::NONE; unless ($weekcountfrom eq "0") { do { $weekcountfrom--; $weekcountfromday--; if ($weekcountfromday eq 0) { $weekcountfromday = $maxdaysinpreviousmonth; $weekcountspecial = "gotolastmonth"; } unless ($weekcountfrom < 0) { $calendarweekday[$weekcountfrom] = $weekcountfromday; } } until $weekcountfrom eq "0"; } $weekcountfrom = $usethisentryweekdaynumber; $weekcountfromday = $usethisentryday; unless ($weekcountfrom eq "6") { do { $weekcountfrom++; $weekcountfromday++; if ($weekcountfromday > $maxdaysinthismonth) { $weekcountfromday = 1; $weekcountspecial = "gotonextmonth"; } unless ($weekcountfrom > 6) { $calendarweekday[$weekcountfrom] = $weekcountfromday; } } until $weekcountfrom eq "6"; } $countfromhere = $usethisentryday; $calendardataday[$usethisentryday] = $usethisentryweekdaynumber; unless ($countfromhere eq "1") { do { $thistempday = $calendardataday[$countfromhere]; $thistempday--; $countfromhere--; if ($thistempday < 0) { $thistempday = 6; } $calendardataday[$countfromhere] = $thistempday; } until $countfromhere eq "1"; } $weekcountfromday = $usethisentryday; $countfromhere = $usethisentryday; unless ($countfromhere eq $maxdaysinthismonth) { do { $thistempday = $calendardataday[$countfromhere]; $thistempday++; $countfromhere++; if ($thistempday > 6) { $thistempday = 0; } $calendardataday[$countfromhere] = $thistempday; } until $countfromhere eq $maxdaysinthismonth; } $calendarfull = $gmcalendartablebeginningtemplate; $calendarfull .= "$gmcalendarblankcelltemplate" x $calendardataday[1]; my $gmentrylist = Gm_Storage::getEntrylist( errHandler=>\&Gm_Web::displayAdminErrorExit ); $loglistdates = Gm_Constants::EMPTY; foreach my $entry ( sort { $gmentrylist->{$b}{'id'} <=> $gmentrylist->{$a}{'id'} } keys( %$gmentrylist ) ) { $thisloglistnumber = $gmentrylist->{$entry}{'id'}; $thisloglistauthor = $gmentrylist->{$entry}{'author'}; $thisloglistsubject = $gmentrylist->{$entry}{'subject'}; $thisloglistdate = $gmentrylist->{$entry}{'created'}; $thisloglisttimeampm = $gmentrylist->{$entry}{'createt'}; $thisloglistopenstatus = $gmentrylist->{$entry}{'status'}; $thisloglistmorestatus = $gmentrylist->{$entry}{'extended'}; $thisloglistentrymusic = $gmentrylist->{$entry}{'music'}; $thisloglistentrymood = $gmentrylist->{$entry}{'mood'}; $thisloglistemoticonstatus = $gmentrylist->{$entry}{'emoticons'}; unless ($thisloglistopenstatus eq "C") { $loglistdates .= "$thisloglistdate "; } } $weekcountfrom = 0; $calendarweekfull = Gm_Constants::EMPTY; do { $currentcountday = $calendarweekday[$weekcountfrom]; $currentcountmonth = $usethisentrymonth; $currentcountyearyear = $usethisentryyearyear; if (($currentcountday > 20) && ($weekcountspecial eq "gotolastmonth")) { $currentcountmonth--; if ($currentcountmonth < 1) { $currentcountmonth = 12; $currentcountyearyear--; } } if (($currentcountday < 10) && ($weekcountspecial eq "gotonextmonth")) { $currentcountmonth++; if ($currentcountmonth > 12) { $currentcountmonth = 1; $currentcountyearyear++; } } # $currentcountdayday = sprintf ("%2d", $currentcountday); # $currentcountdayday =~ tr/ /0/; # $currentcountmonthmonth = sprintf ("%2d", $currentcountmonth); # $currentcountmonthmonth =~ tr/ /0/; $currentcountdayday = Gm_Utils::toTwoDigit( $currentcountday ); $currentcountmonthmonth = Gm_Utils::toTwoDigit( $currentcountmonth ); $currentcountyear = substr($currentcountyearyear, -2, 2); $thisweeklistdate = "$currentcountmonthmonth\/$currentcountdayday\/$currentcountyear"; if ($loglistdates =~ /$thisweeklistdate/) { if ($generateentrypages eq Gm_Constants::NO) { foreach my $entry ( sort { $gmentrylist->{$b}{'id'} <=> $gmentrylist->{$a}{'id'} } keys( %$gmentrylist ) ) { $loglistnumber = $gmentrylist->{$entry}{'id'}; $loglistauthor = $gmentrylist->{$entry}{'author'}; $loglistsubject = $gmentrylist->{$entry}{'subject'}; $loglistdate = $gmentrylist->{$entry}{'created'}; $loglisttimeampm = $gmentrylist->{$entry}{'createt'}; $loglistopenstatus = $gmentrylist->{$entry}{'status'}; $loglistmorestatus = $gmentrylist->{$entry}{'extended'}; if ($loglistdate eq $thisweeklistdate) { &gm_getloglistvariables; $listsubsub = $gmcalendarweekfulldaytemplate; &entrylistsubsub; $calendarweekfull .= $listsubsub; } } } else { $thiscalendarweeklink = Gm_Constants::EMPTY; foreach my $entry ( sort { $gmentrylist->{$b}{'id'} <=> $gmentrylist->{$a}{'id'} } keys( %$gmentrylist ) ) { $loglistnumber = $gmentrylist->{$entry}{'id'}; $loglistauthor = $gmentrylist->{$entry}{'author'}; $loglistsubject = $gmentrylist->{$entry}{'subject'}; $loglistdate = $gmentrylist->{$entry}{'created'}; $loglisttimeampm = $gmentrylist->{$entry}{'createt'}; $loglistopenstatus = $gmentrylist->{$entry}{'status'}; $loglistmorestatus = $gmentrylist->{$entry}{'extended'}; if (($loglistdate eq $thisweeklistdate) && ($thiscalendarweeklink eq Gm_Constants::EMPTY)) { unless (($thisloglistmorestatus eq 'N') && ($linktocalendarentries eq Gm_Constants::MORE)) { $thiscalendarweeklink = Gm_Constants::YES; } } } if ($thiscalendarweeklink eq Gm_Constants::EMPTY) { $listsubsub = $gmcalendarweekfulldaytemplate; $listsubsub =~ s/{{day}}/$currentcountday/g; $listsubsub =~ s/{{day}}/$currentcountday/g; $listsubsub =~ s/{{month}}/$currentcountmonth/g; $listsubsub =~ s/{{monthmonth}}/$currentcountmonthmonth/g; $listsubsub =~ s/{{year}}/$currentcountyear/g; $listsubsub =~ s/{{yearyear}}/$currentcountyearyear/g; $calendarweekfull .= $listsubsub; } else { foreach my $entry ( sort { $gmentrylist->{$b}{'id'} <=> $gmentrylist->{$a}{'id'} } keys( %$gmentrylist ) ) { $loglistnumber = $gmentrylist->{$entry}{'id'}; $loglistauthor = $gmentrylist->{$entry}{'author'}; $loglistsubject = $gmentrylist->{$entry}{'subject'}; $loglistdate = $gmentrylist->{$entry}{'created'}; $loglisttimeampm = $gmentrylist->{$entry}{'createt'}; $loglistopenstatus = $gmentrylist->{$entry}{'status'}; $loglistmorestatus = $gmentrylist->{$entry}{'extended'}; if (($loglistdate eq $thisweeklistdate) && ($thiscalendarweeklink eq Gm_Constants::YES) && ($loglistopenstatus ne "C")) { &gm_getloglistvariables; $listsubsub = $gmcalendarweekfulldaylinktemplate; &entrylistsubsub; $calendarweekfull .= $listsubsub; $thiscalendarweeklink = Gm_Constants::EMPTY; } } } } } else { $listsubsub = $gmcalendarweekfulldaytemplate; $listsubsub =~ s/{{day}}/$currentcountday/g; $listsubsub =~ s/{{day}}/$currentcountday/g; $listsubsub =~ s/{{month}}/$currentcountmonth/g; $listsubsub =~ s/{{monthmonth}}/$currentcountmonthmonth/g; $listsubsub =~ s/{{year}}/$currentcountyear/g; $listsubsub =~ s/{{yearyear}}/$currentcountyearyear/g; $calendarweekfull .= $listsubsub; } $weekcountfrom++; } until $weekcountfrom eq "7"; $countfromhere = 1; do { # $countfromherepadded = sprintf ("%2d", $countfromhere); # $countfromherepadded =~ tr/ /0/; $countfromherepadded = Gm_Utils::toTwoDigit( $countfromhere ); $thislistdate = "$usethisentrymonthmonth\/$countfromherepadded\/$usethisentryyear"; if ($loglistdates =~ /$thislistdate/) { if ($generateentrypages eq Gm_Constants::NO) { foreach my $entry ( sort { $gmentrylist->{$b}{'id'} <=> $gmentrylist->{$a}{'id'} } keys( %$gmentrylist ) ) { $loglistnumber = $gmentrylist->{$entry}{'id'}; $loglistauthor = $gmentrylist->{$entry}{'author'}; $loglistsubject = $gmentrylist->{$entry}{'subject'}; $loglistdate = $gmentrylist->{$entry}{'created'}; $loglisttimeampm = $gmentrylist->{$entry}{'createt'}; $loglistopenstatus = $gmentrylist->{$entry}{'status'}; $loglistmorestatus = $gmentrylist->{$entry}{'extended'}; if ($loglistdate eq $thislistdate) { &gm_getloglistvariables; $listsubsub = $gmcalendarfullcelltemplate; &entrylistsubsub; $calendarfull .= $listsubsub; } } } else { $thiscalendarlink = Gm_Constants::EMPTY; foreach my $entry ( sort { $gmentrylist->{$b}{'id'} <=> $gmentrylist->{$a}{'id'} } keys( %$gmentrylist ) ) { $loglistnumber = $gmentrylist->{$entry}{'id'}; $loglistauthor = $gmentrylist->{$entry}{'author'}; $loglistsubject = $gmentrylist->{$entry}{'subject'}; $loglistdate = $gmentrylist->{$entry}{'created'}; $loglisttimeampm = $gmentrylist->{$entry}{'createt'}; $loglistopenstatus = $gmentrylist->{$entry}{'status'}; $loglistmorestatus = $gmentrylist->{$entry}{'extended'}; if (($loglistdate eq $thislistdate) && ($thiscalendarlink eq Gm_Constants::EMPTY)) { unless (($loglistmorestatus eq 'N') && ($linktocalendarentries eq Gm_Constants::MORE)) { $thiscalendarlink = Gm_Constants::YES; } } } if ($thiscalendarlink eq Gm_Constants::EMPTY) { $listsubsub = $gmcalendarfullcelltemplate; $listsubsub =~ s/{{day}}/$countfromhere/g; $listsubsub =~ s/{{day}}/$countfromherepadded/g; $calendarfull .= $listsubsub; } else { foreach my $entry ( sort { $gmentrylist->{$b}{'id'} <=> $gmentrylist->{$a}{'id'} } keys( %$gmentrylist ) ) { $loglistnumber = $gmentrylist->{$entry}{'id'}; $loglistauthor = $gmentrylist->{$entry}{'author'}; $loglistsubject = $gmentrylist->{$entry}{'subject'}; $loglistdate = $gmentrylist->{$entry}{'created'}; $loglisttimeampm = $gmentrylist->{$entry}{'createt'}; $loglistopenstatus = $gmentrylist->{$entry}{'status'}; $loglistmorestatus = $gmentrylist->{$entry}{'extended'}; if (($loglistdate eq $thislistdate) && ($thiscalendarlink eq Gm_Constants::YES) && ($loglistopenstatus ne "C")) { &gm_getloglistvariables; $listsubsub = $gmcalendarfullcelllinktemplate; &entrylistsubsub; $calendarfull .= $listsubsub; $thiscalendarlink = Gm_Constants::EMPTY; } } } } } else { $listsubsub = $gmcalendarfullcelltemplate; $listsubsub =~ s/{{day}}/$countfromhere/g; $listsubsub =~ s/{{day}}/$countfromherepadded/g; $calendarfull .= $listsubsub; } ## calendar fix addressing when last day of month falls on Saturday if ( ($calendardataday[$countfromhere] eq "6") && ($countfromhere ne $maxdaysinthismonth) ) { $calendarfull .= "</tr>\n<tr>"; } $countfromhere++; } until $countfromhere > $maxdaysinthismonth; $endofcaldisplay = 6 - $calendardataday[$maxdaysinthismonth]; $calendarfull .= "$gmcalendarblankcelltemplate" x $endofcaldisplay; $calendarfull .= $gmcalendartableendingtemplate; $calendarfull =~ s/{{month}}/$usethisentrymonth/g; $calendarfull =~ s/{{monthmonth}}/$usethisentrymonthmonth/g; $calendarfull =~ s/{{year}}/$usethisentryyear/g; $calendarfull =~ s/{{yearyear}}/$usethisentryyearyear/g; $calendarfull =~ s/{{monthword}}/$usethisentrymonthword/g; $calendarfull =~ s/{{monthwordupper}}/$usethisentrymonthwordupper/g; $calendarfull =~ s/{{monthwordlower}}/$usethisentrymonthwordlower/g; $calendarfull =~ s/{{monthwordshort}}/$usethisentrymonthwordshort/g; $calendarfull =~ s/{{monthworduppershort}}/$usethisentrymonthworduppershort/g; $calendarfull =~ s/{{monthwordlowershort}}/$usethisentrymonthwordlowershort/g; } # ----------------- # log the author in # ----------------- sub gm_login { ## TODO PERHAPS THIS SHOULD USE CUSTOM ERRORHANDLER TO GIVE USER OPTION TO FIX FILES? ## DIAGNOSITICS CHMODS, BUT COULD GET TO IT IF IT DIDN'T ALREADY WORK, REALLY NEED ## TO RESTRICT DIAGNOSITIC ACCESS? Gm_Storage::validateResources( errHandler=>\&Gm_Web::displayAdminErrorExit ); if ($loginnotice eq Gm_Constants::EMPTY) { $loginnotice = qq(<B><FONT COLOR="#000000">Login Prompt</font></B><P>); } &gm_readconfig; if ($cookiesallowed eq Gm_Constants::NO) { $getnameandpwcookie = Gm_Constants::EMPTY; } else { $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>"; } ## TODO HEADER SHOULD BE PRINT OUT HERE, SO THAT WE DON'T HAVE FUNKY LOOKING ERROR MESSAGE ## TODO THIS SHOULD UTILIZE A PRINT_ADMIN_SCREEN TYPE FUNCTION print<<GMLOGIN; $gmheadtag $gmframetop $loginnotice <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> $getnameandpwcookie $gmframebottom </BODY> </HTML> GMLOGIN exit; } # ------------------ # validate the login # ------------------ sub gm_validate { &gm_readconfig; ## TODO COORDINATE SO ONLY DONE ONCE PER CALL &gm_bancheck; ## works off of some configs $gmvalidated = Gm_Constants::NO; $gmentryaccess = Gm_Constants::NO; $gmentryeditaccess = Gm_Constants::NO; $gmconfigurationaccess = Gm_Constants::NO; $gmtemplateaccess = Gm_Constants::NO; $gmauthoraccess = Gm_Constants::NO; $gmcplogaccess = Gm_Constants::NO; $gmrebuildaccess = Gm_Constants::NO; $gmbookmarkletaccess = Gm_Constants::NO; $gmuploadaccess = Gm_Constants::NO; $gmloginaccess = Gm_Constants::NO; $IN{'authorname'} =~ s/\|//g; $IN{'authorpassword'} =~ s/\|//g; $IN{'authorname'} =~ s/^\s+//; $IN{'authorname'} =~ s/\s+$//; $IN{'authorpassword'} =~ s/^\s+//; $IN{'authorpassword'} =~ s/\s+$//; ######################################################################## ## gm_validate extension to allow a rebuild operation without a password ## by passing a token reference instead. added by linear 9/3/2003 ######################################################################## # merged in 1.3 if (($IN{'authorname'} eq Gm_Constants::EMPTY) || ($IN{'authorpassword'} eq Gm_Constants::EMPTY)) { unless($IN{'gmtoken'}) { $loginnotice = qq(<B><FONT COLOR="#0000FF">You left one or more of the fields blank. Please try again.</font></B><P>); gm_writetocplog("<B><FONT COLOR=\"#FF0000\">Invalid login attempt:</font></B> One or more fields left blank ($IN{'authorname'} $IN{'authorpassword'})"); &gm_login; } } if ($IN{'gmtoken'} && $IN{'rebuilding'}) { # read the token from the file where we persisted it open (TOKENPLEASE, "<$EntriesPath/gm-token.cgi") || &gm_dangermouse("Can't read the token file."); @gmtoken = <TOKENPLEASE>; $gmtoken = $gmtoken[0]; chomp ($gmtoken); $gmtokenauthor = $gmtoken[1]; chomp ($gmtokenauthor); $gmtokenpass = $gmtoken[2]; chomp ($gmtokenpass); close (TOKENPLEASE); # examine the token for validity if ($IN{'gmtoken'} eq $gmtoken) { $IN{'authorname'} = $gmtokenauthor; $IN{'authorpassword'} = $gmtokenpass; } } my $gmauthors = Gm_Storage::getAuthors( errHandler=>\&Gm_Web::displayAdminErrorExit ); my $selectedauthor = $gmauthors->{$IN{'authorname'}}; if ($selectedauthor->{'author'} eq $IN{'authorname'}) { $gmvalidated = "foundname"; ## WTF THIS LINE IS SERIOUSLY MESSED. THE STORED PASSWORD IS BEING PASSED AS SALT my $crypted = crypt($IN{'authorpassword'}, $selectedauthor->{'password'}); if ( ($selectedauthor->{'password'} eq $crypted) || ($selectedauthor->{'password'} eq $IN{'authorpassword'}) ) { $gmvalidated = Gm_Constants::YES; if ($selectedauthor->{'postnew'} eq 'Y') { $gmentryaccess = Gm_Constants::YES; } if ($selectedauthor->{'editentries'} eq 'Y') { $gmentryeditaccess = Gm_Constants::YES; } if ($selectedauthor->{'editentries'} eq 'O') { $gmentryeditaccess = "mineonly"; } if ($selectedauthor->{'editconfigs'} eq 'Y') { $gmconfigurationaccess = Gm_Constants::YES; } if ($selectedauthor->{'edittemplates'} eq 'Y') { $gmtemplateaccess = Gm_Constants::YES; } if ($selectedauthor->{'edittemplates'} eq 'O') { $gmtemplateaccess = "hfsonly"; } if ($selectedauthor->{'editauthors'} eq 'Y') { $gmauthoraccess = Gm_Constants::YES; } if ($selectedauthor->{'rebuild'} eq 'Y') { $gmrebuildaccess = Gm_Constants::YES; } if ($selectedauthor->{'viewcplog'} eq 'Y') { $gmcplogaccess = Gm_Constants::YES; } if ($selectedauthor->{'bookmarklets'} eq 'Y') { $gmbookmarkletaccess = Gm_Constants::YES; } if ($selectedauthor->{'upload'} eq 'Y') { $gmuploadaccess = Gm_Constants::YES; } if ($selectedauthor->{'viewadmin'} eq 'Y') { $gmloginaccess = Gm_Constants::YES; } } } if ($gmvalidated eq "foundname") { $loginnotice = qq(<B><FONT COLOR="#0000FF">The password you entered for that author is incorrect. Please try again.</font></B><P>); gm_writetocplog("<B><FONT COLOR=\"#FF0000\">Invalid login attempt:</font></B> Incorrect password ($IN{'authorpassword'}) for $IN{'authorname'}"); &gm_login; } if ($gmvalidated ne Gm_Constants::YES) { $loginnotice = qq(<B><FONT COLOR="#0000FF">No such author is registered. Please try again.</font></B><P>); gm_writetocplog("<B><FONT COLOR=\"#FF0000\">Invalid login attempt:</font></B> No such author as $IN{'authorname'} ($IN{'authorpassword'}) registered"); &gm_login; } } # -------------------------- # check if this IP is banned # -------------------------- # TODO MOVE THIS TO CORE sub gm_bancheck { my $gmbanlist = Gm_Storage::getBanlist( errHandler=>\&Gm_Web::displayAdminErrorExit ); $currentip = $ENV{'REMOTE_ADDR'}; if ( scalar( keys(%$gmbanlist)) > 0 ) { foreach my $gmbanlistline ( keys(%$gmbanlist)) { ($checkthisip, $checkthisiphost, $checkthisperson) = ($gmbanlist->{$gmbanlistline}{'ip'}, $gmbanlist->{$gmbanlistline}{'host'}, $gmbanlist->{$gmbanlistline}{'label'} ); if (($currentip =~ m/$checkthisip/) && ($checkthisip ne Gm_Constants::EMPTY)) { #cp log will check if should actually log my $cpMsg = "<font color=\"#FF0000\"><b>A banned IP ($checkthisip"; if ($checkthisperson ne Gm_Constants::EMPTY) { $cpMsg .= ", \"$checkthisperson\""; } $cpMsg .= ") attempted to access this program</b></font>"; gm_writetocplog( $cpMsg ); ## Tell them why &gm_dangermouse("You have been banned from accessing this program.<br />(IP: $currentip)"); } } } } # --------------- # write to cp log # --------------- ## Write to Control Panel Log # shorthand to write to the control panel log # ARGS1 = message to write to control panel # DEPRECATED: Gm_Core::writeToCplog() sub gm_writetocplog { my $writetologtext = shift; if ($keeplog eq Gm_Constants::YES) { my ($gmdate) = Gm_Utils::getStdDate( $serveroffset ); if( Gm_Utils::hackWebTest( $writetologtext ) ){ $writetologtext = '<font COLOR="#dd0000">[Aborted log - Hack Attempt]</font> by '.$ENV{'REMOTE_ADDR'}; } Gm_Storage::addLogMessage( msg=>"<font size=\"1\">[$gmdate] [$authorIP]". "</font> $writetologtext", errHandler=>\&Gm_Web::displayAdminErrorExit ); } } # ----------------------------- # danger will robinson, danger! # ----------------------------- ### DEPRICATED, USE Gm_Web::displayAdminErrorExit INSTEAD sub gm_dangermouse { my $dangerwarning = shift(@_); Gm_Web::displayAdminErrorExit( $dangerwarning ); } 1; # ------------------------ # front page - log options # ------------------------ sub gm_frontpage { &gm_readconfig; if (($cgilocalpath eq Gm_Constants::EMPTY) || ($cgiwebpath eq Gm_Constants::EMPTY) || ($LogPath eq Gm_Constants::EMPTY) || ($EntriesPath eq Gm_Constants::EMPTY) || ($LogWebPath eq Gm_Constants::EMPTY) || ($EntriesWebPath eq Gm_Constants::EMPTY)) { if (($cgilocalpath eq Gm_Constants::EMPTY) && ($LogPath ne Gm_Constants::EMPTY)) { $cgilocalpath = $LogPath; } if (($cgiwebpath eq Gm_Constants::EMPTY) && ($LogWebPath ne Gm_Constants::EMPTY)) { $cgiwebpath = $LogWebPath; } if ($cgilocalpath eq Gm_Constants::EMPTY) { if ($ENV{'SCRIPT_FILENAME'}) { $cgilocalpath = $ENV{'SCRIPT_FILENAME'}; } elsif ($ENV{'PATH_TRANSLATED'}) { $cgilocalpath = $ENV{'PATH_TRANSLATED'}; $cgilocalpath =~ s/\\/\//g; } @cgilocalpathtemp = split(/\//, $cgilocalpath); pop(@cgilocalpathtemp); $cgilocalpath = join("\/", @cgilocalpathtemp); # added 1.3.1 - 1/20/05 flipped cracker $loglocalpath = $cgilocalpath; $loglocalpath =~ s/\/cgi-bin//g; # end additions } @cgipath = split(/\//, $cgilocalpath); $cgiwebpathextension = pop(@cgipath); # added 1.3.1 - 1/20/05 flipped cracker @logpath = split(/\//, $loglocalpath); $logwebpathextension = pop(@logpath); if ($logwebpathextension eq "public_html") { $logwebpathextensionnew = Gm_Constants::EMPTY; } else { $logwebpathextensionnew = "/"; $logwebpathextensionnew .= $logwebpathextension; } # end additions if ($cgiwebpath eq Gm_Constants::EMPTY) { $cgiwebpath = "http://$ENV{'HTTP_HOST'}/$cgiwebpathextension"; } if ($LogPath eq Gm_Constants::EMPTY) { $LogPath = $loglocalpath; } if ($EntriesPath eq Gm_Constants::EMPTY) { $EntriesPath = ("$loglocalpath" . "/archives"); } if ($LogWebPath eq Gm_Constants::EMPTY) { $LogWebPath = "http://$ENV{'HTTP_HOST'}$logwebpathextensionnew"; } if ($EntriesWebPath eq Gm_Constants::EMPTY) { $EntriesWebPath = "http://$ENV{'HTTP_HOST'}$logwebpathextensionnew/archives"; } &gm_writeconfig; } &gm_validate; if ($gmloginaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to log in without authorization"); $loginnotice = qq(<B><FONT COLOR="#FF0000">You don't have access to log in.</FONT></B><P>); &gm_login; } if ($statusnote eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#000000">Main Menu</FONT></B><P>); } if (($IN{'authorname'} eq "Alice") && ($IN{'authorpassword'} eq "wonderland")) { $setnameandpwcookie = Gm_Constants::EMPTY; } else { $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>"; } if ($cookiesallowed eq Gm_Constants::NO) { $setnameandpwcookie = Gm_Constants::EMPTY; } $visityoursitelink = Gm_Constants::EMPTY; ## TODO GET RID OF THIS! NO OPEN FILE HANDLES AND CALL OTHER, ITS JUST CHECKING THE FILE # THIS SHOULD BE LINK THAT LOOKS LIKE BUTTON, SEE MULTIEDIT unless (!(open(CHECKMATE,"<$LogPath/$indexfilename"))) { &gm_readcounter; unless ($newentrynumber eq "0") { $indexfilenamesmartcheck = "/$indexfilename"; $indexfilenameprefix = substr($indexfilename, 0, 6); if ($indexfilenameprefix eq "index.") { $indexfilenamesmartcheck = "/"; } $visityoursitelink = qq(<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>); } } close(CHECKMATE); print<<GMFRONTPAGE; $gmheadtag $gmframetop $statusnote $setnameandpwcookie <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=10 CELLSPACING=0 WIDTH=520> <TR><TD VALIGN=TOP ALIGN=CENTER COLSPAN=2>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Add A New Entry" STYLE="background: #D0FFD0; width: 500"><BR>Post a new entry to your weblog/journal.</FONT></FONT></TD></TR> <TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Configuration"><BR>Your site's settings and options.</FONT></FONT></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Edit An Entry"><BR>Edit entries and edit/delete comments.</FONT></FONT></TD></TR> <TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Edit Templates"><BR>Change your site's layout and appearance.</FONT></FONT></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Edit Authors"><BR>Edit or add authors to post to your site.</FONT></FONT></TD></TR> <TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Rebuild Files"><BR>Regenerate part or all of your site.</FONT></FONT></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="View Control Panel Log"><BR>A record of how your site's been used.</FONT></FONT></TD></TR> <TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Add Bookmarklets"><BR>Post entries with one click (IE 5+ only).</FONT></FONT></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Upload Files"><BR>Upload images or other files to your site.</FONT></FONT></TD></TR> <TR><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Edit Banned IP List"><BR>Ban someone from using your site.</FONT></FONT></TD><TD VALIGN=TOP ALIGN=CENTER WIDTH=50%>$gmfonttag<FONT SIZE=1><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Re-Login"><BR>Re-enter as another author.</FONT></FONT></TD></TR> </FORM> $visityoursitelink </TABLE> <P> $gmframebottom </BODY> </HTML> GMFRONTPAGE $statusnote = Gm_Constants::EMPTY; exit; } # ---------------- # templates editor # ---------------- sub gm_edittemplates { &gm_validate; if ($gmtemplateaccess eq Gm_Constants::NO) { gm_writetocplog("$IN{'authorname'} attempted to edit the templates without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the templates.</FONT></B><P>); &gm_frontpage; } if ($statusnote eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#000000">Edit Templates</FONT></B><BR><FONT SIZE=1>Select a group of templates to edit. Templates control<BR>the layout & format of every aspect of your weblog/journal.</FONT><P>); } if ($gmtemplateaccess eq "hfsonly") { $statusnote .= "<B>You only have access to edit the header, footer & sidebar templates.</B><P>"; } print<<GMEDITTEMPLATESMENU; $gmheadtag $gmframetop $statusnote <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 Main Index-Related Templates" STYLE="width: 320"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Edit Archive-Related Templates" STYLE="width: 320"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Edit Entry Page-Related Templates" STYLE="width: 320"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Edit Karma & Comments-Related Templates" STYLE="width: 320"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Edit Header, Footer & Sidebar Templates" STYLE="width: 320"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Edit Miscellaneous Templates" STYLE="width: 320"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="width: 320; background: #C0C0C0"> </FORM> <P> $gmframebottom </BODY> </HTML> GMEDITTEMPLATESMENU $statusnote = Gm_Constants::EMPTY; exit; } # ------------------------------- # edit template group: main index # ------------------------------- sub gm_editmainindextemplates { &gm_validate; if (($gmtemplateaccess eq Gm_Constants::NO) || ($gmtemplateaccess eq "hfsonly")) { gm_writetocplog("$IN{'authorname'} attempted to edit the main index templates without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the main index templates.</FONT></B><P>); &gm_frontpage; } &gm_readtemplates; &gm_delousealltemplates; if ($statusnote eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#000000">Editing Main Index-Related Templates</FONT></B><BR><FONT SIZE=1>These are the templates that affect the layout and appearance of your main index.</FONT><P>); } if ($gmrebuildaccess eq Gm_Constants::YES) { if ($automaticrebuilddefault eq Gm_Constants::YES) { $autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="index" CHECKED> Automatically rebuild main index after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>); } else { $autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="index"> Automatically rebuild main index after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>); } } &gm_readcounter; if ($newentrynumber eq "0") { $autorebuildcheckbox = Gm_Constants::EMPTY; } print<<GMEDITMAININDEXTEMPLATES; $gmheadtag $gmframetop $statusnote <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="modifiedtemplategroup" VALUE="main index"> <INPUT TYPE=HIDDEN NAME="newentrypagetemplate" VALUE="$gmentrypagetemplate"> <INPUT TYPE=HIDDEN NAME="newarchiveindextemplate" VALUE="$gmarchiveindextemplate"> <INPUT TYPE=HIDDEN NAME="newarchiveentrypagetemplate" VALUE="$gmarchiveentrypagetemplate"> <INPUT TYPE=HIDDEN NAME="newarchiveentrytemplate" VALUE="$gmarchiveentrytemplate"> <INPUT TYPE=HIDDEN NAME="newcommentstemplate" VALUE="$gmcommentstemplate"> <INPUT TYPE=HIDDEN NAME="newcommentsformtemplate" VALUE="$gmcommentsformtemplate"> <INPUT TYPE=HIDDEN NAME="newparaseparationtemplate" VALUE="$gmparaseparationtemplate"> <INPUT TYPE=HIDDEN NAME="newkarmaformtemplate" VALUE="$gmkarmaformtemplate"> <INPUT TYPE=HIDDEN NAME="newlinktargettemplate" VALUE="$gmlinktargettemplate"> <INPUT TYPE=HIDDEN NAME="newkarmalinktemplate" VALUE="$gmkarmalinktemplate"> <INPUT TYPE=HIDDEN NAME="newcommentslinktemplate" VALUE="$gmcommentslinktemplate"> <INPUT TYPE=HIDDEN NAME="newcommentauthoremailtemplate" VALUE="$gmcommentauthoremailtemplate"> <INPUT TYPE=HIDDEN NAME="newcommentauthorhomepagetemplate" VALUE="$gmcommentauthorhomepagetemplate"> <INPUT TYPE=HIDDEN NAME="newcommentdividertemplate" VALUE="$gmcommentdividertemplate"> <INPUT TYPE=HIDDEN NAME="newmoreentrypagetemplate" VALUE="$gmmoreentrypagetemplate"> <INPUT TYPE=HIDDEN NAME="newmorearchiveentrypagetemplate" VALUE="$gmmorearchiveentrypagetemplate"> <INPUT TYPE=HIDDEN NAME="newpreviouslinktemplate" VALUE="$gmpreviouslinktemplate"> <INPUT TYPE=HIDDEN NAME="newnextlinktemplate" VALUE="$gmnextlinktemplate"> <INPUT TYPE=HIDDEN NAME="newpreviousmorelinktemplate" VALUE="$gmpreviousmorelinktemplate"> <INPUT TYPE=HIDDEN NAME="newnextmorelinktemplate" VALUE="$gmnextmorelinktemplate"> <INPUT TYPE=HIDDEN NAME="newarchivemasterindextemplate" VALUE="$gmarchivemasterindextemplate"> <INPUT TYPE=HIDDEN NAME="newlogarchiveslinktemplate" VALUE="$gmlogarchiveslinktemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinktemplate" VALUE="$gmentrypagelinktemplate"> <INPUT TYPE=HIDDEN NAME="newmoreentrypagelinktemplate" VALUE="$gmmoreentrypagelinktemplate"> <INPUT TYPE=HIDDEN NAME="newlogarchiveslinkseparatortemplate" VALUE="$gmlogarchiveslinkseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinkseparatortemplate" VALUE="$gmentrypagelinkseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinkmonthseparatortemplate" VALUE="$gmentrypagelinkmonthseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinkdayseparatortemplate" VALUE="$gmentrypagelinkdayseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinkyearseparatortemplate" VALUE="$gmentrypagelinkyearseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newheadertemplate" VALUE="$gmheadertemplate"> <INPUT TYPE=HIDDEN NAME="newfootertemplate" VALUE="$gmfootertemplate"> <INPUT TYPE=HIDDEN NAME="newsidebartemplate" VALUE="$gmsidebartemplate"> <INPUT TYPE=HIDDEN NAME="newarchiveentryseparatortemplate" VALUE="$gmarchiveentryseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newmorearchiveentrytemplate" VALUE="$gmmorearchiveentrytemplate"> <INPUT TYPE=HIDDEN NAME="newdatearchivetemplate" VALUE="$gmdatearchivetemplate"> <INPUT TYPE=HIDDEN NAME="newlogarchiveslinkweeklytemplate" VALUE="$gmlogarchiveslinkweeklytemplate"> <INPUT TYPE=HIDDEN NAME="newcustomonetemplate" VALUE="$gmcustomonetemplate"> <INPUT TYPE=HIDDEN NAME="newcustomtwotemplate" VALUE="$gmcustomtwotemplate"> <INPUT TYPE=HIDDEN NAME="newcustomthreetemplate" VALUE="$gmcustomthreetemplate"> <INPUT TYPE=HIDDEN NAME="newcustomfourtemplate" VALUE="$gmcustomfourtemplate"> <INPUT TYPE=HIDDEN NAME="newcustomfivetemplate" VALUE="$gmcustomfivetemplate"> <INPUT TYPE=HIDDEN NAME="newcustomsixtemplate" VALUE="$gmcustomsixtemplate"> <INPUT TYPE=HIDDEN NAME="newcustomseventemplate" VALUE="$gmcustomseventemplate"> <INPUT TYPE=HIDDEN NAME="newcustomeighttemplate" VALUE="$gmcustomeighttemplate"> <INPUT TYPE=HIDDEN NAME="newcustomninetemplate" VALUE="$gmcustomninetemplate"> <INPUT TYPE=HIDDEN NAME="newcustomtentemplate" VALUE="$gmcustomtentemplate"> <INPUT TYPE=HIDDEN NAME="newpopuppagetemplate" VALUE="$gmpopuppagetemplate"> <INPUT TYPE=HIDDEN NAME="newpopupcodetemplate" VALUE="$gmpopupcodetemplate"> <INPUT TYPE=HIDDEN NAME="newsearchformtemplate" VALUE="$gmsearchformtemplate"> <INPUT TYPE=HIDDEN NAME="newsearchresultspagetemplate" VALUE="$gmsearchresultspagetemplate"> <INPUT TYPE=HIDDEN NAME="newsearchresultsentrytemplate" VALUE="$gmsearchresultsentrytemplate"> <INPUT TYPE=HIDDEN NAME="newcalendartablebeginningtemplate" VALUE="$gmcalendartablebeginningtemplate"> <INPUT TYPE=HIDDEN NAME="newcalendartableendingtemplate" VALUE="$gmcalendartableendingtemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarblankcelltemplate" VALUE="$gmcalendarblankcelltemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarfullcelltemplate" VALUE="$gmcalendarfullcelltemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarfullcelllinktemplate" VALUE="$gmcalendarfullcelllinktemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarweekfulldaytemplate" VALUE="$gmcalendarweekfulldaytemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarweekfulldaylinktemplate" VALUE="$gmcalendarweekfulldaylinktemplate"> <INPUT TYPE=HIDDEN NAME="newcommentpreviewdividertemplate" VALUE="$gmcommentpreviewdividertemplate"> <INPUT TYPE=HIDDEN NAME="newcommentpreviewformtemplate" VALUE="$gmcommentpreviewformtemplate"> <INPUT TYPE=HIDDEN NAME="newsmartlinknocommentstemplate" VALUE="$gmsmartlinknocommentstemplate"> <INPUT TYPE=HIDDEN NAME="newsmartlinkonecommenttemplate" VALUE="$gmsmartlinkonecommenttemplate"> <INPUT TYPE=HIDDEN NAME="newsmartlinkmanycommentstemplate" VALUE="$gmsmartlinkmanycommentstemplate"> <INPUT TYPE=HIDDEN NAME="newlinebreaktemplate" VALUE="$gmlinebreaktemplate"> <INPUT TYPE=HIDDEN NAME="newcommentlinktargettemplate" VALUE="$gmcommentlinktargettemplate"> <INPUT TYPE=HIDDEN NAME="newsmartentrymoodtemplate" VALUE="$gmsmartentrymoodtemplate"> <INPUT TYPE=HIDDEN NAME="newsmartentrymusictemplate" VALUE="$gmsmartentrymusictemplate"> <INPUT TYPE=HIDDEN NAME="newdategroupingfooterarchivetemplate" VALUE="$gmdategroupingfooterarchivetemplate"> <INPUT TYPE=HIDDEN NAME="newcookiescodetemplate" VALUE="$gmcookiescodetemplate"> <INPUT TYPE=HIDDEN NAME="newsmartemoticonscodetemplate" VALUE="$gmsmartemoticonscodetemplate"> <INPUT TYPE=HIDDEN NAME="newgmusererrorheadertemplate" VALUE="$gmusererrorheadertemplate"> <INPUT TYPE=HIDDEN NAME="newgmusererrorfootertemplate" VALUE="$gmusererrorfootertemplate"> <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=720> <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> <TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR> <tr><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2><TABLE BORDER=0 cellpadding=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> <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> <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> <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> </TABLE> $autorebuildcheckbox <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Save Template Changes"> <INPUT TYPE=RESET CLASS="button" STYLE="background: #FFD0D0" VALUE="Undo Changes Since Last Save"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Templates Menu"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0"> </FORM> <P> $gmframebottom </BODY> </HTML> GMEDITMAININDEXTEMPLATES $statusnote = Gm_Constants::EMPTY; exit; } # ----------------------------- # edit template group: archives # ----------------------------- sub gm_editarchivetemplates { &gm_validate; if (($gmtemplateaccess eq Gm_Constants::NO) || ($gmtemplateaccess eq "hfsonly")) { gm_writetocplog("$IN{'authorname'} attempted to edit the archive templates without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the archive templates.</FONT></B><P>); &gm_frontpage; } &gm_readtemplates; &gm_delousealltemplates; if ($statusnote eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#000000">Editing Archive-Related Templates</FONT></B><BR><FONT SIZE=1>These are the templates that affect the layout and appearance of your archives.</FONT><P>); } $autorebuildcheckbox = Gm_Constants::EMPTY; if ($gmrebuildaccess eq Gm_Constants::YES) { if ($automaticrebuilddefault eq Gm_Constants::YES) { $autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="archiveindexes" CHECKED> Automatically rebuild archive master index and log indexes after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>); } else { $autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="archiveindexes"> Automatically rebuild archive master index and log indexes after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>); } } &gm_readcounter; if ($newentrynumber eq "0") { $autorebuildcheckbox = Gm_Constants::EMPTY; } print<<GMEDITARCHIVETEMPLATES; $gmheadtag $gmframetop $statusnote <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="modifiedtemplategroup" VALUE="archive"> <INPUT TYPE=HIDDEN NAME="newindextemplate" VALUE="$gmindextemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagetemplate" VALUE="$gmentrypagetemplate"> <INPUT TYPE=HIDDEN NAME="newarchiveentrypagetemplate" VALUE="$gmarchiveentrypagetemplate"> <INPUT TYPE=HIDDEN NAME="newentrytemplate" VALUE="$gmentrytemplate"> <INPUT TYPE=HIDDEN NAME="newstayattoptemplate" VALUE="$gmstayattoptemplate"> <INPUT TYPE=HIDDEN NAME="newdatetemplate" VALUE="$gmdatetemplate"> <INPUT TYPE=HIDDEN NAME="newcommentstemplate" VALUE="$gmcommentstemplate"> <INPUT TYPE=HIDDEN NAME="newcommentsformtemplate" VALUE="$gmcommentsformtemplate"> <INPUT TYPE=HIDDEN NAME="newparaseparationtemplate" VALUE="$gmparaseparationtemplate"> <INPUT TYPE=HIDDEN NAME="newkarmaformtemplate" VALUE="$gmkarmaformtemplate"> <INPUT TYPE=HIDDEN NAME="newlinktargettemplate" VALUE="$gmlinktargettemplate"> <INPUT TYPE=HIDDEN NAME="newdategroupingfootertemplate" VALUE="$gmdategroupingfootertemplate"> <INPUT TYPE=HIDDEN NAME="newkarmalinktemplate" VALUE="$gmkarmalinktemplate"> <INPUT TYPE=HIDDEN NAME="newcommentslinktemplate" VALUE="$gmcommentslinktemplate"> <INPUT TYPE=HIDDEN NAME="newcommentauthoremailtemplate" VALUE="$gmcommentauthoremailtemplate"> <INPUT TYPE=HIDDEN NAME="newcommentauthorhomepagetemplate" VALUE="$gmcommentauthorhomepagetemplate"> <INPUT TYPE=HIDDEN NAME="newcommentdividertemplate" VALUE="$gmcommentdividertemplate"> <INPUT TYPE=HIDDEN NAME="newmoreentrytemplate" VALUE="$gmmoreentrytemplate"> <INPUT TYPE=HIDDEN NAME="newmoreentrypagetemplate" VALUE="$gmmoreentrypagetemplate"> <INPUT TYPE=HIDDEN NAME="newmorearchiveentrypagetemplate" VALUE="$gmmorearchiveentrypagetemplate"> <INPUT TYPE=HIDDEN NAME="newpreviouslinktemplate" VALUE="$gmpreviouslinktemplate"> <INPUT TYPE=HIDDEN NAME="newnextlinktemplate" VALUE="$gmnextlinktemplate"> <INPUT TYPE=HIDDEN NAME="newpreviousmorelinktemplate" VALUE="$gmpreviousmorelinktemplate"> <INPUT TYPE=HIDDEN NAME="newnextmorelinktemplate" VALUE="$gmnextmorelinktemplate"> <INPUT TYPE=HIDDEN NAME="newlogarchiveslinktemplate" VALUE="$gmlogarchiveslinktemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinktemplate" VALUE="$gmentrypagelinktemplate"> <INPUT TYPE=HIDDEN NAME="newmoreentrypagelinktemplate" VALUE="$gmmoreentrypagelinktemplate"> <INPUT TYPE=HIDDEN NAME="newlogarchiveslinkseparatortemplate" VALUE="$gmlogarchiveslinkseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinkseparatortemplate" VALUE="$gmentrypagelinkseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinkmonthseparatortemplate" VALUE="$gmentrypagelinkmonthseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinkdayseparatortemplate" VALUE="$gmentrypagelinkdayseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinkyearseparatortemplate" VALUE="$gmentrypagelinkyearseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newheadertemplate" VALUE="$gmheadertemplate"> <INPUT TYPE=HIDDEN NAME="newfootertemplate" VALUE="$gmfootertemplate"> <INPUT TYPE=HIDDEN NAME="newsidebartemplate" VALUE="$gmsidebartemplate"> <INPUT TYPE=HIDDEN NAME="newentryseparatortemplate" VALUE="$gmentryseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newlogarchiveslinkweeklytemplate" VALUE="$gmlogarchiveslinkweeklytemplate"> <INPUT TYPE=HIDDEN NAME="newcustomonetemplate" VALUE="$gmcustomonetemplate"> <INPUT TYPE=HIDDEN NAME="newcustomtwotemplate" VALUE="$gmcustomtwotemplate"> <INPUT TYPE=HIDDEN NAME="newcustomthreetemplate" VALUE="$gmcustomthreetemplate"> <INPUT TYPE=HIDDEN NAME="newcustomfourtemplate" VALUE="$gmcustomfourtemplate"> <INPUT TYPE=HIDDEN NAME="newcustomfivetemplate" VALUE="$gmcustomfivetemplate"> <INPUT TYPE=HIDDEN NAME="newcustomsixtemplate" VALUE="$gmcustomsixtemplate"> <INPUT TYPE=HIDDEN NAME="newcustomseventemplate" VALUE="$gmcustomseventemplate"> <INPUT TYPE=HIDDEN NAME="newcustomeighttemplate" VALUE="$gmcustomeighttemplate"> <INPUT TYPE=HIDDEN NAME="newcustomninetemplate" VALUE="$gmcustomninetemplate"> <INPUT TYPE=HIDDEN NAME="newcustomtentemplate" VALUE="$gmcustomtentemplate"> <INPUT TYPE=HIDDEN NAME="newpopuppagetemplate" VALUE="$gmpopuppagetemplate"> <INPUT TYPE=HIDDEN NAME="newpopupcodetemplate" VALUE="$gmpopupcodetemplate"> <INPUT TYPE=HIDDEN NAME="newsearchformtemplate" VALUE="$gmsearchformtemplate"> <INPUT TYPE=HIDDEN NAME="newsearchresultspagetemplate" VALUE="$gmsearchresultspagetemplate"> <INPUT TYPE=HIDDEN NAME="newsearchresultsentrytemplate" VALUE="$gmsearchresultsentrytemplate"> <INPUT TYPE=HIDDEN NAME="newcalendartablebeginningtemplate" VALUE="$gmcalendartablebeginningtemplate"> <INPUT TYPE=HIDDEN NAME="newcalendartableendingtemplate" VALUE="$gmcalendartableendingtemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarblankcelltemplate" VALUE="$gmcalendarblankcelltemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarfullcelltemplate" VALUE="$gmcalendarfullcelltemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarfullcelllinktemplate" VALUE="$gmcalendarfullcelllinktemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarweekfulldaytemplate" VALUE="$gmcalendarweekfulldaytemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarweekfulldaylinktemplate" VALUE="$gmcalendarweekfulldaylinktemplate"> <INPUT TYPE=HIDDEN NAME="newcommentpreviewdividertemplate" VALUE="$gmcommentpreviewdividertemplate"> <INPUT TYPE=HIDDEN NAME="newcommentpreviewformtemplate" VALUE="$gmcommentpreviewformtemplate"> <INPUT TYPE=HIDDEN NAME="newsmartlinknocommentstemplate" VALUE="$gmsmartlinknocommentstemplate"> <INPUT TYPE=HIDDEN NAME="newsmartlinkonecommenttemplate" VALUE="$gmsmartlinkonecommenttemplate"> <INPUT TYPE=HIDDEN NAME="newsmartlinkmanycommentstemplate" VALUE="$gmsmartlinkmanycommentstemplate"> <INPUT TYPE=HIDDEN NAME="newlinebreaktemplate" VALUE="$gmlinebreaktemplate"> <INPUT TYPE=HIDDEN NAME="newcommentlinktargettemplate" VALUE="$gmcommentlinktargettemplate"> <INPUT TYPE=HIDDEN NAME="newsmartentrymoodtemplate" VALUE="$gmsmartentrymoodtemplate"> <INPUT TYPE=HIDDEN NAME="newsmartentrymusictemplate" VALUE="$gmsmartentrymusictemplate"> <INPUT TYPE=HIDDEN NAME="newcookiescodetemplate" VALUE="$gmcookiescodetemplate"> <INPUT TYPE=HIDDEN NAME="newsmartemoticonscodetemplate" VALUE="$gmsmartemoticonscodetemplate"> <INPUT TYPE=HIDDEN NAME="newgmusererrorheadertemplate" VALUE="$gmusererrorheadertemplate"> <INPUT TYPE=HIDDEN NAME="newgmusererrorfootertemplate" VALUE="$gmusererrorfootertemplate"> <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=720> <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://greymatterforum.proboards82.com/" 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> <TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR> <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> <TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR> <TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2><TABLE BORDER=0 cellpadding=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> <TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR> <tr><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD VALIGN=TOP ALIGN=CENTER><TABLE BORDER=0 cellpadding=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> <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> </TABLE> $autorebuildcheckbox <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Save Template Changes"> <INPUT TYPE=RESET CLASS="button" STYLE="background: #FFD0D0" VALUE="Undo Changes Since Last Save"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Templates Menu"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0"> </FORM> <P> $gmframebottom </BODY> </HTML> GMEDITARCHIVETEMPLATES $statusnote = Gm_Constants::EMPTY; exit; } # -------------------------------- # edit template group: entry pages # -------------------------------- sub gm_editentrypagetemplates { &gm_validate; if (($gmtemplateaccess eq Gm_Constants::NO) || ($gmtemplateaccess eq "hfsonly")) { gm_writetocplog("$IN{'authorname'} attempted to edit the entry page templates without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the entry page templates.</FONT></B><P>); &gm_frontpage; } &gm_readtemplates; &gm_delousealltemplates; if ($statusnote eq Gm_Constants::EMPTY) { $statusnote = qq(<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=720><TR><TD VALIGN=MIDDLE ALIGN=CENTER>$gmfonttag<B><FONT COLOR="#000000">Editing Entry Page-Related Templates</FONT></B><BR><FONT SIZE=1>These are the templates that affect the layout and appearance of the pages for your individual entries (as opposed to the Index Entry templates, in the Main Index and Archive template groups, which customise how entries appear in the body of your log). If you have "Generate pages for individual entries" disabled in Configuration, you can ignore these templates.</FONT></TD></TR></TABLE><P>); } $autorebuildcheckbox = Gm_Constants::EMPTY; if ($gmrebuildaccess eq Gm_Constants::YES) { if ($automaticrebuilddefault eq Gm_Constants::YES) { $autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="entrypages" CHECKED> Automatically rebuild all entry pages after saving\n<BR>\n<FONT SIZE=1> After clicking Save, expect a wait of up to several minutes if leaving this box checked. <BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>); } else { $autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="entrypages"> Automatically rebuild all entry pages after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>); } } &gm_readcounter; if ($newentrynumber eq "0") { $autorebuildcheckbox = Gm_Constants::EMPTY; } print<<GMEDITENTRYPAGETEMPLATES; $gmheadtag $gmframetop $statusnote <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="modifiedtemplategroup" VALUE="entry page"> <INPUT TYPE=HIDDEN NAME="newindextemplate" VALUE="$gmindextemplate"> <INPUT TYPE=HIDDEN NAME="newarchiveindextemplate" VALUE="$gmarchiveindextemplate"> <INPUT TYPE=HIDDEN NAME="newentrytemplate" VALUE="$gmentrytemplate"> <INPUT TYPE=HIDDEN NAME="newarchiveentrytemplate" VALUE="$gmarchiveentrytemplate"> <INPUT TYPE=HIDDEN NAME="newstayattoptemplate" VALUE="$gmstayattoptemplate"> <INPUT TYPE=HIDDEN NAME="newdatetemplate" VALUE="$gmdatetemplate"> <INPUT TYPE=HIDDEN NAME="newcommentstemplate" VALUE="$gmcommentstemplate"> <INPUT TYPE=HIDDEN NAME="newcommentsformtemplate" VALUE="$gmcommentsformtemplate"> <INPUT TYPE=HIDDEN NAME="newparaseparationtemplate" VALUE="$gmparaseparationtemplate"> <INPUT TYPE=HIDDEN NAME="newkarmaformtemplate" VALUE="$gmkarmaformtemplate"> <INPUT TYPE=HIDDEN NAME="newlinktargettemplate" VALUE="$gmlinktargettemplate"> <INPUT TYPE=HIDDEN NAME="newdategroupingfootertemplate" VALUE="$gmdategroupingfootertemplate"> <INPUT TYPE=HIDDEN NAME="newkarmalinktemplate" VALUE="$gmkarmalinktemplate"> <INPUT TYPE=HIDDEN NAME="newcommentslinktemplate" VALUE="$gmcommentslinktemplate"> <INPUT TYPE=HIDDEN NAME="newcommentauthoremailtemplate" VALUE="$gmcommentauthoremailtemplate"> <INPUT TYPE=HIDDEN NAME="newcommentauthorhomepagetemplate" VALUE="$gmcommentauthorhomepagetemplate"> <INPUT TYPE=HIDDEN NAME="newcommentdividertemplate" VALUE="$gmcommentdividertemplate"> <INPUT TYPE=HIDDEN NAME="newmoreentrytemplate" VALUE="$gmmoreentrytemplate"> <INPUT TYPE=HIDDEN NAME="newpreviouslinktemplate" VALUE="$gmpreviouslinktemplate"> <INPUT TYPE=HIDDEN NAME="newnextlinktemplate" VALUE="$gmnextlinktemplate"> <INPUT TYPE=HIDDEN NAME="newpreviousmorelinktemplate" VALUE="$gmpreviousmorelinktemplate"> <INPUT TYPE=HIDDEN NAME="newnextmorelinktemplate" VALUE="$gmnextmorelinktemplate"> <INPUT TYPE=HIDDEN NAME="newarchivemasterindextemplate" VALUE="$gmarchivemasterindextemplate"> <INPUT TYPE=HIDDEN NAME="newlogarchiveslinktemplate" VALUE="$gmlogarchiveslinktemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinktemplate" VALUE="$gmentrypagelinktemplate"> <INPUT TYPE=HIDDEN NAME="newmoreentrypagelinktemplate" VALUE="$gmmoreentrypagelinktemplate"> <INPUT TYPE=HIDDEN NAME="newlogarchiveslinkseparatortemplate" VALUE="$gmlogarchiveslinkseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinkseparatortemplate" VALUE="$gmentrypagelinkseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinkmonthseparatortemplate" VALUE="$gmentrypagelinkmonthseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinkdayseparatortemplate" VALUE="$gmentrypagelinkdayseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinkyearseparatortemplate" VALUE="$gmentrypagelinkyearseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newheadertemplate" VALUE="$gmheadertemplate"> <INPUT TYPE=HIDDEN NAME="newfootertemplate" VALUE="$gmfootertemplate"> <INPUT TYPE=HIDDEN NAME="newsidebartemplate" VALUE="$gmsidebartemplate"> <INPUT TYPE=HIDDEN NAME="newentryseparatortemplate" VALUE="$gmentryseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newarchiveentryseparatortemplate" VALUE="$gmarchiveentryseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newmorearchiveentrytemplate" VALUE="$gmmorearchiveentrytemplate"> <INPUT TYPE=HIDDEN NAME="newdatearchivetemplate" VALUE="$gmdatearchivetemplate"> <INPUT TYPE=HIDDEN NAME="newlogarchiveslinkweeklytemplate" VALUE="$gmlogarchiveslinkweeklytemplate"> <INPUT TYPE=HIDDEN NAME="newcustomonetemplate" VALUE="$gmcustomonetemplate"> <INPUT TYPE=HIDDEN NAME="newcustomtwotemplate" VALUE="$gmcustomtwotemplate"> <INPUT TYPE=HIDDEN NAME="newcustomthreetemplate" VALUE="$gmcustomthreetemplate"> <INPUT TYPE=HIDDEN NAME="newcustomfourtemplate" VALUE="$gmcustomfourtemplate"> <INPUT TYPE=HIDDEN NAME="newcustomfivetemplate" VALUE="$gmcustomfivetemplate"> <INPUT TYPE=HIDDEN NAME="newcustomsixtemplate" VALUE="$gmcustomsixtemplate"> <INPUT TYPE=HIDDEN NAME="newcustomseventemplate" VALUE="$gmcustomseventemplate"> <INPUT TYPE=HIDDEN NAME="newcustomeighttemplate" VALUE="$gmcustomeighttemplate"> <INPUT TYPE=HIDDEN NAME="newcustomninetemplate" VALUE="$gmcustomninetemplate"> <INPUT TYPE=HIDDEN NAME="newcustomtentemplate" VALUE="$gmcustomtentemplate"> <INPUT TYPE=HIDDEN NAME="newpopuppagetemplate" VALUE="$gmpopuppagetemplate"> <INPUT TYPE=HIDDEN NAME="newpopupcodetemplate" VALUE="$gmpopupcodetemplate"> <INPUT TYPE=HIDDEN NAME="newsearchformtemplate" VALUE="$gmsearchformtemplate"> <INPUT TYPE=HIDDEN NAME="newsearchresultspagetemplate" VALUE="$gmsearchresultspagetemplate"> <INPUT TYPE=HIDDEN NAME="newsearchresultsentrytemplate" VALUE="$gmsearchresultsentrytemplate"> <INPUT TYPE=HIDDEN NAME="newcalendartablebeginningtemplate" VALUE="$gmcalendartablebeginningtemplate"> <INPUT TYPE=HIDDEN NAME="newcalendartableendingtemplate" VALUE="$gmcalendartableendingtemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarblankcelltemplate" VALUE="$gmcalendarblankcelltemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarfullcelltemplate" VALUE="$gmcalendarfullcelltemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarfullcelllinktemplate" VALUE="$gmcalendarfullcelllinktemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarweekfulldaytemplate" VALUE="$gmcalendarweekfulldaytemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarweekfulldaylinktemplate" VALUE="$gmcalendarweekfulldaylinktemplate"> <INPUT TYPE=HIDDEN NAME="newcommentpreviewdividertemplate" VALUE="$gmcommentpreviewdividertemplate"> <INPUT TYPE=HIDDEN NAME="newcommentpreviewformtemplate" VALUE="$gmcommentpreviewformtemplate"> <INPUT TYPE=HIDDEN NAME="newsmartlinknocommentstemplate" VALUE="$gmsmartlinknocommentstemplate"> <INPUT TYPE=HIDDEN NAME="newsmartlinkonecommenttemplate" VALUE="$gmsmartlinkonecommenttemplate"> <INPUT TYPE=HIDDEN NAME="newsmartlinkmanycommentstemplate" VALUE="$gmsmartlinkmanycommentstemplate"> <INPUT TYPE=HIDDEN NAME="newlinebreaktemplate" VALUE="$gmlinebreaktemplate"> <INPUT TYPE=HIDDEN NAME="newcommentlinktargettemplate" VALUE="$gmcommentlinktargettemplate"> <INPUT TYPE=HIDDEN NAME="newsmartentrymoodtemplate" VALUE="$gmsmartentrymoodtemplate"> <INPUT TYPE=HIDDEN NAME="newsmartentrymusictemplate" VALUE="$gmsmartentrymusictemplate"> <INPUT TYPE=HIDDEN NAME="newdategroupingfooterarchivetemplate" VALUE="$gmdategroupingfooterarchivetemplate"> <INPUT TYPE=HIDDEN NAME="newcookiescodetemplate" VALUE="$gmcookiescodetemplate"> <INPUT TYPE=HIDDEN NAME="newsmartemoticonscodetemplate" VALUE="$gmsmartemoticonscodetemplate"> <INPUT TYPE=HIDDEN NAME="newgmusererrorheadertemplate" VALUE="$gmusererrorheadertemplate"> <INPUT TYPE=HIDDEN NAME="newgmusererrorfootertemplate" VALUE="$gmusererrorfootertemplate"> <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=720> <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> <TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR> <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> <TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR> <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> <TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR> <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> </TABLE> $autorebuildcheckbox <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Save Template Changes"> <INPUT TYPE=RESET CLASS="button" STYLE="background: #FFD0D0" VALUE="Undo Changes Since Last Save"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Templates Menu"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0"> </FORM> <P> $gmframebottom </BODY> </HTML> GMEDITENTRYPAGETEMPLATES $statusnote = Gm_Constants::EMPTY; exit; } # ------------------------------------- # edit template group: karma & comments # ------------------------------------- sub gm_editkarmacommentstemplates { &gm_validate; if (($gmtemplateaccess eq Gm_Constants::NO) || ($gmtemplateaccess eq "hfsonly")) { gm_writetocplog("$IN{'authorname'} attempted to edit the karma & comments templates without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the karma & comments templates.</FONT></B><P>); &gm_frontpage; } &gm_readtemplates; &gm_delousealltemplates; if ($statusnote eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#000000">Editing Karma & Comments-Related Templates</FONT></B><BR><FONT SIZE=1>These are the templates that affect all elements relating to karma voting and comment posting; if you have<BR>either or both of those disabled, you can ignore the templates relating to them. All these templates<BR>affect things that will not appear on entries for which karma voting and/or comment posting is disabled.</FONT><P>); } $autorebuildcheckbox = Gm_Constants::EMPTY; if ($gmrebuildaccess eq Gm_Constants::YES) { if ($automaticrebuilddefault eq Gm_Constants::YES) { $autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="everything" CHECKED> Automatically rebuild all files after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>); } else { $autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="everything"> Automatically rebuild all files after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>); } } &gm_readcounter; if ($newentrynumber eq "0") { $autorebuildcheckbox = Gm_Constants::EMPTY; } print<<GMEDITKARMACOMMENTSTEMPLATES; $gmheadtag $gmframetop $statusnote <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="modifiedtemplategroup" VALUE="karma & comments"> <INPUT TYPE=HIDDEN NAME="newindextemplate" VALUE="$gmindextemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagetemplate" VALUE="$gmentrypagetemplate"> <INPUT TYPE=HIDDEN NAME="newarchiveindextemplate" VALUE="$gmarchiveindextemplate"> <INPUT TYPE=HIDDEN NAME="newarchiveentrypagetemplate" VALUE="$gmarchiveentrypagetemplate"> <INPUT TYPE=HIDDEN NAME="newentrytemplate" VALUE="$gmentrytemplate"> <INPUT TYPE=HIDDEN NAME="newarchiveentrytemplate" VALUE="$gmarchiveentrytemplate"> <INPUT TYPE=HIDDEN NAME="newstayattoptemplate" VALUE="$gmstayattoptemplate"> <INPUT TYPE=HIDDEN NAME="newdatetemplate" VALUE="$gmdatetemplate"> <INPUT TYPE=HIDDEN NAME="newparaseparationtemplate" VALUE="$gmparaseparationtemplate"> <INPUT TYPE=HIDDEN NAME="newlinktargettemplate" VALUE="$gmlinktargettemplate"> <INPUT TYPE=HIDDEN NAME="newdategroupingfootertemplate" VALUE="$gmdategroupingfootertemplate"> <INPUT TYPE=HIDDEN NAME="newmoreentrytemplate" VALUE="$gmmoreentrytemplate"> <INPUT TYPE=HIDDEN NAME="newmoreentrypagetemplate" VALUE="$gmmoreentrypagetemplate"> <INPUT TYPE=HIDDEN NAME="newmorearchiveentrypagetemplate" VALUE="$gmmorearchiveentrypagetemplate"> <INPUT TYPE=HIDDEN NAME="newpreviouslinktemplate" VALUE="$gmpreviouslinktemplate"> <INPUT TYPE=HIDDEN NAME="newnextlinktemplate" VALUE="$gmnextlinktemplate"> <INPUT TYPE=HIDDEN NAME="newpreviousmorelinktemplate" VALUE="$gmpreviousmorelinktemplate"> <INPUT TYPE=HIDDEN NAME="newnextmorelinktemplate" VALUE="$gmnextmorelinktemplate"> <INPUT TYPE=HIDDEN NAME="newarchivemasterindextemplate" VALUE="$gmarchivemasterindextemplate"> <INPUT TYPE=HIDDEN NAME="newlogarchiveslinktemplate" VALUE="$gmlogarchiveslinktemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinktemplate" VALUE="$gmentrypagelinktemplate"> <INPUT TYPE=HIDDEN NAME="newmoreentrypagelinktemplate" VALUE="$gmmoreentrypagelinktemplate"> <INPUT TYPE=HIDDEN NAME="newlogarchiveslinkseparatortemplate" VALUE="$gmlogarchiveslinkseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinkseparatortemplate" VALUE="$gmentrypagelinkseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinkmonthseparatortemplate" VALUE="$gmentrypagelinkmonthseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinkdayseparatortemplate" VALUE="$gmentrypagelinkdayseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinkyearseparatortemplate" VALUE="$gmentrypagelinkyearseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newheadertemplate" VALUE="$gmheadertemplate"> <INPUT TYPE=HIDDEN NAME="newfootertemplate" VALUE="$gmfootertemplate"> <INPUT TYPE=HIDDEN NAME="newsidebartemplate" VALUE="$gmsidebartemplate"> <INPUT TYPE=HIDDEN NAME="newentryseparatortemplate" VALUE="$gmentryseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newarchiveentryseparatortemplate" VALUE="$gmarchiveentryseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newmorearchiveentrytemplate" VALUE="$gmmorearchiveentrytemplate"> <INPUT TYPE=HIDDEN NAME="newdatearchivetemplate" VALUE="$gmdatearchivetemplate"> <INPUT TYPE=HIDDEN NAME="newlogarchiveslinkweeklytemplate" VALUE="$gmlogarchiveslinkweeklytemplate"> <INPUT TYPE=HIDDEN NAME="newcustomonetemplate" VALUE="$gmcustomonetemplate"> <INPUT TYPE=HIDDEN NAME="newcustomtwotemplate" VALUE="$gmcustomtwotemplate"> <INPUT TYPE=HIDDEN NAME="newcustomthreetemplate" VALUE="$gmcustomthreetemplate"> <INPUT TYPE=HIDDEN NAME="newcustomfourtemplate" VALUE="$gmcustomfourtemplate"> <INPUT TYPE=HIDDEN NAME="newcustomfivetemplate" VALUE="$gmcustomfivetemplate"> <INPUT TYPE=HIDDEN NAME="newcustomsixtemplate" VALUE="$gmcustomsixtemplate"> <INPUT TYPE=HIDDEN NAME="newcustomseventemplate" VALUE="$gmcustomseventemplate"> <INPUT TYPE=HIDDEN NAME="newcustomeighttemplate" VALUE="$gmcustomeighttemplate"> <INPUT TYPE=HIDDEN NAME="newcustomninetemplate" VALUE="$gmcustomninetemplate"> <INPUT TYPE=HIDDEN NAME="newcustomtentemplate" VALUE="$gmcustomtentemplate"> <INPUT TYPE=HIDDEN NAME="newpopuppagetemplate" VALUE="$gmpopuppagetemplate"> <INPUT TYPE=HIDDEN NAME="newpopupcodetemplate" VALUE="$gmpopupcodetemplate"> <INPUT TYPE=HIDDEN NAME="newsearchformtemplate" VALUE="$gmsearchformtemplate"> <INPUT TYPE=HIDDEN NAME="newsearchresultspagetemplate" VALUE="$gmsearchresultspagetemplate"> <INPUT TYPE=HIDDEN NAME="newsearchresultsentrytemplate" VALUE="$gmsearchresultsentrytemplate"> <INPUT TYPE=HIDDEN NAME="newcalendartablebeginningtemplate" VALUE="$gmcalendartablebeginningtemplate"> <INPUT TYPE=HIDDEN NAME="newcalendartableendingtemplate" VALUE="$gmcalendartableendingtemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarblankcelltemplate" VALUE="$gmcalendarblankcelltemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarfullcelltemplate" VALUE="$gmcalendarfullcelltemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarfullcelllinktemplate" VALUE="$gmcalendarfullcelllinktemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarweekfulldaytemplate" VALUE="$gmcalendarweekfulldaytemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarweekfulldaylinktemplate" VALUE="$gmcalendarweekfulldaylinktemplate"> <INPUT TYPE=HIDDEN NAME="newlinebreaktemplate" VALUE="$gmlinebreaktemplate"> <INPUT TYPE=HIDDEN NAME="newcommentlinktargettemplate" VALUE="$gmcommentlinktargettemplate"> <INPUT TYPE=HIDDEN NAME="newsmartentrymoodtemplate" VALUE="$gmsmartentrymoodtemplate"> <INPUT TYPE=HIDDEN NAME="newsmartentrymusictemplate" VALUE="$gmsmartentrymusictemplate"> <INPUT TYPE=HIDDEN NAME="newdategroupingfooterarchivetemplate" VALUE="$gmdategroupingfooterarchivetemplate"> <INPUT TYPE=HIDDEN NAME="newgmusererrorheadertemplate" VALUE="$gmusererrorheadertemplate"> <INPUT TYPE=HIDDEN NAME="newgmusererrorfootertemplate" VALUE="$gmusererrorfootertemplate"> <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=720> <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> <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> <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> <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> <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> <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> <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> </TABLE> $autorebuildcheckbox <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Save Template Changes"> <INPUT TYPE=RESET CLASS="button" STYLE="background: #FFD0D0" VALUE="Undo Changes Since Last Save"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Templates Menu"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0"> </FORM> <P> $gmframebottom </BODY> </HTML> GMEDITKARMACOMMENTSTEMPLATES $statusnote = Gm_Constants::EMPTY; exit; } # --------------------------------------------- # edit template group: header, footer & sidebar # --------------------------------------------- sub gm_editheaderfootertemplates { &gm_validate; if ($gmtemplateaccess eq Gm_Constants::NO) { gm_writetocplog("$IN{'authorname'} attempted to edit the header, footer & sidebar templates without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the header, footer & sidebar templates.</FONT></B><P>); &gm_frontpage; } &gm_readtemplates; &gm_delousealltemplates; if ($statusnote eq Gm_Constants::EMPTY) { $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>); } $autorebuildcheckbox = Gm_Constants::EMPTY; if ($gmrebuildaccess eq Gm_Constants::YES) { if ($automaticrebuilddefault eq Gm_Constants::YES) { $autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="everything" CHECKED> Automatically rebuild all files after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>); } else { $autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="everything"> Automatically rebuild all files after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>); } } &gm_readcounter; if ($newentrynumber eq "0") { $autorebuildcheckbox = Gm_Constants::EMPTY; } print<<GMEDITHEADERFOOTERTEMPLATES; $gmheadtag $gmframetop $statusnote <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="modifiedtemplategroup" VALUE="header, footer & sidebar"> <INPUT TYPE=HIDDEN NAME="newindextemplate" VALUE="$gmindextemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagetemplate" VALUE="$gmentrypagetemplate"> <INPUT TYPE=HIDDEN NAME="newarchiveindextemplate" VALUE="$gmarchiveindextemplate"> <INPUT TYPE=HIDDEN NAME="newarchiveentrypagetemplate" VALUE="$gmarchiveentrypagetemplate"> <INPUT TYPE=HIDDEN NAME="newentrytemplate" VALUE="$gmentrytemplate"> <INPUT TYPE=HIDDEN NAME="newarchiveentrytemplate" VALUE="$gmarchiveentrytemplate"> <INPUT TYPE=HIDDEN NAME="newstayattoptemplate" VALUE="$gmstayattoptemplate"> <INPUT TYPE=HIDDEN NAME="newdatetemplate" VALUE="$gmdatetemplate"> <INPUT TYPE=HIDDEN NAME="newcommentstemplate" VALUE="$gmcommentstemplate"> <INPUT TYPE=HIDDEN NAME="newcommentsformtemplate" VALUE="$gmcommentsformtemplate"> <INPUT TYPE=HIDDEN NAME="newparaseparationtemplate" VALUE="$gmparaseparationtemplate"> <INPUT TYPE=HIDDEN NAME="newkarmaformtemplate" VALUE="$gmkarmaformtemplate"> <INPUT TYPE=HIDDEN NAME="newlinktargettemplate" VALUE="$gmlinktargettemplate"> <INPUT TYPE=HIDDEN NAME="newdategroupingfootertemplate" VALUE="$gmdategroupingfootertemplate"> <INPUT TYPE=HIDDEN NAME="newkarmalinktemplate" VALUE="$gmkarmalinktemplate"> <INPUT TYPE=HIDDEN NAME="newcommentslinktemplate" VALUE="$gmcommentslinktemplate"> <INPUT TYPE=HIDDEN NAME="newcommentauthoremailtemplate" VALUE="$gmcommentauthoremailtemplate"> <INPUT TYPE=HIDDEN NAME="newcommentauthorhomepagetemplate" VALUE="$gmcommentauthorhomepagetemplate"> <INPUT TYPE=HIDDEN NAME="newcommentdividertemplate" VALUE="$gmcommentdividertemplate"> <INPUT TYPE=HIDDEN NAME="newmoreentrytemplate" VALUE="$gmmoreentrytemplate"> <INPUT TYPE=HIDDEN NAME="newmoreentrypagetemplate" VALUE="$gmmoreentrypagetemplate"> <INPUT TYPE=HIDDEN NAME="newmorearchiveentrypagetemplate" VALUE="$gmmorearchiveentrypagetemplate"> <INPUT TYPE=HIDDEN NAME="newpreviouslinktemplate" VALUE="$gmpreviouslinktemplate"> <INPUT TYPE=HIDDEN NAME="newnextlinktemplate" VALUE="$gmnextlinktemplate"> <INPUT TYPE=HIDDEN NAME="newpreviousmorelinktemplate" VALUE="$gmpreviousmorelinktemplate"> <INPUT TYPE=HIDDEN NAME="newnextmorelinktemplate" VALUE="$gmnextmorelinktemplate"> <INPUT TYPE=HIDDEN NAME="newarchivemasterindextemplate" VALUE="$gmarchivemasterindextemplate"> <INPUT TYPE=HIDDEN NAME="newlogarchiveslinktemplate" VALUE="$gmlogarchiveslinktemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinktemplate" VALUE="$gmentrypagelinktemplate"> <INPUT TYPE=HIDDEN NAME="newmoreentrypagelinktemplate" VALUE="$gmmoreentrypagelinktemplate"> <INPUT TYPE=HIDDEN NAME="newlogarchiveslinkseparatortemplate" VALUE="$gmlogarchiveslinkseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinkseparatortemplate" VALUE="$gmentrypagelinkseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinkmonthseparatortemplate" VALUE="$gmentrypagelinkmonthseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinkdayseparatortemplate" VALUE="$gmentrypagelinkdayseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagelinkyearseparatortemplate" VALUE="$gmentrypagelinkyearseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newentryseparatortemplate" VALUE="$gmentryseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newarchiveentryseparatortemplate" VALUE="$gmarchiveentryseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newmorearchiveentrytemplate" VALUE="$gmmorearchiveentrytemplate"> <INPUT TYPE=HIDDEN NAME="newdatearchivetemplate" VALUE="$gmdatearchivetemplate"> <INPUT TYPE=HIDDEN NAME="newlogarchiveslinkweeklytemplate" VALUE="$gmlogarchiveslinkweeklytemplate"> <INPUT TYPE=HIDDEN NAME="newpopuppagetemplate" VALUE="$gmpopuppagetemplate"> <INPUT TYPE=HIDDEN NAME="newpopupcodetemplate" VALUE="$gmpopupcodetemplate"> <INPUT TYPE=HIDDEN NAME="newsearchformtemplate" VALUE="$gmsearchformtemplate"> <INPUT TYPE=HIDDEN NAME="newsearchresultspagetemplate" VALUE="$gmsearchresultspagetemplate"> <INPUT TYPE=HIDDEN NAME="newsearchresultsentrytemplate" VALUE="$gmsearchresultsentrytemplate"> <INPUT TYPE=HIDDEN NAME="newcalendartablebeginningtemplate" VALUE="$gmcalendartablebeginningtemplate"> <INPUT TYPE=HIDDEN NAME="newcalendartableendingtemplate" VALUE="$gmcalendartableendingtemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarblankcelltemplate" VALUE="$gmcalendarblankcelltemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarfullcelltemplate" VALUE="$gmcalendarfullcelltemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarfullcelllinktemplate" VALUE="$gmcalendarfullcelllinktemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarweekfulldaytemplate" VALUE="$gmcalendarweekfulldaytemplate"> <INPUT TYPE=HIDDEN NAME="newcalendarweekfulldaylinktemplate" VALUE="$gmcalendarweekfulldaylinktemplate"> <INPUT TYPE=HIDDEN NAME="newcommentpreviewdividertemplate" VALUE="$gmcommentpreviewdividertemplate"> <INPUT TYPE=HIDDEN NAME="newcommentpreviewformtemplate" VALUE="$gmcommentpreviewformtemplate"> <INPUT TYPE=HIDDEN NAME="newsmartlinknocommentstemplate" VALUE="$gmsmartlinknocommentstemplate"> <INPUT TYPE=HIDDEN NAME="newsmartlinkonecommenttemplate" VALUE="$gmsmartlinkonecommenttemplate"> <INPUT TYPE=HIDDEN NAME="newsmartlinkmanycommentstemplate" VALUE="$gmsmartlinkmanycommentstemplate"> <INPUT TYPE=HIDDEN NAME="newlinebreaktemplate" VALUE="$gmlinebreaktemplate"> <INPUT TYPE=HIDDEN NAME="newcommentlinktargettemplate" VALUE="$gmcommentlinktargettemplate"> <INPUT TYPE=HIDDEN NAME="newsmartentrymoodtemplate" VALUE="$gmsmartentrymoodtemplate"> <INPUT TYPE=HIDDEN NAME="newsmartentrymusictemplate" VALUE="$gmsmartentrymusictemplate"> <INPUT TYPE=HIDDEN NAME="newdategroupingfooterarchivetemplate" VALUE="$gmdategroupingfooterarchivetemplate"> <INPUT TYPE=HIDDEN NAME="newcookiescodetemplate" VALUE="$gmcookiescodetemplate"> <INPUT TYPE=HIDDEN NAME="newsmartemoticonscodetemplate" VALUE="$gmsmartemoticonscodetemplate"> <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=720> <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> <TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR> <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> <TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR> <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> <TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR> <TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2> <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2> <TABLE BORDER=0 cellpadding=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> <TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR> <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>User Error Header Template</B><BR><FONT SIZE=1>Whatever you put here will appear whenever an error or alert is presented to the user (this will not change how the admin errors are displayed, just errors such as not entering a Name on the comment form). <b>Note</b> that no template tags will work withen this template (they will display as {{template}}). </FONT></FONT></TD></TR></TABLE></TD></TR></TABLE><P></FONT> <TEXTAREA NAME="newgmusererrorheadertemplate" COLS=86 ROWS=30 WRAP=VIRTUAL STYLE="width: 720"> $gmusererrorheadertemplate</TEXTAREA>$gmfonttag</FONT></TD></TR> <TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR> <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>User Error Footer Template</B><BR><FONT SIZE=1>Whatever you put here will appear whenever an error or alert is presented to the user (this will not change how the admin errors are displayed, just errors such as not entering a Name on the comment form). Close any tags opened by the Error Header Template. <b>Note</b> that no template tags will work withen this template (they will display as {{template}}). </FONT></FONT></TD></TR></TABLE></TD></TR></TABLE><P></FONT> <TEXTAREA NAME="newgmusererrorfootertemplate" COLS=86 ROWS=30 WRAP=VIRTUAL STYLE="width: 720"> $gmusererrorfootertemplate</TEXTAREA>$gmfonttag</FONT></TD></TR> <TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR> </TABLE> $autorebuildcheckbox <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Save Template Changes"> <INPUT TYPE=RESET CLASS="button" STYLE="background: #FFD0D0" VALUE="Undo Changes Since Last Save"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Templates Menu"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0"> </FORM> <P> $gmframebottom </BODY> </HTML> GMEDITHEADERFOOTERTEMPLATES $statusnote = Gm_Constants::EMPTY; exit; } # ---------------------------------- # edit template group: miscellaneous # ---------------------------------- sub gm_editmisctemplates { &gm_validate; if (($gmtemplateaccess eq Gm_Constants::NO) || ($gmtemplateaccess eq "hfsonly")) { gm_writetocplog("$IN{'authorname'} attempted to edit the miscellaneous templates without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the miscellaneous templates.</FONT></B><P>); &gm_frontpage; } &gm_readtemplates; &gm_delousealltemplates; if ($statusnote eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#000000">Editing Miscellaneous Templates</FONT></B><BR><FONT SIZE=1>All the templates affecting things that didn't fit into the other categories.</FONT><P>); } $autorebuildcheckbox = Gm_Constants::EMPTY; if ($gmrebuildaccess eq Gm_Constants::YES) { if ($automaticrebuilddefault eq Gm_Constants::YES) { $autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="everything" CHECKED> Automatically rebuild all files after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>); } else { $autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="everything"> Automatically rebuild all files after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>); } } &gm_readcounter; if ($newentrynumber eq "0") { $autorebuildcheckbox = Gm_Constants::EMPTY; } print<<GMEDITMISCTEMPLATES; $gmheadtag $gmframetop $statusnote <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="modifiedtemplategroup" VALUE="miscellaneous"> <INPUT TYPE=HIDDEN NAME="newindextemplate" VALUE="$gmindextemplate"> <INPUT TYPE=HIDDEN NAME="newentrypagetemplate" VALUE="$gmentrypagetemplate"> <INPUT TYPE=HIDDEN NAME="newarchiveindextemplate" VALUE="$gmarchiveindextemplate"> <INPUT TYPE=HIDDEN NAME="newarchiveentrypagetemplate" VALUE="$gmarchiveentrypagetemplate"> <INPUT TYPE=HIDDEN NAME="newentrytemplate" VALUE="$gmentrytemplate"> <INPUT TYPE=HIDDEN NAME="newarchiveentrytemplate" VALUE="$gmarchiveentrytemplate"> <INPUT TYPE=HIDDEN NAME="newstayattoptemplate" VALUE="$gmstayattoptemplate"> <INPUT TYPE=HIDDEN NAME="newdatetemplate" VALUE="$gmdatetemplate"> <INPUT TYPE=HIDDEN NAME="newcommentstemplate" VALUE="$gmcommentstemplate"> <INPUT TYPE=HIDDEN NAME="newcommentsformtemplate" VALUE="$gmcommentsformtemplate"> <INPUT TYPE=HIDDEN NAME="newkarmaformtemplate" VALUE="$gmkarmaformtemplate"> <INPUT TYPE=HIDDEN NAME="newlinktargettemplate" VALUE="$gmlinktargettemplate"> <INPUT TYPE=HIDDEN NAME="newdategroupingfootertemplate" VALUE="$gmdategroupingfootertemplate"> <INPUT TYPE=HIDDEN NAME="newkarmalinktemplate" VALUE="$gmkarmalinktemplate"> <INPUT TYPE=HIDDEN NAME="newcommentslinktemplate" VALUE="$gmcommentslinktemplate"> <INPUT TYPE=HIDDEN NAME="newcommentauthoremailtemplate" VALUE="$gmcommentauthoremailtemplate"> <INPUT TYPE=HIDDEN NAME="newcommentauthorhomepagetemplate" VALUE="$gmcommentauthorhomepagetemplate"> <INPUT TYPE=HIDDEN NAME="newcommentdividertemplate" VALUE="$gmcommentdividertemplate"> <INPUT TYPE=HIDDEN NAME="newmoreentrytemplate" VALUE="$gmmoreentrytemplate"> <INPUT TYPE=HIDDEN NAME="newmoreentrypagetemplate" VALUE="$gmmoreentrypagetemplate"> <INPUT TYPE=HIDDEN NAME="newmorearchiveentrypagetemplate" VALUE="$gmmorearchiveentrypagetemplate"> <INPUT TYPE=HIDDEN NAME="newarchivemasterindextemplate" VALUE="$gmarchivemasterindextemplate"> <INPUT TYPE=HIDDEN NAME="newheadertemplate" VALUE="$gmheadertemplate"> <INPUT TYPE=HIDDEN NAME="newfootertemplate" VALUE="$gmfootertemplate"> <INPUT TYPE=HIDDEN NAME="newsidebartemplate" VALUE="$gmsidebartemplate"> <INPUT TYPE=HIDDEN NAME="newentryseparatortemplate" VALUE="$gmentryseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newarchiveentryseparatortemplate" VALUE="$gmarchiveentryseparatortemplate"> <INPUT TYPE=HIDDEN NAME="newmorearchiveentrytemplate" VALUE="$gmmorearchiveentrytemplate"> <INPUT TYPE=HIDDEN NAME="newdatearchivetemplate" VALUE="$gmdatearchivetemplate"> <INPUT TYPE=HIDDEN NAME="newcustomonetemplate" VALUE="$gmcustomonetemplate"> <INPUT TYPE=HIDDEN NAME="newcustomtwotemplate" VALUE="$gmcustomtwotemplate"> <INPUT TYPE=HIDDEN NAME="newcustomthreetemplate" VALUE="$gmcustomthreetemplate"> <INPUT TYPE=HIDDEN NAME="newcustomfourtemplate" VALUE="$gmcustomfourtemplate"> <INPUT TYPE=HIDDEN NAME="newcustomfivetemplate" VALUE="$gmcustomfivetemplate"> <INPUT TYPE=HIDDEN NAME="newcustomsixtemplate" VALUE="$gmcustomsixtemplate"> <INPUT TYPE=HIDDEN NAME="newcustomseventemplate" VALUE="$gmcustomseventemplate"> <INPUT TYPE=HIDDEN NAME="newcustomeighttemplate" VALUE="$gmcustomeighttemplate"> <INPUT TYPE=HIDDEN NAME="newcustomninetemplate" VALUE="$gmcustomninetemplate"> <INPUT TYPE=HIDDEN NAME="newcustomtentemplate" VALUE="$gmcustomtentemplate"> <INPUT TYPE=HIDDEN NAME="newcommentpreviewdividertemplate" VALUE="$gmcommentpreviewdividertemplate"> <INPUT TYPE=HIDDEN NAME="newcommentpreviewformtemplate" VALUE="$gmcommentpreviewformtemplate"> <INPUT TYPE=HIDDEN NAME="newsmartlinknocommentstemplate" VALUE="$gmsmartlinknocommentstemplate"> <INPUT TYPE=HIDDEN NAME="newsmartlinkonecommenttemplate" VALUE="$gmsmartlinkonecommenttemplate"> <INPUT TYPE=HIDDEN NAME="newsmartlinkmanycommentstemplate" VALUE="$gmsmartlinkmanycommentstemplate"> <INPUT TYPE=HIDDEN NAME="newdategroupingfooterarchivetemplate" VALUE="$gmdategroupingfooterarchivetemplate"> <INPUT TYPE=HIDDEN NAME="newcookiescodetemplate" VALUE="$gmcookiescodetemplate"> <INPUT TYPE=HIDDEN NAME="newsmartemoticonscodetemplate" VALUE="$gmsmartemoticonscodetemplate"> <INPUT TYPE=HIDDEN NAME="newgmusererrorheadertemplate" VALUE="$gmusererrorheadertemplate"> <INPUT TYPE=HIDDEN NAME="newgmusererrorfootertemplate" VALUE="$gmusererrorfootertemplate"> <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=720> <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> <TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR> <TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2><TABLE BORDER=0 cellpadding=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://greymatterforum.proboards82.com/" 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> <TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR> <TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2><TABLE BORDER=0 cellpadding=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> <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> <TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR> <TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2><TABLE BORDER=0 cellpadding=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> <TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR> <TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2><TABLE BORDER=0 cellpadding=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> <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> <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> <TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR> <TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2><TABLE BORDER=0 cellpadding=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> <TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR> <TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2><TABLE BORDER=0 cellpadding=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> <TR><TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>   </TD></TR> <TR><TD VALIGN=BOTTOM ALIGN=CENTER COLSPAN=2><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10 WIDTH=100%><TR><TD COLSPAN=2><TABLE BORDER=0 cellpadding=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> <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> </TABLE> $autorebuildcheckbox <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Save Template Changes"> <INPUT TYPE=RESET CLASS="button" STYLE="background: #FFD0D0" VALUE="Undo Changes Since Last Save"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Templates Menu"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0"> </FORM> <P> $gmframebottom </BODY> </HTML> GMEDITMISCTEMPLATES $statusnote = Gm_Constants::EMPTY; exit; } # ------------------------- # save the template changes # ------------------------- sub gm_savetemplatechanges { &gm_validate; if ($gmtemplateaccess eq Gm_Constants::NO) { gm_writetocplog("$IN{'authorname'} attempted to edit the templates without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the templates.</FONT></B><P>); &gm_frontpage; } ### TODO MAKE THE PARAM NAME SAME AS REAL TEMPLATE NAME, SO WE CAN LOOP THROUGH ## HASH AND RELOUSE AND SET TEMPLATES $IN{'newindextemplate'} = Gm_Utils::toStoreSafe($IN{'newindextemplate'}); $IN{'newentrypagetemplate'} = Gm_Utils::toStoreSafe($IN{'newentrypagetemplate'}); $IN{'newarchiveindextemplate'} = Gm_Utils::toStoreSafe($IN{'newarchiveindextemplate'}); $IN{'newarchiveentrypagetemplate'} = Gm_Utils::toStoreSafe($IN{'newarchiveentrypagetemplate'}); $IN{'newentrytemplate'} = Gm_Utils::toStoreSafe($IN{'newentrytemplate'}); $IN{'newarchiveentrytemplate'} = Gm_Utils::toStoreSafe($IN{'newarchiveentrytemplate'}); $IN{'newstayattoptemplate'} = Gm_Utils::toStoreSafe($IN{'newstayattoptemplate'}); $IN{'newdatetemplate'} = Gm_Utils::toStoreSafe($IN{'newdatetemplate'}); $IN{'newcommentstemplate'} = Gm_Utils::toStoreSafe($IN{'newcommentstemplate'}); $IN{'newcommentsformtemplate'} = Gm_Utils::toStoreSafe($IN{'newcommentsformtemplate'}); $IN{'newparaseparationtemplate'} = Gm_Utils::toStoreSafe($IN{'newparaseparationtemplate'}); $IN{'newkarmaformtemplate'} = Gm_Utils::toStoreSafe($IN{'newkarmaformtemplate'}); $IN{'newlinktargettemplate'} = Gm_Utils::toStoreSafe($IN{'newlinktargettemplate'}); $IN{'newdategroupingfootertemplate'} = Gm_Utils::toStoreSafe($IN{'newdategroupingfootertemplate'}); $IN{'newkarmalinktemplate'} = Gm_Utils::toStoreSafe($IN{'newkarmalinktemplate'}); $IN{'newcommentslinktemplate'} = Gm_Utils::toStoreSafe($IN{'newcommentslinktemplate'}); $IN{'newcommentauthoremailtemplate'} = Gm_Utils::toStoreSafe($IN{'newcommentauthoremailtemplate'}); $IN{'newcommentauthorhomepagetemplate'} = Gm_Utils::toStoreSafe($IN{'newcommentauthorhomepagetemplate'}); $IN{'newcommentdividertemplate'} = Gm_Utils::toStoreSafe($IN{'newcommentdividertemplate'}); $IN{'newmoreentrytemplate'} = Gm_Utils::toStoreSafe($IN{'newmoreentrytemplate'}); $IN{'newmoreentrypagetemplate'} = Gm_Utils::toStoreSafe($IN{'newmoreentrypagetemplate'}); $IN{'newmorearchiveentrypagetemplate'} = Gm_Utils::toStoreSafe($IN{'newmorearchiveentrypagetemplate'}); $IN{'newpreviouslinktemplate'} = Gm_Utils::toStoreSafe($IN{'newpreviouslinktemplate'}); $IN{'newnextlinktemplate'} = Gm_Utils::toStoreSafe($IN{'newnextlinktemplate'}); $IN{'newpreviousmorelinktemplate'} = Gm_Utils::toStoreSafe($IN{'newpreviousmorelinktemplate'}); $IN{'newnextmorelinktemplate'} = Gm_Utils::toStoreSafe($IN{'newnextmorelinktemplate'}); $IN{'newarchivemasterindextemplate'} = Gm_Utils::toStoreSafe($IN{'newarchivemasterindextemplate'}); $IN{'newlogarchiveslinktemplate'} = Gm_Utils::toStoreSafe($IN{'newlogarchiveslinktemplate'}); $IN{'newentrypagelinktemplate'} = Gm_Utils::toStoreSafe($IN{'newentrypagelinktemplate'}); $IN{'newmoreentrypagelinktemplate'} = Gm_Utils::toStoreSafe($IN{'newmoreentrypagelinktemplate'}); $IN{'newlogarchiveslinkseparatortemplate'} = Gm_Utils::toStoreSafe($IN{'newlogarchiveslinkseparatortemplate'}); $IN{'newentrypagelinkseparatortemplate'} = Gm_Utils::toStoreSafe($IN{'newentrypagelinkseparatortemplate'}); $IN{'newentrypagelinkmonthseparatortemplate'} = Gm_Utils::toStoreSafe($IN{'newentrypagelinkmonthseparatortemplate'}); $IN{'newentrypagelinkdayseparatortemplate'} = Gm_Utils::toStoreSafe($IN{'newentrypagelinkdayseparatortemplate'}); $IN{'newentrypagelinkyearseparatortemplate'} = Gm_Utils::toStoreSafe($IN{'newentrypagelinkyearseparatortemplate'}); $IN{'newheadertemplate'} = Gm_Utils::toStoreSafe($IN{'newheadertemplate'}); $IN{'newfootertemplate'} = Gm_Utils::toStoreSafe($IN{'newfootertemplate'}); $IN{'newsidebartemplate'} = Gm_Utils::toStoreSafe($IN{'newsidebartemplate'}); $IN{'newcustomlinktemplate'} = Gm_Constants::EMPTY; $IN{'newentryseparatortemplate'} = Gm_Utils::toStoreSafe($IN{'newentryseparatortemplate'}); $IN{'newarchiveentryseparatortemplate'} = Gm_Utils::toStoreSafe($IN{'newarchiveentryseparatortemplate'}); $IN{'newmorearchiveentrytemplate'} = Gm_Utils::toStoreSafe($IN{'newmorearchiveentrytemplate'}); $IN{'newdatearchivetemplate'} = Gm_Utils::toStoreSafe($IN{'newdatearchivetemplate'}); $IN{'newlogarchiveslinkweeklytemplate'} = Gm_Utils::toStoreSafe($IN{'newlogarchiveslinkweeklytemplate'}); $IN{'newcustomonetemplate'} = Gm_Utils::toStoreSafe($IN{'newcustomonetemplate'}); $IN{'newcustomtwotemplate'} = Gm_Utils::toStoreSafe($IN{'newcustomtwotemplate'}); $IN{'newcustomthreetemplate'} = Gm_Utils::toStoreSafe($IN{'newcustomthreetemplate'}); $IN{'newcustomfourtemplate'} = Gm_Utils::toStoreSafe($IN{'newcustomfourtemplate'}); $IN{'newcustomfivetemplate'} = Gm_Utils::toStoreSafe($IN{'newcustomfivetemplate'}); $IN{'newcustomsixtemplate'} = Gm_Utils::toStoreSafe($IN{'newcustomsixtemplate'}); $IN{'newcustomseventemplate'} = Gm_Utils::toStoreSafe($IN{'newcustomseventemplate'}); $IN{'newcustomeighttemplate'} = Gm_Utils::toStoreSafe($IN{'newcustomeighttemplate'}); $IN{'newcustomninetemplate'} = Gm_Utils::toStoreSafe($IN{'newcustomninetemplate'}); $IN{'newcustomtentemplate'} = Gm_Utils::toStoreSafe($IN{'newcustomtentemplate'}); $IN{'newpopuppagetemplate'} = Gm_Utils::toStoreSafe($IN{'newpopuppagetemplate'}); $IN{'newpopupcodetemplate'} = Gm_Utils::toStoreSafe($IN{'newpopupcodetemplate'}); $IN{'newsearchformtemplate'} = Gm_Utils::toStoreSafe($IN{'newsearchformtemplate'}); $IN{'newsearchresultspagetemplate'} = Gm_Utils::toStoreSafe($IN{'newsearchresultspagetemplate'}); $IN{'newsearchresultsentrytemplate'} = Gm_Utils::toStoreSafe($IN{'newsearchresultsentrytemplate'}); $IN{'newcalendartablebeginningtemplate'} = Gm_Utils::toStoreSafe($IN{'newcalendartablebeginningtemplate'}); $IN{'newcalendartableendingtemplate'} = Gm_Utils::toStoreSafe($IN{'newcalendartableendingtemplate'}); $IN{'newcalendarblankcelltemplate'} = Gm_Utils::toStoreSafe($IN{'newcalendarblankcelltemplate'}); $IN{'newcalendarfullcelltemplate'} = Gm_Utils::toStoreSafe($IN{'newcalendarfullcelltemplate'}); $IN{'newcalendarfullcelllinktemplate'} = Gm_Utils::toStoreSafe($IN{'newcalendarfullcelllinktemplate'}); $IN{'newcalendarweekblankdaytemplate'} = Gm_Constants::EMPTY; $IN{'newcalendarweekfulldaytemplate'} = Gm_Utils::toStoreSafe($IN{'newcalendarweekfulldaytemplate'}); $IN{'newcalendarweekfulldaylinktemplate'} = Gm_Utils::toStoreSafe($IN{'newcalendarweekfulldaylinktemplate'}); $IN{'newcommentpreviewdividertemplate'} = Gm_Utils::toStoreSafe($IN{'newcommentpreviewdividertemplate'}); $IN{'newcommentpreviewformtemplate'} = Gm_Utils::toStoreSafe($IN{'newcommentpreviewformtemplate'}); $IN{'newsmartlinknocommentstemplate'} = Gm_Utils::toStoreSafe($IN{'newsmartlinknocommentstemplate'}); $IN{'newsmartlinkonecommenttemplate'} = Gm_Utils::toStoreSafe($IN{'newsmartlinkonecommenttemplate'}); $IN{'newsmartlinkmanycommentstemplate'} = Gm_Utils::toStoreSafe($IN{'newsmartlinkmanycommentstemplate'}); $IN{'newlinebreaktemplate'} = Gm_Utils::toStoreSafe($IN{'newlinebreaktemplate'}); $IN{'newcommentlinktargettemplate'} = Gm_Utils::toStoreSafe($IN{'newcommentlinktargettemplate'}); $IN{'newsmartentrymoodtemplate'} = Gm_Utils::toStoreSafe($IN{'newsmartentrymoodtemplate'}); $IN{'newsmartentrymusictemplate'} = Gm_Utils::toStoreSafe($IN{'newsmartentrymusictemplate'}); $IN{'newdategroupingfooterarchivetemplate'} = Gm_Utils::toStoreSafe($IN{'newdategroupingfooterarchivetemplate'}); $IN{'newcookiescodetemplate'} = Gm_Utils::toStoreSafe($IN{'newcookiescodetemplate'}); $IN{'newsmartemoticonscodetemplate'} = Gm_Utils::toStoreSafe($IN{'newsmartemoticonscodetemplate'}); $IN{'newgmusererrorheadertemplate'} = Gm_Utils::toStoreSafe($IN{'newgmusererrorheadertemplate'}); $IN{'newgmusererrorfootertemplate'} = Gm_Utils::toStoreSafe($IN{'newgmusererrorfootertemplate'}); if (($IN{'newcustomlinktemplate'} ne Gm_Constants::EMPTY) && ((substr($IN{'newcustomlinktemplate'}, 0, 1)) ne " ")) { $IN{'newcustomlinktemplate'} = " $IN{'newcustomlinktemplate'}"; } if ($IN{'entrylistingmorecheck'} eq Gm_Constants::YES) { $IN{'newmoreentrytemplate'} = $IN{'newentrytemplate'}; } if ($IN{'entrylistingstayattopcheck'} eq Gm_Constants::YES) { $IN{'newstayattoptemplate'} = $IN{'newentrytemplate'}; } if ($IN{'archivelogindexcheck'} eq Gm_Constants::YES) { $IN{'newarchiveindextemplate'} = $IN{'newindextemplate'}; } if ($IN{'archiveentrylistingcheck'} eq Gm_Constants::YES) { $IN{'newarchiveentrytemplate'} = $IN{'newentrytemplate'}; } if ($IN{'archiveentrylistingmorecheck'} eq Gm_Constants::YES) { $IN{'newmorearchiveentrytemplate'} = $IN{'newmoreentrytemplate'}; } if ($IN{'archivedateheadercheck'} eq Gm_Constants::YES) { $IN{'newdatearchivetemplate'} = $IN{'newdatetemplate'}; } if ($IN{'archivedatefootercheck'} eq Gm_Constants::YES) { $IN{'newdategroupingfooterarchivetemplate'} = $IN{'newdategroupingfootertemplate'}; } if ($IN{'archiveentryseparatorcheck'} eq Gm_Constants::YES) { $IN{'newarchiveentryseparatortemplate'} = $IN{'newentryseparatortemplate'}; } if ($IN{'entrymorepagecheck'} eq Gm_Constants::YES) { $IN{'newmoreentrypagetemplate'} = $IN{'newentrypagetemplate'}; } if ($IN{'entryarchivepagecheck'} eq Gm_Constants::YES) { $IN{'newarchiveentrypagetemplate'} = $IN{'newentrypagetemplate'}; } if ($IN{'entrymorearchivepagecheck'} eq Gm_Constants::YES) { $IN{'newmorearchiveentrypagetemplate'} = $IN{'newarchiveentrypagetemplate'}; } if ($IN{'previousmorelinkcheck'} eq Gm_Constants::YES) { $IN{'newpreviousmorelinktemplate'} = $IN{'newpreviouslinktemplate'}; } if ($IN{'nextmorelinkcheck'} eq Gm_Constants::YES) { $IN{'newnextmorelinktemplate'} = $IN{'newnextlinktemplate'}; } if ($IN{'moreentrylistlinkcheck'} eq Gm_Constants::YES) { $IN{'newmoreentrypagelinktemplate'} = $IN{'newentrypagelinktemplate'}; } ## Putting into hash to save my %templs = (); $templs{'gmindextemplate'} = $IN{'newindextemplate'}; $templs{'gmentrypagetemplate'} = $IN{'newentrypagetemplate'}; $templs{'gmarchiveindextemplate'} = $IN{'newarchiveindextemplate'}; $templs{'gmarchiveentrypagetemplate'} = $IN{'newarchiveentrypagetemplate'}; $templs{'gmentrytemplate'} = $IN{'newentrytemplate'}; $templs{'gmarchiveentrytemplate'} = $IN{'newarchiveentrytemplate'}; $templs{'gmstayattoptemplate'} = $IN{'newstayattoptemplate'}; $templs{'gmdatetemplate'} = $IN{'newdatetemplate'}; $templs{'gmcommentstemplate'} = $IN{'newcommentstemplate'}; $templs{'gmcommentsformtemplate'} = $IN{'newcommentsformtemplate'}; $templs{'gmparaseparationtemplate'} = $IN{'newparaseparationtemplate'}; $templs{'gmkarmaformtemplate'} = $IN{'newkarmaformtemplate'}; $templs{'gmlinktargettemplate'} = $IN{'newlinktargettemplate'}; $templs{'gmdategroupingfootertemplate'} = $IN{'newdategroupingfootertemplate'}; $templs{'gmkarmalinktemplate'} = $IN{'newkarmalinktemplate'}; $templs{'gmcommentslinktemplate'} = $IN{'newcommentslinktemplate'}; $templs{'gmcommentauthoremailtemplate'} = $IN{'newcommentauthoremailtemplate'}; $templs{'gmcommentauthorhomepagetemplate'} = $IN{'newcommentauthorhomepagetemplate'}; $templs{'gmcommentdividertemplate'} = $IN{'newcommentdividertemplate'}; $templs{'gmmoreentrytemplate'} = $IN{'newmoreentrytemplate'}; $templs{'gmmoreentrypagetemplate'} = $IN{'newmoreentrypagetemplate'}; $templs{'gmmorearchiveentrypagetemplate'} = $IN{'newmorearchiveentrypagetemplate'}; $templs{'gmpreviouslinktemplate'} = $IN{'newpreviouslinktemplate'}; $templs{'gmnextlinktemplate'} = $IN{'newnextlinktemplate'}; $templs{'gmpreviousmorelinktemplate'} = $IN{'newpreviousmorelinktemplate'}; $templs{'gmnextmorelinktemplate'} = $IN{'newnextmorelinktemplate'}; $templs{'gmarchivemasterindextemplate'} = $IN{'newarchivemasterindextemplate'}; $templs{'gmlogarchiveslinktemplate'} = $IN{'newlogarchiveslinktemplate'}; $templs{'gmentrypagelinktemplate'} = $IN{'newentrypagelinktemplate'}; $templs{'gmmoreentrypagelinktemplate'} = $IN{'newmoreentrypagelinktemplate'}; $templs{'gmlogarchiveslinkseparatortemplate'} = $IN{'newlogarchiveslinkseparatortemplate'}; $templs{'gmentrypagelinkseparatortemplate'} = $IN{'newentrypagelinkseparatortemplate'}; $templs{'gmentrypagelinkmonthseparatortemplate'} = $IN{'newentrypagelinkmonthseparatortemplate'}; $templs{'gmentrypagelinkdayseparatortemplate'} = $IN{'newentrypagelinkdayseparatortemplate'}; $templs{'gmentrypagelinkyearseparatortemplate'} = $IN{'newentrypagelinkyearseparatortemplate'}; $templs{'gmheadertemplate'} = $IN{'newheadertemplate'}; $templs{'gmfootertemplate'} = $IN{'newfootertemplate'}; $templs{'gmsidebartemplate'} = $IN{'newsidebartemplate'}; $templs{'gmentryseparatortemplate'} = $IN{'newentryseparatortemplate'}; $templs{'gmarchiveentryseparatortemplate'} = $IN{'newarchiveentryseparatortemplate'}; $templs{'gmmorearchiveentrytemplate'} = $IN{'newmorearchiveentrytemplate'}; $templs{'gmdatearchivetemplate'} = $IN{'newdatearchivetemplate'}; $templs{'gmlogarchiveslinkweeklytemplate'} = $IN{'newlogarchiveslinkweeklytemplate'}; $templs{'gmcustomonetemplate'} = $IN{'newcustomonetemplate'}; $templs{'gmcustomtwotemplate'} = $IN{'newcustomtwotemplate'}; $templs{'gmcustomthreetemplate'} = $IN{'newcustomthreetemplate'}; $templs{'gmcustomfourtemplate'} = $IN{'newcustomfourtemplate'}; $templs{'gmcustomfivetemplate'} = $IN{'newcustomfivetemplate'}; $templs{'gmcustomsixtemplate'} = $IN{'newcustomsixtemplate'}; $templs{'gmcustomseventemplate'} = $IN{'newcustomseventemplate'}; $templs{'gmcustomeighttemplate'} = $IN{'newcustomeighttemplate'}; $templs{'gmcustomninetemplate'} = $IN{'newcustomninetemplate'}; $templs{'gmcustomtentemplate'} = $IN{'newcustomtentemplate'}; $templs{'gmpopuppagetemplate'} = $IN{'newpopuppagetemplate'}; $templs{'gmpopupcodetemplate'} = $IN{'newpopupcodetemplate'}; $templs{'gmsearchformtemplate'} = $IN{'newsearchformtemplate'}; $templs{'gmsearchresultspagetemplate'} = $IN{'newsearchresultspagetemplate'}; $templs{'gmsearchresultsentrytemplate'} = $IN{'newsearchresultsentrytemplate'}; $templs{'gmcalendartablebeginningtemplate'} = $IN{'newcalendartablebeginningtemplate'}; $templs{'gmcalendartableendingtemplate'} = $IN{'newcalendartableendingtemplate'}; $templs{'gmcalendarblankcelltemplate'} = $IN{'newcalendarblankcelltemplate'}; $templs{'gmcalendarfullcelltemplate'} = $IN{'newcalendarfullcelltemplate'}; $templs{'gmcalendarfullcelllinktemplate'} = $IN{'newcalendarfullcelllinktemplate'}; $templs{'gmcalendarweekfulldaytemplate'} = $IN{'newcalendarweekfulldaytemplate'}; $templs{'gmcalendarweekfulldaylinktemplate'} = $IN{'newcalendarweekfulldaylinktemplate'}; $templs{'gmcommentpreviewdividertemplate'} = $IN{'newcommentpreviewdividertemplate'}; $templs{'gmcommentpreviewformtemplate'} = $IN{'newcommentpreviewformtemplate'}; $templs{'gmsmartlinknocommentstemplate'} = $IN{'newsmartlinknocommentstemplate'}; $templs{'gmsmartlinkonecommenttemplate'} = $IN{'newsmartlinkonecommenttemplate'}; $templs{'gmsmartlinkmanycommentstemplate'} = $IN{'newsmartlinkmanycommentstemplate'}; $templs{'gmlinebreaktemplate'} = $IN{'newlinebreaktemplate'}; $templs{'gmcommentlinktargettemplate'} = $IN{'newcommentlinktargettemplate'}; $templs{'gmsmartentrymoodtemplate'} = $IN{'newsmartentrymoodtemplate'}; $templs{'gmsmartentrymusictemplate'} = $IN{'newsmartentrymusictemplate'}; $templs{'gmdategroupingfooterarchivetemplate'} = $IN{'newdategroupingfooterarchivetemplate'}; $templs{'gmsmartemoticonscodetemplate'} = $IN{'newsmartemoticonscodetemplate'}; $templs{'gmcookiescodetemplate'} = $IN{'newcookiescodetemplate'}; $templs{'gmusererrorheadertemplate'} = $IN{'newgmusererrorheadertemplate'}; $templs{'gmusererrorfootertemplate'} = $IN{'newgmusererrorfootertemplate'}; Gm_Storage::setTemplates( templates =>\%templs, errHandler=>\&Gm_Web::displayAdminErrorExit ); $statusnote = qq(<B><FONT COLOR="#0000FF">The $IN{'modifiedtemplategroup'} templates have been modified. Be sure to rebuild<BR>your files to make these changes take effect throughout your site.</FONT></B><P>); gm_writetocplog("$IN{'authorname'} modified the $IN{'modifiedtemplategroup'} templates"); if ($IN{'autorebuild'} eq "index") { &gm_rebuildmainindexfile; } if ($IN{'autorebuild'} eq "archiveindexes") { &gm_rebuildarchivelogindexes; } if ($IN{'autorebuild'} eq "entrypages") { &gm_rebuildallentrypages; } if ($IN{'autorebuild'} eq "everything") { &gm_rebuildeverything; } &gm_edittemplates; } # --------------------------- # view the greymatter logfile # --------------------------- sub gm_viewcplog { &gm_validate; if ($gmcplogaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to view the control panel log without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to view the control panel log.</FONT></B><P>); &gm_frontpage; } if ($statusnote eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#000000">Control Panel Log</FONT></B><P>); } print<<GMVIEWLOGTOP; $gmheadtag $gmframetop $statusnote <P ALIGN=LEFT> GMVIEWLOGTOP my $gmlogfile = Gm_Storage::getCplog( errHandler=>\&Gm_Web::displayAdminErrorExit ); foreach $gmlogfileline (@$gmlogfile) { println( "$gmlogfileline<BR>" ); } my ($gmdate) = Gm_Utils::getStdDate( $serveroffset ); &gm_readcounter; if ($newentrynumber ne "0") { $newalltimetotalkarmanumber = $newalltimepktotalnumber - $newalltimenktotalnumber; $newalltimetotalkarmavotes = $newalltimepktotalnumber + $newalltimenktotalnumber; $entriesonmainnumber = $newentrynumber - $newarchivenumber; # $karmavotesonaverage = sprintf("%.1f", ($newalltimetotalkarmavotes / $newentrynumber)); # $commentspostedonaverage = sprintf("%.1f", ($newalltimecommentstotalnumber / $newentrynumber)); $karmavotesonaverage = Gm_Utils::toFirstDec( ($newalltimetotalkarmavotes / $newentrynumber)); $commentspostedonaverage = Gm_Utils::toFirstDec( ($newalltimecommentstotalnumber / $newentrynumber)); } else { $newalltimetotalkarmanumber = 0; $newalltimetotalkarmavotes = 0; $entriesonmainnumber = 0; $karmavotesonaverage = 0; $commentspostedonaverage = 0; } print<<GMVIEWLOGBOTTOM; </P> <br /> <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 $gmdate</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> <br /> <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" STYLE="background: #FFD0D0" VALUE="Reset The Control Panel Log"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0"> </FORM> <P> $gmframebottom GMVIEWLOGBOTTOM exit; } # ---------------------------- # clear the greymatter logfile # ---------------------------- sub gm_resetcplog { &gm_validate; if ($gmcplogaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to clear the control panel log without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to clear the control panel log.</FONT></B><P>); &gm_frontpage; ## TODO MOVE TO WEB } Gm_Storage::setCplog( log=>[], errHandler=>\&Gm_Web::displayAdminErrorExit ); gm_writetocplog( "$IN{'authorname'} cleared this control panel log" ); ## TODO: MAKE THIS AN ARG TO SOMETHING $statusnote = qq(<B><FONT COLOR="#0000FF">The control panel log has been cleared.</FONT></B><P>); ## TODO: MOVE TO WEB, RENAME TO MENU &gm_frontpage; } # -------------- # authors editor # -------------- sub gm_editauthors { &gm_validate; if ($gmauthoraccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to edit the authors without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the authors.</FONT></B><P>); &gm_frontpage; } if ($statusnote eq Gm_Constants::EMPTY) { $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>); } my $gmauthors = Gm_Storage::getAuthors( errHandler=>\&Gm_Web::displayAdminErrorExit ); print<<GMEDITAUTHORBEGINNING; $gmheadtag $gmframetop $statusnote <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 WIDTH=100% BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%> <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> GMEDITAUTHORBEGINNING $alicewarning = Gm_Constants::EMPTY; $alternateauthorrowone = "#EEF8FF"; $alternateauthorrowtwo = "#F8F8FF"; $alternateauthorrow = $alternateauthorrowone; ## We are looping through keys of hash (keys are author names) and sorting foreach my $author ( sort { $gmauthors->{$a}{'author'} cmp $gmauthors->{$b}{'author'} } keys( %$gmauthors ) ) { if ($alternateauthorrow eq $alternateauthorrowone) { $alternateauthorrow = $alternateauthorrowtwo; } else { $alternateauthorrow = $alternateauthorrowone; } if (($gmauthors->{$author}{'author'} eq 'Alice') && ($gmauthors->{$author}{'password'} eq 'wonderland')) { $alicewarning = "<P><B>Be sure to create your own author and delete Alice!</B>" } println('<TR><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="'.$alternateauthorrow.'" NOWRAP>'. '<INPUT TYPE=RADIO NAME="selectedauthor" VALUE="'.$gmauthors->{$author}{'author'}.'">'. '</TD><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="'.$alternateauthorrow.'" NOWRAP>'. $gmfonttag.$gmauthors->{$author}{'author'}.'</FONT></TD>'); if ($gmauthors->{$author}{'postnew'} eq 'Y') { print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag Yes</FONT></TD>); } else { print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag No</FONT></TD>); } if ($gmauthors->{$author}{'editentries'} eq 'Y') { print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag Yes</FONT></TD>); } elsif ($gmauthorinfo[7] eq 'O') { print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag Own</FONT></TD>); } else { print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag No</FONT></TD>); } if ($gmauthors->{$author}{'editconfigs'} eq 'Y') { print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag Yes</FONT></TD>); } else { print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag No</FONT></TD>); } if ($gmauthors->{$author}{'edittemplates'} eq 'Y') { print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag Yes</FONT></TD>); } elsif ($gmauthorinfo[9] eq 'O') { print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag HFS</FONT></TD>); } else { print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag No</FONT></TD>); } if ($gmauthors->{$author}{'editauthors'} eq 'Y') { print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag Yes</FONT></TD>); } else { print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag No</FONT></TD>); } if ($gmauthors->{$author}{'rebuild'} eq 'Y') { print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag Yes</FONT></TD>); } else { print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag No</FONT></TD>); } if ($gmauthors->{$author}{'viewcplog'} eq 'Y') { print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag Yes</FONT></TD>); } else { print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag No</FONT></TD>); } if ($gmauthors->{$author}{'bookmarklets'} eq 'Y') { print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag Yes</FONT></TD>); } else { print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag No</FONT></TD>); } if ($gmauthors->{$author}{'upload'} eq 'Y') { print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag Yes</FONT></TD>); } else { print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag No</FONT></TD>); } if ($gmauthors->{$author}{'viewadmin'} eq 'Y') { print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag Yes</FONT></TD>); } else { print qq(<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="$alternateauthorrow" NOWRAP>$gmfonttag No</FONT></TD>); } print "</TR>\n"; } print<<GMEDITAUTHORSBOTTOM; </TABLE></TD></TR></TABLE> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Edit Selected Author"> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #FFD0D0" VALUE="Delete Selected Author"> $alicewarning <P> <TABLE BORDER=0 cellpadding=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> Create a new account for someone to have access to Greymatter with (giving an e-mail or homepage is optional). You can specify whether the author is created having access to everything, to nothing, or to post & edit their own entries only; you can then customise their access further by editing their account above after it's been created.</FONT><P>Name: <INPUT TYPE=TEXT CLASS="textinput" SIZE=25 NAME="newauthorname">     Password: <INPUT TYPE=PASSWORD CLASS="textinput" SIZE=25 NAME="newauthorpassword"><P>E-Mail: <INPUT TYPE=TEXT CLASS="textinput" SIZE=30 NAME="newauthoremail">     Homepage: <INPUT TYPE=TEXT CLASS="textinput" SIZE=30 NAME="newauthorhomepage" VALUE="http://"><P><B>Default Author Access</B><BR><INPUT TYPE=RADIO NAME="newauthoraccess" VALUE="all" CHECKED> All access   <INPUT TYPE=RADIO NAME="newauthoraccess" VALUE="none"> No access<BR><INPUT TYPE=RADIO NAME="newauthoraccess" VALUE="postedit"> Post & edit their own entries only<P><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Create New Author"></FONT></TD></TR></TABLE></TD></TR></TABLE> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0"> </FORM> <P> $gmframebottom </BODY> </HTML> GMEDITAUTHORSBOTTOM $statusnote = Gm_Constants::EMPTY; exit; } # ------------------- # create a new author # ------------------- sub gm_createnewauthor { &gm_validate; if ($gmauthoraccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to create a new author without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to create a new author.</FONT></B><P>); &gm_frontpage; } if (($IN{'newauthorname'} eq Gm_Constants::EMPTY) || ($IN{'newauthorpassword'} eq Gm_Constants::EMPTY)) { $statusnote = qq(<B><FONT COLOR="#FF0000">You left either the name or password fields blank. Please try again.</FONT></B><P>); &gm_editauthors; } if (($IN{'newauthorname'} =~ /^\s+/) || ($IN{'newauthorpassword'} =~ /^\s+/) || ($IN{'newauthorname'} =~ /\s+$/) || ($IN{'newauthorpassword'} =~ /\s+$/)) { $statusnote = qq(<B><FONT COLOR="#FF0000">You cannot have a space at the beginning or end<BR>of the author name or password. Please try again.</FONT></B><P>); &gm_editauthors; } ## We are removing spaces temporily $IN{'newauthorname'} =~ s/ /THISISASPACE/g; $IN{'newauthorpassword'} =~ s/ /THISISASPACE/g; if (($IN{'newauthorname'} =~ /\W/) || ($IN{'newauthorpassword'} =~ /\W/)) { $statusnote = qq(<B><FONT COLOR="#FF0000">The author name or password cannot contain non-alphanumeric characters<BR>(characters other than letters, numbers or spaces). Please try again.</FONT></B><P>); &gm_editauthors; } ## Now we are restoring to proper form $IN{'newauthorname'} =~ s/THISISASPACE/ /g; $IN{'newauthorpassword'} =~ s/THISISASPACE/ /g; ## TODO MAKE THIS SCRUBBING IN UTIL $IN{'newauthoremail'} =~ s/^\s+//; $IN{'newauthoremail'} =~ s/\s+$//; $IN{'newauthorhomepage'} =~ s/^\s+//; $IN{'newauthorhomepage'} =~ s/\s+$//; if ($IN{'newauthorhomepage'} eq "http://") { $IN{'newauthorhomepage'} = Gm_Constants::EMPTY; } my $gmauthors = Gm_Storage::getAuthors( errHandler=>\&Gm_Web::displayAdminErrorExit ); ## just checking if author name exisits, note this works because of keys we are using # would have to change if we made keys a numeric id or something (but name better be unique) if ( exists( $gmauthors->{$IN{'newauthorname'}}) ) { gm_writetocplog("$IN{'authorname'} attempted to add an author that is already registered ($IN{'newauthorname'})"); $statusnote = qq(<B><FONT COLOR="#FF0000">That author is already registered.</FONT></B><P>); &gm_editauthors; } $temphomepageprefix = substr($IN{'newauthorhomepage'}, 0, 7); if ($temphomepageprefix ne "http://") { $IN{'newauthorhomepage'} = "http://$IN{'newauthorhomepage'}"; } if ($IN{'newauthorhomepage'} eq "http://") { $IN{'newauthorhomepage'} = Gm_Constants::EMPTY; } my ($skip, $wday, $mon, $mday, $JSYear, $hour, $min, $sec, $AMPM ) = Gm_Utils::getStdDate( $serveroffset ); my $montwo = Gm_Utils::toTwoDigit( $mon ); my $mdaytwo = Gm_Utils::toTwoDigit( $mday ); # TODO STANDARDIZE HOW DATES ARE STORED (WITH LEADING 0 OR NOT) $IN{'newauthorpassword'} = crypt($IN{'newauthorpassword'},$IN{'newauthorpassword'}); my %newAuthor = (); $newAuthor{'author'} = $IN{'newauthorname'}; $newAuthor{'password'} = $IN{'newauthorpassword'}; $newAuthor{'email'} = $IN{'newauthoremail'}; $newAuthor{'homepage'} = $IN{'newauthorhomepage'}; $newAuthor{'created'} = "$montwo\/$mdaytwo\/$JSYear"; $newAuthor{'posttotal'} = '0'; if ($IN{'newauthoraccess'} eq Gm_Constants::ALL) { $newAuthor{'postnew'} = 'Y'; $newAuthor{'editentries'} = 'Y'; $newAuthor{'editconfigs'} = 'Y'; $newAuthor{'edittemplates'} = 'Y'; $newAuthor{'editauthors'} = 'Y'; $newAuthor{'rebuild'} = 'Y'; $newAuthor{'viewcplog'} = 'Y'; $newAuthor{'bookmarklets'} = 'Y'; $newAuthor{'upload'} = 'Y'; $newAuthor{'viewadmin'} = 'Y'; } elsif ($IN{'newauthoraccess'} eq "postedit") { # Some perms $newAuthor{'postnew'} = 'Y'; $newAuthor{'editentries'} = 'O'; $newAuthor{'editconfigs'} = 'N'; $newAuthor{'edittemplates'} = 'N'; $newAuthor{'editauthors'} = 'N'; $newAuthor{'rebuild'} = 'N'; $newAuthor{'viewcplog'} = 'N'; $newAuthor{'bookmarklets'} = 'Y'; $newAuthor{'upload'} = 'N'; $newAuthor{'viewadmin'} = 'Y'; } else { # No perms $newAuthor{'postnew'} = 'N'; $newAuthor{'editentries'} = 'N'; $newAuthor{'editconfigs'} = 'N'; $newAuthor{'edittemplates'} = 'N'; $newAuthor{'editauthors'} = 'N'; $newAuthor{'rebuild'} = 'N'; $newAuthor{'viewcplog'} = 'N'; $newAuthor{'bookmarklets'} = 'N'; $newAuthor{'upload'} = 'N'; $newAuthor{'viewadmin'} = 'N'; } Gm_Storage::addAuthor( %newAuthor, errHandler=>\&Gm_Web::displayAdminErrorExit ); gm_writetocplog("$IN{'authorname'} registered a new author ($IN{'newauthorname'})"); $statusnote = qq(<B><FONT COLOR="#0000FF">$IN{'newauthorname'} has been added to the author database.</FONT></B><P>); &gm_editauthors; } # ---------------- # delete an author # ---------------- sub gm_deleteselectedauthor { &gm_validate; if ($gmauthoraccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to delete an author ($IN{'selectedauthor'}) without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to delete authors.</FONT></B><P>); &gm_frontpage; } my $gmauthors = Gm_Storage::getAuthors( errHandler=>\&Gm_Web::displayAdminErrorExit ); if ( !exists( $gmauthors->{$IN{'selectedauthor'}}) ) { $statusnote = qq(<B><FONT COLOR="#FF0000">You must select an author first.</FONT></B><P>); &gm_editauthors; } if( scalar( keys(%$gmauthors)) == 1 ){ $statusnote = qq(<B><FONT COLOR="#FF0000">You can't delete the only remaining author!</FONT></B><P>); &gm_editauthors; } Gm_Storage::deleteAuthor( author=>$IN{'selectedauthor'}, errHandler=>\&Gm_Web::displayAdminErrorExit ); if ($IN{'selectedauthor'} eq $IN{'authorname'}) { gm_writetocplog("$IN{'authorname'} deleted himself/herself."); } else { gm_writetocplog("$IN{'authorname'} deleted an author ($IN{'selectedauthor'})"); } if ($IN{'selectedauthor'} eq $IN{'authorname'}) { $loginnotice = qq(<B><FONT COLOR="#0000FF">Please re-enter under your new author name and password.</FONT></B><P>); &gm_login; } else { $statusnote = qq(<B><FONT COLOR="#0000FF">$IN{'selectedauthor'} has been deleted.</FONT></B><P>); &gm_editauthors; } } # ----------------- # editing an author # ----------------- sub gm_editselectedauthor { &gm_validate; if ($gmauthoraccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to edit the authors without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the authors.</FONT></B><P>); &gm_frontpage; } my $gmauthors = Gm_Storage::getAuthors( errHandler=>\&Gm_Web::displayAdminErrorExit ); if ( !exists( $gmauthors->{$IN{'selectedauthor'}}) ) { $statusnote = qq(<B><FONT COLOR="#FF0000">You must select an author first.</FONT></B><P>); &gm_editauthors; } my $selectedauthor = $gmauthors->{$IN{'selectedauthor'}}; if ($selectedauthor->{'homepage'} eq Gm_Constants::EMPTY) { $selectedauthor->{'homepage'} = "http://"; } if ($statusnote eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#000000">Editing $selectedauthor->{'author'}'s Info & Access (Created $selectedauthor->{'created'})</FONT></B><P>); } ## TODO REFACTOR OUT STORAGE OF PASSWORD AS PLAIN TEXT, USE GM_AUTH print<<GMEDITSELECTEDAUTHORTOP; $gmheadtag $gmframetop $statusnote <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="authororiginalname" VALUE="$selectedauthor->{'author'}"> <INPUT TYPE=HIDDEN NAME="authororiginalpassword" VALUE="$selectedauthor->{'password'}"> <INPUT TYPE=HIDDEN NAME="authororiginaldate" VALUE="$selectedauthor->{'created'}"> <INPUT TYPE=HIDDEN NAME="authororiginalentries" VALUE="$selectedauthor->{'posttotal'}"> <INPUT TYPE=HIDDEN NAME="editedauthornumber" VALUE="$selectedauthor->{'author'}"> <TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=1> <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="$selectedauthor->{'author'}" SIZE=20></TD></TR> <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="$selectedauthor->{'password'}" SIZE=20></TD></TR> <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="$selectedauthor->{'email'}" SIZE=20></TD></TR> <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="$selectedauthor->{'homepage'}" SIZE=20></TD></TR> GMEDITSELECTEDAUTHORTOP print qq(<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Can post new entries?:</FONT></TD>); if ($selectedauthor->{'postnew'} eq 'Y') { 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); } else { 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); } print qq(<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Can edit entries?:</FONT></TD>); if ($selectedauthor->{'editentries'} eq 'Y') { 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); } elsif ($gmselectedauthorinfo[7] eq 'O') { 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); } else { 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); } print qq(<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Can configure?:</FONT></TD>); if ($selectedauthor->{'editconfigs'} eq 'Y') { 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); } else { 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); } print qq(<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Can edit templates?:</FONT></TD>); if ($selectedauthor->{'edittemplates'} eq 'Y') { 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); } elsif ($gmselectedauthorinfo[9] eq 'O') { 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); } else { 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); } print qq(<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Can edit authors?:</FONT></TD>); if ($selectedauthor->{'editauthors'} eq 'Y') { 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); } else { 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); } print qq(<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Can rebuild files?:</FONT></TD>); if ($selectedauthor->{'rebuild'} eq 'Y') { 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); } else { 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); } print qq(<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Can view CP log?:</FONT></TD>); if ($selectedauthor->{'viewcplog'} eq 'Y') { 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); } else { 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); } print qq(<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Can use bookmarklets?:</FONT></TD>); if ($selectedauthor->{'bookmarklets'} eq 'Y') { 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); } else { 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); } print qq(<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Can upload files?:</FONT></TD>); if ($selectedauthor->{'upload'} eq 'Y') { 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); } else { 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); } print qq(<TR><TD VALIGN=MIDDLE ALIGN=RIGHT BGCOLOR="#FFFFFF">$gmfonttag Can login to gm.cgi?:</FONT></TD>); if ($selectedauthor->{'viewadmin'} eq 'Y') { 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); } else { 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); } print<<GMEDITSELECTEDAUTHORBOTTOM; </TABLE></TD></TR></TABLE> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Save Changes To This Author"> <INPUT TYPE=RESET CLASS="button" STYLE="background: #FFD0D0" VALUE="Undo Changes Since Last Save"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Author Panel"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0"> </FORM> <P> $gmframebottom </BODY> </HTML> GMEDITSELECTEDAUTHORBOTTOM exit; } # ------------------------- # save changes to an author # ------------------------- sub gm_saveauthorchanges { &gm_validate; if ($gmauthoraccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to modify an author ($IN{'authororiginalname'}) without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to delete authors.</FONT></B><P>); &gm_frontpage; } $IN{'editedname'} =~ s/\|//g; $IN{'editedpassword'} =~ s/\|//g; $IN{'editedemail'} =~ s/\|//g; $IN{'editedhomepage'} =~ s/\|//g; $IN{'editedname'} =~ s/^\s+//; $IN{'editedname'} =~ s/\s+$//; $IN{'editedpassword'} =~ s/^\s+//; $IN{'editedpassword'} =~ s/\s+$//; if (($IN{'editedname'} eq Gm_Constants::EMPTY) || ($IN{'editedpassword'} eq Gm_Constants::EMPTY)) { $statusnote = qq(<B><FONT COLOR="#FF0000">You left either the name or password fields blank. Please try again.</FONT></B><P>); &gm_editauthors; } my $gmauthors = Gm_Storage::getAuthors( errHandler=>\&Gm_Web::displayAdminErrorExit ); if (($IN{'authororiginalname'} ne $IN{'editedname'}) && ( exists( $gmauthors->{$IN{'editedname'}} )) ){ gm_writetocplog("$IN{'authorname'} attempted to change to duplicate of $IN{'editedname'} via $IN{'authororiginalname'}"); $statusnote = qq(<B><FONT COLOR="#FF0000">You can't change the name of an existing author to duplicate of another author.</FONT></B><P>); &gm_editauthors; } if (($IN{'editedname'} ne $IN{'authororiginalname'}) && ($keeplog eq Gm_Constants::YES)) { if ($IN{'authorname'} eq $IN{'authororiginalname'}) { gm_writetocplog("$IN{'authorname'} changed his/her own name to $IN{'editedname'}"); } else { gm_writetocplog("$IN{'authorname'} changed $IN{'authororiginalname'}'s name to $IN{'editedname'}"); } } $temphomepageprefix = substr($IN{'editedhomepage'}, 0, 7); if ($temphomepageprefix ne "http://") { $IN{'editedhomepage'} = "http://$IN{'editedhomepage'}"; } if ($IN{'editedhomepage'} eq "http://") { $IN{'editedhomepage'} = Gm_Constants::EMPTY; } my $selectedauthor = $gmauthors->{$IN{'authororiginalname'}}; my %updatedInfo = (); if( $IN{'editedname'} ne $selectedauthor->{'author'}){ $updatedInfo{'author'} = $IN{'editedname'}; } if( $IN{'editedpassword'} ne $selectedauthor->{'password'}){ $updatedInfo{'password'} = crypt($IN{'editedpassword'},$IN{'editedpassword'}); } if( $IN{'editedemail'} ne $selectedauthor->{'email'}){ $updatedInfo{'email'} = $IN{'editedemail'}; } if( $IN{'editedhomepage'} ne $selectedauthor->{'homepage'}){ $updatedInfo{'homepage'} = $IN{'editedhomepage'}; } if( $IN{'editedentryaccess'} ne $selectedauthor->{'postnew'}){ $updatedInfo{'postnew'} = $IN{'editedentryaccess'}; } if( $IN{'editedentryeditaccess'} ne $selectedauthor->{'editentries'}){ $updatedInfo{'editentries'} = $IN{'editedentryeditaccess'}; } if( $IN{'editedconfigureaccess'} ne $selectedauthor->{'editconfigs'}){ $updatedInfo{'editconfigs'} = $IN{'editedconfigureaccess'}; } if( $IN{'editedtemplateaccess'} ne $selectedauthor->{'edittemplates'}){ $updatedInfo{'edittemplates'} = $IN{'editedtemplateaccess'}; } if( $IN{'editedauthoraccess'} ne $selectedauthor->{'editauthors'}){ $updatedInfo{'editauthors'} = $IN{'editedauthoraccess'}; } if( $IN{'editedrebuildaccess'} ne $selectedauthor->{'rebuild'}){ $updatedInfo{'rebuild'} = $IN{'editedrebuildaccess'}; } if( $IN{'editedcplogaccess'} ne $selectedauthor->{'viewcplog'}){ $updatedInfo{'viewcplog'} = $IN{'editedcplogaccess'}; } if( $IN{'editedbookmarkletaccess'} ne $selectedauthor->{'bookmarklets'}){ $updatedInfo{'bookmarklets'} = $IN{'editedbookmarkletaccess'}; } if( $IN{'editeduploadaccess'} ne $selectedauthor->{'upload'}){ $updatedInfo{'upload'} = $IN{'editeduploadaccess'}; } if( $IN{'editedloginaccess'} ne $selectedauthor->{'viewadmin'}){ $updatedInfo{'viewadmin'} = $IN{'editedloginaccess'}; } if( scalar( keys( %updatedInfo )) < 1 ){ # hmm, no updates submitted $statusnote = qq(<B><FONT COLOR="#0000FF">No changes were made to $selectedauthor->{'author'}.</FONT></B><P>); } else { Gm_Storage::updateAuthor( key=>$selectedauthor->{'author'}, %updatedInfo, errHandler=>\&Gm_Web::displayAdminErrorExit ); if ($IN{'authororiginalname'} eq $IN{'authorname'}) { $IN{'authorname'} = $IN{'editedname'}; $IN{'authorpassword'} = $IN{'editedpassword'}; } if ($IN{'authorname'} eq $IN{'editedname'}) { gm_writetocplog("$IN{'authorname'} edited his/her own info/access"); } else { gm_writetocplog("$IN{'authorname'} edited $IN{'editedname'}'s info/access"); } $statusnote = qq(<B><FONT COLOR="#0000FF">$IN{'editedname'}'s info/access has been edited.</FONT></B><P>); } &gm_editauthors; } # ------------------ # configuration menu # ------------------ sub gm_configuration { &gm_validate; if ($gmconfigurationaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to configure this program without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to configure this program.</FONT></B><P>); &gm_frontpage; } &gm_readconfig; my ($basedate, $wday, $mon, $mday, $JSYear, $hour, $min, $sec, $AMPM ) = Gm_Utils::getStdDate( $serveroffset ); my $montwo = Gm_Utils::toTwoDigit( $mon ); my $mdaytwo = Gm_Utils::toTwoDigit( $mday ); my $hourtwo = Gm_Utils::toTwoDigit( $hour ); my $mintwo = Gm_Utils::toTwoDigit( $min ); $censorlist = Gm_Utils::toWebSafe($censorlist); $otherfilelist = Gm_Utils::toWebSafe($otherfilelist); if ($statusnote eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#000000">Configuration Options</FONT></B><P>); } print<<GMCONFIGMENUTOP; $gmheadtag $gmframetop $statusnote <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=7 CELLSPACING=1 WIDTH=700> <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://greymatterforum.proboards82.com/" 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> <TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=100%>$gmfonttag<B>Local Log Path:</B><BR><FONT SIZE=1>The main weblog/journal directory on your account, where your main index file is.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedlogpath" VALUE="$LogPath" SIZE=30 STYLE="width: 400">$gmfonttag</TD></TR> <TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=100%>$gmfonttag<B>Local Entries/Archives Path:</B><BR><FONT SIZE=1>The directory on your account where your entry files (current and archived) are to be stored.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedentriespath" VALUE="$EntriesPath" SIZE=30 STYLE="width: 400">$gmfonttag</TD></TR> <TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=100%>$gmfonttag<B>Local CGI Path:</B><BR><FONT SIZE=1>The place on your account where you keep all your Greymatter CGI files ("gm*.cgi").</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedcgilocalpath" VALUE="$cgilocalpath" SIZE=30 STYLE="width: 400">$gmfonttag</TD></TR> <TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=100%>$gmfonttag<B>Website Log Path:</B><BR><FONT SIZE=1>The website address of the directory where your main index file is.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedlogwebpath" VALUE="$LogWebPath" SIZE=30 STYLE="width: 400">$gmfonttag</TD></TR> <TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=100%>$gmfonttag<B>Website Entries Path:</B><BR><FONT SIZE=1>The website address of the directory where all your entries are to be stored.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedentrieswebpath" VALUE="$EntriesWebPath" SIZE=30 STYLE="width: 400" WIDTH=100%>$gmfonttag</TD></TR> <TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT>$gmfonttag<B>Website CGI Path:</B><BR><FONT SIZE=1>The website address of the directory where all your Greymatter CGI files are kept.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedcgiwebpath" VALUE="$cgiwebpath" SIZE=30 STYLE="width: 400">$gmfonttag</TD></TR> <TR 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> </TABLE></TD></TR></TABLE> <P> <TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=1 WIDTH=700> <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> <TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Index filename:</B><BR><FONT SIZE=1>The filename of your log/journal's main index. If you enable "Keep archive master index", Greymatter will create that file in the archives directory with the same filename.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=350></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedindexfilename" VALUE="$indexfilename" SIZE=15 STYLE="width: 200">$gmfonttag</TD></TR> <TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>.suffix to entry files:</B><BR><FONT SIZE=1>If you have "Generate pages for individual entries" enabled, this is the suffix those pages will have.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedentrysuffix" VALUE="$entrysuffix" SIZE=15 STYLE="width: 200">$gmfonttag</TD></TR> <TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>.suffix to log archives:</B><BR><FONT SIZE=1>If you have "Keep monthly/weekly log archives" enabled, this is the suffix those log archive files will have.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedlogarchivesuffix" VALUE="$logarchivesuffix" SIZE=15 STYLE="width: 200">$gmfonttag</TD></TR> <TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Days to keep on main index:</B><BR><FONT SIZE=1>The number of days' worth of entries Greymatter will list on your main index before scrolling them off.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedindexdays" VALUE="$indexdays" SIZE=5 MAXLENGTH=5>$gmfonttag</TD></TR> GMCONFIGMENUTOP print qq(<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Generate pages for individual entries?</B><BR><FONT SIZE=1>Specifies whether you want individual entries to have their own pages. Comments are disabled if this is turned off.</FONT></FONT></TD>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedgenerateentrypages', value=>Gm_Constants::YES, checked=>$generateentrypages ).' Yes   '); println( Gm_Web::createRadioButton( name=>'editedgenerateentrypages', value=>Gm_Constants::NO, checked=>$generateentrypages ).' No '); println('</FONT></TD></TR>'); print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Keep archive master index?</B><BR><FONT SIZE=1>If enabled, Greymatter will keep an index (with the same filename as above) in your entries/archives directory, intended to be an overview of all your archives.</FONT></FONT></TD>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedkeeparchivemasterindex', value=>Gm_Constants::YES, checked=>$keeparchivemasterindex ).' Yes   '); println( Gm_Web::createRadioButton( name=>'editedkeeparchivemasterindex', value=>Gm_Constants::NO, checked=>$keeparchivemasterindex ).' No '); println('</FONT></TD></TR>'); print qq(<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Keep monthly/weekly log archives?</B><BR><FONT SIZE=1>If enabled, Greymatter will keep archive files of your log in monthly or weekly installments in your entries/archives directory.</FONT></FONT></TD>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedkeepmonthlyarchives', value=>Gm_Constants::YES, checked=>$keepmonthlyarchives ).' Yes   '); println( Gm_Web::createRadioButton( name=>'editedkeepmonthlyarchives', value=>Gm_Constants::NO, checked=>$keepmonthlyarchives ).' No '); println('</FONT></TD></TR>'); print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Keep main index and archive log<BR>indexes concurrent with each other?</B><BR><FONT SIZE=1>If enabled, both new and archived entries will be listed in the monthly/weekly archives; if disabled, Greymatter won't list entries there until they've scrolled off the main index. For simplicity's sake, it's a good idea leave this on.</FONT></FONT></TD>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedconcurrentmainandarchives', value=>Gm_Constants::YES, checked=>$concurrentmainandarchives ).' Yes   '); println( Gm_Web::createRadioButton( name=>'editedconcurrentmainandarchives', value=>Gm_Constants::NO, checked=>$concurrentmainandarchives ).' No '); println('</FONT></TD></TR>'); print qq(<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Archive by month or week?</B><BR><FONT SIZE=1>If "Keep monthly/weekly log archives" is enabled, this specifies whether the log archives will be generated by the month or by the week.</FONT></FONT></TD>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedarchiveformat', value=>Gm_Constants::MONTH, checked=>$archiveformat ).' Monthly   '); println( Gm_Web::createRadioButton( name=>'editedarchiveformat', value=>Gm_Constants::WEEK, checked=>$archiveformat ).' Weekly '); println('</FONT></TD></TR>'); print qq(</TABLE></TD></TR></TABLE> <P> <TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=1 WIDTH=700> <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> <TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=100%>$gmfonttag<B>E-Mail Program Location:</B><BR><FONT SIZE=1>The pointer to the mail program (usually Sendmail) on your account.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editedmailprog" VALUE="$mailprog" SIZE=30 STYLE="width: 400">$gmfonttag</TD></TR> <TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=100%>$gmfonttag<B>E-Mail(s) to send notices to:</B><BR><FONT SIZE=1>The e-mail addresses you want all notifications (if any) to be sent to. Separate multiple e-mail addresses with semicolons.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=LEFT></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editednotifyemail" VALUE="$NotifyEmail" SIZE=30 STYLE="width: 400">$gmfonttag</TD></TR> <TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=100%>$gmfonttag<B>Send e-mail notifications for:</B><BR><FONT SIZE=1>Indicates whether you want Greymatter to send e-mails notifying you of new karma votes, new comment postings, both karma and comments, or to disable e-mail notification altogether.</FONT></FONT></TD>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER">'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editednotifyforstatus', value=>Gm_Constants::KARMA, checked=>$NotifyForStatus ).' New karma votes  '); println( Gm_Web::createRadioButton( name=>'editednotifyforstatus', value=>Gm_Constants::COMMENTS, checked=>$NotifyForStatus ).' New comments<BR>'); println( Gm_Web::createRadioButton( name=>'editednotifyforstatus', value=>Gm_Constants::BOTH, checked=>$NotifyForStatus ).' Both   '); println( Gm_Web::createRadioButton( name=>'editednotifyforstatus', value=>Gm_Constants::NEITHER, checked=>$NotifyForStatus ).' Neither'); println('</FONT></TD></TR>'); print qq(</TABLE></TD></TR></TABLE> <P> <TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=1 WIDTH=700> <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> <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>); println( '<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedemoticonsallowed', value=>Gm_Constants::ENTRIES, checked=>$emoticonsallowed ).' Entries only   '); println( Gm_Web::createRadioButton( name=>'editedemoticonsallowed', value=>Gm_Constants::COMMENTS, checked=>$emoticonsallowed ).' Comments only<BR> '); println( Gm_Web::createRadioButton( name=>'editedemoticonsallowed', value=>Gm_Constants::BOTH, checked=>$emoticonsallowed ).' Both   '); println( Gm_Web::createRadioButton( name=>'editedemoticonsallowed', value=>Gm_Constants::NEITHER, checked=>$emoticonsallowed ).' Neither '); println( '</FONT></TD></TR>' ); print qq(</TABLE></TD></TR></TABLE> <P> <TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=1 WIDTH=700> <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> <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>); println('<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedallowkarmaorcomments', value=>Gm_Constants::KARMA, checked=>$allowkarmaorcomments ).' Karma only   '); println( Gm_Web::createRadioButton( name=>'editedallowkarmaorcomments', value=>Gm_Constants::COMMENTS, checked=>$allowkarmaorcomments ).'Comments only<BR> '); println( Gm_Web::createRadioButton( name=>'editedallowkarmaorcomments', value=>Gm_Constants::BOTH, checked=>$allowkarmaorcomments ).'Both   '); println( Gm_Web::createRadioButton( name=>'editedallowkarmaorcomments', value=>Gm_Constants::NEITHER, checked=>$allowkarmaorcomments ).'Neither '); println( '</FONT></TD></TR>' ); print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Order of comments on entry pages:</B><BR><FONT SIZE=1>The order in which you want comments displayed. If "ascending", they'll be listed from newest to oldest, with the newest comment at the top; if "descending", from first to last, with the first comment at the top.</FONT></FONT></TD>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedcommentsorder', value=>Gm_Constants::ASCENDING, checked=>$commentsorder ).' Ascending   '); println( Gm_Web::createRadioButton( name=>'editedcommentsorder', value=>Gm_Constants::DESCENDING, checked=>$commentsorder ).' Descending '); println('</FONT></TD></TR>'); print qq(<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Can post comments and vote on karma in archives?</B><BR><FONT SIZE=1>If enabled, visitors can cast karma votes or post comments (if applicable) on entries no longer listed on the main index. Enabling this may slow down your site over time.</FONT></FONT></TD>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedposttoarchives', value=>Gm_Constants::YES, checked=>$posttoarchives ).' Yes   '); println( Gm_Web::createRadioButton( name=>'editedposttoarchives', value=>Gm_Constants::NO, checked=>$posttoarchives ).' No '); println('</FONT></TD></TR>'); print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Karma voting on by default?</B><BR><FONT SIZE=1>Specifies whether "Allow karma voting on this entry" is preselected to "Yes" or "No" by default on the "Add a new entry" screen.</FONT></FONT></TD>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedallowkarmadefault', value=>Gm_Constants::YES, checked=>$allowkarmadefault ).' Yes   '); println( Gm_Web::createRadioButton( name=>'editedallowkarmadefault', value=>Gm_Constants::NO, checked=>$allowkarmadefault ).' No '); println('</FONT></TD></TR>'); print qq(<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Comment posting on by default?</B><BR><FONT SIZE=1>Specifies whether "Allow comments to be posted to this entry" is preselected to "Yes" or "No" by default on the "Add a new entry" screen.</FONT></FONT></TD>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedallowcommentsdefault', value=>Gm_Constants::YES, checked=>$allowcommentsdefault ).' Yes   '); println( Gm_Web::createRadioButton( name=>'editedallowcommentsdefault', value=>Gm_Constants::NO, checked=>$allowcommentsdefault ).' No '); println('</FONT></TD></TR>'); print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>HTML allowed in comments?</B><BR><FONT SIZE=1>Indicates whether you want to allow visitors to include HTML codes in their comments, or to have Greymatter strip them out. You can also specify whether only the codes for links, bold and italics can be included, or just the codes for links.</FONT></FONT></TD>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedallowhtmlincomments', value=>Gm_Constants::YES, checked=>$allowhtmlincomments ).' All HTML allowed   '); println( Gm_Web::createRadioButton( name=>'editedallowhtmlincomments', value=>Gm_Constants::NO, checked=>$allowhtmlincomments ).' No HTML allowed<BR> '); println( Gm_Web::createRadioButton( name=>'editedallowhtmlincomments', value=>'linkboldital', checked=>$allowhtmlincomments ).' Linking, Bold & Italic code only<BR> '); println( Gm_Web::createRadioButton( name=>'editedallowhtmlincomments', value=>'linkonly', checked=>$allowhtmlincomments ).' Linking code only '); println('</FONT></TD></TR>'); print qq(<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Auto-link URLs in comments?</B><BR><FONT SIZE=1>If enabled, Greymatter will automatically link to any website or e-mail addresses that users post in their comments (unless you've enabled linking above and they've already linked the website/e-mail address themselves).</FONT></FONT></TD>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedautolinkurls', value=>Gm_Constants::YES, checked=>$autolinkurls ).' Yes   '); println( Gm_Web::createRadioButton( name=>'editedautolinkurls', value=>Gm_Constants::NO, checked=>$autolinkurls ).' No '); println('</FONT></TD></TR>'); print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Strip new lines from comments?</B><BR><FONT SIZE=1>If enabled, all line and paragraph breaks are stripped when displaying visitors' comments, turning them into unbroken blocks of text; if disabled, Greymatter preserves the visitors' original formatting.</FONT></FONT></TD>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedstriplinesfromcomments', value=>Gm_Constants::YES, checked=>$striplinesfromcomments ).' Yes   '); println( Gm_Web::createRadioButton( name=>'editedstriplinesfromcomments', value=>Gm_Constants::NO, checked=>$striplinesfromcomments ).' No '); println('</FONT></TD></TR>'); print qq(<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Allow multiple karma votes from same IP?</B><BR><FONT SIZE=1>If enabled, the same visitor could cast multiple karma votes on the same entry; if disabled, only one vote per visitor is allowed.</FONT></FONT></TD>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedallowmultiplekarmavotes', value=>Gm_Constants::YES, checked=>$allowmultiplekarmavotes ).' Yes   '); println( Gm_Web::createRadioButton( name=>'editedallowmultiplekarmavotes', value=>Gm_Constants::NO, checked=>$allowmultiplekarmavotes ).' No '); println('</FONT></TD></TR>'); print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Mention it in the control panel log when<BR>comments and karma votes are added?</B><BR><FONT SIZE=1>Enable this if you want Greymatter to mention all new comments and karma votes in the control panel log.</FONT></FONT></TD>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedlogkarmaandcomments', value=>Gm_Constants::YES, checked=>$logkarmaandcomments ).' Yes   '); println( Gm_Web::createRadioButton( name=>'editedlogkarmaandcomments', value=>Gm_Constants::NO, checked=>$logkarmaandcomments ).' No '); println('</FONT></TD></TR>'); # new config entries for $keepphphacklog and $mailhacknotice: linear 9/12/2003 # merged into 1.3 print 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>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedkeepphphacklog', value=>Gm_Constants::YES, checked=>$keepphphacklog ).' Yes   '); println( Gm_Web::createRadioButton( name=>'editedkeepphphacklog', value=>Gm_Constants::NO, checked=>$keepphphacklog ).' No '); println('</FONT></TD></TR>'); print 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>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedmailhacknotice', value=>Gm_Constants::YES, checked=>$mailhacknotice ).' Yes   '); println( Gm_Web::createRadioButton( name=>'editedmailhacknotice', value=>Gm_Constants::NO, checked=>$mailhacknotice ).' No '); println('</FONT></TD></TR>'); println('<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>'.$gmfonttag. '<B>Password Protect Author Name in Comments?</B><BR><FONT SIZE=1> '. '<B><FONT COLOR="#00FF00">Updated</FONT></B> If enabled '. 'comments cannot be entered that contain a registered authors name. When authors '. 'wish to post comments they must enter their author name, the "_", and their '. 'password. In other words as AUTHORNAME_PASSWORD (using proper case for the '. 'username and password). Exact means that the commenter name must match the '. 'author\'s name exactly.</FONT></FONT></TD>'); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedprotectauthorname', value=>'LOOSE', checked=>$protectauthorname ).' Loose   '); println( Gm_Web::createRadioButton( name=>'editedprotectauthorname', value=>'STRICT', checked=>$protectauthorname ).' Exact   '); println( Gm_Web::createRadioButton( name=>'editedprotectauthorname', value=>Gm_Constants::NO, checked=>$protectauthorname ).' No '); println('</FONT></TD></TR>'); println('<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>'.$gmfonttag. '<B>Limit Links in Comments?</B><BR><FONT SIZE=1>If enabled '. 'comments that contain more than the specified allowed amount of comments will '. 'be automatically block and/or banned.</FONT></FONT></TD>'); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedcommentlinklimit', value=>'blockban', checked=>$commentlinklimit ).' Block and Ban   '); println( Gm_Web::createRadioButton( name=>'editedcommentlinklimit', value=>'block', checked=>$commentlinklimit ).' Block   '); println( Gm_Web::createRadioButton( name=>'editedcommentlinklimit', value=>Gm_Constants::NO, checked=>$commentlinklimit ).' No <br />'); println( '<INPUT TYPE=TEXT CLASS="textinput" NAME="editedcommentlinklimitnum" VALUE="'. $commentlinklimitnum.'" SIZE=5 MAXLENGTH=5> links' ); println('</FONT></TD></TR>'); println('<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>'.$gmfonttag. '<B>Force Previewing when Posting a Comment?</B><BR><FONT SIZE=1>If enabled '. 'comments cannot be entered without previewing first. This extra step can help '. 'cut down on spam. Note that if this is enabled, you may wish to remove the '. '"Submit" button on the comment entry template, since this will just take the user'. 'to the preview page, or remove the "Preview" button.'. '<br />Note: This may require a modification to the "Confirmation Form Template",'. ' simply add or verify that the button in that template has the "name=postit" attribute.'. '</FONT></TD>'); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedcommentforcepreview', value=>Gm_Constants::YES, checked=>$commentforcepreview ).' Yes   '); println( Gm_Web::createRadioButton( name=>'editedcommentforcepreview', value=>Gm_Constants::NO, checked=>$commentforcepreview ).' No '); println('</FONT></TD></TR>'); println('<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>'.$gmfonttag. '<B>Commenter Verification?</B> <FONT COLOR="#00FF00"UPDATED</FONT><BR><FONT SIZE=1>If enabled '. 'when a comment is submitted, the commenter will be prompted to retype a "pass-phrase" withen 3 minutes,'. 'to cut down on automated spam. You can provide a static pass-phrase that users will '. 'be prompted, or the pass-phrase will be used to create a random 7 character string '. '</FONT></FONT></TD>'); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedcommentverify', value=>'random', checked=>$commentverify ).' Random Phrase   '); println( Gm_Web::createRadioButton( name=>'editedcommentverify', value=>'static', checked=>$commentverify ).' Static Phrase   '); println( Gm_Web::createRadioButton( name=>'editedcommentverify', value=>Gm_Constants::NO, checked=>$commentverify ).' No <br />'); println( '<INPUT TYPE=TEXT CLASS="textinput" NAME="editedcommentverifyphrase" VALUE="'. $commentverifyphrase.'" SIZE=15 MAXLENGTH=15>' ); println('</FONT></TD></TR>'); print qq(</TABLE></TD></TR></TABLE> <P> <TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=1 WIDTH=700> <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> <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> <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> </TABLE></TD></TR></TABLE> <P> <TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=1 WIDTH=700> <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> <TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Allowed File Types:</B><BR><FONT SIZE=1>If you only wish to allow certain types of files to be uploaded, enter their file suffixes here. Separate allowed file types by semicolons (for example, "jpg;gif;zip"). Leave this blank to allow any type of file to be uploaded.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editeduploadfilesallowed" VALUE="$uploadfilesallowed" SIZE=20 STYLE="width: 320">$gmfonttag</TD></TR> <TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Maximum Filesize Allowed:</B><BR><FONT SIZE=1>If you don't wish to allow files larger than a certain size to be uploaded, specify that limit here (in KB/kilobytes). Leave this on "0" to allow files of any size to be uploaded.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%></FONT><INPUT TYPE=TEXT CLASS="textinput" NAME="editeduploadfilesizelimit" VALUE="$uploadfilesizelimit" SIZE=5 MAXLENGTH=5>$gmfonttag KB</TD></TR> </TABLE></TD></TR></TABLE> <P> <TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=1 WIDTH=700> <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> <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>); println( '<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedcensorenabled', value=>Gm_Constants::ENTRIES, checked=>$censorenabled ).' Entries only   '); println( Gm_Web::createRadioButton( name=>'editedcensorenabled', value=>Gm_Constants::COMMENTS, checked=>$censorenabled ).' Comments only<BR> '); println( Gm_Web::createRadioButton( name=>'editedcensorenabled', value=>Gm_Constants::BOTH, checked=>$censorenabled ).' Both   '); println( Gm_Web::createRadioButton( name=>'editedcensorenabled', value=>Gm_Constants::NEITHER, checked=>$censorenabled ).' Neither'); println('</FONT></TD></TR>'); print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Censor List</B><BR><FONT SIZE=1>Enter any words or phrases you want to censor, separated by lines (press return after each word/phrase). Use [brackets] around words/phrases to censor the term only if it's not part of another word/phrase; for example, censoring the word hell would render hell as **** and shell as s****, but censoring [hell] would only turn hell by itself into asterisks, and leave the word shell alone.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%></FONT><TEXTAREA NAME="editedcensorlist" COLS=25 ROWS=6 WRAP=VIRTUAL STYLE="width: 320">$censorlist</TEXTAREA>$gmfonttag</FONT></TD></TR> </TABLE></TD></TR></TABLE> <P> <TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=1 WIDTH=700> <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> <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> <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>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedotherfilelistentryrebuild', value=>Gm_Constants::YES, checked=>$otherfilelistentryrebuild ).' Yes   '); println( Gm_Web::createRadioButton( name=>'editedotherfilelistentryrebuild', value=>Gm_Constants::NO, checked=>$otherfilelistentryrebuild ).' No '); println('</FONT></TD></TR>'); print qq(</TABLE></TD></TR></TABLE> <P> <TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=7 CELLSPACING=1 WIDTH=700> <TR><TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#C0C0C0" COLSPAN=2>$gmfonttag<B>Miscellaneous Options</B></FONT></TD></TR> <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>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedcookiesallowed', value=>Gm_Constants::YES, checked=>$cookiesallowed ).' Yes   '); println( Gm_Web::createRadioButton( name=>'editedcookiesallowed', value=>Gm_Constants::NO, checked=>$cookiesallowed ).' No '); println('<BR><INPUT TYPE=CHECKBOX NAME="editeddeletecookies" VALUE="yes"> Delete cookies set by Greymatter?'); println('</FONT></TD></TR>'); print qq(<TR BGCOLOR="#FFFFFF">); println('<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>'); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedkeeplog', value=>Gm_Constants::YES, checked=>$keeplog ).' Yes   '); println( Gm_Web::createRadioButton( name=>'editedkeeplog', value=>Gm_Constants::NO, checked=>$keeplog ).' No '); println('</FONT></TD></TR>'); print qq(<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Allow "easy formatting"?</B><BR><FONT SIZE=1>With "easy formatting", bold text, italics & underlining can be done easily by bracketing text with two **asterisks**, \\\\backslashes\\\\ or __underlines__ respectively. You can specify whether this is enabled in entries, comments, or both; if disabled, the characters won't be converted.</FONT></FONT></TD>); println( '<TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedinlineformatting', value=>Gm_Constants::ENTRIES, checked=>$inlineformatting ).' Entries only   '); println( Gm_Web::createRadioButton( name=>'editedinlineformatting', value=>Gm_Constants::COMMENTS, checked=>$inlineformatting ).' Comments only<BR> '); println( Gm_Web::createRadioButton( name=>'editedinlineformatting', value=>Gm_Constants::BOTH, checked=>$inlineformatting ).' Both   '); println( Gm_Web::createRadioButton( name=>'editedinlineformatting', value=>Gm_Constants::NEITHER, checked=>$inlineformatting ).' Neither '); println('</FONT></TD></TR>'); print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Default entry list view:</B><BR><FONT SIZE=1>This specifies which view will be the default when you go to the Edit An Entry selection menu.</FONT></FONT></TD><TD VALIGN=MIDDLE ALIGN=CENTER WIDTH=50%>$gmfonttag<SELECT NAME="editeddefaultentrylistview" CLASS="selectlist">\n); println( Gm_Web::createOption( value=>'main', label=>' Current entries ('.$indexdays.' day(s))', checked=>$defaultentrylistview )); println( Gm_Web::createOption( value=>'onlyyou', label=>' All entries by you', checked=>$defaultentrylistview )); println( Gm_Web::createOption( value=>Gm_Constants::MORE, label=>' All extended entries', checked=>$defaultentrylistview )); println( Gm_Web::createOption( value=>Gm_Constants::OPEN, label=>' All open entries', checked=>$defaultentrylistview )); println( Gm_Web::createOption( value=>Gm_Constants::CLOSED, label=>' All closed entries', checked=>$defaultentrylistview )); println( Gm_Web::createOption( value=>Gm_Constants::ALL, label=>' All entries', checked=>$defaultentrylistview )); print qq(</SELECT></FONT></TD></TR>\n<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Order of list links:</B><BR><FONT SIZE=1>The order in which you want links to be displayed in log list 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>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedentrylistsortorder', value=>Gm_Constants::ASCENDING, checked=>$entrylistsortorder ).' Ascending   '); println( Gm_Web::createRadioButton( name=>'editedentrylistsortorder', value=>Gm_Constants::DESCENDING, checked=>$entrylistsortorder ).' Descending '); println('</FONT></TD></TR>'); print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Log entry list variable number:</B><BR><FONT SIZE=1>The number of entries to link to, starting from the most recent, whenever the "number" variant of the log entrylist variables (for example, if this is set to 5, using {{logmoreentrylist number}} would generate a list of links to the five most recent extended entries). Check the <a href="http://greymatterforum.proboards82.com/" 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); print qq(<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Link to entries in {{logentrylist comments}} only if comments are active?</B><BR><FONT SIZE=1>If you use {{logentrylist comments}} and its related variables (see the <a href="http://greymatterforum.proboards82.com/" 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>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedcommententrylistonlyifokay', value=>Gm_Constants::YES, checked=>$commententrylistonlyifokay ).' Yes   '); println( Gm_Web::createRadioButton( name=>'editedcommententrylistonlyifokay', value=>Gm_Constants::NO, checked=>$commententrylistonlyifokay ).' No '); println('</FONT></TD></TR>'); print qq(<TR BGCOLOR="#FFFFFF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>Entries to link to in {{calendar}}:</B><BR><FONT SIZE=1>Whenever you use {{calendar}} or {{calendarweek}} to generate tables linking to your entries, this specifies whether you want to link to the most recent entry for that day, or to link only to extended entries. (It won't generate links at all if "Generate pages for individual entries" is turned off.)</FONT></FONT></TD>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedlinktocalendarentries', value=>Gm_Constants::ALL, checked=>$linktocalendarentries ).' Always link to entry for that calendar day<BR>'); println( Gm_Web::createRadioButton( name=>'editedlinktocalendarentries', value=>Gm_Constants::MORE, checked=>$linktocalendarentries ).' Link only to extended entries '); println('</FONT></TD></TR>'); print qq(<TR BGCOLOR="#F8F8FF"><TD VALIGN=MIDDLE ALIGN=RIGHT WIDTH=50%>$gmfonttag<B>"Automatically rebuild" selected by default?</B><BR><FONT SIZE=1>Selects whether the option to automatically rebuild files after saving changes to templates or entries is prechecked by default. (Authors without access to rebuilding files won't see this option.)</FONT></FONT></TD>); println('<TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH=50%>'.$gmfonttag ); println( Gm_Web::createRadioButton( name=>'editedautomaticrebuilddefault', value=>Gm_Constants::YES, checked=>$automaticrebuilddefault ).' Yes   '); println( Gm_Web::createRadioButton( name=>'editedautomaticrebuilddefault', value=>Gm_Constants::NO, checked=>$automaticrebuilddefault ).' No '); println('</FONT></TD></TR>'); print<<GMCONFIGMENUBOTTOM; </TABLE></TD></TR></TABLE> <P> <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> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Save Configuration"> <INPUT TYPE=RESET CLASS="button" STYLE="background: #FFD0D0" VALUE="Undo Changes Since Last Save"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0"> </FORM> <P> $gmframebottom </BODY> </HTML> GMCONFIGMENUBOTTOM $statusnote = Gm_Constants::EMPTY; exit; } # ---------------- # save config file # ---------------- sub gm_saveconfiguration { &gm_validate; if ($gmconfigurationaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to save changes to the config file without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to change the config file.</FONT></B><P>); &gm_frontpage; } chomp ($IN{'editedcensorlist'}); $IN{'editedcensorlist'} = Gm_Utils::toStoreSafe($IN{'editedcensorlist'}); chomp ($IN{'editedotherfilelist'}); $IN{'editedotherfilelist'} = Gm_Utils::toStoreSafe($IN{'editedotherfilelist'}); $IN{'editedlogpath'} = Gm_Utils::toConfigSafe($IN{'editedlogpath'}); $IN{'editedentriespath'} = Gm_Utils::toConfigSafe($IN{'editedentriespath'}); $IN{'editedlogwebpath'} = Gm_Utils::toConfigSafe($IN{'editedlogwebpath'}); $IN{'editedentrieswebpath'} = Gm_Utils::toConfigSafe($IN{'editedentrieswebpath'}); $IN{'editednotifyemail'} = Gm_Utils::toConfigSafe($IN{'editednotifyemail'}); $IN{'editedindexfilename'} = Gm_Utils::toConfigSafe($IN{'editedindexfilename'}); $IN{'editedentrysuffix'} = Gm_Utils::toConfigSafe($IN{'editedentrysuffix'}); $IN{'editedindexdays'} = Gm_Utils::toConfigSafe($IN{'editedindexdays'}); $IN{'editedoffsettime'} = Gm_Utils::toConfigSafe($IN{'editedoffsettime'}); $IN{'editedtimezone'} = Gm_Utils::toConfigSafe($IN{'editedtimezone'}); $IN{'editedmailprog'} = Gm_Utils::toConfigSafe($IN{'editedmailprog'}); $IN{'editedcgilocalpath'} = Gm_Utils::toConfigSafe($IN{'editedcgilocalpath'}); $IN{'editedcgiwebpath'} = Gm_Utils::toConfigSafe($IN{'editedcgiwebpath'}); $IN{'editedemoticonspath'} = Gm_Utils::toConfigSafe($IN{'editedemoticonspath'}); $IN{'editedentrylistcountnumber'} = Gm_Utils::toConfigSafe($IN{'editedentrylistcountnumber'}); $IN{'editedlogarchivesuffix'} = Gm_Utils::toConfigSafe($IN{'editedlogarchivesuffix'}); $IN{'editedcensorlist'} =~ s/^\s+//; $IN{'editedcensorlist'} =~ s/\s+$//; $IN{'editedotherfilelist'} =~ s/^\s+//; $IN{'editedotherfilelist'} =~ s/^\s+//; $IN{'editedentrysuffix'} =~ s/\.//g; $IN{'editednotifyemail'} =~ s/ //g; $IN{'editedlogarchivesuffix'} =~ s/\.//g; if (($IN{'editedlogpath'} eq Gm_Constants::EMPTY) || ($IN{'editedentriespath'} eq Gm_Constants::EMPTY) || ($IN{'editedlogwebpath'} eq Gm_Constants::EMPTY) || ($IN{'editedentrieswebpath'} eq Gm_Constants::EMPTY) || ($IN{'editedindexfilename'} eq Gm_Constants::EMPTY) || ($IN{'editedentrysuffix'} eq Gm_Constants::EMPTY) || ($IN{'editedindexdays'} eq Gm_Constants::EMPTY) || ($IN{'editedoffsettime'} eq Gm_Constants::EMPTY) || ($IN{'editedtimezone'} eq Gm_Constants::EMPTY) || ($IN{'editedcgilocalpath'} eq Gm_Constants::EMPTY) || ($IN{'editedcgiwebpath'} eq Gm_Constants::EMPTY) || ($IN{'editedentrylistcountnumber'} eq Gm_Constants::EMPTY) || ($IN{'editedlogarchivesuffix'} eq Gm_Constants::EMPTY)) { $statusnote = qq(<B><FONT COLOR="#FF0000">You left one or more of the required fields blank. Please try again.</FONT></B><P>); &gm_configuration; } if ($IN{'editedindexdays'} =~ /\D/) { $statusnote = qq(<B><FONT COLOR="#FF0000">"Days to keep on main index" must be a number.</FONT></B><P>); &gm_configuration; } if ($IN{'editedoffsettime'} =~ /[^0-9.-]/) { $statusnote = qq(<B><FONT COLOR="#FF0000">"Server Offset Time" must be a number.</FONT></B><P>); &gm_configuration; } if ($IN{'editeduploadfilesizelimit'} eq Gm_Constants::EMPTY) { $IN{'editeduploadfilesizelimit'} = 0; } if ($IN{'editeduploadfilesizelimit'} =~ /\D/) { $statusnote = qq(<B><FONT COLOR="#FF0000">"Maximum Filesize Allowed" must be a number.</FONT></B><P>); &gm_configuration; } if (($IN{'editednotifyemail'} ne Gm_Constants::EMPTY) && ($IN{'editedmailprog'} eq Gm_Constants::EMPTY)) { $statusnote = qq(<B><FONT COLOR="#FF0000">You must give your server's e-mail program location<BR>if you're going to have e-mail notification enabled.</FONT></B><P>); &gm_configuration; } if (($IN{'editednotifyemail'} eq Gm_Constants::EMPTY) && ($IN{'editednotifyforstatus'} ne Gm_Constants::NEITHER)) { $statusnote = qq(<B><FONT COLOR="#FF0000">You must give an e-mail address to receive e-mail notifications.</FONT></B><P>); &gm_configuration; } if ($IN{'editedentrylistcountnumber'} =~ /\D/) { $statusnote = qq(<B><FONT COLOR="#FF0000">"Log entry list variable number" must be a number.</FONT></B><P>); &gm_configuration; } $IN{'editeduploadfilesallowed'} =~ s/;/SEMICOLON/g; if ($IN{'editeduploadfilesallowed'} =~ /\W/) { $statusnote = qq(<B><FONT COLOR="#FF0000">"Allowed File Types" must only contain alphanumeric characters (besides semicolons).</FONT></B><P>); &gm_configuration; } $IN{'editeduploadfilesallowed'} =~ s/SEMICOLON/;/g; if ($IN{'editedindexdays'} < 1) { $statusnote = qq(<B><FONT COLOR="#FF0000">"Days to keep on main index" must be set to at least one!</FONT></B><P>); &gm_configuration; } if( $IN{'editedcommentlinklimit'} ne Gm_Constants::NO && $IN{'editedcommentlinklimitnum'} < 1 ){ # blocking comments with zero links makes no sense $statusnote = '<B><FONT COLOR="#FF0000">"Limit Links in Comments" must be set to at '. 'least one!</FONT></B><P>'; &gm_configuration; } if( $IN{'editedcommentverify'} ne Gm_Constants::NO && $IN{'editedcommentverifyphrase'} eq '' ){ # if turned on must have a phrase of some sort $statusnote = '<B><FONT COLOR="#FF0000">"Please provide a pass-phrase for '. '"Commenter Verification"!</FONT></B><P>'; &gm_configuration; } if (substr($IN{'editedlogpath'}, -1) eq "/") { chop ($IN{'editedlogpath'}) }; if (substr($IN{'editedentriespath'}, -1) eq "/") { chop ($IN{'editedentriespath'}) }; if (substr($IN{'editedcgilocalpath'}, -1) eq "/") { chop ($IN{'editedcgilocalpath'}) }; if (substr($IN{'editedlogwebpath'}, -1) eq "/") { chop ($IN{'editedlogwebpath'}) }; if (substr($IN{'editedentrieswebpath'}, -1) eq "/") { chop ($IN{'editedentrieswebpath'}) }; if (substr($IN{'editedcgiwebpath'}, -1) eq "/") { chop ($IN{'editedcgiwebpath'}) }; if (substr($IN{'editedemoticonspath'}, -1) eq "/") { chop ($IN{'editedemoticonspath'}) }; my %confs = (); $confs{'gmlogpath'} = $IN{'editedlogpath'}; $confs{'gmentriespath'} = $IN{'editedentriespath'}; $confs{'gmlogwebpath'} = $IN{'editedlogwebpath'}; $confs{'gmentrieswebpath'} = $IN{'editedentrieswebpath'}; $confs{'gmnotifyemail'} = $IN{'editednotifyemail'}; $confs{'gmindexfilename'} = $IN{'editedindexfilename'}; $confs{'gmentrysuffix'} = $IN{'editedentrysuffix'}; $confs{'gmindexdays'} = $IN{'editedindexdays'}; $confs{'gmserveroffset'} = $IN{'editedoffsettime'}; $confs{'gmtimezone'} = $IN{'editedtimezone'}; $confs{'gmkeeplog'} = $IN{'editedkeeplog'}; $confs{'gmposttoarchives'} = $IN{'editedposttoarchives'}; $confs{'gmallowkarmadefault'} = $IN{'editedallowkarmadefault'}; $confs{'gmallowcommentsdefault'} = $IN{'editedallowcommentsdefault'}; $confs{'gmcommentsorder'} = $IN{'editedcommentsorder'}; $confs{'gmgenerateentrypages'} = $IN{'editedgenerateentrypages'}; $confs{'gmallowhtmlincomments'} = $IN{'editedallowhtmlincomments'}; $confs{'gmlogkarmaandcomments'} = $IN{'editedlogkarmaandcomments'}; $confs{'gmmailprog'} = $IN{'editedmailprog'}; $confs{'gmnotifyforstatus'} = $IN{'editednotifyforstatus'}; $confs{'gmautolinkurls'} = $IN{'editedautolinkurls'}; $confs{'gmstriplinesfromcomments'} = $IN{'editedstriplinesfromcomments'}; $confs{'gmallowmultiplekarmavotes'} = $IN{'editedallowmultiplekarmavotes'}; $confs{'gmversionsetup'} = $gmversion; $confs{'gmversion'} = Gm_Constants::GM_VERSION; $confs{'gmcgilocalpath'} = $IN{'editedcgilocalpath'}; $confs{'gmcgiwebpath'} = $IN{'editedcgiwebpath'}; $confs{'gmconcurrentmainandarchives'} = $IN{'editedconcurrentmainandarchives'}; $confs{'gmkeeparchivemasterindex'} = $IN{'editedkeeparchivemasterindex'}; $confs{'gmentrylistsortorder'} = $IN{'editedentrylistsortorder'}; $confs{'gmallowkarmaorcomments'} = $IN{'editedallowkarmaorcomments'}; $confs{'gmentrylistcountnumber'} = $IN{'editedentrylistcountnumber'}; $confs{'gmcookiesallowed'} = $IN{'editedcookiesallowed'}; $confs{'gmlogarchivesuffix'} = $IN{'editedlogarchivesuffix'}; $confs{'gmcensorlist'} = $IN{'editedcensorlist'}; $confs{'gmcensorenabled'} = $IN{'editedcensorenabled'}; $confs{'gmkeepmonthlyarchives'} = $IN{'editedkeepmonthlyarchives'}; $confs{'gmdefaultentrylistview'} = $IN{'editeddefaultentrylistview'}; $confs{'gmlinktocalendarentries'} = $IN{'editedlinktocalendarentries'}; $confs{'gmautomaticrebuilddefault'} = $IN{'editedautomaticrebuilddefault'}; $confs{'gmcommententrylistonlyifokay'} = $IN{'editedcommententrylistonlyifokay'}; $confs{'gmotherfilelist'} = $IN{'editedotherfilelist'}; $confs{'gmotherfilelistentryrebuild'} = $IN{'editedotherfilelistentryrebuild'}; $confs{'gmarchiveformat'} = $IN{'editedarchiveformat'}; $confs{'gminlineformatting'} = $IN{'editedinlineformatting'}; $confs{'gmuploadfilesallowed'} = $IN{'editeduploadfilesallowed'}; $confs{'gmuploadfilesizelimit'} = $IN{'editeduploadfilesizelimit'}; $confs{'gmemoticonspath'} = $IN{'editedemoticonspath'}; $confs{'gmkeepphphacklog'} = $IN{'editedkeepphphacklog'}; $confs{'gmmailhacknotice'} = $IN{'editedmailhacknotice'}; $confs{'gmemoticonsallowed'} = $IN{'editedemoticonsallowed'}; $confs{'gmprotectauthorname'} = $IN{'editedprotectauthorname'}; $confs{'gmcommentlinklimit'} = $IN{'editedcommentlinklimit'}; $confs{'gmcommentlinklimitnum'} = $IN{'editedcommentlinklimitnum'}; $confs{'gmcommentforcepreview'} = $IN{'editedcommentforcepreview'}; $confs{'gmcommentverify'} = $IN{'editedcommentverify'}; $confs{'gmcommentverifyphrase'} = $IN{'editedcommentverifyphrase'}; Gm_Storage::setConfigs( configs=>\%confs, errHandler=>\&Gm_Web::displayAdminErrorExit ); if (($keeplog eq Gm_Constants::NO) && ($IN{'editedkeeplog'} eq Gm_Constants::YES)) { my ($gmdate) = Gm_Utils::getStdDate( $serveroffset ); gm_writetocplog( "$IN{'authorname'} let this log get its groove back\n". "<FONT SIZE=1>[$gmdate] [$authorIP]</FONT> $IN{'authorname'} edited the config file"); } if ($IN{'editedkeeplog'} eq Gm_Constants::NO) { my ($gmdate) = Gm_Utils::getStdDate( $serveroffset ); gm_writetocplog("$IN{'authorname'} edited the config file\n<FONT SIZE=1>[$gmdate] [$authorIP]</FONT> $IN{'authorname'} decided to stop this log from getting down with its bad-ass self"); } else { gm_writetocplog("$IN{'authorname'} edited the config file"); } $statusnote = qq(<B><FONT COLOR="#0000FF">The config file has been updated. Be sure to rebuild your files<BR>for the changes to take effect on your site, if appropriate.</FONT></B><P>); if ($IN{'editeddeletecookies'} eq Gm_Constants::YES) { $statusnote .= "\n<SCRIPT TYPE=\"text/javascript\" LANGUAGE=\"JavaScript\">\n<!--//\ndeleteCookie(\"gmcookiename\");\ndeleteCookie(\"gmcookiepw\");\n//-->\n</SCRIPT>"; } &gm_frontpage; } # ------------------- # edit banned ip list # ------------------- sub gm_editbanlist { &gm_validate; if ($gmconfigurationaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to edit the ban list without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit the ban list.</FONT></B><P>); &gm_frontpage; } if ($statusnote eq Gm_Constants::EMPTY) { $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>); } print<<GMBANLISTMENUTOP; $gmheadtag $gmframetop $statusnote <FORM ACTION="gm.cgi" METHOD=POST> <INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}"> <INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}"> <SELECT CLASS="selectlist" NAME="editedbanlist" SIZE=10> GMBANLISTMENUTOP my $gmbanlist = Gm_Storage::getBanlist( errHandler=>\&Gm_Web::displayAdminErrorExit ); foreach $gmbanlistline ( sort { $gmbanlist->{$a}{'ip'} <=> $gmbanlist->{$b}{'ip'} } keys(%$gmbanlist)) { ($gmbannedip, $gmbannediphost, $gmbannedperson) = ($gmbanlist->{$gmbanlistline}{'ip'}, $gmbanlist->{$gmbanlistline}{'host'}, $gmbanlist->{$gmbanlistline}{'label'} ); $gmbannedperson =~ s/</\</g; $gmbannedperson =~ s/>/\>/g; $gmbannedperson =~ s/"/\"/g; print qq(<OPTION VALUE="$gmbannedip|$gmbannedperson">$gmbannedip/$gmbannediphost); if ($gmbannedperson ne Gm_Constants::EMPTY) { print " ($gmbannedperson)"; } print "\n"; } print<<GMBANLISTMENUBOTTOM; </SELECT> <P> New IP to ban: <INPUT TYPE=TEXT CLASS="textinput" MAXLENGTH=15 NAME="editednewbannedip" SIZE=15> <BR> Banned person's name (optional): <INPUT TYPE=TEXT CLASS="textinput" NAME="editednewbannedperson" SIZE=15> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Add New IP"> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #FFD0D0" VALUE="Delete Selected IP"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0"> </FORM> <P> $gmframebottom </BODY> </HTML> GMBANLISTMENUBOTTOM $statusnote = Gm_Constants::EMPTY; exit; } # ------------------------- # add an ip to the ban list # ------------------------- sub gm_addbannedip { &gm_validate; if ($gmconfigurationaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to add an IP ($IN{'editednewbannedip'}) to the ban list without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to add an IP to the ban list.</FONT></B><P>); &gm_frontpage; } $IN{'editednewbannedip'} =~ s/\n//g; $IN{'editednewbannedip'} =~ s/\|//g; $IN{'editednewbannedperson'} =~ s/\n//g; $IN{'editednewbannedperson'} =~ s/\|//g; if ($IN{'editednewbannedip'} eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#FF0000">You must enter the IP you want to add to the ban list.</FONT></B><P>); &gm_editbanlist; } my $gmbanlist = Gm_Storage::getBanlist( errHandler=>\&Gm_Web::displayAdminErrorExit ); foreach my $gmbanlistline ( keys(%$gmbanlist)) { ($checkthisip, $checkthisiphost, $checkthisperson) = ($gmbanlist->{$gmbanlistline}{'ip'}, $gmbanlist->{$gmbanlistline}{'host'}, $gmbanlist->{$gmbanlistline}{'label'} ); if ($checkthisip eq $IN{'editednewbannedip'}) { $statusnote = qq(<B><FONT COLOR="#FF0000">That IP is already in the ban list.</FONT></B><P>); &gm_editbanlist; } } $newbannediphost = $IN{'editednewbannedip'}; Gm_Storage::addBanlist( ip=>$IN{'editednewbannedip'}, host=>$newbannediphost, label=>$IN{'editednewbannedperson'}, errHandler=>\&Gm_Web::displayAdminErrorExit ); if ($keeplog eq Gm_Constants::YES) { my $cpMsg = "$IN{'authorname'} added an IP ($IN{'editednewbannedip'}"; if ($IN{'editednewbannedperson'} ne Gm_Constants::EMPTY) { $cpMsg .= ", \"$IN{'editednewbannedperson'}\""; } $cpMsg .= ") to the ban list"; gm_writetocplog( $cpMsg ); } $statusnote = qq(<B><FONT COLOR="#0000FF">$IN{'editednewbannedip'} has been added to the ban list.</FONT></B><P>); &gm_editbanlist; } # ------------------------------ # delete an ip from the ban list # ------------------------------ sub gm_deletebannedip { &gm_validate; if ($gmconfigurationaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to delete an IP ($IN{'editedbanlist'}) to the ban list without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to delete an IP from the ban list.</FONT></B><P>); &gm_frontpage; } chomp($IN{'editedbanlist'}); if ($IN{'editedbanlist'} eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#FF0000">You must select the IP you want to delete from the ban list.</FONT></B><P>); &gm_editbanlist; } my ($banIp, $banLabel) = split( '\|', $IN{'editedbanlist'}); # Since ip is the primary key Gm_Storage::deleteBanlist( ip=>$banIp, errHandler=>\&Gm_Web::displayAdminErrorExit ); if ($keeplog eq Gm_Constants::YES) { my $cpMsg = "$IN{'authorname'} deleted an IP ($banIp"; if ($banLabel ne Gm_Constants::EMPTY) { $cpMsg .= ", \"$banLabel\""; } $cpMsg .= ") from the ban list"; gm_writetocplog( $cpMsg ); } $statusnote = qq(<B><FONT COLOR="#0000FF">$deletedthisbannedip has been deleted from the ban list.</FONT></B><P>); &gm_editbanlist; } # --------------- # add a new entry # --------------- sub gm_addentry { &gm_validate; if ($gmentryaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to add an entry without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to add entries.</FONT></B><P>); &gm_frontpage; } &gm_readcounter; if ($newentrynumber eq "0") { _checkIfDiagRun('<B><FONT COLOR="#FF0000">Please run "Diagnostics & Repair" '. 'in the Configuration screen before posting your first entry.</FONT></B><P>'); } if ($statusnote eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#000000">Add A New Entry</FONT></B><BR><FONT SIZE=1>This is the form by which you add new entries to your weblog/journal. You can make this either a standard or extended entry;<BR>standard entries contain only main text (the first box), while extended entries also have "more" text (the second box).<BR>Standard & extended entries can be handled and formatted in distinct ways via your templates.</FONT><P>); } if ($IN{'newentrysubject'} ne Gm_Constants::EMPTY) { $IN{'newentrysubject'} = Gm_Utils::toWebSafe($IN{'newentrysubject'}); } if ($IN{'newentrymaintext'} ne Gm_Constants::EMPTY) { $IN{'newentrymaintext'} = Gm_Utils::toWebSafe($IN{'newentrymaintext'}); } if ($IN{'newentrymoretext'} ne Gm_Constants::EMPTY) { $IN{'newentrymoretext'} = Gm_Utils::toWebSafe($IN{'newentrymoretext'}); } # emoticons code display added &gm_emoticons_code; my $inlineinstructions = ''; if( $inlineformatting eq Gm_Constants::ENTRIES || $inlineformatting eq Gm_Constants::BOTH ){ $inlineinstructions = '<FONT SIZE=1>With "easy formatting", bold text, italics & underlining can be done easily by bracketing text with two **asterisks**, \\\\backslashes\\\\ or __underlines__ respectively.</FONT>'; } print<<GMADDENTRYTOP; $gmheadtagtwo $gmframetop $statusnote <script language="JavaScript"> function commentEmoticonMain(code) { var cache = document.entryadd.newentrymaintext.value; document.entryadd.newentrymaintext.value = cache + " " + code; document.entryadd.newentrymaintext.focus(); } function commentEmoticonMore(code) { var cache = document.entryadd.newentrymoretext.value; document.entryadd.newentrymoretext.value = cache + " " + code; document.entryadd.newentrymoretext.focus(); } </script> <FORM ACTION="gm.cgi" METHOD=POST name="entryadd"> <INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}"> <INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}"> <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> <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> <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> <P> <b>Main Entry Text</b> <BR> </FONT> <table> <tr valign="top"> $emoticonsmaincode <td><TEXTAREA NAME="newentrymaintext" COLS=86 ROWS=15 WRAP=VIRTUAL STYLE="width: 720">$IN{'newentrymaintext'}</TEXTAREA> <br />$inlineinstructions</td> </tr> </table> $gmfonttag<P> <b>Extended ("More") Entry Text—Optional</b> <BR> </FONT> <table> <tr valign="top"> $emoticonsmorecode <td><TEXTAREA NAME="newentrymoretext" COLS=86 ROWS=15 WRAP=VIRTUAL STYLE="width: 720">$IN{'newentrymoretext'}</TEXTAREA> </td> </tr> </table> $gmfonttag<P> <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript"> <!--// if ((parseInt(navigator.appVersion) >= 4) && (navigator.appName == "Microsoft Internet Explorer")) { document.write("<font size=1>Shortcut keys: CTRL-SHIFT-A to add a link, CTRL-SHIFT-B to bold selected text,<BR>CTRL-SHIFT-I to italicise, CTRL-SHIFT-U to underline</FONT><P>"); } //--> </SCRIPT> <TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#000000"><TR><TD><TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=716 BGCOLOR="#FFFFD0"><TR><TD VALIGN=TOP ALIGN=CENTER>$gmfonttag<b>Entry Options</b><BR><font size=1>If you wish to enable or disable karma voting and/or comment posting for this entry, you can specify it below (use Configuration to set whether those are on or off by default), unless you've disabled karma or comments altogether. You can also specify whether to keep an entry permanently at the top of your main log (you can edit the entry later to turn that off).</FONT></FONT></TD></TR></TABLE></TD></TR></TABLE> <P> GMADDENTRYTOP if (($allowkarmaorcomments eq Gm_Constants::KARMA) || ($allowkarmaorcomments eq Gm_Constants::BOTH)) { print qq(Allow karma voting on this entry: ); println( Gm_Web::createRadioButton( name=>'newentryallowkarma', value=>Gm_Constants::YES, checked=>$allowkarmadefault ).' Yes '); println( Gm_Web::createRadioButton( name=>'newentryallowkarma', value=>Gm_Constants::NO, checked=>$allowkarmadefault ).' No '); } else { print qq(<INPUT TYPE=HIDDEN NAME="newentryallowkarma" VALUE="no">\n); } if ($allowkarmaorcomments eq Gm_Constants::BOTH) { print "<BR>\n"; } # emoticons options added by flipped cracker 9/17/2003 # merged in version 1.3 if (($emoticonsallowed eq Gm_Constants::ENTRIES) || ($emoticonsallowed eq Gm_Constants::BOTH)) { 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); } else { print qq(<INPUT TYPE=HIDDEN NAME="newentryemoticonsallowed" VALUE="no">\n); } #merged 9/17/2003 if (($allowkarmaorcomments eq Gm_Constants::COMMENTS) || ($allowkarmaorcomments eq Gm_Constants::BOTH)) { print qq(Allow comments to be posted to this entry: ); println( Gm_Web::createRadioButton( name=>'newentryallowcomments', value=>Gm_Constants::YES, checked=>$allowcommentsdefault ).' Yes '); println( Gm_Web::createRadioButton( name=>'newentryallowcomments', value=>Gm_Constants::NO, checked=>$allowcommentsdefault ).' No '); } else { print qq(<INPUT TYPE=HIDDEN NAME="newentryallowcomments" VALUE="no">\n); } print<<GMADDENTRYBOTTOM; <BR> Keep this entry at the top of the main log: <INPUT TYPE=RADIO NAME="newentrystayattop" VALUE="yes"> Yes <INPUT TYPE=RADIO NAME="newentrystayattop" VALUE="no" CHECKED> No <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Preview Before Posting"> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Add This Entry"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0"> </FORM> <P> $gmframebottom </BODY> </HTML> GMADDENTRYBOTTOM exit; } # ------------------------------- # add a new entry - popup version # ------------------------------- sub gm_addentrypopup { &gm_validate; if (($gmentryaccess ne Gm_Constants::YES) || ($gmbookmarkletaccess ne Gm_Constants::YES)) { gm_writetocplog("$IN{'authorname'} attempted to add an entry via popup without authorization"); $statusnote = qq(<b><font color="#FF0000">You don't have access to add entries via the popup window.</FONT></b><P>); &gm_frontpage; } &gm_readcounter; if ($newentrynumber eq "0") { _checkIfDiagRun('<b><font color="#FF0000">Please run "Diagnostics & Repair" '. 'in the Configuration screen before posting your first entry.</FONT></b><P>'); } if ($statusnote eq Gm_Constants::EMPTY) { $statusnote = qq(<b><font color="#000000">Greymatter Pop-Up Posting Window</FONT></b><P>); } $popupincludetext = qq(<A HREF="$IN{'loglink'}">$IN{'loglinktitle'}</A>); if ($IN{'logtext'} ne Gm_Constants::EMPTY) { $popupincludetext .= "\n\n$IN{'logtext'}"; } if ($IN{'newentrysubject'} ne Gm_Constants::EMPTY) { $IN{'newentrysubject'} = Gm_Utils::toWebSafe($IN{'newentrysubject'}); } if ($IN{'newentrymaintext'} ne Gm_Constants::EMPTY) { $IN{'newentrymaintext'} = Gm_Utils::toWebSafe($IN{'newentrymaintext'}); } else { $IN{'newentrymaintext'} = $popupincludetext; } if ($IN{'newentrymoretext'} ne Gm_Constants::EMPTY) { $IN{'newentrymoretext'} = Gm_Utils::toWebSafe($IN{'newentrymoretext'}); } # emoticons code display added &gm_emoticons_code; my $inlineinstructions = ''; if( $inlineformatting eq Gm_Constants::ENTRIES || $inlineformatting eq Gm_Constants::BOTH ){ $inlineinstructions = '<FONT SIZE=1>With "easy formatting", bold text, italics & underlining can be done easily by bracketing text with two **asterisks**, \\\\backslashes\\\\ or __underlines__ respectively.</FONT>'; } print<<GMADDENTRYPOPUPTOP; $gmheadtagtwo $gmframetoptwo $statusnote <script language="JavaScript"> function commentEmoticonMain(code) { var cache = document.entryadd.newentrymaintext.value; document.entryadd.newentrymaintext.value = cache + " " + code; document.entryadd.newentrymaintext.focus(); } function commentEmoticonMore(code) { var cache = document.entryadd.newentrymoretext.value; document.entryadd.newentrymoretext.value = cache + " " + code; document.entryadd.newentrymoretext.focus(); } </script> <FORM ACTION="gm.cgi" METHOD=POST name="entryadd"> <INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}"> <INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}"> <INPUT TYPE=HIDDEN NAME="gmbmspecial" VALUE="popupblog"> <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> <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> <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> <P> <b>Main Entry Text</b> <BR> </FONT> <table> <tr valign="top"> $emoticonsmaincode <td><TEXTAREA NAME="newentrymaintext" COLS=50 ROWS=12 WRAP=VIRTUAL STYLE="width: 590">$IN{'newentrymaintext'}</TEXTAREA> <br />$inlineinstructions</td> </tr> </table> $gmfonttag<P> <b>Extended ("More") Entry Text—Optional</b> <BR> </FONT> <table> <tr valign="top"> $emoticonsmorecode <td><TEXTAREA NAME="newentrymoretext" COLS=50 ROWS=12 WRAP=VIRTUAL STYLE="width: 590">$IN{'newentrymoretext'}</TEXTAREA> </td> </tr> </table> <P> <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript"> <!--// if ((parseInt(navigator.appVersion) >= 4) && (navigator.appName == "Microsoft Internet Explorer")) { document.write("<font size=1>Shortcut keys: CTRL-SHIFT-A to add a link, CTRL-SHIFT-B to bold selected text,<BR>CTRL-SHIFT-I to italicise, CTRL-SHIFT-U to underline</FONT><P>"); } //--> </SCRIPT> <P> GMADDENTRYPOPUPTOP if (($allowkarmaorcomments eq Gm_Constants::KARMA) || ($allowkarmaorcomments eq Gm_Constants::BOTH)) { print qq(Allow karma voting on this entry: ); println( Gm_Web::createRadioButton( name=>'newentryallowkarma', value=>Gm_Constants::YES, checked=>$allowkarmadefault ).' Yes '); println( Gm_Web::createRadioButton( name=>'newentryallowkarma', value=>Gm_Constants::NO, checked=>$allowkarmadefault ).' No '); } else { print qq(<INPUT TYPE=HIDDEN NAME="newentryallowkarma" VALUE="no">\n); } if ($allowkarmaorcomments eq Gm_Constants::BOTH) { print "<BR>\n"; } # emoticons options added by flipped cracker 9/17/2003 # merged in version 1.3 if (($emoticonsallowed eq Gm_Constants::ENTRIES) || ($emoticonsallowed eq Gm_Constants::BOTH)) { 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); } else { print qq(<INPUT TYPE=HIDDEN NAME="newentryemoticonsallowed" VALUE="no">\n); } if (($allowkarmaorcomments eq Gm_Constants::COMMENTS) || ($allowkarmaorcomments eq Gm_Constants::BOTH)) { print qq(Allow comments to be posted to this entry: ); println( Gm_Web::createRadioButton( name=>'newentryallowcomments', value=>Gm_Constants::YES, checked=>$allowcommentsdefault ).' Yes '); println( Gm_Web::createRadioButton( name=>'newentryallowcomments', value=>Gm_Constants::NO, checked=>$allowcommentsdefault ).' No '); } else { print qq(<INPUT TYPE=HIDDEN NAME="newentryallowcomments" VALUE="no">\n); } print<<GMADDENTRYPOPUPBOTTOM; <BR> Keep this entry at the top of the main log: <INPUT TYPE=RADIO NAME="newentrystayattop" VALUE="yes"> Yes <INPUT TYPE=RADIO NAME="newentrystayattop" VALUE="no" CHECKED> No <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Preview Before Posting"> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Add This Entry"> </FORM> $gmframebottomtwo </BODY> </HTML> GMADDENTRYPOPUPBOTTOM exit; } # ---------------------------- # preview entry before posting # ---------------------------- sub gm_previewentry { &gm_validate; if ($gmentryaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to add an entry without authorization"); $statusnote = qq(<b><font color="#FF0000">You don't have access to add entries.</FONT></b><P>); &gm_frontpage; } $newentrysubject = Gm_Utils::toStoreSafe($IN{'newentrysubject'}); $newentrymaintext = Gm_Utils::toStoreSafe($IN{'newentrymaintext'}); $newentrymoretext = Gm_Utils::toStoreSafe($IN{'newentrymoretext'}); $newentrymusic = Gm_Utils::toStoreSafe($IN{'newentrymusic'}); $newentrymood = Gm_Utils::toStoreSafe($IN{'newentrymood'}); $newentrysubjectdeloused = Gm_Utils::toWebSafe($newentrysubject); $newentrymaintextdeloused = Gm_Utils::toWebSafe($newentrymaintext); $newentrymoretextdeloused = Gm_Utils::toWebSafe($newentrymoretext); $newentrymusicdeloused = Gm_Utils::toWebSafe($newentrymusic); $newentrymooddeloused = Gm_Utils::toWebSafe($newentrymood); $newentrysubjectdeloused =~ s/\n/\|\*\|/g; $newentrymaintextdeloused =~ s/\n/\|\*\|/g; $newentrymoretextdeloused =~ s/\n/\|\*\|/g; $newentrymusicdeloused =~ s/\n/\|\*\|/g; $newentrymooddeloused =~ s/\n/\|\*\|/g; $newentrymaintext =~ s/\|\*\|/<BR>/g; $newentrymoretext =~ s/\|\*\|/<BR>/g; $newentrymaintext =~ s/\n/<BR>/g; $newentrymoretext =~ s/\n/<BR>/g; $newentrymaintext =~ s/<BR><BR>/<\/P><P ALIGN=JUSTIFY>/g; $newentrymoretext =~ s/<BR><BR>/<\/P><P ALIGN=JUSTIFY>/g; &gm_readcounter; unless ($newentrynumber < 1) { &gm_getentryvariables($newentrynumber); &gm_formatentry($newentrymaintext); $newentrymaintext = $entryreturn; unless ($newentrymoretext eq Gm_Constants::EMPTY) { &gm_formatentry($newentrymoretext); $newentrymoretext = $entryreturn; } } $showmoretext = Gm_Constants::EMPTY; if ($newentrymoretext ne Gm_Constants::EMPTY) { $showmoretext = "</P><P ALIGN=CENTER><CENTER>\n<B>[extended text]</B>\n</CENTER></P><P ALIGN=JUSTIFY>\n$newentrymoretext\n"; } if ($statusnote eq Gm_Constants::EMPTY) { if ($newentrysubject ne Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#000000">Previewing "$newentrysubject"</FONT></B><BR><FONT SIZE=1>Click "Add This Entry" below to add this entry to your site, or click "Re-Edit This Entry" to re-edit it.</FONT><P>); } else { $statusnote = qq(<B><FONT COLOR="#000000">Previewing New Entry</FONT></B><BR><FONT SIZE=1>Click "Add This Entry" below to add this entry to your site, or click "Re-Edit This Entry" to re-edit it.</FONT><P>); } } print<<GMPREVIEWENTRY; $gmheadtag $gmframetop $statusnote <P ALIGN=JUSTIFY> $newentrymaintext $showmoretext </P><P ALIGN=CENTER><CENTER> <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="newentrysubject" VALUE="$newentrysubjectdeloused"> <INPUT TYPE=HIDDEN NAME="newentrymaintext" VALUE="$newentrymaintextdeloused"> <INPUT TYPE=HIDDEN NAME="newentrymoretext" VALUE="$newentrymoretextdeloused"> <INPUT TYPE=HIDDEN NAME="newentryallowkarma" VALUE="$IN{'newentryallowkarma'}"> <INPUT TYPE=HIDDEN NAME="newentryallowcomments" VALUE="$IN{'newentryallowcomments'}"> <INPUT TYPE=HIDDEN NAME="newentryemoticonsallowed" VALUE="$IN{'newentryemoticonsallowed'}"> <INPUT TYPE=HIDDEN NAME="newentrystayattop" VALUE="$IN{'newentrystayattop'}"> <INPUT TYPE=HIDDEN NAME="newentrymusic" VALUE="$IN{'newentrymusic'}"> <INPUT TYPE=HIDDEN NAME="newentrymood" VALUE="$IN{'newentrymood'}"> <INPUT TYPE=HIDDEN NAME="gmbmspecial" VALUE="$IN{'gmbmspecial'}"> <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"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0"> </FORM> </CENTER></P> $gmframebottom </BODY> </HTML> GMPREVIEWENTRY exit; } # ------------------ # save the new entry # ------------------ sub gm_savenewentry { &gm_validate; if ($gmentryaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to add an entry without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to add entries.</FONT></B><P>); &gm_frontpage; } $IN{'newentrysubject'} = Gm_Utils::toStoreSafe($IN{'newentrysubject'}); $IN{'newentrysubject'} = Gm_Utils::toConfigSafe($IN{'newentrysubject'}); $IN{'newentrymaintext'} = Gm_Utils::toStoreSafe($IN{'newentrymaintext'}); $IN{'newentrymoretext'} = Gm_Utils::toStoreSafe($IN{'newentrymoretext'}); $IN{'newentrymusic'} = Gm_Utils::toStoreSafe($IN{'newentrymusic'}); $IN{'newentrymood'} = Gm_Utils::toStoreSafe($IN{'newentrymood'}); if ($IN{'newentrymaintext'} eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#FF0000">You left the main text field blank. Please try again.</FONT></B><P>); if ($IN{'gmbmspecial'} eq "popupblog") { &gm_addentrypopup; } else { &gm_addentry; } } &gm_readcounter; $newentrynumber++; # $newentrynumberpadded = sprintf ("%8d", $newentrynumber); # $newentrynumberpadded =~ tr/ /0/; $newentrynumberpadded = Gm_Utils::toEntryPadded( $newentrynumber ); &gm_readconfig; my ($basedate, $wday, $mon, $mday, $JSYear, $hour, $min, $sec, $AMPM ) = Gm_Utils::getStdDate( $serveroffset ); my $shortyear = substr($JSYear, -2, 2); my $montwo = Gm_Utils::toTwoDigit( $mon ); my $mdaytwo = Gm_Utils::toTwoDigit( $mday ); my $hourtwo = Gm_Utils::toTwoDigit( $hour ); my $mintwo = Gm_Utils::toTwoDigit( $min ); open (CHECKIT, "<$EntriesPath/$newentrynumberpadded.cgi") || ($numbercheck="good"); @gmchecklistor = <CHECKIT>; if(@gmchecklistor[0] =~ /\|/) {$numbercheck="bugger";} close (CHECKIT); if($numbercheck eq "bugger") {gm_dangermouse("Fatal Error, gm-counter likely to be disrupted. Please run a Diagnostics & Repair."); exit;} else {unlink ("$EntriesPath/$newentrynumberpadded.cgi");} ## TODO FIX THIS SO THAT ITS A STORAGE FUNCTION open (FUNNYFEET, ">$EntriesPath/$newentrynumberpadded.cgi") || &gm_dangermouse("Can't write to $EntriesPath/$newentrynumberpadded.cgi. Please make sure that your entries/archives directory is correctly configured and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); print FUNNYFEET "$newentrynumber|$IN{'authorname'}|$IN{'newentrysubject'}|$wday|$mon|$mday|$JSYear|$hour|$min|$sec|$AMPM|0|0|0|$IN{'newentryallowkarma'}|$IN{'newentryallowcomments'}|open|$IN{'newentrymusic'}|$IN{'newentrymood'}|$IN{'newentryemoticonsallowed'}\n"; print FUNNYFEET "0.0.0.0|I\n"; print FUNNYFEET "$IN{'newentrymaintext'}\n"; print FUNNYFEET "$IN{'newentrymoretext'}\n"; close (FUNNYFEET); chmod (0666, "$EntriesPath/$newentrynumberpadded.cgi"); $newentrytempmorestatus = 'N'; if ($IN{'newentrymoretext'} ne Gm_Constants::EMPTY) { $newentrytempmorestatus = 'Y'; } my %newentry = (); $newentry{'id'} = $newentrynumber; $newentry{'author'} = $IN{'authorname'}; $newentry{'subject'} = $IN{'newentrysubject'}; $newentry{'created'} = "$montwo\/$mdaytwo\/$shortyear"; $newentry{'createt'} = "$hourtwo\:$mintwo $AMPM"; $newentry{'status'} = "O"; $newentry{'extended'} = $newentrytempmorestatus; $newentry{'music'} = $IN{'newentrymusic'}; $newentry{'mood'} = $IN{'newentrymood'}; $newentry{'emoticons'} = $IN{'newentryemoticonsallowed'}; Gm_Storage::addEntrylist( %newentry, errHandler=>\&Gm_Web::displayAdminErrorExit ); if ($IN{'newentrystayattop'} eq Gm_Constants::YES) { $newstayattopnumber = $newentrynumber; } $newalltimeopenentriesnumber++; &gm_writecounter; if ($generateentrypages eq Gm_Constants::YES) { &gm_readconfig; &gm_getentryvariables($newentrynumber); if ($thisentryopenstatus eq Gm_Constants::OPEN) { if ($thisentrymorebody ne Gm_Constants::EMPTY) { &gm_formatentry($gmmoreentrypagetemplate); } else { &gm_formatentry($gmentrypagetemplate); } open (THISFILE, ">$EntriesPath/$thisentrynumberpadded.$entrysuffix") || &gm_dangermouse("Can't write file to $EntriesPath/$thisentrynumberpadded.$entrysuffix - please run Diagnostics & Repair in the Configuration screen."); print THISFILE $entryreturn; close (THISFILE); chmod (0666, "$EntriesPath/$newentrynumberpadded.$entrysuffix"); } else { unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } if ($newentrynumber ne "1") { $updatepreviousnumber = $newentrynumber - 1; &gm_getentryvariables($updatepreviousnumber); if ($thisentryopenstatus eq Gm_Constants::OPEN) { if ($updatepreviousnumber <= $newarchivenumber) { if ($thisentrymorebody ne Gm_Constants::EMPTY) { &gm_formatentry($gmmorearchiveentrypagetemplate); } else { &gm_formatentry($gmarchiveentrypagetemplate); } } else { if ($thisentrymorebody ne Gm_Constants::EMPTY) { &gm_formatentry($gmmoreentrypagetemplate); } else { &gm_formatentry($gmentrypagetemplate); } } open (THISFILE, ">$EntriesPath/$thisentrynumberpadded.$entrysuffix") || &gm_dangermouse("Can't write file to $EntriesPath/$thisentrynumberpadded.$entrysuffix - please run Diagnostics & Repair in the Configuration screen."); print THISFILE $entryreturn; close (THISFILE); chmod (0666, "$EntriesPath/$newentrynumberpadded.$entrysuffix"); } else { unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } } } &gm_generatemainindex; &gm_readcounter; if (($newarchivenumber ne "0") || ($concurrentmainandarchives eq Gm_Constants::YES)) { if (($generateentrypages eq Gm_Constants::YES) && ($newarchivenumber ne "0")) { &gm_getentryvariables($newarchivenumber); $originaldaymarker = "$thisentryday $thisentrymonth"; $currentdaymarker = $originaldaymarker; $markercount = $newarchivenumber; do { if ($thisentryopenstatus eq Gm_Constants::OPEN) { if ($thisentrymorebody ne Gm_Constants::EMPTY) { &gm_formatentry($gmmorearchiveentrypagetemplate); } else { &gm_formatentry($gmarchiveentrypagetemplate); } open (THISFILE, ">$EntriesPath/$thisentrynumberpadded.$entrysuffix") || &gm_dangermouse("Can't write file to $EntriesPath/$thisentrynumberpadded.$entrysuffix - please run Diagnostics & Repair in the Configuration screen."); print THISFILE $entryreturn; close (THISFILE); chmod (0666, "$EntriesPath/$newentrynumberpadded.$entrysuffix"); } else { unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } $markercount--; if ($markercount eq "0") { $currentdaymarker = "finis"; } else { &gm_getentryvariables($markercount); $currentdaymarker = "$thisentryday $thisentrymonth"; } } until $currentdaymarker ne $originaldaymarker; } if ($concurrentmainandarchives eq Gm_Constants::YES) { $newarchivenumber = $newentrynumber; } unless ($keepmonthlyarchives eq Gm_Constants::NO) { &gm_generatearchive($newarchivenumber); } &gm_readcounter; } if ($keeparchivemasterindex eq Gm_Constants::YES) { if ($newarchivenumber ne "0") { &gm_getentryvariables($newarchivenumber); } else { &gm_getentryvariables($newentrynumber); } &gm_formatentry($gmarchivemasterindextemplate); open (THISFILE, ">$EntriesPath/$indexfilename") || &gm_dangermouse("Can't write to $EntriesPath/$indexfilename. Please make sure your paths are configured correctly, that the entries/archives directory is CHMODed to 777, and that $EntriesPath/$indexfilename is CHMODed to 666; also try running Diagnostics & Repair from the Configuration screen."); print THISFILE $entryreturn; close (THISFILE); chmod (0666, "$EntriesPath/$indexfilename"); } my $gmauthors = Gm_Storage::getAuthors( errHandler=>\&Gm_Web::displayAdminErrorExit ); my $selectedauthor = $gmauthors->{$IN{'authorname'}}; my $authorEntries = $selectedauthor->{'posttotal'}++; Gm_Storage::updateAuthor( key=>$selectedauthor->{'author'}, posttotal=>$authorEntries, errHandler=>\&Gm_Web::displayAdminErrorExit ); $recordentrysubject = $IN{'newentrysubject'}; if ($recordentrysubject eq Gm_Constants::EMPTY) { $recordentrysubject = "[no subject]"; } if ($IN{'gmbmspecial'} eq "popupblog") { gm_writetocplog("$IN{'authorname'} added a new entry (#$newentrynumber\: $recordentrysubject) via popup"); } else { gm_writetocplog("$IN{'authorname'} added a new entry (#$newentrynumber\: $recordentrysubject)"); } if (($otherfilelist ne Gm_Constants::EMPTY) && ($otherfilelistentryrebuild eq Gm_Constants::YES) && ($IN{'gmbmspecial'} ne "popupblog")) { $IN{'rebuilding'} = "connectedaftersave"; $IN{'rebuildfrom'} = "connected"; &gm_rebuildupdate; } if ($IN{'gmbmspecial'} eq "popupblog") { $indexfilenamesmartcheck = "/$indexfilename"; $indexfilenameprefix = substr($indexfilename, 0, 6); if ($indexfilenameprefix eq "index.") { $indexfilenamesmartcheck = "/"; } print<<GMPOPUPNOTICE; $gmheadtag $gmframetoptwo<B><FONT COLOR="#0000FF">Your new entry has been added to <A HREF="$LogWebPath$indexfilenamesmartcheck" TARGET="NEW"><FONT COLOR="#0000FF">your site</FONT></A>.</FONT></B><P><A HREF="javascript:window.close();">Click here to close this window.</A>$gmframebottomtwo </BODY> </HTML> GMPOPUPNOTICE exit; } $statusnote = qq(<B><FONT COLOR="#0000FF">Your new entry has been added.</FONT></B><P>); &gm_frontpage; } # ------------------ # rebuild files menu # ------------------ sub gm_rebuildfilesmenu { &gm_validate; if ($gmrebuildaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to rebuild the files without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to rebuild the files.</FONT></B><P>); &gm_frontpage; } &gm_readcounter; if ($newentrynumber eq "0") { $statusnote = qq(<B><FONT COLOR="#FF0000">There are no entries yet!</FONT></B><P>); &gm_frontpage; } if ($statusnote eq Gm_Constants::EMPTY) { $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>); } $rebuildconnectedfilesbutton = Gm_Constants::EMPTY; if ($otherfilelist ne Gm_Constants::EMPTY) { $rebuildconnectedfilesbutton = qq(<P>\n<INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Rebuild Connected Files" STYLE="width: 320">); } print<<GMREBUILDMENU; $gmheadtag $gmframetop $statusnote <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="Rebuild Last Entry Page Only" STYLE="width: 320"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Rebuild Main Index File" STYLE="width: 320"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Rebuild Main Entry Pages" STYLE="width: 320"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Rebuild Archive Master Index" STYLE="width: 320"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Rebuild Archive Log Indexes" STYLE="width: 320"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Rebuild Archive Entry Pages" STYLE="width: 320"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Rebuild All Entry Pages" STYLE="width: 320"> $rebuildconnectedfilesbutton <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Rebuild Everything" STYLE="width: 320"> <P> <FONT SIZE=1> After clicking, expect a wait of up to several minutes, depending<BR>on how much is being rebuilt. <B>DO NOT INTERRUPT GREYMATTER</B><BR>while it's rebuilding, or you could damage your files. </FONT> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0"> </FORM> <P> $gmframebottom </BODY> </HTML> GMREBUILDMENU $statusnote = Gm_Constants::EMPTY; exit; } # --------------------------- # rebuild the main index file # --------------------------- sub gm_rebuildmainindexfile { &gm_validate; if ($gmrebuildaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to rebuild the main index file without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to rebuild the main index file.</FONT></B><P>); &gm_frontpage; } &gm_readcounter; if ($newentrynumber eq "0") { $statusnote = qq(<B><FONT COLOR="#FF0000">There are no entries yet.</FONT></B><P>); &gm_frontpage; } &gm_generatemainindex; gm_writetocplog("$IN{'authorname'} rebuilt the main index file"); if ($IN{'autorebuild'} eq "index") { $statusnote = qq(<B><FONT COLOR="#0000FF">The $IN{'modifiedtemplategroup'} templates have been<BR>modified and the main index file has been rebuilt.</FONT></B><P>); &gm_edittemplates; } else { $statusnote = qq(<B><FONT COLOR="#0000FF">The main index file has been rebuilt.</FONT></B><P>); &gm_frontpage; } } # ---------------------------- # rebuild last entry page only # ---------------------------- sub gm_rebuildlastentrypageonly { &gm_validate; if ($gmrebuildaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to rebuild the last entry page without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to rebuild the last entry page.</FONT></B><P>); &gm_frontpage; } &gm_readconfig; if ($generateentrypages ne Gm_Constants::YES) { $statusnote = qq(<B><FONT COLOR="#FF0000">Entry page generation is currently disabled.</FONT></B><P>); &gm_rebuildfilesmenu; } &gm_readcounter; &gm_readtemplates; if ($newentrynumber eq "0") { $statusnote = qq(<B><FONT COLOR="#FF0000">There are no entries yet.</FONT></B><P>); &gm_frontpage; } &gm_getentryvariables($newentrynumber); if ($thisentryopenstatus eq Gm_Constants::OPEN) { if ($thisentrymorebody ne Gm_Constants::EMPTY) { &gm_formatentry($gmmoreentrypagetemplate); } else { &gm_formatentry($gmentrypagetemplate); } open (THISFILE, ">$EntriesPath/$thisentrynumberpadded.$entrysuffix") || &gm_dangermouse("Can't write to $EntriesPath/$thisentrynumberpadded.$entrysuffix. Please make sure that your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); print THISFILE $entryreturn; close (THISFILE); chmod (0666, "$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } else { unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } gm_writetocplog("$IN{'authorname'} rebuilt the last entry page"); $statusnote = qq(<B><FONT COLOR="#0000FF">The last entry page has been rebuilt.</FONT></B><P>); &gm_frontpage; } # ------------------------ # rebuild main entry files # ------------------------ sub gm_rebuildmainentrypages { &gm_validate; if ($gmrebuildaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to rebuild the main entry pages without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to rebuild the main entry pages.</FONT></B><P>); &gm_frontpage; } &gm_readconfig; if ($generateentrypages ne Gm_Constants::YES) { $statusnote = qq(<B><FONT COLOR="#FF0000">Entry page generation is currently disabled.</FONT></B><P>); &gm_rebuildfilesmenu; } &gm_readcounter; &gm_readtemplates; if ($newentrynumber eq "0") { $statusnote = qq(<B><FONT COLOR="#FF0000">There are no entries yet.</FONT></B><P>); &gm_frontpage; } $IN{'rebuilding'} = "mainentries"; $IN{'rebuildfrom'} = $newarchivenumber + 1; &gm_rebuildupdate; } # ---------------------------- # rebuild archive master index # ---------------------------- sub gm_rebuildarchivemasterindex { &gm_validate; if ($gmrebuildaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to rebuild the archive master index without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to rebuild the archive master index.</FONT></B><P>); &gm_frontpage; } &gm_readconfig; &gm_readcounter; &gm_readtemplates; if ($keeparchivemasterindex eq Gm_Constants::NO) { $statusnote = qq(<B><FONT COLOR="#FF0000">"Keep archive master index" is currently disabled.</FONT></B><P>); &gm_frontpage; } if ($newarchivenumber ne "0") { &gm_getentryvariables($newarchivenumber); } else { &gm_getentryvariables($newentrynumber); } &gm_formatentry($gmarchivemasterindextemplate); open (THISFILE, ">$EntriesPath/$indexfilename") || &gm_dangermouse("Can't write to $EntriesPath/$indexfilename. Please make sure your paths are configured correctly, that the entries/archives directory is CHMODed to 777, and that $EntriesPath/$indexfilename is CHMODed to 666; also try running Diagnostics & Repair from the Configuration screen."); print THISFILE $entryreturn; close (THISFILE); chmod (0666, "$EntriesPath/$indexfilename"); gm_writetocplog("$IN{'authorname'} rebuilt the archive master index"); $statusnote = qq(<B><FONT COLOR="#0000FF">The archive master index has been rebuilt.</FONT></B><P>); &gm_frontpage; } # --------------------------- # rebuild archive log indexes # --------------------------- sub gm_rebuildarchivelogindexes { &gm_validate; if ($gmrebuildaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to rebuild the archive log indexes without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to rebuild the archive log indexes.</FONT></B><P>); &gm_frontpage; } &gm_readconfig; &gm_readcounter; &gm_readtemplates; if (($IN{'autorebuild'} eq "archiveindexes") && ($keeparchivemasterindex ne Gm_Constants::NO)) { if ($newarchivenumber ne "0") { &gm_getentryvariables($newarchivenumber); } else { &gm_getentryvariables($newentrynumber); } &gm_formatentry($gmarchivemasterindextemplate); open (THISFILE, ">$EntriesPath/$indexfilename") || &gm_dangermouse("Can't write to $EntriesPath/$indexfilename. Please make sure your paths are configured correctly, that the entries/archives directory is CHMODed to 777, and that $EntriesPath/$indexfilename is CHMODed to 666; also try running Diagnostics & Repair from the Configuration screen."); print THISFILE $entryreturn; close (THISFILE); } if ($keepmonthlyarchives eq Gm_Constants::NO) { $statusnote = qq(<B><FONT COLOR="#FF0000">Log archives are currently disabled.</FONT></B><P>); if ($IN{'autorebuild'} eq "archiveindexes") { $statusnote = qq(<B><FONT COLOR="#FF0000">The $IN{'modifiedtemplategroup'} templates have been modified.</FONT></B><P>); } &gm_frontpage; } if (($newarchivenumber eq "0") && ($concurrentmainandarchives ne Gm_Constants::YES)) { $statusnote = qq(<B><FONT COLOR="#FF0000">There are no archive log indexes yet.</FONT></B><P>); if ($IN{'autorebuild'} eq "archiveindexes") { $statusnote = qq(<B><FONT COLOR="#FF0000">The $IN{'modifiedtemplategroup'} templates have been modified.</FONT></B><P>); } &gm_frontpage; } unlink glob("$EntriesPath/archive-*.$entrysuffix"); unlink glob("$EntriesPath/archive-*.$logarchivesuffix"); if ($concurrentmainandarchives eq Gm_Constants::YES) { $newarchivenumber = $newentrynumber; } $stoppednumber = $newarchivenumber; do { &gm_generatearchive($stoppednumber); } until $stoppednumber <= 1; if( $gmneedstogeneratefirstarchive ){ &gm_generatearchive(1); } gm_writetocplog("$IN{'authorname'} rebuilt the archive log indexes"); if ($IN{'autorebuild'} eq "archiveindexes") { $statusnote = qq(<B><FONT COLOR="#0000FF">The $IN{'modifiedtemplategroup'} templates have been<BR>modified and the archive indexes have been rebuilt.</FONT></B><P>); &gm_edittemplates; } else { $statusnote = qq(<B><FONT COLOR="#0000FF">The archive log indexes have been rebuilt.</FONT></B><P>); &gm_frontpage; } } # --------------------------- # rebuild archive entry pages # --------------------------- sub gm_rebuildarchiveentrypages { &gm_validate; if ($gmrebuildaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to rebuild the archive entry pages without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to rebuild the archive entry pages.</FONT></B><P>); &gm_frontpage; } &gm_readconfig; &gm_readcounter; &gm_readtemplates; if ($newarchivenumber eq "0") { $statusnote = qq(<B><FONT COLOR="#FF0000">There are no archives yet.</FONT></B><P>); &gm_frontpage; } if ($generateentrypages eq Gm_Constants::NO) { $statusnote = qq(<B><FONT COLOR="#FF0000">Entry page generation is currently disabled.</FONT></B><P>); &gm_rebuildfilesmenu; } $IN{'rebuilding'} = "archivefiles"; $IN{'rebuildfrom'} = "1"; &gm_rebuildupdate; } # ----------------------- # rebuild all entry pages # ----------------------- sub gm_rebuildallentrypages { &gm_validate; if ($gmrebuildaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to rebuild the entry pages without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to rebuild the entry pages.</FONT></B><P>); &gm_frontpage; } &gm_readconfig; if ($generateentrypages ne Gm_Constants::YES) { $statusnote = qq(<B><FONT COLOR="#FF0000">Entry page generation is currently disabled.</FONT></B><P>); &gm_rebuildfilesmenu; } &gm_readcounter; &gm_readtemplates; if ($newentrynumber eq "0") { $statusnote = qq(<B><FONT COLOR="#FF0000">There are no entries yet.</FONT></B><P>); &gm_frontpage; } unlink glob("$EntriesPath/archive-*.$entrysuffix"); $IN{'rebuilding'} = "entryfiles"; $IN{'rebuildfrom'} = "1"; &gm_rebuildupdate; } # ------------------------------- # rebuild connected files - check # ------------------------------- sub gm_rebuildconnectedfilescheck { &gm_validate; if ($gmrebuildaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to rebuild the connected files without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to rebuild the connected files.</FONT></B><P>); &gm_frontpage; } if ($otherfilelist eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#FF0000">There are no connected files to rebuild.</FONT></B><P>); &gm_frontpage; } &gm_readconfig; &gm_readcounter; &gm_readtemplates; $IN{'rebuilding'} = "connected"; $IN{'rebuildfrom'} = "connected"; &gm_rebuildupdate; } # ------------------ # rebuild everything # ------------------ sub gm_rebuildeverything { &gm_validate; if ($gmrebuildaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to rebuild all the files without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to rebuild all the files.</FONT></B><P>); &gm_frontpage; } unlink glob("$EntriesPath/*.reg"); unlink glob("$EntriesPath/archive-*.$entrysuffix"); unlink glob("$EntriesPath/archive-*.$logarchivesuffix"); $IN{'rebuilding'} = "everything"; $IN{'rebuildfrom'} = "index"; &gm_rebuildupdate; } # ------------------------------ # edit an entry - selection menu # ------------------------------ sub gm_editentryselection { &gm_validate; if ($gmentryeditaccess eq Gm_Constants::NO) { gm_writetocplog("$IN{'authorname'} attempted to edit entries without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit entries.</FONT></B><P>); &gm_frontpage; } &gm_readcounter; if ($newentrynumber eq "0") { $statusnote = qq(<B><FONT COLOR="#FF0000">There are no entries yet!</FONT></B><P>); &gm_frontpage; } if ($IN{'entryselectionview'} eq Gm_Constants::EMPTY) { $IN{'entryselectionview'} = $defaultentrylistview; } $searchingfortext = Gm_Constants::EMPTY; if ($IN{'entrysearch'} ne Gm_Constants::EMPTY) { $searchingfortext = qq(<P>\n<FONT COLOR="#0000FF"><B>All entries containing "$IN{'entrysearch'}"</B></FONT>\n<P>\n); $IN{'entryselectionview'} = "searchresults"; $IN{'entrysearch'} = Gm_Utils::toStoreSafe($IN{'entrysearch'}); } if ($statusnote eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#000000">Entry Selection</FONT></B><BR><FONT SIZE=1>Select an entry to edit or review. "Closed" entries are considered deleted<BR>and are no longer visible on your site, but can be reopened at any time.</FONT><P>); } if ($gmentryeditaccess eq 'mineonly') { $statusnote .= qq(<B>You only have access to edit your own entries.</B><P>); } my $gmentrylist = Gm_Storage::getEntrylist( errHandler=>\&Gm_Web::displayAdminErrorExit ); my @gmsortkeys = keys( %$gmentrylist ); ## default to date sort unless( defined( $IN{'sortby'} ) ){ $IN{'sortby'} = 'date'; } @gmsortkeys = sort { lc($gmentrylist->{$a}{$IN{'sortby'}}) cmp lc($gmentrylist->{$b}{$IN{'sortby'}}) || $b <=> $a; } @gmsortkeys; ## TODO: CLEAN UP THIS SO THAT AUTHORNAME NAD PASSWORD IS ONLY STORED IF NOT USING # COOKIES (ALSO, THAT PW BETTER NOT BE PLAINTEXT print<<GMEDITENTRYSELECTIONMENUTOP; $gmheadtag $gmframetop $statusnote $searchingfortext <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="thomas" VALUE="Edit An Entry"> <SELECT CLASS="selectlist" NAME="entryselectionlist" SIZE=15> GMEDITENTRYSELECTIONMENUTOP $gmentrydatemarker = "nyet"; $liststayattopnotice = Gm_Constants::EMPTY; $listclosedentrynotice = Gm_Constants::EMPTY; $listmoreentrynotice = Gm_Constants::EMPTY; $listsecondblank = Gm_Constants::YES; foreach my $elkey (@gmsortkeys) { $listentrynumber = $gmentrylist->{$elkey}{'id'}; $listentryauthor = $gmentrylist->{$elkey}{'author'}; $listentrysubject = $gmentrylist->{$elkey}{'subject'}; $listentrydate = $gmentrylist->{$elkey}{'created'}; $listentrytime = $gmentrylist->{$elkey}{'createt'}; $listentryopenstatus = $gmentrylist->{$elkey}{'status'}; $listentrymorestatus = $gmentrylist->{$elkey}{'extended'}; if ($IN{'entryselectionview'} eq "searchresults") { $containsearch = Gm_Constants::NO; if ($listofaffectedentries ne Gm_Constants::EMPTY) { foreach $checkforthisentry (@affectedentrylist) { if ($checkforthisentry eq $listentrynumber) { $containsearch = Gm_Constants::YES; } } } else { &gm_getentryvariables($listentrynumber); 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)) { $containsearch = Gm_Constants::YES; } } } if ($listentrysubject eq Gm_Constants::EMPTY) { $listentrysubject = "(no subject)"; } ## TODO: CLEAN THIS MESS UP. USE LETTER APPREVIATIONS INSTEAD OF WIERD CHARACTERS, HARD TO READ OR SINGLE CHAR FLAGS if (($listentrynumber eq $newstayattopnumber) && ($listentryopenstatus eq "C") && ($listentrymorestatus eq 'Y')) { unless (($listentryauthor ne $IN{'authorname'}) && ($IN{'entryselectionview'} eq "onlyyou")) { unless (($IN{'entryselectionview'} eq "searchresults") && ($containsearch eq Gm_Constants::NO)) { print qq(<OPTION VALUE="$listentrynumber">‡ † * [$listentrydate $listentrytime] $listentrynumber\: $listentrysubject \($listentryauthor\)\n); $liststayattopnotice = "‡ = Entry currently marked to stay at the top of the main index."; $listclosedentrynotice = "† = Closed entry."; $listmoreentrynotice = "* = Extended entry (contains \"more\" text)."; $listsecondblank = Gm_Constants::NO; } } } elsif (($listentrynumber eq $newstayattopnumber) && ($listentryopenstatus eq "C")) { unless (($listentryauthor ne $IN{'authorname'}) && ($IN{'entryselectionview'} eq "onlyyou")) { unless (($IN{'entryselectionview'} eq "searchresults") && ($containsearch eq Gm_Constants::NO)) { print qq(<OPTION VALUE="$listentrynumber">‡ † [$listentrydate $listentrytime] $listentrynumber\: $listentrysubject \($listentryauthor\)\n); $liststayattopnotice = "‡ = Entry currently marked to stay at the top of the main index."; $listclosedentrynotice = "† = Closed entry."; $listsecondblank = Gm_Constants::NO; } } } elsif (($listentrynumber eq $newstayattopnumber) && ($listentrymorestatus eq 'Y')) { unless (($listentryauthor ne $IN{'authorname'}) && ($IN{'entryselectionview'} eq "onlyyou")) { unless (($IN{'entryselectionview'} eq "searchresults") && ($containsearch eq Gm_Constants::NO)) { print qq(<OPTION VALUE="$listentrynumber">‡ * [$listentrydate $listentrytime] $listentrynumber\: $listentrysubject \($listentryauthor\)\n); $liststayattopnotice = "‡ = Entry currently marked to stay at the top of the main index."; $listmoreentrynotice = "* = Extended entry (contains \"more\" text)."; $listsecondblank = Gm_Constants::NO; } } } elsif ($listentrynumber eq $newstayattopnumber) { unless (($listentryauthor ne $IN{'authorname'}) && ($IN{'entryselectionview'} eq "onlyyou")) { unless (($IN{'entryselectionview'} eq "searchresults") && ($containsearch eq Gm_Constants::NO)) { print qq(<OPTION VALUE="$listentrynumber">‡ [$listentrydate $listentrytime] $listentrynumber\: $listentrysubject \($listentryauthor\)\n); $liststayattopnotice = "‡ = Entry currently marked to stay at the top of the main index."; $listsecondblank = Gm_Constants::NO; } } } elsif (($listentrymorestatus eq 'Y') && ($listentryopenstatus eq "C")) { unless (($listentryauthor ne $IN{'authorname'}) && ($IN{'entryselectionview'} eq "onlyyou")) { unless (($IN{'entryselectionview'} eq "searchresults") && ($containsearch eq Gm_Constants::NO)) { if (($IN{'entryselectionview'} eq "searchresults") || ($IN{'entryselectionview'} eq "onlyyou") || ($IN{'entryselectionview'} eq Gm_Constants::MORE) || ($IN{'entryselectionview'} eq Gm_Constants::CLOSED) || ($IN{'entryselectionview'} eq Gm_Constants::ALL) || ($IN{'entryselectionview'} eq Gm_Constants::MAIN)) { unless (($listentrynumber <= $newarchivenumber) && ($IN{'entryselectionview'} eq Gm_Constants::MAIN)) { print qq(<OPTION VALUE="$listentrynumber">† * [$listentrydate $listentrytime] $listentrynumber\: $listentrysubject \($listentryauthor\)\n); $listclosedentrynotice = "† = Closed entry."; $listmoreentrynotice = "* = Extended entry (contains \"more\" text)."; $listsecondblank = Gm_Constants::NO; } } } } } elsif ($listentrymorestatus eq 'Y') { unless (($listentryauthor ne $IN{'authorname'}) && ($IN{'entryselectionview'} eq "onlyyou")) { unless (($IN{'entryselectionview'} eq "searchresults") && ($containsearch eq Gm_Constants::NO)) { if (($IN{'entryselectionview'} eq "searchresults") || ($IN{'entryselectionview'} eq "onlyyou") || ($IN{'entryselectionview'} eq Gm_Constants::MORE) || ($IN{'entryselectionview'} eq Gm_Constants::OPEN) || ($IN{'entryselectionview'} eq Gm_Constants::ALL) || ($IN{'entryselectionview'} eq Gm_Constants::MAIN)) { unless (($listentrynumber <= $newarchivenumber) && ($IN{'entryselectionview'} eq Gm_Constants::MAIN)) { print qq(<OPTION VALUE="$listentrynumber">* [$listentrydate $listentrytime] $listentrynumber\: $listentrysubject \($listentryauthor\)\n); $listmoreentrynotice = "* = Extended entry (contains \"more\" text)."; $listsecondblank = Gm_Constants::NO; } } } } } elsif ($listentryopenstatus eq "C") { unless (($listentryauthor ne $IN{'authorname'}) && ($IN{'entryselectionview'} eq "onlyyou")) { unless (($IN{'entryselectionview'} eq "searchresults") && ($containsearch eq Gm_Constants::NO)) { if (($IN{'entryselectionview'} eq "searchresults") || ($IN{'entryselectionview'} eq "onlyyou") || ($IN{'entryselectionview'} eq Gm_Constants::CLOSED) || ($IN{'entryselectionview'} eq Gm_Constants::ALL) || ($IN{'entryselectionview'} eq Gm_Constants::MAIN)) { unless (($listentrynumber <= $newarchivenumber) && ($IN{'entryselectionview'} eq Gm_Constants::MAIN)) { print qq(<OPTION VALUE="$listentrynumber">† [$listentrydate $listentrytime] $listentrynumber\: $listentrysubject \($listentryauthor\)\n); $listclosedentrynotice = "† = Closed entry."; $listsecondblank = Gm_Constants::NO; } } } } } else { unless (($listentryauthor ne $IN{'authorname'}) && ($IN{'entryselectionview'} eq "onlyyou")) { unless (($IN{'entryselectionview'} eq "searchresults") && ($containsearch eq Gm_Constants::NO)) { if (($IN{'entryselectionview'} eq "searchresults") || ($IN{'entryselectionview'} eq "onlyyou") || ($IN{'entryselectionview'} eq Gm_Constants::OPEN) || ($IN{'entryselectionview'} eq Gm_Constants::ALL) || ($IN{'entryselectionview'} eq Gm_Constants::MAIN)) { unless (($listentrynumber <= $newarchivenumber) && ($IN{'entryselectionview'} eq Gm_Constants::MAIN)) { print qq(<OPTION VALUE="$listentrynumber">[$listentrydate $listentrytime] $listentrynumber\: $listentrysubject \($listentryauthor\)\n); $listsecondblank = Gm_Constants::NO; } } } } } } print 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); if ($IN{'entryselectionview'} eq "searchresults") { print qq(<OPTION VALUE="$defaultentrylistview" SELECTED> \(Search results\)\n); } println( Gm_Web::createOption( value=>'main', label=>"Current entries ($indexdays day(s))", checked=>$IN{'entryselectionview'} )); println( Gm_Web::createOption( value=>'onlyyou', label=>'All entries by you', checked=>$IN{'entryselectionview'} )); println( Gm_Web::createOption( value=>Gm_Constants::MORE, label=>'All extended entries', checked=>$IN{'entryselectionview'} )); println( Gm_Web::createOption( value=>Gm_Constants::OPEN, label=>'All open entries', checked=>$IN{'entryselectionview'} )); println( Gm_Web::createOption( value=>Gm_Constants::CLOSED, label=>'All closed entries', checked=>$IN{'entryselectionview'} )); println( Gm_Web::createOption( value=>Gm_Constants::ALL, label=>'All entries', checked=>$IN{'entryselectionview'} )); $listnotice = Gm_Constants::EMPTY; if (($liststayattopnotice ne Gm_Constants::EMPTY) && ($listmoreentrynotice ne Gm_Constants::EMPTY) && ($listclosedentrynotice ne Gm_Constants::EMPTY)) { $listnotice = "<FONT SIZE=1>$liststayattopnotice\n<BR>\n$listmoreentrynotice\n<BR>\n$listclosedentrynotice</FONT>\n<P>"; } elsif (($liststayattopnotice ne Gm_Constants::EMPTY) && ($listmoreentrynotice ne Gm_Constants::EMPTY)) { $listnotice = "<FONT SIZE=1>$liststayattopnotice\n<BR>\n$listmoreentrynotice</FONT>\n<P>"; } elsif (($liststayattopnotice ne Gm_Constants::EMPTY) && ($listclosedentrynotice ne Gm_Constants::EMPTY)) { $listnotice = "<FONT SIZE=1>$liststayattopnotice\n<BR>\n$listclosedentrynotice</FONT>\n<P>"; } elsif ($liststayattopnotice ne Gm_Constants::EMPTY) { $listnotice = "<FONT SIZE=1>$liststayattopnotice</FONT>\n<P>"; } elsif (($listmoreentrynotice ne Gm_Constants::EMPTY) && ($listclosedentrynotice ne Gm_Constants::EMPTY)) { $listnotice = "<FONT SIZE=1>$listmoreentrynotice\n<BR>\n$listclosedentrynotice</FONT>\n<P>"; } elsif ($listmoreentrynotice ne Gm_Constants::EMPTY) { $listnotice = "<FONT SIZE=1>$listmoreentrynotice</FONT>\n<P>"; } elsif ($listclosedentrynotice ne Gm_Constants::EMPTY) { $listnotice = "<FONT SIZE=1>$listclosedentrynotice</FONT>\n<P>"; } print qq(</SELECT>   <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Change View" STYLE="width: 100; height: 22">\n<P>Sort by: ); # TODO THIS NO LONGER DEFAULTS TO DATE SORTED - USE LOCAL VAR AND DEFALT IT TO DATE IF BAD DATA IN $IN println( Gm_Web::createRadioButton( name=>'sortby', value=>'date', checked=>$IN{'sortby'} ).' Date  '); println( Gm_Web::createRadioButton( name=>'sortby', value=>'subject', checked=>$IN{'sortby'} ).' Subject  '); println( Gm_Web::createRadioButton( name=>'sortby', value=>'author', checked=>$IN{'sortby'} ).' Author'); print<<GMEDITENTRYSELECTIONMENUBOTTOM; <P> $listnotice <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Edit Selected Entry"> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #FFD0D0" VALUE="Open/Close Selected Entry"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0; width: 485" VALUE="Search And Replace Across All Entries"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0"> </FORM> <P> </CENTER> $gmframebottom </BODY> </HTML> GMEDITENTRYSELECTIONMENUBOTTOM $statusnote = Gm_Constants::EMPTY; exit; } # ------------------------------------ # editing entries - search and replace # ------------------------------------ sub gm_editentrysearchandreplace { &gm_validate; if ($gmentryeditaccess eq Gm_Constants::NO) { gm_writetocplog("$IN{'authorname'} attempted to perform a search-and-replace without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to perform a search-and-replace.</FONT></B><P>); &gm_frontpage; } if ($gmentryeditaccess eq "mineonly") { $statusnote = qq(<B><FONT COLOR="#FF0000">You must have access to edit all entries to do this.</FONT></B><P>); &gm_editentryselection; } if ($statusnote eq Gm_Constants::EMPTY) { $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>); } print<<GMEDITENTRYSEARCHREPLACE; $gmheadtag $gmframetop $statusnote <CENTER> <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=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> <P> <INPUT TYPE=CHECKBOX NAME="srcaseinsensitive" VALUE="yes"> Make "Search For" term case-insensitive? <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0; width: 485" VALUE="Perform Search And Replace"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Entry Selection"> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0"> </FORM> <P> </CENTER> $gmframebottom </BODY> </HTML> GMEDITENTRYSEARCHREPLACE $statusnote = Gm_Constants::EMPTY; exit; } # -------------------------- # perform search and replace # -------------------------- ## TODO: THIS SHOULD DO A REBUILD ONCE ITS DONE, HAVE TO MANUALLY REBUILD sub gm_performsearchandreplace { &gm_validate; if ($gmentryeditaccess eq Gm_Constants::NO) { gm_writetocplog("$IN{'authorname'} attempted to perform a search-and-replace without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to perform a search-and-replace.</FONT></B><P>); &gm_frontpage; } if ($gmentryeditaccess eq "mineonly") { $statusnote = qq(<B><FONT COLOR="#FF0000">You must have access to edit all entries to do this.</FONT></B><P>); &gm_editentryselection; } &gm_readcounter; $currententrycounter = $newentrynumber; $entriesaffected = 0; $listofaffectedentries = Gm_Constants::EMPTY; $rebuildentrylist = Gm_Constants::NO; do { # $currententrycounterpadded = sprintf ("%8d", $currententrycounter); # $currententrycounterpadded =~ tr/ /0/; $currententrycounterpadded = Gm_Utils::toEntryPadded( $currententrycounter ); open (FUNNYFEET, "<$EntriesPath/$currententrycounterpadded.cgi") || &gm_dangermouse("Can't read $EntriesPath/$currententrycounterpadded.cgi. Please make sure that your entries/archives directory is correctly configured and is CHMODed to 777, or try running Diagnostics & Repair in the Configuration screen."); @entrylines = <FUNNYFEET>; close (FUNNYFEET); $gmcounter = 0; $resaveentry = Gm_Constants::NO; chomp ($entrylines[0]); ($thisentrynumber, $thisentryauthor, $thisentrysubject, $thisentryweekdaynumber, $thisentrymonth, $thisentryday, $thisentryyearyear, $thisentryhour, $thisentryminute, $thisentrysecond, $thisentryampm, $thisentrypositivekarma, $thisentrynegativekarma, $thisentrycommentsnumber, $thisentryallowkarma, $thisentryallowcomments, $thisentryopenstatus, $thisentrymusic, $thisentrymood, $thisentryemoticonsallowed) = split (/\|/, $entrylines[0]); if ($IN{'srcaseinsensitive'} eq Gm_Constants::YES) { if ($thisentrysubject =~ m/$IN{'srsearchterm'}/i) { $thisentrysubject =~ s/$IN{'srsearchterm'}/$IN{'srreplaceterm'}/ig; $entrylines[0] = "$thisentrynumber|$thisentryauthor|$thisentrysubject|$thisentryweekdaynumber|$thisentrymonth|$thisentryday|$thisentryyearyear|$thisentryhour|$thisentryminute|$thisentrysecond|$thisentryampm|$thisentrypositivekarma|$thisentrynegativekarma|$thisentrycommentsnumber|$thisentryallowkarma|$thisentryallowcomments|$thisentryopenstatus|$thisentrymusic|$thisentrymood|$thisentryemoticonsallowed"; $resaveentry = Gm_Constants::YES; $rebuildentrylist = Gm_Constants::YES; } } else { if ($thisentrysubject =~ m/$IN{'srsearchterm'}/) { $thisentrysubject =~ s/$IN{'srsearchterm'}/$IN{'srreplaceterm'}/g; $entrylines[0] = "$thisentrynumber|$thisentryauthor|$thisentrysubject|$thisentryweekdaynumber|$thisentrymonth|$thisentryday|$thisentryyearyear|$thisentryhour|$thisentryminute|$thisentrysecond|$thisentryampm|$thisentrypositivekarma|$thisentrynegativekarma|$thisentrycommentsnumber|$thisentryallowkarma|$thisentryallowcomments|$thisentryopenstatus|$thisentrymusic|$thisentrymood|$thisentryemoticonsallowed"; $resaveentry = Gm_Constants::YES; $rebuildentrylist = Gm_Constants::YES; } } foreach (@entrylines) { chomp ($entrylines[$gmcounter]); unless (($gmcounter eq "0") || ($gmcounter eq "1")) { if ($IN{'srcaseinsensitive'} eq Gm_Constants::YES) { if ($entrylines[$gmcounter] =~ m/$IN{'srsearchterm'}/i) { $entrylines[$gmcounter] =~ s/$IN{'srsearchterm'}/$IN{'srreplaceterm'}/ig; $resaveentry = Gm_Constants::YES; } } else { if ($entrylines[$gmcounter] =~ m/$IN{'srsearchterm'}/) { $entrylines[$gmcounter] =~ s/$IN{'srsearchterm'}/$IN{'srreplaceterm'}/g; $resaveentry = Gm_Constants::YES; } } } $gmcounter++; } if ($resaveentry eq Gm_Constants::YES) { open (FUNNYFEET, ">$EntriesPath/$currententrycounterpadded.cgi") || &gm_dangermouse("Can't write to $EntriesPath/$currententrycounterpadded.cgi. Please make sure that your entries/archives directory is correctly configured and is CHMODed to 777, or try running Diagnostics & Repair in the Configuration screen."); foreach $thisistheline (@entrylines) { print FUNNYFEET "$thisistheline\n"; } close (FUNNYFEET); $entriesaffected++; $listofaffectedentries .= "$currententrycounter|"; } $currententrycounter--; } until $currententrycounter eq "0"; ## TODO: THIS CODE DUPLICATES IN GM_DIAGNOSTICSPERFORM if ($rebuildentrylist eq Gm_Constants::YES) { $checkentrycounter = $newentrynumber; my %rebuiltentrylist = (); do { # $checkentrycounterpadded = sprintf ("%8d", $checkentrycounter); # $checkentrycounterpadded =~ tr/ /0/; $checkentrycounterpadded = Gm_Utils::toEntryPadded( $checkentrycounter ); &gm_getentryvariables($checkentrycounter); $checkentryopenstatus = 'O'; $checkentrymorestatus = 'N'; if ($thisentryopenstatus eq Gm_Constants::CLOSED) { $checkentryopenstatus = "C"; } if ($thisentrymorebody ne Gm_Constants::EMPTY) { $checkentrymorestatus = 'Y'; } $rebuiltentrylist{$thisentrynumber} = { id=>$thisentrynumber, author=>$thisentryauthor, subject=>$thisentrysubject, created=>"$thisentrymonthmonth\/$thisentrydayday\/$thisentryyear", createt=>"$thisentryhourhour\:$thisentryminuteminute $thisentryampm", status=>$checkentryopenstatus, extended=>$checkentrymorestatus, music=>$thisentrymusic, mood=>$thisentrymood, emoticons=>$thisentryemoticonsallowed }; $checkentrycounter--; } until $checkentrycounter eq "0"; Gm_Storage::setEntrylist( list=>\%rebuiltentrylist, errHandler=>\&Gm_Web::displayAdminErrorExit ); } if ($listofaffectedentries ne Gm_Constants::EMPTY) { chop ($listofaffectedentries); @affectedentrylist = split (/\|/, $listofaffectedentries); } if ($entriesaffected eq "0") { gm_writetocplog("$IN{'authorname'} searched all entries for \"$IN{'srsearchterm'}\" and replaced it with \"$IN{'srreplaceterm'}\" (no entries affected)"); $statusnote = qq(<B><FONT COLOR="#FF0000">The search term was not found.</FONT></B><P>); $IN{'entryselectionview'} = "searchresults"; &gm_editentryselection; } elsif ($entriesaffected eq "1") { gm_writetocplog("$IN{'authorname'} searched all entries for \"$IN{'srsearchterm'}\" and replaced it with \"$IN{'srreplaceterm'}\" (1 entry affected)"); $statusnote = qq(<B><FONT COLOR="#0000FF">The search-and-replace was completed successfully \(1 entry affected\).<BR>The affected entry is listed below.</FONT></B><P>); $IN{'entryselectionview'} = "searchresults"; &gm_editentryselection; } else { gm_writetocplog("$IN{'authorname'} searched all entries for \"$IN{'srsearchterm'}\" and replaced it with \"$IN{'srreplaceterm'}\" ($entriesaffected entries affected)"); $statusnote = qq(<B><FONT COLOR="#0000FF">The search-and-replace was completed successfully \($entriesaffected entries affected\).<BR>All affected entries are listed below.</FONT></B><P>); $IN{'entryselectionview'} = "searchresults"; &gm_editentryselection; } } # ----------------------------------- # edit an entry - main editing screen # ----------------------------------- # TODO: REFACTOR THIS, ADD NEW, AND ADD POPUP INTO ONE sub gm_editthisentry { &gm_validate; if ($gmentryeditaccess eq Gm_Constants::NO) { gm_writetocplog("$IN{'authorname'} attempted to edit entry #$IN{'entryselectionlist'} without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit entries.</FONT></B><P>); &gm_frontpage; } if ($IN{'entryselectionlist'} eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#FF0000">You must select an entry to edit.</FONT></B><P>); &gm_editentryselection; } &gm_readconfig; &gm_readtemplates; &gm_readcounter; # $thisentrynumberpadded = sprintf ("%8d", $IN{'entryselectionlist'}); # $thisentrynumberpadded =~ tr/ /0/; $thisentrynumberpadded = Gm_Utils::toEntryPadded( $IN{'entryselectionlist'} ); open (FUNNYFEET, "<$EntriesPath/$thisentrynumberpadded.cgi") || &gm_dangermouse("Can't read $EntriesPath/$thisentrynumberpadded.cgi. Please make sure that your entries/archives directory is correctly configured and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); @entrylines = <FUNNYFEET>; close (FUNNYFEET); $gmcounter = 0; foreach (@entrylines) { chomp ($entrylines[$gmcounter]); $gmcounter++; } ($thisentrynumber, $thisentryauthor, $thisentrysubject, $thisentryweekdaynumber, $thisentrymonth, $thisentryday, $thisentryyearyear, $thisentryhour, $thisentryminute, $thisentrysecond, $thisentryampm, $thisentrypositivekarma, $thisentrynegativekarma, $thisentrycommentsnumber, $thisentryallowkarma, $thisentryallowcomments, $thisentryopenstatus, $thisentrymusic, $thisentrymood, $thisentryemoticonsallowed) = split (/\|/, $entrylines[0]); if (($IN{'authorname'} ne $thisentryauthor) && ($gmentryeditaccess eq "mineonly")) { gm_writetocplog("$IN{'authorname'} attempted to edit entry #$IN{'entryselectionlist'} (by $thisentryauthor) without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit entries you didn't create.</FONT></B><P>); &gm_editentryselection; } # chomp ($thisentryopenstatus); # $thisentrymonthmonth = sprintf ("%2d", $thisentrymonth); # $thisentrydayday = sprintf ("%2d", $thisentryday); # $thisentryhourhour = sprintf ("%2d", $thisentryhour); # $thisentryminuteminute = sprintf ("%2d", $thisentryminute); # $thisentrysecondsecond = sprintf ("%2d", $thisentrysecond); # $thisentrymonthmonth =~ tr/ /0/; # $thisentrydayday =~ tr/ /0/; # $thisentryhourhour =~ tr/ /0/; # $thisentryminuteminute =~ tr/ /0/; # $thisentrysecondsecond =~ tr/ /0/; $thisentrymonthmonth = Gm_Utils::toTwoDigit( $thisentrymonth ); $thisentrydayday = Gm_Utils::toTwoDigit( $thisentryday ); $thisentryhourhour = Gm_Utils::toTwoDigit( $thisentryhour ); $thisentryminuteminute = Gm_Utils::toTwoDigit( $thisentryminute ); $thisentrysecondsecond = Gm_Utils::toTwoDigit( $thisentrysecond ); $thisentrymainbody = $entrylines[2]; $thisentrymorebody = $entrylines[3]; $thisentrymainbody = Gm_Utils::toWebSafe($thisentrymainbody); $thisentrymorebody = Gm_Utils::toWebSafe($thisentrymorebody); $thisentrysubject = Gm_Utils::toWebSafe($thisentrysubject); $thisentrymusic = Gm_Utils::toWebSafe($thisentrymusic); $thisentrymood = Gm_Utils::toWebSafe($thisentrymood); if ($statusnote eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#000000"><B>Editing Entry #$thisentrynumber: Posted by $thisentryauthor @ $thisentrymonthmonth/$thisentrydayday/$thisentryyearyear $thisentryhourhour\:$thisentryminuteminute\:$thisentrysecondsecond $thisentryampm</B></FONT></B><P>); } $autorebuildcheckbox = Gm_Constants::EMPTY; if ($gmrebuildaccess eq Gm_Constants::YES) { if ($automaticrebuilddefault eq Gm_Constants::YES) { $autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="indexandentry" CHECKED> Automatically rebuild main index and this entry's page after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>); } else { $autorebuildcheckbox = qq(<P>\n<INPUT TYPE=CHECKBOX NAME="autorebuild" VALUE="indexandentry"> Automatically rebuild main index and this entry's page after saving\n<BR>\n<FONT SIZE=1>After clicking Save, expect a wait of up to several minutes if leaving this box checked.<BR>DO NOT interrupt Greymatter while it's rebuilding!</FONT>); } } # emoticons code display added &gm_emoticons_code; my $inlineinstructions = ''; if( $inlineformatting eq Gm_Constants::ENTRIES || $inlineformatting eq Gm_Constants::BOTH ){ $inlineinstructions = '<FONT SIZE=1>With "easy formatting", bold text, italics & underlining can be done easily by bracketing text with two **asterisks**, \\\\backslashes\\\\ or __underlines__ respectively.</FONT>'; } print<<GMENTRYEDITTOP; $gmheadtagtwo $gmframetop $statusnote <script language="JavaScript"> function commentEmoticonMain(code) { var cache = document.editentry.revisedentrymaintext.value; document.editentry.revisedentrymaintext.value = cache + " " + code; document.editentry.revisedentrymaintext.focus(); } function commentEmoticonMore(code) { var cache = document.editentry.revisedentrymoretext.value; document.editentry.revisedentrymoretext.value = cache + " " + code; document.editentry.revisedentrymoretext.focus(); } /* This script and many more are available free online at The JavaScript Source!! http://javascript.internet.com Created by: Hillel Aftel :: equazcion (at) gmail.com */ function checkAll(checkname, exby) { for (i = 0; i < checkname.length; i++) checkname[i].checked = exby.checked? true:false } </script> <FORM ACTION="gm.cgi" METHOD=POST name="editentry"> <INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}"> <INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}"> <INPUT TYPE=HIDDEN NAME="revisedentrynumber" VALUE="$thisentrynumber"> <INPUT TYPE=HIDDEN NAME="revisedentryauthor" VALUE="$thisentryauthor"> <INPUT TYPE=HIDDEN NAME="entryselectionview" VALUE="$IN{'entryselectionview'}"> <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> <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> <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> <P> <b>Main Entry Text</b> <BR> </FONT> <table> <tr valign="top"> $emoticonsmaincode <td><TEXTAREA NAME="revisedentrymaintext" COLS=86 ROWS=15 WRAP=VIRTUAL STYLE="width: 720">$thisentrymainbody</TEXTAREA> <br />$inlineinstructions</td> </tr> </table> $gmfonttag<P> <b>Extended ("More") Entry Text—Optional</b> <BR> </FONT> <table> <tr valign="top"> $emoticonsmorecode <td><TEXTAREA NAME="revisedentrymoretext" COLS=86 ROWS=15 WRAP=VIRTUAL STYLE="width: 720">$thisentrymorebody</TEXTAREA> </td> </tr> </table>$gmfonttag <P> <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript"> <!--// if ((parseInt(navigator.appVersion) >= 4) && (navigator.appName == "Microsoft Internet Explorer")) { document.write("<font size=1>Shortcut keys: CTRL-SHIFT-A to add a link, CTRL-SHIFT-B to bold selected text,<BR>CTRL-SHIFT-I to italicise, CTRL-SHIFT-U to underline</FONT><P>"); } //--> </SCRIPT> GMENTRYEDITTOP if ($thisentrycommentsnumber ne "0") { println('<TABLE BORDER="0" CELLPADDING="7" CELLSPACING="1" WIDTH="720" class="bold_table"><TR>'); println('<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#B0B0D0">'.$gmfonttag. '<b><font size=1>Multi Delete</FONT></b></TD>'); println('<TD VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="#B0B0D0">'.$gmfonttag. '<b><font size=1>Action</FONT></b></TD>'); println('<TD VALIGN=MIDDLE ALIGN=LEFT BGCOLOR="#B0B0D0" WIDTH=100%>'. $gmfonttag.' <b><font size=1>Comment</FONT></b></TD></TR>'); $commentcounter = 4; $commentcountermax = $thisentrycommentsnumber + 3; $alternatecommentrowone = "#FFF8FF"; $alternatecommentrowtwo = "#F6F8FF"; $alternatecommentrow = $alternatecommentrowone; do { if ($alternatecommentrow eq $alternatecommentrowone) { $alternatecommentrow = $alternatecommentrowtwo; } else { $alternatecommentrow = $alternatecommentrowone; } $thiscommentnumber = $commentcounter - 3; ($thiscommentauthor, $thiscommentauthorip, $thiscommentauthoremailabsolute, $thiscommentauthorhomepageabsolute, $thiscommentweekdaynumber, $thiscommentmonth, $thiscommentday, $thiscommentyearyear, $thiscommenthour, $thiscommentminute, $thiscommentsecond, $thiscommentampm, $thiscommenttext) = split (/\|/, $entrylines[$commentcounter]); # $thiscommentmonthmonth = sprintf ("%2d", $thiscommentmonth); # $thiscommentdayday = sprintf ("%2d", $thiscommentday); # $thiscommenthourhour = sprintf ("%2d", $thiscommenthour); # $thiscommentminuteminute = sprintf ("%2d", $thiscommentminute); # $thiscommentsecondsecond = sprintf ("%2d", $thiscommentsecond); # $thiscommentmonthmonth =~ tr/ /0/; # $thiscommentdayday =~ tr/ /0/; # $thiscommenthourhour =~ tr/ /0/; # $thiscommentminuteminute =~ tr/ /0/; # $thiscommentsecondsecond =~ tr/ /0/; $thiscommentmonthmonth = Gm_Utils::toTwoDigit( $thiscommentmonth ); $thiscommentdayday = Gm_Utils::toTwoDigit( $thiscommentday ); $thiscommenthourhour = Gm_Utils::toTwoDigit( $thiscommenthour ); $thiscommentminuteminute = Gm_Utils::toTwoDigit( $thiscommentminute ); $thiscommentsecondsecond = Gm_Utils::toTwoDigit( $thiscommentsecond ); $thiscommenttext =~ s/</\</g; $thiscommenttext =~ s/>/\>/g; $thiscommenttext =~ s/\|\*\|/\n/g; $thiscommenttext =~ s/\n/<BR>/g; $thiscommenttext =~ s/<BR><BR>/<P>/g; # $thiscommenttext =~ s/ /  /g; println('<TR><TD VALIGN=TOP ALIGN=CENTER BGCOLOR="'.$alternatecommentrow.'">'. '<INPUT TYPE="checkbox" NAME="multideletecommentselection" VALUE="'.$thiscommentnumber.'"></TD>'); println('<TD VALIGN=TOP ALIGN=CENTER BGCOLOR="'.$alternatecommentrow.'" nowrap>'); ## The edit link println( $gmfonttag.'<a href="'.$ENV{SCRIPT_NAME}.'?thomas=Edit+Selected+Comment&'. 'revisedentrycommentselection='.$thiscommentnumber.'&revisedentryauthor='.$thisentryauthor. '&revisedentrynumber='.$thisentrynumber.'&authorname='.$IN{authorname}. '&authorpassword='.$IN{authorpassword}.'&entryselectionview='. $IN{entryselectionview}.'" class="link_button">  Edit  </a>   '); ## The delete link println(' <a href="'.$ENV{SCRIPT_NAME}.'?thomas=Delete+Selected+Comment&'. 'revisedentrycommentselection='.$thiscommentnumber.'&revisedentryauthor='.$thisentryauthor. '&revisedentrynumber='.$thisentrynumber.'&authorname='.$IN{authorname}. '&authorpassword='.$IN{authorpassword}.'&entryselectionview='. $IN{entryselectionview}.'" class="link_button" STYLE="background: #FFD0D0">  Delete  </a>'. '</font></TD>'); println('<TD VALIGN=MIDDLE ALIGN=LEFT BGCOLOR="'.$alternatecommentrow.'">'. $gmfonttag.'<b>#'.$thiscommentnumber.': Posted by '.$thiscommentauthor.' ('. $thiscommentauthorip.') @ '.$thiscommentmonthmonth.'/'.$thiscommentdayday.'/'. $thiscommentyearyear.' '.$thiscommenthourhour.':'.$thiscommentminuteminute. ':'.$thiscommentsecondsecond.' '.$thiscommentampm.'</b><br />'.$thiscommenttext.' '); if (($thiscommentauthoremailabsolute ne Gm_Constants::EMPTY) && ($thiscommentauthorhomepageabsolute ne Gm_Constants::EMPTY)) { print qq(<P>----------<BR>E-Mail: <A HREF="mailto:$thiscommentauthoremailabsolute">$thiscommentauthoremailabsolute</A><BR>Homepage: <A HREF="$thiscommentauthorhomepageabsolute">$thiscommentauthorhomepageabsolute</A>); } else { if ($thiscommentauthoremailabsolute ne Gm_Constants::EMPTY) { print qq(<P>----------<BR>E-Mail: <A HREF="mailto:$thiscommentauthoremailabsolute">$thiscommentauthoremailabsolute</A>); } if ($thiscommentauthorhomepageabsolute ne Gm_Constants::EMPTY) { print qq(<P>----------<BR>Homepage: <A HREF="$thiscommentauthorhomepageabsolute">$thiscommentauthorhomepageabsolute</A>); } } print qq(</FONT></TD></TR>); $commentcounter++; } until $commentcounter > $commentcountermax; println("</TABLE>\n<P>"); println('<input type="checkbox" name="all" onClick="checkAll(document.editentry.multideletecommentselection,this)">Check/Uncheck All    '); println('<INPUT TYPE="submit" CLASS="button" NAME="thomas" STYLE="background: #FFD0D0" VALUE="Delete All Selected Comments"><br /><br />'); } if ($thisentrypositivekarma ne "0") { 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): ); $karmatempipline = Gm_Constants::EMPTY; @karmatempiptally = split (/\|/, $entrylines[1]); $gmcounter = 0; foreach (@karmatempiptally) { if ($karmatempiptally[$gmcounter] eq "P") { $karmatempipline .= "$karmatempiptally[$gmcounter - 1], "; } $gmcounter++; } substr($karmatempipline, -2, 2) = Gm_Constants::EMPTY; print qq($karmatempipline \($thisentrypositivekarma total\)</FONT></TD></TR></TABLE></TD></TR></TABLE>\n<P>\n); } if ($thisentrynegativekarma ne "0") { 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): ); $karmatempipline = Gm_Constants::EMPTY; @karmatempiptally = split (/\|/, $entrylines[1]); $gmcounter = 0; foreach (@karmatempiptally) { if ($karmatempiptally[$gmcounter] eq 'N') { $karmatempipline .= "$karmatempiptally[$gmcounter - 1], "; } $gmcounter++; } substr($karmatempipline, -2, 2) = Gm_Constants::EMPTY; print qq($karmatempipline \($thisentrynegativekarma total\)</FONT></TD></TR></TABLE></TD></TR></TABLE>\n<P>\n); } if (($allowkarmaorcomments eq Gm_Constants::KARMA) || ($allowkarmaorcomments eq Gm_Constants::BOTH)) { println('Allow karma voting on this entry: '); println( Gm_Web::createRadioButton( name=>'revisedentryallowkarma', value=>Gm_Constants::YES, checked=>$thisentryallowkarma ).' Yes '); println( Gm_Web::createRadioButton( name=>'revisedentryallowkarma', value=>Gm_Constants::NO, checked=>$thisentryallowkarma ).' No '); } else { print qq(<INPUT TYPE=HIDDEN NAME="revisedentryallowkarma" VALUE="no">\n); } if ($allowkarmaorcomments eq Gm_Constants::BOTH) { print "<BR>\n"; } if (($allowkarmaorcomments eq Gm_Constants::COMMENTS) || ($allowkarmaorcomments eq Gm_Constants::BOTH)) { println('Allow comments to be posted to this entry: '); println( Gm_Web::createRadioButton( name=>'revisedentryallowcomments', value=>Gm_Constants::YES, checked=>$thisentryallowcomments ).' Yes '); println( Gm_Web::createRadioButton( name=>'revisedentryallowcomments', value=>Gm_Constants::NO, checked=>$thisentryallowcomments ).' No '); } else { print qq(<INPUT TYPE=HIDDEN NAME="revisedentryallowkarma" VALUE="no">\n); } if (($emoticonsallowed eq Gm_Constants::ENTRIES) || ($emoticonsallowed eq Gm_Constants::BOTH)) { println('Allow emoticons to be used in this entry: '); println( Gm_Web::createRadioButton( name=>'revisedentryemoticonsallowed', value=>Gm_Constants::YES, checked=>$thisentryemoticonsallowed ).' Yes '); println( Gm_Web::createRadioButton( name=>'revisedentryemoticonsallowed', value=>Gm_Constants::NO, checked=>$thisentryemoticonsallowed ).' No '); } else { print qq(<INPUT TYPE=HIDDEN NAME="revisedentryemoticonsallowed" VALUE="no">\n); } ## Can't convert this because it compares vars that aren't the inputs values if ($newstayattopnumber eq $thisentrynumber) { println('<br />Keep this entry at the top of the main page: '. '<INPUT TYPE=RADIO NAME="revisedentrystayattop" VALUE="'.Gm_Constants::YES.'" CHECKED> Yes '. '<INPUT TYPE=RADIO NAME="revisedentrystayattop" VALUE="'.Gm_Constants::NO.'"> No <br />'); } else { println('<br />Keep this entry at the top of the main page: '. '<INPUT TYPE=RADIO NAME="revisedentrystayattop" VALUE="'.Gm_Constants::YES.'"> Yes '. '<INPUT TYPE=RADIO NAME="revisedentrystayattop" VALUE="'.Gm_Constants::NO.'" CHECKED> No <br />'); } println('This entry is: '); println( Gm_Web::createRadioButton( name=>'revisedentryopenstatus', value=>Gm_Constants::OPEN, checked=>$thisentryopenstatus ).' Open '); println( Gm_Web::createRadioButton( name=>'revisedentryopenstatus', value=>Gm_Constants::CLOSED, checked=>$thisentryopenstatus ).' Closed '); print<<GMENTRYEDITBOTTOM; $autorebuildcheckbox <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Save Changes To This Entry"> <INPUT TYPE=RESET CLASS="button" STYLE="background: #FFD0D0" VALUE="Undo Changes Since Last Save"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Select Another Entry"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0"> </FORM> <P> $gmframebottom </BODY> </HTML> GMENTRYEDITBOTTOM exit; } # ---------------------------- # save changes to edited entry # ---------------------------- sub gm_saveentrychanges { &gm_validate; if ($gmentryeditaccess eq Gm_Constants::NO) { gm_writetocplog("$IN{'authorname'} attempted to edit entry #$IN{'revisedentrynumber'} without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit entries.</FONT></B><P>); &gm_frontpage; } if (($IN{'authorname'} ne $IN{'revisedentryauthor'}) && ($gmentryeditaccess eq "mineonly")) { gm_writetocplog("$IN{'authorname'} attempted to edit entry #$IN{'entryselectionlist'} (by $IN{'revisedentryauthor'}) without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit entries you didn't create.</FONT></B><P>); &gm_editentryselection; } $IN{'revisedentrysubject'} = Gm_Utils::toStoreSafe($IN{'revisedentrysubject'}); $IN{'revisedentrysubject'} = Gm_Utils::toConfigSafe($IN{'revisedentrysubject'}); if ($IN{'revisedentrymaintext'} eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#FF0000">You left the main text field blank. Please try again.</FONT></B><P>); $IN{'entryselectionlist'} = $IN{'revisedentrynumber'}; &gm_editthisentry; } &gm_readconfig; &gm_readtemplates; &gm_readcounter; # $thisentrynumberpadded = sprintf ("%8d", $IN{'revisedentrynumber'}); # $thisentrynumberpadded =~ tr/ /0/; $thisentrynumberpadded = Gm_Utils::toEntryPadded( $IN{'revisedentrynumber'} ); open (FUNNYFEET, "<$EntriesPath/$thisentrynumberpadded.cgi") || &gm_dangermouse("Can't read $EntriesPath/$thisentrynumberpadded.cgi. Please make sure your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); @entrylines = <FUNNYFEET>; close (FUNNYFEET); $gmcounter = 0; foreach (@entrylines) { chomp ($entrylines[$gmcounter]); $gmcounter++; } ($thisentrynumber, $thisentryauthor, $thisentrysubject, $thisentryweekdaynumber, $thisentrymonth, $thisentryday, $thisentryyearyear, $thisentryhour, $thisentryminute, $thisentrysecond, $thisentryampm, $thisentrypositivekarma, $thisentrynegativekarma, $thisentrycommentsnumber, $thisentryallowkarma, $thisentryallowcomments, $thisentryopenstatus, $thisentrymusic, $thisentrymood, $thisentryemoticonsallowed) = split (/\|/, $entrylines[0]); chomp ($thisentryemoticonsallowed); if (($thisentryopenstatus eq Gm_Constants::OPEN) && ($IN{'revisedentryopenstatus'} eq Gm_Constants::CLOSED)) { $newalltimeopenentriesnumber--; $newalltimeclosedentriesnumber++; } if (($thisentryopenstatus eq Gm_Constants::CLOSED) && ($IN{'revisedentryopenstatus'} eq Gm_Constants::OPEN)) { $newalltimeopenentriesnumber++; $newalltimeclosedentriesnumber--; } $thisentryyear = substr($thisentryyearyear, -2, 2); @months = ("null", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); @weekdays = ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"); $thisentryweekday = $weekdays[$thisentryweekdaynumber]; $thisentrymonthword = $months[$thisentrymonth]; # $thisentrymonthmonth = sprintf ("%2d", $thisentrymonth); # $thisentrydayday = sprintf ("%2d", $thisentryday); # $thisentryhourhour = sprintf ("%2d", $thisentryhour); # $thisentryminuteminute = sprintf ("%2d", $thisentryminute); # $thisentrysecondsecond = sprintf ("%2d", $thisentrysecond); # $thisentrymonthmonth =~ tr/ /0/; # $thisentrydayday =~ tr/ /0/; # $thisentryhourhour =~ tr/ /0/; # $thisentryminuteminute =~ tr/ /0/; # $thisentrysecondsecond =~ tr/ /0/; $thisentrymonthmonth = Gm_Utils::toTwoDigit( $thisentrymonth ); $thisentrydayday = Gm_Utils::toTwoDigit( $thisentryday ); $thisentryhourhour = Gm_Utils::toTwoDigit( $thisentryhour ); $thisentryminuteminute = Gm_Utils::toTwoDigit( $thisentryminute ); $thisentrysecondsecond = Gm_Utils::toTwoDigit( $thisentrysecond ); $IN{'revisedentrysubject'} = Gm_Utils::toStoreSafe($IN{'revisedentrysubject'}); $IN{'revisedentrysubject'} = Gm_Utils::toConfigSafe($IN{'revisedentrysubject'}); $IN{'revisedentrymaintext'} = Gm_Utils::toStoreSafe($IN{'revisedentrymaintext'}); $IN{'revisedentrymoretext'} = Gm_Utils::toStoreSafe($IN{'revisedentrymoretext'}); $IN{'revisedentrymusic'} = Gm_Utils::toStoreSafe($IN{'revisedentrymusic'}); $IN{'revisedentrymood'} = Gm_Utils::toStoreSafe($IN{'revisedentrymood'}); open (FUNNYFEET, ">$EntriesPath/$thisentrynumberpadded.cgi") || &gm_dangermouse("Can't write to $EntriesPath/$thisentrynumberpadded.cgi. Please make sure your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); print FUNNYFEET "$thisentrynumber|$thisentryauthor|$IN{'revisedentrysubject'}|$thisentryweekdaynumber|$thisentrymonth|$thisentryday|$thisentryyearyear|$thisentryhour|$thisentryminute|$thisentrysecond|$thisentryampm|$thisentrypositivekarma|$thisentrynegativekarma|$thisentrycommentsnumber|$IN{'revisedentryallowkarma'}|$IN{'revisedentryallowcomments'}|$IN{'revisedentryopenstatus'}|$IN{'revisedentrymusic'}|$IN{'revisedentrymood'}|$IN{'revisedentryemoticonsallowed'}\n"; print FUNNYFEET "$entrylines[1]\n"; print FUNNYFEET "$IN{'revisedentrymaintext'}\n"; print FUNNYFEET "$IN{'revisedentrymoretext'}\n"; if ($thisentrycommentsnumber ne "0") { $commentcounter = 4; $commentcountermax = $thisentrycommentsnumber + 3; do { unless ($entrylines[$commentcounter] eq Gm_Constants::EMPTY) { print FUNNYFEET "$entrylines[$commentcounter]\n"; } $commentcounter++; } until $commentcounter > $commentcountermax; } close (FUNNYFEET); $revisedentrymorestatus = 'N'; if ($IN{'revisedentrymoretext'} ne Gm_Constants::EMPTY) { $revisedentrymorestatus = 'Y'; } $revisedentrymarkopen = 'O'; if ($IN{'revisedentryopenstatus'} eq Gm_Constants::CLOSED) { $revisedentrymarkopen = "C"; } my %updatedInfo = (); $updatedInfo{'subject'} = $IN{'revisedentrysubject'}; $updatedInfo{'status'} = $revisedentrymarkopen; $updatedInfo{'extended'} = $revisedentrymorestatus; $updatedInfo{'music'} = $IN{'revisedentrymusic'}; $updatedInfo{'mood'} = $IN{'revisedentrymood'}; $updatedInfo{'emoticons'} = $IN{'revisedentryemoticonsallowed'}; my $gmentrylist = Gm_Storage::updateEntrylist( key=>$IN{'revisedentrynumber'}, %updatedInfo, errHandler=>\&Gm_Web::displayAdminErrorExit ); if (($IN{'revisedentrystayattop'} eq Gm_Constants::NO) && ($newstayattopnumber eq $thisentrynumber)) { $newstayattopnumber = 0; } if ($IN{'revisedentrystayattop'} eq Gm_Constants::YES) { $newstayattopnumber = $thisentrynumber; } &gm_writecounter; $recordentrysubject = $IN{'revisedentrysubject'}; if ($recordentrysubject eq Gm_Constants::EMPTY) { $recordentrysubject = "[no subject]"; } gm_writetocplog("$IN{'authorname'} edited an entry (#$IN{'revisedentrynumber'}: $recordentrysubject)"); if ($IN{'autorebuild'} eq "indexandentry") { &gm_readconfig; &gm_readcounter; &gm_readtemplates; &gm_generatemainindex; &gm_getentryvariables($IN{'revisedentrynumber'}); if (($thisentryopenstatus eq Gm_Constants::OPEN) && ($generateentrypages eq Gm_Constants::YES)) { if ($thisentrymorebody ne Gm_Constants::EMPTY) { &gm_formatentry($gmmoreentrypagetemplate); } else { &gm_formatentry($gmentrypagetemplate); } open (THISFILE, ">$EntriesPath/$thisentrynumberpadded.$entrysuffix") || &gm_dangermouse("Can't write to $EntriesPath/$thisentrynumberpadded.$entrysuffix. Please make sure that your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); print THISFILE $entryreturn; close (THISFILE); chmod (0666, "$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } else { unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } $statusnote = qq(<B><FONT COLOR="#0000FF">Entry #$IN{'revisedentrynumber'} ($recordentrysubject) has been edited<BR>and the main index & this entry's page have been rebuilt.</FONT></B><P>); } else { $statusnote = qq(<B><FONT COLOR="#0000FF">Entry #$IN{'revisedentrynumber'} ($recordentrysubject) has been edited.<BR>Be sure to rebuild your files for the changes to be visible on your site.</FONT></B><P>); } &gm_frontpage; } # ------------------------ # change entry open status # ------------------------ sub gm_changeentryopenstatus { &gm_validate; if ($gmentryeditaccess eq Gm_Constants::NO) { gm_writetocplog("$IN{'authorname'} attempted to change the open/closed status on entry #$IN{'revisedentrynumber'} without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to open/close entries.</FONT></B><P>); &gm_frontpage; } if ($IN{'entryselectionlist'} eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#FF0000">You must select an entry to open or close.</FONT></B><P>); &gm_editentryselection; } &gm_readconfig; &gm_readtemplates; &gm_readcounter; # $thisentrynumberpadded = sprintf ("%8d", $IN{'entryselectionlist'}); # $thisentrynumberpadded =~ tr/ /0/; $thisentrynumberpadded = Gm_Utils::toEntryPadded( $IN{'entryselectionlist'} ); open (FUNNYFEET, "<$EntriesPath/$thisentrynumberpadded.cgi") || &gm_dangermouse("Can't read $EntriesPath/$thisentrynumberpadded.cgi. Please make sure your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); @entrylines = <FUNNYFEET>; close (FUNNYFEET); $gmcounter = 0; foreach (@entrylines) { chomp ($entrylines[$gmcounter]); $gmcounter++; } ($thisentrynumber, $thisentryauthor, $thisentrysubject, $thisentryweekdaynumber, $thisentrymonth, $thisentryday, $thisentryyearyear, $thisentryhour, $thisentryminute, $thisentrysecond, $thisentryampm, $thisentrypositivekarma, $thisentrynegativekarma, $thisentrycommentsnumber, $thisentryallowkarma, $thisentryallowcomments, $thisentryopenstatus, $thisentrymusic, $thisentrymood, $thisentryemoticonsallowed) = split (/\|/, $entrylines[0]); if (($IN{'authorname'} ne $thisentryauthor) && ($gmentryeditaccess eq "mineonly")) { gm_writetocplog("$IN{'authorname'} attempted to change the open/closed status on entry #$IN{'entryselectionlist'} (by $thisentryauthor) without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to open/close entries you didn't create.</FONT></B><P>); &gm_editentryselection; } if ($thisentryopenstatus eq Gm_Constants::OPEN) { $newalltimeopenentriesnumber--; $newalltimeclosedentriesnumber++; $thisentryopenstatus = Gm_Constants::CLOSED; } else { $newalltimeopenentriesnumber++; $newalltimeclosedentriesnumber--; $thisentryopenstatus = Gm_Constants::OPEN; } $gmcounter = 0; &gm_writecounter; open (FUNNYFEET, ">$EntriesPath/$thisentrynumberpadded.cgi") || &gm_dangermouse("Can't write to $EntriesPath/$thisentrynumberpadded.cgi. Please make sure your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); print FUNNYFEET "$thisentrynumber|$thisentryauthor|$thisentrysubject|$thisentryweekdaynumber|$thisentrymonth|$thisentryday|$thisentryyearyear|$thisentryhour|$thisentryminute|$thisentrysecond|$thisentryampm|$thisentrypositivekarma|$thisentrynegativekarma|$thisentrycommentsnumber|$thisentryallowkarma|$thisentryallowcomments|$thisentryopenstatus|$thisentrymusic|$thisentrymood|$thisentryemoticonsallowed\n"; foreach (@entrylines) { unless ($gmcounter eq "0") { print FUNNYFEET "$entrylines[$gmcounter]\n"; } $gmcounter++; } close (FUNNYFEET); ## Updating entry list with new status, but all we know is that we are flipping it # so we have to get old one then update with new value my $gmentrylist = Gm_Storage::getEntrylist( errHandler=>\&Gm_Web::displayAdminErrorExit ); my %updatedInfo = (); if ($gmentrylist->{$thisentrynumber}{'status'} eq 'O') { $updatedInfo{'status'} = 'C'; } else { $updatedInfo{'status'} = 'O'; } my $gmentrylist = Gm_Storage::updateEntrylist( key=>$thisentrynumber, %updatedInfo, errHandler=>\&Gm_Web::displayAdminErrorExit ); if ($thisentryopenstatus eq Gm_Constants::OPEN) { gm_writetocplog("$IN{'authorname'} reopened an entry (#$thisentrynumber: $thisentrysubject)"); $statusnote = qq(<B><FONT COLOR="#0000FF">Entry #$thisentrynumber ($thisentrysubject) has been reopened.<BR>Be sure to rebuild your files for the changes to be visible on your site.</FONT></B><P>); } else { gm_writetocplog("$IN{'authorname'} closed an entry (#$thisentrynumber: $thisentrysubject)"); $statusnote = qq(<B><FONT COLOR="#0000FF">Entry #$thisentrynumber ($thisentrysubject) has been closed.<BR>Be sure to rebuild your files for the changes to be visible on your site.</FONT></B><P>); } &gm_editentryselection; } # ----------------------- # delete selected comment # ----------------------- sub gm_deleteselectedcomment { &gm_validate; if ($gmentryeditaccess eq Gm_Constants::NO) { gm_writetocplog("$IN{'authorname'} attempted to delete a comment from entry #$IN{'revisedentrynumber'} ($IN{'revisedentrysubject'}) without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to delete comments.</FONT></B><P>); &gm_frontpage; } if ($IN{'revisedentrycommentselection'} eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#FF0000">You must select a comment to be deleted.</FONT></B><P>); &gm_editthisentry; } if (($IN{'authorname'} ne $IN{'revisedentryauthor'}) && ($gmentryeditaccess eq "mineonly")) { gm_writetocplog("$IN{'authorname'} attempted to delete a comment from entry #$IN{'entryselectionlist'} (by $IN{'revisedentryauthor'}) without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to delete comments from entries you didn't create.</FONT></B><P>); &gm_editentryselection; } $deleteme = $IN{'revisedentrycommentselection'} + 3; # $thisentrynumberpadded = sprintf ("%8d", $IN{'revisedentrynumber'}); # $thisentrynumberpadded =~ tr/ /0/; $thisentrynumberpadded = Gm_Utils::toEntryPadded( $IN{'revisedentrynumber'} ); open (FUNNYFEET, "<$EntriesPath/$thisentrynumberpadded.cgi") || &gm_dangermouse("Can't read $EntriesPath/$thisentrynumberpadded.cgi. Please make sure that your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); @entrylines = <FUNNYFEET>; close (FUNNYFEET); ($thisentrynumber, $thisentryauthor, $thisentrysubject, $thisentryweekdaynumber, $thisentrymonth, $thisentryday, $thisentryyearyear, $thisentryhour, $thisentryminute, $thisentrysecond, $thisentryampm, $thisentrypositivekarma, $thisentrynegativekarma, $thisentrycommentsnumber, $thisentryallowkarma, $thisentryallowcomments, $thisentryopenstatus, $thisentrymusic, $thisentrymood, $thisentryemoticonsallowed) = split (/\|/, $entrylines[0]); if (($IN{'authorname'} ne $IN{'revisedentryauthor'} ) && ($gmentryeditaccess eq "mineonly")) { gm_writetocplog("$IN{'authorname'} attempted to delete entry #$IN{'entryselectionlist'} (by $IN{'revisedentryauthor'}) without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to delete entries you didn't create.</FONT></B><P>); &gm_editentryselection; } $thisentrycommentsnumber--; $entrylines[0] = "$thisentrynumber|$thisentryauthor|$thisentrysubject|$thisentryweekdaynumber|$thisentrymonth|$thisentryday|$thisentryyearyear|$thisentryhour|$thisentryminute|$thisentrysecond|$thisentryampm|$thisentrypositivekarma|$thisentrynegativekarma|$thisentrycommentsnumber|$thisentryallowkarma|$thisentryallowcomments|$thisentryopenstatus|$thisentrymusic|$thisentrymood|$thisentryemoticonsallowed"; $entrylines[$deleteme] = "*DELETED*"; open (FUNNYFEET, ">$EntriesPath/$thisentrynumberpadded.cgi") || &gm_dangermouse("Can't write to $EntriesPath/$thisentrynumberpadded.cgi. Please make sure that your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); foreach $revisedentryline (@entrylines) { chomp ($revisedentryline); unless ($revisedentryline eq "*DELETED*") { print FUNNYFEET "$revisedentryline\n"; } } close (FUNNYFEET); &gm_readcounter; $newalltimecommentstotalnumber--; &gm_writecounter; gm_writetocplog("$IN{'authorname'} deleted a comment from entry #$IN{'revisedentrynumber'} ($IN{'revisedentrysubject'})"); $statusnote = qq(<B><FONT COLOR="#0000FF">The comment has been deleted.</FONT></B><P>); $IN{'entryselectionlist'} = $IN{'revisedentrynumber'}; &gm_editthisentry; } # ----------------------- # delete all selected comments # ----------------------- sub gm_DeleteAllSelectedComments { &gm_validate; my @del_ids = split("\t",$IN{'multideletecommentselection'}); if ($gmentryeditaccess eq Gm_Constants::NO) { gm_writetocplog("$IN{'authorname'} attempted to delete a comment from entry #$IN{'revisedentrynumber'} ($IN{'revisedentrysubject'}) without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to delete comments.</FONT></B><P>); &gm_frontpage; } if ($IN{'multideletecommentselection'} eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#FF0000">You must select a comment to be deleted.</FONT></B><P>); &gm_editthisentry; } if (($IN{'authorname'} ne $IN{'revisedentryauthor'}) && ($gmentryeditaccess eq "mineonly")) { gm_writetocplog("$IN{'authorname'} attempted to delete a comment from entry #$IN{'entryselectionlist'} (by $IN{'revisedentryauthor'}) without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to delete comments from entries you didn't create.</FONT></B><P>); &gm_editentryselection; } ## Opening up the entry we want to modify ... TODO make this a Gm_Store method # $thisentrynumberpadded = sprintf ("%8d", $IN{'revisedentrynumber'}); # $thisentrynumberpadded =~ tr/ /0/; $thisentrynumberpadded = Gm_Utils::toEntryPadded( $IN{'revisedentrynumber'} ); open (FUNNYFEET, "<$EntriesPath/$thisentrynumberpadded.cgi") || &gm_dangermouse("Can't read $EntriesPath/$thisentrynumberpadded.cgi. Please make sure that your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); @entrylines = <FUNNYFEET>; close (FUNNYFEET); ($thisentrynumber, $thisentryauthor, $thisentrysubject, $thisentryweekdaynumber, $thisentrymonth, $thisentryday, $thisentryyearyear, $thisentryhour, $thisentryminute, $thisentrysecond, $thisentryampm, $thisentrypositivekarma, $thisentrynegativekarma, $thisentrycommentsnumber, $thisentryallowkarma, $thisentryallowcomments, $thisentryopenstatus, $thisentrymusic, $thisentrymood, $thisentryemoticonsallowed) = split (/\|/, $entrylines[0]); if (($IN{'authorname'} ne $IN{'revisedentryauthor'} ) && ($gmentryeditaccess eq "mineonly")) { gm_writetocplog("$IN{'authorname'} attempted to delete entry #$IN{'entryselectionlist'} (by $IN{'revisedentryauthor'}) without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to delete entries you didn't create.</FONT></B><P>); &gm_editentryselection; } $statusnote = Gm_Constants::EMPTY; foreach my $del_id (@del_ids){ $deleteme = $del_id + 3; $thisentrycommentsnumber--; $entrylines[$deleteme] = "*DELETED*"; $statusnote .= qq(<B><FONT COLOR="#0000FF">Comment \#$del_id has been deleted.</FONT></B><br />); } ## Entry Header information $entrylines[0] = "$thisentrynumber|$thisentryauthor|$thisentrysubject|$thisentryweekdaynumber|$thisentrymonth|$thisentryday|$thisentryyearyear|$thisentryhour|$thisentryminute|$thisentrysecond|$thisentryampm|$thisentrypositivekarma|$thisentrynegativekarma|$thisentrycommentsnumber|$thisentryallowkarma|$thisentryallowcomments|$thisentryopenstatus|$thisentrymusic|$thisentrymood|$thisentryemoticonsallowed"; open (FUNNYFEET, ">$EntriesPath/$thisentrynumberpadded.cgi") || &gm_dangermouse("Can't write to $EntriesPath/$thisentrynumberpadded.cgi. Please make sure that your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); foreach $revisedentryline (@entrylines) { chomp ($revisedentryline); unless ($revisedentryline eq "*DELETED*") { print FUNNYFEET "$revisedentryline\n"; } } close (FUNNYFEET); &gm_readcounter; $newalltimecommentstotalnumber--; &gm_writecounter; gm_writetocplog("$IN{'authorname'} deleted a comment(s) \#".join(',',@del_ids)." from entry #$IN{'revisedentrynumber'} ($IN{'revisedentrysubject'})"); $IN{'entryselectionlist'} = $IN{'revisedentrynumber'}; &gm_editthisentry; } # --------------------- # edit selected comment # --------------------- sub gm_editselectedcomment { &gm_validate; if ($gmentryeditaccess eq Gm_Constants::NO) { gm_writetocplog("$IN{'authorname'} attempted to edit comment #$IN{'revisedentrycommentselection'} in entry #$IN{'revisedentrynumber'} ($IN{'revisedentrysubject'}) without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit comments.</FONT></B><P>); &gm_frontpage; } if ($IN{'revisedentrycommentselection'} eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#FF0000">You must select a comment to be edited.</FONT></B><P>); $IN{'entryselectionlist'} = $IN{'revisedentrynumber'}; &gm_editthisentry; } if (($IN{'authorname'} ne $IN{'revisedentryauthor'}) && ($gmentryeditaccess eq "mineonly")) { gm_writetocplog("$IN{'authorname'} attempted to edit a comment in entry #$IN{'entryselectionlist'} (by $IN{'revisedentryauthor'}) without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit comments in entries you didn't create.</FONT></B><P>); &gm_editentryselection; } # $thisentrynumberpadded = sprintf ("%8d", $IN{'revisedentrynumber'}); # $thisentrynumberpadded =~ tr/ /0/; $thisentrynumberpadded = Gm_Utils::toEntryPadded( $IN{'revisedentrynumber'} ); $editme = $IN{'revisedentrycommentselection'} + 3; open (FUNNYFEET, "<$EntriesPath/$thisentrynumberpadded.cgi") || &gm_dangermouse("Can't read $EntriesPath/$thisentrynumberpadded.cgi. Please make sure that your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); @entrylines = <FUNNYFEET>; close (FUNNYFEET); chomp ($entrylines[$editme]); $entrylines[$editme] =~ s/\|\*\|/\n/g; ($thiscommentauthor, $thiscommentauthorip, $thiscommentauthoremailabsolute, $thiscommentauthorhomepageabsolute, $thiscommentweekdaynumber, $thiscommentmonth, $thiscommentday, $thiscommentyearyear, $thiscommenthour, $thiscommentminute, $thiscommentsecond, $thiscommentampm, $thiscommenttext) = split (/\|/, $entrylines[$editme]); # $thiscommentmonthmonth = sprintf ("%2d", $thiscommentmonth); # $thiscommentdayday = sprintf ("%2d", $thiscommentday); # $thiscommenthourhour = sprintf ("%2d", $thiscommenthour); # $thiscommentminuteminute = sprintf ("%2d", $thiscommentminute); # $thiscommentsecondsecond = sprintf ("%2d", $thiscommentsecond); # $thiscommentmonthmonth =~ tr/ /0/; # $thiscommentdayday =~ tr/ /0/; # $thiscommenthourhour =~ tr/ /0/; # $thiscommentminuteminute =~ tr/ /0/; # $thiscommentsecondsecond =~ tr/ /0/; $thiscommentmonthmonth = Gm_Utils::toTwoDigit( $thiscommentmonth ); $thiscommentdayday = Gm_Utils::toTwoDigit( $thiscommentday ); $thiscommenthourhour = Gm_Utils::toTwoDigit( $thiscommenthour ); $thiscommentminuteminute = Gm_Utils::toTwoDigit( $thiscommentminute ); $thiscommentsecondsecond = Gm_Utils::toTwoDigit( $thiscommentsecond ); $thiscommenttext = Gm_Utils::toWebSafe($thiscommenttext); if ($statusnote eq Gm_Constants::EMPTY) { $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>); } print<<GMEDITCOMMENT; $gmheadtag $gmframetop $statusnote <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="revisedentryauthor" VALUE="$IN{'revisedentryauthor'}"> <INPUT TYPE=HIDDEN NAME="revisedentrynumber" VALUE="$IN{'revisedentrynumber'}"> <INPUT TYPE=HIDDEN NAME="revisedentrysubject" VALUE="$IN{'revisedentrysubject'}"> <INPUT TYPE=HIDDEN NAME="entryselectionlist" VALUE="$IN{'revisedentrynumber'}"> <INPUT TYPE=HIDDEN NAME="revisedentrycommentselection" VALUE="$IN{'revisedentrycommentselection'}"> <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> <P> <B>Comment Text</B> <BR> </FONT><TEXTAREA NAME="revisedentrycommenttext" COLS=86 ROWS=15 WRAP=VIRTUAL STYLE="width: 720">$thiscommenttext</TEXTAREA>$gmfonttag <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Save Changes To This Comment"> <INPUT TYPE=RESET CLASS="button" STYLE="background: #FFD0D0" VALUE="Undo Changes Since Last Save"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Entry Editing"> <P> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0"> </FORM> <P> $gmframebottom </BODY> </HTML> GMEDITCOMMENT exit; } # -------------------- # save comment changes # -------------------- sub gm_savecommentchanges { &gm_validate; if ($gmentryeditaccess eq Gm_Constants::NO) { gm_writetocplog("$IN{'authorname'} attempted to edit comment #$IN{'revisedentrycommentselection'} in entry #$IN{'revisedentrynumber'} ($IN{'revisedentrysubject'}) without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit comments.</FONT></B><P>); &gm_frontpage; } if (($IN{'authorname'} ne $IN{'revisedentryauthor'}) && ($gmentryeditaccess eq "mineonly")) { gm_writetocplog("$IN{'authorname'} attempted to edit comment #$IN{'revisedentrycommentselection'} in entry #$IN{'entryselectionlist'} (by $IN{'revisedentryauthor'}) without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to edit comments in entries you didn't create.</FONT></B><P>); &gm_editentryselection; } $IN{'entryselectionlist'} = $IN{'revisedentrynumber'}; $IN{'revisedentrycommentauthor'} = Gm_Utils::toConfigSafe($IN{'revisedentrycommentauthor'}); $IN{'revisedentrycommentauthoremail'} = Gm_Utils::toConfigSafe($IN{'revisedentrycommentauthoremail'}); $IN{'revisedentrycommentauthorhomepage'} = Gm_Utils::toConfigSafe($IN{'revisedentrycommentauthorhomepage'}); $IN{'revisedentrycommenttext'} = Gm_Utils::toStoreSafe($IN{'revisedentrycommenttext'}); if (($IN{'revisedentrycommentauthor'} eq Gm_Constants::EMPTY) || ($IN{'revisedentrycommenttext'} eq Gm_Constants::EMPTY)) { $statusnote = qq(<B><FONT COLOR="#FF0000">You left either the comment author or text blank. Please try again.</FONT></B><P>); &gm_editselectedcomment; } # $thisentrynumberpadded = sprintf ("%8d", $IN{'revisedentrynumber'}); # $thisentrynumberpadded =~ tr/ /0/; $thisentrynumberpadded = Gm_Utils::toEntryPadded( $IN{'revisedentrynumber'} ); open (FUNNYFEET, "<$EntriesPath/$thisentrynumberpadded.cgi") || &gm_dangermouse("Can't read $EntriesPath/$thisentrynumberpadded.cgi. Please make sure that your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); @entrylines = <FUNNYFEET>; close (FUNNYFEET); $editme = $IN{'revisedentrycommentselection'} + 3; chomp ($entrylines[$editme]); ($thiscommentauthor, $thiscommentauthorip, $thiscommentauthoremailabsolute, $thiscommentauthorhomepageabsolute, $thiscommentweekdaynumber, $thiscommentmonth, $thiscommentday, $thiscommentyearyear, $thiscommenthour, $thiscommentminute, $thiscommentsecond, $thiscommentampm, $thiscommenttext) = split (/\|/, $entrylines[$editme]); $entrylines[$editme] = "$IN{'revisedentrycommentauthor'}|$thiscommentauthorip|$IN{'revisedentrycommentauthoremail'}|$IN{'revisedentrycommentauthorhomepage'}|$thiscommentweekdaynumber|$thiscommentmonth|$thiscommentday|$thiscommentyearyear|$thiscommenthour|$thiscommentminute|$thiscommentsecond|$thiscommentampm|$IN{'revisedentrycommenttext'}"; $gmcounter = 0; open (FUNNYFEET, ">$EntriesPath/$thisentrynumberpadded.cgi") || &gm_dangermouse("Can't write to $EntriesPath/$thisentrynumberpadded.cgi. Please make sure that your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); foreach (@entrylines) { chomp ($entrylines[$gmcounter]); print FUNNYFEET "$entrylines[$gmcounter]\n"; $gmcounter++; } close (FUNNYFEET); gm_writetocplog("$IN{'authorname'} edited comment #$IN{'revisedentrycommentselection'} in entry #$IN{'revisedentrynumber'} ($IN{'revisedentrysubject'})"); $statusnote = qq(<B><FONT COLOR="#0000FF">Comment #$IN{'revisedentrycommentselection'} has been edited. Be sure to rebuild your files<BR>to make the changes visible on that entry's page.</FONT></B><P>); &gm_editthisentry; } # ------------------------ # save config file for D&R # ------------------------ sub gm_saveconfigurationdr { &gm_validate; if ($gmconfigurationaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to save changes to the config file without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to change the config file.</FONT></B><P>); &gm_frontpage; } chomp ($IN{'editedcensorlist'}); $IN{'editedcensorlist'} = Gm_Utils::toStoreSafe($IN{'editedcensorlist'}); chomp ($IN{'editedotherfilelist'}); $IN{'editedotherfilelist'} = Gm_Utils::toStoreSafe($IN{'editedotherfilelist'}); $IN{'editedlogpath'} = Gm_Utils::toConfigSafe($IN{'editedlogpath'}); $IN{'editedentriespath'} = Gm_Utils::toConfigSafe($IN{'editedentriespath'}); $IN{'editedlogwebpath'} = Gm_Utils::toConfigSafe($IN{'editedlogwebpath'}); $IN{'editedentrieswebpath'} = Gm_Utils::toConfigSafe($IN{'editedentrieswebpath'}); $IN{'editednotifyemail'} = Gm_Utils::toConfigSafe($IN{'editednotifyemail'}); $IN{'editedindexfilename'} = Gm_Utils::toConfigSafe($IN{'editedindexfilename'}); $IN{'editedentrysuffix'} = Gm_Utils::toConfigSafe($IN{'editedentrysuffix'}); $IN{'editedindexdays'} = Gm_Utils::toConfigSafe($IN{'editedindexdays'}); $IN{'editedoffsettime'} = Gm_Utils::toConfigSafe($IN{'editedoffsettime'}); $IN{'editedtimezone'} = Gm_Utils::toConfigSafe($IN{'editedtimezone'}); $IN{'editedmailprog'} = Gm_Utils::toConfigSafe($IN{'editedmailprog'}); $IN{'editedcgilocalpath'} = Gm_Utils::toConfigSafe($IN{'editedcgilocalpath'}); $IN{'editedcgiwebpath'} = Gm_Utils::toConfigSafe($IN{'editedcgiwebpath'}); $IN{'editedemoticonspath'} = Gm_Utils::toConfigSafe($IN{'editedemoticonspath'}); $IN{'editedentrylistcountnumber'} = Gm_Utils::toConfigSafe($IN{'editedentrylistcountnumber'}); $IN{'editedlogarchivesuffix'} = Gm_Utils::toConfigSafe($IN{'editedlogarchivesuffix'}); $IN{'editedcensorlist'} =~ s/^\s+//; $IN{'editedcensorlist'} =~ s/\s+$//; $IN{'editedotherfilelist'} =~ s/^\s+//; $IN{'editedotherfilelist'} =~ s/^\s+//; $IN{'editedentrysuffix'} =~ s/\.//g; $IN{'editednotifyemail'} =~ s/ //g; $IN{'editedlogarchivesuffix'} =~ s/\.//g; if (($IN{'editedlogpath'} eq Gm_Constants::EMPTY) || ($IN{'editedentriespath'} eq Gm_Constants::EMPTY) || ($IN{'editedlogwebpath'} eq Gm_Constants::EMPTY) || ($IN{'editedentrieswebpath'} eq Gm_Constants::EMPTY) || ($IN{'editedindexfilename'} eq Gm_Constants::EMPTY) || ($IN{'editedentrysuffix'} eq Gm_Constants::EMPTY) || ($IN{'editedindexdays'} eq Gm_Constants::EMPTY) || ($IN{'editedoffsettime'} eq Gm_Constants::EMPTY) || ($IN{'editedtimezone'} eq Gm_Constants::EMPTY) || ($IN{'editedcgilocalpath'} eq Gm_Constants::EMPTY) || ($IN{'editedcgiwebpath'} eq Gm_Constants::EMPTY) || ($IN{'editedentrylistcountnumber'} eq Gm_Constants::EMPTY) || ($IN{'editedlogarchivesuffix'} eq Gm_Constants::EMPTY)) { $statusnote = qq(<B><FONT COLOR="#FF0000">You left one or more of the required fields blank. Please try again.</FONT></B><P>); &gm_configuration; } if ($IN{'editedindexdays'} =~ /\D/) { $statusnote = qq(<B><FONT COLOR="#FF0000">"Days to keep on main index" must be a number.</FONT></B><P>); &gm_configuration; } if ($IN{'editedoffsettime'} =~ /\D/) { unless ($IN{'editedoffsettime'} =~ /-/) { $statusnote = qq(<B><FONT COLOR="#FF0000">"Server Offset Time" must be a number.</FONT></B><P>); &gm_configuration; } } if ($IN{'editeduploadfilesizelimit'} eq Gm_Constants::EMPTY) { $IN{'editeduploadfilesizelimit'} = 0; } if ($IN{'editeduploadfilesizelimit'} =~ /\D/) { $statusnote = qq(<B><FONT COLOR="#FF0000">"Maximum Filesize Allowed" must be a number.</FONT></B><P>); &gm_configuration; } if (($IN{'editednotifyemail'} ne Gm_Constants::EMPTY) && ($IN{'editedmailprog'} eq Gm_Constants::EMPTY)) { $statusnote = qq(<B><FONT COLOR="#FF0000">You must give your server's e-mail program location<BR>if you're going to have e-mail notification enabled.</FONT></B><P>); &gm_configuration; } if (($IN{'editednotifyemail'} eq Gm_Constants::EMPTY) && ($IN{'editednotifyforstatus'} ne Gm_Constants::NEITHER)) { $statusnote = qq(<B><FONT COLOR="#FF0000">You must give an e-mail address to receive e-mail notifications.</FONT></B><P>); &gm_configuration; } if ($IN{'editedentrylistcountnumber'} =~ /\D/) { $statusnote = qq(<B><FONT COLOR="#FF0000">"Log entry list variable number" must be a number.</FONT></B><P>); &gm_configuration; } $IN{'editeduploadfilesallowed'} =~ s/;/SEMICOLON/g; if ($IN{'editeduploadfilesallowed'} =~ /\W/) { $statusnote = qq(<B><FONT COLOR="#FF0000">"Allowed File Types" must only contain alphanumeric characters (besides semicolons).</FONT></B><P>); &gm_configuration; } $IN{'editeduploadfilesallowed'} =~ s/SEMICOLON/;/g; if ($IN{'editedindexdays'} < 1) { $statusnote = qq(<B><FONT COLOR="#FF0000">"Days to keep on main index" must be set to at least one!</FONT></B><P>); &gm_configuration; } if (substr($IN{'editedlogpath'}, -1) eq "/") { chop ($IN{'editedlogpath'}) }; if (substr($IN{'editedentriespath'}, -1) eq "/") { chop ($IN{'editedentriespath'}) }; if (substr($IN{'editedcgilocalpath'}, -1) eq "/") { chop ($IN{'editedcgilocalpath'}) }; if (substr($IN{'editedlogwebpath'}, -1) eq "/") { chop ($IN{'editedlogwebpath'}) }; if (substr($IN{'editedentrieswebpath'}, -1) eq "/") { chop ($IN{'editedentrieswebpath'}) }; if (substr($IN{'editedcgiwebpath'}, -1) eq "/") { chop ($IN{'editedcgiwebpath'}) }; if (substr($IN{'editedemoticonspath'}, -1) eq "/") { chop ($IN{'editedemoticonspath'}) }; my %confs = (); $confs{'gmlogpath'} = $IN{'editedlogpath'}; $confs{'gmentriespath'} = $IN{'editedentriespath'}; $confs{'gmlogwebpath'} = $IN{'editedlogwebpath'}; $confs{'gmentrieswebpath'} = $IN{'editedentrieswebpath'}; $confs{'gmnotifyemail'} = $IN{'editednotifyemail'}; $confs{'gmindexfilename'} = $IN{'editedindexfilename'}; $confs{'gmentrysuffix'} = $IN{'editedentrysuffix'}; $confs{'gmindexdays'} = $IN{'editedindexdays'}; $confs{'gmserveroffset'} = $IN{'editedoffsettime'}; $confs{'gmtimezone'} = $IN{'editedtimezone'}; $confs{'gmkeeplog'} = $IN{'editedkeeplog'}; $confs{'gmposttoarchives'} = $IN{'editedposttoarchives'}; $confs{'gmallowkarmadefault'} = $IN{'editedallowkarmadefault'}; $confs{'gmallowcommentsdefault'} = $IN{'editedallowcommentsdefault'}; $confs{'gmcommentsorder'} = $IN{'editedcommentsorder'}; $confs{'gmgenerateentrypages'} = $IN{'editedgenerateentrypages'}; $confs{'gmallowhtmlincomments'} = $IN{'editedallowhtmlincomments'}; $confs{'gmlogkarmaandcomments'} = $IN{'editedlogkarmaandcomments'}; $confs{'gmmailprog'} = $IN{'editedmailprog'}; $confs{'gmnotifyforstatus'} = $IN{'editednotifyforstatus'}; $confs{'gmautolinkurls'} = $IN{'editedautolinkurls'}; $confs{'gmstriplinesfromcomments'} = $IN{'editedstriplinesfromcomments'}; $confs{'gmallowmultiplekarmavotes'} = $IN{'editedallowmultiplekarmavotes'}; $confs{'gmversionsetup'} = $gmversion; $confs{'gmversion'} = Gm_Constants::GM_VERSION; $confs{'gmcgilocalpath'} = $IN{'editedcgilocalpath'}; $confs{'gmcgiwebpath'} = $IN{'editedcgiwebpath'}; $confs{'gmconcurrentmainandarchives'} = $IN{'editedconcurrentmainandarchives'}; $confs{'gmkeeparchivemasterindex'} = $IN{'editedkeeparchivemasterindex'}; $confs{'gmentrylistsortorder'} = $IN{'editedentrylistsortorder'}; $confs{'gmallowkarmaorcomments'} = $IN{'editedallowkarmaorcomments'}; $confs{'gmentrylistcountnumber'} = $IN{'editedentrylistcountnumber'}; $confs{'gmcookiesallowed'} = $IN{'editedcookiesallowed'}; $confs{'gmlogarchivesuffix'} = $IN{'editedlogarchivesuffix'}; $confs{'gmcensorlist'} = $IN{'editedcensorlist'}; $confs{'gmcensorenabled'} = $IN{'editedcensorenabled'}; $confs{'gmkeepmonthlyarchives'} = $IN{'editedkeepmonthlyarchives'}; $confs{'gmdefaultentrylistview'} = $IN{'editeddefaultentrylistview'}; $confs{'gmlinktocalendarentries'} = $IN{'editedlinktocalendarentries'}; $confs{'gmautomaticrebuilddefault'} = $IN{'editedautomaticrebuilddefault'}; $confs{'gmcommententrylistonlyifokay'} = $IN{'editedcommententrylistonlyifokay'}; $confs{'gmotherfilelist'} = $IN{'editedotherfilelist'}; $confs{'gmotherfilelistentryrebuild'} = $IN{'editedotherfilelistentryrebuild'}; $confs{'gmarchiveformat'} = $IN{'editedarchiveformat'}; $confs{'gminlineformatting'} = $IN{'editedinlineformatting'}; $confs{'gmuploadfilesallowed'} = $IN{'editeduploadfilesallowed'}; $confs{'gmuploadfilesizelimit'} = $IN{'editeduploadfilesizelimit'}; $confs{'gmemoticonspath'} = $IN{'editedemoticonspath'}; $confs{'gmkeepphphacklog'} = $IN{'editedkeepphphacklog'}; $confs{'gmmailhacknotice'} = $IN{'editedmailhacknotice'}; $confs{'gmemoticonsallowed'} = $IN{'editedemoticonsallowed'}; $confs{'gmprotectauthorname'} = $IN{'editedprotectauthorname'}; $confs{'gmcommentlinklimit'} = $IN{'editedcommentlinklimit'}; $confs{'gmcommentlinklimitnum'} = $IN{'editedcommentlinklimitnum'}; $confs{'gmcommentforcepreview'} = $IN{'editedcommentforcepreview'}; $confs{'gmcommentverify'} = $IN{'editedcommentverify'}; $confs{'gmcommentverifyphrase'} = $IN{'editedcommentverifyphrase'}; Gm_Storage::setConfigs( configs=>\%confs, errHandler=>\&Gm_Web::displayAdminErrorExit ); if (($keeplog eq Gm_Constants::NO) && ($IN{'editedkeeplog'} eq Gm_Constants::YES)) { my ($gmdate) = Gm_Utils::getStdDate( $serveroffset ); gm_writetocplog( "$IN{'authorname'} let this log get its groove back\n". "<FONT SIZE=1>[$gmdate] [$authorIP]</FONT> $IN{'authorname'} edited the config file"); } if ($IN{'editedkeeplog'} eq Gm_Constants::NO) { my ($gmdate) = Gm_Utils::getStdDate( $serveroffset ); gm_writetocplog("$IN{'authorname'} edited the config file for D&R\n<FONT SIZE=1>[$gmdate] [$authorIP]</FONT> $IN{'authorname'} decided to stop this log from getting down with its bad-ass self"); } else { gm_writetocplog("$IN{'authorname'} edited the config file for D&R"); } } # ---------------------------- # diagnostics & repair - check # ---------------------------- sub gm_diagnosticscheck { &gm_saveconfigurationdr; &gm_validate; if ($gmconfigurationaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to perform diagnostics & repair without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to perform diagnostics & repair.</FONT></B><P>); &gm_frontpage; } print<<GMDIAGNOSTICSCHECK; $gmheadtag $gmframetop <B>Diagnostics & Repair</B> <P> This will check file access and permissions for your Greymatter installation, correctly CHMOD all files (if it can; you will need to do this manually if Greymatter can't do this automatically), repair any missing entries or corrupt counter files, and rebuild your entry list. If you are installing Greymatter for the first time, if you've changed your path settings and want to verify them, or if you believe an important configuration file might be corrupt, click below to run diagnostics and rebuilding operations on your Greymatter setup. Running this will not alter your files. <B>Note:</B> This will verify your Local paths, but it cannot verify your Website paths.<P>Please wait for several moments after clicking (or even minutes if you have a large number of entries).<BR><B>DO NOT interrupt this procedure once started!</B><P><FORM ACTION="gm.cgi" METHOD=POST><INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}"><INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}"><TABLE BORDER=0 cellpadding=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> $gmframebottom </BODY> </HTML> GMDIAGNOSTICSCHECK exit; } # ------------------------------ # diagnostics & repair - perform # ------------------------------ ### THIS SEEMS TO DUPLICATE PART OF GM_LOGIN SUB sub gm_diagnosticsperform { &gm_validate; if ($gmconfigurationaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to perform diagnostics & repair without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to perform diagnostics & repair.</FONT></B><P>); &gm_frontpage; } $docreport = "<UL>\n"; # NOTE: THIS IS NO LONGER VALIDATING THE CGI PATH ( DO WE NEED THAT VAR?) my $worked = Gm_Storage::validateResources( errHandler=>\&Gm_Web::displayAdminErrorExit, chmod=>'1' ); if( $worked ){ $docreport .= "<LI> All config files are readable/writeable and are CHMODed correctly\n"; $docreport .= "<LI> The local CGI path is correctly configured and all essential files are there\n"; } else { $docreport .= "<LI> Config files are <b>NOT</b> readable/writeable; errors were encountered\n"; $docreport .= "<LI> The local CGI path is <b>NOT</b> correctly configured; errors were encountered\n"; } open (NOWHEREMAN, ">$EntriesPath/gm-testfile.txt") || &gm_dangermouse("Can't create files in $EntriesPath. Make sure the entries/archives path is correctly configured and that this directory is CHMODed to 777."); print NOWHEREMAN "test"; close (NOWHEREMAN); unlink ("$EntriesPath/gm-testfile.txt") || &gm_dangermouse("Can't delete the gm-testfile.txt file created in $EntriesPath. Your server may not support this operation."); $docreport .= "<LI> The entries/archives path is readable/writeable and is CHMODed correctly\n"; chmod (0666, "$EntriesPath/$indexfilename"); unless (!(open(NOWHERETEMP,"<$EntriesPath/$indexfilename"))) { open (NOWHEREMAN, "<$EntriesPath/$indexfilename") || &gm_dangermouse("Can't read $EntriesPath/$indexfilename. Make sure the entries/archives path is correctly configured and CHMODed to 777, the index filename is correctly specified under Configuration, and that this file is CHMODed to 666."); @nowhereland = <NOWHEREMAN>; close (NOWHEREMAN); open (NOWHEREMAN, ">$EntriesPath/$indexfilename") || &gm_dangermouse("Can't write to $EntriesPath/$indexfilename. Make sure the entries/archives path is correctly configured and CHMODed to 777, the index filename is correctly specified under Configuration, and that this file is CHMODed to 666."); print NOWHEREMAN @nowhereland; close (NOWHEREMAN); $docreport .= "<LI> The archive index file is readable/writeable and is CHMODed correctly\n"; } close(NOWHERETEMP); &gm_readcounter; $oldentrynumbercount = $newentrynumber; $countentriesfromhere = 5000; $foundtopentry = Gm_Constants::NO; # 00000000.cgi can't be read fix: linear 9/3/2003 # merged into 1.3 do { # $countentriesfromherepadded = sprintf ("%8d", $countentriesfromhere); # $countentriesfromherepadded =~ tr/ /0/; $countentriesfromherepadded = Gm_Utils::toEntryPadded( $countentriesfromhere ); if ($countentriesfromhere eq "0") { $newentrynumber = "0"; $foundtopentry = Gm_Constants::YES; } if (-e "$EntriesPath/$countentriesfromherepadded.cgi") { $newentrynumber = $countentriesfromhere; $foundtopentry = Gm_Constants::YES; } $countentriesfromhere--; } until $foundtopentry eq Gm_Constants::YES; # merged 9/11/2003 &gm_writecounter; if ($oldentrynumbercount ne $newentrynumber) { $docreport .= "<LI> The counter was successfully repaired\n"; &gm_generatemainindex; } if ($newentrynumber ne "0") { $checkentrycounter = $newentrynumber; $docreportentryappend = Gm_Constants::NO; do { # $checkentrycounterpadded = sprintf ("%8d", $checkentrycounter); # $checkentrycounterpadded =~ tr/ /0/; $checkentrycounterpadded = Gm_Utils::toEntryPadded( $checkentrycounter ); $makedummyentry = Gm_Constants::NO; if (!(open(ENTRYCHECK,"<$EntriesPath/$checkentrycounterpadded.cgi"))) { $makedummyentry = Gm_Constants::YES; } close(ENTRYCHECK); if (($makedummyentry eq Gm_Constants::YES) && ($checkentrycounter ne "0")) { my ($basedate, $wday, $mon, $mday, $JSYear, $hour, $min, $sec, $AMPM ) = Gm_Utils::getStdDate( $serveroffset ); my $montwo = Gm_Utils::toTwoDigit( $mon ); my $mdaytwo = Gm_Utils::toTwoDigit( $mday ); my $hourtwo = Gm_Utils::toTwoDigit( $hour ); my $mintwo = Gm_Utils::toTwoDigit( $min ); $thisnewwday = $wday; $thisnewmon = $mon; $thisnewmday = $mday; $thisnewyear = $JSYear; $thisnewhour = $hour; $thisnewmin = $min; $thisnewsec = $sec; $thisnewampm = $AMPM; if ($checkentrycounter ne $newentrynumber) { $nextentrynumber = $thisentrynumber + 1; # $nextentrynumberpadded = sprintf ("%8d", $nextentrynumber); # $nextentrynumberpadded =~ tr/ /0/; $nextentrynumberpadded = Gm_Utils::toEntryPadded( $nextentrynumber ); 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."); @nextentrylines = <FUNNYFEET>; close (FUNNYFEET); ($nextentrynumber, $nextentryauthor, $nextentrysubject, $nextentryweekdaynumber, $nextentrymonth, $nextentryday, $nextentryyearyear, $nextentryhour, $nextentryminute, $nextentrysecond, $nextentryampm, $nextentrypositivekarma, $nextentrynegativekarma, $nextentrycommentsnumber, $nextentryallowkarma, $nextentryallowcomments, $nextentryopenstatus, $nextentrymusic, $nextentrymood, $nextentryemoticonsallowed) = split (/\|/, $nextentrylines[0]); $thisnewwday = $nextentryweekdaynumber; $thisnewmon = $nextentrymonth; $thisnewmday = $nextentryday; $thisnewyear = $nextentryyearyear; $thisnewhour = $nextentryhour; $thisnewmin = $nextentryminute; $thisnewsec = $nextentrysecond; $thisnewampm = $nextentryampm; } elsif ($checkentrycounter ne "1") { $previousentrynumber = $thisentrynumber - 1; # $previousentrynumberpadded = sprintf ("%8d", $previousentrynumber); # $previousentrynumberpadded =~ tr/ /0/; $previousentrynumberpadded = Gm_Utils::toEntryPadded( $previousentrynumber ); 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."); @previousentrylines = <FUNNYFEET>; close (FUNNYFEET); ($previousentrynumber, $previousentryauthor, $previousentrysubject, $previousentryweekdaynumber, $previousentrymonth, $previousentryday, $previousentryyearyear, $previousentryhour, $previousentryminute, $previousentrysecond, $previousentryampm, $previousentrypositivekarma, $previousentrynegativekarma, $previousentrycommentsnumber, $previousentryallowkarma, $previousentryallowcomments, $previousentryopenstatus, $previousentrymusic, $previousentrymood, $previousentryemoticonsallowed) = split (/\|/, $previousentrylines[0]); $thisnewwday = $previousentryweekdaynumber; $thisnewmon = $previousentrymonth; $thisnewmday = $previousentryday; $thisnewyear = $previousentryyearyear; $thisnewhour = $previousentryhour; $thisnewmin = $previousentryminute; $thisnewsec = $previousentrysecond; $thisnewampm = $previousentryampm; } open (FUNNYFEET, ">$EntriesPath/$checkentrycounterpadded.cgi") || &gm_dangermouse("Can't write to $EntriesPath/$checkentrycounterpadded.cgi. Please make sure that your entries/archives directory is correctly configured and is CHMODed to 777."); print FUNNYFEET "$checkentrycounter|Greymatter|*Repaired*|$thisnewwday|$thisnewmon|$thisnewmday|$thisnewyear|$thisnewhour|$thisnewmin|$thisnewsec|$thisnewampm|0|0|0|no|no|closed\n"; print FUNNYFEET "0.0.0.0|I\n"; print FUNNYFEET "This entry was detected by Greymatter during Diagnostics & Repair as being missing or corrupt. This is a dummy entry only. DO NOT reopen this entry.\n"; print FUNNYFEET "\n"; close (FUNNYFEET); $docreportentryappend = Gm_Constants::YES; $docreport .= "<LI> Entry #$checkentrycounter was detected as being missing or corrupt and was successfully replaced (it is recommended that you go to the Rebuild Files screen now and click \"Rebuild Everything\")\n"; } chmod (0666, "$EntriesPath/$checkentrycounterpadded.cgi"); $checkentrycounter--; } until $checkentrycounter eq "0"; $docreport .= "<LI> All entry files are working correctly\n"; } if ($newentrynumber ne "0") { $checkentrycounter = $newentrynumber; my %rebuiltentrylist = (); do { # $checkentrycounterpadded = sprintf ("%8d", $checkentrycounter); # $checkentrycounterpadded =~ tr/ /0/; $checkentrycounterpadded = Gm_Utils::toEntryPadded( $checkentrycounter ); &gm_getentryvariables($checkentrycounter); $checkentryopenstatus = 'O'; $checkentrymorestatus = 'N'; if ($thisentryopenstatus eq Gm_Constants::CLOSED) { $checkentryopenstatus = "C"; } if ($thisentrymorebody ne Gm_Constants::EMPTY) { $checkentrymorestatus = 'Y'; } $rebuiltentrylist{$thisentrynumber} = { id=>$thisentrynumber, author=>$thisentryauthor, subject=>$thisentrysubject, created=>"$thisentrymonthmonth\/$thisentrydayday\/$thisentryyear", createt=>"$thisentryhourhour\:$thisentryminuteminute $thisentryampm", status=>$checkentryopenstatus, extended=>$checkentrymorestatus, music=>$thisentrymusic, mood=>$thisentrymood, emoticons=>$thisentryemoticonsallowed }; $checkentrycounter--; } until $checkentrycounter eq "0"; Gm_Storage::setEntrylist( list=>\%rebuiltentrylist, errHandler=>\&Gm_Web::displayAdminErrorExit ); $docreport .= "<LI> The entry list was successfully rebuilt\n" } open (NOWHEREMAN, "<$LogPath/$indexfilename") || &gm_dangermouse("Can't read $LogPath/$indexfilename. Make sure the log path is correctly configured, the index filename is correctly specified under Configuration, and that this file is CHMODed to 666."); @nowhereland = <NOWHEREMAN>; close (NOWHEREMAN); chmod (0666, "$LogPath/$indexfilename"); open (NOWHEREMAN, ">$LogPath/$indexfilename") || &gm_dangermouse("Can't write to $LogPath/$indexfilename. Make sure the log path is correctly configured, the index filename is correctly specified under Configuration, and that this file is CHMODed to 666."); print NOWHEREMAN @nowhereland; close (NOWHEREMAN); $docreport .= "<LI> The main index file is readable/writeable and is CHMODed correctly\n"; if ($otherfilelist ne Gm_Constants::EMPTY) { @connectedfilelist = split ('\\n', $otherfilelist); foreach $usethisfilename (@connectedfilelist) { open (NOWHEREMAN, "<$usethisfilename") || &gm_dangermouse("Can't open $usethisfilename. Please make sure that this file exists and is CHMODed to 666, or else remove it from your list of connected files in configuration."); @connectedfilelines = <NOWHEREMAN>; close (NOWHEREMAN); chmod (0666, "$usethisfilename"); open (NOWHEREMAN, ">$usethisfilename") || &gm_dangermouse("Can't write to $usethisfilename. Please make sure that this file exists and is CHMODed to 666, or else remove it from your list of connected files in configuration."); print NOWHEREMAN @connectedfilelines; close (NOWHEREMAN); } $docreport .= "<LI> All connected files are readable/writeable and are CHMODed correctly\n"; } gm_writetocplog( "$IN{'authorname'} successfully performed diagnostics & repair."); print<<GMDIAGNOSTICSFINISHED; $gmheadtag $gmframetop <FONT COLOR="#0000FF"><B>Diagnostics & Repair Complete</B></FONT> <P> All operations were completed successfully. Greymatter successfully checked and/or performed the following: <P> <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD ALIGN=LEFT>$gmfonttag$docreport</FONT></TD></TR></TABLE> <P> <FORM ACTION="gm.cgi" METHOD=POST><INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}"><INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}"><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Configuration"> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0"></FORM></P><P ALIGN=CENTER> $gmframebottom </BODY> </HTML> GMDIAGNOSTICSFINISHED exit; } # ---------------- # add bookmarklets # ---------------- sub gm_addbookmarklets { &gm_validate; if ($gmbookmarkletaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to add bookmarklets without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to use bookmarklets.</FONT></B><P>); &gm_frontpage; } &gm_readcounter; if ($newentrynumber eq "0") { _checkIfDiagRun('<B><FONT COLOR="#FF0000">Please run "Diagnostics & Repair" '. 'in the Configuration screen before adding bookmarklets.</FONT></B><P>'); } if (($IN{'authorname'} eq "Alice") && ($IN{'authorpassword'} eq "wonderland")) { $statusnote = qq(<B><FONT COLOR="#FF0000">You can't add bookmarklets under the default account.<BR>Create a new author account for yourself first.</FONT></B><P>); &gm_frontpage; } $gmbookmarkletline = "@=\"javascript:doc=external.menuArguments.document;lt=escape(doc.selection.createRange().text);loglink=escape(doc.location.href);loglinktitle=escape(doc.title);wingm=window.open('"; $gmbookmarkletline .= $cgiwebpath; $gmbookmarkletline .= "/gm.cgi?thomas=gmbmpost&authorname="; $gmbookmarkletline .= $IN{'authorname'}; $gmbookmarkletline .= "&authorpassword="; $gmbookmarkletline .= $IN{'authorpassword'}; $gmbookmarkletline .= "&logtext='+lt+'&loglink='+loglink+'&loglinktitle='+loglinktitle,'gmwindow','scrollbars=yes,width=750,height=460,left=75,top=75,status=yes,resizable=yes');wingm.focus();\""; $usethisauthorname = int(rand 999999) + 1; open (FUNNYFEET, ">$EntriesPath/gmrightclick-$usethisauthorname.reg") || &gm_dangermouse("Can't write to $EntriesPath/gmrightclick.reg. Please make sure that your entries/archives directory is correctly configured and is CHMODed to 777, or try running Diagnostics & Repair in the Configuration screen."); print FUNNYFEET "REGEDIT4\n"; print FUNNYFEET "[HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\MenuExt\\Post To &Greymatter]\n"; print FUNNYFEET "$gmbookmarkletline\n"; print FUNNYFEET "\"contexts\"=hex:31"; close (FUNNYFEET); if ($statusnote eq Gm_Constants::EMPTY) { $statusnote = qq(<B><FONT COLOR="#000000">Add Bookmarklets (Internet Explorer 5+ Only)</FONT></B><P>); } &gm_readconfig; gm_writetocplog("$IN{'authorname'} added a bookmarklet"); print<<GMADDBOOKMARKLETS; $gmheadtag $gmframetop $statusnote <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript"> <!-- function installrightclickposting() { if (confirm("This will update your Windows registry. Are you sure?")) location.href="$EntriesWebPath/gmrightclick-$usethisauthorname.reg" } --> </SCRIPT> <P ALIGN=JUSTIFY> Installing bookmarklets makes for the quickest and most convenient way to "blog" new items, allowing you to post new entries to Greymatter with one mouse-click while surfing anywhere on the web. After installing a bookmarklet, clicking the new "Post To Greymatter" menu or toolbar button in your browser will load Greymatter in a pop-up window containing a link to the website you're currently visiting all ready to go in your new entry, plus any text from the website that you may have highlighted. (These bookmarklets are currently only verified to work on Internet Explorer 5 or higher. Also, since bookmarklets contain your Greymatter name and password, you may wish to be careful about installing these if you share your computer with others.) </P><P ALIGN=JUSTIFY> To install the standard bookmarklet, just drag the following link to your browser's menu or toolbar: </P><P ALIGN=CENTER><CENTER> <B><A HREF="javascript:lt=document.selection.createRange().text;void(gmwindow=window.open('$cgiwebpath/gm.cgi?thomas=gmbmpost&authorname=$IN{'authorname'}&authorpassword=$IN{'authorpassword'}&logtext='+escape(lt)+'&loglink='+escape(location.href)+'&loglinktitle='+escape(document.title),'gmwindow','scrollbars=yes,width=750,height=460,left=75,top=75,resizable=yes,status=yes'));gmwindow.focus();">Post To Greymatter</A></B> </CENTER></P><P ALIGN=JUSTIFY> Even more conveniently, you can also install it to your right-click menu (IE Windows users only). To do this, click on the link below to update your Windows registry with the new menu option. After clicking OK, select "Open this file from its current location" to install. </P><P ALIGN=CENTER><CENTER> <B><A HREF="javascript:installrightclickposting()">Install Right-Click Menu Access</A></B> </CENTER></P><P ALIGN=JUSTIFY> Finally, click Clear And Exit, and shut down Internet Explorer; you should see the new option in your right-click menu once you restart IE. (Should you wish to uninstall this later, you'll need to edit your Windows registry. To do this, select "Run..." from the start menu, type in "regedit", expand the directories until you reach "\\HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\MenuExt", right click the "Post To &Greymatter" option, and click Delete. As always, be careful about editing the registry—you can mess up your computer if you do this wrong.) </P><P ALIGN=JUSTIFY> And that's that! You should now have the bookmarklets installed and working correctly, allowing one-click automatic logging to Greymatter from anywhere on the web. Enjoy. =) </P><P ALIGN=CENTER><CENTER> <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="usethisauthorname" VALUE="$usethisauthorname"> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Clear And Exit"> </FORM> </CENTER></P> $gmframebottom </BODY> </HTML> GMADDBOOKMARKLETS exit; } # ------------ # upload files # ------------ sub gm_uploadfiles { &gm_validate; if ($gmuploadaccess ne Gm_Constants::YES) { gm_writetocplog("$IN{'authorname'} attempted to upload files without authorization"); $statusnote = qq(<B><FONT COLOR="#FF0000">You don't have access to upload files.</FONT></B><P>); &gm_frontpage; } &gm_readcounter; if ($newentrynumber eq "0") { _checkIfDiagRun('<B><FONT COLOR="#FF0000">Please run "Diagnostics & Repair" '. 'in the Configuration screen before uploading files.</FONT></B><P>'); } if ($uploadfilesallowed ne Gm_Constants::EMPTY) { $howmanyfiletypes = 0; @uploadfiletypesallowed = split (/;/, $uploadfilesallowed); foreach $thisfiletype (@uploadfiletypesallowed) { $allowthesefiletypes .= ".$thisfiletype, "; } $allowthesefiletypes =~ s/, .(\w+), $/ and .$1/; $allowthesefiletypes =~ s/, $//; } if (($uploadfilesallowed ne Gm_Constants::EMPTY) && ($uploadfilesizelimit ne "0")) { $specialuploadtext = "Only $allowthesefiletypes files may currently be uploaded,<BR>and no file larger than $uploadfilesizelimit\k may be uploaded.<P>"; } elsif ($uploadfilesallowed ne Gm_Constants::EMPTY) { $specialuploadtext = "Only $allowthesefiletypes files may currently be uploaded.<P>"; } elsif ($uploadfilesizelimit ne "0") { $specialuploadtext = "No file larger than $uploadfilesizelimit\k may currently be uploaded.<P>"; } else { $specialuploadtext = Gm_Constants::EMPTY; } if ($statusnote eq Gm_Constants::EMPTY) { $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); } &gm_readconfig; $insertauthorname = $IN{'authorname'}; $insertauthorpassword = $IN{'authorpassword'}; print<<GMUPLOADFILES; $gmheadtag $gmframetop $statusnote <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript1.2"> <!--// document.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>'); //--> </SCRIPT> <FORM ACTION="gm.cgi" METHOD=POST> <INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}"> <INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}"> <INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" VALUE="Return To Main Menu" STYLE="background: #C0C0C0"> </FORM> $gmframebottom </BODY> </HTML> GMUPLOADFILES exit; } # ---------------- # version checking # ---------------- sub gm_versioncheck { if ($versionsetup ne $gmversion) { print<<GMVERSIONCHECKTOP; $gmheadtag $gmframetop GMVERSIONCHECKTOP ## TODO: REFACTOR THIS, IT MUST BE UPDATED WITH EVERY RELEASE, WAY TO FIX? if ($versionsetup eq 'one point zero') { 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>); } elsif ($versionsetup eq '1.1') { print qq(Greymatter has detected that you are upgrading from version 1.1. Some of your files will need to be updated now. After Greymatter is done updating, you might want to review the new configuration and template options; it's also <I>strongly recommended</I> that you "Rebuild Everything" right after it finishes updating. Finally, be sure to upload the new gm-upload.cgi with your other Greymatter CGI files and CHMOD it to 755, if you haven't already.<P><FORM ACTION="gm.cgi" METHOD=POST><INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}"><INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}"><INPUT TYPE=HIDDEN NAME="oldsetupversion" VALUE="$versionsetup"><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Update Now"></FORM><P>); } elsif ($versionsetup eq '1.2' || $versionsetup eq '1.21' || $versionsetup eq '1.21a' || $versionsetup eq '1.21b' || $versionsetup eq '1.21c' || $versionsetup eq '1.21d' || $versionsetup eq '1.21e' || $versionsetup eq '1.3' || $versionsetup eq '1.3a' || $versionsetup eq '1.3.1' || $versionsetup eq '1.6.1' || $versionsetup eq '1.7.1' ){ _printVersionMessage( $versionsetup, $gmversion ); } else { ## We might actually be dealing with old template format, lets read them again ... _old_gm_readconfig(); if ($versionsetup eq 'one point zero') { 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>); } elsif ($versionsetup eq '1.1') { print qq(Greymatter has detected that you are upgrading from version 1.1. Some of your files will need to be updated now. After Greymatter is done updating, you might want to review the new configuration and template options; it's also <I>strongly recommended</I> that you "Rebuild Everything" right after it finishes updating. Finally, be sure to upload the new gm-upload.cgi with your other Greymatter CGI files and CHMOD it to 755, if you haven't already.<P><FORM ACTION="gm.cgi" METHOD=POST><INPUT TYPE=HIDDEN NAME="authorname" VALUE="$IN{'authorname'}"><INPUT TYPE=HIDDEN NAME="authorpassword" VALUE="$IN{'authorpassword'}"><INPUT TYPE=HIDDEN NAME="oldsetupversion" VALUE="$versionsetup"><INPUT TYPE=SUBMIT CLASS="button" NAME="thomas" STYLE="background: #D0FFD0" VALUE="Update Now"></FORM><P>); } elsif ($versionsetup eq '1.2' || $versionsetup eq '1.21' || $versionsetup eq '1.21a' || $versionsetup eq '1.21b' || $versionsetup eq '1.21c' || $versionsetup eq '1.21d' || $versionsetup eq '1.21e' || $versionsetup eq '1.3' || $versionsetup eq '1.3a' || $versionsetup eq '1.3.1' ){ _printVersionMessage( $versionsetup, $gmversion ); } else { print qq(<B>ERROR:</B> Greymatter could not determine the version setup. Please make sure that Greymatter is installed correctly. Try reuploading the gm-config.cgi file that came with Greymatter and try logging in again; you'll need to reconfigure your Configuration settings.); } } print<<GMVERSIONCHECKBOTTOM; $gmframebottom </BODY> </HTML> GMVERSIONCHECKBOTTOM exit; } } sub _printVersionMessage { my ($versionsetup, $newversion) = @_; println('Greymatter has detected that you are upgrading from version '.$versionsetup.'.<br /> '. 'Version '.$newversion.' has several new features in 1.7.2 include updated author '. 'protection (loose and strict), Comment Phrase must be entered withen three '. 'minutes, security enhancements, and more.'. '<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>'); } ## Helper util to reduce copy and paste, should find a better home someday sub _checkIfDiagRun { my $msg = shift(); $cploglines = Gm_Storage::getCplog( errHandler=>\&Gm_Web::displayAdminErrorExit ); $cplogtext = join (" ", @$cploglines); unless ($cplogtext =~ /successfully performed diagnostics/) { $statusnote = $msg; &gm_frontpage; } } # ----------------- # version upgrading ## TODO MAKE THIS WORK MUCH MUCH BETTER, EACH VERSION CHANGE SHOULD BE ISOLATED IN VERSION BLOCK # ONCE VERSION BLOCK RUN, SET VERSION TO VERSION BLOCK VERSION? HOW MAKE CHANGES CUMULATIVE? # if( $version = '1.3.1' ){ # ... stuff .... # $version = '1.6.1'; # } # ----------------- sub gm_versionupgrading { ## Check if the config version is blank, this indicates a probably config file format change ## Use read old templates and read old configs and read old counters where approp. if ($IN{'oldsetupversion'} eq "one point zero") { open (FUNNYFEET, "<gm-entrylist.cgi") || &gm_dangermouse("Can't read the entrylist file. Please make sure that gm-entrylist.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files."); @tempnewentrylist = <FUNNYFEET>; close (FUNNYFEET); open (FUNNYFEETWO, ">gm-entrylist.cgi") || &gm_dangermouse("Can't write to the entrylist file. Please make sure that gm-entrylist.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files."); foreach $tempnewentrylistline (@tempnewentrylist) { chomp ($tempnewentrylistline); ($templistnumber, $templistauthorname, $templistsubject, $templistdate, $templisttime, $templistopenstatus) = split (/\|/, $tempnewentrylistline); $templistopenstatus = 'O'; if ($templistopenstatus eq Gm_Constants::CLOSED) { $templistopenstatus = "C"; } $templistmorestatus = 'N'; &gm_getentryvariables($templistnumber); if ($thisentrymorebody ne Gm_Constants::EMPTY) { $templistmorestatus = 'Y'; } print FUNNYFEETWO "$templistnumber|$templistauthorname|$templistsubject|$templistdate|$templisttime|$templistopenstatus|$templistmorestatus\n"; } close (FUNNYFEETWO); _old_gm_readtemplates(); $gmentrytemplate =~ s/\n/\|\*\|/g; $gmentrypagetemplate =~ s/\n/\|\*\|/g; $gmarchiveentrypagetemplate =~ s/\n/\|\*\|/g; $gmarchiveentrytemplate =~ s/\n/\|\*\|/g; $gmdatetemplate =~ s/\n/\|\*\|/g; open (FUNNYFEETHREE, ">>gm-templates.cgi"); print FUNNYFEETHREE "$gmentrytemplate\n"; print FUNNYFEETHREE "$gmentrypagetemplate\n"; print FUNNYFEETHREE "$gmarchiveentrypagetemplate\n"; print FUNNYFEETHREE qq([{{pagepreviouslink}}Previous entry: "{{previousentrysubject}}"</A>]\n); print FUNNYFEETHREE qq([{{pagenextlink}}Next entry: "{{nextentrysubject}}"</A>]\n); print FUNNYFEETHREE qq([{{pagemorepreviouslink}}Previous extended entry: "{{previousmoreentrysubject}}"</A>]\n); print FUNNYFEETHREE qq([{{pagemorenextlink}}Next extended entry: "{{nextmoreentrysubject}}"</A>]\n); print FUNNYFEETHREE qq(<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">|*|<HTML>|*|<HEAD>|*|<TITLE>My Archives|*||*||*||*||*||*|

|*|{{header}}|*|

|*|My Archives|*|

|*||*|

|*|Log Archives|*|

|*|{{logarchivelist}}|*|

|*|Entries|*|

|*|{{logentrylist}}|*|

|*||*|

|*|{{gmicon}}|*|

|*|{{footer}}|*|

|*||*||*|\n); print FUNNYFEETHREE qq({{pagearchivelogindexlink}}Log Archives: {{monthword}} {{yearyear}}\n); print FUNNYFEETHREE qq({{pagelink}}{{monthmonth}}/{{dayday}}/{{yearyear}}: {{entrysubject}}\n); print FUNNYFEETHREE qq({{pagelink}}{{monthmonth}}/{{dayday}}/{{yearyear}}: {{entrysubject}}\n); print FUNNYFEETHREE qq( / \n); print FUNNYFEETHREE qq(
\n); print FUNNYFEETHREE "

\n"; print FUNNYFEETHREE "
\n"; print FUNNYFEETHREE "

\n"; print FUNNYFEETHREE "\n"; print FUNNYFEETHREE "\n"; print FUNNYFEETHREE "\n"; print FUNNYFEETHREE qq( onMouseOver="window.status='{{monthmonth}}/{{dayday}}/{{yearyear}}: {{entrysubject}}';return true" onMouseOut="window.status='';return true"\n); print FUNNYFEETHREE "\n"; print FUNNYFEETHREE "\n"; print FUNNYFEETHREE "$gmarchiveentrytemplate\n"; print FUNNYFEETHREE "$gmdatetemplate\n"; close (FUNNYFEETHREE); open (FUNNYFEETFOUR, ">>gm-config.cgi"); print FUNNYFEETFOUR "yes\n"; print FUNNYFEETFOUR "ascending\n"; print FUNNYFEETFOUR "both\n"; print FUNNYFEETFOUR "10\n"; close (FUNNYFEETFOUR); _old_gm_readconfig(); $versionsetup = $gmversion; _old_gm_writeconfig(); } if (($IN{'oldsetupversion'} eq "one point zero") || ($IN{'oldsetupversion'} eq "1.1")) { _old_gm_readtemplates(); open (LAUGHINGFEET, "; close (LAUGHINGFEET); open (LAUGHINGFEETONE, ">gm-templates.cgi") || &gm_dangermouse("Can't write to the templates file. Please make sure that gm-templates.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files."); foreach $thistemplateline (@gmtemplateline) { chomp ($thistemplateline); unless ($thistemplateline eq Gm_Constants::EMPTY) { $authoremaillinkreplacement = qq(); $authorhomepagelinkreplacement = qq(); $commentauthoremaillinkreplacement = qq(); $commentauthorhomepagelinkreplacement = qq(); $commentspostlinkreplacement = qq(); $pagelinkreplacement = qq(); $pageindexlinkreplacement = qq(); $pagearchiveindexlinkreplacement = qq(); $pagearchivelogindexlinkreplacement = qq(); $pagenextlinkreplacement = qq(); $pagenextmorelinkreplacement = qq(); $pagepreviouslinkreplacement = qq(); $pagepreviousmorelinkreplacement = qq(); $pagesmartindexlinkreplacement = qq(); $pagepositivekarmalinkreplacement = qq(); $pagenegativekarmalinkreplacement = qq(); $thistemplateline =~ s/{{authoremaillink}}/$authoremaillinkreplacement/ig; $thistemplateline =~ s/{{authorhomepagelink}}/$authorhomepagelinkreplacement/ig; $thistemplateline =~ s/{{commentauthoremaillink}}/$commentauthoremaillinkreplacement/ig; $thistemplateline =~ s/{{commentauthorhomepagelink}}/$commentauthorhomepagelinkreplacement/ig; $thistemplateline =~ s/{{commentspostlink}}/$commentspostlinkreplacement/ig; $thistemplateline =~ s/{{pagelink}}/$pagelinkreplacement/ig; $thistemplateline =~ s/{{pageindexlink}}/$pageindexlinkreplacement/ig; $thistemplateline =~ s/{{pagearchiveindexlink}}/$pagearchiveindexlinkreplacement/ig; $thistemplateline =~ s/{{pagearchivelogindexlink}}/$pagearchivelogindexlinkreplacement/ig; $thistemplateline =~ s/{{pagenextlink}}/$pagenextlinkreplacement/ig; $thistemplateline =~ s/{{pagenextmorelink}}/$pagenextmorelinkreplacement/ig; $thistemplateline =~ s/{{pagepreviouslink}}/$pagepreviouslinkreplacement/ig; $thistemplateline =~ s/{{pagepreviousmorelink}}/$pagepreviousmorelinkreplacement/ig; $thistemplateline =~ s/{{pagemorepreviouslink}}/$pagepreviousmorelinkreplacement/ig; $thistemplateline =~ s/{{pagemorenextlink}}/$pagepreviousmorelinkreplacement/ig; $thistemplateline =~ s/{{pagesmartindexlink}}/$pagesmartindexlinkreplacement/ig; $thistemplateline =~ s/{{positivekarmalink}}/$pagepositivekarmalinkreplacement/ig; $thistemplateline =~ s/{{negativekarmalink}}/$pagenegativekarmalinkreplacement/ig; } print LAUGHINGFEETONE "$thistemplateline\n"; } close (LAUGHINGFEETONE); &gm_readtemplates; $gmindextemplate = Gm_Utils::toStoreSafe($gmindextemplate); $gmentrypagetemplate = Gm_Utils::toStoreSafe($gmentrypagetemplate); $gmarchiveindextemplate = Gm_Utils::toStoreSafe($gmarchiveindextemplate); $gmarchiveentrypagetemplate = Gm_Utils::toStoreSafe($gmarchiveentrypagetemplate); $gmentrytemplate = Gm_Utils::toStoreSafe($gmentrytemplate); $gmarchiveentrytemplate = Gm_Utils::toStoreSafe($gmarchiveentrytemplate); $gmstayattoptemplate = Gm_Utils::toStoreSafe($gmstayattoptemplate); $gmdatetemplate = Gm_Utils::toStoreSafe($gmdatetemplate); $gmcommentstemplate = Gm_Utils::toStoreSafe($gmcommentstemplate); $gmcommentsformtemplate = Gm_Utils::toStoreSafe($gmcommentsformtemplate); $gmparaseparationtemplate = Gm_Utils::toStoreSafe($gmparaseparationtemplate); $gmkarmaformtemplate = Gm_Utils::toStoreSafe($gmkarmaformtemplate); # new templates {{target}} and dategrouping footer take the place of the long-deprecated ones: linear 9/18/2003 # new in 1.3 $gmlinktargettemplate = Gm_Utils::toStoreSafe($gmlinktargettemplate); $gmdategroupingfootertemplate = Gm_Utils::toStoreSafe($gmdategroupingfootertemplate); # merged 9/18/2003 $gmkarmalinktemplate = Gm_Utils::toStoreSafe($gmkarmalinktemplate); $gmcommentslinktemplate = Gm_Utils::toStoreSafe($gmcommentslinktemplate); $gmcommentauthoremailtemplate = Gm_Utils::toStoreSafe($gmcommentauthoremailtemplate); $gmcommentauthorhomepagetemplate = Gm_Utils::toStoreSafe($gmcommentauthorhomepagetemplate); $gmcommentdividertemplate = Gm_Utils::toStoreSafe($gmcommentdividertemplate); $gmmoreentrytemplate = Gm_Utils::toStoreSafe($gmmoreentrytemplate); $gmmoreentrypagetemplate = Gm_Utils::toStoreSafe($gmmoreentrypagetemplate); $gmmorearchiveentrypagetemplate = Gm_Utils::toStoreSafe($gmmorearchiveentrypagetemplate); $gmpreviouslinktemplate = Gm_Utils::toStoreSafe($gmpreviouslinktemplate); $gmnextlinktemplate = Gm_Utils::toStoreSafe($gmnextlinktemplate); $gmpreviousmorelinktemplate = Gm_Utils::toStoreSafe($gmpreviousmorelinktemplate); $gmnextmorelinktemplate = Gm_Utils::toStoreSafe($gmnextmorelinktemplate); $gmarchivemasterindextemplate = Gm_Utils::toStoreSafe($gmarchivemasterindextemplate); $gmlogarchiveslinktemplate = Gm_Utils::toStoreSafe($gmlogarchiveslinktemplate); $gmentrypagelinktemplate = Gm_Utils::toStoreSafe($gmentrypagelinktemplate); $gmmoreentrypagelinktemplate = Gm_Utils::toStoreSafe($gmmoreentrypagelinktemplate); $gmlogarchiveslinkseparatortemplate = Gm_Utils::toStoreSafe($gmlogarchiveslinkseparatortemplate); $gmentrypagelinkseparatortemplate = Gm_Utils::toStoreSafe($gmentrypagelinkseparatortemplate); $gmentrypagelinkmonthseparatortemplate = Gm_Constants::EMPTY; $gmentrypagelinkdayseparatortemplate = Gm_Constants::EMPTY; $gmentrypagelinkyearseparatortemplate = Gm_Constants::EMPTY; $gmheadertemplate = Gm_Utils::toStoreSafe($gmheadertemplate); $gmfootertemplate = Gm_Utils::toStoreSafe($gmfootertemplate); $gmsidebartemplate = Gm_Utils::toStoreSafe($gmsidebartemplate); $gmentryseparatortemplate = Gm_Utils::toStoreSafe($gmentryseparatortemplate); $gmarchiveentryseparatortemplate = Gm_Utils::toStoreSafe($gmarchiveentryseparatortemplate); $gmmorearchiveentrytemplate = Gm_Utils::toStoreSafe($gmmorearchiveentrytemplate); $gmdatearchivetemplate = Gm_Utils::toStoreSafe($gmdatearchivetemplate); open (LAUGHINGFEETTWO, ">gm-templates.cgi") || &gm_dangermouse("Can't write to the templates file. Please make sure that gm-templates.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files."); print LAUGHINGFEETTWO "$gmindextemplate\n"; print LAUGHINGFEETTWO "$gmentrypagetemplate\n"; print LAUGHINGFEETTWO "$gmarchiveindextemplate\n"; print LAUGHINGFEETTWO "$gmarchiveentrypagetemplate\n"; print LAUGHINGFEETTWO "$gmentrytemplate\n"; print LAUGHINGFEETTWO "$gmarchiveentrytemplate\n"; print LAUGHINGFEETTWO "$gmstayattoptemplate\n"; print LAUGHINGFEETTWO "$gmdatetemplate\n"; print LAUGHINGFEETTWO "$gmcommentstemplate\n"; print LAUGHINGFEETTWO "$gmcommentsformtemplate\n"; print LAUGHINGFEETTWO "$gmparaseparationtemplate\n"; print LAUGHINGFEETTWO "$gmkarmaformtemplate\n"; print LAUGHINGFEETTWO "$gmlinktargettemplate\n"; print LAUGHINGFEETTWO "$gmdategroupingfootertemplate\n"; print LAUGHINGFEETTWO "$gmkarmalinktemplate\n"; print LAUGHINGFEETTWO "$gmcommentslinktemplate\n"; print LAUGHINGFEETTWO "$gmcommentauthoremailtemplate\n"; print LAUGHINGFEETTWO "$gmcommentauthorhomepagetemplate\n"; print LAUGHINGFEETTWO "$gmcommentdividertemplate\n"; print LAUGHINGFEETTWO "$gmmoreentrytemplate\n"; print LAUGHINGFEETTWO "$gmmoreentrypagetemplate\n"; print LAUGHINGFEETTWO "$gmmorearchiveentrypagetemplate\n"; print LAUGHINGFEETTWO "$gmpreviouslinktemplate\n"; print LAUGHINGFEETTWO "$gmnextlinktemplate\n"; print LAUGHINGFEETTWO "$gmpreviousmorelinktemplate\n"; print LAUGHINGFEETTWO "$gmnextmorelinktemplate\n"; print LAUGHINGFEETTWO "$gmarchivemasterindextemplate\n"; print LAUGHINGFEETTWO "$gmlogarchiveslinktemplate\n"; print LAUGHINGFEETTWO "$gmentrypagelinktemplate\n"; print LAUGHINGFEETTWO "$gmmoreentrypagelinktemplate\n"; print LAUGHINGFEETTWO "$gmlogarchiveslinkseparatortemplate\n"; print LAUGHINGFEETTWO "$gmentrypagelinkseparatortemplate\n"; print LAUGHINGFEETTWO "\n"; print LAUGHINGFEETTWO "\n"; print LAUGHINGFEETTWO "\n"; print LAUGHINGFEETTWO "$gmheadertemplate\n"; print LAUGHINGFEETTWO "$gmfootertemplate\n"; print LAUGHINGFEETTWO "$gmsidebartemplate\n"; print LAUGHINGFEETTWO "\n"; print LAUGHINGFEETTWO "$gmentryseparatortemplate\n"; print LAUGHINGFEETTWO "$gmarchiveentryseparatortemplate\n"; print LAUGHINGFEETTWO "$gmmorearchiveentrytemplate\n"; print LAUGHINGFEETTWO "$gmdatearchivetemplate\n"; print LAUGHINGFEETTWO qq({{weekbeginningmonthmonth}}/{{weekbeginningdayday}}/{{weekbeginningyearyear}} to {{weekendingmonthmonth}}/{{weekendingdayday}}/{{weekendingyearyear}}\n); print LAUGHINGFEETTWO qq(\n); print LAUGHINGFEETTWO qq(\n); print LAUGHINGFEETTWO qq(\n); print LAUGHINGFEETTWO qq(\n); print LAUGHINGFEETTWO qq(\n); print LAUGHINGFEETTWO qq(\n); print LAUGHINGFEETTWO qq(\n); print LAUGHINGFEETTWO qq(\n); print LAUGHINGFEETTWO qq(\n); print LAUGHINGFEETTWO qq(\n); print LAUGHINGFEETTWO qq(|*||*|{{monthmonth}}/{{dayday}}/{{year}}: {{popuptitle}}|*||*||*||*||*||*|{{popuptitle}}|*||*||*|\n); print LAUGHINGFEETTWO qq(\n); print LAUGHINGFEETTWO qq(

\n); print LAUGHINGFEETTWO qq(|*||*||*|Search Results|*||*||*||*||*||*|

|*|Search results for "{{searchterm}}" \({{searchmatches}} matches\)|*|

|*||*|{{searchresults}}|*||*|

|*|[Return To Main Index]|*|

|*|{{gmicon}}|*|

|*||*||*|\n); print LAUGHINGFEETTWO qq(

|*|{{monthmonth}}/{{dayday}}/{{yearyear}}: {{entrysubject}}|*|

|*|{{entrymainbodyfirstwords 10}}...|*|

|*|

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

|*|Previewing Your Comment|*|

|*|\n); print LAUGHINGFEETTWO qq(

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

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

\n); print LAUGHINGFEETTWO qq(No Comments\n); print LAUGHINGFEETTWO qq(1 Comment\n); print LAUGHINGFEETTWO qq({{commentsnumber}} comments\n); print LAUGHINGFEETTWO qq(
\n); close (LAUGHINGFEETTWO); _old_gm_readconfig(); $versionsetup = $gmversion; $cookiesallowed = Gm_Constants::NO; $logarchivesuffix = $entrysuffix; $censorlist = Gm_Constants::EMPTY; $censorenabled = Gm_Constants::NEITHER; $keepmonthlyarchives = Gm_Constants::YES; $defaultentrylistview = Gm_Constants::MAIN; $linktocalendarentries = Gm_Constants::ALL; $automaticrebuilddefault = Gm_Constants::YES; $commententrylistonlyifokay = Gm_Constants::YES; $otherfilelist = Gm_Constants::EMPTY; $otherfilelistentryrebuild = Gm_Constants::NO; $archiveformat = Gm_Constants::MONTH; $inlineformatting = Gm_Constants::ENTRIES; $uploadfilesallowed = Gm_Constants::EMPTY; $uploadfilesizelimit = "0"; _old_gm_writeconfig(); open (LAUGHINGFEETTHREE, "; close (LAUGHINGFEETTHREE); open (LAUGHINGFEETFOUR, ">gm-authors.cgi") || &gm_dangermouse("Can't write to the authors file. Please make sure that gm-authors.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files."); foreach $thisupgradeauthorline (@gmauthorupgradedata) { chomp ($thisupgradeauthorline); unless ($thisupgradeauthorline eq Gm_Constants::EMPTY) { ($thisupgradeauthorname, $thisupgradeauthorpassword, $thisupgradeauthoremail, $thisupgradeauthorhomepage, $thisupgradeauthordate, $thisupgradeauthorposts, $thisupgradeauthorentryaccess, $thisupgradeauthorentryeditaccess, $thisupgradeauthorconfigurationaccess, $thisupgradeauthortemplateaccess, $thisupgradeauthorauthoraccess, $thisupgradeauthorrebuildaccess, $thisupgradeauthorcplogaccess) = split (/\|/, $thisupgradeauthorline); $thisupgradeauthorbookmarkletaccess = 'N'; $thusupgradeauthoruploadaccess = 'N'; $thisupgradeauthorloginaccess = 'Y'; if ($thisupgradeauthorentryaccess eq 'Y') { $thisupgradeauthorbookmarkletaccess = 'Y'; } if ($thisupgradeauthorconfigurationaccess eq 'Y') { $thisupgradeauthoruploadaccess = 'Y'; } print LAUGHINGFEETFOUR "$thisupgradeauthorname|$thisupgradeauthorpassword|$thisupgradeauthoremail|$thisupgradeauthorhomepage|$thisupgradeauthordate|$thisupgradeauthorposts|$thisupgradeauthorentryaccess|$thisupgradeauthorentryeditaccess|$thisupgradeauthorconfigurationaccess|$thisupgradeauthortemplateaccess|$thisupgradeauthorauthoraccess|$thisupgradeauthorrebuildaccess|$thisupgradeauthorcplogaccess|$thisupgradeauthorbookmarkletaccess|$thisupgradeauthoruploadaccess|$thisupgradeauthorloginaccess\n"; } } close (LAUGHINGFEETFOUR); } if ($IN{'oldsetupversion'} eq "1.2" || $IN{'oldsetupversion'} eq "1.21" || $IN{'oldsetupversion'} eq "1.21a" || $IN{'oldsetupversion'} eq "1.21b" || $IN{'oldsetupversion'} eq "1.21c" || $IN{'oldsetupversion'} eq "1.21d" || $IN{'oldsetupversion'} eq "1.21e" || $IN{'oldsetupversion'} eq "1.3" || $IN{'oldsetupversion'} eq "1.3a" ) { ## cleaning up some reused templates in 1.3.1 _old_gm_readtemplates; $gmtemplates[12] = ""; $gmtemplates[13] = ""; open (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."); foreach $thistemplate (@gmtemplates) { $thistemplate =~ s(\n)(\|\*\|)g; print LAUGHINGFEETFOUR "$thistemplate\n"; } close (LAUGHINGFEETFOUR); } use Gm_Upgrade; Gm_Upgrade::upgradeGm( version=>$IN{'oldsetupversion'}, errHandler=>\&Gm_Web::displayAdminErrorExit ); &gm_readconfig; ## configs should be in correct format now $newConfigs->{'gmversionsetup'} = $gmversion; Gm_Storage::setConfigs( configs=>$newConfigs, errHandler=>\&Gm_Web::displayAdminErrorExit ); &gm_readtemplates; # merged 10/2/2003 gm_writetocplog("$IN{'authorname'} upgraded Greymatter from an older version ($IN{'oldsetupversion'}) to a newer version ($gmversion)"); $statusnote = 'Upgrade complete! Welcome back, '.$IN{'authorname'}. '.
New features in 1.7.2 include updated author protection (loose and strict), '. 'Comment Phrase must be entered withen three minutes, security enhancements, and more.

'; &gm_configuration; } sub _old_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 = ; 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]; # new templates {{target}} and dategrouping footer take the place of the long-deprecated ones: linear 9/18/2003 # new in 1.3 $gmlinktargettemplate = $gmtemplates[12]; $gmdategroupingfootertemplate = $gmtemplates[13]; # merged 9/18/2003 $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]; $gmcommentlinktargettemplate = $gmtemplates[73]; $gmsmartentrymoodtemplate = $gmtemplates[74]; $gmsmartentrymusictemplate = $gmtemplates[75]; $gmdategroupingfooterarchivetemplate = $gmtemplates[76]; $gmsmartemoticonscodetemplate = $gmtemplates[77]; $gmcookiescodetemplate = $gmtemplates[78]; } sub _old_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 = ; 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]; $emoticonspath = $gmconfig[46]; $keepphphacklog = $gmconfig[47]; $mailhacknotice = $gmconfig[48]; $emoticonsallowed = $gmconfig[49]; } # --------------------- # write the config file # --------------------- sub _old_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"; print FUNNYFEETCONNIE "$emoticonspath\n"; print FUNNYFEETCONNIE "$keepphphacklog\n"; print FUNNYFEETCONNIE "$mailhacknotice\n"; print FUNNYFEETCONNIE "$emoticonsallowed\n"; close (FUNNYFEETCONNIE); } # ---------------------- # rebuild update process # ---------------------- sub gm_rebuildupdate { &Gm_Trace::Trace(level => 2, msg => "Entering gm_rebuildupdate"); &gm_validate; &Gm_Trace::Trace(level => 3, msg => "After gm_validate"); if ($gmrebuildaccess ne Gm_Constants::YES) { &Gm_Trace::Trace(level => 3, msg => "gmrebuildaccess ne Gm_Constants::YES"); gm_writetocplog("$IN{'authorname'} attempted to rebuild files without authorization"); $statusnote = qq(You don't have access to rebuild files.

); &Gm_Trace::Trace(level => 3, msg => "before gm_frontpage"); &gm_frontpage; &Gm_Trace::Trace(level => 3, msg => "after gm_frontpage"); } $usethisauthorname = $IN{'authorname'}; $usethisauthorpassword = $IN{'authorpassword'}; $usethisauthorname =~ s/ /\+/g; $usethisauthorpassword =~ s/ /\+/g; $nowrebuild = Gm_Constants::EMPTY; $whatimdoing = "Error"; &Gm_Trace::Trace(level => 3, msg => "before gm_readconfig"); &gm_readconfig; &Gm_Trace::Trace(level => 3, msg => "before gm_readcounter"); &gm_readcounter; &Gm_Trace::Trace(level => 3, msg => "before gm_readtemplates"); &gm_readtemplates; &Gm_Trace::Trace(level => 3, msg => "after gm_readtemplates"); if ($IN{'rebuildfrom'} eq "index") { &Gm_Trace::Trace(level => 3, msg => "in index"); &gm_generatemainindex; $whatimdoing = "Rebuilt main index. Now rebuilding log archives..."; $nowrebuild = "logarchives"; &Gm_Trace::Trace(level => 3, msg => "End of index build"); } elsif ($IN{'rebuildfrom'} eq "logarchives") { &Gm_Trace::Trace(level => 3, msg => "in logarchives"); if (($newarchivenumber ne "0") || ($concurrentmainandarchives eq Gm_Constants::YES)) { &Gm_Trace::Trace(level => 3, msg => "newarchivenum ne 0 and concurrent main arch"); if ($keepmonthlyarchives ne Gm_Constants::NO) { &Gm_Trace::Trace(level => 3, msg => "keep monthly archives ne no"); if ($concurrentmainandarchives eq Gm_Constants::YES) { $newarchivenumber = $newentrynumber; } $stoppednumber = $newarchivenumber; &Gm_Trace::Trace(level => 3, msg => "before gm_generatearchive do loop"); do { &gm_generatearchive($stoppednumber); } until $stoppednumber <= 1; &Gm_Trace::Trace(level => 3, msg => "before gm_generatearchive if statement"); if( $gmneedstogeneratefirstarchive ){ &gm_generatearchive(1); } &gm_readcounter; &Gm_Trace::Trace(level => 3, msg => "after readcounte"); } } $whatimdoing = "Rebuilt log archives. Now rebuilding archive master index..."; $nowrebuild = "masterindex"; &Gm_Trace::Trace(level => 3, msg => "end logarchives"); } elsif ($IN{'rebuildfrom'} eq "masterindex") { if (($keeparchivemasterindex eq Gm_Constants::YES) && ($newentrynumber ne "0")) { if ($newarchivenumber ne "0") { &gm_getentryvariables($newarchivenumber); } else { &gm_getentryvariables($newentrynumber); } &gm_formatentry($gmarchivemasterindextemplate); open (THISARCHIVEFILE, ">$EntriesPath/$indexfilename") || &gm_dangermouse("Can't write to $EntriesPath/$indexfilename. Please make sure your paths are configured correctly, that the entries/archives directory is CHMODed to 777, and that $EntriesPath/$indexfilename is CHMODed to 666; also try running Diagnostics & Repair from the Configuration screen."); print THISARCHIVEFILE $entryreturn; close (THISARCHIVEFILE); chmod (0666, "$EntriesPath/$indexfilename"); } if ($otherfilelist ne Gm_Constants::EMPTY) { $whatimdoing = "Rebuilt archive master index. Now rebuilding connected files..."; $nowrebuild = "connected"; } else { $whatimdoing = "Rebuilt archive master index. Now rebuilding entry files..."; $nowrebuild = "1"; } } elsif ($IN{'rebuildfrom'} eq "connected") { if ($otherfilelist ne Gm_Constants::EMPTY) { &gm_rebuildconnectedfiles; if ($connectedfilesdone eq Gm_Constants::YES) { $whatimdoing = "Rebuilt connected files. Now rebuilding entry files..."; $nowrebuild = "1"; if (($IN{'rebuilding'} eq "connected") || ($IN{'rebuilding'} eq "connectedaftersave")) { $nowrebuild = "done"; } } else { $connectpercentdone = int( ($IN{'connectednumber'} / $#connectedfilelist) * 100 ); $whatimdoing = "Rebuilding connected files ($connectpercentdone% done)..."; $nowrebuild = "connected"; } } else { $whatimdoing = "Now rebuilding entry files..."; $nowrebuild = "1"; } } else { unless (($IN{'rebuilding'} eq "connected") || ($IN{'rebuilding'} eq "connectedaftersave")) { if (($generateentrypages eq Gm_Constants::YES) && ($newentrynumber ne "0")) { $currentcount = $IN{'rebuildfrom'}; $counttohere = $currentcount + 9; if ($IN{'rebuildfrom'} eq "archivefiles") { if ($counttohere > $newarchivenumber) { $counttohere = $newarchivenumber; } } else { if ($counttohere > $newentrynumber) { $counttohere = $newentrynumber; } } do { &gm_getentryvariables($currentcount); if ($thisentryopenstatus eq Gm_Constants::OPEN) { if ($currentcount <= $newarchivenumber) { if ($thisentrymorebody ne Gm_Constants::EMPTY) { &gm_formatentry($gmmorearchiveentrypagetemplate); } else { &gm_formatentry($gmarchiveentrypagetemplate); } } else { if ($thisentrymorebody ne Gm_Constants::EMPTY) { &gm_formatentry($gmmoreentrypagetemplate); } else { &gm_formatentry($gmentrypagetemplate); } } open (THISENTRYFILE, ">$EntriesPath/$thisentrynumberpadded.$entrysuffix") || &gm_dangermouse("Can't write to $EntriesPath/$thisentrynumberpadded.$entrysuffix. Please make sure that your entries/archives directory is correctly configured and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); print THISENTRYFILE $entryreturn; close (THISENTRYFILE); chmod (0666, "$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } else { unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } unless ($currentcount eq $counttohere) { $currentcount++; } } until $currentcount eq $counttohere; $percentdone = int( ($counttohere / $newentrynumber) * 100 ); $whatimdoing = "Rebuilt entry pages: $IN{'rebuildfrom'} to $counttohere ($percentdone% done)..."; if ($counttohere eq $newentrynumber) { &gm_getentryvariables($newentrynumber); if ($thisentryopenstatus eq Gm_Constants::OPEN) { if ($thisentrymorebody ne Gm_Constants::EMPTY) { &gm_formatentry($gmmoreentrypagetemplate); } else { &gm_formatentry($gmentrypagetemplate); } open (THISFILE, ">$EntriesPath/$thisentrynumberpadded.$entrysuffix") || &gm_dangermouse("Can't write to $EntriesPath/$thisentrynumberpadded.$entrysuffix. Please make sure that your entries/archives directory is configured correctly and is CHMODed to 777; also try running Diagnostics & Repair from the Configuration screen."); print THISFILE $entryreturn; close (THISFILE); chmod (0666, "$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } else { unlink ("$EntriesPath/$thisentrynumberpadded.$entrysuffix"); } $nowrebuild = "done"; } else { $nowrebuild = $counttohere; } } else { $nowrebuild = "done"; } } } &Gm_Trace::Trace(level => 3, msg => "before token"); # create a token, and persist it to a file called gm-token.cgi: linear 9/3/2003 # merged into 1.3 $now = time(); $usethistoken = "gm" . $now; open (HAVEATOKEN, ">$EntriesPath/gm-token.cgi") || &gm_dangermouse("Can't persist the token. Please make sure that your archive directory is CHMODed 777."); print HAVEATOKEN "$usethistoken\n"; print HAVEATOKEN "$IN{'authorname'}\n"; print HAVEATOKEN "$IN{'authorpassword'}\n"; close (HAVEATOKEN); &Gm_Trace::Trace(level => 3, msg => "after token"); $metarefreshtag = qq(); #merged 9/11/2003 if (($nowrebuild eq Gm_Constants::EMPTY) || ($nowrebuild eq "done")) { if ($IN{'rebuilding'} eq "everything") { $statusnote = qq(All the files have been rebuilt.); ## clean up the token file we created: linear 9/3/2003 # merged into 1.3 unlink ("$EntriesPath/gm-token.cgi"); # merged 9/11/2003 gm_writetocplog("$IN{'authorname'} rebuilt all the files"); } elsif ($IN{'rebuilding'} eq "entryfiles") { $statusnote = qq(All the entry pages have been rebuilt.); gm_writetocplog("$IN{'authorname'} rebuilt all the entry pages"); } elsif ($IN{'rebuilding'} eq "archivefiles") { $statusnote = qq(All the archive entry pages have been rebuilt.); gm_writetocplog("$IN{'authorname'} rebuilt all the archive entry pages"); } elsif ($IN{'rebuilding'} eq "mainentries") { $statusnote = qq(All the main entry pages have been rebuilt.); gm_writetocplog("$IN{'authorname'} rebuilt all the main entry pages"); } elsif ($IN{'rebuilding'} eq "connected") { $statusnote = qq(All the connected files have been rebuilt.); gm_writetocplog("$IN{'authorname'} rebuilt all the connected files"); } elsif ($IN{'rebuilding'} eq "connectedaftersave") { $statusnote = qq(Your new entry has been added.); } else { $statusnote = qq(All relevant files have been rebuilt.); gm_writetocplog("$IN{'authorname'} rebuilt unknown files"); } $whatimdoing = qq($statusnote



); $metarefreshtag = Gm_Constants::EMPTY; } if ($IN{'rebuilding'} eq "everything") { $statusnote = qq(Rebuilding Everything

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

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

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

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

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

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

); } &Gm_Trace::Trace(level => 3, msg => "before redraw"); $gmrebuildheadtag = qq# Greymatter $metarefreshtag $gmadmincss #; print< GMREBUILDUPDATE &Gm_Trace::Trace(level => 4, msg => "$gmrebuildheadtag"); &Gm_Trace::Trace(level => 4, msg => "$gmframetop"); &Gm_Trace::Trace(level => 4, msg => "$statusnote"); &Gm_Trace::Trace(level => 4, msg => "$whatimdoing"); &Gm_Trace::Trace(level => 4, msg => "$gmframebottom"); &Gm_Trace::Trace(level => 3, msg => "end function"); exit; }

|*|[{{pageindexlink}}Main Index]|*|