Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Add-ons for VP-ASP
 strip html
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

apswater
VP-CART Super User

444 Posts

Posted - February 04 2008 :  16:07:36  Show Profile  Visit apswater's Homepage  Reply with Quote
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  Show Profile  Visit support's Homepage  Reply with Quote
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
Go to Top of Page

apswater
VP-CART Super User

444 Posts

Posted - February 04 2008 :  16:26:32  Show Profile  Visit apswater's Homepage  Reply with Quote
Thanks Cam.

I just wanted to make sure I didnt do something wrong.

of course, now I see someone whote something similar in 2004!
Go to Top of Page

riprod
VP-CART New User

USA
85 Posts

Posted - December 02 2008 :  12:22:42  Show Profile  Reply with Quote
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00