vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How To Add NoParse BBCode? (https://vborg.vbsupport.ru/showthread.php?t=236808)

Pro-eSports.com 02-24-2010 07:00 PM

How To Add NoParse BBCode?
 
How can I add the [noparse] BBCode to the post editor?

TimberFloorAu 02-24-2010 07:30 PM

create a new bbcode

title no parse
bbcode tag name noparse


save.

If you want an image for it, just add one to :images/editor/noparse.gif

create icon 16px x 16px in photoshop and save as noparse.gif

That should work.

--------------- Added [DATE]1267047285[/DATE] at [TIME]1267047285[/TIME] ---------------

Ahh alternatively.

goto template editor_toolbar_on

find:
<vb:if condition="!$show['basicbbcodeonly']">
<ul>

Add after:

<img src="images/buttons/noparse.gif" class="imagebutton" id="{vb:raw editorid}_cmd_wrap0_noparse" width="20" height="20" alt="Insert No Parse Tags" />
<vb:if condition="$show['basic_bbcode']">

Pro-eSports.com 02-24-2010 08:00 PM

What's the HTML replacement for the code?

EDIT: Nevermind, the code is a default code that comes with vB. Basically I just have to add the icon as you suggested in your post edit. :)

TimberFloorAu 02-24-2010 08:18 PM

Your Welcome !

msmayz 11-29-2014 07:09 PM

Necroing this thread because I have the same question -- I want to add a button to my text editor toolbar that will wrap [noparse][/noparse] tags -- but the solution in post #2 above isn't working for me.

When I go to Admin CP > Styles & Templates > Search in Templates, I can't find a template called editor_toolbar_on, and I can't find code in any template that reads:
<vb:if condition="!$show['basicbbcodeonly']">
<ul>

Am I looking in the wrong place?

ozzy47 11-29-2014 07:27 PM

That is because you are looking at directions to a older version of vB than you have. This is why we tell people to start their own threads, instead of bringing up old ones. :)

So do as was first suggested.

create a new bbcode

title no parse
bbcode tag name noparse


save.

If you want an image for it, just add one to :images/editor/noparse.gif

create icon 16px x 16px in photoshop and save as noparse.gif

That should work.

msmayz 11-29-2014 09:13 PM

No, I have vB 4, and this is the vB 4 discussion forum. Sorry for necroing a thread; just trying to be polite. Next time I'll start a new thread.

And, like, I said in my post, the directions in post #2 are not working for me. I tried both options.

I tried creating a new BB code, but it won't let me save it unless I insert something in the HTML field. I cannot for the life of me find the proper HTML command for noparse.

ozzy47 11-29-2014 09:31 PM

It does not matter if this in the vB4 section, this was before the ckeditor which you are using.

Anyway, use this as the replacement.

Code:

<noparse>{param}</noparse>

kh99 11-29-2014 09:32 PM

You have vb4, but earlier versions of vb4 didn't have the ckeditor.

For the replacement, did you try just using {param}?

ozzy47 11-29-2014 09:37 PM

What I posted above seems to work Kevin. :)

kh99 11-29-2014 09:42 PM

Ok, but are the tags necessary? Seems like they wouldn't do anything.

ozzy47 11-29-2014 09:46 PM

Yeah it don't look like they are necessary, but it don't hurt either. :)

msmayz 11-29-2014 09:52 PM

Now it's giving me this error:

Quote:

There is already a BB code tag named 'noparse'. You may not create duplicate names.

ozzy47 11-29-2014 09:54 PM

Change the BB Code Tag Name to NoParse

msmayz 11-29-2014 10:00 PM

Okay, did that. Thank you. And now to create the button on the editing toolbar -- in ckeditor.php, if I want the button to appear to the left of the Code button, I would insert the text in red, yes?
Code:

$toolbar[] = array('NoParse', 'Code', 'Html', 'Php');

ETA: because, yeah, that's not working.

ozzy47 11-29-2014 10:02 PM

If you added the bbcode, it should automatically be added to the editor.

Now if you want it to show up in the Quick Reply, see this thread, http://ozzmodz.com/showthread.php/52...ck-Reply-Issue post #4

msmayz 11-29-2014 10:19 PM

It was automatically added to the Go Advanced editor, but to the very end of the last row, along with the other buttons I've added (strikethrough and spoiler).

I don't need the "no parse" button to show up in the Quick Reply editor, but I do want to change its location in the Go Advanced editor (or at least duplicate the button so that I can place it where I want, since there seems to be no way to remove the added buttons from the end of the last row).

Was the code I posted incorrect? How do I add (duplicate) the button so that it shows up to the left of the Code button in the Go Advanced editor?

ozzy47 11-29-2014 10:23 PM

I assume you can try what you posted, if it don't work, just undo the edit. :) I think what should be added is whatever the Title you used for it though

msmayz 11-29-2014 10:48 PM

Thanks, ozzy -- that worked.

ozzy47 11-29-2014 10:50 PM

Awesome, glad it is all good to go now. :)

nerbert 11-29-2014 11:44 PM

Quote:

Originally Posted by msmayz (Post 2524844)
It was automatically added to the Go Advanced editor, but to the very end of the last row, along with the other buttons I've added (strikethrough and spoiler).

I don't need the "no parse" button to show up in the Quick Reply editor, but I do want to change its location in the Go Advanced editor (or at least duplicate the button so that I can place it where I want, since there seems to be no way to remove the added buttons from the end of the last row).

Was the code I posted incorrect? How do I add (duplicate) the button so that it shows up to the left of the Code button in the Go Advanced editor?

Here are some button plugins for one of my projects. The title is "Editor" and the tagname is "editor". It puts a code editor in posts. I wrote these plugins a long time ago so I'm not sure why and how they work. Try altering them for your project.

In editor_toolbar_start

Code:

                $do_cache_editor = true;
                foreach($vbulletin->bbcodecache AS $cache)
                {
                        if($cache['title'] == 'Editor')
                        {
                                $do_cache_editor = false;
                        }
                }
               
                if($do_cache_editor)
                {
                        $vbulletin->bbcodecache[] = array(
                                bbcodeid    => 200,
                                bbcodetag  => 'editor',
                                title      => 'Editor',
                                buttonimage => 'clientscript/codemirror-3.0/images/editor.png'
                        );
                }

in editor_custom_toolbar_loop

Code:

                if($title == 'Editor')
                {
                        $handled = true;
                }

in editor_toolbar_set

Code:

        if($this->editor_type == 'fe')
        {
                if($iespell)
                {
                        $this->config['toolbar'][12][] = 'Editor';
                }
                else
                {
                        $this->config['toolbar'][11][] = 'Editor';
                }

        }


ozzy47 11-29-2014 11:49 PM

Quote:

Originally Posted by nerbert (Post 2524872)
Here are some button plugins for one of my projects. The title is "Editor" and the tagname is "editor". It puts a code editor in posts. I wrote these plugins a long time ago so I'm not sure why and how they work. Try altering them for your project.

In editor_toolbar_start

Code:

        $do_cache_editor = true;
        foreach($vbulletin->bbcodecache AS $cache)
        {
            if($cache['title'] == 'Editor')
            {
                $do_cache_editor = false;
            }
        }
       
        if($do_cache_editor)
        {
            $vbulletin->bbcodecache[] = array(
                bbcodeid    => 200,
                bbcodetag  => 'editor',
                title      => 'Editor',
                buttonimage => 'clientscript/codemirror-3.0/images/editor.png'
            );
        }

in editor_custom_toolbar_loop

Code:

        if($title == 'Editor')
        {
            $handled = true;
        }

in editor_toolbar_set

Code:

    if($this->editor_type == 'fe')
    {
        if($iespell)
        {
            $this->config['toolbar'][12][] = 'Editor';
        }
        else
        {
            $this->config['toolbar'][11][] = 'Editor';
        }

    }


That looks cool nerbert, but the issue was solved already. But it is good reference for anyone else wanting to add bbcodes via a mod. :)


All times are GMT. The time now is 05:54 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.01132 seconds
  • Memory Usage 1,776KB
  • 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
  • (8)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (22)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