vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   New Posting Features - Form Hack (https://vborg.vbsupport.ru/showthread.php?t=126676)

attroll 03-05-2008 05:28 AM

Quote:

Originally Posted by Deep-X (Post 1457123)
No Divine is right since version 3.6.8 patch 2 this now creates a new error in newthread.php on line 654 and such. I had to disable the hack to get it from displaying the error code on all new posts.

Please advise

I have this working with version 3.6.8 patch 2 with no problem.

DivineMessenger 03-05-2008 08:31 AM

I know it WILL work I just don't know why mine wont... I have had like 6 people check it over and no one can figure it out.

Kwikms 03-05-2008 09:16 AM

Quote:

Originally Posted by DivineMessenger (Post 1457368)
I know it WILL work I just don't know why mine wont... I have had like 6 people check it over and no one can figure it out.

I'll take the challenge. Send me a PM with the form and the two templates and I take a look at it.

nothing4me 03-05-2008 09:38 AM

How do I require attachments or it can't be posted/sent?
How do I require attachments or it can't be posted/sent?
How do I require attachments or it can't be posted/sent?
How do I require attachments or it can't be posted/sent?
How do I require attachments or it can't be posted/sent?
How do I require attachments or it can't be posted/sent?
How do I require attachments or it can't be posted/sent?
How do I require attachments or it can't be posted/sent?


Sorry for the copy + paste, but I had to.... I was being ignored. :(

attroll 03-05-2008 04:16 PM

Quote:

Originally Posted by DivineMessenger (Post 1457368)
I know it WILL work I just don't know why mine wont... I have had like 6 people check it over and no one can figure it out.

Have you tried disabling all your other plugins and then trying it to see if it will work? That would isolate it being one of your other plugins. If it works after you disable all your other plugins then I would enable one at a time and see which one it is interfearing with.

If that is not the casue I would say I will look into it but it looks like Kwikms is going to look into it for you already. If they can not figure it oout let me know. I can not promise anything.

illithid 03-05-2008 05:09 PM

Quote:

Originally Posted by Deep-X (Post 1457123)
No Divine is right since version 3.6.8 patch 2 this now creates a new error in newthread.php on line 654 and such. I had to disable the hack to get it from displaying the error code on all new posts.

Please advise

I am using version 3.6.8pl2 and have 2 forms working just fine on my board. One of my forms, I have hacked to bits and rebuilt as an entire stand-alone product instead of being a plugin for the original product. They work great with no errors.

Quote:

Originally Posted by Kwikms (Post 1456585)
@Divine - Could be everyting, like a forgotten ; or one " to much where it shouldnt be.

Kwikms, is correct in this statement. Alot of problems can occur from adding in or forgetting to add a ';' or ' " '.

Quote:

Originally Posted by DivineMessenger (Post 1457147)
I'll pay someone $10 to get mine working! lol

If you still need help, pm me. I can try to assist you. Money is not needed.

snunhuck 03-05-2008 10:36 PM

How do I remove the dropdown meny and some radio button questions?

illithid 03-06-2008 02:57 AM

You need to edit the following templates :
  • form
  • formanswers

To do this open the product-form.xml in a text editor. Find
Code:

<template name="form" templatetype="template"
Look through the code that follows, it is the actual template that sets up the structure of the form. This is the area in which the html code will be for the drop down menu and the radio buttons.

Once you have edited that, find
Code:

<template name="formanswers" templatetype="template"
This template returns the questions and answers from the form. You will need to remove the variables in this template that correspond to the drop down menu and the radio buttons.

Now find
Code:

// Part 1
Remove the lines that correspond to the drop down menu and the radio button that you have removed from the templates. Proceed down the page a bit to
Code:

// Part 2
Again, remove the lines that correspond to the drop down menu and radio buttons.

The next part is optional, but I recommend that you do this -> continue down the page until you find where the radio button variables and drop down menu are set with values. Remove these from the file. No sense in code existing in the file if it is not being used.

zmmmzz 03-06-2008 05:42 PM

is there a way I can add tags through this mod?

illithid 03-06-2008 06:28 PM

Quote:

Originally Posted by zmmmzz (Post 1458647)
is there a way I can add tags through this mod?

Not sure I understand what you mean by "tags". If you are talking about html tags, then yes. You will have to do that via the template "form". Also, some of the variables in the php code section of the xml document can hold html tags as part of the variable definition.

If this doesn't help, then please be more specific with the meaning of "tags".

DivineMessenger 03-07-2008 11:52 AM

ok i got an error:

"XML Error: not well-formed (invalid token) at Line 548"
the line is
"$dropdownanswer3_g = $vbulletin->GPC['dropdownanswer3_g'];"

Any ideas?

illithid 03-07-2008 03:37 PM

Quote:

Originally Posted by DivineMessenger (Post 1459236)
ok i got an error:

"XML Error: not well-formed (invalid token) at Line 548"
the line is
"$dropdownanswer3_g = $vbulletin->GPC['dropdownanswer3_g'];"

Any ideas?

It looks like you may be setting up your variables incorrectly. Send your xml file to me, I will take a look at it and see if I can fix it for you.

snunhuck 03-07-2008 08:47 PM

Quote:

Originally Posted by illithid (Post 1458145)
You need to edit the following templates :
  • form
  • formanswers

To do this open the product-form.xml in a text editor. Find
Code:

<template name="form" templatetype="template"
Look through the code that follows, it is the actual template that sets up the structure of the form. This is the area in which the html code will be for the drop down menu and the radio buttons.

Once you have edited that, find
Code:

<template name="formanswers" templatetype="template"
This template returns the questions and answers from the form. You will need to remove the variables in this template that correspond to the drop down menu and the radio buttons.

Now find
Code:

// Part 1
Remove the lines that correspond to the drop down menu and the radio button that you have removed from the templates. Proceed down the page a bit to
Code:

// Part 2
Again, remove the lines that correspond to the drop down menu and radio buttons.

The next part is optional, but I recommend that you do this -> continue down the page until you find where the radio button variables and drop down menu are set with values. Remove these from the file. No sense in code existing in the file if it is not being used.

Thanks :D

Skyline_GT 03-08-2008 11:06 AM

This is very confusing when adding new questions..

synisterk 03-08-2008 05:11 PM

I was fighting a simple order form on my site,

This is perfect for that....great hack.

Deep-X 03-17-2008 11:15 PM

Ok some times its the ; or the , that you deleted that you miss. So I need help with this if anybody can direct me.

Quote:

// To add more then one form, copy this whole text, and creat a new plug-in with the hook location 'newthread_start'.
// After, change the form name. You can't have 2 forms with the same name.

// Name of this form
$formname = "application";

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

// ################################################## #####################
// ######################## CUSTOMIZE VARIABLES ##########################
// ################################################## #####################

////////////////////////////////////////////////////////////////////////////////////////////////////
////// BEGIN CUSTOMIZATION BELOW////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//VARIABLES
//Study how variables are add here to add or remove any. If you add a variable to your form, you must add it to part one and part two.
////////////////////////////////////////////////////////////////////////////////////////////////////

// Part 1
$vbulletin->input->clean_array_gpc('p', array(
'normalanswer1' => TYPE_STR,
'radioanswer1' => TYPE_STR,
'normalanswer2' => TYPE_STR,
'normalanswer3' => TYPE_STR,
'answer1' => TYPE_STR,
'answer2' => TYPE_STR,
'answer3' => TYPE_STR,
'dropdownanswer1' => TYPE_STR,
'dropdownanswer2' => TYPE_STR,
'longanswer1' => TYPE_STR
));

// Part 2
$normalanswer1 = $vbulletin->GPC['normalanswer1'];
$radioanswer1 = $vbulletin->GPC['radioanswer1'];
$normalanswer2 = $vbulletin->GPC['normalanswer1'];
$normalanswer3 = $vbulletin->GPC['normalanswer1'];
$answer1 = $vbulletin->GPC['answer1'];
$answer2 = $vbulletin->GPC['answer2'];
$answer3 = $vbulletin->GPC['answer3'];
$dropdownanswer1 = $vbulletin->GPC['dropdownanswer1'];
$dropdownanswer2 = $vbulletin->GPC['dropdownanswer1'];
$longanswer1 = $vbulletin->GPC['longanswer1'];

////////////////////////////////////////////////////////////////////////////////////////////////////
//USERGROUPS ALLOWED
//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array.
//To enable this feature, remove the '//' before the 'if'.
////////////////////////////////////////////////////////////////////////////////////////////////////

// if (!in_array($vbulletin->userinfo['usergroupid'], array(2,5,6,7,9))) print_no_permission();

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//NAME OF TEMPLATES - DO THIS BIT IF YOU ARE MAKING MORE FORMS AND WANT TO USE A DIFFERENT LOOKING TEMPLATE
////////////////////////////////////////////////////////////////////////////////////////////////////

// Name of the main template
$maintemplate = "recruitment";
// Name of the answer template
$answertemplate = "formanswers";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//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
//You CAN make this number a variable. You can have a drop down menu or in the link like do=form&f=1. Make sure you add it the variables list.
$formforumid = "4";

//ENABLE POLL TO BE CREATED - 1 = yes, 0 = no
$formpoll = "0";
$polloption[1] = "Yes";
$polloption[2] = "No";
//$polloption[3] = "Maybe";

//Make poll public - 1 = yes, 0 = no
$pollpublic = "1";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO REPLY TO EXISTING THREAD - 1 = yes, 0 = no
$formreply = "0";

//EXISTING THREAD ID FOR FORM TO REPLY IN
$formreplythreadid = "4";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE PMED (guests CANNOT use this option) - 1 = yes, 0 = no
$formpm = "1";

//USERNAME TO PM TO (separate multiple usernames with a ';')
$formpmname = "Ol_Man;Professor;Suicide;Art;Slayer";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE EMAILED - 1 = yes, 0 = no
$formemail = "0";

//EMAIL ADDRESS TO EMAIL TO (separate multiple usernames with a ';')
$formemailaddress = "csnyderiii@global-fortress.com";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE ATTACHMENTS - 1 = yes, 0 = no
//attachments can only be used if the form is going to make a new thread or post
$allow_attachments = "1";

////////////////////////////////////////////////////////////////////////////////////////////////////



////////////////////////////////////////////////////////////////////////////////////////////////////
//REDIRECT OPTIONS:
// 0 - thank you message (thread, reply, pm, or email)
// 1 - redirect to post (thread or reply)
// 2 - redirect to thread (thread only)
// 3 - redirect to forum (thread only)
// 4 - redirect to editpost (thread or reply)
//
// Feel free to change the thank you message if you choose option 0
////////////////////////////////////////////////////////////////////////////////////////////////////

$redirectoption = "3";

$errormessage = "Thank you for submitting this form!"; //This is the thank you message

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//FORCE USER TO ANSWER ALL QUESTIONS - 1 = yes, 0 = no
//If you added or deleted variables, you must edit what it checked for. Search for "$answerall ==" and edit 2 lines under it.
////////////////////////////////////////////////////////////////////////////////////////////////////

$answerall = "1";

////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF FORM (do not use quotation marks or you will get a parse error, besides the quotes around the whole title)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formtitle = "GFC R.A.C Application";

////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF THREAD/POST/PM/EMAIL (do not use quotation marks in the title or you will get a parse error)
//You may use variables from the form for this.
////////////////////////////////////////////////////////////////////////////////////////////////////

$posttitle = "$formtitle";

////////////////////////////////////////////////////////////////////////////////////////////////////
//PURPOSE OF FORM (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formpurpose = "If you are interested in joining the Global Fortress Community you must read & follow the instructions below";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion1 = "Fill in your Game user name(s).";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion1 = "Do you own & use a microphone? We require all new recruits to use Ventrilo www.ventrilo.com & you will need a microphone for this. Check out the Ventrilo Server Info on the front of the website. r IP and setup info. With out a microphone you will not be recruited.";

// The following choices must NOT have quotation marks
$radiochoice1a = "yes";
$radiochoice1b = "no";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 2 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion2 = "Fill in your xfire user name.";
//$radioquestion2 = "Do you have xFire Installed(recommended).
//www.xfire.com";

// The following choices must NOT have quotation marks
//$radiochoice2a = "Yes";
//$radiochoice2b = "No";


////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 3 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

//$radioquestion3 = "";
$normalquestion3 = "Make sure you get your steam ID / BF2 PID / BF2142 PID / In Game user Name";
// The following choices must NOT have quotation marks
//$radiochoice3a = "Yes";
//$radiochoice3b = "No";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
$question1 = "How long have you been playing?";
$explain1 = "Please list how long you have been playing the game which you are applying";

//QUESTION 2 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
$question2 = "How old are you?";
$explain2 = "Please enter your age here.";

//QUESTION 3 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
$question3 = "Have you been in any clans?";
$explain3 = "Please enter your Clan names that you have been associated with.";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//DROP DOWN CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$dropdownquestion1 = "Are you presently in a another Clan?";

// The following choices must NOT have quotation marks
$dropdownchoice1a = "No";
$dropdownchoice1b = "Yes";
//$dropdownchoice1c = "Yes but with another Game";

////////////////////////////////////////////////////////////////////////////////////////////////////

$dropdownquestion2 = "Which Games are you applying for?";

// The following choices must NOT have quotation marks
$dropdownchoice1a = "Counter-Strike Source";
$dropdownchoice1b = "Team Fortress 2";
$dropdownchoice1c = "Day of Defeat Source";
$dropdownchoice1d = "Battlefield2";
$dropdownchoice1e = "Battlefield 2142";
$dropdownchoice1f = "Call of Duty 4";
$dropdownchoice1g = "Project Torque";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//CHECK BOX CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////
//$checkboxquestion1 = "Which game are you applying for.";

// The following choices must NOT have quotation marks
//$checkboxchoice1_1 = "Counter-Strike : Source";
//$checkboxchoice1_2 = "Battlefield 2142";
//$checkboxchoice1_3 = "Other then listed Above";


////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//LONG TEXT AREA INPUT: QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////


$longquestion1 = "Please tell us why you want to join Global Fortress Community.";
$longexplain1 = "Please be as detailed as possible.";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//VB TEXT AREA INPUT: You can only have ONE vb text question. (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$vbtextquestion = "In order to keep GFC gaming servers, voice server, fourms etc running we require donations by members. Are you willing to donate a small ($5) monthly amount to help with these costs? Please write down any additional information that you want to add that might help us recruit you.";
$vbtextexplain = "";

////////////////////////////////////////////////////////////////////////////////////////////////
////// END OF CUSTOMIZATION ////////////////////////////////////////////////////////////////////
///// DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU ARE DOING!!! ////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
We are a gaming clan so this is a recruitment form any suggestion would be great.

Kwikms 03-18-2008 07:42 AM

Quote:

Originally Posted by Deep-X (Post 1467456)
Are you willing to donate a small ($5) monthly amount to help with these costs?

I think the "$5" could be a problem. User HTML-Code instead.

Deepdog009 03-18-2008 04:12 PM

Been away folks and its good 2 be back and C that this mod by ABE1 is over 900 installs,,, Beauts...


I recently had an accident on the freeway and im still recovering from injuries inflicted by slamming head on into separator...


I'll never buy another V-8 engine :( 2 many headaches... :eek:;)

I will try 2 assist if time permits...

Good Luck 2 ALL...

amroawad 03-18-2008 07:57 PM

Hi,

I have imported the xml file but I can change anything. Where can I start using this tool.

Thanks

tehtide 03-20-2008 03:09 PM

Quote:

Originally Posted by Grimbone (Post 1386959)
In the code below. how would I go about sending a post to 2 different forums?

Code:

$formforumid = "13";
I am trying to get this to post to both a regular section of the forums and to a private section.

Has anyone been able to come up with a solution to have this post in two different forums? I'm in the same boat... I need this form to go to a public section so that the user can comment, but then I need to have that same form be posted to a private section where membership can comment and discuss w/o the user being able to read the comments etc...

Basically a complaint form.

trevanh 03-21-2008 06:34 AM

I set up 4 forms and got them all working beautifully. Then after a few weeks, they stopped working. Now, even logged in as admin01, I get the following error (when I try to simply access any of the forms):

you do not have permission to access this page. This could be due to one of several reasons:

Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.


I'm not sure what happened. They only thing I can think of is that I installed vBAdvanced CMPS, passiveVid, and GTUserCP since the forms were working.

Does anybody know what the cause of this problem may be? Is it a conflict with one of the other programs? I don't know where to go from here...

Help!

Brundlefly 03-21-2008 06:20 PM

Quote:

Originally Posted by trevanh (Post 1470470)
I set up 4 forms and got them all working beautifully. Then after a few weeks, they stopped working. Now, even logged in as admin01, I get the following error (when I try to simply access any of the forms):

you do not have permission to access this page. This could be due to one of several reasons:

Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.


I'm not sure what happened. They only thing I can think of is that I installed vBAdvanced CMPS, passiveVid, and GTUserCP since the forms were working.

Does anybody know what the cause of this problem may be? Is it a conflict with one of the other programs? I don't know where to go from here...

Help!

This looks like what you'd get if you have garbage in your $formforumid variable. Verify the forum ids you have the forms posting into.

trevanh 03-21-2008 06:58 PM

Here's what I see in the plugin manager for each and every form I've created:

$formforumid = "34";

That forum does exist, and functions normally.

Is that what you were referring to? Not sure where else to look for garbage...

This is a forum that only admins are allowed to view, but I do want users from specified groups to be able to post in that forum. So, in the plugin, I added the usergroups that I want to have access to the form, and for that forum, I allowed those usergroups permission to post but not view.

What am I missing?

So, to reiterate, even admin01 cannot so much as VIEW these forms- permissions errors every time.
:confused:

Deepdog009 03-21-2008 07:43 PM

Quote:

Originally Posted by trevanh (Post 1470977)
Here's what I see in the plugin manager for each and every form I've created:

$formforumid = "34";

That forum does exist, and functions normally.

Is that what you were referring to? Not sure where else to look for garbage...

This is a forum that only admins are allowed to view, but I do want users from specified groups to be able to post in that forum. So, in the plugin, I added the usergroups that I want to have access to the form, and for that forum, I allowed those usergroups permission to post but not view.

What am I missing?

So, to reiterate, even admin01 cannot so much as VIEW these forms- permissions errors every time.
:confused:

trevanh its probably another MOD that is affecting your forms...

Did U recently add anything new 2 your products???

Several folks had the same issue and unistalling permission MODs fixed it...

Also could be your usergroup permissions,,, maybe...

Im still recovering from a vehicle accident and haven't done much vbulletin troubleshooting,,, but if time permits and my back getts better, I will post more...

Good Luck 2 ya

trevanh 03-21-2008 08:39 PM

Thanks for your reply, Deepdog009.

Besides this Form Hack, I have the following mods installed:

passiveVid
vBAdvanced CMPS
GTUserCP

I just made them inactive but the problem remains.

Perhaps there's something that I need to run in diagnostics or maintenance to get the changes to take?

vbuser99 03-27-2008 03:05 PM

Nice work. This is what I was looking for.

trevanh 03-27-2008 03:27 PM

Quote:

Originally Posted by trevanh (Post 1471070)
Thanks for your reply, Deepdog009.

Besides this Form Hack, I have the following mods installed:

passiveVid
vBAdvanced CMPS
GTUserCP

I just made them inactive but the problem remains.

Perhaps there's something that I need to run in diagnostics or maintenance to get the changes to take?

OK, we found the problem:

We had to modify each Form we'd created in vBulletin with the following change (first the original code, then the new code):

ORIGINAL CODE
////////////////////////////////////////////////////////////////////////////////////////////////////
//USERGROUPS ALLOWED
//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array.
//To enable this feature, remove the '//' before the 'if'.
////////////////////////////////////////////////////////////////////////////////////////////////////

if (!in_array($vbulletin->userinfo['11'], array(5,6,7,11))) print_no_permission();



NEW CODE
////////////////////////////////////////////////////////////////////////////////////////////////////
//USERGROUPS ALLOWED
//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array.
//To enable this feature, remove the '//' before the 'if'.
////////////////////////////////////////////////////////////////////////////////////////////////////

// Use the line below to customize the allowed groups access to this form
$allowed_group_ids = array(6,7,11,12,13);

$form_view_permission = false;
$member_group_id_array = explode(',', $vbulletin->userinfo['membergroupids']);
if (in_array($vbulletin->userinfo['usergroupid'], $allowed_group_ids)) {
$form_view_permission = true;
}
foreach ($member_group_id_array as $membergroupid){
if(in_array($membergroupid, $allowed_group_ids)){
$form_view_permission = true;
}
}
if ($form_view_permission == false) print_no_permission();

This change allows users to access the Forms if their primary or member group ids match the list specified in the $form_view_permission array.

Deepdog009 03-30-2008 07:27 AM

Quote:

Originally Posted by trevanh (Post 1475949)
OK, we found the problem:

We had to modify each Form we'd created in vBulletin with the following change (first the original code, then the new code):

ORIGINAL CODE
////////////////////////////////////////////////////////////////////////////////////////////////////
//USERGROUPS ALLOWED
//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array.
//To enable this feature, remove the '//' before the 'if'.
////////////////////////////////////////////////////////////////////////////////////////////////////

if (!in_array($vbulletin->userinfo['11'], array(5,6,7,11))) print_no_permission();



NEW CODE
////////////////////////////////////////////////////////////////////////////////////////////////////
//USERGROUPS ALLOWED
//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array.
//To enable this feature, remove the '//' before the 'if'.
////////////////////////////////////////////////////////////////////////////////////////////////////

// Use the line below to customize the allowed groups access to this form
$allowed_group_ids = array(6,7,11,12,13);

$form_view_permission = false;
$member_group_id_array = explode(',', $vbulletin->userinfo['membergroupids']);
if (in_array($vbulletin->userinfo['usergroupid'], $allowed_group_ids)) {
$form_view_permission = true;
}
foreach ($member_group_id_array as $membergroupid){
if(in_array($membergroupid, $allowed_group_ids)){
$form_view_permission = true;
}
}
if ($form_view_permission == false) print_no_permission();

This change allows users to access the Forms if their primary or member group ids match the list specified in the $form_view_permission array.

*********************************************

That's great you found the issue and resolved it...

Its usually something that U missed or overlooked that's causing the problems...

I will be posting more and troubleshooting more in the near future...

Good Luck 2 U


*********************************************

ionian 03-30-2008 04:31 PM

Thank you very much for this usefull hack

Haltech 03-31-2008 07:18 PM

I don't quite understand this step:
#
# Edit the main plug-in - the instructions are all inside the hook itself, in the top half. Follow the instructions carefully!

where do I go?

Thanks

Haltech 03-31-2008 09:28 PM

Never mind, found it.

BryanG 04-01-2008 08:12 PM

Ok. I'm not sure what I am doing wrong, but my form is not coming up properly.

My form has 16 questions:

4 Radio Questions
7 Long Questions
3 Check Questions
1 Normal Question
1 Question

I've also set my array to match my questions:

Code:

//Part 1
$vbulletin->input->clean_array_gpc('p', array(
'radioanswer1' => TYPE_STR,
'normalanswer2' => TYPE_STR,
'radioanswer3' => TYPE_STR,
'longanswer4' => TYPE_STR,
'longanswer5' => TYPE_STR,
'longanswer6' => TYPE_STR,
'longanswer7' => TYPE_STR,
'checkboxanswer8_1' => TYPE_STR,
'checkboxanswer8_2' => TYPE_STR,
'checkboxanswer8_3' => TYPE_STR,
'checkboxanswer8_4' => TYPE_STR,
'answer9' => TYPE_STR,
'longanswer10' => TYPE_STR,
'longanswer11' => TYPE_STR,
'checkboxanswer12_1' => TYPE_STR,
'checkboxanswer12_2' => TYPE_STR,
'checkboxanswer12_3' => TYPE_STR,
'checkboxanswer12_4' => TYPE_STR,
'checkboxanswer12_5' => TYPE_STR,
'checkboxanswer12_6' => TYPE_STR,
'checkboxanswer12_7' => TYPE_STR,
'checkboxanswer13_1' => TYPE_STR,
'checkboxanswer13_2' => TYPE_STR,
'checkboxanswer13_3' => TYPE_STR,
'checkboxanswer13_4' => TYPE_STR,
'checkboxanswer13_5' => TYPE_STR,
'checkboxanswer13_6' => TYPE_STR,
'checkboxanswer13_7' => TYPE_STR,
'longanswer14' => TYPE_STR,
'radioanswer15' => TYPE_STR,
'radioanswer16' => TYPE_STR
));

And my variables to match the questions as well:

Code:

// Part 2
$radioanswer1 = $vbulletin->GPC['radioanswer1'];
$normalanswer2 = $vbulletin->GPC['normalanswer2'];
$radioanswer3 = $vbulletin->GPC['radioanswer3'];
$longanswer4 = $vbulletin->GPC['longanswer4'];
$longanswer5 = $vbulletin->GPC['longanswer5'];
$longanswer6 = $vbulletin->GPC['longanswer6'];
$longanswer7 = $vbulletin->GPC['longanswer7'];
$checkboxanswer8_1 = $vbulletin->GPC['checkboxanswer8_1'];
$checkboxanswer8_2 = $vbulletin->GPC['checkboxanswer8_2'];
$checkboxanswer8_3 = $vbulletin->GPC['checkboxanswer8_3'];
$checkboxanswer8_4 = $vbulletin->GPC['checkboxanswer8_4'];
$answer9 = $vbulletin->GPC['answer9'];
$longanswer10 = $vbulletin->GPC['longanswer10'];
$longanswer11 = $vbulletin->GPC['longanswer11'];
$checkboxanswer12_1 = $vbulletin->GPC['checkboxanswer12_1'];
$checkboxanswer12_2 = $vbulletin->GPC['checkboxanswer12_2'];
$checkboxanswer12_3 = $vbulletin->GPC['checkboxanswer12_3'];
$checkboxanswer12_4 = $vbulletin->GPC['checkboxanswer12_4'];
$checkboxanswer12_5 = $vbulletin->GPC['checkboxanswer12_5'];
$checkboxanswer12_6 = $vbulletin->GPC['checkboxanswer12_6'];
$checkboxanswer12_7 = $vbulletin->GPC['checkboxanswer12_7'];
$checkboxanswer13_1 = $vbulletin->GPC['checkboxanswer13_1'];
$checkboxanswer13_2 = $vbulletin->GPC['checkboxanswer13_2'];
$checkboxanswer13_3 = $vbulletin->GPC['checkboxanswer13_3'];
$checkboxanswer13_4 = $vbulletin->GPC['checkboxanswer13_4'];
$checkboxanswer13_5 = $vbulletin->GPC['checkboxanswer13_5'];
$checkboxanswer13_6 = $vbulletin->GPC['checkboxanswer13_6'];
$checkboxanswer13_7 = $vbulletin->GPC['checkboxanswer13_7'];
$longanswer14 = $vbulletin->GPC['longanswer14'];
$radioanswer15 = $vbulletin->GPC['radioanswer15'];
$radioanswer16 = $vbulletin->GPC['radioanswer16'];

But, when I view the questionnaire, it looks like the attached image... :confused:

Any suggestions?

BryanG 04-01-2008 10:53 PM

Nevermind...I'm just going to un-install this hack. I didn't realize that you had to change templates and change the part of the script where it says "Do not change beyoind this point" to get the thing to work.

Nor did I realize that making a simple form could be made so complicated.

Why? Because all it says is "Edit the main plug-in - the instructions are all inside the hook itself, in the top half. Follow the instructions carefully!". Doesn't mention anything about ALL of the other stuff you have to edit. I thought all I might have to do is put questions in and the type of answers I wanted for each question (ie. checkbox, dropdown, textbox, etc.), and that would be it.

Good concept, poor way of going about doing it.

nightbloom 04-02-2008 05:24 AM

I ended up uninstalling as well. If this could be made into something nice and tidy in the CP with simple input fields then it would be great.

It breaks too often and is just too much WORK on top of running a busy forum.

Fabulous idea, poor implementation for me.

BryanG 04-02-2008 02:52 PM

I wouldn't even really classify this as a mod.

It's more or less some code, or a template, and then you have to change all of it to fit what you want it to do.

Deepdog009 04-02-2008 06:11 PM

Folks you've gotta remember that some Hacks take a bit of time 2 perfect,,, and if the Guy or Gal releasing it doesn't have many free hours to invest in them,,, then you must B patient with Modders new releases or updates...

Im sure many Guys and Gals here @ this site have a job and family to tend 2 also...
Sometimes their computer may B down or like me,,, always on the road...

Please give ALL Modders support so that they will possibly update in the future and continue releases... {{{ DONATE }}}

PHP, Javascript, CSS, Html, Flash, XML coding isn't easy and it can take up much of your free time in some cases.

Yes this Mod can B - A - bit of time setting up,,, But it is very useful boosting your new members numbers and it has other great advantages with member feedback...


Remember if you never ASK you'll never GET...

Support ALL modders and more updates may come your way...

Gotta Go now and Put back on my Ball & Chain...
;)

Smurky 04-03-2008 02:26 AM

I am wondering, is there another mod available that does the same as this one?

BryanG 04-03-2008 08:05 PM

There is for older versions (https://vborg.vbsupport.ru/showthread.php?t=53269) but I think it was abandoned by the previous coder as this is pretty much his script updated to work in 3.6.X.

There is also another one out there based off of this script, but it's made specifically for WoW Clan applications (https://vborg.vbsupport.ru/showthread.php?t=150424).

Msfantastico 04-04-2008 12:43 PM

please help

I can't seem to get this for to post. It shows up and appears to work fine and gives a thank you message...but it isn't posting in the forum listed...it just does nothing.

Here is my template
Code:


// To add more then one form, copy this whole text, and creat a new plug-in with the hook location 'newthread_start'.
// After, change the form name. You can't have 2 forms with the same name.

// Name of this form
$formname = "form";

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

// #######################################################################
// ######################## CUSTOMIZE VARIABLES ##########################
// #######################################################################

////////////////////////////////////////////////////////////////////////////////////////////////////
////// BEGIN CUSTOMIZATION BELOW////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//VARIABLES
//Study how variables are add here to add or remove any. If you add a variable to your form, you must add it to part one and part two.
////////////////////////////////////////////////////////////////////////////////////////////////////

// Part 1
$vbulletin->input->clean_array_gpc('p', array(
'normalanswer1' => TYPE_STR,
'radioanswer1' => TYPE_STR,
'radioanswer2' => TYPE_STR,
'radioanswer3' => TYPE_STR,
'radioanswer3other' => TYPE_STR,
'answer1' => TYPE_STR,
'answer2' => TYPE_STR,
'answer3' => TYPE_STR,
'dropdownanswer1' => TYPE_STR,
'checkboxanswer1_1' => TYPE_STR,
'checkboxanswer1_2' => TYPE_STR,
'checkboxanswer1_3' => TYPE_STR,
'longanswer1' => TYPE_STR
));

// Part 2
$normalanswer1 = $vbulletin->GPC['normalanswer1'];
$radioanswer1 = $vbulletin->GPC['radioanswer1'];
$radioanswer2 = $vbulletin->GPC['radioanswer2'];
$radioanswer3 = $vbulletin->GPC['radioanswer3'];
$radioanswer3other = $vbulletin->GPC['radioanswer3other'];
$answer1 = $vbulletin->GPC['answer1'];
$answer2 = $vbulletin->GPC['answer2'];
$answer3 = $vbulletin->GPC['answer3'];
$dropdownanswer1 = $vbulletin->GPC['dropdownanswer1'];
$checkboxanswer1_1 = $vbulletin->GPC['checkboxanswer1_1'];
$checkboxanswer1_2 = $vbulletin->GPC['checkboxanswer1_2'];
$checkboxanswer1_3 = $vbulletin->GPC['checkboxanswer1_3'];
$longanswer1 = $vbulletin->GPC['longanswer1'];

////////////////////////////////////////////////////////////////////////////////////////////////////
//USERGROUPS ALLOWED
//You can add or remove usegroups that are ALLOWED to use this form by changing the numbers below in the array.
//To enable this feature, remove the '//' before the 'if'.
////////////////////////////////////////////////////////////////////////////////////////////////////

// if (!in_array($vbulletin->userinfo['usergroupid'], array(2,6))) print_no_permission();

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//NAME OF TEMPLATES - DO THIS BIT IF YOU ARE MAKING MORE FORMS AND WANT TO USE A DIFFERENT LOOKING TEMPLATE
////////////////////////////////////////////////////////////////////////////////////////////////////

// Name of the main template
$maintemplate = "form";
// Name of the answer template
$answertemplate = "formanswers";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//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
//You CAN make this number a variable. You can have a drop down menu or in the link like do=form&f=1. Make sure you add it the variables list.
$formforumid = "1";

//ENABLE POLL TO BE CREATED - 1 = yes, 0 = no
$formpoll = "0";
$polloption[1] = "Yes";
$polloption[2] = "No";
$polloption[3] = "Maybe";

//Make poll public - 1 = yes, 0 = no
$pollpublic = "0";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO REPLY TO EXISTING THREAD - 1 = yes, 0 = no
$formreply = "0";

//EXISTING THREAD ID FOR FORM TO REPLY IN
$formreplythreadid = "12345";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE PMED (guests CANNOT use this option) - 1 = yes, 0 = no
$formpm = "0";

//USERNAME TO PM TO (separate multiple usernames with a ';')
$formpmname = "Abe";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE FORM TO BE EMAILED - 1 = yes, 0 = no
$formemail = "0";

//EMAIL ADDRESS TO EMAIL TO (separate multiple usernames with a ';')
$formemailaddress = "youremail@yourforums.com";

////////////////////////////////////////////////////////////////////////////////////////////////////

//ENABLE ATTACHMENTS - 1 = yes, 0 = no
//attachments can only be used if the form is going to make a new thread or post
$allow_attachments = "1";

////////////////////////////////////////////////////////////////////////////////////////////////////



////////////////////////////////////////////////////////////////////////////////////////////////////
//REDIRECT OPTIONS:
// 0 - thank you message (thread, reply, pm, or email)
// 1 - redirect to post (thread or reply)
// 2 - redirect to thread (thread only)
// 3 - redirect to forum (thread only)
// 4 - redirect to editpost (thread or reply)
//
// Feel free to change the thank you message if you choose option 0
////////////////////////////////////////////////////////////////////////////////////////////////////

$redirectoption = "0";

$errormessage = "Thank you for submitting this form!"; //This is the thank you message

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//FORCE USER TO ANSWER ALL QUESTIONS - 1 = yes, 0 = no
//If you added or deleted variables, you must edit what it checked for. Search for "$answerall ==" and edit 2 lines under it.
////////////////////////////////////////////////////////////////////////////////////////////////////

$answerall = "0";

////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF FORM (do not use quotation marks or you will get a parse error, besides the quotes around the whole title)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formtitle = "Generic Form";

////////////////////////////////////////////////////////////////////////////////////////////////////
//TITLE OF THREAD/POST/PM/EMAIL (do not use quotation marks in the title or you will get a parse error)
//You may use variables from the form for this.
////////////////////////////////////////////////////////////////////////////////////////////////////

$posttitle = "$formtitle";

////////////////////////////////////////////////////////////////////////////////////////////////////
//PURPOSE OF FORM (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$formpurpose = "REVIEW form is to allow you to submit a form, and this form will be made into a thread in a particular forum, or be PMed to a moderator or be emailed to a moderator.";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL INPUT BOX : QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$normalquestion1 = "What is the meaning to life?";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion1 = "Choose one of the following choices";

// The following choices must NOT have quotation marks
$radiochoice1a = "yes";
$radiochoice1b = "no";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 2 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion2 = "Choose another one of the following choices";

// The following choices must NOT have quotation marks
$radiochoice2a = "good";
$radiochoice2b = "bad";
$radiochoice2c = "both";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//RADIO BOX CHOICES : QUESTION 3 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$radioquestion3 = "Is it yes or no? If yes, please elaborate";

// The following choices must NOT have quotation marks
$radiochoice3a = "yes";
$radiochoice3b = "no";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
$question1 = "What is your name?";
$explain1 = "Please enter your real name here.";

//QUESTION 2 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
$question2 = "What is your email?";
$explain2 = "Please enter your real email here.";

//QUESTION 3 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
$question3 = "What is your website?";
$explain3 = "Please enter your URL here.";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//DROP DOWN CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$dropdownquestion1 = "What is your gender?";

// The following choices must NOT have quotation marks
$dropdownchoice1a = "no comment";
$dropdownchoice1b = "male";
$dropdownchoice1c = "female";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//CHECK BOX CHOICES : QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$checkboxquestion1 = "This shows how to use checkboxes.";

// The following choices must NOT have quotation marks
$checkboxchoice1_1 = "good";
$checkboxchoice1_2 = "bad";
$checkboxchoice1_3 = "both";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//LONG TEXT AREA INPUT: QUESTION 1 (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$longquestion1 = "Please write down a paragraph about yourself.";
$longexplain1 = "For example, a bit about your experience in this area.";

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
//VB TEXT AREA INPUT: You can only have ONE vb text question. (do not use quotation marks or you will get a parse error, besides the quotes around the whole text)
////////////////////////////////////////////////////////////////////////////////////////////////////

$vbtextquestion = "Please write down a paragraph about how you like this forum.";
$vbtextexplain = "For example, what makes this forum different from all other forums?";

////////////////////////////////////////////////////////////////////////////////////////////////
////// END OF CUSTOMIZATION ////////////////////////////////////////////////////////////////////
/////  DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU ARE DOING!!! ////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////


Msfantastico 04-05-2008 03:36 AM

HI I"M ALMOST THERE!!:p


Please tell me how I can have the user pick the form title...I want them to enter their own title in the field

What should I do?

Say they are posting a review about candy

thhey can type in their review in the feild like

review of candy

and that becomes the topic title

thanks


All times are GMT. The time now is 10:52 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.02582 seconds
  • Memory Usage 2,025KB
  • 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
  • (12)bbcode_code_printable
  • (16)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)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