Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How to add this bbcode in?

merfedmerfed New
edited June 2011 in Vanilla 2.0 - 2.8
I've gone over the nbbc docs and I can't seem to get this to work:
[youtube="video code from URL"]Video Title or User Input[/youtube]

to be this:

<a href="Youtube URL">Video Title or User Input</a>

It just comes back as a link to youtube, not putting into the video code.
Tagged:

Answers

  • merfedmerfed New
    edited June 2011
    I was looking at the NBBC documentation and threw this from their documentation into class.nbbc.plugin.php to see if it worked:

    $BBCode->AddRule('border', Array( 'mode' => BBCODE_MODE_ENHANCED, 'template' => '<div style="border: {$size}px solid {$color}">{$_content}</div>', 'class' => 'block', 'allow_in' => Array('listitem', 'block', 'columns'), ));

    I changed their $bbcode to $BBCode, that was all I changed.

    This did nothing than output raw bbcode, so I'm thinking something is different in how NBBC was implemented on vanilla, as apposed to how it is in their documentation?
  • ToddTodd Chief Product Officer Vanilla Staff
    That should work. Make sure your config is set to format stuff in BBCode first.
    $Configuration['Garden']['InputFormatter'] = 'BBCode';
  • zaneperryzaneperry New
    edited February 2013

    I tried this as well with no luck. I tested and test_nbbc.php appears to test clean (the readme.html shows missing pages in the left and right frames). I tested bbcode and it appeared to be working. I have InputFormatter set to BBCode. My mono test failed.

    $bbcode->AddRule('mono', Array( 'simple_start' => '<tt>', 'simple_end' => '</tt>', 'class' => 'inline', 'allow_in' => Array('listitem', 'block', 'columns', 'inline', 'link'), ));

    I even tried deleting the quote bbcode code within class.nbbc.plugin.php yet the quote bbcode still worked.

    $BBCode->AddRule('quote', array('mode' => BBCODE_MODE_CALLBACK, 'method' => array($this, "DoQuote"), 'allow_in' => Array('listitem', 'block', 'columns'), 'before_tag' => "sns", 'after_tag' => "sns", 'before_endtag' => "sns", 'after_endtag' => "sns", 'plain_start' => "\n<b>Quote:</b>\n", 'plain_end' => "\n", ));

    I am confused. I appreciate any support.

    Update: Here is the page I am trying to use to guide me -> http://nbbc.sourceforge.net/doc/usage_add.html

  • @zaneperry

    why would you delete the quote code?

    the object is called $BBCode not $bbcode

    this plugin is an extension of the built in BBCode. It need to be enabled too.

    if you want quotes to work properly use the quotes plugin.

    grep is your friend.

  • also if you are using 2.1 I doubt this has been tested for it.

    grep is your friend.

Sign In or Register to comment.