[PHP] Finding split points in an article for inserting ads

2011-02-15 Thread Brian Dunning
Hey all - I've got long articles, the HTML for which comes out of MySQL. Works great. I want to split it up so that I can insert ad blocks at various points within it. The articles are all pretty long but they're of variable length. I want to chop them up into three close-to-equal (doesn't

Re: [PHP] Finding split points in an article for inserting ads

2011-02-15 Thread Simon J Welsh
On 16/02/2011, at 10:03 AM, Brian Dunning wrote: Hey all - I've got long articles, the HTML for which comes out of MySQL. Works great. I want to split it up so that I can insert ad blocks at various points within it. The articles are all pretty long but they're of variable length. I want

Re: [PHP] Finding split points in an article for inserting ads

2011-02-15 Thread Robert Cummings
On 11-02-15 04:03 PM, Brian Dunning wrote: Hey all - I've got long articles, the HTML for which comes out of MySQL. Works great. I want to split it up so that I can insert ad blocks at various points within it. The articles are all pretty long but they're of variable length. I want to chop

Re: [PHP] Finding split points in an article for inserting ads

2011-02-15 Thread Brian Dunning
Yes, thanks, what I'm looking for is how to do that. On Feb 15, 2011, at 1:38 PM, Simon J Welsh wrote: Assuming you're only using p tags, count the number of opening p tags, divide by three. First ad block goes after the round($amount/3)-th /p, second ad block goes after the

Re: [PHP] Finding split points in an article for inserting ads

2011-02-15 Thread David Robley
Brian Dunning wrote: Yes, thanks, what I'm looking for is how to do that. On Feb 15, 2011, at 1:38 PM, Simon J Welsh wrote: Assuming you're only using p tags, count the number of opening p tags, divide by three. First ad block goes after the round($amount/3)-th /p, second ad block goes

Re: [PHP] Finding split points in an article for inserting ads

2011-02-15 Thread Tamara Temple
On Feb 15, 2011, at 4:32 PM, Brian Dunning wrote: Yes, thanks, what I'm looking for is how to do that. On Feb 15, 2011, at 1:38 PM, Simon J Welsh wrote: Assuming you're only using p tags, count the number of opening p tags, divide by three. First ad block goes after the