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)

Gotmian 04-22-2009 09:08 AM

Hey, great mod! :)

Is there a way for me when the email is sent out to include there the username of the member who used the form?

amjadz4 04-22-2009 09:19 AM

Quote:

Originally Posted by Gotmian (Post 1796589)
Hey, great mod! :)

Is there a way for me when the email is sent out to include there the username of the member who used the form?

just add a field for named "username" so the user who is typing will enter his username. :)

Elenna 04-22-2009 02:05 PM

Quote:

Originally Posted by Gotmian (Post 1796589)
Hey, great mod! :)

Is there a way for me when the email is sent out to include there the username of the member who used the form?

You can include {username} in the form if you'd like (perhaps in the title?).

If you'd rather their username appear as the answer to a question, do this:

Create a new question, selecting "Custom" for the type. Name it "Username".

In the code field, enter in:
Code:

$answer = '<input type="text" readonly="readonly" id="q_' . $formbit[id] . '" name="' . $formbit[id] . '" value="' . $vbulletin->userinfo[username] . '" style="background:silver;"  />';
Then their username is sent in like it is the answer to a question in the form, and they cannot change it.

Martyh 04-23-2009 12:33 AM

Hi BananaLive,

( Or anyone that can help.)

When I submit the form below ( your example ) to a HTML page , it directs me to a page of smileys located here

http://localhost/forum/misc.php?user=bob

It seems to cut off the "do=form&fid=1" part but does add the "user=bob" part"
I'm kinda stuck on that one.

.
<form name="form" action="http://localhost/forum/misc.php?do=form&fid=1" method="get">
Username:
<input type="text" name="user" />
<input type="submit" value="Submit" />
</form>




Another question on this one.

Quote:

Originally Posted by bananalive (Post 1792360)
How do I get parameter from url of form posted in custom output? (must have parameter)

1. Form Hook: Form Start

PHP Code:

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

2. Form Hook: Before Submit
PHP Code:

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

3. Use {param} in custom output.

Do I need to change anything in these codes to be able to use the form on the top of the page ?

When you say "use {param} in custom output" I really don't know what that means could someone explain that in a little more detail please ? . Sorry for my inexperience I am willing to pay/donate (to you or to your favorite charity), to anyone who can help me out with this.

Thanks,

bananalive 04-23-2009 08:39 AM

Quote:

Originally Posted by Martyh (Post 1797082)
Hi BananaLive,

( Or anyone that can help.)

When I submit the form below ( your example ) to a HTML page , it directs me to a page of smileys located here

http://localhost/forum/misc.php?user=bob

It seems to cut off the "do=form&fid=1" part but does add the "user=bob" part"
I'm kinda stuck on that one.

.
<form name="form" action="http://localhost/forum/misc.php?do=form&fid=1" method="get">
Username:
<input type="text" name="user" />
<input type="submit" value="Submit" />
</form>



Another question on this one.


Do I need to change anything in these codes to be able to use the form on the top of the page ?

When you say "use {param} in custom output" I really don't know what that means could someone explain that in a little more detail please ? . Sorry for my inexperience I am willing to pay/donate (to you or to your favorite charity), to anyone who can help me out with this.

Thanks,

HTML Code:

<form name="form" action="misc.php" method="get">
<input type="hidden" name="do" value="form" />
<input type="hidden" name="fid" value="1" />
Username:
<input type="text" name="user" />
<input type="submit" value="Submit" />
</form>

PHP Code:

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


Custom output enables you to design your own layout using the parts of the form.
PHP Code:

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

The alternative would be to use this code: (it justs adds the field like another question at the end of the form output)
PHP Code:

$formoutput .= $form[preq] . "Username" $form[pstq];
$formoutput .= $form['prea'] . $hiddenfield1 $form[psta]; 


Martyh 04-23-2009 08:58 AM

Thanks again BananaLive,

Let me make sure I'm not wasting your time here, I should do this ?

1.) Use the HTML code on my HTML template

2.) Use the first php code in my hook form start

3.) Use the second php code in my custom output window.

4.) OR use the last php code in place of the third one if I just want to add the field to the end of a form

Please correct where I may be wrong in this sequence.

Thanks

bananalive 04-23-2009 09:28 AM

Quote:

Originally Posted by Martyh (Post 1797269)
Thanks again BananaLive,


Let me make sure I'm not wasting your time here, I should do this ?

1.) Use the HTML code on my HTML template

2.) Use the first php code in my hook form start

3.) Use the second php code in my custom output window.

4.) OR use the last php code in place of the third one if I just want to add the field to the end of a form

Please correct where I may be wrong in this sequence.

Thanks

Yes apart from 3. The custom output is the bbcode/text which is how you want the form's post/email/etc. to look like.

3.) Use the second php code in Form Hook: Before Submit and then do a custom output

Martyh 04-23-2009 09:43 AM

Hi,

OK , a lot of progress. The field name shows up in the new thread at the end ( prefer that one ) but the value doesn't ( actual name entered in form )

Sorry to be a pain.

Thanks

bananalive 04-23-2009 02:12 PM

Quote:

Originally Posted by Martyh (Post 1797286)
Hi,

OK , a lot of progress. The field name shows up in the new thread at the end ( prefer that one ) but the value doesn't ( actual name entered in form )

Sorry to be a pain.

Thanks

view page source of form, and see if you get

<input type="hidden" name="hiddenfield1" ... />

Is there anything in the value="" part of it?

zushiba 04-23-2009 06:37 PM

I'm looking through the help file for information on the save to database function but don't see anything. Anyone have any tips on what this does and how it works?


All times are GMT. The time now is 02:49 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.02721 seconds
  • Memory Usage 1,774KB
  • 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_html_printable
  • (5)bbcode_php_printable
  • (6)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