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)

sweetguy2004 06-02-2010 04:22 PM

very interesting i will sure install this thanks for your efforts :)

Bobbo 06-02-2010 08:02 PM

What would be an easy way to display custom variable data in a form email body. For example, I have a form, the user fills it out and clicks submit. The contents of that form get emailed to someone else. Now, in the Before Submit hook, I have some logic that sets a variable based on how the user filled out the form. I'd like the contents of that variable to be displayed in the body of the email.

The variable is completely custom and based on data returning from a SQL dB lookup.

Any ideas? Geesh, I love this mod. It offers so much flexibility!

********
Figured this out. I simply appended my information to $formoutput, ie, $formoutput .= "My variable: " .$row[variable];
This works fine. I would think there is a way to make it a template variable so I could then use something like {my_variable}, but suspect it might take a lot more work.
********

Bobbo

rtrm 06-04-2010 08:11 PM

This is a great mod, thanks very much for all your hard work on it.

I have a small issue. When including an entered value for thread title, I can't include the value of the first field. On another form the values of the 2nd and 3rd field are included as {q_3} and {q_4}, so I figured I should use {q_0}, but that isn't recognized and the code is displayed. I tried {q_1}, but that produces nothing.

vilhiem 06-04-2010 08:25 PM

is there any way to do CALCULATIONS on the fields so when it's appended to the table, a number is generated in a field based on the values entered in other fields ...?

Reycer 06-05-2010 12:20 AM

This is one awesome mod...I've been using it since it's debut quite a while back.

Question: I have a situation to where I need to have files to be uploaded. So I direct the form to post into a forum. Problem is, I don't want that particular forum to be seen be anyone but myself, so I set the forum permissions so that only I can see it. This creates a problem with the attachments, it will not allow users to then upload attachments, when that forum is hidden. I can go in and make it so that they can make posts in in, but it is still hidden, and I can turn on that they can upload attachments, but if they can't view the forum, then they can't upload attachments in the form.

I have considered making this forum an "Admin Only" forum, and making so they can't get into it, but I would just rather have it not seen at all. Anyway to make this work?

HolyKiller 06-06-2010 11:53 PM

Quote:

Originally Posted by rtrm (Post 2048415)
This is a great mod, thanks very much for all your hard work on it.

I have a small issue. When including an entered value for thread title, I can't include the value of the first field. On another form the values of the 2nd and 3rd field are included as {q_3} and {q_4}, so I figured I should use {q_0}, but that isn't recognized and the code is displayed. I tried {q_1}, but that produces nothing.

You need to use unique ID of that question, not his "position" in that specific form. So if you have question like this:

1. Favorite color _______ (Single Line Text Field) #44 ______ 10

Simply use {q_44} for thread title :)

rtrm 06-07-2010 06:05 AM

Quote:

Originally Posted by HolyKiller (Post 2049647)
You need to use unique ID of that question, not his "position" in that specific form. So if you have question like this:

1. Favorite color _______ (Single Line Text Field) #44 ______ 10

Simply use {q_44} for thread title :)

Ah! Obvious really. Thanks very much.

Cedric_FP 06-07-2010 07:30 AM

Using the following code:

Code:

$forumid2 = 31;
if ($complete)
    {
        if (!$vbulletin->userinfo['userid'])
        {
            $vbulletin->input->clean_array_gpc('p', array(
                'humanverify' => TYPE_ARRAY,
            ));
            $newpost['humanverify'] = $vbulletin->GPC['humanverify'];
        }
        require_once(DIR . '/includes/functions_editor.php');
        require_once(DIR . '/includes/functions_bigthree.php');
        require_once('./includes/class_dm.php');
        require_once('./includes/class_dm_threadpost.php');
        require_once('./includes/functions_databuild.php');
        if (!$closed)
        {
            $open = 1;
        }
        else
        {
            $open = 0;
        }
        $threaddm = new vB_DataManager_Thread_FirstPost($vbulletin, ERRTYPE_STANDARD);
        /*$foruminfo = fetch_foruminfo($forumid);*/
        $threaddm->set_info('forum',$foruminfo);
        $threaddm->set_info('user', $vbulletin->userinfo);
        $threaddm->set('forumid', $forumid2);
        $threaddm->set('userid', $vbulletin->userinfo['userid']);
        $threaddm->set('title', $threadtitle);
        $threaddm->set('pagetext', $formoutput);
        $allow_smilie = '1';
        $visible = '1';
        $threaddm->set('open', $open);
        if ($form[prefixid])
        {
            $threaddm->set('prefixid', $form[prefixid]);
        }
        if ($form[iconid])
        {
            $threaddm->set('iconid', $iconid);
        }
        $threaddm->set('allowsmilie', $allow_smilie);
        $threaddm->set('visible', $visible);
        $threaddm->pre_save();
        $threadid = $threaddm->save();
        unset($threaddm);
        build_thread_counters($threadid);
        build_forum_counters($forumid); 
        if (!empty($threaddm->errors))
        {
            $errorss .= $threaddm->errors;
            $errormessage = "Form failed to submit. The following error(s) occured: <br /> ".$errorss;
            eval(standard_error($errormessage));
        }
        $threadinfo = fetch_threadinfo($threadid);
        $newpost['postid'] = $threadinfo['firstpostid'];
        mark_thread_read($threadinfo, $foruminfo, $vbulletin->userinfo['userid'], TIMENOW);
        /*($hook = vBulletinHook::fetch_hook('newthread_post_complete')) ? eval($hook) : false;*/
        if ($form[poll] == 1)
        {
            $question = $form[pollquestion];
            $threadinfo = verify_id('thread', $threadid, 0, 1);
            $polloptions = count($polloption);
            $vbulletin->GPC['options'] = $polloption;
            $counter = 0;
            $optioncount = 0;
            $badoption = '';
            while ($counter++ < $polloptions)
            {
                if ($vbulletin->options['maxpolllength'] AND vbstrlen($vbulletin->GPC['options']["$counter"]) > $vbulletin->options['maxpolllength'])
                {
                    $badoption .= iif($badoption, ', ') . $counter;
                }
                if (!empty($vbulletin->GPC['options']["$counter"]))
                {
                    $optioncount++;
                }
            }
            $poll = datamanager_init('Poll', $vbulletin, ERRTYPE_STANDARD);
            $counter = 0;
            while ($counter++ < $polloptions)
            {
                if ($vbulletin->GPC['options']["$counter"] != '')
                {
                    $poll->set_option($vbulletin->GPC['options']["$counter"]);
                }
            }
            $poll->set('question', $question);
            $poll->set('dateline', TIMENOW);
            $poll->set('active', '1');
            $poll->set('public', $form['publicpoll']);
            $poll->set('multiple', $form['multiplepoll']);
            $pollid = $poll->save();
            $threadman = datamanager_init('Thread', $vbulletin, ERRTYPE_STANDARD, 'threadpost');
            $threadman->set_existing($threadinfo);
            $threadman->set('pollid', $pollid);
            $threadman->save();
        }
        if ($form[submitmessage])
        {
            $errormessage = $form[submitmessage];
        }
        else
        {
            $errormessage = "Form was submitted successfully. Click <a href=\"showthread.php?" . $vbulletin->session->vars['sessionurl'] . "p=" . $newpost[postid] . "#post" . $newpost[postid] . "\">here</a> to view the thread.";
        }
    }

How would I also create replies to the thread created? The replies don't have to contain form data, they are just standard replies such as "Reserved".

Thanks.

bananalive 06-08-2010 02:03 PM

Quote:

Originally Posted by vilhiem (Post 2048426)
is there any way to do CALCULATIONS on the fields so when it's appended to the table, a number is generated in a field based on the values entered in other fields ...?

Form Hook: Before Submit:
PHP Code:

$qo[4] = $qo[4]+1;
$q[4] = $q[4]+1

4 is the question hash

bananalive 06-08-2010 02:26 PM

1 Attachment(s)
Quote:

Originally Posted by riskofficer (Post 2046878)
when editing form result, in date field in year cell -- entrie like "2010" is fine, but years 2009, 2008 are shown as "209, 208"

in excel export everything fine

Fixed in attached file


All times are GMT. The time now is 06:30 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.02766 seconds
  • Memory Usage 1,770KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (4)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