Right I did. In newthread template I have $der2 for example.
Then this is part of the code from earlier.
Code:
$usergroupdata = array();
while ($usergroup = $vbulletin->db->fetch_array($usergroups))
{
$usergroupdata[$usergroup['usergroupid']] = $usergroup['title'];
$der2 = $usergroup['title'];
eval('$der .= "' . fetch_template('jon') . '";');
}
But see I need the title and ID from each usergroup. The ID would get associated with the checkbox name or value I'm guessing. Then the usergroup title would just be listed to each checkbox
oh and the template jon I have:
Code:
<label for="usergroups">
<input type="checkbox" name="" value="" id="" tabindex="1" />$der2
</label>
--------------- Added [DATE]1239283376[/DATE] at [TIME]1239283376[/TIME] ---------------
Hmm, changed it around cuz I found some issues with my code (idiot) doh.
newthread form complete hook
Code:
$usergroupdata = array();
while ($usergroup = $vbulletin->db->fetch_array($usergroups))
{
//Assign group title to $grouptitle variable
$usergroupdata[$usergroup['title']] = $usergroup['title'];
$grouptitle = $usergroupdata[$usergroup['title']];
//Assign group ID to $groupID variable
$usergroupdata[$usergroup['usergroupid']] = $usergroup['usergroupid'];
$groupID= $usergroupdata[$usergroup['usergroupid']];
eval('$der .= "' . fetch_template('jon') . '";');
}
Jon template:
Code:
<label for="usergroups">
<input type="checkbox" name="groupID" value="$groupID" id="" tabindex="1" />$grouptitle
</label>
newthread post complete hook
Code:
$vbulletin->input->clean_array_gpc('p', array('groupID' => TYPE_ARRAY));
echo $vbulletin->GPC['groupID'];
At least its displaying so far.
--------------- Added [DATE]1239285415[/DATE] at [TIME]1239285415[/TIME] ---------------
I think I got it to display all ID's that I check!
My newthread post complete hook was wrong. This works. Maybe you can double check to make sure its written correctly though. Also, what if I needed to get all email address from users associated with each checkbox. Wouldnt' I just do a left join on that original query?
Code:
$vbulletin->input->clean_array_gpc('p', array('groupID' => TYPE_ARRAY));
foreach ($vbulletin->GPC['groupID'] AS $id)
{
echo $id . " ";
}