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)

Dragonsys 08-09-2010 06:30 PM

Quote:

Originally Posted by bada_bing (Post 2079778)
I am wondering I I setup a forum using Easy Forms if there is any way to intergrate this into vbadvanced?

what are you wanting for integration?

bananalive 08-09-2010 07:35 PM

Quote:

Originally Posted by Sarcoth (Post 2081403)
I tried the following with no luck for the top part. I think this is mostly correct, but I must be doing a variable the wrong way.

PHP Code:

    $shuserid $vbulletin->db->query_first("select userid from vBull_user where username='{$qo['shuser']}'");
    
$userinfo=fetch_userinfo($qo[$shuserid]); 


PHP Code:



$shuserid 
$vbulletin->db->query_first("
 SELECT userid
 FROM "
TABLE_PREFIX ."user
 WHERE username = '" 
$db->escape_string($qo['shuser']) . "'
"
); 


Willy T 08-10-2010 11:23 PM

Can you please make

Quote:

Usergroups Allowed to Edit Forms
Usergroups allowed to add/edit/delete forms (Permission to view Form List is recommended for these usergroups)
each on their own line? I want usergroups to be able to CREATE forms but not delete everyone's in the event someone get's angry. They can request deletion by a moderator.

Thank you!

Sarcoth 08-11-2010 12:04 AM

Quote:

Originally Posted by bananalive (Post 2081459)
PHP Code:

$shuserid $vbulletin->db->query_first("
 SELECT userid
 FROM "
TABLE_PREFIX ."user
 WHERE username = '" 
$db->escape_string($qo['shuser']) . "'
"
); 


Good stuff Banana, thank you. I got it working! :) I am using a custom question which selects a user from usergroup 2; reference name = shuser.
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>'


Then, here is the code I am using to move a user to a new usergroup:
PHP Code:

$shuserid $vbulletin->db->query_first("
    SELECT userid
    FROM "
TABLE_PREFIX ."user
    WHERE username = '" 
$db->escape_string($qo['shuser']) . "'
"
);
//print_r($shuserid['userid']);

if ($complete) {
    
$userinfo=fetch_userinfo($shuserid[userid]);
    
    
//**Replace 18 with choosen usergroupid you want to add them to**//
    
$user['usergroupid'] = 18;

    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();



bigrover 08-11-2010 07:01 PM

Thank you, bananalive. This is a great mod. :up:

Is there an obvious location where the form id is displayed? I am interested so I can manage the redirect location for my newthread_form_complete plugin.

I also would like to see some method of autocomplete of a field through comparison to a database field such as username. Sounds like some AJAX and Javascripting would be involved, not unlike what is happening during a vB user registration when it is checking the length and content of the new username while it is being entered.

mokonzi 08-11-2010 07:32 PM

The form ID is always included in the URL...

bigrover 08-12-2010 04:42 AM

How can I adjust the forum destination for the form results dynamically? Specifically, I want to recognize the forum I am in when I make the call to the form 'http://www.your-site.com/forum/misc.php?do=form&fid=1'. I am using the plugin example below and adjusted the array to the custom forum. It correctly loaded the form rather than the standard post editor, but it saved the results into the destination forum coded in the form (forum #2), and not the current forum where it was launched. Can I override that behavior?

Create vBulletin Plugin with hook location newthread_form_complete
PHP Code:
if (in_array($forumid, array(3)))
{
header( 'Location: http://www.your-site.com/forum/misc.php?do=form&fid=1' ) ;
}
Originally Posted by StagKill View Post

bigrover 08-12-2010 12:56 PM

I am getting the following error from the Form Hook: Before Submit:

Unable to add cookies, header already sent.
File: /home/yoursite.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.

AliceHoward 08-13-2010 04:39 PM

In a word, perfect, thank you. :)

Choez 08-14-2010 02:01 PM

Still looking for a tip/hint as to how I can make a form submit twice to 2 different locations :) Been playing around with it myself but I can't get it to work :-/


All times are GMT. The time now is 09:14 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.02741 seconds
  • Memory Usage 1,780KB
  • 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
  • (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