MyBB Community Forums

Full Version: How to inject code in 'switch' statement?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I would like to add the following code in inc/class_parser.php using a plugin, but I don't know how.
case "bilibili":
    // https://www.bilibili.com/video/av34623787/
    $id = substr($path[2], 2);
    break;


Can anyone help me please?
You cannot do this (inject) in any programming language that I know.
Is it possible to do this with a plugin instead of editing the core file though?
^ have you tried using patches plugin (changing plugin compatibility to try it on MyBB 1.8.x)

wrt your earlier related thread, have you tried making a MyCode for it or tried modifying js as effone suggested ..
Depends where you want to insert it, there is so much code in that file.

Hook at parse_message_me_mycode instead.
@.m. I completely forgot to try making a MyCode. That worked, thank you!