Creating BBCODE similar to builtin BBCODE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • imog
    New Member
    • Mar 2010
    • 23
    • 3.8.x

    Creating BBCODE similar to builtin BBCODE

    The following builtin bbcodes are special: code, html, php, quote

    They all have builtin templates, and when used their display can easily be tweaked to appear or not appear to non-logged in members by modifying those builtin templates.

    I'd like to do the same for a custom bbcode. Creating the bbcode and templates necessary is straightforward, but how do the builtin bbcode templates hook into post content?

    For example, when the [html][/html] is used within a members post, the bbcode_html template is inserted into the post. How do I make that happen for custom bbcode I create?
  • imog
    New Member
    • Mar 2010
    • 23
    • 3.8.x

    #2
    I'm guessing it uses the bbcode_create hook?

    I want to use the following to only show the contents of custom bbcode like so: <if condition="$bbuserinfo[userid]"></if>

    Comment

    • imog
      New Member
      • Mar 2010
      • 23
      • 3.8.x

      #3
      Got my answer on vbulletin.org, which is probably more appropriate for this sort of question. In case it may help anyone else, this is working for me, and you can find the code I used here:

      Comment

      • Andy
        Senior Member
        • Jan 2002
        • 5886
        • 4.1.x

        #4
        Be sure to use the Custom BB Codes

        Admin CP -> Custom BB Codes ->

        Comment

        • imog
          New Member
          • Mar 2010
          • 23
          • 3.8.x

          #5
          Thanks. I use custom BBcodes normally Andy, however with custom BBcodes you can't use PHP to manipulate what is inside the bbcode. The plugin description I linked above allows you to create a custom bbcode like [registered][/registered] which can be used by any forum member, and then only display the content between those tags to other registered members. Essentially, its a hack to get the same sort of functionality vbulletin.org has for only displaying code snippets to logged in members.

          My intention is to use it for member only contests like so:

          Hey, we're having a sweet contest! Here's the details for forum members:
          [registered]contest details go here, forum guests see a message that they need to register to see the details[/registered]

          Comment

          Related Topics

          Collapse

          Working...