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 07-16-2008 03:05 AM

Quote:

Originally Posted by Deepdog009 (Post 1337121)
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
//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.
if ($dropdownanswer2 == "Title here")
        {
            
$formforumid "11";
        }
if (
$dropdownanswer2 == "Title here 1")
        {
            
$formforumid "5";
        }
if (
$dropdownanswer2 == "Title here 2")
        {
            
$formforumid "17";
        }
if (
$dropdownanswer2 == "Title here 3")
        {
            
$formforumid "9";
        }
if (
$dropdownanswer2 == "Title here 4")
        {
            
$formforumid "32";
        }

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

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


POSTING 2 FORUMS ??????????????????????????????????

Many ways, but this may help U

For some strange reason, this prevents the attachment feature from showing on the form.

Any ideas why that might happen?

BlueBulletRL 07-16-2008 03:07 AM

I'm having trouble making it work when I click new thread in my 2 forsale forums to the forum. I have put in the variables. I'm not sure if the form works yet because I can't get the form to link to when I hit new thread. Is this something I'm missing in the setup?

RedGTiVR6 07-16-2008 03:14 AM

this modification doesn't touch the new thread button. To do that, you need a separate modification.

Abe1 created a modification that would do this already. Just check his profile for that.

ccplim 07-16-2008 03:15 AM

Quote:

Originally Posted by BlueBulletRL (Post 1576487)
I'm having trouble making it work when I click new thread in my 2 forsale forums to the forum. I have put in the variables. I'm not sure if the form works yet because I can't get the form to link to when I hit new thread. Is this something I'm missing in the setup?

I believed this should help solve your problem :)

BlueBulletRL 07-16-2008 03:35 AM

Thank yoU!

Stryker412 07-16-2008 12:16 PM

Ok thanks for the tip about the templates, that was what I was missing. Now I want to add a question for the following.

Birthday (3 separate drop down boxes next to each other on the same line, can this be auto filled like the forum name?)

Edit: Ok I've added drop downs for State/Province but I've already used a-z & aa-zz so what can I use next? Can I just keep going aaa-zzz or should I switch to numbers?

How can I make sections separate on the form? I want to have a section for personal info, gaming, info, then a longanswer box for final comments.

I also tested the forum and filled in every question, yet when I go to preview it said I didn't answer all the questions.

RedGTiVR6 07-17-2008 08:15 PM

I'd keep using letters.

As for the answers, did you ad them to the answer template as well?

No ideas on the separate section other than perhaps creating multiple forms.

MoMan 07-18-2008 01:01 AM

I almost got everything to work on vBulletin 3.7.2, but there are two things that are bugging me which I'll have to get to work before using the form on my site:

1. Can the form have a field through which users can choose a custom thread title?
2. If the forum to which you try linking the form requires thread prefixes, no new threads can be posted through the form. How would I got about having the form automatically add a prefix, or select a prefix based on a radio button choice or dropdown?

RedGTiVR6 07-18-2008 02:03 AM

To get the form to have a thread title which is essentially a field, just change $posttitle = $whateveransweryouwant ($answer1 or $longanswer1 or $dropdownanswer1, etc.)

Same as above.

For instance, on our forum, the thread title is generated as the following:

$posttitle = "$dropdownanswer2 - $dropdownanswer1 - $answer2";

MoMan 07-18-2008 11:34 AM

Quote:

Originally Posted by RedGTiVR6 (Post 1578124)
To get the form to have a thread title which is essentially a field, just change $posttitle = $whateveransweryouwant ($answer1 or $longanswer1 or $dropdownanswer1, etc.)

Same as above.

For instance, on our forum, the thread title is generated as the following:

$posttitle = "$dropdownanswer2 - $dropdownanswer1 - $answer2";

Thanks a lot for the reply!

Do you also happen to know what the vBulletin variable for prefixes is?

RedGTiVR6 07-18-2008 01:01 PM

That I don't know, but you might try the programing discussions forum?

AsscBB 07-18-2008 04:28 PM

Is there a way to have the dropdown menu selections be a variable? I have a need for a variable length dropdown based on the results of a query so rather than using a drop down for static results like gender, I would like it to be able to return a variable length of options such as all of the members of a particular usergroup.

any ideas?

Thanks!

Stryker412 07-18-2008 04:31 PM

How do I do three drop downs side by side rather than under each other? I want one for Month, Day, year.

If I want the thread title to be the username of the applicant it would be $posttitle = $bbuserinfo ?

Also, is there anyway to have the submitted form posted in a section that the user cannot see? I want each application to be submitted to the admin section so we may comment/vote on each one.

Is it possible to only allow the person to submit an application once?

Lastly, is there a way to automatically reject an application (once it's filled out) if a certain variable is not met (such as age)?

Stryker412 07-20-2008 12:47 PM

bump, anyone?

Stryker412 07-21-2008 02:38 PM

Quote:

Originally Posted by RedGTiVR6 (Post 1577968)
I'd keep using letters.

As for the answers, did you ad them to the answer template as well?

No ideas on the separate section other than perhaps creating multiple forms.

This is how my formanswers looks:


Code:

$formtitle
$bbuserinfo[username]

$question1
$answer1

$question2
$answer2

$question3
$answer3

$question4
$answer4

$dropdownquestion1
$dropdownanswer1

$dropdownquestion2
$dropdownanswer2

$dropdownquestion3
$dropdownanswer3

$dropdownquestion4
$dropdownanswer4

-----------------------------------------------------
$longquestion1
$longanswer1
------------------------------------------------------


RedGTiVR6 07-21-2008 03:09 PM

1.) Make sure each answer is added to the plug-in in the top section.
2.) Make sure each answer is also listed as an option in the form template. (usually as such: <select name="dropdownanswer2">) - you MUST tell the system essentially this: What ever the users pics as their answer to the drop down, that becomes dropdownanswerx.
3.) Make sure each answer is listed in the form answer template.

If you have them listed in each, then you should see it showing up.

Stryker412 07-21-2008 03:36 PM

Quote:

Originally Posted by RedGTiVR6 (Post 1580651)
1.) Make sure each answer is added to the plug-in in the top section.
2.) Make sure each answer is also listed as an option in the form template. (usually as such: <select name="dropdownanswer2">) - you MUST tell the system essentially this: What ever the users pics as their answer to the drop down, that becomes dropdownanswerx.
3.) Make sure each answer is listed in the form answer template.

If you have them listed in each, then you should see it showing up.

I have the questions I'm not using commented out, could that be an issue?

Code:

// 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,
'dropdownanswer1' => TYPE_STR,
'dropdownanswer2' => TYPE_STR,
'dropdownanswer3' => TYPE_STR,
'dropdownanswer4' => TYPE_STR,
'answer3' => TYPE_STR,
'answer4' => 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'];
$dropdownanswer1 = $vbulletin->GPC['dropdownanswer1'];
$dropdownanswer2 = $vbulletin->GPC['dropdownanswer2'];
$dropdownanswer3 = $vbulletin->GPC['dropdownanswer3'];
$dropdownanswer4 = $vbulletin->GPC['dropdownanswer4'];
$answer3 = $vbulletin->GPC['answer3'];
$answer4 = $vbulletin->GPC['answer4'];
//$checkboxanswer1_1 = $vbulletin->GPC['checkboxanswer1_1'];
//$checkboxanswer1_2 = $vbulletin->GPC['checkboxanswer1_2'];
//$checkboxanswer1_3 = $vbulletin->GPC['checkboxanswer1_3'];
$longanswer1 = $vbulletin->GPC['longanswer1'];


RedGTiVR6 07-21-2008 03:46 PM

No, that wouldn't cause the problem.

In your form template, the call for the drop down should look something like this, does it?

Code:

<td class="alt1" valign="middle">
<b>$dropdownquestion2</b>:
</td>
<td class="alt1" valign="middle" colspan="2">
<select name="dropdownanswer2">
<option value="$dropdownchoice2a" <if condition="$dropdownchoice2a == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2a</option>
<option value="$dropdownchoice2b" <if condition="$dropdownchoice2b == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2b</option>
<option value="$dropdownchoice2c" <if condition="$dropdownchoice2c == $dropdownanswer2">selected="selected"</if>>$dropdownchoice2c</option>
</select></td>
</tr>


Stryker412 07-21-2008 04:07 PM

Mine:

Code:

<tr>
<td class="alt2" valign="middle">
<b>$dropdownquestion1</b>:
</td>
<td class="alt2" valign="middle" colspan="2">
<select name="dropdownanswer1">
<option value="$dropdownchoice1a" <if condition="$dropdownchoice1a == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1a</option>
<option value="$dropdownchoice1b" <if condition="$dropdownchoice1b == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1b</option>
</select></td>
</tr>


Stryker412 07-21-2008 04:20 PM

Quote:

Originally Posted by Stryker412 (Post 1580626)
This is how my formanswers looks:


Code:

$formtitle
$bbuserinfo[username]

$question1
$answer1

$question2
$answer2

$question3
$answer3

$question4
$answer4

$dropdownquestion1
$dropdownanswer1

$dropdownquestion2
$dropdownanswer2

$dropdownquestion3
$dropdownanswer3

$dropdownquestion4
$dropdownanswer4

-----------------------------------------------------
$longquestion1
$longanswer1
------------------------------------------------------


ok I think I found the issue. I forgot to edit the one section of the hack.

Code:

if ($answerall == "1")
    {
        if ($answer1 == '' OR $answer2 == '' OR $answer3 == '' OR $answer4 == '' OR $dropdownanswer1 == '' OR $dropdownanswer2 == '' OR $dropdownanswer3 == '' OR $dropdownanswer4 OR $longanswer1 == '')

I edited the line but am still getting the error that I have to answer all questions.

MoMan 07-21-2008 10:26 PM

Quote:

Originally Posted by MoMan (Post 1578361)
Thanks a lot for the reply!

Do you also happen to know what the vBulletin variable for prefixes is?

Quote:

Originally Posted by RedGTiVR6 (Post 1578403)
That I don't know, but you might try the programing discussions forum?

I've looked through the XML file and found a way for a radio option to assign a thread prefix. Here's the code I added, if anyone else is interested:

Find:

PHP Code:

$newpost['title'] =& $posttitle

Below Add:

PHP Code:

if ($radiochoice2a == $radioanswer2)
           { 
           
$newpost['prefixid'] = '7';
           } 

Modify the conditional to your needs, obviously, or add a second or third one, depending on how many prefixes you're using. You'll need to get the prefix IDs from the admin panel's prefix list page.

Stryker412 07-21-2008 11:24 PM

Ok I fixed it finally. I still need help on some questions.

1) How can I bold the questions once they're posted?
2) How can I set it so the title of each thread includes the applicant's forum name?
3) How do I add two more drop down boxes next to an existing question? Like I've said previously I want to do month, day, and year in a row.
4) Is there anyway to prevent a person from submitting a application more than once?

Deepdog009 07-22-2008 04:30 AM

Quote:

Originally Posted by RedGTiVR6 (Post 1576484)
For some strange reason, this prevents the attachment feature from showing on the form.

Any ideas why that might happen?


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

RedGTiVR6,,,
I'm currently looking into other options... I will post about it by wensday...

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


Quote:

Originally Posted by Stryker412 (Post 1580981)
Ok I fixed it finally. I still need help on some questions.

1) How can I bold the questions once they're posted?
2) How can I set it so the title of each thread includes the applicant's forum name?
3) How do I add two more drop down boxes next to an existing question? Like I've said previously I want to do month, day, and year in a row.
4) Is there anyway to prevent a person from submitting a application more than once?


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

Stryker412,,,

Posting bbcodes will solve Q1... This mod allows bbcode in both MAIN template & ANSWERS template...

MAIN template
HTML Code:

<tr>
<td class="alt1" valign="middle">
<b>Username</b>:<br />
Your Username.</td>
<td class="alt1" valign="middle" colspan="2">
<b>$bbuserinfo[username]</b></td>
</tr>
<tr>
<td class="alt2" valign="middle">
<b>$question1</b>:<br />
</td>

ANSWER template
HTML Code:

$bbuserinfo[username]

$question1 :eek:
$answer1

$question2 ;)
$answer2

$question3 :up:
$answer3

$question4 :D
$answer4

$dropdownquestion1
$dropdownanswer1

$dropdownquestion2
$dropdownanswer2

Q2 requires some minor code changes to $posttitle,,, take a look RedGTiVR6 recent postings......

Q3 ??? *** Download and install forms below to help you better with triple dropdowns......

Q4 ??? *** Prevent more than once submit? Members by userid,,, guests???:eek: ......

pipin 07-22-2008 06:59 AM

Quote:

Originally Posted by vissa (Post 1571409)
For some reason this will not work for GUESTS in 3.7.2 pl1. It submits the form fine, but the thread doesn't appear in the mod section. It works fine for all other members.

Update:
I had to turn off guest image verification in order for this to work for guests...

-vissa

same here, but it doesn't bother me, cause guests aren't allowed to post in the forum.


Strange thing is, that in 4.1 and the versions before the messagearea with the vb editor doesnt work at all, even in the standard template of this mod.

Stryker412 07-22-2008 09:41 AM

Quote:

Originally Posted by Deepdog009 (Post 1581127)
Q4 ??? *** Prevent more than once submit? Members by userid,,, guests???:eek: ......

Registered users only, I don't allow guests to use the form.

If I try to add bbcode to the answers form I get this:

The following error occurred when attempting to evaluate this template:

Quote:

Parse error: syntax error, unexpected '/', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /forum/includes/adminfunctions_template.php(3716) : eval()'d code on line 4

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.


Also, not sure if anyone knows but hitting the Reset button on the form does nothing.

Stryker412 07-22-2008 04:20 PM

Quote:

Originally Posted by Deepdog009 (Post 1581127)
Q3 ??? *** Download and install forms below to help you better with triple dropdowns...

I installed the triple dropdown product, but what do I do with it?

lazytown 07-23-2008 08:52 AM

Works pretty good in 3.7.2, however it's SPAMORAMA on my 2 forums... I will probably have to remove this if there is no spam protection option.

-vissa

Deepdog009 07-25-2008 05:34 AM

Quote:

Originally Posted by RedGTiVR6 (Post 1576484)
For some strange reason, this prevents the attachment feature from showing on the form.

Any ideas why that might happen?

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

Take a look at these links...>>>

Dropdown Forum posting {1}

Dropdown Forum posting {2} Reset forums posting time in admincp...

Dropdown Forum posting {3}

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

Quote:

Originally Posted by Stryker412 (Post 1581521)
I installed the triple dropdown product, but what do I do with it?

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

U wanted to use triple dropdowns for testing? Test in new forms...

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

Stryker412 07-25-2008 01:38 PM

Quote:

Originally Posted by Deepdog009 (Post 1583591)
*****************************************

U wanted to use triple dropdowns for testing? Test in new forms...

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

I'm not sure how to implement it into the form, is there a readme?

Also, is there a way to limit users (registered only) from using the form more than once in a set period of time?

RedGTiVR6 07-25-2008 02:16 PM

[QUOTE=Deepdog009;1583591]

It seems to be on the right track, but he never got it to work.

:(

Quote:

Dropdown Forum posting {2} Reset forums posting time in admincp...
Hrmm - close, but no cigar unfortunately. This guy is only adding code (unsuccessfully) to have the form post in two places upon submitting.

Unfortunately, this is essentially the same code that you provided just for a thread instead of a forum. Since I'm wanting to have a new thread created in a specific forum based on the drop-down that's selected, this doesn't really apply to my situation. Thanks though!

Your code seems to be there, it just doesn't allow attachments when it's in there for some strange reason. No clue why though? Maybe I need to take this to the developers forum to get another set of eyes on it?

karnevil 07-27-2008 01:48 PM

I seem to have done something stupid

anytime you hit POST TOPIC (new thread) on my forum now it brings up my form answers instead of opening the post a new thread page.

Quote:

Amethyst ______________________________________
Quote:

weekly ? : ____ monthly ? : ____ Who gets? : Comments :
______________________________________ ____ ______________________________________ ____ ______________________________________ ____ ______________________________________ ____ ______________________________________ ____ ______________________________________ ____ ____ ______________________________________ ____ ______________________________________ ____ ______________________________________ ______________________________________ ______________________________________ ______________________________________ ______________________________________ ______________________________________
ie the answers without format or any completion

The path is correct ''.............. forums/newthread.php?do=newthread&f=168 ''


I think when I was editing the formanswers template I accidentaly changed the title of formanswers to newthread, (I meant to search templates but was distracted grr), I changed it back straight away - but thats where things went wrong and I really cant work how to get back.

I now seem to have two formanswers template, one is the original and one is the one i have been working on.


Any ideas ? please please please

karnevil 07-27-2008 02:03 PM

okay sorry brain dead moment

I went and made a new newthread template - seems I have overwritten it with formanswers, so all fixed.....sorry for being a pleb.

btw - form is really great just a bit tedious to edit.

Stryker412 07-28-2008 11:39 AM

Can anyone help me with these issues so I can get this form ready, it's the only issues holding me back right now.

1) Need help with how to implement the Ajax triple dropdown menu on one line.
2) How to make the questions bold when they are posted in a thread.
3) How to put the user's forum ID or name in the thread title when posted.

RedGTiVR6 07-28-2008 12:00 PM

[QUOTE=Stryker412;1585889]Can anyone help me with these issues so I can get this form ready, it's the only issues holding me back right now.

Quote:

1) Need help with how to implement the Ajax triple dropdown menu on one line.
Post in that thread then, this thread has nothing to do with the AJAX add on.

Quote:

2) How to make the questions bold when they are posted in a thread.
That's beenc overed before in the thread here.

Go to your answer template and add in bb code where you want it, just like in a regular post on your forums. Just be sure to leave a space between the BB code and the code in your answer template.

Quote:

3) How to put the user's forum ID or name in the thread title when posted.
Also been covered numerous times in this thread. You might want to use the search in this thread feature in the future when you have questions about how to do something with a mod. It saves the developers and others from having to repeat themselves numerous times and it means that those with questions that haven't been answered actually might have their questions answered and seen....

Stryker412 07-28-2008 12:20 PM

Quote:

Originally Posted by RedGTiVR6 (Post 1585905)
Post in that thread then, this thread has nothing to do with the AJAX add on.

Actually I'm sure lots of people would like to ask user's for birthday so I'd say it's very relevant.

RedGTiVR6 07-28-2008 12:34 PM

You're asking for help with the AJAX mod, this isn't the AJAX thread.

They are two completely different developers.

Abe1 wrote the form hack, deepdpg009 wrote the ADD-ON for the form hack: https://vborg.vbsupport.ru/showthread.php?t=182144

AJAX functionality is NOT a normal part of this modification, it's an add on which was written by a different developer. If you have questions about AJAX functionality, you should ask it in the AJAX thread, NOT the general modification thread.

Stryker412 07-28-2008 12:39 PM

For the username in title I tried:

$posttitle = "$bbuserinfo[username]";

However I got nothing but errors, what is the proper code for that line?

RedGTiVR6 07-28-2008 12:49 PM

can you post the errors?

Stryker412 07-28-2008 12:51 PM

I don't get an error but the thread title looks like this if I have the code as:

$posttitle = "$formtitle - $bbuserinfo[username]";

Thread shows as Community Member Application -

No user name shows.

PHILLYFAN 07-28-2008 02:13 PM

ok I uploaded the XML file, how can I view the application I can't seem to find it


All times are GMT. The time now is 04:16 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.02416 seconds
  • Memory Usage 1,914KB
  • 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
  • (6)bbcode_code_printable
  • (2)bbcode_html_printable
  • (3)bbcode_php_printable
  • (26)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