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 02-01-2010 03:28 PM

Quote:

Originally Posted by chsmith700 (Post 1972205)
bananalive,

I am trying to get this to email to a form question. We have a drop down with email address, I need the form to be emailed to the selection on that drop down. Can you please help?

Add to bottom of Form Hook: Before Submit:
(changing 5 to the question hash of the email address question)

PHP Code:

    $form[email] = $qo[5]; 


bananalive 02-01-2010 03:33 PM

Quote:

Originally Posted by Sarcoth (Post 1972236)
Alright, now that is impressive! Can you tell me the code I would need to do a query on the profilefields (i.e. field8)? I'd like to pull that field and then just have it added to the form without the user having to enter it again.

No need for a query for that, it is already cached in vBulletin userinfo

1. Create 'Custom' question
2. Use following php Code:

PHP Code:

$answer '<input class="textbox" type="text" readonly="readonly" id="q_' $formbit[id] . '" name="' $formbit[id] . '" value="' $vbulletin->userinfo[field8] . '" />'


chsmith700 02-01-2010 03:38 PM

Thanks a bunch!!!

adamdavidconn 02-01-2010 04:24 PM

hi.
I am wondering, how can you make a user be changed to a different usergroup, or added to a secondry one after completion and submission of the form.

many thanks
adam

bananalive 02-01-2010 04:41 PM

Quote:

Originally Posted by adamdavidconn (Post 1972301)
hi.
I am wondering, how can you make a user be changed to a different usergroup, or added to a secondry one after completion and submission of the form.

many thanks
adam

This code worked with vB v3.x it should work with vB v4.x but I haven't tested it with vb v4.x.

Form Hook: Before Submit

PHP Code:
PHP Code:

if ($complete)  

$userinfo $vbulletin->userinfo
$user['usergroupid'] = 4
if (empty(
$user['usergroupid'])) 

$user['usergroupid'] = 2


$getusergroupid iif($userinfo['displaygroupid'] != $userinfo['usergroupid'], $userinfo['displaygroupid'], $user['usergroupid']); 

$user_usergroup =& $vbulletin->usergroupcache["$user[usergroupid]"]; 
$display_usergroup =& $vbulletin->usergroupcache["$getusergroupid"]; 


$userdata =& datamanager_init('User'$vbulletinERRTYPE_STANDARD); 
$userdata->set_existing($userinfo); 
$userdata->set('usergroupid'$user['usergroupid']); 
$userdata->set_usertitle
$user['customtitle'] ? $user['usertitle'] : ''
false
$display_usergroup
(
$user_usergroup['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canusecustomtitle']) ? true false
(
$user_usergroup['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['cancontrolpanel']) ? true false 
); 

require_once(
DIR '/includes/functions_ranks.php'); 
if (
$user['userid'] == $vbulletin->userinfo['userid']) 

$vbulletin->userinfo['usergroupid'] = $user['usergroupid']; 
$vbulletin->userinfo['displaygroupid'] = $user['usergroupid']; 


$userdata->save(); 




adamdavidconn 02-01-2010 05:29 PM

ok, thanks. So I guess the code I need to edit is
PHP Code:

if ($complete)  

$userinfo $vbulletin->userinfo
$user['usergroupid'] = 4
if (empty(
$user['usergroupid'])) 

$user['usergroupid'] = 2


Could you explain how I would configure this. The numbers at the end reference the usergroup id, but what do the 2 variables corrolate to?

EDIT: I worked out that
PHP Code:

$user['usergroupid'] = 4

moves a user to a new usergroup. However, I am unsure how to add a additional usergroup, and not make them change their primary

Sarcoth 02-01-2010 05:39 PM

Wow, that is some really cool stuff Banana. Each time I think this mod can do everything, it does something else. Very cool.

I did find another minor issue, which I wouldn't even consider an issue. I wanted to add a link to one of the questions so a user could read a "Code of Conduct" for the forums. They have to answer yes after it is read. If I do the question in html, it looks fine on the editform page, but not on the actual form. If I do the question in bbcode, it looks fine on the actual form, but not on the editform page.

The previous question about the usergroupid is also a very cool feature. Does that change their primary usergroup or does it add them to this as an additional group? Also does this change their current title to that secondary group at the same time?

Here's an idea. Can I set up a question that when someone clicks on the link in the question, it gives a pop-up box with the information they have to read? That would be nice. No worries though, you have enough on your plate right now.

valendono 02-01-2010 07:49 PM

1 Attachment(s)
Hi Banana,

Yea I knew, its only work with bold and size bbcode only.. I attach the screenshoot.. I cant use[list] or [img] on the description..

Cleveregg 02-01-2010 09:07 PM

Quote:

Originally Posted by bananalive (Post 1972136)
Give registered users permission to 'View Forms List'

..sorry - still doesn't work for me - I still get the edit|delete|copy|export...line & the create form underneath as per my 2nd pic

thanks anyway

*** Just downloaded and installed 4.02 - seems to be working ok now - just styling to suit - great job bananalive !! ***

Martyh 02-02-2010 01:26 AM

Hi BL, and thanks for continuing your work on this mod, it's a great one.

I am wondering if I can have the multi-line box that appears for the user to write in, default to a larger size automatically , please let me know if that is possible. I am figuring I need to click "increase" about three times to get to the size I would want. So I would like it to just default to that for the user.

Thanks

Mark


All times are GMT. The time now is 11:05 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.02492 seconds
  • Memory Usage 1,771KB
  • 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
  • (5)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
  • (3)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