PDA

View Full Version : Set/Get BBCode tag count in post


Typhon
09-28-2015, 11:40 PM
I have a custom bbcode that interacts with the database via a plug-in and I'd like to be able to uniquely identify the bbcode in the post. I have post id already, but in the case where the bbcode is used multiple times in a post, I want a number sequence as well. Is there something in place that does this? Also; I'd want to be able to write this id back into the post (not the post cache).

Example:

test 1
test 2

I'd like it to parse the post on submission and create:

]test 1
test 2

Any thoughts? I've looked at forum, but I'm not even sure what to search for. Thanks!

Gio~Logist
09-30-2015, 03:09 AM
Is this for css reasons? If so, you can use nth-child, assuming your plugin uses a unique tag.

Example:
#postidstuff p.pluginstuff:nth-child(2){ css here }

Would apply to the second one.

Typhon
09-30-2015, 10:48 AM
Thanks for the reply!

This is not used for CSS. The contents of the bbcode are written into the database and I need to return the unique row id back to the bbcode block. So some posts may have multiple bbcode blocks and I need to be able to identify each of them. There is a button in each block of bbcode that opens up another application using that unique id. I hope that makes sense. :)

Thanks!

Typhon
10-02-2015, 12:51 PM
I figured it out. I didn't realize that the post/bbcode parsing happened all at once; so I was just able to define a global and add an id to the parser. pretty easy after that. Thanks!