vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   BB Code Enhancements - Better code syntax highlighting (https://vborg.vbsupport.ru/showthread.php?t=285933)

Raptor 07-19-2015 12:09 AM

1 Attachment(s)
Here is the changes to add 'Select All' to this mod (thanks to BCP Hung for his select all mod which I used for this) and also fixed the edit issue so that you can edit the code without everything parsing with no problems (thanks to wedframe in the previous post) :)

Insert javascript code into headinclude template
AdminCP -> Styles & Templates -> Style Manager -> Edit Templates -> headinclude
Copy and paste following js code to bottom of headinclude template :

Code:

<script type="text/javascript">
    function selectAll(a)
    {
        var e  = a.parentNode.parentNode.getElementsByTagName('code')[0];
        if  (window.getSelection)
        {
            var s = window.getSelection();
            if  (s.setBaseAndExtent)
            {
                s.setBaseAndExtent(e, 0, e, e.innerText.length -  1);
            }
            else
            {
                var r = document.createRange();
                r.selectNodeContents(e);
                s.removeAllRanges();
                s.addRange(r);
            }
        }
        else if (document.getSelection)
        {
            var s = document.getSelection();
            var r = document.createRange();
            r.selectNodeContents(e);
            s.removeAllRanges();
            s.addRange(r);
        }
        else if  (document.selection)
        {
            var r = document.body.createTextRange();
            r.moveToElementText(e);
            r.select();
        }
    }
</script>

then import and overwrite the new xml - enjoy :)

Tested on vb 4.2.3

Here's info to add the custom bbcode buttons to Quick Reply and Quick Edit

https://vborg.vbsupport.ru/showpost....4&postcount=15

GHRake 05-30-2017 10:26 PM

anyone had trouble with highlight bbcode doing this in the code blocks:
https://vborg.vbsupport.ru/external/2017/05/19.png

I'm at a loss here :(

RaYdeN.ADM 08-16-2017 06:01 AM

<font color="DeepSkyBlue">This plugin ruined the forum, do you know any way to restore bbcode php html default, after deleting the plugin?</font>

RaYdeN.ADM 08-20-2017 10:19 PM

Any idea?

Raptor 07-28-2021 02:01 PM

I have a weird one. Used this plugin for a few years now and works great. However I've come across some code that simply will not parse no matter what. Can anyone assist?

This is the code when parsed with standard CODE wrappers.

Code:

*/ picture
const int16 BOOT_LOGO[] = {
128, 49,
    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    0x0FFF,0xFFFF,0xE007,0xFFFF,0xFFFE,0x007C,0x0000,0x0078,0x1FFF,0xFFFF,0xF00F,0xFFFF,0xFFFF,
    0x00FE,0x0000,0x00FC,0x1FFF,0xFFFF,0xF80F,0xFFFF,0xFFFF,0x00FF,0x0000,0x00FC,0x1FFF,0xFFFF,
    0xF007,0xFFFF,0xFFFF,0x00FF,0x8000,0x00FC,
    0x0FFF,0xFFFF,0xE003,0xFFFF,0xFFFE,0x00FF,0xC000,0x00FC,0x0000,0x000F,0xE000,0x0000,0x0000,
    0x00FF,0xE000,0x00FC,0x0000,0x001F,0xC000,0x0000,0x0000,0x00FF,0xE000,0x00FC,0x0000,0x003F,
    0x8000,0x0000,0x0000,0x00FF,0xF000,0x00FC,
    0x0000,0x007F,0x0000,0x0000,0x0000,0x00FF,0xF800,0x00FC,0x0000,0x00FE,0x0000,0x0000,0x0000,
    0x00FD,0xFC00,0x00FC,0x0000,0x01FC,0x0000,0x0000,0x0000,0x00FC,0xFE00,0x00FC,0x0000,0x03F8,
    0x0000,0x0000,0x0000,0x00FC,0x7F00,0x00FC,
    0x0000,0x07F0,0x0000,0x0000,0x0000,0x00FC,0x3F80,0x00FC,0x0000,0x07F0,0x0000,0x0000,0x0000,
    0x00FC,0x1FC0,0x00FC,0x0000,0x0FE0,0x0000,0x0000,0x0000,0x00FC,0x1FE0,0x00FC,0x0000,0x1FC0,
    0x0000,0x0000,0x0000,0x00FC,0x0FF0,0x00FC,
    0x0000,0x3F80,0x0007,0xFFFF,0xFFFE,0x00FC,0x07F0,0x00FC,0x0000,0x7F00,0x000F,0xFFFF,0xFFFF,
    0x00FC,0x03F8,0x00FC,0x0000,0xFE00,0x000F,0xFFFF,0xFFFF,0x00FC,0x01FC,0x00FC,0x0001,0xFC00,
    0x0007,0xFFFF,0xFFFE,0x00FC,0x00FE,0x00FC,
    0x0003,0xF800,0x0003,0xFFFF,0xFFFC,0x00FC,0x007F,0x00FC,0x0003,0xF800,0x0000,0x0000,0x0000,
    0x00FC,0x003F,0x80FC,0x0007,0xF000,0x0000,0x0000,0x0000,0x00FC,0x001F,0xC0FC,0x000F,0xE000,
    0x0000,0x0000,0x0000,0x00FC,0x000F,0xE0FC,
    0x001F,0xC000,0x0000,0x0000,0x0000,0x00FC,0x000F,0xF0FC,0x003F,0x8000,0x0000,0x0000,0x0000,
    0x00FC,0x0007,0xF0FC,0x007F,0x0000,0x0000,0x0000,0x0000,0x00FC,0x0003,0xF8FC,0x00FE,0x0000,
    0x0000,0x0000,0x0000,0x00FC,0x0001,0xFCFC,
    0x01FC,0x0000,0x0000,0x0000,0x0000,0x00FC,0x0000,0xFEFC,0x03F8,0x0000,0x0000,0x0000,0x0000,
    0x00FC,0x0000,0x7FFC,0x03F8,0x0000,0x0000,0x0000,0x0000,0x00FC,0x0000,0x3FFC,0x07F0,0x0000,
    0x0000,0x0000,0x0000,0x00FC,0x0000,0x1FFC,
    0x0FE0,0x0000,0x0000,0x0000,0x0000,0x00FC,0x0000,0x0FFC,0x1FFF,0xFFFF,0xE003,0xFFFF,0xFFFC,
    0x00FC,0x0000,0x07FC,0x3FFF,0xFFFF,0xF007,0xFFFF,0xFFFE,0x00FC,0x0000,0x07FC,0x3FFF,0xFFFF,
    0xF80F,0xFFFF,0xFFFF,0x00FC,0x0000,0x03FC,
    0x3FFF,0xFFFF,0xF00F,0xFFFF,0xFFFF,0x00FC,0x0000,0x01FC,0x1FFF,0xFFFF,0xF007,0xFFFF,0xFFFE,
    0x0078,0x0000,0x00F8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
 } // picture
/*

When using PHPS with the plugin it shows nothing at all - even stranger if I remove "128, 49," from the beginning of the script, all displays correctly.

Any thoughts?


All times are GMT. The time now is 05:03 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.01100 seconds
  • Memory Usage 1,742KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete