PDA

View Full Version : Forms Hack


Pages : 1 2 [3] 4 5

sully02
01-02-2006, 11:42 PM
that would be great.

at least then i can see everything i need to do for next time.

Wasn't able to test this out on my board, but give this a shot and let me know how it works:

onkel.joi
01-03-2006, 12:25 AM
I have a small question. Is it possible to remove question from the final thread if the answer was not given? For example: What is your name?: ____________
The answer is not give for this, so I want in the final thread not to have that question, but if in the other thread user would answer that question it should appear in the final thread. Hopefully I did not get everybody confused. Thanks

Code Monkey
01-03-2006, 12:53 AM
Why is my post message wraped in the following when I test this unchanged?

<!-- BEGIN TEMPLATE: formanswers -->

<!-- END TEMPLATE: formanswers -->

sully02
01-03-2006, 01:08 AM
Why is my post message wraped in the following when I test this unchanged?

<!-- BEGIN TEMPLATE: formanswers -->


<!-- END TEMPLATE: formanswers -->

Because you are in debug mode on your forums. I would turn that off.

Code Monkey
01-03-2006, 01:24 AM
It's a dev site first of all. ;)

It was doing that because "Add Template Name in HTML Comments" Was set to "yes". Even so, it should not put it in the post.

bluesteel
01-03-2006, 07:27 AM
Great hack Abe1. Having some fun with it,but now I'm stuck :(
I don't know if this is possible, but in the answers, can a conditional be set somewhere that show an image depending on what the $radioanswer1 answer is?

ie if radioanswer 1 = Yes, show image 1
else
show image 2

if you know what I mean lol

Can anybody help me please?

Puntoboy
01-03-2006, 08:49 AM
Wasn't able to test this out on my board, but give this a shot and let me know how it works:

thats brilliant thank you.

its not quite right but i think i can sort it. well i hope.

http://www.puntosports.co.uk/forums/newthread.php?do=Application

D.Ilyin
01-03-2006, 10:05 AM
You can use vBcode in your answer template.
There is one thing mentioned above, make sure there is a space after the last opening tag and before the first closing tag. Otherwise I think you get an error when you try to save the template.

An example taken from one of my answer templates:

$subjecttitleans

$longanswer1

_____________________________________________

$subjectdate : $subjectdateans
$subjectlocation : $subjectlocationans
$filesize : $filesizeans
$fileruntime : $fileruntimeans
$fileformat : $fileformatans

_____________________________________________

$longquestion2

$longanswer2

_____________________________________________

$longquestion3

$longanswer3

RMS-Chef thank's man! :)
I readed this topic tree times before i find answer on my question.
I think this must be placed in plugin as example, because it's not "visible" option for beginers.
And is there any chance to remove those spaces in replies? I mean how can i use BBCODEs in answer form without spaces?

steven s
01-03-2006, 11:10 AM
Can anybody help me please?
I've been using a condition to change the color of a table cell and add required if there is no answer.
$bbuserinfo[field14] is one of my profile fields. This is done in your form.

<if condition="$bbuserinfo[field14]">
<td class="alt1" valign="top">$bbuserinfo[field14]<else />
<td bgcolor="#ffff66" valign="top"><font size="-2">required</font></if>
</td>

onkel.joi
01-03-2006, 11:19 AM
I have a small question. Is it possible to remove question from the final thread if the answer was not given? For example: What is your name?: ____________
The answer is not give for this, so I want in the final thread not to have that question, but if in the other thread user would answer that question it should appear in the final thread. Hopefully I did not get everybody confused. Thanks
Any help for me? :ermm:

Snake
01-03-2006, 12:02 PM
Thanks!

/me clicks install

Puntoboy
01-03-2006, 02:50 PM
thats brilliant thank you.

its not quite right but i think i can sort it. well i hope.

http://www.puntosports.co.uk/forums/newthread.php?do=Application

can't get this to work, its not displaying correctly and i've set it so it emails me the completed for but thats blank when i recieve it.

sully02
01-03-2006, 08:31 PM
can't get this to work, its not displaying correctly and i've set it so it emails me the completed for but thats blank when i recieve it.

I believe I still have your file saved. I'll take another look at it once I leave work tonight.

Puntoboy
01-03-2006, 08:35 PM
smashing, thanks for your help.

wolfstream
01-04-2006, 04:08 PM
This looks good, like just what I've been looking for, actually. A couple of questions/ problems though.
Firstly:
I'm trying to get the form data to parse a very simple url, like:
http://www.domain.com/newthread.php?do=form&review=myhost
The idea is to have that last bit be part of the title itself. Code changed for this:

$formtitle = "Generic Form for $review";

which simply returns
Forumname : Generic form for
Am I missing something here? Do I need to add something to parse the review bit?

Secondly, can this parse sql queries directly? Instead of handing them off to a forum, what I'm looking to do is add them to a db of reviews which will then be approved by an admin, and viewed by the end user, not in a forum as it were.

onkel.joi
01-05-2006, 04:46 PM
I have a small question. Is it possible to remove question from the final thread if the answer was not given? For example: What is your name?: ____________
The answer is not give for this, so I want in the final thread not to have that question, but if in the other thread user would answer that question it should appear in the final thread. Hopefully I did not get everybody confused. Thanks
Thanks guys for lots of halp.

pipin
01-06-2006, 06:42 AM
thx
used this with threadid and t
and it works now.

but i found a new glitch :speechless:

a posting done through the form wont be shown in the upper category of a subforum as last posting.

http://home.arcor.de/jensgessner/date.jpg

It looks like your camparing it to a category and not another thread.


hm? i wanted to point out, that the last post is not updated in the upper category. The image is mixed from 2 views: bottom the threadview in the category mainboards and top the allforumview. last post isnt the same there.

keroberos
01-06-2006, 09:40 PM
any idea why users on IE post a APP it doesnt work, but firefox it does?

Gripemaster
01-07-2006, 05:22 AM
*Clicks Install*

Thank you! EXCELLENT hack! :)

My only question, being somewhat new to this, how exactly do I go about doing a second form? How is it created to differ from the first one?

onkel.joi
01-07-2006, 12:15 PM
Does anybody knows how to make second botton next to New Thread that would make make forms? I am already installed Edit New Thread Addon but I want to keep that New Thread botton just in case if someone whats the regular way to may thread.
Any help?

Hellraider
01-07-2006, 02:16 PM
Some kind of small "bug" (wrong explaintext on gender choose):

In product-XML search for:


<td class="alt1" valign="middle">
<b>$dropdownquestion1</b>:<br />
$explain3</td>


REPLACE with:


<td class="alt1" valign="middle">
<b>$dropdownquestion1</b>:<br />
</td>

Gripemaster
01-07-2006, 03:27 PM
*Clicks Install*

Thank you! EXCELLENT hack! :)

My only question, being somewhat new to this, how exactly do I go about doing a second form? How is it created to differ from the first one?

*Bump*

:nervous:

Abe1
01-07-2006, 09:18 PM
Some kind of small "bug" (wrong explaintext on gender choose):

In product-XML search for:


<td class="alt1" valign="middle">
<b>$dropdownquestion1</b>:<br />
$explain3</td>


REPLACE with:


<td class="alt1" valign="middle">
<b>$dropdownquestion1</b>:<br />
</td>


Thanks. Removed for next version.

Puntoboy
01-08-2006, 08:41 PM
can someone help me with this? i can't get it to work one bit.

D.Ilyin
01-09-2006, 06:31 AM
can someone help me with this? i can't get it to work one bit.help whith what?

D.Ilyin
01-09-2006, 06:37 AM
I have a small question. Is it possible to remove question from the final thread if the answer was not given? For example: What is your name?: ____________
The answer is not give for this, so I want in the final thread not to have that question, but if in the other thread user would answer that question it should appear in the final thread. Hopefully I did not get everybody confused. Thanks
In formanswers you must find you question for example you have:
$question1
$answer1
and replace whith
<if condition="$answer1">
$question1
$answer1
</if>
for me it's work's ;)

Puntoboy
01-09-2006, 08:23 AM
can't get this to work, its not displaying correctly and i've set it so it emails me the completed for but thats blank when i recieve it.

with this.

i can't get the forum to work.

the bottom field should be a payment field.

http://www.puntosports.co.uk/forums/newthread.php?do=Application

D.Ilyin
01-09-2006, 10:46 AM
can't get this to work, its not displaying correctly and i've set it so it emails me the completed for but thats blank when i recieve it.with this.

i can't get the forum to work.

the bottom field should be a payment field.

http://www.puntosports.co.uk/forums/newthread.php?do=Application
try to attach you full changed plugin.xml
but u should change this
if ($_REQUEST['action'] == '')
{
$_REQUEST['action'] = "form";
}
to this
if ($_REQUEST['action'] == '')
{
$_REQUEST['action'] = "Application";
}
and
if ($_REQUEST['action'] == 'form')
{
// set message box width to usercp size
$stylevar['messagewidth'] = $stylevar['messagewidth_usercp'];
$dontusewysiwyg = 1;
$editorid = construct_edit_toolbar();
to this
if ($_REQUEST['action'] == 'Application')
{
// set message box width to usercp size
$stylevar['messagewidth'] = $stylevar['messagewidth_usercp'];
$dontusewysiwyg = 1;
$editorid = construct_edit_toolbar();

D.Ilyin
01-09-2006, 11:55 AM
Originally Posted by bluesteel
Great hack Abe1. Having some fun with it,but now I'm stuck
I don't know if this is possible, but in the answers, can a conditional be set somewhere that show an image depending on what the $radioanswer1 answer is?

ie if radioanswer 1 = Yes, show image 1
else
show image 2

if you know what I mean lolCan anybody help me please? u must try as i wrote above. something like this (if i undestanded you :)):
<if condition="$gendernanswer == 1">
[img]http://yoursite.ru/male.gif[ /img] --- without spaces
<else />
[img]http://yoursite.ru/female.gif[ /img] --- without spaces
</if>

naqalone
01-10-2006, 10:17 PM
Many thanks for this hack. It's great!

I have one question. How can I add a textbox,a button browse and a button attach to add a attachment to the form.

Abe1
01-10-2006, 10:33 PM
Many thanks for this hack. It's great!

I have one question. How can I add a textbox,a button browse and a button attach to add a attachment to the form.

You cant add attachments to the form. You can use the direct to edit post page where they can add attachemetns.

jilly
01-11-2006, 03:58 AM
When I call my form page it's blank. Anyone see a problem in the code syntax here?

** edited - the problem was I changed the template names in the code - I misread the instructions... changed them back to default and it worked

bsmat
01-11-2006, 08:41 AM
Thanks!

kassem
01-11-2006, 08:57 AM
Thanks a lot for this hack.

wrang
01-11-2006, 01:53 PM
You cant add attachments to the form. You can use the direct to edit post page where they can add attachemetns.

What do you meen. I realy what a attachment in this form at the beginning. Is it possible to have this

EricaJoy
01-11-2006, 01:54 PM
* EricaJoy clicks install

would people mind sharing the forms they've created? here is my first, one for user feedback that posts into an area accessible by site staff.// 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 = "feedback";

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,
'radioanswer1' => TYPE_STR,
'radioanswer2' => TYPE_STR,
'radioanswer3' => TYPE_STR,
'radioanswer3other' => TYPE_STR,
'answer1' => TYPE_STR,
'answer2' => TYPE_STR,
'answer3' => TYPE_STR,
'dropdownanswer1' => TYPE_STR,
'longanswer1' => TYPE_STR
));

// Part 2
$normalanswer1 = $vbulletin->GPC['normalanswer1'];
$radioanswer1 = $vbulletin->GPC['radioanswer1'];
$radioanswer2 = $vbulletin->GPC['radioanswer2'];
$radioanswer3 = $vbulletin->GPC['radioanswer3'];
$radioanswer3other = $vbulletin->GPC['radioanswer3other'];
$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 = "feedback";
// Name of the answer template
$answertemplate = "feedbackanswers";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "47";

//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 = "0";

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

//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 feedback about yoursite!"; //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)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formtitle = "Feedback";

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "$formtitle";

////////////////////////////////////////////////////////////////////////////////////////////////////
//PURPOSE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formpurpose = "This form is to be used for feedback about yoursite. All feedback will be submitted for review by the statf.";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

//$normalquestion1 = "What is the meaning to life?";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion1 = "Is your feedback regarding an error, an addition, or a change to yoursite?";

// The following choices must NOT have quotation marks
$radiochoice1a = "Addition";
$radiochoice1b = "Change";
$radiochoice1c = "Error";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 2 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion2 = "Is your feedback low, medium, or high priority?";

// The following choices must NOT have quotation marks
$radiochoice2a = "Low";
$radiochoice2b = "Medium";
$radiochoice2c = "High";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 3 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion3 = "Would you like a response to your feedback sent to you via Private Message?";

// The following choices must NOT have quotation marks
$radiochoice3a = "Yes";
$radiochoice3b = "No";

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

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

//QUESTION 2 (do not use quotation marks or you will get a parse error)
//$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)
//$question3 = "What is your website?";
//$explain3 = "Please enter your URL here.";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//DROP DOWN CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

// $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)
////////////////////////////////////////////////////////////////////////////////////////////////////

$longquestion1 = "What is your feedback?";
$longexplain1 = "Please give a detailed question and/or comment regarding your feedback about yoursite.";

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

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

//$vbtextquestion = "Please write down a paragraph about how you like this forum.";
//$vbtextexplain = "For example, what makes this forum different from all other forums?";

////////////////////////////////////////////////////////////////////////////////////////////////
////// 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 ($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';
$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";
$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();
}

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

eval('print_output("' . fetch_template("$maintemplate") . '");');
}
} and here is the accompanying template$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" />

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="60%" align="center">
<tr>
<td class="tcat" colspan="3"> $vboptions[bbtitle] - $formtitle </td>
</tr>
<tr>
<td class="panelsurround" align="center" colspan="3"> <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 class="alt1" valign="middle"> <b>Username</b>: </td>
<td class="alt1" valign="middle" colspan="2"> <b>$bbuserinfo[username]</b></td>
</tr>
<tr>
<td class="alt2" colspan="3"><fieldset class="fieldset" style="margin:0px"> <b>$radioquestion1</b> </fieldset></td>
</tr>
<tr>
<td class="alt1"><input type="radio" name="radioanswer1" value="$radiochoice1a" />
$radiochoice1a </td>
<td class="alt1"><input type="radio" name="radioanswer1" value="$radiochoice1b" />
$radiochoice1b </td>
<td class="alt1"><input type="radio" name="radioanswer1" value="$radiochoice1c" />
$radiochoice1c</td>
</tr>
<tr>
<td class="alt2" colspan="3"> <fieldset class="fieldset" style="margin:0px"> <b>$radioquestion2</b></fieldset> </td>
</tr>
<tr>
<td class="alt1"><input type="radio" name="radioanswer2" value="$radiochoice2a" />
$radiochoice2a </td>
<td class="alt1"><input type="radio" name="radioanswer2" value="$radiochoice2b" />
$radiochoice2b </td>
<td class="alt1"><input type="radio" name="radioanswer2" value="$radiochoice2c" />
$radiochoice2c </td>
</tr>
<tr>
<td class="alt2" colspan="3"> <fieldset class="fieldset" style="margin:0px"> <b>$radioquestion3</b></fieldset> </td>
</tr>
<tr>
<td class="alt1"><input type="radio" name="radioanswer3" value="$radiochoice3a" />
$radiochoice3a </td>
<td class="alt1"><input type="radio" name="radioanswer3" value="$radiochoice3b" />
$radiochoice3b </td>
<td class="alt1">&nbsp;</td>
</tr>
<tr>
<td class="alt2" valign="middle"> <b>$longquestion1</b><br>
$longexplain1</td>
<td class="alt2" valign="middle" colspan="2"> <textarea rows="20" cols="70" name="longanswer1"></textarea>
</td>
</tr>
<tr>
<td class="alt1" valign="middle" colspan="3">&nbsp; </td>
</tr>
<tr>
<td class="alt1" valign="top" colspan="3"> <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>


You can see it in action here: http://www.wbs-reloaded.com/newthread.php?do=feedback

wrang
01-11-2006, 02:22 PM
Where can i change the text like Username in the form and the Please give your , followed by your

I want to change this text to swedish

EricaJoy
01-11-2006, 02:53 PM
I changed all the text for mine in the plugin and in the template.

naqalone
01-11-2006, 07:25 PM
Thanks for the great hack.
I would like to add a field that can browse to 1 file, and another button "upload" to attach the file to the post.

Anybody can help me.:)
Thanks again.

wrang
01-11-2006, 07:32 PM
I changed all the text for mine in the plugin and in the template.

Thanks i found it ;)

xOzzie
01-12-2006, 09:35 AM
I had this working OK on my forum (very nice hack, btw!).

As I was fooling around with it on my test forum, I uninstalled it using the Manage Products area of the admincp, then reinstalled the same .xml product.

However, now when I try to navigate to /newthread/php?do=form I get Invalid Forum specified. If you followed a valid link, please notify the administrator and a parsing error at the top of the pageParse error: parse error, unexpected '\"' in /home/mysite/public_html/forums/newthread.php(68) : eval()'d code on line 89 I've checked and rechecked everything I can think of and still can't get it working again despite multiple attempts to upload and overwrite. Again this is the identical .xml file that I had working fine but now won't function. Any ideas?

/edit - uploading the original package works so I must have inadvertently created an error in my modified file. :(

puertoblack2003
01-13-2006, 01:27 AM
I had this working OK on my forum (very nice hack, btw!).

As I was fooling around with it on my test forum, I uninstalled it using the Manage Products area of the admincp, then reinstalled the same .xml product.

However, now when I try to navigate to /newthread/php?do=form I get Invalid Forum specified. If you followed a valid link, please notify the administrator and a parsing error at the top of the pageParse error: parse error, unexpected '\"' in /home/mysite/public_html/forums/newthread.php(68) : eval()'d code on line 89 I've checked and rechecked everything I can think of and still can't get it working again despite multiple attempts to upload and overwrite. Again this is the identical .xml file that I had working fine but now won't function. Any ideas?

/edit - uploading the original package works so I must have inadvertently created an error in my modified file. :(






i'm having the same issue but on fresh install any fix or can anybody look a the script.

D.Ilyin
01-13-2006, 04:35 AM
i'm having the same issue but on fresh install any fix or can anybody look a the script.
1. $formname = Staff Application;to$formname = "Staff_Application";
Variables can't have spaces!!!
2. // Name of the main template
$maintemplate = Puerto [BluePoison];
// Name of the answer template
$answertemplate = Puerto [BluePoison];
$maintemplate and $answertemplate - should be diference!!!! And whithout spaces!
3. $formforumid = 96; Check that you have this forum ID!
4. $formtitle = Staff Application;
$posttitle = Staff Application;
$formpurpose = The.......
$normalquestion1 = Can you........

......
and so.....
the same as first
5. if ($_REQUEST['action'] == '')
{
$_REQUEST['action'] = "form";
}
red - you form name! so it must be "Staff_Application"
6. eval('$formsend = "' . fetch_template("$answertemplate") . '";'); must be your template name
7. if ($_REQUEST['action'] == 'form')
{
// set message box width to usercp size
the same as 5.
8. eval('print_output("' . fetch_template("$maintemplate") . '");'); the same sa 6

--------------------------------------------------------------
hmmmmm..... try to fix it :)

D.Ilyin
01-13-2006, 04:38 AM
I had this working OK on my forum (very nice hack, btw!).

As I was fooling around with it on my test forum, I uninstalled it using the Manage Products area of the admincp, then reinstalled the same .xml product.

However, now when I try to navigate to /newthread/php?do=form I get Invalid Forum specified. If you followed a valid link, please notify the administrator and a parsing error at the top of the pageParse error: parse error, unexpected '\"' in /home/mysite/public_html/forums/newthread.php(68) : eval()'d code on line 89 I've checked and rechecked everything I can think of and still can't get it working again despite multiple attempts to upload and overwrite. Again this is the identical .xml file that I had working fine but now won't function. Any ideas?

/edit - uploading the original package works so I must have inadvertently created an error in my modified file. :(
try find answers in my post above and than if errors still be, attach you *.xml

HaMaDa4eVeR
01-13-2006, 09:41 AM
Hello
I got this error message :
Parse error: parse error, unexpected T_STRING in

and when I try to open newthread.php?do=form I will get this error



althouth everything is right and I changed the formforumid to the my specified forum id ?????

I'm still Facing this proplem !

steven s
01-13-2006, 09:46 AM
I'm still Facing this proplem !

Having the wrong forum name would just give you 'Invalid Forum specified. If you followed a valid link, please notify the administrator'.

When you edited the form script, did it compile correctly, no errors?

xOzzie
01-13-2006, 10:14 AM
try find answers in my post above and than if errors still be, attach you *.xmlThanks for the response. I just re-modified a working 'original' .xml file and all is well. I believe I must have induced an error as I was modifying the file.

puertoblack2003
01-13-2006, 10:32 AM
1. $formname = Staff Application;to$formname = "Staff_Application";
Variables can't have spaces!!!
2. // Name of the main template
$maintemplate = Puerto [BluePoison];
// Name of the answer template
$answertemplate = Puerto [BluePoison];
$maintemplate and $answertemplate - should be diference!!!! And whithout spaces!
3. $formforumid = 96; Check that you have this forum ID!
4. $formtitle = Staff Application;
$posttitle = Staff Application;
$formpurpose = The.......
$normalquestion1 = Can you........

......
and so.....
the same as first
5. if ($_REQUEST['action'] == '')
{
$_REQUEST['action'] = "form";
}
red - you form name! so it must be "Staff_Application"
6. eval('$formsend = "' . fetch_template("$answertemplate") . '";'); must be your template name
7. if ($_REQUEST['action'] == 'form')
{
// set message box width to usercp size
the same as 5.
8. eval('print_output("' . fetch_template("$maintemplate") . '");'); the same sa 6

--------------------------------------------------------------
hmmmmm..... try to fix it :)




Thank you sir for your time :rolleyes: i will tried that when i get home..will keep you posted :ermm:

jilly
01-13-2006, 02:10 PM
My moderator form goes to a private moderator board, and all the posts are coming through as 'moderated', even though the forum is not set that way - the forums settings say 'no' to all the moderation questions.. and the people submitting the forms are NOT on moderated status.. Any ideas?

puertoblack2003
01-13-2006, 08:41 PM
1. $formname = Staff Application;to$formname = "Staff_Application";
Variables can't have spaces!!!
2. // Name of the main template
$maintemplate = Puerto [BluePoison];
// Name of the answer template
$answertemplate = Puerto [BluePoison];
$maintemplate and $answertemplate - should be diference!!!! And whithout spaces!
3. $formforumid = 96; Check that you have this forum ID!
4. $formtitle = Staff Application;
$posttitle = Staff Application;
$formpurpose = The.......
$normalquestion1 = Can you........

......
and so.....
the same as first
5. if ($_REQUEST['action'] == '')
{
$_REQUEST['action'] = "form";
}
red - you form name! so it must be "Staff_Application"
6. eval('$formsend = "' . fetch_template("$answertemplate") . '";'); must be your template name
7. if ($_REQUEST['action'] == 'form')
{
// set message box width to usercp size
the same as 5.
8. eval('print_output("' . fetch_template("$maintemplate") . '");'); the same sa 6

--------------------------------------------------------------
hmmmmm..... try to fix it :)





ok did everything possible to get it right but no luck now i hav ethis error message...

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/.debit/puertoblack2003/puertotech.com/newthread.php(68) : eval()'d code on line 9

next step please :ermm:

Puntoboy
01-13-2006, 11:58 PM
try to attach you full changed plugin.xml
but u should change this
if ($_REQUEST['action'] == '')
{
$_REQUEST['action'] = "form";
}
to this
if ($_REQUEST['action'] == '')
{
$_REQUEST['action'] = "Application";
}
and
if ($_REQUEST['action'] == 'form')
{
// set message box width to usercp size
$stylevar['messagewidth'] = $stylevar['messagewidth_usercp'];
$dontusewysiwyg = 1;
$editorid = construct_edit_toolbar();
to this
if ($_REQUEST['action'] == 'Application')
{
// set message box width to usercp size
$stylevar['messagewidth'] = $stylevar['messagewidth_usercp'];
$dontusewysiwyg = 1;
$editorid = construct_edit_toolbar();


ok i have changed this but the form is not working correctly.

i need the forum, once completed, emailling to my email account for processing.

i've set it so it does this however when i receive the email, its more or less blank, non of the fields are there just the title.

any help? also i cannot get the bottom field to change to the Payment type and not Title.

// 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 = "Application";

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(
'normalanswer2' => TYPE_STR,
'normalanswer3' => TYPE_STR,
'normalanswer4' => TYPE_STR,
'normalanswer5' => TYPE_STR,
'normalanswer6' => TYPE_STR,
'normalanswer7' => TYPE_STR,
'normalanswer8' => TYPE_STR,
'normalanswer9' => TYPE_STR,
'normalanswer10' => TYPE_STR,
'normalanswer11' => TYPE_STR,
'normalanswer12' => TYPE_STR,
'normalanswer13' => TYPE_STR,
'normalanswer14' => TYPE_STR,
'normalanswer15' => TYPE_STR,
'normalanswer16' => TYPE_STR,
'normalanswer17' => TYPE_STR,
'normalanswer18' => TYPE_STR,
'dropdownanswer1' => TYPE_STR,
'dropdownanswer2' => TYPE_STR,
));

// Part 2
$normalanswer2 = $vbulletin->GPC['normalanswer2'];
$normalanswer3 = $vbulletin->GPC['normalanswer3'];
$normalanswer4 = $vbulletin->GPC['normalanswer4'];
$normalanswer5 = $vbulletin->GPC['normalanswer5'];
$normalanswer6 = $vbulletin->GPC['normalanswer6'];
$normalanswer7 = $vbulletin->GPC['normalanswer7'];
$normalanswer8 = $vbulletin->GPC['normalanswer8'];
$normalanswer9 = $vbulletin->GPC['normalanswer9'];
$normalanswer10 = $vbulletin->GPC['normalanswer10'];
$normalanswer11 = $vbulletin->GPC['normalanswer11'];
$normalanswer12 = $vbulletin->GPC['normalanswer12'];
$normalanswer13 = $vbulletin->GPC['normalanswer13'];
$normalanswer14 = $vbulletin->GPC['normalanswer14'];
$normalanswer15 = $vbulletin->GPC['normalanswer15'];
$normalanswer16 = $vbulletin->GPC['normalanswer16'];
$normalanswer17 = $vbulletin->GPC['normalanswer17'];
$normalanswer18 = $vbulletin->GPC['normalanswer18'];
$dropdownanswer1 = $vbulletin->GPC['dropdownanswer1'];
$dropdownanswer2 = $vbulletin->GPC['dropdownanswer2'];


////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "0";

//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 = "2";

//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 = "0";

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

//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 = "1";

//EMAIL ADDRESS TO EMAIL TO
$formemailaddress = "club@puntosports.co.uk";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 this form!"; //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)
////////////////////////////////////////////////////////////////////////////////////////////////////

$bbuserinfo = $vbulletin->userinfo;
$formtitle = "Club Membership Application for $bbuserinfo[username]";

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "Punto Sports Club Application";

////////////////////////////////////////////////////////////////////////////////////////////////////
//PURPOSE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formpurpose = "If you wish to become a member of The Punto Sports Club, please fill in all fields of this form as instructed.";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 2 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion2 = "first name";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 3 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion3 = "last name";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 4 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion4 = "Street Address";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 5 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion5 = "Town";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 6 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion6 = "County";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 7 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion7 = "Postal Code";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 8 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion8 = "Country";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 9 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion9 = "Date of Birth";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 10 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion10 = "Daytime Telephone Number";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 11 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion11 = "Evening Telephone Number";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 12 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion12 = "Mobile Telephone Number";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 13 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion13 = "Email Address";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 14 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion14 = "Punto Mark";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 15 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion15 = "Model";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 16 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion16 = "Year";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 17 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion17 = "Registration";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 18 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion18 = "Colour";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//DROP DOWN CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$dropdownquestion1 = "title";

// The following choices must NOT have quotation marks
$dropdownchoice1a = "Mr.";
$dropdownchoice1b = "Mrs.";
$dropdownchoice1c = "Miss";
$dropdownchoice1d = "Ms.";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//DROP DOWN CHOICES : QUESTION 2 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$dropdownquestion2 = "What method will you be using for payment?";

// The following choices must NOT have quotation marks
$dropdownchoice2a = "Paypal";
$dropdownchoice2b = "Cash";
$dropdownchoice2c = "Cheque";
$dropdownchoice2d = "Postal Order";
$dropdownchoice2e = "Other Method";

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

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

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


$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 ($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';
$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";
$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();
}

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

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

D.Ilyin
01-14-2006, 12:52 PM
ok did everything possible to get it right but no luck now i hav ethis error message...

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/.debit/puertoblack2003/puertotech.com/newthread.php(68) : eval()'d code on line 9

next step please :ermm: please attach your *.xml....
try to find what's wrong with it.

D.Ilyin
01-14-2006, 12:54 PM
i've set it so it does this however when i receive the email, its more or less blank, non of the fields are there just the title. and how about that.....
Do not edit anythingfrom this plugin! Only your mail, and try to test.

puertoblack2003
01-14-2006, 12:57 PM
please attach your *.xml....
try to find гще what's wrong with it.

thanks man i was getting frustrated :disappointed: for about a few hours.. :ermm:

Puntoboy
01-14-2006, 01:06 PM
and how about that.....
Do not edit anythingfrom this plugin! Only your mail, and try to test.

someone did this for me. i'm just trying to get this to work and its not working.

D.Ilyin
01-14-2006, 01:10 PM
thanks man i was getting frustrated :disappointed: for about a few hours.. :ermm:
hmm..... i mean all.... with all templates. Becouse i can't find error without them.

Puntoboy and you too...

Puntoboy
01-14-2006, 01:22 PM
// 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 = "Application";

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(
'normalanswer2' => TYPE_STR,
'normalanswer3' => TYPE_STR,
'normalanswer4' => TYPE_STR,
'normalanswer5' => TYPE_STR,
'normalanswer6' => TYPE_STR,
'normalanswer7' => TYPE_STR,
'normalanswer8' => TYPE_STR,
'normalanswer9' => TYPE_STR,
'normalanswer10' => TYPE_STR,
'normalanswer11' => TYPE_STR,
'normalanswer12' => TYPE_STR,
'normalanswer13' => TYPE_STR,
'normalanswer14' => TYPE_STR,
'normalanswer15' => TYPE_STR,
'normalanswer16' => TYPE_STR,
'normalanswer17' => TYPE_STR,
'normalanswer18' => TYPE_STR,
'dropdownanswer1' => TYPE_STR,
'dropdownanswer2' => TYPE_STR,
));

// Part 2
$normalanswer2 = $vbulletin->GPC['normalanswer2'];
$normalanswer3 = $vbulletin->GPC['normalanswer3'];
$normalanswer4 = $vbulletin->GPC['normalanswer4'];
$normalanswer5 = $vbulletin->GPC['normalanswer5'];
$normalanswer6 = $vbulletin->GPC['normalanswer6'];
$normalanswer7 = $vbulletin->GPC['normalanswer7'];
$normalanswer8 = $vbulletin->GPC['normalanswer8'];
$normalanswer9 = $vbulletin->GPC['normalanswer9'];
$normalanswer10 = $vbulletin->GPC['normalanswer10'];
$normalanswer11 = $vbulletin->GPC['normalanswer11'];
$normalanswer12 = $vbulletin->GPC['normalanswer12'];
$normalanswer13 = $vbulletin->GPC['normalanswer13'];
$normalanswer14 = $vbulletin->GPC['normalanswer14'];
$normalanswer15 = $vbulletin->GPC['normalanswer15'];
$normalanswer16 = $vbulletin->GPC['normalanswer16'];
$normalanswer17 = $vbulletin->GPC['normalanswer17'];
$normalanswer18 = $vbulletin->GPC['normalanswer18'];
$dropdownanswer1 = $vbulletin->GPC['dropdownanswer1'];
$dropdownanswer2 = $vbulletin->GPC['dropdownanswer2'];


////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "0";

//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 = "2";

//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 = "0";

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

//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 = "1";

//EMAIL ADDRESS TO EMAIL TO
$formemailaddress = "club@puntosports.co.uk";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 this form!"; //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)
////////////////////////////////////////////////////////////////////////////////////////////////////

$bbuserinfo = $vbulletin->userinfo;
$formtitle = "Club Membership Application for $bbuserinfo[username]";

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "Punto Sports Club Application";

////////////////////////////////////////////////////////////////////////////////////////////////////
//PURPOSE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formpurpose = "If you wish to become a member of The Punto Sports Club, please fill in all fields of this form as instructed.";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 2 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion2 = "first name";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 3 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion3 = "last name";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 4 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion4 = "Street Address";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 5 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion5 = "Town";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 6 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion6 = "County";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 7 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion7 = "Postal Code";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 8 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion8 = "Country";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 9 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion9 = "Date of Birth";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 10 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion10 = "Daytime Telephone Number";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 11 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion11 = "Evening Telephone Number";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 12 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion12 = "Mobile Telephone Number";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 13 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion13 = "Email Address";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 14 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion14 = "Punto Mark";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 15 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion15 = "Model";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 16 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion16 = "Year";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 17 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion17 = "Registration";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 18 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion18 = "Colour";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//DROP DOWN CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$dropdownquestion1 = "title";

// The following choices must NOT have quotation marks
$dropdownchoice1a = "Mr.";
$dropdownchoice1b = "Mrs.";
$dropdownchoice1c = "Miss";
$dropdownchoice1d = "Ms.";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//DROP DOWN CHOICES : QUESTION 2 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$dropdownquestion2 = "What method will you be using for payment?";

// The following choices must NOT have quotation marks
$dropdownchoice2a = "Paypal";
$dropdownchoice2b = "Cash";
$dropdownchoice2c = "Cheque";
$dropdownchoice2d = "Postal Order";
$dropdownchoice2e = "Other Method";

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

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

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


$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 ($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';
$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";
$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();
}

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

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

this not it then?

Puntoboy
01-14-2006, 01:28 PM
this one?

Blind Guardian
01-14-2006, 09:50 PM
Thanks, I should be able to use this to make moderator recommendations, moderator resignations and signature removal requests a lot more efficient.

puertoblack2003
01-14-2006, 11:08 PM
hmm..... i mean all.... with all templates. Becouse i can't find error without them.

Puntoboy and you too...


@ D.Ilyin, i'm confused now "template"....isn't the one i attached two post back the one the only thing i modified by instruction from plugin-manger hook section where this i made the mod...of.....lol...now i'm confused :ermm:

LoOnEyToOnZ
01-15-2006, 12:54 AM
Is it possible to attach files and make it attached into the forum thread as well if we choose post in forum ?

rabid dingo
01-15-2006, 03:30 AM
If I tell one of y'all what I need the form to do, can someone help me? I've played with this thing for 4 hours and I just keep getting "Sorry, this forum is not accepting new posts."

HaMaDa4eVeR
01-15-2006, 07:24 AM
Parse error: parse error, unexpected T_STRING in /home/XXX/public_html/vb/newthread.php(68) : eval()'d code on line 3
I'm still facing this proplem .... what I do ?

Abe1
01-15-2006, 01:51 PM
I'm still facing this proplem .... what I do ?

Look at line 3 in the plugin and see wht is wrong there. Look at line 2 also.

HaMaDa4eVeR
01-15-2006, 04:14 PM
Look at line 3 in the plugin and see wht is wrong there. Look at line 2 also.
I fixed this error but I got a lot of error all of them are Parse error I sloved untile now ,, in future use /* ur comment here ... */ instant of //
Also I deleted the space between variables.
although I'm still got error and I can't what I do with this please check out my plugin and try u fix the proplems
I'm so sorry but I neeeeeeeeeeeeeeeeeed this hack

D.Ilyin
01-16-2006, 06:07 AM
this one?
yes. Try this one. It works. I recivede mail whith them:
Club Membership Application for admin
admin

Name: Mr. 22 2

-----------------------------------------------------

Street Address: 2
Town: 2
County: 2
Postal Code: 2
Country: 2
Date of Birth: 2
Daytime Telephone Number: 2
Evening Telephone Number: 2
Mobile Telephone Number: 2
Email Address: 2
Punto Mark: 2
Model: 2
Year: 2
Registration: 2
Colour: 2

-----------------------------------------------------

What method will you be using for payment?: Paypal
don't foget to change this variable $formemailaddress = "your@mail.ru";

D.Ilyin
01-16-2006, 06:18 AM
I fixed this error but I got a lot of error all of them are Parse error I sloved untile now ,, in future use /* ur comment here ... */ instant of //
Also I deleted the space between variables.
although I'm still got error and I can't what I do with this please check out my plugin and try u fix the proplems
I'm so sorry but I neeeeeeeeeeeeeeeeeed this hack
sory but who change this for you? :ermm:
there is so many errors! and the most is additionals LINE's between PHP comments.
for example:THREAD, NEW POLL, REPLY TO EXISITING THREAD, PMed OR

EMAILED
New aditional lines made text above like a "functions" and "variables". That's why too many errors.

UPDATED
change those errors.... Try to paste it.....

PS NEVER change this code:if ($_REQUEST['action'] == "submit")
{

if ($answerall == "1")to anything!

uzman59
01-16-2006, 01:04 PM
where is the main hook

Puntoboy
01-16-2006, 01:48 PM
yes. Try this one. It works. I recivede mail whith them:
don't foget to change this variable $formemailaddress = "your@mail.ru";


tried it, still doesn't work, the the option to change payment method still says Title

here is the forum link.. http://www.puntosports.co.uk/forums/newthread.php?do=Application

and when i test this and recieve the form all the email says is...

"Club Membership Application for Puntoboy Puntoboy"

and that is it.

D.Ilyin
01-17-2006, 09:13 AM
tried it, still doesn't work, the the option to change payment method still says Title

here is the forum link.. http://www.puntosports.co.uk/forums/newthread.php?do=Application

and when i test this and recieve the form all the email says is...

"Club Membership Application for Puntoboy Puntoboy"

and that is it.
"Title" - FIXED.

About mail as i sad above for me work (vB 3.5.3).
What version do you use?

Puntoboy
01-17-2006, 09:16 AM
"Title" - FIXED.

About mail as i sad above for me work (vB 3.5.3).
What version do you use?

3.5.2...

is there anything else i need to do apart from import this XML file?

thanks for your help buddy.

Puntoboy
01-17-2006, 09:24 AM
3.5.2...

is there anything else i need to do apart from import this XML file?

thanks for your help buddy.

ok i've uploaded the XML, changed the email address and its still the same...

"Club Membership Application for Puntoboy Puntoboy"

and the rest of the forum is blank...

Puntoboy
01-17-2006, 09:41 AM
just tried this for the forums other style and it worked in a way...

Club Membership Application for psc
psc

Name: Mr. 2 2

-----------------------------------------------------

Street Address: 2
Town: 2
County: 2
Postal Code: 2
Country: 2
Date of Birth: 2
Daytime Telephone Number: 2
Evening Telephone Number: 2
Mobile Telephone Number: 2
Email Address: 22
Punto Mark: 2
Model: 2
Year: 2
Registration: 222
Colour: 2

-----------------------------------------------------

What method will you be using for payment?: Paypal

what templates does the Plugin edit? as both of the styles have the same templates, just different colours.

D.Ilyin
01-17-2006, 09:51 AM
thanks for your help buddy ??????? :)
just tried this for the forums other style and it worked in a way...

what templates does the Plugin edit? as both of the styles have the same templates, just different colours.
sory? can't help.....
for me (just test) no differense on 4 styles installed on my board.
just look at admincp - Styles & Templates - Style Manager.
Expand all you styles and check two teplates in all styles: FORM, FORMANSWER.
They must be in all styles.

D.Ilyin
01-17-2006, 10:00 AM
Abe1 can i ask you about future request?
Addable fields in forms.
Try to explain what i mean. When creating POOLs in usual threads we can set number of fields for poll.
Can you add this future in forms?

PS i tried to do it myself but ..... :(

Puntoboy
01-17-2006, 10:29 AM
??????? :)

sory? can't help.....
for me (just test) no differense on 4 styles installed on my board.
just look at admincp - Styles & Templates - Style Manager.
Expand all you styles and check two teplates in all styles: FORM, FORMANSWER.
They must be in all styles.

you can help mate, as you just have....

for some reason the XML didn't create a template for formanswers in the first style (the one i was trying) created a new one and copied it from the working template!

all works now! you're a life saver!

Puntoboy
01-17-2006, 11:38 AM
you can help mate, as you just have....

for some reason the XML didn't create a template for formanswers in the first style (the one i was trying) created a new one and copied it from the working template!

all works now! you're a life saver!

how do i set it so they must answer all fields?

i set the option to "1" but it always comes up with the error "you need to answer every question!" eventhough all fields are answered.

Puntoboy
01-17-2006, 12:38 PM
is this not right?

if ($answerall == "1")
{
if ($normalanswer2 == 'First Name' OR $normalanswer3 == 'Last Name' OR $normalanswer4 == 'Street Address' OR $normalanswer5 == 'Town' OR $normalanswer6 == 'County' OR $normalanswer7 == 'Postal Code' OR $normalanswer8 == 'Country' OR $normalanswer9 == 'Date of Birth' OR $normalanswer10 == 'Daytime Telephone Number' OR $normalanswer11 == 'Evening Telephone Number' OR $normalanswer12 == 'Mobile Telephone Number' OR $normalanswer13 == 'Email Address' OR $normalanswer14 == 'Punto Mark' OR $normalanswer15 == 'Model' OR $normalanswer16 == 'Year' OR $normalanswer17 == 'Registration' OR $normalanswer18 == 'Colour' OR $dropdownquestion1 = "title" OR $dropdownquestion2 = "What method will you be using for payment?")

D.Ilyin
01-17-2006, 03:24 PM
all works now! you're a life saver!
no i'm not...
is this not right?

if ($answerall == "1")
{
if ($normalanswer2 == 'First Name' OR $normalanswer3 == 'Last Name' OR $normalanswer4 == 'Street Address' OR $normalanswer5 == 'Town' OR $normalanswer6 == 'County' OR $normalanswer7 == 'Postal Code' OR $normalanswer8 == 'Country' OR $normalanswer9 == 'Date of Birth' OR $normalanswer10 == 'Daytime Telephone Number' OR $normalanswer11 == 'Evening Telephone Number' OR $normalanswer12 == 'Mobile Telephone Number' OR $normalanswer13 == 'Email Address' OR $normalanswer14 == 'Punto Mark' OR $normalanswer15 == 'Model' OR $normalanswer16 == 'Year' OR $normalanswer17 == 'Registration' OR $normalanswer18 == 'Colour' OR $dropdownquestion1 = "title" OR $dropdownquestion2 = "What method will you be using for payment?")
no. but this if ($answerall == "1")
{
if ($normalanswer4 == '' OR $normalanswer5 == '' OR $normalanswer6 == '' OR $normalanswer7 == '' OR $normalanswer8 == '' OR $normalanswer9 == '' OR $normalanswer10 == '' OR $normalanswer11 == '' OR $normalanswer12 == '' OR $normalanswer13 == '' OR $normalanswer14 == '' OR $normalanswer15 == '' OR $normalanswer16 == '' OR $normalanswer17 == '' OR $normalanswer18 = '' OR $dropdownanswer1 = '' OR $dropdownanswer2 = '')right :)

Puntoboy
01-17-2006, 03:27 PM
no i'm not...

no. but this if ($answerall == "1")
{
if ($normalanswer4 == '' OR $normalanswer5 == '' OR $normalanswer6 == '' OR $normalanswer7 == '' OR $normalanswer8 == '' OR $normalanswer9 == '' OR $normalanswer10 == '' OR $normalanswer11 == '' OR $normalanswer12 == '' OR $normalanswer13 == '' OR $normalanswer14 == '' OR $normalanswer15 == '' OR $normalanswer16 == '' OR $normalanswer17 == '' OR $normalanswer18 $dropdownanswer1 = '' OR $dropdownanswer2 = '')right :)

ahh i see, so without the title, cheers!

D.Ilyin
01-17-2006, 03:29 PM
ahh i see, so without the title, cheers!
yes :)

Puntoboy
01-17-2006, 03:37 PM
yes :)

cheers mate, working perfectly now!

and yes you are a life saver. i dread to think how much money i have lost since upgrading my site.!

pipin
01-18-2006, 08:35 AM
I customized the form and wrote two new templates using it to make new posts in a certqain forum.

And it works very well.

But one problem occured:

i set permissions for unregistered User to make posts in this forum (this works by normal new thread in the form), but with the form it wont work.

rabid dingo
01-18-2006, 08:41 AM
This is killing me! I need 2 forms and I can't get any of 'em to work!

Abe1
01-18-2006, 09:41 PM
I customized the form and wrote two new templates using it to make new posts in a certqain forum.

And it works very well.

But one problem occured:

i set permissions for unregistered User to make posts in this forum (this works by normal new thread in the form), but with the form it wont work.

Are you using the latest version of the hack? This problem was fixed.

pipin
01-19-2006, 09:19 AM
Are you using the latest version of the hack? This problem was fixed.

doh. shame on me.

osariase
01-19-2006, 05:02 PM
Forgive me but I dont know what to do I uploaded the xml file and I dont know what to do from there. The instructions says edit main hook, what is that? please assist thanks i'm still new to this

D.Ilyin
01-19-2006, 05:49 PM
Forgive me but I dont know what to do I uploaded the xml file and I dont know what to do from there. The instructions says edit main hook, what is that? please assist thanks i'm still new to this
it's here ./admincp/plugin.php?do=modify
find Form hack and click edit.

sully02
01-19-2006, 06:22 PM
I seem to be having a bit of a problem with mine. I've modified it to have 7 text boxes for answering. All of the code looks right, but when the response is posted, only the first 5 text box answers show up. Any insight into why this is?

pipin
01-19-2006, 09:27 PM
I seem to be having a bit of a problem with mine. I've modified it to have 7 text boxes for answering. All of the code looks right, but when the response is posted, only the first 5 text box answers show up. Any insight into why this is?

you have all 7 variables in formanswer?

and this in the main hook?

////////////////////////////////////////////////////////////////////////////////////////////////////
//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(

'answer1' => TYPE_STR,
'answer2' => TYPE_STR,
'answer3' => TYPE_STR,
'answer4' => TYPE_STR,
'answer5' => TYPE_STR,
'answer6' => TYPE_STR,
'answer7' => TYPE_STR

));

// Part 2

$answer1 = $vbulletin->GPC['answer1'];
$answer2 = $vbulletin->GPC['answer2'];
$answer3 = $vbulletin->GPC['answer3'];
$answer4 = $vbulletin->GPC['answer4'];
$answer5 = $vbulletin->GPC['answer5'];
$answer6 = $vbulletin->GPC['answer6'];
$answer7 = $vbulletin->GPC['answer7'];

sully02
01-20-2006, 01:18 AM
you have all 7 variables in formanswer?

and this in the main hook?

////////////////////////////////////////////////////////////////////////////////////////////////////
//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(

'answer1' => TYPE_STR,
'answer2' => TYPE_STR,
'answer3' => TYPE_STR,
'answer4' => TYPE_STR,
'answer5' => TYPE_STR,
'answer6' => TYPE_STR,
'answer7' => TYPE_STR

));

// Part 2

$answer1 = $vbulletin->GPC['answer1'];
$answer2 = $vbulletin->GPC['answer2'];
$answer3 = $vbulletin->GPC['answer3'];
$answer4 = $vbulletin->GPC['answer4'];
$answer5 = $vbulletin->GPC['answer5'];
$answer6 = $vbulletin->GPC['answer6'];
$answer7 = $vbulletin->GPC['answer7'];

It looks a little different than that (I have more than just long answers), but that was the problem! I later added two questions, but forgot to add the answer variables. Thanks!

rabid dingo
01-20-2006, 07:39 AM
No matter what I do, I only get "Sorry! This forum is not accepting new posts."
Someone please help!

D.Ilyin
01-20-2006, 08:15 AM
No matter what I do, I only get "Sorry! This forum is not accepting new posts."
Someone please help!
try to change forumid in hook on some open for post forum.

rabid dingo
01-20-2006, 09:11 AM
I've done that. I have no idea what's wrong. I set it for an open forum. I even tried setting it both to post to an existing thread and a new one. I can't even get the form to show up. Just the error.

HaMaDa4eVeR
01-20-2006, 11:43 AM
Hello
I fixed all errors and the form apper to me but when i submitting
Invalid Forum specified. If you followed a valid link, please notify the administrator
althought I edit everything

//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="3";

what's the wrong

xOzzie
01-20-2006, 10:28 PM
I had that happen when I had the forumid set incorrectly.

XFSImperial
01-21-2006, 02:07 AM
I am having a minor issue with this hack. Installed and customized it, but I removed a large number of the questions except for question2 and longquestion1. However, when I visit the form, it still shows rows and blank form areas. I deleted the extra variables from both the part 1 & part 2 sections. Any suggestions to completely terminating the other blank sections?

pipin
01-21-2006, 05:13 AM
I am having a minor issue with this hack. Installed and customized it, but I removed a large number of the questions except for question2 and longquestion1. However, when I visit the form, it still shows rows and blank form areas. I deleted the extra variables from both the part 1 & part 2 sections. Any suggestions to completely terminating the other blank sections?

you have to edit the form template!

HaMaDa4eVeR
01-21-2006, 07:58 AM
I had that happen when I had the forumid set incorrectly.
NO I'm sure that I set the correct forumid and I activate the option
//ENABLE FORM TO BE POSTED - 1 = yes, 0 = no
$formforum="1";
and the forumid=3 and I've forum in my forum with id=3

$formforumid="3";

Blind Guardian
01-22-2006, 11:21 PM
I don't suppose anyone would know if it'd be possible to modify this plugin to act as a moderator warning system?

I like my moderators to both post a reason in the member's usernotes, aswell as send them a private message when they're warned. It'd be nice if I could streamline that into one form, which'd both post in their usernotes and send a PM notifying them of the warning.

Puntoboy
01-23-2006, 12:14 PM
i seem to be getting a database error with this hack

Database error in vBulletin 3.5.2:

Invalid SQL:
SELECT * FROM vb3_forumpermission
WHERE ( forumid IN() AND usergroupid IN (1)) AND
(maxthread=0 AND perhour=0);

MySQL Error : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND usergroupid IN (1)) AND
(maxthread=0 AND perhour=0)' a
Error Number : 1064
Date : Monday, January 23rd 2006 @ 01:51:46 PM
Script : http://www.puntosports.co.uk/forums/newthread.php?do=Application
Referrer : http://www.puntosports.co.uk/club_join.htm
IP Address : 82.37.156.173
Username : Unregistered
Classname : vb_database

D.Ilyin
01-24-2006, 01:30 PM
i seem to be getting a database error with this hack

Database error in vBulletin 3.5.2:

Invalid SQL:
SELECT * FROM vb3_forumpermission
WHERE ( forumid IN() AND usergroupid IN (1)) AND
(maxthread=0 AND perhour=0);

MySQL Error : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND usergroupid IN (1)) AND
(maxthread=0 AND perhour=0)' a
Error Number : 1064
Date : Monday, January 23rd 2006 @ 01:51:46 PM
Script : http://www.puntosports.co.uk/forums/newthread.php?do=Application
Referrer : http://www.puntosports.co.uk/club_join.htm
IP Address : 82.37.156.173
Username : Unregistered
Classname : vb_database
What have you did with it? :)
Cause last version works fine for guests :)

BaconDelight
01-24-2006, 02:28 PM
I remember reading in the 3.0x version of this hack that the resulting posts were not indexed for search. Is that no longer an issue in 3.5x?

BaconDelight
01-24-2006, 05:24 PM
Okay, I've installed this on a test board and it works great (and yes, the resulting posts are searchable.

I just have one question. I'd like some more detailed formatting from the forumanswers template, but if I try adding bbcode to the template, I get a parse error. How can I get that kind of formatting? For example, the way it is now, the thread comes out like this:

What is the meaning of life?
The answer is 42.

whereas I'd like it to look like this:

What is the meaning of life?
The answer is 42.

D.Ilyin
01-25-2006, 06:09 AM
Okay, I've installed this on a test board and it works great (and yes, the resulting posts are searchable.

I just have one question. I'd like some more detailed formatting from the forumanswers template, but if I try adding bbcode to the template, I get a parse error. How can I get that kind of formatting? For example, the way it is now, the thread comes out like this:

What is the meaning of life?
The answer is 42.

whereas I'd like it to look like this:

What is the meaning of life?
The answer is 42.
Try to add spaces before and after variables used in formanswer template.
I wrote about that some pages ago in this thread.

BaconDelight
01-25-2006, 01:48 PM
Try to add spaces before and after variables used in formanswer template.
I wrote about that some pages ago in this thread.Thanks, I actually got it working yesterday. I think some colons were screwing it up.

gyankow
01-25-2006, 07:49 PM
Will this work in 3.5.3?

Abe1
01-25-2006, 11:02 PM
Will this work in 3.5.3?

Yes.

D.Ilyin
01-26-2006, 04:27 AM
Yes.
Abe1 i'm sory, but could you answer on my question (https://vborg.vbsupport.ru/showpost.php?p=875433&postcount=575)?
I added massive and additional REQUEST, another one template for circle with massive, but still can't make it work all together :(.

Abe1
01-26-2006, 12:18 PM
Abe1 i'm sory, but could you answer on my question (https://vborg.vbsupport.ru/showpost.php?p=875433&postcount=575)?
I added massive and additional REQUEST, another one template for circle with massive, but still can't make it work all together :(.

I'll have to see how I have the code.

bashy
01-29-2006, 05:06 PM
Hello peeps

I would like some help please creating a form..

I have read the plugin and most of it is beyond my comprehension :(
I have included an attachment as to what i would like on the form.....

I really hope some one can help

Thanks in advance

leroub
01-30-2006, 04:41 AM
<font color="Green">* I click on install</font>

This is possible that while clicking on "New message" one arrives in the form ?
Without pass by a link...

thx for your help...

D.Ilyin
01-30-2006, 09:31 AM
* I click on install

This is possible that while clicking on "New message" one arrives in the form ?
Without pass by a link...

thx for your help...
just look at addons to this hack or here (https://vborg.vbsupport.ru/showthread.php?t=102923).

leroub
01-30-2006, 07:39 PM
thx... :up:

Kinneas
02-02-2006, 12:52 AM
Hey, just a quickie. Sorry if it's already been answered, I did a brief search but It's 3AM and I'm exhausted :P

I know that the form has the ability to auto create a poll...but is it possible to set it up as well so that the poll has an automatic timeout specified by me? I intend to use the form to create a poll which closes after 3 days automatically. Is this possible to do?

silurius
02-02-2006, 02:05 AM
For some reason, this form stopped posting to my specified forum all of a sudden. I have combed through the plugin code and can't figure it out. It will email though. Anyone else having this issue? Might have popped up since upgrading to 3.5.3 but I can't remember.

Kinneas
02-02-2006, 03:39 PM
Hey, just a quickie. Sorry if it's already been answered, I did a brief search but It's 3AM and I'm exhausted :P

I know that the form has the ability to auto create a poll...but is it possible to set it up as well so that the poll has an automatic timeout specified by me? I intend to use the form to create a poll which closes after 3 days automatically. Is this possible to do?

Never mind, figured it out :)

A simple

$poll->set('timeout', '3' );

added to the poll creation process deals with that :D

CnB
02-03-2006, 06:55 PM
Edit: i fixed the problem

though one other thing
is there a way to make the form submissions show up as new posts ?
each user who submits a form gets no post count added
and the forum where the form is submitted wont show a new post

WNxWakko
02-05-2006, 04:01 AM
Is there any way to add the Preview Thread or Preview Form in this case?

I deperatly need that feature if its possible somehow.

Puntoboy
02-05-2006, 04:05 PM
Is there any way to add the Preview Thread or Preview Form in this case?

I deperatly need that feature if its possible somehow.

how can i stop guests accessing the form?

zennifer
02-10-2006, 12:37 PM
This is a great hack and is working well with one acception.

If anyone replys to the thread that is created by it the replys are not listed. In other words all threads created by this hack are listed as having 0 replys even though they may have a dozen or more. Has anyone experianced this?

ArchangelX
02-11-2006, 03:02 AM
I'm confused...what is the hooks? How do I edit it? I'm sorry...this is my first time editing stuff like this...can someone give me a hint? Thanks!

ArchangelX
02-11-2006, 04:01 AM
Forget it...I figured it out...thanks!

PET
02-12-2006, 03:32 AM
I don't really understand this:


2 - Edit the main hook - the instructions are all inside the hook itself, in the top half. Follow the instructions carefully!


Where are the options ? How do i create a new form ??

Jaguartje
02-18-2006, 04:36 PM
I'm using this hack a while now, but now I found out that Unregistered or unloggedin visitors can also fill in the form and post it. I don't want this. The form has to get a prevention of submitting the form if someone is known as "Unregistered" on the website. I've tried the code below, but this doesn't seem to function:

if ($bbuserinfo == 'Unregistered')
{
$errormessage = "You have to register or login first before submitting this form. You can register <a href=\"http://www.coy-guild.net/register.php\">here</a>" or log in <a href=\"http://www.coy-guild.net/login.php\">here</a>.;
eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
exit();
}

Any suggestions?

Abe1
02-18-2006, 10:13 PM
I'm using this hack a while now, but now I found out that Unregistered or unloggedin visitors can also fill in the form and post it. I don't want this. The form has to get a prevention of submitting the form if someone is known as "Unregistered" on the website. I've tried the code below, but this doesn't seem to function:

if ($bbuserinfo == 'Unregistered')
{
$errormessage = "You have to register or login first before submitting this form. You can register <a href=\"http://www.coy-guild.net/register.php\">here</a>" or log in <a href=\"http://www.coy-guild.net/login.php\">here</a>.;
eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
exit();
}

Any suggestions?

In the hook, there is the following setting: USERGROUPS ALLOWED

Set it to 0 and 1

Jaguartje
02-19-2006, 09:35 AM
Thanks, I missed that option!

descds
02-19-2006, 01:35 PM
OK a little confused here.

My form works perfectly well have is by default posting happily to

$formforumid = "27";

However from what i understand if i put &f= into the url i can get it to post to other forums but can i heck as like get that to work :)

So say i use

newthread.php?do=Usenet_Review=f=12

it should create a new thread into forum ID number 12 correct ?

However it insists on posting to 27 each time.

Obviously it would be nice to use one form and hack and then put in the url which forums to post it to.

Any ideas what i'm doing wrong ? Or is there more i should be looking at ?

Abe1
02-19-2006, 03:00 PM
OK a little confused here.

My form works perfectly well have is by default posting happily to

$formforumid = "27";

However from what i understand if i put &f= into the url i can get it to post to other forums but can i heck as like get that to work :)

So say i use

newthread.php?do=Usenet_Review=f=12

it should create a new thread into forum ID number 12 correct ?

However it insists on posting to 27 each time.

Obviously it would be nice to use one form and hack and then put in the url which forums to post it to.

Any ideas what i'm doing wrong ? Or is there more i should be looking at ?

You have to add it to the Template also. You have to add a hidden field named forumid.

descds
02-19-2006, 03:49 PM
You have to add it to the Template also. You have to add a hidden field named forumid.

OK i'm nearly there i'm sure but its not quite right yet.

Heres my plugins and templates. Can you tell me what i'm doing wrong ?

// 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 = "Usenet_Review";

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,
'radioanswer1' => TYPE_STR,
'radioanswer3other' => TYPE_STR,
'answer1' => TYPE_STR,
'answer2' => TYPE_STR,
'answer3' => TYPE_STR,
'longanswer1' => TYPE_STR,
'longanswer2' => TYPE_STR
));

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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(6,7,5,12,17,18,33))) 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 = "Usenet";
// Name of the answer template
$answertemplate = "Usenet_Review";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = $forumid;
//if (strlen($formforumid) == 0) {
// $errormessage = $vbulletin->userinfo['username'] . ", Fatal Error - please contact admin and tell them the formforumid variable was blank when trying to create a new classified advert. Thanks!";
// eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
// exit();
//}

//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 = "0";

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

//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 this form!"; //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 = "1";

////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formtitle = "Usenet Review Submit";

////////////////////////////////////////////////////////////////////////////////////////////////////
//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.
////////////////////////////////////////////////////////////////////////////////////////////////////
if ($radioanswer1 !="N/A") {
$posttitle = "REVIEW: $normalanswer1 [$radioanswer1]";
} else {
$posttitle = "REVIEW: $normalanswer1";
}
////////////////////////////////////////////////////////////////////////////////////////////////////
//PURPOSE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formpurpose = "Try and be as concise as you can when submitting reviews. We appreciate that it takes a little longer but the more boxes you fill in, the better it is for everyone looking at it.";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion1 = "Please Provide a Title For the New review. You don't need to submit REVIEW: or REGION here, it will be automatically added afterwards.";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion1 = "Is this post N/A (Not Known) PAL or NTSC";

// The following choices must NOT have quotation marks
$radiochoice1a = "N/A";
$radiochoice1b = "PAL";
$radiochoice1c = "NTSC";

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

//QUESTION 1 (do not use quotation marks or you will get a parse error)
$question1 = "Usenet Group";
$explain1 = "Please specify which group this post is goin up in ..";

//QUESTION 2 (do not use quotation marks or you will get a parse error)
$question2 = "Post Filename?";
$explain2 = "Please specify the searchable filename for this post ..";

//QUESTION 3 (do not use quotation marks or you will get a parse error)
$question3 = "Link to a cover image";
$explain3 = "If you have a link to a cover image (I.e. AMAZON) please post it here.";


////////////////////////////////////////////////////////////////////////////////////////////////////
//LONG TEXT AREA INPUT: QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$longquestion1 = "Please submit a text based NFO:";
$longexplain1 = "You can cut and paste into this box and it eill be encapsuled into code tags to keep the format";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//LONG TEXT AREA INPUT: QUESTION 2 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$longquestion2 = "Please Provide A movie synopsis";
$longexplain2 = "You can cut and paste this from other sites as long as its a movie synopsis and not someones review.";

////////////////////////////////////////////////////////////////////////////////////////////////
////// 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 $answer1 == '' OR $answer2 == '')
{
$errormessage = "$bbuserinfo[username], you need to fill in the <b>Title</b>, <b>Group</b> and <b>Search Name</b> to submit your review.";
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 ($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'] = '0';
$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";
$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();
}

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

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

Form Template
$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="100%" align="center">
<tr>
<td class="tcat" colspan="3">
$vboptions[bbtitle] - $formtitle
</td>
</tr>
<tr>
<td class="panelsurround" align="center" colspan="3">

<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 class="alt1" colspan="3">
<b>$normalquestion1</b>
</td>
</tr>
<tr>
<td class="alt2" colspan="3">
<input type="text" size="73" maxlength="73" name="normalanswer1" />
</td>
</tr>
<tr>
<td class="alt2" colspan="3">
<b>$radioquestion1</b>
</td></tr><tr>
<td><input type="radio" checked name="radioanswer1" value="$radiochoice1a" /> $radiochoice1a </td>
<td><input type="radio" name="radioanswer1" value="$radiochoice1b" /> $radiochoice1b </td>
<td><input type="radio" name="radioanswer1" value="$radiochoice1c" /> $radiochoice1c </td>
</tr>
<tr>
<td class="alt1" valign="middle">
<b>Username</b>:<br />
Your Username.</td>
<td class="alt1" valign="middle" colspan="2">
<b>$bbuserinfo[username]</b></td>
</tr>
<tr>
<td class="alt2" valign="middle">
<b>$question1</b>:<br />
$explain1</td>
<td class="alt2" valign="middle" colspan="2">
<input type="text" size="30" name="answer1" /></td>
</tr>
<tr>
<td class="alt1" valign="middle">
<b>$question2</b>:<br />
$explain2</td>
<td class="alt1" valign="middle" colspan="2">
<input type="text" size="30" name="answer2" /></td>
</tr>
<tr>
<td class="alt2" valign="middle">
<b>$question3</b>:<br />
$explain3</td>
<td class="alt2" valign="middle" colspan="2">
<input type="text" size="30" name="answer3" /></td>
</tr>
<tr>
<td class="alt2" valign="middle">
<b>$longquestion1</b><br>
$longexplain1</td>
<td class="alt2" valign="middle" colspan="2">
<textarea rows="20" cols="70" name="longanswer1"></textarea>
</td>
</tr>
</td>
</tr>
<tr>
<td class="alt2" valign="middle">
<b>$longquestion2</b><br>
$longexplain2</td>
<td class="alt2" valign="middle" colspan="2">
<textarea rows="20" cols="70" name="longanswer2"></textarea>
</td>
</tr>
</td>
</tr>
<tr>
<td valign="top" colspan="3">
<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>

Everytime i try using something like

newthread.php?do=Usenet_Review&f=16 it says its posted but nothing shows in that forum. I've tried a variety of different forums and checked access and posting rights etc so its something i have slightly wrong somewhere in the code.

Any help would very much be appreciated.

BTW awesome hack ..

WNxWakko
02-19-2006, 08:09 PM
Is there any way to add a Preview to the form?

Abe1
02-19-2006, 09:04 PM
Is there any way to add a Preview to the form?

Not right now.

descds
02-19-2006, 09:37 PM
Hi abe1.

I know i'm probably being a pain and your busy but if you could take a quick look and see what i'm doing wrong with this &f=xx part of the form i really would appreciate it.

It seems silly to create 7 plugin clones when one will do with the &f= added somewhere .

JeffreyC
02-20-2006, 05:33 AM
Is anyone willing (if paid) to help me implement this into my forum?

I have failed at it.

descds
02-20-2006, 03:19 PM
I think i've exhausted all combinations now :(

I've tried

$formforumid = $forumid;

I've tried

$formforumid = $_GET ['f'];

I've tried

$formforumid = $_GET ['$forumid'];

And many more combinations.

The url i'm passing is

http://localhost/forum/newthread.php?do=Usenet_Review&f=20

But no matter what i do i cannot get it to post in forum 20 (or any forum for that matter).

And i have this

<input type="hidden" value="$forumid" name="f" />

under

<input type="hidden" value="submit" name="action" />

in my main template.

Please someone tell me what i'm doing wrong :) Cos i have no idea why it won;t accept the forum number being passed along the url ...

Thanatos
02-20-2006, 11:54 PM
For some reason, this form stopped posting to my specified forum all of a sudden. I have combed through the plugin code and can't figure it out. It will email though. Anyone else having this issue? Might have popped up since upgrading to 3.5.3 but I can't remember.

I added a 3rd form tonight and suddenly, it stopped working.

I can submit any of the 3 forms with success, but none will actually appear in any of their designated forums. This was working fine before I added a 3rd form.

I can set it to email or PM and it works correctly, emailing or PM'ing the form to me, but that isn't very helpful.

It was working in 3.5.3 for me till tonight lol.

I am clueless. Anyone else have suggestions?

Abe1
02-21-2006, 03:15 AM
I think i've exhausted all combinations now :(

I've tried

$formforumid = $forumid;

I've tried

$formforumid = $_GET ['f'];

I've tried

$formforumid = $_GET ['$forumid'];

And many more combinations.

The url i'm passing is

http://localhost/forum/newthread.php?do=Usenet_Review&f=20

But no matter what i do i cannot get it to post in forum 20 (or any forum for that matter).

And i have this

<input type="hidden" value="$forumid" name="f" />

under

<input type="hidden" value="submit" name="action" />

in my main template.

Please someone tell me what i'm doing wrong :) Cos i have no idea why it won;t accept the forum number being passed along the url ...

Try this:
$formforumid = $_REQUEST['forumid'];

PoisonDart
02-21-2006, 03:42 AM
Can you update this hack for 3.5.3

descds
02-21-2006, 10:59 AM
Try this:
$formforumid = $_REQUEST['forumid'];

Still refuses to work :(
This has to be something i'm doing wrong :(

I've tried

http://localhost/forum/newthread.php?do=Usenet_Review&f=20

and

http://localhost/forum/newthread.php?do=Usenet_Review?f=20

Both tell me that they have posted but i get nothing in that forum or any other forum for that matter.

I now have

$formforumid = $_REQUEST['$forumid'];

in my plugin

and

<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" />

In part of my main form template ...

Still no show :(

I've tried removing the $ in the main form so :-

<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" />

I've tried adding the $ to the php

$formforumid = $_REQUEST['$forumid'];

And both combinations of that :(

I really just can't get it to post. Please, if you could, and i really would appreciate the help, can you tell me concisely where i'm going wrong.

heres my main form and php files once more :-

Main Plugin
// 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 = "Usenet_Review";

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,
'radioanswer1' => TYPE_STR,
'radioanswer3other' => TYPE_STR,
'answer1' => TYPE_STR,
'answer2' => TYPE_STR,
'answer3' => TYPE_STR,
'longanswer1' => TYPE_STR,
'longanswer2' => TYPE_STR
));

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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(6,7,5,12,17,18,33))) 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 = "Usenet";
// Name of the answer template
$answertemplate = "Usenet_Review";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = $forumid;
//if (strlen($formforumid) == 0) {
// $errormessage = $vbulletin->userinfo['username'] . ", Fatal Error - please contact admin and tell them the formforumid variable was blank when trying to create a new classified advert. Thanks!";
// eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
// exit();
//}

//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 = "0";

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

//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 this form!"; //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 = "1";

////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formtitle = "Usenet Review Submit";

////////////////////////////////////////////////////////////////////////////////////////////////////
//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.
////////////////////////////////////////////////////////////////////////////////////////////////////
if ($radioanswer1 !="N/A") {
$posttitle = "REVIEW: $normalanswer1 [$radioanswer1]";
} else {
$posttitle = "REVIEW: $normalanswer1";
}
////////////////////////////////////////////////////////////////////////////////////////////////////
//PURPOSE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formpurpose = "Try and be as concise as you can when submitting reviews. We appreciate that it takes a little longer but the more boxes you fill in, the better it is for everyone looking at it.";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion1 = "Please Provide a Title For the New review. You don't need to submit REVIEW: or REGION here, it will be automatically added afterwards.";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion1 = "Is this post N/A (Not Known) PAL or NTSC";

// The following choices must NOT have quotation marks
$radiochoice1a = "N/A";
$radiochoice1b = "PAL";
$radiochoice1c = "NTSC";

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

//QUESTION 1 (do not use quotation marks or you will get a parse error)
$question1 = "Usenet Group";
$explain1 = "Please specify which group this post is goin up in ..";

//QUESTION 2 (do not use quotation marks or you will get a parse error)
$question2 = "Post Filename?";
$explain2 = "Please specify the searchable filename for this post ..";

//QUESTION 3 (do not use quotation marks or you will get a parse error)
$question3 = "Link to a cover image";
$explain3 = "If you have a link to a cover image (I.e. AMAZON) please post it here.";


////////////////////////////////////////////////////////////////////////////////////////////////////
//LONG TEXT AREA INPUT: QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$longquestion1 = "Please submit a text based NFO:";
$longexplain1 = "You can cut and paste into this box and it eill be encapsuled into code tags to keep the format";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//LONG TEXT AREA INPUT: QUESTION 2 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$longquestion2 = "Please Provide A movie synopsis";
$longexplain2 = "You can cut and paste this from other sites as long as its a movie synopsis and not someones review.";

////////////////////////////////////////////////////////////////////////////////////////////////
////// 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 $answer1 == '' OR $answer2 == '')
{
$errormessage = "$bbuserinfo[username], you need to fill in the <b>Title</b>, <b>Group</b> and <b>Search Name</b> to submit your review.";
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 ($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'] = '0';
$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";
$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();
}

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

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

Main form

$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="100%" align="center">
<tr>
<td class="tcat" colspan="3">
$vboptions[bbtitle] - $formtitle
</td>
</tr>
<tr>
<td class="panelsurround" align="center" colspan="3">

<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 class="alt1" colspan="3">
<b>$normalquestion1</b>
</td>
</tr>
<tr>
<td class="alt2" colspan="3">
<input type="text" size="73" maxlength="73" name="normalanswer1" />
</td>
</tr>
<tr>
<td class="alt2" colspan="3">
<b>$radioquestion1</b>
</td></tr><tr>
<td><input type="radio" checked name="radioanswer1" value="$radiochoice1a" /> $radiochoice1a </td>
<td><input type="radio" name="radioanswer1" value="$radiochoice1b" /> $radiochoice1b </td>
<td><input type="radio" name="radioanswer1" value="$radiochoice1c" /> $radiochoice1c </td>
</tr>
<tr>
<td class="alt1" valign="middle">
<b>Username</b>:<br />
Your Username.</td>
<td class="alt1" valign="middle" colspan="2">
<b>$bbuserinfo[username]</b></td>
</tr>
<tr>
<td class="alt2" valign="middle">
<b>$question1</b>:<br />
$explain1</td>
<td class="alt2" valign="middle" colspan="2">
<input type="text" size="30" name="answer1" /></td>
</tr>
<tr>
<td class="alt1" valign="middle">
<b>$question2</b>:<br />
$explain2</td>
<td class="alt1" valign="middle" colspan="2">
<input type="text" size="30" name="answer2" /></td>
</tr>
<tr>
<td class="alt2" valign="middle">
<b>$question3</b>:<br />
$explain3</td>
<td class="alt2" valign="middle" colspan="2">
<input type="text" size="30" name="answer3" /></td>
</tr>
<tr>
<td class="alt2" valign="middle">
<b>$longquestion1</b><br>
$longexplain1</td>
<td class="alt2" valign="middle" colspan="2">
<textarea rows="20" cols="70" name="longanswer1"></textarea>
</td>
</tr>
</td>
</tr>
<tr>
<td class="alt2" valign="middle">
<b>$longquestion2</b><br>
$longexplain2</td>
<td class="alt2" valign="middle" colspan="2">
<textarea rows="20" cols="70" name="longanswer2"></textarea>
</td>
</tr>
</td>
</tr>
<tr>
<td valign="top" colspan="3">
<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>

The form works perfectly if i hard code the forum ID in the plugin so i know in principal the form is perfectly fine ..

Abe1
02-21-2006, 12:07 PM
Try this:// 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 = "Usenet_Review";

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,
'radioanswer1' => TYPE_STR,
'radioanswer3other' => TYPE_STR,
'answer1' => TYPE_STR,
'answer2' => TYPE_STR,
'answer3' => TYPE_STR,
'longanswer1' => TYPE_STR,
'longanswer2' => TYPE_STR
));

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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(6,7,5,12,17,18,33))) 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 = "Usenet";
// Name of the answer template
$answertemplate = "Usenet_Review";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = $forumid;
//if (strlen($formforumid) == 0) {
// $errormessage = $vbulletin->userinfo['username'] . ", Fatal Error - please contact admin and tell them the formforumid variable was blank when trying to create a new classified advert. Thanks!";
// eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
// exit();
//}

//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 = "0";

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

//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 this form!"; //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 = "1";

////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formtitle = "Usenet Review Submit";

////////////////////////////////////////////////////////////////////////////////////////////////////
//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.
////////////////////////////////////////////////////////////////////////////////////////////////////
if ($radioanswer1 !="N/A") {
$posttitle = "REVIEW: $normalanswer1 [$radioanswer1]";
} else {
$posttitle = "REVIEW: $normalanswer1";
}
////////////////////////////////////////////////////////////////////////////////////////////////////
//PURPOSE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formpurpose = "Try and be as concise as you can when submitting reviews. We appreciate that it takes a little longer but the more boxes you fill in, the better it is for everyone looking at it.";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion1 = "Please Provide a Title For the New review. You don't need to submit REVIEW: or REGION here, it will be automatically added afterwards.";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion1 = "Is this post N/A (Not Known) PAL or NTSC";

// The following choices must NOT have quotation marks
$radiochoice1a = "N/A";
$radiochoice1b = "PAL";
$radiochoice1c = "NTSC";

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

//QUESTION 1 (do not use quotation marks or you will get a parse error)
$question1 = "Usenet Group";
$explain1 = "Please specify which group this post is goin up in ..";

//QUESTION 2 (do not use quotation marks or you will get a parse error)
$question2 = "Post Filename?";
$explain2 = "Please specify the searchable filename for this post ..";

//QUESTION 3 (do not use quotation marks or you will get a parse error)
$question3 = "Link to a cover image";
$explain3 = "If you have a link to a cover image (I.e. AMAZON) please post it here.";


////////////////////////////////////////////////////////////////////////////////////////////////////
//LONG TEXT AREA INPUT: QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$longquestion1 = "Please submit a text based NFO:";
$longexplain1 = "You can cut and paste into this box and it eill be encapsuled into code tags to keep the format";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//LONG TEXT AREA INPUT: QUESTION 2 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$longquestion2 = "Please Provide A movie synopsis";
$longexplain2 = "You can cut and paste this from other sites as long as its a movie synopsis and not someones review.";

////////////////////////////////////////////////////////////////////////////////////////////////
////// 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 $answer1 == '' OR $answer2 == '')
{
$errormessage = "$bbuserinfo[username], you need to fill in the <b>Title</b>, <b>Group</b> and <b>Search Name</b> to submit your review.";
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 ($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'] = '0';
$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";
$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();
}

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

eval('print_output("' . fetch_template("$maintemplate") . '");');
}
}and$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="forumid">

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="tcat" colspan="3">
$vboptions[bbtitle] - $formtitle
</td>
</tr>
<tr>
<td class="panelsurround" align="center" colspan="3">

<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 class="alt1" colspan="3">
<b>$normalquestion1</b>
</td>
</tr>
<tr>
<td class="alt2" colspan="3">
<input type="text" size="73" maxlength="73" name="normalanswer1" />
</td>
</tr>
<tr>
<td class="alt2" colspan="3">
<b>$radioquestion1</b>
</td></tr><tr>
<td><input type="radio" checked name="radioanswer1" value="$radiochoice1a" /> $radiochoice1a </td>
<td><input type="radio" name="radioanswer1" value="$radiochoice1b" /> $radiochoice1b </td>
<td><input type="radio" name="radioanswer1" value="$radiochoice1c" /> $radiochoice1c </td>
</tr>
<tr>
<td class="alt1" valign="middle">
<b>Username</b>:<br />
Your Username.</td>
<td class="alt1" valign="middle" colspan="2">
<b>$bbuserinfo[username]</b></td>
</tr>
<tr>
<td class="alt2" valign="middle">
<b>$question1</b>:<br />
$explain1</td>
<td class="alt2" valign="middle" colspan="2">
<input type="text" size="30" name="answer1" /></td>
</tr>
<tr>
<td class="alt1" valign="middle">
<b>$question2</b>:<br />
$explain2</td>
<td class="alt1" valign="middle" colspan="2">
<input type="text" size="30" name="answer2" /></td>
</tr>
<tr>
<td class="alt2" valign="middle">
<b>$question3</b>:<br />
$explain3</td>
<td class="alt2" valign="middle" colspan="2">
<input type="text" size="30" name="answer3" /></td>
</tr>
<tr>
<td class="alt2" valign="middle">
<b>$longquestion1</b><br>
$longexplain1</td>
<td class="alt2" valign="middle" colspan="2">
<textarea rows="20" cols="70" name="longanswer1"></textarea>
</td>
</tr>
</td>
</tr>
<tr>
<td class="alt2" valign="middle">
<b>$longquestion2</b><br>
$longexplain2</td>
<td class="alt2" valign="middle" colspan="2">
<textarea rows="20" cols="70" name="longanswer2"></textarea>
</td>
</tr>
</td>
</tr>
<tr>
<td valign="top" colspan="3">
<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>

mkdevo
02-21-2006, 01:07 PM
is there/will there be any way to use a form to submit a new calendar event?

descds
02-21-2006, 01:47 PM
Thanks Abe that now works perfectly. As a matter of knowledge what was i doing wrong ?

Abe1
02-21-2006, 07:06 PM
Thanks Abe that now works perfectly. As a matter of knowledge what was i doing wrong ?

All I did was change f to forumid.

Thanatos
02-21-2006, 08:43 PM
Any suggestions regarding the forms breaking and not posting when submitted while mailing and pm'ing still works?

Abe1
02-22-2006, 02:12 AM
Any suggestions regarding the forms breaking and not posting when submitted while mailing and pm'ing still works?

If they dont have permission to post.

Thanatos
02-22-2006, 08:59 PM
If they dont have permission to post.

That wouldn't be valid, I am the Administrator, I can see and post in ALL of these forums and the apps I submit do not post in these forums. My usergroup is defined in the forms as well.

So does that mean that if a user can't see the forum, it won't submit to it? The old version was doing this just fine. Can this be defined or can I get the old version? lol

Abe1
02-22-2006, 10:04 PM
That wouldn't be valid, I am the Administrator, I can see and post in ALL of these forums and the apps I submit do not post in these forums. My usergroup is defined in the forms as well.

So does that mean that if a user can't see the forum, it won't submit to it? The old version was doing this just fine. Can this be defined or can I get the old version? lol

What old version?

Just give them permission to post. They dont need permission to view I believe.

Thanatos
02-22-2006, 10:38 PM
Any older version..seemed to work.

The point is...I am the Admin, I have permission to do both and the forms won't work for me. They submit, they just never appear. I get no indication of an error, just the message telling me thanks for submitting the form, but nothing appears, even if I go and look under new posts.

oni0n56
02-25-2006, 07:44 PM
Will this work with 3.5.4??

This is exactly what I need...

Abe1
02-26-2006, 01:27 AM
Will this work with 3.5.4??

This is exactly what I need...

Yes.

OrangeFlea
02-27-2006, 03:55 PM
I'm still trying to grasp the concept behind this hack. Once you've developed your form and you post it as a thread, will only the form be presented in the thread and will everyone's answers be viewable in the thread (to everyone), or will each members' answered form be automatically sent to an admin or a moderator?

I'm trying to understand the exact process and capabilities (from the creation of the form to the submitted form)

PtP
02-28-2006, 03:21 AM
I have been pulling my hair our trying to force one of my forms to use a certain style other than the default, I dont not allow users to change styles BUT I have different styles on some of the forums and wish to use one of these on one of my forms, Is this possible. any help appreciated.

BaconDelight
03-01-2006, 03:22 AM
I'm still trying to grasp the concept behind this hack. Once you've developed your form and you post it as a thread, will only the form be presented in the thread and will everyone's answers be viewable in the thread (to everyone), or will each members' answered form be automatically sent to an admin or a moderator?

I'm trying to understand the exact process and capabilities (from the creation of the form to the submitted form)

You don't post the form as a thread. Esentially, the form takes the place of the "Create New Thread" page. What happens to the responses depends on what option you choose. The response will either be posted as a new thread, sent as a PM to whomever you specify, as a reply to an existing thread.

lolo?
03-01-2006, 03:49 PM
Hi evry one
how to make a drop down menu
in this line

//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 = "2";
thanks

dodgechargerfan
03-01-2006, 08:20 PM
Finally figured out how to get the form the way I needed.

Thanks for this hack!

<installed>

MythoLogy
03-01-2006, 11:00 PM
Finally figured out how to get the form the way I needed.


Thanks for this hack!

<installed>

For some less vbulletin familiar users it might be a little tough knowing that the "Hook" is the plug-in itself. Hopefully they check out the thread or ask.

*clicks install - Great 2 hacks Abe1

Going to make this so users can apply for usergroups aka separate guilds families. So many thanks for this!

Aesma Deva
03-02-2006, 02:55 AM
I want to try using this along with GARS. Thankzz, Abe.
*Installs second hack from Abe in 2 days*
Edit ~ And yes, you might want to add that you can edit it through the plugin manager in the instructions.

zennifer
03-02-2006, 07:04 PM
My moderator form goes to a private moderator board, and all the posts are coming through as 'moderated', even though the forum is not set that way - the forums settings say 'no' to all the moderation questions.. and the people submitting the forms are NOT on moderated status.. Any ideas?


I too am having this same problem.

lolo?
03-03-2006, 06:11 AM
hello how to add multiple forum choice??
i have this code
$formforumid = "2";
$formforumid = "3";
but the from make a post only on the last forum never in the first
can you help me please
thanks a lot

heynurse
03-03-2006, 06:13 PM
Does anyone have forms and templates that they would like to share? I'm looking to create a moderator application form, but if someone else has already done the work of modifying the hook and templates and would like to share them with us all that would be great!

I'm sure that there are several good uses of this form hack and it would be interesting to hear all the ways you are using it.

Thanks!

SLGR
03-04-2006, 04:08 AM
Is there anyway to use this form as a separate .php file (example: /forum/form.php) and not as "/newthread.php?do=form"?

Thanatos
03-06-2006, 11:33 PM
I have found that "Adv. Editing Options for Mods and Admins" conflicts with this, but erratically.

Once I uninstalled this, my forms would submit into their specified forums again.

Jayphen
03-07-2006, 03:12 AM
So can this form be put anywhere? (ie outside the forum itself, but on the same server etc)

aflax045
03-07-2006, 07:56 PM
I have figured out how to put the applicant name in the thread title and know how the "default thread title" works. However, is it possible for this to be:
Applicant Name: Default Thread Title

Example:

UserBob - Administrator Application

ca99uk
03-08-2006, 03:01 PM
Hello,

firstly thanks for the hardwork on the form. Secondly it works great for me except one thing (dont know if its possible or not). When a user posts a message using the form the subscription doesnt seem to work. I am using this form as a sort of helpdesk ticket and want the users to get an email when I reply to the post.

It works great if they post without using the form but if they make a post using the form their subscription doesnt seem to work, and they get no email notifications???

Also my HTML or coding skills are very very very very basic so if there is a fix or something I can do to get this working a step by step explanation would be great :nervous:

Any ideas and thanks in advance??

Jon.
03-08-2006, 03:32 PM
Can someone tell me what the main hook is, and where i can find it?

ca99uk
03-10-2006, 07:34 AM
Anyone? I would really appreciate any help with this one :)

.......

firstly thanks for the hardwork on the form. Secondly it works great for me except one thing (dont know if its possible or not). When a user posts a message using the form the subscription doesnt seem to work. I am using this form as a sort of helpdesk ticket and want the users to get an email when I reply to the post.

It works great if they post without using the form but if they make a post using the form their subscription doesnt seem to work, and they get no email notifications???

Also my HTML or coding skills are very very very very basic so if there is a fix or something I can do to get this working a step by step explanation would be great

Any ideas and thanks in advance??

silly rabbit
03-10-2006, 02:14 PM
I've played with this hack a little (works like a charm thx!) question is: If posting 'form' replys to a thread and/or forum has anybody had any good success (they'd like to share) REVERSING THE PROCESS???

Example: Let's say I design my own custom 'signup' page the results of which get posted into a forum. I'd like to be able to 'edit' / retrieve the data posted back INTO A FORM PAGE (ie: repopulate the data) for review / changes as opposed to simply using the Vb editor??

Rabbit

jilly
03-12-2006, 02:53 PM
My moderator form goes to a private moderator board, and all the posts are coming through as 'moderated', even though the forum is not set that way - the forums settings say 'no' to all the moderation questions.. and the people submitting the forms are NOT on moderated status.. Any ideas?

Again, the requests are not coming from a moderated usergroup, and the forum they are pointed to is not set to have posts or threads in the forum moderated. I am using version 3.3

Elikster
03-13-2006, 02:48 PM
I have modifed the XML to have it working, and it submits, but it does not get it posted into the forum itself as it is intended here. Here is the copy of the XML file.


<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="form_hack" active="1">
<title>Form Hack</title>
<description>Create a

form.</description>
<version>3.3</version>
<codes>
</codes>
<templates>
<template

name="form" templatetype="template" date="1133965929" username="Abe" version="3.5.2"><![CDATA[$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" />

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"

align="center">
<tr>
<td class="tcat" colspan="3">
$vboptions[bbtitle] - $formtitle
</td>
</tr>
<tr>
<td class="panelsurround" align="center" colspan="3">

<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 class="alt1" valign="middle">
<b>Username</b>:<br />
Your Username.</td>
<td class="alt1" valign="middle" colspan="2">
<b>$bbuserinfo[username]</b></td>
</tr>

<tr>
<td class="alt1" valign="middle">
<b>$dropdownquestion1</b>:<br />
$explain3</td>
<td class="alt1" valign="middle" colspan="2">
<select name="dropdownanswer1">
<option value="$dropdownchoice1a">$dropdownchoice1a</option>
<option value="$dropdownchoice1b">$dropdownchoice1b</option>
<option value="$dropdownchoice1c">$dropdownchoice1c</option>
<option value="$dropdownchoice1d">$dropdownchoice1d</option>
<option value="$dropdownchoice1e">$dropdownchoice1e</option>
<option value="$dropdownchoice1f">$dropdownchoice1f</option>
<option value="$dropdownchoice1g">$dropdownchoice1g</option>
<option value="$dropdownchoice1h">$dropdownchoice1h</option>
<option value="$dropdownchoice1i">$dropdownchoice1i</option>
<option value="$dropdownchoice1j">$dropdownchoice1j</option>
<option value="$dropdownchoice1k">$dropdownchoice1k</option>
<option value="$dropdownchoice1l">$dropdownchoice1l</option>
<option value="$dropdownchoice1m">$dropdownchoice1m</option>
<option value="$dropdownchoice1n">$dropdownchoice1n</option>
<option value="$dropdownchoice1o">$dropdownchoice1o</option>
<option value="$dropdownchoice1p">$dropdownchoice1p</option>
<option value="$dropdownchoice1q">$dropdownchoice1q</option>
<option value="$dropdownchoice1r">$dropdownchoice1r</option>
<option value="$dropdownchoice1s">$dropdownchoice1s</option>
<option value="$dropdownchoice1t">$dropdownchoice1t</option>
<option value="$dropdownchoice1u">$dropdownchoice1u</option>
<option value="$dropdownchoice1v">$dropdownchoice1v</option>
<option value="$dropdownchoice1w">$dropdownchoice1w</option>
<option value="$dropdownchoice1x">$dropdownchoice1x</option>
<option value="$dropdownchoice1y">$dropdownchoice1y</option>
<option value="$dropdownchoice1z">$dropdownchoice1z</option>
<option value="$dropdownchoice1aa">$dropdownchoice1aa</option>
<option value="$dropdownchoice1ab">$dropdownchoice1ab</option>
<option value="$dropdownchoice1ac">$dropdownchoice1ac</option>
<option value="$dropdownchoice1ad>$dropdownchoice1ad</option>
<option value="$dropdownchoice1ae">$dropdownchoice1ae</option>
<option value="$dropdownchoice1af">$dropdownchoice1af</option>
<option value="$dropdownchoice1ag">$dropdownchoice1ag</option>
<option value="$dropdownchoice1ah">$dropdownchoice1ah</option>
<option value="$dropdownchoice1ai">$dropdownchoice1ai</option>
<option value="$dropdownchoice1aj">$dropdownchoice1aj</option>
</select></td>
</tr>

<tr>
<td class="alt2" valign="middle">
<b>$question1</b>:<br />
$explain1</td>
<td class="alt2" valign="middle" colspan="2">
<input type="text" size="30" name="answer1" /></td>
</tr>

<tr>
<td class="alt1" valign="middle">
<b>$dropdownquestion2</b>:<br />
</td>
<td class="alt1" valign="middle" colspan="2">
<select name="dropdownanswer2">
<option value="$dropdownchoice2a">$dropdownchoice2a</option>
<option value="$dropdownchoice2b">$dropdownchoice2b</option>
<option value="$dropdownchoice2c">$dropdownchoice2c</option>
<option value="$dropdownchoice2d">$dropdownchoice2d</option>
<option value="$dropdownchoice2e">$dropdownchoice2e</option>
<option value="$dropdownchoice2f">$dropdownchoice2f</option>
<option value="$dropdownchoice2g">$dropdownchoice2g</option>
<option value="$dropdownchoice2h">$dropdownchoice2h</option>
<option value="$dropdownchoice2i">$dropdownchoice2i</option>
<option value="$dropdownchoice2j">$dropdownchoice2j</option>
<option value="$dropdownchoice2k">$dropdownchoice2k</option>
</select></td>
</tr>


<tr>
<td class="alt1" valign="middle">
<b>$question2</b>:<br />
$explain2</td>
<td class="alt1" valign="middle" colspan="2">
<input type="text" size="30" name="answer2" /></td>
</tr>

<tr>
<td class="alt1" valign="middle">
<b>$dropdownquestion3</b>:<br />
</td>
<td class="alt1" valign="middle" colspan="2">
<select name="dropdownanswer3">
<option value="$dropdownchoice3a">$dropdownchoice3a</option>
<option value="$dropdownchoice3b">$dropdownchoice3b</option>
<option value="$dropdownchoice3c">$dropdownchoice3c</option>
</select></td>
</tr>

<tr>
<td class="alt1" valign="middle">
<b>$dropdownquestion4</b>:<br />
</td>
<td class="alt1" valign="middle" colspan="2">
<select name="dropdownanswer4">
<option value="$dropdownchoice4a">$dropdownchoice4a</option>
<option value="$dropdownchoice4b">$dropdownchoice4b</option>
<option value="$dropdownchoice4c">$dropdownchoice4c</option>
<option value="$dropdownchoice4d">$dropdownchoice4d</option>
<option value="$dropdownchoice4e">$dropdownchoice4e</option>
<option value="$dropdownchoice4f">$dropdownchoice4f</option>
<option value="$dropdownchoice4g">$dropdownchoice4g</option>
<option value="$dropdownchoice4h">$dropdownchoice4h</option>
<option value="$dropdownchoice4i">$dropdownchoice4i</option>
<option value="$dropdownchoice4j">$dropdownchoice4j</option>
<option value="$dropdownchoice4k">$dropdownchoice4k</option>
<option value="$dropdownchoice4l">$dropdownchoice4l</option>
<option value="$dropdownchoice4m">$dropdownchoice4m</option>
<option value="$dropdownchoice4n">$dropdownchoice4n</option>
<option value="$dropdownchoice4o">$dropdownchoice4o</option>
</select></td>
</tr>

<tr>
<td class="alt1" valign="middle">
<b>$dropdownquestion5</b>:<br />
</td>
<td class="alt1" valign="middle" colspan="2">
<select name="dropdownanswer5">
<option value="$dropdownchoice5a">$dropdownchoice5a</option>
<option value="$dropdownchoice5b">$dropdownchoice5b</option>
</select></td>
</tr>

<tr>
<td class="alt2" valign="middle">
<b>$longquestion1</b><br>
$longexplain1</td>
<td class="alt2" valign="middle" colspan="2">
<textarea rows="15" cols="70" name="longanswer1"></textarea>
</td>
</tr>

<tr>
<td class="alt2" valign="middle">
<b>$longquestion2</b><br>
$longexplain2</td>
<td class="alt2" valign="middle" colspan="2">
<textarea rows="5" cols="70" name="longanswer2"></textarea>
</td>
</tr>

<tr>
<td class="alt2" valign="middle">
<b>$longquestion3</b><br>
$longexplain3</td>
<td class="alt2" valign="middle" colspan="2">
<textarea rows="20" cols="70" name="longanswer3"></textarea>
</td>
</tr>

<tr>
<td class="alt1" valign="middle">
<b>$question3</b>:<br />
$explain3</td>
<td class="alt1" valign="middle" colspan="2">
<input type="text" size="30" name="answer3" /></td>
</tr>

<tr>
<td class="alt1" valign="middle">
<b>$dropdownquestion6</b>:<br />
</td>
<td class="alt1" valign="middle" colspan="2">
<select name="dropdownanswer6">
<option value="$dropdownchoice5a">$dropdownchoice6a</option>
<option value="$dropdownchoice5b">$dropdownchoice6b</option>
</select></td>
</tr>

<tr>
<td class="alt1" valign="middle" colspan="3">
<b>$vbtextquestion</b><br />
$vbtextexplain
<div align="center">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
$messagearea
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>

<td valign="top" colspan="3">
<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>]]></template>
<template name="formanswers" templatetype="template" date="1133965917" username="Abe"

version="3.5.2"><![CDATA[$formtitle
$bbuserinfo[username]

$dropdownquestion1
$dropdownanswer1

$question1
$answer1

$dropdownquestion2
$dropdownanswer2

$question2
$answer2

$dropdownquestion3
$dropdownanswer3

$dropdownquestion4
$dropdownanswer4

$dropdownquestion5
$dropdownanswer5

$question3
$answer3

$dropdownquestion1
$dropdownanswer1

------------------------------------------------------
$longquestion1

$longanswer1

------------------------------------------------------
$longquestion2

$longanswer2

------------------------------------------------------
$longquestion3

$longanswer3

------------------------------------------------------

$dropdownquestion6
$dropdownanswer6

------------------------------------------------------
$vbtextquestion

$vbtextanswer

------------------------------------------------------]]></template>
</templates>
<plugins>
<plugin

active="1">
<title>Form Hack - DONT EDIT OR COPY</title>


<hookname>editor_wysiwyg_compatible</hookname>
<phpcode><![CDATA[global $dontusewysiwyg;

if($dontusewysiwyg && $choice == 2)
{
$choice = 1;
}]]></phpcode>
</plugin>
<plugin active="1">
<title>Form Hack</title>


<hookname>newthread_start</hookname>
<phpcode><![CDATA[// 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 = "application";

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(
'dropdownanswer1' => TYPE_STR,
'normalanswer1' => TYPE_STR,
'dropdownanswer2' => TYPE_STR,
'normalanswer2' => TYPE_STR,
'dropdownanswer3' => TYPE_STR,
'dropdownanswer4' => TYPE_STR,
'dropdownanswer5' => TYPE_STR,
'longanswer1' => TYPE_STR,
'longanswer2' => TYPE_STR,
'longanswer3' => TYPE_STR,
'longanswer4' => TYPE_STR,
'normalanswer3' => TYPE_STR,
'dropdownanswer6' => TYPE_STR,
));

// Part 2

$dropdownanswer1 = $vbulletin->GPC['dropdownanswer1'];
$normalanswer1 = $vbulletin->GPC['answer1'];
$dropdownanswer2 = $vbulletin->GPC['dropdownanswer2'];
$normalanswer2 = $vbulletin->GPC['answer2'];
$dropdownanswer3 = $vbulletin->GPC['dropdownanswer3'];
$dropdownanswer4 = $vbulletin->GPC['dropdownanswer4'];
$dropdownanswer5 = $vbulletin->GPC['dropdownanswer5'];
$longanswer1 = $vbulletin->GPC['longanswer1'];
$longanswer2 = $vbulletin->GPC['longanswer2'];
$longanswer3 = $vbulletin->GPC['longanswer3'];
$longanswer4 = $vbulletin->GPC['longanswer4'];
$normalanswer3 = $vbulletin->GPC['answer3'];
$dropdownanswer6 = $vbulletin->GPC['dropdownanswer6'];
////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "formanswer";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "4";

//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 = "0";

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

//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 to Twilight Legion!"; //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)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formtitle = "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 = "$formtitle - Citizen: $dropdownanswer5";

////////////////////////////////////////////////////////////////////////////////////////////////////
//PURPOSE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formpurpose = "This is an application form for Twilight Legion. We are registered to the city of Qeynos on the Guk

server.

Make certain to fill out this form accurately and completely. Failure to do so may result in disqualification from the

application process.

NOTE: New applicants must be at least level 10 to be considered for full membership at this time.";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
// Questionaire Listing Form

// Adventure Class - Dropdown
$dropdownquestion1 = "Adventurer Class:";
$dropdownchoice1a = "Fighter - Bruiser ";
$dropdownchoice1b = "Fighter - Brawler - Monk ";
$dropdownchoice1c = "Fighter - Brawler - Bruiser";
$dropdownchoice1d = "Fighter - Crusader";
$dropdownchoice1e = "Fighter - Crusader - Paladin";
$dropdownchoice1f = "Fighter - Crusader - Shadowknight";
$dropdownchoice1g = "Fighter - Warrior";
$dropdownchoice1h = "Fighter - Warrior - Beresker";
$dropdownchoice1i = "Fighter - Warrior - Guardian";
$dropdownchoice1j = "Mage - Enhanter";
$dropdownchoice1k = "Mage - Enchanter - Coercer";
$dropdownchoice1l = "Mage - Enchanter - Illusionist";
$dropdownchoice1m = "Mage - Sorceror";
$dropdownchoice1n = "Mage - Sorceror - Warlock";
$dropdownchoice1o = "Mage - Sorceror - Wizard";
$dropdownchoice1p = "Mage - Summoner";
$dropdownchoice1q = "Mage - Summoner - Conjuror";
$dropdownchoice1r = "Mage - Summoner - Necromaner";
$dropdownchoice1s = "Priest - Druid";
$dropdownchoice1t = "Priest - Druid - Fury";
$dropdownchoice1u = "Priest - Druid - Warden";
$dropdownchoice1v = "Priest - Cleric";
$dropdownchoice1w = "Priest - Cleric - Inquistor";
$dropdownchoice1x = "Priest - Cleric - Templar";
$dropdownchoice1y = "Priest - Priest";
$dropdownchoice1z = "Priest - Priest - Defiler";
$dropdownchoice1aa = "Priest - Priest - Mystic";
$dropdownchoice1ab = "Scout - Bard";
$dropdownchoice1ac = "Scout - Bard - Dirage";
$dropdownchoice1ad = "Scout - Bard - Troubadour";
$dropdownchoice1ae = "Scout - Predator";
$dropdownchoice1af = "Scout - Predator - Assassin";
$dropdownchoice1ag = "Scout - Predator - Ranger";
$dropdownchoice1ah = "Scout - Rogue";
$dropdownchoice1ai = "Scout - Rogue - Brigand";
$dropdownchoice1aj= "Scout - Rogue - Swashbuckler";

// Level - normalanswer
$question1 = "Adventurer Level:";
$explain1 = "What level is your Adventurer?";

// Artisan Class - dropdown
$dropdownquestion2 = "Artisian Class:";
$dropdownchoice2a = "Craftsman";
$dropdownchoice2b = "Provisioner";
$dropdownchoice2c = "Woodworker";
$dropdownchoice2d = "Outfitter";
$dropdownchoice2e = "Armorer";
$dropdownchoice2f = "Weaponsmith";
$dropdownchoice2g = "Tailor";
$dropdownchoice2h = "Scholar";
$dropdownchoice2i = "Jeweler";
$dropdownchoice2j = "Sage";
$dropdownchoice2k = "Alchemist";

// Level - normalanswer
$question2 = "Artisian Level:";
$explain2 = "What level is your Artisan?";

// Sex - dropdown
$dropdownquestion3 = "Gender:";
$dropdownchoice3a = "Male";
$dropdownchoice3b = "Female";

// Race - dropdown
$dropdownquestion4 = "Race:";
$dropdownchoice4a = "Barbarian";
$dropdownchoice4b = "Dark Elf";
$dropdownchoice4c = "Dwarf";
$dropdownchoice4d = "Erudite";
$dropdownchoice4e = "Froglok";
$dropdownchoice4f = "Gnome";
$dropdownchoice4g = "Half Elf";
$dropdownchoice4h = "High Elf";
$dropdownchoice4i = "Human";
$dropdownchoice4j = "Iksar";
$dropdownchoice4k = "Kerran";
$dropdownchoice4l = "Orge";
$dropdownchoice4m = "Ratonga";
$dropdownchoice4n = "Troll";
$dropdownchoice4o = "Wolf Elf";


// Citizenship - dropdown
$dropdownquestion5 = "City Citizenship:";
$dropdownchoice5a = "Qeynos";
$dropdownchoice5b = "Freeport";

// Reason for Joining -longanswer
$longquestion1 = "Reason for Joining:";
$longexplain1 = "What prompt you to consider to join our guild?";

// Any Former Guild if Any - longanswer
$longquestion2 = "Former Guilds:";
$longexplain2 = "What is your former guilds if any.";

// Reason for Leaving former Guild - longanswer
$longquestion3 = "What is your basis for leaving former Guild?";
$longexplain3 = "Explain on why you left your old guild if you have any former one.";

// Referral - normalanswer
$question3 = "Referral";
$explain3 = "Who referred you to our guild?";

// Read the Charter? - dropdown
$dropdownquestion6 = "Did you read our Guild Charter:";
$dropdownchoice6a = "No";
$dropdownchoice6b = "Yes";



$vbtextquestion = "Your expectations and inspirations?";
$vbtextexplain = "What you like to benefit from our guild for yourself and the guild in whole.";



////////////////////////////////////////////////////////////////////////////////////////////////
////// 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 ($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';
$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";
$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();
}

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

eval('print_output("' . fetch_template("$maintemplate") . '");');
}
}]]></phpcode>
</plugin>
</plugins>
<phrases>
</phrases>
<options>
</options>
</product>

ChiliVB
03-14-2006, 02:11 PM
I'm having a problem with unregistered users accessing/viewing a form. We would like this form application to be accessible outside the forum to unregistered users.

I currently have the USERGROUP permissions not enabled and set the same as the default form hook, as below.

// if (!in_array($vbulletin->userinfo['usergroupid'], array(2,5,6,7))) print_no_permission();
I have tried adding usergroup 1 as an ID and enabling this setting but it did not help.

A registered user or administrator can access and submit forums without a problem. But I need for unregistered users to be able to view/submit.

Can anyone shed some light on this for me?

Elikster
03-14-2006, 03:15 PM
Got it all working properly now. Found one ; that shouldn't be there that caused it not to post at all.

FLMom
03-14-2006, 04:04 PM
I am about to install! Thanks :)

FLMom
03-14-2006, 04:59 PM
Alright, I need help please!!

I installed this and I am assuming I did it the right way, but I can't seem to find it anywhere? In the step #3 of the install when it says "3 - To get to the form, go to: /newthread.php?do=form (change "form" to the name of your form if you have few)"
How do I go to that? I am new to this stuff and just can't figure it out. Can someone please explain this too me? TIA :D

ChiliVB
03-14-2006, 05:56 PM
Alright, I need help please!!

I installed this and I am assuming I did it the right way, but I can't seem to find it anywhere? In the step #3 of the install when it says "3 - To get to the form, go to: /newthread.php?do=form (change "form" to the name of your form if you have few)"
How do I go to that? I am new to this stuff and just can't figure it out. Can someone please explain this too me? TIA :D
I'm new to this too.. but I can maybe help a little.

In Plug-In Manager in the ACP you will see a hook called "Form Hack". That is the "main hook" referenced in the instructions. Edit form hack and follow the instructions to save a form with a new name. Then edit the "new" hook and set options the way you want them.

There are also two templates, form and formanswers, that have to be modified if you customize the appearance. I made new templates for my customized form so I always have the main one to look at for default options.

Hope this helps you a little. :)

HappyDJ
03-19-2006, 09:14 PM
I still can't figure this out - how to use etc! It would be excellent if some sort of idiots guide was made to make a form or whatever!

Any takers?

silly rabbit
03-20-2006, 02:25 PM
I still can't figure this out - how to use etc! It would be excellent if some sort of idiots guide was made to make a form or whatever!

Any takers?
happy, while no EXPERT myself the form hack consists of three things wrapped up into one neat XML plugin - two templates and php processing code. 1)An input template(named 'form'), 2)an output template(named answers) and 3)the php processing code itself which is hooked to 'newthread_start'. The 2 templates, once installed, can be found in the vb 'Style Manager' and edited from within the admin cp (like everything else) rather than constantly reinstalling/overwriting the plugin itself (which I did initially).

The first thing I did however, to make life easier on myself, was to rename (thru search replace) all the variable references in the script itself to simplier, more generic names like 'question1', 'answer1' and $answer1 (the php references). I assume you know HTML form processing right??

Step2 (prior to loading the XML) is deciding where the output 'answers' is to go and those options are embedded in the php code itself. In my case I chose 'reply to thread' leaving the reply to 'new thread' option '0' otherwise you'll get a double post.

Having muddled thru all of that I designed my own 'custom' input 'form' (using the same 'answer' variables) and noticed 1 thing - I did not have to change the 'formname' (or modify the XML plugin) IF you manually assign the new template (in my case named 'testform') the same title $formtitle="form" as the hookcode will still execute!! In other words the only real reason I see to install a second XML is if the php processing code needs changing. Of course if ya need new / different php processing code (which you need to design) then the XML plugin and the 'formtitle' needs to change too but if Abe's processing code is good (and all ya need) you can manually force the issue AT RUNTIME . . .

Make Sense??

I am using this in conjunction with Logician's 'Webtemplates' and it works very well posting user input data into a thread of my designation . . . .

Eh, Questions??

Rabbit

|oR|Greg
03-20-2006, 02:27 PM
is there/will there be any way to use a form to submit a new calendar event?

I would install this if an option were to also add an event to the calendar. Like a check box to add it, then a drop down for date.

silly rabbit
03-20-2006, 02:43 PM
I would install this if an option were to also add an event to the calendar. Like a check box to add it, then a drop down for date.
That'd be GOOD!! And say a handy way to custom retrieve and edit / update a current event that already exists (without the help of the AdminCP)????

mrgrimes
03-22-2006, 11:06 AM
Hi. I'm new to both vBulletin and php, but this hack looks like it could do what I'm after. Basically I want a form that submits a private log entry that only the user and moderator can see.

Can this hack be modified to set permissions on a new thread, and if so how?

Abe1
03-22-2006, 11:06 AM
It uses the permissions of the forum to send the message to.

mrgrimes
03-22-2006, 11:08 AM
So I'd need a different form for every user?

Abe1
03-22-2006, 11:11 AM
No. You say the form should send to Forumid 1.

Forumid 1 has permissions on what you want. The new thread with use thoughs permissions.

mrgrimes
03-22-2006, 11:16 AM
Then I'd need a separate forum for each user? Ideally I want each user within a forum to keep the results of the form private from the other users. I guess this isn't possible?

Abe1
03-22-2006, 11:41 AM
Then I'd need a separate forum for each user? Ideally I want each user within a forum to keep the results of the form private from the other users. I guess this isn't possible?
Yes it's possable. Set the forum's permissions that only the thread starter can see a thread. If you didn't start it, then you wont see it. You can change this for each usergroup so you can have your mods and admins see the threads.

mrgrimes
03-22-2006, 01:12 PM
Of course! Excellent, I'll give that a go. Very many thanks.

ca99uk
03-22-2006, 02:09 PM
Is there a way to get subscription working with this. Ive got a problem where if a user submits a thread to a forum using this form the global subscription wont work. Please can someone help with this, as I really like the hack, but really need users to get email notifications to replys to threads that they have started with this form.

????

Many thanks.

Abe1
03-23-2006, 12:36 PM
I'll have to look into it.

ChrisBaktis
03-23-2006, 04:49 PM
I want to include a link to a form in the postbit....

My question - is there a way that when I click on the link the the username of the post i was in will become one of the variables for output?

ill try to make it clear...

I run a trading site...if I go to post made by User X and click on the link I want User X's username to be a variable in the form as the person I trade with (etc User X will become $normalquestion1).

Any idea?

ca99uk
03-24-2006, 09:29 AM
I'll have to look into it.

Thanks Abe1

Titam
03-25-2006, 11:20 AM
I have problem with the first "blank area".

I just install this hack, i juste quote //normalquestion1

and when i go there, i have blank text area without any question http://forums.hollinae.com/newthread.php?do=form

and I didn't found where i can delete it

phill2003
03-25-2006, 08:54 PM
Hi,


This is great and i have it working a treat but for one thing.


I would like the thread title to be what the user inputs for the first variable, you see i am trying to use this as a way of letting users post news to my front page.


I have been trying for 2 hours to get it to work but i'm no good at this stuff and am just guessing really could someone please point out how i would go about it.

http://img212.imageshack.us/img212/3209/12344copy3az.jpg

Freesteyelz
03-26-2006, 05:43 AM
Fantastic hack. It serves so many functions. Thank you, Abe1. *Clicked install*

silly rabbit
03-27-2006, 12:31 PM
I would like the thread title to be what the user inputs for the first variable . . .
<plugin active=\"1\">
<title>Form Hack</title>
<hookname>newthread_start</hookname>
<phpcode><![CDATA[// 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 = \"form\";
if ($_REQUEST['do'] == $formname)
phill2003, assign your 'user inputed' title (ie: $answer1) to '$posttitle' here after commenting '$formtitle = \"Generic Form\";' out. . .
// $formtitle = \"Generic Form\";
//////////////////////////////////////////////////
//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 = \"$formtitle\";

phill2003
03-27-2006, 02:24 PM
Hi,

thanks for that the only thing ismine does not look like yours at all, and when i try to do your alterations i get an error when posting a thread.

here is the code i have for the form.

// 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 = "form";

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,





'longanswer1' => TYPE_STR
));

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

$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 = "2";

//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 = "0";

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

//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 this form!"; //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)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formtitle = "News Posting.";

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "$formtitle";

////////////////////////////////////////////////////////////////////////////////////////////////////
//PURPOSE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formpurpose = "This Allows our users to post news to the from page, The news article will be viewed by a member of staff before it is posted to the news section of the site so do not worry if it does not show up straight away.";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion1 = "The News Title.";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////



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

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 2 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////



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

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 3 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////



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

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


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

////////////////////////////////////////////////////////////////////////////////////////////////////
//DROP DOWN CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////



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

////////////////////////////////////////////////////////////////////////////////////////////////////
//LONG TEXT AREA INPUT: QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////



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

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



////////////////////////////////////////////////////////////////////////////////////////////////
////// 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 ($formforum == "1")
{
$foruminfo = verify_id('forum', $formforumid, 0, 1);
$forumperms = fetch_permissions($foruminfo[forumid]);
$newpost['username'] =& $vbulletin->userinfo['username'];
$newpost['message'] =& $formsend;
$newpost['title'] =& $normalquestion1;
$newpost['parseurl'] = '1';
$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";
$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();
}

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

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

phill2003
03-28-2006, 01:49 PM
I sorted it out, In the incredibly unlikely event that someone else has this problem here is how i fixed it,

In this part

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'] =& $normalquestion1;
$newpost['parseurl'] = '1';
$newpost['emailupdate'] = '9999';


I changed this $newpost['title'] =& $normalquestion1; to this.

$newpost['title'] =& $normalanswer1;


Simple really but after 11 hours of doing things to the site it took a while to realise...

Spinball
03-29-2006, 12:52 PM
WNxWakko]
Is there any way to add a Preview to the form?
Not right now.
Please put this on your 'to do' list if you have one. A preview would be a useful addition.
Thanks.

ChrisBaktis
03-29-2006, 01:11 PM
I want to include a link to a form in the postbit....

My question - is there a way that when I click on the link the the username of the post i was in will become one of the variables for output?

ill try to make it clear...

I run a trading site...if I go to post made by User X and click on the link I want User X's username to be a variable in the form as the person I trade with (etc User X will become $normalquestion1).

Any idea?

anyone?

Sarcoth
03-31-2006, 08:17 PM
I've put at least 8 hours into this now and just can't figure out what I'm doing wrong. I'm trying to design my own form and keep running into problems. I've tested various changes.

I have copied the form plugin, added and new one, copied the data into the new one and renamed the form. I was able to successfully get into the new form (http://sacredhaven.org/vanguard/forums/newthread.php?do=enlist) with no problems.

1) I removed the following from the plugin:

Part 1: 'normalanswer1' => TYPE_STR,
Part 2: $normalanswer1 = $vbulletin->GPC['normalanswer1'];
Question: $normalquestion1 = "What is the meaning to life?";

Sarcoth
03-31-2006, 08:23 PM
I've put at least 8 hours into this now and just can't figure out what I'm doing wrong. I'm trying to design my own form and keep running into problems. I've tested various changes.

I have copied the form plugin, added and new one, copied the data into the new one and renamed the form. I was able to successfully get into the new form (http://sacredhaven.org/vanguard/forums/newthread.php?do=enlist) with no problems.

1) I removed the following from the plugin:

Part 1: 'normalanswer1' => TYPE_STR,
Part 2: $normalanswer1 = $vbulletin->GPC['normalanswer1'];
Question: $normalquestion1 = "What is the meaning to life?";

The question was gone, but the box to type the answer was still there, so I continued a little further.

2) I changed the following:

$maintemplate = "form_enlist";
$answertemplate = "formanswers_enlist";

I copied the form and formanswer templates, added new ones with the names form_enlist and formanswers_enlist. I haven't gone in to change the data yet because just by making this change, the page loads to a blank empty page now.

This is very frustrating. Can anyone assist?

Freesteyelz
03-31-2006, 10:15 PM
1. You'll need to remove the entries for $normalanswer1 in the form and answer templates.

2. Are you getting a blank page or does an error show? If the latter, what is the error.

Sarcoth
03-31-2006, 11:45 PM
I removed the following from the form_enlist template:

<tr>
<td class="alt1" colspan="3">
<b>$normalquestion1</b>
</td>
</tr>
<tr>
<td class="alt2" colspan="3">
<input type="text" size="30" name="normalanswer1" />
</td>
</tr>


I removed the following from the formanswers_enlist template:

$normalquestion1
$normalanswer1



Still coming up as a blank page, so something else must be happening. :(

Here's the link to the form: http://sacredhaven.org/vanguard/forums/newthread.php?do=enlist


Have I done something wrong or perhaps another plugin is messing this up.

I'm using the following plugins:
Form Hack 3.3
Separate Sticky and Normal Threads 1.20
vBadvanced CMPS 2.1.0
Welcome Headers 4.0.6

-------------------------------------
Edit: Just an fyi, the original form that comes with the form hack plugin is working fine from what I can tell.

http://sacredhaven.org/vanguard/forums/newthread.php?do=form

It becomes a blank page when I change the path over to the form_enlist template from what I can tell. And, if I try to use the regular form template and remove the generalquestion and generalanswer parts, it still gives me an empty box in the form. I'm lost.

Sarcoth
04-01-2006, 12:49 AM
Well, I figured it out. /SIGH

Seems I was altering the Hack Form for my Darkness style but I had my style set to a test style. I went into my options and changed it back to Darkness and it's working.

Oh well, it's always the simple things. Awesome Hack, thank you!

SaN-DeeP
04-01-2006, 02:01 AM
Nice addon. Thanks for doing it.

phill2003
04-01-2006, 02:59 AM
Well, I figured it out. /SIGH

Seems I was altering the Hack Form for my Darkness style but I had my style set to a test style. I went into my options and changed it back to Darkness and it's working.

Oh well, it's always the simple things. Awesome Hack, thank you!


Sounds like you just needed a break from it to figure it out, 8 hours is a long time without one.

Glad you got yours sorted :)

almukmin
04-02-2006, 01:45 PM
What the hell is this? I've installed it, now what? WTF? Can someone help me out here!

phill2003
04-02-2006, 03:50 PM
We could if we knew what the problem is, WTH does not give much away really :)

ca99uk
04-03-2006, 11:22 AM
Can anyone get subscription working with this? This works great and would be the perfect solution for my problem if I could get subscription working. Unforutunatly when a user makes a new thread using the form, subscription does not work. =(

Any ideas??

Thanks.

Abe1
04-03-2006, 11:52 AM
Can anyone get subscription working with this? This works great and would be the perfect solution for my problem if I could get subscription working. Unforutunatly when a user makes a new thread using the form, subscription does not work. =(

Any ideas??

Thanks.
I will see what I can do about this.

Abe1
04-03-2006, 12:59 PM
FORM HACK FEATURES REQUEST NOW!

I am in middle up updating this hack. If there is a feature you want that is not mentioned in this post, post it now.

Preview – 100% done
WYSIWYG Editor – Fully working now
Subscriptions – 0% done

zennifer
04-03-2006, 03:28 PM
hmm I've been using this for quite some time now to post membership requests but for some reason when I tried to add PMing and E-mailing of the form those two don't work. I am the one filling out the form and I have permission to e-mail and PM so it's not a permissions thing.... at least I dont' think. It still posts to the same forum that it always did so I'm not sure whats wrong... any advice?
-Jenn

Abe1
04-03-2006, 03:30 PM
hmm I've been using this for quite some time now to post membership requests but for some reason when I tried to add PMing and E-mailing of the form those two don't work. I am the one filling out the form and I have permission to e-mail and PM so it's not a permissions thing.... at least I dont' think. It still posts to the same forum that it always did so I'm not sure whats wrong... any advice?
-Jenn
Unsure. I dont know why it wouldn't be working. Are you making sure you are enabling it?

ChrisBaktis
04-03-2006, 11:02 PM
I want to include a link to a form in the postbit....

My question - is there a way that when I click on the link the the username of the post i was in will become one of the variables for output?

ill try to make it clear...

I run a trading site...if I go to post made by User X and click on the link I want User X's username to be a variable in the form as the person I trade with (etc User X will become $normalquestion1).

Any idea?

Id like to be able to do this.

Abe1
04-03-2006, 11:18 PM
Id like to be able to do this.
They are already. $bbuserinfo[username]

defcon_420
04-04-2006, 02:03 AM
gotta say Great hack Abe1! you really put alot of effort into this and have spent alot of time supporting it
A++

Abe1
04-04-2006, 12:23 PM
ANY OTHER FEATURES? I'm almost realy to release.
hmm I've been using this for quite some time now to post membership requests but for some reason when I tried to add PMing and E-mailing of the form those two don't work. I am the one filling out the form and I have permission to e-mail and PM so it's not a permissions thing.... at least I dont' think. It still posts to the same forum that it always did so I'm not sure whats wrong... any advice?
-JennI set the form now that it uses the users defaut pref. on subscriptions.
Is that good?

ddolliver
04-04-2006, 01:24 PM
We need PayPal button to use this as a registration form. We want to have fill-in boxes for user information, vehicle information and then the option to send the form by email AND payPal the membership fee, or send the fee by USPS.:rolleyes:

Abe1
04-04-2006, 02:25 PM
We need PayPal button to use this as a registration form. We want to have fill-in boxes for user information, vehicle information and then the option to send the form by email AND payPal the membership fee, or send the fee by USPS.:rolleyes:
:P Keep dreaming

ChrisBaktis
04-04-2006, 04:02 PM
They are already. $bbuserinfo[username]

Im not sure on how to have the username of the member that posted the post I was just on to carry over to the form...can you explain?

I dont want my name in that area - I want the members name that wrote the post to appear there.

Abe1
04-04-2006, 05:06 PM
Im not sure on how to have the username of the member that posted the post I was just on to carry over to the form...can you explain?

I dont want my name in that area - I want the members name that wrote the post to appear there.
Right, use: $bbuserinfo[username] in the answer template.

BioVader
04-04-2006, 05:52 PM
OK if I can get this answered I think I will be able to go from there once I see how the code is changed... First I want my form only to be filled out by registered users SO that when they open the form their username is automatically placed in the subject bar. Then when they submit their app and it directs to the selected forum, we can see who the app is from via the subject line. I would also like to add a one other answer from the form to the subject line but I think if I see how to added the username I can figure out how to do the second part.

Ex: Membership Application: [username] <answer1>

Abe1
04-04-2006, 06:07 PM
OK if I can get this answered I think I will be able to go from there once I see how the code is changed... First I want my form only to be filled out by registered users SO that when they open the form their username is automatically placed in the subject bar. Then when they submit their app and it directs to the selected forum, we can see who the app is from via the subject line. I would also like to add a one other answer from the form to the subject line but I think if I see how to added the username I can figure out how to do the second part.

Ex: Membership Application: [username] <answer1>
use the var. $bbuserinfo['username']

BioVader
04-04-2006, 07:41 PM
Like this? I've tried putting it right after Membership App and get errors.. This way errors out too..

$formtitle = "Membership 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 = "$formtitle $bbuserinfo['username']";


Error:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/xxx/public_html/forums/newthread.php(68) : eval()'d code on line 151

ChrisBaktis
04-04-2006, 08:04 PM
I dont think you are following what im asking for....$bbuserinfo [username] is going to be the person that is actually filling out and submitting the form. As it is now I do use that already - I use it so the form logs ME as one of the traders.

this is part of my Answer form

Trade/Sale Between: $bbuserinfo[username] / $normalanswer1


$bbuserinfo[username] logs me as one of the traders - and $normalanswer1 is the other trader (whos name I have to type in when filling out the form)

what I want to do is have a link in a post - when I click that link I want the form to assign $normalanswer1 as the person who's post I just clicked the link from. I cant see how $bbuserinfo[username] will do that. The form is (as it is) will not assign $normalanswer1 as the name of the author of the post.

I dont know how else to explain it.

Abe1
04-04-2006, 08:19 PM
Like this? I've tried putting it right after Membership App and get errors.. This way errors out too..

$formtitle = "Membership 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 = "$formtitle $bbuserinfo['username']";


Error:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/xxx/public_html/forums/newthread.php(68) : eval()'d code on line 151
Make it $bbuserinfo[username] since you have it in quote.

Abe1
04-04-2006, 08:21 PM
I dont think you are following what im asking for....$bbuserinfo [username] is going to be the person that is actually filling out and submitting the form. As it is now I do use that already - I use it so the form logs ME as one of the traders.

this is part of my Answer form

Trade/Sale Between: $bbuserinfo[username] / $normalanswer1


$bbuserinfo[username] logs me as one of the traders - and $normalanswer1 is the other trader (whos name I have to type in when filling out the form)

what I want to do is have a link in a post - when I click that link I want the form to assign $normalanswer1 as the person who's post I just clicked the link from. I cant see how $bbuserinfo[username] will do that. The form is (as it is) will not assign $normalanswer1 as the name of the author of the post.

I dont know how else to explain it.
So you want a link to that user you write in?

ChrisBaktis
04-04-2006, 08:30 PM
I run a trading site....what I want to do is have a link in all the posts that you click that will take you to the form. This form is how we post trades.

the postbit would have this 'Post A Trade With Member X' - Member X would be the username of the person who made that post...(i have this setup) - now when you click that link it takes you to the form and makes Member X one of the variables.

Im trying to avoid members having to type in the person they are trading with...just figured it would be easier that if they clicked the link in member x's post that member x would become one of the variiables - this would prevent members not typing in the actual username and it would eliminate typing mistakes for the person you are trading with.

Abe1
04-04-2006, 10:43 PM
I run a trading site....what I want to do is have a link in all the posts that you click that will take you to the form. This form is how we post trades.

the postbit would have this 'Post A Trade With Member X' - Member X would be the username of the person who made that post...(i have this setup) - now when you click that link it takes you to the form and makes Member X one of the variables.

Im trying to avoid members having to type in the person they are trading with...just figured it would be easier that if they clicked the link in member x's post that member x would become one of the variiables - this would prevent members not typing in the actual username and it would eliminate typing mistakes for the person you are trading with.
It's possable.

Request tha the poster put the userid of the other person in the form also. Then, make a url tag in the answer template using the userid.

ChrisBaktis
04-04-2006, 11:21 PM
im looking for this to be done automaticly - it would actually be more work for a member to look up a members user id then input it...

Im looking for this to be automated but it doesnt appear to be a way to do it.

mrgrimes
04-05-2006, 08:03 AM
Can this hack be used to create forms that are located outside vBulletin (eg on a page on a different website)? (Sorry if this has been asked before: I thought I'd seen a similar post but I've searched through this thread and can't find anything.)

BioVader
04-05-2006, 08:04 AM
Ok I want to start over again... Same type of thing though. This time the user will open up the "Membership Application" and they will fill out the form.

The default forum title when they open the form is "Membership Application". What I would like to have happen is when they hit the submit form button, I would like the forum title to change to "Membership Application: <question2> <question1>"

So if they answered question1 with Submarine and question2 with Yellow, the new subject line when submitted would read,

Membership Application: Yellow Submarine (doable?)

Abe1
04-05-2006, 12:12 PM
Can this hack be used to create forms that are located outside vBulletin (eg on a page on a different website)? (Sorry if this has been asked before: I thought I'd seen a similar post but I've searched through this thread and can't find anything.)
Sorry, not set up for that.

mrgrimes
04-05-2006, 12:18 PM
Just to clarify: this means I can't use take the content of an external form and post it into vBulletin using this hack?

Abe1
04-05-2006, 01:05 PM
Just to clarify: this means I can't use take the content of an external form and post it into vBulletin using this hack?
This hack gives you a form to add info into vb.

mrgrimes
04-05-2006, 01:24 PM
Yes, but can it be tweaked so that the info can be added to vB from a form hosted elsewhere? Currently the form itself has to be located in a thread within vBulletin; I would like to be able to put the form in a news item of an external page but for the results to be posted to a thread within vBulletin.

Renae
04-05-2006, 02:15 PM
I really like this, it makes something that I was trying to do very convenient.

HOWEVER, I am not a php genius (I use python a lot) so when you say "DO NOT USE QUOTATION MARKS AS IT WILL CAUSE A PARSE ERROR" that is not very descriptive. I thought that meant DO not use any quotation marks at all, when in reality it means only use them once. I finally saw SULLY02's post which explained this a little better.

Abe1
04-06-2006, 02:38 AM
Version 3.4: (04/05/2006)

[FIXED] Removed extra line from template.
[ADDED] WYSIWYG editor now works besides the regular editor.
[ADDED] Preview.
[CHANGED] Subscriptions now take from user default setting.


It's hard to upgrade if you made lots of template changes. There are many changes to the template do to the preview feature.

CremeEgg
04-06-2006, 12:57 PM
I'm going to be using this form for Guild Applications, I have a couple of questions.

New applicants won't be registered on the site so can I remove the section that takes the vB username?

Secondly, the editor doesn't appear for anyone that isn't logged in, any ideas why? When I test the form as a logged in user the editor works fine, as a guest you just get a text input box.

EDIT: One last thing (honest) when I tried to add 8 choices to the drop down menu question, I only got the first 3 appear (I'm a real newbie to all this) did I do something wrong with the variables?

Abe1
04-06-2006, 01:05 PM
I'm going to be using this form for Guild Applications, I have a couple of questions.

New applicants won't be registered on the site so can I remove the section that takes the vB username?

Secondly, the editor doesn't appear for anyone that isn't logged in, any ideas why? When I test the form as a logged in user the editor works fine, as a guest you just get a text input box.

EDIT: One last thing (honest) when I tried to add 8 choices to the drop down menu question, I only got the first 3 appear (I'm a real newbie to all this) did I do something wrong with the variables?
To remove or add things, you have to edit the templates also.

VB by default doesn't allow unregistered users to use the editor. They just see a plain box.

CremeEgg
04-06-2006, 01:10 PM
To remove or add things, you have to edit the templates also.

VB by default doesn't allow unregistered users to use the editor. They just see a plain box.
Thanks for the quick reply. I'll have another play about tonight see if I can get it all sussed out.

New to all things vB and have a very demanding WoW Guild that want lots from their site, so steep learning curve.

After applications it's time to tackle some form of DKP system, just wish someone would integrate eqDKP and vB.

almukmin
04-06-2006, 03:03 PM
Can someone help me on this template installation.
I'll pay via Paypal. PM me.

Thanks.

Abe1
04-06-2006, 03:14 PM
Can someone help me on this template installation.
I'll pay via Paypal. PM me.

Thanks.
I've helped people. Send me a PM of what you want.

Necser
04-06-2006, 09:17 PM
This is a great hack! I would like to know if anyone seen a hack to allows you to update the thread through the form.

This hack is the first step: To submit the thread through form.

Can it be done that you go to the thread and the user by clicking "edit" will get the same form that he/she submitted before with already filled up fields from the thread? Then the user edits the test in the form and saves this into the thread.

Cheers!

PsiNyde
04-07-2006, 07:37 PM
yeah i liked this too. installed.

one big suggestion [and i've seen that it's been covered here in support, buuuut] - put the template & plugin edits required for field and option changes in the readme - it's quite sparse and doesn't cover nearly what it should. it took me a couple of hours to find all the variables that needed changing when i edited input fields/questions. even the plugin doesn't explain it very well [per instructions]. it would just be easier on everybody if everything needed to customize this was annotated in the package. ;) THANKS!

Abe1
04-07-2006, 08:15 PM
yeah i liked this too. installed.

one big suggestion [and i've seen that it's been covered here in support, buuuut] - put the template & plugin edits required for field and option changes in the readme - it's quite sparse and doesn't cover nearly what it should. it took me a couple of hours to find all the variables that needed changing when i edited input fields/questions. even the plugin doesn't explain it very well [per instructions]. it would just be easier on everybody if everything needed to customize this was annotated in the package. ;) THANKS!
I'd love to add more info the plug-in but I'm not a writer. I'm a coder. I know PHP and HTML. If some-one wants to work with me and fix up the manuals, be my guest.

Notce, all my answers are around 1 line. If your luck (like now) you get a 2nd or 3rd.

WNxWakko
04-08-2006, 01:20 AM
Hmm, when I click preview it does show me at the top, but all the stuff I entered in the form is gone. I would have to retype it all? What did I do wrong?

RDX1
04-08-2006, 02:19 AM
It doesn't work.. Newthread shows this:
Parse error: parse error, unexpected '/' in /home/path/to/newthread.php(68) : eval()'d code on line 167

// 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 = "linkexchange";

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,
'radioanswer1' => TYPE_STR,
'radioanswer2' => TYPE_STR,
'radioanswer3' => TYPE_STR,
'radioanswer3other' => TYPE_STR,
'answer1' => TYPE_STR,
'answer2' => TYPE_STR,
'answer3' => TYPE_STR,
'dropdownanswer1' => TYPE_STR,
'longanswer1' => TYPE_STR
));

// Part 2
$normalanswer1 = $vbulletin->GPC['normalanswer1'];
$radioanswer1 = $vbulletin->GPC['radioanswer1'];
$radioanswer2 = $vbulletin->GPC['radioanswer2'];
$radioanswer3 = $vbulletin->GPC['radioanswer3'];
$radioanswer3other = $vbulletin->GPC['radioanswer3other'];
$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(1,2,3,5,6,7,9,17,12,20,22,21))) 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 = "0";

//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 = "2";

//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 = "0";

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

//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 = "1";

//EMAIL ADDRESS TO EMAIL TO
$formemailaddress = "talk@domain.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 a link exchange! We will get back to you soon!"; //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 = "1";

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

$formtitle = "Submit Link Exchange Request";

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "$formtitle";

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

$formpurpose = "Submit your link exchange request";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 the meaning to life?";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "Choose one of the following choices";

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 3 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////
/
/ $radioquestion3 = "Is it yes or no? If yes, please elaborate";
/
// The following choices must NOT have quotation marks
/ $radiochoice3a = "yes";
/ $radiochoice3b = "no";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
$question1 = "Contact 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 contact 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 = "Reciprocal URL:";
$explain3 = "
The page on your site where you are linking back to us. We do manually review all sites, if you do not link back to us your submission will be not be published.";

//QUESTION 4 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
$question4 = "What is your site name?";
$explain4 = "Enter your site name, what you want the link to be displayed as";

//QUESTION 5 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
$question5 = "What is your website URL?";
$explain5 = "Enter your site URL, this is where the link will be sent to";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "Site Category:";

// The following choices must NOT have quotation marks
$dropdownchoice1a = "Adult Entertainment";
$dropdownchoice1b = "Adult Erotica";
$dropdownchoice1c = "Adult Portals and Directories";
$dropdownchoice1d = "Adult Stores";
$dropdownchoice1e = "General Adult Sites";
$dropdownchoice1f = "Personals and Datings";
$dropdownchoice1g = "Sex Blogs";
$dropdownchoice1h = "Sex Information and Resources";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 write down a paragraph about yourself.";
/ $longexplain1 = "For example, a bit about your experience in this area.";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 write down a paragraph about how you like this forum.";
/ $vbtextexplain = "For example, what makes this forum different from all other forums?";

////////////////////////////////////////////////////////////////////////////////////////////////
////// 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") . '");');
}
}

WNxWakko
04-08-2006, 02:23 AM
hmm, ok I figured out why the fields didnt stay. I see you added a value= in the boxes within the template. Damn that was a pain to upgrade but its done and working perfect. Thank ya very much for that addition.

RDX1
04-08-2006, 06:06 AM
Any idea what's wrong with mine?

ChiliVB
04-08-2006, 02:01 PM
Version 3.4: (04/05/2006)

[FIXED] Removed extra line from template.
[ADDED] WYSIWYG editor now works besides the regular editor.
[ADDED] Preview.
[CHANGED] Subscriptions now take from user default setting.
It's hard to upgrade if you made lots of template changes. There are many changes to the template do to the preview feature.

Abe1,

Would you mind giving me an example of the impact for upgrading. I don't want to cause any downtime for my primary form when I upgrade.

I'm thinking it might be best to install this as a "new" hook and not overwrite and so a custom "answer" template can be created in parallel without causing disruption?

Also is it only the answer template that needs "lots of changes" or also the mainhook for the form.