![]() |
Configuring a new field via usercp (user)
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); 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 |
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...
|
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'])) 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 :) |
In plugin: forumdata_start put this code in it to make a valid field.
$this->validfields['mloginexempt'] = array(TYPE_BOOLEAN, REQ_NO); |
Quote:
Will changing it as you indicate also mean that it will work both in the admincp and could be read anywhere else? |
All times are GMT. The time now is 03:47 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|