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)

Deepdog009 04-11-2007 11:45 AM

Quote:

Originally Posted by rayw (Post 1224763)
I'm trying to modify this form a little bit so that I have a drop down box with a list of 2-3 forums that users can choose to post the information too. I'm not an experienced programmer so I'm having a little trouble getting this working.

Would anyone be willing to post exactly what needs to be modified for this to work correctly?

THanks! :)


Next goto MAIN Template and adddddddd that new dropdown there also...>>>
Use your own code or template code to add...
3 dropdowns below in code

HTML Code:

<TABLE width="100%"><TR>
  <TD class="radio_button_question question" colspan="4">
<B>* </B>
$dropdownquestion4
</TD>
</TR>
<TR><TD class="radio_button_answer" ><table cellspacing="0" cellpadding="0"><tr><td class="radio_button_answer">
<!--DROP_DOWN_TYPE --><select name="dropdownanswer4" class="radio_button">
<option value="$dropdownchoice4a" <if condition="$dropdownchoice4a == $dropdownanswer4">selected="selected"</if>>$dropdownchoice4a</option>
<option value="$dropdownchoice4b" <if condition="$dropdownchoice3b == $dropdownanswer4">selected="selected"</if>>$dropdownchoice4b</option>
<option value="$dropdownchoice4c" <if condition="$dropdownchoice4c == $dropdownanswer4">selected="selected"</if>>$dropdownchoice4c</option>
</SELECT>
</td></tr></table></TD></TR></TABLE>
<p></p>
<div align="center">
<tr>
<td class="alt2" valign="middle" colspan="3">
<b>$vbtextquestion</b><br />
$vbtextexplain
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
$messagearea
</td>
</tr>
</table>
</div>
</td>
</tr>
<if condition="$attachmentoption">
<tr>
<td class="alt1" colspan="3" align="center">
<div style="width:$stylevar[formwidth]" align="$stylevar[left]">$attachmentoption</div>
</td>
</tr>
</if>
<tr>
<td valign="top" colspan="3">
<p align="center">
<input type="submit" value="Submit" name="submit" style="font-family: Verdana; font-size: 10pt" class="button" />
<input type="submit" value="Preview" name="submit" style="font-family: Verdana; font-size: 10pt" class="button" />
<input type="reset" value="Reset" name="reset" style="font-family: Verdana; font-size: 10pt" class="button" />
</p></td></tr>
</table>

</form>

$footer
</body>
</html>


Deepdog009 04-11-2007 11:50 AM

Quote:

Originally Posted by rayw (Post 1224763)
I'm trying to modify this form a little bit so that I have a drop down box with a list of 2-3 forums that users can choose to post the information too. I'm not an experienced programmer so I'm having a little trouble getting this working.

Would anyone be willing to post exactly what needs to be modified for this to work correctly?

THanks! :)

Add to plugin code with NEW dropdown...
Add to proper location...
'dropdownanswer4' => TYPE_STR,
$dropdownanswer4 = $vbulletin->GPC['dropdownanswer4];


HTML Code:

// Part 1
$vbulletin->input->clean_array_gpc('p', array(
'answer1' => TYPE_STR,
'answer2' => TYPE_STR,
'radioanswer1' => TYPE_STR,
'radioanswer2' => TYPE_STR,
'radioanswer3' => TYPE_STR,
'radioanswer4' => TYPE_STR,
'radioanswer5' => TYPE_STR,
'radioanswer6' => TYPE_STR,
'radioanswer7' => TYPE_STR,
'dropdownanswer1' => TYPE_STR,
'dropdownanswer2' => TYPE_STR,
'answer3' => TYPE_STR,
'radioanswer8' => TYPE_STR,
'radioanswer9' => TYPE_STR,
'radioanswer10' => TYPE_STR,
'radioanswer11' => TYPE_STR,
'answer4' => TYPE_STR,
'dropdownanswer1' => TYPE_STR,
'answer5' => TYPE_STR,
'answer6' => TYPE_STR,
));

// Part 2
$answer1 = $vbulletin->GPC['answer1'];
$answer2 = $vbulletin->GPC['answer2'];
$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'];
$dropdownanswer1 = $vbulletin->GPC['dropdownanswer1'];
$dropdownanswer2 = $vbulletin->GPC['dropdownanswer2'];
$answer3 = $vbulletin->GPC['answer3'];
$radioanswer8 = $vbulletin->GPC['radioanswer8'];
$radioanswer9 = $vbulletin->GPC['radioanswer9'];
$radioanswer10 = $vbulletin->GPC['radioanswer10'];
$radioanswer11 = $vbulletin->GPC['radioanswer11'];
$answer4 = $vbulletin->GPC['answer4'];
$dropdownanswer3 = $vbulletin->GPC['dropdownanswer3'];
$answer5 = $vbulletin->GPC['answer5'];
$answer6 = $vbulletin->GPC['answer6'];


Lower Plugin code area...> questions...>

HTML Code:

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

$dropdownquestion4 = "Which forum to post to question here...<<<";

// The following choices must NOT have quotation marks
$dropdownchoice4a = "MLB";
$dropdownchoice4b = "NFL";
$dropdownchoice4c = "NBA";

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


Good Luck;)

rayw 04-11-2007 12:23 PM

Thanks a lot for taking the time to explain that Deepdog009, but I don't think it answers my question (if it does, then I don't understand it).

For example, say you wanted a form to post news in your forum. There are 3 different forums which represent the catergories the for news. They are Sport, Weather and Other - each of which are different forums.

Basically, depending on what you select in the drop down box will determine which forum the news is posted in to.

I hope that makes more sense.

:)

Deepdog009 04-12-2007 02:03 AM

RayW what you be asking requires some code modifications. Im good with CSS and HTML but at this time Im still reading and learning on PHP, Perl and Java.

ABE1 can help you better.

Take a peek in the earlier posts and maybe theres something there that might help U.

Good Luck

rayw 04-12-2007 05:26 AM

No worries, thanks a lot.

Cheers! :)

rayw 04-12-2007 07:29 AM

Ok, I've been trying to nut this out based on what others have posted in the thread.

Basically, I want a drop down box which defines what forum the news will be posted too.

I have the following:

Code:

//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 ($dropdownanswer1 == 'Hardware'){
$formforumid = "96";}
if ($dropdownanswer1 == 'Software'){
$formforumid = "99";}

Further down:
Code:

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

// The following choices must NOT have quotation marks

$newscatchoice1a = "Hardware";
$newscatchoice1b = "Software";

Template:
Code:

<select name="dropdownanswer1">
<option value="$newscatchoice1a" <if condition="$newscatchoice1a == $dropdownanswer1">selected="selected"</if>>$newscatchoice1a</option>
<option value="$newscatchoice1b" <if condition="$newscatchoice1b == $dropdownanswer1">selected="selected"</if>>$newscatchoice1b</option>
</select>

EDIT - THIS IS FIXED - SEE POST BELOW: When I submit the form using this, I get: Warning: Cannot use a scalar value as an array in /includes/functions_newpost.php on line 356

Could someone offer some advice. I'm assuming the problem lies in the above somewhere; maybe!! :confused:

THanks!

rayw 04-12-2007 07:35 AM

HEY!!!! I figured it out. I just noticed that <select name="dropdownforum1"> should be <select name="dropdownanswer1">.

I will post the finished product once I have fine tuned it. :)

EDIT: I've updated the code above so it should work fine now.

Deepdog009 04-12-2007 11:34 AM

U da Man RayW:up:

Yes please post your outcome when finished.

If statements seem easy until you place them. But eventually hard work and patience will prevail.

Cya :)

VHLinks 04-15-2007 06:55 AM

Hey guys, maybe I missed it, I also ran a search. Is there way to set this up so you can select a post icon, and not have it be blank when it posts the topic? I was trying to figure out a way to do it, but I kept breaking the code. Any ideas would be great. Thanks!

upnorth 04-16-2007 04:04 PM

I'm looking for some guidance in formatting the answer template so that I can control the way the finished post looks. Is there any way to use conditionals in the answer template?

For example I have

$question1
$checkboxAnswer1_1
$checkboxAnswer1_2
$checkboxAnswer1_3

If only the first checkbox is selected on the form then the $checkboxAnswer1_2 and $checkboxAnswer1_3 put spaces in the final post. I'd like to do something like

if ($checkboxAnswer1_2==""){
echo "";
}
That way I can eliminate the spaces?

Any ideas?


All times are GMT. The time now is 09:13 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.02161 seconds
  • Memory Usage 1,776KB
  • 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
  • (3)bbcode_html_printable
  • (2)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