vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   New Posting Features - Form Hack (https://vborg.vbsupport.ru/showthread.php?t=126676)

jiffy 07-13-2007 08:53 PM

I don't claim to be a PHP wizard but why does it not work for me to change this code:
Code:

$posttitle = "$formtitle";
To this code:
Code:

$posttitle = "$normalquestion1";
I'm trying to get the new thread to have the title of the text filled in to normalquestion1. Seems like this is a simple thing but when I try the second code a new thread is never created. It processes the form fine, at least it seems like it does but no thread shows up in the forum. When I change the code back to "$forumtitle" it works fine again. Weird.

TheMilkCarton 07-13-2007 10:40 PM

Here's what I use:

Code:

$formtitle = "$normalanswer1 - $answer1 - $dropdownanswer1 $answer3, $dropdownanswer2";
$posttitle = "$formtitle";

And it works just fine. I also made $pagetitle into something custom (and changed the breadcrumb in the form template to show $pagetitle) otherwise the name of the form, the breadcrumb, and the title of page will be blank, since the answers have yet to be filled out yet.

OHH... duh. Look at your code again, you're using $normalquestion1 instead of $normalanswer1. :)

jiffy 07-14-2007 02:24 PM

Quote:

Originally Posted by TheMilkCarton (Post 1290351)
OHH... duh. Look at your code again, you're using $normalquestion1 instead of $normalanswer1. :)

You my friend are my hero. Can't believe I didn't notice that. All is good now. :)

StudMuffin21 07-15-2007 10:24 PM

So I'm still having problems getting the forum answers to show up. I have it set up to where after submitting the form, a new thread is created. For the most part it works fine, but not all the questions show their answers.

Any suggestions? I've been unable to get this working, and have worked on it for at least a month now :(

lazytown 07-17-2007 04:59 AM

I'm using this as a glorified contact-us. I noticed with 3.6.5 (patched) that guest forms are NOT being posted to the forum. If a member uses the forum, it works fine. If a guest uses it, it looks like it goes through ok but nothing shows up. Any ideas?

-vissa

pbmansion 07-18-2007 04:37 PM

Is there a way to have more columns and a much larger selection?

Deepdog009 07-19-2007 12:30 AM

Quote:

Originally Posted by vissa (Post 1293403)
I'm using this as a glorified contact-us. I noticed with 3.6.5 (patched) that guest forms are NOT being posted to the forum. If a member uses the forum, it works fine. If a guest uses it, it looks like it goes through ok but nothing shows up. Any ideas?

-vissa

Turn off your image verification in vbulletin options and your issue B solved...

Good luck


+++++++++++++++++++++++++++++++++++++++++++++++
StudMuffin21
So I'm still having problems getting the forum answers to show up. I have it set up to where after submitting the form, a new thread is created. For the most part it works fine, but not all the questions show their answers.
+++++++++++++++++++++++++++++++++++++++++++++++
Upload your form in txt format and I will C if I can fix your issue...?


^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pbmansion,,, U can make your form a colossus monster if U want, I have several forms that have 30 questions and many more that are Godzilla's...;)

There's no limit, the problem is making them work properly and keeping the rif raf scum, scabs, spammers and leechs out...:D

StudMuffin21 07-19-2007 12:48 AM

Deepdog009

Here is the information you requested. I've gone over it many times, but can't find what I'm doing wrong. Any assistance is appreciated. :)

I uploaded the files in txt format instead of posting them on the forum to save space.

TheMilkCarton 07-19-2007 11:26 AM

Without looking too far into it, I'd say there is a slim chance that your form templates are causing it.

You most likely didn't add $answers 4-8 and $longanswers 2-3 to the VARIABLES section in your Form plugin.

For you, that section should look like:
Code:

// Part 1
$vbulletin->input->clean_array_gpc('p', array(
'answer1' => TYPE_STR,
'answer2' => TYPE_STR,
'answer3' => TYPE_STR,
'answer4' => TYPE_STR,
'answer5' => TYPE_STR,
'answer6' => TYPE_STR,
'answer7' => TYPE_STR,
'answer8' => TYPE_STR,
'dropdownanswer1' => TYPE_STR,
'longanswer1' => TYPE_STR
'longanswer2' => TYPE_STR
'longanswer3' => TYPE_STR
));

// Part 2
$answer1 = $vbulletin->GPC['answer1'];
$answer2 = $vbulletin->GPC['answer2'];
$answer3 = $vbulletin->GPC['answer3'];
$answer4 = $vbulletin->GPC['answer4'];
$answer5 = $vbulletin->GPC['answer5'];
$answer6 = $vbulletin->GPC['answer6'];
$answer7 = $vbulletin->GPC['answer7'];
$answer8 = $vbulletin->GPC['answer8'];
$dropdownanswer1 = $vbulletin->GPC['dropdownanswer1'];
$longanswer1 = $vbulletin->GPC['longanswer1'];
$longanswer2 = $vbulletin->GPC['longanswer2'];
$longanswer3 = $vbulletin->GPC['longanswer3'];


TheMilkCarton 07-19-2007 11:39 AM

Quote:

Originally Posted by vissa (Post 1295599)
So you're saying I can't have image verification for searches and a contact-us form for guests at the same time?

Yeah. I made a fix for this a long time ago.. which I never ended up releasing. I think DeepDog released an Add-On to this Form Hack, but it's not the *REAL* image verification, so I think you still may have to disable Guest Image Verification for everything.

Erm... Apparently you deleted your post.. haha.

--------------------------------------------------
Edit: Does this form handle all errors correctly? For instance, when trying to submit a form where the Post Title is longer than the limit set in vBulletin Options, it gives my users "Invalid Forum Specified", instead of returning an error saying "Thread Title is too long" or whatever. I'm pretty sure it's not any of the modifications to the Form Hack that I've done, since I looked through the plugin code and can't find any references to the post title length.

Edit2: Well, the "fix" is simple enough. I just had to put a maxlength="" on all the input fields that add up to make my thread title.

lazytown 07-19-2007 12:25 PM

<a href="https://vborg.vbsupport.ru/member.php?u=72648" target="_blank">Deepdog009</a> - thanks for your help, that fixed the invisible guest problem (turning off captcha for new guest posts -- which we don't allow in any of our forums anyways).

Now I have a second problem (I've seen it mentioned a long time ago). When a guest uses the contact us form that is posted in a thread, it becomes a thread that requires moderator approval. Other mods have gotten around this type of problem by assigning a user account to the mod that posts (like auto-bans or duplicate account reports). Has anyone solved this problem for this mod?

Thanks
-vissa

StudMuffin21 07-19-2007 04:57 PM

Quote:

Originally Posted by TheMilkCarton (Post 1295598)
Without looking too far into it, I'd say there is a slim chance that your form templates are causing it.

Attached is the copy of the form hack code.

NOTE: After the problem is fixed, I will try and remember to delete these attachments.

Deepdog009 07-19-2007 10:29 PM

Quote:

Originally Posted by StudMuffin21 (Post 1295851)
Attached is the copy of the form hack code.

NOTE: After the problem is fixed, I will try and remember to delete these attachments.

StudMuffin21 I think Milk Carton shedded some light on your issue...

sorry, but been busy and forgot 2 stop by here the last few dias. I forgot what your issue was?

I will download files and post about it soon as i can:)...

StudMuffin21 07-20-2007 02:26 AM

Deepdon009 and MilkCarton,

I changed the coding so it now reads correctly as you had suggested (previously that portion was not correct); however, I am still getting the same problem.

On the form, all questions and blank spaces show up. When submitting the form, only the answers for questions 1, 2, 3, and 10 are displayed. I've gone over the code again a few times today and don't know what I have overlooked.

TheMilkCarton 07-20-2007 03:32 AM

Quote:

Originally Posted by StudMuffin21 (Post 1296205)
Deepdon009 and MilkCarton,

I changed the coding so it now reads correctly as you had suggested (previously that portion was not correct); however, I am still getting the same problem.

On the form, all questions and blank spaces show up. When submitting the form, only the answers for questions 1, 2, 3, and 10 are displayed. I've gone over the code again a few times today and don't know what I have overlooked.

Ummm... The $answers 4-8 and $longanswers 2-3 are commented out in the TXT file you uploaded.

You need to remove the // from each line.

And there is no question 10? unless you mean longanswer1

StudMuffin21 07-20-2007 06:05 AM

If I remove the // marks, I get these errors:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/cobaltli/public_html/newthread.php(71) : eval()'d code on line 638

and

Invalid thread specified

Yes, by question 10, 11 and 12, I mean the long answers.

Deepdog009 07-20-2007 07:13 PM

Quote:

Originally Posted by StudMuffin21 (Post 1295851)
Attached is the copy of the form hack code.

NOTE: After the problem is fixed, I will try and remember to delete these attachments.


Ok, corrected a bit of code and its ALIVE;)


Studdmuffin21, I like yo name,,, N-E ways yo issue was with here...>>>

HTML Code:

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

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

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

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

Change 2 match your form {{{CLA}}} ...
The other form already is using those titles...
When U create new forms, U must create all new info {{{names}}} for main template, answers template and plugin form name must be different from the rest of your forms...

ABE1 has this in hook, if your new forms dont work always double check new names of all templates and plugin info. If U get PARSE errors then its a code issue, somewhere U may have added something by mistake or using the wrong code characters.

HTML Code:

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

// Name of the main template
$maintemplate = "studmuffin21";
// Name of the answer template
$answertemplate = "studmuffin21answers";

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

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


Everything else was looking outta sight:D

StudMuffin21 07-20-2007 08:14 PM

lol..yeah that name has a story behind it. Some really good lookin girl gave it to me a long time ago as a call sign when I couldn't come up with one for a laser tag game. haha...I just had to keep it.

Anyway, ok so here is what I did. As you suggested, I created two new templates. One named "form1" and the other "formanswers1" I then edited the code to read the exact name of those templates as you suggested in your post (only instead of using studmuffin21, I used form1).

I feel so stupid cause I still am getting the same problem. And that is not all of the answers show up when the form is submitted.

I've gone over the templates and hack several times again but did not see any problems, though keep in mind I am not a coder.

Should I try to uninstall and delete everything and reinstall it? Would that make a difference? Or is there something I am missing still?

And by the way, thank you very much for your continued efforts to help me resolve this problem. I do much appreciate it :D

Fireproof 07-20-2007 09:08 PM

Hey guys,

This Form Hack is just what I need to create a standardized "Product Review" form for my forums. Unfortunately, despite my efforts, I can't get it to work. I'm far from a coder and know nothing about php or xml anyway, so that doesn't surprise me, LOL.

The proposal: I've mocked up what i want my form to look like. Does anyone want to configure this hack for me for a few bucks?

Deepdog009 07-21-2007 12:02 AM

Quote:

Originally Posted by StudMuffin21 (Post 1296864)
lol..yeah that name has a story behind it. Some really good lookin girl gave it to me a long time ago as a call sign when I couldn't come up with one for a laser tag game. haha...I just had to keep it.

Anyway, ok so here is what I did. As you suggested, I created two new templates. One named "form1" and the other "formanswers1" I then edited the code to read the exact name of those templates as you suggested in your post (only instead of using studmuffin21, I used form1).

I feel so stupid cause I still am getting the same problem. And that is not all of the answers show up when the form is submitted.

I've gone over the templates and hack several times again but did not see any problems, though keep in mind I am not a coder.

Should I try to uninstall and delete everything and reinstall it? Would that make a difference? Or is there something I am missing still?

And by the way, thank you very much for your continued efforts to help me resolve this problem. I do much appreciate it :D

Sorry, misunderstood your Question...
Looking at your form preview and I-C your problem...
Give me a moment and I shall resolve... :o

Deepdog009 07-21-2007 12:36 AM

Ok, found yo issue...

HTML Code:

// Part 1
$vbulletin->input->clean_array_gpc('p', array(
'radioanswer3other' => TYPE_STR,
'answer1' => TYPE_STR,
'answer2' => TYPE_STR,
'answer3' => TYPE_STR,
'answer4' => TYPE_STR,
'answer5' => TYPE_STR,
'answer6' => TYPE_STR,
'answer7' => TYPE_STR,
'answer8' => TYPE_STR,
'dropdownanswer1' => TYPE_STR,
'longanswer1' => TYPE_STR    <<<..... comma missing here
'longanswer2' =>
TYPE_STR  <<<.... comma missing here
'longanswer3' =>
TYPE_STR
));

COMMA's missing...

Add comma's at the end and as Milk Carton was saying get rid of the {{{ // }}} and that will rectify yo issues...


Good Luck;)

StudMuffin21 07-21-2007 12:58 AM

Ah man! I knew it was gonna be something stupid! :( I can't believe I didn't see that.

Well it is all working now. Thank you SO very much for your help. You saved me a ton of hours of headache. :D:D:D:D:D:D

shanevas2 07-21-2007 05:15 AM

What am i doing wrong? I have it all set up but after they fill out all the fields and click submit you get this and no new thread

No Thread specified. If you followed a valid link, please notify the administrator

shanevas2 07-21-2007 05:17 AM

oops

shanevas2 07-21-2007 07:39 PM

any one?

Alfa1 07-21-2007 08:32 PM

Will this work with GARS?

Deepdog009 07-22-2007 03:18 PM

Quote:

Originally Posted by shanevas2 (Post 1297151)
What am i doing wrong? I have it all set up but after they fill out all the fields and click submit you get this and no new thread

No Thread specified. If you followed a valid link, please notify the administrator

Shanevas2 go back a few pages in this Mod and U will C several posts that relate 2 your issue...

Its a plugin issue thats causing that message...

When editing your new form, go one step at a time and check your form after every edit, that way U will know where the issue is if there is one...

Good Luck

popowich 07-22-2007 09:48 PM

The form page sends my web server to 100% and locks up my forum when trying to view a form.

-Raymond

shanevas2 07-23-2007 12:23 AM

I can not find it?

shanevas2 07-23-2007 03:43 AM

Is this right?
Code:

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


shanevas2 07-24-2007 02:08 AM

???? any one?

popowich 07-24-2007 02:12 AM

The developer may kill me, but try putting the entire plugin code in a thread.

Well, the editable section, everything above the "Don't edit here and below" line.

Please wrap it in php code tags.

And don't bump threads so much, it's free support ya know. ;)

Thank you.

-Raymond

StudMuffin21 07-24-2007 04:38 AM

Shane,

I'm not sure how you have it set up, but here is what u need to do.

Referring to the code below:
Where it says
Code:

$forumform = "1";
You need to change your code exactly as that reads in order for your form to be posted as a new thread somewhere on your forum. In other words, make the number inside the parenthesis a number 1 to make it post a new thread, or a 0 to not post.

Now that that is done, you need to make sure you have your forum id set up correctly. So where the code says
Code:

$formforumid = "59";
you need to ensure the number in the parenthesis is the correct id of the section of the forum you want a new thread to be posted. To find that id, go to your main forums page. From there click on the exact forum you want the new thread to be posted in. Now look at your URL. At the very end of the URL there will be a number (at the top of the ULR for THIS website, the number should read 126676). Insert the number you find on YOUR site at the end of the URL for the section you want the thread to be posted in the forumid section of the code.

That should make it work for ya.



EXAMPLE:
Code:

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

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


StudMuffin21 07-24-2007 04:44 AM

DeepDog,

If I may acquire your assistance hopefully one last time.

The form I was having problems with is now working like a dream!! Thank you for creating such an easy hack.

That said, I am having troubles creating a second form.

I created a second plugin with the correct code (though I may need to post it later if I have troubles again. I then created a second set of templates to match that second form (making sure I made the names correctly).

However, when trying to view the form I get the following error:
Code:

Parse error: syntax error, unexpected T_VARIABLE in /home/cobaltli/public_html/newthread.php(71) : eval()'d code on line 217
I'm sure it has something to do with my plugin part of the code, but I'm not sure which. As usual, I've looked over the code plenty of times before posting this to make sure I didn't overlook something stupid (though I have done that before).

One thought I have is that the style templates for the NEW second form have a Product name of vBulletin instead of Form Hack as do the other style templates for the first form. I could not for the life of me get tis Product name to change.

In any case, any suggestions are appreciated. Thank you!

SuthernKumfort 07-24-2007 06:16 AM

Can you take a look at this screenshot and tell me how to get rid of the black in the boxes in the upper part of the form. You can view the site at www.wmdgaming.com

https://vborg.vbsupport.ru/

vFan 07-24-2007 04:56 PM

Does anyone know the answer to my question(s) below? Thx.


Quote:

Originally Posted by vFan (Post 1279336)
Silly question perhaps, but in addition to being posted to a thread, poll, etc., does the information submitted via the form hack automatically get stored in the database as well? If it doesn't get stored in the db then is it possible to modifiy the form to have 2 actions associated with the submit button. (You know like the ability to submit info to a db while notifying someone via email that their order has been received.) What I want is for the form data to be posted to a thread upon submission as well as storing it in the db so I can send it on to a different application it later. If if can be done, how do I do it?

(By the way, I have looked through the tables in my db and do not see any of the information that has been posted to my threads so I'm assuming that it only gets posted not stored ? Please correct me if I'm wrong)

Sorry if this is a ridiculous question but I am not a coder. Any help is appreciated. Thanks.


shanevas2 07-25-2007 03:45 AM

Still not working. Acts like it is but not posting it.

http://www.uscarmeets.com/forumdisplay.php?f=121

Code:

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

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


StudMuffin21 07-25-2007 06:39 AM

Ok Shane,

Just so I understand you correctly, you want the form to be posted in the link you provided, correct?

anuanu 07-25-2007 08:56 PM

I got a question and i have tried playing around with the code to get it to work but nope still cant...

for this code=
Code:

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

I have two of those 1 after the other both with different names for the $vbtextquestion and they both show up but only one of them the editor works. The other one acts like a message inside of a gif.

This is the code i have
Code:

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

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

top one works and i use the entire editor (change font size, style, smilies etc) The other one just acts as a normal fill in the blank and i cant click on any of the font sizes/styles/smilies etc.

How would i fix this?

Deepdog009 07-25-2007 09:01 PM

Quote:

Originally Posted by shanevas2 (Post 1298737)
Is this right?
Code:

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


Out of town again...

Shanevas2 I think its best if U let me look at yo form files...
Convert into txt format and upload 2 post so that I can take a look C...???

Good Luck

*********************************************

SuthernKumfort U will need 2 edit or modify your main template 2 make changes on colors of form ???

*********************************************

StudMuffin21 I can help its no problem, but at this time im helping some offline folks and others with forms, so bare with me...

Upload your files as before and I shall take a look C...


Thank god I love working with forms:eek:


All times are GMT. The time now is 05:00 AM.

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

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

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

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