MyBB Community Forums
How to use function from mybb in custom file? - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Development (https://community.mybb.com/forum-68.html)
+---- Thread: How to use function from mybb in custom file? (/thread-186469.html)



How to use function from mybb in custom file? - Qiao - 2015-11-19

I need to custom move threads.

I see "move_threads()" functions in class_moderation.php that I want to use.
How do I include it in empty php file?

I tried
include('inc/init.php');
include('global.php');
but it returns "Please make sure IN_MYBB is defined".

How it should be done?


RE: How to use function from mybb in custom file? - Sazze - 2015-11-19

I'd use this instead:

define("IN_MYBB", 1);
require_once MYBB_ROOT."inc/init.php";
require_once "./global.php";



RE: How to use function from mybb in custom file? - Qiao - 2015-11-20

Yep, thanks.

I just realized i could see it in any real php page-file in mybb.