vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   New Posting Features - Easy Forms v4.x - Create a form or multiple forms without php or html knowledge (https://vborg.vbsupport.ru/showthread.php?t=234385)

redraider 08-15-2010 10:25 PM

Need help, I havent been able to figure out how to allow user to choose which forum they want to post the question to.

In short : There is just one form that the user uses, and in that form, he chooses from a drop down which forum he should post the question to.

How would I be able to achieve this.

Any help will be great!

bananalive 08-16-2010 03:46 PM

Quote:

Originally Posted by redraider (Post 2084503)
Need help, I havent been able to figure out how to allow user to choose which forum they want to post the question to.

In short : There is just one form that the user uses, and in that form, he chooses from a drop down which forum he should post the question to.

How would I be able to achieve this.

Any help will be great!

  1. Create Custom Question with:
    Reference Name: forumid
    PHP Code:
    PHP Code:

    $answer "<select name=\"$formbit[id]\" id=\"q_" $formbit[id]  ."\">";

    foreach (
    $vbulletin->forumcache AS $forumid  => $forum)
    {
    if (
    $qo['forumid']==$forumid)
    {
    $forum['selected'] = ' selected="selected"';
    }
    $answer .= "<option value=\"$forumid\"$forum[selected]>$forum[title]</option>";
    }
    $answer .= "</select>"

  2. Edit Form -> Form Hook: Before Submit:
    PHP Code:

    $forumid $form['forumid'] = $qo['forumid']; 


bananalive 08-16-2010 03:47 PM

Quote:

Originally Posted by bigrover (Post 2082661)
I am getting the following error from the Form Hook: Before Submit:

Unable to add cookies, header already sent.
File: /home/thebonvi/domains/thebonvivant.org/public_html/forums/misc.php(89) : eval()'d code(491) : eval()'d code
Line: 1

The code I entered is:

$form[forumid] = forumid

I am trying to get the form to go to the current forum where the user clicked on the link to go to the form. What am I doing wrong?

***

On a separate thought, does the misc.php accept an argument containing the forumid, like the newthread.php? I could pass the forumid at the time the form is called if it does.

You are using invalid php in one of the hooks.

The following is an example of correct php:

PHP Code:

$form['forumid'] = '3'


Bigj85 08-16-2010 11:41 PM

hey banana,been using easyforms a while and love it

just lately though I tried using the question variables for the form output

the form output should be {q_1} Review for {q_2} by {username}

{q_1} being a game name and {q_2} being the platform,so the output should read something like

"mass effect 2 review for PC by bigj85"

but only the username variable is working so I get

"Review for by bigj85"

am I doing something wrong here?

I'm having the forms output sent to a forum as their own thread btw

Welshy2008 08-17-2010 11:29 AM

Is this great mod been confirmed as working on an upgrade from 4.0.5 and 4.0.6, Please?

Sarcoth 08-17-2010 01:17 PM

Quote:

Originally Posted by Bigj85 (Post 2085001)
hey banana,been using easyforms a while and love it
just lately though I tried using the question variables for the form output
the form output should be {q_1} Review for {q_2} by {username}
{q_1} being a game name and {q_2} being the platform,so the output should read something like
"mass effect 2 review for PC by bigj85"
but only the username variable is working so I get
"Review for by bigj85"
am I doing something wrong here?
I'm having the forms output sent to a forum as their own thread btw

{q_#} does not mean the first question. It represents the questions number. Go to the edit form page for the form you are looking at. Go to the bottom. You'll see your questions listed like so:

Quote:

1. What is the name of the game? (Single Line Text Field) #38
The number at the end there (#38) is the question's number. So, that would be {q_38}.

Personally, I recommend using reference name within the question (like gamename) and then doing {q_gamename} instead, but that's up to you.

temporaryins 08-17-2010 05:51 PM

Quote:

Originally Posted by Welshy2008 (Post 2085203)
Is this great mod been confirmed as working on an upgrade from 4.0.5 and 4.0.6, Please?

I've had it running on 4.0.5, upgrade to 4.0.6, still working fine.

Bigj85 08-17-2010 09:00 PM

Quote:

Originally Posted by Sarcoth (Post 2085255)
{q_#} does not mean the first question. It represents the questions number. Go to the edit form page for the form you are looking at. Go to the bottom. You'll see your questions listed like so:



The number at the end there (#38) is the question's number. So, that would be {q_38}.

Personally, I recommend using reference name within the question (like gamename) and then doing {q_gamename} instead, but that's up to you.


ahhhh thanks Sarcoth that did the trick :)

bigrover 08-18-2010 05:06 AM

I am unable to affect the destination of the form results with the code you corrected below in the form hook before submit location. The form always goes to the destination specified in the "Forumid where Thread is posted:" location. In my case I have a main category (forum 1), a main forum (forum 2) and a review forum (forum 3). I even tried setting "Forumid where Thread is posted:" to the main category. I didn't get an error, but the form results did not appear in either forum. Not sure where it went. I'm not getting an error message anymore, but neither am I able to redirect the form output.

Per your comments in post #651 I also tried the forum assignment without the single quotes surrounding the target forum with no change in behavior.

PHP Code:

$form['forumid'] = 3

Quote:

Originally Posted by bananalive (Post 2084811)
You are using invalid php in one of the hooks.

The following is an example of correct php:

PHP Code:

$form['forumid'] = '3'



bananalive 08-18-2010 09:38 AM

Quote:

Originally Posted by bigrover (Post 2085620)
I am unable to affect the destination of the form results with the code you corrected below in the form hook before submit location. The form always goes to the destination specified in the "Forumid where Thread is posted:" location. In my case I have a main category (forum 1), a main forum (forum 2) and a review forum (forum 3). I even tried setting "Forumid where Thread is posted:" to the main category. I didn't get an error, but the form results did not appear in either forum. Not sure where it went. I'm not getting an error message anymore, but neither am I able to redirect the form output.

Per your comments in post #651 I also tried the forum assignment without the single quotes surrounding the target forum with no change in behavior.

PHP Code:

$form['forumid'] = 3


To affect the destination forum you need both variables changing, as below:

PHP Code:

$forumid $form['forumid'] = 3



All times are GMT. The time now is 02:22 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.05906 seconds
  • Memory Usage 1,775KB
  • 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_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (5)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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