The Styles Guide

Anything in Italics is code that is suitable to be put in a style.

The plethora of standard variables

Subject, Text, User, Date , Category , UserField_Email , Year, Month_Name, Month_Number, Weekday, Day, Hour, Minute, Second, AMPM, Time_Zone, TwoDigitYear, TwoDigitMonth, TwoDigitHour, TwoDigitDay.

If

The code that follows will print the date at the top of the day's worth of posts.
<If: Sub: isNewDate>
<b><Field: Month_Name> <Field: Day> '<Field: TwoDigitYear></b>
</If>

else

<If: Field: UserField_Email>
<a href="mailto:<Field: UserField_Email>"><Field: User></a>
<If: Else>
<Field: User>
</If>

eq (ne)

<If: Field: Subject eq "w00t, Coranto">
Don't we all love Coranto?
<If: Else>
Grr..
</If>

== (!=)

<If: Field: Day == 32>
Something isn't right here...
</If>

PerlCode

<PerlCode>
if(($Day) == 1){$Day = $Day . "st"}
if(($Day) == 2){$Day = $Day . "nd"}
if(($Day) == 3){$Day = $Day . "rd"}
if(($Day) > 3){$Day = $Day . "th"}
</PerlCode>

PerlCode in cruser.pl

Put the following in the style
<Sub: fixthedate>
And the stuff below this, in cruser.pl (it tell you where)
sub fixthedate {
if(($Day) == 1){$Day = $Day . "st"}
if(($Day) == 2){$Day = $Day . "nd"}
if(($Day) == 3){$Day = $Day . "rd"}
if(($Day) > 3){$Day = $Day . "th"}
}

Basic Example 1

<If: Sub: isNewDate>
<br>
<center>
<table cellspacing="1" cellpadding="0" bgcolor="#000000" width="75%"><tr><td>
<table cellspacing="0" cellpadding="0" width="100%" bgcolor="#FFFFFF"><tr><td>
<center><font color="#000000"><Field: Month_Number>//<Field: Day>//<Field: Year></font></center>
</td></tr></table>
</td></tr></table>
</center>
</If>
<b><Field: Subject></b> - <Field: Text><br>
<Field: Hour>|<Field: Minute> {<Field: User>}

Would print something like...
~

7//13//2001
Wow.... - Look at how much you've learned. Obviously I have no idea if you, or anyone is learning anything at all from this, but I can hope.
10|27 {mark}
~

Basic Example 2

<If: Sub: isNewDate>
<p class="date"><Field: Month_Number>.<Field: Day>.<Field: TwoDigitYear></p>
</If>
<a class="nav" href="/cgi-bin/viewnews.cgi?id=<Field: newsid>" title="the link that never dies"><Field: Date></a> - <Field: User>
<If: Field: Subject> <b><Field: Subject></b></If><br>
<Field: Text>
<br>

Would print something like...
~
2:27 AM - mark huzzah
Look, this one has a link to viewnews (nonfunctional) in it that is generated by the PerlCode.
~

Advanced Example 1

Put the following code right ABOVE <Field: Text>
<PerlCode>
my $yourlength = 150;
if (length($Text) > $yourlength){
$yourlength--;
my $Backup = $Text;
$Text =~ s/<br>/>br</g;
$Text =~ s/<br \/>/>br \/</g;
$text =~ s/<[^>]+>//g;
$Text =~ s/>br \/</<br \/>/g;
$Text =~ s/>br</<br>/g;
if (length($Text) > $yourlength){
$Text = substr($Text,0,index($Text,' ',$yourlength));
$Text .= qq~<br><a href="/cgi-bin/viewnews.cgi?id=$newsid" title="more">more...</a>~;
}else{
$Text = $Backup;
}
}
</PerlCode>