The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Comments |
#962
|
|||
|
|||
Hi,
This works great for posting into one forum, but I'm having a problem figuring out how to get it to post to various forums depending on the value selected from the drop-down. What I am trying to achieve is this : If dropdownanswer1 = dropdownchoice1a then formforumid="59" If dropdownanswer1 = dropdownchoice1b then formforumid="26" I have about 18 different forums where this form will be used, I only have 3 in the templates for now for testing. Can't seem to figure out whether the problem lies in the hook, or whether there needs to be some template mod. Anything I try results in either a parse error or a scalar value error. Any help appreciated. Thx. PHP Code:
HTML Code:
$stylevar[htmldoctype] <html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]"> <head> $headinclude <title>$vboptions[bbtitle] - $formtitle</title> </head> <body> $header $navbar <!-- main --> <br /> <form enctype="multipart/form-data" method="post" action="newthread.php"> <input type="hidden" value="$formname" name="do" /> <input type="hidden" value="submit" name="action" /> <input type="hidden" value="$forumid" name="f" /> <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="60%" align="center"> <tr> <td class="tcat" colspan="2"> $vboptions[bbtitle] - $formtitle </td> </tr> <tr> <td class="panelsurround" align="center" colspan="2"> <table class="panel" cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%"> <tr> <td align="$stylevar[left]"> <fieldset class="fieldset" style="margin:0px"> <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0"> <tr> <td> $formpurpose </td> </tr> </table> </fieldset></td> </tr> </table></td> </tr> <tr> <td width="50" valign="middle" class="alt1"> <b>Username</b></td> <td class="alt1" valign="middle"> <b>$bbuserinfo[username]</b></td> </tr> <tr> <td class="alt1" valign="middle" colspan="2"> </td> </tr> </tr> <tr> <td class="alt1" valign="middle"> <b>$dropdownquestion1</b>: </td> <td class="alt1" valign="middle"> <select name="dropdownanswer1"> <option value="$dropdownchoice1a" <if condition="$dropdownchoice1a == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1a</option> <option value="$dropdownchoice1b" <if condition="$dropdownchoice1b == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1b</option> <option value="$dropdownchoice1c" <if condition="$dropdownchoice1c == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1c</option> </select></td> </tr> <tr> <td colspan="2" valign="middle" class="alt2"> </td> </tr> <tr> <td colspan="2" valign="middle" class="alt2"> <b>$question1</b></td> </tr> <tr> <td colspan="2" valign="middle" class="alt1"><span class="alt2"> <input name="answer1" type="text" value="" size="70"> </span></td> </tr> <tr> <td class="alt2" valign="middle" colspan="2"> </td> </tr> <tr> <td colspan="2" valign="middle" class="alt2"><b>$question2</b></td> </tr> <tr> <td colspan="2" valign="middle" class="alt1"><span class="alt2"> <input name="answer2" type="text" value="" size="70"> </span></td> </tr> <tr> <td class="alt2" valign="middle" colspan="2"> </td> </tr> <tr> <td class="alt2" valign="middle" colspan="2"><b>$longquestion1</b></td> </tr> <tr> <td colspan="2" valign="middle" class="alt1"><textarea rows="10" cols="70" name="longanswer1"></textarea> </td> </tr> <tr> <td class="alt2" valign="middle" colspan="2"> </td> </tr> <tr> <td class="alt1" valign="top" colspan="2"> <p align="center"> <input type="submit" value="Submit" name="submit" style="font-family: Verdana; font-size: 10pt" class="button" /> <input type="reset" value="Reset" name="reset" style="font-family: Verdana; font-size: 10pt" class="button" /> </p></td> </tr> </table> </form> $footer </body> </html> Code:
Letter placed by: $bbuserinfo[username] ----------------------------------------------------- To the Leaders of $dropdownanswer1 ----------------------------------------------------- From: $answer1 ----------------------------------------------------- Subject : $answer2 ----------------------------------------------------- $longanswer1 |
#963
|
|||
|
|||
Usergroup Question
PHP Code:
Also, once the form is completed, I'd like to add a line at the end of the form to add them to a different "Additional Usergroup". Any help would be appreciated and I'll gladly send you $10 via paypal if you coding makes this work. Thanks, Nick |
#964
|
||||
|
||||
Quote:
PHP Code:
|
#965
|
|||
|
|||
Abe1,
You are good. That definitely did the trick. Just PM me with an email to send the Paypal donation. I did have a 2nd request in that message though, I'm guessing you missed it. Quote:
I'll put ADD_MEMBERGROUPIDS_HERE; for where I'd like to add it in my code. PHP Code:
Thanks again for your help! |
#966
|
||||
|
||||
Quote:
I must have missed the 2nd part. It would take a while ot make the other thing. |
#967
|
|||
|
|||
Any info on the drop-down ? This has been asked in this thread so many times (not just by me) but no answers. As I said in my post above, it works fine for posting to a single pre-defined forumid.
Would I just be best just hard-coding the template with the drop-choices and then passing the forum ID back instead of the choices ? I'm at a loss of the best way to go about this. thx. |
#968
|
|||
|
|||
Abe1,
Just curious, for adding to a Membergroupids, could we just reuse the code you gave me for checking to see if someone is in a Membergroup and then instead of "print_no_permission();" -- you could instead say add that membergroupid to this user? Something like this (12 being the secondary member group I want to add the user to if they answer correctly): PHP Code:
The other thing I tried was something Amy had posted for adding to a secondary group. Sadly it gave a Fatal error: Call to a member function on a non-object in ..../newthread.php(68) : eval()'d code on line 403. I know I missed setting a variable, but just not sure what one and what to set there. PHP Code:
|
#969
|
|||
|
|||
Hi, great hack, have it installed and its working except for Unregistered users. I have tested it with other usegroups and it works fine but guests form inputs simply arent processed. The thread is created but the thread does not have any content. I have set all the permissions for guests to allow them to post in the thread where the form should submit the output of the form but it just creates a thread with nothing in them except "Unregistered". Any ideas? I have set the permissions correctly, I am pretty sure. Any chance of some assistance please
If you look at the attachment, you will see how it looks like, all screwed up Thank you. |
#970
|
|||
|
|||
Quote:
|
#971
|
|||
|
|||
Just got this hack installed and configured for one form how I wanted it. Nice work Abe1, just what I needed!
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|