vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Forms Hack (https://vborg.vbsupport.ru/showthread.php?t=93970)

Zanix 10-02-2005 12:40 AM

Quote:

Originally Posted by Abe1
The option is in the plugin.

Thanks, I looked through the php and found this part that has to do with where to post.

PHP Code:

////////////////////////////////////////////////////////////////////////////////////////////////////
//CHOOSE WHETHER YOU WANT FORM TO BE POSTED IN A NEW THREAD, NEW POLL, REPLY TO EXISITING THREAD, PMed OR EMAILED
///////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE POSTED - 1 = yes, 0 = no
$formforum "1";

//FORUM TO POST NEW THREAD IN
$formforumid "2"

Now I got it to work posting into one forum, but im not sure how to actually set it up so its according to the option from the dropdown menu in the form. I tried a couple of different ways but it just ended up not posting anywhere at all and giving an error.

WNxWakko 10-02-2005 02:34 PM

Any progress yet on why I cant get an unregistered user to be able to use the form?

Abe1 10-02-2005 02:36 PM

Quote:

Originally Posted by WNxWakko
Any progress yet on why I cant get an unregistered user to be able to use the form?

Nope, not yet.

rfairbairn 10-02-2005 08:55 PM

Hi

Thanks for all the work on this.

We have a working version of your hack working well on our test forum, however I'd like to have 2 forms.

I have read other posts and spent some time experimenting to try and come up with the answer, with no luck.

What exactly would I change, or do to the file so that I can have more than one form.

Thanks again

Abe1 10-02-2005 10:49 PM

Quote:

Originally Posted by rfairbairn
Hi

Thanks for all the work on this.

We have a working version of your hack working well on our test forum, however I'd like to have 2 forms.

I have read other posts and spent some time experimenting to try and come up with the answer, with no luck.

What exactly would I change, or do to the file so that I can have more than one form.

Thanks again

Copy the plugin and call it a new name. Also change the form name on the first line of the plugin.

rfairbairn 10-03-2005 09:39 PM

Thanks for the help, I got it to work.

I thought I'd just post this for future reference:

Heres how I got 2 forms to work on the same board:

Copied the file and renamed it

Edit the line in the hack

PHP Code:

<product productid="form_hack" title="Form Hack" 

Changing the product id (keep lower case and use a underscore if you want more than one word)

Change the title - Makes your life easier when you have more than one form

Find:
PHP Code:

        <plugins>
        <
plugin active="1">
            <
title>Form Hack</title>
            <
hookname>newthread_start</hookname>
            <
phpcode><![CDATA[// Name of this form
$formname "form";

if (
$_REQUEST['do'] == $formname

change formname to something else eg
PHP Code:

$formname "anotherform"

After you've imported the product, you should then be able to find your form at:
http://www.yourboard.com/forum/newth...do=anotherform (or whatever your formname is)

eure-mudder 10-05-2005 08:09 AM

Is there any possibility to change the name of the new thread, so that the name of the user who filles in the form is part of the name of the thread?

I want to use this hack to make an introduction Interview, for every new member. And the name of the new Thread schould sometihing like "<username>´s Interview".

Abe1 10-05-2005 11:48 PM

Quote:

Originally Posted by eure-mudder
Is there any possibility to change the name of the new thread, so that the name of the user who filles in the form is part of the name of the thread?

I want to use this hack to make an introduction Interview, for every new member. And the name of the new Thread schould sometihing like "<username>?s Interview".

Put as the thread title "$user[userid]'s Interview".

WNxWakko 10-05-2005 11:48 PM

Is there a way to add the attachment feature to this?

Also similar question as above, but Id like the answer of question one to appear as the title, is that possible?

WNxWakko 10-05-2005 11:58 PM

ok I tried what you told him,

$formtitle = "$user[userid]";

Is that the right spot? Cause it didnt work

Abe1 10-06-2005 12:07 AM

Quote:

Originally Posted by WNxWakko
ok I tried what you told him,

$formtitle = "$user[userid]";

Is that the right spot? Cause it didnt work

Sorry, '$vbulletin->userinfo[username]'

WNxWakko 10-06-2005 02:19 AM

That didnt work either.

$formtitle = "$vbulletin->userinfo[username] Justice Appeal";

output was,

Array[username] Justice Appeal

Abe1 10-06-2005 02:47 AM

Quote:

Originally Posted by WNxWakko
That didnt work either.

$formtitle = "$vbulletin->userinfo[username] Justice Appeal";

output was,

Array[username] Justice Appeal

try

$bbuserinfo = $vbulletin->userinfo;
$formtitle = "$bbuserinfo[username] Justice Appeal";

WNxWakko 10-06-2005 02:49 AM

yeah it worked. Thank you. Um now my other question. How do I pull the answer of question 1 to the title also, and is attachments possible or to complicated?

Abe1 10-06-2005 02:51 AM

Quote:

Originally Posted by WNxWakko
yeah it worked. Thank you. Um now my other question. How do I pull the answer of question 1 to the title also, and is attachments possible or to complicated?

For attachment, you should use the option to transfer to edit post.

You can add the $answer1 varible to the title.

WNxWakko 10-06-2005 03:01 AM

im confused on the attachment part. option to transfer? did get the question working thanks.

Abe1 10-06-2005 03:05 AM

Quote:

Originally Posted by WNxWakko
im confused on the attachment part. option to transfer? did get the question working thanks.

There is an option were to send the user after they click submit. Use the one to go to the edit post page. This way thay can upload attachments right after.

WNxWakko 10-06-2005 03:06 AM

ah, so it will only work after submitting the form.

Abe1 10-06-2005 03:08 AM

Quote:

Originally Posted by WNxWakko
ah, so it will only work after submitting the form.

Yes.

WNxWakko 10-06-2005 04:26 AM

I have another nutty question :) sorry. I have the banner mod installed which allows me to add images or html to put a banner in a forum. Is is possibly for me to put this code into this html box so the form shows up at the top of this forum. If so how would I make this work?

Abe1 10-06-2005 05:12 AM

Quote:

Originally Posted by WNxWakko
I have another nutty question :) sorry. I have the banner mod installed which allows me to add images or html to put a banner in a forum. Is is possibly for me to put this code into this html box so the form shows up at the top of this forum. If so how would I make this work?

You would put it in the main form template.

eure-mudder 10-06-2005 05:15 AM

Quote:

Originally Posted by Abe1
try

$bbuserinfo = $vbulletin->userinfo;
$formtitle = "$bbuserinfo[username] Justice Appeal";

Works fine.
Thank you, great Hack!

PET 10-06-2005 09:03 AM

i don't really understand what this hack do...

neofootball 10-06-2005 04:51 PM

Question for you Abe1 when I edit the hook and remove radio choices and add more text questions do I edit the hook to below:

$vbulletin->input->clean_array_gpc('p', array(
'normalanswer1' => STR,
'normalanswer2' => STR,
'normalanswer3' => STR,
'normalanswer4' => STR,
'normalanswer5' => STR,
'longanswer1' => STR,
'longanswer2' => STR,

'action' => STR
));

$normalanswer1 =& $vbulletin->GPC['normalanswer1'];
$normalanswer2 =& $vbulletin->GPC['normalanswer2'];
$normalanswer3 =& $vbulletin->GPC['normalanswer3'];
$normalanswer4 =& $vbulletin->GPC['normalanswer4'];
$normalanswer5 =& $vbulletin->GPC['normalanswer5'];
$longanswer1 =& $vbulletin->GPC['longanswer1'];
$longanswer2 =& $vbulletin->GPC['longanswer2'];
??

Because I can only get it to show normalanswer1 & longanswer1.

Abe1 10-06-2005 06:25 PM

Quote:

Originally Posted by neofootball
Question for you Abe1 when I edit the hook and remove radio choices and add more text questions do I edit the hook to below:

$vbulletin->input->clean_array_gpc('p', array(
'normalanswer1' => STR,
'normalanswer2' => STR,
'normalanswer3' => STR,
'normalanswer4' => STR,
'normalanswer5' => STR,
'longanswer1' => STR,
'longanswer2' => STR,

'action' => STR
));

$normalanswer1 =& $vbulletin->GPC['normalanswer1'];
$normalanswer2 =& $vbulletin->GPC['normalanswer2'];
$normalanswer3 =& $vbulletin->GPC['normalanswer3'];
$normalanswer4 =& $vbulletin->GPC['normalanswer4'];
$normalanswer5 =& $vbulletin->GPC['normalanswer5'];
$longanswer1 =& $vbulletin->GPC['longanswer1'];
$longanswer2 =& $vbulletin->GPC['longanswer2'];
??

Because I can only get it to show normalanswer1 & longanswer1.

This is great! But, you have to add to the formanswers template these new varibles also.

neofootball 10-06-2005 06:27 PM

They are in the template that's what I don't understand why only two is showing.

Abe1 10-06-2005 06:29 PM

Quote:

Originally Posted by neofootball
They are in the template that's what I don't understand why only two is showing.

In the form, did you make sure you changed the name= to normalanswer1 & longanswer1

neofootball 10-06-2005 09:18 PM

Yes they are correctly in the template form.

Mepher 10-07-2005 12:12 AM

Abe is it possible to have the form post to 2 seperate forums? I have it all set up and working with a custom form. It posts to a single forum fine but I would like it to generate 2 seperate posts in different forums.

WNxWakko 10-07-2005 02:33 AM

Quote:

Originally Posted by Abe1
You would put it in the main form template.


Im not sure what you mean? I did try copying the form template info into the banner html header box, but it just displayed all the boxes and code.

WNxWakko 10-08-2005 04:06 AM

Hi (waves) ya me again :) I do have another question. How can I make the required fields not for all but only for certain questions?

RMS-Chef 10-08-2005 04:14 AM

Quote:

Originally Posted by WNxWakko
Hi (waves) ya me again :) I do have another question. How can I make the required fields not for all but only for certain questions?

Look in the plugin code not too far below the end of the variables setup.
Look for:
Code:

  if ($answerall == "1")
A couple lines under that you will see the question variables listed in a format something like:
Code:

$answer1 == '' OR $answer2 == '' OR $answer3 == ..........etc.
Just remove the answers you do not want to be required and add in any custom ones that you do want answered.

Of course make sure you set that you want answers to be required in the upper part plugin. ;)

WNxWakko 10-09-2005 01:08 AM

Thank you all for your assistance with my needy needs. I appriciate it. There is still a couple things I want this to do, but most have been resolved so thanks.

Alteran Ancient 10-09-2005 02:49 PM

Is there any way you can ger the User's Username included IN the name of the Thread you create with the form.

Abe1 10-09-2005 08:06 PM

Quote:

Originally Posted by Cycloneflame
Is there any way you can ger the User's Username included IN the name of the Thread you create with the form.

Look back a few posts.

silurius 10-10-2005 03:56 AM

Argh, this is a great concept but having a heck of a time with the customization of it. Still, I should not be complaining.

Main issue at the moment is, I seemed to have done something wrong and my forums will not load up the form no matter what. This is even after uninstalling the product, making sure it was not listed in product/plugin/styles, clearing my cache and reinstalling it again.

"Sorry! This forum is not accepting new posts." <- get this on DEFAULT installation now

What could I be missing?

Abe1 10-10-2005 05:02 AM

Quote:

Originally Posted by silurius
Argh, this is a great concept but having a heck of a time with the customization of it. Still, I should not be complaining.

Main issue at the moment is, I seemed to have done something wrong and my forums will not load up the form no matter what. This is even after uninstalling the product, making sure it was not listed in product/plugin/styles, clearing my cache and reinstalling it again.

"Sorry! This forum is not accepting new posts." <- get this on DEFAULT installation now

What could I be missing?

It means the settings for the forum you want to post the thread in, dont allow you to post.

Mepher 10-10-2005 10:43 AM

Abe, reposting this from a page back.

Quote:

Originally Posted by Mepher
Abe is it possible to have the form post to 2 seperate forums? I have it all set up and working with a custom form. It posts to a single forum fine but I would like it to generate 2 seperate posts in different forums.


Abe1 10-10-2005 12:10 PM

Quote:

Originally Posted by Mepher
Abe, reposting this from a page back.

Find this:
PHP Code:

build_new_post('thread'$foruminfo, array(), array(), $newpost$errors); 

add after:
PHP Code:

$foruminfo verify_id('forum'$formforumid01);
$forumperms fetch_permissions($foruminfo[forumid]);
build_new_post('thread'$foruminfo, array(), array(), $newpost$errors); 

Replace on the first line '$formforumid' with the other forumid you want to post in.

Mepher 10-10-2005 12:14 PM

Nice, thanks for the fast reply Abe.


All times are GMT. The time now is 02:25 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.02074 seconds
  • Memory Usage 1,852KB
  • 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
  • (2)bbcode_code_printable
  • (6)bbcode_php_printable
  • (19)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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