Well, I've figured out this much on my own from tearing apart the admincp/profilefield.php script.
PHP Code:
$db->query_write(fetch_query_sql($vbulletin->GPC['profilefield'], 'profilefield'));
$vbulletin->GPC['profilefieldid'] = $db->insert_id();
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "userfield ADD field{$vbulletin->GPC['profilefieldid']} MEDIUMTEXT NOT NULL");
$db->query_write("OPTIMIZE TABLE " . TABLE_PREFIX . "userfield");
$db->query_write("
UPDATE " . TABLE_PREFIX . "profilefield SET
type = 'radio',
data = '" . $db->escape_string('a:2:{i:0;s:7:"Enabled";i:1;s:8:"Disabled";}') . "',
def = 0,
form = 3,
searchable = 0,
memberlist = 0
WHERE profilefieldid = " . $vbulletin->GPC['profilefieldid'] . "
");
$db->query_write("
REPLACE INTO " . TABLE_PREFIX . "phrase
(languageid, fieldname, varname, text, product, username, dateline, version)
VALUES
(
0,
'cprofilefield',
'field" . $db->escape_string($vbulletin->GPC['profilefieldid']) . "_title',
'" . $db->escape_string('Enable Quote Truncation') . "',
'vbulletin',
'" . $db->escape_string('deadbydawn') . "',
" . TIMENOW . ",
'" . $db->escape_string($vbulletin->options['templateversion']) . "'
),
(
0,
'cprofilefield',
'field" . $db->escape_string($vbulletin->GPC['profilefieldid']) . "_desc',
'" . $db->escape_string('This will automatically hide large amounts of text inside of a quote, similar to a spoiler tag') . "',
'vbulletin',
'" . $db->escape_string('deadbydawn') . "',
" . TIMENOW . ",
'" . $db->escape_string($vbulletin->options['templateversion']) . "'
)
");
This works, but it leaves me with a question:
I need to be able to know which field is created with this process so that I can reference it later within the template as well as the uninstall script. I know that it is stored during the install as $vbulletin->GPC['profilefieldid'], but is there any way I can "store" that? It would be very convenient if there was a way I could reference that variable when creating the TEMPLATE.
The only thing I can think of is creating another db table that stores it, but that seems like overkill to me, and certainly isn't something I would want to add to something that hooks into the ShowThread_complete hook. Any other suggestions?