View Full Version : FORM to THREAD/ FORUM/ POLL/ PM/ EMAIL - CUSTOMIZABLE FORMS - Mod Apps, Orders, News.
Erwin
06-11-2004, 10:00 PM
FORM to THREAD/ FORUM/ POLL/ PM/ EMAIL - Totally CUSTOMIZABLE FORMS
Version 1.6 for vBulletin 3.x.x by Dr Erwin Loh
Features:
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
2. Create a new poll in the new thread with options of your choice
3. Posted as a reply in an existing thread of your choice
4. PMed to you or someone else
5. Emailed to an email address you specify
6. Choose to redirect to the post, thread or forum, or a custom thank you message
7. Choose to redirect to editpost to upload attachments
Or any combination or all of the above?
Well, this is the hack for you! :)
You can use this for:
1) Moderator Applications
2) Quiz Submit Form which gets PMed to a moderator
3) Contact Form that goes to PM, email or thread
4) Guests to apply to be members
5) Report a Moderator form that goes as a PM to you
6) Guests can PM you for whatever reason
7) Order form to buy things
8) Donation form
9) News or Articles submissions that can go straight to a thread
Or anything you like - this hack is totally customizable via the PHP file.
Basically, this hack involves modifying 1 PHP file form.php (you add questions, options etc. in the PHP file itself), uploading it, and then adding 2 templates.
The beauty of this hack is that once you have added the 2 templates, to make a new form, all you need to do is copy the form.php and rename it to form2.php, edit the variables in the PHP file, and you have a totally new form!!! You do not need to touch the templates again.
Format of the form:
1. One main input question
2. 2 Radio buttons Choice questions
3. 3 Normal text input questions
4. 1 Long answer question
This is customizable via the PHP file.
Also:
- You can set the usergroups you want access to this form.
- Depending on your forum permissions, if the new thread is in a public forum, members can reply to it. This hack allows a form to submit the new thread or post wherever you want it to go.
- Force the user to answer all questions.
INSTALLATION
Easy - takes only a few minutes:
1. Add the 2 templates.
2. Edit form.php - the instructions are all inside the PHP file itself, in the top half. Follow the instructions carefully!
3. Upload form.php
Just link to form1.php eg. http://www.yourforum.com/forums/form.php
Done!
Use this hack to make as many forms as you like!
Enjoy! :)
Updates:
Version 1.1 - Option to force user to answer all questions.
Version 1.2 - Thread count and lastposter information now updated if form is sent to existing thread.
Version 1.3 - ADDED CREATE POLL OPTION! :)
Version 1.4 - Fixed bug with Form-to-thread code
Version 1.5 - Major update:
- fixed bug where thread count not updated when form to forum
- fixed default posting to allow smilies and sigs when reply to thread
- added templates to cache (saves 2 queries)
- added option to change thank you message
- added options to redirect to post, thread or forum when submit
Version 1.6 - Choose to redirect to editpost to upload attachments
Screenshot is an example of a form - the form title and questions are customizable:
SaN-DeeP
06-11-2004, 11:41 PM
sounds interesting. i will give this a try now ;)
* SaN-DeeP is ready to install
thnx for making it 3.0 complaint
Sandy...
Thanks for this :)
* mmw installs
Erwin
06-11-2004, 11:47 PM
sounds interesting. i will give this a try now ;)
* SaN-DeeP is ready to install
thnx for making it 3.0 complaint
Sandy...
I've modified form.php just slightly to make the thank you page look nicer - please download and upload the new form.php if you have managed to download it before this post was made. :)
Erwin
06-11-2004, 11:48 PM
In the vB2 version, you needed to install 3 templates. I've reduced it down to 2 now. :)
pjdaley
06-12-2004, 12:06 AM
i will download this when i get home, and test it out, but im just wondering, can a guest fill out such any form, i see it creates a thread in a forum i can specify...but the question is can other members reply? like can they see it and ect? im just wondering...
Erwin
06-12-2004, 12:16 AM
i will download this when i get home, and test it out, but im just wondering, can a guest fill out such any form, i see it creates a thread in a forum i can specify...but the question is can other members reply? like can they see it and ect? im just wondering...
You can set which usergroup you want access to this form in the PHP file. :)
Whether members can reply depends on the forum permissions - nothing to do with this hack. This hack just does what I've described. :)
insanctus
06-12-2004, 12:29 AM
Lmao title was so long I just had to look :)
* insanctus will click install and play with it.
KTBleeding
06-12-2004, 01:02 AM
Cool!
Is there anyway to make it so registered members have to have atleast 10 posts to fill out a certain form?
Vivi Ornitier
06-12-2004, 02:03 AM
nice, been waitin for somethin like this. If we want the forum to create a new thread in certain forums, can it be done so it creates a new thread in 2 specified forums?? I just need clarification on that before i start installin
Erwin
06-12-2004, 02:53 AM
nice, been waitin for somethin like this. If we want the forum to create a new thread in certain forums, can it be done so it creates a new thread in 2 specified forums?? I just need clarification on that before i start installin
2 forums? Of course - just replicate the section of the code that checks $formforum, and make another variable called $formforumid2, and in the second copy of the $formforum section, rename $formforumid to $formforumid2.
dndog
06-12-2004, 03:02 AM
/me clicks install.
I had requested this a month ago. Thanks.
ernestdefoe
06-12-2004, 03:19 AM
Works like a charm for me. After I figured it out. My mind is working slower and slower these days. Thanks for this hack.
Logikos
06-12-2004, 03:38 AM
/me clicks install.
NICE!
BamaStangGuy
06-12-2004, 05:02 AM
Awsome man got it working for me
http://mustang-forums.com/forums/modapp.php
B-E-A-U-T-I-F-U-L hack
Format of the form:
1. One main input question
2. 2 Radio buttons Choice questions
3. 3 Normal text input questions
4. 1 Long answer question
This is customizable via the PHP file.
How can I change the format of the form? say I want few main input questions, few radio buttons, norman text input, few long answers ...
Erwin
06-12-2004, 06:14 AM
B-E-A-U-T-I-F-U-L hack
How can I change the format of the form? say I want few main input questions, few radio buttons, norman text input, few long answers ...
You can do that by adding or substracting the variables, modifying the "global section" at the top to allow the variables to be requested, and then changing the template to add or substract the variables.
It can be worked out in my hack - I've given you the tools - go forth and modify this hack to suit your site!
reteep
06-12-2004, 07:05 AM
Great Hack Erwin, thanks!
Boofo
06-12-2004, 07:42 AM
Thank you, sir. ;)
* Boofo clicks install!
Lee Wilde
06-12-2004, 08:04 AM
You are a scholar and a gentleman Erwin - thank you for this hack.
Would it be possible for the user to select which forum he wants to post in? Perhaps a drop-down list of several forums.....when the user selects one, it changes the forumid.
If this is possible, would you mind providing the necessary code changes?
Intex
06-12-2004, 08:14 AM
Nice1 Erwin - I used your hack from 2.x. Good job :).
* Intex will add over the weekend
MindTrix
06-12-2004, 11:47 AM
Sounds super sweet, im going to try this out. Ohh and BrentWilson we cant see your demo because it asks us to sign up
nexialys
06-12-2004, 11:54 AM
good work Erwin.... btw i lost a client by your fault... ;) but it's for good, i was not to do it as well as your hack!
KTBleeding
06-12-2004, 01:05 PM
Cool!
Is there anyway to make it so registered members have to have atleast 10 posts to fill out a certain form?
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
BamaStangGuy
06-12-2004, 01:30 PM
Sounds super sweet, im going to try this out. Ohh and BrentWilson we cant see your demo because it asks us to sign up
Fixed it sorry about that.
MTHA if you need help on customizing it let me know
romanticyao
06-12-2004, 04:36 PM
thanx erwin~ i have waited so long for this one~:nervous:
BarHopper
06-12-2004, 09:29 PM
This sia stupid question, but where are the two templates?
Erwin
06-12-2004, 10:08 PM
This sia stupid question, but where are the two templates?
They are the 2 text files in the ZIP files. :) "form" and "formanswers".
KTBleeding
06-12-2004, 10:08 PM
This sia stupid question, but where are the two templates?
Included in the zip. form.txt and formanwers.txt (I believe, I'm at work right now and don't have access to see if that's correct.)
KTBleeding
06-12-2004, 10:12 PM
They are the 2 text files in the ZIP files. :) "form" and "formanswers".
Beat me to it. :(
Fixed it sorry about that.
MTHA if you need help on customizing it let me know
Appreciate your offer, but I got it alright Wilson. I just wanna ask to see if there's a proper way to add, and I got that from Erwin.
This is a great hack, very easy to customize.
However, each "form" will have different structure, set of questions, number of questions, type of questions, which will end up to have different template for each form anyway.
One question:
After submitting the form, user is redirect to a thanks page
-username-, thank you for submitting the -topic!-
Should it be auto redirect to forum home, or some thread?
BarHopper
06-13-2004, 07:03 AM
ah, thankyou kind sirs.
/me clicks install
Lee Wilde
06-14-2004, 03:51 PM
You are a scholar and a gentleman Erwin - thank you for this hack.
Would it be possible for the user to select which forum he wants to post in? Perhaps a drop-down list of several forums.....when the user selects one, it changes the forumid.
If this is possible, would you mind providing the necessary code changes?
Thanks anyway. I'll try something else.
The Realist
06-14-2004, 05:00 PM
Erwin
Your getting better and better as you grow older M8 :)
Again you have shown your the bee's knee's and I take my hat off to you.
Great hack and Im installing.
Thank You.
Erwin
06-14-2004, 08:26 PM
Thanks anyway. I'll try something else.
What you suggest is simple and only requires a template mod - just a drop down menu in HTML with a list of forumids - all you need is to make sure the forumid variable is added to the POST list at the top of html.php.
pjdaley
06-14-2004, 10:50 PM
great hack man, but is it possible to change the name of the thread? to one of the answers?
teksigns
06-14-2004, 11:14 PM
any way to make it so that a new thread gets posted and a NEW EVENT in the calander of choice ......
Erwin
06-14-2004, 11:20 PM
great hack man, but is it possible to change the name of the thread? to one of the answers?
Sure - in the PHP file, look for the query that inserts the new thread, and change the threat title being inserted from $formtitle to whichever variable you want.
Erwin
06-14-2004, 11:21 PM
any way to make it so that a new thread gets posted and a NEW EVENT in the calander of choice ......Can be done, but that's a completely different hack mate. :) I may add this as a new option when I have time - it's not hard.
teksigns
06-14-2004, 11:23 PM
Can be done, but that's a completely different hack mate. :) I may add this as a new option when I have time - it's not hard.
thank you !
I really could use this !
pjdaley
06-15-2004, 01:45 AM
Sure - in the PHP file, look for the query that inserts the new thread, and change the threat title being inserted from $formtitle to whichever variable you want.
i understand, but like i want this form for unregistered, so it shows... Unregistered $formtitle.... i would rather just put like... Guest Submitted new Joke! or something
Erwin
06-15-2004, 02:18 AM
i understand, but like i want this form for unregistered, so it shows... Unregistered $formtitle.... i would rather just put like... Guest Submitted new Joke! or something
You can put whatever you wish by modifying the php file.
Boofo
06-15-2004, 03:45 AM
What you suggest is simple and only requires a template mod - just a drop down menu in HTML with a list of forumids - all you need is to make sure the forumid variable is added to the POST list at the top of html.php.
Can you show us what we would need to do for that, sir? ;)
pjdaley
06-15-2004, 04:03 AM
You can put whatever you wish by modifying the php file.
not really a coder though :ermm:
Zephanor
06-17-2004, 03:12 AM
Nice work! I've setup an application form that works quite well and it was easy to figure out.
Is there a way to set it up so that it will require all fields to be answered in order for the form to be sumbitted?
bonken
06-17-2004, 11:04 AM
rocks
!!
HakkieDEV
06-17-2004, 01:40 PM
Thank you sir for this extremely good hack!
Zephanor
06-18-2004, 05:30 AM
Anyone have any thoughts on requiring all fields to be completed before submitting the form? Or maybe a direction I can look or fiddle with?
Any help is appreciated and this is an awesome hack, I love it.
:D
Erwin
06-18-2004, 05:37 AM
Anyone have any thoughts on requiring all fields to be completed before submitting the form? Or maybe a direction I can look or fiddle with?
Any help is appreciated and this is an awesome hack, I love it.
:D
You can do that by adding some javascript to the top of the template to check the fields before submitting. I can also code it into the PHP file, but I'm trying to make this hack as generic as possible, so any customization will have to be done by the installer, as each site requires different things.
Boofo
06-18-2004, 05:46 AM
You can do that by adding some javascript to the top of the template to check the fields before submitting. I can also code it into the PHP file, but I'm trying to make this hack as generic as possible, so any customization will have to be done by the installer, as each site requires different things.
Couldn't you code it in PHP and make a variable option at the top to turn it off or on? I think it would be a great addition. ;)
Erwin
06-18-2004, 06:31 AM
Couldn't you code it in PHP and make a variable option at the top to turn it off or on? I think it would be a great addition. ;)
You guys are asking for sooooo much. ;)
Geez, and I do this for free though... when I find time, I'll add it.
Boofo
06-18-2004, 11:23 AM
You guys are asking for sooooo much. ;)
Geez, and I do this for free though... when I find time, I'll add it.
That's the spirit! That's what makes you stand out from the rest of us here. ;)
Zephanor
06-18-2004, 01:20 PM
Heheh, it would be a great addition but it's not a big deal. I like that it's an easy snap it. I'll poke around and see what I can find.
Thanks!
Erwin
06-19-2004, 02:00 AM
Update Version 1.1
-------------------------
Added option to force user to answer all questions.
New ZIP file attached in first post.
To upgrade manually, you can do this:
1) In form.php, find:
////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////
Above ADD:
////////////////////////////////////////////////////////////////////////////////////////////////////
//FORCE USER TO ANSWER ALL QUESTIONS - 1 = yes, 0 = no
////////////////////////////////////////////////////////////////////////////////////////////////////
$answerall = "1";
2) Then, find:
if ($action=="submit") {
Below, ADD:
if ($answerall == "1") {
if ($normalanswer1 == '' OR $radioanswer1 == '' OR $radioanswer2 == '' OR $radioanswer3 == '' OR $radioanswer3other == '' 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();
}
}
Done! :)
Playboy69
06-19-2004, 02:07 AM
I am new to this so is there anyone who can walk me through this a bit on how to install this please
Zephanor
06-19-2004, 04:47 AM
Erwin, you are da man!
Thanks a great deal. Only problem is that there is no way to click back to retain the answers (my form as 10 longanswers and that would be frustrating if they missed one of the two radio buttons.)
Oh, I just thought of another idea and to be totally ignored by this is perfectly fine as I'm totally satified with your work as is.
Any way to make it so that folks can only fill out the form once? I'm sure there is but it would probably require making an addition to the DB which I'm not quite sure how to do that (I'm sql dumb. Heheh.)
Keep up the great work!
Boofo
06-19-2004, 04:52 AM
Erwin, you are da man!
Thanks a great deal. I just thought of another idea and to be totally ignored by this is perfectly fine as I'm totally satified with your work as is.
Any way to make it so that folks can only fill out the form once? I'm sure there is but it would probably require making an addition to the DB which I'm not quite sure how to do that (I'm sql dumb. Heheh.)
Keep up the great work!
You want fries with that? LOL
Zephanor
06-19-2004, 05:05 AM
Oh I know, I get the same thing on the items I actually work on myself, heheh. I don't ask a lot all over, it's pretty rare but the need is there in this case. Either way I'm happy just having what I've got and all credit to the author.
:)
Boofo
06-19-2004, 05:19 AM
Oh I know, I get the same thing on the items I actually work on myself, heheh. I don't ask a lot all over, it's pretty rare but the need is there in this case. Either way I'm happy just having what I've got and all credit to the author.
:)
I was just messing with you. I'm worse for that than you are, actually. ;)
Playboy69
06-19-2004, 06:01 AM
I was wondering how to set this up. It says add the 2 templates but I have no clue how or what the templates are. Also If i wanted to add more questions or changes how the answers are do i have to add this in the templates?
Thanks alot for the Hack Erwin!
If I may... My request for the future wish-list on this hack would be some kind of AdminCP (or ModCP) interface where you could setup a form automagically.
It works great as is, but if I had a way for my different usergoup leaders to setup their own questionaires it would be even better
Thank you again for the Mod Erwin.
EDIT: Since when does the quick reply auto-quote a post?
gmtalk
06-20-2004, 03:19 AM
Erwin,
Great Hack. I have one request. Is there a way to make PM/Email to user feature send the response form to the thread starter and not a set userid that is called in the php file you currently have?
I assume that it is possible, but with my finite coding ability I do not know where to begin.
teksigns
06-20-2004, 03:26 AM
Erwin,
Great Hack. I have one request. Is there a way to make PM/Email to user feature send the response form to the thread starter and not a set userid that is called in the php file you currently have?
I assume that it is possible, but with my finite coding ability I do not know where to begin.
Simple .....
Change :
$formpmid = "1";
to :
$formpmid = $bbuserinfo[userid];
i have not tested this but it should send the pm to the user
that submitted the form ......
ragintajin
06-21-2004, 02:48 AM
The beauty of this hack is that once you have added the 2 templates, to make a new form, all you need to do is copy the form.php and rename it to form2.php, edit the variables in the PHP file, and you have a totally new form!!! You do not need to touch the templates again.
Format of the form:
1. One main input question
2. 2 Radio buttons Choice questions
3. 3 Normal text input questions
4. 1 Long answer question
This is customizable via the PHP file.
You can do that by adding or substracting the variables, modifying the "global section" at the top to allow the variables to be requested, and then changing the template to add or substract the variables.
It can be worked out in my hack - I've given you the tools - go forth and modify this hack to suit your site!I'm confused...so to add more questions do I have to edit the templates or not?
Erwin
06-21-2004, 03:53 AM
I'm confused...so to add more questions do I have to edit the templates or not?
You need to be a licensed user to use this hack first. :)
ragintajin
06-21-2004, 06:10 AM
You need to be a licensed user to use this hack first. :)I am...
Erwin
06-21-2004, 09:43 AM
Mmm... you are showing up as an unlicensed user for some reason... did you change your email address or something?
gmtalk
06-21-2004, 06:03 PM
Erwin,
Hack is great. I would like to provide the ability to have attachments in the form to thread feature. Is there an easy way to go about this?
The changes provided by Tek worked after some other changes made.
Erwin
06-21-2004, 08:25 PM
Erwin,
Hack is great. I would like to provide the ability to have attachments in the form to thread feature. Is there an easy way to go about this?
The changes provided by Tek worked after some other changes made.
Mmm... not a bad idea... Is there an easy way to do it? Not sure, haven't tried... maybe when I have time.
ChrisBaktis
06-23-2004, 09:22 PM
This is a great hack - I have one request. Is there a way to make it so a member can upload a photo with the form? I run a sports card trading site and want to use this form so members can upload a picture of a good card pull. It would be nice if I can add the feature to the form so they can upload the scan.
Chris
Erwin
06-23-2004, 10:28 PM
This is a great hack - I have one request. Is there a way to make it so a member can upload a photo with the form? I run a sports card trading site and want to use this form so members can upload a picture of a good card pull. It would be nice if I can add the feature to the form so they can upload the scan.
Chris
Do people want the form to upload the thing as an attachment, or just upload it to the directory? The latter is easier to do, but the former requires a bit more innovation.
Do people want the form to upload the thing as an attachment, or just upload it to the directory? The latter is easier to do, but the former requires a bit more innovation.
The ability to upload it as an attachment would be nice if it was possible.
If it was just uploaded to a directory then it would be difficult to manage permissions to who had access to it wouldn't it?
Erwin
06-24-2004, 01:44 AM
It would be an attachment to a post... mmm, it's easy in vB2, but in vB3 with the new manage attachment system, it's not as straightforward. When I have time possible...
gmtalk
06-24-2004, 08:01 AM
Erwin,
I think that doing it similar to the current new post w/attachments would be the go. As was said by WAR, I would like to have the ability to manage permissions.
Just my 2 cents.
ChrisBaktis
06-24-2004, 01:25 PM
I would want it as an attachment. I want to get the form and picture that I can then put into an HTML or another .php file to display. I like the browse option that members have when they upload attachements now.
Chris
Erwin,
Thanks Again....Great work...Big fan of your Hacks.
NOW for the challenge(?).
I would like to use to include a POLL with the post. Is this possible. It would definitely be worth while. (This would be ideal in addition to the attachment hack).
Erwin
06-28-2004, 11:14 PM
Erwin,
Thanks Again....Great work...Big fan of your Hacks.
NOW for the challenge(?).
I would like to use to include a POLL with the post. Is this possible. It would definitely be worth while. (This would be ideal in addition to the attachment hack).
Not as simple as it looks, adding poll. When I have time I may tackle this. Too busy at the moment with work and my own site.
teksigns
06-30-2004, 05:15 PM
I have a question !
i want my form to post a new thread in html ....
i have it where it works fine for the administrator .
however when a registered user post using the form
the thread just displays the raw html in the post
rather than showing the parsed html version....
the reason this happens is because i do not allow
html posting for anyone except administrators .
are there a way to make it so that post genterated with the
form allow the html to show requardless of the forum permissions
but still ristrict all other post to the forum permission of no html
'
Erwin
07-02-2004, 03:03 AM
I have a question !
i want my form to post a new thread in html ....
i have it where it works fine for the administrator .
however when a registered user post using the form
the thread just displays the raw html in the post
rather than showing the parsed html version....
the reason this happens is because i do not allow
html posting for anyone except administrators .
are there a way to make it so that post genterated with the
form allow the html to show requardless of the forum permissions
but still ristrict all other post to the forum permission of no html
'
You need to hack functions_newpost for that to occur.
ragintajin
07-02-2004, 03:28 AM
You need to be a licensed user to use this hack first. :)
Okay, its official...Steve Machol says I'm showing up as licensed...could you kindly address my questions in post #64?
Erwin
07-02-2004, 06:26 AM
Okay, its official...Steve Machol says I'm showing up as licensed...could you kindly address my questions in post #64?
Was that at vBulletin.com? Because over here, you're still showing up as unlicensed. vBulletin.org uses a separate database to check if a member is licensed.
Praxin
07-02-2004, 02:12 PM
I'm trying to pre-populate a drop down box with usernames from a specific usergroup - I know how to do it if it was all in the PHP file (cant quote it off the top of my head, got it all at home though), but I am not sure how to then translate this into the form using the actual template.
Its the templates that really bamboozle me - I'm thinking that I need to create separate variables for each returned row to then pass into the template. Anything easier?
Steve Machol
07-02-2004, 04:15 PM
Was that at vBulletin.com? Because over here, you're still showing up as unlicensed. vBulletin.org uses a separate database to check if a member is licensed.
Erwin, he's showing up as licensed for me on these forums and was yesterday when I checked. He also shows as licensed in the Admin CP here, and was yesterday when I checked.
Creative210
07-02-2004, 08:03 PM
Excellent I will be installing this. :)
I'm trying to pre-populate a drop down box with usernames from a specific usergroup - I know how to do it if it was all in the PHP file (cant quote it off the top of my head, got it all at home though), but I am not sure how to then translate this into the form using the actual template.
Its the templates that really bamboozle me - I'm thinking that I need to create separate variables for each returned row to then pass into the template. Anything easier?
I am trying to do similiar things, populating drop down menus with results from a query.
If anyone figures out an easy way to do this please share.
trainer
07-03-2004, 05:48 PM
how can i setup different layouts for different forms? do i have to add a template for each layout? if so how do i call the new template so the .php file knows what template to use?
GamerzWorld
07-03-2004, 08:30 PM
Anyone got a premade form.php i can edit for mod application
GamerzWorld
07-03-2004, 09:01 PM
Nvm, all done :) great hack
* GamerzWorld installs
blkmgc
07-04-2004, 05:19 PM
*clicks install*
got a quick question though, ok i installed it on my site (www.jo-joint.com/forums/form.php) and it only lets the user submit a form one time, is there a way to change that?
Jolten
07-09-2004, 09:46 PM
Wonderful hack!
After some modifying I'm getting a query for an uncached template. All I pretty much did was delete some radio buttons and the check for them and changed the two template names to two new custom templates. I'm having a real hard time finding what other template the script may be using other than STANDARD_ERROR.
Either way.. freakin' great hack Erwin. Thanks.
Erwin
07-09-2004, 09:50 PM
Wonderful hack!
After some modifying I'm getting a query for an uncached template. All I pretty much did was delete some radio buttons and the check for them and changed the two template names to two new custom templates. I'm having a real hard time finding what other template the script may be using other than STANDARD_ERROR.
Either way.. freakin' great hack Erwin. Thanks.
This file only uses the standard_error template.
Jolten
07-09-2004, 09:56 PM
that's what I thought. hmmm.. Thanks Erwin.
Jolten
07-09-2004, 10:18 PM
Okay help please... I've changed the three template names. The form works wonderfully.. but there's a query for an uncashed template.
if ($action=="submit") {
if ($answerall == "1") {
if ($answer1 == '' OR $answer2 == '' OR $longanswer1 == '')
{
$errormessage = "You need to answer every question, $bbuserinfo[username]!";
eval('print_output("' . fetch_template('flag_error') . '");');
exit();
}
}
eval('$formsend = "' . fetch_template('flag_answers') . '";');
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,
" . iif($type == 'thread', 'threadcount = threadcount + 1,') . "
lastpost = " . TIMENOW . ",
lastposter = '" . addslashes($bbuserinfo['username']) . "',
lastthread = '".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle',
lastthreadid = $thread[threadid]
WHERE forumid = $formforumid
");
}
if ($formemail == "1") {
vbmail($formemailaddress, $formtitle, $formsend);
}
$errormessage = "The image has been flagged.";
eval('print_output("' . fetch_template('flag_error') . '");');
exit();
}
eval('print_output("' . fetch_template('flag') . '");');
?>
2. Posted as a reply in an existing thread of your choice
When reply to an existing thread, should thread counter and last poster be updated?
Look for
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) . "','$allowsmilie','$signature','$ipaddress','$iconi d','1')");
Add after
$DB_site->query("UPDATE thread SET replycount = replycount + 1, lastpost = " . TIMENOW . ", lastposter = '".addslashes($bbuserinfo[username])."' WHERE threadid = $formreplythreadid");
Erwin
07-10-2004, 07:10 AM
Thanks mtha - forgot to add that.
Update Version 1.2
Thread count and lastposter information now updated if form is sent to existing thread.
Zip file is updated.
To upgrade, just apply the changes in the post above.
Merjawy
07-10-2004, 08:05 AM
Great hack Erwin.. will install soon I get my issues out of the way and upgrade
Thanks mtha - forgot to add that.
Update Version 1.2
Thread count and lastposter information now updated if form is sent to existing thread.
Zip file is updated.
To upgrade, just apply the changes in the post above.
:)
this one is not important, but if you want, you can fix.
when sending a PM to user, and that user has option to display a pop-up for new PM, the pop-up isnt displayed.
T2DMan
07-13-2004, 12:25 PM
Cool - this is going to be fun
Objective - each thread is a restaurant, users submit review, and review gets posted into that thread, with the data stored. Each thread shows survey to date, new survey form, and submitted reviews.
I'll report back when its all working.
Erwin
07-13-2004, 12:32 PM
:)
this one is not important, but if you want, you can fix.
when sending a PM to user, and that user has option to display a pop-up for new PM, the pop-up isnt displayed.
Really? It does for me.
Really? It does for me.
It doesn't pop the window up for me either but i wasn't worried about it.
Thanks again for this hack erwin, it has been invaluable for me as I've been building the site I am working on.
Best mod ever ! I needed this so bad.
One question how would i be able to add a drop down menu like for example:
What's your favourite color ? and then they can chose from red/blue/black/etc
I am a complete newbie so the more details you can give me the better !
Thanks !
Figured everything out.
However, is there a way to allow other usergroups to see it without them being able to submit it?
And if so, how would it be possible to make it so that when they do enter info and submit they see a message saying something like "you're not allowed to apply" ?
Thanks and sorry i am asking for so much.
romanticyao
07-20-2004, 07:38 AM
I have one question, is it possible to add dropdown box with all my fourm & subforum listed so when my user apply for mod they don't need to type the fourm name in a box? if it's possilbe please show me how its done~Thank you and again, this is a great hack.
D|ver
07-20-2004, 04:08 PM
a really great hack !!!! :D
but will there be a version in the future which allow attachment uploading, if the output is going to be submitted as a thread?
that would be great :)
Holidazed
07-20-2004, 09:28 PM
Erwin, this is awesome. However, I am having a problem.
I modified the form.php and added a bunch of questions. I also removed the radio buttons as they were not needed.
However, my form now looks like this.
http://www.dungeonkeepersdomain.com/forums/form_request_a_forum.php
It has radion buttons at the top and does not have all my questions.
What did I do wrong?
Erwin
07-20-2004, 10:21 PM
Erwin, this is awesome. However, I am having a problem.
I modified the form.php and added a bunch of questions. I also removed the radio buttons as they were not needed.
However, my form now looks like this.
http://www.dungeonkeepersdomain.com/forums/form_request_a_forum.php
It has radion buttons at the top and does not have all my questions.
What did I do wrong?
Edit the form template and remove the radio buttons in it. I can't see the page as you've made the form for registered members only.
Holidazed
07-20-2004, 10:27 PM
Well, if the template needs modifying for this, does this mean I need to modify the template for each and every different form I make? Do I make new templates? What do I call them? How do I tell hte form to look to these templates instead of the old ones?
Erwin
07-20-2004, 11:30 PM
Well, if the template needs modifying for this, does this mean I need to modify the template for each and every different form I make? Do I make new templates? What do I call them? How do I tell hte form to look to these templates instead of the old ones?
If you don't modify the number of questions, you can use the same templates.
If you want to start changing the type and number of questions, you need to copy and rename the template, and change the template name in form.php - keep doing that for new forms, only if you modify those things.
It's not hard too work out - I've made this hack to be customizable - go forth and change it however you like.
irishfreakout
07-21-2004, 04:58 PM
Just an idea for future versions (something i would fiind really useful!)
Add the ability to post to a text file for either all or part of the form.
For example, ithis would be used for collecting demographic information that is dumped into a text file then imported to Excel for analysis.
Holidazed
07-21-2004, 07:27 PM
If you don't modify the number of questions, you can use the same templates.
If you want to start changing the type and number of questions, you need to copy and rename the template, and change the template name in form.php - keep doing that for new forms, only if you modify those things.
It's not hard too work out - I've made this hack to be customizable - go forth and change it however you like.
OK, I got that resolved. I currently have the form at http://www.dungeonkeepersdomain.com/form_request_a_forum.php set so anybody can use it. It is ustilizing the the "form_request_a_forum" template and "formanswers_request_a_forum" answers template. When I fill out the form, it still says "you need to answer every question!".
I DID ANSWER EVERY QUESTION.
My "form_request_a_forum" template looks like this.
$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 bgcolor="#FFFFFF" cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
<tr>
<td>
<font color="#000000">$formpurpose</font>
</td>
</tr>
</table>
</fieldset>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="alt2" valign="middle" width="60%">
<b>Your Username</b>:</td>
<td class="alt2" valign="middle" colspan="2" width="40%">
<b>$bbuserinfo[username]</b>
</td>
</tr>
<tr>
<td class="alt2" valign="middle" width="60%">
<b>$normalquestion1</b><br>
<font face="verdana" size="1">$explain1</font>
</td>
<td class="alt2" valign="middle" colspan="2" width="40%">
<input type="text" size="30" name="normalanswer1">
</td>
</tr>
<tr>
<td class="alt2" valign="middle" width="60%">
<b>$normalquestion2</b><br>
<font face="verdana" size="1">$explain2</font>
</td>
<td class="alt2" valign="middle" colspan="2" width="40%">
<input type="text" size="30" name="normalanswer2">
</td>
</tr>
<tr>
<td class="alt2" valign="middle" width="60%">
<b>$normalquestion3</b><br>
<font face="verdana" size="1">$explain3</font>
</td>
<td class="alt2" valign="middle" colspan="2" width="40%">
<input type="text" size="30" name="normalanswer3">
</td>
</tr>
<tr>
<td class="alt2" valign="middle" width="60%">
<b>$normalquestion4</b><br>
<font face="verdana" size="1">$explain4</font>
</td>
<td class="alt2" valign="middle" colspan="2" width="40%">
<input type="text" size="30" name="normalanswer4">
</td>
</tr>
<tr>
<td class="alt2" valign="middle" width="60%">
<b>$normalquestion5</b><br>
<font face="verdana" size="1">$explain5</font>
</td>
<td class="alt2" valign="middle" colspan="2" width="40%">
<input type="text" size="30" name="normalanswer5">
</td>
</tr>
<tr>
<td colspan="3" class="alt2" valign="middle">
<b>$longquestion6</b><br>
<font face="verdana" size="1">$longexplain6</font><br>
<textarea rows="5" cols="60" name="longanswer6" wrap="VIRTUAL" maxlength="225"></textarea>
</td>
</tr>
<tr>
<td colspan="3" class="alt2" valign="middle">
<b>$longquestion7</b><br>
<font face="verdana" size="1">$longexplain7</font><br>
<textarea rows="5" cols="60" name="longanswer7" wrap="VIRTUAL" maxlength="225"></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 my "formanswers_request_a_forum" template looks like this.
$formtitle
$bbuserinfo[username]
-----------------------------------------------------
$normalquestion1
$normalanswer1
-----------------------------------------------------
$normalquestion2
$normalanswer2
-----------------------------------------------------
$normalquestion3
$normalanswer3
-----------------------------------------------------
$normalquestion4
$normalanswer4
-----------------------------------------------------
$normalquestion5
$normalanswer5
-----------------------------------------------------
$longquestion6
$longanswer6
------------------------------------------------------
$longquestion7
$longanswer7
------------------------------------------------------
It works perfectly if I do not force all the questions to be answerws.
What am I doing wrong?
you need to change the conditional in the PHP file where it checks to see if all questions have been answered to match your new format.
I don't have the files where i can look at them right now, but the line you are looking for is marked with a comment, it is a long string of if ($variable1 == "" OR $variable2 == "" OR etc...
You need to change all of the previously used variable names into the variable names you are using now:
$normalanswer1
$normalanswer2
$normalanswer3
$normalanswer4
$normalanswer5
$longanswer6
$longanswer7
If that isn't clear enough, I will post the specific line you need to change later when I get back home
Holidazed
07-21-2004, 10:04 PM
you need to change the conditional in the PHP file where it checks to see if all questions have been answered to match your new format.
I don't have the files where i can look at them right now, but the line you are looking for is marked with a comment, it is a long string of if ($variable1 == "" OR $variable2 == "" OR etc...
You need to change all of the previously used variable names into the variable names you are using now:
$normalanswer1
$normalanswer2
$normalanswer3
$normalanswer4
$normalanswer5
$longanswer6
$longanswer7
If that isn't clear enough, I will post the specific line you need to change later when I get back home
OK, it looks like this.
globalize($_POST, array(
'normalanswer1' => STR,
'normalanswer2' => STR,
'normalanswer3' => STR,
'normalanswer4' => STR,
'normalanswer5' => STR,
'longanswer6' => STR,
'longanswer7' => STR,
'action' => STR
));
Still does not work
Erwin
07-21-2004, 10:50 PM
No, not that part, that's the wrong section.
You need to modify the bit of code that checks that all questions are answered which is further down the file. The one that checks that if a variable is empty, then the person needs to answer it.
Holidazed
07-22-2004, 02:02 AM
No, not that part, that's the wrong section.
You need to modify the bit of code that checks that all questions are answered which is further down the file. The one that checks that if a variable is empty, then the person needs to answer it.Erwin, can you give me the classic "Look for" kind of help? Also, I answered all the questions I had on the form. I left NOTHING blank.
Erwin
07-22-2004, 02:25 AM
Remove the variables you don't need in this line:
if ($answerall == "1") {
if ($normalanswer1 == '' OR $radioanswer1 == '' OR $radioanswer2 == '' OR $radioanswer3 == '' OR $radioanswer3other == '' OR $answer1 == '' OR $answer2 == '' OR $answer3 == '' OR $longanswer1 == '')
Holidazed
07-22-2004, 12:09 PM
thanks
Aurous
07-26-2004, 08:54 PM
no spam control :(
:dead:
pjdaley
07-27-2004, 01:01 AM
not really a coder though :ermm:
can someone show me what to change in the php file, so i can change the title of the thread thats created into one of the answers? please?
Holidazed
07-27-2004, 02:41 PM
can someone show me what to change in the php file, so i can change the title of the thread thats created into one of the answers? please?
That is pretty self explanitory
Open up the form.php (or whatever you named it) file
Look for:
////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////
$formtitle = "Generic Form";
Replace:
$formtitle = "Generic Form";
With:
$formtitle = "thread title goes here";
LoOnEyToOnZ
07-27-2004, 03:49 PM
Dont mind if its a silly question, but the 2 templates being mentioned that has to be added, where are they ?
Holidazed
07-27-2004, 03:58 PM
Maybe I am misunderstanding you, but the templates you are referring to are included with the initial zip file. They are .txt files. Just make new templates with the same name as the .txt file (omit the .txt in the template name) and cut and paste the contects of the .txt file into the template.
pjdaley
07-27-2004, 03:59 PM
That is pretty self explanitory
Open up the form.php (or whatever you named it) file
Look for:
////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////
$formtitle = "Generic Form";
Replace:
$formtitle = "Generic Form";
With:
$formtitle = "thread title goes here";
Thank for your help. What i meant was, after the person submits the form, and it creates the thread. It says Unregistered has submitted a form! or whatever you want it with right? Well, how can i make it so the info they put for the first answer can be the title. For example, Whats your name? Joe. It'll say Joe has submitted a form! :ermm: ?
Holidazed
07-27-2004, 04:10 PM
the default values for the form show the username as the first part of the thread title. I am unsure why your are referring to "Unregistered". Maybe you should modify for form.php file to only allow groups other than "unregistered" to use the form.
hpwilhelm
07-27-2004, 08:12 PM
Thanks Erwin! Great hack! :)
One (two) questions: If submited as newthread or threadreply the postcounts for the user and forums does not update. Would this be possible to add?
And one more thing: BB-code support? (Smilies and formating) Not essensial, but would be nice... :)
hpwilhelm
07-28-2004, 07:49 AM
Thanks Erwin! Great hack! :)
One (two) questions: If submited as newthread or threadreply the postcounts for the user and forums does not update. Would this be possible to add?
And one more thing: BB-code support? (Smilies and formating) Not essensial, but would be nice... :)
I need a way to format the thread output... :ermm: Anyone?
I would prefere CSS if thats posible.
My intention is a standardised output.
Erwin
07-28-2004, 12:36 PM
Thanks Erwin! Great hack! :)
One (two) questions: If submited as newthread or threadreply the postcounts for the user and forums does not update. Would this be possible to add?
And one more thing: BB-code support? (Smilies and formating) Not essensial, but would be nice... :)
Really? They should. Is this a problem with other users?
hpwilhelm
07-28-2004, 06:22 PM
Really? They should. Is this a problem with other users?
The users postcount and the forums total postcount does not increase.
The forumsdisplay shows as when a "normal" post is made: last poster, date and postcount increase.
But the most important question for me right now is how I can format the new thread, with fonts, headers and paragraphs, not just plain text. How does vbulletin handle postformating? Now it just outputs the code as entered into both form and template... :ermm: Any ideas?
hpwilhelm
07-28-2004, 08:52 PM
But the most important question for me right now is how I can format the new thread, with fonts, headers and paragraphs, not just plain text. How does vbulletin handle postformating? Now it just outputs the code as entered into both form and template... :ermm: Any ideas?
Ok, I've enabled HTML for the destination forum, then I can format it like I want using XHTML/CSS, but the forum is open for discussions also, so I would prefere if HTML could remain "off" for everyone else besides when using the form... :p
spence2
08-01-2004, 05:07 AM
Thank you for this wonderful hack!
Erwin
08-07-2004, 06:15 AM
The users postcount and the forums total postcount does not increase.
The forumsdisplay shows as when a "normal" post is made: last poster, date and postcount increase.
But the most important question for me right now is how I can format the new thread, with fonts, headers and paragraphs, not just plain text. How does vbulletin handle postformating? Now it just outputs the code as entered into both form and template... :ermm: Any ideas?
Yeah, you're right the user post count does not increase because this is not a post. :) I never added the query to add to the user's post count.
breathwork
08-11-2004, 10:27 AM
INSTALLATION
Easy - takes only a few minutes:
1. Add the 2 templates.
2. Edit form.php - the instructions are all inside the PHP file itself, in the top half. Follow the instructions carefully!
3. Upload form.php
Just link to form1.php eg. http://www.yourforum.com/forums/form.php
Hi, I am having trouble insatlling the hack. I am new to vb hacking, how do I add 2 templates and where do I get them from and where should I place the form.php file you have in your zip file, and finally, how can I make this link to so that it always appears when a user wants to start a topic/thread or reply to a topic/thread
Sorry to be a pain, if this is too much for you, please point me somewhere where this is all explained (simply)
Many thanks
:ninja:
I can answer some Questions:
The 2 Templates you will find in the .zip-file coming to you as .txt-files. Now copy the content and open your ACP nad go to "Manage Styles" (http://www.yourForumUrl.de/admincp/template.php?do=modify). Open the scrolldown and select "Add New Template". Now you paste the content of the txtfile in the large Box. In the Title-field you put the name of the Txt-file but without its ending (.txt).
Thats all.
The Form.php you just put in your Forumsroot.
Now you can test ist on http://www.YourBoardUrl.de/form.php
Hope i could help, and now i have a question.
If an User fills out the form and it got posted as Thread the User doesn't get an Notificationmail if an answer was dropped. Even he has enabled it in UCP.
Any fix for this?
Its really an great great Hack. Thank you for your Muse.
breathwork
08-12-2004, 07:50 AM
Hey there my good teacher VAU, many thanks for your assistance, It has worked, except when I ran the form and hit submit it came back with the following error
Database error in vBulletin 3.0.3:
Invalid SQL: INSERT INTO post (postid,threadid,title,username,userid,dateline,pa getext,allowsmilie,showsignature,ipaddress,iconid, visible) VALUES (NULL,'12345','admin Generic Form','admin','1','1092300514','Generic Form
admin
What is the meaning to life?
Just a test
Choose one of the following choices
yes
Choose another one of the following choices
both
Is it yes or no? If yes, please elaborate
yes
hi there
What is your name?
Geoffrey
What is your email?
BreathWork@bigfoot.com
What is your website?
http://www.breathwork.be
-----------------------------------------------------
Please write down a paragraph about yourself.
This is a sample paragraph about my self and could be used as a means of posting a form message to a forum
------------------------------------------------------
','','','','','1')
mysql error: Table 'breathz_ibfncbb.post' doesn't exist
mysql error number: 1146
Is this normal? :ninja:
I get always a
Fatal error: Call to undefined function: gettemplate() in /home/b4ne/www/form1.php on line 214
when I try to call the form1.php file.
any idea ?
@Breathwork: Nothing to thank for.
But with your SQL-Failure i cant help you. It cant post your Informations in the Databse-table, but i'm not knowing enough to tell you why.
@b4ne: Did you add the Templates?
yes I did if I go to templates they are all there
Erwin
08-17-2004, 02:40 PM
Update Version 1.3 - Form to Poll feature added
I've added the ability to create a simple poll from the form.
In the new form.php, edit these variables -
//ENABLE POLL TO BE CREATED - 1 = yes, 0 = no
$formpoll = "1";
$formoption1 = "Yes";
$formoption2 = "No";
You can rename the 2 poll options.
I've made it default that the poll is created with 2 options, but with some code changes you can customize this obviously.
I've got it with 2 options because I use my form as a moderation application form, and the poll is automatically created in our staff forums so that staff can vote. :)
Enjoy! :)
Erwin can you help me with my previously reported problem ?
spence2
08-17-2004, 05:49 PM
Erwin,
I would love to add to my form the ability to employ Mystics' [vB 3.0.0] - Thread Category / Prefix Hack (https://vborg.vbsupport.ru/showthread.php?t=61494&page=1&pp=15).
What I need is the ability to insert the selection menu into my form similar to the way it is inserted in the attached image. Any light you might shed on the way I might go about doing this would be greatly appreciated! (BTW ... I have asked Mystics as well but so far he has not responded.)
PKRWUD
08-18-2004, 05:11 PM
AWESOME Hack!
Installed!
One question: How do I make it so that the user is redirected to the thread after they complete the form?
Virulent1
08-18-2004, 07:05 PM
ok i followed instructions... uploaded form.php and added the templates.. but im having one problem... when i go to submit the application to my self for a test.. i recieve a BLANK PM and BLANK EMAIL.. i dont get why its sending them blank... anyway very nice hack :D
Brahm
08-18-2004, 07:06 PM
Erwin,
You're a real pro. Thanks for this hack -- it rocks. I have been doing a little research on how to get this page to redirect to the new "Thread" it has created once the form is submitted and it tells you "Thank You." Is there a simple line of code I can add to the form.php that will do this?
Erwin
08-19-2004, 12:04 AM
Make sure you add the templates to the correct style. Blank pages and PMs mean the templates are not there or cannot be found.
Virulent1
08-19-2004, 12:51 AM
they are added to the correct template.. thats odd... :\ i even tryed adding them to the other.. still blank... :\ i named them form and formanswers... like they should be from what im told..
cnczone
08-19-2004, 12:55 AM
how do i check the color for those table that are black?
Erwin
08-19-2004, 04:44 AM
how do i check the color for those table that are black?
Your background must be black or somethng - modify the "form" template.
Merjawy
08-19-2004, 05:15 AM
Very nice Erwin, thanks
I have a little question :)
how can I use this hack? not technicaly, I did install it and customized it and all working just fine test posing in forum (new/reply) and email
but I guess my question is whats the best way to use it for? or how to make use of it?
I sat there with another admin trying to figure that but .....
I thought I'd just use the email part to make it like site comments or whatever
but why use that to post in the forum when we have the normal posing way or even quick posting too?
I am sorry I am not tryin to say anything other than wanting some ideas to make use of the script as I do like it
Thanks
Erwin
08-19-2004, 05:31 AM
Very nice Erwin, thanks
I have a little question :)
how can I use this hack? not technicaly, I did install it and customized it and all working just fine test posing in forum (new/reply) and email
but I guess my question is whats the best way to use it for? or how to make use of it?
I sat there with another admin trying to figure that but .....
I thought I'd just use the email part to make it like site comments or whatever
but why use that to post in the forum when we have the normal posing way or even quick posting too?
I am sorry I am not tryin to say anything other than wanting some ideas to make use of the script as I do like it
Thanks
The potential uses of this hack is listed in my first post. It's not a complete list.
I use it on my site as a moderator application form, which creates a poll automatically in my staff forum for current staff to vote.
But others have used it for manual donations, selling items etc.
Some use it as a way for guests to PM staff, or a way to submit quizzes or news articles.
It's what you want to make of it.
PKRWUD
08-19-2004, 06:33 AM
Very nice Erwin, thanks
I have a little question :)
how can I use this hack? not technicaly, I did install it and customized it and all working just fine test posing in forum (new/reply) and email
but I guess my question is whats the best way to use it for? or how to make use of it?
I sat there with another admin trying to figure that but .....
I thought I'd just use the email part to make it like site comments or whatever
but why use that to post in the forum when we have the normal posing way or even quick posting too?
I am sorry I am not tryin to say anything other than wanting some ideas to make use of the script as I do like it
Thanks
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
alqadir
08-19-2004, 07:46 AM
hey guys whats up.
I am just about to install this hack -- or as I would call it a MAJOR UPGRADE.
I want to use this form for many forums, but do not want to upload a new forum.php, and the two templetes for each forum. Each forum I want to post to will ask the same questions.
What I am asking here is, is it possible to use the same forum.php and the two templetes for multiple forums? I do not want the form answers to be posted in multiple forums. If this is possible how can I do it?
Is it also possible to for this script to find out automatically what thread the user wants to reply to?
Thanks.
PKRWUD
08-19-2004, 08:23 AM
Okay, new question. I have this hack installed for new threads in a specific forum. How do I set it up so that members are sent to my form.php when they try to start a new thread?
Erwin
08-19-2004, 08:53 PM
Update version 1.4
Fixed a bug where if you enable the Form to Reply in Existing Thread, the Forum last title and forum post count did not update.
Code added is this:
//FORUM ID WHERE THE EXISTING THREAD IS IN
$formreplyforumid = "456";
and an extra query under the $formreply=1 query code.
Sorry for the inconvenience. This part of the hack works properly now.
Erwin
08-19-2004, 08:59 PM
AWESOME Hack!
Installed!
One question: How do I make it so that the user is redirected to the thread after they complete the form?You want the user to be redirected?
I can do that easily - will make a version 1.5 that does this later this weekend just for you. Not hard at all. :) I have to leave for work now.
PKRWUD
08-20-2004, 01:50 AM
Awww. I feel so special. :D. You can see how I have it set up now, and what I've done since I couldn't figure out how to redirect. You don't have to answer all the questions. Just go here (http://www.ricehatersclub.com/vbulletin/forumdisplay.php?f=53), log in as Guest (p/w: Pass), and click on the New Thread button.
BTW, I used to live just outside of Perth. Where are you located?
PKRWUD
08-20-2004, 02:28 AM
Erwin I was also wondering if you could incorporate :
//FORUM TO POST NEW THREAD IN
$formforumid = $foruminfo[forumid];
so that you forms.php can basically over ride newthreadpost.php
would this be possible.
if so how would one change the buton assoiciation with create new thread pointing to newthread.php tp forms.php..
Thanks
This is how I did it...
In Forumdisplay template, find:
<a href="newthread.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]">
And replace it with:
<a href="<if condition="$foruminfo['forumid'] == xx">form.php<else />newthread.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]</if>">
Except you would sustitute your forum ID where it says xx. Works excellent.
Merjawy
08-20-2004, 05:49 AM
Thanks Ewrin and Chris you gave me ideas on how I could use it now
Merjawy
08-20-2004, 05:50 AM
A might be a bug report for Erwin :)
when posing a new thread all fine, when posting a reply to an existing thread the disable smiles is checked by default
alqadir
08-20-2004, 09:01 AM
thanks guys..
this is one awesome script.. would be interesting to see how ppl modded this hack to fit their site..
Erwin
08-21-2004, 12:46 PM
Version 1.5 - Major update:
- fixed bug where thread count not updated when form to forum
- fixed default posting to allow smilies and sigs when reply to thread
- added templates to cache (saves 2 queries)
- added option to change thank you message
- added options to redirect to post, thread or forum when submit
You need to upload the new form.php file - I've changed the code quite a bit in it.
Enjoy!
Erwin
08-21-2004, 12:54 PM
Awww. I feel so special. :D. You can see how I have it set up now, and what I've done since I couldn't figure out how to redirect. You don't have to answer all the questions. Just go here (http://www.ricehatersclub.com/vbulletin/forumdisplay.php?f=53), log in as Guest (p/w: Pass), and click on the New Thread button.
BTW, I used to live just outside of Perth. Where are you located?
I've added redirect in version 1.5 - you can choose to redirect to the post, the thread or the forum, or to a thank you message which you can customize. :)
I live in Melbourne.
Erwin
08-21-2004, 12:54 PM
A might be a bug report for Erwin :)
when posing a new thread all fine, when posting a reply to an existing thread the disable smiles is checked by default
Fixed in version 1.5.
ChrisBaktis
08-21-2004, 02:20 PM
Erwin,
Just a question...are you going to update this to accept picture attachments?
Thanks
Chris
spence2
08-21-2004, 04:31 PM
Is there a character limit to the textarea?
Erwin
08-22-2004, 12:17 AM
Erwin,
Just a question...are you going to update this to accept picture attachments?
Thanks
Chris
I might, but that would mean changing the templates as well, and obviously the attachment won't be PMed unless the PM attachment hack is used, and I don't use that hack. :)
But I don't think it would be hard to do. Are there many people who want that option? :)
oldford
08-22-2004, 01:51 AM
Are there many people who want that option? :) Yes! I'd like to use this hack for my classifieds forum to force people to include the info they always forget (price, location, name, etc.). Allowing attachments is a big part of placing classified ads.
Thanks for the great hack BTW. I got it running pretty easily, but would definitely like the attachment option.
PKRWUD
08-22-2004, 09:13 AM
I've added redirect in version 1.5 - you can choose to redirect to the post, the thread or the forum, or to a thank you message which you can customize. :)
I live in Melbourne.
You totally ROCK!
Thanks so much!!!
duncan99
08-22-2004, 05:03 PM
Thanks Erwin for the hack, its great I will install it. One question though, how can I change the redirect option to the forum where the user run the form.php ?
Merjawy
08-22-2004, 07:10 PM
Fixed in version 1.5.
Great, thnx Erwin
I will check it soon
as for attachment, I am not much fan of that I don't even have PM attachment hack but its a nice option to have if you got the time and not so much of trouble. :)
thnx again
Erwin
08-22-2004, 08:19 PM
Thanks Erwin for the hack, its great I will install it. One question though, how can I change the redirect option to the forum where the user run the form.php ?
Instructions in the php file itself.
duncan99
08-22-2004, 08:57 PM
Instructions in the php file itself.
I found out after the user submit the form, the redirection sends the user to the forum where the answer form will be there. In my case I set the answer form in the Admin forum which the user is not allow to have access. So how can I set the redirection to the forum I specify?
* duncan99 installed
Erwin
08-22-2004, 11:41 PM
I found out after the user submit the form, the redirection sends the user to the forum where the answer form will be there. In my case I set the answer form in the Admin forum which the user is not allow to have access. So how can I set the redirection to the forum I specify?
* duncan99 installedYou mean another forum? By default it php file redirects to the forum where the thread is made.
To specify an alternative forum -
Go down to near the end of the php file, replace $forum[forumid] in the $url line to the number of the user forum.
duncan99
08-23-2004, 12:37 AM
Thank you, it works great.
oldford
08-23-2004, 03:03 AM
This is how I did it...
In Forumdisplay template, find:
<a href="newthread.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]">
And replace it with:
<a href="<if condition="$foruminfo['forumid'] == xx">form.php<else />newthread.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]</if>">
Except you would sustitute your forum ID where it says xx. Works excellent.
Thanks for this. It works great. :)
Now can anyone tell me how that line should look if you want to have more than 1 forum? (example: forum A should use formA.php, forum B should use formB.php, etc.) Basically, how do you extend the "if condition" to work for more than 1 forumid?
Merjawy
08-23-2004, 06:16 AM
Thanks for this. It works great. :)
Now can anyone tell me how that line should look if you want to have more than 1 forum? (example: forum A should use formA.php, forum B should use formB.php, etc.) Basically, how do you extend the "if condition" to work for more than 1 forumid?
https://vborg.vbsupport.ru/showpost.php?p=521998&postcount=11
mOdEtWo
08-23-2004, 12:19 PM
I try to make the form reply to a thread, and I know I have given the right options (enabled, forumid, threadid). When the form is submitted, I get a mysql error:
mysql error: Table 'forums.post' doesn't exist
mysql error number: 1146
Is there something wrong with the post sql code?
$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)
");
oldford
08-23-2004, 01:42 PM
https://vborg.vbsupport.ru/showpost.php?p=521998&postcount=11
I thought that was to insert one form result into two different forums at the same time? Maybe I'm wrong?
All I'm talking about is the redirect code when you click on "New Thread". I have different form.php files for each forum. I just need the redirect to understand that if it's forumid 123 then clicking on "New Thread" should redirect to form123.php. And if it's forumid 456 it should go to form456.php
PKRWUD
08-23-2004, 04:59 PM
I'm very new to PHP, and I don't know that this is correct, but I believe this will work for you...
In Forumdisplay template, find:
<a href="newthread.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]">
And replace it with this:
<a href="<if condition="$foruminfo['forumid'] == xx">form.php<elseif condition="$foruminfo['forumid'] == yy">form2.php<elseif condition="$foruminfo['forumid'] == zz">form3.php<else />newthread.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]</if>">
xx is the forum ID for form.php, yy is the forum ID for form2.php, and zz is the forum ID for form3.php.
Back up your template first, but I believe this will work for you. If it doesn't, change the closing </if> tag to </endif>.
oldford
08-23-2004, 06:24 PM
Thanks, but I get a parse error. I tried both </if> and </endif>
PKRWUD
08-23-2004, 06:53 PM
Damn. Well, I'm sorry, I really thought that would do it. I'll see what I can find out.
Isaiah33
08-23-2004, 11:51 PM
a nice feature to this would be to be able to customize everything in admincp
Erwin
08-24-2004, 02:11 AM
a nice feature to this would be to be able to customize everything in admincp
Can be done, but would take a whole more coding on my behalf, and add extra queries to call up the variables from the database - I released this as courtesy for other forum admins - I don't have the time to code an Admin CP backend - wish I did. :)
Virulent1
08-24-2004, 04:00 AM
im having some trouble.. install is fine.. got everything to work.. but its about modifing this form.php...
PREVIEW HERE: http://www.craq.org/vb/form.php
See theres a textbox under the first question.. i dont want that there... and i dont want "Choose one of the following choices" either... i want Yes or No to be where that textbox is now... and Under "How long will you be able to moderate" theres suppose to be 3 choices and only 2 show up... and i don't want that text box beside it there either... well thats it.. please someone help :( heres my current code:
<?php
/*================================================= =====================*\
|| ################################################## ################## ||
|| # FORM TO THREAD/ FORUM/ PM/ EMAIL - Totally CUSTOMIZABLE FORMS # ||
|| # Version 1.3 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);
// ######################### 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,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 = "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 = "0";
//FORUM TO POST NEW THREAD IN
$formforumid = "0";
//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";
////////////////////////////////////////////////////////////////////////////////////////////////////
//ENABLE FORM TO BE PMED - 1 = yes, 0 = no
$formpm = "1";
//USERID TO PM TO
$formpmid = "1";
////////////////////////////////////////////////////////////////////////////////////////////////////
//ENABLE FORM TO BE EMAILED - 1 = yes, 0 = no
$formemail = "1";
//EMAIL ADDRESS TO EMAIL TO
$formemailaddress = "virulent@verizon.net";
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "Moderator Application";
////////////////////////////////////////////////////////////////////////////////////////////////////
//PURPOSE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////
$formpurpose = "The purpose of this form is to allow everyone at craQ [dot] org to have an equal chance at becoming a moderator.";
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////
$normalquestion1 = "Would you be able to contribute to a monthly donation for server expenses?";
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////
$radioquestion1 = "Choose one of the following choices";
// The following choices must NOT have quotation marks
$radiochoice1a = "yes";
$radiochoice1b = "no";
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 2 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////
$radioquestion2 = "How old are you? [Be honest]";
// The following choices must NOT have quotation marks
$radiochoice2a = "13 or below";
$radiochoice2b = "14 - 18";
$radiochoice2c = "18+";
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 3 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////
$radioquestion3 = "How often will you be on to moderate? [Be honest]";
// The following choices must NOT have quotation marks
$radiochoice3a = "1 Hour/Less a day";
$radiochoice3b = "2-4 Hours a day";
$radiochoice3c = "4+ Hours a Day";
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//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 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////
$longquestion1 = "Please write down a paragraph about yourself.";
$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 $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,
" . iif($type == 'thread', 'threadcount = threadcount + 1,') . "
lastpost = " . TIMENOW . ",
lastposter = '" . addslashes($bbuserinfo['username']) . "',
lastthread = '".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle',
lastthreadid = $thread[threadid]
WHERE 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) . "','$allowsmilie','$signature','$ipaddress','$iconi d','1')");
$DB_site->query("UPDATE thread SET replycount = replycount + 1, lastpost = " . TIMENOW . ", lastposter = '".addslashes($bbuserinfo[username])."' WHERE threadid = $formreplythreadid");
}
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);
}
$errormessage = "$bbuserinfo[username], thank you for submitting the $bbtitle $formtitle!";
eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
exit();
}
eval('print_output("' . fetch_template('form') . '");');
?>
mOdEtWo
08-24-2004, 04:32 AM
I try to make the form reply to a thread, and I know I have given the right options (enabled, forumid, threadid). When the form is submitted, I get a mysql error:
mysql error: Table 'forums.post' doesn't exist
mysql error number: 1146
Is there something wrong with the post sql code?
$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)
");
Erwin, got any idea why I get a database error on this?
Does "post into an existing thread" work for anyone else?
Merjawy
08-24-2004, 06:29 AM
Does "post into an existing thread" work for anyone else?
I can't answer your first question
but your second, yes it worked fine for me on new thread and post to existing thread as a reply
Isaiah33
08-24-2004, 06:48 AM
ok i isntallaed and customized it makes a great poll but doesnt show any of the vouch questions or answers
Erwin
08-24-2004, 12:13 PM
The code works.
mysql error: Table 'forums.post' doesn't exist
The code can't find your post table for whatever reason. Is your database prefix forums?
PKRWUD
08-24-2004, 12:29 PM
im having some trouble.. install is fine.. got everything to work.. but its about modifing this form.php...
PREVIEW HERE: http://www.craq.org/vb/form.php
See theres a textbox under the first question.. i dont want that there... and i dont want "Choose one of the following choices" either... i want Yes or No to be where that textbox is now... and Under "How long will you be able to moderate" theres suppose to be 3 choices and only 2 show up... and i don't want that text box beside it there either... well thats it.. please someone help :( heres my current code:
<?php
/*================================================= =====================*\
|| ################################################## ################## ||
|| # FORM TO THREAD/ FORUM/ PM/ EMAIL - Totally CUSTOMIZABLE FORMS # ||
|| # Version 1.3 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);
// ######################### 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,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 = "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 = "0";
//FORUM TO POST NEW THREAD IN
$formforumid = "0";
//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";
////////////////////////////////////////////////////////////////////////////////////////////////////
//ENABLE FORM TO BE PMED - 1 = yes, 0 = no
$formpm = "1";
//USERID TO PM TO
$formpmid = "1";
////////////////////////////////////////////////////////////////////////////////////////////////////
//ENABLE FORM TO BE EMAILED - 1 = yes, 0 = no
$formemail = "1";
//EMAIL ADDRESS TO EMAIL TO
$formemailaddress = "virulent@verizon.net";
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "Moderator Application";
////////////////////////////////////////////////////////////////////////////////////////////////////
//PURPOSE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////
$formpurpose = "The purpose of this form is to allow everyone at craQ [dot] org to have an equal chance at becoming a moderator.";
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////
$normalquestion1 = "Would you be able to contribute to a monthly donation for server expenses?";
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////
$radioquestion1 = "Choose one of the following choices";
// The following choices must NOT have quotation marks
$radiochoice1a = "yes";
$radiochoice1b = "no";
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 2 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////
$radioquestion2 = "How old are you? [Be honest]";
// The following choices must NOT have quotation marks
$radiochoice2a = "13 or below";
$radiochoice2b = "14 - 18";
$radiochoice2c = "18+";
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 3 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////
$radioquestion3 = "How often will you be on to moderate? [Be honest]";
// The following choices must NOT have quotation marks
$radiochoice3a = "1 Hour/Less a day";
$radiochoice3b = "2-4 Hours a day";
$radiochoice3c = "4+ Hours a Day";
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//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 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////
$longquestion1 = "Please write down a paragraph about yourself.";
$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 $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,
" . iif($type == 'thread', 'threadcount = threadcount + 1,') . "
lastpost = " . TIMENOW . ",
lastposter = '" . addslashes($bbuserinfo['username']) . "',
lastthread = '".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle',
lastthreadid = $thread[threadid]
WHERE 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) . "','$allowsmilie','$signature','$ipaddress','$iconi d','1')");
$DB_site->query("UPDATE thread SET replycount = replycount + 1, lastpost = " . TIMENOW . ", lastposter = '".addslashes($bbuserinfo[username])."' WHERE threadid = $formreplythreadid");
}
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);
}
$errormessage = "$bbuserinfo[username], thank you for submitting the $bbtitle $formtitle!";
eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
exit();
}
eval('print_output("' . fetch_template('form') . '");');
?>
Here's the form.php file the way you want it...
<?php
/*================================================= =====================*\
|| ################################################## ################## ||
|| # FORM TO THREAD/ FORUM/ PM/ EMAIL - Totally CUSTOMIZABLE FORMS++++# ||
|| # Version 1.3 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);
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
globalize($_POST, array(
'radioanswer1' => STR,
'radioanswer2' => STR,
'radioanswer3' => 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,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 = "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 = "0";
//FORUM TO POST NEW THREAD IN
$formforumid = "0";
//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";
////////////////////////////////////////////////////////////////////////////////////////////////////
//ENABLE FORM TO BE PMED - 1 = yes, 0 = no
$formpm = "1";
//USERID TO PM TO
$formpmid = "1";
////////////////////////////////////////////////////////////////////////////////////////////////////
//ENABLE FORM TO BE EMAILED - 1 = yes, 0 = no
$formemail = "1";
//EMAIL ADDRESS TO EMAIL TO
$formemailaddress = "virulent@verizon.net";
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "Moderator Application";
////////////////////////////////////////////////////////////////////////////////////////////////////
//PURPOSE OF FORM (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////
$formpurpose = "The purpose of this form is to allow everyone at craQ [dot] org to have an equal chance at becoming a moderator.";
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////
$radioquestion1 = "Would you be able to contribute to a monthly donation for server expenses?";
// The following choices must NOT have quotation marks
$radiochoice1a = "yes";
$radiochoice1b = "no";
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 2 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////
$radioquestion2 = "How old are you? [Be honest]";
// The following choices must NOT have quotation marks
$radiochoice2a = "13 or below";
$radiochoice2b = "14 - 18";
$radiochoice2c = "18+";
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 3 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////
$radioquestion3 = "How often will you be on to moderate? [Be honest]";
// The following choices must NOT have quotation marks
$radiochoice3a = "1 Hour/Less a day";
$radiochoice3b = "2-4 Hours a day";
$radiochoice3c = "4+ Hours a Day";
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
//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 1 (do not use quotation marks or you will get a parse error)
////////////////////////////////////////////////////////////////////////////////////////////////////
$longquestion1 = "Please write down a paragraph about yourself.";
$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 $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,
++++++++++++++++++++++++++++++++" . iif($type == 'thread', 'threadcount = threadcount + 1,') . "
++++++++++++++++++++++++++++++++lastpost = " . TIMENOW . ",
++++++++++++++++++++++++++++++++lastposter = '" . addslashes($bbuserinfo['username']) . "',
++++++++++++++++++++++++++++++++lastthread = '".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle',
++++++++++++++++++++++++++++++++lastthreadid = $thread[threadid]
++++++++++++++++++++++++++++++++WHERE 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,showsignatu++re,ipaddress,iconi d,visible) VALUES (NULL,'$formreplythreadid','".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle','".addslashes($bbuserinfo[username])."','$bbuserinfo[userid]','".time()."','" . addslashes($formsend) . "','$allowsmilie','$signature','$ipaddress','$iconi d','1')");
++++++$DB_site->query("UPDATE thread SET replycount = replycount + 1, lastpost = " . TIMENOW . ", lastposter = '".addslashes($bbuserinfo[username])."' WHERE threadid = $formreplythreadid");
++++}
++++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);
++++}
++++$errormessage = "$bbuserinfo[username], thank you for submitting the $bbtitle $formtitle!";
++++eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
+++exit();
}
eval('print_output("' . fetch_template('form') . '");');
?>
And change your formanswer template as follows...
$formtitle
$bbuserinfo[username]
$radioquestion1
$radioanswer1
$radioquestion2
$radioanswer2
$radioquestion3
$radioanswer3
$question1
$answer1
$question2
$answer2
$question3
$answer3
-----------------------------------------------------
$longquestion1
$longanswer1
------------------------------------------------------
mOdEtWo
08-24-2004, 02:52 PM
The code can't find your post table for whatever reason. Is your database prefix forums?
Nope, prefix is "vb3". Name is "forum".
Strange thing, "post a new thread" works, but not "reply to a thread". My post table is there, hehe. ;)
Virulent1
08-24-2004, 04:58 PM
hey PKRWUD, thanks alot.. i did what you said but im having a bit of trouble :[ .. i get this error: Parse error: parse error, unexpected T_INC, expecting T_VARIABLE or '$' in /home/*****/public_html/vb/form.php on line 193 then if i delete those + signs in front of line 193 i get the same error except on another line with the + signs? any ideas? i dont want to go delete them all if i dont know what im doing.
Virulent1
08-24-2004, 10:56 PM
nvm all set
Erwin
08-25-2004, 03:46 AM
Nope, prefix is "vb3". Name is "forum".
Strange thing, "post a new thread" works, but not "reply to a thread". My post table is there, hehe. ;)
Although your prefix is 'vb3' for some reason the code is looking for the post table with the prefix 'forums' - look at your error message:
mysql error: Table 'forums.post' doesn't exist
It should say 'vb3.post' not 'forums.post' shouldn't it?
Isaiah33
08-25-2004, 04:01 AM
Erwin.... I want to know if you can a part where guest can apply to get into the board. And with the poll option we select yes they shall get a email that says they got accept and gives a random password or a password they selcted. And if the voters say no they get a email that he got decilned. but it doesnt send email untill the poll gets enough votes or admin auto matic selects a button that accepts with out reaching the # of required yes.
mfowler70
08-25-2004, 01:04 PM
Works great!
Erwin
08-26-2004, 12:25 AM
Erwin.... I want to know if you can a part where guest can apply to get into the board. And with the poll option we select yes they shall get a email that says they got accept and gives a random password or a password they selcted. And if the voters say no they get a email that he got decilned. but it doesnt send email untill the poll gets enough votes or admin auto matic selects a button that accepts with out reaching the # of required yes.
Anything is possible with coding. :) But that's a totally different and very customized feature you're asking for - not hard to do, but I won't be doing it.
Isaiah33
08-26-2004, 08:02 AM
theres no way you can do becuase i suck being a coder and i know i wouldn't be able to.
oldford
08-27-2004, 02:08 AM
I thought that was to insert one form result into two different forums at the same time? Maybe I'm wrong?
All I'm talking about is the redirect code when you click on "New Thread". I have different form.php files for each forum. I just need the redirect to understand that if it's forumid 123 then clicking on "New Thread" should redirect to form123.php. And if it's forumid 456 it should go to form456.php
Does anyone else have any thoughts on this code? PKRWUD seemed pretty close, but I still got errors. Thanks!
PKRWUD
08-27-2004, 03:54 AM
nvm all set
I'm sorry, I've been away from my Mac for a few days. I just looked at the code I posted for you, and for the first time saw all those "+" signs. That's what I get for re-writing it for you in a text app instead of BBEdit! My bad. I'm glad you got it figured out!
:)
alqadir
08-27-2004, 09:57 PM
This is how I did it...
In Forumdisplay template, find:
<a href="newthread.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]">
And replace it with:
<a href="<if condition="$foruminfo['forumid'] == xx">form.php<else />newthread.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]</if>">
Except you would sustitute your forum ID where it says xx. Works excellent.
can i send variables in the form.php. ie. if i made a link that said
<a href="form.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]">
Can I access the forumid variable inside the form.php?
Will the form.php call work?
I am essentially trying to override the newthread.php.
Thanks for all your help so far.
SnowBot
08-28-2004, 03:01 AM
If i choose this option in the form.php file
//REDIRECT OPTIONS:
// 0 - thank you message
How can i add the navbar and a link back to the forum? Like a " Click Here to return to the forum"
Thanks
Snowy
PKRWUD
08-28-2004, 03:16 AM
If i choose this option in the form.php file
How can i add the navbar and a link back to the forum? Like a " Click Here to return to the forum"
Thanks
Snowy
Add $navbar directly underneath $header in the Form template.
PKRWUD
08-28-2004, 03:17 AM
can i send variables in the form.php. ie. if i made a link that said
<a href="form.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]">
Can I access the forumid variable inside the form.php?
Will the form.php call work?
I am essentially trying to override the newthread.php.
Thanks for all your help so far.
If you're asking me, I don't have a clue. Sorry.
SnowBot
08-28-2004, 04:00 AM
Add $navbar directly underneath $header in the Form template.
$navbar Is already there but i dont get the navbar when the forum is submitted and goes to the "Thank You Message"
I get the navbar when you are answering the questions but not once you submit and get redirected to the "thanks" message.
oldford
08-29-2004, 03:36 AM
I'm talking about the redirect code when you click on "New Thread". I have different form.php files for each forum. I just need the redirect to understand that if it's forumid 123 then clicking on "New Thread" should redirect to form123.php. And if it's forumid 456 it should go to form456.php
OK, finally got this to work. Here's the code if you want to have the "New Thread" button redirect to different forms for different forums. Don't forget to end with the correct number of </if> end tags to close out the code.
<a href="<if condition="$foruminfo['forumid'] == 123">form123.php<else /><if condition="$foruminfo['forumid'] == 456">form456.php<else />newthread.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]</if></if>">
PKRWUD, it looks like the <elseif> code isn't supported by VB so you need to nest <if> instead. At least according to the manual:
http://www.vbulletin.com/docs/html/main/template_conditionals
dndog
08-29-2004, 02:40 PM
Erwin,
I'm trying to make a form where someone can type the name of a website in $answer2 and then paste the link in $answer1 and it will link the word in the post. Here is my edited formanswers template:
$formtitle
$bbuserinfo[username]
Link to Site:
<A HREF="$answer1">$answer2</a>
Here is what happens:
Link to Site
<A HREF="game name">http://www.dndonlinegames.com</a>
How can I make this work? Thanks!
alqadir
08-30-2004, 01:56 AM
I got it to work, now my form.php files overwrites my newthread.
What I did was in the forumdisplay file I redirected the newthread commnd to point to filesCommand.php and in the redirection sent the current forum number. In the filesCommand.php I created multiple global arrays which stored command forum families for thread posting. I then did a CASE compare to see which form.php file should be called. Along with the form.php call I also sent the forum number and a series of on/off commands which enable and disable certain questions. This allows me to have a few generic form.php which are customized during call.
The only draw back I have right now is changing the number and type of questions since an external file handles this, so all you really need is one form.php that can customize itself during call.
If anyone is interested in the alterations I have made email me. I have a word document which highlighted all my edits. I have not put my comments in yet, but when I do I will post a link.
Thanks for all you help guys.
PKRWUD
08-30-2004, 01:52 PM
$navbar Is already there but i dont get the navbar when the forum is submitted and goes to the "Thank You Message"
I get the navbar when you are answering the questions but not once you submit and get redirected to the "thanks" message.
My bad, add $navbar directly underneath $header in the STANDARD_ERROR template.
:)
PKRWUD
08-30-2004, 01:54 PM
OK, finally got this to work. Here's the code if you want to have the "New Thread" button redirect to different forms for different forums. Don't forget to end with the correct number of </if> end tags to close out the code.
<a href="<if condition="$foruminfo['forumid'] == 123">form123.php<else /><if condition="$foruminfo['forumid'] == 456">form456.php<else />newthread.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]</if></if>">
PKRWUD, it looks like the <elseif> code isn't supported by VB so you need to nest <if> instead. At least according to the manual:
http://www.vbulletin.com/docs/html/main/template_conditionals
I am still very much a rookie at all this, but I can rebuild carburetors in my sleep. lol. Thanks for posting your findings!!!
Take care,
~Chris
PKRWUD
08-30-2004, 01:59 PM
Erwin-
I have discovered one small problem. If there is an apostrophe in the thread title, I get a MySQL error.
Erwin
08-31-2004, 03:14 AM
Erwin,
I'm trying to make a form where someone can type the name of a website in $answer2 and then paste the link in $answer1 and it will link the word in the post. Here is my edited formanswers template:
$formtitle
$bbuserinfo[username]
Link to Site:
<A HREF="$answer1">$answer2</a>
Here is what happens:
Link to Site
<A HREF="game name">http://www.dndonlinegames.com</a>
How can I make this work? Thanks!Replace:
<A HREF="$answer1">$answer2</a>
With:
The [url ] bbtag:
[url="$answer1" ] $answer2 [/url ]
Remove the space in the url tags, but keep the space around $answer2.
Erwin
08-31-2004, 03:16 AM
Erwin-
I have discovered one small problem. If there is an apostrophe in the thread title, I get a MySQL error.
Just add a \ in FRONT of any apostrophes you want to use IN the quotation marks.
PKRWUD
08-31-2004, 09:42 AM
Just add a \ in FRONT of any apostrophes you want to use IN the quotation marks.
I'm sorry, I wasn't specific enough. When ever someone fills out the form on my site, if they include an apostrophe in the box that becomes $formtitle (ie: I'm having car trouble), when they try to complete the form, they get the following error message:
Database error in vBulletin 3.0.0:
Invalid SQL:
INSERT INTO thread(title, lastpost, forumid, open, replycount,
postusername, postuserid, lastposter, dateline, iconid, visible, attach)
VALUES
('PKRWUD 'test'', 1093876723, 53,
1, 0, 'PKRWUD', 94,
'PKRWUD', 1093876723, 0, 1,
0)
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'test'', 1093876723, 53,
mysql error number: 1064
Erwin
08-31-2004, 12:19 PM
Replace:
'$formtitle'
in the query with:
'" . addslashes($formtitle) . "'
PKRWUD
08-31-2004, 01:16 PM
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,
~Chris
alqadir
08-31-2004, 06:51 PM
Newbie question: why do we have three files here? Can't everything be put in the form.php file?
The second file contains example templates thatyou will need to create in addition to the generic form.php file
dndog
08-31-2004, 08:56 PM
Replace:
<A HREF="$answer1">$answer2</a>
With:
The [url ] bbtag:
$answer2 [/url ]
Remove the space in the url tags, but keep the space around $answer2.
I tried doing that, but the url came out like this:
[URL=http://"/;www.yahoo.com"]Yahoo ("$answer1" )
Beautiful.
One minor typo in installation.txt tho..
3. Upload form.php
Just link to form1.php eg. http://www.yourforum.com/forums/form.php
:)
y2krazy
09-01-2004, 11:21 AM
Is there a way to make a form that is created to be required by any new registration before they can do anything else? Such as a form that posts an introduction thread in a specified forum when someone registers, and it will be a requirement before said new member can do anything on the entire forum(almost like a "second" registration page). Maybe a re-direct once the registration goes through or something to the form before anything else can take place. Let me know if this can be done, or is even possible. Thanks!
Thanks for the hack. I made 14 forms for my site. All leading to new threads.
I got 2 problems now. One, the posts don't count. Two, the posts don't get searched.
I fixed number one by my self.
find:$forum[forumid] = $formforumid;add before: $DB_site->query("
UPDATE " . TABLE_PREFIX . "user
SET posts = posts + 1
WHERE userid = $bbuserinfo[userid]
");
find:$forum[forumid] = $formreplyforumid;add before: $DB_site->query("
UPDATE " . TABLE_PREFIX . "user
SET posts = posts + 1
WHERE userid = $bbuserinfo[userid]
");
For the search problem, I couldn't come up with anything yet. Maybe someone else can.
dndog
09-03-2004, 08:15 PM
Does anybody know how to fix my url problem? It outputs a url like this:
http://"/;www.yahoo.com"
How can I get rid of the "?
RMS-Chef
09-04-2004, 03:43 AM
Anyone know if it would be possible to add something like a drop down menu that could list of admin defined forums in which the form would be submitted as a new thread?
I am helping a friend with writing style forum so he has many categories/forums to submit writing. Rather than creating 20 forms that are identical other than the forum they would be submitting to, it would be great to have one form with the user defining which forum to send it to as a new thread.
RMS-Chef
09-04-2004, 12:50 PM
OK, finally got this to work. Here's the code if you want to have the "New Thread" button redirect to different forms for different forums. Don't forget to end with the correct number of </if> end tags to close out the code.
<a href="<if condition="$foruminfo['forumid'] == 123">form123.php<else /><if condition="$foruminfo['forumid'] == 456">form456.php<else />newthread.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]</if></if>">
PKRWUD, it looks like the <elseif> code isn't supported by VB so you need to nest <if> instead. At least according to the manual:
http://www.vbulletin.com/docs/html/main/template_conditionalsThis works great.
I am not sure if anyone else would do it this way but I have a lot of different forms and instead of typing the name of each form file name such as:
<if condition="$foruminfo['forumid'] == 123">form123.php<else />
I instead am using:
<if condition="$foruminfo['forumid'] == 123">form$foruminfo[forumid].php<else />
Means one less thing to edit when nesting a bunch of these if/else.
This brings me to another question, would it be possible to just have one if statement and use an array of some sort like:
<if condition="$foruminfo['forumid'] == 123,124,125,126">form$foruminfo[forumid].php<else />
I know this does not work but could it be done? I am a complete code newb so I wouldn't have the first clue if it's possible or what's involved but that would cut down on huge nesting.
AmbitiousLemon
09-05-2004, 12:10 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.
PcGamer
09-05-2004, 05:56 PM
Nice modification. I have it working well on my site :)
I use my forms to just send an email to my address. Is it possible for it to send to multiple addresses? If so how?
Thanks!
Nice modification. I have it working well on my site :)
I use my forms to just send an email to my address. Is it possible for it to send to multiple addresses? If so how?
Thanks!
Sure,
Look for this: vbmail($formemailaddress, $formtitle, $formsend);copy this line over and over for as many email addreess you want the email going to. Change $formemailaddress to a different email on each line.
Anyone figured out yet how to make a thread made by these forms search able?
y2krazy
09-06-2004, 01:57 AM
Is there a way to make a form that is created to be required by any new registration before they can do anything else? Such as a form that posts an introduction thread in a specified forum when someone registers, and it will be a requirement before said new member can do anything on the entire forum(almost like a "second" registration page). Maybe a re-direct once the registration goes through or something to the form before anything else can take place. Let me know if this can be done, or is even possible. Thanks!No one has any idea how this can be done? Would be great if someone could help me out... :)
Thanks for the hack. I made 14 forms for my site. All leading to new threads.
I got 2 problems now. One, the posts don't count. Two, the posts don't get searched.
I fixed number one by my self.
find:$forum[forumid] = $formforumid;add before: $DB_site->query("
UPDATE " . TABLE_PREFIX . "user
SET posts = posts + 1
WHERE userid = $bbuserinfo[userid]
");
find:$forum[forumid] = $formreplyforumid;add before: $DB_site->query("
UPDATE " . TABLE_PREFIX . "user
SET posts = posts + 1
WHERE userid = $bbuserinfo[userid]
");
For the search problem, I couldn't come up with anything yet. Maybe someone else can.
I Just fixed a MAJOR bug in this. If you used this, you MUST fix and run 'update user post count' in you acp. ALL users post count were going up evey time one person would use the form.
Michael2
09-11-2004, 02:24 PM
This is a long thread so I'm sorry if these questions have been asked, I skimmed through it but didn't see the answers...
What would I need to do to get the thread title to be the answer from the first question? I'm using it for recipes, the first question is the recipe name, I want that to be the thread title.
Is there any way to use BB code? When I try putting it in the formanswers template I get an error when trying to save it. I want the questions to be in bold so that they stand out from the answers.
This is an awesome hack, thanks!
dndog
09-11-2004, 03:35 PM
Replace:
<A HREF="$answer1">$answer2</a>
With:
The [url ] bbtag:
$answer2 [/url ]
Remove the space in the url tags, but keep the space around $answer2.
I tried doing that, but the url came out like this:
[url]http://"/;www.yahoo.com" ("$answer1" )
Please let me know what I Can do to fix this...
wrongful
09-12-2004, 01:26 PM
Does anyone have any idea how I can add a flood check to this?
What would I need to do to get the thread title to be the answer from the first question? I'm using it for recipes, the first question is the recipe name, I want that to be the thread title.
This should do to:
Find'".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle',E=Replace with:'$answer1',Repeat this step as meny times as you can. I think it's about 5 or 6 times.
Is there any way to use BB code? When I try putting it in the formanswers template I get an error when trying to save it. I want the questions to be in bold so that they stand out from the answers.You can you BB code in the form_answer. Just make sur there is a space right before the '[' of the BB code if you are putting it right after a varible.
This is an awesome hack, thanks!Agreed.
Also, make sure you use my hack (look a few posts earlier) if you want the form to count as a post.
Ymeaga1n
09-12-2004, 08:35 PM
Erwin it appears you have some extra code at the bottom of the form template that throws it off
<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>
the extra </td></tr></table> was throwing off how my page looked on the bottom because it was closing my table speficed in my header template. Hope you have a chance to edit it.
y2krazy
09-12-2004, 11:34 PM
Is there a way to make a form that is created to be required by any new registration before they can do anything else? Such as a form that posts an introduction thread in a specified forum when someone registers, and it will be a requirement before said new member can do anything on the entire forum(almost like a "second" registration page). Maybe a re-direct once the registration goes through or something to the form before anything else can take place. Let me know if this can be done, or is even possible. Thanks!Still looking for some help here guys. A simple yes or no will do... ;)
Still looking for some help here guys. A simple yes or no will do... ;)
There is a way. But, it would take too long to explain. Basicly, make new users only see a link to the form. And all new users need one post and they change groups.
y2krazy
09-14-2004, 04:17 PM
There is a way. But, it would take too long to explain. Basicly, make new users only see a link to the form. And all new users need one post and they change groups.
Now, if only I had the time to do that... ;)
I can see it's not difficult, but I just need the time for it. I could just add an if/else statement so that they see a huge link to the form if they have < 1 post(if conditional), and if they have done the form, then they will see the normal forums view(else conditional). Thanks for the tip! ^^
Amavisca
09-16-2004, 03:32 PM
Can I use this hack with the Article hack? I just want people to post articles in a specific format. How can I do that? Thanks a lot
Line 250 need to be fixed.
switch between lastposter and lastthread
change
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($bbuserinfo['username']) . " $formtitle',
lastthread = '".addslashes(htmlspecialchars($bbuserinfo[username]))."',
lastthreadid = $formreplythreadid
WHERE forumid = $formreplyforumid
");
$forum[forumid] = $formreplyforumid;
}
to
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($bbuserinfo['username']) . "',
lastthread = '".addslashes(htmlspecialchars($bbuserinfo[username]))." $formtitle',
lastthreadid = $formreplythreadid
WHERE forumid = $formreplyforumid
");
$forum[forumid] = $formreplyforumid;
}
Erwin
09-19-2004, 11:48 PM
Fixed my ZIP mtha - thanks.
Marcus Lau
09-21-2004, 05:41 PM
Alright, PTL!!! That is awesome!!!! Thank God for you!!!
venomx
09-22-2004, 03:15 AM
I have it set to PM me when someone fills out the form. Works great but something is wrong because I do not get an email saying I have a new PM....
Erwin
09-22-2004, 01:46 PM
I have it set to PM me when someone fills out the form. Works great but something is wrong because I do not get an email saying I have a new PM....
Why bother with an email to tell you that you got a PM, when you can enable the form to be emailed to you directly? :)
venomx
09-22-2004, 01:55 PM
Because I like to get an email that I have a PM. I choose PM because its easier to save the answers. I fixed the problem I think. I just moved to a new server and on the old the catchall for emails was on but on the new server it was off so the email I used on my forum was bouncing.
Because I like to get an email that I have a PM. I choose PM because its easier to save the answers. I fixed the problem I think. I just moved to a new server and on the old the catchall for emails was on but on the new server it was off so the email I used on my forum was bouncing.
So get the form to do both, PM and Email.
Rein Masamuri
09-27-2004, 12:59 AM
ooo nice, I hope its well documented. thanks ^_^
teksigns
10-04-2004, 11:50 AM
anyone have a working textarea wysiwyg replacement for this Mod ?????
Edmund
10-06-2004, 04:37 AM
Sorry if I missed this earlier but does anyone find that search function does not capture any unique keywords from the first post in the thread?
I implemented the form and realised the following:
- post form resulting in new thread
- do search for unique keyword in thread -> no results
- post some random reply to thread
- do search again for unique keyword -> still no results
- post random reply containing unique keyword
- do search yet again for unique keyword -> finally thread is listed in results
Help!! Anyone?
Ghanem
10-08-2004, 12:48 AM
Hi,
Thank you for the great hack, I used it as a quiz form and its working fine except a bug..
when a memer does not answer all the questions (answer all is enabled) and try to go back, its seems resending the answers again and again..
I have a request too please..
How can I make it so a member can answer only one time, the next time he opens the page, he gets you have allready participated..
Regards.
Sorry if I missed this earlier but does anyone find that search function does not capture any unique keywords from the first post in the thread?
I implemented the form and realised the following:
- post form resulting in new thread
- do search for unique keyword in thread -> no results
- post some random reply to thread
- do search again for unique keyword -> still no results
- post random reply containing unique keyword
- do search yet again for unique keyword -> finally thread is listed in results
Help!! Anyone?
I mentioned this bug and another bug a few posts earlier. The other bug is that the post count doesn't go up when a user uses the form. I posted a fix to that bug. This bug I am waiting for the developers help.
I did come up with a temporary solution. I have my member directed to the 'edit post' page. When they click 'save changes' the posts goes into the search.
taffy056
10-10-2004, 05:37 PM
Hi,
I am having trouble installing this hack. how do I add the 2 templates together in the text files, and where do I put them, I am running VB 3.0.3 ?
Many thanks
taffy056
10-15-2004, 09:03 AM
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
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.