| Author |
Topic Search Topic Options
|
suedechaser
Groupie
Joined: 25 February 2006
Location: USA
Status: Offline
Points: 129
|
Post Options
Thanks(0)
Quote Reply
Topic: Feed first 100 characters Posted: 10 October 2006 at 8:01am |
|
Hi All,
I think this has been covered here - but I cannot find it anywhere.
Is there a way to modify an RSS post feed to only show the first - say - 100 characters and then (...read more)?
thank you in advance
regards
suede
|
 |
Scotty32
Moderator Group
Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
|
Post Options
Thanks(0)
Quote Reply
Posted: 10 October 2006 at 11:42am |
just do:
strMessage = Left(sarryRssTopics(7, intCurrentRecord),100) |
but if theres code to display a smiley, link or a picture it will cut it in half
|
|
|
 |
suedechaser
Groupie
Joined: 25 February 2006
Location: USA
Status: Offline
Points: 129
|
Post Options
Thanks(0)
Quote Reply
Posted: 10 October 2006 at 8:37pm |
|
Hi Scotty,
Thanks for this.
Looking at the actual feed xml, it appears to count any message formatting into the total character count ( as message formatting appears to prefix the actual post in the xml! )
Do you know of an alternative that will count only the characters in the actual post message?
regards
suede
|
 |
dfrancis
Senior Member
Joined: 16 March 2005
Location: United States
Status: Offline
Points: 442
|
Post Options
Thanks(0)
Quote Reply
Posted: 10 October 2006 at 9:36pm |
|
take out the html before counting.
|
 |
suedechaser
Groupie
Joined: 25 February 2006
Location: USA
Status: Offline
Points: 129
|
Post Options
Thanks(0)
Quote Reply
Posted: 10 October 2006 at 10:42pm |
|
Hi dfrancis,
Thanks for the tip!
I have to admit, after looking at the code, that I have no odea how to do that one. Is it possible for you to provide an example / hint please?
regards
suede
|
 |
dfrancis
Senior Member
Joined: 16 March 2005
Location: United States
Status: Offline
Points: 442
|
Post Options
Thanks(0)
Quote Reply
Posted: 10 October 2006 at 10:57pm |
Actually... there's a function already included in the forum... let me see if I can find it.
Edited by dfrancis - 10 October 2006 at 11:34pm
|
 |
dfrancis
Senior Member
Joined: 16 March 2005
Location: United States
Status: Offline
Points: 442
|
Post Options
Thanks(0)
Quote Reply
Posted: 10 October 2006 at 11:33pm |
Correction!!!
Bruce has already done the work... all you need to do is this...
YourFullText = "long raw text including html"
ShortText = removeHTML(YourFullText, 100, False)
That's it!!!
To see how it works, review the removeHTML function in /functions/functions_filters.asp
|
 |
suedechaser
Groupie
Joined: 25 February 2006
Location: USA
Status: Offline
Points: 129
|
Post Options
Thanks(0)
Quote Reply
Posted: 11 October 2006 at 12:44am |
|
Thanks dfrancis, thanks Bruce!!
...simply perfect.
regards
seude
|
 |