vb.org Archive

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

Simon Lloyd 03-14-2009 09:25 AM

Quote:

Originally Posted by SSG.D (Post 1767170)
Fantastic mod!!

Got a question though: I'm trying to make a contest registration form thats e-mailed on submit.

When the E-mail arrives it looks like this:

MASTER O WAR TOURNAMENTWhat is your game name? PHOENIX What is your E-mail Address? yourname@email.net Are you a Clan Admin? Yes If Clan Admin, are you Registering your clan Or a small unit? Bulldog, nerdboy

How can I fix this to look like this:

MASTER O WAR TOURNAMENT:

What is your game name? PHOENIX
What is your E-mail Address? yourname@email.net
Are you a Clan Admin? Yes
If Clan Admin, are you Registering your clan Or a small unit? Yes
Bulldog, nerdboy

Any help would be great!!:D

You have to use the custom form output, here's mine, it displays something like you want:
PHP Code:

[CENTER][B][SIZE=5][COLOR=black]Top Tip[/COLOR][/SIZE][/B][/CENTER]
[
FONT=Arial Black] [SIZE=3][U]Submitted By:[/U][/SIZE][/FONT]   [FONT=Arial] [SIZE=2][I]  $q[20] [/I][/SIZE][/FONT]
[
U][FONT=Arial Black][SIZE=3]Date:[/SIZE][/FONT][/U]  [FONT=Arial]   [SIZE=2][I]  $q[21] [/I][/SIZE][/FONT]
[
U][FONT=Arial Black][SIZE=3]Tip Description[/SIZE][/FONT][/U]
 [
FONT=Arial][SIZE=2][I]$q[10] [/I][/SIZE][/FONT]
[
U][FONT=Arial Black][SIZE=3]Difficulty Of Implementation Level[/SIZE][/FONT][/U][I][FONT=Arial Black][SIZE=1](Easy......Difficult)[/SIZE][/FONT][/I]

[
FONT=Arial][SIZE=2][I]$qo[17] [/I][/SIZE][/FONT]

[
U][FONT=Arial Black][SIZE=3]User Level Required to Adapt Tip[/SIZE][/FONT][/U]

[
FONT=Arial][SIZE=2][I]$qo[18] [/I][/SIZE][/FONT]

[
U][FONT=Arial Black][SIZE=3]Posted Top Tip[/SIZE][/FONT][/U]
[
toptip][I]$q[12][/I][/toptip

and here's a link for how it looks http://www.thecodecage.com/forumz/to...-new-post.html
I had to use php tags to stop it parsing!

bananalive 03-14-2009 10:36 AM

Quote:

Originally Posted by SSG.D (Post 1767170)
Fantastic mod!!

Got a question though: I'm trying to make a contest registration form thats e-mailed on submit.

When the E-mail arrives it looks like this:

MASTER O WAR TOURNAMENTWhat is your game name? PHOENIX What is your E-mail Address? yourname@email.net Are you a Clan Admin? Yes If Clan Admin, are you Registering your clan Or a small unit? Bulldog, nerdboy

How can I fix this to look like this:

MASTER O WAR TOURNAMENT:

What is your game name? PHOENIX
What is your E-mail Address? yourname@email.net
Are you a Clan Admin? Yes
If Clan Admin, are you Registering your clan Or a small unit? Yes
Bulldog, nerdboy

Any help would be great!!:D

Add to end of second Answer BBcode: box
Code:

\r\n

bananalive 03-14-2009 10:38 AM

Quote:

Originally Posted by Heldenverband (Post 1767702)
At the moment its not working for me and i dont know why :confused:

Here the error message :

PHP Code:

WarnungCannot use a scalar value as an array in [path]/misc.php(100) : eval()'d code (Zeile 2178)

Warnung: Cannot use a scalar value as an array in [path]/includes/functions_newpost.php (Zeile 394)

Warnung: Cannot use a scalar value as an array in [path]/vbcms_global_modules/vbcmsmodul_lasttopics.php (Zeile 129) 


check your options for creating new thread

bananalive 03-14-2009 10:42 AM

Quote:

Originally Posted by koolasia (Post 1766944)
Hey,

Is it possible that when a form has optional questions and if they are not filled than these questions dont appear in the thread created ??

not unless you use custom output

bananalive 03-14-2009 10:47 AM

Quote:

Originally Posted by hobbybox (Post 1766776)
First - Thank you for a great application and your support in helping people modify.

With that I have a question.

I have created one form to help members trade items. They fill out the form and it posts to a thread. I have been asked to have a button in someones post where if it is clicked, you would go to the form and that persons name would be in the form already.

I have it now as {username} / $qo1 (or whatever the variable is) so when the form is filled out that information is the thread title - example if I filled out the form would be 'Me / Name of person i type in box"

Is it possible to somehow carry the username of the persons post I am in so that $qo1 spot automaticly fills in so I would not have to type the persons name when a link from that post is clicked and you are taken to the form?

I hope im clear on what im asking - thank you in advance for your help.

This requires Easy Forms v3.3

Add this into postbit template somewhere (or postbit_legacy)
HTML Code:

<a href="misc.php?do=form&fid=2&username=$post[username]">Trade with $post[username]</a>
Import attached file.

form Hook: Form start

PHP Code:

$hiddenfield1 $vbulletin->input->clean_gpc('g''username'TYPE_NOHTML);
if (empty(
$hiddenfield1))
    {
        
$errormessage "Error, this form needs a username.";
           eval(
'print_output("' fetch_template('STANDARD_ERROR') . '");');
    } 

form Hook: Before Submit

PHP Code:

$hiddenfield1 $vbulletin->input->clean_gpc('p''hiddenfield1'TYPE_NOHTML);
$formoutput str_replace('{param}'"$hiddenfield1"$formoutput); 

Then you can use {param} in custom output.

if you don't want to use custom output then add a custom question with php code:
PHP Code:

$answer '<input type="text" readonly="readonly" id="q_' $formbit[id] . '" name="' $formbit[id] . '" value="' $hiddenfield1 '" />'


bananalive 03-14-2009 11:30 AM

Quote:

Originally Posted by LloydApter (Post 1767705)
Quote:

Originally Posted by LloydApter (Post 1767269)
Many thanks for the mod - it's exactly what I need :up:

How can I show the individual results of all submitted form replies to the relevant forum members in easy viewable format?

Something like this (in table format):

Number Name City Reply
1. John London Yes
2. Lloyd Paris No
ect.

Thanks again!

I have reviewed all the material and postings and didn't find any explanation of how to order the results from the form.

Say it's a form to invite people to an event and then afterwards people want to see who is going with their relevant contact details that they completed in the form and also see their names on the list. Or it's a survey and people want to see the results of the survey in worksheet format so they can analyse them... How can this be done?

Many thanks

  1. this uses BB Code Table & Easy Forms v3.3
  2. Create thread/post eg.
    HTML Code:

    [table]column1|column2|column3
    [/table]

  3. Form Hook: Before Submit
    PHP Code:

    if ($complete)
    {
    require_once(
    './includes/class_dm.php');
    require_once(
    './includes/class_dm_threadpost.php');
    $postid 245;
    $postinfo fetch_postinfo($postid);
    $postpagetext str_replace('[/table]'"\r\n $formoutput [/table]"$postinfo[pagetext]);
    $postdm = new vB_DataManager_Post($vbulletinERRTYPE_STANDARD);
    $postdm->set_existing($postinfo);
    $postdm->set('pagetext'$postpagetext);
    $postdm->pre_save();
    if(
    count($postdm->errors) < 1)
    {
    $postdm->save();
    }
    else
    {
    foreach (
    $errors as $error) {
                    
    $errorss .= $error"<br />";
                }
                
    $errormessage "Following errors occurred".$errorss;
                eval(
    'print_output("' fetch_template('STANDARD_ERROR') . '");');
    }
    unset(
    $postdm);

    if (
    $form[submitmessage])
    {
    $errormessage $form[submitmessage];
    }
    else
    {
    $errormessage "Form was submitted successfully. Click <a href=\"showthread.php?" $vbulletin->session->vars['sessionurl'] . "p=" $postinfo[postid] . "#post" $postinfo[postid] . "\">here</a> to view the post.";
    }


  4. Replace 245 with appropriate postid
  5. Use custom output e.g.
    Code:

    $qo[75] | $thisuser[username] | $qo[59]

hobbybox 03-14-2009 12:12 PM

thank you for the info - im going to give it a try

I installed this on a second board - and all is working great (VB 3.8.1 and Easy forms 3.3) but if logged in as a ergular user I cannot upload an attachments...I can do it as an admin so I know it works but im drawing a blank as to why another group cannot do it....

Usergroup permission for attachments set to Yes - that usergroup can add attachments in regular posts but just not the form...any ideas where im not looking?

hobbybox 03-14-2009 12:18 PM

Quote:

Originally Posted by bananalive (Post 1767768)
This requires Easy Forms v3.3

Add this into postbit template somewhere (or postbit_legacy)
HTML Code:

<a href="misc.php?do=form&fid=2&username=$post[username]">Trade with $post[username]</a>
Import attached file.

form Hook: Form start

PHP Code:

$hiddenfield1 $vbulletin->input->clean_gpc('g''username'TYPE_NOHTML);
if (empty(
$hiddenfield1))
    {
        
$errormessage "Error, this form needs a username.";
           eval(
'print_output("' fetch_template('STANDARD_ERROR') . '");');
    } 

form Hook: Before Submit

PHP Code:

$hiddenfield1 $vbulletin->input->clean_gpc('p''hiddenfield1'TYPE_NOHTML);
$formoutput str_replace('{param}'"$hiddenfield1"$formoutput); 

Then you can use {param} in custom output.

if you don't want to use custom output then add a custom question with php code:
PHP Code:

$answer '<input type="text" readonly="readonly" id="q_' $formbit[id] . '" name="' $formbit[id] . '" value="' $hiddenfield1 '" />'


When the member clicks the link how can I make it so the form shows the name of the person the member is going to trade with....I just would like it so the person can see something like 'Trading With: that members name' - I dont want there to be confusion when they are filling out the form now knowing if they have the right name.


****** Scratch this one - I got all to work but im just tinkering with it to figure out how to get the {parm} into the thread title

Ok I tried and I cannot figure out how to get that hiddenvalue into the thread title - the {param} varible works in the form itself but not in the thread title

LloydApter 03-14-2009 02:19 PM

Quote:

Originally Posted by bananalive (Post 1767783)
  1. this uses BB Code Table & Easy Forms v3.3
  2. Create thread/post eg.
    HTML Code:

    [table]column1|column2|column3
    [/table]

  3. Form Hook: Before Submit
    PHP Code:

    if ($complete)
    {
    require_once(
    './includes/class_dm.php');
    require_once(
    './includes/class_dm_threadpost.php');
    $postid 245;
    $postinfo fetch_postinfo($postid);
    $postpagetext str_replace('[/table]'"\r\n $formoutput [/table]"$postinfo[pagetext]);
    $postdm = new vB_DataManager_Post($vbulletinERRTYPE_STANDARD);
    $postdm->set_existing($postinfo);
    $postdm->set('pagetext'$postpagetext);
    $postdm->pre_save();
    if(
    count($postdm->errors) < 1)
    {
    $postdm->save();
    }
    else
    {
    foreach (
    $errors as $error) {
                    
    $errorss .= $error"<br />";
                }
                
    $errormessage "Following errors occurred".$errorss;
                eval(
    'print_output("' fetch_template('STANDARD_ERROR') . '");');
    }
    unset(
    $postdm);

    if (
    $form[submitmessage])
    {
    $errormessage $form[submitmessage];
    }
    else
    {
    $errormessage "Form was submitted successfully. Click <a href=\"showthread.php?" $vbulletin->session->vars['sessionurl'] . "p=" $postinfo[postid] . "#post" $postinfo[postid] . "\">here</a> to view the post.";
    }


  4. Replace 245 with appropriate postid
  5. Use custom output e.g.
    Code:

    $qo[75] | $thisuser[username] | $qo[59]

I get to this page when I tried making these updates:

Quote:

Fatal error: Existing data passed is not an array
Called set_existing in [path]/misc.php(100) : eval()'d code(1039) : eval()'d code on line 9
Called eval in [path]/misc.php(100) : eval()'d code on line 1039
Called eval in [path]/misc.php on line 100
in [path]/includes/class_dm.php on line 235
#0 vb_error_handler(256, Existing data passed is not an array
Called set_existing in /var/www/vhtdocs/userweb61076/html/forum/misc.php(100) : eval()'d code(1039) : eval()'d code on line 9
Called eval in /var/www/vhtdocs/userweb61076/html/forum/misc.php(100) : eval()'d code on line 1039
Called eval in /var/www/vhtdocs/userweb61076/html/forum/misc.php on line 100
, /var/www/vhtdocs/userweb61076/html/forum/includes/class_dm.php, 235, Array ([existing] => ,[line] =>
Called set_existing in /var/www/vhtdocs/userweb61076/html/forum/misc.php(100) : eval()'d code(1039) : eval()'d code on line 9
Called eval in /var/www/vhtdocs/userweb61076/html/forum/misc.php(100) : eval()'d code on line 1039
Called eval in /var/www/vhtdocs/userweb61076/html/forum/misc.php on line 100
....
Thanks for all your help

bananalive 03-14-2009 02:24 PM

Quote:

Originally Posted by LloydApter (Post 1767899)
I get to this page when I tried making these updates:



Thanks for all your help

Check the postid. Below code checks postid is valid

Form Hook: Before Submit:
PHP Code:

if ($complete)
{
require_once(
'./includes/class_dm.php');
require_once(
'./includes/class_dm_threadpost.php');
$postid 245;
$postinfo fetch_postinfo($postid);
if (!
$postinfo)
{
$errormessage 'Post doesn\'t exist, please alter line $postid = 245 ';
eval(
'print_output("' fetch_template('STANDARD_ERROR') . '");');
}
$postpagetext str_replace('[/table]'"\r\n $formoutput [/table]"$postinfo[pagetext]);
$postdm = new vB_DataManager_Post($vbulletinERRTYPE_STANDARD);
$postdm->set_existing($postinfo);
$postdm->set('pagetext'$postpagetext);
$postdm->pre_save();
if(
count($postdm->errors) < 1)
{
$postdm->save();
}
else
{
foreach (
$errors as $error)
{
$errorss .= $error"<br />";
}
$errormessage "Following errors occurred".$errorss;
eval(
'print_output("' fetch_template('STANDARD_ERROR') . '");');
}
unset(
$postdm);

if (
$form[submitmessage])
{
$errormessage $form[submitmessage];
}
else
{
$errormessage "Form was submitted successfully. Click <a href=\"showthread.php?" $vbulletin->session->vars['sessionurl'] . "p=" $postinfo[postid] . "#post" $postinfo[postid] . "\">here</a> to view the post.";
}




All times are GMT. The time now is 09:04 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.02333 seconds
  • Memory Usage 1,880KB
  • 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
  • (3)bbcode_code_printable
  • (4)bbcode_html_printable
  • (11)bbcode_php_printable
  • (11)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