Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show first 25 words from a field.... 1

Status
Not open for further replies.

Beat

Technical User
Joined
Aug 26, 2001
Messages
41
Location
SE
I have a news section on my site. On my index page I want to show a short preview of the most recent articles, like the first 25 wirds, or something.

I think I've seen a extension for it, but I cant find it now.

Can anyone help??

Thanks!
 
Sorry, this isn't a solution to your problem, but merely another question. You say you have articles on your site. Do you have an interface built where your writers can submit the articles they write from an HTML interface on the web? If so, what's the best way to go about building something like this in ultradev?
 
In my news section, I dont give the visitor an option to post anything, but I also have a forum, where the visitor can post stuff.

I have done that very simple. Just a forum with textboxes where you type your subject, your name and your message. And I also have a hidden field with the date. When you click "send" it inserts the values in the database. then I have a page where you can read the messages. That page is done with a recordset where I get the subject, date author and message from the database, which I have a repeat function on.

Works well for me and my forum and I recon you can do a similar thing for your articles/news!!

Good Luck!!
 
Say you have a variable, 'story' with the full text of the article in it:

dim storyArray()
storyArray = split(story,&quot; &quot;) '<--- parses story on spaces
if ubound(storyArray) > 24 then
dim i
for i = 1 to 25
response.write(storyArray(i))
next
else
response.write(story)
end if

If your story has 25 words or more, it will write the first 25. If it doesn't, then it will write the whole thing.

:-)
Paul Prewett
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top