vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Forms Hack (https://vborg.vbsupport.ru/showthread.php?t=93970)

Heaven 04-09-2006 09:24 PM

If I change the following line:
$newpost['username'] =& $vbulletin->userinfo['username'];

to
$newpost['username'] = 'Anonymous';

Will the author of the posted thread always be Anonymous? That's what I'm looking to do. Sorry for the dumb question, I'm not a coder.

Abe1 04-09-2006 10:36 PM

Quote:

Originally Posted by Heaven
If I change the following line:
$newpost['username'] =& $vbulletin->userinfo['username'];

to
$newpost['username'] = 'Anonymous';

Will the author of the posted thread always be Anonymous? That's what I'm looking to do. Sorry for the dumb question, I'm not a coder.

Nope. Unless that is a real user I think.

MrPatience 04-10-2006 09:16 PM

Thanks Abe1 for this hack, it is great! Just installed few days ago and it is working perfect.

I have only a question. Sorry if this has been answered before, I searched through the thread and didnt find an answer... I'm running a non-English forum, and I tried to translate the buttons to Send, Reset and Preview form. But when I try things like this:

HTML Code:

<input type="submit" value="Enviar" name="submit" style="font-family: Verdana; font-size: 10pt" class="button" />
<input type="submit" value="Previsualizar" name="submit" style="font-family: Verdana; font-size: 10pt" class="button" />
<input type="reset" value="Reiniciar" name="reset" style="font-family: Verdana; font-size: 10pt" class="button" />

then the Reset button does not seem to work, and clicking on Enviar(Submit) does a preview (and the thread is not posted). What am I doing wrong?

Thanks in advance

Abe1 04-11-2006 12:06 AM

Quote:

Originally Posted by MrPatience
Thanks Abe1 for this hack, it is great! Just installed few days ago and it is working perfect.

I have only a question. Sorry if this has been answered before, I searched through the thread and didnt find an answer... I'm running a non-English forum, and I tried to translate the buttons to Send, Reset and Preview form. But when I try things like this:

HTML Code:

<input type="submit" value="Enviar" name="submit" style="font-family: Verdana; font-size: 10pt" class="button" />
<input type="submit" value="Previsualizar" name="submit" style="font-family: Verdana; font-size: 10pt" class="button" />
<input type="reset" value="Reiniciar" name="reset" style="font-family: Verdana; font-size: 10pt" class="button" />

then the Reset button does not seem to work, and clicking on Enviar(Submit) does a preview (and the thread is not posted). What am I doing wrong?

Thanks in advance

I;m not really sure. I believe I have these values hard coded into the hook for submission. I'm not sure why the rest whould not work though.

mcgrco 04-11-2006 01:01 PM

Hi, I'm currently working for the Medcorps NGO on a project that's allows cambodian doctors to communicate with a network of international doctors. http://www.medicorps.com/updates/cambodia.html
i have only got programming experience in MS Access VBa and implemented a solution using access with outlook integration. Although this works on small scale the project really should be online so it can be rolled out across Cambodia and many other poor countries. The key to its success is the simplicity of the input forms for the doctors. i.e pull down list and simple text boxs should be used to create the first post. the doctors have little or no computer expereince so this is really vital to sucess.

I am in the process of installing the vbulletin softwear which the company kindly donated to Medicorps. Is there anyone out there that could provide guidance to a vbulletin newbi on how i can get my access forms on the web. My concern is that the form is very long (its tabbed in access) and i have no web design experience. Any help is greatfully appreciated.
Thanks in advance

ca99uk 04-11-2006 04:20 PM

Hello Abe,

Just want to say thank you for all your hardwork with this hack. Subscription now works great and it does exactly what I needed. Fantastic hack, great dev...

Thanks!!!!

Mindwarp 04-11-2006 06:12 PM

ok so I know I have to be missing an easy step. But I got this stupid flu and I just can't think straight today.

I created another form and named it ModApp but when I goto

http://www.mysite.com/board/newthread.php?do=ModApp

I get
Quote:

Invalid Forum specified. If you followed a valid link, please notify the administrator

Abe1 04-11-2006 10:55 PM

Quote:

Originally Posted by Mindwarp
ok so I know I have to be missing an easy step. But I got this stupid flu and I just can't think straight today.

I created another form and named it ModApp but when I goto

http://www.mysite.com/board/newthread.php?do=ModApp

I get

It may be conflicting with another hack.

akanevsky 04-11-2006 11:01 PM

Why does this hack integrate such a large block of code into a single showthread hook? It'd be much more practical if you had this in a separate file. It would also make this hack more compatible with others... :(

TheFocusElf 04-11-2006 11:08 PM

I want to thank you Abe, in this case it is not just enough to "click install," my friend had me install it on his MMORPG clan's website with some minor edits of my own (just to modifiable code that you indicated in the file), and he writes me daily telling me how nice it has made his "clan's" recruiting go.

So I am passing it on.

-Scott

Abe1 04-12-2006 02:05 AM

Quote:

Originally Posted by Psionic Vision
Why does this hack integrate such a large block of code into a single showthread hook? It'd be much more practical if you had this in a separate file. It would also make this hack more compatible with others... :(

Sorry, when making a hack for vb3.5, only if I really need another file do I add one.

Abe1 04-12-2006 02:11 AM

Quote:

Originally Posted by TheFocusElf
I want to thank you Abe, in this case it is not just enough to "click install," my friend had me install it on his MMORPG clan's website with some minor edits of my own (just to modifiable code that you indicated in the file), and he writes me daily telling me how nice it has made his "clan's" recruiting go.

So I am passing it on.

-Scott

Glad to hear :)

akanevsky 04-12-2006 11:00 AM

Quote:

Originally Posted by Abe1
Sorry, when making a hack for vb3.5, only if I really need another file do I add one.

Even though you don't need to add another file to make this work, I think some coders here - including me - would appreciate it if other people would TRY to avoid making hacks that can conflict with other hacks. In this case, your hack conflicts with my adv.editing options... :(

Abe1 04-12-2006 12:59 PM

Quote:

Originally Posted by Psionic Vision
Even though you don't need to add another file to make this work, I think some coders here - including me - would appreciate it if other people would TRY to avoid making hacks that can conflict with other hacks. In this case, your hack conflicts with my adv.editing options... :(

Is there anything I can do to make it compatable?

mcgrco 04-13-2006 07:03 AM

Firstly, sterling work on this hack. I don't fully appreciate the work you had to put in to it as i don't know how to code but I can appreciate, along with everyone else, the usfulness of such a tool.

Ok, I think I worked out what I need to do with this to get it to work. I assume that I need to edit the xml file to my needs. In a the deep end I guess. Just a couple of quick questions if I might.
I dont know php or html coding but I have some experience with VBA.

Can the form user select which forum the message gets posted to?

Do I need to declare the the variable for each field seperatly. I.e I cant reuse a variable. My form will have over 50 input types so its just a hell of a lot of code.

Given the number of inputs is it possible to split the page in to several pages instead of a continoues form. Not a major if you cant, just wondering.

Many thanks in advance

blacklancer 04-13-2006 03:42 PM

installed! thanks for this. its awesome.

i have a question on the redirection though....i want it to go straight to payments.php when done with the form(i modified it to act as a membership form) so that they can pay. how would i go about doing that??

yayvb 04-15-2006 09:29 AM

Quote:

Originally Posted by Abe1
This would be just about in possable since it's one varible once it's posted.

You know more than me since I'm not a coder plus that makes sense. But it makes me wonder then, how does vbulletin.org do it successfully for their hacks sections??

Abe1 04-16-2006 01:45 AM

Quote:

Originally Posted by blacklancer
installed! thanks for this. its awesome.

i have a question on the redirection though....i want it to go straight to payments.php when done with the form(i modified it to act as a membership form) so that they can pay. how would i go about doing that??

You can do it. You would ahve to find in the plug-in where the url directs. You should edit to where you want.

Abe1 04-16-2006 01:46 AM

Quote:

Originally Posted by yayvb
You know more than me since I'm not a coder plus that makes sense. But it makes me wonder then, how does vbulletin.org do it successfully for their hacks sections??

Give me an example please.

Lucas 04-16-2006 05:07 AM

How can I make all questions apper on form? http://www.l2prodigy.com/forum/newthread.php?do=form
wanna make it like this: http://www.l2-paradise.com/forums/newthread.php?do=form

Abe1 04-16-2006 05:09 AM

Quote:

Originally Posted by LucasG

You have to remove the code from the template.

welo 04-16-2006 05:20 AM

Dunno if you're still taking suggestions but I thought of something that would be a nice little inclusion for this. It would be extremely helpful if we were able to determine which form fields were posted and which were emailed.

This way, for instance, people could submit a form that contains their wishlist and address while only the wishlist gets posted to the forum. The address - which must remain private - would then be sent to the admin. Naturally you'd want options where the content of a field could be either posted, emailed, or both.

Apologies if this has already been mentioned or the ability already exists.

Lucas 04-16-2006 12:59 PM

Quote:

Originally Posted by Abe1
You have to remove the code from the template.

What code from which template?

Abe1 04-17-2006 12:13 PM

Quote:

Originally Posted by LucasG
What code from which template?

called 'form'

Abe1 04-17-2006 12:14 PM

Quote:

Originally Posted by welo
Dunno if you're still taking suggestions but I thought of something that would be a nice little inclusion for this. It would be extremely helpful if we were able to determine which form fields were posted and which were emailed.

This way, for instance, people could submit a form that contains their wishlist and address while only the wishlist gets posted to the forum. The address - which must remain private - would then be sent to the admin. Naturally you'd want options where the content of a field could be either posted, emailed, or both.

Apologies if this has already been mentioned or the ability already exists.

It's possable if you make a new answer template and make a little coding changes. I can't explain right now.

Bounce 04-18-2006 03:24 PM

Hi Abe

Nice work :)
however lol

I'm trying to remove a few of the options ..

I edit out the $ of what i want to edit out

HTML Code:

////////////////////////////////////////////////////////////////////////////////////////////////////
//VARIABLES
//Study how variables are add here to add or remove any. If you add a variable to your form, you must add it to part one and part two.
////////////////////////////////////////////////////////////////////////////////////////////////////

// Part 1
$vbulletin->input->clean_array_gpc('p', array(
'normalanswer1' => TYPE_STR,
'longanswer1' => TYPE_STR
));

// Part 2
$normalanswer1 = $vbulletin->GPC['normalanswer1'];
$longanswer1 = $vbulletin->GPC['longanswer1'];

It removes the text but not the input fields :)

I only want 3 options for the form, how do i remove the input fields and the buttons?

Screenshot

http://www.mcdanieldigital.com/comun...mages/form.jpg

I created the new plugin as per the instructions in the original plugin :confused:

Do I also remove the actual radio Box itself ?

HTML Code:

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 2 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion2 = "Choose another one of the following choices";

// The following choices must NOT have quotation marks
$radiochoice2a = "good";
$radiochoice2b = "bad";
$radiochoice2c = "both";

////////////////////////////////////////////////////////////////////////////////////////////////////


Abe1 04-18-2006 03:25 PM

Quote:

Originally Posted by hIBEES
Hi Abe

Nice work :)
however lol

I'm trying to remove a few of the options ..

I edit out the $ of what i want to edit out

HTML Code:

////////////////////////////////////////////////////////////////////////////////////////////////////
//VARIABLES
//Study how variables are add here to add or remove any. If you add a variable to your form, you must add it to part one and part two.
////////////////////////////////////////////////////////////////////////////////////////////////////

// Part 1
$vbulletin->input->clean_array_gpc('p', array(
'normalanswer1' => TYPE_STR,
'longanswer1' => TYPE_STR
));

// Part 2
$normalanswer1 = $vbulletin->GPC['normalanswer1'];
$longanswer1 = $vbulletin->GPC['longanswer1'];

It removes the text but not the input fields :)

I anly want 3 options for the form, how do i remove the input fields and the buttons?

Screenshot

http://www.mcdanieldigital.com/comun...mages/form.jpg

I created the new plugin as per the instructions in the original plugin :confused:

You have to remove the imput fields from the template.

Bounce 04-18-2006 03:28 PM

Quote:

Originally Posted by Abe1
You have to remove the imput fields from the template.


just just thought of that and edited my post :)

I shall go try :)

Bounce 04-18-2006 03:35 PM

Ahhh I see now ... you need to edit out the stuff below the lines that say do not touch unless you know what you are doing lol

Correct? Below an example

HTML Code:

if ($answerall == "1")
    {
        if ($normalanswer1 == '' OR $radioanswer1 == '' OR $radioanswer2 == '' OR $radioanswer3 == '' OR $answer1 == '' OR $answer2 == '' OR $answer3 == '' OR $longanswer1 == '')
        {


Abe1 04-18-2006 03:37 PM

Quote:

Originally Posted by hIBEES
Ahhh I see now ... you need to edit out the stuff below the lines that say do not touch unless you know what you are doing lol

Correct? Below an example

HTML Code:

if ($answerall == "1")
    {
        if ($normalanswer1 == '' OR $radioanswer1 == '' OR $radioanswer2 == '' OR $radioanswer3 == '' OR $answer1 == '' OR $answer2 == '' OR $answer3 == '' OR $longanswer1 == '')
        {


Edit that if you change a field.

Bounce 04-18-2006 03:39 PM

Quote:

Originally Posted by Abe1
Edit that if you change a field.


EEK !!!! :confused: I'll give it a go , thanks

[high]* Bounce backs up the original lol[/high]

SupremeWeapon 04-18-2006 05:45 PM

I get

Code:

Fatal error: Existing data passed is not an array
Called set_existing in /var/www/gamelibraryonline.com/htdocs/dtr/boards/newthread.php(68) : eval()'d code on line 381
Called eval in /var/www/gamelibraryonline.com/htdocs/dtr/boards/newthread.php on line 68
in /includes/class_dm.php on line 235

unedited form. i get that error when trying to submit.

Abe1 04-18-2006 06:13 PM

Quote:

Originally Posted by SupremeWeapon
I get

Code:

Fatal error: Existing data passed is not an array
Called set_existing in /var/www/gamelibraryonline.com/htdocs/dtr/boards/newthread.php(68) : eval()'d code on line 381
Called eval in /var/www/gamelibraryonline.com/htdocs/dtr/boards/newthread.php on line 68
in /includes/class_dm.php on line 235

unedited form. i get that error when trying to submit.

You are trying to start a poll?

SupremeWeapon 04-18-2006 06:30 PM

actually Yea I am. It's for a team Application.

should I turn that off or something?

Abe1 04-18-2006 06:31 PM

Quote:

Originally Posted by SupremeWeapon
actually Yea I am. It's for a team Application.

should I turn that off or something?

I'm just trying to see why you would get the error. Make sure all info is correct.

SupremeWeapon 04-18-2006 06:36 PM

Cleaned th epost up.


When poll is selected I get that fatal error.
When poll isnt selected it goes throug but doesnt post.

Quote:

// To add more then one form, copy this whole text, and creat a new plug-in with the hook location 'newthread_start'.
// After, change the form name. You can't have 2 forms with the same name.

// Name of this form
$formname = "app";

if ($_REQUEST['do'] == $formname)
{

// ################################################## #####################
// ######################## CUSTOMIZE VARIABLES ##########################
// ################################################## #####################

////////////////////////////////////////////////////////////////////////////////////////////////////
////// BEGIN CUSTOMIZATION BELOW////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//VARIABLES
//Study how variables are add here to add or remove any. If you add a variable to your form, you must add it to part one and part two.
////////////////////////////////////////////////////////////////////////////////////////////////////

// Part 1
$vbulletin->input->clean_array_gpc('p', array(
'normalanswer1' => TYPE_STR,
'normalanswer2' => TYPE_STR,
'radioanswer1' => TYPE_STR,
'answer1' => TYPE_STR,
'answer2' => TYPE_STR,
'answer3' => TYPE_STR,
'dropdownanswer1' => TYPE_STR,
'longanswer1' => TYPE_STR
));

// Part 2
$normalanswer1 = $vbulletin->GPC['normalanswer1'];
$normalanswer2 = $vbulletin->GPC['normalanswer2'];
$radioanswer1 = $vbulletin->GPC['radioanswer1'];
$answer1 = $vbulletin->GPC['answer1'];
$answer2 = $vbulletin->GPC['answer2'];
$answer3 = $vbulletin->GPC['answer3'];
$dropdownanswer1 = $vbulletin->GPC['dropdownanswer1'];
$longanswer1 = $vbulletin->GPC['longanswer1'];

////////////////////////////////////////////////////////////////////////////////////////////////////
//USERGROUPS ALLOWED
//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array.
//To enable this feature, remove the '//' before the 'if'.
////////////////////////////////////////////////////////////////////////////////////////////////////

// if (!in_array($vbulletin->userinfo['usergroupid'], array(2,5,6,7))) print_no_permission();

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//NAME OF TEMPLATES - DO THIS BIT IF YOU ARE MAKING MORE FORMS AND WANT TO USE A DIFFERENT LOOKING TEMPLATE
////////////////////////////////////////////////////////////////////////////////////////////////////

// Name of the main template
$maintemplate = "form";
// Name of the answer template
$answertemplate = "formanswers";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//CHOOSE WHETHER YOU WANT FORM TO BE POSTED IN A NEW THREAD, NEW POLL, REPLY TO EXISITING THREAD, PMed OR EMAILED
///////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE POSTED - 1 = yes, 0 = no
$formforum = "1";

//FORUM TO POST NEW THREAD IN
//You CAN make this number a variable. You can have a drop down menu or in the link like do=form&f=1. Make sure you add it the variables list.
$formforumid = "11";

//ENABLE POLL TO BE CREATED - 1 = yes, 0 = no
$formpoll = "0";
$polloption[1] = "Yes";
$polloption[2] = "No";
$polloption[3] = "Maybe";

//Make poll public - 1 = yes, 0 = no
$pollpublic = "1";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO REPLY TO EXISTING THREAD - 1 = yes, 0 = no
$formreply = "0";

//EXISTING THREAD ID FOR FORM TO REPLY IN
$formreplythreadid = "12345";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE PMED (guests CANNOT use this option) - 1 = yes, 0 = no
$formpm = "0";

//USERNAME TO PM TO
$formpmname = "Abe";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE EMAILED - 1 = yes, 0 = no
$formemail = "0";

//EMAIL ADDRESS TO EMAIL TO
$formemailaddress = "youremail@yourforums.com";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//REDIRECT OPTIONS:
// 0 - thank you message (thread, reply, pm, or email)
// 1 - redirect to post (thread or reply)
// 2 - redirect to thread (thread only)
// 3 - redirect to forum (thread only)
// 4 - redirect to editpost to upload attachments (thread or reply)
//
// Feel free to change the thank you message if you choose option 0
////////////////////////////////////////////////////////////////////////////////////////////////////

$redirectoption = "0";

$errormessage = "Thank you for submitting Your application! We will review it and get back to you."; //This is the thank you message

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//FORCE USER TO ANSWER ALL QUESTIONS - 1 = yes, 0 = no
//If you added or deleted variables, you must edit what it checked for. Search for "$answerall ==" and edit 2 lines under it.
////////////////////////////////////////////////////////////////////////////////////////////////////

$answerall = "0";

////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF FORM (do not use quotation marks or you will get a parse error, besides the quotes around the whole title)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formtitle = "Team Application";

////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF THREAD/POST/PM/EMAIL (do not use quotation marks in the title or you will get a parse error)
//You may use variables from the form for this.
////////////////////////////////////////////////////////////////////////////////////////////////////

$posttitle = "$dtrapp";

////////////////////////////////////////////////////////////////////////////////////////////////////
//PURPOSE OF FORM (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formpurpose = "This form is for you to submit an application to join TeamDTR. It does not auto promise you a position on the team.";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion1 = "What is your Online Name?";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion1 = "Who referred you??";

////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion1 = "Do you see yourself as a person who can follow rules set forth?";

// The following choices must NOT have quotation marks
$radiochoice1a = "yes";
$radiochoice1b = "no";

////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 3 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
$question1 = "What is your REAL name?";
$explain1 = "Please enter your real name here.";

//QUESTION 2 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
$question2 = "What is your email?";
$explain2 = "Please enter your real email here.";

//QUESTION 3 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
$question3 = "What games do you play?";
$explain3 = "List your games here. If there isnt enough room then use the last input box..";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//DROP DOWN CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$dropdownquestion1 = "What is your gender?";

// The following choices must NOT have quotation marks
$dropdownchoice1a = "no comment";
$dropdownchoice1b = "male";
$dropdownchoice1c = "female";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//LONG TEXT AREA INPUT: QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$longquestion1 = "Please explain Why you want to join TeamDTR.";
$longexplain1 = "Be specific this will play a role in your applicaion being reviewed.";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//VB TEXT AREA INPUT: You can only have ONE vb text question. (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$vbtextquestion = "Please give us any other info you wish to.";
$vbtextexplain = "Put anhting in here that you feel is worth while to your application.";

////////////////////////////////////////////////////////////////////////////////////////////////
////// END OF CUSTOMIZATION ////////////////////////////////////////////////////////////////////
///// DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU ARE DOING!!! ////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////

// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################
if ($_REQUEST['action'] == '')
{
$_REQUEST['action'] = "form";
}


$bbuserinfo = $vbulletin->userinfo;

// start navbar
$navbits = array();
$navbits['newthread.php?' . $vbulletin->session->vars['sessionurl'] . "do=$formname"] = $formtitle;

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');

if ($_REQUEST['action'] == "submit")
{

if ($answerall == "1")
{
if ($normalanswer1 == '' OR $radioanswer1 == '' OR $radioanswer2 == '' OR $radioanswer3 == '' OR $answer1 == '' OR $answer2 == '' OR $answer3 == '' OR $longanswer1 == '')
{
$errormessage = "$bbuserinfo[username], you need to answer every question!";
eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
exit();
}
}

$vbulletin->input->clean_array_gpc('p', array(
'wysiwyg' => TYPE_BOOL,
'message' => TYPE_STR
));

if ($vbulletin->GPC['wysiwyg'])
{
require_once(DIR . '/includes/functions_wysiwyg.php');
$vbtextanswer = convert_wysiwyg_html_to_bbcode($vbulletin->GPC['message'], $foruminfo['allowhtml']);
}
else
{
$vbtextanswer =& $vbulletin->GPC['message'];
}

eval('$formsend = "' . fetch_template("$answertemplate") . '";');

if ($_POST['submit'] == 'Submit')
{
if ($formforum == "1")
{
$foruminfo = verify_id('forum', $formforumid, 0, 1);
$forumperms = fetch_permissions($foruminfo[forumid]);
$newpost['username'] =& $vbulletin->userinfo['username'];
$newpost['message'] =& $formsend;
$newpost['title'] =& $posttitle;
$newpost['parseurl'] = '1';

if ($vbulletin->userinfo['autosubscribe'] != -1)
{
$newpost['emailupdate'] = $vbulletin->userinfo['autosubscribe'];
}
else
{
$newpost['emailupdate'] = 9999;
}

if ($vbulletin->userinfo['signature'] != '')
{
$newpost['signature'] = '1';
}
else
{
$newpost['signature'] = '0';
}

build_new_post('thread', $foruminfo, array(), array(), $newpost, $errors);

if ($formpoll == "1")
{
$threadinfo = verify_id('thread', $newpost[threadid], 0, 1);
$polloptions = count($polloption);
$question = $posttitle;
$vbulletin->GPC['options'] = $polloption;

$counter = 0;
$optioncount = 0;
$badoption = '';
while ($counter++ < $polloptions)
{ // 0..Pollnum-1 we want, as arrays start with 0
if ($vbulletin->options['maxpolllength'] AND vbstrlen($vbulletin->GPC['options']["$counter"]) > $vbulletin->options['maxpolllength'])
{
$badoption .= iif($badoption, ', ') . $counter;
}
if (!empty($vbulletin->GPC['options']["$counter"]))
{
$optioncount++;
}
}

// Add the poll
$poll =& datamanager_init('Poll', $vbulletin, ERRTYPE_STANDARD);

$counter = 0;
while ($counter++ < $polloptions)
{
if ($vbulletin->GPC['options']["$counter"] != '')
{
$poll->set_option($vbulletin->GPC['options']["$counter"]);
}
}

$poll->set('question', $question);
$poll->set('dateline', TIMENOW);
$poll->set('active', '1');
$poll->set('public', $pollpublic);

$pollid = $poll->save();
//end create new poll

// update thread
$threadman =& datamanager_init('Thread', $vbulletin, ERRTYPE_STANDARD, 'threadpost');
$threadman->set_existing($threadinfo);
$threadman->set('pollid', $pollid);
$threadman->save();
}
}

if ($formreply == "1")
{
$threadinfo = verify_id('thread', $formreplythreadid, 0, 1);
$forumperms = fetch_permissions($threadinfo[forumid]);
$newpost['username'] =& $vbulletin->userinfo['username'];
$newpost['message'] =& $formsend;
$newpost['title'] =& $posttitle;
$newpost['parseurl'] = "1";

if ($vbulletin->userinfo['autosubscribe'] != -1)
{
$newpost['emailupdate'] = $vbulletin->userinfo['autosubscribe'];
}
else
{
$newpost['emailupdate'] = 9999;
}

if ($vbulletin->userinfo['signature'] != '')
{
$newpost['signature'] = '1';
}
else
{
$newpost['signature'] = '0';
}

build_new_post('reply', $foruminfo, $threadinfo, $postinfo, $newpost, $errors);
}

if ($formpm == "1")
{
$vbulletin->GPC['message'] =& $formsend;
$vbulletin->GPC['title'] =& $posttitle;
$vbulletin->GPC['recipients'] =& $formpmname;

$pm['message'] =& $vbulletin->GPC['message'];
$pm['title'] =& $vbulletin->GPC['title'];
$pm['recipients'] =& $vbulletin->GPC['recipients'];

// create the DM to do error checking and insert the new PM
$pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);

$pmdm->set('fromuserid', $vbulletin->userinfo['userid']);
$pmdm->set('fromusername', $vbulletin->userinfo['username']);
$pmdm->setr('title', $pm['title']);
$pmdm->setr('message', $pm['message']);
$pmdm->set_recipients($pm['recipients'], $permissions);
$pmdm->set('dateline', TIMENOW);

// everything's good!
$pmdm->save();
}

if ($formemail == "1")
{
vbmail($formemailaddress, $posttitle, $formsend);
}

if ($redirectoption == "1")
{
$vbulletin->url = 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . "p=$newpost[postid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
if ($redirectoption == "2")
{
$vbulletin->url = 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t=$newpost[threadid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
if ($redirectoption == "3")
{
$vbulletin->url = 'forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f=$foruminfo[forumid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
if ($redirectoption == "4")
{
$vbulletin->url = 'editpost.php?do=editpost&' . $vbulletin->session->vars['sessionurl'] . "p=$newpost[postid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
exit();
}
else
{
require_once('./includes/class_bbcode.php');
$parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
$preview = $parser->do_parse($formsend);

$_REQUEST['action'] = 'form';
}
}

if ($_REQUEST['action'] == 'form')
{
// set message box width to usercp size
$stylevar['messagewidth'] = $stylevar['messagewidth_usercp'];
$editorid = construct_edit_toolbar($vbtextanswer);

eval('print_output("' . fetch_template("$maintemplate") . '");');
}
}

mastersite 04-20-2006 03:22 PM

Hi im a complete noob to this mod, and im not sure why the form isn't appearing when i post a new thread.

Ive created a new plugin with the all the code and saved as different title, whatelse is there to do?

TomasDR 04-21-2006 09:11 AM

I searched the thread but all I found was one user who included a checkbox their template. But is there anyway to add a multiple choice checkbox type question?

If not, are there any plans to include that feature?

Recent Install and liking it!

csidlernet 04-21-2006 10:06 AM

really cool thanks a lot

Abe1 04-21-2006 01:33 PM

Quote:

Originally Posted by TomasDR
I searched the thread but all I found was one user who included a checkbox their template. But is there anyway to add a multiple choice checkbox type question?

If not, are there any plans to include that feature?

Recent Install and liking it!

I'll try to add a check box options soon.


All times are GMT. The time now is 02:30 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02522 seconds
  • Memory Usage 1,965KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (7)bbcode_html_printable
  • (23)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete