View Single Post
Old 01-17-2013, 01:04 AM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,542
Thanks: 62
Thanked 4,054 Times in 4,023 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
It makes sense except you haven't said what part of the post you want to *KEEP*.

That code is stripping out *ALL* HTML tags. Is that what you want?

But the code is really really funky.
Code:
if(img.length<=1) 
{ 
    imgtag = '<span style="float:left; padding:0px 10px 5px 0px;">'
           + '<a href="'+pURL+'"><img src=".../017.jpg".../></a></span>'; 
    summ = summary_img; 
} 
if(img.length>=1) 
{ 
    imgtag = '<span style="padding:0px 0px 10px 0px;">'
           + '<a href="'+pURL+'"><img src="'+img[0].src+'" .../></a></span>'; 
    summ = summary_img; 
}
That is *IDIOTIC* code!

If img.length is *exactly* 1 (that is, if there is exactly 1 image within the <div>) then that code will first set imgtag to the one string and then to the other!

And there is similar insanity with the if (postCount>=1) stuff.

On top of that, the code to strip the HTML tags is braindead.

It wouldn't give me much confidence in using this software.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Users who have thanked Old Pedant for this post:
joesruddock (01-18-2013)