Author |
Topic |
|
apswater
VP-CART Super User
444 Posts |
Posted - February 04 2008 : 16:07:36
|
I posted some code a few weeks back for removing html from a string. Now it is gone. Can someone tell me why? |
|
support
Administrator
4679 Posts |
Posted - February 04 2008 : 16:22:10
|
Hi Mitch,
We suffered a meltdown on our database and have lost a number of records unfortunately.
Thanks Cam
VP-ASP Support
Here it is again for everyone:
After looking around to find a prewritten function that will remove html code from a string, I came up empty.
so I wrote one.
If any of you need it, here is it for free. It works great if you put links in your category description like I do, then use those description to make your meta tags,.
I didnt dim the variables so make sure you dont use the optons explicit or it wont work.
function striphtml(strString)
htmlread = "on"
If len(strString) = 0 or isnull(strString) then stripHtml = "" exit function End if
y=0
do until y = len(strstring) y=y+1 startstring=mid(strString,y,1)
if startstring ="<" then htmlread="off" endstring=" " & endstring end if if startstring ="<" then trigger="on"
if htmlread = "on" then endstring=endstring & startstring 'response.write "<hr>" & endstring & "<hr>"
end if
if startstring = ">" then htmlread = "on" endstring = endstring & " " end if loop
striphtml = trim(clean(endstring))
y=0
set startstring=nothing set endstring=nothing set triggerr=nothing exit function end function
http://www.apswater.com
|
|
|
apswater
VP-CART Super User
444 Posts |
Posted - February 04 2008 : 16:26:32
|
Thanks Cam.
I just wanted to make sure I didnt do something wrong.
of course, now I see someone whote something similar in 2004! |
|
|
riprod
VP-CART New User
USA
85 Posts |
Posted - December 02 2008 : 12:22:42
|
how do I use this. I am trying to strip out the HTML in [cdescription], so when it displays in top sellers, it is not bold and formatted.
Where do I put this code and how do I call it on "tmp_topsellers.htm"
thanks |
|
|
|
Topic |
|