Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Help with some code...
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Help with some code...

 Post Reply Post Reply
Author
kwouters View Drop Down
Newbie
Newbie


Joined: 07 August 2005
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote kwouters Quote  Post ReplyReply Direct Link To This Post Topic: Help with some code...
    Posted: 12 October 2006 at 1:28pm

Hi There,

I'm using Ezaspsite for my homepage. An item on the mainpage is news.
When I put news on it often doesn't display what I want it to.
I found out that the lenght of the news on the mainpage is hardcoded. I put the code below. I already changed the number from 350 to 500.
Can anyone help me to change this code into something that reads the item and displays it until it runs across e.g. [#] or something.

Thanks in advance..

Greetings, Koen

If blnWordCut = True Then
  If len(strNewsItem)>500 then
   strNewsItem = left(strNewsItem,500) & "<br><br><a href=""forum/forum_posts.asp?TID=" & intNewsID & """ class=""text2"" alt="""& strTxtShowMore &""" title="""& strTxtShowMore &""">"& strTxtShowMore &"</a>"
                        strMore = True
  End If
End If

Back to Top
jeffdaro View Drop Down
Groupie
Groupie


Joined: 15 April 2005
Status: Offline
Points: 171
Post Options Post Options   Thanks (0) Thanks(0)   Quote jeffdaro Quote  Post ReplyReply Direct Link To This Post Posted: 12 October 2006 at 4:35pm
Are you saying you want it to include all text from strNewsItem up to and excluding a delimiter like '#'? If that's what you mean then you can do something like this...

Originally posted by Code Sample Code Sample wrote:


Dim intDelimiterPos

    intDelimiterPos = instr(1, strNewsItem, '#')

    If intDelimiterPos > 0 then
        strNewsItem = mid(strNewsItem, 1, intDelimiterPos - 1)
    End if

Back to Top
kwouters View Drop Down
Newbie
Newbie


Joined: 07 August 2005
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote kwouters Quote  Post ReplyReply Direct Link To This Post Posted: 13 October 2006 at 8:51am
@jeffdaro: Thanks for this code... I've tried it, and it works perfect.
The most articles now are showing complete (some mistakes*), and when I put in the # the article is shown up to there.
 
* Mistakes: Some articles containing pictures and links don't fully show. It looks like a limit in characters, but I can't figure out where it is. I will be looking into that.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.