2018-10-21, 09:25 AM
Hello,
I am working on a plugin that grants the user an award randomly based on a percent. I want the admin to be able to add as many random award entries as he wants. I have done all of this but the problem is that I can't get the admin module page to display.
I've added a new menu item to config module in the ACP and whenever I click the menu item it just redirects me to index.php?module=config.
In my plugin file I have this:
The file rndaward.php is located in admin/modules/config but it doesn't seem to work, I have tried doing some random stuff inside the rndaward.php and even copying some other module file from a different plugin but the page still won't display, it just stays on index.php?module=config
Here is a demo of what is happening: https://i.gyazo.com/5fb2a9270d0abdb192b1...862c71.mp4
Anyone know what's up?
I am working on a plugin that grants the user an award randomly based on a percent. I want the admin to be able to add as many random award entries as he wants. I have done all of this but the problem is that I can't get the admin module page to display.
I've added a new menu item to config module in the ACP and whenever I click the menu item it just redirects me to index.php?module=config.
In my plugin file I have this:
if(defined('IN_ADMINCP')) {
$plugins->add_hook('admin_config_menu', 'randomaward_admin_submenu');
$plugins->add_hook('admin_config_action_handler', 'randomaward_admin_action_handler');
} else {
$plugins->add_hook("newreply_do_newreply_end", "randomaward");
}
function randomaward_admin_submenu(&$args) {
$args[] = array(
"id" => "randomaward",
"title" => "Random Awards",
"link" => "index.php?module=config-randomawards"
);
}
function randomaward_admin_action_handler(&$args) {
$args['randomaward_vars'] = array(
"active" => "randomaward",
"file" => "rndaward.php"
);
}
The file rndaward.php is located in admin/modules/config but it doesn't seem to work, I have tried doing some random stuff inside the rndaward.php and even copying some other module file from a different plugin but the page still won't display, it just stays on index.php?module=config
Here is a demo of what is happening: https://i.gyazo.com/5fb2a9270d0abdb192b1...862c71.mp4
Anyone know what's up?