Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    MikeRohsoft's Avatar
    Join Date
    May 2013
    Gender
    male
    Location
    Los Santos
    Posts
    797
    Reputation
    593
    Thanks
    26,314

    MPGH Codeblocks Syntax Highlight

    Add GreaseMonkey to your Browser Addons
    create a new Script and paste this:
    Code:
    // ==UserScript==
    // @name MPGH Code Blocks Syntax Highlight  
    // @author Mike Rohosft
    // @grant       GM.setValue
    // @grant       GM.getValue
    // @include https://www.mpgh.net/forum/*
    // ==/UserScript==
      
    function responseHandler(text) {
        GM.setValue('prettyprint', text);
        const b = new Blob([text], { type: 'text/javascript' });
        const u = URL.createObjectURL(b);
        const script = document.createElement('script');
        script.type = 'text/javascript';
        script.src = u;
        document.head.appendChild(script);
    }
      
    window.addEventListener('load', function init() {
        const code_blocks = document.getElementsByClassName("bbcode_code");
        for (let i = 0, v; v = code_blocks[i]; i++) {
        	if (v.tagName.toLowerCase() !== 'pre') {
    		    continue;
            }
            v.classList.add('prettyprint');  
        }
        GM.getValue('prettyprint').then(textblob => {
    			if (!textblob) {
          	fetch('https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js').then(res => res.text().then(responseHandler));  
          } else {
            responseHandler(textblob); 
          }
        });
        window.removeEventListener('load', init);
    });
    save it
    reload


    Last edited by MikeRohsoft; 07-30-2019 at 04:32 AM. Reason: small improvement

  2. The Following 4 Users Say Thank You to MikeRohsoft For This Useful Post:

    Danny (07-29-2019),Hector (07-31-2019),Sam (07-29-2019),Vicarious (07-30-2019)

  3. #2
    Danny's Avatar
    Join Date
    Jun 2015
    Gender
    male
    Posts
    9,617
    Reputation
    2835
    Thanks
    3,002
    My Mood
    Aggressive
    Why has this hacked me Mike? UwU :3

    Gj though, should come in use for many
    Last edited by Danny; 07-29-2019 at 05:34 PM.

    I am not a middleman nor do I buy/sell anything. If you are being contacted by someone off-site from MPGH then it's not me! Please report these to me via PM. Don't be stupid, think first.

  4. #3
    Sam's Avatar
    Join Date
    Oct 2015
    Gender
    female
    Posts
    1,202
    Reputation
    313
    Thanks
    637
    My Mood
    Psychedelic
    Quote Originally Posted by Joe View Post
    Why has this hacked me Mike? UwU :3

    Gj though, should come in use for many
    My nam joe I see beep boop code and pretend I know what’s going on
    [SPOILER=History](mm/dd/yyyy)
    Joined - 10/15/2015
    Cocksucker - 09/05/2018 - 10/20/2019
    Premium - 10/04/2018 - Now
    Newsforce (Hack of the week) - 05/12/2019 - 09/12/2019
    Premium Seller - 07/06/2019 - Now
    Newsforce (Cybersecurity) - 09/12/2019 - 03/01/2020

  5. The Following 3 Users Say Thank You to Sam For This Useful Post:

    Danny (07-30-2019),Hector (07-31-2019),`Jess (07-29-2019)

  6. #4
    Vicarious's Avatar
    Join Date
    May 2013
    Gender
    male
    Location
    R'lyeh
    Posts
    2,554
    Reputation
    619
    Thanks
    1,807
    What is that good for?

    prev. Names: HΔSTUR ▬ Sound.

  7. #5
    Breezeyou2's Avatar
    Join Date
    Apr 2016
    Gender
    male
    Location
    Under Your Bed !
    Posts
    1,845
    Reputation
    117
    Thanks
    280
    My Mood
    Breezy
    True, What does it do tho ?

    Email [Fast Replies]: breezeyou1@gmail.com
    ▶Selling VCCs |VISA/Mastercard Verify Your paypal Method Get Your VCC Contact me on IM/Email us


  8. #6
    MikeRohsoft's Avatar
    Join Date
    May 2013
    Gender
    male
    Location
    Los Santos
    Posts
    797
    Reputation
    593
    Thanks
    26,314
    Adds some Improvements and I've added a Screenshot with previous - after compare

  9. #7
    Silent's Avatar
    Join Date
    Jan 2015
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    5,070
    Reputation
    2172
    Thanks
    8,474
    My Mood
    Bitchy
    How about @arunforce @dave add syntax highlighting with the forum upgrade. Hahahahahahahaahhahahahaahahhahahahahahahahahahaha hahah a hahahahahahahaahhahahahaahahhahahahahahahahahahaha hahah
    Click Here to visit the official MPGH wiki! Keep up with the latest news and information on games and MPGH! To check out pages dedicated to games, see the links below!











    dd/mm/yyyy
    Member - 31/01/2015
    Premium - 12/09/2016
    Call of Duty minion - 05/11/2016 - 05/11/2019
    BattleOn minion - 28/02/2017 - 05/11/2019
    Battlefield minion - 30/05/2017 - 05/11/2019
    Other Semi-Popular First Person Shooter Hacks minion - 21/09/2017 - 17/09/2019
    Publicist - 07/11/2017 - 02/08/2018
    Cock Sucker - 01/12/2017 - Unknown
    Minion+ - 06/03/2018 - 05/11/2019
    Fortnite minion - 08/05/2018 - 05/11/2019
    Head Publicist - 08/10/2018 - 10/01/2020
    Developer Team - 26/10/2019 - 10/01/2020
    Former Staff - 10/01/2020



  10. #8
    Vicarious's Avatar
    Join Date
    May 2013
    Gender
    male
    Location
    R'lyeh
    Posts
    2,554
    Reputation
    619
    Thanks
    1,807
    Quote Originally Posted by MikeRohsoft View Post
    Adds some Improvements and I've added a Screenshot with previous - after compare
    Oh I see. Seems like it's not working for me

    prev. Names: HΔSTUR ▬ Sound.

  11. #9
    MikeRohsoft's Avatar
    Join Date
    May 2013
    Gender
    male
    Location
    Los Santos
    Posts
    797
    Reputation
    593
    Thanks
    26,314
    did u removed the spaces in the Header between the @ and the rest?
    Code:
    // @ name MPGH Code Blocks Syntax Highlight  
    // @ author Mike Rohosft
    // @ grant       GM.setValue
    // @ grant       GM.getValue
    // @ include https://www.mpgh.net/forum/*
    if i put them together, bbcode will mess it up
    Code:
    //  @Name MPGH Code Blocks Syntax Highlight  
    //  @Author Mike Rohosft
    //  @Grant       GM.setValue
    //  @Grant       GM.getValue
    //  @include https://www.mpgh.net/forum/*


    okay, i fixed it :P u can copy it now
    Last edited by MikeRohsoft; 07-30-2019 at 04:31 AM.

  12. The Following User Says Thank You to MikeRohsoft For This Useful Post:

    Vicarious (07-30-2019)

  13. #10
    Vicarious's Avatar
    Join Date
    May 2013
    Gender
    male
    Location
    R'lyeh
    Posts
    2,554
    Reputation
    619
    Thanks
    1,807
    Quote Originally Posted by MikeRohsoft View Post
    did u removed the spaces in the Header between the @ and the rest?
    Code:
    // @ name MPGH Code Blocks Syntax Highlight  
    // @ author Mike Rohosft
    // @ grant       GM.setValue
    // @ grant       GM.getValue
    // @ include https://www.mpgh.net/forum/*
    if i put them together, bbcode will mess it up
    Code:
    //  @Name MPGH Code Blocks Syntax Highlight  
    //  @Author Mike Rohosft
    //  @Grant       GM.setValue
    //  @Grant       GM.getValue
    //  @include https://www.mpgh.net/forum/*


    okay, i fixed it :P u can copy it now
    Thanks. It works now

    prev. Names: HΔSTUR ▬ Sound.

  14. #11
    niggo's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Location
    At home
    Posts
    11,195
    Reputation
    2219
    Thanks
    3,779
    My Mood
    Angelic
    Quote Originally Posted by Silent View Post
    forum upgrade
    heh

    maybe 2030





    26.09.2012 Signed Up
    16.05.2017 Premium Member
    06.05.2018 - 07.08.2019 Publicist
    06.08.2018 - now Middleman
    17.12.2018 - now Marketplace Minion
    07.06.2019 - now Newsforce
    01.08.2019 - now Publicist
    15.08.2019 - now Fortnite Minion
    08.12.2019 - now GTA Marketplace Minion
    03.01.2020 - now Social Engineering Minion
    07.01.2020 - now Minion+
    10.01.2020 - now Cracking Minion
    07.02.2020 - now Head Publicist




    Quote Originally Posted by Snake View Post
    you're the prime of the primes
    if shitposting was transformers you'd be optimus prime and eternity would be bumblebee
    Quote Originally Posted by Organized Chaos View Post
    acoustic retarded cum slut
    = niggo
    Quote Originally Posted by FlavderKrasse View Post
    iM SO FUCKN SAD I GO FOR SUCIDE
    Quote Originally Posted by Hectard View Post
    Am I a racist if i say Nico niggo neee
    Quote Originally Posted by Snolfy44 View Post
    help
    how works it??
    Quote Originally Posted by Demon770 View Post
    How to hack
    Quote Originally Posted by ImThrowingMyLifeAway View Post
    niggo ugly lol
    Quote Originally Posted by Dot View Post
    I cannot wait to see you replying with another stupid reply
    Quote Originally Posted by Bowie View Post
    Stop shitposting for god sakes
    Quote Originally Posted by Poseidon View Post
    You're literally dumb.
    Quote Originally Posted by 71c View Post
    You're literally dumb.
    Quote Originally Posted by 71c View Post
    Stop shitposting for god sakes, You're literally dumb.






  15. #12
    Dave84311's Avatar
    Join Date
    Dec 2005
    Gender
    male
    Location
    The Wild Wild West
    Posts
    35,837
    Reputation
    5782
    Thanks
    41,292
    My Mood
    Devilish
    Would be nice to have this in a vb4 plugin functionality





    THE EYE OF AN ADMINISTRATOR IS UPON YOU. ANY WRONG YOU DO IM GONNA SEE, WHEN YOU'RE ON MPGH, LOOK BEHIND YOU, 'CAUSE THATS WHERE IM GONNA BE


    "First they ignore you. Then they laugh at you. Then they fight you. Then you lose.” - Dave84311

    HAVING VIRTUAL DETOX

  16. #13
    Banana's Avatar
    Join Date
    May 2012
    Gender
    male
    Location
    Too kawaii to live, too sugoi to die
    Posts
    1,012
    Reputation
    268
    Thanks
    8,152
    My Mood
    Amazed
    damn this shit is good, finally codes with colors
    Member - 30/05/2012
    Premium - 01/11/2020
    News Force - 12/05/2019 till 24/02/2021





  17. #14
    Biesi's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Posts
    4,993
    Reputation
    374
    Thanks
    8,808
    My Mood
    Twisted
    Quote Originally Posted by Dave84311 View Post
    Would be nice to have this in a vb4 plugin functionality
    Just include the script, duh

  18. The Following 2 Users Say Thank You to Biesi For This Useful Post:

    Hector (07-31-2019),MikeRohsoft (07-31-2019)

  19. #15
    MikeRohsoft's Avatar
    Join Date
    May 2013
    Gender
    male
    Location
    Los Santos
    Posts
    797
    Reputation
    593
    Thanks
    26,314
    Quote Originally Posted by Biesi View Post


    Just include the script, duh
    I thought it too xD "Can't be so difficult to find the file which adds the class 'bbcode_code' to the pre element and insert there the class 'prettyprint' + this script in the Header", but who knows, maybe it is xD
    To write a vBulletin Module means PHP and my last PHP Script is 16 years ago, better not :P

  20. The Following User Says Thank You to MikeRohsoft For This Useful Post:

    Hector (07-31-2019)

Page 1 of 2 12 LastLast

Similar Threads

  1. How to use the Syntax Highlighter
    By Dave84311 in forum Coders Lounge
    Replies: 19
    Last Post: 05-21-2013, 03:50 AM
  2. [Release] Visual Studio syntax highlighting for Windows types
    By acedcafe in forum C++/C Programming
    Replies: 1
    Last Post: 12-30-2011, 06:19 AM
  3. [Release] MPGH VB Syntax Highlighting.
    By Jason in forum Visual Basic Programming
    Replies: 26
    Last Post: 01-23-2011, 07:25 AM
  4. Test of new syntax highlighting /fmm
    By Kallisti in forum C++/C Programming
    Replies: 4
    Last Post: 01-22-2011, 04:55 PM
  5. [Help]How-to Make Syntax Highlighting
    By Web-Designer in forum Visual Basic Programming
    Replies: 9
    Last Post: 10-06-2010, 06:24 PM