bbcode to generate static content in message

dknife

Active member
I have a function I wrote on my forum which displays dynamic content from the main site by simply using a bbcode tag and an ID to pull the data. This concept works great however what I really need is the ability to post the same content as either static or dynamic. The data it retrieves and displays changes over time quite a lot so the post becomes less relevant over time as that data changes.

Instead of designing a snapshot system of the data in question (which is quite complex with many tables), I'm trying to figure out a way to obtain that data via the bbcode (which I've done already) and replace the reference in the post so it is no longer generated but rather is added into the post content itself.

Is this conceivable? I'd have to hook into the message post function itself I guess and listen for that bbcode tag then apply a function to replace that part of the message with additional content?
 

AndyB

Well-known member
It's not clear what you're doing. Are you changing data somewhere and want this new data to show in the BB Code? If so why not use an iFrame.
 

dknife

Active member
It's not clear what you're doing. Are you changing data somewhere and want this new data to show in the BB Code? If so why not use an iFrame.
The opposite. I want to take a snapshot of the data and insert it into the post when a bbcode tag is first posted. My existing implementation already displays the information but it retrieves that data when the post is displayed and the bbcode is present with the ID.

Code:
[gang]742[/gang]
As with other bbcode, when the post is loaded for display, it modifies the content of it to implement whatever the bbcode is used for. With my current plugin, it converts that bbcode into a full display of all the data I want in a big table with formatting.

So I also want the option of when you're first posting that message with the {gang}###{/gang} bbcode, it instead retrieves all that data and formatting and enters that into the database instead of the bbcode at the time of making the post.
 
Top