Does anyone know any good tutorials for making ACP modules?
Also how do you make a radio form in the ACP module?
Good Tutorial for Making ACP Modules
Forum rules
Please post any phpBB 3.1.x related topics in the phpBB 3.1.x discussion forum.
Please post any phpBB 3.1.x related topics in the phpBB 3.1.x discussion forum.
Re: Good Tutorial for Making ACP Modules
Here's one tutorial on STG...
http://startrekguide.com/community/viewtopic.php?f=50&t=9465
Mostly, you've got to wing it when you're writing it, and just have fun. Learn from the errors you get.
Here's a little breakdown for what that class includes.
http://startrekguide.com/community/viewtopic.php?f=50&t=9465
Mostly, you've got to wing it when you're writing it, and just have fun. Learn from the errors you get.
Here's a little breakdown for what that class includes.
Code: Select all
class acp_foo // Class name. Always have the acp_ prefix! This should be the same name as the file it is in.
{
var $u_action; // Just leave this in here.
var $new_config;
function main($id, $mode) // The main function. This is called when the ACP module is loaded
{
global $db, $user, $auth, $template; // Globaling in the phpBB classes...
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
switch($mode) // We're switching between modes here.
{
case 'index':
$this->page_title = 'ACP_FOO'; // Set the page title to be the contents of $user->lang['ACP_FOO']
$this->tpl_name = 'acp_foo'; // This gets us to use the ACP template file named acp_foo.html
break;
}
}
}
Re: Good Tutorial for Making ACP Modules
Thanks I'll check that out, also how do I make a MOD show, I don't get how you set up permissions for it.
Re: Good Tutorial for Making ACP Modules
comkid wrote:also how do I make a MOD show
If you mean module show, you simply add it like any other module, under the system tab.
I don't get how you set up permissions for it.
For actually adding permissions: http://phpbbmodders.net/articles/3.0/permissions/
To require a certain permission to view the module, you change the 'auth' parameter in the info file. For example.
Code: Select all
<?php
/**
*
* @package acp
* @version $Id: acp_main.php 8479 2008-03-29 00:22:48Z naderman $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @package module_install
*/
class acp_main_info
{
function module()
{
return array(
'filename' => 'acp_main',
'title' => 'ACP_INDEX',
'version' => '1.0.0',
'modes' => array(
'main' => array('title' => 'ACP_INDEX', 'auth' => 'acl_my_permission', 'cat' => array('ACP_CAT_GENERAL')),
),
);
}
function install()
{
}
function uninstall()
{
}
}
?>
See 'auth' => 'acl_my_permission', just change acl_my_permission to the permission name.
Re: Good Tutorial for Making ACP Modules
I don't get how to add permissions to Modules
-
- Past Contributor
- Posts: 79
- Joined: 14 Jun 2009, 16:29
- Real name: Sam
- Location: Sacramento, CA, USA
- Contact:
Re: Good Tutorial for Making ACP Modules
You see where it says " 'auth' => 'acl_my_permission' "? the acl_my_permission is the auth, you have to make a plugin to be able to use it. When you first start off making modules, I would recommend using one you find in another module to avoid having to figure out how to make the auth plugins right away.
Re: Good Tutorial for Making ACP Modules
Well I want to make a form in ACP to set up its own permissions so how would I do?
I was thinking of using the $config.
I was thinking of using the $config.
Re: Good Tutorial for Making ACP Modules
I'm not sure what you are asking, but to add permissions, there is a good tutorial on the Wiki: http://wiki.phpbb.com/Permissions
You would not want to use the config table for permissions...
You would not want to use the config table for permissions...