The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
I have the Form Hack installed and have a question that I'm hoping someone can answer with relative ease since I'm not getting a response from the developer. My question happens to be basic PHP/HTML, but since I'm not a developer, I can't figure out the issue.
I'm trying to associate values (numeric) based on a selection of a dropdown. The numeric variable is associated to a thread ID wherease the dropdown selection is a recognizable name. Here's the default code: Code:
<select name="dropdownanswer1"> <option value="$dropdownchoice1a" <if condition="$dropdownchoice1a == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1a</option> </select> Code:
<option value="$dropdownthreadID" <if condition="$dropdownchoice1a == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1a</option> $dropdownthreadID = 100 $dropdownchoice1a = Monday These variables are called within a newthread_start plugin. Code:
//EXISTING THREAD ID FOR FORM TO REPLY IN $formreplythreadid = "$dropdownanswer1"; Any help would be appreciated! |
|
#2
|
|||
|
|||
|
woowww.. and what hack is this originally from?
|
|
#3
|
|||
|
|||
|
Uhh...read the first sentence.
|
|
#4
|
|||
|
|||
|
aww that hack is garbage. I tried it and it made a Generic Form which i couldn't even access
|
|
#5
|
||||
|
||||
|
Quote:
|
|
#6
|
|||
|
|||
|
Hey Ctrl Alt Del,
You ever have any luck with this? I got the form to work flawlessly http://www.adversaryguild.com/forums...ad.php?do=form, but I would really like the thread that the reply goes to be based on the reponse of one of the dropdown selections. I've tried making a hidden field: Code:
<input type="hidden" name="threadrepid" value="$dropdownanswer1" /> Code:
$formreply = "1";
//$formreplythreadid = $posttid;
if ($threadrepid == $dropdownanswer1b)
{
$formreplythreadid = "41";
}
if ($threadrepid == $dropdownanswer1c)
{
$formreplythreadid = "42";
}
if ($threadrepid == $dropdownanswer1d)
{
$formreplythreadid = "45";
}
I even assigned the vars as suggested - so they could be read into the array properly: Code:
'threadrepid' => TYPE_STR, $threadrepid = $vbulletin->GPC['threadrepid'];
|
|
#7
|
|||
|
|||
|
Since I'm not a programmer, I didn't have much success either so I just did it a redundant and manual way. Here's an example:
Code:
$cust["15"] = "Title 1"; $cust["16"] = "Title 2"; $cust["17"] = "Title 3"; $dropdowncust1 = "15"; $dropdowncust2 = "16"; $dropdowncust3 = "17"; Then in the form, Code:
<option value="$dropdowncust1" <if condition="$dropdowncust1 == $dropdownanswercust">selected="selected"</if>>$cust[15]</option> <option value="$dropdowncust2" <if condition="$dropdowncust2 == $dropdownanswercust">selected="selected"</if>>$cust[16]</option> <option value="$dropdowncust3" <if condition="$dropdowncust3 == $dropdownanswercust">selected="selected"</if>>$cust[17]</option>
|
|
#8
|
|||
|
|||
|
Hey,
Thanks for the quick reply. I "think" I figured it out after much cussing lol... I wound up NOT having to declare any new variables, and NOT having to modify the "form" style. All I did was pretty much what I had been working on previously, but called it slightly differently since the calls I was making were causing SQL to panic because of the array usage. Here's the code if you're interested: Code:
//ENABLE FORM TO REPLY TO EXISTING THREAD - 1 = yes, 0 = no
$formreply = "1";
if ($dropdownanswer1 == 'Mage'){
$formreplythreadid = "43";}
if ($dropdownanswer1 == 'Warlock'){
$formreplythreadid = "34";}
if ($dropdownanswer1 == 'Warrior'){
$formreplythreadid = "41";}
if ($dropdownanswer1 == 'Rogue'){
$formreplythreadid = "42";}
if ($dropdownanswer1 == 'Priest'){
$formreplythreadid = "40";}
if ($dropdownanswer1 == 'Hunter'){
$formreplythreadid = "46";}
if ($dropdownanswer1 == 'Paladin'){
$formreplythreadid = "45";}
if ($dropdownanswer1 == 'Shaman'){
$formreplythreadid = "44";}
//EXISTING THREAD ID FOR FORM TO REPLY IN
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|