PDA

View Full Version : scan for bbcodes within posts


succo
05 Jun 2007, 09:28
ok, this is what i'd like to do:
i've got a nice 'media' forum, containing many bbcode tags for stuff i'd like to show in the homepage... at the moment i'm working on making the 'upcoming' module read all the posts in some forums, find the ones containing 'my' bbcode and strip it and put it in a variable... this is my code so far:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



it's partially working, as it finds the correct posts, but (in one case) doesn't succeed in stripping some part of the post away, maybe (that's what i noticed) because it finds some " (quotes)

may anyone help in building this thing up? :)

Dismounted
05 Jun 2007, 09:49
Use preg instead of ereg. It's faster.

succo
05 Jun 2007, 10:20
mmmmmmmh... trying with

Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

but isn't substituting anything in the text... so, what's wrong? :)
thanks

Dismounted
05 Jun 2007, 11:05
Have you had a look at how vBulletin does it?

succo
05 Jun 2007, 11:24
ok, will try later when back from work :)

thanks

ok, made it work like this



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


thanks :)