I start for about 25 years with an TI and learned Basic. Next was an Commodere 64, Amiga. On Amiga I learned Assembler and wrote some Games. Many years later again, I learned myself (without book ...) php,html and javascript. Then I wrote some small
Since vB4 is out, there are 2 new unfinished settings. At this moment those settings aren't used by vB4. I've asked in the bugtracker, but get no answer 'bout this.
I wrote my own solution to finish up those 2 settings and hope that this will be implemented in one of the next versions. I've attached a image to, see what I mean.
Ok, let's start (remember: this is a beta solution).
1st extend the database
ALTER TABLE `vb4_setting` CHANGE `datatype` `datatype` ENUM( 'free', 'number', 'boolean', 'bitfield', 'username', 'integer', 'posint', 'arrayinteger', 'arrayfree' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'free'
2nd create two new GLOBAL phrases
title = datatype_arrayinteger phrase = Array Integer
title = datatype_arrayfree phrase = Array Free
The next parts is to change 3 files:
open admincp/options.php
search for:
PHP Code:
case 'username':
$checked= array('username' => ' checked="checked"');
break;
add below:
PHP Code:
case 'arrayinteger':
$checked= array('arrayinteger' => ' checked="checked"');
break;
case 'arrayfree':
$checked= array('arrayfree' => ' checked="checked"');
break;
if (trim ($setting['datatype']) == 'arrayinteger' OR trim ($setting['datatype']) == 'arrayfree')
{
$store = array ();
if (is_array (explode (',', trim ($setting['defaultvalue']))))
{
foreach (explode (',', trim ($setting['defaultvalue'])) AS $value)
{
$store[] = $value;
}
}
$setting['defaultvalue'] = serialize ($store);
}
Ok, with this changes you can have those settings working now.
How to use those options ?
In your product (under the settingsgroup) you can now have two more options:
This is example one:
Quote:
<setting varname="multiinput_choose" displayorder="20">
<datatype>arrayfree</datatype>
<optioncode>multiinput</optioncode>
<defaultvalue>Hello up there,where on the air,it's hockey night tonight</defaultvalue>
</setting>
The optioncode is only multiinput and the datatype MUST be arrayfree or arrayinteger.
The next example is selectmulti:eval
Quote:
<setting varname="multiselect_choose" displayorder="10">
<datatype>arrayinteger</datatype>
<optioncode>selectmulti:eval
$options = array (
'0' => 'you can choose what you want',
'1' => 'this is a multiselect field',
'2' => 'choose one or more',
'3' => 'option if you like',
'4' => 'this option wont work',
'5' => 'in a standard',
'6' => 'vBulletin 4.0.1',
); </optioncode>
<defaultvalue>1,3,4</defaultvalue>
</setting>
Here also you have to use arrayfree or arrayinteger. Others won't work !
I really hope, that those options are available in a further version of vB4.
This is to finish an incomplete implementation of the 'arrayinteger' and 'arrayfree' option data types. It's vB 4.1.5 now and this still is not finished in the core. Absolutely ridiculous.
i was going to post this bug, but found ur thread..
its disappointing that it is not fix yet in main core files. have to create now a new admincp page for one setting.