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)

Stryker412 08-19-2008 07:06 PM

Quote:

Originally Posted by skulldred (Post 1602509)
Hi all

i have a question about the creation of a new thread.

PHP Code:

PHP 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 "1"

When i set $formforumid = "1"; to //$formforumid = "1"; and open the link
how descript with do=form&f=1 nothing happens after saving. I receive the message box that all is ok but when i have a look no new thread. Have you an idea why this happen? I see in the info text that i have to set the variable but also when i open the form with the link?

Thanks for your help

If you set it to //$formforumid = "1" you are cancelling out that line, so effectively it's not posting it at all. You have to go into your admincp and look at your forum manager from there determine what the forumid is and set that line to the corresponding # and it will post within that forum.

skulldred 08-19-2008 07:21 PM

ok that's clear but whats with this: You can have a drop down menu or in the link like do=form&f=1. I think that mean i can give the forumID information over the link? On this way i have to create only one form and not for each Forum one...

Stryker412 08-19-2008 07:32 PM

Not really sure what that is, maybe the others can chime in.

farplane dragon 08-20-2008 02:06 AM

alright, I'm getting a bit frustrated here. It seems that no matter what I do, I just can't get this to work, I'm getting two errors.

Code:

Parse error: syntax error, unexpected T_STRING in /home/.earthworms/archaicstudios/archaicstudios.net/testvb/testforums/newthread.php(74) : eval()'d code on line 190
and

Code:

Invalid Forum specified. If you followed a valid link, please notify the administrator
If I didn't have so much patience, I'd have given up on this so called "easy" hack. Yeah, easy if you don't change anything but the text, but after that, it just seems to complicate itself. Can someone give me a hand with this?

ccplim 08-20-2008 03:52 AM

No offence on this but before we start pouring out the solutions, you might want to had another good look at the codes in your plugin again.

I had a look at it and discovered a few missing items like ", ; and :. :)

Quote:

Originally Posted by farplane dragon (Post 1602762)
alright, I'm getting a bit frustrated here. It seems that no matter what I do, I just can't get this to work, I'm getting two errors.

Code:

Parse error: syntax error, unexpected T_STRING in /home/.earthworms/archaicstudios/archaicstudios.net/testvb/testforums/newthread.php(74) : eval()'d code on line 190
and

Code:

Invalid Forum specified. If you followed a valid link, please notify the administrator
If I didn't have so much patience, I'd have given up on this so called "easy" hack. Yeah, easy if you don't change anything but the text, but after that, it just seems to complicate itself. Can someone give me a hand with this?


skulldred 08-20-2008 09:42 AM

Nobody knows the way over do=form&f=1? It makes a lot easier with this form... Or is there a way to to take the address in to a variable? Or is there alredy a variable? So i can take the informations from the address...

[H]Dazz 08-20-2008 11:01 AM

Does anyone know if this works with 3.7.x?

farplane dragon 08-20-2008 11:02 AM

Quote:

Originally Posted by ccplim (Post 1602810)
No offence on this but before we start pouring out the solutions, you might want to had another good look at the codes in your plugin again.

I had a look at it and discovered a few missing items like ", ; and :. :)

That's because I'm not a coder, it's not that I haven't looked over my code, it's that I have no idea where stuff is missing. I've done a little bit of code editing in the past, but nothing like I've had to do with this.

edit: I went through the 3 forms again, I fixed some of the variables on the answer form, and found some missing ; on the hook, but I have no idea if anything is wrong with the template or what else is missing. Just to note, I haven't edited the imported xml file if that makes a difference.

BlueBulletRL 08-20-2008 12:21 PM

Hey I'm trying to get this to work with cyb advanced permissions based on post count and I'm having trouble. Anyone have any idea why? I've tried changing the execution order and it did not work. Still lets me post.

ccplim 08-20-2008 01:22 PM

Quote:

Originally Posted by farplane dragon (Post 1602988)
That's because I'm not a coder, it's not that I haven't looked over my code, it's that I have no idea where stuff is missing. I've done a little bit of code editing in the past, but nothing like I've had to do with this.

edit: I went through the 3 forms again, I fixed some of the variables on the answer form, and found some missing ; on the hook, but I have no idea if anything is wrong with the template or what else is missing. Just to note, I haven't edited the imported xml file if that makes a difference.

Frankly speaking, when I posted the previous reply, I haven't even open up your form and formanswers template and look at their contents yet.

I am also not a coder myself but it is through this mod that I started to have more ideas on php, html, and javascripts.

Anyway, I have re-attached your plugin that I have edited. I have not tested it on my test site yet but I believed it should work (unless I happened to miss out any spot due to my tired eyes).

Good luck.

farplane dragon 08-20-2008 03:20 PM

Well, the good new is that it's working, however, I'm having 2 main problems. Setting to where they have to answer all questions causes it to say, "X, you have to answer all questions" even if you have.

Also, I have it set to create a new thread, but the answers are partly out of order compared to the form, any idea to how to fix that?

Also, is there a way to make it so the questions in that topic appear bold, so they stand out from the answers?

Stryker412 08-20-2008 03:50 PM

Quote:

Originally Posted by farplane dragon (Post 1603096)
Well, the good new is that it's working, however, I'm having 2 main problems. Setting to where they have to answer all questions causes it to say, "X, you have to answer all questions" even if you have.

Also, I have it set to create a new thread, but the answers are partly out of order compared to the form, any idea to how to fix that?

Also, is there a way to make it so the questions in that topic appear bold, so they stand out from the answers?

I had the same problem when I first started it too. You have to go lower down in the form area and edit this section.

Code:

if ($answerall == "1")
    {
        if ($answer1 == '' OR $answer2 == '' OR $answer4 == '' OR $dropdownanswer1 == '' OR dropdownanswer3 == '' OR $dropdownanswer4 == '' OR $longanswer1 == '')
        {
            $errormessage = "$bbuserinfo[username], you need to answer every question!";
            eval('print_output("' . fetch_template('STANDARD_ERROR') . '");');
            exit();

Make sure that all your questions are in there or ones you're not using are removed.

ccplim 08-20-2008 03:52 PM

Quote:

Originally Posted by farplane dragon (Post 1603096)
Well, the good new is that it's working, however, I'm having 2 main problems. Setting to where they have to answer all questions causes it to say, "X, you have to answer all questions" even if you have.

Also, I have it set to create a new thread, but the answers are partly out of order compared to the form, any idea to how to fix that?

Also, is there a way to make it so the questions in that topic appear bold, so they stand out from the answers?

I have not tried on the answer all questions portion but this post might provide some clues for you.

I don't really understand what do you mean in your following paragraph.

Quote:

Also, I have it set to create a new thread, but the answers are partly out of order compared to the form, any idea to how to fix that?
As for your last question, are you saying that you want the questions to be appeared in bold in your submitted form? If that is the case, just go to your formanswers template and enclose those questions that you want to appear in bold using the standard bb codes.

farplane dragon 08-20-2008 04:07 PM

This is my current hook. I don't know if I'm defining them wrong at the bottom or what.

Stryker412 08-20-2008 04:12 PM

Quote:

Originally Posted by farplane dragon (Post 1603138)
This is my current hook. I don't know if I'm defining them wrong at the bottom or what.

You have a typo.

Code:

if ($answerall == "1")
    {
        if ($normalanswer1 == '' OR $normalanswer2 == '' OR $normalanswer3 == '' OR $normalanswer4 == '' OR $normalanswer5 == '' OR $normalanswer6 == '' OR $normalanswer7 == '' OR $normalanswer8 == '' OR $normalanswer9 =='' OR $checkboxcanswer1_1 =='' OR $longanswer2 =='' OR $dropdownanswer1 =='' OR $dropdownanswers2 =='' OR $dropdownanswers3 =='' OR $dropdownanswers4 =='' OR $dropdownanswers5 =='')
        {


farplane dragon 08-20-2008 04:13 PM

Quote:

Originally Posted by ccplim (Post 1603125)
I have not tried on the answer all questions portion but this post might provide some clues for you.

I don't really understand what do you mean in your following paragraph.



As for your last question, are you saying that you want the questions to be appeared in bold in your submitted form? If that is the case, just go to your formanswers template and enclose those questions that you want to appear in bold using the standard bb codes.

What I mean, is if you look at the 2 pictures I uploaded, if you look at the post, the questions/answers are listed in a different order then on the form. For example, on the form it asks for position and then experience, but in the post it goes, experience then position, I think the next 2 were out of order too.

farplane dragon 08-20-2008 04:18 PM

Quote:

Originally Posted by Stryker412 (Post 1603142)
You have a typo.

Code:

if ($answerall == "1")
    {
        if ($normalanswer1 == '' OR $normalanswer2 == '' OR $normalanswer3 == '' OR $normalanswer4 == '' OR $normalanswer5 == '' OR $normalanswer6 == '' OR $normalanswer7 == '' OR $normalanswer8 == '' OR $normalanswer9 =='' OR $checkboxcanswer1_1 =='' OR $longanswer2 =='' OR $dropdownanswer1 =='' OR $dropdownanswers2 =='' OR $dropdownanswers3 =='' OR $dropdownanswers4 =='' OR $dropdownanswers5 =='')
        {


Even after fixing that, the problem still persists

Quote:

Originally Posted by ccplim (Post 1603125)
I have not tried on the answer all questions portion but this post might provide some clues for you.

What's the difference between that and what's already there? It seems the same to me

Maybe the dropdown box is the problem?

EDIT: As I supected, it was adding the drop down box to that line that caused the problem. So know all that's left is the order problem.

EDIT2: Actually, now it just gets stuck on the thank you screen.

ccplim 08-20-2008 04:22 PM

Quote:

Originally Posted by farplane dragon (Post 1603143)
What I mean, is if you look at the 2 pictures I uploaded, if you look at the post, the questions/answers are listed in a different order then on the form. For example, on the form it asks for position and then experience, but in the post it goes, experience then position, I think the next 2 were out of order too.

I see..... you just need to rearrange the items in the formanswers template to the correct position that you want.

ccplim 08-20-2008 04:29 PM

Quote:

Originally Posted by farplane dragon (Post 1603145)
What's the difference between that and what's already there? It seems the same to me

Maybe the dropdown box is the problem?

I will need to figure that out as I have not done that on my side yet. I'll try to take a look at it tomorrow morning (it's now 1.30am over here and I need to get some sleep :p)

farplane dragon 08-20-2008 04:35 PM

Quote:

Originally Posted by ccplim (Post 1603156)
I will need to figure that out as I have not done that on my side yet. I'll try to take a look at it tomorrow morning (it's now 1.30am over here and I need to get some sleep :p)

Yeah, yeah, cool. Thanks for the help so far. I actually got the answer all problem fixed, it's just the "getting stuck on the thank you screen" I have to figure out.

Stryker412 08-20-2008 07:13 PM

Quote:

Originally Posted by farplane dragon (Post 1603160)
Yeah, yeah, cool. Thanks for the help so far. I actually got the answer all problem fixed, it's just the "getting stuck on the thank you screen" I have to figure out.

What do you mean by this?

Daggerzz 08-20-2008 08:13 PM

I am sure that this question has been asked. With over 80 pages, it is probably in there somewhere, but I have not found an exact match to my problem. So maybe someone can help me.

I want to call my copy of the hack in this way:

PHP Code:

/newthread.php?dp=myform&p=### 

where ### is the post I want to reply to.

I can generate this link without problem. My form begins executing. I can echo to the screen for verification, the "p" variable, by accessing $_REQUEST['p'].

I want to set the variable $formreplythreadid to this "p" variable. I have tried various variations:
PHP Code:

$formreplythreadid $_REQUEST['p']; 

or this
PHP Code:

$x $_REQUEST['p'];
$formreplythreadid $x

I also attempted to add a variable to the form like other user input variables, using
something like this:
PHP Code:

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

// Part 2
$var1$vbulletin->GPC['var1'];
$wheretogo$vbulletin->GPC['wheretogo']; 

With the value defined in this way, I tried to assign to it in two different ways. First I tried to directly assign to it:
PHP Code:

$wheretogo $_REQUEST['p']; 

and lastly I tried to allow the user to input the value via the form input screen. This works so I know a variable will work. But I cant figure out how to have the program assign the variable

In all cases, I could echo the value to the screen with success; however, in all cases when I tried to assign my variables value to $formreplythreadid, the value seems to be empty.

How can I set the value $formreplythreadid to a value that is generated at runtime?

farplane dragon 08-20-2008 09:14 PM

Quote:

Originally Posted by Stryker412 (Post 1603218)
What do you mean by this?

Normally, I'd see the thank you screen then get redirected back to forumhome I believe. Now, I see the thank you screen and that's it, it doesn't redirect to anywhere.

skulldred 08-20-2008 09:54 PM

Hi Daggerzz i have the same problem but with threads... I guess that is the solution... :

//ENABLE FORM TO REPLY TO EXISTING THREAD - 1 = yes, 0 = no
$formreply = "1";
if ($dropdownanswer1 == 'Mage'){
$formreplythreadid = "43";}
if ($dropdownanswer1 == 'Warlock'){
$formreplythreadid = "34";}
if ($dropdownanswer1 == 'Warrior'){
$formreplythreadid = "41";}
if ($dropdownanswer1 == 'Rogue'){
$formreplythreadid = "42";}
if ($dropdownanswer1 == 'Priest'){
$formreplythreadid = "40";}
if ($dropdownanswer1 == 'Hunter'){
$formreplythreadid = "46";}
if ($dropdownanswer1 == 'Paladin'){
$formreplythreadid = "45";}
if ($dropdownanswer1 == 'Shaman'){
$formreplythreadid = "44";}
//EXISTING THREAD ID FOR FORM TO REPLY IN

Can you explain me where you have added this code please? $x = $_REQUEST['p'];

Daggerzz 08-20-2008 11:50 PM

Quote:

Originally Posted by

Can you explain me where you have added this code please? $x = $_REQUEST['p'
;

I put this in the form hack right after I defined the variables. i know this is teh right value because i can make it display the number. The problem is if iIuse that as a variable for $formreplythreadid it gives me an error. I need to be able to post this to any number of threads so a drop down box would not work.

Stryker412 08-22-2008 09:05 PM

Quote:

Originally Posted by farplane dragon (Post 1603301)
Normally, I'd see the thank you screen then get redirected back to forumhome I believe. Now, I see the thank you screen and that's it, it doesn't redirect to anywhere.

That's how it is on mine too, it never redirected. I would like to know if you find out how.

Also, I'd like to beg/plead one more last time if someone can help me set up a birthday question so the three drop down menus are side by side on the same line.

BlueBulletRL 08-24-2008 03:43 PM

Also I will plead again someone please help me!

cragtay 08-25-2008 07:20 AM

I make my question in a quote because after posted this, I saw Daggerzz's post. The problem is similar. However, I typed my question so I don't want to delete it :">


Quote:

For example, I have 2 categories: A and B, and in each category, there are 3 forums.
The forum ids are 2, 4, 6 (3 forums in category A) and 5, 7, 9 (3 forums in category B).

I want to design 2 forms (newA and newB) for each category. 3 forums in each category will use a common form.

http://mydomain.com/newthread.php?do=newA&f=2
http://mydomain.com/newthread.php?do=newA&f=4
http://mydomain.com/newthread.php?do=newA&f=6

http://mydomain.com/newthread.php?do=newB&f=5
http://mydomain.com/newthread.php?do=newB&f=7
http://mydomain.com/newthread.php?do=newB&f=9

How can I do that?

I think that I should get the forumid from the URL to put into the variable $formforumid in the form template (newA or newB). Is it possible?
If I don't make that number a variable, then I have to make 3 separate forms, whose the contents are same, but names are different, for each category. In the example, there are only 6 forums. However, in practically, there may have more forums that 6. Make seperate form for each forum is really not effective way.

Could someone help me?

Stryker412 08-25-2008 12:55 PM

Thanks to Abe I was able to get the triple drop down question working.

Vackrick 08-26-2008 02:25 AM

Parse error: syntax error, unexpected T_VARIABLE in /home/shawnyue/public_html/forum/newthread.php(74) : eval()'d code on line 191

Vackrick 08-26-2008 03:35 AM

How to add this into the templete???

$dropdownquestion1 = "Suspension Reason";

// The following choices must NOT have quotation marks
$dropdownchoice1a = "Inactivity";
$dropdownchoice1b = "No Ads";
$dropdownchoice1c = "Wrong Ads ";
$dropdownchoice1d = "Incorrect Placement Of Ads";
$dropdownchoice1e = "No Index Up Within 1 Week Or More";
$dropdownchoice1f = "Another Reason That Is Unlisted";
$dropdownchoice1g = "Unknown";

mustang_lex 08-26-2008 01:12 PM

<font color="Red">Threads automatically generated state that they are "Moderated" SOLVED!
Form missing "Manage Attachments" SOLVED!
</font>

For those who have had this happen to them. I found the solutions. Its quite simple but easily overlooked. Please note that in my situation, the form was being posted to an admin forum that is not accessible to any registered users, just admins.

1) Login into Admin CP
2) Under "Forum and Moderators" click Forum Permissions
3) Go to the forum that the form gets submitted to.
4) Click "Edit" on the usergroup that uses the form (you may need to do this for more then just one usergroup)
5) Because in my situation, everything was set to NO. So I selected YES to "Can Post Threads", "Follow Forum Moderation Rules" and "Can Upload Attachments".
6) Save and volla. Well it worked for me.

Stryker412 08-26-2008 01:55 PM

I didn't test my triple drop down question in IE. It shows in Firefox fine, but in IE the one drop down box does not even appear.

Edit: fixed

cragtay 08-27-2008 08:34 AM

In the default form template of Form Hack 4.1, there is only one place where user can use editor menu bar, emotions, etc., i.e. $messagearea

Can I create another place where user can use editor menu bar, emotions, etc. in a form? I may have only one VB TEXT AREA INPUT, but is there any way to have one more field where user can use bbcode, emoticons, etc.?

viper357 08-27-2008 01:01 PM

I have 2 forms up and running but when I click submit on my newly created form it is not creating any threads, I have tried various forum numbers but nothing?

skulldred 08-27-2008 10:32 PM

My solution:

Add:
PHP Code:

<input type="hidden" value="$foidname="fid" /> 

after:
PHP Code:

<input type="hidden" value="$formnamename="do" /> 

then set the variable:
PHP Code:

'foid' => TYPE_STR 

PHP Code:

$foid $_REQUEST['fid']; 

and now add the following:

PHP 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.
if ($foid == '5'){
$formforumid "5";}
if (
$foid == '6'){
$formforumid "6";} 

open the form with:
newthread.php?do=form&fid=5 or 6 or what you want

thats it

lazytown 08-28-2008 12:12 AM

For those of you trying to use this as a "contact us" form but are frustrated with the spam, I found a solution..

Use this mod https://vborg.vbsupport.ru/showthread.php?t=186926 instead (only useful for a single contact us form to be posted as a thread).. Uses the spam prevention features of vbulletin.

-vissa

BlueBulletRL 09-02-2008 02:19 AM

pretty please someone help me

Castro82 09-03-2008 02:21 PM

after the update to 3.7.3 there is an securitytokken error using this hack.?

DieselMinded 09-05-2008 12:59 AM

WOW will implement when its updated next


All times are GMT. The time now is 08:06 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.05798 seconds
  • Memory Usage 1,886KB
  • 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
  • (7)bbcode_code_printable
  • (11)bbcode_php_printable
  • (19)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

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

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