Is this possible

Discuss news styles, css code, and other Coranto customizations in here...the possibilities are endless, so have at it!

Moderator: Spunkmeyer

Is this possible

Postby kussie » Sun Mar 17, 2002 12:08 am

Is it possible to trim the subject field for theheadline diplay to a certian amount of characters??
kussie
 
Posts: 22
Joined: Sat Mar 16, 2002 9:50 am
Location: Australia

yes

Postby Umrath » Sun Mar 17, 2002 12:19 am

<PerlCode>
if(length($Subject) > 150) {
$Subject = SnipText($Subject, 150);
}
</PerlCode>

if you add that (if i understand right), the subject will be snipped at the last word past 150 characters. Someone who knows perl, correct me if i am wrong.

P.S. that must go in your news style
Once upon a time there was a giraffe named herbert, and he had a long neck. One day while herbert was tromping through the forest, he stepped on a little root, and tripped. while he was laying on the ground, a chipmunk named elmer came over and told him that he had better get his bony behind up because Jeffer the Lion was on the prowl. Suddenly, Jeffer burst throught the hedge and ate elmer. The moral of the story is Jeffer is mean, elmer is a cool guy, and herbert is a good name for a band. The End
User avatar
Umrath
 
Posts: 118
Joined: Sat Mar 16, 2002 11:23 pm

Postby l0rdphi1 » Sun Mar 17, 2002 6:40 am

or..
<PerlCode>
$Subject = SnipText($Subject, 150) if length($Subject) > 150;
</PerlCode>


Please tell me whats with people and making code all long?
User avatar
l0rdphi1
 
Posts: 3590
Joined: Sat Mar 09, 2002 10:03 pm
Location: Pennsylvania, United States of America


Return to Customization

Who is online

Users browsing this forum: No registered users and 2 guests

cron