Log in

View Full Version : FORM to THREAD/ FORUM/ POLL/ PM/ EMAIL - CUSTOMIZABLE FORMS - Mod Apps, Orders, News.


Pages : 1 [2] 3

chet
10-15-2004, 08:38 PM
It would be nice to see what this is being used for and the code that surrounds it, I would like a application for mod form but I do not know how to edit the file

Erwin
10-16-2004, 12:04 PM
Hi,

Finally figured out how to install this hack. I have a slight problem now, I keep on getting this error message:

"..you do not have permission to access this page. This could be due to one of several reasons:"

etc

I have set the permissions to allow me access but I still receive the above, any ideas?

taffy
Make sure your usergroupid is allowed.

taffy056
10-17-2004, 08:57 AM
Hi Erwin,

The code looks like this at present, when I go to mydomain/forum/form.php all I get is a white page.

if (!in_array($bbuserinfo['usergroupid'], array())) print_no_permission();

When I put my usergroupid into the code I get the error message above, I am not quite sure whether I am allowing or disallowing a group when I put a number into the above code.

Thanks,
taffy

chet
10-17-2004, 09:01 AM
Could somebody create me an moderators application form please

Chet

It would be nice to see what this is being used for and the code that surrounds it, I would like a application for mod form but I do not know how to edit the file

Erwin
10-17-2004, 12:36 PM
Hi Erwin,

The code looks like this at present, when I go to mydomain/forum/form.php all I get is a white page.

if (!in_array($bbuserinfo['usergroupid'], array())) print_no_permission();

When I put my usergroupid into the code I get the error message above, I am not quite sure whether I am allowing or disallowing a group when I put a number into the above code.

Thanks,
taffy
You haven't entered a usergroupid - delete the whole line if you want everyone to access it.

taffy056
10-17-2004, 04:35 PM
Hi Erwin,

I just started over again, and redone the templates etc, now I have a major problem with my forum, I can't go into any of the threads, if I give you an admin account on my forum can you have a look at what the problem is?

Just sent you a PM of my url, for you to have a look

taffy

Lionel
10-17-2004, 08:55 PM
Erwin, I have a small problem with

<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">If $radiochoice1b, what should we use? <INPUT TYPE="text" NAME="radioanswer1other"></td>
</tr>

If I set all fields, it will not go thru. If I set it as 0, it will go thru but variable $radiochoice1b is not parsed.

Since we have two radioanswer1 choices (either 1a or 1b), it seems that the second choice 1b is not perceived as $radioanswer1. Could it be the reason why it is not going thru?

taffy056
10-17-2004, 10:06 PM
Hi Erwin,

Would it be possible to put this form directly on the create 'New Thread' button, so you come directly to the form instead of creating a new thread? I have requested a hack like this for a poll, but I am still waiting for an answer.

taffy

Erwin
10-17-2004, 11:17 PM
Hi Erwin,

Would it be possible to put this form directly on the create 'New Thread' button, so you come directly to the form instead of creating a new thread? I have requested a hack like this for a poll, but I am still waiting for an answer.

taffy
Instructions to do this is in the thread itself.

I can enter your threads with no problems.

Lionel
10-17-2004, 11:19 PM
I seem to have solved my problem by adding 'checked' to the first radio button

<tr>
<td class="alt1"><INPUT TYPE="radio" NAME="radioanswer1" value="$radiochoice1a" checked>$radiochoice1a</td>
<td class="alt1"><INPUT TYPE="radio" NAME="radioanswer1" value="$radiochoice1b">$radiochoice1b</td>
<td class="alt1">If $radiochoice1b, what should we use? <INPUT TYPE="text" NAME="radioanswer1other"></td>
</tr>

taffy056
10-18-2004, 05:29 PM
Instructions to do this is in the thread itself.
Hi Erwin,

Thanks for the reply, but I do not understand what you mean, can you explain with a bit more detail.

taffy

Abe1
10-18-2004, 05:44 PM
@ Erwin

Did you even fix my bug I mentioned awile ago about threads and posts made by the forms dont get put on the search index?

Erwin
10-18-2004, 10:36 PM
@ Erwin

Did you even fix my bug I mentioned awile ago about threads and posts made by the forms dont get put on the search index?
It's not a bug because I use the mysql fulltext search on my site, not the searchindex, and I'm not about to modify the hack to do something which I don't require and cannot test.

Abe1
10-19-2004, 12:17 PM
It's not a bug because I use the mysql fulltext search on my site, not the searchindex, and I'm not about to modify the hack to do something which I don't require and cannot test.
How do I switch? Never saw an option.

Roms
10-20-2004, 12:27 AM
Thanks, I've been looking for something like this.

Clicks Install. :)

Amavisca
10-20-2004, 01:34 AM
I want to use this form for article hack. Mean that members who want to post a new article have to use this form to submit. Can anybody help me out how to do it plz??? Thanks in advance.

Lostnode
10-24-2004, 01:36 AM
Email function not working... al I did was change the 0 to a 1 and changed the meail... after a few tries and nothing I tried the PN function and it works fine... and ideas?

Blam Forumz
10-24-2004, 04:27 AM
woohoo

got it working

:) Erwin, thanks again

AmbitiousLemon
10-25-2004, 12:48 AM
Erwin I would also like to add my vote for allowing attachments in the form should it be used to create a new thread. You mentioned earlier that this might be hard while simply uploading an image to the db wouldn't be as hard. Could you give us some example code on how to allow someone to uplaod to db and then show the template mod that would be needed to display that image in the thread?

I like a previous poster am trying to use this for a classifieds section.

any help?

Erwin
10-25-2004, 02:18 AM
any help?
I'll look into this on the weekend... no promises... ;)

AmbitiousLemon
10-25-2004, 02:25 AM
I'll look into this on the weekend... no promises... ;)

:) Thank you, I appreciate it.

hasan2k
11-02-2004, 01:52 AM
Erwin

I have 2 questions which may have been answered already but I was not able to find.

1. Can this hack be used to create a form which PM's the info to a specific user group chosen (all the members in the user group get the PM)?

2. Can I add 30 or more fields for questions and answers instead of the format you had in the attached image in the first post?

Erwin
11-02-2004, 04:58 AM
Erwin

I have 2 questions which may have been answered already but I was not able to find.

1. Can this hack be used to create a form which PM's the info to a specific user group chosen (all the members in the user group get the PM)?

2. Can I add 30 or more fields for questions and answers instead of the format you had in the attached image in the first post?
Yes to both, with modification. I'm not going to have time to do them though.

hasan2k
11-02-2004, 05:37 AM
Yes to both, with modification. I'm not going to have time to do them though.

Thanks.. I will see what I can do myself. if i get stuck I will ask for help here.

bendigo-tech
11-03-2004, 12:45 AM
Fantastic... love it!

Installed and working nicely.

THANKS! :)

SirJonathan
11-04-2004, 09:59 PM
Hmm.. I have a feeling I'm missing something super obvious ;).

I uploaded the files to my server and when I viewed form.php, it was completely blank.. Any ideas? :)

-Jonathan

Abe1
11-05-2004, 01:20 AM
Hmm.. I have a feeling I'm missing something super obvious ;).

I uploaded the files to my server and when I viewed form.php, it was completely blank.. Any ideas? :)

-Jonathan
Did you add the templates?

lancepoint
11-11-2004, 05:33 AM
how do i get each form thats filled out to post in a certain area and given a custom post tittle defined in the form?

lancepoint
11-12-2004, 12:32 AM
how do i get each form thats filled out to post in a certain area and given a custom post tittle defined in the form?

HELP!@@

Chrisedge
11-15-2004, 09:34 PM
Any U2 fans want to help me with this one? I'm looking to do a form that when in a certain forum (not all forums), when they click on new thread, a form comes up with various questions on particular live recordings like:

Date: (Drop downs)
Venue: (Text Box)
City/State/Country: (Text Box)
Setlist: (Text Box)
Taper?: (Drop downs YES/NO)
NTSC/PAL: (Drop down)
PC Authored/Standalone: (Drop down)
Notes: (Text Box)
Attach Screenshots: (Attach box, then creates thumbnails)

Then it creates a new thread, with the date, city and venue as the title, and all the info gets dumped into a new thread and people can reply to the thread with the thumbnail attachments at the bottom.

If someone wants to help, I could throw a few live DVD's into the deal :)

Spinball
11-20-2004, 10:04 AM
*installed*
Very nice hack - does, with a bit of tweaking, just what I need.
I'm using it to ensure people enter all the required information in classified adverts. I'll be trying to change the target address of the 'New thread' button in certain forums to call this script.
Many thanks Mr Erwin, Sir!

Question/request for you.
How would I implement the $messagearea and $posticons variables so that the user interface for one of the fields is identical to a normal new thread?

Spinball
11-20-2004, 10:27 PM
I hope you don't mind but I'd like to share how I got this working to use a form to submit the first post in new threads.
It's for our classifieds forums (3 of them) where people often dive in and break several trading rules.
I wanted to make sure they were given plenty of opportunities to read the rules before submitting their adverts.
See the attached screen grab.
Our 3 forums have forum ids of 51,62 and 99.

Firstly I used a temporary forum invisible to the public to test this out.
I followed Erwin's instructions to edit the form and formanswers templates and form.php.
The only things I needed to change in the form.txt template was to add a variable 'f' to store the forumid rather than hard code it.

<input type="hidden" value="$userid" name="userid">
<input type="hidden" value="$f" name="f">
<input type="hidden" value="submit" name="action">


and the tickbox code looked like this.
<tr>
<td class="alt1" valign="top"><b>$ad_agreequestion</b></td>
<td class="alt1" valign="top" colspan="2"><input name="ad_agree" type="checkbox" value="Confirmed"> <font class="smallfont">$ad_agreeexplain</font></td>
</tr>


(I used the smallfont class to reduce the size of the explanation text).

Then most of the work goes in the form.php. Aside from changing it to put in my own variables etc., I had to make a few additional tweaks.

At the top I globalised the variables used in the form plus the forum id 'f'

globalize($_POST, array(
'ad_title' => STR,
'ad_description' => STR,
'ad_location' => STR,
'ad_agree' => STR,
'action' => STR,
'f' => STR
));

and set the forumid to the passed variable $f instead of hard coding it.

//FORUM TO POST NEW THREAD IN
$formforumid = $f;

and changed the form validation to insist that the checkbox be checked:

if ($answerall == "1") {
if ($ad_title == '' OR $ad_description == '' OR $ad_location == '' OR $ad_agree <> 'Confirmed')
{
$errormessage = "Please complete all the information on the classified submission form and agree that you have read and abide by the trading rules.<br>Press the Back button to return to the form.";
eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
exit();
}
}


The last thing I did was to edit the FORUMDISPLAY template to make the 'New Thread' buttons call the form. In both places (there are 2 buttons):

<!-- -------------- new thread button logic for classifieds form ----- -->
<if condition="$show['newthreadlink']">
<if condition="$foruminfo[forumid] == 51 OR $foruminfo[forumid] == 62 OR $foruminfo[forumid] == 99">
<a href="form.php?$session[sessionurl]&amp;f=$foruminfo[forumid]">
<else />
<a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]">
</if>
<!-- ------------ / new thread button logic for classifieds form ----- -->


Note that it calls the form.php with the f= to the forumid.
And it works perfectly.

The next enhancement might be to install a separate hack which creates an [admin] bb code which hides text within it from all users except admin. And then get people to enter a phone number for security purposes which only admin can see in the posts.

Maybe Erwin will want to add my suggestions into his standard hack.

blue_chi
11-21-2004, 07:47 PM
THIS IS GOOD.

Going to install it soon! ;)

defi
11-23-2004, 08:16 PM
I was wondering;

1.) Is there a way to change it so the user can enter a name for the thread rather then a pre-defined one being made?

2.) Have attachments been added to the capability of this form?

neofootball
11-23-2004, 08:34 PM
Nice hack! Is there a way to pm & email more than one person?

glenvw
11-26-2004, 09:04 AM
I am looking for a registration process where a person:

First has to fill out a separate front-end registration process I already have. The applicant fills out name, address, phone, birthdate, etc (common demographic information) . He is presented with opt-in co-reg offers etc.

He is then automatically sent to the VBBS registration page where he/she enters a user name and password. It would be nice if the user name, birthdate, etc could be passed from the first form (not on a VBBS page) and inserted in the VBBS registration. This would make it look uniform. It is not necessary though.

My goal is first to monetize the registration process.

Restrict access to all forums unless they were registered.

However, if a person is not registered now, they are sent directly to the VBBS registration page. This process would require that they be sent to the new front end registration page.

After a member is regsitered, I would like it if they were made to log in only on the front end page where they could just log in if already registered.

I have no idea if this could be done but I am looking for a programmer that knows his stuff and can make this happen. I am posting it here because Erwin's hack was as close as I have seen.

Thank in advance.

The Markus
11-27-2004, 10:36 PM
This sia stupid question, but where are the two templates?
If that was stupid then my question is ridiculous... :nervous:

Where do you upload these to?? I am somewhat PHP inept at the moment, but I am learning.. I can feel my brain swelling :ninja:

ChrisBaktis
12-12-2004, 06:43 PM
Need some Mod Help....

I run a site that mambers trade on - I want to use this form to post a thread of what is being traded....This is what I would like to do...

Instead of the username and form title to show up as the 'Thread Title' I would like to use $normalanswer1 / $normalanswer2

For Example..I would like the title show up as 'member#1 / member#2' This way when our mods are going through the posts the title of each post is the two members names that are making the trade with an '/' in between.

Can this be done? if so how?

Also is it possible to use Bold and underline in the output when this is posted to a thread? I know I cannot use HTML because I dont allow HTML in the thread but is there any other way?

Chris

Erwin
12-12-2004, 08:35 PM
Need some Mod Help....

I run a site that mambers trade on - I want to use this form to post a thread of what is being traded....This is what I would like to do...

Instead of the username and form title to show up as the 'Thread Title' I would like to use $normalanswer1 / $normalanswer2

For Example..I would like the title show up as 'member#1 / member#2' This way when our mods are going through the posts the title of each post is the two members names that are making the trade with an '/' in between.

Can this be done? if so how?

Also is it possible to use Bold and underline in the output when this is posted to a thread? I know I cannot use HTML because I dont allow HTML in the thread but is there any other way?

Chris
1. You can change the thread title within the code - look at the code and you can work it out.

2. You can modify the form template with bbcode tags to add bold.

ChrisBaktis
12-12-2004, 08:47 PM
problem is i have no idea where to change it in the form.php file....$formtitle shows up all over the place and i dont know which to replace and how I would put 2 variables with an "/" between them.

ChrisBaktis
12-12-2004, 08:57 PM
figured it out!

oldford
12-13-2004, 06:20 PM
I've had this great mod (thanks Erwin!) running fine for months, but I do have one problem. Every couple of weeks I get someone complaining that they get the following error:

There seems to have been a slight problem with the Discussion Boards database.
Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.

The error doesn't seem to happen very often and I can't recreate the error on my end. I do know that the problem only occurs on the forum that I used this mod on.

Any thoughts? :surprised:

TheDPQ
12-13-2004, 07:07 PM
Installed
Its just so...mind bogglingly useful. THANK YOU.

Erwin
12-13-2004, 09:49 PM
I've had this great mod (thanks Erwin!) running fine for months, but I do have one problem. Every couple of weeks I get someone complaining that they get the following error:



The error doesn't seem to happen very often and I can't recreate the error on my end. I do know that the problem only occurs on the forum that I used this mod on.

Any thoughts? :surprised:
What is the actual mysql error?

alqadir
12-16-2004, 05:42 AM
Firstly, I would like to say I love this hack, it is really awesome and used on a daily basis at www.wetnerds.com. After using this hack for some time, I am trying to mod it so it can better fit my site. I was hoping someone can help me out for the following:
a) have an image uploading option which allows users to upload an image upto a certian size
b) If a user tries to post a topic(subject), where that topic already exists, the system does not allow the post to be posted.

thanks

sensimilla
12-16-2004, 06:46 AM
looks like a great hack thanks alot!

alqadir
12-16-2004, 07:10 PM
Has anyone had problems when " ' " (single quotes) are inputted by the user?

oldford
12-17-2004, 03:30 PM
What is the actual mysql error?
I don't actually get the error myself so I'm not sure. Is there a log I can find to see what the mysql error was?

j_86
12-21-2004, 11:37 PM
Having problems using different form templates and form.php names.

Can someone give me a step by step to doing this? It's not working for me, i'm completeley stumped!

alkatraz
12-27-2004, 06:28 AM
a) have an image uploading option which allows users to upload an image upto a certian size

I've been watching this thread for months hoping to see the option for attachments.

As soon as it's added this hack will become invaluable to every admin who has a classifieds sections or a members _____ section (fill in the blank, with anything from car profiles to collections)

My #1 pet peeve is people posting classifieds without the required info and it's a huge waste of time for my moderators to make sure the info gets posted.


I dropped $100 bucks on the ClassifiedPost system which ended up being a nightmare for my members. Adding attachments to this hack (combined with the recently released thumbnail threadview (https://vborg.vbsupport.ru/showthread.php?threadid=73220)) will make all my headaches go away!!!

I would gladly paypal you $25 bucks for your time Erwin if you can make it happen by Jan 1st. =) (I realize your time is probably worth more then that, but am hoping a small donation will give you some incentive.)

Erwin
12-28-2004, 08:34 PM
I've been watching this thread for months hoping to see the option for attachments.

As soon as it's added this hack will become invaluable to every admin who has a classifieds sections or a members _____ section (fill in the blank, with anything from car profiles to collections)

My #1 pet peeve is people posting classifieds without the required info and it's a huge waste of time for my moderators to make sure the info gets posted. (I realize your time is probably worth more then that, but am hoping a small donation will give you some incentive)


I dropped $100 bucks on the ClassifiedPost system which ended up being a nightmare for my members. Adding attachments to this hack (combined with the recently released thumbnail threadview (https://vborg.vbsupport.ru/showthread.php?threadid=73220)) will make all my headaches go away!!!

I would gladly paypal you $25 bucks for your time Erwin if you can make it happen by Jan 1st. =)
Definitely not by Jan 1st. :) I've better things to do with my time. But I will be adding this, just not in the near future. I have a million things to do for my own forums.

alkatraz
12-29-2004, 06:08 AM
lol I understand, it was worth a shot ;)

Spinball
12-29-2004, 07:59 AM
Hi Dr Eriwin, Sir,
do you intend to implement the attachments functionality as part of a general duplication of the other options when creating a thread?
I ask because my members are requesting the ability to subscribe to the threads at the point of submitting the form.

Abe1
12-29-2004, 01:24 PM
Hi Dr Eriwin, Sir,
do you intend to implement the attachments functionality as part of a general duplication of the other options when creating a thread?
I ask because my members are requesting the ability to subscribe to the threads at the point of submitting the form.
This is what i do. After someone clicks 'submit,' they are directed to the 'edit post' page. This gives them a chance to add attachments. Also, when they click on 'update post' is adds the words in the post to the search index.

Spinball
12-29-2004, 01:37 PM
This is what i do. After someone clicks 'submit,' they are directed to the 'edit post' page. This gives them a chance to add attachments. Also, when they click on 'update post' is adds the words in the post to the search index.

Thanks, Abe1, it's a nice solution but unfortunately not appropriate for my forum where people submitting their classified adverts are not then allowed to edit them.

mod2000
12-30-2004, 10:48 PM
is there no need of updateing the searchindex table ? I see some mysql inserts but no update of the searchindex of the board.

EDIT: And my question ???? HEEELOOO

alkatraz
12-31-2004, 07:28 AM
This is what i do. After someone clicks 'submit,' they are directed to the 'edit post' page. This gives them a chance to add attachments. Also, when they click on 'update post' is adds the words in the post to the search index.

sweet! that will do the trick until attachments are added.

for anyone else that wants the code to do this,

Find
if ($redirectoption == "3") {
$url = "forumdisplay.php?$session[sessionurl]f=$forum[forumid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}

Add BELOW,
if ($redirectoption == "4") {
$url = "editpost.php?do=editpost&$session[sessionurl]p=$post[postid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}

and then use $redirectoption = "4";

alkatraz
12-31-2004, 07:32 AM
SPINBALL

Thanks for your code too!!

ChrisBaktis
01-02-2005, 02:58 AM
Is there a way to have this Pm'd to more then one person? I get a database error if I try to add 2 user ID's.

Chris

alqadir
01-04-2005, 05:36 AM
thanks alkatraz, this hack addition works perfectly. :)

alkatraz
01-04-2005, 04:25 PM
np alqadir!


When the script creates a new thread in a forum,
an error occurs if a member has posted a ' in the thread title.

I'd like to process $ad_title (the var. i've used for the title) to strip out ' and " or any characters that could cause a problem.

doing some research into it, the trim function might do it
http://ca.php.net/trim

Think this would remove ' ? How would I remove "?
trim($ad_title, " ' ");

I crossposted this in the wrong thread (oops) but Delphy suggested using this:

$ad_title = html_entities($ad_title, ENT_QUOTES)

but it creates an error when entering the script...

anyone have any suggestions?

Wifey
01-05-2005, 02:16 AM
Alright, I thought I had done everything right but obviously not.

This is my form1.php file:

<?php

/*================================================= =====================*\
|| ################################################## ################## ||
|| # FORM TO THREAD/ FORUM/ PM/ EMAIL - Totally CUSTOMIZABLE FORMS # ||
|| # Version 1.5 for vBulletin 3.x.x by Dr Erwin Loh # ||
|| # ---------------------------------------------------------------- # ||
|| # Copyright ?2000?2004 Dr Erwin Loh. All Rights Reserved. # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| ################################################## ################## ||
\*================================================ ======================*/

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

$globaltemplates = array(
'form1',
'formanswers'
);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

globalize($_POST, array(
'normalanswer1' => STR,
'normalanswer2' => STR,
'normalanswer3' => STR,
'normalanswer4' => STR,
'normalanswer5' => STR,
'normalanswer6' => STR,
'radioanswer1' => STR,
'radioanswer2' => STR,
'radioanswer3' => STR,
'radioanswer4' => STR,
'answer1' => STR,
'answer2' => STR,
'answer3' => STR,
'longanswer1' => STR,
'action' => STR
));

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//USERGROUPS ALLOWED
//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array
////////////////////////////////////////////////////////////////////////////////////////////////////

if (!in_array($bbuserinfo['usergroupid'], array(10,11,13,14,15,16,17,18,5,6,7))) print_no_permission();

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NAME OF THIS PHP FILE AND TEMPLATES - DO THIS BIT IF YOU ARE MAKING MORE FORMS!
//You can easily make more forms by just copying this file, renaming it, and modifying the variable in
//this file. You can keep the same templates for different forms. For more customization, you can
//use different templates, by renaming and modifying the templates.
////////////////////////////////////////////////////////////////////////////////////////////////////

// Name of this file
$phpfilename = "form1.php";

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

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

//ENABLE POLL TO BE CREATED - 1 = yes, 0 = no
$formpoll = "1";
$formoption1 = "Yes";
$formoption2 = "No";

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

//ENABLE FORM TO REPLY TO EXISTING THREAD
$formreply = "0";

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

//FORUM ID WHERE THE EXISTING THREAD IS IN
$formreplyforumid = "0";

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

//ENABLE FORM TO BE PMED - 1 = yes, 0 = no
$formpm = "0";

//USERID TO PM TO
$formpmid = "1";

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

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

//EMAIL ADDRESS TO EMAIL TO
$formemailaddress = "admin@degrassi-boards.com";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//REDIRECT OPTIONS:
// 0 - thank you message
// 1 - redirect to post
// 2 - redirect to thread
// 3 - redirect to forum
//
// Feel free to change the thank you message if you choose option 0
////////////////////////////////////////////////////////////////////////////////////////////////////

$redirectoption = "0";

$errormessage = "Thank you so much for submitting this survey! We value your opinion and hope that this can help to make D-B even better!"; //This is the thank you message

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//FORCE USER TO ANSWER ALL QUESTIONS - 1 = yes, 0 = no
////////////////////////////////////////////////////////////////////////////////////////////////////

$answerall = "0";

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

$formtitle = "Degrassi-Boards Survey";

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

$formpurpose = "The purpose of this survey is to get your feedback on things happening around the boards. We value and appreciate you all and hope that you will take the time to submit this. The answers willbe automatically posted in a hidden forum so nobody but staff will be able to see your answers. Once the survey is over, a general post will be made with some general results.";

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

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

$normalquestion1 = "What is the best thing about DB?";

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

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

$normalquestion2 = "What is the worst thing about DB?";

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

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

$radioquestion1 = "Do you agree with all the rules?";

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

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

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

$normalquestion3 = "If you answered no to 3a, which rule do you disagree with? (You may simply put the number)";

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

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

$normalquestion4 = "If you disagreed with a rule, why is that particular rule one you do not think is right?";

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

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

$radioquestion2 = "Which of the following would you use to describe the DB staff?";

// The following choices must NOT have quotation marks
$radiochoice2a = "Excellent";
$radiochoice2b = "Average";
$radiochoice2c = "Poor";

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

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

$normalquestion5 = Why do you feel that way?;

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

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

$radioquestion4 = "Do you feel the rules and signature guidelines are easy to understand";

$radioquestion3 = "Do you feel included on the boards?";

// The following choices must NOT have quotation marks
$radiochoice3a = "Always";
$radiochoice3b = "Most of the time";
$radiochoice3c = "Never";

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

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

$normalquestion6 = "Why do you feel that way?";

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

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

// The following choices must NOT have quotation marks
$radiochoice4a = "yes";
$radiochoice4b = "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.";

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

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

$longquestion1 = "Any additional comments to add?";
$longexplain1 = "For example, a bit about your experience in this area.";

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

// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################

// start navbar
$navbits = array(
"$phpfilename?$session[sessionurl]" => $formtitle
);

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

if ($action=="submit") {

if ($answerall == "1") {
if ($normalanswer1 == '' OR $normalanswer2 == '' OR $radioanswer1 == '' OR $normalanswer3 == '' $normalanswer4 == '' OR OR $radioanswer2 == '' OR $normalanswer5 == '' OR $radioanswer3 == '' OR $normalanswer6 == '' $radioanswer4 == '' 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();
}
}

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

if ($formforum == "1") {
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "thread(title, lastpost, forumid, open, replycount,
postusername, postuserid, lastposter, dateline, iconid, visible, attach)
VALUES
('".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle', " . TIMENOW . ", $formforumid,
1, 0, '" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid],
'" . addslashes($bbuserinfo['username']) . "', " . TIMENOW . ", 0, 1,
0)
");
$thread['threadid'] = $DB_site->insert_id();
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "post
(threadid, title, username, userid, dateline, pagetext, allowsmilie,
showsignature, iconid, visible)
VALUES
($thread[threadid], '".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle',
'" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid], " . TIMENOW . ",
'" . addslashes($formsend) . "', 1, 1,
0, 1)
");
$post['postid'] = $DB_site->insert_id();
$DB_site->query("
UPDATE " . TABLE_PREFIX . "thread
SET firstpostid = $post[postid]
WHERE threadid = $thread[threadid]
");
$DB_site->query("
UPDATE " . TABLE_PREFIX . "forum
SET replycount = replycount + 1,
threadcount = threadcount + 1,
lastpost = " . TIMENOW . ",
lastposter = '" . addslashes($bbuserinfo['username']) . "',
lastthread = '".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle',
lastthreadid = $thread[threadid]
WHERE forumid = $formforumid
");
$forum[forumid] = $formforumid;
}

if ($formpoll == "1") {
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "poll (question,dateline,options,votes,active,numberopti ons,timeout,multiple,public) VALUES ('".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle'," . TIMENOW . ",'$formoption1|||$formoption2','" . addslashes("0|||0") . "',1,2,0,0,0)");
$pollid = $DB_site->insert_id();
$DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET pollid = '".$pollid."' WHERE threadid = '".$thread[threadid]."'");
}

if ($formreply == "1") {
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,pa getext,allowsmilie,showsignature,ipaddress,iconid, visible) VALUES (NULL,'$formreplythreadid','".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle','".addslashes($bbuserinfo[username])."','$bbuserinfo[userid]','".time()."','" . addslashes($formsend) . "','1','1','0','0','1')");
$DB_site->query("UPDATE thread SET replycount = replycount + 1, lastpost = " . TIMENOW . ", lastposter = '".addslashes($bbuserinfo[username])."' WHERE threadid = $formreplythreadid");
$DB_site->query("
UPDATE " . TABLE_PREFIX . "forum
SET replycount = replycount + 1,
lastpost = " . TIMENOW . ",
lastposter = '".addslashes(htmlspecialchars($bbuserinfo[username]))."',
lastthread = '" . addslashes($bbuserinfo['username']) . " $formtitle',
lastthreadid = $formreplythreadid
WHERE forumid = $formreplyforumid
");
$forum[forumid] = $formreplyforumid;
}

if ($formpm == "1") {
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pmtext\n\t(fromuserid, fromusername, title, message, touserarray, iconid, dateline, showsignature)\nVALUES\n\t($bbuserinfo[userid], '" . addslashes($bbuserinfo['username']) . "', '".addslashes(htmlspecialchars($formtitle))."', '".addslashes(htmlspecialchars($formsend))."', '" . addslashes(serialize($tostring)) . "', 0, " . TIMENOW . ", 1)");
$pmtextid = $DB_site->insert_id();
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pm (pmtextid, userid, messageread) VALUES ($pmtextid, $formpmid, 0)");
$DB_site->shutdown_query("UPDATE " . TABLE_PREFIX . "user SET pmtotal=pmtotal+1, pmunread=pmunread+1 WHERE userid = $formpmid");
}

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

if ($redirectoption == "1") {
$url = "showthread.php?$session[sessionurl]p=$post[postid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
if ($redirectoption == "2") {
$url = "showthread.php?$session[sessionurl]t=$thread[threadid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
if ($redirectoption == "3") {
$url = "forumdisplay.php?$session[sessionurl]f=$forum[forumid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
exit();
}
eval('print_output("' . fetch_template('form') . '");');
?>

And this is form1 template:

$stylevar[htmldoctype]
<html id="form" dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle] - $formtitle</title>
$headinclude
</head>
<body>
$header
$navbar

<br>

<form enctype="multipart/form-data" method="post" action="$phpfilename">
<input type="hidden" value="$userid" name="userid">
<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" colspan="3">
<b>$normalquestion1</b>
</td>
</tr>
<tr>
<td class="alt2" colspan="3">
<input type="text" size="30" name="normalanswer1">
</td>
</tr>
<tr>
<td class="alt1" colspan="3">
<b>$normalquestion2</b>
</td>
</tr>
<tr>
<td class="alt2" colspan="3">
<input type="text" size="30" name="normalanswer2">
</td>
</tr>
<tr>
<td class="alt1" colspan="3">
<b>$radioquestion1</b>
</td>
</tr><tr>
<td><INPUT TYPE="radio" NAME="radioanswer1" value="$radiochoice1a"> $radiochoice1a </td>
<td><INPUT TYPE="radio" NAME="radioanswer1" value="$radiochoice1b"> $radiochoice1b </td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="alt1" colspan="3">
<b>$normalquestion3</b>
</td>
</tr>
<tr>
<td class="alt2" colspan="3">
<input type="text" size="30" name="normalanswer3">
</td>
</tr>

<tr>
<td class="alt1" colspan="3">
<b>$normalquestion4</b>
</td>
</tr>
<tr>
<td class="alt2" colspan="3">
<input type="text" size="30" name="normalanswer4">
</td>
</tr>
<tr>
<td class="alt2" colspan="3">
<b>$radioquestion2</b>
</td></tr><tr>
<td><INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2a"> $radiochoice2a </td>
<td><INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2b"> $radiochoice2b </td>
<td><INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2c"> $radiochoice2c </td>
</tr>
<tr>
<td class="alt1" colspan="3">
<b>$normalquestion5</b>
</td>
</tr>
<tr>
<td class="alt2" colspan="3">
<input type="text" size="30" name="normalanswer5">
</td>
</tr>
<tr>
<td class="alt1" colspan="3">
<b>$radioquestion3</b>
</td>
</tr><tr>
<td><INPUT TYPE="radio" NAME="radioanswer1" value="$radiochoice3a"> $radiochoice1a </td>
<td><INPUT TYPE="radio" NAME="radioanswer1" value="$radiochoice3b"> $radiochoice1b </td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="alt1" colspan="3">
<b>$normalquestion6</b>
</td>
</tr>
<tr>
<td class="alt2" colspan="3">
<input type="text" size="30" name="normalanswer6">
</td>
</tr>
<td class="alt1" colspan="3">
<b>$radioquestion4</b>
</td>
</tr><tr>
<td><INPUT TYPE="radio" NAME="radioanswer3" value="$radiochoice4a"> $radiochoice3a </td>
<td><INPUT TYPE="radio" NAME="radioanswer3" value="$radiochoice4b"> $radiochoice3b </td>
</tr>
<tr>
<td class="alt2" valign="middle">
<b>Username</b>:<br>
Your Username.</td>
<td class="alt2" valign="middle" colspan="2">
<b>$bbuserinfo[username]</b></td>
</tr>
<tr>
<td class="alt1" valign="middle">
<b>$question1</b>:<br>
$explain1</td>
<td class="alt1" valign="middle" colspan="2">
<input type="text" size="30" name="answer1"></td>
</tr>
<tr>
<td class="alt2" valign="middle">
<b>$question2</b>:<br>
$explain2</td>
<td class="alt2" valign="middle" colspan="2">
<input type="text" size="30" name="answer2"></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="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 valign="top">
<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>
</td>
</tr>
</table>

</form>

$footer
</body>
</html>

And this is formanswers template:

$formtitle
$bbuserinfo[username]

$normalquestion1
$normalanswer1

$normalquestion2
$normalanswer2

$radioquestion1
$radioanswer1

$normalquestion3
$normalanswer3

$normalquestion4
$normalanswer4

$radioquestion2
$radioanswer2

$normalquestion5
$normalanswer5

$radioquestion3
$radioanswer3

$normalquestion6
$normalanswer6

$radioquestion4
$radioanswer4

$question1
$answer1

$question2
$answer2

$question3
$answer3

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

$longanswer1

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

It all matches up, so what the heck am I doing wrong? I keep getting a blank page. No errors, just a blank page. The templates were added to my default style which rolls over to every other style I have. However when I got to http://www.degrassi-boards.com/form1.php it's a blank page.

Erwin
01-05-2005, 02:39 AM
Easy.

Rename your form1 template as form. The template is meant to be called form.

Alternatively, you can do this:

In your form1.php, find:


eval('print_output("' . fetch_template('form') . '");');


Replace with:


eval('print_output("' . fetch_template('form1') . '");');


Your form1.php file is looking for the form template, which you are calling form1.

Deaths
01-05-2005, 01:42 PM
Looks really good , I'll install it when I have some time ;).

* Deaths installs

Erwin
01-05-2005, 09:26 PM
Version 1.6 minor update - added the option to redirect to editpost to upload attachments. Good simple solution provided by abe1, posted by alkatraz - saves me from figuring out a way to hack it. ;)

alkatraz
01-05-2005, 09:49 PM
saves me from figuring out a way to hack it.
doh! I should have shut my mouth, lol
hopefully adding attachments to the form is still on your to do list

also, I think having the ability to trim characters that can cause errors with the MYSQL insert would be a huge bonus..
$ad_title = html_entities($ad_title, ENT_QUOTES)

Does that sound like it should work? I tried it but the form gives an instant error if it's included. I'm not a coder tho and could be putting it in the wrong spot.

j_86
01-05-2005, 10:00 PM
wouldn't add_slashes() work for that?

Erwin
01-06-2005, 12:40 AM
wouldn't add_slashes() work for that?
Yup, that would do it. I should have sanity checking in the code, but may have forgotten to add it.

alkatraz
01-06-2005, 02:44 AM
Yup, that would do it. I should have sanity checking in the code, but may have forgotten to add it.
Here's what that section of code looks like from your script (unmodified)
('".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle', " . TIMENOW . ", $formforumid,
1, 0, '" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid],
'" . addslashes($bbuserinfo['username']) . "', " . TIMENOW . ", 0, 1,
0)

I see ".addslashes(htmlspecialchars($bbuserinfo[username]))." has addslashes around it but $formtitle', doesn't..

I guess that's because you're predefining $formtitle within form.php whereas i've modified it so the form title is specified in an INPUT box on the form which gets submitted. (useful in my situation where i'm forcing members to submit their classified ads through this form)

alkatraz
01-06-2005, 02:57 AM
interesting..

I changed it to,

".addslashes(htmlspecialchars($ad_title))."

and it no longer gives an error, but still allows the new thread to posted with the ' in it!? So it's not removing anything, it's just adding slashes to allow that character I imagine?

tried adding,
trim($ad_title, " ' ");
inside the submit part of the script to remove ' from the title, but that didn't seem to work either..

the Sandman
01-06-2005, 03:29 AM
Replace:

'$formtitle'

in the query with:

'" . addslashes($formtitle) . "'
I'm not terribly bright when it comes to this stuff, and didn't realize that I had to make that change in 3 queries in order for it to work, but I figured it out in a couple minutes. Thanks for taking the time to help! You ROCK!

Thanks again!

Take care,
~ChrisI'm just not getting this. :( Can you tell me exactly what to replace where...

Abe1
01-06-2005, 02:33 PM
Version 1.6 minor update - added the option to redirect to editpost to upload attachments. Good simple solution provided by alkatraz - saves me from figuring out a way to hack it. ;)
Maybe I should get some credit for it also. I was the one who came up with idea and have been using it since you came up with this hack. alkatraz, just posted the code for it.

Don't worry I don't need the credit. I just wanted to correct you.

Erwin
01-06-2005, 08:54 PM
Maybe I should get some credit for it also. I was the one who came up with idea and have been using it since you came up with this hack. alkatraz, just posted the code for it.

Don't worry I don't need the credit. I just wanted to correct you.
Oops - I assumed it was alkatraz's idea. I'll fix it.

Abe1
01-06-2005, 08:57 PM
Oops - I assumed it was alkatraz's idea. I'll fix it.
If you look at his post, he quotes me.

dina
01-06-2005, 10:39 PM
I installed this mod tonight, and it worked fine until I wanted to translate the "If yes, please elaborate" on $radioquestion3. First no matter how many times I changed the text it still showed up the same. Then I tried removing the whole "please elaborate" text, but it was still there.

After that I started wondering if it was a browser problem (normally use Opera), so I opened the site in IE, but the page came out blank (did log in and have added it to all templates and permissions are correct). Same thing in Firefox.

Is something cached somewhere or have I completely gone insane?

Here is the link to the form (guest can view it, but it's not in English):

www.akasha.no/modform.php

Here is the modform.php:


<?php

/*================================================= =====================*\
|| ################################################## ################## ||
|| # FORM TO THREAD/ FORUM/ PM/ EMAIL - Totally CUSTOMIZABLE FORMS # ||
|| # Version 1.6 for vBulletin 3.x.x by Dr Erwin Loh # ||
|| # ---------------------------------------------------------------- # ||
|| # Copyright ?2000–2004 Dr Erwin Loh. All Rights Reserved. # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| ################################################## ################## ||
\*================================================ ======================*/

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

$globaltemplates = array(
'modform',
'modformanswers'
);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

globalize($_POST, array(
'normalanswer1' => STR,
'radioanswer1' => STR,
'radioanswer2' => STR,
'radioanswer3' => STR,
'radioanswer3other' => STR,
'answer1' => STR,
'answer2' => STR,
'answer3' => STR,
'longanswer1' => STR,
'action' => STR
));

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//USERGROUPS ALLOWED
//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array
////////////////////////////////////////////////////////////////////////////////////////////////////

if (!in_array($bbuserinfo['usergroupid'], array(6,7,2,5,1,3,18,11,14,9,10,12,13,16))) print_no_permission();

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NAME OF THIS PHP FILE AND TEMPLATES - DO THIS BIT IF YOU ARE MAKING MORE FORMS!
//You can easily make more forms by just copying this file, renaming it, and modifying the variable in
//this file. You can keep the same templates for different forms. For more customization, you can
//use different templates, by renaming and modifying the templates.
////////////////////////////////////////////////////////////////////////////////////////////////////

// Name of this file
$phpfilename = "modform.php";

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

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

//ENABLE POLL TO BE CREATED - 1 = yes, 0 = no
$formpoll = "0";
$formoption1 = "Yes";
$formoption2 = "No";

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

//ENABLE FORM TO REPLY TO EXISTING THREAD
$formreply = "0";

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

//FORUM ID WHERE THE EXISTING THREAD IS IN
$formreplyforumid = "456";

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

//ENABLE FORM TO BE PMED - 1 = yes, 0 = no
$formpm = "1";

//USERID TO PM TO
$formpmid = "2";

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

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

//EMAIL ADDRESS TO EMAIL TO
$formemailaddress = "admin@akasha.no";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//REDIRECT OPTIONS:
// 0 - thank you message
// 1 - redirect to post
// 2 - redirect to thread
// 3 - redirect to forum
// 4 - redirect to editpost to upload attachments
//
// Feel free to change the thank you message if you choose option 0
////////////////////////////////////////////////////////////////////////////////////////////////////

$redirectoption = "0";

$errormessage = "Takk for at du tok deg tid til ? fylle ut dette skjemaet. Vi vil svare deg s? fort som mulig!"; //This is the thank you message

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//FORCE USER TO ANSWER ALL QUESTIONS - 1 = yes, 0 = no
////////////////////////////////////////////////////////////////////////////////////////////////////

$answerall = "1";

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

$formtitle = "Moderators?knad";

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

$formpurpose = "Her kan du fylle inn din moderators?knad for Akasha Diskusjonsforum. Vennligst fyll inn alle felter nedenfor. Din s?knad vil bli sendt til Mari og vurdert av hele ledelsen.";

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

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

$normalquestion1 = "Fortell oss litt om deg selv";
$normalanswer1 = "";

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

$question1 = "Hvorfor ?nsker du ? bli moderator?";
$answer1 = "";

$question2 = "Hva ?nsker du ? bidra med?";
$answer2 = "";

$question3 = "Hvordan tror du forumet kan forbedres dersom du blir moderator?";
$answer3 = "";

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

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

$radioquestion1 = "Kan du jobbe under stress og kunne ta et valg selv om valget m?ter kritikk?";

// The following choices must NOT have quotation marks
$radiochoice1a = "ja";
$radiochoice1b = "nei";

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

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

$radioquestion2 = "Er du lojal og kan samarbeide med andre, dele ideer og v?re tilgjengelig for m?ter";

// The following choices must NOT have quotation marks
$radiochoice2a = "ja";
$radiochoice2b = "nei";
$radiochoice2c = "delvis";

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

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

$radioquestion3 = "Er du moderator/administrator for andre norske religi?se/alternative forum?";

// The following choices must NOT have quotation marks
$radiochoice3a = "ja";
$radiochoice3b = "nei";

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

$longquestion1 = "Fortell oss litt om deg selv og hvorfor du mener du passer som moderator.";
$longexplain1 = "For eksempel, tidligere erfaring o.l.";

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

// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################


// start navbar
$navbits = array(
"$phpfilename?$session[sessionurl]" => $formtitle
);

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

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

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

if ($formforum == "1") {
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "thread(title, lastpost, forumid, open, replycount,
postusername, postuserid, lastposter, dateline, iconid, visible, attach)
VALUES
('".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle', " . TIMENOW . ", $formforumid,
1, 0, '" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid],
'" . addslashes($bbuserinfo['username']) . "', " . TIMENOW . ", 0, 1,
0)
");
$thread['threadid'] = $DB_site->insert_id();
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "post
(threadid, title, username, userid, dateline, pagetext, allowsmilie,
showsignature, iconid, visible)
VALUES
($thread[threadid], '".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle',
'" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid], " . TIMENOW . ",
'" . addslashes($formsend) . "', 1, 1,
0, 1)
");
$post['postid'] = $DB_site->insert_id();
$DB_site->query("
UPDATE " . TABLE_PREFIX . "thread
SET firstpostid = $post[postid]
WHERE threadid = $thread[threadid]
");
$DB_site->query("
UPDATE " . TABLE_PREFIX . "forum
SET replycount = replycount + 1,
threadcount = threadcount + 1,
lastpost = " . TIMENOW . ",
lastposter = '" . addslashes($bbuserinfo['username']) . "',
lastthread = '".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle',
lastthreadid = $thread[threadid]
WHERE forumid = $formforumid
");
$forum[forumid] = $formforumid;
}

if ($formpoll == "1") {
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "poll (question,dateline,options,votes,active,numberopti ons,timeout,multiple,public) VALUES ('".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle'," . TIMENOW . ",'$formoption1|||$formoption2','" . addslashes("0|||0") . "',1,2,0,0,0)");
$pollid = $DB_site->insert_id();
$DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET pollid = '".$pollid."' WHERE threadid = '".$thread[threadid]."'");
}

if ($formreply == "1") {
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,pa getext,allowsmilie,showsignature,ipaddress,iconid, visible) VALUES (NULL,'$formreplythreadid','".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle','".addslashes($bbuserinfo[username])."','$bbuserinfo[userid]','".time()."','" . addslashes($formsend) . "','1','1','0','0','1')");
$DB_site->query("UPDATE thread SET replycount = replycount + 1, lastpost = " . TIMENOW . ", lastposter = '".addslashes($bbuserinfo[username])."' WHERE threadid = $formreplythreadid");
$DB_site->query("
UPDATE " . TABLE_PREFIX . "forum
SET replycount = replycount + 1,
lastpost = " . TIMENOW . ",
lastposter = '".addslashes(htmlspecialchars($bbuserinfo[username]))."',
lastthread = '" . addslashes($bbuserinfo['username']) . " $formtitle',
lastthreadid = $formreplythreadid
WHERE forumid = $formreplyforumid
");
$forum[forumid] = $formreplyforumid;
}

if ($formpm == "1") {
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pmtext\n\t(fromuserid, fromusername, title, message, touserarray, iconid, dateline, showsignature)\nVALUES\n\t($bbuserinfo[userid], '" . addslashes($bbuserinfo['username']) . "', '".addslashes(htmlspecialchars($formtitle))."', '".addslashes(htmlspecialchars($formsend))."', '" . addslashes(serialize($tostring)) . "', 0, " . TIMENOW . ", 1)");
$pmtextid = $DB_site->insert_id();
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pm (pmtextid, userid, messageread) VALUES ($pmtextid, $formpmid, 0)");
$DB_site->shutdown_query("UPDATE " . TABLE_PREFIX . "user SET pmtotal=pmtotal+1, pmunread=pmunread+1 WHERE userid = $formpmid");
}

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

if ($redirectoption == "1") {
$url = "showthread.php?$session[sessionurl]p=$post[postid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
if ($redirectoption == "2") {
$url = "showthread.php?$session[sessionurl]t=$thread[threadid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
if ($redirectoption == "3") {
$url = "forumdisplay.php?$session[sessionurl]f=$forum[forumid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
if ($redirectoption == "4") {
$url = "editpost.php?do=editpost&$session[sessionurl]p=$post[postid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
exit();
}
eval('print_output("' . fetch_template('form') . '");');
?>


I haven't altered the templates at all.

Any ideas?

Erwin
01-07-2005, 12:10 AM
You changed the name of the template but forgot to change this line in form.php:


eval('print_output("' . fetch_template('form') . '");');


Hence the blank page.

As for the changing of the variable - it's because the page is blank so your browser cached the old page.

dina
01-07-2005, 12:20 AM
Ahhh.. thanks :)

Mythotical
01-11-2005, 02:41 AM
Ok too many pages to read but here is my problem, I got radio buttons going across the screen, I need 3 to a line, how can I add a line break and it actually read it with no error?

http://www.malvaria.com/character.php is where its located.

Thanks in advance.
Myth

alkatraz
01-11-2005, 02:52 AM
^^^ boo to being lazy

edit the template "form"

<tr>
<td class="alt2" colspan="3">
<b>$radioquestion2</b>
</td></tr><tr>
<td><INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2a"> $radiochoice2a </td>
<td><INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2b"> $radiochoice2b </td>
<td><INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2c"> $radiochoice2c </td>
</tr>

change it to
<tr>
<td class="alt2" colspan="3">
<b>$radioquestion2</b>
</td></tr><tr>
<td><INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2a"> $radiochoice2a </td>
<td><INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2b"> $radiochoice2b </td>
<td><INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2c"> $radiochoice2c </td>
</tr>

<tr>
<td><INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2d"> $radiochoice2d </td>
<td><INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2e"> $radiochoice2e </td>
<td><INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2f"> $radiochoice2f </td>
</tr>




It's basic html, just add a new table row instead of trying to squeeze everything into one row.

Mythotical
01-11-2005, 03:16 AM
Yeah a friend and me got it figured out. We proud of ourselves for that. hehe

Amavisca
01-16-2005, 04:46 AM
Hi !
is there anybody here can help me out ? On the form.php
//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.";

Can u add some code to check if the link input is correct/exist when member enter info? Some of my member just enter link either not working or wrong fomart.

Spinball
01-16-2005, 07:25 AM
Hi !
is there anybody here can help me out ? On the form.php
//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.";

Can u add some code to check if the link input is correct/exist when member enter info? Some of my member just enter link either not working or wrong fomart.

You could take a look at the code used in Andy's links and files hack.

Amavisca
01-16-2005, 08:02 PM
You could take a look at the code used in Andy's links and files hack.

Im pretty noob when it comes to code and stuff, can u help me out ???

kvnband
01-17-2005, 12:05 AM
Any way to create a drop down menu with this script? Or Checkboxes? It really is a great thing, but I need some more options. If I've missed something, please let me know.

Hexemer
01-18-2005, 12:42 AM
1. You can change the thread title within the code - look at the code and you can work it out.

I have changed the title to

$formtitle = "$normalquestion2";

but it doesn't work. The Board shows my username but not the data of "$normalquestion2" in the new thread. What do I wrong? :ermm:

Jolten
01-25-2005, 06:02 PM
Hi Dr. Erwin,

Wonderful hack. I've been using it for some time.

I was wondering if you could possibly help me pass a variable through the form?

I've set the form to open in a popup window with no title/scroll/tool bars. It gets filled out and then posted to a forum and emailed. It works wonderfully. I'd like to pass a variable from the link to the forum, through to the forum answers. I've added ?id=$var&cad=$var to the link.. and used the $_GET commands in form.php to pull them, then applied them to a new variable

e.g:


$id=$_GET['id'];
$cat=$_GET['cat'];
$link="http://www.domain.com?id=".$id."&cat=".$cat;


Then I've added $link to the formanswers template.

$link gets parsed and works, but the $id and $cat variables are not being set.

Is this possibly due to the lack of an address bar in the window where the form displays?

any help would be appreciated. thanks

AlienSector
01-26-2005, 09:24 PM
Nice work, Erwin :). I've integrated this with a new project of mine and although it has been cut down a great deal (coding wise, as I neeed only the Form-to-PM), it provided a great starting point on what I was unable to do myself at the time.

The only addition I would like to see is to be able to add HTML or BBCode, though doing so proved to be unsuccessful it seems. Perhaps I am overlooking something, though is there a way around this?

scoheb
01-27-2005, 12:47 AM
Hi,

I installed your hack and it is working wonderfully.

I use the form to reply to thread feature and it seems that the search index is not getting updated.

Is anyone having this problem?

Thanks,

SH

ChrisBaktis
01-27-2005, 04:57 PM
Hi,

I installed your hack and it is working wonderfully.

I use the form to reply to thread feature and it seems that the search index is not getting updated.

Is anyone having this problem?

Thanks,

SH

I get this same problem - seems will only be included in a search if someone replies to the thread.

Chris

Erwin
01-27-2005, 08:33 PM
I get this same problem - seems will only be included in a search if someone replies to the thread.

Chris
I don't use the searchindex so I never had to add it as I use the mysql fulltext index.

When I find time I may add the option to update searchindex.

Jolten
01-27-2005, 11:00 PM
No chance on this huh?



Wonderful hack. I've been using it for some time.

I was wondering if you could possibly help me pass a variable through the form?

I've set the form to open in a popup window with no title/scroll/tool bars. It gets filled out and then posted to a forum and emailed. It works wonderfully. I'd like to pass a variable from the link to the forum, through to the forum answers. I've added ?id=$var&cad=$var to the link.. and used the $_GET commands in form.php to pull them, then applied them to a new variable

e.g:


$id=$_GET['id'];
$cat=$_GET['cat'];
$link="http://www.domain.com?id=".$id."&cat=".$cat;


Then I've added $link to the formanswers template.

$link gets parsed and works, but the $id and $cat variables are not being set.

Is this possibly due to the lack of an address bar in the window where the form displays?

any help would be appreciated. thanks



thanks

ChrisBaktis
01-27-2005, 11:27 PM
I don't use the searchindex so I never had to add it as I use the mysql fulltext index.

When I find time I may add the option to update searchindex.

That would be GREAT, and much appreciated, Erwin.

kangta
01-28-2005, 09:27 AM
* kangta clicks Install

Excellent hack.

I noticed a bit of a glitch, I don't know whether or not it's been noted/addressed previously. I've been testing my customized setup rather extensively ever since I managed to get it to work. I read earlier that posts made via this form aren't added to a user's post count, and I saw that to be a good thing considering what my form was being used for. However, since I was testing and posting several threads I didn't need, I deleted each one afterwards. The forum is a new installation, and I soon noticed that I had a post count of zero even though I had posts elsewhere not made by the form. I know that the reason for this is because the posts submitted through the form don't add to your post count, while physically deleting a thread takes away from your post count anyway, but I just wanted to point that out. ;)

Abe1
01-31-2005, 01:14 AM
Hi,

I installed your hack and it is working wonderfully.

I use the form to reply to thread feature and it seems that the search index is not getting updated.

Is anyone having this problem?

Thanks,

SH
Do what I do. Make the forum to go the 'edit post' page. When the user clicks 'update' then the post will go to the index.

Dan
02-02-2005, 06:58 PM
Any one happen to know a way to make it so the people who have instant email turned on don't get an email? I'm currently using it as a moderator application forum and my staff would like to comment on the applications but if they do the person who sent the app would recieve an email if they have instant subscribe on.

Thanks!

Jolten
02-02-2005, 07:04 PM
I'm still looking for a way to pass a variable through the form.

Erwin
02-02-2005, 10:39 PM
I'm still looking for a way to pass a variable through the form.
You need to add the variable to the top of the PHP file where variables are checked for security reasons.

Jolten
02-02-2005, 10:50 PM
You need to add the variable to the top of the PHP file where variables are checked for security reasons.

Thank's for replying Erwin.

I added the following to the top of the form.php file


// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'flagcomm'); // change this depending on your filename

$catid=$_POST['catid'];
$cad=$_POST['cad'];
$linkUrl="http://www.domain.com/page.php?id=".$catid."&cad=".$cad."&type=a";


// ################### PRE-CACHE TEMPLATES AND DATA ######################

// get special phrase groups
$phrasegroups = array(

);


But I can't seem to pull the link into the form answers. $linkurl works fine in the answers but the two variables are empty.

I've also added hidden inputs to the form template for both these variables.

ericgtr
02-04-2005, 01:47 PM
Hmm, I am wondering if one of you guys who have worked a lot with this can help me out. What I would like use this for is a confirmation page so basically when a user clicks the "Submit new thread" button in forrumid=106 it takes them to a page that says "did you remember to do this and that?" then if they click "yes" the are redirected to the post page and if they select "no" they receive a can't continue (or something similar).

Spinball
02-04-2005, 03:59 PM
Hmm, I am wondering if one of you guys who have worked a lot with this can help me out. What I would like use this for is a confirmation page so basically when a user clicks the "Submit new thread" button in forrumid=106 it takes them to a page that says "did you remember to do this and that?" then if they click "yes" the are redirected to the post page and if they select "no" they receive a can't continue (or something similar).

Yes, I have done exactly that. Please see my earlier post in this thead.

Erwin
02-05-2005, 03:23 AM
Thank's for replying Erwin.

I added the following to the top of the form.php file


// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'flagcomm'); // change this depending on your filename

$catid=$_POST['catid'];
$cad=$_POST['cad'];
$linkUrl="http://www.domain.com/page.php?id=".$catid."&cad=".$cad."&type=a";


// ################### PRE-CACHE TEMPLATES AND DATA ######################

// get special phrase groups
$phrasegroups = array(

);


But I can't seem to pull the link into the form answers. $linkurl works fine in the answers but the two variables are empty.

I've also added hidden inputs to the form template for both these variables.
No, you have to add the variables to this array:


globalize($_POST, array(
'normalanswer1' => STR,
'radioanswer1' => STR,
'longanswer1' => STR,
'action' => STR
));


Otherwise vB won't let it through for security reasons.

Jolten
02-05-2005, 03:31 AM
ahh thanks. I'll play with it some more.

Lee Wilde
02-06-2005, 04:25 AM
Hello Erwin and all users of this hack. This hack is proving to be invaluable for us, we are most appreciative.

Just a little extra thing I'm trying to do, which is causing a minor annoyance....

I've slightly hacked forumdisplay.php to display a preview of the thread. It works, as you can see from the screenshot....but how can I get rid of the unnecessary "begin template" text....I can't even figure out where its coming from.

Thank you, any suggestions would be appreciated.

Jolten
02-06-2005, 06:09 AM
Turn off the option to show templates in the source code. It's in the vBulletin options area.

life is boost
02-09-2005, 10:06 PM
this is a great hack, we use this as aclassifieds form for our site. the only thing i was wondering is if we can get the forum to post the IP of the user like on a normal post. when someone uses the form, it will not save their IP information.

DarrinM
02-11-2005, 07:28 PM
Hi All

Been following this thread, great hack Erwin, can think of many ways to use it however I am wondering if the following can be acheived.

When viewing someone's profile I wonder if it would be possible to then open a form and have some of the fields automatically populated - Form originators name (i.e. the person viewing the profile), the username or even custom field(s) taken from the person who's profile is being viewed. I then want to send the form contents via email to a third party static email address (which is obviously covered already)

Thanks in advance

DarrinM

Erwin
02-11-2005, 10:01 PM
Hi All

Been following this thread, great hack Erwin, can think of many ways to use it however I am wondering if the following can be acheived.

When viewing someone's profile I wonder if it would be possible to then open a form and have some of the fields automatically populated - Form originators name (i.e. the person viewing the profile), the username or even custom field(s) taken from the person who's profile is being viewed. I then want to send the form contents via email to a third party static email address (which is obviously covered already)

Thanks in advance

DarrinM
Of course you can do all that using $bbuserinfo[field10] or whatever it is and putting it in the form template. :)

kall
02-12-2005, 01:13 AM
Of course you can do all that using $bbuserinfo[field10] or whatever it is and putting it in the form template. :)
How about...

The user submitting the form can choose which people the output is PMed to?

Cheertobi
02-12-2005, 09:36 AM
Hi,

I am sorry, I have not been through all of the thread right now! Just one quick question, is it also possible to post calender events via form.php?!

Regards,

Tobi

Leeper
02-12-2005, 01:40 PM
I just want to make sure that I'm on the right train of thought here before I jump in with this major addition. I believe that with this and some custom work I can come up with a much better solution than what we have now.
Currently we have a very cumbersome process for person to join our club. To register as a guest on the forum is very straight forward process as it is the one built by vB. To join the club however is a bit more of a pain. Member uses join form and once completed and they submit, an email is generated to the admin team and the new user is sent to paypal. The problem is that there is nothing explaining that they still need to register on the forums. Once payment is received the member is moved into the member area but again, this is a very separate process that IÂ’d like to integrate.
Can I create a "Join Form" with all of the variables that I need and a payment function that then leads the user into the registration area? The new join form would post the information into an admin forum.

Sorry if IÂ’m posting this in the wrong area and IÂ’m probably over complicating this but IÂ’m a novice trying to find a better way.

Erwin
02-13-2005, 01:02 AM
Hi,

I am sorry, I have not been through all of the thread right now! Just one quick question, is it also possible to post calender events via form.php?!

Regards,

Tobi
Possible but I have not added that function to the hack yet. I may in future.

Erwin
02-13-2005, 01:03 AM
I just want to make sure that I'm on the right train of thought here before I jump in with this major addition. I believe that with this and some custom work I can come up with a much better solution than what we have now.
Currently we have a very cumbersome process for person to join our club. To register as a guest on the forum is very straight forward process as it is the one built by vB. To join the club however is a bit more of a pain. Member uses join form and once completed and they submit, an email is generated to the admin team and the new user is sent to paypal. The problem is that there is nothing explaining that they still need to register on the forums. Once payment is received the member is moved into the member area but again, this is a very separate process that I?d like to integrate.
Can I create a "Join Form" with all of the variables that I need and a payment function that then leads the user into the registration area? The new join form would post the information into an admin forum.

Sorry if I?m posting this in the wrong area and I?m probably over complicating this but I?m a novice trying to find a better way.
That can be done - you just change the redirect options.

ChrisBaktis
02-13-2005, 01:55 PM
Erwin,

I use this form to post trades between two members and currently have it setup to post the trade to a a specific form...I would also like to have it so it sends a PM to the other member (the person posting the form has to enter the other members name). Could I use the form answer variable to do this? Also if it is possible, and the person posting the trade enters a wrong member name (misspelled etc) would it still post in the form but not send the pm?

Erwin
02-13-2005, 08:48 PM
Erwin,

I use this form to post trades between two members and currently have it setup to post the trade to a a specific form...I would also like to have it so it sends a PM to the other member (the person posting the form has to enter the other members name). Could I use the form answer variable to do this? Also if it is possible, and the person posting the trade enters a wrong member name (misspelled etc) would it still post in the form but not send the pm?
Yes, you can definitely do all that. It's only a matter of changing the variables and adding a line to the code to search for the userid in order to send the pm.

Leeper
02-13-2005, 09:19 PM
That can be done - you just change the redirect options.
Wow! Normally I can see work that has been done and customize it a bit but I'm just not having much luck with this. Erwin thank you for your hard work and rather than pestering you with another question every hour or so, can you recommend someone to build a fairly elaborate form? Your work is great and I can see a ton of applications for this but in this particular case I'm working with a time constraint and it needs to be done right the first time since it will be handling money transactions.

ChrisBaktis
02-13-2005, 11:05 PM
Yes, you can definitely do all that. It's only a matter of changing the variables and adding a line to the code to search for the userid in order to send the pm.

I can do the variables but can you help with the line of code to search for the userid?

DarrinM
02-16-2005, 04:06 PM
Can anyone advise me or provide help with the following scenario

When viewing someone's profile I wish to be able to click to open up a new form which will then be sent both to the person who's profile is being viewed and also to a third party preset email address.

I understand how to get most of the data prefilled on the form (such as the senders email address) but cannot see how I can pass the username and usernames email address of the person who's profile is being viewed into and to be used by the form

An alternative to doing this would be the ability to select a user from the member list (maybe in drop down) and then return to the form and populate the fields with their name, email address and maybe a custom field from their profile

Hope someone can assist and many thanks in advance

Regards

Darrin

Jolten
02-16-2005, 04:10 PM
The variables for the profile owners page are $userinfo[username] etc. rather than $bbuserinfo.. you should be able to use those to fill out form fields.

ge66
02-16-2005, 07:01 PM
Seemes to be a very useful hack.

I have a suggestion/question. Is i possible to make a form that I can fill in and submit today and that will be posted as a thred on Sunday say 7 am.

I want to use this to be able to spread news articles that I post at one time over several days.

I also guess it could be nice if you wanted a poll posted 6 am the first day of the month or something.

A chance to post a thread at any given date and time that you set in a form.

Cheertobi
02-19-2005, 12:15 PM
Hi,

once again, have not been through all post of this thread. Just want to let you know, that I found two missing TABLE_PREFIXes!

$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,pa getext,allowsmilie,showsignature,ipaddress,iconid, visible) VALUES (NULL,'$formreplythreadid','".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle','".addslashes($bbuserinfo[username])."','$bbuserinfo[userid]','".time()."','" . addslashes($formsend) . "','1','1','0','0','1')");
$DB_site->query("UPDATE thread SET replycount = replycount + 1, lastpost = " . TIMENOW . ", lastposter = '".addslashes($bbuserinfo[username])."' WHERE threadid = $formreplythreadid");
$DB_site->query("
UPDATE " . TABLE_PREFIX . "forum
SET replycount = replycount + 1,
lastpost = " . TIMENOW . ",
lastposter = '".addslashes(htmlspecialchars($bbuserinfo[username]))."',
lastthread = '" . addslashes($bbuserinfo['username']) . " $formtitle',
lastthreadid = $formreplythreadid
WHERE forumid = $formreplyforumid

have to be like

$DB_site->query("INSERT INTO " . TABLE_PREFIX . "post (postid,threadid,title,username,userid,dateline,pa getext,allowsmilie,showsignature,ipaddress,iconid, visible) VALUES (NULL,'$formreplythreadid','".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle','".addslashes($bbuserinfo[username])."','$bbuserinfo[userid]','".time()."','" . addslashes($formsend) . "','1','1','0','0','1')");
$DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET replycount = replycount + 1, lastpost = " . TIMENOW . ", lastposter = '".addslashes($bbuserinfo[username])."' WHERE threadid = $formreplythreadid");
$DB_site->query("
UPDATE " . TABLE_PREFIX . "forum
SET replycount = replycount + 1,
lastpost = " . TIMENOW . ",
lastposter = '".addslashes(htmlspecialchars($bbuserinfo[username]))."',
lastthread = '" . addslashes($bbuserinfo['username']) . " $formtitle',
lastthreadid = $formreplythreadid
WHERE forumid = $formreplyforumid

Anyway, it is a really great hack, can I parse BBCode for Bold etc. in anyway?!

Tobi

Cheertobi
02-19-2005, 01:30 PM
Hi,

just found out how to parse the bbcode.

But also found another "problem", the redirect does not work ;( The url just ended like:

editpost.php?do=editpost&p=
Where p is empty.

Regards,

Tobi

ChrisBaktis
02-21-2005, 04:57 PM
Does anyone know how to add it so forms that post to threads are added to the search index? Currently the posts will not show up until someone replies to them without using a form.

vbted
02-23-2005, 11:17 PM
how would i make one of the input boxes check to see if it matches a custom profile field and pm to that user? any help would be great i'm sql noob. -Ted

life is boost
02-24-2005, 01:22 PM
im still working on trying to get the form to add the users IP like a normal post would. If anyone has an ideas please let me know.

ChrisBaktis
02-24-2005, 02:00 PM
Does anyone know how to add it so forms that post to threads are added to the search index? Currently the posts will not show up until someone replies to them without using a form.

Anyone?

Abe1
02-24-2005, 04:24 PM
Anyone?
yes, use the option that will make the form go to the 'edit post' after. Once the user clicks 'submit,' the words will be added to the search.

ChrisBaktis
02-25-2005, 12:09 AM
Thanks - I didnt see that verion 1.6 came out - this actually works out well for me.

ChrisBaktis
02-25-2005, 04:55 PM
Has anyone played with this hack so a member can type in the username of the person they want the form pm'd to?

ChrisBaktis
02-26-2005, 07:20 PM
Has anyone played with this hack so a member can type in the username of the person they want the form pm'd to?

Just looking for a member to be able to type in a username and the form will PM that member the contents of a custom profile field.

unixdotcom
03-02-2005, 03:35 AM
Dear Erwin,

Thank you for this "hack". We are working on a non-profit site, currently prototyped at www.inss.com, which will be moved to the "right domain" soon.

We need a form that is a "case submission" that permits a person who has been "abused" by the IRS to submit a custom designed form, which will be moderated, and then posted into the forum database.

Is this possible with your software?

Thank you for your help with our query.

Neo

morrow
03-13-2005, 10:30 PM
I'll tell you what I'm going to use it for (as soon as I can figure out how to add a redirect). :) My website is automotive themed, and we have a couple Tech forums, where members come to ask advice on how to fix various problems that they are having with their vehicles. A common problem that we see is when a member doesn't give important information when they are starting a thread. There have been times when all they'll say is: "My car runs crappy. What's wrong with it?" They forget that we may not know their Make/Model/Year, etc. For a couple years now, I've wanted to have a form that needs to be filled out in order to make a post in that forum, so that I could tell them specifically what info is needed.

I don't know what your forum is about, but perhaps you could find a similar use for this wonderful hack. :) Attached is a pic of my form page.

Take care,
~Chris

I am working on something very similar (automotive) and would like almost identicle information to what you have. Would you be willing to send me your form and templates? I'd really appreciate that. I'm not looking to copy what you have, but just want to see what you did to get it working.

Thanks alot!

morrow
03-15-2005, 02:45 AM
Can somebody / anybody who has this installed with multiple questions post their working sample? I'd really love to get this hack up and running with more than the stock questions.

Thanks!

morrow
03-15-2005, 05:33 PM
Can I offer some $$$$$$ for some help here? Let's not get too crazy, what I'm asking for will take someone approximately 1 1/2 minutes to accomplish.

Thanks

ChrisBaktis
03-16-2005, 07:31 PM
what do you want a template of the form.php file?

morrow
03-17-2005, 04:18 AM
what do you want a template of the form.php file?

I would like the form.php and the two templates. I would like to look at somebody's working copy. I know the version here works, but it only provides 1 of each type of question. All I would like to do is see what this software looks like with multiples of each question, or at least the first question.

Thanks for the response.

ChrisBaktis
03-17-2005, 12:34 PM
form:

<?php

/*================================================= =====================*\
|| ################################################## ################## ||
|| # FORM TO THREAD/ FORUM/ PM/ EMAIL - Totally CUSTOMIZABLE FORMS # ||
|| # Version 1.6 for vBulletin 3.x.x by Dr Erwin Loh # ||
|| # ---------------------------------------------------------------- # ||
|| # Copyright ?2000?2004 Dr Erwin Loh. All Rights Reserved. # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| ################################################## ################## ||
\*================================================ ======================*/

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

$globaltemplates = array(
'tc_tradepostform',
'tc_tradepostformanswers'
);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

globalize($_POST, array(
'normalanswer1' => STR,
'radioanswer1' => STR,
'radioanswer2' => STR,
'radioanswer3' => STR,
'radioanswer3other' => STR,
'answer1' => STR,
'answer2' => STR,
'answer3' => STR,
'longanswer1' => STR,
'action' => STR
));

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//USERGROUPS ALLOWED
//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array
////////////////////////////////////////////////////////////////////////////////////////////////////

if (!in_array($bbuserinfo['usergroupid'], array(2,5,6,9,13,15,16,17,19))) print_no_permission();

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NAME OF THIS PHP FILE AND TEMPLATES - DO THIS BIT IF YOU ARE MAKING MORE FORMS!
//You can easily make more forms by just copying this file, renaming it, and modifying the variable in
//this file. You can keep the same templates for different forms. For more customization, you can
//use different templates, by renaming and modifying the templates.
////////////////////////////////////////////////////////////////////////////////////////////////////

// Name of this file
$phpfilename = "tc_tradepostform.php";

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

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

//ENABLE POLL TO BE CREATED - 1 = yes, 0 = no
$formpoll = "0";
$formoption1 = "Yes";
$formoption2 = "No";

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

//ENABLE FORM TO REPLY TO EXISTING THREAD
$formreply = "0";

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

//FORUM ID WHERE THE EXISTING THREAD IS IN
$formreplyforumid = "456";

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

//ENABLE FORM TO BE PMED - 1 = yes, 0 = no
$formpm = "0";

//USERID TO PM TO
$formpmid = "1";

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

//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
// 1 - redirect to post
// 2 - redirect to thread
// 3 - redirect to forum
// 4 - redirect to editpost to upload attachments
//
// Feel free to change the thank you message if you choose option 0
////////////////////////////////////////////////////////////////////////////////////////////////////

$redirectoption = "4";

$errormessage = "Thank you for submitting this form!"; //This is the thank you message

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//FORCE USER TO ANSWER ALL QUESTIONS - 1 = yes, 0 = no
////////////////////////////////////////////////////////////////////////////////////////////////////

$answerall = "0";

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

$formtitle = "Personal Trade Center - Post A Trade/Sale";

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

$formpurpose = "Use This Form To Post A Trade or Sale Between RST Members";

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

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

$radioquestion1 = "Is This A Trade Or Sale?";

// The following choices must NOT have quotation marks
$radiochoice1a = "Trade";
$radiochoice1b = "Sale";

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

$radioquestion2 = "Insurance On Shipping";

// The following choices must NOT have quotation marks
$radiochoice2a = "Yes";
$radiochoice2b = "No";

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

$radioquestion3 = "Delivery Confirmation";

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

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

$radioquestion4 = "Who Is Sending First";

// The following choices must NOT have quotation marks
$radiochoice4a = "Me";
$radiochoice4b = "Trade Partner";
$radiochoice4c = "Same Time";

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

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

$normalquestion1 = "Trade/Sale Member Name #1";

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

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

$longquestion1 = "Please Post What Member #1 Will RECEIVE";

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

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

$normalquestion2 = "Trade/Sale Member Name #2";

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

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

$longquestion2 = "Please Post What Your Trade/Sale Partner WILL RECEIVE";

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

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

$longquestion3 = "Include Any Other Info Here";

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



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

// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################

// start navbar
$navbits = array(
"$phpfilename?$session[sessionurl]" => $formtitle
);

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

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

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

if ($formforum == "1") {
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "thread(title, lastpost, forumid, open, replycount,
postusername, postuserid, lastposter, dateline, iconid, visible, attach)
VALUES
('".addslashes(htmlspecialchars($bbuserinfo[username]))." / $normalanswer2', " . TIMENOW . ", $formforumid,
1, 0, '" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid],
'" . addslashes($bbuserinfo['username']) . "', " . TIMENOW . ", 0, 1,
0)
");
$thread['threadid'] = $DB_site->insert_id();
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "post
(threadid, title, username, userid, dateline, pagetext, allowsmilie,
showsignature, iconid, visible)
VALUES
($thread[threadid], '".addslashes(htmlspecialchars($bbuserinfo[username]))." / $normalanswer2',
'" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid], " . TIMENOW . ",
'" . addslashes($formsend) . "', 1, 1,
0, 1)
");
$post['postid'] = $DB_site->insert_id();
$DB_site->query("
UPDATE " . TABLE_PREFIX . "thread
SET firstpostid = $post[postid]
WHERE threadid = $thread[threadid]
");
$DB_site->query("
UPDATE " . TABLE_PREFIX . "forum
SET replycount = replycount + 1,
threadcount = threadcount + 1,
lastpost = " . TIMENOW . ",
lastposter = '" . addslashes($bbuserinfo['username']) . "',
lastthread = '".addslashes(htmlspecialchars($bbuserinfo[username]))." /$normalanswer2',
lastthreadid = $thread[threadid]
WHERE forumid = $formforumid
");
$forum[forumid] = $formforumid;
}

if ($formpoll == "1") {
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "poll (question,dateline,options,votes,active,numberopti ons,timeout,multiple,public) VALUES ('".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle'," . TIMENOW . ",'$formoption1|||$formoption2','" . addslashes("0|||0") . "',1,2,0,0,0)");
$pollid = $DB_site->insert_id();
$DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET pollid = '".$pollid."' WHERE threadid = '".$thread[threadid]."'");
}

if ($formreply == "1") {
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,pa getext,allowsmilie,showsignature,ipaddress,iconid, visible) VALUES (NULL,'$formreplythreadid','".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle','".addslashes($bbuserinfo[username])."','$bbuserinfo[userid]','".time()."','" . addslashes($formsend) . "','1','1','0','0','1')");
$DB_site->query("UPDATE thread SET replycount = replycount + 1, lastpost = " . TIMENOW . ", lastposter = '".addslashes($bbuserinfo[username])."' WHERE threadid = $formreplythreadid");
$DB_site->query("
UPDATE " . TABLE_PREFIX . "forum
SET replycount = replycount + 1,
lastpost = " . TIMENOW . ",
lastposter = '".addslashes(htmlspecialchars($bbuserinfo[username]))."',
lastthread = '" . addslashes($bbuserinfo['username']) . " $formtitle',
lastthreadid = $formreplythreadid
WHERE forumid = $formreplyforumid
");
$forum[forumid] = $formreplyforumid;
}

if ($formpm == "1") {
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pmtext\n\t(fromuserid, fromusername, title, message, touserarray, iconid, dateline, showsignature)\nVALUES\n\t($bbuserinfo[userid], '" . addslashes($bbuserinfo['username']) . "', '".addslashes(htmlspecialchars($formtitle))."', '".addslashes(htmlspecialchars($formsend))."', '" . addslashes(serialize($tostring)) . "', 0, " . TIMENOW . ", 1)");
$pmtextid = $DB_site->insert_id();
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pm (pmtextid, userid, messageread) VALUES ($pmtextid, $formpmid, 0)");
$DB_site->shutdown_query("UPDATE " . TABLE_PREFIX . "user SET pmtotal=pmtotal+1, pmunread=pmunread+1 WHERE userid = $formpmid");
}

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

if ($redirectoption == "1") {
$url = "showthread.php?$session[sessionurl]p=$post[postid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
if ($redirectoption == "2") {
$url = "showthread.php?$session[sessionurl]t=$thread[threadid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
if ($redirectoption == "3") {
$url = "forumdisplay.php?$session[sessionurl]f=$forum[forumid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
if ($redirectoption == "4") {
$url = "editpost.php?do=editpost&$session[sessionurl]p=$post[postid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
exit();
}
eval('print_output("' . fetch_template('tc_tradepostform') . '");');
?>

Form Template (I left out my custom skin template info)

<!-- main page contents -->

<form enctype="multipart/form-data" method="post" action="$phpfilename">
<input type="hidden" value="$userid" name="userid">
<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">
$formtitle
</td>
</tr>


<!-- Sale or Trade Start -->
<tr>
<td class="alt2" colspan="3"> <b><font color="#ff0000">$radioquestion1</font></b><br>
<INPUT TYPE="radio" NAME="radioanswer1" value="$radiochoice1a"> <b>$radiochoice1a</b> <INPUT TYPE="radio" NAME="radioanswer1" value="$radiochoice1b"> <b>$radiochoice1b</b> </td>
</tr>
<!-- Sale or Trade End -->

<!-- Blank Line -->
<tr>
<td class="alt1" valign="middle" height="25"></td>
</tr>
<!-- Blank Line End-->


<!-- Member #1 Start -->
<tr>
<td class="alt2" colspan="3">

<b><font color="#ff0000">What will $bbuserinfo[username] get?</font></b><br>


<textarea rows="5" cols="70" name="longanswer1"></textarea>
</td>
</tr>
<!-- Member #1 End -->

<!-- Blank Line -->
<tr>
<td class="alt1" valign="middle" height="25"></td>
</tr>
<!-- Blank Line End-->


<!-- Member #2 Start -->
<tr>
<td class="alt2" colspan="3"> <b><font color="#ff0000">Username of your trade/sale partner? (must be exact - please be careful)</font></b><br>



<input type="text" size="30" name="normalanswer2"><br><BR>


<b><font color="#ff0000">$longquestion2</font></b><br>


<textarea rows="5" cols="70" name="longanswer2"></textarea>
</td>
</tr>
<!-- Member #2 End -->

<!-- Blank Line -->
<tr>
<td class="alt1" valign="middle" height="25"></td>
</tr>
<!-- Blank Line End-->

<!-- Insurance Start -->
<tr>
<td class="alt2" colspan="3"> <b><font color="#ff0000"><b>$radioquestion2</b></font></b><br>
<INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2a"> <b>$radiochoice2a</b> <INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2b"> <b>$radiochoice2b</b> </td>
</tr>
<!-- Insurance End End-->

<!-- Del Conf. Start -->
<tr>
<td class="alt2" colspan="3"> <b><font color="#ff0000">$radioquestion3</font></b><br>
<INPUT TYPE="radio" NAME="radioanswer3" value="$radiochoice3a"> <b>$radiochoice3a<b> <INPUT TYPE="radio" NAME="radioanswer3" value="$radiochoice3b"> <b>$radiochoice3b</b> </td>
</tr>
<!-- Del. Conf. End-->

<!-- Shipping Start -->
<tr>
<td class="alt2" colspan="3"> <b><font color="#ff0000">$radioquestion4</font></b><br>
<INPUT TYPE="radio" NAME="radioanswer4" value="$radiochoice4a"> <b>$radiochoice4a</b> <INPUT TYPE="radio" NAME="radioanswer4" value="$radiochoice4b"> <b>$radiochoice4b</b> <INPUT TYPE="radio" NAME="radioanswer4" value="$radiochoice4c"> <b>$radiochoice4c</b> </td>
</tr>
<!-- Shipping End-->

<!-- Blank Line -->
<tr>
<td class="alt1" valign="middle" height="25"></td>
</tr>
<!-- Blank Line End-->

<!-- Misc Info Start -->
<tr>
<td class="alt2" colspan="3">
<b><font color="#ff0000">$longquestion3</font></b><br>
<textarea rows="5" cols="70" name="longanswer3"></textarea>
</td>
</tr>
<!-- Misc Info End -->

<tr>
<td valign="top">
<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>
</td>
</tr>
</table>

</font>

</form>

<!-- / main page contents -->

Answer Template

This $radioanswer1 Is Between: $bbuserinfo[username] & $normalanswer2

Type Of Transaction: $radioanswer1

$radioquestion2: $radioanswer2

$radioquestion3: $radioanswer3

$radioquestion4: $radioanswer4

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

$bbuserinfo[username] gets:
$longanswer1

$normalanswer2 gets:
$longanswer2

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

Misc Information:
$longanswer3

The answer template has bb code because I have this directed to post to a forum.

morrow
03-17-2005, 06:28 PM
form:

<?php

/*================================================= =====================*\
|| ################################################## ################## ||
|| # FORM TO THREAD/ FORUM/ PM/ EMAIL - Totally CUSTOMIZABLE FORMS # ||
|| # Version 1.6 for vBulletin 3.x.x by Dr Erwin Loh # ||
|| # ---------------------------------------------------------------- # ||
|| # Copyright ?2000?2004 Dr Erwin Loh. All Rights Reserved. # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| ################################################## ################## ||
\*================================================ ======================*/

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

$globaltemplates = array(
'tc_tradepostform',
'tc_tradepostformanswers'
);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

globalize($_POST, array(
'normalanswer1' => STR,
'radioanswer1' => STR,
'radioanswer2' => STR,
'radioanswer3' => STR,
'radioanswer3other' => STR,
'answer1' => STR,
'answer2' => STR,
'answer3' => STR,
'longanswer1' => STR,
'action' => STR
));

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//USERGROUPS ALLOWED
//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array
////////////////////////////////////////////////////////////////////////////////////////////////////

if (!in_array($bbuserinfo['usergroupid'], array(2,5,6,9,13,15,16,17,19))) print_no_permission();

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NAME OF THIS PHP FILE AND TEMPLATES - DO THIS BIT IF YOU ARE MAKING MORE FORMS!
//You can easily make more forms by just copying this file, renaming it, and modifying the variable in
//this file. You can keep the same templates for different forms. For more customization, you can
//use different templates, by renaming and modifying the templates.
////////////////////////////////////////////////////////////////////////////////////////////////////

// Name of this file
$phpfilename = "tc_tradepostform.php";

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

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

//ENABLE POLL TO BE CREATED - 1 = yes, 0 = no
$formpoll = "0";
$formoption1 = "Yes";
$formoption2 = "No";

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

//ENABLE FORM TO REPLY TO EXISTING THREAD
$formreply = "0";

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

//FORUM ID WHERE THE EXISTING THREAD IS IN
$formreplyforumid = "456";

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

//ENABLE FORM TO BE PMED - 1 = yes, 0 = no
$formpm = "0";

//USERID TO PM TO
$formpmid = "1";

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

//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
// 1 - redirect to post
// 2 - redirect to thread
// 3 - redirect to forum
// 4 - redirect to editpost to upload attachments
//
// Feel free to change the thank you message if you choose option 0
////////////////////////////////////////////////////////////////////////////////////////////////////

$redirectoption = "4";

$errormessage = "Thank you for submitting this form!"; //This is the thank you message

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//FORCE USER TO ANSWER ALL QUESTIONS - 1 = yes, 0 = no
////////////////////////////////////////////////////////////////////////////////////////////////////

$answerall = "0";

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

$formtitle = "Personal Trade Center - Post A Trade/Sale";

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

$formpurpose = "Use This Form To Post A Trade or Sale Between RST Members";

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

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

$radioquestion1 = "Is This A Trade Or Sale?";

// The following choices must NOT have quotation marks
$radiochoice1a = "Trade";
$radiochoice1b = "Sale";

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

$radioquestion2 = "Insurance On Shipping";

// The following choices must NOT have quotation marks
$radiochoice2a = "Yes";
$radiochoice2b = "No";

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

$radioquestion3 = "Delivery Confirmation";

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

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

$radioquestion4 = "Who Is Sending First";

// The following choices must NOT have quotation marks
$radiochoice4a = "Me";
$radiochoice4b = "Trade Partner";
$radiochoice4c = "Same Time";

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

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

$normalquestion1 = "Trade/Sale Member Name #1";

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

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

$longquestion1 = "Please Post What Member #1 Will RECEIVE";

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

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

$normalquestion2 = "Trade/Sale Member Name #2";

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

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

$longquestion2 = "Please Post What Your Trade/Sale Partner WILL RECEIVE";

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

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

$longquestion3 = "Include Any Other Info Here";

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



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

// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################

// start navbar
$navbits = array(
"$phpfilename?$session[sessionurl]" => $formtitle
);

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

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

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

if ($formforum == "1") {
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "thread(title, lastpost, forumid, open, replycount,
postusername, postuserid, lastposter, dateline, iconid, visible, attach)
VALUES
('".addslashes(htmlspecialchars($bbuserinfo[username]))." / $normalanswer2', " . TIMENOW . ", $formforumid,
1, 0, '" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid],
'" . addslashes($bbuserinfo['username']) . "', " . TIMENOW . ", 0, 1,
0)
");
$thread['threadid'] = $DB_site->insert_id();
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "post
(threadid, title, username, userid, dateline, pagetext, allowsmilie,
showsignature, iconid, visible)
VALUES
($thread[threadid], '".addslashes(htmlspecialchars($bbuserinfo[username]))." / $normalanswer2',
'" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid], " . TIMENOW . ",
'" . addslashes($formsend) . "', 1, 1,
0, 1)
");
$post['postid'] = $DB_site->insert_id();
$DB_site->query("
UPDATE " . TABLE_PREFIX . "thread
SET firstpostid = $post[postid]
WHERE threadid = $thread[threadid]
");
$DB_site->query("
UPDATE " . TABLE_PREFIX . "forum
SET replycount = replycount + 1,
threadcount = threadcount + 1,
lastpost = " . TIMENOW . ",
lastposter = '" . addslashes($bbuserinfo['username']) . "',
lastthread = '".addslashes(htmlspecialchars($bbuserinfo[username]))." /$normalanswer2',
lastthreadid = $thread[threadid]
WHERE forumid = $formforumid
");
$forum[forumid] = $formforumid;
}

if ($formpoll == "1") {
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "poll (question,dateline,options,votes,active,numberopti ons,timeout,multiple,public) VALUES ('".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle'," . TIMENOW . ",'$formoption1|||$formoption2','" . addslashes("0|||0") . "',1,2,0,0,0)");
$pollid = $DB_site->insert_id();
$DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET pollid = '".$pollid."' WHERE threadid = '".$thread[threadid]."'");
}

if ($formreply == "1") {
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,pa getext,allowsmilie,showsignature,ipaddress,iconid, visible) VALUES (NULL,'$formreplythreadid','".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle','".addslashes($bbuserinfo[username])."','$bbuserinfo[userid]','".time()."','" . addslashes($formsend) . "','1','1','0','0','1')");
$DB_site->query("UPDATE thread SET replycount = replycount + 1, lastpost = " . TIMENOW . ", lastposter = '".addslashes($bbuserinfo[username])."' WHERE threadid = $formreplythreadid");
$DB_site->query("
UPDATE " . TABLE_PREFIX . "forum
SET replycount = replycount + 1,
lastpost = " . TIMENOW . ",
lastposter = '".addslashes(htmlspecialchars($bbuserinfo[username]))."',
lastthread = '" . addslashes($bbuserinfo['username']) . " $formtitle',
lastthreadid = $formreplythreadid
WHERE forumid = $formreplyforumid
");
$forum[forumid] = $formreplyforumid;
}

if ($formpm == "1") {
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pmtext\n\t(fromuserid, fromusername, title, message, touserarray, iconid, dateline, showsignature)\nVALUES\n\t($bbuserinfo[userid], '" . addslashes($bbuserinfo['username']) . "', '".addslashes(htmlspecialchars($formtitle))."', '".addslashes(htmlspecialchars($formsend))."', '" . addslashes(serialize($tostring)) . "', 0, " . TIMENOW . ", 1)");
$pmtextid = $DB_site->insert_id();
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pm (pmtextid, userid, messageread) VALUES ($pmtextid, $formpmid, 0)");
$DB_site->shutdown_query("UPDATE " . TABLE_PREFIX . "user SET pmtotal=pmtotal+1, pmunread=pmunread+1 WHERE userid = $formpmid");
}

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

if ($redirectoption == "1") {
$url = "showthread.php?$session[sessionurl]p=$post[postid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
if ($redirectoption == "2") {
$url = "showthread.php?$session[sessionurl]t=$thread[threadid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
if ($redirectoption == "3") {
$url = "forumdisplay.php?$session[sessionurl]f=$forum[forumid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
if ($redirectoption == "4") {
$url = "editpost.php?do=editpost&$session[sessionurl]p=$post[postid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
exit();
}
eval('print_output("' . fetch_template('tc_tradepostform') . '");');
?>

Form Template (I left out my custom skin template info)

<!-- main page contents -->

<form enctype="multipart/form-data" method="post" action="$phpfilename">
<input type="hidden" value="$userid" name="userid">
<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">
$formtitle
</td>
</tr>


<!-- Sale or Trade Start -->
<tr>
<td class="alt2" colspan="3"> <b><font color="#ff0000">$radioquestion1</font></b><br>
<INPUT TYPE="radio" NAME="radioanswer1" value="$radiochoice1a"> <b>$radiochoice1a</b> <INPUT TYPE="radio" NAME="radioanswer1" value="$radiochoice1b"> <b>$radiochoice1b</b> </td>
</tr>
<!-- Sale or Trade End -->

<!-- Blank Line -->
<tr>
<td class="alt1" valign="middle" height="25"></td>
</tr>
<!-- Blank Line End-->


<!-- Member #1 Start -->
<tr>
<td class="alt2" colspan="3">

<b><font color="#ff0000">What will $bbuserinfo[username] get?</font></b><br>


<textarea rows="5" cols="70" name="longanswer1"></textarea>
</td>
</tr>
<!-- Member #1 End -->

<!-- Blank Line -->
<tr>
<td class="alt1" valign="middle" height="25"></td>
</tr>
<!-- Blank Line End-->


<!-- Member #2 Start -->
<tr>
<td class="alt2" colspan="3"> <b><font color="#ff0000">Username of your trade/sale partner? (must be exact - please be careful)</font></b><br>



<input type="text" size="30" name="normalanswer2"><br><BR>


<b><font color="#ff0000">$longquestion2</font></b><br>


<textarea rows="5" cols="70" name="longanswer2"></textarea>
</td>
</tr>
<!-- Member #2 End -->

<!-- Blank Line -->
<tr>
<td class="alt1" valign="middle" height="25"></td>
</tr>
<!-- Blank Line End-->

<!-- Insurance Start -->
<tr>
<td class="alt2" colspan="3"> <b><font color="#ff0000"><b>$radioquestion2</b></font></b><br>
<INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2a"> <b>$radiochoice2a</b> <INPUT TYPE="radio" NAME="radioanswer2" value="$radiochoice2b"> <b>$radiochoice2b</b> </td>
</tr>
<!-- Insurance End End-->

<!-- Del Conf. Start -->
<tr>
<td class="alt2" colspan="3"> <b><font color="#ff0000">$radioquestion3</font></b><br>
<INPUT TYPE="radio" NAME="radioanswer3" value="$radiochoice3a"> <b>$radiochoice3a<b> <INPUT TYPE="radio" NAME="radioanswer3" value="$radiochoice3b"> <b>$radiochoice3b</b> </td>
</tr>
<!-- Del. Conf. End-->

<!-- Shipping Start -->
<tr>
<td class="alt2" colspan="3"> <b><font color="#ff0000">$radioquestion4</font></b><br>
<INPUT TYPE="radio" NAME="radioanswer4" value="$radiochoice4a"> <b>$radiochoice4a</b> <INPUT TYPE="radio" NAME="radioanswer4" value="$radiochoice4b"> <b>$radiochoice4b</b> <INPUT TYPE="radio" NAME="radioanswer4" value="$radiochoice4c"> <b>$radiochoice4c</b> </td>
</tr>
<!-- Shipping End-->

<!-- Blank Line -->
<tr>
<td class="alt1" valign="middle" height="25"></td>
</tr>
<!-- Blank Line End-->

<!-- Misc Info Start -->
<tr>
<td class="alt2" colspan="3">
<b><font color="#ff0000">$longquestion3</font></b><br>
<textarea rows="5" cols="70" name="longanswer3"></textarea>
</td>
</tr>
<!-- Misc Info End -->

<tr>
<td valign="top">
<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>
</td>
</tr>
</table>

</font>

</form>

<!-- / main page contents -->

Answer Template

This $radioanswer1 Is Between: $bbuserinfo[username] & $normalanswer2

Type Of Transaction: $radioanswer1

$radioquestion2: $radioanswer2

$radioquestion3: $radioanswer3

$radioquestion4: $radioanswer4

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

$bbuserinfo[username] gets:
$longanswer1

$normalanswer2 gets:
$longanswer2

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

Misc Information:
$longanswer3

The answer template has bb code because I have this directed to post to a forum.
Chris,

Thank you so much for your time and effort. I really appreciate this. I'm going to give this a shot later tonight.

ChrisBaktis
03-18-2005, 12:18 PM
your welcome

kisersose
03-20-2005, 06:06 PM
Parse error: parse error, unexpected T_STRING in /home/****/public_html/forum/form.php on line 137

i keep getting this or another line.............. AND I DID EVERYTHING CORRECT PLEASE HELp!!!1

org
03-29-2005, 09:32 PM
This is exactly the reason I needed to take the leap into converting an existing website (+12000 companies and +3000 active members) into vBulletin. Again thank you Erwin!

agiacosa
03-30-2005, 11:56 AM
This is exactly the reason I needed to take the leap into converting an existing website (+12000 companies and +3000 active members) into vBulletin. Again thank you Erwin!
I am trying to use the redirect to edit post feature. I need the user tobe able to attach and excel spreadsheet when they respond and that is added as a post to an existing thread.

When I hit submit, I get an error: No Post Specified.

What is going wrong?

Erwin
03-31-2005, 01:13 AM
I am trying to use the redirect to edit post feature. I need the user tobe able to attach and excel spreadsheet when they respond and that is added as a post to an existing thread.

When I hit submit, I get an error: No Post Specified.

What is going wrong?
Not sure, as it obviously works for other people.... mmm... the postid is not being passed for some reason...

agiacosa
03-31-2005, 01:16 PM
Not sure, as it obviously works for other people.... mmm... the postid is not being passed for some reason...
I have Dani's mod-rewrite hack. Could that be causing the problem?

Erwin
04-01-2005, 11:05 AM
I have Dani's mod-rewrite hack. Could that be causing the problem?
That's it.

agiacosa
04-01-2005, 02:54 PM
That's it.
Great! I was afraid of that. :-(

wynode
04-03-2005, 07:07 AM
*clicks install*

I was actually looking for a very simple form tool for something else.......and came across this.

Now I ran into some other problem on my forum and this is going to help resovle that problem.

Great work!

gldtn
04-11-2005, 03:27 PM
Erwin,

I installed this hack and it works fine, but there is a couple of things I would like to do that I don't quite know how. So I was wondering if you or anyone here could share a bit of your knowledge w/ me.

First; I wanted to be able to let me users to set thier own title to the thread.
Second; I want the form to be executed only when someone click on newthread on a certain forum.

I have a basic idea on how this could be done, but yet don't know how, and for the second option I know I would probably have to edit my showthread template and add an if statement along with some php file editing, but that won't be a problem if someone can provide me the code.

Thanks a Lot!

Erwin
04-13-2005, 10:10 PM
Erwin,

I installed this hack and it works fine, but there is a couple of things I would like to do that I don't quite know how. So I was wondering if you or anyone here could share a bit of your knowledge w/ me.

First; I wanted to be able to let me users to set thier own title to the thread.
Second; I want the form to be executed only when someone click on newthread on a certain forum.

I have a basic idea on how this could be done, but yet don't know how, and for the second option I know I would probably have to edit my showthread template and add an if statement along with some php file editing, but that won't be a problem if someone can provide me the code.

Thanks a Lot!
1. You need to edit the PHP file and replace the title variable with a form variable. Not hard to figure out if you take a look at the code itself.

2. That's just a template edit. Somewhere in this thread someone posted a way to do this already.

datainternet
04-17-2005, 05:41 PM
Hi Erwin,

1. In the form.php - file there is an option called "REDIRECT OPTIONS:". There you can choose Option 0 to show a thank you message.

Now my question: Is it possibly to show this message AND redirect after some seconds to another page?

I need this for this hack by mtha: https://vborg.vbsupport.ru/showpost.php?p=641989&postcount=131

Would be nice if you could help me :).

MFG datainternet

Erwin
04-19-2005, 11:14 AM
Hi Erwin,

1. In the form.php - file there is an option called "REDIRECT OPTIONS:". There you can choose Option 0 to show a thank you message.

Now my question: Is it possibly to show this message AND redirect after some seconds to another page?

I need this for this hack by mtha: https://vborg.vbsupport.ru/showpost.php?p=641989&postcount=131

Would be nice if you could help me :).

MFG datainternet
Anything is possible. :) You just add a redirect javascript to the template for the redirect I think.

gldtn
04-19-2005, 02:23 PM
1. You need to edit the PHP file and replace the title variable with a form variable. Not hard to figure out if you take a look at the code itself.

2. That's just a template edit. Somewhere in this thread someone posted a way to do this already.
Thanks, I got it to working the way I wanted to.. Sorry for not reading the whole thread at first. I was at work at the time.

whelck
04-20-2005, 12:54 AM
Excellent work, Erwin. I've installed and it works great.

datainternet
04-21-2005, 01:10 PM
Anything is possible. :) You just add a redirect javascript to the template for the redirect I think.

Hi thank for help, but I didn't get ahead yet.

The problem is that there is no template for the redirect, it's only this line in the php file:

$redirectoption = "0";

$errormessage = "Thanks!"; //This is the thank you message

You see that the hack by mtha is based on this hack.

Could you help me please?

Sorry but I'm just a beginner in php :(.

MFG datainternet

deb0
04-27-2005, 03:32 AM
Nice work, no issues. i haven't tried the customization yet, but basic installation of flawless.

thx; Install!

SirJonathan
04-27-2005, 05:51 PM
Has anyone had problems with the form not posting? I am using the form for a membership application on my site and using it to process 12 or so different questions. I've had a number of people say that they've submitted the form and then it never shows up in the approval area..

Anyone else had any trouble with this? Any suggestions?

-Jonathan

SirJonathan
05-02-2005, 03:38 PM
I've had a couple more problems with this and its quite discouraging for the membership.. any ideas on why it would not actually be posting when people submit?

-Jonathan

Erwin
05-03-2005, 03:21 AM
I've had a couple more problems with this and its quite discouraging for the membership.. any ideas on why it would not actually be posting when people submit?

-Jonathan
It could be a million things. When you added questions, did you add the corresponding variables? You need to have a basic grasp of PHP to add more questions.

SirJonathan
05-04-2005, 06:59 PM
Yes :). I added all the variables and for most people it works great. There are just some who have filled it all out, post, and it never shows up in the forum.

I've worked on the permissions and I'm pretty sure its not that.. You are required to register before you access the form. Can you think of any reasons why it would work for most people and then not for some?

-Jonathan

Razasharp
05-06-2005, 02:39 PM
Hi Erwin

Great hack!

I hope you can help me :-)

Is there anyway to modify the hack so that I can have 3 form fields for the TITLE? I dont actually need to make use of the full hack as all I am trying to do it 'force' people to add certain things in the titles of one particular forum (which uses a seperate style so no probs in modifying it's templates).

so for eg I could have 3:

Field 1 [item for sale]: Grandfather clock

Field 2 [price]: ?400

Field 3 [city]: London

then the title for that thread would read: Grandfather clock ?400 London

In the threadbit template I did try to copy/duplicate:


<!-- subject field -->
<table cellpadding="0" cellspacing="0" border="0" class="fieldset">
<tr>
<td class="smallfont" colspan="3">$vbphrase[title]:</td>
</tr>
<tr>
<td><input type="text" class="bginput" name="subject" value="$subject" size="40" maxlength="85" tabindex="1" /></td>
<td>&nbsp;&nbsp;</td>
<td><img id="display_posticon" src="$selectedicon[src]" alt="$selectedicon[alt]" /></td> </tr>
</table>
<!-- / subject field -->

but it only 'took' what was placed in the second field :-(

Would really appreciate some help on this..
Thanks in advance.

Spinball
05-07-2005, 06:08 PM
Razasharp,
you need to input 3 fields - lets name them subject1, subject2 and subject3.
Then you'll need to edit the php script which processes your forum to set the subject
$subject = $subject1 . " " . $subject2 . " " . $subject3;
I would put some validation in there, too, to make sure they entered all 3 fields.

Spinball
05-07-2005, 08:50 PM
Erwin, I'm trying to integrate the standard vB posting message box with smilies and BBcode stuff etc.
I've had a stab based on the goings on in newthread.php and the newthread template, and have nearly got it going.
In the template I added $messagearea.
And in my form.php I added
$phrasegroups = array('threadmanage', 'posting');
$specialtemplates = array(
'bbcodecache'
);
require_once('./includes/functions_newpost.php');
require_once('./includes/functions_editor.php');
require_once('./includes/functions_bigthree.php');

near the top and at the bottom
construct_edit_toolbar($newpost['message'], 0, $foruminfo['forumid'], $foruminfo['allowsmilies']);

just before

eval('print_output("' . fetch_template('form_new') . '");');


The only problem is that the buttons (e.g. the B (bold) button) don't highlight when mouse overed and when clicking them, nothing happens.
Submitting the forum works ok using $message.
Can you help at all?

Erwin
05-10-2005, 02:31 AM
Erwin, I'm trying to integrate the standard vB posting message box with smilies and BBcode stuff etc.
I've had a stab based on the goings on in newthread.php and the newthread template, and have nearly got it going.
In the template I added $messagearea.
And in my form.php I added
$phrasegroups = array('threadmanage', 'posting');
$specialtemplates = array(
'bbcodecache'
);
require_once('./includes/functions_newpost.php');
require_once('./includes/functions_editor.php');
require_once('./includes/functions_bigthree.php');

near the top and at the bottom
construct_edit_toolbar($newpost['message'], 0, $foruminfo['forumid'], $foruminfo['allowsmilies']);

just before

eval('print_output("' . fetch_template('form_new') . '");');


The only problem is that the buttons (e.g. the B (bold) button) don't highlight when mouse overed and when clicking them, nothing happens.
Submitting the forum works ok using $message.
Can you help at all?
Ahhh... :) I wish I had time to look into that, but I don't. It's to do with the javascript files - make sure they are included. And they are being referred to correctly.

Bubble #5
05-13-2005, 03:58 AM
We are using the standard form.txt but our submit and reset buttons won't center. No matter what we try to do they stay left aligned :( Is there anyway that we can fix this?

specting
05-18-2005, 11:51 AM
Hello Guys:

I'm a starting user that need to instal this hack and have several questions:

- I have add the templates but I don't not How can I applied this templates to one Sub-forum? We have several subjects and each sub-forum has a diferent forms.

- In other hand we have several kinds of users: Administrator, moderator and standar user. We wnat that this form will be only applied to the standar users. How might I configurated the privileges?

Thank you very much fro your help in advance.

Javi.

DogGunn
06-02-2005, 09:21 AM
I just get a blank screen.. Help?

Marco van Herwaarden
06-02-2005, 12:47 PM
I just get a blank screen.. Help?Double check your edits and use a good editor.

mustang_lex
06-02-2005, 01:33 PM
I think this may be the answer to my questions.

Can this hack incorporate a photo upload requirement as well?

Erwin
06-02-2005, 11:29 PM
I think this may be the answer to my questions.

Can this hack incorporate a photo upload requirement as well?
There is a way to do it where you can add attachments via an edit.

mustang_lex
06-03-2005, 09:17 PM
Ok. cool. how? :nervous:

mustang_lex
06-04-2005, 01:13 AM
I don't get it i got a blank page. :ermm:

mustang_lex
06-04-2005, 01:14 AM
I just get a blank screen.. Help?

Ya I did too??????????

mustang_lex
06-04-2005, 01:19 PM
OK, now that I admit I'm new at this hacking thing, when you say add these templates you actually have to add them in Admin CP. Since I did that. Its all working great. Now I need to cusomize it. Here goes nothing :speechless:

mustang_lex
06-05-2005, 11:44 PM
My form works great. Once question. My form is asking questions that the member may have entered in their profile. Such as hobbies for example. How can I have the text field that they will fill in on the form (such as hobbies) default to having the same text in their profile?

Erwin
06-06-2005, 12:06 AM
My form works great. Once question. My form is asking questions that the member may have entered in their profile. Such as hobbies for example. How can I have the text field that they will fill in on the form (such as hobbies) default to having the same text in their profile?
In the variable for the answer, put down $bbuserinfo[fieldx] where fieldx is the custom profile field number.

mustang_lex
06-06-2005, 05:20 PM
Awesome!!! i added value="$bbuserinfo[field7]" To my input fields (changing the fieldID) and its cool. When the person opens the app. if the questions were allready filled out in their profile, it will be automatically added in each text field. This ROCKS!!!!! Thanks

mustang_lex
06-06-2005, 05:26 PM
I would like to incorporate an upload field. Is this possible. When the person submits, the photo is uploaded to a folder on the server, and the file title is displayed in the formanswer (mine inwhich is submitted to a group)

paul41598
06-07-2005, 07:44 PM
Is it possible to put a form (this form) somehow in a new thread, and then users can view that thread, choose all the selections, submit it, and then write it out to a new thread? Almost like a question form in a thread, and then the results goto a result thread.

Spinball
06-08-2005, 01:39 PM
Erwin,
do you think it would be possible to add the code to subscribe people to new threads if they have automatic subscriptions switched on?
For our use - the creation of classified adverts - it's particularly needed.
Thanks

paul41598
06-08-2005, 07:19 PM
I have figured out a way to do dropdowns if anyone is interested

Cyricx
06-13-2005, 12:57 PM
Hmmm, found a bug, when a user fills out a form and uses a ' like

Suzuhara's

It gives an invalid sql error

Database error in vBulletin 3.0.7:

Invalid SQL:
INSERT INTO vb3_thread(title, lastpost,
forumid, open, replycount,
postusername, postuserid, lastposter,
dateline, iconid, visible, attach)
VALUES
('Aged bowman Requests
Suzuhara's Care Package', 1118670743, 176,
1, 0, 'Aged bowman', 593,
'Aged bowman', 1118670743, 0,
1,
0)

mysql error: You have an error in your SQL syntax near 's Care
Package', 1118670743, 176,
1, 0,' at line 5

mysql error number: 1064

Spinball
06-13-2005, 01:11 PM
Cyricx,
do you see $formtitle in the following bit of the hack where it inserts the thread?
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "thread(title, lastpost, forumid, open, replycount,
postusername, postuserid, lastposter, dateline, iconid, visible, attach)
VALUES ('".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle', " . TIMENOW . ", $formforumid,1, 0, '" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid],
'" . addslashes($bbuserinfo['username']) . "', " . TIMENOW . ", 0, 1,
0)
");
well if you put " . addslashes($formtitle) . " instead, this will fix it.
Try it and see if it still breaks when you use a quote in the title.

mustang_lex
06-14-2005, 07:25 PM
Although this bug hasn't been picked up by me yet. I like to fix it. and I have no clue what you ment at the last post spinball, Please send details. Thanks

Spinball
06-15-2005, 08:33 AM
Although this bug hasn't been picked up by me yet. I like to fix it. and I have no clue what you ment at the last post spinball, Please send details. Thanks
Sorry but I can't teach you PHP. I suggest you buy a PHP and MySQL book (http://www.sitepoint.com/books/phpmysql1/) and learn it like I did. It will serve you well to best maintain your forum.

jeepinaround
06-15-2005, 08:35 PM
Ok I had this working at one point in time. Some of the modifications I have done is...
Having the first question answered as the title to the thread
The option to redirect to the form when posting a new thread

For some reason now when you fill out the form and hit submit it creates a new thread with the answer to the first question as the title but nothing in the actual post it is blank other than a signature. I took all day from work and read every page of this thread and did not find a similiar problem. Does anybody have any ideas? The only thing I can think of that I did was upgrade to 3.0.7 since I originally had this working.

sdsvtdriver
06-16-2005, 04:51 AM
I'd like to change the subject to be, say the answer to normal question1. how easy is this to change?

jeepinaround
06-16-2005, 12:12 PM
It was easy, just some code to change. It is posted in this thread some where.

GiJoe
06-17-2005, 02:05 AM
I have figured out a way to do dropdowns if anyone is interested

Yes :nervous:

MrTchMan
06-18-2005, 04:47 PM
I am having a problem. I have set up the form to require all information to be filled in. I was testing it out and if I complete the form it would give me a error message. When I hot the back button the error message stays up and I have to refresh the form before it will come back up and I loose all the information. Any Ideas???

Thanks

jeepinaround
06-20-2005, 05:06 PM
Can no one help me out? After filling out the form I get a blank thread. No errors or anything.

Marco van Herwaarden
06-20-2005, 07:49 PM
Please double check edits/templates.

midnightz
06-20-2005, 09:14 PM
Hello

I also believe in theory it would be easy to add a browse feature and then it could upload a file (lets say banner) into a directory in forums (ie forums/banners/)

Thank you - this is the last tweak I need for this to be perfect!

jeepinaround
06-20-2005, 11:07 PM
Yeah I triple checked everything and no luck so I had to take it off. I didn't really want to as when it was working it was exactly what I needed. To me it seems as though it quit working when I upgraded to 3.0.7. No way to prove it and I am moderate at coding php. I can get around it and see things that I wouldn't have just 1 year ago but still no luck with this mod. Still if anyone has any suggestions please post them as I would love for this to work again. I just needed to make the forum so people could at least post in it.

MrTchMan
06-21-2005, 01:15 PM
I am having a problem. I have set up the form to require all information to be filled in. I was testing it out and if I complete the form it would give me a error message. When I hot the back button the error message stays up and I have to refresh the form before it will come back up and I loose all the information. Any Ideas???

Thanks


Anyone have any ideas?

midnightz
06-21-2005, 01:42 PM
Anyone have any ideas?

On line 137


//FORCE USER TO ANSWER ALL QUESTIONS - 1 = yes, 0 = no
////////////////////////////////////////////////////////////////////////////////////////////////////

$answerall = "0";

Change 0 to variable 1.

and make sure you have all created fields (lets say answer 9) in form / form answers / and inside the php file and bottom code on line 234 to 235

where it says:

if ($answerall == "1") {
if ($normalanswer1 == '' OR $radioanswer1 == '' OR $radioanswer2 == etc....

MrTchMan
06-21-2005, 02:00 PM
On line 137


//FORCE USER TO ANSWER ALL QUESTIONS - 1 = yes, 0 = no
////////////////////////////////////////////////////////////////////////////////////////////////////

$answerall = "0";

Change 0 to variable 1.

and make sure you have all created fields (lets say answer 9) in form / form answers / and inside the php file and bottom code on line 234 to 235

where it says:

if ($answerall == "1") {
if ($normalanswer1 == '' OR $radioanswer1 == '' OR $radioanswer2 == etc....

Here is my form.php I have that option checked. It does requre me to fill out all info but when a user doesn't it gives them the error message and when they hit back it doesn't go back. Maybe I am over looking something. THanks in advance

<?php

/*================================================= =====================*\
|| ################################################## ################## ||
|| # FORM TO THREAD/ FORUM/ PM/ EMAIL - Totally CUSTOMIZABLE FORMS # ||
|| # Version 1.6 for vBulletin 3.x.x by Dr Erwin Loh # ||
|| # ---------------------------------------------------------------- # ||
|| # Copyright ?2000?2004 Dr Erwin Loh. All Rights Reserved. # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| ################################################## ################## ||
\*================================================ ======================*/

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

$globaltemplates = array(
'form',
'formanswers'
);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

globalize($_POST, array(
'normalanswer1' => STR,
'answer1' => STR,
'answer2' => STR,
'answer3' => STR,
'answer4' => STR,
'answer5' => STR,
'answer6' => STR,
'answer7' => STR,
'answer8' => STR,
'answer9' => STR,
'answer10' => STR,
'answer11' => STR,
'longanswer1' => STR,
'action' => STR
));

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//USERGROUPS ALLOWED
//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array
////////////////////////////////////////////////////////////////////////////////////////////////////

if (!in_array($bbuserinfo['usergroupid'], array(2,5,6,7,9,10))) print_no_permission();

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NAME OF THIS PHP FILE AND TEMPLATES - DO THIS BIT IF YOU ARE MAKING MORE FORMS!
//You can easily make more forms by just copying this file, renaming it, and modifying the variable in
//this file. You can keep the same templates for different forms. For more customization, you can
//use different templates, by renaming and modifying the templates.
////////////////////////////////////////////////////////////////////////////////////////////////////

// Name of this file
$phpfilename = "form.php";

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

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

//ENABLE POLL TO BE CREATED - 1 = yes, 0 = no
$formpoll = "0";
$formoption1 = "Yes";
$formoption2 = "No";

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

//ENABLE FORM TO REPLY TO EXISTING THREAD
$formreply = "0";

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

//FORUM ID WHERE THE EXISTING THREAD IS IN
$formreplyforumid = "456";

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

//ENABLE FORM TO BE PMED - 1 = yes, 0 = no
$formpm = "0";

//USERID TO PM TO
$formpmid = "1";

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

//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
// 1 - redirect to post
// 2 - redirect to thread
// 3 - redirect to forum
// 4 - redirect to editpost to upload attachments
//
// Feel free to change the thank you message if you choose option 0
////////////////////////////////////////////////////////////////////////////////////////////////////

$redirectoption = "4";

$errormessage = "Thank you for submitting this form!"; //This is the thank you message

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//FORCE USER TO ANSWER ALL QUESTIONS - 1 = yes, 0 = no
////////////////////////////////////////////////////////////////////////////////////////////////////

$answerall = "1";

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

$formtitle = "Trading Post Form";

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

$formpurpose = "The purpose of this form is to create a standard way of entering items for sale in the flea market. If you item is not a cell phone please put a N/A in all fields that don't apply to you, and then post all your details in the additional details section";

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

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

$normalquestion1 = "What is the title of your thread?";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//QUESTION 1 (do not use quotation marks or you will get a parse error)
$question1 = "What is your asking price?";
$explain1 = "Please enter a asking price. If it is a trade specify what you are looking for";

//QUESTION 2 (do not use quotation marks or you will get a parse error)
$question2 = "What color is the item";
$explain2 = "Please enter the color of the item.";

//QUESTION 3 (do not use quotation marks or you will get a parse error)
$question3 = "What is included?";
$explain3 = "Please let people know what is included with your item";

//QUESTION 4 (do not use quotation marks or you will get a parse error)
$question4 = "What Service Provider?";
$explain4 = "List the networks this phone has been used or tested on.";

//QUESTION 5 (do not use quotation marks or you will get a parse error)
$question5 = "What is the life timer?";
$explain5 = "Please enter your life time here. For sprint phones press ##786#";

//QUESTION 6 (do not use quotation marks or you will get a parse error)
$question6 = "What is the condition of the item?";
$explain6 = "Item Condition.";

//QUESTION 7 (do not use quotation marks or you will get a parse error)
$question7 = "Do you have pictures?";
$explain7 = "If you have pictures post them in additional details box via the [img] code or click submit and add an attachment";

//QUESTION 8 (do not use quotation marks or you will get a parse error)
$question8 = "What is the location you are shipping from?";
$explain8 = "Please enter a location.";

//QUESTION 9 (do not use quotation marks or you will get a parse error)
$question9 = "What is your shipping method";
$explain9 = "Shipping terms and how will you ship. Please inlcude Price.";

//QUESTION 10 (do not use quotation marks or you will get a parse error)
$question10 = "What Payment methods do you accept?";
$explain10 = "Please list preferred payment methods";

//QUESTION 11 (do not use quotation marks or you will get a parse error)
$question11 = "How can users contact you?";
$explain11 = "Contact Information";

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

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

$longquestion1 = "What are your additional details?.";
$longexplain1 = "Please use this area to enter more details. (i.e. Why you are selling) You can also use this space to put in any information that you could not in the above questions. Like items other than cell phones.";

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

// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################

// start navbar
$navbits = array(
"$phpfilename?$session[sessionurl]" => $formtitle
);

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

if ($action=="submit") {

if ($answerall == "1") {
if ($normalanswer1 == '' OR $answer1 == '' OR $answer2 == '' OR $answer3 == '' OR $answer4 == '' OR $answer5 == '' OR $answer6 == '' OR $answer7 == '' OR $answer8 == '' OR $answer9 == '' OR $answer10 == '' OR $answer11 == '' OR $longanswer1 == '' OR $ad_agree <> 'Confirmed')
{
$errormessage = "Please complete all the information on the classified submission form and agree that you have read and abide by the trading rules.<br>Press the Back button to return to the form.";
eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
exit();
}
}

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

if ($formforum == "1") {
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "thread(title, lastpost, forumid, open, replycount,
postusername, postuserid, lastposter, dateline, iconid, visible, attach)
VALUES
('normalanswer1', " . TIMENOW . ", $formforumid,
1, 0, '" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid],
'" . addslashes($bbuserinfo['username']) . "', " . TIMENOW . ", 0, 1,
0)
");
$thread['threadid'] = $DB_site->insert_id();
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "post
(threadid, title, username, userid, dateline, pagetext, allowsmilie,
showsignature, iconid, visible)
VALUES
($thread[threadid], '$normalanswer1',
'" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid], " . TIMENOW . ",
'" . addslashes($formsend) . "', 1, 1,
0, 1)
");
$post['postid'] = $DB_site->insert_id();
$DB_site->query("
UPDATE " . TABLE_PREFIX . "thread
SET firstpostid = $post[postid]
WHERE threadid = $thread[threadid]
");
$DB_site->query("
UPDATE " . TABLE_PREFIX . "forum
SET replycount = replycount + 1,
threadcount = threadcount + 1,
lastpost = " . TIMENOW . ",
lastposter = '" . addslashes($bbuserinfo['username']) . "',
lastthread = '$normalanswer1',
lastthreadid = $thread[threadid]
WHERE forumid = $formforumid
");
$DB_site->query("
UPDATE " . TABLE_PREFIX . "user
SET posts = posts + 1
WHERE userid = $bbuserinfo[userid]
");
$forum[forumid] = $formforumid;
}

if ($formpoll == "1") {
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "poll (question,dateline,options,votes,active,numberopti ons,timeout,multiple,public) VALUES ('$normalanswer1'," . TIMENOW . ",'$formoption1|||$formoption2','" . addslashes("0|||0") . "',1,2,0,0,0)");
$pollid = $DB_site->insert_id();
$DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET pollid = '".$pollid."' WHERE threadid = '".$thread[threadid]."'");
}

if ($formreply == "1") {
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,pa getext,allowsmilie,showsignature,ipaddress,iconid, visible) VALUES (NULL,'$formreplythreadid','$normalanswer1','".addslashes($bbuserinfo[username])."','$bbuserinfo[userid]','".time()."','" . addslashes($formsend) . "','1','1','0','0','1')");
$DB_site->query("UPDATE thread SET replycount = replycount + 1, lastpost = " . TIMENOW . ", lastposter = '".addslashes($bbuserinfo[username])."' WHERE threadid = $formreplythreadid");
$DB_site->query("
UPDATE " . TABLE_PREFIX . "forum
SET replycount = replycount + 1,
lastpost = " . TIMENOW . ",
lastposter = '".addslashes(htmlspecialchars($bbuserinfo[username]))."',
lastthread = '" . addslashes($bbuserinfo['username']) . " $formtitle',
lastthreadid = $formreplythreadid
WHERE forumid = $formreplyforumid
");
$DB_site->query("
UPDATE " . TABLE_PREFIX . "user
SET posts = posts + 1
WHERE userid = $bbuserinfo[userid]
");
$forum[forumid] = $formreplyforumid;
}

if ($formpm == "1") {
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pmtext\n\t(fromuserid, fromusername, title, message, touserarray, iconid, dateline, showsignature)\nVALUES\n\t($bbuserinfo[userid], '" . addslashes($bbuserinfo['username']) . "', '".addslashes(htmlspecialchars($formtitle))."', '".addslashes(htmlspecialchars($formsend))."', '" . addslashes(serialize($tostring)) . "', 0, " . TIMENOW . ", 1)");
$pmtextid = $DB_site->insert_id();
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pm (pmtextid, userid, messageread) VALUES ($pmtextid, $formpmid, 0)");
$DB_site->shutdown_query("UPDATE " . TABLE_PREFIX . "user SET pmtotal=pmtotal+1, pmunread=pmunread+1 WHERE userid = $formpmid");
}

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

if ($redirectoption == "1") {
$url = "showthread.php?$session[sessionurl]p=$post[postid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
if ($redirectoption == "2") {
$url = "showthread.php?$session[sessionurl]t=$thread[threadid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
if ($redirectoption == "3") {
$url = "forumdisplay.php?$session[sessionurl]f=$forum[forumid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
if ($redirectoption == "4") {
$url = "editpost.php?do=editpost&$session[sessionurl]p=$post[postid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
exit();
}
eval('print_output("' . fetch_template('form') . '");');
?>

paul41598
06-21-2005, 03:15 PM
Here is a documentation I wrote up for anyone who wants dropdowns as well, in their forms. ;)


Good luck, and enjoy!

bluesteel
06-22-2005, 09:39 PM
Hi Erwin,

Great hack! Very flexible and just what I was looking for. Thanks!

I have a question for either your good self, or anyone else who might like to reply.

Is there a line of code or something that I can add to the form.php file that puts the new thread in the ACP Thread Moderation queue? I have the specific forum that the new thread is created in set for new Threads to be Moderated, but the form.php ignores this and posts.
If you know what I mean! :squareeyed:

Thanks in advance for any help that may be forthcoming guys.

Alan

jaredvolkl
06-24-2005, 09:06 PM
Hi Erwin,

Great hack! Very flexible and just what I was looking for. Thanks!

I have a question for either your good self, or anyone else who might like to reply.

Is there a line of code or something that I can add to the form.php file that puts the new thread in the ACP Thread Moderation queue? I have the specific forum that the new thread is created in set for new Threads to be Moderated, but the form.php ignores this and posts.
If you know what I mean! :squareeyed:

Thanks in advance for any help that may be forthcoming guys.

Alan

This is exactly what I need to do. I have a forum that I'd like new threads posted to go into moderation when they are posted through this form. I've tried setting the visible value to 0 which gets pushed to both post and thread, but that was no help.

Marcus Lau
06-27-2005, 12:57 PM
Erwin ... nin bei dan sibei gu liao! Thanks Erwin and God Bless You Richly!

MrTchMan
06-27-2005, 11:59 PM
Anyone? Please?


Here is my form.php I have that option checked. It does requre me to fill out all info but when a user doesn't it gives them the error message and when they hit back it doesn't go back. Maybe I am over looking something. THanks in advance

<?php

/*================================================= =====================*\
|| ################################################## ################## ||
|| # FORM TO THREAD/ FORUM/ PM/ EMAIL - Totally CUSTOMIZABLE FORMS # ||
|| # Version 1.6 for vBulletin 3.x.x by Dr Erwin Loh # ||
|| # ---------------------------------------------------------------- # ||
|| # Copyright ?2000?2004 Dr Erwin Loh. All Rights Reserved. # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| ################################################## ################## ||
\*================================================ ======================*/

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

$globaltemplates = array(
'form',
'formanswers'
);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

globalize($_POST, array(
'normalanswer1' => STR,
'answer1' => STR,
'answer2' => STR,
'answer3' => STR,
'answer4' => STR,
'answer5' => STR,
'answer6' => STR,
'answer7' => STR,
'answer8' => STR,
'answer9' => STR,
'answer10' => STR,
'answer11' => STR,
'longanswer1' => STR,
'action' => STR
));

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//USERGROUPS ALLOWED
//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array
////////////////////////////////////////////////////////////////////////////////////////////////////

if (!in_array($bbuserinfo['usergroupid'], array(2,5,6,7,9,10))) print_no_permission();

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//NAME OF THIS PHP FILE AND TEMPLATES - DO THIS BIT IF YOU ARE MAKING MORE FORMS!
//You can easily make more forms by just copying this file, renaming it, and modifying the variable in
//this file. You can keep the same templates for different forms. For more customization, you can
//use different templates, by renaming and modifying the templates.
////////////////////////////////////////////////////////////////////////////////////////////////////

// Name of this file
$phpfilename = "form.php";

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

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

//ENABLE POLL TO BE CREATED - 1 = yes, 0 = no
$formpoll = "0";
$formoption1 = "Yes";
$formoption2 = "No";

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

//ENABLE FORM TO REPLY TO EXISTING THREAD
$formreply = "0";

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

//FORUM ID WHERE THE EXISTING THREAD IS IN
$formreplyforumid = "456";

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

//ENABLE FORM TO BE PMED - 1 = yes, 0 = no
$formpm = "0";

//USERID TO PM TO
$formpmid = "1";

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

//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
// 1 - redirect to post
// 2 - redirect to thread
// 3 - redirect to forum
// 4 - redirect to editpost to upload attachments
//
// Feel free to change the thank you message if you choose option 0
////////////////////////////////////////////////////////////////////////////////////////////////////

$redirectoption = "4";

$errormessage = "Thank you for submitting this form!"; //This is the thank you message

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//FORCE USER TO ANSWER ALL QUESTIONS - 1 = yes, 0 = no
////////////////////////////////////////////////////////////////////////////////////////////////////

$answerall = "1";

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

$formtitle = "Trading Post Form";

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

$formpurpose = "The purpose of this form is to create a standard way of entering items for sale in the flea market. If you item is not a cell phone please put a N/A in all fields that don't apply to you, and then post all your details in the additional details section";

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

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

$normalquestion1 = "What is the title of your thread?";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//QUESTION 1 (do not use quotation marks or you will get a parse error)
$question1 = "What is your asking price?";
$explain1 = "Please enter a asking price. If it is a trade specify what you are looking for";

//QUESTION 2 (do not use quotation marks or you will get a parse error)
$question2 = "What color is the item";
$explain2 = "Please enter the color of the item.";

//QUESTION 3 (do not use quotation marks or you will get a parse error)
$question3 = "What is included?";
$explain3 = "Please let people know what is included with your item";

//QUESTION 4 (do not use quotation marks or you will get a parse error)
$question4 = "What Service Provider?";
$explain4 = "List the networks this phone has been used or tested on.";

//QUESTION 5 (do not use quotation marks or you will get a parse error)
$question5 = "What is the life timer?";
$explain5 = "Please enter your life time here. For sprint phones press ##786#";

//QUESTION 6 (do not use quotation marks or you will get a parse error)
$question6 = "What is the condition of the item?";
$explain6 = "Item Condition.";

//QUESTION 7 (do not use quotation marks or you will get a parse error)
$question7 = "Do you have pictures?";
$explain7 = "If you have pictures post them in additional details box via the [img] code or click submit and add an attachment";

//QUESTION 8 (do not use quotation marks or you will get a parse error)
$question8 = "What is the location you are shipping from?";
$explain8 = "Please enter a location.";

//QUESTION 9 (do not use quotation marks or you will get a parse error)
$question9 = "What is your shipping method";
$explain9 = "Shipping terms and how will you ship. Please inlcude Price.";

//QUESTION 10 (do not use quotation marks or you will get a parse error)
$question10 = "What Payment methods do you accept?";
$explain10 = "Please list preferred payment methods";

//QUESTION 11 (do not use quotation marks or you will get a parse error)
$question11 = "How can users contact you?";
$explain11 = "Contact Information";

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

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

$longquestion1 = "What are your additional details?.";
$longexplain1 = "Please use this area to enter more details. (i.e. Why you are selling) You can also use this space to put in any information that you could not in the above questions. Like items other than cell phones.";

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

// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################

// start navbar
$navbits = array(
"$phpfilename?$session[sessionurl]" => $formtitle
);

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

if ($action=="submit") {

if ($answerall == "1") {
if ($normalanswer1 == '' OR $answer1 == '' OR $answer2 == '' OR $answer3 == '' OR $answer4 == '' OR $answer5 == '' OR $answer6 == '' OR $answer7 == '' OR $answer8 == '' OR $answer9 == '' OR $answer10 == '' OR $answer11 == '' OR $longanswer1 == '' OR $ad_agree <> 'Confirmed')
{
$errormessage = "Please complete all the information on the classified submission form and agree that you have read and abide by the trading rules.<br>Press the Back button to return to the form.";
eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
exit();
}
}

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

if ($formforum == "1") {
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "thread(title, lastpost, forumid, open, replycount,
postusername, postuserid, lastposter, dateline, iconid, visible, attach)
VALUES
('normalanswer1', " . TIMENOW . ", $formforumid,
1, 0, '" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid],
'" . addslashes($bbuserinfo['username']) . "', " . TIMENOW . ", 0, 1,
0)
");
$thread['threadid'] = $DB_site->insert_id();
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "post
(threadid, title, username, userid, dateline, pagetext, allowsmilie,
showsignature, iconid, visible)
VALUES
($thread[threadid], '$normalanswer1',
'" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid], " . TIMENOW . ",
'" . addslashes($formsend) . "', 1, 1,
0, 1)
");
$post['postid'] = $DB_site->insert_id();
$DB_site->query("
UPDATE " . TABLE_PREFIX . "thread
SET firstpostid = $post[postid]
WHERE threadid = $thread[threadid]
");
$DB_site->query("
UPDATE " . TABLE_PREFIX . "forum
SET replycount = replycount + 1,
threadcount = threadcount + 1,
lastpost = " . TIMENOW . ",
lastposter = '" . addslashes($bbuserinfo['username']) . "',
lastthread = '$normalanswer1',
lastthreadid = $thread[threadid]
WHERE forumid = $formforumid
");
$DB_site->query("
UPDATE " . TABLE_PREFIX . "user
SET posts = posts + 1
WHERE userid = $bbuserinfo[userid]
");
$forum[forumid] = $formforumid;
}

if ($formpoll == "1") {
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "poll (question,dateline,options,votes,active,numberopti ons,timeout,multiple,public) VALUES ('$normalanswer1'," . TIMENOW . ",'$formoption1|||$formoption2','" . addslashes("0|||0") . "',1,2,0,0,0)");
$pollid = $DB_site->insert_id();
$DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET pollid = '".$pollid."' WHERE threadid = '".$thread[threadid]."'");
}

if ($formreply == "1") {
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,pa getext,allowsmilie,showsignature,ipaddress,iconid, visible) VALUES (NULL,'$formreplythreadid','$normalanswer1','".addslashes($bbuserinfo[username])."','$bbuserinfo[userid]','".time()."','" . addslashes($formsend) . "','1','1','0','0','1')");
$DB_site->query("UPDATE thread SET replycount = replycount + 1, lastpost = " . TIMENOW . ", lastposter = '".addslashes($bbuserinfo[username])."' WHERE threadid = $formreplythreadid");
$DB_site->query("
UPDATE " . TABLE_PREFIX . "forum
SET replycount = replycount + 1,
lastpost = " . TIMENOW . ",
lastposter = '".addslashes(htmlspecialchars($bbuserinfo[username]))."',
lastthread = '" . addslashes($bbuserinfo['username']) . " $formtitle',
lastthreadid = $formreplythreadid
WHERE forumid = $formreplyforumid
");
$DB_site->query("
UPDATE " . TABLE_PREFIX . "user
SET posts = posts + 1
WHERE userid = $bbuserinfo[userid]
");
$forum[forumid] = $formreplyforumid;
}

if ($formpm == "1") {
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pmtext\n\t(fromuserid, fromusername, title, message, touserarray, iconid, dateline, showsignature)\nVALUES\n\t($bbuserinfo[userid], '" . addslashes($bbuserinfo['username']) . "', '".addslashes(htmlspecialchars($formtitle))."', '".addslashes(htmlspecialchars($formsend))."', '" . addslashes(serialize($tostring)) . "', 0, " . TIMENOW . ", 1)");
$pmtextid = $DB_site->insert_id();
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pm (pmtextid, userid, messageread) VALUES ($pmtextid, $formpmid, 0)");
$DB_site->shutdown_query("UPDATE " . TABLE_PREFIX . "user SET pmtotal=pmtotal+1, pmunread=pmunread+1 WHERE userid = $formpmid");
}

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

if ($redirectoption == "1") {
$url = "showthread.php?$session[sessionurl]p=$post[postid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
if ($redirectoption == "2") {
$url = "showthread.php?$session[sessionurl]t=$thread[threadid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
if ($redirectoption == "3") {
$url = "forumdisplay.php?$session[sessionurl]f=$forum[forumid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
if ($redirectoption == "4") {
$url = "editpost.php?do=editpost&$session[sessionurl]p=$post[postid]";
eval(print_standard_redirect('redirect_postthanks' ));
exit();
}
eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
exit();
}
eval('print_output("' . fetch_template('form') . '");');
?>

aggiefan
07-02-2005, 11:43 PM
Here's a link to my form. It's being used for a contest I'm doing (win 2 Big XII Championship Tickets for football). It's a pick 'em contest where the user predicts the winner and fills out a tiebreaker guess. I have it set up to where it will PM me. The games entered are just testing...

http://aggiefans.com/forums/week1.php

Listed are the things I want this form to do:
I want it to PM me and the submitting user. Also, is there a way to get this form to actually input the answers into a table which can be stored in a database and displayed by user (link to each person's picks)? Only allow a user to submit it once

I'd be willing to pay for help with the database/table thing. The other two requests have been posted before, but I've searched all 31 pages and haven't found an answer. Take a look and let me know what you think and if you can help.

aggiefan
07-03-2005, 12:02 AM
Ok, I found the answer to #1 and a lot of other user's questions. Here's what I did to get the 2 PM's to work. (it may be redundant or the roundabout way, but given my lack of programming skill, it works and wasn't hard).

In your form.php find:
//ENABLE FORM TO BE PMED - 1 = yes, 0 = no
$formpm = "1";

//USERID TO PM TO
$formpmid = "whateveridyouhavehere";
Make this change:
//USERID TO PM TO
$formpmid = "whateveridyouhavehere";
$formpmid2 = "$bbuserinfo[userid]"
That's if you want it PM'd to the submitter. If not, put whoever's userid you want it to go to. Repeat as many times as necessary (next one would be pmid3, etc).

Then scroll down and find in the bottom area:
if ($formpm == "1") {
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pmtext\n\t(fromuserid, fromusername, title, message, touserarray, iconid, dateline, showsignature)\nVALUES\n\t($bbuserinfo[userid], '" . addslashes($bbuserinfo['username']) . "', '".addslashes(htmlspecialchars($formtitle))."', '".addslashes(htmlspecialchars($formsend))."', '" . addslashes(serialize($tostring)) . "', 0, " . TIMENOW . ", 1)");
$pmtextid = $DB_site->insert_id();
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pm (pmtextid, userid, messageread) VALUES ($pmtextid, $formpmid, 0)");
$DB_site->shutdown_query("UPDATE " . TABLE_PREFIX . "user SET pmtotal=pmtotal+1, pmunread=pmunread+1 WHERE userid = $formpmid");
}

What I did is copy this entire section of code, repaste it below where it is and change the 2 bolded area:if ($formpm == "1") {
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pmtext\n\t(fromuserid, fromusername, title, message, touserarray, iconid, dateline, showsignature)\nVALUES\n\t($bbuserinfo[userid], '" . addslashes($bbuserinfo['username']) . "', '".addslashes(htmlspecialchars($formtitle))."', '".addslashes(htmlspecialchars($formsend))."', '" . addslashes(serialize($tostring)) . "', 0, " . TIMENOW . ", 1)");
$pmtextid = $DB_site->insert_id();
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pm (pmtextid, userid, messageread) VALUES ($pmtextid, $formpmid2, 0)");
$DB_site->shutdown_query("UPDATE " . TABLE_PREFIX . "user SET pmtotal=pmtotal+1, pmunread=pmunread+1 WHERE userid = $formpmid2");

It worked for me and sent a PM of the answers to me and the person who submitted it. Hope this helps.

Stachel
07-03-2005, 11:01 AM
Ever wanted an online form that a user can fill out, which when submitted gets:

1. Posted into a new thread in a forum of your choice
3. Posted as a reply in an existing thread of your choice
5. Emailed to an email address you specify
Oh my GOD just last week I was wondering if this was possible !!!

Dr. Loh you are a genius!

Stachel

Michael2
07-07-2005, 08:27 AM
Any plans to make this work with 3.5? I was using it before and really miss it. :(

jsteinitz
07-07-2005, 08:46 PM
Hi,

Downloaded, installed and made some field modifications--working well. Excellent hack; I had been trying to figure out a way to standardize input from users but had given up. Thanks very much to you, Dr. Loh.

One problem-- the threads that are posted via the form don't seem to be appearing in searches; if I post a thread directly to the forum (bypassing the form), searching works correctly on this one thread only.

Any ideas why my form-generated posts aren't being included in searches?

jsteinitz
07-07-2005, 09:03 PM
Thanks anyway; found the answer in the forum.

ZGeek
07-13-2005, 02:04 AM
Is there anyway to change the reply to email address to the member who filled out the form?

jschlosser
07-13-2005, 03:58 AM
hi dude's,

first of all thanks for this nice script. its very impotant for me to have it.
the second one is my bad english. sorry for:)
i have changed the script for my needs, but one thing is also important for me.

THE TITLE::: can only changed in the script. form.php

but i need a textform wherer i can write my own TITLE of the new thread.
is it possible to change ???

would be wonderful.

you can see my form on this site.

http://www.pickup-portal.com
on the left side go to "Fahruzeuge eingeben" then you 'll see the form.php

when you click on "Frachten eingeben" you 'll see the the fom1.php

login: test
pass: test

many thankx in advance

greets sascha

ps. when i make a new thread with this script and i want search a word from the new thread, i cannot find something in the search. ???

SirJonathan
07-14-2005, 12:01 AM
Yes :). I added all the variables and for most people it works great. There are just some who have filled it all out, post, and it never shows up in the forum.

I've worked on the permissions and I'm pretty sure its not that.. You are required to register before you access the form. Can you think of any reasons why it would work for most people and then not for some?

-Jonathan

Any ideas on this one?

I'm using the form to recieve membership applications from my members and its very frustrating when even a few of the applications posted don't actually go through. Has anyone else had trouble with the form not posting for some of their users?

-Jonathan

Sovereign
07-19-2005, 10:38 PM
Uhh, the install says that this is compliant with vB version 3.x.x, but I get

Fatal error: Call to undefined function: globalize() in /home/alliance/public_html/vb/hostingrequest.php on line 24
when attempting to use the test form....(I'm on 3.5)

Marco van Herwaarden
07-20-2005, 06:35 AM
Uhh, the install says that this is compliant with vB version 3.x.x, but I get

Fatal error: Call to undefined function: globalize() in /home/alliance/public_html/vb/hostingrequest.php on line 24
when attempting to use the test form....(I'm on 3.5)I am afraid that this thread was posted before anybody had knowledge of the upcoming vB3.5.

I guess it should read that this hack will work on any vB3.0.x version.

csidlernet
07-20-2005, 07:55 AM
preety cool. *installs*

Sovereign
07-20-2005, 01:30 PM
I saw the same error in Erwin's POP3/IMAP hack, something with "globalize" being undefined....

Abe1
07-20-2005, 01:43 PM
I saw the same error in Erwin's POP3/IMAP hack, something with "globalize" being undefined....

Because you installed this hack on a vb3.5 forum. This hack only works on a vb3.0 forum

Sovereign
07-20-2005, 04:56 PM
Is there a way around that? And besides, the hack readme says for vB 3.x.x! (I know now that this was before any info on the actual 3.5 became availible, but I thought I'd give it a shot.)

Abe1
07-20-2005, 07:03 PM
Is there a way around that? And besides, the hack readme says for vB 3.x.x! (I know now that this was before any info on the actual 3.5 became availible, but I thought I'd give it a shot.)

The only way around it wait for an update. I contacted the developer if he minds if I come out with an update for this but I didn't here back from him yet.

ZGeek
07-21-2005, 03:55 AM
I have a weird problem I wonder if anyone can help. I converted my mail system so the form answers are emailed in HTML format. Unfortunately I sometimes get strange "!" marks appearing in the code. They are random and only appear in emails. The forms post perfectly in the forums.

Any ideas?

PKRWUD
07-21-2005, 12:04 PM
I'm sorry if it's been covered, but I can't afford the time to read all 32 pages. I am trying to use this form for all replies to a specific thread. It's thread #18579 in forum #40. How do I set things up so that when someone hits the reply button in that thread, they are taken to the form?

Santhalas
07-23-2005, 05:41 PM
Is this hack compatible with 3.0.7? I tried installing it exactly as it says in the instructions, but all I'm getting is a blank page...

Edit: Solved the problem on my own, actually. Thanks!

kvnband
07-25-2005, 01:54 AM
For all those wanting moderation, I've got it for ya! The following code places the THREAD into moderation que. It appears to work flawlessly.

in form.php, find

$DB_site->query("
UPDATE " . TABLE_PREFIX . "forum
SET replycount = replycount + 1,
threadcount = threadcount + 1,
lastpost = " . TIMENOW . ",
lastposter = '" . addslashes($bbuserinfo['username']) . "',
lastthread = '".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle',
lastthreadid = $thread[threadid]
WHERE forumid = $formforumid
");
and delete it. Then find

$post['postid'] = $DB_site->insert_id();
$DB_site->query("
UPDATE " . TABLE_PREFIX . "thread
SET firstpostid = $post[postid]
WHERE threadid = $thread[threadid]
");
AFTER, ADD

//Added By Kevin
//Add Thread To Moderation Que

$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "moderation(threadid, postid, type)
VALUES
($thread[threadid], $post[postid], 'thread')
");

//End Added By Kevin


Now, if the thread is in moderation que, you don't want it to show up as visible in your forums, do you? So, in

$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "post
(threadid, title, username, userid, dateline, pagetext, allowsmilie,
showsignature, iconid, visible)
VALUES......addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid], " . TIMENOW . ",
'" . addslashes($formsend) . "', 1, 1,
0, 1)
"); at the end there, instead of it being 1, 1, 0, 1, make it 1, 1, 0, 0. Then, right above there, change the numbers at the end of

$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "thread(title, lastpost, forumid, open, replycount,
postusername, postuserid, lastposter, dateline, iconid, visible, attach)
VALUES
(.... " . TIMENOW . ", $formforumid,
0, 0, '" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid],
'" . addslashes($bbuserinfo['username']) . "', " . TIMENOW . ", 0, 1, 0)
"); to 0, 0, 0.

I'm sorry if this is confusing...It probably is. But Just wanted to give everyone else a chance to add threads to the moderation que.

Kevin

PKRWUD
07-25-2005, 09:48 AM
That's killer! I don't suppose you know how to set it up the way I was asking, do you (scroll up two posts)?

kvnband
07-25-2005, 01:05 PM
That's killer! I don't suppose you know how to set it up the way I was asking, do you (scroll up two posts)?

I can try. In your Showthread template, go down about 20 lines.

FIND
<if condition="$show['largereplybutton']">
AFTER, ADD
<if condition="$thread[threadid] == 18579">
<td class="smallfont"><a href="form.php"><img src="$stylevar[imgdir_button]/reply.gif" alt="$vbphrase[reply]" border="0" /></a>
<else />
FIND </if>
AFTER, ADD </if>

FIND <if condition="$show['largereplybutton']"> It is down many lines.

You'll see that this section is identical to the one you just changed. So change this one just like you changed the other one.
Please note that I haven't tested it and honestly have no idea if it works :-)
Kevin

DougM
07-27-2005, 01:10 AM
EDIT :: I was making this too complicated. All I had to do was add the $bbuserinfo[field9] to the formanswers template. Fantastic.

I think this will do exactly what I need but I'm having some difficulty pulling custom profile fields into a new thread from the form. I can get the member's custom field to show up in the form by using this:

In the Form template:<tr>
<td class="alt2" valign="middle">
<b>Phone</b>:<br>
Your Phone Number.</td>
<td class="alt2" valign="middle" colspan="2">
<b>$bbuserinfo[field9]</b></td>
</tr> In form.phpI can't figure it outI'm looking at form.php and trying to see how the username $bbuserinfo[username] is processed but I guess it's beyond me or I'm missing the obvious.

Can anyone help me to get a custom profile field into a new thread? Much appreciated if so.

Thanks

Antivirus
07-27-2005, 09:37 PM
This is a great hack, which is extremely useful for us. I was wondering though, while turning on the ENABLE FORM TO BE EMAILED feature within the form.php file... would it be possible for the REPLYTO email address in the email which is sent, to match the email address in the profile of the member whom had submitted the form?

jschlosser
07-29-2005, 07:26 AM
hi dude's,

first of all thanks for this nice script. its very impotant for me to have it.
the second one is my bad english. sorry for
i have changed the script for my needs, but one thing is also important for me.

THE TITLE::: can only changed in the script. form.php

but i need a textform wherer i can write my own TITLE of the new thread.
is it possible to change ???

would be wonderful.

you can see my form on this site.

http://www.pickup-portal.com
on the left side go to "Fahruzeuge eingeben" then you 'll see the form.php

when you click on "Frachten eingeben" you 'll see the the fom1.php

login: test
pass: test



ps. when i make a new thread with this script and i want search a word from the new thread, i cannot find something in the search. ???

the search function isn#t working with this script. can any1 fix this bug ?

I use the Version vbulletin 3.07
many thankx in advance

greets sascha

Marco van Herwaarden
07-29-2005, 07:38 AM
Please provide a test login if you want us to see something.

Thanks.

DougM
07-29-2005, 10:51 AM
I'm trying to create a different header for my form by using a conditional statement and it's not working. Can anyone tell what I may be doing wrong? This is what I'm trying to use:<if condition="THIS_SCRIPT == 'form'"> Nothing shows up on the form page with this.

kvnband
07-29-2005, 01:08 PM
hi dude's,

first of all thanks for this nice script. its very impotant for me to have it.
the second one is my bad english. sorry for
i have changed the script for my needs, but one thing is also important for me.

THE TITLE::: can only changed in the script. form.php

but i need a textform wherer i can write my own TITLE of the new thread.
is it possible to change ???

would be wonderful.

you can see my form on this site.

http://www.pickup-portal.com
on the left side go to "Fahruzeuge eingeben" then you 'll see the form.php

when you click on "Frachten eingeben" you 'll see the the fom1.php

login: test
pass: test



ps. when i make a new thread with this script and i want search a word from the new thread, i cannot find something in the search. ???

the search function isn#t working with this script. can any1 fix this bug ?

I use the Version vbulletin 3.07
many thankx in advance

greets sascha

First off, search this thread for the search problem. I'm not sure if it's ever been fixed or not.

Secondly, to change the subject, in form.php, go down to

INSERT INTO " . TABLE_PREFIX . "thread(title, lastpost, forumid, open, replycount,....
2 lines down is
('".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle', " . TIMENOW . ", $formforumid,
change '".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle'
to 'Your THREAD TITLE HERE'
then go down about 10 lines to

VALUES
($thread[threadid], '".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle',
'" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid], " . TIMENOW . ",
'" . addslashes($formsend) . "', 1, 1,
0, 1)
and change
"'.addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle'
to 'YOUR THREAD TITLE'

You'll want to put some sort of variable in those changes though. a variable from the form so that not every thread will have the same exact title. You can see what I'm doing at
http://www.birdboard.com/forum/bird-board-classifieds.html

Every new thread there has the same format, but not exactly the same title.
Kevin

leroub
07-31-2005, 12:21 PM
thx for this hack....

how to put bbcode in the template of the answer....

thanks in advance...

leroub
07-31-2005, 12:43 PM
it's ok... i forget to put a space between my text and bbcode... ;)

jschlosser
08-04-2005, 03:50 AM
WOW kvnband, many many thax. i try to change this first.

u know about the search function ???

it's very hard for my to explain all probs in english but i try.

would be wonderful, when someone could't change this bug for the search.

greets sascha

ps. many many many many thanks goes to kvnband !!!!!!!

kvnband
08-04-2005, 04:51 AM
WOW kvnband, many many thax. i try to change this first.

u know about the search function ???


it's very hard for my to explain all probs in english but i try.


would be wonderful, when someone could't change this bug for the search.

greets sascha

ps. many many many many thanks goes to kvnband !!!!!!!

I'm sorry, but I have never looked into the search problem (my form created threads are auto pruned after 30 days of inactivity, so there is no reason to bother indexing them).
Kevin

jschlosser
08-04-2005, 11:06 AM
hi, ok thats right. i must delete alle the threads also after 30 days. how i can do that automatically.

but i need very urgent the same like you. everybody who make a new thread with this form must write a title of the thread. can u help me with this ??

with the code changes above every thread looks like " THREAD TITLE HERE"

thanks in advance.

greets sascha

kvnband
08-04-2005, 12:39 PM
hi, ok thats right. i must delete alle the threads also after 30 days. how i can do that automatically.

but i need very urgent the same like you. everybody who make a new thread with this form must write a title of the thread. can u help me with this ??

with the code changes above every thread looks like " THREAD TITLE HERE"

thanks in advance.

greets sascha

I sent you a PM. You must create an input box in your form callled $threadtitle or something similar. Then put $threadtitle (or whatever you called it) in replacement of 'YOUR THREAD TITLE HERE'
Kevin

kvnband
08-04-2005, 12:40 PM
Also, to auto prune threads

https://vborg.vbsupport.ru/showthread.php?t=67049&highlight=auto+prune

Antivirus
08-04-2005, 08:58 PM
I installed this mod into our vBulliten, and everything works great, however even though we uploaded each template into the two different styles we have, for some reason the styles keep reverting back to default when either loading the form or submitting the form.

Is anyone else having this problem with this mod on their boards whom have custom styles? We could just be experiencing something goofed up in a template on the custom styler somewhere.

Cyricx
08-09-2005, 11:49 AM
Any plans to port this hack over to 3.5?

Abe1
08-09-2005, 11:53 AM
Any plans to port this hack over to 3.5?

I sent a PM to Erwin asking about if he minding if I worked on this hack for vb3.5. I never got a reply. I'm going to PM him again.

azinwood
08-09-2005, 09:11 PM
just installed in our auto for sale section. works great.

thx!

Abe1
08-10-2005, 04:58 AM
OK guys, thaks to Erwin permission, I have ported the hack over to vb3.5. 93970

PKRWUD
08-13-2005, 12:17 AM
I can try.

Please note that I haven't tested it and honestly have no idea if it works :-)
Kevin

Kevin, You ROCK!!!

I'm still working out some other bugs, but your suggestion worked perfectly! Thank you very much!!!

Take care,
~Chris

PKRWUD
08-13-2005, 02:30 AM
Okay, odd problem. I have had this installed for close to a year with no problems, but now I'm trying it a little differently, and I've come across a problem. I am using the form to reply to a thread.

In form.php:
//ENABLE FORM TO BE POSTED - 1 = yes, 0 = no
$formforum = "1";

//FORUM TO POST NEW THREAD IN
$formforumid = "";

//ENABLE POLL TO BE CREATED - 1 = yes, 0 = no
$formpoll = "0";
$formoption1 = "Yes";
$formoption2 = "No";


If I leave $formforumid the way it is above, I get a syntax error. If I enter a 0 there, the error goes away, but the post won't redirect to the thread, it redirects to the last post, all by itself. If I enter in the forum ID #, it starts a new thread in that forum.

My question is; what should I enter there?

michaelsilvia
09-10-2005, 02:16 AM
Anyway to get this to work on 3.0.8? I tried it, but it is not working.

Mike

mod2000
09-10-2005, 08:19 AM
i hope ... damn .. ive done this hack the last 3 days by myself :( didnt see the hack in here.

CnB
09-19-2005, 01:23 PM
i dont get the installation !!
add the templates to what ?
i assume form.txt and formanswer.txt are the templates
but where do i add them ?

and does it work on 3.0.9 ?

bendigo-tech
09-22-2005, 11:49 PM
i dont get the installation !!
add the templates to what ?
i assume form.txt and formanswer.txt are the templates
but where do i add them ?

and does it work on 3.0.9 ?
Yes, form and formanswers are the templates. Use the Style Manager in admincp to add them.

I have it working on 3.0.9 with no problems. didn't have to make any modifcations either.

bendigo-tech
09-23-2005, 12:43 AM
I have this setup and running nice. However, when filling out the form, I want the option of being able to choose between 3 forums to post the information too. I don't mind if it uses a drop-down menu or even radio buttons. I just need to know how I can set this up.

Any help would be great! Thanks!

hbalagh1
09-28-2005, 08:37 PM
great little mod, using it to sign up for a gift exchange we have started :)

hbalagh1
09-28-2005, 08:58 PM
Thank you for this :)

I got unlazy and attempted the conditionals myself and got it working. If anyone else wants to make it so users have to have a certain post count to be able to fill out the form, do this.

In the "form" template..

Find: <tr>
<td> $formpurpose </td>
</tr>
</table>
</fieldset></td>
</tr>
</table></td>
</tr>
Add After: <if condition="$bbuserinfo[posts] >= 10"> (change 10 to whatever post count you want required)

Now find: </form>
Add After: <else />
<tr>
<td class="alt2" valign="middle">TEXT YOU WANT UNQUALIFIED USERS TO SEE.</td>
</tr>
</table>
</td>
</tr>
</table>
</if>


Works great!
* KTBleeding clicks install

hbalagh1
09-30-2005, 08:31 PM
I have a request... I would like to have this pm'd to a user and posted as a reply in a thread....my request is though (if possible) I would like one of the answers not to show up in the tread only the pm...since we are dealing w/ members postal addreses... is this possible???

Thanks
Heather