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)

bananalive 04-06-2010 10:09 AM

Quote:

Originally Posted by Tortikova (Post 2015558)
Have you got sidebar widget for last active voting?

Huh?

bananalive 04-06-2010 10:10 AM

Quote:

Originally Posted by stuky4ever (Post 2014945)
Im not using a custom output, and non of that worked.

Try upgrading to latest version.

bananalive 04-06-2010 10:10 AM

Quote:

Originally Posted by Cedric_FP (Post 2014938)
Can this form product customize output (when creating a new thread) of specific questions.

For example:

Question 1: How old are you?


Output:
  • 22 years old

Yes there is an option to create custom output when edit each form.

bananalive 04-06-2010 10:13 AM

Quote:

Originally Posted by Selcor (Post 2014793)

Thank you very much!, You're right!.


I do not understand much English language:

In the section Edit Form - Thread / PM / Email Title use {q_*}
In the section Form BB code and Custom Output use {qo_*}

What is the difference between {q_*} {qo_*} and {qn_*} ???.

Edit:

Understood the difference between {qo_*} and {qn_*}.
{qo_*} sends the response and {qn_*} send the question.

One suggestion for future versions:
?One could be used ID relative and not absolute?, because when you copy a Form, it changes all the ID and we have to re-edit the entire Form.

Thanks!

The problem with relative question hashes is that if you re-order the questions then it would mess up all of the custom output.

I have added the option of 'Reference Name:' when creating/editing questions which can be used instead of question hashes and would remain the same when copying forms.

bananalive 04-06-2010 10:16 AM

Quote:

Originally Posted by kemical (Post 2014771)
Thank you for this awesome mod!

Is there a way to have a form post to two separate forums at the same time? I run a forum for a World of Warcraft guild, and I setup a form for people applying to our guild. Right now the form posts to a public forum, but I would like it to also be posted to a more restricted forum as well.

You could copy the code for posting a new thread into Form Hook: Before Submit:

(Changing forumid 31 to your preferred forumid in line 1 of code below)

PHP 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($vbulletinERRTYPE_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'$threadid01);
            
$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'$vbulletinERRTYPE_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'$vbulletinERRTYPE_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.";
        }
    } 


munsonfan15 04-06-2010 10:37 AM

Quote:

Originally Posted by bananalive (Post 2016731)
Yes, it is possible with Easy Forms

For dropdown list of members, create a custom question with following php code:
PHP Code:

$answer .= '<select name="'.$formbit[id].'">';
$members $db->query_read("SELECT * FROM " TABLE_PREFIX "user
WHERE usergroupid = 2
ORDER BY username ASC"
);
    while(
$row $db->fetch_array($members)) {
$answer .= '<option value="'.$row[username].'"';
if (
$row[username] == $thisanswer) {
$answer .= 'selected="selected"';
}
$answer .= '>'.$row[username].'</option>';
}
$answer .= '</select>'

Change 2 to the desired usergroupid

Works like a charm - one addition if you could help me out please - how can I add secondary groups also?

bananalive 04-06-2010 11:07 AM

Quote:

Originally Posted by munsonfan15 (Post 2016746)
Works like a charm - one addition if you could help me out please - how can I add secondary groups also?

PHP Code:

$usgid 2;
$answer .= '<select name="'.$formbit[id].'">';
$members $db->query_read("SELECT * FROM " TABLE_PREFIX "user
WHERE usergroupid = '
$usgid' OR membergroupids = '$usgid' OR membergroupids LIKE \"$usgid,%\" OR membergroupids LIKE \"%,$usgid\" OR membergroupids LIKE \"%,$usgid,%\"
ORDER BY username ASC"
);
    while(
$row $db->fetch_array($members)) {
$answer .= '<option value="'.$row[username].'"';
if (
$row[username] == $thisanswer) {
$answer .= 'selected="selected"';
}
$answer .= '>'.$row[username].'</option>';
}
$answer .= '</select>'


munsonfan15 04-06-2010 11:21 AM

FANTASTIC! Thank you so much...Installed

munsonfan15 04-06-2010 02:30 PM

I cannot get some custom ouput to work.

I have tried the following: {q_1}, {qo_1}, and {q_date} (date is the reference name I assigned_ and I iether get nothing or some funny symbols.

When I use {q_2} (this is a drop down box variable) that works everywhere I use it, in the body of the post and the post title - just dont know why the date question and radio box question do not work correctly.

the {qn_x} works and puts the actual question just fine.

munsonfan15 04-06-2010 05:15 PM

Well I thought all was well (except for my custom ouput problem above) until I tried to submit a form being a regular member instead of an Admin. I get a message that there is a Securuty Token problem and form cannot be sumbitted. I have checked all permissions and all looks ok. Not sure what that message means.

*** I figured some things outs...

I received the Security Token error if I have a member on both a primary and secondary usergroup AND have the displayed group anything other then default. If I change to Default it all appears to work ok


All times are GMT. The time now is 10:13 PM.

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.02069 seconds
  • Memory Usage 1,827KB
  • 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_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)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