vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Set/Get BBCode tag count in post (https://vborg.vbsupport.ru/showthread.php?t=320373)

Typhon 09-28-2015 11:40 PM

Set/Get BBCode tag count in post
 
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:

[GROUP]test 1[/GROUP]
[GROUP]test 2[/GROUP]

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

[GROUP=[post_id:sequence]]test 1[/GROUP]
[GROUP=12312312312:2]test 2[/GROUP]

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:
Code:

#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!


All times are GMT. The time now is 03:52 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01030 seconds
  • Memory Usage 1,710KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete