Get [URL] and [IMG] data in array (post_id => array(url, title)) from posts

Marcus

Well-known member
If a post with id=5 is like this [U RL should be URL]

Hello [U RL='[url]http://google.com']Googlelink[/url][/U RL], this is [U RL]http://domain.com[/U RL] [I MG]http://picture.com/image.jpg[/I MG]

it should return this array
PHP:
[5]['url'][0]['link'] ="http://google.com"
[5]['url'][0]['title'] "Googlelink"
[5]['url'][1]['link'] ="http://domain.com"
[5]['url'][1]['title'] ""
[5]['img'][0] = "http://picture.com/image.jpg"

I want to fetch the data from existing posts, too. It would be best to hook into an existing routine like rebuild post index. Do you know where I should hook into, and if there is an existing XenForo function that helps me fetch the bbcode data?

BbCode_Parter:: parse() returns an array like above, but is there a parent function that is executed in the rebuild counters so I don't have to rewrite a "rebuild bbcode for all posts" function - and with the added benefit to store the bbcode in cache?
 
Last edited:
Back
Top Bottom