The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
I'm having a bit of trouble.
I'm writing a mod where I'd like to alter a new field in the user table via the edit user page of the admincp. I added the relevant phrases and then added this to the useradmin_edit_column2 hook: Code:
print_table_break('', $INNERTABLEWIDTH);
print_table_header($vbphrase['ae_header']);
print_yes_no_row($vbphrase['ae_user_exempt_option'], 'user[mloginexempt]', $user['mloginexempt']);
Quote:
I tried adding this to useradmin_edit_start: Code:
$user = array_merge($user, array('mloginexempt' => 0));
Does anyone know what the missing piece of code might be, and the hook where I should place it? This could be useful for anyone else who tries to add an additional option to the edit user function of the admincp. Mark |
|
#2
|
|||
|
|||
|
Anyone? This isn't really an obvious question, so was hoping someone with a bit more experience might be able to shed some light on this...
|
|
#3
|
|||
|
|||
|
Finally managed to solve this, and thought I'd share this here for anybody else who tries the same thing.
After several hours of sifting through tutorials, I found this one about adding bitfields. I read through it and eventually figured out that I could adapt it to non-bitfield options. Therefore all I was missing was this code: Code:
if (!isset($this->validfields['mloginexempt']))
{
$this->validfields['mloginexempt'] = array(TYPE_BOOLEAN, REQ_NO);
}
Yes, I know, I probably should have used a bitfield for this, but I'm just adding this on at the end. I'll know better for next time
|
|
#4
|
|||
|
|||
|
In plugin: forumdata_start put this code in it to make a valid field.
$this->validfields['mloginexempt'] = array(TYPE_BOOLEAN, REQ_NO); |
|
#5
|
|||
|
|||
|
Quote:
Will changing it as you indicate also mean that it will work both in the admincp and could be read anywhere else? |
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|