Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to inject code in 'switch' statement?
#1
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?
Reply
#2
You cannot do this (inject) in any programming language that I know.
Best regards, Peter.
PHP Developer.


#gitlab #myplugins
Reply
#3
Is it possible to do this with a plugin instead of editing the core file though?
Reply
#4
^ 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 ..
Reply
#5
Depends where you want to insert it, there is so much code in that file.

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


Forum Jump:


Users browsing this thread: 1 Guest(s)