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)

RedGTiVR6 02-17-2007 11:36 AM

I've used the search feature that's built into the AdminCP to search all templates.

I've searched for the following in all templates:

applyanswers
begin template
end template
<!-- BEGIN TEMPLATE: applyanswers -->
<!-- END TEMPLATE: applyanswers -->

Nothing comes up.

That's searching through all of the templates and all of the styles.

I was getting these lines even before I modified the hack. I installed it and immediately tested it.

thalamus 02-17-2007 01:34 PM

Quote:

Originally Posted by thalamus (Post 1183471)
I can't see anywhere the issue of these forms going into the moderation queue being resolved, or even a pointer as to why this happens when the forum and usergourp permissions have been set accordingly.

OK, I finally managed a workaround to this problem (if you can call it that)... basically, I copied the build_new_post function into a separate file (for instance, includes/functions_formhack.php) and renamed the function to build_newform_post. I then commented out the relevant forum permission settings to avoid the post going into the moderation queue, then in the formhack plugin, within the "if ($_REQUEST['action'] == "submit")" braces I included a "require_once" of the functions file. The call to build the new post then went to build_newform_post. Seems to work fine...

Kiint 02-18-2007 12:36 PM

Quote:

Originally Posted by RedGTiVR6 (Post 1184507)
I've used the search feature that's built into the AdminCP to search all templates.

I've searched for the following in all templates:

applyanswers
begin template
end template
<!-- BEGIN TEMPLATE: applyanswers -->
<!-- END TEMPLATE: applyanswers -->

Nothing comes up.

That's searching through all of the templates and all of the styles.

I was getting these lines even before I modified the hack. I installed it and immediately tested it.

I've found the solution, and if you are anything like me you are going to kick yourself....

Quote:

If you have the option "Add Template Name in HTML Comments" in the General Settings set to YES you get the template info in PM and emails:

<!-- BEGIN TEMPLATE: warn_pm_alert -->
Taken from this post https://vborg.vbsupport.ru/showthrea...TE#post1150078

Right, off to headbutt the wall a few times....

alternity 02-18-2007 03:06 PM

I cannot get a form I've created to show up. When I try to access it vB gives me the following error:
Code:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/www/web2/web/newthread.php(71) : eval()'d code on line 39
And says "Invalid Forum specified. If you followed a valid link, please notify the administrator".

I've looked over my code but I can't figure out what is wrong for the life of me. Any help would be extremely appreciated :).

EDIT: Found the error! I didn't put a comma after declaring one of my datatypes. I've corrected the code below to show that. However, now I have a different error message and still says the Invalid Forum specified error. The new error seems to be coming from the script part, which doesn't make sense because I haven't touched it at all. Here's the error:
Code:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/www/web2/web/newthread.php(71) : eval()'d code on line 278
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(
'radioanswer1' => TYPE_STR,
'radioanswer2' => TYPE_STR,
'radioanswer3' => TYPE_STR,
'radioanswer4' => TYPE_STR,
'radioanswer5' => TYPE_STR,
'radioanswer6' => TYPE_STR,
'radioanswer7' => TYPE_STR,
'radioanswer8' => TYPE_STR,
'answer1' => TYPE_STR,
'answer2' => TYPE_STR,
'answer3' => TYPE_STR,
'answer4' => TYPE_STR,
'answer5' => TYPE_STR,
'longanswer1' => TYPE_STR,
'longanswer2' => TYPE_STR,
'longanswer3' => TYPE_STR,
'longanswer4' => TYPE_STR,
'longanswer5' => TYPE_STR,
'longanswer6' => TYPE_STR
));

// Part 2
$radioanswer1 = $vbulletin->GPC['radioanswer1'];
$radioanswer2 = $vbulletin->GPC['radioanswer2'];
$radioanswer3 = $vbulletin->GPC['radioanswer3'];
$radioanswer4 = $vbulletin->GPC['radioanswer4'];
$radioanswer5 = $vbulletin->GPC['radioanswer5'];
$radioanswer6 = $vbulletin->GPC['radioanswer6'];
$radioanswer7 = $vbulletin->GPC['radioanswer7'];
$radioanswer8 = $vbulletin->GPC['radioanswer8'];
$answer1 = $vbulletin->GPC['answer1'];
$answer2 = $vbulletin->GPC['answer2'];
$answer3 = $vbulletin->GPC['answer3'];
$answer4 = $vbulletin->GPC['answer4'];
$answer5 = $vbulletin->GPC['answer5'];
$longanswer1 = $vbulletin->GPC['longanswer1'];
$longanswer2 = $vbulletin->GPC['longanswer2'];
$longanswer3 = $vbulletin->GPC['longanswer3'];
$longanswer4 = $vbulletin->GPC['longanswer4'];
$longanswer5 = $vbulletin->GPC['longanswer5'];
$longanswer6 = $vbulletin->GPC['longanswer6'];

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "memberappcss";
// Name of the answer template
$answertemplate = "memberappcssanswers";

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

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "24";

//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 = "0";

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



////////////////////////////////////////////////////////////////////////////////////////////////////
//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 = "2";

$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 = "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 = "Test";

////////////////////////////////////////////////////////////////////////////////////////////////////
//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 wish to join The Legion's Counter-Strike Source Division you will need to fill out this application as completely as possible.  Once you have finished this form you will be redirected to the post, where you will need to wait for your sponsor to post his approval, at which point you will be added to The Legion's member list!";

$question1 = "What is your screen name:";
$explain1 = "Please enter your screen name here.";

$question2 = "What is your real name:";
$explain2 = "Please enter your real name here, this is optional and you don't need to answer if you would prefer not to.";

$question3 = "Who was your recruiter/how did you find us:";
$explain3 = "Please enter the name of the person who recruited you here or if you found us someplace else please tell us where.";

$question4 = "What is your age:";
$explain4 = "Please specify your age.  The Legion does not discriminate in any way based on your age and if your uncomforable giving this information than you don't need to.";

$question5 = "What is your xFire screen name:";
$explain5 = "Please tell us your xFire screen name.  If you do not have xFire is is extremely advised that you get it, as The Legion uses xFire for clan communication and to help judge how active members are.";

$longquestion1 = "What clan experiance do you have:";
$longexplain1 = "Please tell us about what clan's you've been in, how long you were a member, what positions you held, etc.  Feel free to be as detailed as you want.";

$longquestion2 = "What gaming experiance do you have:";
$longexplain2 = "Please tell us what games you have played over the years and your experience in them, and also what games you are currently playing.";

$longquestion3 = "What leadership positions have you held:";
$longexplain3 = "Please tell us about any leadership positions you've had and what your responsibilities were.  This can be anywhere, in a clan, at school, in a club, at work, etc.";

$longquestion4 = "Why do you want to join The Legion:";
$longexplain4 = "Please tell us why you wish to join The Legion.";

$radioquestion1 = "What kind of gamer do you consider yourself to be:";

$radiochoice1a = "Occasional gamer, I game a few times each week.";
$radiochoice1b = "Weekend warrior, I'm too busy to play during the week.";
$radiochoice1c = "Fulltime gamer, I play every day as much as possible.";

$radioquestion2 = "What is your internet speed:";

$radiochoice2a = "Dialup";
$radiochoice2b = "DSL/Cable";
$radiochoice2c = "T1/ISDN or Faster";

//////////// Division Specific Questions //////////

$longquestion5 = "What hours are you available for game play:";
$longexplain5 = "Please tell us  during which hours of the week are you usually avaliable for gaming?";

$longquestion6 = "What is your preferred weapons combination:";
$longexplain6 = "Please tell us what weapons you prefer to use when playing Counter-Strike Source.";

$radioquestion3 = "You must have a Microphone. Do you currently have one?:";

$radiochoice3a = "yes";
$radiochoice3b = "no";

$radioquestion4 = "You must have X-Fire. Do you currently have it?:";

$radiochoice4a = "yes";
$radiochoice4b = "no";

$radioquestion5 = "You must have Ventrilo. Do you currently have it?:";

$radiochoice5a = "yes";
$radiochoice5b = "no";

$radioquestion6 = "Do you understand that you will be required to attend practices:";

$radiochoice6a = "yes";
$radiochoice6b = "no";

$radioquestion7 = "Are you aware that we have a Code of Conduct?:";

$radiochoice7a = "yes";
$radiochoice7b = "no";

$radioquestion8 = "Have you read our Code of Conduct and agreed to it?:";

$radiochoice8a = "yes";
$radiochoice8b = "no";

$vbtextquestion = "Is there anything else you'd like to add?:";
$vbtextexplain = "If you have any other information you would like us to know please tell us here.";

////////////////////////////////////////////////////////////////////////////////////////////////
////// END OF CUSTOMIZATION ////////////////////////////////////////////////////////////////////

....


blind-eddie 02-18-2007 05:45 PM

I see some of your problem, Find all instances of ?:";
get rid of :
That will stop some if not all errors.

EDIT: I also deleted all :....didnt work...Give me a min....



THis is line 278 $_REQUEST['action'] = "form";

It must say stay the same

Abe1 02-18-2007 07:01 PM

Quote:

Originally Posted by Kiint (Post 1183090)
Anyone have an answer to this problem?

Disable the option in your vb main settings not to show the template name.

mrgrimes 02-19-2007 09:42 AM

Quote:

Originally Posted by |oR|Greg (Post 1075473)
Important FYI - If you have "Guest Post Image Verification" turned on, posting to a thread will not work because the form hack doesn't integrate the Image Verification system.

This is proving a major pain for me. My forms need to be able to post to threads, but with 'Guest Post Image Verification' turned off I get ENORMOUS amounts of spam. Any suggestions as to how I could combat this?

blind-eddie 02-19-2007 01:21 PM

Yes, dont allow guest to post. Set usergroup setting for guest, not to be able to post. Make them register.

Silverstangs 02-19-2007 05:18 PM

Form installed and works fine... I'll be using it for Feedback uses.

RedGTiVR6 02-19-2007 10:54 PM

Quote:

Originally Posted by Kiint (Post 1185240)
I've found the solution...

SWEET! Thanks a million!

I didn't even know that was an option to set!

All fixed now!

Now I'm going to move on to making the 'New Thread' button in the forums where the forms will be posted, lead directly to the form, instead of a new thread.


All times are GMT. The time now is 09:11 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.01712 seconds
  • Memory Usage 1,809KB
  • 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
  • (3)bbcode_code_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