Forum Moderators: open
The current version is much tougher on whitespaces. The trick above doesn't work anymore. Is there a different way to achieve indentation? Needless to say (I hope) that postings with code in them would become much easier to read. Think of CSS, HTML, JavaScript, PHP. Even Perl might become readable ;)
<?php
if($var = "fish") {
echo "YAY, we are having fish for dinner!"; (6 space indent)
} else {
echo "Booo...No fish"; (6 space indent)
}
?>
Something has to be done to clean all the extra spaces out of posts from some browsers. I don't see anyway short of allowing people to spam the db, than ripping out the spaces.
There isn't accidently a php code beautification routine written in perl is there?
perl example of perl syntax highlighting on the fly:
[sedition.com...]
[perl]$thisprogram = $threadprogram;
&AccessCheck;
#-----------------------:
$ua3 =$ENV{'HTTP_USER_AGENT'};
$inforum = $FORM{'forum'};
$inkeyword = $FORM{'keyword'};
$inthreadid = $FORM{'discussion'};
if ($inthreadid =~ /\-/) {
($inthreadid,$section,$tsplitcnt) = split(/-/,$inthreadid);
}
$section--;
$section =0 if $section <0;
$tsplitcnt =$threadsplitcnt;
#$threadsplitcnt =30 if $threadsplitcnt <30;
#$threadsplitcnt =70 if $threadsplitcnt >70 && ($sysop ne $LIU);
$prefsdirty++ if $tsplitcnt!= $threadsplitcnt;
$tsplitcnt =$threadsplitcnt;
$StartMessage =($section * $threadsplitcnt)+1 if $section;
$EndMessage =$StartMessage + $threadsplitcnt;
&GetKeywordForumHeader($inkeyword) if length($inkeyword);
&GetForumHeader($inforumid) if!length($inkeyword);
$threaddat = "$ForumsData/$DirPrefix$inforumid/$inthreadid.cat";
$tlog = "forum$inforum/$inthreadid.htm";
&GoHighlight if!$highlight;
$ValidMember =0 if exists $prefs{"$LIU-access-validated"};[/perl]