For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > May 2007 > Re: [PHP-DB] Read more link with HTML code









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-DB] Read more link with HTML code
James Gadrow

2007-05-07, 6:57 pm

Hmmm... Perhaps you should think about separating the tags from the
content? Do something like:

//Strip tags from content and add a few char hook to be used for
re-insertion
//Count 200 chars (ignoring any hooks found while parsing and thereby
not adding it to the char count)
//Make sure last char is a space or something appropriate
//re-insert tags over the hooks (count tags used & tags closed)
//close any inserted tags that aren't closed already in nested order

Mike van Hoof wrote:
> Hello list,
>
> I got a problem with displaying content in a "read more block" which
> contains HTML code.
> The problem is as followes:
>
> I got a large piece of content, which contains HTML code (<b><u><i>
> etc), but after 200 characters a read more link appears. At the moment
> I strip al the HTML out of this piece of content, and display the full
> set off content on another page.
> But now i also want to display the bold text etc. in the first (200
> chrs) content block. The only problem i have here, is that when I got
> a bold tag opend in the first 200 chrs, and it's closed after 400
> chrs, then the rest off the page is also bold.
>
> somebody got a solution ?
>
> Thanks for reading.
>
> Mike
>



--
Thanks,

Jim
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com