The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
||||
|
||||
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') . '";'); } oh and the template jon I have: Code:
<label for="usergroups"> <input type="checkbox" name="" value="" id="" tabindex="1" />$der2 </label> 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') . '";'); } Code:
<label for="usergroups"> <input type="checkbox" name="groupID" value="$groupID" id="" tabindex="1" />$grouptitle </label> Code:
$vbulletin->input->clean_array_gpc('p', array('groupID' => TYPE_ARRAY)); echo $vbulletin->GPC['groupID']; --------------- 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 . " "; } |
#12
|
||||
|
||||
You're making it so complicated...
PHP Code:
HTML Code:
<label for="usergroups"> <input type="checkbox" name="groupID" value="$usergroup[usergroupid]" id="" tabindex="1" />$usergroup[title] </label> |
#13
|
||||
|
||||
lol, ya I always do it seems
So if I'm trying to pull all email address who are IN those $usergroupids Code:
$usergroups = $vbulletin->db->query_read(" SELECT usergroup.usergroupid, usergroup.title, user.email FROM " . TABLE_PREFIX . "usergroup AS usergroup, user AS user WHERE usergroup.usergroupid IN ($usergroupids) "); UPDATE: ( 9:33pm) Ok I've been working on this. Instead of the query going in the form complete, I'm putting it in there newthread post complete: Here is my updated code. It wont work though. Code:
$vbulletin->input->clean_array_gpc('p', array('groupID' => TYPE_ARRAY)); foreach ($vbulletin->GPC['groupID'] AS $id) { $ids = $id; } $usergroups2 = $vbulletin->db->query_read(" SELECT email FROM " . TABLE_PREFIX . "user WHERE usergroupid IN ($ids) "); while ($usergroups3 = $vbulletin->db->fetch_array($usergroups2)) { //send to my email to test if subject line is parsing variables vbmail("my_email_was_here.net", $usergroups3['email'], $message); } |
#14
|
|||
|
|||
Funny, I am kinda trying to do the same thing.. I want a page that shows the second membergroupids 'id' and tells me the title.
Johns Membergroup Ids is: 12, 31 I want it to pick up '31' and tell me the title for '31'. Any Ideas |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|