Help with UMIL - adding UCP tab and module

Discussion forum for MOD Writers regarding MOD Development.
Locked
User avatar
BrokenCrust
Registered User
Posts: 62
Joined: Mon Feb 11, 2008 8:43 pm
Contact:

Help with UMIL - adding UCP tab and module

Post by BrokenCrust »

I would like to add a new UCP tab with a new module under it. so I tried this:-

Code: Select all

'module_add' => array(array('ucp', 0, 'UCP_MY_MOD')),
'module_add' => array(array('ucp', 'UCP_MY_MOD', array('module_basename' => 'my_mod'))),
Which gives the error

ERROR: The parent category specified for this module does not exist.

If I add the tab only, it works

Code: Select all

'module_add' => array(array('ucp', 0, 'UCP_MY_MOD')),
If instead of a new tab I add the module to an existing tab it works

Code: Select all

'module_add' => array(array('ucp', 'UCP_MAIN', array('module_basename' => 'my_mod'))),
If I add the tab manually myself and then just add the module to it, then it works

Code: Select all

'module_add' => array(array('ucp', 'UCP_MY_MOD', array('module_basename' => 'my_mod'))),
But I can not seem to add a tab and then a module to it at the same time.

Please can someone help me with the UMIL syntax?

I have phpBB 3.0.10 and UMIL 1.0.4

User avatar
AmigoJack
Registered User
Posts: 5702
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Help with UMIL - adding UCP tab and module

Post by AmigoJack »

[quote="BrokenCrust"]

Code: Select all

'module_add' => ...,
'module_add' => ...,
Array keys have to be unique - you're always overwriting any previous one with the last one if the key is the same. PHP basics. In other words:

Code: Select all

// This is the same...
$a= array
( 'one'=> 1
, 'one'=> 2
, 'one'=> 3
);

// ...as writing this one:
$a= array
( 'one'=> 3
);

// This can be proven by:
print_r( $a ); 
Have a look at phpBB Statistics which also adds its own modules.
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

User avatar
Steve
Registered User
Posts: 1089
Joined: Tue Apr 07, 2009 7:48 pm
Location: UK ,up north!!
Name: Steven Clark
Contact:

Re: Help with UMIL - adding UCP tab and module

Post by Steve »

try this:

Code: Select all

        
'module_add' => array(
    // First, lets add a new category 
            array('ucp', '', 'UCP_MY_MOD'), //Category/tab title 

    // next let's add our module
            array('ucp', 'UCP_USER_MY_MOD', array( // Mode title
                    'module_basename'    => my_mod', //info file name minus ucp_
                    'modes'                => array('my_mod_mode), // Mode set in info file
                ),    
            )
 
Last edited by Steve on Sat Feb 18, 2012 10:15 am, edited 1 time in total.

User avatar
BrokenCrust
Registered User
Posts: 62
Joined: Mon Feb 11, 2008 8:43 pm
Contact:

Re: Help with UMIL - adding UCP tab and module

Post by BrokenCrust »

Thanks, I've sorted it. I knew it would be something obvious. Looking too much at UMIL and not enough at PHP. :oops:

User avatar
michaelo
Registered User
Posts: 1292
Joined: Thu Jun 13, 2002 3:49 am
Location: Dublin, Ireland
Name: Michael O'Toole
Contact:

Re: Help with UMIL - adding UCP tab and module

Post by michaelo »

What's the file structure for ucp modules?

The acp has changed to not require the info folder as all files are in the acp root..
For example: ...acp\my_filename_module.php & ...acp\my_filename_ino.php, is this true for ucp?

When I try to add ucp modle I get: A required module info file is missing: \myextension\balh\ucp\ucp_my_filename...

I'm also assuming the ucp files go into: extension_name\extension\ucp ...
Contributions: Mods & Styles Extensions
(site is down): Kiss Portal Engine

Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 26045
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Help with UMIL - adding UCP tab and module

Post by Paul »

Are you talking about 3.0 or 3.1?
In 3.0 is nothing changed, and the info folder is still there. In 3.1 it is changed, however UMIL should/can't be used with 3.1.
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development

User avatar
michaelo
Registered User
Posts: 1292
Joined: Thu Jun 13, 2002 3:49 am
Location: Dublin, Ireland
Name: Michael O'Toole
Contact:

Re: Help with UMIL - adding UCP tab and module

Post by michaelo »

Sorry Paul, looks like posted in wrong forum... I was reading so many post I got lost :oops:
Contributions: Mods & Styles Extensions
(site is down): Kiss Portal Engine

Locked

Return to “[3.0.x] MOD Writers Discussion”